builder-settings-types 0.0.284 → 0.0.286

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,35 +1,35 @@
1
- const vt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
2
- let ht = (c = 21) => {
1
+ const gt = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
2
+ let lt = (c = 21) => {
3
3
  let t = "", e = crypto.getRandomValues(new Uint8Array(c |= 0));
4
4
  for (; c--; )
5
- t += vt[e[c] & 63];
5
+ t += gt[e[c] & 63];
6
6
  return t;
7
7
  };
8
- function Ct(c) {
8
+ function mt(c) {
9
9
  let t = 0, e = c.parentElement;
10
10
  for (; e; )
11
11
  e.classList.contains("setting-group") && e !== c && t++, e = e.parentElement;
12
12
  return t;
13
13
  }
14
- function J(c, t) {
14
+ function q(c, t) {
15
15
  const e = Math.min(Math.max(t, 0), 5);
16
16
  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 = "");
17
17
  }
18
- function et(c, t = 0) {
18
+ function Q(c, t = 0) {
19
19
  c.querySelectorAll(":scope > .setting-group-content > .setting-group").forEach((i) => {
20
20
  const s = i, n = t + 1;
21
- J(s, n), et(s, n);
21
+ q(s, n), Q(s, n);
22
22
  });
23
23
  }
24
- const yt = {
24
+ const ft = {
25
25
  maxLevel: 5,
26
26
  spacingMultiplier: 1,
27
27
  visualIndentMultiplier: 2,
28
28
  enableAutoDetection: !0
29
29
  };
30
- class Et {
30
+ class vt {
31
31
  constructor(t = {}) {
32
- this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...yt, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
32
+ this.observedElements = /* @__PURE__ */ new Set(), this.config = { ...ft, ...t }, this.config.enableAutoDetection && this.setupAutoDetection();
33
33
  }
34
34
  /**
35
35
  * Setup automatic detection using MutationObserver
@@ -63,7 +63,7 @@ class Et {
63
63
  * Update nesting for a specific element
64
64
  */
65
65
  updateElementNesting(t) {
66
- const e = Ct(t);
66
+ const e = mt(t);
67
67
  this.applyNestingWithConfig(t, e);
68
68
  }
69
69
  /**
@@ -111,20 +111,20 @@ class Et {
111
111
  this.observer && (this.observer.disconnect(), this.observer = void 0), this.observedElements.clear();
112
112
  }
113
113
  }
114
- const ot = new Et();
115
- function X(c) {
114
+ const it = new vt();
115
+ function J(c) {
116
116
  if (c === null || typeof c != "object") return c;
117
117
  if (c instanceof Date) return new Date(c.getTime());
118
- if (c instanceof Array) return c.map((t) => X(t));
118
+ if (c instanceof Array) return c.map((t) => J(t));
119
119
  if (typeof c == "object") {
120
120
  const t = {};
121
121
  for (const e in c)
122
- Object.prototype.hasOwnProperty.call(c, e) && (t[e] = X(c[e]));
122
+ Object.prototype.hasOwnProperty.call(c, e) && (t[e] = J(c[e]));
123
123
  return t;
124
124
  }
125
125
  return c;
126
126
  }
127
- function bt(c) {
127
+ function Ct(c) {
128
128
  switch (c) {
129
129
  case "number":
130
130
  return 0;
@@ -142,15 +142,15 @@ function bt(c) {
142
142
  return "";
143
143
  }
144
144
  }
145
- class w {
145
+ class b {
146
146
  constructor(t = {}) {
147
- this.props = t, this.dataPropsPath = "", this.id = t.id || ht(), this.value = this.props.default, this.desktop = this.props.default, this.title = t.title || "", this.includeGetJson = t.includeGetJson !== void 0 ? t.includeGetJson : !0;
147
+ this.props = t, this.dataPropsPath = "", this.id = t.id || lt(), this.value = this.props.default, this.desktop = this.props.default, this.title = t.title || "", this.includeGetJson = t.includeGetJson !== void 0 ? t.includeGetJson : !0;
148
148
  }
149
149
  static SetUploadUrl(t) {
150
- globalThis.DefaultUploadUrl = t, w.DefaultUploadUrl = t;
150
+ globalThis.DefaultUploadUrl = t, b.DefaultUploadUrl = t;
151
151
  }
152
152
  static SetDefaultLanguage(t) {
153
- globalThis.DefaultLanguage = t, w.DefaultLanguage = t;
153
+ globalThis.DefaultLanguage = t, b.DefaultLanguage = t;
154
154
  }
155
155
  destroy() {
156
156
  throw new Error("Method not implemented.");
@@ -171,8 +171,8 @@ class w {
171
171
  this.value = t, this.inputEl && (this.inputEl.value = String(t)), this.onChange && this.onChange(t), this.props.detectChange && this.props.detectChange(t);
172
172
  }
173
173
  clone() {
174
- const t = this.constructor, e = X(this.props), i = new t(e);
175
- return i.value = X(this.value), i;
174
+ const t = this.constructor, e = J(this.props), i = new t(e);
175
+ return i.value = J(this.value), i;
176
176
  }
177
177
  createInput(t) {
178
178
  t = { ...this.props.inputProps, ...t };
@@ -192,7 +192,7 @@ class w {
192
192
  const i = document.createElement("div");
193
193
  i.className = t.wrapperClassName || "";
194
194
  const s = document.createElement("input");
195
- this.inputEl = s, s.value = String(t.value || bt(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "", this.dataPropsPath && s.setAttribute("data-test-id", this.dataPropsPath);
195
+ this.inputEl = s, s.value = String(t.value || Ct(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "", this.dataPropsPath && s.setAttribute("data-test-id", this.dataPropsPath);
196
196
  const n = (a) => {
197
197
  const l = a.target;
198
198
  let r = l.value;
@@ -234,30 +234,30 @@ class w {
234
234
  }
235
235
  }
236
236
  function D(c) {
237
- return c instanceof w;
237
+ return c instanceof b;
238
238
  }
239
- function L(c) {
240
- return c instanceof P;
239
+ function w(c) {
240
+ return c instanceof T;
241
241
  }
242
- function at(c) {
243
- return D(c) || L(c);
242
+ function st(c) {
243
+ return D(c) || w(c);
244
244
  }
245
- function j(c, t) {
245
+ function W(c, t) {
246
246
  for (const e in c)
247
247
  if (Object.prototype.hasOwnProperty.call(c, e)) {
248
248
  const i = c[e];
249
249
  t(e, i);
250
250
  }
251
251
  }
252
- const Y = class Y {
252
+ const K = class K {
253
253
  constructor(t) {
254
254
  this.elementRef = null, this.isHidden = !1, this.custom = !1, this.initialValues = {}, this.changeTimeout = null, this.isHandlingChange = !1, this.changeHandlers = /* @__PURE__ */ new Set(), this.blurTimeout = null, this.lastChangeTime = 0, this.handleBlur = () => {
255
- }, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.hide = !1, this.id = t.id || ht(), 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();
255
+ }, this.pendingBlurHandler = null, this.originalDefaultValues = {}, this.nestingLevel = 0, this.dataPropsPath = "", this.hide = !1, this.id = t.id || lt(), 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();
256
256
  }
257
257
  propagateNestingLevel() {
258
258
  const t = this.nestingLevel + 1;
259
- j(this.settings, (e, i) => {
260
- L(i) && (i.nestingLevel = t, i.propagateNestingLevel());
259
+ W(this.settings, (e, i) => {
260
+ w(i) && (i.nestingLevel = t, i.propagateNestingLevel());
261
261
  });
262
262
  }
263
263
  getNestingLevel() {
@@ -273,18 +273,18 @@ const Y = class Y {
273
273
  this.dataPropsPath = t, this.propagateDataPropsPath();
274
274
  }
275
275
  propagateDataPropsPath() {
276
- j(this.settings, (t, e) => {
276
+ W(this.settings, (t, e) => {
277
277
  const i = String(t), s = this.dataPropsPath ? `${this.dataPropsPath}_${i}` : i;
278
- (L(e) || D(e) && typeof e.setDataPropsPath == "function") && e.setDataPropsPath(s);
278
+ (w(e) || D(e) && typeof e.setDataPropsPath == "function") && e.setDataPropsPath(s);
279
279
  });
280
280
  }
281
281
  updateNestingStyles() {
282
- this.elementRef && (J(this.elementRef, this.nestingLevel), et(this.elementRef, this.nestingLevel));
282
+ this.elementRef && (q(this.elementRef, this.nestingLevel), Q(this.elementRef, this.nestingLevel));
283
283
  }
284
284
  forceChildUIRefresh() {
285
285
  Object.entries(this.settings).forEach(([t, e]) => {
286
286
  try {
287
- if (L(e)) {
287
+ if (w(e)) {
288
288
  const i = e.getValues();
289
289
  e.setValue(i);
290
290
  } else if (typeof e.setValue == "function") {
@@ -328,7 +328,7 @@ const Y = class Y {
328
328
  }
329
329
  clone() {
330
330
  const t = {};
331
- j(this.settings, (s, n) => {
331
+ W(this.settings, (s, n) => {
332
332
  const o = String(s);
333
333
  typeof n.clone == "function" ? t[o] = n.clone() : (console.warn(
334
334
  `Setting with key '${o}' does not have a clone method. Copying reference.`
@@ -345,7 +345,7 @@ const Y = class Y {
345
345
  deleteItem: this.deleteItemCfg,
346
346
  dataProps: this.dataProps,
347
347
  hide: this.hide
348
- }, i = xt(e);
348
+ }, i = Et(e);
349
349
  return i.initialValues = this.getValues(), i;
350
350
  }
351
351
  resetDefault() {
@@ -355,7 +355,7 @@ const Y = class Y {
355
355
  setMobileValues(t) {
356
356
  !t || typeof t != "object" || (Object.entries(t).forEach(([e, i]) => {
357
357
  const s = this.settings[e];
358
- s && (L(s) || D(s)) && typeof s.setMobileValue == "function" && s.setMobileValue(i);
358
+ s && (w(s) || D(s)) && typeof s.setMobileValue == "function" && s.setMobileValue(i);
359
359
  }), this.setValue(t), this.onChange && this.onChange(this.getValues()));
360
360
  }
361
361
  getMobileValues(t) {
@@ -364,7 +364,7 @@ const Y = class Y {
364
364
  for (const i in this.settings)
365
365
  if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
366
366
  const s = this.settings[i];
367
- if (L(s))
367
+ if (w(s))
368
368
  e[i] = s.getMobileValues();
369
369
  else {
370
370
  const n = s;
@@ -375,7 +375,7 @@ const Y = class Y {
375
375
  } else {
376
376
  const e = this.settings[t];
377
377
  if (!e) return;
378
- if (L(e)) return e.getMobileValues();
378
+ if (w(e)) return e.getMobileValues();
379
379
  const i = e;
380
380
  return i.mobileValue !== void 0 ? i.mobileValue : i.value;
381
381
  }
@@ -391,9 +391,9 @@ const Y = class Y {
391
391
  Object.keys(s).length > 0 && (this.lastChangeTime = Date.now(), this.initialValues = i, t(i), this.updateVisibility()), this.isHandlingChange = !1;
392
392
  }, 50));
393
393
  };
394
- return this.changeHandlers.clear(), j(this.settings, (i, s) => {
394
+ return this.changeHandlers.clear(), W(this.settings, (i, s) => {
395
395
  var n;
396
- if (L(s))
396
+ if (w(s))
397
397
  s.setOnChange(() => {
398
398
  const o = this.getValues();
399
399
  this.initialValues = o, t(o);
@@ -421,10 +421,10 @@ const Y = class Y {
421
421
  const o = i.slice(this.addItemCfg.keyPrefix.length), a = Number(o);
422
422
  if (Number.isFinite(a)) {
423
423
  const l = this.addItemCfg.createItem(a);
424
- at(l) && (this.addSetting(i, l), n = l);
424
+ st(l) && (this.addSetting(i, l), n = l);
425
425
  }
426
426
  }
427
- n && (L(n) || D(n)) && typeof n.setValue == "function" && n.setValue(s);
427
+ n && (w(n) || D(n)) && typeof n.setValue == "function" && n.setValue(s);
428
428
  }), setTimeout(() => {
429
429
  this.forceChildUIRefresh();
430
430
  }, 0);
@@ -438,7 +438,7 @@ const Y = class Y {
438
438
  const s = this.getValues();
439
439
  this.initialValues = s, (n = this.onChange) == null || n.call(this, s), this.updateVisibility();
440
440
  };
441
- L(t) ? t.setOnChange(() => e()) : D(t) ? t.setOnChange(() => e()) : (i = t.setOnChange) == null || i.call(t, () => e());
441
+ w(t) ? t.setOnChange(() => e()) : D(t) ? t.setOnChange(() => e()) : (i = t.setOnChange) == null || i.call(t, () => e());
442
442
  }
443
443
  addSetting(t, e) {
444
444
  var s, n;
@@ -447,14 +447,14 @@ const Y = class Y {
447
447
  ".setting-group-content"
448
448
  );
449
449
  if (o) {
450
- L(e) && typeof e.setNestingLevel == "function" && e.setNestingLevel(this.nestingLevel + 1);
450
+ w(e) && typeof e.setNestingLevel == "function" && e.setNestingLevel(this.nestingLevel + 1);
451
451
  const a = e.draw(), l = this.deleteItemCfg ?? this.addItemCfg;
452
452
  if (l) {
453
453
  const p = l.keyPrefix ?? ((s = this.addItemCfg) == null ? void 0 : s.keyPrefix);
454
454
  p && t.startsWith(p) && this.addDeleteButtonToElement(a, t);
455
455
  }
456
456
  const r = o.querySelector(".sg-add-button-bottom");
457
- r ? o.insertBefore(a, r) : o.appendChild(a), ot.trackElement(a), J(a, this.nestingLevel + 1), et(a, this.nestingLevel + 1);
457
+ r ? o.insertBefore(a, r) : o.appendChild(a), it.trackElement(a), q(a, this.nestingLevel + 1), Q(a, this.nestingLevel + 1);
458
458
  const h = a.style.display;
459
459
  a.style.display = "none", a.offsetHeight, a.style.display = h, this.updateNestingStyles();
460
460
  }
@@ -637,7 +637,7 @@ const Y = class Y {
637
637
  for (const i in this.settings)
638
638
  if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
639
639
  const s = this.settings[i];
640
- if (L(s))
640
+ if (w(s))
641
641
  e[i] = s.getValues();
642
642
  else {
643
643
  const n = s;
@@ -648,7 +648,7 @@ const Y = class Y {
648
648
  } else {
649
649
  const e = this.settings[t];
650
650
  if (!e) return;
651
- if (L(e)) return e.getValues();
651
+ if (w(e)) return e.getValues();
652
652
  const i = e;
653
653
  return i.getValue ? i.getValue() : i.value;
654
654
  }
@@ -661,7 +661,7 @@ const Y = class Y {
661
661
  for (const s in this.settings)
662
662
  if (Object.prototype.hasOwnProperty.call(this.settings, s)) {
663
663
  const n = this.settings[s];
664
- if (L(n)) {
664
+ if (w(n)) {
665
665
  const o = n.getValuesForJson();
666
666
  o !== null && (i[s] = o);
667
667
  } else {
@@ -673,7 +673,7 @@ const Y = class Y {
673
673
  } else {
674
674
  const i = this.settings[t];
675
675
  if (!i) return;
676
- if (L(i))
676
+ if (w(i))
677
677
  return i.includeGetJson === !1 ? null : i.getValuesForJson();
678
678
  {
679
679
  const s = i;
@@ -687,7 +687,7 @@ const Y = class Y {
687
687
  for (const i in this.settings)
688
688
  if (Object.prototype.hasOwnProperty.call(this.settings, i)) {
689
689
  const s = this.settings[i];
690
- if (L(s))
690
+ if (w(s))
691
691
  e[i] = s.getDefaultValues();
692
692
  else {
693
693
  const n = s;
@@ -698,14 +698,14 @@ const Y = class Y {
698
698
  } else {
699
699
  const e = this.settings[t];
700
700
  if (!e) return;
701
- if (L(e)) return e.getDefaultValues();
701
+ if (w(e)) return e.getDefaultValues();
702
702
  const i = e;
703
703
  return i.default !== void 0 ? i.default : i.value;
704
704
  }
705
705
  }
706
706
  draw() {
707
707
  const t = document.createElement("div");
708
- 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"), J(t, this.nestingLevel);
708
+ t.className = "setting-group", t.id = `setting-group-${this.id}`, K.hiddenElements.add(t), this.hide && (t.style.display = "none"), this.isMain && t.classList.add("main-group"), this.custom && t.classList.add("custom_class"), q(t, this.nestingLevel);
709
709
  const e = document.createElement("div");
710
710
  e.className = "setting-group-title", this.isCollapsed && e.classList.add("collapsed-view"), e.setAttribute("role", "button"), e.setAttribute(
711
711
  "aria-expanded",
@@ -737,9 +737,9 @@ const Y = class Y {
737
737
  for (const h in this.settings)
738
738
  if (Object.prototype.hasOwnProperty.call(this.settings, h)) {
739
739
  const p = this.settings[h];
740
- L(p) && typeof p.setNestingLevel == "function" && p.setNestingLevel(this.nestingLevel + 1);
740
+ w(p) && typeof p.setNestingLevel == "function" && p.setNestingLevel(this.nestingLevel + 1);
741
741
  const d = p.draw();
742
- L(p) && p.deleteItemCfg && this.addDeleteButtonToElement(
742
+ w(p) && p.deleteItemCfg && this.addDeleteButtonToElement(
743
743
  d,
744
744
  h,
745
745
  p
@@ -760,14 +760,14 @@ const Y = class Y {
760
760
  </svg>`;
761
761
  h.innerHTML = `${p}<span style="margin-left:4px;">${this.addItemCfg.buttonLabel ?? "Add"}</span>`, h.addEventListener("click", (d) => {
762
762
  d.stopPropagation(), d.preventDefault();
763
- const u = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), g = this.addItemCfg.createItem(u);
764
- if (at(g)) {
765
- const m = `${this.addItemCfg.keyPrefix}${u}`;
766
- this.addSetting(m, g);
763
+ const u = this.getNextIndexFromPrefix(this.addItemCfg.keyPrefix), m = this.addItemCfg.createItem(u);
764
+ if (st(m)) {
765
+ const f = `${this.addItemCfg.keyPrefix}${u}`;
766
+ this.addSetting(f, m);
767
767
  }
768
768
  }), a.appendChild(h);
769
769
  }
770
- return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(a), this.elementRef = t, ot.trackElement(t), setTimeout(() => {
770
+ return e.appendChild(i), e.appendChild(n), t.appendChild(e), t.appendChild(a), this.elementRef = t, it.trackElement(t), setTimeout(() => {
771
771
  this.updateNestingStyles();
772
772
  }, 0), this.pendingBlurHandler && (this.pendingBlurHandler = null), t;
773
773
  }
@@ -809,12 +809,12 @@ const Y = class Y {
809
809
  }
810
810
  }
811
811
  };
812
- Y.hiddenElements = /* @__PURE__ */ new Set();
813
- let P = Y;
814
- function le(c) {
815
- return new wt(c);
812
+ K.hiddenElements = /* @__PURE__ */ new Set();
813
+ let T = K;
814
+ function oe(c) {
815
+ return new yt(c);
816
816
  }
817
- class wt extends P {
817
+ class yt extends T {
818
818
  constructor(t) {
819
819
  super(t);
820
820
  const e = Object.keys(this.settings)[0];
@@ -855,7 +855,7 @@ class wt extends P {
855
855
  const h = document.createElement("div");
856
856
  h.className = "tab-panel", this.contentContainers[a] = h;
857
857
  const p = this.settings[a];
858
- p && (L(p) && typeof p.setNestingLevel == "function" && p.setNestingLevel(this.getNestingLevel() + 1), h.appendChild(
858
+ p && (w(p) && typeof p.setNestingLevel == "function" && p.setNestingLevel(this.getNestingLevel() + 1), h.appendChild(
859
859
  p.draw()
860
860
  )), o.appendChild(h), l === 0 && !this.activeTabId && (this.activeTabId = a);
861
861
  }), e.appendChild(i), e.appendChild(n), e.appendChild(o), !this.activeTabId) {
@@ -865,13 +865,13 @@ class wt extends P {
865
865
  return this.updateTabUI(), t;
866
866
  }
867
867
  }
868
- function xt(c) {
869
- return new P(c);
868
+ function Et(c) {
869
+ return new T(c);
870
870
  }
871
- function re(c) {
871
+ function ae(c) {
872
872
  return c;
873
873
  }
874
- class Lt extends w {
874
+ class bt extends b {
875
875
  constructor(t = {}) {
876
876
  super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
877
877
  }
@@ -891,12 +891,12 @@ class Lt extends w {
891
891
  });
892
892
  }
893
893
  }
894
- const kt = "<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>";
895
- class M extends Lt {
894
+ const wt = "<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>";
895
+ class M extends bt {
896
896
  constructor(t) {
897
897
  super({
898
898
  ...t,
899
- icon: t.icon || kt,
899
+ icon: t.icon || wt,
900
900
  title: t.title || "Color",
901
901
  default: t.default ? M.normalizeColorValue(t.default) : "#000000"
902
902
  }), this.inputType = "color", this.element = null, this.colorInputEl = null, this.textInputEl = null, this.detectChange = t.detectChange;
@@ -995,17 +995,17 @@ class M extends Lt {
995
995
  return this.isValidHex() ? this.hexToRgb(this.value) : "0, 0, 0";
996
996
  }
997
997
  }
998
- const Mt = `
998
+ const xt = `
999
999
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1000
1000
  <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"/>
1001
1001
  <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"/>
1002
1002
  <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"/>
1003
1003
  </svg>`;
1004
- class R extends w {
1004
+ class R extends b {
1005
1005
  constructor(t = {}) {
1006
1006
  super({
1007
1007
  ...t,
1008
- icon: t.icon || Mt,
1008
+ icon: t.icon || xt,
1009
1009
  title: t.title || "Color & Opacity",
1010
1010
  default: t.default || "#000000FF"
1011
1011
  }), 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 = R.normalizeHexWithOpacity(this.value));
@@ -1123,7 +1123,7 @@ class R extends w {
1123
1123
  };
1124
1124
  }
1125
1125
  }
1126
- class ce extends w {
1126
+ class le extends b {
1127
1127
  constructor(t = {}) {
1128
1128
  super(t), this.inputType = "text", t.onChange && this.setOnChange(t.onChange);
1129
1129
  }
@@ -1155,7 +1155,7 @@ class ce extends w {
1155
1155
  return e.addEventListener("input", i), e.addEventListener("change", i), e.addEventListener("blur", s), t.appendChild(e), t;
1156
1156
  }
1157
1157
  }
1158
- class I extends w {
1158
+ class S extends b {
1159
1159
  constructor(t) {
1160
1160
  super(t), this.inputType = "number", this.inputElement = null, this.mobileValue = t.mobile, this.validateProps(), this.value = this.validateValue(this.value);
1161
1161
  }
@@ -1214,12 +1214,12 @@ class I extends w {
1214
1214
  );
1215
1215
  }
1216
1216
  }
1217
- const St = `
1217
+ const Lt = `
1218
1218
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1219
1219
  <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"/>
1220
1220
  <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"/>
1221
1221
  </svg>`;
1222
- class It extends I {
1222
+ class kt extends S {
1223
1223
  constructor(t = {}) {
1224
1224
  const e = {
1225
1225
  title: "Opacity",
@@ -1228,7 +1228,7 @@ class It extends I {
1228
1228
  maxValue: 100,
1229
1229
  step: 1,
1230
1230
  default: t.default ?? 100,
1231
- icon: St,
1231
+ icon: Lt,
1232
1232
  ...t
1233
1233
  };
1234
1234
  super(e), this.inputType = "number", this.mobileValue = t.mobile;
@@ -1240,12 +1240,12 @@ class It extends I {
1240
1240
  this.mobileValue = t, t !== void 0 && this.setValue(t);
1241
1241
  }
1242
1242
  }
1243
- const Nt = `
1243
+ const Mt = `
1244
1244
  <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">
1245
1245
  <polyline points="6 9 12 15 18 9"></polyline>
1246
1246
  </svg>
1247
1247
  `;
1248
- class it extends w {
1248
+ class tt extends b {
1249
1249
  constructor(t = {}) {
1250
1250
  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) {
1251
1251
  const e = this._options.findIndex((i) => i.value === this.value);
@@ -1289,7 +1289,7 @@ class it extends w {
1289
1289
  a.onclick = (l) => this.selectOption(l, o, e), i.appendChild(a);
1290
1290
  }), document.body.appendChild(i);
1291
1291
  const s = document.createElement("div");
1292
- return s.classList.add("svg-container"), s.innerHTML = Nt, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
1292
+ return s.classList.add("svg-container"), s.innerHTML = Mt, t.appendChild(s), this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
1293
1293
  this._options.push(...n), this.isLoading = !1, this.updateOptionsList(), this.updateButtonText();
1294
1294
  }).catch((n) => {
1295
1295
  console.error("Failed to fetch async options:", n), this.isLoading = !1, this.updateButtonText("Failed to load options");
@@ -1352,7 +1352,7 @@ class it extends w {
1352
1352
  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();
1353
1353
  }
1354
1354
  }
1355
- class Vt extends w {
1355
+ class St extends b {
1356
1356
  constructor(t = {}) {
1357
1357
  super(t), this.inputType = "button", this.value || (this.value = "center");
1358
1358
  }
@@ -1408,7 +1408,7 @@ class Vt extends w {
1408
1408
  }), t.appendChild(i), t;
1409
1409
  }
1410
1410
  }
1411
- class he extends w {
1411
+ class re extends b {
1412
1412
  constructor(t) {
1413
1413
  super(t), this.inputType = "button", this.bgWithAlpha = "rgba(145, 158, 171, 0.08)";
1414
1414
  }
@@ -1437,27 +1437,27 @@ class he extends w {
1437
1437
  return o.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), o.appendChild(t), o;
1438
1438
  }
1439
1439
  }
1440
- class pe extends w {
1440
+ class ce extends b {
1441
1441
  constructor(t = {}) {
1442
1442
  super(t), this.inputType = { width: "number", height: "number" }, this.aspectRatio = 1, this.isUpdating = !1;
1443
1443
  const e = t.width || 0, i = t.height || 0;
1444
1444
  this.value || (this.value = {
1445
1445
  width: e,
1446
1446
  height: i
1447
- }), 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 I({
1447
+ }), 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({
1448
1448
  title: "Width",
1449
1449
  default: this.value.width,
1450
1450
  suffix: "px",
1451
1451
  minValue: this.minWidth,
1452
1452
  maxValue: this.maxWidth,
1453
- icon: Pt
1454
- }), this.heightSetting = new I({
1453
+ icon: It
1454
+ }), this.heightSetting = new S({
1455
1455
  title: "Height",
1456
1456
  default: this.value.height,
1457
1457
  suffix: "px",
1458
1458
  minValue: this.minHeight,
1459
1459
  maxValue: this.maxHeight,
1460
- icon: Tt
1460
+ icon: Nt
1461
1461
  }), this.widthSetting.setOnChange(this.handleWidthChange.bind(this)), this.heightSetting.setOnChange(this.handleHeightChange.bind(this));
1462
1462
  }
1463
1463
  handleWidthChange(t) {
@@ -1551,24 +1551,24 @@ class pe extends w {
1551
1551
  }
1552
1552
  }
1553
1553
  }
1554
- const Pt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1554
+ const It = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1555
1555
  <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"/>
1556
- </svg>`, Tt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1556
+ </svg>`, Nt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1557
1557
  <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"/>
1558
- </svg>`, Q = `
1558
+ </svg>`, Y = `
1559
1559
  <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
1560
1560
  <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"/>
1561
1561
  </svg>
1562
- `, Ot = `
1562
+ `, Vt = `
1563
1563
  <svg width="91" height="71" viewBox="0 0 91 71" fill="none" xmlns="http://www.w3.org/2000/svg">
1564
1564
  <rect width="91" height="71" rx="4" fill="#F2F4F7"/>
1565
1565
  <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"/>
1566
1566
  </svg>
1567
- `, Ht = `
1567
+ `, Tt = `
1568
1568
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 12 12" fill="none">
1569
1569
  <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"/>
1570
1570
  </svg>
1571
- `, $t = `
1571
+ `, Pt = `
1572
1572
  <svg xmlns="http://www.w3.org/2000/svg" width="29" height="29" viewBox="0 0 29 29" fill="none">
1573
1573
  <!-- Top dot -->
1574
1574
  <circle cx="14.5" cy="3" r="1.5" fill="#02CC59" opacity="1"/>
@@ -1588,7 +1588,7 @@ const Pt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewB
1588
1588
  <circle cx="6.7" cy="6.7" r="1.5" fill="#02CC59" opacity="0.3"/>
1589
1589
  </svg>
1590
1590
  `;
1591
- class pt extends w {
1591
+ class rt extends b {
1592
1592
  constructor(t = {}) {
1593
1593
  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();
1594
1594
  }
@@ -1641,7 +1641,7 @@ class pt extends w {
1641
1641
  );
1642
1642
  if (t && t !== "") {
1643
1643
  this.showLoading(), s && s instanceof HTMLElement && (s.style.display = "none"), e && e.classList.remove("no-image"), i && (i.innerHTML = `
1644
- <span class="upload-icon">${Q}</span>
1644
+ <span class="upload-icon">${Y}</span>
1645
1645
  <span class="upload-label">Replace</span>
1646
1646
  `);
1647
1647
  const n = () => {
@@ -1652,7 +1652,7 @@ class pt extends w {
1652
1652
  this.previewEl.addEventListener("load", n), this.previewEl.addEventListener("error", o), this.previewEl.src = t;
1653
1653
  } else
1654
1654
  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 = `
1655
- <span class="upload-icon">${Q}</span>
1655
+ <span class="upload-icon">${Y}</span>
1656
1656
  <span class="upload-label">Upload</span>
1657
1657
  `);
1658
1658
  }
@@ -1685,9 +1685,9 @@ class pt extends w {
1685
1685
  const s = this.value && this.value !== "";
1686
1686
  s || i.classList.add("no-image");
1687
1687
  const n = document.createElement("div");
1688
- if (n.className = "preview-placeholder", n.innerHTML = Ot, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML = $t, this.loadingSpinner.style.display = "none", this.previewWrapper.appendChild(this.loadingSpinner), this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
1688
+ if (n.className = "preview-placeholder", n.innerHTML = Vt, this.previewWrapper = document.createElement("div"), this.previewWrapper.className = "preview-wrapper", this.loadingSpinner = document.createElement("div"), this.loadingSpinner.className = "loading-spinner", this.loadingSpinner.innerHTML = Pt, this.loadingSpinner.style.display = "none", this.previewWrapper.appendChild(this.loadingSpinner), this.previewEl = document.createElement("img"), this.previewEl.className = "upload-preview", this.props.delete) {
1689
1689
  const a = document.createElement("button");
1690
- a.className = "delete-button", a.type = "button", a.title = "Delete image", a.innerHTML = Ht, this.previewWrapper.appendChild(a), a.onclick = (l) => {
1690
+ a.className = "delete-button", a.type = "button", a.title = "Delete image", a.innerHTML = Tt, this.previewWrapper.appendChild(a), a.onclick = (l) => {
1691
1691
  var r;
1692
1692
  l.stopPropagation(), this.value = "", this.updatePreviewState(null), (r = this.onChange) == null || r.call(this, ""), this.hideError();
1693
1693
  };
@@ -1695,7 +1695,7 @@ class pt extends w {
1695
1695
  this.previewWrapper.appendChild(this.previewEl);
1696
1696
  const o = document.createElement("button");
1697
1697
  return o.className = "upload-button", this.getDataPropsPath() && o.setAttribute("data-test-id", this.getDataPropsPath()), o.innerHTML = `
1698
- <span class="upload-icon">${Q}</span>
1698
+ <span class="upload-icon">${Y}</span>
1699
1699
  <span class="upload-label">Upload</span>
1700
1700
  `, i.appendChild(n), i.appendChild(this.previewWrapper), i.appendChild(o), t.appendChild(i), s ? this.updatePreviewState(this.value) : this.updatePreviewState(null), o.onclick = () => {
1701
1701
  window.postMessage(
@@ -1708,14 +1708,14 @@ class pt extends w {
1708
1708
  }, t;
1709
1709
  }
1710
1710
  }
1711
- class de extends I {
1711
+ class he extends S {
1712
1712
  constructor(t = {}) {
1713
1713
  super({
1714
1714
  ...t,
1715
1715
  title: t.title || "Height",
1716
1716
  suffix: t.suffix || "px",
1717
1717
  minValue: t.minValue ?? 0,
1718
- icon: t.icon || At,
1718
+ icon: t.icon || Ot,
1719
1719
  default: t.default ?? 100
1720
1720
  }), this.inputType = "number", this.mobileValue = t.mobile;
1721
1721
  }
@@ -1726,17 +1726,17 @@ class de extends I {
1726
1726
  this.mobileValue = t, t !== void 0 && this.setValue(t);
1727
1727
  }
1728
1728
  }
1729
- const At = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1729
+ const Ot = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1730
1730
  <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"/>
1731
1731
  </svg>`;
1732
- class ue extends I {
1732
+ class pe extends S {
1733
1733
  constructor(t = {}) {
1734
1734
  super({
1735
1735
  ...t,
1736
1736
  title: t.title || "Width",
1737
1737
  suffix: t.suffix || "px",
1738
1738
  minValue: t.minValue ?? 0,
1739
- icon: t.icon || Bt,
1739
+ icon: t.icon || Ht,
1740
1740
  default: t.default ?? 100
1741
1741
  }), this.inputType = "number", this.mobileValue = t.mobile;
1742
1742
  }
@@ -1747,14 +1747,14 @@ class ue extends I {
1747
1747
  this.mobileValue = t, t !== void 0 && this.setValue(t);
1748
1748
  }
1749
1749
  }
1750
- const Bt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1750
+ const Ht = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
1751
1751
  <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"/>
1752
- </svg>`, Dt = `
1752
+ </svg>`, $t = `
1753
1753
  <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">
1754
1754
  <polyline points="6 9 12 15 18 9"></polyline>
1755
1755
  </svg>
1756
1756
  `;
1757
- class ge extends w {
1757
+ class de extends b {
1758
1758
  constructor(t = {}) {
1759
1759
  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) {
1760
1760
  const e = this._options.findIndex(
@@ -1809,7 +1809,7 @@ class ge extends w {
1809
1809
  a.onclick = (l) => this.selectApiOption(l, o, e), i.appendChild(a);
1810
1810
  }), t.appendChild(i);
1811
1811
  const s = document.createElement("div");
1812
- return s.classList.add("svg-container"), s.innerHTML = Dt, t.appendChild(s), s.onclick = () => {
1812
+ return s.classList.add("svg-container"), s.innerHTML = $t, t.appendChild(s), s.onclick = () => {
1813
1813
  var n, o;
1814
1814
  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));
1815
1815
  }, this.optionsListEl = i, this.svgContainer = s, this.props.getOptionsAsync && !this.hasInitializedOptions ? (this.isLoading = !0, this.updateButtonText(), this.props.getOptionsAsync().then((n) => {
@@ -1901,7 +1901,7 @@ class ge extends w {
1901
1901
  ), this.updateButtonText();
1902
1902
  }
1903
1903
  }
1904
- class me extends w {
1904
+ class ue extends b {
1905
1905
  constructor(t) {
1906
1906
  var e, i;
1907
1907
  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;
@@ -1951,13 +1951,13 @@ class me extends w {
1951
1951
  this.detectChangeCallback = t;
1952
1952
  }
1953
1953
  }
1954
- const Rt = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1954
+ const At = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1955
1955
  <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"/>
1956
1956
  </svg>`;
1957
- class fe extends w {
1957
+ class ge extends b {
1958
1958
  // Store mobile value
1959
1959
  constructor(t = {}) {
1960
- t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? Rt, 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);
1960
+ t.rowGap = t.rowGap ?? !0, t.columnGap = t.columnGap ?? !0, t.title = t.title ?? "Gap", t.icon = t.icon ?? At, 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);
1961
1961
  }
1962
1962
  draw() {
1963
1963
  const t = document.createElement("div");
@@ -2008,42 +2008,42 @@ class fe extends w {
2008
2008
  this.mobileValue = t, t !== void 0 && this.setValue(t);
2009
2009
  }
2010
2010
  }
2011
- const Ft = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2011
+ const Bt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2012
2012
  <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"/>
2013
2013
  </svg>`;
2014
- class ve extends I {
2014
+ class me extends S {
2015
2015
  constructor(t = {}) {
2016
2016
  super({
2017
2017
  ...t,
2018
2018
  minValue: t.minValue ?? 0,
2019
2019
  maxValue: t.maxValue ?? 1e3,
2020
- icon: t.icon || Ft,
2020
+ icon: t.icon || Bt,
2021
2021
  title: t.title || "Margin Bottom",
2022
2022
  default: t.default ?? 20,
2023
2023
  wrapperClassName: "margin-bottom-wrapper " + (t.wrapperClassName || "")
2024
2024
  }), this.inputType = "number";
2025
2025
  }
2026
2026
  }
2027
- const Ut = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2027
+ const Dt = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
2028
2028
  <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"
2029
2029
  stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
2030
2030
  </svg>`;
2031
- class Ce extends I {
2031
+ class fe extends S {
2032
2032
  constructor(t = {}) {
2033
2033
  super({
2034
2034
  ...t,
2035
2035
  minValue: t.minValue ?? 0,
2036
2036
  maxValue: t.maxValue ?? 1e3,
2037
- icon: t.icon || Ut,
2037
+ icon: t.icon || Dt,
2038
2038
  title: t.title || "Margin Top",
2039
2039
  default: t.default ?? 20,
2040
2040
  wrapperClassName: "margin-top-wrapper " + (t.wrapperClassName || "")
2041
2041
  }), this.inputType = "number";
2042
2042
  }
2043
2043
  }
2044
- class ye extends w {
2044
+ class ve extends b {
2045
2045
  constructor(t) {
2046
- super(t), this.inputType = {}, this.container = null, this.defaultLanguage = "", this.uploadSettings = /* @__PURE__ */ new Map(), t.default ? this.value = { ...t.default } : this.value || (this.value = {}), this.defaultLanguage = t.languages.includes(w.DefaultLanguage) ? w.DefaultLanguage : t.languages[0];
2046
+ super(t), this.inputType = {}, this.container = null, this.defaultLanguage = "", this.uploadSettings = /* @__PURE__ */ new Map(), t.default ? this.value = { ...t.default } : this.value || (this.value = {}), this.defaultLanguage = t.languages.includes(b.DefaultLanguage) ? b.DefaultLanguage : t.languages[0];
2047
2047
  const e = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
2048
2048
  t.languages.forEach((i) => {
2049
2049
  var s, n;
@@ -2076,11 +2076,11 @@ class ye extends w {
2076
2076
  const h = "...";
2077
2077
  let p = 0, d = e.length, u = 0;
2078
2078
  for (; p <= d; ) {
2079
- const m = Math.floor((p + d) / 2), f = e.slice(0, m).trimEnd() + h;
2080
- this.measureTextWidth(f, i) <= l ? (u = m, p = m + 1) : d = m - 1;
2079
+ const f = Math.floor((p + d) / 2), g = e.slice(0, f).trimEnd() + h;
2080
+ this.measureTextWidth(g, i) <= l ? (u = f, p = f + 1) : d = f - 1;
2081
2081
  }
2082
- const g = e.slice(0, u).trimEnd() + h;
2083
- t.placeholder = g;
2082
+ const m = e.slice(0, u).trimEnd() + h;
2083
+ t.placeholder = m;
2084
2084
  }
2085
2085
  autosizeTextarea(t, e = 3) {
2086
2086
  t.style.height = "auto";
@@ -2092,7 +2092,7 @@ class ye extends w {
2092
2092
  i.classList.add("simple-multi-language-row");
2093
2093
  const s = document.createElement("label");
2094
2094
  if (s.classList.add("simple-language-label"), s.textContent = t.toUpperCase(), s.setAttribute("for", `textarea-${t}`), i.appendChild(s), this.props.multiImg) {
2095
- const n = new pt({
2095
+ const n = new rt({
2096
2096
  defaultUrl: e || "",
2097
2097
  title: "",
2098
2098
  id: `${this.id}_upload_${t}`
@@ -2188,7 +2188,7 @@ class ye extends w {
2188
2188
  });
2189
2189
  }
2190
2190
  }
2191
- class Ee extends w {
2191
+ class Ce extends b {
2192
2192
  constructor(t = {}) {
2193
2193
  super(t), this.inputType = "select";
2194
2194
  const e = [
@@ -2199,7 +2199,7 @@ class Ee extends w {
2199
2199
  { name: "Bounce", value: "bounce 1.5s ease-in-out infinite" },
2200
2200
  { name: "Pulse", value: "pulse 1.5s ease-in-out infinite" }
2201
2201
  ];
2202
- this.selectSetting = new it({
2202
+ this.selectSetting = new tt({
2203
2203
  title: this.title || "Animation",
2204
2204
  options: e,
2205
2205
  default: this.props.default || "none"
@@ -2215,27 +2215,27 @@ class Ee extends w {
2215
2215
  this.selectSetting.destroy(), super.destroy();
2216
2216
  }
2217
2217
  }
2218
- const dt = (c, t) => {
2219
- let e = !1, i = 0, s = 0, n = 0, o = 0;
2220
- const a = (h) => {
2221
- if (h.target.closest("button")) return;
2222
- e = !0, i = h.clientX, s = h.clientY;
2223
- const p = t.getBoundingClientRect();
2224
- n = p.left, o = p.top, document.addEventListener("mousemove", l), document.addEventListener("mouseup", r), document.body.style.userSelect = "none";
2225
- }, l = (h) => {
2226
- if (!e) return;
2227
- const p = h.clientX - i, d = h.clientY - s, u = window.innerWidth, g = window.innerHeight, m = t.offsetWidth, f = t.offsetHeight;
2228
- let C = n + p, y = o + d;
2229
- C = Math.max(8, Math.min(u - m - 8, C)), y = Math.max(8, Math.min(g - f - 8, y)), t.style.left = `${C}px`, t.style.top = `${y}px`;
2230
- }, r = () => {
2231
- e = !1, document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", r), document.body.style.userSelect = "";
2218
+ const ct = (c, t, e) => {
2219
+ let i = !1, s = 0, n = 0, o = 0, a = 0;
2220
+ const l = (p) => {
2221
+ if (p.target.closest("button")) return;
2222
+ i = !0, s = p.clientX, n = p.clientY;
2223
+ const d = t.getBoundingClientRect();
2224
+ o = d.left, a = d.top, document.addEventListener("mousemove", r), document.addEventListener("mouseup", h), document.body.style.userSelect = "none";
2225
+ }, r = (p) => {
2226
+ if (!i) return;
2227
+ const d = p.clientX - s, u = p.clientY - n, m = window.innerWidth, f = window.innerHeight, g = t.offsetWidth, C = t.offsetHeight;
2228
+ let y = o + d, L = a + u;
2229
+ 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);
2230
+ }, h = () => {
2231
+ i = !1, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", h), document.body.style.userSelect = "";
2232
2232
  };
2233
- c.addEventListener("mousedown", a);
2234
- }, U = (c) => {
2233
+ c.addEventListener("mousedown", l);
2234
+ }, A = (c) => {
2235
2235
  if (!c) return null;
2236
2236
  let t = c.trim();
2237
2237
  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()}`;
2238
- }, F = (c, t, e) => `#${[c, t, e].map((i) => Math.max(0, Math.min(255, i)).toString(16).padStart(2, "0")).join("")}`, S = (c) => {
2238
+ }, F = (c, t, e) => `#${[c, t, e].map((i) => Math.max(0, Math.min(255, i)).toString(16).padStart(2, "0")).join("")}`, k = (c) => {
2239
2239
  const t = c.replace("#", ""), e = t.length === 3 ? t.split("").map((i) => i + i).join("") : t;
2240
2240
  return {
2241
2241
  r: parseInt(e.slice(0, 2), 16),
@@ -2243,12 +2243,12 @@ const dt = (c, t) => {
2243
2243
  b: parseInt(e.slice(4, 6), 16)
2244
2244
  };
2245
2245
  }, H = (c) => {
2246
- const { r: t, g: e, b: i } = S(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;
2246
+ const { r: t, g: e, b: i } = k(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;
2247
2247
  let h = 0;
2248
2248
  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);
2249
2249
  const p = a === 0 ? 0 : r / a, d = a;
2250
2250
  return { h: h * 60, s: p, v: d };
2251
- }, W = (c, t, e) => {
2251
+ }, G = (c, t, e) => {
2252
2252
  const i = (c % 360 + 360) % 360, s = e * t, n = s * (1 - Math.abs(i / 60 % 2 - 1)), o = e - s;
2253
2253
  let a = 0, l = 0, r = 0;
2254
2254
  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(
@@ -2256,10 +2256,10 @@ const dt = (c, t) => {
2256
2256
  Math.round((l + o) * 255),
2257
2257
  Math.round((r + o) * 255)
2258
2258
  );
2259
- }, Gt = (c, t, e) => {
2259
+ }, Rt = (c, t, e) => {
2260
2260
  const i = e * (1 - t / 2), s = i === 0 || i === 1 ? 0 : (e - i) / Math.min(i, 1 - i);
2261
2261
  return { hue: c, sat: s, lightness: i };
2262
- }, Z = (c, t, e) => {
2262
+ }, X = (c, t, e) => {
2263
2263
  const i = (1 - Math.abs(2 * e - 1)) * t, s = i * (1 - Math.abs(c / 60 % 2 - 1)), n = e - i / 2;
2264
2264
  let o = 0, a = 0, l = 0;
2265
2265
  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), {
@@ -2267,10 +2267,10 @@ const dt = (c, t) => {
2267
2267
  g: Math.round((a + n) * 255),
2268
2268
  b: Math.round((l + n) * 255)
2269
2269
  };
2270
- }, ut = (c, t) => {
2270
+ }, ht = (c, t) => {
2271
2271
  const e = Math.max(0, Math.min(100, t)) / 100;
2272
2272
  if (c.startsWith("#")) {
2273
- const { r: s, g: n, b: o } = S(c);
2273
+ const { r: s, g: n, b: o } = k(c);
2274
2274
  return `rgba(${s}, ${n}, ${o}, ${e})`;
2275
2275
  }
2276
2276
  if (c.startsWith("rgba("))
@@ -2280,7 +2280,7 @@ const dt = (c, t) => {
2280
2280
  if (c.startsWith("hsl(")) {
2281
2281
  const s = c.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
2282
2282
  if (s) {
2283
- const { r: n, g: o, b: a } = Z(
2283
+ const { r: n, g: o, b: a } = X(
2284
2284
  parseInt(s[1]),
2285
2285
  parseInt(s[2]) / 100,
2286
2286
  parseInt(s[3]) / 100
@@ -2291,7 +2291,7 @@ const dt = (c, t) => {
2291
2291
  if (c.startsWith("hsla(")) {
2292
2292
  const s = c.match(/hsla\((\d+),\s*(\d+)%,\s*(\d+)%,\s*[\d.]+\)/);
2293
2293
  if (s) {
2294
- const { r: n, g: o, b: a } = Z(
2294
+ const { r: n, g: o, b: a } = X(
2295
2295
  parseInt(s[1]),
2296
2296
  parseInt(s[2]) / 100,
2297
2297
  parseInt(s[3]) / 100
@@ -2299,13 +2299,13 @@ const dt = (c, t) => {
2299
2299
  return `rgba(${n}, ${o}, ${a}, ${e})`;
2300
2300
  }
2301
2301
  }
2302
- const i = U(c);
2302
+ const i = A(c);
2303
2303
  if (i) {
2304
- const { r: s, g: n, b: o } = S(i);
2304
+ const { r: s, g: n, b: o } = k(i);
2305
2305
  return `rgba(${s}, ${n}, ${o}, ${e})`;
2306
2306
  }
2307
2307
  return c;
2308
- }, zt = (c) => [
2308
+ }, Ft = (c) => [
2309
2309
  "red",
2310
2310
  "green",
2311
2311
  "blue",
@@ -2329,17 +2329,17 @@ const dt = (c, t) => {
2329
2329
  "teal",
2330
2330
  "fuchsia",
2331
2331
  "transparent"
2332
- ].includes(c.toLowerCase()), gt = (c) => [
2332
+ ].includes(c.toLowerCase()), pt = (c) => [
2333
2333
  /^#[0-9a-fA-F]{3,8}$/,
2334
2334
  /^rgba?\s*\([^)]+\)$/,
2335
2335
  /^hsla?\s*\([^)]+\)$/,
2336
2336
  /^[a-zA-Z]+$/
2337
- ].some((e) => e.test(c.trim())), Wt = (c) => {
2337
+ ].some((e) => e.test(c.trim())), Ut = (c) => {
2338
2338
  if (typeof document > "u")
2339
- return gt(c) || !!U(c);
2339
+ return pt(c) || !!A(c);
2340
2340
  const t = document.createElement("div");
2341
2341
  return t.style.color = c, t.style.color !== "";
2342
- }, mt = (c) => {
2342
+ }, dt = (c) => {
2343
2343
  const t = c.trim();
2344
2344
  if (/^#[0-9A-Fa-f]{8}$/.test(t)) {
2345
2345
  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);
@@ -2364,7 +2364,7 @@ const dt = (c, t) => {
2364
2364
  /hsla?\s*\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)/
2365
2365
  );
2366
2366
  if (i) {
2367
- const { r: n, g: o, b: a } = Z(
2367
+ const { r: n, g: o, b: a } = X(
2368
2368
  parseFloat(i[1]),
2369
2369
  parseFloat(i[2]) / 100,
2370
2370
  parseFloat(i[3]) / 100
@@ -2375,8 +2375,8 @@ const dt = (c, t) => {
2375
2375
  opacity: Math.round(l * 100)
2376
2376
  };
2377
2377
  }
2378
- return { color: U(t) || t, position: 0, opacity: 100 };
2379
- }, lt = (c) => {
2378
+ return { color: A(t) || t, position: 0, opacity: 100 };
2379
+ }, nt = (c) => {
2380
2380
  const t = [];
2381
2381
  let e = "", i = 0;
2382
2382
  for (let s = 0; s < c.length; s++) {
@@ -2390,7 +2390,7 @@ const dt = (c, t) => {
2390
2390
  e += n;
2391
2391
  }
2392
2392
  return e.trim() && t.push(e.trim()), t;
2393
- }, rt = (c, t) => {
2393
+ }, ot = (c, t) => {
2394
2394
  const e = new RegExp(`${t}\\s*\\(`, "i"), i = c.match(e);
2395
2395
  if (!i) return null;
2396
2396
  const s = i.index + i[0].length;
@@ -2398,7 +2398,7 @@ const dt = (c, t) => {
2398
2398
  for (let a = s; a < c.length && n > 0; a++)
2399
2399
  c[a] === "(" ? n++ : c[a] === ")" && n--, o = a;
2400
2400
  return n === 0 ? c.substring(s, o) : null;
2401
- }, qt = (c) => {
2401
+ }, Gt = (c) => {
2402
2402
  const t = c.split(" ")[0].toLowerCase();
2403
2403
  return [
2404
2404
  "circle",
@@ -2410,16 +2410,16 @@ const dt = (c, t) => {
2410
2410
  "at",
2411
2411
  "contain",
2412
2412
  "cover"
2413
- ].includes(t) ? !1 : /^#[0-9a-f]{3,8}$/i.test(t) || /^rgb/i.test(c) || /^hsl/i.test(c) || zt(t);
2414
- }, ct = (c) => {
2413
+ ].includes(t) ? !1 : /^#[0-9a-f]{3,8}$/i.test(t) || /^rgb/i.test(c) || /^hsl/i.test(c) || Ft(t);
2414
+ }, at = (c) => {
2415
2415
  const t = [];
2416
2416
  return c.forEach((e, i) => {
2417
2417
  const s = e.trim();
2418
2418
  if (!s) return;
2419
2419
  let n = "", o = 0;
2420
2420
  const a = s.match(/^(.+?)\s+(\d+(?:\.\d+)?)%?\s*$/);
2421
- a && gt(a[1].trim()) ? (n = a[1].trim(), o = parseFloat(a[2])) : (n = s, o = c.length === 1 ? 0 : i / (c.length - 1) * 100);
2422
- const l = mt(n);
2421
+ a && pt(a[1].trim()) ? (n = a[1].trim(), o = parseFloat(a[2])) : (n = s, o = c.length === 1 ? 0 : i / (c.length - 1) * 100);
2422
+ const l = dt(n);
2423
2423
  l.position = Math.max(0, Math.min(100, Math.round(o))), t.push(l);
2424
2424
  }), t;
2425
2425
  }, $ = (c) => {
@@ -2433,15 +2433,15 @@ const dt = (c, t) => {
2433
2433
  opacity: e.opacity === void 0 || Number.isNaN(e.opacity) ? 100 : e.opacity
2434
2434
  }))
2435
2435
  };
2436
- }, O = (c) => {
2436
+ }, P = (c) => {
2437
2437
  const t = c.replace(/;$/, "").trim();
2438
- if (Wt(t)) {
2439
- const s = mt(t);
2438
+ if (Ut(t)) {
2439
+ const s = dt(t);
2440
2440
  return $({ type: "solid", angle: 0, stops: [s] });
2441
2441
  }
2442
- const e = rt(t, "linear-gradient");
2442
+ const e = ot(t, "linear-gradient");
2443
2443
  if (e) {
2444
- const s = lt(e);
2444
+ const s = nt(e);
2445
2445
  let n = 90, o = s;
2446
2446
  const a = s[0];
2447
2447
  if (a.includes("deg")) {
@@ -2457,12 +2457,12 @@ const dt = (c, t) => {
2457
2457
  "to top right": 45,
2458
2458
  "to top left": 315
2459
2459
  }[a] ?? 90, o = s.slice(1));
2460
- const l = ct(o);
2460
+ const l = at(o);
2461
2461
  return l.length ? $({ type: "linear", angle: n, stops: l }) : null;
2462
2462
  }
2463
- const i = rt(t, "radial-gradient");
2463
+ const i = ot(t, "radial-gradient");
2464
2464
  if (i) {
2465
- const s = lt(i), n = s[0] && !qt(s[0]) ? s.slice(1) : s, o = ct(n);
2465
+ const s = nt(i), n = s[0] && !Gt(s[0]) ? s.slice(1) : s, o = at(n);
2466
2466
  return o.length ? $({ type: "radial", angle: 0, stops: o }) : null;
2467
2467
  }
2468
2468
  return null;
@@ -2472,10 +2472,10 @@ const dt = (c, t) => {
2472
2472
  return `#${s}${n}`;
2473
2473
  }
2474
2474
  const t = c.stops.map(
2475
- (e) => `${ut(e.color, e.opacity ?? 100)} ${e.position}%`
2475
+ (e) => `${ht(e.color, e.opacity ?? 100)} ${e.position}%`
2476
2476
  ).join(", ");
2477
2477
  return c.type === "radial" ? `radial-gradient(circle, ${t})` : `linear-gradient(${c.angle}deg, ${t})`;
2478
- }, jt = (c) => Math.round(c / 100 * 255).toString(16).toUpperCase().padStart(2, "0"), tt = (c) => {
2478
+ }, zt = (c) => Math.round(c / 100 * 255).toString(16).toUpperCase().padStart(2, "0"), _ = (c) => {
2479
2479
  if (c.type === "solid") {
2480
2480
  const t = c.stops[0];
2481
2481
  if (t) {
@@ -2483,14 +2483,14 @@ const dt = (c, t) => {
2483
2483
  if (i === 100)
2484
2484
  return e;
2485
2485
  {
2486
- const s = jt(i);
2486
+ const s = zt(i);
2487
2487
  return `${e}${s}`;
2488
2488
  }
2489
2489
  }
2490
2490
  return "#000000";
2491
2491
  }
2492
2492
  return c.type === "linear" ? `Linear ${c.angle}°` : "Radial Gradient";
2493
- }, q = class q {
2493
+ }, z = class z {
2494
2494
  static defaults() {
2495
2495
  return {
2496
2496
  solid: [],
@@ -2500,8 +2500,8 @@ const dt = (c, t) => {
2500
2500
  static normalizeList(t) {
2501
2501
  const e = /* @__PURE__ */ new Set(), i = [];
2502
2502
  return t.forEach((s) => {
2503
- let n = U(s);
2504
- n || O(s) && (n = s), n && (e.has(n) || (e.add(n), i.push(n)));
2503
+ let n = A(s);
2504
+ n || P(s) && (n = s), n && (e.has(n) || (e.add(n), i.push(n)));
2505
2505
  }), i.slice(0, this.MAX_COLORS);
2506
2506
  }
2507
2507
  static ensureLoaded() {
@@ -2544,11 +2544,11 @@ const dt = (c, t) => {
2544
2544
  }
2545
2545
  static addColor(t, e) {
2546
2546
  if (!t) return;
2547
- let i = U(t), s = "solid";
2547
+ let i = A(t), s = "solid";
2548
2548
  if (i)
2549
2549
  s = "solid";
2550
2550
  else {
2551
- const l = O(t);
2551
+ const l = P(t);
2552
2552
  l && (i = t, s = l.type === "solid" ? "solid" : "gradient");
2553
2553
  }
2554
2554
  if (!i) return;
@@ -2556,42 +2556,69 @@ const dt = (c, t) => {
2556
2556
  a !== -1 && o.splice(a, 1), o.unshift(i), o.length > this.MAX_COLORS && (o.length = this.MAX_COLORS), this.persist();
2557
2557
  }
2558
2558
  };
2559
- q.STORAGE_KEY = "settingsLib_recentColors", q.MAX_COLORS = 12, q.colors = null;
2560
- let A = q;
2561
- const st = (c, t) => {
2559
+ z.STORAGE_KEY = "settingsLib_recentColors", z.MAX_COLORS = 12, z.colors = null;
2560
+ let B = z;
2561
+ const et = (c, t) => {
2562
2562
  const e = document.createElement("div");
2563
2563
  e.className = "color-picker-recent-section";
2564
2564
  const i = document.createElement("div");
2565
- i.className = "color-picker-recent-title", i.textContent = "Recently Used Colors";
2565
+ i.className = "color-picker-recent-title", i.textContent = "Recently Used";
2566
2566
  const s = document.createElement("div");
2567
2567
  s.className = "color-picker-recent-grid";
2568
2568
  const n = document.createElement("div");
2569
2569
  n.className = "color-picker-recent-placeholder", n.textContent = "No recent colors yet", e.appendChild(i), e.appendChild(s), e.appendChild(n);
2570
2570
  const o = () => {
2571
2571
  s.innerHTML = "";
2572
- const a = A.getColors(t);
2572
+ const a = B.getColors(t);
2573
2573
  if (a.length === 0) {
2574
2574
  s.style.display = "none", n.style.display = "block";
2575
2575
  return;
2576
2576
  }
2577
2577
  s.style.display = "grid", n.style.display = "none", a.forEach((l) => {
2578
2578
  const r = document.createElement("button");
2579
- r.type = "button", r.className = "color-picker-recent-swatch", r.title = l, r.setAttribute("aria-label", `Use color ${l}`), r.style.background = l, r.style.borderColor = l, r.addEventListener("click", () => c(l)), s.appendChild(r);
2579
+ r.type = "button", r.className = "color-picker-recent-swatch";
2580
+ const h = Wt(l);
2581
+ r.title = h, r.setAttribute("aria-label", `Use color: ${h}`), r.style.background = l, r.style.borderColor = l;
2582
+ const p = document.createElement("div");
2583
+ p.className = "color-picker-tooltip", p.textContent = h, p.style.display = "none", document.body.appendChild(p), r.addEventListener("mouseenter", (d) => {
2584
+ const u = r.getBoundingClientRect();
2585
+ p.style.display = "block", p.style.left = `${u.left + u.width / 2}px`, p.style.top = `${u.bottom + 8}px`;
2586
+ }), r.addEventListener("mouseleave", () => {
2587
+ p.style.display = "none", r.style.boxShadow = "";
2588
+ }), r.addEventListener("mousedown", () => {
2589
+ r.style.boxShadow = "0px 0px 0px 2px var(--grey40)";
2590
+ }), r.addEventListener("mouseup", () => {
2591
+ setTimeout(() => {
2592
+ r.style.boxShadow = "";
2593
+ }, 150);
2594
+ }), r.addEventListener("click", () => c(l)), r.addEventListener("DOMNodeRemoved", () => {
2595
+ p.parentNode && p.parentNode.removeChild(p);
2596
+ }), s.appendChild(r);
2580
2597
  });
2581
2598
  };
2582
2599
  return o(), { container: e, refresh: o };
2583
- }, ft = `<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
2600
+ }, Wt = (c) => {
2601
+ const t = P(c);
2602
+ if (t)
2603
+ return _(t);
2604
+ const e = A(c);
2605
+ if (e) {
2606
+ const i = k(e);
2607
+ return `${e} (RGB: ${i.r}, ${i.g}, ${i.b})`;
2608
+ }
2609
+ return c;
2610
+ }, ut = `<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
2584
2611
  <path fill-rule="evenodd" clip-rule="evenodd"
2585
2612
  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"
2586
2613
  fill="#919EAB"/>
2587
- </svg>`, _t = `<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2614
+ </svg>`, jt = `<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2588
2615
  <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"/>
2589
- </svg>`, Jt = `<svg width="15" height="17" viewBox="0 0 15 17" fill="none" xmlns="http://www.w3.org/2000/svg">
2616
+ </svg>`, qt = `<svg width="15" height="17" viewBox="0 0 15 17" fill="none" xmlns="http://www.w3.org/2000/svg">
2590
2617
  <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"/>
2591
- </svg>`, Xt = `<svg width="14" height="2" viewBox="0 0 14 2" fill="none" xmlns="http://www.w3.org/2000/svg">
2618
+ </svg>`, _t = `<svg width="14" height="2" viewBox="0 0 14 2" fill="none" xmlns="http://www.w3.org/2000/svg">
2592
2619
  <path d="M0.8 0.800003H12.4667" stroke="#919EAB" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
2593
2620
  </svg>`;
2594
- class Zt {
2621
+ class Jt {
2595
2622
  constructor(t, e = "gradient") {
2596
2623
  this.isOpen = !1, this.currentColor = "#FF0000", this.currentOpacity = 100, this.outsideClick = (i) => {
2597
2624
  if (!this.isOpen) return;
@@ -2625,44 +2652,46 @@ class Zt {
2625
2652
  const i = document.createElement("span");
2626
2653
  i.textContent = "Color";
2627
2654
  const s = document.createElement("button");
2628
- s.className = "color-picker-close", s.innerHTML = ft, s.addEventListener("click", () => this.close(!0)), e.appendChild(i), e.appendChild(s), dt(e, t);
2655
+ s.className = "color-picker-close", s.innerHTML = ut, s.addEventListener("click", () => this.close(!0)), e.appendChild(i), e.appendChild(s), ct(e, t);
2629
2656
  const n = document.createElement("div");
2630
2657
  n.className = "color-picker-area", this.colorArea = n;
2631
2658
  const o = document.createElement("div");
2632
2659
  o.className = "color-picker-marker", this.colorMarker = o, n.appendChild(o);
2633
2660
  const a = document.createElement("div");
2634
- a.className = "color-picker-hue-container";
2661
+ a.className = "color-picker-sliders-container";
2635
2662
  const l = document.createElement("button");
2636
- l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML = _t;
2663
+ l.className = "color-picker-eyedropper", l.type = "button", l.innerHTML = jt;
2637
2664
  const r = document.createElement("div");
2638
- r.className = "color-picker-hue", this.hueSlider = r;
2665
+ r.className = "color-picker-sliders-group";
2639
2666
  const h = document.createElement("div");
2640
- h.className = "color-picker-hue-marker", this.hueMarker = h, r.appendChild(h), a.appendChild(l), a.appendChild(r);
2667
+ h.className = "color-picker-hue", this.hueSlider = h;
2641
2668
  const p = document.createElement("div");
2642
- p.className = "color-picker-opacity", this.opacitySlider = p;
2669
+ p.className = "color-picker-hue-marker", this.hueMarker = p, h.appendChild(p);
2643
2670
  const d = document.createElement("div");
2644
- d.className = "color-picker-opacity-marker", this.opacityMarker = d, p.appendChild(d);
2645
- const u = st((B) => {
2646
- var G;
2647
- this.setColor(B), (G = this.onChange) == null || G.call(this, B, this.currentOpacity);
2671
+ d.className = "color-picker-opacity", this.opacitySlider = d;
2672
+ const u = document.createElement("div");
2673
+ u.className = "color-picker-opacity-marker", this.opacityMarker = u, d.appendChild(u), r.appendChild(h), r.appendChild(d), a.appendChild(l), a.appendChild(r);
2674
+ const m = et((E) => {
2675
+ var x;
2676
+ this.setColor(E), (x = this.onChange) == null || x.call(this, E, this.currentOpacity);
2648
2677
  }, this.recentScope);
2649
- this.recentSectionRefresh = u.refresh;
2650
- const g = document.createElement("div");
2651
- g.className = "color-picker-format-section";
2652
- const m = document.createElement("select");
2653
- m.className = "color-picker-format-select", this.select = m;
2654
- const f = document.createElement("option");
2655
- f.value = "hex", f.textContent = "HEX";
2678
+ this.recentSectionRefresh = m.refresh;
2679
+ const f = document.createElement("div");
2680
+ f.className = "color-picker-format-section";
2681
+ const g = document.createElement("select");
2682
+ g.className = "color-picker-format-select", this.select = g;
2656
2683
  const C = document.createElement("option");
2657
- C.value = "rgb", C.textContent = "RGB";
2684
+ C.value = "hex", C.textContent = "HEX";
2658
2685
  const y = document.createElement("option");
2659
- y.value = "hsl", y.textContent = "HSL", m.appendChild(f), m.appendChild(C), m.appendChild(y);
2660
- const E = document.createElement("input");
2661
- E.type = "text", E.className = "color-picker-color-input", E.value = this.currentColor, this.input = E;
2662
- const T = document.createElement("div");
2663
- T.className = "color-picker-input-container";
2664
- const k = document.createElement("button");
2665
- return k.className = "color-picker-copy-inside", k.textContent = "Copy", T.appendChild(E), T.appendChild(k), g.appendChild(m), g.appendChild(T), t.appendChild(e), t.appendChild(n), t.appendChild(a), t.appendChild(p), t.appendChild(u.container), t.appendChild(g), t.addEventListener("click", (B) => B.stopPropagation()), this.bind(n, r, p, E, m, k, l), t;
2686
+ y.value = "rgb", y.textContent = "RGB";
2687
+ const L = document.createElement("option");
2688
+ L.value = "hsl", L.textContent = "HSL", g.appendChild(C), g.appendChild(y), g.appendChild(L);
2689
+ const I = document.createElement("input");
2690
+ I.type = "text", I.className = "color-picker-color-input", I.value = this.currentColor, this.input = I;
2691
+ const O = document.createElement("div");
2692
+ O.className = "color-picker-input-container";
2693
+ const v = document.createElement("button");
2694
+ return v.className = "color-picker-copy-inside", v.textContent = "Copy", O.appendChild(I), 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, I, g, v, l), t;
2666
2695
  }
2667
2696
  createBackdrop() {
2668
2697
  const t = document.createElement("div");
@@ -2673,37 +2702,37 @@ class Zt {
2673
2702
  bind(t, e, i, s, n, o, a) {
2674
2703
  const l = (p) => {
2675
2704
  var y;
2676
- const d = t.getBoundingClientRect(), u = Math.max(0, Math.min(1, (p.clientX - d.left) / d.width)), g = Math.max(0, Math.min(1, (p.clientY - d.top) / d.height));
2677
- this.colorMarker.style.left = `${u * 100}%`, this.colorMarker.style.top = `${g * 100}%`;
2678
- const f = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, C = W(f, u, 1 - g);
2705
+ 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));
2706
+ this.colorMarker.style.left = `${u * 100}%`, this.colorMarker.style.top = `${m * 100}%`;
2707
+ const g = this.parsePercentage(this.hueMarker.style.left || "0%") * 360, C = G(g, u, 1 - m);
2679
2708
  this.currentColor = C, this.syncInput(), this.updateOpacityBg(), (y = this.onChange) == null || y.call(this, C, this.currentOpacity);
2680
2709
  }, r = (p) => {
2681
2710
  var y;
2682
2711
  const d = e.getBoundingClientRect();
2683
2712
  let u = Math.max(0, Math.min(1, (p.clientX - d.left) / d.width));
2684
2713
  this.hueMarker.style.left = `${u * 100}%`;
2685
- const g = u * 360, m = this.parsePercentage(this.colorMarker.style.left || "0%"), f = this.parsePercentage(this.colorMarker.style.top || "0%"), C = W(g, m, 1 - f);
2686
- this.currentColor = C, this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${g}, 100%, 50%))`, this.syncInput(), this.updateOpacityBg(), (y = this.onChange) == null || y.call(this, C, this.currentOpacity);
2714
+ const m = u * 360, f = this.parsePercentage(this.colorMarker.style.left || "0%"), g = this.parsePercentage(this.colorMarker.style.top || "0%"), C = G(m, f, 1 - g);
2715
+ 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);
2687
2716
  }, h = (p) => {
2688
- var g;
2717
+ var m;
2689
2718
  const d = i.getBoundingClientRect(), u = Math.max(0, Math.min(1, (p.clientX - d.left) / d.width));
2690
- this.opacityMarker.style.left = `${u * 100}%`, this.currentOpacity = Math.round(u * 100), (g = this.onChange) == null || g.call(this, this.currentColor, this.currentOpacity);
2719
+ this.opacityMarker.style.left = `${u * 100}%`, this.currentOpacity = Math.round(u * 100), (m = this.onChange) == null || m.call(this, this.currentColor, this.currentOpacity);
2691
2720
  };
2692
2721
  t.addEventListener("mousedown", (p) => {
2693
2722
  p.preventDefault(), l(p);
2694
- const d = (g) => l(g), u = () => {
2723
+ const d = (m) => l(m), u = () => {
2695
2724
  document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", u);
2696
2725
  };
2697
2726
  document.addEventListener("mousemove", d), document.addEventListener("mouseup", u);
2698
2727
  }), e.addEventListener("mousedown", (p) => {
2699
2728
  p.preventDefault(), r(p);
2700
- const d = (g) => r(g), u = () => {
2729
+ const d = (m) => r(m), u = () => {
2701
2730
  document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", u);
2702
2731
  };
2703
2732
  document.addEventListener("mousemove", d), document.addEventListener("mouseup", u);
2704
2733
  }), i.addEventListener("mousedown", (p) => {
2705
2734
  p.preventDefault(), h(p);
2706
- const d = (g) => h(g), u = () => {
2735
+ const d = (m) => h(m), u = () => {
2707
2736
  document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", u);
2708
2737
  };
2709
2738
  document.addEventListener("mousemove", d), document.addEventListener("mouseup", u);
@@ -2741,10 +2770,10 @@ class Zt {
2741
2770
  const t = this.select.value, { h: e, s: i, v: s } = H(this.currentColor);
2742
2771
  if (t === "hex") this.input.value = this.currentColor;
2743
2772
  else if (t === "rgb") {
2744
- const { r: n, g: o, b: a } = S(this.currentColor);
2773
+ const { r: n, g: o, b: a } = k(this.currentColor);
2745
2774
  this.input.value = `rgb(${n}, ${o}, ${a})`;
2746
2775
  } else {
2747
- const { hue: n, sat: o, lightness: a } = Gt(e, i, s);
2776
+ const { hue: n, sat: o, lightness: a } = Rt(e, i, s);
2748
2777
  this.input.value = `hsl(${Math.round(n)}, ${Math.round(
2749
2778
  o * 100
2750
2779
  )}%, ${Math.round(a * 100)}%)`;
@@ -2763,42 +2792,42 @@ class Zt {
2763
2792
  const s = t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
2764
2793
  if (s) {
2765
2794
  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);
2766
- e = W(n, r, l);
2795
+ e = G(n, r, l);
2767
2796
  }
2768
2797
  }
2769
2798
  }
2770
2799
  e && this.setColor(e);
2771
2800
  }
2772
2801
  updateOpacityBg() {
2773
- const { r: t, g: e, b: i } = S(this.currentColor);
2802
+ const { r: t, g: e, b: i } = k(this.currentColor);
2774
2803
  this.opacitySlider.style.setProperty(
2775
2804
  "--base-color",
2776
2805
  `rgb(${t}, ${e}, ${i})`
2777
2806
  );
2778
2807
  }
2779
2808
  open(t, e, i) {
2780
- var E;
2809
+ var L;
2781
2810
  this.currentColor = t, this.currentOpacity = i ?? 100, this.syncInput();
2782
2811
  const { h: s, s: n, v: o } = H(t);
2783
- 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}%`, (E = this.recentSectionRefresh) == null || E.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);
2812
+ 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);
2784
2813
  const a = this.element.offsetWidth, l = this.element.offsetHeight, r = e.getBoundingClientRect(), h = window.innerWidth, p = window.innerHeight, d = 16;
2785
- let u = r.right + 8, g = r.top;
2786
- const m = h - r.right, f = r.left;
2787
- m >= a + d ? u = r.right + 8 : f >= a + d ? u = r.left - a - 8 : u = Math.max(d, (h - a) / 2);
2814
+ let u = r.right + 8, m = r.top;
2815
+ const f = h - r.right, g = r.left;
2816
+ f >= a + d ? u = r.right + 8 : g >= a + d ? u = r.left - a - 8 : u = Math.max(d, (h - a) / 2);
2788
2817
  const C = p - r.bottom, y = r.top;
2789
- C >= l + d ? g = r.bottom + 8 : y >= l + d ? g = r.top - l - 8 : C > y ? (g = r.bottom + 8, g + l > p - d && (g = p - l - d)) : (g = r.top - l - 8, g < d && (g = d)), this.element.style.left = `${u}px`, this.element.style.top = `${g}px`;
2818
+ 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`;
2790
2819
  }
2791
2820
  close(t) {
2792
2821
  var e;
2793
- 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.recentScope !== "gradient" && (A.addColor(this.currentColor, this.recentScope), (e = this.recentSectionRefresh) == null || e.call(this)));
2822
+ 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" && (B.addColor(this.currentColor, this.recentScope), (e = this.recentSectionRefresh) == null || e.call(this)));
2794
2823
  }
2795
2824
  getElement() {
2796
2825
  return this.element;
2797
2826
  }
2798
2827
  }
2799
- class Kt {
2828
+ class Xt {
2800
2829
  constructor(t) {
2801
- 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();
2830
+ this.recentScope = "all", this.updateScheduled = !1, this.currentColor = t.initialColor, this.currentOpacity = t.initialOpacity, this.onColorChange = t.onColorChange, t.scope && (this.recentScope = t.scope), this.container = this.createContainer(), this.initializePicker();
2802
2831
  }
2803
2832
  createContainer() {
2804
2833
  const t = document.createElement("div");
@@ -2806,19 +2835,21 @@ class Kt {
2806
2835
  <div class="color-picker-area embedded">
2807
2836
  <div class="color-picker-marker"></div>
2808
2837
  </div>
2809
- <div class="color-picker-hue-container">
2838
+ <div class="color-picker-sliders-container embedded">
2810
2839
  <button class="color-picker-eyedropper">
2811
2840
  <svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2812
2841
  <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"/>
2813
2842
  </svg>
2814
2843
  </button>
2815
- <div class="color-picker-hue embedded">
2816
- <div class="color-picker-hue-marker"></div>
2844
+ <div class="color-picker-sliders-group">
2845
+ <div class="color-picker-hue embedded">
2846
+ <div class="color-picker-hue-marker"></div>
2847
+ </div>
2848
+ <div class="color-picker-opacity embedded">
2849
+ <div class="color-picker-opacity-marker"></div>
2850
+ </div>
2817
2851
  </div>
2818
2852
  </div>
2819
- <div class="color-picker-opacity embedded">
2820
- <div class="color-picker-opacity-marker"></div>
2821
- </div>
2822
2853
  <div class="color-picker-format-section embedded">
2823
2854
  <select class="color-picker-format-select">
2824
2855
  <option value="hex">HEX</option>
@@ -2831,43 +2862,41 @@ class Kt {
2831
2862
  </div>
2832
2863
  </div>
2833
2864
  `;
2834
- const e = st((i) => {
2865
+ const e = et((i) => {
2835
2866
  this.applyRecentColor(i);
2836
2867
  }, this.recentScope);
2837
2868
  return this.recentSectionRefresh = e.refresh, t.appendChild(e.container), t;
2838
2869
  }
2839
2870
  initializePicker() {
2840
- const t = this.container.querySelector(
2871
+ this.colorArea = this.container.querySelector(
2841
2872
  ".color-picker-area"
2842
- ), e = this.container.querySelector(
2873
+ ), this.colorMarker = this.container.querySelector(
2843
2874
  ".color-picker-marker"
2844
- ), i = this.container.querySelector(
2875
+ ), this.hueSlider = this.container.querySelector(
2845
2876
  ".color-picker-hue"
2846
- ), s = this.container.querySelector(
2877
+ ), this.hueMarker = this.container.querySelector(
2847
2878
  ".color-picker-hue-marker"
2848
- ), n = this.container.querySelector(
2879
+ ), this.opacitySlider = this.container.querySelector(
2849
2880
  ".color-picker-opacity"
2850
- ), o = this.container.querySelector(
2881
+ ), this.opacityMarker = this.container.querySelector(
2851
2882
  ".color-picker-opacity-marker"
2852
- ), a = this.container.querySelector(
2883
+ ), this.formatSelect = this.container.querySelector(
2853
2884
  ".color-picker-format-select"
2854
- ), l = this.container.querySelector(
2885
+ ), this.colorInput = this.container.querySelector(
2855
2886
  ".color-picker-color-input"
2856
- ), r = this.container.querySelector(
2887
+ );
2888
+ const t = this.container.querySelector(
2857
2889
  ".color-picker-copy-inside"
2858
- ), { h, s: p, v: d } = H(this.currentColor);
2859
- s.style.left = `${h / 360 * 100}%`, e.style.left = `${p * 100}%`, e.style.top = `${(1 - d) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${h}, 100%, 50%))`, o.style.left = `${this.currentOpacity}%`, this.updateOpacityBackground(n), this.updateColorInput(a, l), this.setupColorAreaEvents(t, e, s), this.setupHueSliderEvents(
2860
- i,
2861
- s,
2862
- t,
2863
- e,
2864
- a,
2865
- l,
2866
- n
2867
- ), this.setupOpacitySliderEvents(n, o), this.setupFormatEvents(a, l, r);
2890
+ ), { h: e, s: i, v: s } = H(this.currentColor);
2891
+ 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);
2892
+ }
2893
+ scheduleUpdate() {
2894
+ this.updateScheduled || (this.updateScheduled = !0, requestAnimationFrame(() => {
2895
+ this.updateColorInput(this.formatSelect, this.colorInput), this.updateOpacityBackground(this.opacitySlider), this.updateScheduled = !1;
2896
+ }));
2868
2897
  }
2869
2898
  updateOpacityBackground(t) {
2870
- const e = S(this.currentColor);
2899
+ const e = k(this.currentColor);
2871
2900
  t.style.setProperty(
2872
2901
  "--base-color",
2873
2902
  `rgb(${e.r}, ${e.g}, ${e.b})`
@@ -2879,7 +2908,7 @@ class Kt {
2879
2908
  e.value = this.currentColor;
2880
2909
  break;
2881
2910
  case "rgb":
2882
- const s = S(this.currentColor);
2911
+ const s = k(this.currentColor);
2883
2912
  e.value = `rgb(${s.r}, ${s.g}, ${s.b})`;
2884
2913
  break;
2885
2914
  case "hsl":
@@ -2891,86 +2920,69 @@ class Kt {
2891
2920
  }
2892
2921
  }
2893
2922
  applyRecentColor(t) {
2894
- if (this.currentColor = t, !(t.includes("gradient") || t.includes("radial"))) {
2895
- this.updatePickerVisualState();
2896
- const i = this.container.querySelector(
2897
- ".color-picker-format-select"
2898
- ), s = this.container.querySelector(
2899
- ".color-picker-color-input"
2900
- );
2901
- this.updateColorInput(i, s);
2902
- }
2903
- this.triggerChange();
2923
+ this.currentColor = t, t.includes("gradient") || t.includes("radial") || (this.updatePickerVisualState(), this.updateColorInput(this.formatSelect, this.colorInput)), this.triggerChange();
2904
2924
  }
2905
2925
  commitRecentColor() {
2906
2926
  var t;
2907
- A.addColor(this.currentColor, this.recentScope), (t = this.recentSectionRefresh) == null || t.call(this);
2908
- }
2909
- setupColorAreaEvents(t, e, i) {
2910
- const s = (n) => {
2911
- const o = t.getBoundingClientRect(), a = Math.max(0, Math.min(1, (n.clientX - o.left) / o.width)), l = Math.max(0, Math.min(1, (n.clientY - o.top) / o.height));
2912
- e.style.left = `${a * 100}%`, e.style.top = `${l * 100}%`;
2913
- const r = parseFloat(i.style.left || "0%") / 100 * 360, h = W(r, a, 1 - l);
2914
- this.currentColor = h;
2915
- const p = this.container.querySelector(
2916
- ".color-picker-format-select"
2917
- ), d = this.container.querySelector(
2918
- ".color-picker-color-input"
2919
- ), u = this.container.querySelector(
2920
- ".color-picker-opacity"
2921
- );
2922
- this.updateColorInput(p, d), this.updateOpacityBackground(u), this.triggerChange();
2927
+ B.addColor(this.currentColor, this.recentScope), (t = this.recentSectionRefresh) == null || t.call(this);
2928
+ }
2929
+ setupColorAreaEvents() {
2930
+ const t = (e) => {
2931
+ 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));
2932
+ this.colorMarker.style.left = `${s * 100}%`, this.colorMarker.style.top = `${n * 100}%`;
2933
+ const o = parseFloat(this.hueMarker.style.left || "0%") / 100 * 360, a = G(o, s, 1 - n);
2934
+ this.currentColor = a, this.scheduleUpdate(), this.triggerChange();
2923
2935
  };
2924
- t.addEventListener("mousedown", (n) => {
2925
- n.preventDefault(), s(n);
2926
- const o = (l) => s(l), a = () => {
2927
- document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", a);
2936
+ this.colorArea.addEventListener("mousedown", (e) => {
2937
+ e.preventDefault(), t(e);
2938
+ const i = (n) => t(n), s = () => {
2939
+ document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", s), this.updateColorInput(this.formatSelect, this.colorInput), this.updateOpacityBackground(this.opacitySlider);
2928
2940
  };
2929
- document.addEventListener("mousemove", o), document.addEventListener("mouseup", a);
2941
+ document.addEventListener("mousemove", i), document.addEventListener("mouseup", s);
2930
2942
  });
2931
2943
  }
2932
- setupHueSliderEvents(t, e, i, s, n, o, a) {
2933
- const l = (r) => {
2934
- const h = t.getBoundingClientRect();
2935
- let p = (r.clientX - h.left) / h.width;
2936
- p = Math.max(0, Math.min(1, p)), e.style.left = `${p * 100}%`;
2937
- const d = p * 360, u = parseFloat(s.style.left || "50%") / 100, g = parseFloat(s.style.top || "50%") / 100;
2938
- i.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${d}, 100%, 50%))`;
2939
- const m = W(d, u, 1 - g);
2940
- this.currentColor = m, this.updateColorInput(n, o), this.updateOpacityBackground(a), this.triggerChange();
2944
+ setupHueSliderEvents() {
2945
+ const t = (e) => {
2946
+ const i = this.hueSlider.getBoundingClientRect();
2947
+ let s = (e.clientX - i.left) / i.width;
2948
+ s = Math.max(0, Math.min(1, s)), this.hueMarker.style.left = `${s * 100}%`;
2949
+ const n = s * 360, o = parseFloat(this.colorMarker.style.left || "50%") / 100, a = parseFloat(this.colorMarker.style.top || "50%") / 100;
2950
+ this.colorArea.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${n}, 100%, 50%))`;
2951
+ const l = G(n, o, 1 - a);
2952
+ this.currentColor = l, this.scheduleUpdate(), this.triggerChange();
2941
2953
  };
2942
- t.addEventListener("mousedown", (r) => {
2943
- r.preventDefault(), l(r);
2944
- const h = (d) => l(d), p = () => {
2945
- document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", p);
2954
+ this.hueSlider.addEventListener("mousedown", (e) => {
2955
+ e.preventDefault(), t(e);
2956
+ const i = (n) => t(n), s = () => {
2957
+ document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", s), this.updateColorInput(this.formatSelect, this.colorInput), this.updateOpacityBackground(this.opacitySlider);
2946
2958
  };
2947
- document.addEventListener("mousemove", h), document.addEventListener("mouseup", p);
2959
+ document.addEventListener("mousemove", i), document.addEventListener("mouseup", s);
2948
2960
  });
2949
2961
  }
2950
- setupOpacitySliderEvents(t, e) {
2951
- const i = (s) => {
2952
- const n = t.getBoundingClientRect(), o = Math.max(0, Math.min(1, (s.clientX - n.left) / n.width));
2953
- e.style.left = `${o * 100}%`, this.currentOpacity = Math.round(o * 100), this.triggerChange();
2962
+ setupOpacitySliderEvents() {
2963
+ const t = (e) => {
2964
+ const i = this.opacitySlider.getBoundingClientRect(), s = Math.max(0, Math.min(1, (e.clientX - i.left) / i.width));
2965
+ this.opacityMarker.style.left = `${s * 100}%`, this.currentOpacity = Math.round(s * 100), this.triggerChange();
2954
2966
  };
2955
- t.addEventListener("mousedown", (s) => {
2956
- s.preventDefault(), i(s);
2957
- const n = (a) => i(a), o = () => {
2958
- document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o);
2967
+ this.opacitySlider.addEventListener("mousedown", (e) => {
2968
+ e.preventDefault(), t(e);
2969
+ const i = (n) => t(n), s = () => {
2970
+ document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", s);
2959
2971
  };
2960
- document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
2972
+ document.addEventListener("mousemove", i), document.addEventListener("mouseup", s);
2961
2973
  });
2962
2974
  }
2963
- setupFormatEvents(t, e, i) {
2964
- t.addEventListener("change", () => {
2965
- this.updateColorInput(t, e);
2966
- }), i.addEventListener("click", () => {
2967
- navigator.clipboard.writeText(e.value).catch(() => {
2968
- e.select(), document.execCommand("copy");
2975
+ setupFormatEvents(t) {
2976
+ this.formatSelect.addEventListener("change", () => {
2977
+ this.updateColorInput(this.formatSelect, this.colorInput);
2978
+ }), t.addEventListener("click", () => {
2979
+ navigator.clipboard.writeText(this.colorInput.value).catch(() => {
2980
+ this.colorInput.select(), document.execCommand("copy");
2969
2981
  });
2970
- }), e.addEventListener("input", () => {
2971
- this.handleManualColorInput(e.value, t);
2972
- }), e.addEventListener("blur", () => {
2973
- this.updateColorInput(t, e);
2982
+ }), this.colorInput.addEventListener("input", () => {
2983
+ this.handleManualColorInput(this.colorInput.value, this.formatSelect);
2984
+ }), this.colorInput.addEventListener("blur", () => {
2985
+ this.updateColorInput(this.formatSelect, this.colorInput);
2974
2986
  });
2975
2987
  }
2976
2988
  handleManualColorInput(t, e) {
@@ -2991,7 +3003,7 @@ class Kt {
2991
3003
  }
2992
3004
  parseHexInput(t) {
2993
3005
  const e = t.startsWith("#") ? t : `#${t}`;
2994
- return U(e);
3006
+ return A(e);
2995
3007
  }
2996
3008
  parseRgbInput(t) {
2997
3009
  const e = t.match(
@@ -3011,7 +3023,7 @@ class Kt {
3011
3023
  if (e) {
3012
3024
  const i = parseFloat(e[1]), s = parseFloat(e[2]) / 100, n = parseFloat(e[3]) / 100;
3013
3025
  if (i >= 0 && i <= 360 && s >= 0 && s <= 1 && n >= 0 && n <= 1) {
3014
- const o = Z(i, s, n);
3026
+ const o = X(i, s, n);
3015
3027
  return F(o.r, o.g, o.b);
3016
3028
  }
3017
3029
  }
@@ -3026,16 +3038,8 @@ class Kt {
3026
3038
  return s || null;
3027
3039
  }
3028
3040
  updatePickerVisualState() {
3029
- const t = this.container.querySelector(
3030
- ".color-picker-area"
3031
- ), e = this.container.querySelector(
3032
- ".color-picker-marker"
3033
- ), i = this.container.querySelector(
3034
- ".color-picker-hue-marker"
3035
- ), s = this.container.querySelector(
3036
- ".color-picker-opacity"
3037
- ), { h: n, s: o, v: a } = H(this.currentColor);
3038
- i.style.left = `${n / 360 * 100}%`, e.style.left = `${o * 100}%`, e.style.top = `${(1 - a) * 100}%`, t.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${n}, 100%, 50%))`, this.updateOpacityBackground(s);
3041
+ const { h: t, s: e, v: i } = H(this.currentColor);
3042
+ 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);
3039
3043
  }
3040
3044
  triggerChange() {
3041
3045
  this.onColorChange(this.currentColor, this.currentOpacity);
@@ -3045,25 +3049,11 @@ class Kt {
3045
3049
  }
3046
3050
  updateColor(t, e) {
3047
3051
  this.currentColor = t, this.currentOpacity = e;
3048
- const i = this.container.querySelector(
3049
- ".color-picker-area"
3050
- ), s = this.container.querySelector(
3051
- ".color-picker-marker"
3052
- ), n = this.container.querySelector(
3053
- ".color-picker-hue-marker"
3054
- ), o = this.container.querySelector(
3055
- ".color-picker-opacity-marker"
3056
- ), a = this.container.querySelector(
3057
- ".color-picker-opacity"
3058
- ), l = this.container.querySelector(
3059
- ".color-picker-format-select"
3060
- ), r = this.container.querySelector(
3061
- ".color-picker-color-input"
3062
- ), { h, s: p, v: d } = H(t), u = h >= 360 ? h % 360 : h;
3063
- n.style.left = `${u / 360 * 100}%`, s.style.left = `${p * 100}%`, s.style.top = `${(1 - d) * 100}%`, i.style.background = `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${u}, 100%, 50%))`, o.style.left = `${e}%`, this.updateOpacityBackground(a), this.updateColorInput(l, r);
3052
+ const { h: i, s, v: n } = H(t), o = i >= 360 ? i % 360 : i;
3053
+ 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);
3064
3054
  }
3065
3055
  }
3066
- const V = class V extends w {
3056
+ const V = class V extends b {
3067
3057
  constructor(t = {}) {
3068
3058
  const e = typeof t.default == "string" ? void 0 : t.default;
3069
3059
  super({
@@ -3103,7 +3093,7 @@ const V = class V extends w {
3103
3093
  defaultValue() {
3104
3094
  const t = this.originalDefault;
3105
3095
  if (typeof t == "string") {
3106
- const i = O(t);
3096
+ const i = P(t);
3107
3097
  if (i)
3108
3098
  return $(i);
3109
3099
  }
@@ -3119,16 +3109,16 @@ const V = class V extends w {
3119
3109
  setValue(t) {
3120
3110
  var i, s;
3121
3111
  let e = null;
3122
- typeof t == "string" ? e = O(t) : t && typeof t == "object" && (e = $(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;
3112
+ typeof t == "string" ? e = P(t) : t && typeof t == "object" && (e = $(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;
3123
3113
  }
3124
3114
  updateUI() {
3125
3115
  if (this.previewEl && this.value)
3126
3116
  if (this.value.type === "solid") {
3127
3117
  const t = this.value.stops[0], e = t.opacity ?? 100;
3128
- this.previewEl.style.background = ut(t.color, e);
3118
+ this.previewEl.style.background = ht(t.color, e);
3129
3119
  } else
3130
3120
  this.previewEl.style.background = N(this.value);
3131
- this.inputEl && this.value && !this.isEditing && (this.inputEl.value = tt(this.value));
3121
+ this.inputEl && this.value && !this.isEditing && (this.inputEl.value = _(this.value));
3132
3122
  }
3133
3123
  cssForTextValue() {
3134
3124
  return this.value ? {
@@ -3150,7 +3140,7 @@ const V = class V extends w {
3150
3140
  const e = document.createElement("div");
3151
3141
  return e.className = "gradient-input-wrapper", this.previewEl = document.createElement("div"), this.previewEl.className = "gradient-mini-preview", this.previewEl.style.background = this.value ? N(this.value) : "linear-gradient(90deg, #a84b4b 0%, #786666 100%)", this.previewEl.addEventListener("click", (i) => {
3152
3142
  i.preventDefault(), i.stopPropagation(), this.openPopover();
3153
- }), 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 ? tt(this.value) : "", this.inputEl.readOnly = !1, this.inputEl.addEventListener("focus", () => {
3143
+ }), 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 ? _(this.value) : "", this.inputEl.readOnly = !1, this.inputEl.addEventListener("focus", () => {
3154
3144
  if (this.isEditing = !0, this.value)
3155
3145
  if (this.value.type === "solid") {
3156
3146
  const i = this.value.stops[0];
@@ -3166,7 +3156,7 @@ const V = class V extends w {
3166
3156
  } else
3167
3157
  this.inputEl.value = N(this.value);
3168
3158
  }), this.inputEl.addEventListener("blur", () => {
3169
- this.isEditing = !1, this.value && (this.inputEl.value = tt(this.value));
3159
+ this.isEditing = !1, this.value && (this.inputEl.value = _(this.value));
3170
3160
  }), this.inputEl.addEventListener(
3171
3161
  "paste",
3172
3162
  (i) => this.handlePaste(i)
@@ -3186,7 +3176,9 @@ const V = class V extends w {
3186
3176
  const e = document.createElement("span");
3187
3177
  e.textContent = "Fill";
3188
3178
  const i = document.createElement("button");
3189
- i.type = "button", i.className = "gradient-popover-close", i.innerHTML = ft, i.addEventListener("click", () => this.closePopover()), t.appendChild(e), t.appendChild(i), dt(t, this.popoverEl);
3179
+ i.type = "button", i.className = "gradient-popover-close", i.innerHTML = ut, i.addEventListener("click", () => this.closePopover()), t.appendChild(e), t.appendChild(i), ct(t, this.popoverEl, (a, l) => {
3180
+ this.popoverPosition = { left: a, top: l };
3181
+ });
3190
3182
  const s = document.createElement("div");
3191
3183
  s.className = "gradient-editor";
3192
3184
  const n = this.createTypeTabs();
@@ -3227,12 +3219,12 @@ const V = class V extends w {
3227
3219
  }
3228
3220
  renderSolid(t) {
3229
3221
  (!this.value || !this.value.stops || !this.value.stops.length) && (this.value || (this.value = this.defaultValue()), this.value.stops = [{ color: "#000000", position: 0, opacity: 100 }]);
3230
- const e = this.value.stops[0], i = new Kt({
3222
+ const e = this.value.stops[0], i = new Xt({
3231
3223
  initialColor: e.color,
3232
3224
  initialOpacity: e.opacity ?? 100,
3233
3225
  onColorChange: (s, n) => {
3234
3226
  if (this.value) {
3235
- const o = O(s);
3227
+ const o = P(s);
3236
3228
  if (o && o.type !== "solid") {
3237
3229
  this.value = o, this.switchType(o.type);
3238
3230
  return;
@@ -3256,24 +3248,24 @@ const V = class V extends w {
3256
3248
  const o = document.createElement("input");
3257
3249
  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°");
3258
3250
  const a = document.createElement("button");
3259
- a.type = "button", a.className = "gradient-flip-btn", a.innerHTML = Jt, i.addEventListener("change", () => {
3251
+ a.type = "button", a.className = "gradient-flip-btn", a.innerHTML = qt, i.addEventListener("change", () => {
3260
3252
  this.switchType(i.value === "radial" ? "radial" : "linear"), this.updateDegreeVisibility(o);
3261
- }), o.addEventListener("focus", (m) => {
3262
- const f = m.target;
3263
- f.value = f.value.replace(/[^0-9-]/g, ""), setTimeout(() => f.select(), 0);
3264
- }), o.addEventListener("input", (m) => {
3265
- const f = parseInt(m.target.value);
3266
- !Number.isNaN(f) && this.value && (this.value.angle = Math.max(0, Math.min(360, f)), this.debouncedPreviewUpdate());
3267
- }), o.addEventListener("blur", (m) => {
3253
+ }), o.addEventListener("focus", (f) => {
3254
+ const g = f.target;
3255
+ g.value = g.value.replace(/[^0-9-]/g, ""), setTimeout(() => g.select(), 0);
3256
+ }), o.addEventListener("input", (f) => {
3257
+ const g = parseInt(f.target.value);
3258
+ !Number.isNaN(g) && this.value && (this.value.angle = Math.max(0, Math.min(360, g)), this.debouncedPreviewUpdate());
3259
+ }), o.addEventListener("blur", (f) => {
3268
3260
  var y;
3269
3261
  this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
3270
- const f = m.target;
3271
- let C = parseInt(f.value);
3272
- 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), f.value = `${C}°`, this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3262
+ const g = f.target;
3263
+ let C = parseInt(g.value);
3264
+ 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();
3273
3265
  }), a.addEventListener("click", () => {
3274
- !this.value || !this.value.stops || (this.value.stops.forEach((m) => {
3275
- m.position = 100 - m.position;
3276
- }), this.value.stops.sort((m, f) => m.position - f.position), this.updateGradientPreview(l), this.createHandles(r, l), this.updateStopsList(u), this.updateUI(), this.triggerChange());
3266
+ !this.value || !this.value.stops || (this.value.stops.forEach((f) => {
3267
+ f.position = 100 - f.position;
3268
+ }), this.value.stops.sort((f, g) => f.position - g.position), this.updateGradientPreview(l), this.createHandles(r, l), this.updateStopsList(u), this.updateUI(), this.triggerChange());
3277
3269
  }), e.appendChild(i), e.appendChild(o), e.appendChild(a), t.appendChild(e), this.updateDegreeVisibility(o);
3278
3270
  const l = document.createElement("div");
3279
3271
  l.className = "gradient-preview", this.updateGradientPreview(l);
@@ -3287,13 +3279,13 @@ const V = class V extends w {
3287
3279
  d.type = "button", d.className = "gradient-add-stop", d.textContent = "+", h.appendChild(p), h.appendChild(d);
3288
3280
  const u = document.createElement("div");
3289
3281
  u.className = "gradient-stops", t.appendChild(h), t.appendChild(u), this.updateStopsList(u);
3290
- const g = st((m) => {
3291
- const f = O(m);
3292
- f && (this.value = f, this.switchType(f.type), this.updateUI(), this.triggerChange());
3282
+ const m = et((f) => {
3283
+ const g = P(f);
3284
+ g && (this.value = g, this.switchType(g.type), this.updateUI(), this.triggerChange());
3293
3285
  }, "all");
3294
- this.recentGradientRefresh = g.refresh, t.appendChild(g.container), d.addEventListener("click", () => {
3295
- var m;
3296
- this.addStop(), this.updateStopsList(u), this.updateGradientPreview(l), this.createHandles(r, l), this.updateUI(), ((m = document.activeElement) == null ? void 0 : m.tagName) !== "INPUT" && this.repositionPopover(), this.triggerChange();
3286
+ this.recentGradientRefresh = m.refresh, t.appendChild(m.container), d.addEventListener("click", () => {
3287
+ var f;
3288
+ 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();
3297
3289
  });
3298
3290
  }
3299
3291
  updateDegreeVisibility(t) {
@@ -3321,65 +3313,53 @@ const V = class V extends w {
3321
3313
  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();
3322
3314
  }, p = (u) => {
3323
3315
  if (!a || !this.value) return;
3324
- const g = e.getBoundingClientRect(), m = u.clientX - l;
3325
- let f = r + m / g.width * 100;
3326
- f = Math.max(0, Math.min(100, f)), this.value.stops[s].position = Math.round(f), n.style.left = `${f}%`, this.updateGradientPreview(), this.updateUI();
3316
+ const m = e.getBoundingClientRect(), f = u.clientX - l;
3317
+ let g = r + f / m.width * 100;
3318
+ g = Math.max(0, Math.min(100, g)), this.value.stops[s].position = Math.round(g), n.style.left = `${g}%`, this.updateGradientPreview();
3327
3319
  }, d = () => {
3328
- a && (a = !1, n.classList.remove("selected"), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", d), this.value && (this.value.stops.sort((u, g) => u.position - g.position), this.createHandles(t, e)), this.updateStopsList(), this.updateUI(), this.triggerChange());
3320
+ 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());
3329
3321
  };
3330
3322
  n.addEventListener("mousedown", h), t.appendChild(n);
3331
3323
  });
3332
3324
  }
3333
3325
  updateStopsList(t) {
3334
- var s;
3335
- const e = t || ((s = this.popoverEl) == null ? void 0 : s.querySelector(".gradient-stops"));
3336
- if (!e || !this.value || this.value.type === "solid" || !this.value.stops)
3337
- return;
3338
- e.innerHTML = "";
3339
- const i = [...this.value.stops].sort(
3340
- (n, o) => n.position - o.position
3341
- );
3342
- i.forEach((n, o) => {
3343
- var G, nt;
3344
- const a = this.value.stops.findIndex(
3345
- (v, b) => v.position === n.position && v.color === n.color && v.opacity === n.opacity && this.value.stops.slice(0, b).filter(
3346
- (x) => x.position === n.position && x.color === n.color && x.opacity === n.opacity
3347
- ).length === i.slice(0, o).filter(
3348
- (x) => x.position === n.position && x.color === n.color && x.opacity === n.opacity
3349
- ).length
3350
- ), l = a !== -1 ? a : o, r = document.createElement("div");
3351
- r.className = "gstop-row";
3326
+ var i;
3327
+ const e = t || ((i = this.popoverEl) == null ? void 0 : i.querySelector(".gradient-stops"));
3328
+ !e || !this.value || this.value.type === "solid" || !this.value.stops || (e.innerHTML = "", this.value.stops.forEach((s, n) => {
3329
+ var I, O;
3330
+ const o = document.createElement("div");
3331
+ o.className = "gstop-row";
3332
+ const a = document.createElement("div");
3333
+ a.className = "gstop-position-group";
3334
+ const l = document.createElement("input");
3335
+ l.type = "text", l.className = "gstop-position-input", l.value = `${s.position}%`, l.style.width = "60px", a.appendChild(l);
3336
+ const r = document.createElement("div");
3337
+ r.className = "gstop-color-container";
3352
3338
  const h = document.createElement("div");
3353
- h.className = "gstop-position-group";
3339
+ h.className = "gstop-color-preview", h.style.backgroundColor = s.color;
3354
3340
  const p = document.createElement("input");
3355
- p.type = "text", p.className = "gstop-position-input", p.value = `${n.position}%`, p.style.width = "60px", h.appendChild(p);
3356
- const d = document.createElement("div");
3357
- d.className = "gstop-color-container";
3358
- const u = document.createElement("div");
3359
- u.className = "gstop-color-preview", u.style.backgroundColor = n.color;
3341
+ p.type = "text", p.className = "gstop-color-input", p.value = s.color.replace("#", "").toUpperCase();
3342
+ const d = document.createElement("button");
3343
+ d.type = "button", d.className = "gstop-color-copy", d.textContent = "Copy", r.appendChild(h), r.appendChild(p), r.appendChild(d);
3344
+ const u = document.createElement("button");
3345
+ u.type = "button", u.className = "gstop-del", u.innerHTML = _t, u.disabled = (((O = (I = this.value) == null ? void 0 : I.stops) == null ? void 0 : O.length) || 0) <= 2, o.appendChild(a), o.appendChild(r), o.appendChild(u), e.appendChild(o);
3346
+ const m = document.createElement("span");
3347
+ m.className = "gstop-opacity-label", m.textContent = "Opacity";
3348
+ const f = document.createElement("div");
3349
+ f.className = "gstop-opacity-group";
3360
3350
  const g = document.createElement("input");
3361
- g.type = "text", g.className = "gstop-color-input", g.value = n.color.replace("#", "").toUpperCase();
3362
- const m = document.createElement("button");
3363
- m.type = "button", m.className = "gstop-color-copy", m.textContent = "Copy", d.appendChild(u), d.appendChild(g), d.appendChild(m);
3364
- const f = document.createElement("button");
3365
- f.type = "button", f.className = "gstop-del", f.innerHTML = Xt, f.disabled = (((nt = (G = this.value) == null ? void 0 : G.stops) == null ? void 0 : nt.length) || 0) <= 2, r.appendChild(h), r.appendChild(d), r.appendChild(f), e.appendChild(r);
3366
- const C = document.createElement("span");
3367
- C.className = "gstop-opacity-label", C.textContent = "Opacity";
3368
- const y = document.createElement("div");
3369
- y.className = "gstop-opacity-group";
3370
- const E = document.createElement("input");
3371
- E.type = "range", E.className = "gstop-opacity-slider", E.min = "0", E.max = "100", E.value = String(n.opacity ?? 100);
3372
- const T = S(n.color);
3373
- E.style.setProperty(
3351
+ g.type = "range", g.className = "gstop-opacity-slider", g.min = "0", g.max = "100", g.value = String(s.opacity ?? 100);
3352
+ const C = k(s.color);
3353
+ g.style.setProperty(
3374
3354
  "--slider-color",
3375
- `rgb(${T.r}, ${T.g}, ${T.b})`
3355
+ `rgb(${C.r}, ${C.g}, ${C.b})`
3376
3356
  );
3377
- const k = document.createElement("span");
3378
- k.className = "gstop-opacity-value", k.textContent = `${n.opacity ?? 100}%`, y.appendChild(E), y.appendChild(k);
3379
- const B = new Zt((v, b) => {
3380
- g.value = v.replace("#", "").toUpperCase(), u.style.backgroundColor = v, this.value.stops[l].color = v, b !== void 0 && (this.value.stops[l].opacity = b, E.value = String(b), k.textContent = `${b}%`);
3381
- const x = S(v);
3382
- E.style.setProperty(
3357
+ const y = document.createElement("span");
3358
+ y.className = "gstop-opacity-value", y.textContent = `${s.opacity ?? 100}%`, f.appendChild(g), f.appendChild(y);
3359
+ const L = new Jt((v, E) => {
3360
+ 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}%`);
3361
+ const x = k(v);
3362
+ g.style.setProperty(
3383
3363
  "--slider-color",
3384
3364
  `rgb(${x.r}, ${x.g}, ${x.b})`
3385
3365
  ), this.updateGradientPreview(), this.createHandles(
@@ -3387,61 +3367,61 @@ const V = class V extends w {
3387
3367
  this.popoverEl.querySelector(".gradient-preview")
3388
3368
  ), this.updateUI(), this.triggerChange();
3389
3369
  }, "solid");
3390
- g.addEventListener("click", (v) => {
3391
- v.preventDefault(), v.stopPropagation(), B.open(n.color, g, n.opacity ?? 100);
3392
- }), g.addEventListener("input", () => {
3393
- const v = g.value.trim(), b = v.startsWith("#") ? v : `#${v}`;
3394
- if (/^#[0-9A-Fa-f]{6}$/.test(b)) {
3395
- this.value.stops[l].color = b, u.style.backgroundColor = b;
3396
- const x = S(b);
3397
- E.style.setProperty(
3370
+ p.addEventListener("click", (v) => {
3371
+ v.preventDefault(), v.stopPropagation(), L.open(s.color, p, s.opacity ?? 100);
3372
+ }), p.addEventListener("input", () => {
3373
+ const v = p.value.trim(), E = v.startsWith("#") ? v : `#${v}`;
3374
+ if (/^#[0-9A-Fa-f]{6}$/.test(E)) {
3375
+ this.value.stops[n].color = E, h.style.backgroundColor = E;
3376
+ const x = k(E);
3377
+ g.style.setProperty(
3398
3378
  "--slider-color",
3399
3379
  `rgb(${x.r}, ${x.g}, ${x.b})`
3400
3380
  ), this.debouncedPreviewUpdate();
3401
3381
  }
3402
- }), g.addEventListener("blur", () => {
3382
+ }), p.addEventListener("blur", () => {
3403
3383
  this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3404
- }), m.addEventListener("click", async (v) => {
3384
+ }), d.addEventListener("click", async (v) => {
3405
3385
  v.stopPropagation();
3406
3386
  try {
3407
- await navigator.clipboard.writeText(`#${g.value}`);
3387
+ await navigator.clipboard.writeText(`#${p.value}`);
3408
3388
  } catch {
3409
3389
  }
3410
- }), p.addEventListener("focus", (v) => {
3411
- const b = v.target;
3412
- b.value = b.value.replace("%", ""), b.select();
3413
- }), p.addEventListener("input", (v) => {
3414
- const b = v.target, x = parseInt(b.value.replace(/[^\d]/g, ""), 10);
3390
+ }), l.addEventListener("focus", (v) => {
3391
+ const E = v.target;
3392
+ E.value = E.value.replace("%", ""), E.select();
3393
+ }), l.addEventListener("input", (v) => {
3394
+ const E = v.target, x = parseInt(E.value.replace(/[^\d]/g, ""), 10);
3415
3395
  if (!Number.isNaN(x)) {
3416
- const z = Math.max(0, Math.min(100, x));
3417
- this.value.stops[l].position = z, b.value = `${z}%`, this.debouncedPreviewUpdate();
3396
+ const U = Math.max(0, Math.min(100, x));
3397
+ this.value.stops[n].position = U, E.value = `${U}%`, this.debouncedPreviewUpdate();
3418
3398
  }
3419
- }), p.addEventListener("blur", (v) => {
3399
+ }), l.addEventListener("blur", (v) => {
3420
3400
  this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null);
3421
- const b = v.target, x = parseInt(b.value.replace(/[^\d]/g, ""), 10);
3401
+ const E = v.target, x = parseInt(E.value.replace(/[^\d]/g, ""), 10);
3422
3402
  if (Number.isNaN(x))
3423
- b.value = `${this.value.stops[l].position}%`;
3403
+ E.value = `${this.value.stops[n].position}%`;
3424
3404
  else {
3425
- const z = Math.max(0, Math.min(100, x));
3426
- this.value.stops[l].position = z, b.value = `${z}%`;
3405
+ const U = Math.max(0, Math.min(100, x));
3406
+ this.value.stops[n].position = U, E.value = `${U}%`;
3427
3407
  }
3428
3408
  this.updateGradientPreview(), this.createHandles(
3429
3409
  this.popoverEl.querySelector(".gradient-handles"),
3430
3410
  this.popoverEl.querySelector(".gradient-preview")
3431
3411
  ), this.updateStopsList(), this.updateUI(), this.triggerChange();
3432
- }), f.addEventListener("click", () => {
3412
+ }), u.addEventListener("click", () => {
3433
3413
  var v;
3434
- (this.value.stops.length || 0) <= 2 || (this.value.stops.splice(l, 1), this.createHandles(
3414
+ (this.value.stops.length || 0) <= 2 || (this.value.stops.splice(n, 1), this.createHandles(
3435
3415
  this.popoverEl.querySelector(".gradient-handles"),
3436
3416
  this.popoverEl.querySelector(".gradient-preview")
3437
3417
  ), this.updateStopsList(), this.updateGradientPreview(), this.updateUI(), ((v = document.activeElement) == null ? void 0 : v.tagName) !== "INPUT" && this.repositionPopover(), this.triggerChange());
3438
- }), E.addEventListener("input", () => {
3439
- const v = parseInt(E.value, 10);
3440
- this.value.stops[l].opacity = Math.max(0, Math.min(100, v)), k.textContent = `${this.value.stops[l].opacity}%`, this.debouncedPreviewUpdate();
3441
- }), E.addEventListener("change", () => {
3418
+ }), g.addEventListener("input", () => {
3419
+ const v = parseInt(g.value, 10);
3420
+ this.value.stops[n].opacity = Math.max(0, Math.min(100, v)), y.textContent = `${this.value.stops[n].opacity}%`, this.debouncedPreviewUpdate();
3421
+ }), g.addEventListener("change", () => {
3442
3422
  this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), this.updateGradientPreview(), this.updateUI(), this.triggerChange();
3443
3423
  });
3444
- });
3424
+ }));
3445
3425
  }
3446
3426
  addStop() {
3447
3427
  if (!this.value || this.value.type === "solid" || !this.value.stops) return;
@@ -3493,8 +3473,8 @@ const V = class V extends w {
3493
3473
  let l = e.right + 8, r = e.top;
3494
3474
  const h = s - e.right, p = e.left, d = i + o;
3495
3475
  h < d && p > h + 100 && (l = e.left - i - 8);
3496
- const u = n - e.bottom, g = e.top;
3497
- g >= a + o ? r = e.top - a - 8 : u >= a + o ? r = e.bottom + 8 : g > 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`;
3476
+ const u = n - e.bottom, m = e.top;
3477
+ 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`;
3498
3478
  });
3499
3479
  }
3500
3480
  }
@@ -3509,16 +3489,17 @@ const V = class V extends w {
3509
3489
  s && this.updatePopoverContent(s);
3510
3490
  }
3511
3491
  closePopover() {
3492
+ var t;
3512
3493
  if (!(!this.popoverEl || !this.isPopoverOpen)) {
3513
3494
  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") {
3514
- const t = N(this.value);
3515
- A.addColor(t, "gradient");
3495
+ const e = N(this.value);
3496
+ B.addColor(e, "gradient"), (t = this.recentGradientRefresh) == null || t.call(this);
3516
3497
  }
3517
3498
  this.previewUpdateTimeout && (clearTimeout(this.previewUpdateTimeout), this.previewUpdateTimeout = null), V.openInstance === this && (V.openInstance = null);
3518
3499
  }
3519
3500
  }
3520
3501
  commitPendingSolidColor() {
3521
- this.pendingSolidColor && (this.solidPicker ? this.solidPicker.commitRecentColor() : A.addColor(this.pendingSolidColor, "solid"), this.pendingSolidColor = null);
3502
+ this.pendingSolidColor && (this.solidPicker ? this.solidPicker.commitRecentColor() : B.addColor(this.pendingSolidColor, "solid"), this.pendingSolidColor = null);
3522
3503
  }
3523
3504
  handlePaste(t) {
3524
3505
  var i;
@@ -3531,7 +3512,7 @@ const V = class V extends w {
3531
3512
  this.parseAndSet(e.value);
3532
3513
  }
3533
3514
  parseAndSet(t) {
3534
- const e = O(t.trim());
3515
+ const e = P(t.trim());
3535
3516
  e && this.setValue(e);
3536
3517
  }
3537
3518
  triggerChange() {
@@ -3555,35 +3536,35 @@ const V = class V extends w {
3555
3536
  }
3556
3537
  };
3557
3538
  V.openInstance = null;
3558
- let K = V;
3559
- const Yt = `
3539
+ let Z = V;
3540
+ const Zt = `
3560
3541
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3561
3542
  <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"/>
3562
3543
  </svg>
3563
- `, Qt = `
3544
+ `, Kt = `
3564
3545
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3565
3546
  <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"/>
3566
3547
  </svg>
3567
3548
  `;
3568
- class be extends P {
3549
+ class ye extends T {
3569
3550
  constructor(t) {
3570
3551
  super({
3571
3552
  title: "Border",
3572
3553
  collapsed: t == null ? void 0 : t.collapsed,
3573
3554
  settings: {
3574
- size: new I({
3555
+ size: new S({
3575
3556
  title: "Size",
3576
- icon: Qt,
3557
+ icon: Kt,
3577
3558
  default: (t == null ? void 0 : t.size) ?? 0,
3578
3559
  suffix: "px"
3579
3560
  }),
3580
- color: new K({
3561
+ color: new Z({
3581
3562
  title: "Border Color",
3582
3563
  default: (t == null ? void 0 : t.color) || "#000000"
3583
3564
  }),
3584
- radius: new I({
3565
+ radius: new S({
3585
3566
  title: "Radius",
3586
- icon: Yt,
3567
+ icon: Zt,
3587
3568
  default: (t == null ? void 0 : t.radius) ?? 12,
3588
3569
  suffix: "px"
3589
3570
  })
@@ -3607,20 +3588,20 @@ class be extends P {
3607
3588
  `;
3608
3589
  }
3609
3590
  }
3610
- const te = `
3591
+ const Yt = `
3611
3592
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
3612
3593
  <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"/>
3613
3594
  </svg>
3614
- `, ee = `
3595
+ `, Qt = `
3615
3596
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3616
3597
  <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"/>
3617
3598
  </svg>
3618
- `, ie = `
3599
+ `, te = `
3619
3600
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3620
3601
  <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"/>
3621
3602
  </svg>
3622
3603
  `;
3623
- class we extends P {
3604
+ class Ee extends T {
3624
3605
  constructor(t = {}) {
3625
3606
  const { showAlign: e = t.showAlign ?? !0, ...i } = t;
3626
3607
  super({
@@ -3628,13 +3609,13 @@ class we extends P {
3628
3609
  collapsed: i.collapsed,
3629
3610
  settings: (() => {
3630
3611
  const s = {
3631
- color: new K({
3612
+ color: new Z({
3632
3613
  title: "Color",
3633
3614
  default: i.colorDefault ?? "#001E1E"
3634
3615
  }),
3635
- fontFamily: new it({
3616
+ fontFamily: new tt({
3636
3617
  title: "Font",
3637
- icon: te,
3618
+ icon: Yt,
3638
3619
  default: i.fontFamilyDefault ?? "Satoshi",
3639
3620
  options: i.fontFamilyOptions ?? [
3640
3621
  { name: "Alt", value: "Croco Sans Black Caps Alt" },
@@ -3645,9 +3626,9 @@ class we extends P {
3645
3626
  getOptions: i.fontFamilyGetOptions,
3646
3627
  getOptionsAsync: i.fontFamilyGetOptionsAsync
3647
3628
  }),
3648
- fontWeight: new it({
3629
+ fontWeight: new tt({
3649
3630
  title: "Weight",
3650
- icon: ee,
3631
+ icon: Qt,
3651
3632
  default: i.fontWeightDefault ?? "400",
3652
3633
  options: i.fontWeightOptions ?? [
3653
3634
  { name: "Regular", value: "400" },
@@ -3657,9 +3638,9 @@ class we extends P {
3657
3638
  getOptions: i.fontWeightGetOptions,
3658
3639
  getOptionsAsync: i.fontWeightGetOptionsAsync
3659
3640
  }),
3660
- fontSize: new I({
3641
+ fontSize: new S({
3661
3642
  title: "Size",
3662
- icon: ie,
3643
+ icon: te,
3663
3644
  default: i.fontSizeDefault ?? 12,
3664
3645
  suffix: "px",
3665
3646
  mobile: i.fontSizeMobileDefault
@@ -3667,7 +3648,7 @@ class we extends P {
3667
3648
  };
3668
3649
  return e ? {
3669
3650
  ...s,
3670
- align: new Vt({
3651
+ align: new St({
3671
3652
  title: "Align",
3672
3653
  default: i.alignDefault ?? "center"
3673
3654
  })
@@ -3699,7 +3680,7 @@ class we extends P {
3699
3680
  `;
3700
3681
  }
3701
3682
  }
3702
- class _ extends w {
3683
+ class j extends b {
3703
3684
  constructor(t) {
3704
3685
  super({
3705
3686
  ...t,
@@ -3745,33 +3726,33 @@ class _ extends w {
3745
3726
  }), i;
3746
3727
  }
3747
3728
  }
3748
- class xe extends P {
3729
+ class be extends T {
3749
3730
  constructor(t) {
3750
3731
  super({
3751
3732
  title: "Margins",
3752
3733
  collapsed: t == null ? void 0 : t.collapsed,
3753
3734
  settings: {
3754
- marginTop: new _({
3735
+ marginTop: new j({
3755
3736
  title: "Top",
3756
- icon: se,
3737
+ icon: ee,
3757
3738
  suffix: "px",
3758
3739
  default: (t == null ? void 0 : t.marginTop) ?? "auto"
3759
3740
  }),
3760
- marginRight: new _({
3741
+ marginRight: new j({
3761
3742
  title: "Right",
3762
- icon: ne,
3743
+ icon: ie,
3763
3744
  suffix: "px",
3764
3745
  default: (t == null ? void 0 : t.marginRight) ?? 0
3765
3746
  }),
3766
- marginBottom: new _({
3747
+ marginBottom: new j({
3767
3748
  title: "Bottom",
3768
- icon: oe,
3749
+ icon: se,
3769
3750
  suffix: "px",
3770
3751
  default: (t == null ? void 0 : t.marginBottom) ?? 0
3771
3752
  }),
3772
- marginLeft: new _({
3753
+ marginLeft: new j({
3773
3754
  title: "Left",
3774
- icon: ae,
3755
+ icon: ne,
3775
3756
  suffix: "px",
3776
3757
  default: (t == null ? void 0 : t.marginLeft) ?? 0
3777
3758
  })
@@ -3788,26 +3769,26 @@ class xe extends P {
3788
3769
  `;
3789
3770
  }
3790
3771
  }
3791
- const se = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3772
+ const ee = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3792
3773
  <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"/>
3793
- </svg>`, ne = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3774
+ </svg>`, ie = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3794
3775
  <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"/>
3795
- </svg>`, oe = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3776
+ </svg>`, se = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3796
3777
  <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"/>
3797
- </svg>`, ae = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3778
+ </svg>`, ne = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
3798
3779
  <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"/>
3799
3780
  </svg>`;
3800
- class Le extends P {
3781
+ class we extends T {
3801
3782
  constructor(t) {
3802
3783
  super({
3803
3784
  title: "Background Image",
3804
3785
  collapsed: t == null ? void 0 : t.collapsed,
3805
3786
  settings: {
3806
- backgroundImage: new pt({
3787
+ backgroundImage: new rt({
3807
3788
  ...t == null ? void 0 : t.uploadProps,
3808
3789
  default: (t == null ? void 0 : t.backgroundImage) ?? ""
3809
3790
  }),
3810
- opacity: new It({
3791
+ opacity: new kt({
3811
3792
  default: (t == null ? void 0 : t.opacity) ?? 100
3812
3793
  }),
3813
3794
  backgroundColor: new R({
@@ -3837,40 +3818,40 @@ class Le extends P {
3837
3818
  }
3838
3819
  }
3839
3820
  export {
3840
- Vt as AlignSetting,
3841
- Ee as AnimationSetting,
3842
- Le as BackgroundSettingSet,
3843
- be as BorderSettingSet,
3844
- he as ButtonSetting,
3821
+ St as AlignSetting,
3822
+ Ce as AnimationSetting,
3823
+ we as BackgroundSettingSet,
3824
+ ye as BorderSettingSet,
3825
+ re as ButtonSetting,
3845
3826
  M as ColorSetting,
3846
3827
  R as ColorWithOpacitySetting,
3847
- pe as DimensionSetting,
3848
- fe as GapSetting,
3849
- K as GradientSetting,
3850
- we as HeaderTypographySettingSet,
3851
- de as HeightSetting,
3852
- ce as HtmlSetting,
3853
- ve as MarginBottomSetting,
3854
- xe as MarginSettingGroup,
3855
- Ce as MarginTopSetting,
3856
- ye as MultiLanguageSetting,
3857
- I as NumberSetting,
3858
- It as OpacitySetting,
3859
- ge as SelectApiSettings,
3860
- it as SelectSetting,
3861
- w as Setting,
3862
- P as SettingGroup,
3863
- Lt as StringSetting,
3864
- wt as TabSettingGroup,
3865
- wt as TabsSettingGroup,
3866
- me as Toggle,
3867
- pt as UploadSetting,
3868
- ue as WidthSetting,
3869
- re as asSettingGroupWithSettings,
3870
- xt as createSettingGroup,
3871
- le as createTabSettingGroup,
3828
+ ce as DimensionSetting,
3829
+ ge as GapSetting,
3830
+ Z as GradientSetting,
3831
+ Ee as HeaderTypographySettingSet,
3832
+ he as HeightSetting,
3833
+ le as HtmlSetting,
3834
+ me as MarginBottomSetting,
3835
+ be as MarginSettingGroup,
3836
+ fe as MarginTopSetting,
3837
+ ve as MultiLanguageSetting,
3838
+ S as NumberSetting,
3839
+ kt as OpacitySetting,
3840
+ de as SelectApiSettings,
3841
+ tt as SelectSetting,
3842
+ b as Setting,
3843
+ T as SettingGroup,
3844
+ bt as StringSetting,
3845
+ yt as TabSettingGroup,
3846
+ yt as TabsSettingGroup,
3847
+ ue as Toggle,
3848
+ rt as UploadSetting,
3849
+ pe as WidthSetting,
3850
+ ae as asSettingGroupWithSettings,
3851
+ Et as createSettingGroup,
3852
+ oe as createTabSettingGroup,
3872
3853
  D as isSetting,
3873
- at as isSettingChild,
3874
- L as isSettingGroup,
3875
- j as iterateSettings
3854
+ st as isSettingChild,
3855
+ w as isSettingGroup,
3856
+ W as iterateSettings
3876
3857
  };