builder-settings-types 0.0.331 → 0.0.335

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.
Files changed (37) hide show
  1. package/dist/Font.svg +3 -3
  2. package/dist/Opacity.svg +7 -7
  3. package/dist/Typography-Size.svg +3 -3
  4. package/dist/URL.svg +3 -3
  5. package/dist/Upload.svg +4 -4
  6. package/dist/Weight.svg +3 -3
  7. package/dist/align-centre.svg +4 -4
  8. package/dist/align-left.svg +4 -4
  9. package/dist/align-right.svg +4 -4
  10. package/dist/base/settings-group/settingsGroup.d.ts +0 -8
  11. package/dist/base/settings.d.ts +0 -12
  12. package/dist/border-size.svg +3 -3
  13. package/dist/builder-settings-types.cjs.js +82 -233
  14. package/dist/builder-settings-types.es.js +2769 -3979
  15. package/dist/chevron-down.svg +5 -5
  16. package/dist/colors.svg +3 -3
  17. package/dist/index.css +1 -1
  18. package/dist/index.d.ts +0 -2
  19. package/dist/margins-bottom.svg +3 -3
  20. package/dist/margins-left.svg +3 -3
  21. package/dist/margins-right.svg +3 -3
  22. package/dist/margins-top.svg +3 -3
  23. package/dist/radius.svg +3 -3
  24. package/dist/settings/gradient-settings/GradientSetting.d.ts +0 -17
  25. package/dist/settings/gradient-settings/components/EmbeddedColorPicker.d.ts +28 -28
  26. package/dist/settings/gradient-settings/utils/icon.d.ts +0 -3
  27. package/dist/settings/gradient-settings/utils/types.d.ts +0 -1
  28. package/dist/settings/multi-language-settings/multiLanguageSettings.d.ts +0 -6
  29. package/dist/settings/select-api/select-api.d.ts +0 -1
  30. package/dist/spacing-height.svg +3 -3
  31. package/dist/spacing-width.svg +3 -3
  32. package/dist/types/index.d.ts +2 -10
  33. package/package.json +1 -1
  34. package/dist/groups/image-setting-set/imageSettingSet.d.ts +0 -21
  35. package/dist/settings/image-map-settings/ImageMapSetting.d.ts +0 -76
  36. package/dist/settings/image-map-settings/index.d.ts +0 -2
  37. package/dist/settings/image-map-settings/types.d.ts +0 -19
@@ -1,31 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Vt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Ct=(d=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(d|=0));for(;d--;)t+=Vt[e[d]&63];return t};function Tt(d){let t=0,e=d.parentElement;for(;e;)e.classList.contains("setting-group")&&e!==d&&t++,e=e.parentElement;return t}function _(d,t){const e=Math.min(Math.max(t,0),5);d.setAttribute("data-nesting-level",e.toString()),e>0?d.style.setProperty("--visual-indent",`${e*2}px`):(d.style.removeProperty("--visual-indent"),d.style.marginLeft="")}function st(d,t=0){d.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach(i=>{const s=i,n=t+1;_(s,n),st(s,n)})}const Pt={maxLevel:5,spacingMultiplier:1,visualIndentMultiplier:2,enableAutoDetection:!0};class Ot{constructor(t={}){this.observedElements=new Set,this.config={...Pt,...t},this.config.enableAutoDetection&&this.setupAutoDetection()}setupAutoDetection(){this.observer=new MutationObserver(t=>{let e=!1;t.forEach(i=>{i.type==="childList"&&i.addedNodes.forEach(s=>{s instanceof HTMLElement&&(s.classList.contains("setting-group")?[s]:Array.from(s.querySelectorAll(".setting-group"))).length>0&&(e=!0)})}),e&&this.updateAllNesting()}),this.observer.observe(document.body,{childList:!0,subtree:!0})}trackElement(t){this.observedElements.add(t),this.updateElementNesting(t)}untrackElement(t){this.observedElements.delete(t)}updateElementNesting(t){const e=Tt(t);this.applyNestingWithConfig(t,e)}updateAllNesting(){this.observedElements.forEach(t=>{t.isConnected?this.updateElementNesting(t):this.observedElements.delete(t)})}applyNestingWithConfig(t,e){const i=Math.min(Math.max(e,0),this.config.maxLevel);if(t.setAttribute("data-nesting-level",i.toString()),i>0){const s=i*this.config.visualIndentMultiplier;t.style.setProperty("--visual-indent",`${s}px`)}else t.style.removeProperty("--visual-indent"),t.style.marginLeft=""}recalculateNesting(t=document.body){t.querySelectorAll(".setting-group").forEach(i=>{const s=i;this.updateElementNesting(s),this.trackElement(s)})}getNestingStats(){const t={};return this.observedElements.forEach(e=>{const i=parseInt(e.getAttribute("data-nesting-level")||"0",10);t[i]=(t[i]||0)+1}),t}destroy(){this.observer&&(this.observer.disconnect(),this.observer=void 0),this.observedElements.clear()}}const dt=new Ot;function Y(d){if(d===null||typeof d!="object")return d;if(d instanceof Date)return new Date(d.getTime());if(d instanceof Array)return d.map(t=>Y(t));if(typeof d=="object"){const t={};for(const e in d)Object.prototype.hasOwnProperty.call(d,e)&&(t[e]=Y(d[e]));return t}return d}function Ht(d){switch(d){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""}}const M=class M{constructor(t={}){this.props=t,this.dataPropsPath="",this.id=t.id||Ct(),this.value=this.props.default,this.desktop=this.props.default,this.title=t.title||"",this.includeGetJson=t.includeGetJson!==void 0?t.includeGetJson:!0}static SetUploadUrl(t){globalThis.DefaultUploadUrl=t,M.DefaultUploadUrl=t}static SetDefaultLanguage(t){globalThis.DefaultLanguage=t,M.DefaultLanguage=t}static CurrentLanguage(t){return t!==void 0&&(M.currentLanguage=t,M.currentLanguageExplicitlySet=!0,M.DefaultLanguage||M.SetDefaultLanguage(t),M.languageChangeCallbacks.forEach(e=>e(t))),M.currentLanguage||M.DefaultLanguage}static HasExplicitCurrentLanguage(){return M.currentLanguageExplicitlySet}static onLanguageChange(t){return M.languageChangeCallbacks.add(t),()=>{M.languageChangeCallbacks.delete(t)}}static SetGlobalVariables(t){M.GlobalVariables={...M.GlobalVariables,...t}}destroy(){throw new Error("Method not implemented.")}setOnChange(t){return this.onChange=t,this}setOnBlur(t){return this.onBlur=t,this}setDataPropsPath(t){this.dataPropsPath=t}getDataPropsPath(){return this.dataPropsPath}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=Y(this.props),i=new t(e);return i.value=Y(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 l=this.createIcon(t.icon,t.iconClassName);a.appendChild(l)}if(t.title){const l=this.createLabel(t.title,t.labelClassName);a.appendChild(l)}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||Ht(t.inputType)),s.type=t.inputType,s.placeholder=t.placeholder||"",s.className=t.inputClassName||"",this.dataPropsPath&&s.setAttribute("data-test-id",this.dataPropsPath);const n=a=>{const l=a.target;let r=l.value;switch(t.inputType){case"number":r=Number(l.value);break;case"color":r=l.value;break;case"date":r=l.value;break;case"select":r=l.value;break;case"text":r=l.value;break;case"button":r=l.value;break;default:r=l.value}this.value=r,this.onChange&&this.onChange(this.value),this.props.detectChange&&this.props.detectChange(this.value)},o=a=>{a.target,this.onBlur&&this.onBlur(this.value)};return s.addEventListener("input",n),s.addEventListener("change",n),s.addEventListener("blur",o),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}};M.currentLanguageExplicitlySet=!1,M.languageChangeCallbacks=new Set,M.GlobalVariables={primary:"#1B1958",secondary:"#0D0938",tertiary:"#2A1560",accent:"#189541","text-dark":"#00141E","text-light":"#FFFFFF"},M.GlobalVariableGroups=[{title:"Global Colors",keys:["primary","secondary","tertiary","accent"]},{title:"Text Color",keys:["text-dark","text-light"]}];let b=M;function $(d){return d instanceof b}function L(d){return d instanceof H}function nt(d){return $(d)||L(d)}const rt=(d,t,e)=>{let i=!1,s=0,n=0,o=0,a=0;const l=h=>{if(h.target.closest("button"))return;i=!0,s=h.clientX,n=h.clientY;const p=t.getBoundingClientRect();o=p.left,a=p.top,document.addEventListener("mousemove",r),document.addEventListener("mouseup",c),document.body.style.userSelect="none"},r=h=>{if(!i)return;const p=h.clientX-s,g=h.clientY-n,C=window.innerWidth,m=window.innerHeight,u=t.offsetWidth,f=t.offsetHeight;let v=o+p,y=a+g;v=Math.max(8,Math.min(C-u-8,v)),y=Math.max(8,Math.min(m-f-8,y)),t.style.left=`${v}px`,t.style.top=`${y}px`,e==null||e(v,y)},c=()=>{i=!1,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",c),document.body.style.userSelect=""};d.addEventListener("mousedown",l)},R=d=>{if(!d)return null;let t=d.trim();return!t.startsWith("#")||(t=t.slice(1),t.length===3&&(t=t.split("").map(e=>e+e).join("")),!/^[0-9a-fA-F]{6}$/.test(t))?null:`#${t.toUpperCase()}`},X=(d,t,e)=>`#${[d,t,e].map(i=>Math.max(0,Math.min(255,i)).toString(16).padStart(2,"0")).join("")}`,O=d=>{const t=d.replace("#",""),e=t.length===3?t.split("").map(i=>i+i).join(""):t;return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16)}},W=d=>{const{r:t,g:e,b:i}=O(d),s=t/255,n=e/255,o=i/255,a=Math.max(s,n,o),l=Math.min(s,n,o),r=a-l;let c=0;r!==0&&(a===s?c=(n-o)/r%6:a===n?c=(o-s)/r+2:c=(s-n)/r+4),c<0&&(c+=6);const h=a===0?0:r/a,p=a;return{h:c*60,s:h,v:p}},j=(d,t,e)=>{const i=(d%360+360)%360,s=e*t,n=s*(1-Math.abs(i/60%2-1)),o=e-s;let a=0,l=0,r=0;return i<60?(a=s,l=n,r=0):i<120?(a=n,l=s,r=0):i<180?(a=0,l=s,r=n):i<240?(a=0,l=n,r=s):i<300?(a=n,l=0,r=s):(a=s,l=0,r=n),X(Math.round((a+o)*255),Math.round((l+o)*255),Math.round((r+o)*255))},yt=(d,t,e)=>{const i=e*(1-t/2),s=i===0||i===1?0:(e-i)/Math.min(i,1-i);return{hue:d,sat:s,lightness:i}},ot=(d,t,e)=>{const i=(1-Math.abs(2*e-1))*t,s=i*(1-Math.abs(d/60%2-1)),n=e-i/2;let o=0,a=0,l=0;return d<60?(o=i,a=s,l=0):d<120?(o=s,a=i,l=0):d<180?(o=0,a=i,l=s):d<240?(o=0,a=s,l=i):d<300?(o=s,a=0,l=i):(o=i,a=0,l=s),{r:Math.round((o+n)*255),g:Math.round((a+n)*255),b:Math.round((l+n)*255)}},at=(d,t)=>{const e=Math.max(0,Math.min(100,t))/100;if(d.startsWith("#")){const{r:s,g:n,b:o}=O(d);return`rgba(${s}, ${n}, ${o}, ${e})`}if(d.startsWith("rgba("))return d.replace(/,\s*[\d.]+\)$/,`, ${e})`);if(d.startsWith("rgb("))return d.replace("rgb(","rgba(").replace(")",`, ${e})`);if(d.startsWith("hsl(")){const s=d.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(s){const{r:n,g:o,b:a}=ot(parseInt(s[1]),parseInt(s[2])/100,parseInt(s[3])/100);return`rgba(${n}, ${o}, ${a}, ${e})`}}if(d.startsWith("hsla(")){const s=d.match(/hsla\((\d+),\s*(\d+)%,\s*(\d+)%,\s*[\d.]+\)/);if(s){const{r:n,g:o,b:a}=ot(parseInt(s[1]),parseInt(s[2])/100,parseInt(s[3])/100);return`rgba(${n}, ${o}, ${a}, ${e})`}}const i=R(d);if(i){const{r:s,g:n,b:o}=O(i);return`rgba(${s}, ${n}, ${o}, ${e})`}return d},Bt=d=>["red","green","blue","yellow","orange","purple","pink","brown","black","white","gray","grey","cyan","magenta","lime","navy","maroon","olive","aqua","silver","teal","fuchsia","transparent"].includes(d.toLowerCase()),Et=d=>[/^#[0-9a-fA-F]{3,8}$/,/^rgba?\s*\([^)]+\)$/,/^hsla?\s*\([^)]+\)$/,/^[a-zA-Z]+$/].some(e=>e.test(d.trim())),$t=d=>{if(typeof document>"u")return Et(d)||!!R(d);const t=document.createElement("div");return t.style.color=d,t.style.color!==""},bt=d=>{const t=d.trim();if(/^#[0-9A-Fa-f]{8}$/.test(t)){const n=t.slice(1),o=parseInt(n.slice(0,2),16),a=parseInt(n.slice(2,4),16),l=parseInt(n.slice(4,6),16),r=parseInt(n.slice(6,8),16);return{color:X(o,a,l),position:0,opacity:Math.round(r/255*100)}}const e=t.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)/);if(e){const n=parseInt(e[1]),o=parseInt(e[2]),a=parseInt(e[3]),l=e[4]?parseFloat(e[4]):1;return{color:X(n,o,a),position:0,opacity:Math.round(l*100)}}const i=t.match(/hsla?\s*\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)/);if(i){const{r:n,g:o,b:a}=ot(parseFloat(i[1]),parseFloat(i[2])/100,parseFloat(i[3])/100),l=i[4]?parseFloat(i[4]):1;return{color:X(n,o,a),position:0,opacity:Math.round(l*100)}}return{color:R(t)||t,position:0,opacity:100}},pt=d=>{const t=[];let e="",i=0;for(let s=0;s<d.length;s++){const n=d[s];if(n==="(")i++;else if(n===")")i--;else if(n===","&&i===0){t.push(e.trim()),e="";continue}e+=n}return e.trim()&&t.push(e.trim()),t},ut=(d,t)=>{const e=new RegExp(`${t}\\s*\\(`,"i"),i=d.match(e);if(!i)return null;const s=i.index+i[0].length;let n=1,o=s;for(let a=s;a<d.length&&n>0;a++)d[a]==="("?n++:d[a]===")"&&n--,o=a;return n===0?d.substring(s,o):null},At=d=>{const t=d.split(" ")[0].toLowerCase();return["circle","ellipse","closest-side","closest-corner","farthest-side","farthest-corner","at","contain","cover"].includes(t)?!1:/^#[0-9a-f]{3,8}$/i.test(t)||/^rgb/i.test(d)||/^hsl/i.test(d)||Bt(t)},gt=d=>{const t=[];return d.forEach((e,i)=>{const s=e.trim();if(!s)return;let n="",o=0;const a=s.match(/^(.+?)\s+(\d+(?:\.\d+)?)%?\s*$/);a&&Et(a[1].trim())?(n=a[1].trim(),o=parseFloat(a[2])):(n=s,o=d.length===1?0:i/(d.length-1)*100);const l=bt(n);l.position=Math.max(0,Math.min(100,Math.round(o))),t.push(l)}),t},D=d=>{const t=d.stops&&d.stops.length?d.stops:[{color:"#000000",position:0,opacity:100}];return{type:d.type&&["linear","radial","solid"].includes(d.type)?d.type:"linear",angle:typeof d.angle=="number"?d.angle:90,stops:t.map((e,i)=>({color:e.color||"#000000",position:typeof e.position=="number"?e.position:t.length===1?0:Math.round(i/(t.length-1)*100),opacity:e.opacity===void 0||Number.isNaN(e.opacity)?100:e.opacity}))}},P=d=>{const t=d.replace(/;$/,"").trim();if($t(t)){const s=bt(t);return D({type:"solid",angle:0,stops:[s]})}const e=ut(t,"linear-gradient");if(e){const s=pt(e);let n=90,o=s;const a=s[0];if(a.includes("deg")){const r=a.match(/(-?\d+(?:\.\d+)?)deg/);r&&(n=parseFloat(r[1]),o=s.slice(1))}else a.includes("to ")&&(n={"to right":90,"to left":270,"to bottom":180,"to top":0,"to bottom right":135,"to bottom left":225,"to top right":45,"to top left":315}[a]??90,o=s.slice(1));const l=gt(o);return l.length?D({type:"linear",angle:n,stops:l}):null}const i=ut(t,"radial-gradient");if(i){const s=pt(i),n=s[0]&&!At(s[0])?s.slice(1):s,o=gt(n);return o.length?D({type:"radial",angle:0,stops:o}):null}return null},I=d=>{if(d.type==="solid"){const e=d.stops[0],i=e.color;if(i.startsWith("var(--"))return i;const s=e.opacity??100,n=i.replace("#",""),o=Math.round(s/100*255).toString(16).toUpperCase().padStart(2,"0");return`#${n}${o}`}const t=d.stops.map(e=>`${at(e.color,e.opacity??100)} ${e.position}%`).join(", ");return d.type==="radial"?`radial-gradient(circle, ${t})`:`linear-gradient(${d.angle}deg, ${t})`},Dt=d=>Math.round(d/100*255).toString(16).toUpperCase().padStart(2,"0"),K=d=>{if(d.type==="solid"){const t=d.stops[0];if(t){const e=t.color;if(e.startsWith("var(--"))return e.replace("var(--","").replace(")","").split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ");e.toUpperCase();const i=t.opacity??100;if(i===100)return e;{const s=Dt(i);return`${e}${s}`}}return"#000000"}return d.type==="linear"?`Linear ${d.angle}°`:"Radial Gradient"},J=class J{static defaults(){return{solid:[],gradient:[]}}static normalizeList(t){const e=new Set,i=[];return t.forEach(s=>{let n=R(s);n||P(s)&&(n=s),n&&(e.has(n)||(e.add(n),i.push(n)))}),i.slice(0,this.MAX_COLORS)}static ensureLoaded(){var t;if(!this.colors&&(this.colors=this.defaults(),!(typeof window>"u")))try{const e=(t=window.sessionStorage)==null?void 0:t.getItem(this.STORAGE_KEY);if(!e)return;const i=JSON.parse(e);if(Array.isArray(i))this.colors.solid=this.normalizeList(i);else if(i&&typeof i=="object"){const s=i;s.solid&&(this.colors.solid=this.normalizeList(s.solid)),s.gradient&&(this.colors.gradient=this.normalizeList(s.gradient))}}catch{this.colors=this.defaults()}}static persist(){var t;if(!(typeof window>"u"))try{(t=window.sessionStorage)==null||t.setItem(this.STORAGE_KEY,JSON.stringify(this.colors||this.defaults()))}catch{}}static list(t){return this.ensureLoaded(),this.colors||(this.colors=this.defaults()),this.colors[t]}static getColors(t){if(t==="all"){const e=this.list("solid"),i=this.list("gradient"),s=[],n=Math.max(e.length,i.length);for(let o=0;o<n;o++)o<e.length&&s.push(e[o]),o<i.length&&s.push(i[o]);return this.normalizeList(s)}return[...this.list(t)]}static addColor(t,e){if(!t)return;let i=R(t),s="solid";if(i)s="solid";else{const l=P(t);l&&(i=t,s=l.type==="solid"?"solid":"gradient")}if(!i)return;const n=e==="all"?s:e,o=this.list(n),a=o.indexOf(i);a!==-1&&o.splice(a,1),o.unshift(i),o.length>this.MAX_COLORS&&(o.length=this.MAX_COLORS),this.persist()}};J.STORAGE_KEY="settingsLib_recentColors",J.MAX_COLORS=12,J.colors=null;let z=J;const ct=(d,t)=>{const e=document.createElement("div");e.className="color-picker-recent-section";const i=document.createElement("div");i.className="color-picker-recent-title",i.textContent="Recently Used";const s=document.createElement("div");s.className="color-picker-tooltip",s.style.display="none",e.appendChild(s);const n=()=>{s.style.display="none"},o=(c,h)=>{const p=c.getBoundingClientRect();s.textContent=h,s.style.left=`${p.left+p.width/2}px`,s.style.top=`${p.bottom+8}px`,s.style.display="block"},a=document.createElement("div");a.className="color-picker-recent-grid";const l=document.createElement("div");l.className="color-picker-recent-placeholder",l.textContent="No recent colors yet",e.appendChild(i),e.appendChild(a),e.appendChild(l);const r=()=>{n(),a.innerHTML="";const c=z.getColors(t);if(c.length===0){a.style.display="none",l.style.display="block";return}a.style.display="grid",l.style.display="none",c.forEach(h=>{const p=document.createElement("button");p.type="button",p.className="color-picker-recent-swatch";const g=Ft(h);if(p.title=g,p.setAttribute("aria-label",`Use color: ${g}`),h.includes("gradient(")){p.style.backgroundImage=h,p.style.backgroundColor="transparent";const m=P(h);m&&m.stops&&m.stops.length>0&&(p.style.borderColor=m.stops[0].color)}else p.style.backgroundColor=h,p.style.borderColor=h;p.addEventListener("mouseenter",()=>o(p,g)),p.addEventListener("mouseleave",()=>{n(),p.style.boxShadow=""}),p.addEventListener("mousedown",()=>{p.style.boxShadow="0px 0px 0px 2px var(--grey40)"}),p.addEventListener("mouseup",()=>{setTimeout(()=>{p.style.boxShadow=""},150)}),p.addEventListener("click",()=>{n(),d(h)}),a.appendChild(p)})};return r(),{container:e,refresh:r}},Ft=d=>{const t=P(d);if(t)return K(t);const e=R(d);if(e){const i=O(e);return`${e} (RGB: ${i.r}, ${i.g}, ${i.b})`}return d},wt=`<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path fill-rule="evenodd" clip-rule="evenodd"
3
- d="M6.12347 4.96653L1.41158 0.254304C1.25449 0.102568 1.04409 0.0186071 0.825694 0.0205049C0.607302 0.0224037 0.398393 0.110007 0.24396 0.26445C0.0895282 0.418893 0.0019303 0.627818 3.24698e-05 0.846225C-0.00186536 1.06463 0.0820894 1.27505 0.233815 1.43215L4.9457 6.14438L0.233814 10.8566C0.0820886 11.0137 -0.00186625 11.2241 3.15434e-05 11.4425C0.00192934 11.6609 0.0895272 11.8699 0.243959 12.0243C0.398392 12.1787 0.607301 12.2663 0.825693 12.2682C1.04408 12.2701 1.25449 12.1862 1.41158 12.0344L6.12347 7.32222L10.8354 12.0344C10.9932 12.1824 11.2023 12.2632 11.4186 12.2597C11.6349 12.2562 11.8414 12.1687 11.9943 12.0156C12.1472 11.8626 12.2346 11.6561 12.2379 11.4398C12.2413 11.2234 12.1604 11.0143 12.0123 10.8566L7.30123 6.14438L12.0131 1.43215C12.0927 1.35531 12.1561 1.2634 12.1998 1.16177C12.2434 1.06014 12.2664 0.950833 12.2674 0.84023C12.2683 0.729626 12.2473 0.61994 12.2054 0.517568C12.1635 0.415196 12.1017 0.322191 12.0234 0.243979C11.9452 0.165768 11.8522 0.103916 11.7499 0.0620327C11.6475 0.0201492 11.5378 -0.000927989 11.4272 3.33052e-05C11.3166 0.000993646 11.2073 0.0239743 11.1057 0.0676297C11.0041 0.111286 10.9122 0.174745 10.8354 0.254305L6.12347 4.96653Z"
4
- fill="#919EAB"/>
5
- </svg>`,xt=`<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
6
- <path fill-rule="evenodd" clip-rule="evenodd" d="M19.1972 3.29156C18.936 3.03034 18.6259 2.82313 18.2847 2.68176C17.9434 2.54039 17.5777 2.46763 17.2083 2.46763C16.8389 2.46763 16.4731 2.54039 16.1319 2.68176C15.7906 2.82313 15.4805 3.03034 15.2194 3.29156L13.7822 4.72875C13.2585 4.4772 12.6697 4.39449 12.097 4.49207C11.5243 4.58964 10.9961 4.86267 10.5853 5.27343L9.91687 5.94281C9.74268 6.11693 9.6045 6.32366 9.51023 6.5512C9.41595 6.77873 9.36743 7.02261 9.36743 7.2689C9.36743 7.5152 9.41595 7.75907 9.51023 7.98661C9.6045 8.21414 9.74268 8.42088 9.91687 8.595L3.83625 14.6747C3.57512 14.936 3.36803 15.2462 3.2268 15.5875C3.08556 15.9288 3.01296 16.2947 3.01312 16.6641V18.3516C3.01312 18.6499 3.13165 18.9361 3.34263 19.1471C3.55361 19.358 3.83975 19.4766 4.13812 19.4766H5.82562C6.57129 19.4759 7.28618 19.1792 7.81312 18.6516L13.8937 12.5728C14.0679 12.747 14.2746 12.8852 14.5021 12.9795C14.7297 13.0737 14.9735 13.1223 15.2198 13.1223C15.4661 13.1223 15.71 13.0737 15.9375 12.9795C16.1651 12.8852 16.3718 12.747 16.5459 12.5728L17.2153 11.9025C17.6261 11.4917 17.8991 10.9635 17.9967 10.3908C18.0942 9.81811 18.0115 9.22926 17.76 8.70562L19.1972 7.26937C19.4584 7.0082 19.6656 6.69813 19.807 6.35687C19.9484 6.01561 20.0211 5.64985 20.0211 5.28047C20.0211 4.91108 19.9484 4.54532 19.807 4.20406C19.6656 3.8628 19.4584 3.55273 19.1972 3.29156ZM5.16281 16.0012L11.2425 9.92062L12.5681 11.2462L6.48844 17.3269C6.31266 17.5027 6.07424 17.6015 5.82562 17.6016H4.88812V16.6641C4.88818 16.4154 4.98698 16.177 5.16281 16.0012Z" fill="#353C47"/>
7
- </svg>`,Gt=`<svg width="15" height="17" viewBox="0 0 15 17" fill="none" xmlns="http://www.w3.org/2000/svg">
8
- <path d="M14.1333 12.4667H0.8M0.8 12.4667L4.13333 9.13332M0.8 12.4667L4.13333 15.8M0.8 4.13332H14.1333M14.1333 4.13332L10.8 0.799988M14.1333 4.13332L10.8 7.46665" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
9
- </svg>`,Rt=`<svg width="14" height="2" viewBox="0 0 14 2" fill="none" xmlns="http://www.w3.org/2000/svg">
10
- <path d="M0.8 0.800003H12.4667" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
11
- </svg>`,zt=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
12
- <rect x="21.25" y="21.333" width="18" height="18" rx="1" transform="rotate(-180 21.25 21.333)" stroke="#637381"/>
13
- <rect x="18.5835" y="18.667" width="12.6667" height="12.6667" rx="1" transform="rotate(-180 18.5835 18.667)" fill="#637381"/>
14
- </svg>
15
-
16
- `,Ut=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
17
- <path d="M4.5 21L19.5 21C19.8978 21 20.2794 20.842 20.5607 20.5607C20.842 20.2794 21 19.8978 21 19.5L21 4.5C21 4.10218 20.842 3.72065 20.5607 3.43934C20.2794 3.15804 19.8978 3 19.5 3L4.5 3C4.10218 3 3.72065 3.15804 3.43934 3.43934C3.15804 3.72064 3 4.10218 3 4.5L3 19.5C3 19.8978 3.15804 20.2794 3.43934 20.5607C3.72065 20.842 4.10218 21 4.5 21ZM7.5 4.5L7.5 7.5L10.5 7.5L10.5 4.5L13.5 4.5L13.5 7.5L16.5 7.5L16.5 10.5L13.5 10.5L13.5 13.5L16.5 13.5L16.5 16.5L13.5 16.5L13.5 19.5L10.5 19.5L10.5 16.5L7.5 16.5L7.5 19.5L4.5 19.5L4.5 4.5L7.5 4.5Z" fill="#637381"/>
18
- <path d="M13.5 16.5L10.5 16.5L10.5 13.5L13.5 13.5L13.5 16.5ZM13.5 10.5L10.5 10.5L10.5 7.5L13.5 7.5L13.5 10.5ZM10.5 13.5L7.5 13.5L7.5 10.5L10.5 10.5L10.5 13.5Z" fill="#637381"/>
19
- </svg>
20
-
21
- `,Wt=`<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
22
- <path d="M20.6106 19.5062C20.6887 19.5843 20.6887 19.711 20.6106 19.7891L19.7896 20.6101C19.7115 20.6882 19.5848 20.6882 19.5067 20.6101L5.98957 7.09298C5.91146 7.01488 5.91146 6.88825 5.98957 6.81014L6.81063 5.98908C6.88873 5.91097 7.01537 5.91097 7.09347 5.98908L20.6106 19.5062Z" fill="#46525C"/>
23
- <path d="M9.69583 12.2146C9.81298 12.3318 9.81298 12.5217 9.69583 12.6389L7.80151 14.5332C6.72071 15.614 6.6062 17.4365 7.80151 18.6318C8.99473 19.8267 10.8184 19.7123 11.8992 18.6318L13.7935 16.7366C13.9106 16.6194 14.1006 16.6194 14.2178 16.7366L14.816 17.3348C14.9331 17.4519 14.9332 17.6418 14.816 17.759L12.9216 19.6543C11.2241 21.3536 8.47364 21.3518 6.77417 19.6543C5.07483 17.9568 5.0749 15.2064 6.77417 13.5068L8.66848 11.6116C8.78563 11.4944 8.97562 11.4944 9.0928 11.6116L9.69583 12.2146ZM13.5085 6.77441C15.2061 5.07514 17.9565 5.07509 19.656 6.77441C21.3535 8.47388 21.3533 11.2243 19.656 12.9238L17.7607 14.8182C17.6436 14.9354 17.4536 14.9353 17.3365 14.8182L16.7344 14.2161C16.6172 14.0989 16.6172 13.9089 16.7344 13.7918L18.6296 11.8975C19.7101 10.8167 19.8245 8.99503 18.6296 7.7998C17.4363 6.60449 15.6118 6.719 14.531 7.7998L12.6367 9.69412C12.5195 9.81128 12.3296 9.81128 12.2124 9.69412L11.6123 9.09402C11.4952 8.97684 11.4952 8.78685 11.6124 8.6697L13.5085 6.77441Z" fill="#46525C"/>
24
- </svg>
25
- `;class mt{constructor(t,e="gradient"){this.isOpen=!1,this.currentColor="#FF0000",this.currentOpacity=100,this.outsideClick=i=>{if(!this.isOpen)return;const s=i.target;if(this.element.contains(s))return;if(this.backdrop.contains(s)){i.preventDefault(),i.stopPropagation(),this.close(!0);return}const n=document.querySelectorAll(".gstop-color-input, .gstop-color-preview, .gradient-mini-preview");if(Array.from(n).some(l=>l.contains(s)))return;const a=document.querySelector(".gradient-popover");a&&a.contains(s)||(i.preventDefault(),i.stopPropagation(),this.close(!0))},this.keyDown=i=>{if(this.isOpen){if(i.key==="Escape")i.preventDefault(),this.close(!0);else if(i.key==="Enter"){const s=i.target;if(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"))return;i.preventDefault(),this.close(!0)}}},this.onChange=t,this.recentScope=e,this.element=this.build(),this.backdrop=this.createBackdrop()}parsePercentage(t){const e=parseFloat(t);return isNaN(e)?0:e/100}build(){const t=document.createElement("div");t.className="custom-color-picker",t.style.display="none";const e=document.createElement("div");e.className="color-picker-header",e.style.cursor="move";const i=document.createElement("span");i.textContent="Color";const s=document.createElement("button");s.className="color-picker-close",s.innerHTML=wt,s.addEventListener("click",()=>this.close(!0)),e.appendChild(i),e.appendChild(s),rt(e,t);const n=document.createElement("div");n.className="color-picker-area",this.colorArea=n;const o=document.createElement("div");o.className="color-picker-marker",this.colorMarker=o,n.appendChild(o);const a=document.createElement("div");a.className="color-picker-sliders-container";const l=document.createElement("button");l.className="color-picker-eyedropper",l.type="button",l.innerHTML=xt;const r=document.createElement("div");r.className="color-picker-sliders-group";const c=document.createElement("div");c.className="color-picker-hue",this.hueSlider=c;const h=document.createElement("div");h.className="color-picker-hue-marker",this.hueMarker=h,c.appendChild(h);const p=document.createElement("div");p.className="color-picker-opacity",this.opacitySlider=p;const g=document.createElement("div");g.className="color-picker-opacity-marker",this.opacityMarker=g,p.appendChild(g),r.appendChild(c),r.appendChild(p),a.appendChild(l),a.appendChild(r);const C=ct(E=>{var w;this.setColor(E),(w=this.onChange)==null||w.call(this,E,this.currentOpacity)},this.recentScope);this.recentSectionRefresh=C.refresh;const m=document.createElement("div");m.className="color-picker-format-section";const u=document.createElement("select");u.className="color-picker-format-select",this.select=u;const f=document.createElement("option");f.value="hex",f.textContent="HEX";const v=document.createElement("option");v.value="rgb",v.textContent="RGB";const y=document.createElement("option");y.value="hsl",y.textContent="HSL",u.appendChild(f),u.appendChild(v),u.appendChild(y);const x=document.createElement("input");x.type="text",x.className="color-picker-color-input",x.value=this.currentColor,this.input=x;const k=document.createElement("div");k.className="color-picker-input-container";const N=document.createElement("button");return N.className="color-picker-copy-inside",N.textContent="Copy",k.appendChild(x),k.appendChild(N),m.appendChild(u),m.appendChild(k),t.appendChild(e),t.appendChild(n),t.appendChild(a),t.appendChild(C.container),t.appendChild(m),t.addEventListener("click",E=>E.stopPropagation()),this.bind(n,c,p,x,u,N,l),t}createBackdrop(){const t=document.createElement("div");return t.className="color-picker-backdrop",t.style.display="none",t.style.pointerEvents="none",t}bind(t,e,i,s,n,o,a){const l=h=>{var v;const p=t.getBoundingClientRect(),g=Math.max(0,Math.min(1,(h.clientX-p.left)/p.width)),C=Math.max(0,Math.min(1,(h.clientY-p.top)/p.height));this.colorMarker.style.left=`${g*100}%`,this.colorMarker.style.top=`${C*100}%`;const u=this.parsePercentage(this.hueMarker.style.left||"0%")*360,f=j(u,g,1-C);this.currentColor=f,this.syncInput(),this.updateOpacityBg(),(v=this.onChange)==null||v.call(this,f,this.currentOpacity)},r=h=>{var v;const p=e.getBoundingClientRect();let g=Math.max(0,Math.min(1,(h.clientX-p.left)/p.width));this.hueMarker.style.left=`${g*100}%`;const C=g*360,m=this.parsePercentage(this.colorMarker.style.left||"0%"),u=this.parsePercentage(this.colorMarker.style.top||"0%"),f=j(C,m,1-u);this.currentColor=f,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${C}, 100%, 50%))`,this.syncInput(),this.updateOpacityBg(),(v=this.onChange)==null||v.call(this,f,this.currentOpacity)},c=h=>{var C;const p=i.getBoundingClientRect(),g=Math.max(0,Math.min(1,(h.clientX-p.left)/p.width));this.opacityMarker.style.left=`${g*100}%`,this.currentOpacity=Math.round(g*100),(C=this.onChange)==null||C.call(this,this.currentColor,this.currentOpacity)};t.addEventListener("mousedown",h=>{h.preventDefault(),l(h);const p=C=>l(C),g=()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",g)};document.addEventListener("mousemove",p),document.addEventListener("mouseup",g)}),e.addEventListener("mousedown",h=>{h.preventDefault(),r(h);const p=C=>r(C),g=()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",g)};document.addEventListener("mousemove",p),document.addEventListener("mouseup",g)}),i.addEventListener("mousedown",h=>{h.preventDefault(),c(h);const p=C=>c(C),g=()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",g)};document.addEventListener("mousemove",p),document.addEventListener("mouseup",g)}),n.addEventListener("change",()=>this.syncInput()),s.addEventListener("input",()=>this.applyFromInput()),s.addEventListener("blur",()=>this.syncInput()),s.addEventListener("keydown",h=>{h.key==="Enter"&&(h.preventDefault(),this.syncInput(),s.blur())}),o.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(s.value)}catch{s.select(),document.execCommand("copy")}}),a.addEventListener("click",async()=>{var h;if(!("EyeDropper"in window)){alert("EyeDropper API is not supported in this browser.");return}try{const p=new window.EyeDropper,{sRGBHex:g}=await p.open();this.setColor(g),(h=this.onChange)==null||h.call(this,g,this.currentOpacity)}catch{}}),document.addEventListener("keydown",this.keyDown,!0),setTimeout(()=>document.addEventListener("click",this.outsideClick,!0),0)}setColor(t){var o;this.currentColor=t;const{h:e,s:i,v:s}=W(t),n=e>=360?e%360:e;this.hueMarker.style.left=`${n/360*100}%`,this.colorMarker.style.left=`${i*100}%`,this.colorMarker.style.top=`${(1-s)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${n}, 100%, 50%))`,this.syncInput(),this.updateOpacityBg(),(o=this.onChange)==null||o.call(this,t,this.currentOpacity)}syncInput(){const t=this.select.value,{h:e,s:i,v:s}=W(this.currentColor);if(t==="hex")this.input.value=this.currentColor;else if(t==="rgb"){const{r:n,g:o,b:a}=O(this.currentColor);this.input.value=`rgb(${n}, ${o}, ${a})`}else{const{hue:n,sat:o,lightness:a}=yt(e,i,s);this.input.value=`hsl(${Math.round(n)}, ${Math.round(o*100)}%, ${Math.round(a*100)}%)`}}applyFromInput(){const t=this.input.value.trim();let e="";if(/^#[0-9A-Fa-f]{6}$/.test(t))e=t;else{const i=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(i){const s=parseInt(i[1]),n=parseInt(i[2]),o=parseInt(i[3]);s<=255&&n<=255&&o<=255&&(e=`#${[s,n,o].map(a=>a.toString(16).padStart(2,"0")).join("")}`)}else{const s=t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(s){const n=parseInt(s[1]),o=parseInt(s[2])/100,a=parseInt(s[3])/100,l=a+o*Math.min(a,1-a),r=l===0?0:2*(1-a/l);e=j(n,r,l)}}}e&&this.setColor(e)}updateOpacityBg(){const{r:t,g:e,b:i}=O(this.currentColor);this.opacitySlider.style.setProperty("--base-color",`rgb(${t}, ${e}, ${i})`)}open(t,e,i){var y;this.currentColor=t,this.currentOpacity=i??100,this.syncInput();const{h:s,s:n,v:o}=W(t);this.hueMarker.style.left=`${s/360*100}%`,this.colorMarker.style.left=`${n*100}%`,this.colorMarker.style.top=`${(1-o)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${s}, 100%, 50%))`,this.updateOpacityBg(),this.opacityMarker.style.left=`${this.currentOpacity}%`,(y=this.recentSectionRefresh)==null||y.call(this),this.isOpen=!0,this.backdrop.style.display="block",this.backdrop.parentElement||document.body.appendChild(this.backdrop),this.element.style.display="block",this.element.style.position="fixed",this.element.style.zIndex="10002",this.element.style.left="-9999px",this.element.style.top="0px",this.element.parentElement||document.body.appendChild(this.element);const a=this.element.offsetWidth,l=this.element.offsetHeight,r=e.getBoundingClientRect(),c=window.innerWidth,h=window.innerHeight,p=16;let g=r.right+8,C=r.top;const m=c-r.right,u=r.left;m>=a+p?g=r.right+8:u>=a+p?g=r.left-a-8:g=Math.max(p,(c-a)/2);const f=h-r.bottom,v=r.top;f>=l+p?C=r.bottom+8:v>=l+p?C=r.top-l-8:f>v?(C=r.bottom+8,C+l>h-p&&(C=h-l-p)):(C=r.top-l-8,C<p&&(C=p)),this.element.style.left=`${g}px`,this.element.style.top=`${C}px`}close(t){var e;this.isOpen&&(this.isOpen=!1,this.backdrop.style.display="none",this.element.style.display="none",document.removeEventListener("click",this.outsideClick,!0),document.removeEventListener("keydown",this.keyDown,!0),t&&this.onChange&&this.recentScope==="solid"&&(z.addColor(this.currentColor,this.recentScope),(e=this.recentSectionRefresh)==null||e.call(this)))}getElement(){return this.element}}class jt{constructor(t){this.isDragging=!1,this.currentColor="#FFFFFF",this.currentColor=this.sanitizeColor(t.initialColor),this.currentOpacity=this.clampOpacity(t.initialOpacity),this.onColorChange=t.onColorChange,this.recentScope=t.scope??"solid",this.element=this.build(),this.initFromColor(this.currentColor,this.currentOpacity)}parsePercentage(t){const e=parseFloat(t);return isNaN(e)?0:e/100}sanitizeColor(t){const e=this.currentColor||"#FFFFFF";return R(t)??e}clampOpacity(t){return Number.isFinite(t)?Math.min(100,Math.max(0,Math.round(t))):100}build(){const t=document.createElement("div");t.className="embedded-color-picker";const e=document.createElement("div");e.className="color-picker-area embedded",this.colorArea=e;const i=document.createElement("div");i.className="color-picker-marker",this.colorMarker=i,e.appendChild(i);const s=document.createElement("div");s.className="color-picker-sliders-container embedded";const n=document.createElement("button");n.className="color-picker-eyedropper",n.type="button",n.innerHTML=xt;const o=document.createElement("div");o.className="color-picker-sliders-group";const a=document.createElement("div");a.className="color-picker-hue embedded",this.hueSlider=a;const l=document.createElement("div");l.className="color-picker-hue-marker",this.hueMarker=l,a.appendChild(l);const r=document.createElement("div");r.className="color-picker-opacity embedded",this.opacitySlider=r;const c=document.createElement("div");c.className="color-picker-opacity-marker",this.opacityMarker=c,r.appendChild(c),o.appendChild(a),o.appendChild(r),s.appendChild(n),s.appendChild(o);const h=ct(x=>{const k=P(x);k&&k.type!=="solid"?this.onColorChange(x,this.currentOpacity):(this.setColor(x),this.onColorChange(this.currentColor,this.currentOpacity))},"all");this.recentSectionRefresh=h.refresh;const p=document.createElement("div");p.className="color-picker-format-section embedded";const g=document.createElement("select");g.className="color-picker-format-select",this.select=g;const C=document.createElement("option");C.value="hex",C.textContent="HEX";const m=document.createElement("option");m.value="rgb",m.textContent="RGB";const u=document.createElement("option");u.value="hsl",u.textContent="HSL",g.appendChild(C),g.appendChild(m),g.appendChild(u);const f=document.createElement("input");f.type="text",f.className="color-picker-color-input",this.input=f;const v=document.createElement("div");v.className="color-picker-input-container";const y=document.createElement("button");return y.className="color-picker-copy-inside",y.textContent="Copy",v.appendChild(f),v.appendChild(y),p.appendChild(g),p.appendChild(v),t.appendChild(e),t.appendChild(s),t.appendChild(p),t.appendChild(h.container),this.bind(e,a,r,f,g,y,n),t}bind(t,e,i,s,n,o,a){const l=(p,g)=>{const C=g||t.getBoundingClientRect(),m=Math.max(0,Math.min(1,(p.clientX-C.left)/C.width)),u=Math.max(0,Math.min(1,(p.clientY-C.top)/C.height));this.colorMarker.style.left=`${m*100}%`,this.colorMarker.style.top=`${u*100}%`;const v=this.parsePercentage(this.hueMarker.style.left||"0%")*360,y=j(v,m,1-u);this.currentColor=y,this.syncInput(),this.updateOpacityBg(),this.queueChange()},r=(p,g)=>{const C=g||e.getBoundingClientRect(),m=Math.max(0,Math.min(1,(p.clientX-C.left)/C.width));this.hueMarker.style.left=`${m*100}%`;const u=m*360,f=this.parsePercentage(this.colorMarker.style.left||"0%"),v=this.parsePercentage(this.colorMarker.style.top||"0%"),y=j(u,f,1-v);this.currentColor=y,this.colorArea.style.background=`linear-gradient(to top, #000, transparent),
26
- linear-gradient(to right, #fff, hsl(${u}, 100%, 50%))`,this.syncInput(),this.updateOpacityBg(),this.queueChange()},c=(p,g)=>{const C=g||i.getBoundingClientRect(),m=Math.max(0,Math.min(1,(p.clientX-C.left)/C.width));this.opacityMarker.style.left=`${m*100}%`,this.currentOpacity=this.clampOpacity(m*100),this.queueChange()},h=(p,g,C)=>{p.preventDefault(),this.isDragging=!0,this.cachedRect=C.getBoundingClientRect(),g(p,this.cachedRect);let m=null,u;const f=()=>{this.dragRafId===void 0&&(this.dragRafId=window.requestAnimationFrame(()=>{this.dragRafId=void 0,m&&this.cachedRect&&g(m,this.cachedRect)}))},v=()=>{this.isDragging&&(this.isDragging=!1,this.dragRafId!==void 0&&(cancelAnimationFrame(this.dragRafId),this.dragRafId=void 0),this.cachedRect=void 0,m=null,this.flushChange(),document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",v),window.removeEventListener("blur",v),this.applyPendingExternal())};u=y=>{if(!y.buttons){v();return}m=y,f()},document.addEventListener("mousemove",u),document.addEventListener("mouseup",v),window.addEventListener("blur",v)};t.addEventListener("mousedown",p=>{h(p,l,t)}),e.addEventListener("mousedown",p=>{h(p,r,e)}),i.addEventListener("mousedown",p=>{h(p,c,i)}),n.addEventListener("change",()=>{this.syncInput()}),s.addEventListener("input",()=>{this.applyFromInput()}),s.addEventListener("blur",()=>{this.syncInput()}),s.addEventListener("keydown",p=>{p.key==="Enter"&&(p.preventDefault(),this.syncInput(),s.blur())}),o.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(s.value)}catch{s.select(),document.execCommand("copy")}}),a.addEventListener("click",async()=>{if(!("EyeDropper"in window)){alert("EyeDropper API is not supported in this browser.");return}try{const p=new window.EyeDropper,{sRGBHex:g}=await p.open();this.setColor(g),this.onColorChange(this.currentColor,this.currentOpacity)}catch{}})}setColor(t){const e=this.sanitizeColor(t);this.currentColor=e;const{h:i,s,v:n}=W(e),o=i>=360?i%360:i;this.hueMarker.style.left=`${o/360*100}%`,this.colorMarker.style.left=`${s*100}%`,this.colorMarker.style.top=`${(1-n)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent),
27
- linear-gradient(to right, #fff, hsl(${o}, 100%, 50%))`,this.syncInput(),this.updateOpacityBg()}syncInput(){const t=this.select.value,{h:e,s:i,v:s}=W(this.currentColor);if(t==="hex")this.input.value=this.currentColor;else if(t==="rgb"){const{r:n,g:o,b:a}=O(this.currentColor);this.input.value=`rgb(${n}, ${o}, ${a})`}else{const{hue:n,sat:o,lightness:a}=yt(e,i,s);this.input.value=`hsl(${Math.round(n)}, ${Math.round(o*100)}%, ${Math.round(a*100)}%)`}}applyFromInput(){const t=this.input.value.trim();let e="";if(/^#[0-9A-Fa-f]{6}$/.test(t))e=t;else{const i=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(i){const s=parseInt(i[1],10),n=parseInt(i[2],10),o=parseInt(i[3],10);s<=255&&n<=255&&o<=255&&(e="#"+[s,n,o].map(a=>a.toString(16).padStart(2,"0")).join(""))}else{const s=t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(s){const n=parseInt(s[1],10),o=parseInt(s[2],10)/100,a=parseInt(s[3],10)/100,l=a+o*Math.min(a,1-a),r=l===0?0:2*(1-a/l);e=j(n,r,l)}}}e&&(this.setColor(e),this.onColorChange(this.currentColor,this.currentOpacity))}updateOpacityBg(){const{r:t,g:e,b:i}=O(this.currentColor);this.opacitySlider.style.setProperty("--base-color",`rgb(${t}, ${e}, ${i})`)}queueChange(){this.changeRafId===void 0&&(this.changeRafId=window.requestAnimationFrame(()=>{this.changeRafId=void 0,this.onColorChange(this.currentColor,this.currentOpacity)}))}flushChange(){this.changeRafId!==void 0&&(cancelAnimationFrame(this.changeRafId),this.changeRafId=void 0),this.onColorChange(this.currentColor,this.currentOpacity)}applyPendingExternal(){if(!this.pendingExternalUpdate)return;const{color:t,opacity:e}=this.pendingExternalUpdate;this.pendingExternalUpdate=void 0,this.initFromColor(t,e)}initFromColor(t,e){var l;const i=this.sanitizeColor(t);this.currentColor=i,this.currentOpacity=this.clampOpacity(e);const{h:s,s:n,v:o}=W(i),a=s>=360?s%360:s;this.hueMarker.style.left=`${a/360*100}%`,this.colorMarker.style.left=`${n*100}%`,this.colorMarker.style.top=`${(1-o)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent),
28
- linear-gradient(to right, #fff, hsl(${a}, 100%, 50%))`,this.opacityMarker.style.left=`${this.currentOpacity}%`,this.updateOpacityBg(),this.syncInput(),(l=this.recentSectionRefresh)==null||l.call(this)}commitRecentColor(){var t;this.recentScope==="solid"&&(z.addColor(this.currentColor,this.recentScope),(t=this.recentSectionRefresh)==null||t.call(this))}getElement(){return this.element}updateColor(t,e){if(this.isDragging){this.pendingExternalUpdate={color:t,opacity:e};return}this.initFromColor(t,e)}}const T=class T extends b{constructor(t={}){const e=typeof t.default=="string"?void 0:t.default;super({...t,title:t.title||"Color",default:e}),this.inputType={type:"text",angle:"number",stops:"text"},this.element=null,this.previewEl=null,this.inputEl=void 0,this.popoverEl=null,this.backdropEl=null,this.isPopoverOpen=!1,this.isEditing=!1,this.popoverPosition=null,this.previewUpdateTimeout=null,this.changeDebounceTimeout=null,this.solidPicker=null,this.pendingSolidColor=null,this.variant="default",this.globalLayoutMode="list",this.globalSearchQuery="",this.currentMode="custom",this.linkedGlobalVariable=null,this.unlinkButton=null,this.onBackgroundClick=i=>{var p;if(!this.popoverEl||!this.isPopoverOpen)return;const s=i.target,n=this.popoverEl.contains(s),o=(p=this.element)==null?void 0:p.contains(s),a=document.querySelectorAll(".custom-color-picker"),l=Array.from(a).some(g=>g.contains(s)),r=s.closest(".gstop-color-input, .gradient-mini-preview, .gstop-color-preview"),c=s.classList.contains("color-picker-backdrop"),h=s.classList.contains("gradient-popover-backdrop");!n&&!o&&!l&&!r&&!c&&!h&&this.closePopover()},this.handlePopoverKeydown=i=>{if(this.isPopoverOpen){if(i.key==="Escape"){i.preventDefault(),this.closePopover();return}if(i.key==="Enter"){const s=i.target;if(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"))return;i.preventDefault(),this.closePopover()}}},this.detectChange=t.detectChange,this.variant=t.variant??"default",this.originalDefault=t.default,this.value=this.defaultValue(),this.setLinkedGlobalVariableFrom(this.originalDefault??this.value)}resolveGlobalVarColor(t){if(t.startsWith("var(--")){const e=t.replace("var(--","").replace(")","");return(b.GlobalVariables||{})[e]||t}return t}setLinkedGlobalVariableFrom(t){var i,s;if(!t){this.linkedGlobalVariable=null;return}const e=typeof t=="string"?t:((s=(i=t.stops)==null?void 0:i[0])==null?void 0:s.color)??null;this.linkedGlobalVariable=e&&e.startsWith("var(--")?e:null}isBoundToGlobal(){return!!this.linkedGlobalVariable}clearGlobalBindingForCustomChange(){var t,e;this.isBoundToGlobal()&&((e=(t=this.value)==null?void 0:t.stops)!=null&&e.length&&(this.value.stops=this.value.stops.map(i=>({...i,color:this.resolveGlobalVarColor(i.color)}))),this.linkedGlobalVariable=null,this.updateUnlinkButtonVisibility())}breakGlobalBinding(){var t;!this.isBoundToGlobal()||!this.value||((t=this.value.stops)!=null&&t.length&&(this.value.stops=this.value.stops.map(e=>({...e,color:this.resolveGlobalVarColor(e.color)}))),this.linkedGlobalVariable=null,this.updateUI(),this.triggerChange(),this.isPopoverOpen&&this.refreshPopoverContent())}defaultValue(){const t=this.originalDefault;if(typeof t=="string"){if(t.startsWith("var(--"))return D({type:"solid",angle:0,stops:[{color:t,position:0,opacity:100}]});const i=P(t);if(i)return D(i)}return D(t&&typeof t=="object"?t:{type:"linear",angle:90,stops:[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}]})}setValue(t){let e=null;typeof t=="string"?t.startsWith("var(--")?e=D({type:"solid",angle:0,stops:[{color:t,position:0,opacity:100}]}):e=P(t):t&&typeof t=="object"&&(e=D(t)),e||(e=this.defaultValue()),this.value=e,this.setLinkedGlobalVariableFrom(t??e),this.updateUI(),this.isPopoverOpen&&this.refreshPopoverContent(),this.triggerChange(),this.pendingSolidColor=null,this.updateUnlinkButtonVisibility()}updateUI(){if(this.previewEl&&this.value)if(this.value.type==="solid"){const t=this.value.stops[0],e=t.opacity??100,i=this.resolveGlobalVarColor(t.color);this.previewEl.style.background=at(i,e)}else{const t=this.resolveGradientGlobalVars(this.value);this.previewEl.style.background=I(t)}if(this.inputEl&&this.value&&!this.isEditing)if(this.isBoundToGlobal()&&this.linkedGlobalVariable){const e=this.linkedGlobalVariable.replace("var(--","").replace(")","").split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ");this.inputEl.value=`Linked: ${e}`}else this.inputEl.value=K(this.value);this.updateUnlinkButtonVisibility()}resolveGradientGlobalVars(t){return{...t,stops:t.stops.map(e=>({...e,color:this.resolveGlobalVarColor(e.color)}))}}updateUnlinkButtonVisibility(){if(!this.unlinkButton)return;const t=this.isBoundToGlobal();t?this.unlinkButton.classList.add("visible"):this.unlinkButton.classList.remove("visible"),this.previewEl&&(t?this.previewEl.classList.add("bound"):this.previewEl.classList.remove("bound"))}cssForTextValue(){return this.value?{background:I(this.value),"-webkit-background-clip":"text","background-clip":"text",color:"transparent","-webkit-text-fill-color":"transparent"}:{}}draw(){const t=document.createElement("div");if(t.className="gradient-setting-wrapper",this.props.title){const i=document.createElement("div");i.className="icon-container";const s=document.createElement("span");s.className="input-label",s.textContent=this.props.title,i.appendChild(s),t.appendChild(i)}const e=document.createElement("div");return e.className="gradient-input-wrapper",this.previewEl=document.createElement("div"),this.previewEl.className="gradient-mini-preview",this.previewEl.style.background=this.value?I(this.value):"linear-gradient(90deg, #a84b4b 0%, #786666 100%)",this.previewEl.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.openPopover()}),this.inputEl=document.createElement("input"),this.inputEl.type="text",this.inputEl.className="gradient-text-input",this.inputEl.placeholder="Enter gradient CSS or paste color...",this.inputEl.value=this.value?K(this.value):"",this.inputEl.readOnly=!1,this.inputEl.addEventListener("focus",()=>{if(this.isEditing=!0,this.value)if(this.value.type==="solid"){const i=this.value.stops[0];if(i){const s=i.color.toUpperCase(),n=i.opacity??100;if(n===100)this.inputEl.value=s;else{const a=Math.round(n/100*255).toString(16).toUpperCase().padStart(2,"0");this.inputEl.value=`${s}${a}`}}}else this.inputEl.value=I(this.value)}),this.inputEl.addEventListener("blur",()=>{this.isEditing=!1,this.value&&(this.inputEl.value=K(this.value))}),this.inputEl.addEventListener("paste",i=>this.handlePaste(i)),this.inputEl.addEventListener("input",i=>this.handleTextInput(i)),this.inputEl.addEventListener("keydown",i=>{i.key==="Enter"&&(this.handleTextInput(i),this.inputEl.blur()),i.key==="Escape"&&(this.value&&(this.inputEl.value=I(this.value)),this.inputEl.blur())}),e.appendChild(this.previewEl),this.unlinkButton=document.createElement("button"),this.unlinkButton.type="button",this.unlinkButton.className="gradient-unlink-button",this.unlinkButton.innerHTML=Wt,this.unlinkButton.title="Break global color binding",this.unlinkButton.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.breakGlobalBinding()}),e.appendChild(this.unlinkButton),e.appendChild(this.inputEl),t.appendChild(e),this.createPopover(),this.element=t,this.updateUnlinkButtonVisibility(),t}createPopover(){if(this.popoverEl)return;this.backdropEl=document.createElement("div"),this.backdropEl.className="gradient-popover-backdrop",this.backdropEl.style.display="none",this.backdropEl.style.pointerEvents="none",this.popoverEl=document.createElement("div"),this.popoverEl.className="gradient-popover",this.popoverEl.style.display="none",this.popoverEl.addEventListener("click",l=>{l.stopPropagation()});const t=document.createElement("div");t.className="gradient-popover-header",t.style.cursor="move";let e=null;if(this.variant!=="global"){e=document.createElement("div"),e.className="color-setting-tabs header-tabs";const l=document.createElement("button");l.className="color-tab active",l.textContent="Custom";const r=document.createElement("button");r.className="color-tab",r.textContent="Global",e.appendChild(l),e.appendChild(r),t.appendChild(e)}else{const l=document.createElement("div");t.appendChild(l)}const i=document.createElement("button");i.type="button",i.className="gradient-popover-close",i.innerHTML=wt,i.addEventListener("click",()=>this.closePopover()),t.appendChild(i),rt(t,this.popoverEl,(l,r)=>{this.popoverPosition={left:l,top:r}});const s=document.createElement("div");s.className="gradient-editor";const n=document.createElement("div");n.className="type-tabs-wrapper";const o=this.createTypeTabs();n.appendChild(o),s.appendChild(n);const a=document.createElement("div");if(a.className="gradient-editor-content",this.updatePopoverContent(a),s.appendChild(a),this.variant!=="global"&&e){const l=e.children[0],r=e.children[1],c=h=>{this.currentMode=h,h==="custom"?(l.classList.add("active"),r.classList.remove("active"),n.style.display="block"):(r.classList.add("active"),l.classList.remove("active"),n.style.display="none"),this.updatePopoverContent(a)};l.addEventListener("click",()=>c("custom")),r.addEventListener("click",()=>c("global")),this.isBoundToGlobal()?(this.currentMode="global",c("global")):(this.currentMode="custom",c("custom"))}this.popoverEl.appendChild(t),this.popoverEl.appendChild(s),document.body.appendChild(this.backdropEl),document.body.appendChild(this.popoverEl)}createTypeTabs(){var s,n;const t=document.createElement("div");t.className="gradient-type-tabs";const e=document.createElement("button");e.type="button",e.className=`gradient-type-tab ${((s=this.value)==null?void 0:s.type)==="solid"?"active":""}`,e.innerHTML=zt,e.style.minWidth="32px",e.addEventListener("click",()=>this.switchType("solid"));const i=document.createElement("button");return i.type="button",i.className=`gradient-type-tab ${((n=this.value)==null?void 0:n.type)!=="solid"?"active":""}`,i.innerHTML=Ut,i.style.minWidth="32px",i.addEventListener("click",()=>{var a,l;const o=((a=this.value)==null?void 0:a.type)==="solid"?"linear":((l=this.value)==null?void 0:l.type)||"linear";this.switchType(o)}),t.appendChild(e),t.appendChild(i),t}switchType(t,e=!1){var o;if(!this.value)return;const i=this.isBoundToGlobal(),s=this.linkedGlobalVariable;if(this.value.type=t,t!=="solid"&&(this.pendingSolidColor=null),t!=="solid"&&(!this.value.stops||this.value.stops.length===0)&&(this.value.stops=[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}]),t!=="solid"&&this.value.stops.length===1){const l=this.value.stops[0].color;if(l.startsWith("var(--")){const r=this.resolveGlobalVarColor(l),c=P(r);c&&c.type!=="solid"&&c.stops.length>=2?(this.value.stops=c.stops,this.value.angle=c.angle,this.value.type=c.type):(this.value.stops.push({color:"#786666",position:100,opacity:100}),this.value.angle=90)}else this.value.stops.push({color:"#786666",position:100,opacity:100}),this.value.angle=90}else if(t!=="solid"&&this.value.stops.length>=2)this.value.angle||(this.value.angle=90);else if(t==="solid"&&i&&s){const a=this.value.stops&&this.value.stops[0]?this.value.stops[0].opacity??100:100;this.value.stops=[{color:s,position:0,opacity:a}],this.value.angle=0}if(this.popoverEl){const a=this.popoverEl.querySelectorAll(".gradient-type-tab");a.forEach(c=>c.classList.remove("active"));const l=a[0],r=a[1];t==="solid"?l==null||l.classList.add("active"):r==null||r.classList.add("active")}const n=(o=this.popoverEl)==null?void 0:o.querySelector(".gradient-editor-content");n&&this.updatePopoverContent(n),this.updateUI(),e&&this.triggerChange()}updatePopoverContent(t){if(t.innerHTML="",!!this.value){if(this.variant!=="global"&&this.currentMode==="global"){this.renderGlobalColors(t);return}this.value.type==="solid"?this.renderSolid(t):this.renderGradient(t)}}renderGlobalColors(t){(!this.value||!this.value.stops||!this.value.stops.length)&&(this.value||(this.value=this.defaultValue()),this.value.stops=[{color:"#000000",position:0,opacity:100}]);const e=this.value.stops[0],i=h=>{h.innerHTML="";let p={};try{p=b.GlobalVariables||{}}catch(u){console.warn("Could not access Setting.GlobalVariables",u)}if(!p||Object.keys(p).length===0){const u=document.createElement("div");u.textContent="No global colors defined",u.style.fontSize="12px",u.style.color="#666",u.style.padding="8px",h.appendChild(u);return}const g=b.GlobalVariableGroups||[{title:"Global Colors",keys:["primary","secondary","tertiary","accent"]},{title:"Text Color",keys:["text-dark","text-light"]}],C=this.globalSearchQuery.toLowerCase();let m;this.globalLayoutMode==="list"?(m=document.createElement("div"),m.className="global-colors-list"):(m=document.createElement("div"),m.className="global-colors-grid"),h.appendChild(m),g.forEach(u=>{const f=Object.entries(p).filter(([v])=>!u.keys.includes(v)&&u.title!=="Global Colors"?!1:u.keys.includes(v)&&v.toLowerCase().includes(C));f.length!==0&&f.forEach(([v,y])=>{if(this.globalLayoutMode==="list"){const x=document.createElement("div");x.className="global-color-row";const k=document.createElement("div");k.className="global-color-circle";const N=this.resolveGlobalVarColor(y);k.style.background=N,(this.linkedGlobalVariable===`var(--${v})`||e.color===`var(--${v})`)&&k.classList.add("selected");const w=document.createElement("span");w.className="global-color-label",w.textContent=v.split("-").map(S=>S.charAt(0).toUpperCase()+S.slice(1)).join(" "),x.appendChild(k),x.appendChild(w),x.addEventListener("click",S=>{S.preventDefault();const F=`var(--${v})`;this.setValue(F),this.pendingSolidColor=F,i(h)}),m.appendChild(x)}else{const x=document.createElement("div");x.className="global-color-circle";const k=this.resolveGlobalVarColor(y);x.style.background=k,x.title=v.split("-").map(E=>E.charAt(0).toUpperCase()+E.slice(1)).join(" "),(this.linkedGlobalVariable===`var(--${v})`||e.color===`var(--${v})`)&&x.classList.add("selected"),x.addEventListener("click",E=>{E.preventDefault();const w=`var(--${v})`;this.setValue(w),this.pendingSolidColor=w,i(h)}),m.appendChild(x)}})})},s=document.createElement("div");s.className="global-controls-row";const n=document.createElement("div");n.className="global-search-container";const o=document.createElement("span");o.className="global-search-icon",o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>';const a=document.createElement("input");a.type="text",a.className="global-search-input",a.placeholder="Search",a.value=this.globalSearchQuery;const l=document.createElement("div");a.addEventListener("input",h=>{this.globalSearchQuery=h.target.value,i(l)}),n.appendChild(o),n.appendChild(a);const r=document.createElement("button");r.className="global-layout-toggle",r.type="button";const c=()=>{r.innerHTML=this.globalLayoutMode==="list"?'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>':'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="8" y1="6" x2="21" y2="6"></line><line x1="8" y1="12" x2="21" y2="12"></line><line x1="8" y1="18" x2="21" y2="18"></line><line x1="3" y1="6" x2="3.01" y2="6"></line><line x1="3" y1="12" x2="3.01" y2="12"></line><line x1="3" y1="18" x2="3.01" y2="18"></line></svg>'};c(),r.addEventListener("click",()=>{this.globalLayoutMode=this.globalLayoutMode==="list"?"grid":"list",c(),i(l)}),s.appendChild(n),s.appendChild(r),t.appendChild(s),t.appendChild(l),i(l)}renderSolid(t){(!this.value||!this.value.stops||!this.value.stops.length)&&(this.value||(this.value=this.defaultValue()),this.value.stops=[{color:"#000000",position:0,opacity:100}]);const e=this.value.stops[0],i=new jt({initialColor:e.color.startsWith("var(--")?this.resolveGlobalVarColor(e.color):e.color,initialOpacity:e.opacity??100,onColorChange:(s,n)=>{if(this.clearGlobalBindingForCustomChange(),this.value){const o=P(s);if(o&&o.type!=="solid"){this.value=o,this.switchType(o.type,!0);return}this.value.stops[0].color=s,this.value.stops[0].opacity=n,this.updateUI(),this.triggerChange(),this.pendingSolidColor=s}}});this.solidPicker=i,t.appendChild(i.getElement())}renderGradient(t){this.solidPicker=null;let e=null;{const c=document.createElement("div");c.className="gradient-subtype-inline";const h=document.createElement("select");h.className="gradient-subtype-select";const p=document.createElement("option");p.value="linear",p.textContent="Linear";const g=document.createElement("option");g.value="radial",g.textContent="Radial",h.appendChild(p),h.appendChild(g),h.value=this.value.type==="radial"?"radial":"linear",e=document.createElement("input"),e.type="text",e.inputMode="numeric",e.className="gradient-degree-input",e.value=`${this.value.angle??90}°`,e.style.width="75px",e.style.textAlign="center",(!this.value.angle||this.value.stops.length<2)&&(this.value.angle=90,e.value="90°");const C=document.createElement("button");C.type="button",C.className="gradient-flip-btn",C.innerHTML=Gt,h.addEventListener("change",()=>{this.clearGlobalBindingForCustomChange(),this.switchType(h.value==="radial"?"radial":"linear",!0),e&&this.updateDegreeVisibility(e)}),e.addEventListener("focus",m=>{const u=m.target;u.value=u.value.replace(/[^0-9-]/g,""),setTimeout(()=>u.select(),0)}),e.addEventListener("input",m=>{this.clearGlobalBindingForCustomChange();const u=parseInt(m.target.value);!Number.isNaN(u)&&this.value&&(this.value.angle=Math.max(0,Math.min(360,u)),this.debouncedPreviewUpdate())}),e.addEventListener("blur",m=>{var v;this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null);const u=m.target;let f=parseInt(u.value);Number.isNaN(f)&&(f=((v=this.value)==null?void 0:v.angle)??0),f=Math.max(0,Math.min(360,f)),this.value&&(this.value.angle=f),u.value=`${f}°`,this.updateGradientPreview(),this.updateUI(),this.triggerChange()}),C.addEventListener("click",()=>{this.clearGlobalBindingForCustomChange(),!(!this.value||!this.value.stops)&&(this.value.stops.forEach(m=>{m.position=100-m.position}),this.value.stops.sort((m,u)=>m.position-u.position),this.updateGradientPreview(i),this.createHandles(s,i),this.updateStopsList(l),this.updateUI(),this.triggerChange())}),c.appendChild(h),c.appendChild(e),c.appendChild(C),t.appendChild(c),this.updateDegreeVisibility(e)}const i=document.createElement("div");i.className="gradient-preview",this.updateGradientPreview(i);const s=document.createElement("div");s.className="gradient-handles",i.appendChild(s),t.appendChild(i),this.createHandles(s,i);const n=document.createElement("div");n.className="gradient-stops-header";const o=document.createElement("span");o.textContent="Stops";const a=document.createElement("button");a.type="button",a.className="gradient-add-stop",a.textContent="+",n.appendChild(o),n.appendChild(a);const l=document.createElement("div");l.className="gradient-stops",t.appendChild(n),t.appendChild(l),this.updateStopsList(l);const r=ct(c=>{const h=P(c);h&&(this.clearGlobalBindingForCustomChange(),this.value=h,this.switchType(h.type,!0),this.updateUI(),this.triggerChange())},"all");this.recentGradientRefresh=r.refresh,t.appendChild(r.container),a.addEventListener("click",()=>{var c;this.clearGlobalBindingForCustomChange(),this.addStop(),this.updateStopsList(l),this.updateGradientPreview(i),this.createHandles(s,i),this.updateUI(),((c=document.activeElement)==null?void 0:c.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange()})}updateDegreeVisibility(t){var e;t&&(((e=this.value)==null?void 0:e.type)==="radial"?(t.disabled=!0,t.style.opacity="0.5"):(t.disabled=!1,t.style.opacity="1"))}updateGradientPreview(t){var i;const e=t||((i=this.popoverEl)==null?void 0:i.querySelector(".gradient-preview"));if(e&&this.value)if(this.value.type==="solid")e.style.background=I(this.value);else{const s=this.value.stops.map(n=>`${at(n.color,n.opacity??100)} ${n.position}%`).join(", ");e.style.background=`linear-gradient(90deg, ${s})`}}debouncedPreviewUpdate(t){this.previewUpdateTimeout&&clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=window.setTimeout(()=>{this.updateGradientPreview(t),this.previewUpdateTimeout=null},16)}createHandles(t,e){t.innerHTML="",!(!this.value||this.value.type==="solid"||!this.value.stops)&&this.value.stops.forEach((i,s)=>{const n=document.createElement("div");n.className="gstop-handle",n.style.left=`${Math.max(0,Math.min(100,i.position))}%`,n.style.top="0%";const o=document.createElement("div");o.className="gstop-chip";const a=this.resolveGlobalVarColor(i.color);o.style.backgroundColor=a,n.appendChild(o);const l=new mt((u,f)=>{this.clearGlobalBindingForCustomChange(),this.value&&this.value.stops[s]&&(this.value.stops[s].color=u,f!==void 0&&(this.value.stops[s].opacity=f),o.style.backgroundColor=u,this.updateGradientPreview(),this.updateStopsList(),this.updateUI(),this.triggerChange())},"solid");let r=!1,c=!1,h=0,p=0;const g=u=>{r=!0,c=!1,h=u.clientX,p=this.value.stops[s].position,n.classList.add("selected"),document.addEventListener("mousemove",C),document.addEventListener("mouseup",m),u.preventDefault(),u.stopPropagation()},C=u=>{if(!r||!this.value)return;const f=u.clientX-h;if(Math.abs(f)>3&&(c=!0),c){this.clearGlobalBindingForCustomChange();const v=e.getBoundingClientRect();let y=p+f/v.width*100;y=Math.max(0,Math.min(100,y)),this.value.stops[s].position=Math.round(y),n.style.left=`${y}%`,this.updateGradientPreview()}},m=u=>{var f;if(r)if(r=!1,n.classList.remove("selected"),document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",m),c)this.value&&(this.value.stops.sort((v,y)=>v.position-y.position),this.createHandles(t,e),this.updateStopsList()),this.updateUI(),this.triggerChange();else{u.stopPropagation();const v=(f=this.value)==null?void 0:f.stops[s];v&&setTimeout(()=>{const y=this.resolveGlobalVarColor(v.color);l.open(y,o,v.opacity??100)},0)}};n.addEventListener("mousedown",g),t.appendChild(n)})}updateStopsList(t){var i;const e=t||((i=this.popoverEl)==null?void 0:i.querySelector(".gradient-stops"));!e||!this.value||this.value.type==="solid"||!this.value.stops||(e.innerHTML="",this.value.stops.forEach((s,n)=>{var k,N;const o=document.createElement("div");o.className="gstop-row";const a=document.createElement("div");a.className="gstop-position-group";const l=document.createElement("input");l.type="text",l.className="gstop-position-input",l.value=`${s.position}%`,l.style.width="60px",a.appendChild(l);const r=document.createElement("div");r.className="gstop-color-container";const c=this.resolveGlobalVarColor(s.color),h=document.createElement("div");h.className="gstop-color-preview",h.style.backgroundColor=c;const p=document.createElement("input");p.type="text",p.className="gstop-color-input",p.value=c.replace("#","").toUpperCase();const g=document.createElement("button");g.type="button",g.className="gstop-color-copy",g.textContent="Copy",r.appendChild(h),r.appendChild(p),r.appendChild(g);const C=document.createElement("button");C.type="button",C.className="gstop-del",C.innerHTML=Rt,C.disabled=(((N=(k=this.value)==null?void 0:k.stops)==null?void 0:N.length)||0)<=2,o.appendChild(a),o.appendChild(r),o.appendChild(C),e.appendChild(o);const m=document.createElement("span");m.className="gstop-opacity-label",m.textContent="Opacity";const u=document.createElement("div");u.className="gstop-opacity-group";const f=document.createElement("input");f.type="range",f.className="gstop-opacity-slider",f.min="0",f.max="100",f.value=String(s.opacity??100);const v=O(c);f.style.setProperty("--slider-color",`rgb(${v.r}, ${v.g}, ${v.b})`);const y=document.createElement("span");y.className="gstop-opacity-value",y.textContent=`${s.opacity??100}%`,u.appendChild(f),u.appendChild(y);const x=new mt((E,w)=>{this.clearGlobalBindingForCustomChange(),p.value=E.replace("#","").toUpperCase(),h.style.backgroundColor=E,this.value.stops[n].color=E,w!==void 0&&(this.value.stops[n].opacity=w,f.value=String(w),y.textContent=`${w}%`);const S=O(E);f.style.setProperty("--slider-color",`rgb(${S.r}, ${S.g}, ${S.b})`),this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateUI(),this.triggerChange()},"solid");p.addEventListener("click",E=>{E.preventDefault(),E.stopPropagation();const w=this.resolveGlobalVarColor(s.color);x.open(w,p,s.opacity??100)}),p.addEventListener("input",()=>{this.clearGlobalBindingForCustomChange();const E=p.value.trim(),w=E.startsWith("#")?E:`#${E}`;if(/^#[0-9A-Fa-f]{6}$/.test(w)){this.value.stops[n].color=w,h.style.backgroundColor=w;const S=O(w);f.style.setProperty("--slider-color",`rgb(${S.r}, ${S.g}, ${S.b})`),this.debouncedPreviewUpdate()}}),p.addEventListener("blur",()=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),this.updateGradientPreview(),this.updateUI(),this.triggerChange()}),g.addEventListener("click",async E=>{E.stopPropagation();try{await navigator.clipboard.writeText(`#${p.value}`)}catch{}}),l.addEventListener("focus",E=>{const w=E.target;w.value=w.value.replace("%",""),w.select()}),l.addEventListener("input",E=>{this.clearGlobalBindingForCustomChange();const w=E.target,S=parseInt(w.value.replace(/[^\d]/g,""),10);if(!Number.isNaN(S)){const F=Math.max(0,Math.min(100,S));this.value.stops[n].position=F,w.value=`${F}%`,this.debouncedPreviewUpdate()}}),l.addEventListener("blur",E=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null);const w=E.target,S=parseInt(w.value.replace(/[^\d]/g,""),10);if(Number.isNaN(S))w.value=`${this.value.stops[n].position}%`;else{const F=Math.max(0,Math.min(100,S));this.value.stops[n].position=F,w.value=`${F}%`}this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateStopsList(),this.updateUI(),this.triggerChange()}),C.addEventListener("click",()=>{var E;(this.value.stops.length||0)<=2||(this.clearGlobalBindingForCustomChange(),this.value.stops.splice(n,1),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateStopsList(),this.updateGradientPreview(),this.updateUI(),((E=document.activeElement)==null?void 0:E.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange())}),f.addEventListener("input",()=>{this.clearGlobalBindingForCustomChange();const E=parseInt(f.value,10);this.value.stops[n].opacity=Math.max(0,Math.min(100,E)),y.textContent=`${this.value.stops[n].opacity}%`,this.debouncedPreviewUpdate()}),f.addEventListener("change",()=>{this.clearGlobalBindingForCustomChange(),this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),this.updateGradientPreview(),this.updateUI(),this.triggerChange()})}))}addStop(){if(!this.value||this.value.type==="solid"||!this.value.stops)return;const t=this.value.stops.map(o=>o.position).sort((o,a)=>o-a);let e=50,i=0;for(let o=0;o<t.length-1;o++){const a=t[o+1]-t[o];a>i&&(i=a,e=t[o]+a/2)}const s=this.value.stops.reduce((o,a)=>Math.abs(a.position-e)<Math.abs(o.position-e)?a:o),n={position:Math.round(e),color:s.color,opacity:s.opacity??100};this.value.stops.push(n),this.value.stops.sort((o,a)=>o.position-a.position)}openPopover(){if(this.popoverEl&&(T.openInstance&&T.openInstance!==this&&T.openInstance.closePopover(),!this.isPopoverOpen)){if(this.isPopoverOpen=!0,T.openInstance=this,this.backdropEl&&(this.backdropEl.style.display="block",this.backdropEl.parentElement||document.body.appendChild(this.backdropEl)),this.popoverEl.style.display="flex",this.refreshPopoverContent(),this.element){const t=this.element.getBoundingClientRect(),e=306,i=window.innerWidth,s=window.innerHeight,n=16;this.popoverEl.style.position="fixed",this.popoverEl.style.zIndex="10000",this.popoverEl.style.left="-9999px",this.popoverEl.style.top="0px";const o=this.popoverEl.offsetHeight;let a=t.right+8,l=t.top;const r=i-t.right,c=t.left,h=e+n;r<h&&c>r+100&&(a=t.left-e-8);const p=s-t.bottom,g=t.top;g>=o+n?l=t.top-o-8:p>=o+n?l=t.bottom+8:g>p?(l=t.top-o-8,l<n&&(l=n)):(l=t.bottom+8,l+o>s-n&&(l=s-o-n)),this.popoverEl.style.left=`${a}px`,this.popoverEl.style.top=`${l}px`,this.popoverPosition={left:a,top:l}}setTimeout(()=>document.addEventListener("click",this.onBackgroundClick,!0),200),document.addEventListener("keydown",this.handlePopoverKeydown,!0)}}repositionPopover(){var t;if(!(!this.popoverEl||!this.isPopoverOpen||!this.element)&&((t=document.activeElement)==null?void 0:t.tagName)!=="INPUT"){if(this.popoverPosition){this.popoverEl.style.left=`${this.popoverPosition.left}px`,this.popoverEl.style.top=`${this.popoverPosition.top}px`;return}requestAnimationFrame(()=>{if(!this.popoverEl||!this.element)return;const e=this.element.getBoundingClientRect(),i=306,s=window.innerWidth,n=window.innerHeight,o=16;this.popoverEl.style.left,this.popoverEl.style.top,this.popoverEl.style.left="-9999px",this.popoverEl.style.top="0px";const a=this.popoverEl.offsetHeight;let l=e.right+8,r=e.top;const c=s-e.right,h=e.left,p=i+o;c<p&&h>c+100&&(l=e.left-i-8);const g=n-e.bottom,C=e.top;C>=a+o?r=e.top-a-8:g>=a+o?r=e.bottom+8:C>g?(r=e.top-a-8,r<o&&(r=o)):(r=e.bottom+8,r+a>n-o&&(r=n-a-o)),this.popoverEl.style.left=`${l}px`,this.popoverEl.style.top=`${r}px`})}}refreshPopoverContent(){var n,o;if(!this.popoverEl)return;const t=this.popoverEl.querySelectorAll(".gradient-type-tab");t.forEach(a=>a.classList.remove("active"));const e=t[0],i=t[1];((n=this.value)==null?void 0:n.type)==="solid"?e.classList.add("active"):(i.classList.add("active"),(o=this.recentGradientRefresh)==null||o.call(this)),this.popoverEl.offsetHeight;const s=this.popoverEl.querySelector(".gradient-editor-content");s&&this.updatePopoverContent(s)}closePopover(){var t;if(!(!this.popoverEl||!this.isPopoverOpen)){if(this.isPopoverOpen=!1,this.popoverPosition=null,this.backdropEl&&(this.backdropEl.style.display="none"),this.popoverEl.style.display="none",document.removeEventListener("click",this.onBackgroundClick,!0),document.removeEventListener("keydown",this.handlePopoverKeydown,!0),this.commitPendingSolidColor(),this.value&&this.value.type!=="solid"){const e=I(this.value);z.addColor(e,"gradient"),(t=this.recentGradientRefresh)==null||t.call(this)}this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),T.openInstance===this&&(T.openInstance=null)}}commitPendingSolidColor(){this.pendingSolidColor&&(this.solidPicker?this.solidPicker.commitRecentColor():z.addColor(this.pendingSolidColor,"solid"),this.pendingSolidColor=null)}handlePaste(t){var i;t.preventDefault();const e=((i=t.clipboardData)==null?void 0:i.getData("text"))||"";this.parseAndSet(e)}handleTextInput(t){const e=t.target;this.parseAndSet(e.value)}parseAndSet(t){let e=t.trim();e&&!e.startsWith("#")&&!e.startsWith("var(")&&!e.startsWith("rgb")&&!e.startsWith("hsl")&&!e.includes("gradient")&&/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$|^[0-9A-Fa-f]{8}$/.test(e)&&(e="#"+e,this.inputEl&&(this.inputEl.value=e));const i=P(e);i&&this.setValue(i)}getChangePayload(){var t;if(this.value)return this.isBoundToGlobal()?((t=this.value.stops)==null?void 0:t.some(i=>i.opacity!==void 0&&i.opacity!==100))?this.resolveGradientGlobalVars(this.value):this.linkedGlobalVariable||void 0:this.value}triggerChange(){const t=this.getChangePayload();t!==void 0&&(this.changeDebounceTimeout&&clearTimeout(this.changeDebounceTimeout),this.changeDebounceTimeout=setTimeout(()=>{var e,i;(e=this.onChange)==null||e.call(this,t),(i=this.detectChange)==null||i.call(this,t),this.changeDebounceTimeout=null},T.CHANGE_DEBOUNCE_DELAY))}getElement(){return this.element}getValue(){const t=this.getChangePayload();return t?typeof t=="string"?t:I(t):""}getCSSValue(){const t=this.getChangePayload();return t?typeof t=="string"?t:I(t):""}getCSSForText(){return this.value?this.cssForTextValue():{}}getRawValue(){return this.value}};T.openInstance=null,T.CHANGE_DEBOUNCE_DELAY=150;let U=T;function q(d,t){for(const e in d)if(Object.prototype.hasOwnProperty.call(d,e)){const i=d[e];t(e,i)}}const tt=class tt{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.lastChangeTime=0,this.handleBlur=()=>{},this.pendingBlurHandler=null,this.originalDefaultValues={},this.nestingLevel=0,this.dataPropsPath="",this.hide=!1,this.id=t.id||Ct(),this.title=t.title,this.settings=t.settings,this.isCollapsed=t.collapsed??!1,this.isMain=t.main??!1,this.custom=t.custom??!1,this.nestingLevel=0,this.includeGetJson=t.includeGetJson??!0,this.addItemCfg=t.addItem,this.deleteItemCfg=t.deleteItem,this.dataProps=t.dataProps,this.dataPropsPath=t.dataProps||"",this.hide=t.hide??!1,Object.assign(this,t.settings),this.initialValues=this.getValues(),this.originalDefaultValues=this.getDefaultValues(),this.propagateNestingLevel(),this.propagateDataPropsPath()}propagateNestingLevel(){const t=this.nestingLevel+1;q(this.settings,(e,i)=>{L(i)&&(i.nestingLevel=t,i.propagateNestingLevel())})}getNestingLevel(){return this.nestingLevel}setNestingLevel(t){this.nestingLevel=t,this.propagateNestingLevel(),this.elementRef&&this.updateNestingStyles()}setTitle(t){if(this.title=t,this.elementRef){const e=this.elementRef.querySelector(".setting-group-title h3");e&&(e.textContent=t)}}getDataPropsPath(){return this.dataPropsPath}setDataPropsPath(t){this.dataPropsPath=t,this.propagateDataPropsPath()}propagateDataPropsPath(){q(this.settings,(t,e)=>{const i=String(t),s=this.dataPropsPath?`${this.dataPropsPath}_${i}`:i;(L(e)||$(e)&&typeof e.setDataPropsPath=="function")&&e.setDataPropsPath(s)})}updateNestingStyles(){this.elementRef&&(_(this.elementRef,this.nestingLevel),st(this.elementRef,this.nestingLevel))}forceChildUIRefresh(){Object.entries(this.settings).forEach(([t,e])=>{try{if(L(e)){const i=e.getValues();e.setValue(i)}else if(typeof e.setValue=="function"){const i=e.value;i!==void 0&&e.setValue(i)}}catch(i){console.warn(`Error refreshing UI for setting ${t}:`,i)}})}removeSetting(t){var s;const e=this.settings[t];if(!e)return;if(delete this.settings[t],this.elementRef){const n=this.elementRef.querySelector(".setting-group-content");if(n){const o=Array.from(n.querySelectorAll(".setting-group, .setting, [data-setting-id]"));for(const a of o){const l=a.id,r=a.getAttribute("data-setting-id");if(l&&"id"in e&&typeof e.id=="string"&&l.includes(e.id)){a.remove();break}if(r&&"id"in e&&typeof e.id=="string"&&r===e.id){a.remove();break}}}}typeof e.cleanup=="function"&&e.cleanup(),this.updateNestingStyles();const i=this.getValues();this.initialValues=i,(s=this.onChange)==null||s.call(this,i)}updateVisibility(){this.elementRef}updateSettings(t,e){var l;const i=(e==null?void 0:e.preserveValues)??!0,s=new Set(Object.keys(this.settings)),n=Object.keys(t),o={};i&&n.forEach(r=>{const c=this.settings[r];c&&(L(c)?o[r]=c.getValues():$(c)?o[r]=c.value:typeof c.getValues=="function"?o[r]=c.getValues():c.value!==void 0&&(o[r]=c.value))}),s.forEach(r=>{n.includes(r)||this.removeSetting(r)}),n.forEach(r=>{var p;const c=t[r],h=this.settings[r];if(h!==c&&(h&&this.removeSetting(r),this.addSetting(r,c),i&&r in o)){const g=o[r];try{L(c)?c.setValue(g):$(c)?(p=c.setValue)==null||p.call(c,g):c.setValue&&c.setValue(g)}catch(C){console.warn(`Could not preserve value for setting ${r}:`,C)}}}),this.settings=t,this.propagateNestingLevel(),this.propagateDataPropsPath();const a=this.getValues();this.initialValues=a,(l=this.onChange)==null||l.call(this,a)}clone(){const t={};q(this.settings,(s,n)=>{const o=String(s);typeof n.clone=="function"?t[o]=n.clone():(console.warn(`Setting with key '${o}' does not have a clone method. Copying reference.`),t[o]=n)});const e={title:this.title,settings:t,collapsed:this.isCollapsed,main:this.isMain,custom:this.custom,includeGetJson:this.includeGetJson,addItem:this.addItemCfg,deleteItem:this.deleteItemCfg,dataProps:this.dataProps,hide:this.hide},i=Lt(e);return i.initialValues=this.getValues(),i}resetDefault(){const t=this.originalDefaultValues;this.setValue(t),this.onChange&&this.onChange(this.getValues())}setMobileValues(t){!t||typeof t!="object"||(Object.entries(t).forEach(([e,i])=>{const s=this.settings[e];s&&(L(s)||$(s))&&typeof s.setMobileValue=="function"&&s.setMobileValue(i)}),this.setValue(t),this.onChange&&this.onChange(this.getValues()))}getMobileValues(t){if(t===void 0){const e={};for(const i in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,i)){const s=this.settings[i];if(L(s))e[i]=s.getMobileValues();else{const n=s;e[i]=n.mobileValue!==void 0?n.mobileValue:n.value}}return e}else{const e=this.settings[t];if(!e)return;if(L(e))return e.getMobileValues();const i=e;return i.mobileValue!==void 0?i.mobileValue:i.value}}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.lastChangeTime=Date.now(),this.initialValues=i,t(i),this.updateVisibility()),this.isHandlingChange=!1},50))};return this.changeHandlers.clear(),q(this.settings,(i,s)=>{var n;if(L(s))s.setOnChange(()=>{const o=this.getValues();this.initialValues=o,t(o)}),this.changeHandlers.add(()=>t(this.getValues()));else if($(s)){const o=()=>e();this.changeHandlers.add(o),s.setOnChange(o)}else{const o=()=>e();this.changeHandlers.add(o),(n=s.setOnChange)==null||n.call(s,o)}}),this}cleanup(){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.changeHandlers.clear()}setValue(t){if(!t||typeof t!="object")return;Object.entries(t).forEach(([i,s])=>{let n=this.settings[i];if(!n&&this.addItemCfg&&i.startsWith(this.addItemCfg.keyPrefix)){const o=i.slice(this.addItemCfg.keyPrefix.length),a=Number(o);if(Number.isFinite(a)){const l=this.addItemCfg.createItem(a);nt(l)&&(this.addSetting(i,l),n=l)}}n&&(L(n)||$(n))&&typeof n.setValue=="function"&&n.setValue(s)}),setTimeout(()=>{this.forceChildUIRefresh()},0);const e=this.getValues();this.initialValues=e,this.onChange&&this.onChange(e)}wireChild(t){var i;const e=()=>{var n;const s=this.getValues();this.initialValues=s,(n=this.onChange)==null||n.call(this,s),this.updateVisibility()};L(t)?t.setOnChange(()=>e()):$(t)?t.setOnChange(()=>e()):(i=t.setOnChange)==null||i.call(t,()=>e())}addSetting(t,e){var s,n;if(this.settings[t]=e,this.wireChild(e),this.elementRef){const o=this.elementRef.querySelector(".setting-group-content");if(o){L(e)&&typeof e.setNestingLevel=="function"&&e.setNestingLevel(this.nestingLevel+1);const a=e.draw(),l=this.deleteItemCfg??this.addItemCfg;if(l){const h=l.keyPrefix??((s=this.addItemCfg)==null?void 0:s.keyPrefix);h&&t.startsWith(h)&&this.addDeleteButtonToElement(a,t)}const r=o.querySelector(".sg-add-button-bottom");r?o.insertBefore(a,r):o.appendChild(a),dt.trackElement(a),_(a,this.nestingLevel+1),st(a,this.nestingLevel+1);const c=a.style.display;a.style.display="none",a.offsetHeight,a.style.display=c,this.updateNestingStyles()}}const i=this.getValues();this.initialValues=i,(n=this.onChange)==null||n.call(this,i)}addDeleteButtonToElement(t,e,i){let s=null;try{s=t.querySelector(":scope > .setting-group-title")}catch{s=null}if(!s){const r=Array.from(t.querySelectorAll(".setting-group-title"));for(const c of r)if(c.closest(".setting-group")===t){s=c;break}s||(s=r[0]??null)}if(!s)return;const n=s.querySelector(".actions-section");if(!n)return;const o=document.createElement("button");o.type="button",o.className="sg-delete-button",i?i.deleteItemCfg:this.deleteItemCfg??this.addItemCfg,o.title="Delete",o.style.cssText=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const yt="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let ct=(c=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(c|=0));for(;c--;)t+=yt[e[c]&63];return t};function Et(c){let t=0,e=c.parentElement;for(;e;)e.classList.contains("setting-group")&&e!==c&&t++,e=e.parentElement;return t}function _(c,t){const e=Math.min(Math.max(t,0),5);c.setAttribute("data-nesting-level",e.toString()),e>0?c.style.setProperty("--visual-indent",`${e*2}px`):(c.style.removeProperty("--visual-indent"),c.style.marginLeft="")}function tt(c,t=0){c.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach(i=>{const s=i,n=t+1;_(s,n),tt(s,n)})}const bt={maxLevel:5,spacingMultiplier:1,visualIndentMultiplier:2,enableAutoDetection:!0};class wt{constructor(t={}){this.observedElements=new Set,this.config={...bt,...t},this.config.enableAutoDetection&&this.setupAutoDetection()}setupAutoDetection(){this.observer=new MutationObserver(t=>{let e=!1;t.forEach(i=>{i.type==="childList"&&i.addedNodes.forEach(s=>{s instanceof HTMLElement&&(s.classList.contains("setting-group")?[s]:Array.from(s.querySelectorAll(".setting-group"))).length>0&&(e=!0)})}),e&&this.updateAllNesting()}),this.observer.observe(document.body,{childList:!0,subtree:!0})}trackElement(t){this.observedElements.add(t),this.updateElementNesting(t)}untrackElement(t){this.observedElements.delete(t)}updateElementNesting(t){const e=Et(t);this.applyNestingWithConfig(t,e)}updateAllNesting(){this.observedElements.forEach(t=>{t.isConnected?this.updateElementNesting(t):this.observedElements.delete(t)})}applyNestingWithConfig(t,e){const i=Math.min(Math.max(e,0),this.config.maxLevel);if(t.setAttribute("data-nesting-level",i.toString()),i>0){const s=i*this.config.visualIndentMultiplier;t.style.setProperty("--visual-indent",`${s}px`)}else t.style.removeProperty("--visual-indent"),t.style.marginLeft=""}recalculateNesting(t=document.body){t.querySelectorAll(".setting-group").forEach(i=>{const s=i;this.updateElementNesting(s),this.trackElement(s)})}getNestingStats(){const t={};return this.observedElements.forEach(e=>{const i=parseInt(e.getAttribute("data-nesting-level")||"0",10);t[i]=(t[i]||0)+1}),t}destroy(){this.observer&&(this.observer.disconnect(),this.observer=void 0),this.observedElements.clear()}}const ot=new wt;function X(c){if(c===null||typeof c!="object")return c;if(c instanceof Date)return new Date(c.getTime());if(c instanceof Array)return c.map(t=>X(t));if(typeof c=="object"){const t={};for(const e in c)Object.prototype.hasOwnProperty.call(c,e)&&(t[e]=X(c[e]));return t}return c}function xt(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 b{constructor(t={}){this.props=t,this.dataPropsPath="",this.id=t.id||ct(),this.value=this.props.default,this.desktop=this.props.default,this.title=t.title||"",this.includeGetJson=t.includeGetJson!==void 0?t.includeGetJson:!0}static SetUploadUrl(t){globalThis.DefaultUploadUrl=t,b.DefaultUploadUrl=t}static SetDefaultLanguage(t){globalThis.DefaultLanguage=t,b.DefaultLanguage=t}destroy(){throw new Error("Method not implemented.")}setOnChange(t){return this.onChange=t,this}setOnBlur(t){return this.onBlur=t,this}setDataPropsPath(t){this.dataPropsPath=t}getDataPropsPath(){return this.dataPropsPath}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=X(this.props),i=new t(e);return i.value=X(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 l=this.createIcon(t.icon,t.iconClassName);a.appendChild(l)}if(t.title){const l=this.createLabel(t.title,t.labelClassName);a.appendChild(l)}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||xt(t.inputType)),s.type=t.inputType,s.placeholder=t.placeholder||"",s.className=t.inputClassName||"",this.dataPropsPath&&s.setAttribute("data-test-id",this.dataPropsPath);const n=a=>{const l=a.target;let r=l.value;switch(t.inputType){case"number":r=Number(l.value);break;case"color":r=l.value;break;case"date":r=l.value;break;case"select":r=l.value;break;case"text":r=l.value;break;case"button":r=l.value;break;default:r=l.value}this.value=r,this.onChange&&this.onChange(this.value),this.props.detectChange&&this.props.detectChange(this.value)},o=a=>{a.target,this.onBlur&&this.onBlur(this.value)};return s.addEventListener("input",n),s.addEventListener("change",n),s.addEventListener("blur",o),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 H(c){return c instanceof b}function w(c){return c instanceof I}function et(c){return H(c)||w(c)}function U(c,t){for(const e in c)if(Object.prototype.hasOwnProperty.call(c,e)){const i=c[e];t(e,i)}}const Y=class Y{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.lastChangeTime=0,this.handleBlur=()=>{},this.pendingBlurHandler=null,this.originalDefaultValues={},this.nestingLevel=0,this.dataPropsPath="",this.hide=!1,this.id=t.id||ct(),this.title=t.title,this.settings=t.settings,this.isCollapsed=t.collapsed??!1,this.isMain=t.main??!1,this.custom=t.custom??!1,this.nestingLevel=0,this.includeGetJson=t.includeGetJson??!0,this.addItemCfg=t.addItem,this.deleteItemCfg=t.deleteItem,this.dataProps=t.dataProps,this.dataPropsPath=t.dataProps||"",this.hide=t.hide??!1,Object.assign(this,t.settings),this.initialValues=this.getValues(),this.originalDefaultValues=this.getDefaultValues(),this.propagateNestingLevel(),this.propagateDataPropsPath()}propagateNestingLevel(){const t=this.nestingLevel+1;U(this.settings,(e,i)=>{w(i)&&(i.nestingLevel=t,i.propagateNestingLevel())})}getNestingLevel(){return this.nestingLevel}setNestingLevel(t){this.nestingLevel=t,this.propagateNestingLevel(),this.elementRef&&this.updateNestingStyles()}getDataPropsPath(){return this.dataPropsPath}setDataPropsPath(t){this.dataPropsPath=t,this.propagateDataPropsPath()}propagateDataPropsPath(){U(this.settings,(t,e)=>{const i=String(t),s=this.dataPropsPath?`${this.dataPropsPath}_${i}`:i;(w(e)||H(e)&&typeof e.setDataPropsPath=="function")&&e.setDataPropsPath(s)})}updateNestingStyles(){this.elementRef&&(_(this.elementRef,this.nestingLevel),tt(this.elementRef,this.nestingLevel))}forceChildUIRefresh(){Object.entries(this.settings).forEach(([t,e])=>{try{if(w(e)){const i=e.getValues();e.setValue(i)}else if(typeof e.setValue=="function"){const i=e.value;i!==void 0&&e.setValue(i)}}catch(i){console.warn(`Error refreshing UI for setting ${t}:`,i)}})}removeSetting(t){var s;const e=this.settings[t];if(!e)return;if(delete this.settings[t],this.elementRef){const n=this.elementRef.querySelector(".setting-group-content");if(n){const o=Array.from(n.querySelectorAll(".setting-group, .setting"));for(const a of o){const l=a.id;if(l&&"id"in e&&typeof e.id=="string"&&l.includes(e.id)){a.remove();break}}}}typeof e.cleanup=="function"&&e.cleanup(),this.updateNestingStyles();const i=this.getValues();this.initialValues=i,(s=this.onChange)==null||s.call(this,i)}updateVisibility(){this.elementRef}clone(){const t={};U(this.settings,(s,n)=>{const o=String(s);typeof n.clone=="function"?t[o]=n.clone():(console.warn(`Setting with key '${o}' does not have a clone method. Copying reference.`),t[o]=n)});const e={title:this.title,settings:t,collapsed:this.isCollapsed,main:this.isMain,custom:this.custom,includeGetJson:this.includeGetJson,addItem:this.addItemCfg,deleteItem:this.deleteItemCfg,dataProps:this.dataProps,hide:this.hide},i=ht(e);return i.initialValues=this.getValues(),i}resetDefault(){const t=this.originalDefaultValues;this.setValue(t),this.onChange&&this.onChange(this.getValues())}setMobileValues(t){!t||typeof t!="object"||(Object.entries(t).forEach(([e,i])=>{const s=this.settings[e];s&&(w(s)||H(s))&&typeof s.setMobileValue=="function"&&s.setMobileValue(i)}),this.setValue(t),this.onChange&&this.onChange(this.getValues()))}getMobileValues(t){if(t===void 0){const e={};for(const i in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,i)){const s=this.settings[i];if(w(s))e[i]=s.getMobileValues();else{const n=s;e[i]=n.mobileValue!==void 0?n.mobileValue:n.value}}return e}else{const e=this.settings[t];if(!e)return;if(w(e))return e.getMobileValues();const i=e;return i.mobileValue!==void 0?i.mobileValue:i.value}}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.lastChangeTime=Date.now(),this.initialValues=i,t(i),this.updateVisibility()),this.isHandlingChange=!1},50))};return this.changeHandlers.clear(),U(this.settings,(i,s)=>{var n;if(w(s))s.setOnChange(()=>{const o=this.getValues();this.initialValues=o,t(o)}),this.changeHandlers.add(()=>t(this.getValues()));else if(H(s)){const o=()=>e();this.changeHandlers.add(o),s.setOnChange(o)}else{const o=()=>e();this.changeHandlers.add(o),(n=s.setOnChange)==null||n.call(s,o)}}),this}cleanup(){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.changeHandlers.clear()}setValue(t){if(!t||typeof t!="object")return;Object.entries(t).forEach(([i,s])=>{let n=this.settings[i];if(!n&&this.addItemCfg&&i.startsWith(this.addItemCfg.keyPrefix)){const o=i.slice(this.addItemCfg.keyPrefix.length),a=Number(o);if(Number.isFinite(a)){const l=this.addItemCfg.createItem(a);et(l)&&(this.addSetting(i,l),n=l)}}n&&(w(n)||H(n))&&typeof n.setValue=="function"&&n.setValue(s)}),setTimeout(()=>{this.forceChildUIRefresh()},0);const e=this.getValues();this.initialValues=e,this.onChange&&this.onChange(e)}wireChild(t){var i;const e=()=>{var n;const s=this.getValues();this.initialValues=s,(n=this.onChange)==null||n.call(this,s),this.updateVisibility()};w(t)?t.setOnChange(()=>e()):H(t)?t.setOnChange(()=>e()):(i=t.setOnChange)==null||i.call(t,()=>e())}addSetting(t,e){var s,n;if(this.settings[t]=e,this.wireChild(e),this.elementRef){const o=this.elementRef.querySelector(".setting-group-content");if(o){w(e)&&typeof e.setNestingLevel=="function"&&e.setNestingLevel(this.nestingLevel+1);const a=e.draw(),l=this.deleteItemCfg??this.addItemCfg;if(l){const p=l.keyPrefix??((s=this.addItemCfg)==null?void 0:s.keyPrefix);p&&t.startsWith(p)&&this.addDeleteButtonToElement(a,t)}const r=o.querySelector(".sg-add-button-bottom");r?o.insertBefore(a,r):o.appendChild(a),ot.trackElement(a),_(a,this.nestingLevel+1),tt(a,this.nestingLevel+1);const h=a.style.display;a.style.display="none",a.offsetHeight,a.style.display=h,this.updateNestingStyles()}}const i=this.getValues();this.initialValues=i,(n=this.onChange)==null||n.call(this,i)}addDeleteButtonToElement(t,e,i){let s=null;try{s=t.querySelector(":scope > .setting-group-title")}catch{s=null}if(!s){const r=Array.from(t.querySelectorAll(".setting-group-title"));for(const h of r)if(h.closest(".setting-group")===t){s=h;break}s||(s=r[0]??null)}if(!s)return;const n=s.querySelector(".actions-section");if(!n)return;const o=document.createElement("button");o.type="button",o.className="sg-delete-button",i?i.deleteItemCfg:this.deleteItemCfg??this.addItemCfg,o.title="Delete",o.style.cssText=`
29
2
  background: none;
30
3
  border: none;
31
4
  cursor: pointer;
@@ -42,7 +15,7 @@
42
15
  <path d="M2 4h12M5.333 4V2.667a1.333 1.333 0 0 1 1.334-1.334h2.666a1.333 1.333 0 0 1 1.334 1.334V4m2 0v9.333a1.333 1.333 0 0 1-1.334 1.334H4.667a1.333 1.333 0 0 1-1.334-1.334V4h8.667Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
43
16
  <path d="M6.667 7.333v4M9.333 7.333v4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
44
17
  </svg>
45
- `;o.innerHTML=a,o.addEventListener("mouseenter",()=>{o.style.backgroundColor="#fef2f2"}),o.addEventListener("mouseleave",()=>{o.style.backgroundColor="transparent"}),o.addEventListener("click",r=>{r.stopPropagation(),r.preventDefault(),this.showDeleteConfirmation().then(c=>{c&&(i&&i.deleteItemCfg?this.removeSetting(e):this.removeSetting(e))})});const l=n.querySelector(".setting-group-arrow");l?n.insertBefore(o,l):n.appendChild(o)}showDeleteConfirmation(){return new Promise(t=>{const e=document.createElement("div");e.className="sg-modal-overlay",e.style.cssText=`
18
+ `;o.innerHTML=a,o.addEventListener("mouseenter",()=>{o.style.backgroundColor="#fef2f2"}),o.addEventListener("mouseleave",()=>{o.style.backgroundColor="transparent"}),o.addEventListener("click",r=>{r.stopPropagation(),r.preventDefault(),this.showDeleteConfirmation().then(h=>{h&&(i&&i.deleteItemCfg?this.removeSetting(e):this.removeSetting(e))})});const l=n.querySelector(".setting-group-arrow");l?n.insertBefore(o,l):n.appendChild(o)}showDeleteConfirmation(){return new Promise(t=>{const e=document.createElement("div");e.className="sg-modal-overlay",e.style.cssText=`
46
19
  position: fixed;
47
20
  top: 0;
48
21
  left: 0;
@@ -97,29 +70,29 @@
97
70
  font-weight: 500;
98
71
  cursor: pointer;
99
72
  transition: all 0.2s;
100
- `,a.addEventListener("mouseenter",()=>{a.style.backgroundColor="#f9fafb",a.style.borderColor="#9ca3af"}),a.addEventListener("mouseleave",()=>{a.style.backgroundColor="white",a.style.borderColor="#d1d5db"}),l.addEventListener("mouseenter",()=>{l.style.backgroundColor="#dc2626"}),l.addEventListener("mouseleave",()=>{l.style.backgroundColor="#ef4444"});const r=()=>{e.style.opacity="0",i.style.transform="scale(0.95)",setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},200)};a.addEventListener("click",()=>{r(),t(!1)}),l.addEventListener("click",()=>{r(),t(!0)}),e.addEventListener("click",h=>{h.target===e&&(r(),t(!1))});const c=h=>{h.key==="Escape"&&(r(),t(!1),document.removeEventListener("keydown",c))};document.addEventListener("keydown",c),o.appendChild(a),o.appendChild(l),i.appendChild(s),i.appendChild(n),i.appendChild(o),e.appendChild(i),document.body.appendChild(e),requestAnimationFrame(()=>{e.style.opacity="1",i.style.transform="scale(1)"}),setTimeout(()=>l.focus(),100)})}getNextIndexFromPrefix(t){const e=new Set(Object.keys(this.settings).filter(s=>s.startsWith(t)).map(s=>{const n=Number(s.slice(t.length));return Number.isFinite(n)?n:-1}).filter(s=>s>=0));let i=0;for(;e.has(i);)i+=1;return i}calculateChanges(t,e){const i={};return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],a=e[n];JSON.stringify(o)!==JSON.stringify(a)&&(i[n]={from:o,to:a})}),i}getValues(t){if(t===void 0){const e={};for(const i in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,i)){const s=this.settings[i];if(L(s))e[i]=s.getValues();else{const n=s;e[i]=n.getValue?n.getValue():n.value}}return e}else{const e=this.settings[t];if(!e)return;if(L(e))return e.getValues();const i=e;return i.getValue?i.getValue():i.value}}getValuesForJson(t){var e;if(t===void 0){if(this.includeGetJson===!1)return null;const i={};for(const s in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,s)){const n=this.settings[s];if(L(n)){const o=n.getValuesForJson();o!==null&&(i[s]=o)}else{const o=n;if(o.includeGetJson!==!1)if(n instanceof U){const a=n.getRawValue();i[s]=a?I(a):null}else i[s]=o.value}}return(this.hide===!0||((e=this==null?void 0:this.groupProps)==null?void 0:e.hide)===!0)&&(i.hide=!0),i}else{const i=this.settings[t];if(!i)return;if(L(i))return i.includeGetJson===!1?null:i.getValuesForJson();{const s=i;if(s.includeGetJson===!1)return null;if(i instanceof U){const n=i.getRawValue();return n?I(n):null}return s.value}}}getDefaultValues(t){if(t===void 0){const e={};for(const i in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,i)){const s=this.settings[i];if(L(s))e[i]=s.getDefaultValues();else{const n=s;e[i]=n.default!==void 0?n.default:n.value}}return e}else{const e=this.settings[t];if(!e)return;if(L(e))return e.getDefaultValues();const i=e;return i.default!==void 0?i.default:i.value}}draw(){const t=document.createElement("div");t.className="setting-group",t.id=`setting-group-${this.id}`,tt.hiddenElements.add(t),this.hide&&(t.style.display="none"),this.isMain&&t.classList.add("main-group"),this.custom&&t.classList.add("custom_class"),_(t,this.nestingLevel);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");i.className="title-section";const s=document.createElement("h3");s.textContent=this.title,i.appendChild(s);const n=document.createElement("div");n.className="actions-section";const o=document.createElement("span");o.className="setting-group-arrow",o.innerHTML=`
73
+ `,a.addEventListener("mouseenter",()=>{a.style.backgroundColor="#f9fafb",a.style.borderColor="#9ca3af"}),a.addEventListener("mouseleave",()=>{a.style.backgroundColor="white",a.style.borderColor="#d1d5db"}),l.addEventListener("mouseenter",()=>{l.style.backgroundColor="#dc2626"}),l.addEventListener("mouseleave",()=>{l.style.backgroundColor="#ef4444"});const r=()=>{e.style.opacity="0",i.style.transform="scale(0.95)",setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},200)};a.addEventListener("click",()=>{r(),t(!1)}),l.addEventListener("click",()=>{r(),t(!0)}),e.addEventListener("click",p=>{p.target===e&&(r(),t(!1))});const h=p=>{p.key==="Escape"&&(r(),t(!1),document.removeEventListener("keydown",h))};document.addEventListener("keydown",h),o.appendChild(a),o.appendChild(l),i.appendChild(s),i.appendChild(n),i.appendChild(o),e.appendChild(i),document.body.appendChild(e),requestAnimationFrame(()=>{e.style.opacity="1",i.style.transform="scale(1)"}),setTimeout(()=>l.focus(),100)})}getNextIndexFromPrefix(t){const e=Object.keys(this.settings).filter(i=>i.startsWith(t)).map(i=>{const s=Number(i.slice(t.length));return Number.isFinite(s)?s:-1}).filter(i=>i>=0);return e.length?Math.max(...e)+1:0}calculateChanges(t,e){const i={};return new Set([...Object.keys(t),...Object.keys(e)]).forEach(n=>{const o=t[n],a=e[n];JSON.stringify(o)!==JSON.stringify(a)&&(i[n]={from:o,to:a})}),i}getValues(t){if(t===void 0){const e={};for(const i in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,i)){const s=this.settings[i];if(w(s))e[i]=s.getValues();else{const n=s;e[i]=n.getValue?n.getValue():n.value}}return e}else{const e=this.settings[t];if(!e)return;if(w(e))return e.getValues();const i=e;return i.getValue?i.getValue():i.value}}getValuesForJson(t){var e;if(t===void 0){if(this.includeGetJson===!1)return null;const i={};for(const s in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,s)){const n=this.settings[s];if(w(n)){const o=n.getValuesForJson();o!==null&&(i[s]=o)}else{const o=n;o.includeGetJson!==!1&&(i[s]=o.value)}}return(this.hide===!0||((e=this==null?void 0:this.groupProps)==null?void 0:e.hide)===!0)&&(i.hide=!0),i}else{const i=this.settings[t];if(!i)return;if(w(i))return i.includeGetJson===!1?null:i.getValuesForJson();{const s=i;return s.includeGetJson===!1?null:s.value}}}getDefaultValues(t){if(t===void 0){const e={};for(const i in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,i)){const s=this.settings[i];if(w(s))e[i]=s.getDefaultValues();else{const n=s;e[i]=n.default!==void 0?n.default:n.value}}return e}else{const e=this.settings[t];if(!e)return;if(w(e))return e.getDefaultValues();const i=e;return i.default!==void 0?i.default:i.value}}draw(){const t=document.createElement("div");t.className="setting-group",t.id=`setting-group-${this.id}`,Y.hiddenElements.add(t),this.hide&&(t.style.display="none"),this.isMain&&t.classList.add("main-group"),this.custom&&t.classList.add("custom_class"),_(t,this.nestingLevel);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");i.className="title-section";const s=document.createElement("h3");s.textContent=this.title,i.appendChild(s);const n=document.createElement("div");n.className="actions-section";const o=document.createElement("span");o.className="setting-group-arrow",o.innerHTML=`
101
74
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
102
75
  <path d="M4 6L8 10L12 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
103
76
  </svg>
104
- `,this.isCollapsed&&o.classList.add("rotated"),n.appendChild(o);const a=document.createElement("div");a.className="setting-group-content",this.isCollapsed&&(a.classList.add("collapsed"),e.classList.add("collapsed-view"),o.classList.add("rotated"),t.classList.add("collapsed")),this.isMain&&a.classList.add("main-content");const l=()=>{this.isCollapsed=!this.isCollapsed,a.classList.toggle("collapsed"),e.classList.toggle("collapsed-view"),o.classList.toggle("rotated"),t.classList.toggle("collapsed",this.isCollapsed),e.setAttribute("aria-expanded",(!this.isCollapsed).toString())};if(e.onclick=l,e.onkeydown=c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),l())},Object.keys(this.settings).length>0){for(const c in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,c)){const h=this.settings[c];L(h)&&typeof h.setNestingLevel=="function"&&h.setNestingLevel(this.nestingLevel+1);const p=h.draw();L(h)&&h.deleteItemCfg&&this.addDeleteButtonToElement(p,c,h),a.appendChild(p)}}else{const c=document.createElement("div");c.className="setting-group-empty",c.textContent="No settings in this group",a.appendChild(c)}if(this.addItemCfg){const c=document.createElement("button");c.type="button",c.className="sg-add-button-bottom",c.style.marginTop="8px";const h=`
77
+ `,this.isCollapsed&&o.classList.add("rotated"),n.appendChild(o);const a=document.createElement("div");a.className="setting-group-content",this.isCollapsed&&(a.classList.add("collapsed"),e.classList.add("collapsed-view"),o.classList.add("rotated"),t.classList.add("collapsed")),this.isMain&&a.classList.add("main-content");const l=()=>{this.isCollapsed=!this.isCollapsed,a.classList.toggle("collapsed"),e.classList.toggle("collapsed-view"),o.classList.toggle("rotated"),t.classList.toggle("collapsed",this.isCollapsed),e.setAttribute("aria-expanded",(!this.isCollapsed).toString())};if(e.onclick=l,e.onkeydown=h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),l())},Object.keys(this.settings).length>0){for(const h in this.settings)if(Object.prototype.hasOwnProperty.call(this.settings,h)){const p=this.settings[h];w(p)&&typeof p.setNestingLevel=="function"&&p.setNestingLevel(this.nestingLevel+1);const d=p.draw();w(p)&&p.deleteItemCfg&&this.addDeleteButtonToElement(d,h,p),a.appendChild(d)}}else{const h=document.createElement("div");h.className="setting-group-empty",h.textContent="No settings in this group",a.appendChild(h)}if(this.addItemCfg){const h=document.createElement("button");h.type="button",h.className="sg-add-button-bottom",h.style.marginTop="8px";const p=`
105
78
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none"
106
79
  xmlns="http://www.w3.org/2000/svg">
107
80
  <path d="M8 3.333v9.334M3.333 8h9.334" stroke="currentColor"
108
81
  stroke-width="1.5" stroke-linecap="round"/>
109
- </svg>`;c.innerHTML=`${h}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel??"Add"}</span>`,c.addEventListener("click",p=>{p.stopPropagation(),p.preventDefault();const g=this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix),C=this.addItemCfg.createItem(g);if(nt(C)){const m=`${this.addItemCfg.keyPrefix}${g}`;this.addSetting(m,C)}}),a.appendChild(c)}return e.appendChild(i),e.appendChild(n),t.appendChild(e),t.appendChild(a),this.elementRef=t,dt.trackElement(t),setTimeout(()=>{this.updateNestingStyles()},0),this.pendingBlurHandler&&(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"))}getJson(){return JSON.stringify(this.getValuesForJson(),null,2)}setJson(t){try{const e=JSON.parse(t);let i=e;const s=Object.keys(this.settings),n=Object.keys(e);if(!s.some(a=>n.includes(a))&&n.length===1){const a=n[0];i=e[a]}this.setValue(i)}catch(e){throw console.error("Invalid JSON provided to setJson:",e),new Error("Invalid JSON format")}}};tt.hiddenElements=new Set;let H=tt;function qt(d){return new ht(d)}class ht extends H{constructor(t){super(t);const e=Object.keys(this.settings)[0];this.activeTabId=e||""}getActiveTabId(){return this.activeTabId}switchToTab(t){var i;if(!this.settings[t]||this.activeTabId===t)return;this.activeTabId=t,this.updateTabUI();const e=this.getValues();this.initialValues=e,(i=this.onChange)==null||i.call(this,e)}getValues(t){return t!==void 0?super.getValues(t):{...super.getValues(),activeTabId:this.activeTabId}}updateTabUI(){if(!this.tabsContainer||!this.contentContainers)return;this.tabsContainer.querySelectorAll(".tab-button").forEach(e=>{e.getAttribute("data-tab-id")===this.activeTabId?e.classList.add("active"):e.classList.remove("active")}),Object.entries(this.contentContainers).forEach(([e,i])=>{e===this.activeTabId?i.classList.add("active"):i.classList.remove("active")})}draw(){const t=super.draw();t.classList.add("tabs-settings-container");const e=t.querySelector(".setting-group-content");if(!e)return t;e.innerHTML="";const i=document.createElement("div");i.className="tabs-title";const s=document.createElement("h3");s.textContent=this.title,i.appendChild(s);const n=document.createElement("div");n.className="tabs-header",this.tabsContainer=n;const o=document.createElement("div");if(o.className="tab-content",this.contentContainers={},Object.keys(this.settings).forEach((a,l)=>{const r=document.createElement("button");r.className="tab-button",r.type="button",r.setAttribute("data-tab-id",a),r.textContent=a,r.addEventListener("click",()=>this.switchToTab(a)),n.appendChild(r);const c=document.createElement("div");c.className="tab-panel",this.contentContainers[a]=c;const h=this.settings[a];h&&(L(h)&&typeof h.setNestingLevel=="function"&&h.setNestingLevel(this.getNestingLevel()+1),c.appendChild(h.draw())),o.appendChild(c),l===0&&!this.activeTabId&&(this.activeTabId=a)}),e.appendChild(i),e.appendChild(n),e.appendChild(o),!this.activeTabId){const a=Object.keys(this.settings)[0];this.activeTabId=a||""}return this.updateTabUI(),t}}function Lt(d){return new H(d)}function Jt(d){return d}class kt extends b{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 Zt="<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 V extends kt{constructor(t){super({...t,icon:t.icon||Zt,title:t.title||"Color",default:t.default?V.normalizeColorValue(t.default):"#000000"}),this.inputType="color",this.element=null,this.colorInputEl=null,this.textInputEl=null,this.detectChange=t.detectChange}static normalizeColorValue(t){return t.startsWith("var(--")?t:t.startsWith("#")?V.normalizeHexValue(t):t.includes(",")?V.rgbToHexStatic(t):V.normalizeHexValue(t)}static normalizeHexValue(t){return t=t.replace("#",""),t.length===3&&(t=t.split("").map(e=>e+e).join("")),t.length!==6?(console.warn(`Invalid hex value "${t}", using default "#000000"`),"#000000"):/^[0-9A-Fa-f]{6}$/.test(t)?`#${t.toLowerCase()}`:(console.warn(`Invalid hex value "${t}", using default "#000000"`),"#000000")}static rgbToHexStatic(t){const e=t.split(",").map(c=>parseInt(c.trim()));if(e.length!==3||e.some(isNaN))return console.warn(`Invalid RGB value "${t}", using default "#000000"`),"#000000";const[i,s,n]=e,o=Math.max(0,Math.min(255,i)),a=Math.max(0,Math.min(255,s)),l=Math.max(0,Math.min(255,n)),r=c=>{const h=c.toString(16);return h.length===1?"0"+h:h};return`#${r(o)}${r(a)}${r(l)}`}setValue(t){if(t===void 0){this.value="#000000",this.colorInputEl&&(this.colorInputEl.value="#000000"),this.textInputEl&&(this.textInputEl.value="#000000"),this.onChange&&this.onChange("#000000"),this.props.detectChange&&this.props.detectChange("#000000");return}if(typeof t=="string"){const e=V.normalizeColorValue(t);this.value=e,this.colorInputEl&&(this.colorInputEl.value=e),this.textInputEl&&(this.textInputEl.value=e),this.onChange&&this.onChange(e),this.props.detectChange&&this.props.detectChange(e)}else this.value="#000000",this.colorInputEl&&(this.colorInputEl.value="#000000"),this.textInputEl&&(this.textInputEl.value="#000000"),this.onChange&&this.onChange("#000000"),this.props.detectChange&&this.props.detectChange("#000000")}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}`}draw(){const t=document.createElement("div");if(t.className="color-setting-wrapper "+(this.props.wrapperClassName||""),this.props.title||this.props.icon){const m=document.createElement("div");if(m.className="icon-container",this.props.icon){const u=document.createElement("span");u.className="input-icon",u.innerHTML=this.props.icon,m.appendChild(u)}if(this.props.title){const u=document.createElement("span");u.className="input-label",u.textContent=this.props.title,m.appendChild(u)}t.appendChild(m)}const e=document.createElement("div");e.className="color-input-wrapper";const i=document.createElement("div");i.className="color-setting-tabs",i.style.display="flex",i.style.marginBottom="8px",i.style.gap="4px";const s=document.createElement("button");s.className="color-tab active",s.textContent="Solid";const n=document.createElement("button");n.className="color-tab",n.textContent="Global",i.appendChild(s),i.appendChild(n);const o=document.createElement("div");o.className="color-content-solid";const a=document.createElement("div");a.className="color-content-global",a.style.display="none",a.style.display="grid",a.style.gridTemplateColumns="repeat(auto-fill, minmax(30px, 1fr))",a.style.gap="8px";const l=()=>{try{if(console.log("ColorSetting: renderGlobalOptions called"),a.innerHTML="",!b){console.error("ColorSetting: Setting class is undefined");const u=document.createElement("div");u.textContent="Error: System error (Setting undefined)",a.appendChild(u);return}const m=b.GlobalVariables||{};if(console.log("ColorSetting: GlobalVariables:",m),!m||Object.keys(m).length===0){const u=document.createElement("div");u.textContent="No global colors defined",u.style.gridColumn="1 / -1",u.style.fontSize="12px",u.style.color="#666",a.appendChild(u);return}Object.entries(m).forEach(([u,f])=>{const v=document.createElement("button");v.className="global-color-btn",v.title=u,v.style.width="30px",v.style.height="30px",v.style.borderRadius="50%",v.style.border="1px solid #ddd",v.style.backgroundColor=f,v.style.cursor="pointer",this.value===`var(--${u})`&&(v.style.border="2px solid #2196f3"),v.addEventListener("click",y=>{var k,N;y.preventDefault();const x=`var(--${u})`;this.value=x,(k=this.onChange)==null||k.call(this,x),(N=this.detectChange)==null||N.call(this,x),Array.from(a.children).forEach(E=>{E.style.border="1px solid #ddd"}),v.style.border="2px solid #2196f3",h.style.backgroundColor=f}),a.appendChild(v)})}catch(m){console.error("ColorSetting: Error in renderGlobalOptions",m),a.innerHTML="Error loading global options"}};l(),s.addEventListener("click",m=>{m.preventDefault(),s.classList.add("active"),n.classList.remove("active"),o.style.display="flex",a.style.display="none",this.value&&this.value.startsWith("var(--")}),n.addEventListener("click",m=>{m.preventDefault(),n.classList.add("active"),s.classList.remove("active"),o.style.display="none",a.style.display="grid",l()}),this.value&&this.value.startsWith("var(--")?n.click():s.click();const r=m=>{const u=m.value.trim();if(!u)return e.classList.remove("error"),!0;const v=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(u);return v?e.classList.remove("error"):e.classList.add("error"),v},c=document.createElement("input");c.type="color",c.className="color-picker",c.value=this.value&&!this.value.startsWith("var(--")?this.value:"#000000",c.setAttribute("aria-label","Choose color"),c.setAttribute("title","Click to open color picker"),this.getDataPropsPath()&&c.setAttribute("data-test-id",this.getDataPropsPath()),this.colorInputEl=c;const h=document.createElement("div");h.className="color-preview";let p=this.value||"#000000";if(p.startsWith("var(--")){const m=p.replace("var(--","").replace(")","");p=(b.GlobalVariables||{})[m]||"#000000"}h.style.backgroundColor=p;const g=document.createElement("input");g.type="text",g.className="color-text-input",g.value=this.value||"",g.placeholder="#000000",g.setAttribute("pattern","#[0-9A-Fa-f]{6}"),g.setAttribute("title","Enter a hex color value (e.g., #ff0000)"),g.setAttribute("aria-label","Hex color value"),g.setAttribute("maxlength","7"),this.getDataPropsPath()&&g.setAttribute("data-test-id",`${this.getDataPropsPath()}_text`),this.textInputEl=g;const C=m=>{var f,v;let u=m.trim();if(u&&!u.startsWith("#")&&!u.startsWith("var(")&&/^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(u)&&(u="#"+u,this.textInputEl&&(this.textInputEl.value=u)),this.textInputEl&&r(this.textInputEl)){const y=V.normalizeColorValue(u);this.value=y,(f=this.onChange)==null||f.call(this,y),(v=this.detectChange)==null||v.call(this,y),this.colorInputEl&&(this.colorInputEl.value=y),h.style.backgroundColor=y}};return this.textInputEl.addEventListener("input",m=>{const u=m.target.value;C(u)}),this.textInputEl.addEventListener("paste",m=>{var f;m.preventDefault();const u=((f=m.clipboardData)==null?void 0:f.getData("text"))||"";this.textInputEl&&(this.textInputEl.value=u.trim(),C(u))}),this.textInputEl.addEventListener("keydown",m=>{var u,f,v;m.key==="Enter"&&(m.preventDefault(),C(((u=this.textInputEl)==null?void 0:u.value)||""),(f=this.textInputEl)==null||f.blur()),m.key==="Escape"&&(this.textInputEl&&this.value&&(this.textInputEl.value=this.value),(v=this.textInputEl)==null||v.blur(),e.classList.remove("error"))}),this.colorInputEl.addEventListener("input",m=>{var v,y;const u=m.target.value,f=V.normalizeColorValue(u);this.value=f,(v=this.onChange)==null||v.call(this,f),(y=this.detectChange)==null||y.call(this,f),this.textInputEl&&(this.textInputEl.value=f),h.style.backgroundColor=f,e.classList.remove("error")}),this.colorInputEl.addEventListener("change",m=>{var v,y;const u=m.target.value,f=V.normalizeColorValue(u);this.value=f,(v=this.onChange)==null||v.call(this,f),(y=this.detectChange)==null||y.call(this,f),this.textInputEl&&(this.textInputEl.value=f),h.style.backgroundColor=f}),o.appendChild(c),o.appendChild(h),o.appendChild(g),e.appendChild(i),e.appendChild(o),e.appendChild(a),t.appendChild(e),this.element=t,t}getElement(){return this.element}getNormalizedValue(){return this.value?V.normalizeColorValue(this.value):"#000000"}isValidHex(){return this.value?/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(this.value):!1}toRgb(){return this.isValidHex()?this.hexToRgb(this.value):"0, 0, 0"}}const _t=`
82
+ </svg>`;h.innerHTML=`${p}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel??"Add"}</span>`,h.addEventListener("click",d=>{d.stopPropagation(),d.preventDefault();const u=this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix),m=this.addItemCfg.createItem(u);if(et(m)){const f=`${this.addItemCfg.keyPrefix}${u}`;this.addSetting(f,m)}}),a.appendChild(h)}return e.appendChild(i),e.appendChild(n),t.appendChild(e),t.appendChild(a),this.elementRef=t,ot.trackElement(t),setTimeout(()=>{this.updateNestingStyles()},0),this.pendingBlurHandler&&(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"))}getJson(){return JSON.stringify(this.getValuesForJson(),null,2)}setJson(t){try{const e=JSON.parse(t);let i=e;const s=Object.keys(this.settings),n=Object.keys(e);if(!s.some(a=>n.includes(a))&&n.length===1){const a=n[0];i=e[a]}this.setValue(i)}catch(e){throw console.error("Invalid JSON provided to setJson:",e),new Error("Invalid JSON format")}}};Y.hiddenElements=new Set;let I=Y;function Lt(c){return new it(c)}class it extends I{constructor(t){super(t);const e=Object.keys(this.settings)[0];this.activeTabId=e||""}getActiveTabId(){return this.activeTabId}switchToTab(t){this.settings[t]&&(this.activeTabId=t,this.updateTabUI())}updateTabUI(){if(!this.tabsContainer||!this.contentContainers)return;this.tabsContainer.querySelectorAll(".tab-button").forEach(e=>{e.getAttribute("data-tab-id")===this.activeTabId?e.classList.add("active"):e.classList.remove("active")}),Object.entries(this.contentContainers).forEach(([e,i])=>{e===this.activeTabId?i.classList.add("active"):i.classList.remove("active")})}draw(){const t=super.draw();t.classList.add("tabs-settings-container");const e=t.querySelector(".setting-group-content");if(!e)return t;e.innerHTML="";const i=document.createElement("div");i.className="tabs-title";const s=document.createElement("h3");s.textContent=this.title,i.appendChild(s);const n=document.createElement("div");n.className="tabs-header",this.tabsContainer=n;const o=document.createElement("div");if(o.className="tab-content",this.contentContainers={},Object.keys(this.settings).forEach((a,l)=>{const r=document.createElement("button");r.className="tab-button",r.type="button",r.setAttribute("data-tab-id",a),r.textContent=a,r.addEventListener("click",()=>this.switchToTab(a)),n.appendChild(r);const h=document.createElement("div");h.className="tab-panel",this.contentContainers[a]=h;const p=this.settings[a];p&&(w(p)&&typeof p.setNestingLevel=="function"&&p.setNestingLevel(this.getNestingLevel()+1),h.appendChild(p.draw())),o.appendChild(h),l===0&&!this.activeTabId&&(this.activeTabId=a)}),e.appendChild(i),e.appendChild(n),e.appendChild(o),!this.activeTabId){const a=Object.keys(this.settings)[0];this.activeTabId=a||""}return this.updateTabUI(),t}}function ht(c){return new I(c)}function kt(c){return c}class pt extends b{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 Mt="<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 k extends pt{constructor(t){super({...t,icon:t.icon||Mt,title:t.title||"Color",default:t.default?k.normalizeColorValue(t.default):"#000000"}),this.inputType="color",this.element=null,this.colorInputEl=null,this.textInputEl=null,this.detectChange=t.detectChange}static normalizeColorValue(t){return t.startsWith("#")?k.normalizeHexValue(t):t.includes(",")?k.rgbToHexStatic(t):k.normalizeHexValue(t)}static normalizeHexValue(t){return t=t.replace("#",""),t.length===3&&(t=t.split("").map(e=>e+e).join("")),t.length!==6?(console.warn(`Invalid hex value "${t}", using default "#000000"`),"#000000"):/^[0-9A-Fa-f]{6}$/.test(t)?`#${t.toLowerCase()}`:(console.warn(`Invalid hex value "${t}", using default "#000000"`),"#000000")}static rgbToHexStatic(t){const e=t.split(",").map(h=>parseInt(h.trim()));if(e.length!==3||e.some(isNaN))return console.warn(`Invalid RGB value "${t}", using default "#000000"`),"#000000";const[i,s,n]=e,o=Math.max(0,Math.min(255,i)),a=Math.max(0,Math.min(255,s)),l=Math.max(0,Math.min(255,n)),r=h=>{const p=h.toString(16);return p.length===1?"0"+p:p};return`#${r(o)}${r(a)}${r(l)}`}setValue(t){if(t===void 0){this.value="#000000",this.colorInputEl&&(this.colorInputEl.value="#000000"),this.textInputEl&&(this.textInputEl.value="#000000"),this.onChange&&this.onChange("#000000"),this.props.detectChange&&this.props.detectChange("#000000");return}if(typeof t=="string"){const e=k.normalizeColorValue(t);this.value=e,this.colorInputEl&&(this.colorInputEl.value=e),this.textInputEl&&(this.textInputEl.value=e),this.onChange&&this.onChange(e),this.props.detectChange&&this.props.detectChange(e)}else this.value="#000000",this.colorInputEl&&(this.colorInputEl.value="#000000"),this.textInputEl&&(this.textInputEl.value="#000000"),this.onChange&&this.onChange("#000000"),this.props.detectChange&&this.props.detectChange("#000000")}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}`}draw(){const t=document.createElement("div");if(t.className="color-setting-wrapper "+(this.props.wrapperClassName||""),this.props.title||this.props.icon){const l=document.createElement("div");if(l.className="icon-container",this.props.icon){const r=document.createElement("span");r.className="input-icon",r.innerHTML=this.props.icon,l.appendChild(r)}if(this.props.title){const r=document.createElement("span");r.className="input-label",r.textContent=this.props.title,l.appendChild(r)}t.appendChild(l)}const e=document.createElement("div");e.className="color-input-wrapper";const i=l=>{const r=l.value.trim();if(!r)return e.classList.remove("error"),!0;const p=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(r);return p?e.classList.remove("error"):e.classList.add("error"),p},s=document.createElement("input");s.type="color",s.className="color-picker",s.value=this.value||"#000000",s.setAttribute("aria-label","Choose color"),s.setAttribute("title","Click to open color picker"),this.getDataPropsPath()&&s.setAttribute("data-test-id",this.getDataPropsPath()),this.colorInputEl=s;const n=document.createElement("div");n.className="color-preview";const o=this.value||"#000000";n.style.backgroundColor=o;const a=document.createElement("input");return a.type="text",a.className="color-text-input",a.value=this.value||"",a.placeholder="#000000",a.setAttribute("pattern","#[0-9A-Fa-f]{6}"),a.setAttribute("title","Enter a hex color value (e.g., #ff0000)"),a.setAttribute("aria-label","Hex color value"),a.setAttribute("maxlength","7"),this.getDataPropsPath()&&a.setAttribute("data-test-id",`${this.getDataPropsPath()}_text`),this.textInputEl=a,this.textInputEl.addEventListener("input",l=>{var h,p;let r=l.target.value.trim();if(this.textInputEl&&i(this.textInputEl)){const d=k.normalizeColorValue(r);this.value=d,(h=this.onChange)==null||h.call(this,d),(p=this.detectChange)==null||p.call(this,d),this.colorInputEl&&(this.colorInputEl.value=d),n.style.backgroundColor=d}}),this.colorInputEl.addEventListener("input",l=>{var p,d;const r=l.target.value,h=k.normalizeColorValue(r);this.value=h,(p=this.onChange)==null||p.call(this,h),(d=this.detectChange)==null||d.call(this,h),this.textInputEl&&(this.textInputEl.value=h),n.style.backgroundColor=h,e.classList.remove("error")}),this.colorInputEl.addEventListener("change",l=>{var p,d;const r=l.target.value,h=k.normalizeColorValue(r);this.value=h,(p=this.onChange)==null||p.call(this,h),(d=this.detectChange)==null||d.call(this,h),this.textInputEl&&(this.textInputEl.value=h),n.style.backgroundColor=h}),e.appendChild(s),e.appendChild(n),e.appendChild(a),t.appendChild(e),this.element=t,t}getElement(){return this.element}getNormalizedValue(){return this.value?k.normalizeColorValue(this.value):"#000000"}isValidHex(){return this.value?/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/.test(this.value):!1}toRgb(){return this.isValidHex()?this.hexToRgb(this.value):"0, 0, 0"}}const St=`
110
83
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
111
84
  <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"/>
112
85
  <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="0.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.5"/>
113
86
  <path d="M9 1V17C4.58172 17 1 13.4183 1 9C1 4.58172 4.58172 1 9 1Z" fill="#667085" stroke="#667085" stroke-width="0.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.5"/>
114
- </svg>`;class G extends b{constructor(t={}){super({...t,icon:t.icon||_t,title:t.title||"Color & Opacity",default:t.default||"#000000FF"}),this.inputType="color",this.element=null,this.colorInputEl=null,this.textInputEl=null,this.opacityInputEl=null,this.colorPreviewEl=null,this.detectChange=t.detectChange,this.value&&(this.value=G.normalizeHexWithOpacity(this.value))}static normalizeHexWithOpacity(t){return t=t.replace("#",""),t.length===3&&(t=t.split("").map(e=>e+e).join("")),t.length===6&&(t=t+"FF"),t.length===8&&/^[0-9A-Fa-f]{8}$/.test(t)?`#${t.toUpperCase()}`:(console.warn(`Invalid hex value "${t}", using default "#000000FF"`),"#000000FF")}getRgbColor(){return this.value?this.value.substring(0,7):"#000000"}getOpacityPercent(){if(!this.value)return 100;const t=this.value.substring(7,9),e=parseInt(t,16)/255;return Math.round(e*100)}static combineColorOpacity(t,e){const i=t.replace("#","").substring(0,6),n=Math.round(e/100*255).toString(16).toUpperCase().padStart(2,"0");return`#${i}${n}`}setValue(t){t===void 0||t===""?this.value="#000000FF":this.value=G.normalizeHexWithOpacity(t),this.updateInputElements(),this.updateColorPreview(),this.onChange&&this.onChange(this.value),this.detectChange&&this.detectChange(this.value)}updateInputElements(){this.value&&(this.colorInputEl&&(this.colorInputEl.value=this.getRgbColor()),this.textInputEl&&(this.textInputEl.value=this.value),this.opacityInputEl&&(this.opacityInputEl.value=this.getOpacityPercent().toString()))}updateColorPreview(){if(!this.colorPreviewEl||!this.value)return;const t=this.getRgbColor(),e=this.getOpacityPercent()/100,i=t.replace("#",""),s=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16);this.colorPreviewEl.style.backgroundColor=`rgba(${s}, ${n}, ${o}, ${e})`}handleColorChange(t){const e=this.getOpacityPercent(),i=G.combineColorOpacity(t,e);this.setValue(i)}handleTextInput(t){const e=/^#[0-9A-Fa-f]{8}$/.test(t.trim()),i=/^#[0-9A-Fa-f]{6}$/.test(t.trim());return e||i?(this.setValue(t),!0):!1}handleOpacityChange(t){const e=this.getRgbColor(),i=Math.max(0,Math.min(100,t)),s=G.combineColorOpacity(e,i);this.setValue(s)}draw(){const t=document.createElement("div");if(t.className="color-with-opacity-setting-wrapper "+(this.props.wrapperClassName||""),this.props.title||this.props.icon){const a=document.createElement("div");if(a.className="icon-container",this.props.icon){const l=document.createElement("span");l.className="input-icon",l.innerHTML=this.props.icon,a.appendChild(l)}if(this.props.title){const l=document.createElement("span");l.className="input-label",l.textContent=this.props.title,a.appendChild(l)}t.appendChild(a)}const e=document.createElement("div");e.className="color-with-opacity-input-wrapper",this.colorInputEl=document.createElement("input"),this.colorInputEl.type="color",this.colorInputEl.className="color-with-opacity-picker",this.getDataPropsPath()&&this.colorInputEl.setAttribute("data-test-id",`${this.getDataPropsPath()}_color`),this.colorPreviewEl=document.createElement("div"),this.colorPreviewEl.className="color-with-opacity-preview",this.textInputEl=document.createElement("input"),this.textInputEl.type="text",this.textInputEl.className="color-with-opacity-text-input",this.textInputEl.placeholder="#000000FF",this.getDataPropsPath()&&this.textInputEl.setAttribute("data-test-id",`${this.getDataPropsPath()}_text`),this.updateInputElements(),this.updateColorPreview();const i=a=>{let l=a.trim();l&&!l.startsWith("#")&&/^[0-9A-Fa-f]{6}$|^[0-9A-Fa-f]{8}$/.test(l)&&(l="#"+l,this.textInputEl&&(this.textInputEl.value=l));const r=this.handleTextInput(l);return r?(this.colorInputEl&&(this.colorInputEl.value=this.getRgbColor()),this.updateColorPreview(),e.classList.remove("error")):l===""?e.classList.remove("error"):e.classList.add("error"),r};this.colorInputEl.addEventListener("input",a=>{const l=a.target;this.handleColorChange(l.value),this.textInputEl&&(this.textInputEl.value=this.value||"#000000FF"),this.updateColorPreview()}),this.textInputEl.addEventListener("input",a=>{const l=a.target;i(l.value)}),this.textInputEl.addEventListener("paste",a=>{var r;a.preventDefault();const l=((r=a.clipboardData)==null?void 0:r.getData("text"))||"";this.textInputEl&&(this.textInputEl.value=l.trim(),i(l))}),this.textInputEl.addEventListener("keydown",a=>{var l,r,c;a.key==="Enter"&&(a.preventDefault(),i(((l=this.textInputEl)==null?void 0:l.value)||""),(r=this.textInputEl)==null||r.blur()),a.key==="Escape"&&(this.textInputEl&&this.value&&(this.textInputEl.value=this.value),(c=this.textInputEl)==null||c.blur(),e.classList.remove("error"))}),this.textInputEl.addEventListener("blur",a=>{const l=a.target;l.value.trim()===""&&(l.value=this.value||"#000000FF",e.classList.remove("error"))}),this.colorPreviewEl.addEventListener("click",()=>{var a;(a=this.colorInputEl)==null||a.click()}),e.appendChild(this.colorInputEl),e.appendChild(this.colorPreviewEl),e.appendChild(this.textInputEl);const s=document.createElement("div");s.className="color-with-opacity-opacity-wrapper",this.opacityInputEl=document.createElement("input"),this.opacityInputEl.type="number",this.opacityInputEl.className="color-with-opacity-opacity-input",this.opacityInputEl.value=this.getOpacityPercent().toString(),this.opacityInputEl.min="0",this.opacityInputEl.max="100",this.opacityInputEl.step="1",this.opacityInputEl.placeholder="100",this.getDataPropsPath()&&this.opacityInputEl.setAttribute("data-test-id",`${this.getDataPropsPath()}_opacity`);const n=document.createElement("span");n.className="color-with-opacity-opacity-suffix",n.textContent="%",this.opacityInputEl.addEventListener("input",a=>{const l=a.target,r=parseFloat(l.value);isNaN(r)||(this.handleOpacityChange(r),this.textInputEl&&(this.textInputEl.value=this.value||"#000000FF"),this.updateColorPreview())}),this.opacityInputEl.addEventListener("blur",a=>{const l=a.target;let r=parseFloat(l.value);isNaN(r)&&(r=this.getOpacityPercent()),r=Math.max(0,Math.min(100,r)),l.value=r.toString(),this.handleOpacityChange(r),this.textInputEl&&(this.textInputEl.value=this.value||"#000000FF"),this.updateColorPreview()}),s.appendChild(this.opacityInputEl),s.appendChild(n);const o=document.createElement("div");return o.className="color-with-opacity-controls-wrapper",o.appendChild(e),o.appendChild(s),t.appendChild(o),this.element=t,this.updateInputElements(),this.updateColorPreview(),t}getElement(){return this.element}getValue(){return this.value}getRgbaValue(){if(!this.value)return"rgba(0, 0, 0, 1)";const t=this.getRgbColor(),e=this.getOpacityPercent()/100,i=t.replace("#",""),s=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16);return`rgba(${s}, ${n}, ${o}, ${e})`}getColorAndOpacity(){return{color:this.getRgbColor(),opacity:this.getOpacityPercent()}}}class Xt extends b{constructor(t={}){super(t),this.inputType="text",t.onChange&&this.setOnChange(t.onChange)}setValue(t){this.value=t,this.textareaEl&&(this.textareaEl.value=t),this.onChange&&this.onChange(t),this.props.detectChange&&this.props.detectChange(t)}draw(){const t=document.createElement("div");if(t.className="html-setting-wrapper "+(this.props.wrapperClassName||""),this.props.title||this.props.icon){const n=document.createElement("div");if(n.className="icon-container",this.props.icon){const o=this.createIcon(this.props.icon);n.appendChild(o)}if(this.props.title){const o=this.createLabel(this.props.title);n.appendChild(o)}t.appendChild(n)}const e=document.createElement("textarea");this.textareaEl=e,e.value=this.value||"",e.placeholder=this.props.placeholder||"Paste your HTML here...",e.className="html-setting-textarea "+(this.props.textareaClassName||""),e.rows=this.props.rows||6,this.getDataPropsPath()&&e.setAttribute("data-test-id",this.getDataPropsPath()),this.props.maxLength!==void 0&&(e.maxLength=this.props.maxLength),this.props.className&&e.classList.add(this.props.className);const i=n=>{const a=n.target.value;this.value=a,this.onChange&&this.onChange(this.value),this.props.detectChange&&this.props.detectChange(this.value)},s=n=>{this.onBlur&&this.value!==void 0&&this.onBlur(this.value)};return e.addEventListener("input",i),e.addEventListener("change",i),e.addEventListener("blur",s),t.appendChild(e),t}}class B extends b{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=document.createElement("div");if(t.className="number-setting-wrapper "+(this.props.wrapperClassName||""),this.props.title||this.props.icon){const s=document.createElement("div");if(s.className="icon-container",this.props.icon){const n=document.createElement("span");n.className="input-icon",n.innerHTML=this.props.icon,s.appendChild(n)}if(this.props.title){const n=document.createElement("span");n.className="input-label",n.textContent=this.props.title,s.appendChild(n)}t.appendChild(s)}const e=document.createElement("div");e.className="number-setting-input-container";const i=document.createElement("input");if(i.type="number",i.className="number-setting-input "+(this.props.inputClassName||""),i.value=String(this.value??""),i.placeholder=this.props.placeholder||"",this.getDataPropsPath()&&i.setAttribute("data-test-id",this.getDataPropsPath()),this.props.minValue!==void 0&&(i.min=String(this.props.minValue)),this.props.maxValue!==void 0&&(i.max=String(this.props.maxValue)),this.props.step!==void 0&&(i.step=String(this.props.step)),i.addEventListener("input",()=>{const s=this.props.minValue??Number.MIN_SAFE_INTEGER,n=this.props.maxValue??Number.MAX_SAFE_INTEGER;let o=Number(i.value);o<s&&(o=s),o>n&&(o=n),String(o)!==i.value&&(i.value=String(o)),this.setValue(o)}),i.addEventListener("blur",()=>{var n,o;const s=this.validateValue(Number(i.value));s!==Number(i.value)&&(i.value=String(s),this.setValue(s)),(o=(n=this.props).onBlur)==null||o.call(n)}),e.appendChild(i),this.props.suffix&&this.props.suffix!=="none"){const s=document.createElement("span");s.className="suffix-label",s.textContent=this.props.suffix,e.appendChild(s)}return t.appendChild(e),this.inputElement=i,t}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,t!==void 0&&this.setValue(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 Kt=`
87
+ </svg>`;class $ extends b{constructor(t={}){super({...t,icon:t.icon||St,title:t.title||"Color & Opacity",default:t.default||"#000000FF"}),this.inputType="color",this.element=null,this.colorInputEl=null,this.textInputEl=null,this.opacityInputEl=null,this.colorPreviewEl=null,this.detectChange=t.detectChange,this.value&&(this.value=$.normalizeHexWithOpacity(this.value))}static normalizeHexWithOpacity(t){return t=t.replace("#",""),t.length===3&&(t=t.split("").map(e=>e+e).join("")),t.length===6&&(t=t+"FF"),t.length===8&&/^[0-9A-Fa-f]{8}$/.test(t)?`#${t.toUpperCase()}`:(console.warn(`Invalid hex value "${t}", using default "#000000FF"`),"#000000FF")}getRgbColor(){return this.value?this.value.substring(0,7):"#000000"}getOpacityPercent(){if(!this.value)return 100;const t=this.value.substring(7,9),e=parseInt(t,16)/255;return Math.round(e*100)}static combineColorOpacity(t,e){const i=t.replace("#","").substring(0,6),n=Math.round(e/100*255).toString(16).toUpperCase().padStart(2,"0");return`#${i}${n}`}setValue(t){t===void 0||t===""?this.value="#000000FF":this.value=$.normalizeHexWithOpacity(t),this.updateInputElements(),this.updateColorPreview(),this.onChange&&this.onChange(this.value),this.detectChange&&this.detectChange(this.value)}updateInputElements(){this.value&&(this.colorInputEl&&(this.colorInputEl.value=this.getRgbColor()),this.textInputEl&&(this.textInputEl.value=this.value),this.opacityInputEl&&(this.opacityInputEl.value=this.getOpacityPercent().toString()))}updateColorPreview(){if(!this.colorPreviewEl||!this.value)return;const t=this.getRgbColor(),e=this.getOpacityPercent()/100,i=t.replace("#",""),s=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16);this.colorPreviewEl.style.backgroundColor=`rgba(${s}, ${n}, ${o}, ${e})`}handleColorChange(t){const e=this.getOpacityPercent(),i=$.combineColorOpacity(t,e);this.setValue(i)}handleTextInput(t){const e=/^#[0-9A-Fa-f]{8}$/.test(t.trim()),i=/^#[0-9A-Fa-f]{6}$/.test(t.trim());return e||i?(this.setValue(t),!0):!1}handleOpacityChange(t){const e=this.getRgbColor(),i=Math.max(0,Math.min(100,t)),s=$.combineColorOpacity(e,i);this.setValue(s)}draw(){const t=document.createElement("div");if(t.className="color-with-opacity-setting-wrapper "+(this.props.wrapperClassName||""),this.props.title||this.props.icon){const o=document.createElement("div");if(o.className="icon-container",this.props.icon){const a=document.createElement("span");a.className="input-icon",a.innerHTML=this.props.icon,o.appendChild(a)}if(this.props.title){const a=document.createElement("span");a.className="input-label",a.textContent=this.props.title,o.appendChild(a)}t.appendChild(o)}const e=document.createElement("div");e.className="color-with-opacity-input-wrapper",this.colorInputEl=document.createElement("input"),this.colorInputEl.type="color",this.colorInputEl.className="color-with-opacity-picker",this.getDataPropsPath()&&this.colorInputEl.setAttribute("data-test-id",`${this.getDataPropsPath()}_color`),this.colorPreviewEl=document.createElement("div"),this.colorPreviewEl.className="color-with-opacity-preview",this.textInputEl=document.createElement("input"),this.textInputEl.type="text",this.textInputEl.className="color-with-opacity-text-input",this.textInputEl.placeholder="#000000FF",this.getDataPropsPath()&&this.textInputEl.setAttribute("data-test-id",`${this.getDataPropsPath()}_text`),this.updateInputElements(),this.updateColorPreview(),this.colorInputEl.addEventListener("input",o=>{const a=o.target;this.handleColorChange(a.value),this.textInputEl&&(this.textInputEl.value=this.value||"#000000FF"),this.updateColorPreview()}),this.textInputEl.addEventListener("input",o=>{const a=o.target;this.handleTextInput(a.value)?(this.colorInputEl&&(this.colorInputEl.value=this.getRgbColor()),this.updateColorPreview(),e.classList.remove("error")):a.value.trim()===""?e.classList.remove("error"):e.classList.add("error")}),this.textInputEl.addEventListener("blur",o=>{const a=o.target;a.value.trim()===""&&(a.value=this.value||"#000000FF",e.classList.remove("error"))}),this.colorPreviewEl.addEventListener("click",()=>{var o;(o=this.colorInputEl)==null||o.click()}),e.appendChild(this.colorInputEl),e.appendChild(this.colorPreviewEl),e.appendChild(this.textInputEl);const i=document.createElement("div");i.className="color-with-opacity-opacity-wrapper",this.opacityInputEl=document.createElement("input"),this.opacityInputEl.type="number",this.opacityInputEl.className="color-with-opacity-opacity-input",this.opacityInputEl.value=this.getOpacityPercent().toString(),this.opacityInputEl.min="0",this.opacityInputEl.max="100",this.opacityInputEl.step="1",this.opacityInputEl.placeholder="100",this.getDataPropsPath()&&this.opacityInputEl.setAttribute("data-test-id",`${this.getDataPropsPath()}_opacity`);const s=document.createElement("span");s.className="color-with-opacity-opacity-suffix",s.textContent="%",this.opacityInputEl.addEventListener("input",o=>{const a=o.target,l=parseFloat(a.value);isNaN(l)||(this.handleOpacityChange(l),this.textInputEl&&(this.textInputEl.value=this.value||"#000000FF"),this.updateColorPreview())}),this.opacityInputEl.addEventListener("blur",o=>{const a=o.target;let l=parseFloat(a.value);isNaN(l)&&(l=this.getOpacityPercent()),l=Math.max(0,Math.min(100,l)),a.value=l.toString(),this.handleOpacityChange(l),this.textInputEl&&(this.textInputEl.value=this.value||"#000000FF"),this.updateColorPreview()}),i.appendChild(this.opacityInputEl),i.appendChild(s);const n=document.createElement("div");return n.className="color-with-opacity-controls-wrapper",n.appendChild(e),n.appendChild(i),t.appendChild(n),this.element=t,this.updateInputElements(),this.updateColorPreview(),t}getElement(){return this.element}getValue(){return this.value}getRgbaValue(){if(!this.value)return"rgba(0, 0, 0, 1)";const t=this.getRgbColor(),e=this.getOpacityPercent()/100,i=t.replace("#",""),s=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16);return`rgba(${s}, ${n}, ${o}, ${e})`}getColorAndOpacity(){return{color:this.getRgbColor(),opacity:this.getOpacityPercent()}}}class It extends b{constructor(t={}){super(t),this.inputType="text",t.onChange&&this.setOnChange(t.onChange)}setValue(t){this.value=t,this.textareaEl&&(this.textareaEl.value=t),this.onChange&&this.onChange(t),this.props.detectChange&&this.props.detectChange(t)}draw(){const t=document.createElement("div");if(t.className="html-setting-wrapper "+(this.props.wrapperClassName||""),this.props.title||this.props.icon){const n=document.createElement("div");if(n.className="icon-container",this.props.icon){const o=this.createIcon(this.props.icon);n.appendChild(o)}if(this.props.title){const o=this.createLabel(this.props.title);n.appendChild(o)}t.appendChild(n)}const e=document.createElement("textarea");this.textareaEl=e,e.value=this.value||"",e.placeholder=this.props.placeholder||"Paste your HTML here...",e.className="html-setting-textarea "+(this.props.textareaClassName||""),e.rows=this.props.rows||6,this.getDataPropsPath()&&e.setAttribute("data-test-id",this.getDataPropsPath()),this.props.maxLength!==void 0&&(e.maxLength=this.props.maxLength),this.props.className&&e.classList.add(this.props.className);const i=n=>{const a=n.target.value;this.value=a,this.onChange&&this.onChange(this.value),this.props.detectChange&&this.props.detectChange(this.value)},s=n=>{this.onBlur&&this.value!==void 0&&this.onBlur(this.value)};return e.addEventListener("input",i),e.addEventListener("change",i),e.addEventListener("blur",s),t.appendChild(e),t}}class S extends b{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=document.createElement("div");if(t.className="number-setting-wrapper "+(this.props.wrapperClassName||""),this.props.title||this.props.icon){const s=document.createElement("div");if(s.className="icon-container",this.props.icon){const n=document.createElement("span");n.className="input-icon",n.innerHTML=this.props.icon,s.appendChild(n)}if(this.props.title){const n=document.createElement("span");n.className="input-label",n.textContent=this.props.title,s.appendChild(n)}t.appendChild(s)}const e=document.createElement("div");e.className="number-setting-input-container";const i=document.createElement("input");if(i.type="number",i.className="number-setting-input "+(this.props.inputClassName||""),i.value=String(this.value??""),i.placeholder=this.props.placeholder||"",this.getDataPropsPath()&&i.setAttribute("data-test-id",this.getDataPropsPath()),this.props.minValue!==void 0&&(i.min=String(this.props.minValue)),this.props.maxValue!==void 0&&(i.max=String(this.props.maxValue)),this.props.step!==void 0&&(i.step=String(this.props.step)),i.addEventListener("input",()=>{const s=this.props.minValue??Number.MIN_SAFE_INTEGER,n=this.props.maxValue??Number.MAX_SAFE_INTEGER;let o=Number(i.value);o<s&&(o=s),o>n&&(o=n),String(o)!==i.value&&(i.value=String(o)),this.setValue(o)}),i.addEventListener("blur",()=>{var n,o;const s=this.validateValue(Number(i.value));s!==Number(i.value)&&(i.value=String(s),this.setValue(s)),(o=(n=this.props).onBlur)==null||o.call(n)}),e.appendChild(i),this.props.suffix&&this.props.suffix!=="none"){const s=document.createElement("span");s.className="suffix-label",s.textContent=this.props.suffix,e.appendChild(s)}return t.appendChild(e),this.inputElement=i,t}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,t!==void 0&&this.setValue(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 Nt=`
115
88
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
116
89
  <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"/>
117
90
  <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"/>
118
- </svg>`;class Mt extends B{constructor(t={}){const e={title:"Opacity",suffix:"%",minValue:0,maxValue:100,step:1,default:t.default??100,icon:Kt,...t};super(e),this.inputType="number",this.mobileValue=t.mobile}getMobileValue(){return this.mobileValue}setMobileValue(t){this.mobileValue=t,t!==void 0&&this.setValue(t)}}const Yt=`
91
+ </svg>`;class dt extends S{constructor(t={}){const e={title:"Opacity",suffix:"%",minValue:0,maxValue:100,step:1,default:t.default??100,icon:Nt,...t};super(e),this.inputType="number",this.mobileValue=t.mobile}getMobileValue(){return this.mobileValue}setMobileValue(t){this.mobileValue=t,t!==void 0&&this.setValue(t)}}const Vt=`
119
92
  <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">
120
93
  <polyline points="6 9 12 15 18 9"></polyline>
121
94
  </svg>
122
- `;class Q extends b{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.clickOutsideListener=null,this.resizeListener=null,t.options&&(this._options=[...t.options]),t.getOptions&&this._options.push(...t.getOptions()),t.getOptionsAsync&&(this.isLoading=!0),this.value!==void 0){const e=this._options.findIndex(i=>i.value===this.value);e>=0&&(this.selectedOptionIndex=e)}}setValue(t){super.setValue(t);const e=this._options.findIndex(i=>i.value===t);e>=0?this.selectedOptionIndex=e:this.selectedOptionIndex=null,this.updateButtonText()}createOption(t,e){const i=document.createElement("li");return i.classList.add("select-option"),i.textContent=t.name,i.dataset.index=String(e),this.selectedOptionIndex===e&&i.classList.add("selected"),i}draw(){const t=document.createElement("div");if(t.classList.add("select-container"),this.container=t,this.props.icon||this.props.title){const n=document.createElement("div");if(n.className="icon-container",this.props.icon){const o=this.createIcon(this.props.icon);n.appendChild(o)}if(this.props.title){const o=this.createLabel(this.props.title);n.appendChild(o)}t.appendChild(n)}else{const n=document.createElement("div");t.appendChild(n)}const e=document.createElement("div");e.classList.add("select-button"),this.getDataPropsPath()&&e.setAttribute("data-test-id",this.getDataPropsPath()),this.isLoading?e.classList.add("loading"):e.textContent=this.selectedOptionIndex!==null?this._options[this.selectedOptionIndex].name:this.props.placeholder||"Select an option",e.onclick=()=>{var n,o;this.isLoading||(this.isOpen=!this.isOpen,this.isOpen?this.checkDropdownPosition():this.cleanupDropdownPosition(),(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(o=this.svgContainer)==null||o.classList.toggle("open",this.isOpen))},t.appendChild(e),this.buttonEl=e;const i=document.createElement("ul");i.classList.add("select-options"),this._options.forEach((n,o)=>{const a=this.createOption(n,o);a.onclick=l=>this.selectOption(l,o,e),i.appendChild(a)}),document.body.appendChild(i);const s=document.createElement("div");return s.classList.add("svg-container"),s.innerHTML=Yt,t.appendChild(s),this.optionsListEl=i,this.svgContainer=s,this.props.getOptionsAsync&&(this.isLoading=!0,this.updateButtonText(),this.props.getOptionsAsync().then(n=>{this._options.push(...n),this.isLoading=!1,this.updateOptionsList(),this.updateButtonText()}).catch(n=>{console.error("Failed to fetch async options:",n),this.isLoading=!1,this.updateButtonText("Failed to load options")})),this.clickOutsideListener&&document.removeEventListener("click",this.clickOutsideListener),this.clickOutsideListener=n=>{var o,a;this.isOpen&&!t.contains(n.target)&&(this.isOpen=!1,(o=this.optionsListEl)==null||o.classList.remove("open"),(a=this.svgContainer)==null||a.classList.remove("open"),this.cleanupDropdownPosition())},document.addEventListener("click",this.clickOutsideListener),this.resizeListener&&window.removeEventListener("resize",this.resizeListener),this.resizeListener=()=>{this.isOpen&&this.checkDropdownPosition()},window.addEventListener("resize",this.resizeListener),t}checkDropdownPosition(){if(!this.optionsListEl||!this.buttonEl||!this.container)return;const t=this.buttonEl.getBoundingClientRect();this.optionsListEl.classList.remove("dropdown-up"),this.optionsListEl.style.position="fixed",this.optionsListEl.style.top=`${t.bottom+2}px`,this.optionsListEl.style.bottom="auto",this.optionsListEl.style.left=`${t.left}px`,this.optionsListEl.style.right="auto",this.optionsListEl.style.width=`${t.width}px`;const e=Math.min(this._options.length*40+12,280);if(window.innerHeight-t.bottom<e){const s=Math.max(10,window.innerHeight-e-10);this.optionsListEl.style.top=`${s}px`}}selectOption(t,e,i){var n,o;const s=this._options[e];s&&(this.setValue(s.value),this.selectedOptionIndex=e,this.isOpen=!1,i.textContent=s.name,(n=this.optionsListEl)==null||n.classList.remove("open"),(o=this.svgContainer)==null||o.classList.remove("open"),this.cleanupDropdownPosition(),this.optionsListEl&&this.optionsListEl.querySelectorAll(".select-option").forEach((l,r)=>{r===e?l.classList.add("selected"):l.classList.remove("selected")}))}cleanupDropdownPosition(){this.optionsListEl&&(this.optionsListEl.style.position="",this.optionsListEl.style.top="",this.optionsListEl.style.bottom="",this.optionsListEl.style.left="",this.optionsListEl.style.right="",this.optionsListEl.style.width="")}updateOptionsList(){if(this.optionsListEl){if(this.optionsListEl.innerHTML="",this._options.length===0){const t=document.createElement("li");t.classList.add("select-option","empty-message"),t.textContent="No options available",this.optionsListEl.appendChild(t);return}this._options.forEach((t,e)=>{const i=this.createOption(t,e);i.onclick=s=>{this.buttonEl&&this.selectOption(s,e,this.buttonEl)},this.optionsListEl.appendChild(i)})}}updateButtonText(t){if(!this.buttonEl)return;if(this.isLoading){this.buttonEl.classList.add("loading"),this.buttonEl.textContent=this.props.loadingText||"Loading options...";return}this.buttonEl.classList.remove("loading","error");let e;t?((t.includes("Failed")||t.includes("Error"))&&this.buttonEl.classList.add("error"),e=t):this.selectedOptionIndex!==null&&this._options[this.selectedOptionIndex]?e=this._options[this.selectedOptionIndex].name:e=this.props.placeholder||"Select an option",this.buttonEl.textContent=e}destroy(){this.clickOutsideListener&&(document.removeEventListener("click",this.clickOutsideListener),this.clickOutsideListener=null),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.cleanupDropdownPosition(),this.optionsListEl&&this.optionsListEl.parentNode&&this.optionsListEl.parentNode.removeChild(this.optionsListEl),super.destroy()}}class St extends b{constructor(t={}){super(t),this.inputType="button",this.value||(this.value="center")}draw(){const t=document.createElement("div");t.className="align-setting-wrapper";const e=document.createElement("label");e.className="align-setting-label",e.textContent=this.title||"Align",t.appendChild(e);const i=document.createElement("div");return i.className="align-options-container",[{name:"left",icon:`
95
+ `;class Z extends b{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.clickOutsideListener=null,this.resizeListener=null,t.options&&(this._options=[...t.options]),t.getOptions&&this._options.push(...t.getOptions()),t.getOptionsAsync&&(this.isLoading=!0),this.value!==void 0){const e=this._options.findIndex(i=>i.value===this.value);e>=0&&(this.selectedOptionIndex=e)}}setValue(t){super.setValue(t);const e=this._options.findIndex(i=>i.value===t);e>=0?this.selectedOptionIndex=e:this.selectedOptionIndex=null,this.updateButtonText()}createOption(t,e){const i=document.createElement("li");return i.classList.add("select-option"),i.textContent=t.name,i.dataset.index=String(e),this.selectedOptionIndex===e&&i.classList.add("selected"),i}draw(){const t=document.createElement("div");if(t.classList.add("select-container"),this.container=t,this.props.icon||this.props.title){const n=document.createElement("div");if(n.className="icon-container",this.props.icon){const o=this.createIcon(this.props.icon);n.appendChild(o)}if(this.props.title){const o=this.createLabel(this.props.title);n.appendChild(o)}t.appendChild(n)}else{const n=document.createElement("div");t.appendChild(n)}const e=document.createElement("div");e.classList.add("select-button"),this.getDataPropsPath()&&e.setAttribute("data-test-id",this.getDataPropsPath()),this.isLoading?e.classList.add("loading"):e.textContent=this.selectedOptionIndex!==null?this._options[this.selectedOptionIndex].name:this.props.placeholder||"Select an option",e.onclick=()=>{var n,o;this.isLoading||(this.isOpen=!this.isOpen,this.isOpen?this.checkDropdownPosition():this.cleanupDropdownPosition(),(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(o=this.svgContainer)==null||o.classList.toggle("open",this.isOpen))},t.appendChild(e),this.buttonEl=e;const i=document.createElement("ul");i.classList.add("select-options"),this._options.forEach((n,o)=>{const a=this.createOption(n,o);a.onclick=l=>this.selectOption(l,o,e),i.appendChild(a)}),document.body.appendChild(i);const s=document.createElement("div");return s.classList.add("svg-container"),s.innerHTML=Vt,t.appendChild(s),this.optionsListEl=i,this.svgContainer=s,this.props.getOptionsAsync&&(this.isLoading=!0,this.updateButtonText(),this.props.getOptionsAsync().then(n=>{this._options.push(...n),this.isLoading=!1,this.updateOptionsList(),this.updateButtonText()}).catch(n=>{console.error("Failed to fetch async options:",n),this.isLoading=!1,this.updateButtonText("Failed to load options")})),this.clickOutsideListener&&document.removeEventListener("click",this.clickOutsideListener),this.clickOutsideListener=n=>{var o,a;this.isOpen&&!t.contains(n.target)&&(this.isOpen=!1,(o=this.optionsListEl)==null||o.classList.remove("open"),(a=this.svgContainer)==null||a.classList.remove("open"),this.cleanupDropdownPosition())},document.addEventListener("click",this.clickOutsideListener),this.resizeListener&&window.removeEventListener("resize",this.resizeListener),this.resizeListener=()=>{this.isOpen&&this.checkDropdownPosition()},window.addEventListener("resize",this.resizeListener),t}checkDropdownPosition(){if(!this.optionsListEl||!this.buttonEl||!this.container)return;const t=this.buttonEl.getBoundingClientRect();this.optionsListEl.classList.remove("dropdown-up"),this.optionsListEl.style.position="fixed",this.optionsListEl.style.top=`${t.bottom+2}px`,this.optionsListEl.style.bottom="auto",this.optionsListEl.style.left=`${t.left}px`,this.optionsListEl.style.right="auto",this.optionsListEl.style.width=`${t.width}px`;const e=Math.min(this._options.length*40+12,280);if(window.innerHeight-t.bottom<e){const s=Math.max(10,window.innerHeight-e-10);this.optionsListEl.style.top=`${s}px`}}selectOption(t,e,i){var n,o;const s=this._options[e];s&&(this.setValue(s.value),this.selectedOptionIndex=e,this.isOpen=!1,i.textContent=s.name,(n=this.optionsListEl)==null||n.classList.remove("open"),(o=this.svgContainer)==null||o.classList.remove("open"),this.cleanupDropdownPosition(),this.optionsListEl&&this.optionsListEl.querySelectorAll(".select-option").forEach((l,r)=>{r===e?l.classList.add("selected"):l.classList.remove("selected")}))}cleanupDropdownPosition(){this.optionsListEl&&(this.optionsListEl.style.position="",this.optionsListEl.style.top="",this.optionsListEl.style.bottom="",this.optionsListEl.style.left="",this.optionsListEl.style.right="",this.optionsListEl.style.width="")}updateOptionsList(){if(this.optionsListEl){if(this.optionsListEl.innerHTML="",this._options.length===0){const t=document.createElement("li");t.classList.add("select-option","empty-message"),t.textContent="No options available",this.optionsListEl.appendChild(t);return}this._options.forEach((t,e)=>{const i=this.createOption(t,e);i.onclick=s=>{this.buttonEl&&this.selectOption(s,e,this.buttonEl)},this.optionsListEl.appendChild(i)})}}updateButtonText(t){if(!this.buttonEl)return;if(this.isLoading){this.buttonEl.classList.add("loading"),this.buttonEl.textContent=this.props.loadingText||"Loading options...";return}this.buttonEl.classList.remove("loading","error");let e;t?((t.includes("Failed")||t.includes("Error"))&&this.buttonEl.classList.add("error"),e=t):this.selectedOptionIndex!==null&&this._options[this.selectedOptionIndex]?e=this._options[this.selectedOptionIndex].name:e=this.props.placeholder||"Select an option",this.buttonEl.textContent=e}destroy(){this.clickOutsideListener&&(document.removeEventListener("click",this.clickOutsideListener),this.clickOutsideListener=null),this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null),this.cleanupDropdownPosition(),this.optionsListEl&&this.optionsListEl.parentNode&&this.optionsListEl.parentNode.removeChild(this.optionsListEl),super.destroy()}}class ut extends b{constructor(t={}){super(t),this.inputType="button",this.value||(this.value="center")}draw(){const t=document.createElement("div");t.className="align-setting-wrapper";const e=document.createElement("label");e.className="align-setting-label",e.textContent=this.title||"Align",t.appendChild(e);const i=document.createElement("div");return i.className="align-options-container",[{name:"left",icon:`
123
96
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
124
97
  <path d="M10.5 7.5C11.1989 7.5 11.5484 7.5 11.824 7.38582C12.1916 7.23358 12.4836 6.94157 12.6358 6.57402C12.75 6.29837 12.75 5.94891 12.75 5.25C12.75 4.55109 12.75 4.20163 12.6358 3.92598C12.4836 3.55843 12.1916 3.26642 11.824 3.11418C11.5484 3 11.1989 3 10.5 3L4.5 3C3.80109 3 3.45163 3 3.17598 3.11418C2.80843 3.26642 2.51642 3.55843 2.36418 3.92597C2.25 4.20163 2.25 4.55109 2.25 5.25C2.25 5.94891 2.25 6.29837 2.36418 6.57402C2.51642 6.94157 2.80843 7.23358 3.17598 7.38582C3.45163 7.5 3.80109 7.5 4.5 7.5L10.5 7.5Z"
125
98
  stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
@@ -140,30 +113,30 @@
140
113
  <path d="M13.5 15C14.1989 15 14.5484 15 14.824 14.8858C15.1916 14.7336 15.4836 14.4416 15.6358 14.074C15.75 13.7984 15.75 13.4489 15.75 12.75C15.75 12.0511 15.75 11.7016 15.6358 11.426C15.4836 11.0584 15.1916 10.7664 14.824 10.6142C14.5484 10.5 14.1989 10.5 13.5 10.5H4.5C3.80109 10.5 3.45163 10.5 3.17598 10.6142C2.80843 10.7664 2.51642 11.0584 2.36418 11.426C2.25 11.7016 2.25 12.0511 2.25 12.75C2.25 13.4489 2.25 13.7984 2.36418 14.074C2.51642 14.4416 2.80843 14.7336 3.17597 14.8858C3.45163 15 3.80109 15 4.5 15L13.5 15Z"
141
114
  stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
142
115
  </svg>
143
- `}].forEach(n=>{const o=document.createElement("button");o.className="align-option-button",o.innerHTML=n.icon,this.getDataPropsPath()&&o.setAttribute("data-test-id",`${this.getDataPropsPath()}_${n.name}`),this.value===n.name&&o.classList.add("selected"),o.addEventListener("click",()=>{var a;i.querySelectorAll(".align-option-button").forEach(l=>l.classList.remove("selected")),o.classList.add("selected"),this.value=n.name,(a=this.onChange)==null||a.call(this,this.value)}),i.appendChild(o)}),t.appendChild(i),t}}class Qt extends b{constructor(t){super(t),this.inputType="button",this.bgWithAlpha="rgba(145, 158, 171, 0.08)"}draw(){const t=document.createElement("button");t.className="button-setting "+(this.props.className||""),t.textContent=this.props.label,t.style.borderColor=this.props.borderColor||"rgba(145, 158, 171, 0.32)",this.getDataPropsPath()&&t.setAttribute("data-test-id",this.getDataPropsPath());const e=this.props.backgroundColor||"rgba(0,0,0,0)",i=this.props.textColor||"black";t.style.backgroundColor=e,t.style.color=i;let s=e;const n=e.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/i);if(n){let a=+n[1],l=+n[2],r=+n[3],c=+n[4];c>=1?(a=Math.round(a*.9),l=Math.round(l*.9),r=Math.round(r*.9)):c=Math.min(1,c+.12),s=`rgba(${a},${l},${r},${c})`}t.addEventListener("mouseenter",()=>{console.log("hoverBg",s),t.style.setProperty("background-color",s,"important")}),t.addEventListener("mouseleave",()=>{t.style.setProperty("background-color",e,"important")}),t.addEventListener("click",()=>{var a,l;return(l=(a=this.props).onClick)==null?void 0:l.call(a)});const o=document.createElement("div");return o.className="button-setting-wrapper "+(this.props.wrapperClassName||""),o.appendChild(t),o}}class te extends b{constructor(t={}){super(t),this.inputType={width:"number",height:"number"},this.aspectRatio=1,this.isUpdating=!1;const e=t.width||0,i=t.height||0;this.value||(this.value={width:e,height:i}),this.minWidth=t.minWidth??0,this.maxWidth=t.maxWidth,this.minHeight=t.minHeight??0,this.maxHeight=t.maxHeight,this.locked=t.locked??!1,this.value.height>0&&(this.aspectRatio=this.value.width/this.value.height),this.widthSetting=new B({title:"Width",default:this.value.width,suffix:"px",minValue:this.minWidth,maxValue:this.maxWidth,icon:ee}),this.heightSetting=new B({title:"Height",default:this.value.height,suffix:"px",minValue:this.minHeight,maxValue:this.maxHeight,icon:ie}),this.widthSetting.setOnChange(this.handleWidthChange.bind(this)),this.heightSetting.setOnChange(this.handleHeightChange.bind(this))}handleWidthChange(t){if(!this.isUpdating&&!(isNaN(t)||t<0)){t=Math.max(this.minWidth,t),this.maxWidth&&t>this.maxWidth&&(t=this.maxWidth),this.isUpdating=!0;try{let e=t,i=this.value.height;this.locked&&this.aspectRatio>0&&(i=Math.round(e/this.aspectRatio),this.maxHeight&&i>this.maxHeight&&(i=this.maxHeight,e=Math.round(i*this.aspectRatio),this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,i>0&&(this.aspectRatio=e/i)))),this.value={width:e,height:i},this.widthSetting.setValue(e),this.locked&&this.heightSetting.setValue(i),this.onChange&&this.onChange(this.value)}finally{this.isUpdating=!1}}}handleHeightChange(t){if(!this.isUpdating&&!(isNaN(t)||t<0)){t=Math.max(this.minHeight,t),this.maxHeight&&t>this.maxHeight&&(t=this.maxHeight),this.isUpdating=!0;try{let e=t,i=this.value.width;this.locked&&this.aspectRatio>0&&(i=Math.round(e*this.aspectRatio),this.maxWidth&&i>this.maxWidth&&(i=this.maxWidth,e=Math.round(i/this.aspectRatio),this.maxHeight&&e>this.maxHeight&&(e=this.maxHeight,e>0&&(this.aspectRatio=i/e)))),this.value={width:i,height:e},this.locked&&this.widthSetting.setValue(i),this.heightSetting.setValue(e),this.onChange&&this.onChange(this.value)}finally{this.isUpdating=!1}}}toggleLock(t){if(this.locked=!this.locked,this.locked&&this.value){const{width:i,height:s}=this.value;s>0&&(this.aspectRatio=i/s)}t.innerHTML=this.getLockSVG(this.locked),t.setAttribute("aria-pressed",String(this.locked)),t.title=this.locked?"Unlock aspect ratio":"Lock aspect ratio";const e=t.closest(".dimension-setting-container");e&&(this.locked?e.classList.add("aspect-locked"):e.classList.remove("aspect-locked")),t.style.transform="scale(0.9)",setTimeout(()=>{t.style.transform="scale(1)"},100)}getLockSVG(t){return t?`
116
+ `}].forEach(n=>{const o=document.createElement("button");o.className="align-option-button",o.innerHTML=n.icon,this.getDataPropsPath()&&o.setAttribute("data-test-id",`${this.getDataPropsPath()}_${n.name}`),this.value===n.name&&o.classList.add("selected"),o.addEventListener("click",()=>{var a;i.querySelectorAll(".align-option-button").forEach(l=>l.classList.remove("selected")),o.classList.add("selected"),this.value=n.name,(a=this.onChange)==null||a.call(this,this.value)}),i.appendChild(o)}),t.appendChild(i),t}}class Tt extends b{constructor(t){super(t),this.inputType="button",this.bgWithAlpha="rgba(145, 158, 171, 0.08)"}draw(){const t=document.createElement("button");t.className="button-setting "+(this.props.className||""),t.textContent=this.props.label,t.style.borderColor=this.props.borderColor||"rgba(145, 158, 171, 0.32)",this.getDataPropsPath()&&t.setAttribute("data-test-id",this.getDataPropsPath());const e=this.props.backgroundColor||"rgba(0,0,0,0)",i=this.props.textColor||"black";t.style.backgroundColor=e,t.style.color=i;let s=e;const n=e.match(/^rgba\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)$/i);if(n){let a=+n[1],l=+n[2],r=+n[3],h=+n[4];h>=1?(a=Math.round(a*.9),l=Math.round(l*.9),r=Math.round(r*.9)):h=Math.min(1,h+.12),s=`rgba(${a},${l},${r},${h})`}t.addEventListener("mouseenter",()=>{console.log("hoverBg",s),t.style.setProperty("background-color",s,"important")}),t.addEventListener("mouseleave",()=>{t.style.setProperty("background-color",e,"important")}),t.addEventListener("click",()=>{var a,l;return(l=(a=this.props).onClick)==null?void 0:l.call(a)});const o=document.createElement("div");return o.className="button-setting-wrapper "+(this.props.wrapperClassName||""),o.appendChild(t),o}}class Pt extends b{constructor(t={}){super(t),this.inputType={width:"number",height:"number"},this.aspectRatio=1,this.isUpdating=!1;const e=t.width||0,i=t.height||0;this.value||(this.value={width:e,height:i}),this.minWidth=t.minWidth??0,this.maxWidth=t.maxWidth,this.minHeight=t.minHeight??0,this.maxHeight=t.maxHeight,this.locked=t.locked??!1,this.value.height>0&&(this.aspectRatio=this.value.width/this.value.height),this.widthSetting=new S({title:"Width",default:this.value.width,suffix:"px",minValue:this.minWidth,maxValue:this.maxWidth,icon:Ot}),this.heightSetting=new S({title:"Height",default:this.value.height,suffix:"px",minValue:this.minHeight,maxValue:this.maxHeight,icon:Ht}),this.widthSetting.setOnChange(this.handleWidthChange.bind(this)),this.heightSetting.setOnChange(this.handleHeightChange.bind(this))}handleWidthChange(t){if(!this.isUpdating&&!(isNaN(t)||t<0)){t=Math.max(this.minWidth,t),this.maxWidth&&t>this.maxWidth&&(t=this.maxWidth),this.isUpdating=!0;try{let e=t,i=this.value.height;this.locked&&this.aspectRatio>0&&(i=Math.round(e/this.aspectRatio),this.maxHeight&&i>this.maxHeight&&(i=this.maxHeight,e=Math.round(i*this.aspectRatio),this.maxWidth&&e>this.maxWidth&&(e=this.maxWidth,i>0&&(this.aspectRatio=e/i)))),this.value={width:e,height:i},this.widthSetting.setValue(e),this.locked&&this.heightSetting.setValue(i),this.onChange&&this.onChange(this.value)}finally{this.isUpdating=!1}}}handleHeightChange(t){if(!this.isUpdating&&!(isNaN(t)||t<0)){t=Math.max(this.minHeight,t),this.maxHeight&&t>this.maxHeight&&(t=this.maxHeight),this.isUpdating=!0;try{let e=t,i=this.value.width;this.locked&&this.aspectRatio>0&&(i=Math.round(e*this.aspectRatio),this.maxWidth&&i>this.maxWidth&&(i=this.maxWidth,e=Math.round(i/this.aspectRatio),this.maxHeight&&e>this.maxHeight&&(e=this.maxHeight,e>0&&(this.aspectRatio=i/e)))),this.value={width:i,height:e},this.locked&&this.widthSetting.setValue(i),this.heightSetting.setValue(e),this.onChange&&this.onChange(this.value)}finally{this.isUpdating=!1}}}toggleLock(t){if(this.locked=!this.locked,this.locked&&this.value){const{width:i,height:s}=this.value;s>0&&(this.aspectRatio=i/s)}t.innerHTML=this.getLockSVG(this.locked),t.setAttribute("aria-pressed",String(this.locked)),t.title=this.locked?"Unlock aspect ratio":"Lock aspect ratio";const e=t.closest(".dimension-setting-container");e&&(this.locked?e.classList.add("aspect-locked"):e.classList.remove("aspect-locked")),t.style.transform="scale(0.9)",setTimeout(()=>{t.style.transform="scale(1)"},100)}getLockSVG(t){return t?`
144
117
  <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none">
145
118
  <path d="M2.91663 4.58333V3.33333C2.91663 2.18274 3.84937 1.25 4.99996 1.25C6.00786 1.25 6.84859 1.96573 7.04162 2.91667M3.66663 8.75H6.33329C7.03336 8.75 7.38339 8.75 7.65078 8.61376C7.88598 8.49392 8.07721 8.30269 8.19705 8.06749C8.33329 7.8001 8.33329 7.45007 8.33329 6.75V6.58333C8.33329 5.88327 8.33329 5.53323 8.19705 5.26584C8.07721 5.03064 7.88598 4.83942 7.65078 4.71958C7.38339 4.58333 7.03336 4.58333 6.33329 4.58333H3.66663C2.96656 4.58333 2.61653 4.58333 2.34914 4.71958C2.11394 4.83942 1.92271 5.03064 1.80287 5.26584C1.66663 5.53323 1.66663 5.88327 1.66663 6.58333V6.75C1.66663 7.45007 1.66663 7.8001 1.80287 8.06749C1.92271 8.30269 2.11394 8.49392 2.34914 8.61376C2.61653 8.75 2.96656 8.75 3.66663 8.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
146
119
  </svg>`:`
147
120
  <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none">
148
121
  <path d="M2.91663 4.58333V3.33333C2.91663 2.18274 3.84937 1.25 4.99996 1.25M3.66663 8.75H6.33329C7.03336 8.75 7.38339 8.75 7.65078 8.61376C7.88598 8.49392 8.07721 8.30269 8.19705 8.06749C8.33329 7.8001 8.33329 7.45007 8.33329 6.75V6.58333C8.33329 5.88327 8.33329 5.53323 8.19705 5.26584C8.07721 5.03064 7.88598 4.83942 7.65078 4.71958C7.38339 4.58333 7.03336 4.58333 6.33329 4.58333H3.66663C2.96656 4.58333 2.61653 4.58333 2.34914 4.71958C2.11394 4.83942 1.92271 5.03064 1.80287 5.26584C1.66663 5.53323 1.66663 5.88327 1.66663 6.58333V6.75C1.66663 7.45007 1.66663 7.8001 1.80287 8.06749C1.92271 8.30269 2.11394 8.49392 2.34914 8.61376C2.61653 8.75 2.96656 8.75 3.66663 8.75Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
149
- </svg>`}setValue(t){if(t&&typeof t.width=="number"&&typeof t.height=="number"){let e=Math.max(this.minWidth,t.width);this.maxWidth&&(e=Math.min(this.maxWidth,e));let i=Math.max(this.minHeight,t.height);this.maxHeight&&(i=Math.min(this.maxHeight,i)),this.value={width:e,height:i},this.locked&&this.value.height>0&&(this.aspectRatio=this.value.width/this.value.height),this.isUpdating=!0;try{this.widthSetting.setValue(this.value.width),this.heightSetting.setValue(this.value.height)}finally{this.isUpdating=!1}}}draw(){const t=document.createElement("div");t.className="dimension-setting-container",this.locked&&t.classList.add("aspect-locked");const e=this.widthSetting.draw(),i=this.heightSetting.draw(),s=document.createElement("div");s.className="dimension-bracket";const n=document.createElement("button");return n.className="dimension-lock-icon",n.setAttribute("type","button"),n.setAttribute("aria-pressed",String(this.locked)),n.setAttribute("aria-label",this.locked?"Unlock aspect ratio":"Lock aspect ratio"),n.title=this.locked?"Unlock aspect ratio":"Lock aspect ratio",n.innerHTML=this.getLockSVG(this.locked),n.onclick=o=>{o.preventDefault(),this.toggleLock(n)},s.appendChild(n),t.appendChild(e),t.appendChild(s),t.appendChild(i),t}isLocked(){return this.locked}setLocked(t){if(this.locked!==t){if(this.locked=t,this.locked&&this.value){const{width:i,height:s}=this.value;s>0&&(this.aspectRatio=i/s)}const e=document.querySelector(".dimension-setting-container .dimension-lock-icon");if(e instanceof HTMLElement){e.innerHTML=this.getLockSVG(this.locked),e.setAttribute("aria-pressed",String(this.locked)),e.title=this.locked?"Unlock aspect ratio":"Lock aspect ratio";const i=e.closest(".dimension-setting-container");i&&(this.locked?i.classList.add("aspect-locked"):i.classList.remove("aspect-locked"))}}}}const ee=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
122
+ </svg>`}setValue(t){if(t&&typeof t.width=="number"&&typeof t.height=="number"){let e=Math.max(this.minWidth,t.width);this.maxWidth&&(e=Math.min(this.maxWidth,e));let i=Math.max(this.minHeight,t.height);this.maxHeight&&(i=Math.min(this.maxHeight,i)),this.value={width:e,height:i},this.locked&&this.value.height>0&&(this.aspectRatio=this.value.width/this.value.height),this.isUpdating=!0;try{this.widthSetting.setValue(this.value.width),this.heightSetting.setValue(this.value.height)}finally{this.isUpdating=!1}}}draw(){const t=document.createElement("div");t.className="dimension-setting-container",this.locked&&t.classList.add("aspect-locked");const e=this.widthSetting.draw(),i=this.heightSetting.draw(),s=document.createElement("div");s.className="dimension-bracket";const n=document.createElement("button");return n.className="dimension-lock-icon",n.setAttribute("type","button"),n.setAttribute("aria-pressed",String(this.locked)),n.setAttribute("aria-label",this.locked?"Unlock aspect ratio":"Lock aspect ratio"),n.title=this.locked?"Unlock aspect ratio":"Lock aspect ratio",n.innerHTML=this.getLockSVG(this.locked),n.onclick=o=>{o.preventDefault(),this.toggleLock(n)},s.appendChild(n),t.appendChild(e),t.appendChild(s),t.appendChild(i),t}isLocked(){return this.locked}setLocked(t){if(this.locked!==t){if(this.locked=t,this.locked&&this.value){const{width:i,height:s}=this.value;s>0&&(this.aspectRatio=i/s)}const e=document.querySelector(".dimension-setting-container .dimension-lock-icon");if(e instanceof HTMLElement){e.innerHTML=this.getLockSVG(this.locked),e.setAttribute("aria-pressed",String(this.locked)),e.title=this.locked?"Unlock aspect ratio":"Lock aspect ratio";const i=e.closest(".dimension-setting-container");i&&(this.locked?i.classList.add("aspect-locked"):i.classList.remove("aspect-locked"))}}}}const Ot=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
150
123
  <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="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
151
- </svg>`,ie=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
124
+ </svg>`,Ht=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
152
125
  <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="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
153
- </svg>`,it=`
126
+ </svg>`,Q=`
154
127
  <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
155
128
  <path d="M5 10.5L7.5 8M7.5 8L10 10.5M7.5 8V13.625M12.5 10.9643C13.2634 10.3338 13.75 9.37996 13.75 8.3125C13.75 6.41402 12.211 4.875 10.3125 4.875C10.1759 4.875 10.0482 4.80375 9.97882 4.68609C9.16379 3.30302 7.65902 2.375 5.9375 2.375C3.34867 2.375 1.25 4.47367 1.25 7.0625C1.25 8.35381 1.77215 9.52317 2.61684 10.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
156
129
  </svg>
157
- `,se=`
130
+ `,$t=`
158
131
  <svg width="91" height="71" viewBox="0 0 91 71" fill="none" xmlns="http://www.w3.org/2000/svg">
159
132
  <rect width="91" height="71" rx="4" fill="#F2F4F7"/>
160
133
  <path d="M37 31.5L39.5 29M39.5 29L42 31.5M39.5 29V34.625M44.5 31.9643C45.2634 31.3338 45.75 30.38 45.75 29.3125C45.75 27.414 44.211 25.875 42.3125 25.875C42.1759 25.875 42.0482 25.8037 41.9788 25.6861C41.1638 24.303 39.659 23.375 37.9375 23.375C35.3487 23.375 33.25 25.4737 33.25 28.0625C33.25 29.3538 33.7721 30.5232 34.6168 31.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
161
134
  </svg>
162
- `,ne=`
135
+ `,At=`
163
136
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
164
137
  <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"/>
165
138
  </svg>
166
- `,oe=`
139
+ `,Bt=`
167
140
  <svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29" fill="none">
168
141
  <!-- Top dot -->
169
142
  <circle cx="14.5" cy="3" r="1.5" fill="#02CC59" opacity="1"/>
@@ -182,227 +155,103 @@
182
155
  <!-- Top-left dot -->
183
156
  <circle cx="6.7" cy="6.7" r="1.5" fill="#02CC59" opacity="0.3"/>
184
157
  </svg>
185
- `;class et extends b{constructor(t={}){super(t),this.inputType="button",this.previewWrapper=null,this.previewEl=null,this.emptyStateEl=null,this.errorContainer=null,this.messageListener=null,this.loadingSpinner=null,this.props.delete===void 0&&(this.props.delete=!0),this.props.maxFileSizeMB===void 0&&(this.props.maxFileSizeMB=5),!this.value&&t.defaultUrl&&t.defaultUrl!==""&&(this.value=t.defaultUrl),this.setupMessageListener()}setupMessageListener(){this.messageListener=t=>{var e;if(t.data&&t.data.type==="FILE_MANAGER_IMAGE_SELECTED"&&t.data.settingId===this.id){const i=t.data.imageUrl;i&&typeof i=="string"&&(this.value=i,this.updatePreviewState(i),(e=this.onChange)==null||e.call(this,i),this.hideError())}},window.addEventListener("message",this.messageListener)}cleanupMessageListener(){this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null)}setValue(t){super.setValue(t),this.previewWrapper&&this.previewEl&&this.updatePreviewState(t)}destroy(){this.cleanupMessageListener()}showError(t){this.errorContainer&&(this.errorContainer.textContent=t,this.errorContainer.style.display="block",setTimeout(()=>{this.errorContainer&&(this.errorContainer.style.display="none")},5e3))}hideError(){this.errorContainer&&(this.errorContainer.style.display="none")}showLoading(){!this.previewWrapper||!this.loadingSpinner||(this.previewWrapper.classList.add("loading"),this.previewWrapper.style.display="flex",this.loadingSpinner.style.display="block",this.previewEl&&(this.previewEl.style.display="none"))}hideLoading(){!this.previewWrapper||!this.loadingSpinner||(this.previewWrapper.classList.remove("loading"),this.loadingSpinner.style.display="none")}validateFileSize(t){const e=(this.props.maxFileSizeMB||5)*1024*1024;if(t.size>e){const i=this.props.maxFileSizeMB||5,s=(t.size/(1024*1024)).toFixed(1);return this.showError(`File size (${s}MB) exceeds maximum limit of ${i}MB`),!1}return!0}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");if(t&&t!==""){this.showLoading(),s&&s instanceof HTMLElement&&(s.style.display="none"),e&&e.classList.remove("no-image"),i&&(i.innerHTML=`
186
- <span class="upload-icon">${it}</span>
158
+ `;class st extends b{constructor(t={}){super(t),this.inputType="button",this.previewWrapper=null,this.previewEl=null,this.emptyStateEl=null,this.errorContainer=null,this.messageListener=null,this.loadingSpinner=null,this.props.delete===void 0&&(this.props.delete=!0),this.props.maxFileSizeMB===void 0&&(this.props.maxFileSizeMB=5),!this.value&&t.defaultUrl&&t.defaultUrl!==""&&(this.value=t.defaultUrl),this.setupMessageListener()}setupMessageListener(){this.messageListener=t=>{var e;if(t.data&&t.data.type==="FILE_MANAGER_IMAGE_SELECTED"&&t.data.settingId===this.id){const i=t.data.imageUrl;i&&typeof i=="string"&&(this.value=i,this.updatePreviewState(i),(e=this.onChange)==null||e.call(this,i),this.hideError())}},window.addEventListener("message",this.messageListener)}cleanupMessageListener(){this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null)}setValue(t){super.setValue(t),this.previewWrapper&&this.previewEl&&this.updatePreviewState(t)}destroy(){this.cleanupMessageListener()}showError(t){this.errorContainer&&(this.errorContainer.textContent=t,this.errorContainer.style.display="block",setTimeout(()=>{this.errorContainer&&(this.errorContainer.style.display="none")},5e3))}hideError(){this.errorContainer&&(this.errorContainer.style.display="none")}showLoading(){!this.previewWrapper||!this.loadingSpinner||(this.previewWrapper.classList.add("loading"),this.previewWrapper.style.display="flex",this.loadingSpinner.style.display="block",this.previewEl&&(this.previewEl.style.display="none"))}hideLoading(){!this.previewWrapper||!this.loadingSpinner||(this.previewWrapper.classList.remove("loading"),this.loadingSpinner.style.display="none")}validateFileSize(t){const e=(this.props.maxFileSizeMB||5)*1024*1024;if(t.size>e){const i=this.props.maxFileSizeMB||5,s=(t.size/(1024*1024)).toFixed(1);return this.showError(`File size (${s}MB) exceeds maximum limit of ${i}MB`),!1}return!0}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");if(t&&t!==""){this.showLoading(),s&&s instanceof HTMLElement&&(s.style.display="none"),e&&e.classList.remove("no-image"),i&&(i.innerHTML=`
159
+ <span class="upload-icon">${Q}</span>
187
160
  <span class="upload-label">Replace</span>
188
161
  `);const n=()=>{this.hideLoading(),this.previewWrapper.classList.add("has-image"),this.previewEl.style.display="block",this.previewEl.removeEventListener("load",n),this.previewEl.removeEventListener("error",o)},o=()=>{this.hideLoading(),this.showError("Failed to load image. Please try again."),this.previewWrapper.classList.remove("has-image"),this.previewEl.style.display="none",this.previewWrapper.style.display="none",s&&s instanceof HTMLElement&&(s.style.display="block"),e&&e.classList.add("no-image"),this.previewEl.removeEventListener("load",n),this.previewEl.removeEventListener("error",o)};this.previewEl.addEventListener("load",n),this.previewEl.addEventListener("error",o),this.previewEl.src=t}else this.hideLoading(),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=`
189
- <span class="upload-icon">${it}</span>
162
+ <span class="upload-icon">${Q}</span>
190
163
  <span class="upload-label">Upload</span>
191
- `)}draw(){const t=document.createElement("div");t.className="upload-setting-wrapper",t.setAttribute("data-setting-id",this.id),t.addEventListener("focusout",a=>{var l;a.relatedTarget&&t.contains(a.relatedTarget)||(l=this.onBlur)==null||l.call(this,this.value??"")},!0);const e=!!(this.props.title||this.props.icon);if(e||t.classList.add("no-label"),e){const a=document.createElement("div");if(a.className="icon-title-container",this.props.icon){const l=this.createIcon(this.props.icon);a.appendChild(l)}if(this.props.title){const l=this.createLabel(this.props.title);a.appendChild(l)}t.appendChild(a)}this.errorContainer=document.createElement("div"),this.errorContainer.className="error-message",this.errorContainer.style.display="none",t.appendChild(this.errorContainer);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=se,this.previewWrapper=document.createElement("div"),this.previewWrapper.className="preview-wrapper",this.loadingSpinner=document.createElement("div"),this.loadingSpinner.className="loading-spinner",this.loadingSpinner.innerHTML=oe,this.loadingSpinner.style.display="none",this.previewWrapper.appendChild(this.loadingSpinner),this.previewEl=document.createElement("img"),this.previewEl.className="upload-preview",this.props.delete){const a=document.createElement("button");a.className="delete-button",a.type="button",a.title="Delete image",a.innerHTML=ne,this.previewWrapper.appendChild(a),a.onclick=l=>{var r;l.stopPropagation(),this.value="",this.updatePreviewState(null),(r=this.onChange)==null||r.call(this,""),this.hideError()}}this.previewWrapper.appendChild(this.previewEl);const o=document.createElement("button");return o.className="upload-button",o.type="button",this.getDataPropsPath()&&o.setAttribute("data-test-id",this.getDataPropsPath()),o.innerHTML=`
192
- <span class="upload-icon">${it}</span>
164
+ `)}draw(){const t=document.createElement("div");t.className="upload-setting-wrapper",t.setAttribute("data-setting-id",this.id),t.addEventListener("focusout",a=>{var l;a.relatedTarget&&t.contains(a.relatedTarget)||(l=this.onBlur)==null||l.call(this,this.value??"")},!0);const e=!!(this.props.title||this.props.icon);if(e||t.classList.add("no-label"),e){const a=document.createElement("div");if(a.className="icon-title-container",this.props.icon){const l=this.createIcon(this.props.icon);a.appendChild(l)}if(this.props.title){const l=this.createLabel(this.props.title);a.appendChild(l)}t.appendChild(a)}this.errorContainer=document.createElement("div"),this.errorContainer.className="error-message",this.errorContainer.style.display="none",t.appendChild(this.errorContainer);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=$t,this.previewWrapper=document.createElement("div"),this.previewWrapper.className="preview-wrapper",this.loadingSpinner=document.createElement("div"),this.loadingSpinner.className="loading-spinner",this.loadingSpinner.innerHTML=Bt,this.loadingSpinner.style.display="none",this.previewWrapper.appendChild(this.loadingSpinner),this.previewEl=document.createElement("img"),this.previewEl.className="upload-preview",this.props.delete){const a=document.createElement("button");a.className="delete-button",a.type="button",a.title="Delete image",a.innerHTML=At,this.previewWrapper.appendChild(a),a.onclick=l=>{var r;l.stopPropagation(),this.value="",this.updatePreviewState(null),(r=this.onChange)==null||r.call(this,""),this.hideError()}}this.previewWrapper.appendChild(this.previewEl);const o=document.createElement("button");return o.className="upload-button",this.getDataPropsPath()&&o.setAttribute("data-test-id",this.getDataPropsPath()),o.innerHTML=`
165
+ <span class="upload-icon">${Q}</span>
193
166
  <span class="upload-label">Upload</span>
194
- `,i.appendChild(n),i.appendChild(this.previewWrapper),i.appendChild(o),t.appendChild(i),s?this.updatePreviewState(this.value):this.updatePreviewState(null),o.onclick=()=>{window.postMessage({type:"OPEN_FILE_MANAGER_MODAL",settingId:this.id},"*")},t}}const vt=`
195
- <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
196
- <path d="M5 10.5L7.5 8M7.5 8L10 10.5M7.5 8V13.625M12.5 10.9643C13.2634 10.3338 13.75 9.37996 13.75 8.3125C13.75 6.41402 12.211 4.875 10.3125 4.875C10.1759 4.875 10.0482 4.80375 9.97882 4.68609C9.16379 3.30302 7.65902 2.375 5.9375 2.375C3.34867 2.375 1.25 4.47367 1.25 7.0625C1.25 8.35381 1.77215 9.52317 2.61684 10.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
197
- </svg>
198
- `,ae=`
199
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
200
- <path d="M1.5 7.5C1.5 7.5 3.00374 5.45116 4.22538 4.22868C5.44702 3.0062 7.1352 2.25 9 2.25C12.7279 2.25 15.75 5.27208 15.75 9C15.75 12.7279 12.7279 15.75 9 15.75C5.92268 15.75 3.32633 13.6907 2.51382 10.875M1.5 7.5V3M1.5 7.5H6" stroke="#637381" stroke-linecap="round" stroke-linejoin="round"/>
201
- </svg>
202
- `,le=`
203
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
204
- <path fill-rule="evenodd" clip-rule="evenodd" d="M11.9943 13.4085L17.6486 19.0631C17.8371 19.2452 18.0896 19.346 18.3516 19.3437C18.6137 19.3414 18.8644 19.2363 19.0497 19.051C19.235 18.8656 19.3402 18.6149 19.3424 18.3528C19.3447 18.0908 19.244 17.8383 19.0619 17.6497L13.4076 11.9951L19.0619 6.34039C19.244 6.15187 19.3447 5.89937 19.3424 5.63728C19.3402 5.37519 19.235 5.12448 19.0497 4.93915C18.8644 4.75382 18.6137 4.64869 18.3516 4.64642C18.0896 4.64414 17.8371 4.74489 17.6486 4.92697L11.9943 10.5816L6.34004 4.92697C6.15068 4.74939 5.89967 4.65245 5.64011 4.65667C5.38055 4.66088 5.13282 4.76592 4.94932 4.94956C4.76583 5.1332 4.66097 5.38102 4.65694 5.6406C4.65291 5.90018 4.75002 6.15114 4.92772 6.34039L10.581 11.9951L4.92672 17.6497C4.83126 17.7419 4.75511 17.8522 4.70273 17.9742C4.65035 18.0961 4.62277 18.2273 4.62162 18.36C4.62047 18.4928 4.64576 18.6244 4.69601 18.7472C4.74627 18.8701 4.82049 18.9817 4.91433 19.0755C5.00818 19.1694 5.11978 19.2436 5.24262 19.2939C5.36545 19.3441 5.49707 19.3694 5.62978 19.3683C5.7625 19.3671 5.89366 19.3395 6.0156 19.2872C6.13755 19.2348 6.24784 19.1586 6.34004 19.0631L11.9943 13.4085Z" fill="#637381"/>
205
- </svg>
206
- `,re=`
207
- <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
208
- <path d="M14 0.5C21.4558 0.5 27.5 6.54416 27.5 14C27.5 21.4558 21.4558 27.5 14 27.5C6.54416 27.5 0.5 21.4558 0.5 14C0.5 6.54416 6.54416 0.5 14 0.5Z" fill="#EFF1F2"/>
209
- <path d="M14 0.5C21.4558 0.5 27.5 6.54416 27.5 14C27.5 21.4558 21.4558 27.5 14 27.5C6.54416 27.5 0.5 21.4558 0.5 14C0.5 6.54416 6.54416 0.5 14 0.5Z" stroke="#FF5630"/>
210
- <path d="M7.25 9.7895C7.25 9.4265 7.50875 9.13175 7.82825 9.13175L9.827 9.13175C10.2237 9.11975 10.574 8.8325 10.709 8.408L10.7315 8.333L10.8177 8.03975C10.8702 7.85975 10.916 7.70225 10.9805 7.562C11.234 7.00775 11.7035 6.623 12.2458 6.52475C12.3837 6.5 12.5292 6.5 12.6957 6.5L15.3043 6.5C15.4715 6.5 15.617 6.5 15.7542 6.52475C16.2965 6.623 16.7667 7.00775 17.0195 7.562C17.084 7.70225 17.1297 7.859 17.183 8.03975L17.2685 8.333L17.291 8.408C17.426 8.8325 17.846 9.1205 18.2435 9.13175L20.171 9.13175C20.4912 9.13175 20.75 9.4265 20.75 9.7895C20.75 10.1525 20.4912 10.4473 20.1717 10.4473L7.8275 10.4473C7.50875 10.4473 7.25 10.1525 7.25 9.7895Z" fill="#FF5630"/>
211
- <path fill-rule="evenodd" clip-rule="evenodd" d="M13.697 21.5L14.303 21.5C16.3902 21.5 17.4335 21.5 18.113 20.8355C18.791 20.171 18.86 19.0813 18.9987 16.9018L19.199 13.7608C19.274 12.578 19.3115 11.9863 18.9717 11.612C18.6312 11.237 18.0567 11.237 16.907 11.237L11.093 11.237C9.94325 11.237 9.368 11.237 9.02825 11.612C8.68775 11.987 8.72525 12.578 8.801 13.7608L9.00125 16.9018C9.14 19.0813 9.209 20.1718 9.88775 20.8355C10.5665 21.5 11.6097 21.5 13.697 21.5ZM12.6845 14.1418C12.6545 13.8163 12.3785 13.5793 12.0695 13.6115C11.7597 13.6438 11.5347 13.934 11.5655 14.2595L11.9405 18.2068C11.9705 18.5323 12.2465 18.7693 12.5555 18.737C12.8652 18.7048 13.0902 18.4145 13.0595 18.089L12.6845 14.1418ZM15.9312 13.6115C16.2402 13.6438 16.466 13.934 16.4345 14.2595L16.0595 18.2068C16.0295 18.5323 15.7527 18.7693 15.4445 18.737C15.1347 18.7048 14.9097 18.4145 14.9405 18.089L15.3155 14.1418C15.3455 13.8163 15.623 13.5793 15.9312 13.6115Z" fill="#FF5630"/>
212
- </svg>
213
- `,ce=`
214
- <svg xmlns="http://www.w3.org/2000/svg" width="11" height="12" viewBox="0 0 11 12" fill="none">
215
- <path d="M-4.47342e-07 2.5585C-3.97978e-07 2.27617 0.20125 2.04692 0.44975 2.04692L2.00433 2.04692C2.31292 2.03758 2.58533 1.81417 2.69033 1.484L2.70783 1.42567L2.77492 1.19758C2.81575 1.05758 2.85133 0.935084 2.9015 0.826C3.09867 0.394917 3.46383 0.0956673 3.88558 0.0192507C3.99292 6.93798e-07 4.10608 7.1793e-07 4.23558 7.40573e-07L6.26442 1.09531e-06C6.3945 1.11805e-06 6.50767 1.13349e-06 6.61442 0.0192512C7.03617 0.0956679 7.40192 0.394918 7.5985 0.826001C7.64867 0.935085 7.68425 1.057 7.72567 1.19758L7.79217 1.42567L7.80967 1.484C7.91467 1.81417 8.24133 2.03817 8.5505 2.04692L10.0497 2.04692C10.2987 2.04692 10.5 2.27617 10.5 2.5585C10.5 2.84084 10.2987 3.07009 10.0502 3.07009L0.449166 3.07008C0.201249 3.07008 -4.96707e-07 2.84083 -4.47342e-07 2.5585Z" fill="#F04438"/>
216
- <path fill-rule="evenodd" clip-rule="evenodd" d="M5.01433 11.6667L5.48566 11.6667C7.10908 11.6667 7.9205 11.6667 8.449 11.1498C8.97633 10.633 9.03 9.78542 9.13792 8.09025L9.29366 5.64725C9.352 4.72734 9.38117 4.26709 9.11692 3.976C8.85208 3.68434 8.40525 3.68434 7.511 3.68433L2.989 3.68433C2.09475 3.68433 1.64733 3.68433 1.38308 3.976C1.11825 4.26767 1.14742 4.72733 1.20633 5.64725L1.36208 8.09025C1.47 9.78542 1.52366 10.6336 2.05158 11.1498C2.5795 11.6667 3.39091 11.6667 5.01433 11.6667ZM4.22683 5.94358C4.2035 5.69042 3.98883 5.50608 3.7485 5.53117C3.50758 5.55625 3.33258 5.782 3.3565 6.03517L3.64816 9.10525C3.6715 9.35842 3.88617 9.54275 4.1265 9.51767C4.36742 9.49258 4.54242 9.26683 4.5185 9.01367L4.22683 5.94358ZM6.75208 5.53117C6.99242 5.55625 7.168 5.782 7.1435 6.03517L6.85183 9.10525C6.8285 9.35842 6.61325 9.54275 6.3735 9.51767C6.13258 9.49259 5.95758 9.26683 5.9815 9.01367L6.27317 5.94358C6.2965 5.69042 6.51233 5.50609 6.75208 5.53117Z" fill="#F04438"/>
217
- </svg>
218
- `,he=`
219
- <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
220
- <path fill-rule="evenodd" clip-rule="evenodd" d="M10.279 5.55268C10.1384 5.41223 9.94777 5.33334 9.74902 5.33334C9.55027 5.33334 9.35965 5.41223 9.21902 5.55268L4.21902 10.5527C4.07857 10.6933 3.99968 10.8839 3.99968 11.0827C3.99968 11.2814 4.07857 11.4721 4.21902 11.6127L9.21902 16.6127C9.28769 16.6864 9.37049 16.7455 9.46249 16.7865C9.55448 16.8275 9.6538 16.8495 9.7545 16.8513C9.8552 16.8531 9.95523 16.8345 10.0486 16.7968C10.142 16.7591 10.2268 16.7029 10.2981 16.6317C10.3693 16.5605 10.4254 16.4757 10.4631 16.3823C10.5009 16.2889 10.5194 16.1889 10.5176 16.0882C10.5158 15.9875 10.4938 15.8881 10.4528 15.7961C10.4118 15.7041 10.3527 15.6213 10.279 15.5527L6.55902 11.8327H14.749C15.462 11.8327 16.549 12.0527 17.436 12.6917C18.284 13.3017 18.999 14.3267 18.999 16.0827C18.999 16.2816 19.078 16.4724 19.2187 16.613C19.3593 16.7537 19.5501 16.8327 19.749 16.8327C19.9479 16.8327 20.1387 16.7537 20.2794 16.613C20.42 16.4724 20.499 16.2816 20.499 16.0827C20.499 13.8387 19.547 12.3627 18.312 11.4737C17.116 10.6127 15.702 10.3327 14.749 10.3327H6.55902L10.279 6.61268C10.4195 6.47206 10.4984 6.28143 10.4984 6.08268C10.4984 5.88393 10.4195 5.69331 10.279 5.55268Z" fill="#454F5B"/>
221
- </svg>
222
- `,de=`
223
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
224
- <path fill-rule="evenodd" clip-rule="evenodd" d="M14.2198 5.55268C14.3604 5.41223 14.551 5.33334 14.7498 5.33334C14.9485 5.33334 15.1391 5.41223 15.2798 5.55268L20.2798 10.5527C20.4202 10.6933 20.4991 10.8839 20.4991 11.0827C20.4991 11.2814 20.4202 11.4721 20.2798 11.6127L15.2798 16.6127C15.2111 16.6864 15.1283 16.7455 15.0363 16.7865C14.9443 16.8275 14.845 16.8495 14.7443 16.8513C14.6436 16.8531 14.5435 16.8345 14.4502 16.7968C14.3568 16.7591 14.2719 16.7029 14.2007 16.6317C14.1295 16.5605 14.0734 16.4757 14.0356 16.3823C13.9979 16.2889 13.9794 16.1889 13.9812 16.0882C13.9829 15.9875 14.005 15.8881 14.046 15.7961C14.087 15.7041 14.1461 15.6213 14.2198 15.5527L17.9398 11.8327H9.74976C9.03676 11.8327 7.94976 12.0527 7.06276 12.6917C6.21476 13.3017 5.49976 14.3267 5.49976 16.0827C5.49976 16.2816 5.42074 16.4724 5.28009 16.613C5.13943 16.7537 4.94867 16.8327 4.74976 16.8327C4.55084 16.8327 4.36008 16.7537 4.21943 16.613C4.07877 16.4724 3.99976 16.2816 3.99976 16.0827C3.99976 13.8387 4.95176 12.3627 6.18676 11.4737C7.38276 10.6127 8.79676 10.3327 9.74976 10.3327H17.9398L14.2198 6.61268C14.0793 6.47206 14.0004 6.28143 14.0004 6.08268C14.0004 5.88393 14.0793 5.69331 14.2198 5.55268Z" fill="#454F5B"/>
225
- </svg>
226
-
227
- `,pe=`
228
- <svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none">
229
- <path fill-rule="evenodd" clip-rule="evenodd" d="M15 7.5C15 11.6423 11.6423 15 7.5 15C3.35775 15 0 11.6423 0 7.5C0 3.35775 3.35775 0 7.5 0C11.6423 0 15 3.35775 15 7.5ZM10.5225 5.2275C10.6278 5.33297 10.687 5.47594 10.687 5.625C10.687 5.77406 10.6278 5.91703 10.5225 6.0225L6.7725 9.7725C6.66703 9.87784 6.52406 9.93701 6.375 9.93701C6.22594 9.93701 6.08297 9.87784 5.9775 9.7725L4.4775 8.2725C4.42224 8.221 4.37791 8.1589 4.34716 8.0899C4.31642 8.0209 4.29989 7.94642 4.29856 7.87089C4.29722 7.79536 4.31112 7.72034 4.33941 7.6503C4.3677 7.58026 4.40981 7.51664 4.46322 7.46322C4.51664 7.40981 4.58026 7.3677 4.6503 7.33941C4.72034 7.31112 4.79536 7.29722 4.87089 7.29856C4.94642 7.29989 5.0209 7.31642 5.0899 7.34716C5.1589 7.37791 5.221 7.42224 5.2725 7.4775L6.375 8.58L8.05125 6.90375L9.7275 5.2275C9.83297 5.12216 9.97594 5.063 10.125 5.063C10.2741 5.063 10.417 5.12216 10.5225 5.2275Z" fill="#06CD5C"/>
230
- </svg>
231
- `,ft=`
232
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
233
- <path d="M8.99998 13.5L5.57436 8.6625C5.01365 8.00048 4.65256 7.19277 4.53315 6.33346C4.41373 5.47415 4.54091 4.5986 4.89987 3.80877C5.25883 3.01895 5.83479 2.34736 6.56068 1.87222C7.28657 1.39708 8.13251 1.13795 8.99998 1.125C10.2025 1.13688 11.3512 1.62483 12.1947 2.48198C13.0381 3.33913 13.5075 4.49561 13.5 5.69812C13.5004 6.74715 13.1433 7.765 12.4875 8.58375L8.99998 13.5ZM8.99998 2.25C8.0954 2.26039 7.23191 2.62934 6.59913 3.27583C5.96634 3.92233 5.61598 4.79353 5.62498 5.69812C5.62924 6.52369 5.92623 7.32097 6.46311 7.94812L8.99998 11.5425L11.6044 7.875C12.0994 7.25706 12.371 6.4899 12.375 5.69812C12.384 4.79353 12.0336 3.92233 11.4008 3.27583C10.7681 2.62934 9.90457 2.26039 8.99998 2.25Z" fill="#637381"/>
234
- <path d="M9 6.1875C9.62132 6.1875 10.125 5.68382 10.125 5.0625C10.125 4.44118 9.62132 3.9375 9 3.9375C8.37868 3.9375 7.875 4.44118 7.875 5.0625C7.875 5.68382 8.37868 6.1875 9 6.1875Z" fill="#637381"/>
235
- <path d="M15.75 6.75H14.625V7.875H15.75V15.75H2.25V7.875H3.375V6.75H2.25C1.95163 6.75 1.66548 6.86853 1.4545 7.07951C1.24353 7.29048 1.125 7.57663 1.125 7.875V15.75C1.125 16.0484 1.24353 16.3345 1.4545 16.5455C1.66548 16.7565 1.95163 16.875 2.25 16.875H15.75C16.0484 16.875 16.3345 16.7565 16.5455 16.5455C16.7565 16.3345 16.875 16.0484 16.875 15.75V7.875C16.875 7.57663 16.7565 7.29048 16.5455 7.07951C16.3345 6.86853 16.0484 6.75 15.75 6.75Z" fill="#637381"/>
236
- </svg>
237
- `,ue=`
238
- <svg width="27" height="34" viewBox="0 0 27 34" fill="none" xmlns="http://www.w3.org/2000/svg">
239
- <path d="M13.2217 0.25C20.3738 0.25 26.1942 6.06962 26.1943 13.2217V13.2227C26.2179 18.4466 22.9671 23.3445 19.666 26.9609C18.0203 28.7638 16.3726 30.2373 15.1357 31.2598C14.5176 31.7708 14.0026 32.1695 13.6426 32.4395C13.4628 32.5743 13.3215 32.6771 13.2256 32.7461L13.2227 32.7471C12.5085 32.2389 9.52009 30.06 6.58984 26.8271C3.35339 23.2564 0.226466 18.445 0.25 13.2148V13.2139C0.25 6.07018 6.06958 0.25024 13.2217 0.25Z" fill="#F04438" stroke="#A82A21" stroke-width="0.5"/>
240
- </svg>
241
- `,ge=`
242
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
243
- <path d="M14.4132 4.80441C14.7371 4.80441 15 5.06731 15 5.39119C15 5.71507 14.7371 5.97797 14.4132 5.97797H13.7595L13.3736 11.7568C13.3426 12.2221 13.3179 12.6056 13.2722 12.9163C13.2256 13.234 13.1515 13.523 12.9982 13.7921C12.7591 14.2119 12.3978 14.5496 11.963 14.7604C11.6845 14.8953 11.3913 14.9499 11.0714 14.9753C10.7584 15.0002 10.3738 15 9.90749 15H8.09251C7.62617 15 7.24164 15.0002 6.92863 14.9753C6.6087 14.9499 6.31554 14.8953 6.037 14.7604C5.60221 14.5496 5.24093 14.2119 5.00176 13.7921C4.84855 13.523 4.77439 13.234 4.72775 12.9163C4.68215 12.6056 4.65745 12.2221 4.62643 11.7568L4.24053 5.97797H3.58678C3.26291 5.97797 3 5.71507 3 5.39119C3 5.06731 3.26291 4.80441 3.58678 4.80441H14.4132ZM5.79648 11.6793C5.82874 12.1632 5.8517 12.4923 5.88899 12.7463C5.9252 12.9927 5.96948 13.1207 6.02115 13.2115C6.14297 13.4253 6.32656 13.5975 6.54802 13.7048C6.64205 13.7504 6.7733 13.7864 7.02203 13.8062C7.27784 13.8265 7.6077 13.8264 8.09251 13.8264H9.90749C10.3923 13.8264 10.7222 13.8265 10.978 13.8062C11.2267 13.7864 11.358 13.7504 11.452 13.7048C11.6734 13.5975 11.857 13.4253 11.9789 13.2115C12.0305 13.1207 12.0748 12.9927 12.111 12.7463C12.1483 12.4923 12.1713 12.1632 12.2035 11.6793L12.5841 5.97797H5.41586L5.79648 11.6793ZM7.21057 11.1048V8.0978C7.21057 7.77392 7.47348 7.51101 7.79736 7.51101C8.1211 7.51117 8.38326 7.77402 8.38326 8.0978V11.1048C8.38326 11.4286 8.1211 11.6915 7.79736 11.6916C7.47348 11.6916 7.21057 11.4287 7.21057 11.1048ZM9.61674 11.1048V8.0978C9.61674 7.77402 9.8789 7.51117 10.2026 7.51101C10.5265 7.51101 10.7894 7.77392 10.7894 8.0978V11.1048C10.7894 11.4287 10.5265 11.6916 10.2026 11.6916C9.8789 11.6915 9.61674 11.4286 9.61674 11.1048ZM10.8044 3C11.1283 3 11.3912 3.26291 11.3912 3.58678C11.3912 3.91066 11.1283 4.17357 10.8044 4.17357H7.19559C6.87172 4.17357 6.60881 3.91066 6.60881 3.58678C6.60881 3.26291 6.87172 3 7.19559 3H10.8044Z" fill="#46525C"/>
244
- </svg>
245
- `,me=`
246
- <svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox="0 0 8 4" fill="none">
247
- <path fill-rule="evenodd" clip-rule="evenodd" d="M0 0L2.58579 2.58579C3.36684 3.36684 4.63317 3.36683 5.41421 2.58579L8 0L0 0Z" fill="#1C252E"/>
248
- </svg>
249
- `,A=class A extends b{constructor(t={}){var e;super(t),this.inputType={imageUrl:"text",markers:"text"},this.mainButton=null,this.thumbnailEl=null,this.markerCountEl=null,this.mapIconEl=null,this.popoverEl=null,this.backdropEl=null,this.imageElement=null,this.cursorTooltip=null,this.popoverPosition=null,this.isPopoverOpen=!1,this.confirmOverlayEl=null,this.confirmPromise=null,this.lastImageNaturalSize=null,this.draggingMarkerId=null,this.history=[],this.historyIndex=-1,this.isUndoRedoOperation=!1,this.initialValue=null,this.messageListener=null,this.props.maxMarkers=this.props.maxMarkers??((e=this.props.prizeMap)==null?void 0:e.length)??10,this.props.maxFileSizeMB=this.props.maxFileSizeMB??5e3,this.props.markerSize=this.props.markerSize??24,this.value||(this.value={imageUrl:"",markers:[]}),this.setupMessageListener(),this.onBackgroundClick=i=>{if(this.isPopoverOpen&&this.popoverEl&&!this.popoverEl.contains(i.target)){if(i.target.closest('[class*="modal"], [class*="Modal"], [class*="dialog"], [class*="Dialog"], [class*="overlay"], [class*="Overlay"]'))return;this.closePopover()}},this.handlePopoverKeydown=i=>{this.isPopoverOpen&&(i.key==="Escape"?this.closePopover():(i.ctrlKey||i.metaKey)&&(i.key==="z"||i.key==="Z"?i.shiftKey?(i.preventDefault(),this.redo()):(i.preventDefault(),this.undo()):(i.key==="y"||i.key==="Y")&&(i.preventDefault(),this.redo())))},this.boundHandleMarkerDrag=this.handleMarkerDrag.bind(this),this.boundStopDragging=this.stopDragging.bind(this)}setupMessageListener(){this.messageListener=t=>{if(t.data&&t.data.type==="FILE_MANAGER_IMAGE_SELECTED"&&t.data.settingId===this.id){const e=t.data.imageUrl;if(e&&typeof e=="string"){const i=this.lastImageNaturalSize,s=new Image;s.onload=()=>{var a;const n={width:s.naturalWidth||0,height:s.naturalHeight||0},o=this.scaleMarkersForNewImage(((a=this.value)==null?void 0:a.markers)||[],i,n);this.value={imageUrl:e,markers:o},this.lastImageNaturalSize=n,this.history=[JSON.parse(JSON.stringify(o))],this.historyIndex=0,this.updateUndoRedoButtons(),this.updateMainDisplay(),this.isPopoverOpen&&this.refreshPopoverContent(),this.triggerChange()},s.onerror=()=>{this.showError("Failed to load image from file manager.")},s.src=e}}},window.addEventListener("message",this.messageListener)}cleanupMessageListener(){this.messageListener&&(window.removeEventListener("message",this.messageListener),this.messageListener=null)}draw(){const t=document.createElement("div");if(t.className="image-map-setting-wrapper",this.props.title||this.props.icon){const h=document.createElement("div");if(h.className="icon-container",this.props.icon){const p=this.createIcon(this.props.icon);h.appendChild(p)}if(this.props.title){const p=this.createLabel(this.props.title);h.appendChild(p)}t.appendChild(h)}const e=document.createElement("div");e.className="image-map-sections-container";const i=document.createElement("div");i.className="image-map-section";const s=document.createElement("h4");s.className="image-map-section-title",s.textContent="Upload/Replace Map Image",i.appendChild(s);const n=document.createElement("div");n.className="image-map-upload-box";const o=document.createElement("div");o.className="image-map-thumbnail-wrapper",this.thumbnailEl=document.createElement("img"),this.thumbnailEl.className="image-map-thumbnail-main",o.appendChild(this.thumbnailEl);const a=document.createElement("button");a.type="button",a.className="image-map-delete-btn",a.innerHTML=ce,a.addEventListener("click",h=>{h.stopPropagation(),this.value={imageUrl:"",markers:[]},this.updateMainDisplay(),this.triggerChange()}),o.appendChild(a),n.appendChild(o);const l=document.createElement("button");l.type="button",l.className="image-map-upload-label",l.innerHTML=`
250
- <div class="upload-icon upload-icon-default">${vt}</div>
251
- <div class="upload-icon upload-icon-replace">${ae}</div>
252
- <span class="upload-text">Upload Image</span>
253
- `,l.addEventListener("click",()=>{window.postMessage({type:"OPEN_FILE_MANAGER_MODAL",settingId:this.id},"*")}),n.appendChild(l),i.appendChild(n),e.appendChild(i);const r=document.createElement("div");r.className="image-map-section";const c=document.createElement("h4");return c.className="image-map-section-title",c.textContent="Map Setup",r.appendChild(c),this.mainButton=document.createElement("button"),this.mainButton.type="button",this.mainButton.className="image-map-button",this.mapIconEl=document.createElement("span"),this.mapIconEl.className="image-map-icon",this.mapIconEl.innerHTML=ft,this.mainButton.appendChild(this.mapIconEl),this.markerCountEl=document.createElement("span"),this.markerCountEl.className="image-map-marker-count",this.mainButton.appendChild(this.markerCountEl),this.mainButton.addEventListener("click",()=>{var h;(h=this.mainButton)!=null&&h.disabled||this.openPopover()}),r.appendChild(this.mainButton),e.appendChild(r),t.appendChild(e),this.createPopover(),this.updateMainDisplay(),t}updateMainDisplay(){var s;if(!this.thumbnailEl||!this.markerCountEl)return;const t=this.value&&this.value.imageUrl&&this.value.imageUrl!=="",e=this.thumbnailEl.parentElement,i=e==null?void 0:e.parentElement;i&&(t?(i.classList.add("has-image"),this.thumbnailEl.src=this.value.imageUrl):(i.classList.remove("has-image"),this.thumbnailEl.src="")),(s=this.value)!=null&&s.markers.length,this.markerCountEl.textContent="Configure Map",this.mainButton&&(this.mainButton.disabled=!t)}createPopover(){this.backdropEl=document.createElement("div"),this.backdropEl.className="image-map-backdrop",this.backdropEl.style.display="none",this.popoverEl=document.createElement("div"),this.popoverEl.className="image-map-popover",this.popoverEl.style.display="none";const t=document.createElement("div");t.className="image-map-header",t.style.cursor="move";const e=document.createElement("h3");e.className="image-map-title",e.textContent="Prize Map",t.appendChild(e);const i=document.createElement("button");i.type="button",i.className="image-map-close-btn",i.innerHTML=le,i.addEventListener("click",()=>void this.closePopover()),t.appendChild(i),rt(t,this.popoverEl,(n,o)=>{this.popoverPosition={left:n,top:o}}),this.popoverEl.appendChild(t);const s=document.createElement("div");s.className="image-map-content",this.popoverEl.appendChild(s),document.body.appendChild(this.backdropEl),document.body.appendChild(this.popoverEl)}openPopover(){A.openInstance&&A.openInstance!==this&&A.openInstance.closePopover(),this.isPopoverOpen=!0,A.openInstance=this,this.value?this.initialValue=JSON.parse(JSON.stringify(this.value)):this.initialValue={imageUrl:"",markers:[]},this.value&&(this.history=[JSON.parse(JSON.stringify(this.value.markers))],this.historyIndex=0),this.backdropEl&&(this.backdropEl.style.display="block"),this.popoverEl&&(this.popoverEl.style.display="flex"),this.positionPopover(),this.refreshPopoverContentAndScrollToBottom(),setTimeout(()=>{document.addEventListener("click",this.onBackgroundClick,!0)},200),document.addEventListener("keydown",this.handlePopoverKeydown,!0)}hasAllMarkers(){if(!this.value)return!1;const t=this.props.maxMarkers||10;return this.value.markers.length===t}hasChanges(){return!this.initialValue||!this.value?!1:JSON.stringify(this.initialValue.markers)!==JSON.stringify(this.value.markers)}async closePopover(t=!1){if(!(!this.isPopoverOpen&&!t)){if(!t&&this.hasChanges()&&!this.hasAllMarkers()){if(!await this.showConfirmModal("Discard changes?","You haven't placed all markers. Closing will discard your changes."))return;this.initialValue&&(this.value=JSON.parse(JSON.stringify(this.initialValue)),this.updateMainDisplay(),this.triggerChange())}this.isPopoverOpen=!1,this.draggingMarkerId=null,this.backdropEl&&(this.backdropEl.style.display="none"),this.popoverEl&&(this.popoverEl.style.display="none"),document.removeEventListener("click",this.onBackgroundClick,!0),document.removeEventListener("keydown",this.handlePopoverKeydown,!0),A.openInstance===this&&(A.openInstance=null)}}positionPopover(){if(!this.popoverEl||!this.mainButton)return;const t=this.mainButton.getBoundingClientRect(),e=800,i=Math.min(window.innerHeight*.8,700);let s=t.right+8,n=t.top;const o=window.innerWidth-t.right;o<e+16&&t.left>o+100&&(s=t.left-e-8),s=Math.max(8,Math.min(s,window.innerWidth-e-8)),n=Math.max(8,Math.min(n,window.innerHeight-i-8)),this.popoverEl.style.left=`${s}px`,this.popoverEl.style.top=`${n}px`,this.popoverPosition={left:s,top:n}}refreshPopoverContent(){if(!this.popoverEl)return;const t=this.popoverEl.querySelector(".image-map-content");if(!t)return;const e=t.querySelector(".image-map-container"),i=t.querySelector(".simple-prize-list"),s=(e==null?void 0:e.scrollTop)||0,n=(i==null?void 0:i.scrollTop)||0;if(t.innerHTML="",this.value&&this.value.imageUrl&&this.value.imageUrl!==""){const a=this.renderControlsRow();t.appendChild(a);const l=document.createElement("div");l.className="image-map-main-layout";const r=document.createElement("div");r.className="image-map-image-section",this.renderImageMapSection(r);const c=document.createElement("div");c.className="prize-list-section",this.renderPrizeList(c),l.appendChild(r),l.appendChild(c),t.appendChild(l);const h=this.renderBottomButtons();t.appendChild(h);const p=r.querySelector(".image-map-container"),g=c.querySelector(".simple-prize-list");p&&(p.scrollTop=s),g&&(g.scrollTop=n)}else this.renderUploadSection(t)}refreshPopoverContentAndScrollToBottom(){this.refreshPopoverContent(),requestAnimationFrame(()=>{this.scrollPrizeListToBottom()})}scrollPrizeListToBottom(){if(!this.popoverEl)return;const t=this.popoverEl.querySelector(".simple-prize-list");t&&requestAnimationFrame(()=>{t.scrollTop=t.scrollHeight})}renderUploadSection(t){const e=document.createElement("div");e.className="upload-section-wrapper";const i=document.createElement("h4");i.className="upload-section-title",i.textContent="Upload/Replace Map Image",e.appendChild(i);const s=document.createElement("div");s.className="upload-section";const n=document.createElement("label");n.className="upload-label",n.innerHTML=`
254
- <div class="upload-placeholder">
255
- ${vt}
256
- <span>Click to upload image</span>
257
- </div>
258
- `;const o=document.createElement("input");o.type="file",o.accept="image/jpeg,image/jpg,image/png,image/gif,image/webp",o.style.display="none",o.addEventListener("change",c=>{var p;const h=(p=c.target.files)==null?void 0:p[0];h&&this.handleImageUpload(h)}),n.appendChild(o),s.appendChild(n),e.appendChild(s);const a=document.createElement("h4");a.className="upload-section-title",a.textContent="Map Setup",e.appendChild(a);const l=document.createElement("div");l.className="upload-section";const r=document.createElement("button");r.type="button",r.className="upload-label map-config-btn",r.innerHTML=`
259
- <div class="upload-placeholder">
260
- ${ft}
261
- <span>Configure Map</span>
262
- </div>
263
- `,r.addEventListener("click",()=>{window.postMessage({type:"OPEN_FILE_MANAGER_MODAL",settingId:this.id},"*")}),l.appendChild(r),e.appendChild(l),t.appendChild(e)}renderControlsRow(){var c;const t=document.createElement("div");t.className="controls-row";const e=document.createElement("div");e.className="place-prize-text",e.textContent="Place Prize",t.appendChild(e);const i=document.createElement("div");i.className="undo-redo-group";const s=document.createElement("button");s.type="button",s.className="undo-btn action-btn",s.innerHTML=he,s.title="Undo (Ctrl+Z)",s.disabled=!this.canUndo(),s.addEventListener("click",()=>this.undo()),i.appendChild(s);const n=document.createElement("button");n.type="button",n.className="redo-btn action-btn",n.innerHTML=de,n.title="Redo (Ctrl+Y)",n.disabled=!this.canRedo(),n.addEventListener("click",()=>this.redo()),i.appendChild(n),t.appendChild(i);const o=this.props.maxMarkers||10,a=((c=this.value)==null?void 0:c.markers.length)||0,l=a===o,r=document.createElement("div");return r.className="prize-counter-inline",r.textContent=`${a}/${o}`,l&&r.classList.add("complete"),t.appendChild(r),t}renderImageMapSection(t){const e=document.createElement("div");e.className="image-map-container";const i=document.createElement("div");i.className="image-map-wrapper",i.addEventListener("mousemove",this.boundHandleMarkerDrag),i.addEventListener("mouseup",this.boundStopDragging),i.addEventListener("mouseleave",this.boundStopDragging),this.imageElement=document.createElement("img"),this.imageElement.className="image-map-image",this.imageElement.src=this.value.imageUrl,this.imageElement.addEventListener("load",()=>this.recordImageNaturalSize()),this.imageElement.addEventListener("click",s=>this.handleImageClick(s)),i.appendChild(this.imageElement),this.cursorTooltip=document.createElement("div"),this.cursorTooltip.className="marker-cursor-tooltip",i.appendChild(this.cursorTooltip),this.imageElement.addEventListener("mouseenter",()=>this.showCursorTooltip()),this.imageElement.addEventListener("mouseleave",()=>this.hideCursorTooltip()),this.imageElement.addEventListener("mousemove",s=>this.updateCursorTooltip(s)),this.value&&this.value.markers&&this.value.markers.forEach(s=>{const n=this.createMarkerElement(s);i.appendChild(n)}),e.appendChild(i),t.appendChild(e)}renderBottomButtons(){var l;const t=this.props.maxMarkers||10,i=(((l=this.value)==null?void 0:l.markers.length)||0)===t,s=document.createElement("div");s.className="bottom-buttons";const n=document.createElement("button");n.type="button",n.className="clear-all-btn",n.innerHTML=ge+"<span>Remove All</span>",n.addEventListener("click",()=>this.handleClearAllMarkers()),s.appendChild(n);const o=document.createElement("div");o.className="done-btn-wrapper";const a=document.createElement("button");if(a.type="button",a.className="done-btn",a.textContent="Done",i||(a.disabled=!0,o.classList.add("has-tooltip")),a.addEventListener("click",()=>{i&&(this.triggerChange(),this.closePopover(!0))}),o.appendChild(a),!i){const r=document.createElement("div");r.className="done-btn-tooltip";const c=document.createElement("div");c.className="done-btn-tooltip-content",c.textContent="Map all prizes";const h=document.createElement("div");h.className="done-btn-tooltip-tail",h.innerHTML=me,r.appendChild(c),r.appendChild(h),o.appendChild(r)}return s.appendChild(o),s}renderPrizeList(t){var o;const e=this.props.maxMarkers||10,i=((o=this.value)==null?void 0:o.markers)||[],s=new Map;i.forEach(a=>s.set(a.index,a));const n=document.createElement("div");n.className="simple-prize-list";for(let a=e;a>=1;a--){const l=s.get(a),r=!!l,c=(l==null?void 0:l.prizeName)||this.props.prizeMap&&this.props.prizeMap[a-1]||"Prize Name",h=document.createElement("div");h.className=`simple-prize-item ${r?"placed":""}`;const p=document.createElement("div");p.className="simple-prize-number",p.textContent=`#${a}`,h.appendChild(p);const g=document.createElement("div");if(g.className="simple-prize-text",g.textContent=`${c}`,h.appendChild(g),r){const C=document.createElement("div");C.className="simple-prize-check",C.innerHTML=pe,h.appendChild(C)}n.appendChild(h)}t.appendChild(n)}createMarkerElement(t){const e=document.createElement("div");e.className="marker-container",e.style.left=`${t.x}%`,e.style.top=`${t.y}%`,e.setAttribute("data-marker-id",String(t.id));const i=document.createElement("div");i.className="image-map-marker",i.innerHTML=ue;const s=document.createElement("span");s.className="marker-number",s.textContent=String(t.index),i.appendChild(s),e.appendChild(i);const n=document.createElement("button");return n.type="button",n.className="marker-delete-btn",n.innerHTML=re,n.addEventListener("click",o=>{o.stopPropagation(),this.handleDeleteMarker(t.id)}),e.appendChild(n),e.addEventListener("mousedown",o=>{o.stopPropagation(),o.preventDefault(),this.draggingMarkerId=t.id,e.classList.add("dragging")}),e}handleImageUpload(t){const e=this.lastImageNaturalSize;if(!["image/jpeg","image/jpg","image/png","image/gif","image/webp"].includes(t.type)){this.showError("Invalid file type. Please upload a JPEG, PNG, GIF, or WebP image.");return}const s=(this.props.maxFileSizeMB||5)*1024*1024;if(t.size>s){const o=(t.size/1048576).toFixed(1);this.showError(`File size (${o}MB) exceeds ${this.props.maxFileSizeMB}MB limit.`);return}const n=new FileReader;n.onload=o=>{var l;const a=(l=o.target)==null?void 0:l.result;if(typeof a=="string"){const r=new Image;r.onload=()=>{var p;const c={width:r.naturalWidth||0,height:r.naturalHeight||0},h=this.scaleMarkersForNewImage(((p=this.value)==null?void 0:p.markers)||[],e,c);this.value={imageUrl:a,markers:h},this.lastImageNaturalSize=c,this.history=[JSON.parse(JSON.stringify(h))],this.historyIndex=0,this.updateUndoRedoButtons(),this.updateMainDisplay(),this.isPopoverOpen&&this.refreshPopoverContent(),this.triggerChange()},r.onerror=()=>{this.showError("Failed to read image file.")},r.src=a}},n.onerror=()=>{this.showError("Failed to read image file.")},n.readAsDataURL(t)}handleImageClick(t){if(this.draggingMarkerId!==null||!this.value||!this.imageElement)return;if(this.value.markers.length>=(this.props.maxMarkers||10)){this.showError(`Maximum of ${this.props.maxMarkers||10} markers allowed.`);return}const e=this.imageElement.getBoundingClientRect(),i=(t.clientX-e.left)/e.width*100,s=(t.clientY-e.top)/e.height*100,n=this.value.markers.map(c=>c.index).sort((c,h)=>c-h);let o=1;for(const c of n)if(c===o)o++;else break;let a;this.props.prizeMap&&this.props.prizeMap.length>0&&(a=this.props.prizeMap[o-1]);const l={id:Date.now(),index:o,x:Math.min(100,Math.max(0,i)),y:Math.min(100,Math.max(0,s)),prizeName:a},r=[...this.value.markers,l];this.setMarkers(r),this.saveState(),this.refreshPopoverContent(),this.updateMainDisplay(),this.triggerChange()}handleMarkerDrag(t){var r;if(this.draggingMarkerId===null||!this.imageElement||!this.value)return;const e=this.imageElement.getBoundingClientRect(),i=(t.clientX-e.left)/e.width*100,s=(t.clientY-e.top)/e.height*100,n=Math.min(100,Math.max(0,i)),o=Math.min(100,Math.max(0,s)),a=this.value.markers.map(c=>c.id===this.draggingMarkerId?{...c,x:n,y:o}:c),l=(r=this.popoverEl)==null?void 0:r.querySelector(`[data-marker-id="${this.draggingMarkerId}"]`);l&&(l.style.left=`${n}%`,l.style.top=`${o}%`),this.setMarkers(a)}stopDragging(){var t;if(this.draggingMarkerId!==null){const e=(t=this.popoverEl)==null?void 0:t.querySelector(`[data-marker-id="${this.draggingMarkerId}"]`);e==null||e.classList.remove("dragging"),this.draggingMarkerId=null,this.saveState(),this.triggerChange()}}handleDeleteMarker(t){if(!this.value||this.value.markers.findIndex(s=>s.id===t)===-1)return;const i=this.value.markers.filter(s=>s.id!==t);this.setMarkers(i),this.saveState(),this.refreshPopoverContent(),this.updateMainDisplay(),this.triggerChange()}handleClearAllMarkers(){this.value&&(this.setMarkers([]),this.saveState(),this.refreshPopoverContent(),this.updateMainDisplay(),this.triggerChange())}getNextPrizeInfo(){if(!this.value)return{index:1,name:"Prize 1"};const t=this.value.markers.map(s=>s.index).sort((s,n)=>s-n);let e=1;for(const s of t)if(s===e)e++;else break;let i=`Prize ${e}`;if(this.props.prizeMap&&this.props.prizeMap.length>0){const s=this.props.prizeMap[e-1];s&&(i=s)}return{index:e,name:i}}showCursorTooltip(){if(!this.cursorTooltip||!this.value||this.value.markers.length>=(this.props.maxMarkers||10))return;const t=this.getNextPrizeInfo();this.cursorTooltip.textContent=String(t.index),this.cursorTooltip.classList.add("visible")}hideCursorTooltip(){this.cursorTooltip&&this.cursorTooltip.classList.remove("visible")}updateCursorTooltip(t){if(!this.cursorTooltip||!this.imageElement)return;const e=this.imageElement.getBoundingClientRect(),i=t.clientX-e.left,s=t.clientY-e.top;this.cursorTooltip.style.left=`${i}px`,this.cursorTooltip.style.top=`${s}px`}saveState(){if(this.isUndoRedoOperation||!this.value)return;const t=JSON.parse(JSON.stringify(this.value.markers));if(this.historyIndex>=0&&this.history.length>0){const e=this.history[this.historyIndex];if(JSON.stringify(e)===JSON.stringify(t))return}this.history=this.history.slice(0,this.historyIndex+1),this.history.push(t),this.historyIndex++,this.history.length>50&&(this.history.shift(),this.historyIndex--),this.updateUndoRedoButtons()}canUndo(){return this.historyIndex>0}canRedo(){return this.historyIndex<this.history.length-1}undo(){if(!this.canUndo()||!this.value)return;this.historyIndex--,this.isUndoRedoOperation=!0;const t=JSON.parse(JSON.stringify(this.history[this.historyIndex]));this.setMarkers(t),this.refreshPopoverContent(),this.updateMainDisplay(),this.triggerChange(),this.isUndoRedoOperation=!1,this.updateUndoRedoButtons()}redo(){if(!this.canRedo()||!this.value)return;this.historyIndex++,this.isUndoRedoOperation=!0;const t=JSON.parse(JSON.stringify(this.history[this.historyIndex]));this.setMarkers(t),this.refreshPopoverContent(),this.updateMainDisplay(),this.triggerChange(),this.isUndoRedoOperation=!1,this.updateUndoRedoButtons()}updateUndoRedoButtons(){if(!this.popoverEl)return;const t=this.popoverEl.querySelector(".undo-btn"),e=this.popoverEl.querySelector(".redo-btn");t&&(t.disabled=!this.canUndo()),e&&(e.disabled=!this.canRedo())}showError(t){const e=document.createElement("div");if(e.className="image-map-error-toast",e.textContent=t,e.style.cssText=`
264
- position: fixed;
265
- top: 20px;
266
- right: 20px;
267
- background-color: #ef4444;
268
- color: white;
269
- padding: 12px 16px;
270
- border-radius: 8px;
271
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
272
- z-index: 10000;
273
- max-width: 350px;
274
- font-size: 14px;
275
- animation: slideIn 0.3s ease-out;
276
- `,!document.getElementById("image-map-toast-styles")){const i=document.createElement("style");i.id="image-map-toast-styles",i.textContent=`
277
- @keyframes slideIn {
278
- from {
279
- transform: translateX(400px);
280
- opacity: 0;
281
- }
282
- to {
283
- transform: translateX(0);
284
- opacity: 1;
285
- }
286
- }
287
- @keyframes slideOut {
288
- from {
289
- transform: translateX(0);
290
- opacity: 1;
291
- }
292
- to {
293
- transform: translateX(400px);
294
- opacity: 0;
295
- }
296
- }
297
- `,document.head.appendChild(i)}document.body.appendChild(e),setTimeout(()=>{e.style.animation="slideOut 0.3s ease-out",setTimeout(()=>{e.parentElement&&e.parentElement.removeChild(e)},300)},5e3)}setMarkers(t){const e=t.map(i=>({...i}));this.value={...this.value||{imageUrl:"",markers:[]},markers:e}}scaleMarkersForNewImage(t,e,i){if(!t.length)return[];const s=e&&e.width&&e.height&&e||i&&i.width&&i.height&&i||null;return t.map(n=>{const o={...n};return s&&o.x>100&&(o.x=o.x/s.width*100),s&&o.y>100&&(o.y=o.y/s.height*100),o.x=this.clampPercentage(o.x),o.y=this.clampPercentage(o.y),o})}clampPercentage(t){return Number.isFinite(t)?Math.max(0,Math.min(100,t)):0}recordImageNaturalSize(){if(!this.imageElement)return;const{naturalWidth:t,naturalHeight:e}=this.imageElement;t&&e&&(this.lastImageNaturalSize={width:t,height:e})}showConfirmModal(t,e){return this.confirmPromise?this.confirmPromise:(this.confirmPromise=new Promise(i=>{this.confirmOverlayEl&&(this.confirmOverlayEl.remove(),this.confirmOverlayEl=null);const s=document.createElement("div");s.className="image-map-confirm-overlay",this.confirmOverlayEl=s;const n=document.createElement("div");n.className="image-map-confirm-modal";const o=document.createElement("div");o.className="confirm-header",o.textContent=t;const a=document.createElement("div");a.className="confirm-body",a.textContent=e;const l=document.createElement("div");l.className="confirm-actions";const r=document.createElement("button");r.type="button",r.className="confirm-btn ghost",r.textContent="Cancel";const c=document.createElement("button");c.type="button",c.className="confirm-btn danger",c.textContent="Discard";const h=p=>{s.remove(),this.confirmOverlayEl=null,this.confirmPromise=null,i(p)};r.addEventListener("click",()=>h(!1)),c.addEventListener("click",()=>h(!0)),s.addEventListener("click",p=>{p.target===s&&h(!1)}),l.appendChild(r),l.appendChild(c),n.appendChild(o),n.appendChild(a),n.appendChild(l),s.appendChild(n),document.body.appendChild(s),setTimeout(()=>{n.classList.add("visible")},10)}),this.confirmPromise)}triggerChange(){this.value&&(this.onChange&&this.onChange(this.value),this.props.detectChange&&this.props.detectChange(this.value))}destroy(){var t,e;this.closePopover(),(t=this.backdropEl)!=null&&t.parentElement&&this.backdropEl.parentElement.removeChild(this.backdropEl),(e=this.popoverEl)!=null&&e.parentElement&&this.popoverEl.parentElement.removeChild(this.popoverEl),document.removeEventListener("click",this.onBackgroundClick,!0),document.removeEventListener("keydown",this.handlePopoverKeydown,!0),this.cleanupMessageListener()}};A.openInstance=null;let lt=A;class Nt extends B{constructor(t={}){super({...t,title:t.title||"Height",suffix:t.suffix||"px",minValue:t.minValue??0,icon:t.icon||ve,default:t.default??100}),this.inputType="number",this.mobileValue=t.mobile}getMobileValue(){return this.mobileValue}setMobileValue(t){this.mobileValue=t,t!==void 0&&this.setValue(t)}}const ve=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
167
+ `,i.appendChild(n),i.appendChild(this.previewWrapper),i.appendChild(o),t.appendChild(i),s?this.updatePreviewState(this.value):this.updatePreviewState(null),o.onclick=()=>{window.postMessage({type:"OPEN_FILE_MANAGER_MODAL",settingId:this.id},"*")},t}}class Dt extends S{constructor(t={}){super({...t,title:t.title||"Height",suffix:t.suffix||"px",minValue:t.minValue??0,icon:t.icon||Rt,default:t.default??100}),this.inputType="number",this.mobileValue=t.mobile}getMobileValue(){return this.mobileValue}setMobileValue(t){this.mobileValue=t,t!==void 0&&this.setValue(t)}}const Rt=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
298
168
  <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"/>
299
- </svg>`;class It extends B{constructor(t={}){super({...t,title:t.title||"Width",suffix:t.suffix||"px",minValue:t.minValue??0,icon:t.icon||fe,default:t.default??100}),this.inputType="number",this.mobileValue=t.mobile}getMobileValue(){return this.mobileValue}setMobileValue(t){this.mobileValue=t,t!==void 0&&this.setValue(t)}}const fe=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
169
+ </svg>`;class Ft extends S{constructor(t={}){super({...t,title:t.title||"Width",suffix:t.suffix||"px",minValue:t.minValue??0,icon:t.icon||Gt,default:t.default??100}),this.inputType="number",this.mobileValue=t.mobile}getMobileValue(){return this.mobileValue}setMobileValue(t){this.mobileValue=t,t!==void 0&&this.setValue(t)}}const Gt=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
300
170
  <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"/>
301
- </svg>`,Ce=`
171
+ </svg>`,Ut=`
302
172
  <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">
303
173
  <polyline points="6 9 12 15 18 9"></polyline>
304
174
  </svg>
305
- `;class ye extends b{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.getDataPropsPath()&&e.setAttribute("data-test-id",this.getDataPropsPath()),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 o=document.createElement("span");if(o.className="select-value",this.isLoading)o.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,l=a&&typeof a.name=="string"?a.name:"Select an option";o.textContent=l}e.appendChild(o)}else{const n=document.createElement("span");if(this.isLoading)n.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,a=o&&typeof o.name=="string"?o.name:"Select an option";n.textContent=a}e.appendChild(n)}e.onclick=()=>{var n,o;this.isLoading||(this.isOpen=!this.isOpen,(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(o=this.svgContainer)==null||o.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,o)=>{const a=this.createOption(n,o);a.onclick=l=>this.selectApiOption(l,o,e),i.appendChild(a)}),t.appendChild(i);const s=document.createElement("div");return s.classList.add("svg-container"),s.innerHTML=Ce,t.appendChild(s),s.onclick=()=>{var n,o;this.isLoading||(this.isOpen=!this.isOpen,(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(o=this.svgContainer)==null||o.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 o=new Set(this._options.map(l=>JSON.stringify(l.value))),a=n.filter(l=>!o.has(JSON.stringify(l.value)));if(this._options.push(...a),this.isLoading=!1,this.hasInitializedOptions=!0,this.value!==void 0){const l=this._options.findIndex(r=>JSON.stringify(r.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 o=new Set(this._options.map(l=>JSON.stringify(l.value))),a=n.filter(l=>!o.has(JSON.stringify(l.value)));if(this._options.push(...a),this.isLoading=!1,this.value!==void 0){const l=this._options.findIndex(r=>JSON.stringify(r.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}getJson(t=!0){return JSON.stringify(t?{}:{value:this.value},null,2)}selectApiOption(t,e,i){var a,l,r;const s=t.target,n=s.querySelector(".select-api-radio")||((a=s.closest(".select-api-option"))==null?void 0:a.querySelector(".select-api-radio"));n&&(n.checked=!0);const o=this._options[e].value;this.setValue(o),this.isOpen=!1,(l=this.optionsListEl)==null||l.classList.remove("open"),(r=this.svgContainer)==null||r.classList.remove("open")}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="")}}update(t=!1){var e;if(this.selectedOptionIndex=this.value!==void 0?this._options.findIndex(i=>JSON.stringify(i.value)===JSON.stringify(this.value)):null,this.updateOptionsList(),this.updateButtonText(),t&&this.value!==void 0){(e=this.onChange)==null||e.call(this,this.value);const i=this.props.detectChange||this.detectChangeCallback;i==null||i(this.value)}}setDetectChange(t){this.detectChangeCallback=t,this.props.detectChange=t}setValue(t){super.setValue(t),this.selectedOptionIndex=this._options.findIndex(e=>JSON.stringify(e.value)===JSON.stringify(t)),this.updateButtonText(),this.updateOptionsList(),this.detectChangeCallback&&this.detectChangeCallback!==this.props.detectChange&&this.detectChangeCallback(t)}}class Ee extends b{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 o,a;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=((a=(o=this.props.options)==null?void 0:o.find(l=>l.value===this.value))==null?void 0:a.status)??!1,this.getDataPropsPath()&&s.setAttribute("data-test-id",this.getDataPropsPath()),s.addEventListener("change",()=>{var r,c;const l=((c=(r=this.props.options)==null?void 0:r.find(h=>h.status===s.checked))==null?void 0:c.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"),r=this.props.activeColor||"#4CAF50",c=this.props.inactiveColor||"#ccc";l.textContent=`
175
+ `;class zt extends b{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.getDataPropsPath()&&e.setAttribute("data-test-id",this.getDataPropsPath()),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 o=document.createElement("span");if(o.className="select-value",this.isLoading)o.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,l=a&&typeof a.name=="string"?a.name:"Select an option";o.textContent=l}e.appendChild(o)}else{const n=document.createElement("span");if(this.isLoading)n.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,a=o&&typeof o.name=="string"?o.name:"Select an option";n.textContent=a}e.appendChild(n)}e.onclick=()=>{var n,o;this.isLoading||(this.isOpen=!this.isOpen,(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(o=this.svgContainer)==null||o.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,o)=>{const a=this.createOption(n,o);a.onclick=l=>this.selectApiOption(l,o,e),i.appendChild(a)}),t.appendChild(i);const s=document.createElement("div");return s.classList.add("svg-container"),s.innerHTML=Ut,t.appendChild(s),s.onclick=()=>{var n,o;this.isLoading||(this.isOpen=!this.isOpen,(n=this.optionsListEl)==null||n.classList.toggle("open",this.isOpen),(o=this.svgContainer)==null||o.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 o=new Set(this._options.map(l=>JSON.stringify(l.value))),a=n.filter(l=>!o.has(JSON.stringify(l.value)));if(this._options.push(...a),this.isLoading=!1,this.hasInitializedOptions=!0,this.value!==void 0){const l=this._options.findIndex(r=>JSON.stringify(r.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 o=new Set(this._options.map(l=>JSON.stringify(l.value))),a=n.filter(l=>!o.has(JSON.stringify(l.value)));if(this._options.push(...a),this.isLoading=!1,this.value!==void 0){const l=this._options.findIndex(r=>JSON.stringify(r.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}getJson(t=!0){return JSON.stringify(t?{}:{value:this.value},null,2)}selectApiOption(t,e,i){var l,r,h,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 o=this._options[e].value;this.value=o;const a=i.querySelector(".select-value");if(a)a.textContent=this._options[e].name;else{const d=i.firstChild;d&&d.tagName==="SPAN"&&(d.textContent=this._options[e].name)}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,o),this.detectChangeCallback&&this.detectChangeCallback(o)}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 Wt extends b{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 o,a;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=((a=(o=this.props.options)==null?void 0:o.find(l=>l.value===this.value))==null?void 0:a.status)??!1,this.getDataPropsPath()&&s.setAttribute("data-test-id",this.getDataPropsPath()),s.addEventListener("change",()=>{var r,h;const l=((h=(r=this.props.options)==null?void 0:r.find(p=>p.status===s.checked))==null?void 0:h.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"),r=this.props.activeColor||"#4CAF50",h=this.props.inactiveColor||"#ccc";l.textContent=`
306
176
  .toggle-switch input:checked + .toggle-slider {
307
177
  background-color: ${r};
308
178
  }
309
179
  .toggle-switch .toggle-slider {
310
- background-color: ${c};
180
+ background-color: ${h};
311
181
  }
312
- `,document.head.appendChild(l)}if(i.appendChild(s),i.appendChild(n),t.appendChild(i),this.props.description){t.classList.add("toggle-has-description");const l=document.createElement("p");l.className="toggle-description",l.textContent=this.props.description,t.appendChild(l)}return t}setDetectChange(t){this.detectChangeCallback=t}}const be=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
182
+ `,document.head.appendChild(l)}if(i.appendChild(s),i.appendChild(n),t.appendChild(i),this.props.description){t.classList.add("toggle-has-description");const l=document.createElement("p");l.className="toggle-description",l.textContent=this.props.description,t.appendChild(l)}return t}setDetectChange(t){this.detectChangeCallback=t}}const jt=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
313
183
  <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"/>
314
- </svg>`;class we extends b{constructor(t={}){t.rowGap=t.rowGap??!0,t.columnGap=t.columnGap??!0,t.title=t.title??"Gap",t.icon=t.icon??be,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 a=document.createElement("span");a.className="setting-icon",a.innerHTML=this.props.icon,i.insertBefore(a,s)}const n=document.createElement("div");n.className=`setting-input-wrapper ${this.props.wrapperClassName||""}`,n.classList.add("gap-setting-wrapper");const o=document.createElement("div");return o.className="gap-inputs-container",this.props.rowGap&&o.appendChild(this.createGapInput("row","Row")),this.props.columnGap&&o.appendChild(this.createGapInput("column","Col")),n.appendChild(o),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,this.getDataPropsPath()&&s.setAttribute("data-test-id",`${this.getDataPropsPath()}_${t}`),s.addEventListener("input",n=>{const o=n.target;let a=parseFloat(o.value);a=this.validateValue(a),String(a)!==o.value&&(o.value=String(a)),this.inputValues[t]=a,this.setValue(a)}),s.addEventListener("blur",n=>{var l,r;const o=n.target;let a=parseFloat(o.value);a=this.validateValue(a),String(a)!==o.value&&(o.value=String(a),this.inputValues[t]=a,this.setValue(a)),(r=(l=this.props).onBlur)==null||r.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}setMobileValue(t){this.mobileValue=t,t!==void 0&&this.setValue(t)}}const xe=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
184
+ </svg>`;class qt extends b{constructor(t={}){t.rowGap=t.rowGap??!0,t.columnGap=t.columnGap??!0,t.title=t.title??"Gap",t.icon=t.icon??jt,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 a=document.createElement("span");a.className="setting-icon",a.innerHTML=this.props.icon,i.insertBefore(a,s)}const n=document.createElement("div");n.className=`setting-input-wrapper ${this.props.wrapperClassName||""}`,n.classList.add("gap-setting-wrapper");const o=document.createElement("div");return o.className="gap-inputs-container",this.props.rowGap&&o.appendChild(this.createGapInput("row","Row")),this.props.columnGap&&o.appendChild(this.createGapInput("column","Col")),n.appendChild(o),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,this.getDataPropsPath()&&s.setAttribute("data-test-id",`${this.getDataPropsPath()}_${t}`),s.addEventListener("input",n=>{const o=n.target;let a=parseFloat(o.value);a=this.validateValue(a),String(a)!==o.value&&(o.value=String(a)),this.inputValues[t]=a,this.setValue(a)}),s.addEventListener("blur",n=>{var l,r;const o=n.target;let a=parseFloat(o.value);a=this.validateValue(a),String(a)!==o.value&&(o.value=String(a),this.inputValues[t]=a,this.setValue(a)),(r=(l=this.props).onBlur)==null||r.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}setMobileValue(t){this.mobileValue=t,t!==void 0&&this.setValue(t)}}const _t=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
315
185
  <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"/>
316
- </svg>`;class Le extends B{constructor(t={}){super({...t,minValue:t.minValue??0,maxValue:t.maxValue??1e3,icon:t.icon||xe,title:t.title||"Margin Bottom",default:t.default??20,wrapperClassName:"margin-bottom-wrapper "+(t.wrapperClassName||"")}),this.inputType="number"}}const ke=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
186
+ </svg>`;class Jt extends S{constructor(t={}){super({...t,minValue:t.minValue??0,maxValue:t.maxValue??1e3,icon:t.icon||_t,title:t.title||"Margin Bottom",default:t.default??20,wrapperClassName:"margin-bottom-wrapper "+(t.wrapperClassName||"")}),this.inputType="number"}}const Xt=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
317
187
  <path d="M15.75 7.25H2.25m9.9 9h-6.3c-1.26 0-1.89 0-2.371-.245a2.25 2.25 0 0 1-.984-.983c-.245-.482-.245-1.112-.245-2.372v-6.3c0-1.26 0-1.89.245-2.371a2.25 2.25 0 0 1 .984-.984c.48-.245 1.11-.245 2.371-.245h6.3c1.26 0 1.89 0 2.371.245.424.216.768.56.984.984.245.48.245 1.11.245 2.371v6.3c0 1.26 0 1.89-.245 2.371-.216.424-.56.768-.984.984-.48.245-1.11.245-2.371.245"
318
188
  stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
319
- </svg>`;class Me extends B{constructor(t={}){super({...t,minValue:t.minValue??0,maxValue:t.maxValue??1e3,icon:t.icon||ke,title:t.title||"Margin Top",default:t.default??20,wrapperClassName:"margin-top-wrapper "+(t.wrapperClassName||"")}),this.inputType="number"}}class Se extends b{constructor(t){super(t),this.inputType={},this.container=null,this.defaultLanguage="",this.uploadSettings=new Map,this.popup=null,t.default?this.value={...t.default}:this.value||(this.value={});const e=b.HasExplicitCurrentLanguage(),i=e?b.CurrentLanguage():"",s=b.DefaultLanguage;this.defaultLanguage=e&&i&&t.languages.includes(i)?i:s&&t.languages.includes(s)?s:t.languages[0];const n=t.defaultValue||`Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;t.languages.forEach(o=>{var a,l;o in(this.value||{})||(this.value||(this.value={}),o===this.defaultLanguage&&n?this.value[o]=((a=t.default)==null?void 0:a[o])||n:this.value[o]=((l=t.default)==null?void 0:l[o])||"")})}capitalizeFirstLetter(t){return String(t).charAt(0).toUpperCase()+String(t).slice(1)}measureTextWidth(t,e){this.textMeasureCanvas||(this.textMeasureCanvas=document.createElement("canvas"));const i=this.textMeasureCanvas.getContext("2d");if(!i)return t.length*10;const s=`${e.fontStyle} ${e.fontWeight} ${e.fontSize} ${e.fontFamily}`.trim();return i.font=s,i.measureText(t).width}adaptPlaceholderToSingleLine(t,e){const i=window.getComputedStyle(t),s=parseFloat(i.paddingLeft)||0,n=parseFloat(i.paddingRight)||0,o=parseFloat(i.borderLeftWidth)||0,a=parseFloat(i.borderRightWidth)||0,l=Math.max(0,t.clientWidth-s-n-o-a);if(l<=0){t.placeholder=e;return}if(this.measureTextWidth(e,i)<=l){t.placeholder=e;return}const c="...";let h=0,p=e.length,g=0;for(;h<=p;){const m=Math.floor((h+p)/2),u=e.slice(0,m).trimEnd()+c;this.measureTextWidth(u,i)<=l?(g=m,h=m+1):p=m-1}const C=e.slice(0,g).trimEnd()+c;t.placeholder=C}autosizeTextarea(t,e=3){t.style.height="auto";const i=window.getComputedStyle(t),s=parseFloat(i.lineHeight)||20,n=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),o=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),a=s*e+n+o,l=Math.min(t.scrollHeight||44,a);t.style.height=`${l}px`,t.scrollHeight>a?t.style.overflowY="auto":t.style.overflowY="hidden"}createTextareaRow(t,e){const i=document.createElement("div");i.classList.add("simple-multi-language-row");const s=document.createElement("label");if(s.classList.add("simple-language-label"),s.textContent=t.toUpperCase(),s.setAttribute("for",`textarea-${t}`),i.appendChild(s),this.props.multiImg){const n=new et({defaultUrl:e||"",title:"",id:`${this.id}_upload_${t}`});n.setOnChange(a=>{this.updateLanguageValue(t,a),t===this.defaultLanguage&&this.updateOtherLanguagePlaceholders(a)}),this.uploadSettings.set(t,n);const o=n.draw();o.classList.add("simple-language-upload"),i.appendChild(o)}else{const n=document.createElement("textarea");n.id=`textarea-${t}`,n.classList.add("simple-language-textarea"),n.value=e||"",n.rows=1,n.style.overflowY="hidden";let o=this.props.placeholder||"Enter text in {language}...";o.includes("{language}")&&(o=o.replace("{language}",t.toUpperCase())),n.setAttribute("data-full-placeholder",o),this.adaptPlaceholderToSingleLine(n,o),this.getDataPropsPath()&&n.setAttribute("data-test-id",`${this.getDataPropsPath()}_${t}`),n.addEventListener("input",l=>{const r=l.target;this.updateLanguageValue(t,r.value),t===this.defaultLanguage&&this.updateOtherLanguagePlaceholders(r.value),this.autosizeTextarea(r,3);const c=n.getAttribute("data-full-placeholder")||"";c&&this.adaptPlaceholderToSingleLine(n,c)}),i.appendChild(n),(l=>(typeof queueMicrotask=="function"?queueMicrotask:r=>setTimeout(r,0))(l))(()=>{this.autosizeTextarea(n,3);const l=n.getAttribute("data-full-placeholder")||"";l&&this.adaptPlaceholderToSingleLine(n,l)})}return i}updateLanguageValue(t,e){this.value||(this.value={});const i={...this.value,[t]:e};this.setValue(i)}updateOtherLanguagePlaceholders(t){this.container&&this.props.languages.forEach(e=>{var s,n;if(e===this.defaultLanguage)return;const i=(s=this.container)==null?void 0:s.querySelector(`#textarea-${e}`);if(i&&(!i.value||i.value.trim()==="")){const o=t||((n=this.props.placeholder)==null?void 0:n.replace("{language}",e.toUpperCase()))||`Enter text in ${e.toUpperCase()}...`;i.setAttribute("data-full-placeholder",o),this.adaptPlaceholderToSingleLine(i,o)}})}renderContent(t){var n;const e=t.querySelector(".simple-multi-language-content");if(!e)return;e.innerHTML="";const i=b.HasExplicitCurrentLanguage(),s=b.CurrentLanguage();if(!i||!s||!this.props.languages.includes(s))this.props.languages.forEach(o=>{var r;const a=((r=this.value)==null?void 0:r[o])||"",l=this.createTextareaRow(o,a);e.appendChild(l)});else{const o=((n=this.value)==null?void 0:n[s])||"",a=this.createTextareaRow(s,o);e.appendChild(a);const l=e.querySelector(".simple-language-textarea");if(l){const r=l.getAttribute("data-full-placeholder")||"";r&&this.adaptPlaceholderToSingleLine(l,r)}}}createPopup(){const t=document.createElement("div");t.classList.add("multi-language-popup-overlay"),t.style.cssText=`
320
- position: fixed;
321
- top: 0;
322
- left: 0;
323
- right: 0;
324
- bottom: 0;
325
- background: rgba(0, 0, 0, 0.5);
326
- display: flex;
327
- align-items: center;
328
- justify-content: center;
329
- z-index: 1;
330
- `;const e=document.createElement("div");e.classList.add("multi-language-popup"),e.style.cssText=`
331
- background: white;
332
- border-radius: 8px;
333
- padding: 24px;
334
- max-width: 600px;
335
- width: 90%;
336
- max-height: 80vh;
337
- overflow-y: auto;
338
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
339
- `;const i=document.createElement("div");i.style.cssText=`
340
- display: flex;
341
- justify-content: space-between;
342
- align-items: center;
343
- margin-bottom: 20px;
344
- `;const s=document.createElement("h3");s.textContent="All Languages",s.style.cssText=`
345
- margin: 0;
346
- font-size: 18px;
347
- font-weight: 600;
348
- `;const n=document.createElement("button");n.textContent="×",n.style.cssText=`
349
- background: none;
350
- border: none;
351
- font-size: 28px;
352
- cursor: pointer;
353
- color: #666;
354
- padding: 0;
355
- width: 32px;
356
- height: 32px;
357
- display: flex;
358
- align-items: center;
359
- justify-content: center;
360
- line-height: 1;
361
- `,n.addEventListener("click",()=>this.closePopup()),i.appendChild(s),i.appendChild(n),e.appendChild(i);const o=document.createElement("div");return o.classList.add("multi-language-popup-content"),this.props.languages.forEach(a=>{var c;const l=((c=this.value)==null?void 0:c[a])||"",r=this.createTextareaRow(a,l);o.appendChild(r)}),e.appendChild(o),t.appendChild(e),t.addEventListener("click",a=>{a.target===t&&this.closePopup()}),t}showPopup(){this.popup||(this.popup=this.createPopup(),document.body.appendChild(this.popup))}closePopup(){this.popup&&(document.body.removeChild(this.popup),this.popup=null)}draw(){const t=document.createElement("div");t.classList.add("simple-multi-language-wrapper");const e=document.createElement("div");e.classList.add("simple-multi-language-title"),e.style.cssText=`
362
- display: flex;
363
- justify-content: space-between;
364
- align-items: center;
365
- `;const i=document.createElement("span");i.textContent=this.props.title??"";const s=document.createElement("button");s.classList.add("multi-language-eye-icon"),s.innerHTML=`
366
- <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
367
- <path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
368
- <circle cx="12" cy="12" r="3"></circle>
369
- </svg>
370
- `,s.style.cssText=`
371
- background: none;
372
- border: none;
373
- cursor: pointer;
374
- padding: 4px;
375
- display: flex;
376
- align-items: center;
377
- justify-content: center;
378
- color: #666;
379
- transition: color 0.2s;
380
- `,s.addEventListener("mouseenter",()=>{s.style.color="#000"}),s.addEventListener("mouseleave",()=>{s.style.color="#666"}),s.addEventListener("click",a=>{a.preventDefault(),this.showPopup()}),e.appendChild(i),e.appendChild(s),t.appendChild(e);const n=document.createElement("div");n.classList.add("simple-multi-language-content"),t.appendChild(n),this.container=t,this.renderContent(t),this.languageChangeUnsubscribe=b.onLanguageChange(a=>{a&&this.props.languages.includes(a)&&(this.defaultLanguage=a),this.container&&this.renderContent(this.container)});const o=()=>{if(!this.container)return;this.container.querySelectorAll(".simple-language-textarea").forEach(l=>{const r=l.getAttribute("data-full-placeholder")||"";r&&this.adaptPlaceholderToSingleLine(l,r)})};return window.addEventListener("resize",o),t}setValue(t){super.setValue(t),this.container&&this.props.languages.forEach(e=>{var i;if(this.props.multiImg){const s=this.uploadSettings.get(e);s&&s.setValue((t==null?void 0:t[e])||"")}else{const s=(i=this.container)==null?void 0:i.querySelector(`#textarea-${e}`);if(s){s.value=(t==null?void 0:t[e])||"",this.autosizeTextarea(s,3);const n=s.getAttribute("data-full-placeholder")||"";n&&this.adaptPlaceholderToSingleLine(s,n)}}})}}class Ne extends b{constructor(t={}){super(t),this.inputType="select";const e=[{name:"None",value:"none"},{name:"Fade",value:"fade 1.5s ease-in-out infinite"},{name:"Slide",value:"slide 1.5s ease-in-out infinite"},{name:"Zoom",value:"zoom 1.5s ease-in-out infinite"},{name:"Bounce",value:"bounce 1.5s ease-in-out infinite"},{name:"Pulse",value:"pulse 1.5s ease-in-out infinite"}];this.selectSetting=new Q({title:this.title||"Animation",options:e,default:this.props.default||"none"}),this.selectSetting.onChange=i=>{var s;this.value=i,(s=this.onChange)==null||s.call(this,i)}}draw(){return this.selectSetting.draw()}destroy(){this.selectSetting.destroy(),super.destroy()}}const Ie=`
189
+ </svg>`;class Zt extends S{constructor(t={}){super({...t,minValue:t.minValue??0,maxValue:t.maxValue??1e3,icon:t.icon||Xt,title:t.title||"Margin Top",default:t.default??20,wrapperClassName:"margin-top-wrapper "+(t.wrapperClassName||"")}),this.inputType="number"}}class Kt extends b{constructor(t){super(t),this.inputType={},this.container=null,this.defaultLanguage="",this.uploadSettings=new Map,t.default?this.value={...t.default}:this.value||(this.value={}),this.defaultLanguage=t.languages.includes(b.DefaultLanguage)?b.DefaultLanguage:t.languages[0];const e=t.defaultValue||`Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;t.languages.forEach(i=>{var s,n;i in(this.value||{})||(this.value||(this.value={}),i===this.defaultLanguage&&e?this.value[i]=((s=t.default)==null?void 0:s[i])||e:this.value[i]=((n=t.default)==null?void 0:n[i])||"")})}capitalizeFirstLetter(t){return String(t).charAt(0).toUpperCase()+String(t).slice(1)}measureTextWidth(t,e){this.textMeasureCanvas||(this.textMeasureCanvas=document.createElement("canvas"));const i=this.textMeasureCanvas.getContext("2d");if(!i)return t.length*10;const s=`${e.fontStyle} ${e.fontWeight} ${e.fontSize} ${e.fontFamily}`.trim();return i.font=s,i.measureText(t).width}adaptPlaceholderToSingleLine(t,e){const i=window.getComputedStyle(t),s=parseFloat(i.paddingLeft)||0,n=parseFloat(i.paddingRight)||0,o=parseFloat(i.borderLeftWidth)||0,a=parseFloat(i.borderRightWidth)||0,l=Math.max(0,t.clientWidth-s-n-o-a);if(l<=0){t.placeholder=e;return}if(this.measureTextWidth(e,i)<=l){t.placeholder=e;return}const h="...";let p=0,d=e.length,u=0;for(;p<=d;){const f=Math.floor((p+d)/2),g=e.slice(0,f).trimEnd()+h;this.measureTextWidth(g,i)<=l?(u=f,p=f+1):d=f-1}const m=e.slice(0,u).trimEnd()+h;t.placeholder=m}autosizeTextarea(t,e=3){t.style.height="auto";const i=window.getComputedStyle(t),s=parseFloat(i.lineHeight)||20,n=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),o=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),a=s*e+n+o,l=Math.min(t.scrollHeight||44,a);t.style.height=`${l}px`,t.scrollHeight>a?t.style.overflowY="auto":t.style.overflowY="hidden"}createTextareaRow(t,e){const i=document.createElement("div");i.classList.add("simple-multi-language-row");const s=document.createElement("label");if(s.classList.add("simple-language-label"),s.textContent=t.toUpperCase(),s.setAttribute("for",`textarea-${t}`),i.appendChild(s),this.props.multiImg){const n=new st({defaultUrl:e||"",title:"",id:`${this.id}_upload_${t}`});n.setOnChange(a=>{this.updateLanguageValue(t,a),t===this.defaultLanguage&&this.updateOtherLanguagePlaceholders(a)}),this.uploadSettings.set(t,n);const o=n.draw();o.classList.add("simple-language-upload"),i.appendChild(o)}else{const n=document.createElement("textarea");n.id=`textarea-${t}`,n.classList.add("simple-language-textarea"),n.value=e||"",n.rows=1,n.style.overflowY="hidden";let o=this.props.placeholder||"Enter text in {language}...";o.includes("{language}")&&(o=o.replace("{language}",t.toUpperCase())),n.setAttribute("data-full-placeholder",o),this.adaptPlaceholderToSingleLine(n,o),this.getDataPropsPath()&&n.setAttribute("data-test-id",`${this.getDataPropsPath()}_${t}`),n.addEventListener("input",l=>{const r=l.target;this.updateLanguageValue(t,r.value),t===this.defaultLanguage&&this.updateOtherLanguagePlaceholders(r.value),this.autosizeTextarea(r,3);const h=n.getAttribute("data-full-placeholder")||"";h&&this.adaptPlaceholderToSingleLine(n,h)}),i.appendChild(n),(l=>(typeof queueMicrotask=="function"?queueMicrotask:r=>setTimeout(r,0))(l))(()=>{this.autosizeTextarea(n,3);const l=n.getAttribute("data-full-placeholder")||"";l&&this.adaptPlaceholderToSingleLine(n,l)})}return i}updateLanguageValue(t,e){this.value||(this.value={});const i={...this.value,[t]:e};this.setValue(i)}updateOtherLanguagePlaceholders(t){this.container&&this.props.languages.forEach(e=>{var s,n;if(e===this.defaultLanguage)return;const i=(s=this.container)==null?void 0:s.querySelector(`#textarea-${e}`);if(i&&(!i.value||i.value.trim()==="")){const o=t||((n=this.props.placeholder)==null?void 0:n.replace("{language}",e.toUpperCase()))||`Enter text in ${e.toUpperCase()}...`;i.setAttribute("data-full-placeholder",o),this.adaptPlaceholderToSingleLine(i,o)}})}draw(){const t=document.createElement("div");if(t.classList.add("simple-multi-language-wrapper"),this.props.title){const s=document.createElement("div");s.classList.add("simple-multi-language-title"),s.textContent=this.props.title,t.appendChild(s)}const e=document.createElement("div");e.classList.add("simple-multi-language-content"),this.props.languages.forEach(s=>{var a;const n=((a=this.value)==null?void 0:a[s])||"",o=this.createTextareaRow(s,n);e.appendChild(o)}),t.appendChild(e),this.container=t;const i=()=>{if(!this.container)return;this.container.querySelectorAll(".simple-language-textarea").forEach(n=>{const o=n.getAttribute("data-full-placeholder")||"";o&&this.adaptPlaceholderToSingleLine(n,o)})};return window.addEventListener("resize",i),t}setValue(t){super.setValue(t),this.container&&this.props.languages.forEach(e=>{var i;if(this.props.multiImg){const s=this.uploadSettings.get(e);s&&s.setValue((t==null?void 0:t[e])||"")}else{const s=(i=this.container)==null?void 0:i.querySelector(`#textarea-${e}`);if(s){s.value=(t==null?void 0:t[e])||"",this.autosizeTextarea(s,3);const n=s.getAttribute("data-full-placeholder")||"";n&&this.adaptPlaceholderToSingleLine(s,n)}}})}}class Yt extends b{constructor(t={}){super(t),this.inputType="select";const e=[{name:"None",value:"none"},{name:"Fade",value:"fade 1.5s ease-in-out infinite"},{name:"Slide",value:"slide 1.5s ease-in-out infinite"},{name:"Zoom",value:"zoom 1.5s ease-in-out infinite"},{name:"Bounce",value:"bounce 1.5s ease-in-out infinite"},{name:"Pulse",value:"pulse 1.5s ease-in-out infinite"}];this.selectSetting=new Z({title:this.title||"Animation",options:e,default:this.props.default||"none"}),this.selectSetting.onChange=i=>{var s;this.value=i,(s=this.onChange)==null||s.call(this,i)}}draw(){return this.selectSetting.draw()}destroy(){this.selectSetting.destroy(),super.destroy()}}const gt=(c,t,e)=>{let i=!1,s=0,n=0,o=0,a=0;const l=p=>{if(p.target.closest("button"))return;i=!0,s=p.clientX,n=p.clientY;const d=t.getBoundingClientRect();o=d.left,a=d.top,document.addEventListener("mousemove",r),document.addEventListener("mouseup",h),document.body.style.userSelect="none"},r=p=>{if(!i)return;const d=p.clientX-s,u=p.clientY-n,m=window.innerWidth,f=window.innerHeight,g=t.offsetWidth,C=t.offsetHeight;let y=o+d,L=a+u;y=Math.max(8,Math.min(m-g-8,y)),L=Math.max(8,Math.min(f-C-8,L)),t.style.left=`${y}px`,t.style.top=`${L}px`,e==null||e(y,L)},h=()=>{i=!1,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",h),document.body.style.userSelect=""};c.addEventListener("mousedown",l)},D=c=>{if(!c)return null;let t=c.trim();return!t.startsWith("#")||(t=t.slice(1),t.length===3&&(t=t.split("").map(e=>e+e).join("")),!/^[0-9a-fA-F]{6}$/.test(t))?null:`#${t.toUpperCase()}`},F=(c,t,e)=>`#${[c,t,e].map(i=>Math.max(0,Math.min(255,i)).toString(16).padStart(2,"0")).join("")}`,M=c=>{const t=c.replace("#",""),e=t.length===3?t.split("").map(i=>i+i).join(""):t;return{r:parseInt(e.slice(0,2),16),g:parseInt(e.slice(2,4),16),b:parseInt(e.slice(4,6),16)}},A=c=>{const{r:t,g:e,b:i}=M(c),s=t/255,n=e/255,o=i/255,a=Math.max(s,n,o),l=Math.min(s,n,o),r=a-l;let h=0;r!==0&&(a===s?h=(n-o)/r%6:a===n?h=(o-s)/r+2:h=(s-n)/r+4),h<0&&(h+=6);const p=a===0?0:r/a,d=a;return{h:h*60,s:p,v:d}},z=(c,t,e)=>{const i=(c%360+360)%360,s=e*t,n=s*(1-Math.abs(i/60%2-1)),o=e-s;let a=0,l=0,r=0;return i<60?(a=s,l=n,r=0):i<120?(a=n,l=s,r=0):i<180?(a=0,l=s,r=n):i<240?(a=0,l=n,r=s):i<300?(a=n,l=0,r=s):(a=s,l=0,r=n),F(Math.round((a+o)*255),Math.round((l+o)*255),Math.round((r+o)*255))},Qt=(c,t,e)=>{const i=e*(1-t/2),s=i===0||i===1?0:(e-i)/Math.min(i,1-i);return{hue:c,sat:s,lightness:i}},K=(c,t,e)=>{const i=(1-Math.abs(2*e-1))*t,s=i*(1-Math.abs(c/60%2-1)),n=e-i/2;let o=0,a=0,l=0;return c<60?(o=i,a=s,l=0):c<120?(o=s,a=i,l=0):c<180?(o=0,a=i,l=s):c<240?(o=0,a=s,l=i):c<300?(o=s,a=0,l=i):(o=i,a=0,l=s),{r:Math.round((o+n)*255),g:Math.round((a+n)*255),b:Math.round((l+n)*255)}},mt=(c,t)=>{const e=Math.max(0,Math.min(100,t))/100;if(c.startsWith("#")){const{r:s,g:n,b:o}=M(c);return`rgba(${s}, ${n}, ${o}, ${e})`}if(c.startsWith("rgba("))return c.replace(/,\s*[\d.]+\)$/,`, ${e})`);if(c.startsWith("rgb("))return c.replace("rgb(","rgba(").replace(")",`, ${e})`);if(c.startsWith("hsl(")){const s=c.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(s){const{r:n,g:o,b:a}=K(parseInt(s[1]),parseInt(s[2])/100,parseInt(s[3])/100);return`rgba(${n}, ${o}, ${a}, ${e})`}}if(c.startsWith("hsla(")){const s=c.match(/hsla\((\d+),\s*(\d+)%,\s*(\d+)%,\s*[\d.]+\)/);if(s){const{r:n,g:o,b:a}=K(parseInt(s[1]),parseInt(s[2])/100,parseInt(s[3])/100);return`rgba(${n}, ${o}, ${a}, ${e})`}}const i=D(c);if(i){const{r:s,g:n,b:o}=M(i);return`rgba(${s}, ${n}, ${o}, ${e})`}return c},te=c=>["red","green","blue","yellow","orange","purple","pink","brown","black","white","gray","grey","cyan","magenta","lime","navy","maroon","olive","aqua","silver","teal","fuchsia","transparent"].includes(c.toLowerCase()),ft=c=>[/^#[0-9a-fA-F]{3,8}$/,/^rgba?\s*\([^)]+\)$/,/^hsla?\s*\([^)]+\)$/,/^[a-zA-Z]+$/].some(e=>e.test(c.trim())),ee=c=>{if(typeof document>"u")return ft(c)||!!D(c);const t=document.createElement("div");return t.style.color=c,t.style.color!==""},vt=c=>{const t=c.trim();if(/^#[0-9A-Fa-f]{8}$/.test(t)){const n=t.slice(1),o=parseInt(n.slice(0,2),16),a=parseInt(n.slice(2,4),16),l=parseInt(n.slice(4,6),16),r=parseInt(n.slice(6,8),16);return{color:F(o,a,l),position:0,opacity:Math.round(r/255*100)}}const e=t.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)/);if(e){const n=parseInt(e[1]),o=parseInt(e[2]),a=parseInt(e[3]),l=e[4]?parseFloat(e[4]):1;return{color:F(n,o,a),position:0,opacity:Math.round(l*100)}}const i=t.match(/hsla?\s*\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)/);if(i){const{r:n,g:o,b:a}=K(parseFloat(i[1]),parseFloat(i[2])/100,parseFloat(i[3])/100),l=i[4]?parseFloat(i[4]):1;return{color:F(n,o,a),position:0,opacity:Math.round(l*100)}}return{color:D(t)||t,position:0,opacity:100}},at=c=>{const t=[];let e="",i=0;for(let s=0;s<c.length;s++){const n=c[s];if(n==="(")i++;else if(n===")")i--;else if(n===","&&i===0){t.push(e.trim()),e="";continue}e+=n}return e.trim()&&t.push(e.trim()),t},lt=(c,t)=>{const e=new RegExp(`${t}\\s*\\(`,"i"),i=c.match(e);if(!i)return null;const s=i.index+i[0].length;let n=1,o=s;for(let a=s;a<c.length&&n>0;a++)c[a]==="("?n++:c[a]===")"&&n--,o=a;return n===0?c.substring(s,o):null},ie=c=>{const t=c.split(" ")[0].toLowerCase();return["circle","ellipse","closest-side","closest-corner","farthest-side","farthest-corner","at","contain","cover"].includes(t)?!1:/^#[0-9a-f]{3,8}$/i.test(t)||/^rgb/i.test(c)||/^hsl/i.test(c)||te(t)},rt=c=>{const t=[];return c.forEach((e,i)=>{const s=e.trim();if(!s)return;let n="",o=0;const a=s.match(/^(.+?)\s+(\d+(?:\.\d+)?)%?\s*$/);a&&ft(a[1].trim())?(n=a[1].trim(),o=parseFloat(a[2])):(n=s,o=c.length===1?0:i/(c.length-1)*100);const l=vt(n);l.position=Math.max(0,Math.min(100,Math.round(o))),t.push(l)}),t},B=c=>{const t=c.stops&&c.stops.length?c.stops:[{color:"#000000",position:0,opacity:100}];return{type:c.type&&["linear","radial","solid"].includes(c.type)?c.type:"linear",angle:typeof c.angle=="number"?c.angle:90,stops:t.map((e,i)=>({color:e.color||"#000000",position:typeof e.position=="number"?e.position:t.length===1?0:Math.round(i/(t.length-1)*100),opacity:e.opacity===void 0||Number.isNaN(e.opacity)?100:e.opacity}))}},P=c=>{const t=c.replace(/;$/,"").trim();if(ee(t)){const s=vt(t);return B({type:"solid",angle:0,stops:[s]})}const e=lt(t,"linear-gradient");if(e){const s=at(e);let n=90,o=s;const a=s[0];if(a.includes("deg")){const r=a.match(/(-?\d+(?:\.\d+)?)deg/);r&&(n=parseFloat(r[1]),o=s.slice(1))}else a.includes("to ")&&(n={"to right":90,"to left":270,"to bottom":180,"to top":0,"to bottom right":135,"to bottom left":225,"to top right":45,"to top left":315}[a]??90,o=s.slice(1));const l=rt(o);return l.length?B({type:"linear",angle:n,stops:l}):null}const i=lt(t,"radial-gradient");if(i){const s=at(i),n=s[0]&&!ie(s[0])?s.slice(1):s,o=rt(n);return o.length?B({type:"radial",angle:0,stops:o}):null}return null},V=c=>{if(c.type==="solid"){const e=c.stops[0],i=e.opacity??100,s=e.color.replace("#",""),n=Math.round(i/100*255).toString(16).toUpperCase().padStart(2,"0");return`#${s}${n}`}const t=c.stops.map(e=>`${mt(e.color,e.opacity??100)} ${e.position}%`).join(", ");return c.type==="radial"?`radial-gradient(circle, ${t})`:`linear-gradient(${c.angle}deg, ${t})`},se=c=>Math.round(c/100*255).toString(16).toUpperCase().padStart(2,"0"),J=c=>{if(c.type==="solid"){const t=c.stops[0];if(t){const e=t.color.toUpperCase(),i=t.opacity??100;if(i===100)return e;{const s=se(i);return`${e}${s}`}}return"#000000"}return c.type==="linear"?`Linear ${c.angle}°`:"Radial Gradient"},W=class W{static defaults(){return{solid:[],gradient:[]}}static normalizeList(t){const e=new Set,i=[];return t.forEach(s=>{let n=D(s);n||P(s)&&(n=s),n&&(e.has(n)||(e.add(n),i.push(n)))}),i.slice(0,this.MAX_COLORS)}static ensureLoaded(){var t;if(!this.colors&&(this.colors=this.defaults(),!(typeof window>"u")))try{const e=(t=window.sessionStorage)==null?void 0:t.getItem(this.STORAGE_KEY);if(!e)return;const i=JSON.parse(e);if(Array.isArray(i))this.colors.solid=this.normalizeList(i);else if(i&&typeof i=="object"){const s=i;s.solid&&(this.colors.solid=this.normalizeList(s.solid)),s.gradient&&(this.colors.gradient=this.normalizeList(s.gradient))}}catch{this.colors=this.defaults()}}static persist(){var t;if(!(typeof window>"u"))try{(t=window.sessionStorage)==null||t.setItem(this.STORAGE_KEY,JSON.stringify(this.colors||this.defaults()))}catch{}}static list(t){return this.ensureLoaded(),this.colors||(this.colors=this.defaults()),this.colors[t]}static getColors(t){if(t==="all"){const e=this.list("solid"),i=this.list("gradient"),s=[...e,...i];return this.normalizeList(s)}return[...this.list(t)]}static addColor(t,e){if(!t)return;let i=D(t),s="solid";if(i)s="solid";else{const l=P(t);l&&(i=t,s=l.type==="solid"?"solid":"gradient")}if(!i)return;const n=e==="all"?s:e,o=this.list(n),a=o.indexOf(i);a!==-1&&o.splice(a,1),o.unshift(i),o.length>this.MAX_COLORS&&(o.length=this.MAX_COLORS),this.persist()}};W.STORAGE_KEY="settingsLib_recentColors",W.MAX_COLORS=12,W.colors=null;let R=W;const nt=(c,t)=>{const e=document.createElement("div");e.className="color-picker-recent-section";const i=document.createElement("div");i.className="color-picker-recent-title",i.textContent="Recently Used";const s=document.createElement("div");s.className="color-picker-recent-grid";const n=document.createElement("div");n.className="color-picker-recent-placeholder",n.textContent="No recent colors yet",e.appendChild(i),e.appendChild(s),e.appendChild(n);const o=()=>{s.innerHTML="";const a=R.getColors(t);if(a.length===0){s.style.display="none",n.style.display="block";return}s.style.display="grid",n.style.display="none",a.forEach(l=>{const r=document.createElement("button");r.type="button",r.className="color-picker-recent-swatch";const h=ne(l);r.title=h,r.setAttribute("aria-label",`Use color: ${h}`),r.style.background=l,r.style.borderColor=l;const p=document.createElement("div");p.className="color-picker-tooltip",p.textContent=h,p.style.display="none",document.body.appendChild(p),r.addEventListener("mouseenter",d=>{const u=r.getBoundingClientRect();p.style.display="block",p.style.left=`${u.left+u.width/2}px`,p.style.top=`${u.bottom+8}px`}),r.addEventListener("mouseleave",()=>{p.style.display="none",r.style.boxShadow=""}),r.addEventListener("mousedown",()=>{r.style.boxShadow="0px 0px 0px 2px var(--grey40)"}),r.addEventListener("mouseup",()=>{setTimeout(()=>{r.style.boxShadow=""},150)}),r.addEventListener("click",()=>c(l)),r.addEventListener("DOMNodeRemoved",()=>{p.parentNode&&p.parentNode.removeChild(p)}),s.appendChild(r)})};return o(),{container:e,refresh:o}},ne=c=>{const t=P(c);if(t)return J(t);const e=D(c);if(e){const i=M(e);return`${e} (RGB: ${i.r}, ${i.g}, ${i.b})`}return c},Ct=`<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
190
+ <path fill-rule="evenodd" clip-rule="evenodd"
191
+ d="M6.12347 4.96653L1.41158 0.254304C1.25449 0.102568 1.04409 0.0186071 0.825694 0.0205049C0.607302 0.0224037 0.398393 0.110007 0.24396 0.26445C0.0895282 0.418893 0.0019303 0.627818 3.24698e-05 0.846225C-0.00186536 1.06463 0.0820894 1.27505 0.233815 1.43215L4.9457 6.14438L0.233814 10.8566C0.0820886 11.0137 -0.00186625 11.2241 3.15434e-05 11.4425C0.00192934 11.6609 0.0895272 11.8699 0.243959 12.0243C0.398392 12.1787 0.607301 12.2663 0.825693 12.2682C1.04408 12.2701 1.25449 12.1862 1.41158 12.0344L6.12347 7.32222L10.8354 12.0344C10.9932 12.1824 11.2023 12.2632 11.4186 12.2597C11.6349 12.2562 11.8414 12.1687 11.9943 12.0156C12.1472 11.8626 12.2346 11.6561 12.2379 11.4398C12.2413 11.2234 12.1604 11.0143 12.0123 10.8566L7.30123 6.14438L12.0131 1.43215C12.0927 1.35531 12.1561 1.2634 12.1998 1.16177C12.2434 1.06014 12.2664 0.950833 12.2674 0.84023C12.2683 0.729626 12.2473 0.61994 12.2054 0.517568C12.1635 0.415196 12.1017 0.322191 12.0234 0.243979C11.9452 0.165768 11.8522 0.103916 11.7499 0.0620327C11.6475 0.0201492 11.5378 -0.000927989 11.4272 3.33052e-05C11.3166 0.000993646 11.2073 0.0239743 11.1057 0.0676297C11.0041 0.111286 10.9122 0.174745 10.8354 0.254305L6.12347 4.96653Z"
192
+ fill="#919EAB"/>
193
+ </svg>`,oe=`<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
194
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M19.1972 3.29156C18.936 3.03034 18.6259 2.82313 18.2847 2.68176C17.9434 2.54039 17.5777 2.46763 17.2083 2.46763C16.8389 2.46763 16.4731 2.54039 16.1319 2.68176C15.7906 2.82313 15.4805 3.03034 15.2194 3.29156L13.7822 4.72875C13.2585 4.4772 12.6697 4.39449 12.097 4.49207C11.5243 4.58964 10.9961 4.86267 10.5853 5.27343L9.91687 5.94281C9.74268 6.11693 9.6045 6.32366 9.51023 6.5512C9.41595 6.77873 9.36743 7.02261 9.36743 7.2689C9.36743 7.5152 9.41595 7.75907 9.51023 7.98661C9.6045 8.21414 9.74268 8.42088 9.91687 8.595L3.83625 14.6747C3.57512 14.936 3.36803 15.2462 3.2268 15.5875C3.08556 15.9288 3.01296 16.2947 3.01312 16.6641V18.3516C3.01312 18.6499 3.13165 18.9361 3.34263 19.1471C3.55361 19.358 3.83975 19.4766 4.13812 19.4766H5.82562C6.57129 19.4759 7.28618 19.1792 7.81312 18.6516L13.8937 12.5728C14.0679 12.747 14.2746 12.8852 14.5021 12.9795C14.7297 13.0737 14.9735 13.1223 15.2198 13.1223C15.4661 13.1223 15.71 13.0737 15.9375 12.9795C16.1651 12.8852 16.3718 12.747 16.5459 12.5728L17.2153 11.9025C17.6261 11.4917 17.8991 10.9635 17.9967 10.3908C18.0942 9.81811 18.0115 9.22926 17.76 8.70562L19.1972 7.26937C19.4584 7.0082 19.6656 6.69813 19.807 6.35687C19.9484 6.01561 20.0211 5.64985 20.0211 5.28047C20.0211 4.91108 19.9484 4.54532 19.807 4.20406C19.6656 3.8628 19.4584 3.55273 19.1972 3.29156ZM5.16281 16.0012L11.2425 9.92062L12.5681 11.2462L6.48844 17.3269C6.31266 17.5027 6.07424 17.6015 5.82562 17.6016H4.88812V16.6641C4.88818 16.4154 4.98698 16.177 5.16281 16.0012Z" fill="#353C47"/>
195
+ </svg>`,ae=`<svg width="15" height="17" viewBox="0 0 15 17" fill="none" xmlns="http://www.w3.org/2000/svg">
196
+ <path d="M14.1333 12.4667H0.8M0.8 12.4667L4.13333 9.13332M0.8 12.4667L4.13333 15.8M0.8 4.13332H14.1333M14.1333 4.13332L10.8 0.799988M14.1333 4.13332L10.8 7.46665" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
197
+ </svg>`,le=`<svg width="14" height="2" viewBox="0 0 14 2" fill="none" xmlns="http://www.w3.org/2000/svg">
198
+ <path d="M0.8 0.800003H12.4667" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
199
+ </svg>`;class re{constructor(t,e="gradient"){this.isOpen=!1,this.currentColor="#FF0000",this.currentOpacity=100,this.outsideClick=i=>{if(!this.isOpen)return;const s=i.target;if(this.element.contains(s))return;const n=document.querySelectorAll(".gstop-color-input");Array.from(n).some(a=>a.contains(s))||(i.preventDefault(),i.stopPropagation(),this.close(!0))},this.keyDown=i=>{if(this.isOpen){if(i.key==="Escape")i.preventDefault(),this.close(!0);else if(i.key==="Enter"){const s=i.target;if(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"))return;i.preventDefault(),this.close(!0)}}},this.onChange=t,this.recentScope=e,this.element=this.build(),this.backdrop=this.createBackdrop()}parsePercentage(t){const e=parseFloat(t);return isNaN(e)?0:e/100}build(){const t=document.createElement("div");t.className="custom-color-picker",t.style.display="none";const e=document.createElement("div");e.className="color-picker-header",e.style.cursor="move";const i=document.createElement("span");i.textContent="Color";const s=document.createElement("button");s.className="color-picker-close",s.innerHTML=Ct,s.addEventListener("click",()=>this.close(!0)),e.appendChild(i),e.appendChild(s),gt(e,t);const n=document.createElement("div");n.className="color-picker-area",this.colorArea=n;const o=document.createElement("div");o.className="color-picker-marker",this.colorMarker=o,n.appendChild(o);const a=document.createElement("div");a.className="color-picker-sliders-container";const l=document.createElement("button");l.className="color-picker-eyedropper",l.type="button",l.innerHTML=oe;const r=document.createElement("div");r.className="color-picker-sliders-group";const h=document.createElement("div");h.className="color-picker-hue",this.hueSlider=h;const p=document.createElement("div");p.className="color-picker-hue-marker",this.hueMarker=p,h.appendChild(p);const d=document.createElement("div");d.className="color-picker-opacity",this.opacitySlider=d;const u=document.createElement("div");u.className="color-picker-opacity-marker",this.opacityMarker=u,d.appendChild(u),r.appendChild(h),r.appendChild(d),a.appendChild(l),a.appendChild(r);const m=nt(E=>{var x;this.setColor(E),(x=this.onChange)==null||x.call(this,E,this.currentOpacity)},this.recentScope);this.recentSectionRefresh=m.refresh;const f=document.createElement("div");f.className="color-picker-format-section";const g=document.createElement("select");g.className="color-picker-format-select",this.select=g;const C=document.createElement("option");C.value="hex",C.textContent="HEX";const y=document.createElement("option");y.value="rgb",y.textContent="RGB";const L=document.createElement("option");L.value="hsl",L.textContent="HSL",g.appendChild(C),g.appendChild(y),g.appendChild(L);const N=document.createElement("input");N.type="text",N.className="color-picker-color-input",N.value=this.currentColor,this.input=N;const O=document.createElement("div");O.className="color-picker-input-container";const v=document.createElement("button");return v.className="color-picker-copy-inside",v.textContent="Copy",O.appendChild(N),O.appendChild(v),f.appendChild(g),f.appendChild(O),t.appendChild(e),t.appendChild(n),t.appendChild(a),t.appendChild(m.container),t.appendChild(f),t.addEventListener("click",E=>E.stopPropagation()),this.bind(n,h,d,N,g,v,l),t}createBackdrop(){const t=document.createElement("div");return t.className="color-picker-backdrop",t.style.display="none",t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),this.close(!0)}),t}bind(t,e,i,s,n,o,a){const l=p=>{var y;const d=t.getBoundingClientRect(),u=Math.max(0,Math.min(1,(p.clientX-d.left)/d.width)),m=Math.max(0,Math.min(1,(p.clientY-d.top)/d.height));this.colorMarker.style.left=`${u*100}%`,this.colorMarker.style.top=`${m*100}%`;const g=this.parsePercentage(this.hueMarker.style.left||"0%")*360,C=z(g,u,1-m);this.currentColor=C,this.syncInput(),this.updateOpacityBg(),(y=this.onChange)==null||y.call(this,C,this.currentOpacity)},r=p=>{var y;const d=e.getBoundingClientRect();let u=Math.max(0,Math.min(1,(p.clientX-d.left)/d.width));this.hueMarker.style.left=`${u*100}%`;const m=u*360,f=this.parsePercentage(this.colorMarker.style.left||"0%"),g=this.parsePercentage(this.colorMarker.style.top||"0%"),C=z(m,f,1-g);this.currentColor=C,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${m}, 100%, 50%))`,this.syncInput(),this.updateOpacityBg(),(y=this.onChange)==null||y.call(this,C,this.currentOpacity)},h=p=>{var m;const d=i.getBoundingClientRect(),u=Math.max(0,Math.min(1,(p.clientX-d.left)/d.width));this.opacityMarker.style.left=`${u*100}%`,this.currentOpacity=Math.round(u*100),(m=this.onChange)==null||m.call(this,this.currentColor,this.currentOpacity)};t.addEventListener("mousedown",p=>{p.preventDefault(),l(p);const d=m=>l(m),u=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",u)}),e.addEventListener("mousedown",p=>{p.preventDefault(),r(p);const d=m=>r(m),u=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",u)}),i.addEventListener("mousedown",p=>{p.preventDefault(),h(p);const d=m=>h(m),u=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",u)}),n.addEventListener("change",()=>this.syncInput()),s.addEventListener("input",()=>this.applyFromInput()),s.addEventListener("blur",()=>this.syncInput()),s.addEventListener("keydown",p=>{p.key==="Enter"&&(p.preventDefault(),this.syncInput(),s.blur())}),o.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(s.value)}catch{s.select(),document.execCommand("copy")}}),a.addEventListener("click",async()=>{var p;if(!("EyeDropper"in window)){alert("EyeDropper API is not supported in this browser.");return}try{const d=new window.EyeDropper,{sRGBHex:u}=await d.open();this.setColor(u),(p=this.onChange)==null||p.call(this,u,this.currentOpacity)}catch{}}),document.addEventListener("keydown",this.keyDown,!0),setTimeout(()=>document.addEventListener("click",this.outsideClick,!0),0)}setColor(t){var o;this.currentColor=t;const{h:e,s:i,v:s}=A(t),n=e>=360?e%360:e;this.hueMarker.style.left=`${n/360*100}%`,this.colorMarker.style.left=`${i*100}%`,this.colorMarker.style.top=`${(1-s)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${n}, 100%, 50%))`,this.syncInput(),this.updateOpacityBg(),(o=this.onChange)==null||o.call(this,t,this.currentOpacity)}syncInput(){const t=this.select.value,{h:e,s:i,v:s}=A(this.currentColor);if(t==="hex")this.input.value=this.currentColor;else if(t==="rgb"){const{r:n,g:o,b:a}=M(this.currentColor);this.input.value=`rgb(${n}, ${o}, ${a})`}else{const{hue:n,sat:o,lightness:a}=Qt(e,i,s);this.input.value=`hsl(${Math.round(n)}, ${Math.round(o*100)}%, ${Math.round(a*100)}%)`}}applyFromInput(){const t=this.input.value.trim();let e="";if(/^#[0-9A-Fa-f]{6}$/.test(t))e=t;else{const i=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(i){const s=parseInt(i[1]),n=parseInt(i[2]),o=parseInt(i[3]);s<=255&&n<=255&&o<=255&&(e=`#${[s,n,o].map(a=>a.toString(16).padStart(2,"0")).join("")}`)}else{const s=t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(s){const n=parseInt(s[1]),o=parseInt(s[2])/100,a=parseInt(s[3])/100,l=a+o*Math.min(a,1-a),r=l===0?0:2*(1-a/l);e=z(n,r,l)}}}e&&this.setColor(e)}updateOpacityBg(){const{r:t,g:e,b:i}=M(this.currentColor);this.opacitySlider.style.setProperty("--base-color",`rgb(${t}, ${e}, ${i})`)}open(t,e,i){var L;this.currentColor=t,this.currentOpacity=i??100,this.syncInput();const{h:s,s:n,v:o}=A(t);this.hueMarker.style.left=`${s/360*100}%`,this.colorMarker.style.left=`${n*100}%`,this.colorMarker.style.top=`${(1-o)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${s}, 100%, 50%))`,this.updateOpacityBg(),this.opacityMarker.style.left=`${this.currentOpacity}%`,(L=this.recentSectionRefresh)==null||L.call(this),this.isOpen=!0,this.backdrop.style.display="block",this.backdrop.parentElement||document.body.appendChild(this.backdrop),this.element.style.display="block",this.element.style.position="fixed",this.element.style.zIndex="10002",this.element.style.left="-9999px",this.element.style.top="0px",this.element.parentElement||document.body.appendChild(this.element);const a=this.element.offsetWidth,l=this.element.offsetHeight,r=e.getBoundingClientRect(),h=window.innerWidth,p=window.innerHeight,d=16;let u=r.right+8,m=r.top;const f=h-r.right,g=r.left;f>=a+d?u=r.right+8:g>=a+d?u=r.left-a-8:u=Math.max(d,(h-a)/2);const C=p-r.bottom,y=r.top;C>=l+d?m=r.bottom+8:y>=l+d?m=r.top-l-8:C>y?(m=r.bottom+8,m+l>p-d&&(m=p-l-d)):(m=r.top-l-8,m<d&&(m=d)),this.element.style.left=`${u}px`,this.element.style.top=`${m}px`}close(t){var e;this.isOpen&&(this.isOpen=!1,this.backdrop.style.display="none",this.element.style.display="none",document.removeEventListener("click",this.outsideClick,!0),document.removeEventListener("keydown",this.keyDown,!0),t&&this.onChange&&this.recentScope==="solid"&&(R.addColor(this.currentColor,this.recentScope),(e=this.recentSectionRefresh)==null||e.call(this)))}getElement(){return this.element}}class ce{constructor(t){this.recentScope="all",this.currentColor=t.initialColor,this.currentOpacity=t.initialOpacity,this.onColorChange=t.onColorChange,t.scope&&(this.recentScope=t.scope),this.container=this.createContainer(),this.initializePicker()}createContainer(){const t=document.createElement("div");t.className="embedded-color-picker-content",t.innerHTML=`
200
+ <div class="color-picker-area embedded">
201
+ <div class="color-picker-marker"></div>
202
+ </div>
203
+ <div class="color-picker-sliders-container embedded">
204
+ <button class="color-picker-eyedropper">
205
+ <svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
206
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M19.1972 3.29156C18.936 3.03034 18.6259 2.82313 18.2847 2.68176C17.9434 2.54039 17.5777 2.46763 17.2083 2.46763C16.8389 2.46763 16.4731 2.54039 16.1319 2.68176C15.7906 2.82313 15.4805 3.03034 15.2194 3.29156L13.7822 4.72875C13.2585 4.4772 12.6697 4.39449 12.097 4.49207C11.5243 4.58964 10.9961 4.86267 10.5853 5.27343L9.91687 5.94281C9.74268 6.11693 9.6045 6.32366 9.51023 6.5512C9.41595 6.77873 9.36743 7.02261 9.36743 7.2689C9.36743 7.5152 9.41595 7.75907 9.51023 7.98661C9.6045 8.21414 9.74268 8.42088 9.91687 8.595L3.83625 14.6747C3.57512 14.936 3.36803 15.2462 3.2268 15.5875C3.08556 15.9288 3.01296 16.2947 3.01312 16.6641V18.3516C3.01312 18.6499 3.13165 18.9361 3.34263 19.1471C3.55361 19.358 3.83975 19.4766 4.13812 19.4766H5.82562C6.57129 19.4759 7.28618 19.1792 7.81312 18.6516L13.8937 12.5728C14.0679 12.747 14.2746 12.8852 14.5021 12.9795C14.7297 13.0737 14.9735 13.1223 15.2198 13.1223C15.4661 13.1223 15.71 13.0737 15.9375 12.9795C16.1651 12.8852 16.3718 12.747 16.5459 12.5728L17.2153 11.9025C17.6261 11.4917 17.8991 10.9635 17.9967 10.3908C18.0942 9.81811 18.0115 9.22926 17.76 8.70562L19.1972 7.26937C19.4584 7.0082 19.6656 6.69813 19.807 6.35687C19.9484 6.01561 20.0211 5.64985 20.0211 5.28047C20.0211 4.91108 19.9484 4.54532 19.807 4.20406C19.6656 3.8628 19.4584 3.55273 19.1972 3.29156ZM5.16281 16.0012L11.2425 9.92062L12.5681 11.2462L6.48844 17.3269C6.31266 17.5027 6.07424 17.6015 5.82562 17.6016H4.88812V16.6641C4.88818 16.4154 4.98698 16.177 5.16281 16.0012Z" fill="#353C47"/>
207
+ </svg>
208
+ </button>
209
+ <div class="color-picker-sliders-group">
210
+ <div class="color-picker-hue embedded">
211
+ <div class="color-picker-hue-marker"></div>
212
+ </div>
213
+ <div class="color-picker-opacity embedded">
214
+ <div class="color-picker-opacity-marker"></div>
215
+ </div>
216
+ </div>
217
+ </div>
218
+ <div class="color-picker-format-section embedded">
219
+ <select class="color-picker-format-select">
220
+ <option value="hex">HEX</option>
221
+ <option value="rgb">RGB</option>
222
+ <option value="hsl">HSL</option>
223
+ </select>
224
+ <div class="color-picker-input-container">
225
+ <input type="text" class="color-picker-color-input" />
226
+ <button class="color-picker-copy-inside">Copy</button>
227
+ </div>
228
+ </div>
229
+ `;const e=nt(i=>{this.applyRecentColor(i)},this.recentScope);return this.recentSectionRefresh=e.refresh,t.appendChild(e.container),t}initializePicker(){this.colorArea=this.container.querySelector(".color-picker-area"),this.colorMarker=this.container.querySelector(".color-picker-marker"),this.hueSlider=this.container.querySelector(".color-picker-hue"),this.hueMarker=this.container.querySelector(".color-picker-hue-marker"),this.opacitySlider=this.container.querySelector(".color-picker-opacity"),this.opacityMarker=this.container.querySelector(".color-picker-opacity-marker"),this.formatSelect=this.container.querySelector(".color-picker-format-select"),this.colorInput=this.container.querySelector(".color-picker-color-input");const t=this.container.querySelector(".color-picker-copy-inside"),{h:e,s:i,v:s}=A(this.currentColor);this.hueMarker.style.left=`${e/360*100}%`,this.colorMarker.style.left=`${i*100}%`,this.colorMarker.style.top=`${(1-s)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${e}, 100%, 50%))`,this.opacityMarker.style.left=`${this.currentOpacity}%`,this.updateOpacityBackground(this.opacitySlider),this.updateColorInput(this.formatSelect,this.colorInput),this.setupColorAreaEvents(),this.setupHueSliderEvents(),this.setupOpacitySliderEvents(),this.setupFormatEvents(t)}scheduleInputUpdate(){this.inputUpdateTimeout&&clearTimeout(this.inputUpdateTimeout),this.inputUpdateTimeout=window.setTimeout(()=>{this.updateColorInput(this.formatSelect,this.colorInput)},16)}updateOpacityBackground(t){const e=M(this.currentColor);t.style.setProperty("--base-color",`rgb(${e.r}, ${e.g}, ${e.b})`)}updateColorInput(t,e){switch(t.value){case"hex":e.value=this.currentColor;break;case"rgb":const s=M(this.currentColor);e.value=`rgb(${s.r}, ${s.g}, ${s.b})`;break;case"hsl":const{h:n,s:o,v:a}=A(this.currentColor),l=a*(1-o/2),r=l===0||l===1?0:(a-l)/Math.min(l,1-l);e.value=`hsl(${Math.round(n)}, ${Math.round(r*100)}%, ${Math.round(l*100)}%)`;break}}applyRecentColor(t){this.currentColor=t,t.includes("gradient")||t.includes("radial")||(this.updatePickerVisualState(),this.updateColorInput(this.formatSelect,this.colorInput)),this.triggerChange()}commitRecentColor(){var t;R.addColor(this.currentColor,this.recentScope),(t=this.recentSectionRefresh)==null||t.call(this)}setupColorAreaEvents(){const t=e=>{const i=this.colorArea.getBoundingClientRect(),s=Math.max(0,Math.min(1,(e.clientX-i.left)/i.width)),n=Math.max(0,Math.min(1,(e.clientY-i.top)/i.height));this.colorMarker.style.left=`${s*100}%`,this.colorMarker.style.top=`${n*100}%`;const o=parseFloat(this.hueMarker.style.left||"0%"),a=Math.max(0,Math.min(360,o/100*360)),l=Math.max(0,Math.min(1,s)),r=Math.max(0,Math.min(1,1-n)),h=z(a,l,r);this.currentColor=h,this.updateOpacityBackground(this.opacitySlider),this.triggerChange()};this.colorArea.addEventListener("mousedown",e=>{e.preventDefault(),t(e);const i=n=>t(n),s=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s),this.updateColorInput(this.formatSelect,this.colorInput),this.updateOpacityBackground(this.opacitySlider)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",s)})}setupHueSliderEvents(){const t=e=>{const i=this.hueSlider.getBoundingClientRect();let s=(e.clientX-i.left)/i.width;s=Math.max(0,Math.min(1,s)),this.hueMarker.style.left=`${s*100}%`;const n=Math.max(0,Math.min(360,s*360)),o=parseFloat(this.colorMarker.style.left||"50%"),a=parseFloat(this.colorMarker.style.top||"50%"),l=Math.max(0,Math.min(1,(isNaN(o)?50:o)/100)),r=Math.max(0,Math.min(1,(isNaN(a)?50:a)/100));this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${n}, 100%, 50%))`;const h=z(n,l,1-r);this.currentColor=h,this.updateOpacityBackground(this.opacitySlider),this.triggerChange()};this.hueSlider.addEventListener("mousedown",e=>{e.preventDefault(),t(e);const i=n=>t(n),s=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s),this.inputUpdateTimeout&&clearTimeout(this.inputUpdateTimeout),this.updateColorInput(this.formatSelect,this.colorInput)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",s)})}setupOpacitySliderEvents(){const t=e=>{const i=this.opacitySlider.getBoundingClientRect(),s=Math.max(0,Math.min(1,(e.clientX-i.left)/i.width));this.opacityMarker.style.left=`${s*100}%`,this.currentOpacity=Math.round(s*100),this.triggerChange()};this.opacitySlider.addEventListener("mousedown",e=>{e.preventDefault(),t(e);const i=n=>t(n),s=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",s)})}setupFormatEvents(t){this.formatSelect.addEventListener("change",()=>{this.updateColorInput(this.formatSelect,this.colorInput)}),t.addEventListener("click",()=>{navigator.clipboard.writeText(this.colorInput.value).catch(()=>{this.colorInput.select(),document.execCommand("copy")})}),this.colorInput.addEventListener("input",()=>{this.handleManualColorInput(this.colorInput.value,this.formatSelect)}),this.colorInput.addEventListener("blur",()=>{this.updateColorInput(this.formatSelect,this.colorInput)})}handleManualColorInput(t,e){const i=t.trim();let s=null;switch(e.value){case"hex":s=this.parseHexInput(i);break;case"rgb":s=this.parseRgbInput(i);break;case"hsl":s=this.parseHslInput(i);break}s||(s=this.autoDetectColorFormat(i)),s&&(this.currentColor=s,this.updatePickerVisualState(),this.triggerChange())}parseHexInput(t){const e=t.startsWith("#")?t:`#${t}`;return D(e)}parseRgbInput(t){const e=t.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*[\d.]+)?\s*\)/);if(e){const i=parseInt(e[1]),s=parseInt(e[2]),n=parseInt(e[3]);if(i<=255&&s<=255&&n<=255)return F(i,s,n)}return null}parseHslInput(t){const e=t.match(/hsla?\s*\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*[\d.]+)?\s*\)/);if(e){const i=parseFloat(e[1]),s=parseFloat(e[2])/100,n=parseFloat(e[3])/100;if(i>=0&&i<=360&&s>=0&&s<=1&&n>=0&&n<=1){const o=K(i,s,n);return F(o.r,o.g,o.b)}}return null}autoDetectColorFormat(t){const e=this.parseHexInput(t);if(e)return e;const i=this.parseRgbInput(t);if(i)return i;const s=this.parseHslInput(t);return s||null}updatePickerVisualState(){const{h:t,s:e,v:i}=A(this.currentColor);this.hueMarker.style.left=`${t/360*100}%`,this.colorMarker.style.left=`${e*100}%`,this.colorMarker.style.top=`${(1-i)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${t}, 100%, 50%))`,this.updateOpacityBackground(this.opacitySlider)}triggerChange(){this.onColorChange(this.currentColor,this.currentOpacity)}getElement(){return this.container}updateColor(t,e){this.currentColor=t,this.currentOpacity=e;const{h:i,s,v:n}=A(t),o=i>=360?i%360:i;this.hueMarker.style.left=`${o/360*100}%`,this.colorMarker.style.left=`${s*100}%`,this.colorMarker.style.top=`${(1-n)*100}%`,this.colorArea.style.background=`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${o}, 100%, 50%))`,this.opacityMarker.style.left=`${e}%`,this.updateOpacityBackground(this.opacitySlider),this.updateColorInput(this.formatSelect,this.colorInput)}}const T=class T extends b{constructor(t={}){const e=typeof t.default=="string"?void 0:t.default;super({...t,title:t.title||"Color",default:e}),this.inputType={type:"text",angle:"number",stops:"text"},this.element=null,this.previewEl=null,this.inputEl=void 0,this.popoverEl=null,this.backdropEl=null,this.isPopoverOpen=!1,this.isEditing=!1,this.popoverPosition=null,this.previewUpdateTimeout=null,this.solidPicker=null,this.pendingSolidColor=null,this.onBackgroundClick=i=>{var d;if(!this.popoverEl||!this.isPopoverOpen)return;const s=i.target,n=this.popoverEl.contains(s),o=(d=this.element)==null?void 0:d.contains(s),a=document.querySelectorAll(".custom-color-picker"),l=Array.from(a).some(u=>u.contains(s)),r=s.closest(".gstop-color-input, .gradient-mini-preview, .gstop-color-preview"),h=s.classList.contains("color-picker-backdrop"),p=s.classList.contains("gradient-popover-backdrop");!n&&!o&&!l&&!r&&!h&&!p&&this.closePopover()},this.handlePopoverKeydown=i=>{if(this.isPopoverOpen){if(i.key==="Escape"){i.preventDefault(),this.closePopover();return}if(i.key==="Enter"){const s=i.target;if(s&&(s.tagName==="INPUT"||s.tagName==="TEXTAREA"))return;i.preventDefault(),this.closePopover()}}},this.detectChange=t.detectChange,this.originalDefault=t.default,this.value=this.defaultValue()}defaultValue(){const t=this.originalDefault;if(typeof t=="string"){const i=P(t);if(i)return B(i)}return B(t&&typeof t=="object"?t:{type:"linear",angle:90,stops:[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}]})}setValue(t){var i,s;let e=null;typeof t=="string"?e=P(t):t&&typeof t=="object"&&(e=B(t)),e||(e=this.defaultValue()),this.value=e,this.updateUI(),this.isPopoverOpen&&this.refreshPopoverContent(),(i=this.onChange)==null||i.call(this,this.value),(s=this.detectChange)==null||s.call(this,this.value),this.pendingSolidColor=null}updateUI(){if(this.previewEl&&this.value)if(this.value.type==="solid"){const t=this.value.stops[0],e=t.opacity??100;this.previewEl.style.background=mt(t.color,e)}else this.previewEl.style.background=V(this.value);this.inputEl&&this.value&&!this.isEditing&&(this.inputEl.value=J(this.value))}cssForTextValue(){return this.value?{background:V(this.value),"-webkit-background-clip":"text","background-clip":"text",color:"transparent","-webkit-text-fill-color":"transparent"}:{}}draw(){const t=document.createElement("div");if(t.className="gradient-setting-wrapper",this.props.title){const i=document.createElement("div");i.className="icon-container";const s=document.createElement("span");s.className="input-label",s.textContent=this.props.title,i.appendChild(s),t.appendChild(i)}const e=document.createElement("div");return e.className="gradient-input-wrapper",this.previewEl=document.createElement("div"),this.previewEl.className="gradient-mini-preview",this.previewEl.style.background=this.value?V(this.value):"linear-gradient(90deg, #a84b4b 0%, #786666 100%)",this.previewEl.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.openPopover()}),this.inputEl=document.createElement("input"),this.inputEl.type="text",this.inputEl.className="gradient-text-input",this.inputEl.placeholder="Enter gradient CSS or paste color...",this.inputEl.value=this.value?J(this.value):"",this.inputEl.readOnly=!1,this.inputEl.addEventListener("focus",()=>{if(this.isEditing=!0,this.value)if(this.value.type==="solid"){const i=this.value.stops[0];if(i){const s=i.color.toUpperCase(),n=i.opacity??100;if(n===100)this.inputEl.value=s;else{const a=Math.round(n/100*255).toString(16).toUpperCase().padStart(2,"0");this.inputEl.value=`${s}${a}`}}}else this.inputEl.value=V(this.value)}),this.inputEl.addEventListener("blur",()=>{this.isEditing=!1,this.value&&(this.inputEl.value=J(this.value))}),this.inputEl.addEventListener("paste",i=>this.handlePaste(i)),this.inputEl.addEventListener("input",i=>this.handleTextInput(i)),this.inputEl.addEventListener("keydown",i=>{i.key==="Enter"&&(this.handleTextInput(i),this.inputEl.blur()),i.key==="Escape"&&(this.value&&(this.inputEl.value=V(this.value)),this.inputEl.blur())}),e.appendChild(this.previewEl),e.appendChild(this.inputEl),t.appendChild(e),this.createPopover(),this.element=t,t}createPopover(){if(this.popoverEl)return;this.backdropEl=document.createElement("div"),this.backdropEl.className="gradient-popover-backdrop",this.backdropEl.style.display="none",this.backdropEl.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),this.closePopover()}),this.popoverEl=document.createElement("div"),this.popoverEl.className="gradient-popover",this.popoverEl.style.display="none",this.popoverEl.addEventListener("click",a=>{a.stopPropagation()});const t=document.createElement("div");t.className="gradient-popover-header",t.style.cursor="move";const e=document.createElement("span");e.textContent="Fill";const i=document.createElement("button");i.type="button",i.className="gradient-popover-close",i.innerHTML=Ct,i.addEventListener("click",()=>this.closePopover()),t.appendChild(e),t.appendChild(i),gt(t,this.popoverEl,(a,l)=>{this.popoverPosition={left:a,top:l}});const s=document.createElement("div");s.className="gradient-editor";const n=this.createTypeTabs();s.appendChild(n);const o=document.createElement("div");o.className="gradient-editor-content",this.updatePopoverContent(o),s.appendChild(o),this.popoverEl.appendChild(t),this.popoverEl.appendChild(s),document.body.appendChild(this.backdropEl),document.body.appendChild(this.popoverEl)}createTypeTabs(){var s,n;const t=document.createElement("div");t.className="gradient-type-tabs";const e=document.createElement("button");e.type="button",e.className=`gradient-type-tab ${((s=this.value)==null?void 0:s.type)==="solid"?"active":""}`,e.textContent="Solid",e.addEventListener("click",()=>this.switchType("solid"));const i=document.createElement("button");return i.type="button",i.className=`gradient-type-tab ${((n=this.value)==null?void 0:n.type)!=="solid"?"active":""}`,i.textContent="Gradient",i.addEventListener("click",()=>{var a,l;const o=((a=this.value)==null?void 0:a.type)==="solid"?"linear":((l=this.value)==null?void 0:l.type)||"linear";this.switchType(o)}),t.appendChild(e),t.appendChild(i),t}switchType(t){var i;if(!this.value)return;if(this.value.type=t,t!=="solid"&&(!this.value.stops||this.value.stops.length===0)&&(this.value.stops=[{color:"#a84b4b",position:0,opacity:100},{color:"#786666",position:100,opacity:100}]),t!=="solid"&&this.value.stops.length<2&&(this.value.angle=90),this.popoverEl){const s=this.popoverEl.querySelectorAll(".gradient-type-tab");s.forEach(a=>a.classList.remove("active"));const n=s[0],o=s[1];t==="solid"?n==null||n.classList.add("active"):o==null||o.classList.add("active")}const e=(i=this.popoverEl)==null?void 0:i.querySelector(".gradient-editor-content");e&&this.updatePopoverContent(e),this.updateUI(),this.triggerChange()}updatePopoverContent(t){t.innerHTML="",this.value&&(this.value.type==="solid"?this.renderSolid(t):this.renderGradient(t))}renderSolid(t){(!this.value||!this.value.stops||!this.value.stops.length)&&(this.value||(this.value=this.defaultValue()),this.value.stops=[{color:"#000000",position:0,opacity:100}]);const e=this.value.stops[0],i=new ce({initialColor:e.color,initialOpacity:e.opacity??100,onColorChange:(s,n)=>{if(this.value){const o=P(s);if(o&&o.type!=="solid"){this.value=o,this.switchType(o.type);return}this.value.stops[0].color=s,this.value.stops[0].opacity=n,this.updateUI(),this.triggerChange(),this.pendingSolidColor=s}}});this.solidPicker=i,t.appendChild(i.getElement())}renderGradient(t){this.solidPicker=null;const e=document.createElement("div");e.className="gradient-subtype-inline";const i=document.createElement("select");i.className="gradient-subtype-select";const s=document.createElement("option");s.value="linear",s.textContent="Linear";const n=document.createElement("option");n.value="radial",n.textContent="Radial",i.appendChild(s),i.appendChild(n),i.value=this.value.type==="radial"?"radial":"linear";const o=document.createElement("input");o.type="text",o.inputMode="numeric",o.className="gradient-degree-input",o.value=`${this.value.angle??90}°`,o.style.width="75px",o.style.textAlign="center",(!this.value.angle||this.value.stops.length<2)&&(this.value.angle=90,o.value="90°");const a=document.createElement("button");a.type="button",a.className="gradient-flip-btn",a.innerHTML=ae,i.addEventListener("change",()=>{this.switchType(i.value==="radial"?"radial":"linear"),this.updateDegreeVisibility(o)}),o.addEventListener("focus",f=>{const g=f.target;g.value=g.value.replace(/[^0-9-]/g,""),setTimeout(()=>g.select(),0)}),o.addEventListener("input",f=>{const g=parseInt(f.target.value);!Number.isNaN(g)&&this.value&&(this.value.angle=Math.max(0,Math.min(360,g)),this.debouncedPreviewUpdate())}),o.addEventListener("blur",f=>{var y;this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null);const g=f.target;let C=parseInt(g.value);Number.isNaN(C)&&(C=((y=this.value)==null?void 0:y.angle)??0),C=Math.max(0,Math.min(360,C)),this.value&&(this.value.angle=C),g.value=`${C}°`,this.updateGradientPreview(),this.updateUI(),this.triggerChange()}),a.addEventListener("click",()=>{!this.value||!this.value.stops||(this.value.stops.forEach(f=>{f.position=100-f.position}),this.value.stops.sort((f,g)=>f.position-g.position),this.updateGradientPreview(l),this.createHandles(r,l),this.updateStopsList(u),this.updateUI(),this.triggerChange())}),e.appendChild(i),e.appendChild(o),e.appendChild(a),t.appendChild(e),this.updateDegreeVisibility(o);const l=document.createElement("div");l.className="gradient-preview",this.updateGradientPreview(l);const r=document.createElement("div");r.className="gradient-handles",l.appendChild(r),t.appendChild(l),this.createHandles(r,l);const h=document.createElement("div");h.className="gradient-stops-header";const p=document.createElement("span");p.textContent="Stops";const d=document.createElement("button");d.type="button",d.className="gradient-add-stop",d.textContent="+",h.appendChild(p),h.appendChild(d);const u=document.createElement("div");u.className="gradient-stops",t.appendChild(h),t.appendChild(u),this.updateStopsList(u);const m=nt(f=>{const g=P(f);g&&(this.value=g,this.switchType(g.type),this.updateUI(),this.triggerChange())},"all");this.recentGradientRefresh=m.refresh,t.appendChild(m.container),d.addEventListener("click",()=>{var f;this.addStop(),this.updateStopsList(u),this.updateGradientPreview(l),this.createHandles(r,l),this.updateUI(),((f=document.activeElement)==null?void 0:f.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange()})}updateDegreeVisibility(t){var e;((e=this.value)==null?void 0:e.type)==="radial"?(t.disabled=!0,t.style.opacity="0.5"):(t.disabled=!1,t.style.opacity="1")}updateGradientPreview(t){var i;const e=t||((i=this.popoverEl)==null?void 0:i.querySelector(".gradient-preview"));e&&this.value&&(e.style.background=V(this.value))}debouncedPreviewUpdate(t){this.previewUpdateTimeout&&clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=window.setTimeout(()=>{this.updateGradientPreview(t),this.previewUpdateTimeout=null},16)}createHandles(t,e){t.innerHTML="",!(!this.value||this.value.type==="solid"||!this.value.stops)&&this.value.stops.forEach((i,s)=>{const n=document.createElement("div");n.className="gstop-handle",n.style.left=`${Math.max(0,Math.min(100,i.position))}%`,n.style.top="0%";const o=document.createElement("div");o.className="gstop-chip",o.style.backgroundColor=i.color,n.appendChild(o);let a=!1,l=0,r=0;const h=u=>{a=!0,l=u.clientX,r=this.value.stops[s].position,n.classList.add("selected"),document.addEventListener("mousemove",p),document.addEventListener("mouseup",d),u.preventDefault(),u.stopPropagation()},p=u=>{if(!a||!this.value)return;const m=e.getBoundingClientRect(),f=u.clientX-l;let g=r+f/m.width*100;g=Math.max(0,Math.min(100,g)),this.value.stops[s].position=Math.round(g),n.style.left=`${g}%`,this.updateGradientPreview()},d=()=>{a&&(a=!1,n.classList.remove("selected"),document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",d),this.value&&(this.value.stops.sort((u,m)=>u.position-m.position),this.createHandles(t,e),this.updateStopsList()),this.updateUI(),this.triggerChange())};n.addEventListener("mousedown",h),t.appendChild(n)})}updateStopsList(t){var i;const e=t||((i=this.popoverEl)==null?void 0:i.querySelector(".gradient-stops"));!e||!this.value||this.value.type==="solid"||!this.value.stops||(e.innerHTML="",this.value.stops.forEach((s,n)=>{var N,O;const o=document.createElement("div");o.className="gstop-row";const a=document.createElement("div");a.className="gstop-position-group";const l=document.createElement("input");l.type="text",l.className="gstop-position-input",l.value=`${s.position}%`,l.style.width="60px",a.appendChild(l);const r=document.createElement("div");r.className="gstop-color-container";const h=document.createElement("div");h.className="gstop-color-preview",h.style.backgroundColor=s.color;const p=document.createElement("input");p.type="text",p.className="gstop-color-input",p.value=s.color.replace("#","").toUpperCase();const d=document.createElement("button");d.type="button",d.className="gstop-color-copy",d.textContent="Copy",r.appendChild(h),r.appendChild(p),r.appendChild(d);const u=document.createElement("button");u.type="button",u.className="gstop-del",u.innerHTML=le,u.disabled=(((O=(N=this.value)==null?void 0:N.stops)==null?void 0:O.length)||0)<=2,o.appendChild(a),o.appendChild(r),o.appendChild(u),e.appendChild(o);const m=document.createElement("span");m.className="gstop-opacity-label",m.textContent="Opacity";const f=document.createElement("div");f.className="gstop-opacity-group";const g=document.createElement("input");g.type="range",g.className="gstop-opacity-slider",g.min="0",g.max="100",g.value=String(s.opacity??100);const C=M(s.color);g.style.setProperty("--slider-color",`rgb(${C.r}, ${C.g}, ${C.b})`);const y=document.createElement("span");y.className="gstop-opacity-value",y.textContent=`${s.opacity??100}%`,f.appendChild(g),f.appendChild(y);const L=new re((v,E)=>{p.value=v.replace("#","").toUpperCase(),h.style.backgroundColor=v,this.value.stops[n].color=v,E!==void 0&&(this.value.stops[n].opacity=E,g.value=String(E),y.textContent=`${E}%`);const x=M(v);g.style.setProperty("--slider-color",`rgb(${x.r}, ${x.g}, ${x.b})`),this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateUI(),this.triggerChange()},"solid");p.addEventListener("click",v=>{v.preventDefault(),v.stopPropagation(),L.open(s.color,p,s.opacity??100)}),p.addEventListener("input",()=>{const v=p.value.trim(),E=v.startsWith("#")?v:`#${v}`;if(/^#[0-9A-Fa-f]{6}$/.test(E)){this.value.stops[n].color=E,h.style.backgroundColor=E;const x=M(E);g.style.setProperty("--slider-color",`rgb(${x.r}, ${x.g}, ${x.b})`),this.debouncedPreviewUpdate()}}),p.addEventListener("blur",()=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),this.updateGradientPreview(),this.updateUI(),this.triggerChange()}),d.addEventListener("click",async v=>{v.stopPropagation();try{await navigator.clipboard.writeText(`#${p.value}`)}catch{}}),l.addEventListener("focus",v=>{const E=v.target;E.value=E.value.replace("%",""),E.select()}),l.addEventListener("input",v=>{const E=v.target,x=parseInt(E.value.replace(/[^\d]/g,""),10);if(!Number.isNaN(x)){const G=Math.max(0,Math.min(100,x));this.value.stops[n].position=G,E.value=`${G}%`,this.debouncedPreviewUpdate()}}),l.addEventListener("blur",v=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null);const E=v.target,x=parseInt(E.value.replace(/[^\d]/g,""),10);if(Number.isNaN(x))E.value=`${this.value.stops[n].position}%`;else{const G=Math.max(0,Math.min(100,x));this.value.stops[n].position=G,E.value=`${G}%`}this.updateGradientPreview(),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateStopsList(),this.updateUI(),this.triggerChange()}),u.addEventListener("click",()=>{var v;(this.value.stops.length||0)<=2||(this.value.stops.splice(n,1),this.createHandles(this.popoverEl.querySelector(".gradient-handles"),this.popoverEl.querySelector(".gradient-preview")),this.updateStopsList(),this.updateGradientPreview(),this.updateUI(),((v=document.activeElement)==null?void 0:v.tagName)!=="INPUT"&&this.repositionPopover(),this.triggerChange())}),g.addEventListener("input",()=>{const v=parseInt(g.value,10);this.value.stops[n].opacity=Math.max(0,Math.min(100,v)),y.textContent=`${this.value.stops[n].opacity}%`,this.debouncedPreviewUpdate()}),g.addEventListener("change",()=>{this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),this.updateGradientPreview(),this.updateUI(),this.triggerChange()})}))}addStop(){if(!this.value||this.value.type==="solid"||!this.value.stops)return;const t=this.value.stops.map(o=>o.position).sort((o,a)=>o-a);let e=50,i=0;for(let o=0;o<t.length-1;o++){const a=t[o+1]-t[o];a>i&&(i=a,e=t[o]+a/2)}const s=this.value.stops.reduce((o,a)=>Math.abs(a.position-e)<Math.abs(o.position-e)?a:o),n={position:Math.round(e),color:s.color,opacity:s.opacity??100};this.value.stops.push(n),this.value.stops.sort((o,a)=>o.position-a.position)}openPopover(){if(this.popoverEl&&(T.openInstance&&T.openInstance!==this&&T.openInstance.closePopover(),!this.isPopoverOpen)){if(this.isPopoverOpen=!0,T.openInstance=this,this.backdropEl&&(this.backdropEl.style.display="block",this.backdropEl.parentElement||document.body.appendChild(this.backdropEl)),this.popoverEl.style.display="flex",this.refreshPopoverContent(),this.element){const t=this.element.getBoundingClientRect(),e=306,i=window.innerWidth,s=window.innerHeight,n=16;this.popoverEl.style.position="fixed",this.popoverEl.style.zIndex="10000",this.popoverEl.style.left="-9999px",this.popoverEl.style.top="0px";const o=this.popoverEl.offsetHeight;let a=t.right+8,l=t.top;const r=i-t.right,h=t.left,p=e+n;r<p&&h>r+100&&(a=t.left-e-8);const d=s-t.bottom,u=t.top;u>=o+n?l=t.top-o-8:d>=o+n?l=t.bottom+8:u>d?(l=t.top-o-8,l<n&&(l=n)):(l=t.bottom+8,l+o>s-n&&(l=s-o-n)),this.popoverEl.style.left=`${a}px`,this.popoverEl.style.top=`${l}px`,this.popoverPosition={left:a,top:l}}setTimeout(()=>document.addEventListener("click",this.onBackgroundClick,!0),200),document.addEventListener("keydown",this.handlePopoverKeydown,!0)}}repositionPopover(){var t;if(!(!this.popoverEl||!this.isPopoverOpen||!this.element)&&((t=document.activeElement)==null?void 0:t.tagName)!=="INPUT"){if(this.popoverPosition){this.popoverEl.style.left=`${this.popoverPosition.left}px`,this.popoverEl.style.top=`${this.popoverPosition.top}px`;return}requestAnimationFrame(()=>{if(!this.popoverEl||!this.element)return;const e=this.element.getBoundingClientRect(),i=306,s=window.innerWidth,n=window.innerHeight,o=16;this.popoverEl.style.left,this.popoverEl.style.top,this.popoverEl.style.left="-9999px",this.popoverEl.style.top="0px";const a=this.popoverEl.offsetHeight;let l=e.right+8,r=e.top;const h=s-e.right,p=e.left,d=i+o;h<d&&p>h+100&&(l=e.left-i-8);const u=n-e.bottom,m=e.top;m>=a+o?r=e.top-a-8:u>=a+o?r=e.bottom+8:m>u?(r=e.top-a-8,r<o&&(r=o)):(r=e.bottom+8,r+a>n-o&&(r=n-a-o)),this.popoverEl.style.left=`${l}px`,this.popoverEl.style.top=`${r}px`})}}refreshPopoverContent(){var n,o;if(!this.popoverEl)return;const t=this.popoverEl.querySelectorAll(".gradient-type-tab");t.forEach(a=>a.classList.remove("active"));const e=t[0],i=t[1];((n=this.value)==null?void 0:n.type)==="solid"?e.classList.add("active"):(i.classList.add("active"),(o=this.recentGradientRefresh)==null||o.call(this)),this.popoverEl.offsetHeight;const s=this.popoverEl.querySelector(".gradient-editor-content");s&&this.updatePopoverContent(s)}closePopover(){var t;if(!(!this.popoverEl||!this.isPopoverOpen)){if(this.isPopoverOpen=!1,this.popoverPosition=null,this.backdropEl&&(this.backdropEl.style.display="none"),this.popoverEl.style.display="none",document.removeEventListener("click",this.onBackgroundClick,!0),document.removeEventListener("keydown",this.handlePopoverKeydown,!0),this.commitPendingSolidColor(),this.value&&this.value.type!=="solid"){const e=V(this.value);R.addColor(e,"gradient"),(t=this.recentGradientRefresh)==null||t.call(this)}this.previewUpdateTimeout&&(clearTimeout(this.previewUpdateTimeout),this.previewUpdateTimeout=null),T.openInstance===this&&(T.openInstance=null)}}commitPendingSolidColor(){this.pendingSolidColor&&(this.solidPicker?this.solidPicker.commitRecentColor():R.addColor(this.pendingSolidColor,"solid"),this.pendingSolidColor=null)}handlePaste(t){var i;t.preventDefault();const e=((i=t.clipboardData)==null?void 0:i.getData("text"))||"";this.parseAndSet(e)}handleTextInput(t){const e=t.target;this.parseAndSet(e.value)}parseAndSet(t){const e=P(t.trim());e&&this.setValue(e)}triggerChange(){var t,e;this.value&&((t=this.onChange)==null||t.call(this,this.value),(e=this.detectChange)==null||e.call(this,this.value))}getElement(){return this.element}getValue(){return this.value?V(this.value):""}getCSSValue(){return this.value?V(this.value):""}getCSSForText(){return this.value?this.cssForTextValue():{}}getRawValue(){return this.value}};T.openInstance=null;let j=T;const he=`
381
230
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
382
231
  <path d="M5.625 9.5H5.6325M12.375 9.5H12.3825M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 6.35L2.25 12.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.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.75L5.85 2.75C4.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.35Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
383
232
  </svg>
384
- `,Ve=`
233
+ `,pe=`
385
234
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
386
235
  <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"/>
387
236
  </svg>
388
- `;class Te extends H{constructor(t){super({title:"Border",collapsed:t==null?void 0:t.collapsed,settings:{size:new B({title:"Size",icon:Ve,default:(t==null?void 0:t.size)??0,suffix:"px"}),color:new U({title:"Border Color",default:(t==null?void 0:t.color)||"#000000"}),radius:new B({title:"Radius",icon:Ie,default:(t==null?void 0:t.radius)??12,suffix:"px"})}})}getValues(){const t=super.getValues(),e=this.settings.color.getValue();return{...t,color:e?`${e}`:t.color}}getCssCode(){const t=this.settings.color.getValue()??"#000000",e=this.settings.radius.value??0,i=this.settings.size.value??0;return`
237
+ `;class de extends I{constructor(t){super({title:"Border",collapsed:t==null?void 0:t.collapsed,settings:{size:new S({title:"Size",icon:pe,default:(t==null?void 0:t.size)??0,suffix:"px"}),color:new j({title:"Border Color",default:(t==null?void 0:t.color)||"#000000"}),radius:new S({title:"Radius",icon:he,default:(t==null?void 0:t.radius)??12,suffix:"px"})}})}getValues(){const t=super.getValues(),e=this.settings.color.getValue();return{...t,color:e?`${e} 1`:t.color}}getCssCode(){const t=this.settings.color.getValue()??"#000000",e=this.settings.radius.value??0,i=this.settings.size.value??0;return`
389
238
  border-image: ${t} 1;
390
239
  border-width: ${i}px;
391
240
  border-radius: ${e}px;
392
241
  border-style: solid;
393
- `}}const Pe=`
242
+ `}}const ue=`
394
243
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
395
244
  <path d="M1 2.75C1 2.05109 1 1.70163 1.11418 1.42597C1.26642 1.05843 1.55843 0.766422 1.92597 0.614181C2.20163 0.5 2.55109 0.5 3.25 0.5H10.75C11.4489 0.5 11.7984 0.5 12.074 0.614181C12.4416 0.766422 12.7336 1.05843 12.8858 1.42597C13 1.70163 13 2.05109 13 2.75M4.75 12.5H9.25M7 0.5V12.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
396
245
  </svg>
397
- `,Oe=`
246
+ `,ge=`
398
247
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
399
248
  <path d="M3 5.75C3 5.05109 3 4.70163 3.11418 4.42597C3.26642 4.05843 3.55843 3.76642 3.92597 3.61418C4.20163 3.5 4.55109 3.5 5.25 3.5H12.75C13.4489 3.5 13.7984 3.5 14.074 3.61418C14.4416 3.76642 14.7336 4.05843 14.8858 4.42597C15 4.70163 15 5.05109 15 5.75M6 15.5H12M7.6875 3.5V15.5M10.3125 3.5V15.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
400
249
  </svg>
401
- `,He=`
250
+ `,me=`
402
251
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
403
252
  <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"/>
404
253
  </svg>
405
- `;class Be extends H{constructor(t={}){const{showAlign:e=t.showAlign??!0,...i}=t;super({title:i.title||"Typography",collapsed:i.collapsed,settings:(()=>{const s={color:new U({title:"Color",default:i.colorDefault??"#001E1E"}),fontFamily:new Q({title:"Font",icon:Pe,default:i.fontFamilyDefault??"Satoshi",options:i.fontFamilyOptions??[{name:"Alt",value:"Croco Sans Black Caps Alt"},{name:"Regular",value:"Croco Sans Caps Regular"},{name:"Caps",value:"Croco Sans Black Caps"},{name:"FaraGo",value:"'FiraGO', sans-serif"}],getOptions:i.fontFamilyGetOptions,getOptionsAsync:i.fontFamilyGetOptionsAsync}),fontWeight:new Q({title:"Weight",icon:Oe,default:i.fontWeightDefault??"400",options:i.fontWeightOptions??[{name:"Regular",value:"400"},{name:"Medium",value:"500"},{name:"Bold",value:"600"}],getOptions:i.fontWeightGetOptions,getOptionsAsync:i.fontWeightGetOptionsAsync}),fontSize:new B({title:"Size",icon:He,default:i.fontSizeDefault??12,suffix:"px",mobile:i.fontSizeMobileDefault})};return e?{...s,align:new St({title:"Align",default:i.alignDefault??"center"})}:s})()})}getCssCode(){var o;const t=this.settings.color.getValue()??"#000000",e=this.settings.fontFamily.value??"Satoshi",i=this.settings.fontWeight.value??"bold",s=this.settings.fontSize.value??12,n=((o=this.settings.align)==null?void 0:o.value)??"left";return`
254
+ `;class fe extends I{constructor(t={}){const{showAlign:e=t.showAlign??!0,...i}=t;super({title:i.title||"Typography",collapsed:i.collapsed,settings:(()=>{const s={color:new j({title:"Color",default:i.colorDefault??"#001E1E"}),fontFamily:new Z({title:"Font",icon:ue,default:i.fontFamilyDefault??"Satoshi",options:i.fontFamilyOptions??[{name:"Alt",value:"Croco Sans Black Caps Alt"},{name:"Regular",value:"Croco Sans Caps Regular"},{name:"Caps",value:"Croco Sans Black Caps"},{name:"FiraGo",value:"'FiraGO', sans-serif"}],getOptions:i.fontFamilyGetOptions,getOptionsAsync:i.fontFamilyGetOptionsAsync}),fontWeight:new Z({title:"Weight",icon:ge,default:i.fontWeightDefault??"400",options:i.fontWeightOptions??[{name:"Regular",value:"400"},{name:"Medium",value:"500"},{name:"Bold",value:"600"}],getOptions:i.fontWeightGetOptions,getOptionsAsync:i.fontWeightGetOptionsAsync}),fontSize:new S({title:"Size",icon:me,default:i.fontSizeDefault??12,suffix:"px",mobile:i.fontSizeMobileDefault})};return e?{...s,align:new ut({title:"Align",default:i.alignDefault??"center"})}:s})()})}getCssCode(){var o;const t=this.settings.color.getValue()??"#000000",e=this.settings.fontFamily.value??"Satoshi",i=this.settings.fontWeight.value??"bold",s=this.settings.fontSize.value??12,n=((o=this.settings.align)==null?void 0:o.value)??"left";return`
406
255
  color: ${t};
407
256
  font-family: ${e};
408
257
  font-weight: ${i};
@@ -415,24 +264,24 @@
415
264
  font-weight: ${i};
416
265
  font-size: ${s}px;
417
266
  text-align: ${n};
418
- `}}class Z extends b{constructor(t){super({...t,default:t.default!==void 0?t.default:"auto"}),this.inputType="number",this.value=t.default!==void 0?t.default:"auto"}draw(){const t=this.value==="auto"?"text":"number",e=a=>{this.value!=="auto"&&(this.props.minValue!==void 0&&(a.min=String(this.props.minValue)),this.props.maxValue!==void 0&&(a.max=String(this.props.maxValue)),this.props.className&&a.classList.add(this.props.className),a.addEventListener("input",()=>{const l=this.props.minValue??Number.MIN_SAFE_INTEGER,r=this.props.maxValue??Number.MAX_SAFE_INTEGER;let c=Number(a.value);c<l&&(c=l),c>r&&(c=r),a.value=String(c)}))},i=this.createInput({value:this.value,inputType:t,title:this.props.title,icon:this.props.icon,inputClassName:"number-setting-input "+(this.props.inputClassName||""),wrapperClassName:"number-setting-wrapper "+(this.props.wrapperClassName||""),inputCustomizer:e,placeholder:this.value==="auto"?"auto":""});if(!this.props.suffix||this.props.suffix==="none")return i;i.classList.add("suffix-wrapper");const s=i.querySelector("input.number-setting-input");s&&(s.style.paddingRight="35px");const n=document.createElement("span");n.className="suffix-label",n.textContent=this.props.suffix,i.appendChild(n);const o=i.querySelector("input");return o&&(o.oninput=a=>{const l=a.target.value.trim();if(l.toLowerCase()==="auto")this.value="auto";else{const r=Number(l);isNaN(r)||(this.value=r)}this.onChange&&this.onChange(this.value)}),i}}class $e extends H{constructor(t){super({title:"Margins",collapsed:t==null?void 0:t.collapsed,settings:{marginTop:new Z({title:"Top",icon:Ae,suffix:"px",default:(t==null?void 0:t.marginTop)??"auto"}),marginRight:new Z({title:"Right",icon:De,suffix:"px",default:(t==null?void 0:t.marginRight)??0}),marginBottom:new Z({title:"Bottom",icon:Fe,suffix:"px",default:(t==null?void 0:t.marginBottom)??0}),marginLeft:new Z({title:"Left",icon:Ge,suffix:"px",default:(t==null?void 0:t.marginLeft)??0})}})}getCssCode(){const t=typeof this.settings.marginTop.value=="number"?`${this.settings.marginTop.value}px`:this.settings.marginTop.value,e=typeof this.settings.marginRight.value=="number"?`${this.settings.marginRight.value}px`:this.settings.marginRight.value,i=typeof this.settings.marginBottom.value=="number"?`${this.settings.marginBottom.value}px`:this.settings.marginBottom.value,s=typeof this.settings.marginLeft.value=="number"?`${this.settings.marginLeft.value}px`:this.settings.marginLeft.value;return`
267
+ `}}class q extends b{constructor(t){super({...t,default:t.default!==void 0?t.default:"auto"}),this.inputType="number",this.value=t.default!==void 0?t.default:"auto"}draw(){const t=this.value==="auto"?"text":"number",e=a=>{this.value!=="auto"&&(this.props.minValue!==void 0&&(a.min=String(this.props.minValue)),this.props.maxValue!==void 0&&(a.max=String(this.props.maxValue)),this.props.className&&a.classList.add(this.props.className),a.addEventListener("input",()=>{const l=this.props.minValue??Number.MIN_SAFE_INTEGER,r=this.props.maxValue??Number.MAX_SAFE_INTEGER;let h=Number(a.value);h<l&&(h=l),h>r&&(h=r),a.value=String(h)}))},i=this.createInput({value:this.value,inputType:t,title:this.props.title,icon:this.props.icon,inputClassName:"number-setting-input "+(this.props.inputClassName||""),wrapperClassName:"number-setting-wrapper "+(this.props.wrapperClassName||""),inputCustomizer:e,placeholder:this.value==="auto"?"auto":""});if(!this.props.suffix||this.props.suffix==="none")return i;i.classList.add("suffix-wrapper");const s=i.querySelector("input.number-setting-input");s&&(s.style.paddingRight="35px");const n=document.createElement("span");n.className="suffix-label",n.textContent=this.props.suffix,i.appendChild(n);const o=i.querySelector("input");return o&&(o.oninput=a=>{const l=a.target.value.trim();if(l.toLowerCase()==="auto")this.value="auto";else{const r=Number(l);isNaN(r)||(this.value=r)}this.onChange&&this.onChange(this.value)}),i}}class ve extends I{constructor(t){super({title:"Margins",collapsed:t==null?void 0:t.collapsed,settings:{marginTop:new q({title:"Top",icon:Ce,suffix:"px",default:(t==null?void 0:t.marginTop)??"auto"}),marginRight:new q({title:"Right",icon:ye,suffix:"px",default:(t==null?void 0:t.marginRight)??0}),marginBottom:new q({title:"Bottom",icon:Ee,suffix:"px",default:(t==null?void 0:t.marginBottom)??0}),marginLeft:new q({title:"Left",icon:be,suffix:"px",default:(t==null?void 0:t.marginLeft)??0})}})}getCssCode(){const t=typeof this.settings.marginTop.value=="number"?`${this.settings.marginTop.value}px`:this.settings.marginTop.value,e=typeof this.settings.marginRight.value=="number"?`${this.settings.marginRight.value}px`:this.settings.marginRight.value,i=typeof this.settings.marginBottom.value=="number"?`${this.settings.marginBottom.value}px`:this.settings.marginBottom.value,s=typeof this.settings.marginLeft.value=="number"?`${this.settings.marginLeft.value}px`:this.settings.marginLeft.value;return`
419
268
  margin-top: ${t};
420
269
  margin-right: ${e};
421
270
  margin-bottom: ${i};
422
271
  margin-left: ${s};
423
- `}}const Ae=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
272
+ `}}const Ce=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
424
273
  <path d="M2.25 16.25H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 16.25H5.6325M5.625 9.5H5.6325M12.375 16.25H12.3825M12.375 9.5H12.3825M9 16.25H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 16.25H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 2.75H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
425
- </svg>`,De=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
274
+ </svg>`,ye=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
426
275
  <path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 16.25H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M15.75 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
427
- </svg>`,Fe=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
276
+ </svg>`,Ee=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
428
277
  <path d="M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 2.75H5.6325M5.625 9.5H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
429
- </svg>`,Ge=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
278
+ </svg>`,be=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
430
279
  <path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 16.25H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
431
- </svg>`;class Re extends H{constructor(t){super({title:"Background Image",collapsed:t==null?void 0:t.collapsed,settings:{backgroundImage:new et({...t==null?void 0:t.uploadProps,default:(t==null?void 0:t.backgroundImage)??""}),opacity:new Mt({default:(t==null?void 0:t.opacity)??100}),backgroundColor:new G({default:(t==null?void 0:t.backgroundColor)??"0, 0, 30"})}})}draw(){const t=super.draw(),e=t.querySelector(".setting-group-content");if(!e)return t;const i=Array.from(e.children),[s,n,o]=i;e.innerHTML="",e.appendChild(s),e.appendChild(n);const a=document.createElement("div");return a.className="bgset-or-label",a.textContent="OR",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||"#000000";return t?`
280
+ </svg>`;class we extends I{constructor(t){super({title:"Background Image",collapsed:t==null?void 0:t.collapsed,settings:{backgroundImage:new st({...t==null?void 0:t.uploadProps,default:(t==null?void 0:t.backgroundImage)??""}),opacity:new dt({default:(t==null?void 0:t.opacity)??100}),backgroundColor:new $({default:(t==null?void 0:t.backgroundColor)??"0, 0, 30"})}})}draw(){const t=super.draw(),e=t.querySelector(".setting-group-content");if(!e)return t;const i=Array.from(e.children),[s,n,o]=i;e.innerHTML="",e.appendChild(s),e.appendChild(n);const a=document.createElement("div");return a.className="bgset-or-label",a.textContent="OR",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||"#000000";return t?`
432
281
  background-image: url("${t}");
433
282
  background-size: cover;
434
283
  background-position: center;
435
284
  opacity: ${e/100};
436
285
  `:`
437
286
  background-color: ${i};
438
- `}}class ze extends H{constructor(t){super({title:(t==null?void 0:t.title)??"Image",collapsed:t==null?void 0:t.collapsed,settings:{image:new et({...t==null?void 0:t.uploadProps,default:(t==null?void 0:t.image)??""}),width:new It({default:(t==null?void 0:t.width)??1e3,mobile:t==null?void 0:t.widthMobile}),height:new Nt({default:(t==null?void 0:t.height)??300,mobile:t==null?void 0:t.heightMobile})}})}}exports.AlignSetting=St;exports.AnimationSetting=Ne;exports.BackgroundSettingSet=Re;exports.BorderSettingSet=Te;exports.ButtonSetting=Qt;exports.ColorSetting=V;exports.ColorWithOpacitySetting=G;exports.DimensionSetting=te;exports.GapSetting=we;exports.GradientSetting=U;exports.HeaderTypographySettingSet=Be;exports.HeightSetting=Nt;exports.HtmlSetting=Xt;exports.ImageMapSetting=lt;exports.ImageSettingSet=ze;exports.MarginBottomSetting=Le;exports.MarginSettingGroup=$e;exports.MarginTopSetting=Me;exports.MultiLanguageSetting=Se;exports.NumberSetting=B;exports.OpacitySetting=Mt;exports.SelectApiSettings=ye;exports.SelectSetting=Q;exports.Setting=b;exports.SettingGroup=H;exports.StringSetting=kt;exports.TabSettingGroup=ht;exports.TabsSettingGroup=ht;exports.Toggle=Ee;exports.UploadSetting=et;exports.WidthSetting=It;exports.asSettingGroupWithSettings=Jt;exports.createSettingGroup=Lt;exports.createTabSettingGroup=qt;exports.isSetting=$;exports.isSettingChild=nt;exports.isSettingGroup=L;exports.iterateSettings=q;
287
+ `}}exports.AlignSetting=ut;exports.AnimationSetting=Yt;exports.BackgroundSettingSet=we;exports.BorderSettingSet=de;exports.ButtonSetting=Tt;exports.ColorSetting=k;exports.ColorWithOpacitySetting=$;exports.DimensionSetting=Pt;exports.GapSetting=qt;exports.GradientSetting=j;exports.HeaderTypographySettingSet=fe;exports.HeightSetting=Dt;exports.HtmlSetting=It;exports.MarginBottomSetting=Jt;exports.MarginSettingGroup=ve;exports.MarginTopSetting=Zt;exports.MultiLanguageSetting=Kt;exports.NumberSetting=S;exports.OpacitySetting=dt;exports.SelectApiSettings=zt;exports.SelectSetting=Z;exports.Setting=b;exports.SettingGroup=I;exports.StringSetting=pt;exports.TabSettingGroup=it;exports.TabsSettingGroup=it;exports.Toggle=Wt;exports.UploadSetting=st;exports.WidthSetting=Ft;exports.asSettingGroupWithSettings=kt;exports.createSettingGroup=ht;exports.createTabSettingGroup=Lt;exports.isSetting=H;exports.isSettingChild=et;exports.isSettingGroup=w;exports.iterateSettings=U;