@symbo.ls/uikit 2.11.91 → 2.11.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -383,10 +383,10 @@ var require_cjs = __commonJS({
383
383
  isFunction: () => isFunction22,
384
384
  isNot: () => isNot4,
385
385
  isNull: () => isNull,
386
- isNumber: () => isNumber,
386
+ isNumber: () => isNumber2,
387
387
  isObject: () => isObject7,
388
388
  isObjectLike: () => isObjectLike32,
389
- isString: () => isString8,
389
+ isString: () => isString9,
390
390
  isUndefined: () => isUndefined,
391
391
  isValidHtmlTag: () => isValidHtmlTag
392
392
  });
@@ -399,8 +399,8 @@ var require_cjs = __commonJS({
399
399
  return false;
400
400
  return typeof arg === "object" && arg.constructor === Object;
401
401
  };
402
- var isString8 = (arg) => typeof arg === "string";
403
- var isNumber = (arg) => typeof arg === "number";
402
+ var isString9 = (arg) => typeof arg === "string";
403
+ var isNumber2 = (arg) => typeof arg === "number";
404
404
  var isFunction22 = (arg) => typeof arg === "function";
405
405
  var isBoolean = (arg) => arg === true || arg === false;
406
406
  var isNull = (arg) => arg === null;
@@ -411,7 +411,7 @@ var require_cjs = __commonJS({
411
411
  return typeof arg === "object";
412
412
  };
413
413
  var isDefined2 = (arg) => {
414
- return isObject7(arg) || isObjectLike32(arg) || isString8(arg) || isNumber(arg) || isFunction22(arg) || isArray62(arg) || isObjectLike32(arg) || isBoolean(arg) || isNull(arg);
414
+ return isObject7(arg) || isObjectLike32(arg) || isString9(arg) || isNumber2(arg) || isFunction22(arg) || isArray62(arg) || isObjectLike32(arg) || isBoolean(arg) || isNull(arg);
415
415
  };
416
416
  var isUndefined = (arg) => {
417
417
  return arg === void 0;
@@ -420,8 +420,8 @@ var require_cjs = __commonJS({
420
420
  boolean: isBoolean,
421
421
  array: isArray62,
422
422
  object: isObject7,
423
- string: isString8,
424
- number: isNumber,
423
+ string: isString9,
424
+ number: isNumber2,
425
425
  null: isNull,
426
426
  function: isFunction22,
427
427
  objectLike: isObjectLike32,
@@ -1157,6 +1157,7 @@ var require_cjs = __commonJS({
1157
1157
  getFontSizeByKey: () => getFontSizeByKey4,
1158
1158
  getMediaColor: () => getMediaColor7,
1159
1159
  getMediaTheme: () => getMediaTheme4,
1160
+ getRgbTone: () => getRgbTone,
1160
1161
  getSequenceValue: () => getSequenceValue,
1161
1162
  getSequenceValuePropertyPair: () => getSequenceValuePropertyPair,
1162
1163
  getSpacingBasedOnRatio: () => getSpacingBasedOnRatio10,
@@ -1224,6 +1225,7 @@ var require_cjs = __commonJS({
1224
1225
  getFontFaceEachString: () => getFontFaceEachString,
1225
1226
  getFontFaceString: () => getFontFaceString,
1226
1227
  getFontFormat: () => getFontFormat,
1228
+ getRgbTone: () => getRgbTone,
1227
1229
  getSequenceValue: () => getSequenceValue,
1228
1230
  getSequenceValuePropertyPair: () => getSequenceValuePropertyPair,
1229
1231
  hexToRgb: () => hexToRgb,
@@ -1245,6 +1247,7 @@ var require_cjs = __commonJS({
1245
1247
  setVariables: () => setVariables
1246
1248
  });
1247
1249
  var import_globals = __toESM2(require_cjs11(), 1);
1250
+ var import_utils16 = __toESM2(require_cjs42(), 1);
1248
1251
  var ENV = "development";
1249
1252
  var colorStringToRgbaArray = (color) => {
1250
1253
  if (color === "")
@@ -1297,7 +1300,7 @@ var require_cjs = __commonJS({
1297
1300
  return [r, g, b];
1298
1301
  };
1299
1302
  var rgbToHex = (r, g, b) => {
1300
- return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
1303
+ return "#" + (1 << 24 | r << 16 | g << 8 | b).toString(16).slice(1);
1301
1304
  };
1302
1305
  var rgbArrayToHex = ([r, g, b]) => {
1303
1306
  return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
@@ -1349,7 +1352,7 @@ var require_cjs = __commonJS({
1349
1352
  g = 255;
1350
1353
  else if (g < 0)
1351
1354
  g = 0;
1352
- return (g | b << 8 | r << 16).toString(16);
1355
+ return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
1353
1356
  };
1354
1357
  var mixTwoRgba = (colorA, colorB, range = 0.5) => {
1355
1358
  const arr = [];
@@ -1371,6 +1374,24 @@ var require_cjs = __commonJS({
1371
1374
  arr[3] = opacity;
1372
1375
  return `rgba(${arr})`;
1373
1376
  };
1377
+ var getRgbTone = (rgb, tone) => {
1378
+ if ((0, import_utils16.isString)(rgb))
1379
+ rgb = rgb.split(", ").map((v) => parseFloat(v));
1380
+ if ((0, import_utils16.isNumber)(tone))
1381
+ tone += "";
1382
+ const toHex = rgbArrayToHex(rgb);
1383
+ const abs2 = tone.slice(0, 1);
1384
+ if (abs2 === "-" || abs2 === "+") {
1385
+ const colorShade = getColorShade(toHex, parseFloat(tone));
1386
+ return hexToRgbArray(colorShade).join(", ");
1387
+ } else {
1388
+ const [r, g, b] = rgb;
1389
+ const hsl = rgbToHSL(r, g, b);
1390
+ const [h, s, l] = hsl;
1391
+ const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
1392
+ return newRgb;
1393
+ }
1394
+ };
1374
1395
  var returnSubThemeOrDefault = (orig, theme) => {
1375
1396
  if (!orig)
1376
1397
  return;
@@ -1419,9 +1440,9 @@ var require_cjs = __commonJS({
1419
1440
  const keys = Object.keys(LIBRARY);
1420
1441
  return keys.map((key) => getFontFaceEachString(key, LIBRARY[key].value));
1421
1442
  };
1422
- var import_utils42 = __toESM2(require_cjs42(), 1);
1443
+ var import_utils52 = __toESM2(require_cjs42(), 1);
1444
+ var import_utils32 = __toESM2(require_cjs42());
1423
1445
  var import_utils22 = __toESM2(require_cjs42());
1424
- var import_utils16 = __toESM2(require_cjs42());
1425
1446
  var toCamelCase = (str) => {
1426
1447
  return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
1427
1448
  return index === 0 ? word.toLowerCase() : word.toUpperCase();
@@ -1429,14 +1450,14 @@ var require_cjs = __commonJS({
1429
1450
  };
1430
1451
  var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
1431
1452
  var arrayzeValue = (val) => {
1432
- if ((0, import_utils22.isString)(val))
1453
+ if ((0, import_utils32.isString)(val))
1433
1454
  return val.split(" ");
1434
- if ((0, import_utils22.isObject)(val))
1455
+ if ((0, import_utils32.isObject)(val))
1435
1456
  return Object.keys(val).map((v) => val[v]);
1436
- if ((0, import_utils22.isArray)(val))
1457
+ if ((0, import_utils32.isArray)(val))
1437
1458
  return val;
1438
1459
  };
1439
- var import_utils32 = __toESM2(require_cjs42(), 1);
1460
+ var import_utils42 = __toESM2(require_cjs42(), 1);
1440
1461
  var defaultConfig_exports = {};
1441
1462
  __export2(defaultConfig_exports, {
1442
1463
  ANIMATION: () => ANIMATION,
@@ -1607,13 +1628,13 @@ var require_cjs = __commonJS({
1607
1628
  CSS_VARS,
1608
1629
  ...defaultConfig_exports
1609
1630
  };
1610
- var cachedConfig = (0, import_utils32.deepClone)(CONFIG4);
1631
+ var cachedConfig = (0, import_utils42.deepClone)(CONFIG4);
1611
1632
  var FACTORY = {
1612
1633
  active: "0",
1613
1634
  0: CONFIG4
1614
1635
  };
1615
1636
  var activateConfig = (def) => {
1616
- if ((0, import_utils32.isDefined)(def)) {
1637
+ if ((0, import_utils42.isDefined)(def)) {
1617
1638
  FACTORY.active = def;
1618
1639
  }
1619
1640
  return FACTORY[def || FACTORY.active];
@@ -1622,10 +1643,10 @@ var require_cjs = __commonJS({
1622
1643
  return FACTORY[def || FACTORY.active];
1623
1644
  };
1624
1645
  var setActiveConfig = (newConfig) => {
1625
- if (!(0, import_utils32.isObject)(newConfig))
1646
+ if (!(0, import_utils42.isObject)(newConfig))
1626
1647
  return;
1627
1648
  FACTORY.active = "1";
1628
- FACTORY["1"] = (0, import_utils32.deepMerge)(newConfig, (0, import_utils32.deepClone)(cachedConfig));
1649
+ FACTORY["1"] = (0, import_utils42.deepMerge)(newConfig, (0, import_utils42.deepClone)(cachedConfig));
1629
1650
  return newConfig;
1630
1651
  };
1631
1652
  var numToLetterMap = {
@@ -1734,7 +1755,7 @@ var require_cjs = __commonJS({
1734
1755
  unit = UNIT2.default,
1735
1756
  useVariable
1736
1757
  } = sequenceProps;
1737
- if ((0, import_utils42.isString)(value) && value.slice(0, 2) === "--")
1758
+ if ((0, import_utils52.isString)(value) && value.slice(0, 2) === "--")
1738
1759
  return `var(${value})`;
1739
1760
  const prefix2 = `--${toDashCase(sequenceProps.type.replace(".", "-"))}-`;
1740
1761
  const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
@@ -1795,11 +1816,11 @@ var require_cjs = __commonJS({
1795
1816
  return sequence[findLetter];
1796
1817
  });
1797
1818
  };
1798
- var import_utils62 = __toESM2(require_cjs42(), 1);
1819
+ var import_utils72 = __toESM2(require_cjs42(), 1);
1799
1820
  var setVariables = (result, key) => {
1800
1821
  const CONFIG22 = getActiveConfig4();
1801
1822
  const { CSS_VARS: CSS_VARS2 } = CONFIG22;
1802
- if ((0, import_utils62.isObjectLike)(result.value)) {
1823
+ if ((0, import_utils72.isObjectLike)(result.value)) {
1803
1824
  } else {
1804
1825
  CSS_VARS2[result.var] = result.value;
1805
1826
  }
@@ -1833,7 +1854,7 @@ var require_cjs = __commonJS({
1833
1854
  }
1834
1855
  }
1835
1856
  };
1836
- var import_utils72 = __toESM2(require_cjs42(), 1);
1857
+ var import_utils82 = __toESM2(require_cjs42(), 1);
1837
1858
  var generateSprite = (icons) => {
1838
1859
  const CONFIG22 = getActiveConfig4();
1839
1860
  let sprite = "";
@@ -1847,7 +1868,7 @@ var require_cjs = __commonJS({
1847
1868
  return sprite;
1848
1869
  };
1849
1870
  var parseRootAttributes = (htmlString) => {
1850
- if (!(0, import_utils72.isString)(htmlString)) {
1871
+ if (!(0, import_utils82.isString)(htmlString)) {
1851
1872
  return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
1852
1873
  }
1853
1874
  const match2 = htmlString.match(/<svg\s+(.*?)>/);
@@ -1867,7 +1888,7 @@ var require_cjs = __commonJS({
1867
1888
  const urlRegex = /url\(#([^)]*)\)/g;
1868
1889
  const matches = code.match(/id="([^"]*)"/g);
1869
1890
  let replacedCode = code;
1870
- if ((0, import_utils72.isArray)(matches)) {
1891
+ if ((0, import_utils82.isArray)(matches)) {
1871
1892
  matches.forEach(() => {
1872
1893
  const randomKey = Math.floor(Math.random() * 1e5);
1873
1894
  replacedCode = code.replace(idRegex, `id="${key}-${randomKey}"`).replace(urlRegex, `url(#${key}-${randomKey})`);
@@ -1920,10 +1941,10 @@ var require_cjs = __commonJS({
1920
1941
  setSVG: () => setSVG,
1921
1942
  setTheme: () => setTheme
1922
1943
  });
1923
- var import_utils82 = __toESM2(require_cjs42(), 1);
1944
+ var import_utils92 = __toESM2(require_cjs42(), 1);
1924
1945
  var getColor4 = (value, key, config) => {
1925
1946
  const CONFIG22 = config || getActiveConfig4();
1926
- if (!(0, import_utils82.isString)(value)) {
1947
+ if (!(0, import_utils92.isString)(value)) {
1927
1948
  if (CONFIG22.verbose)
1928
1949
  console.warn(value, "- type for color is not valid");
1929
1950
  return;
@@ -1932,7 +1953,7 @@ var require_cjs = __commonJS({
1932
1953
  return `var(${value})`;
1933
1954
  if (key && value[key])
1934
1955
  value = value[key];
1935
- const [name, alpha, tone] = (0, import_utils82.isArray)(value) ? value : value.split(" ");
1956
+ const [name, alpha, tone] = (0, import_utils92.isArray)(value) ? value : value.split(" ");
1936
1957
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG22;
1937
1958
  let val = COLOR2[name] || GRADIENT2[name];
1938
1959
  if (!val) {
@@ -1947,22 +1968,11 @@ var require_cjs = __commonJS({
1947
1968
  console.warn(value, " - does not have ", key);
1948
1969
  }
1949
1970
  let rgb = val.rgb;
1950
- if (!rgb)
1971
+ if (!rgb) {
1951
1972
  return CONFIG22.useVariable ? `var(${val.var})` : val.value;
1973
+ }
1952
1974
  if (tone && !val[tone]) {
1953
- const toHex = rgbArrayToHex(rgb.split(", ").map((v) => parseFloat(v)));
1954
- const abs2 = tone.slice(0, 1);
1955
- if (abs2 === "-" || abs2 === "+") {
1956
- rgb = hexToRgbArray(
1957
- getColorShade(toHex, parseFloat(tone))
1958
- ).join(", ");
1959
- } else {
1960
- const [r, g, b] = [...rgb.split(", ").map((v) => parseInt(v))];
1961
- const hsl = rgbToHSL(r, g, b);
1962
- const [h, s, l] = hsl;
1963
- const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
1964
- rgb = newRgb;
1965
- }
1975
+ rgb = getRgbTone(rgb, tone);
1966
1976
  val[tone] = { rgb, var: `${val.var}-${tone}` };
1967
1977
  }
1968
1978
  if (val[tone])
@@ -1975,17 +1985,17 @@ var require_cjs = __commonJS({
1975
1985
  const CONFIG22 = config || getActiveConfig4();
1976
1986
  if (!globalTheme)
1977
1987
  globalTheme = CONFIG22.globalTheme;
1978
- if (!(0, import_utils82.isString)(value)) {
1988
+ if (!(0, import_utils92.isString)(value)) {
1979
1989
  if (CONFIG22.verbose)
1980
1990
  console.warn(value, "- type for color is not valid");
1981
1991
  return;
1982
1992
  }
1983
1993
  if (value.slice(0, 2) === "--")
1984
1994
  return `var(${value})`;
1985
- const [name] = (0, import_utils82.isArray)(value) ? value : value.split(" ");
1995
+ const [name] = (0, import_utils92.isArray)(value) ? value : value.split(" ");
1986
1996
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG22;
1987
1997
  const val = COLOR2[name] || GRADIENT2[name];
1988
- const isObj = (0, import_utils82.isObject)(val);
1998
+ const isObj = (0, import_utils92.isObject)(val);
1989
1999
  if (isObj && val.value)
1990
2000
  return getColor4(value, `@${globalTheme}`, config);
1991
2001
  else if (isObj) {
@@ -2008,15 +2018,15 @@ var require_cjs = __commonJS({
2008
2018
  };
2009
2019
  var setColor = (val, key, suffix) => {
2010
2020
  const CONFIG22 = getActiveConfig4();
2011
- if ((0, import_utils82.isString)(val) && val.slice(0, 2) === "--")
2021
+ if ((0, import_utils92.isString)(val) && val.slice(0, 2) === "--")
2012
2022
  val = getColor4(val.slice(2));
2013
- if ((0, import_utils82.isArray)(val)) {
2023
+ if ((0, import_utils92.isArray)(val)) {
2014
2024
  return {
2015
2025
  "@light": setColor(val[0], key, "light"),
2016
2026
  "@dark": setColor(val[1], key, "dark")
2017
2027
  };
2018
2028
  }
2019
- if ((0, import_utils82.isObject)(val)) {
2029
+ if ((0, import_utils92.isObject)(val)) {
2020
2030
  const obj = {};
2021
2031
  for (const variant in val)
2022
2032
  obj[variant] = setColor(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
@@ -2039,15 +2049,15 @@ var require_cjs = __commonJS({
2039
2049
  };
2040
2050
  var setGradient = (val, key, suffix) => {
2041
2051
  const CONFIG22 = getActiveConfig4();
2042
- if ((0, import_utils82.isString)(val) && val.slice(0, 2) === "--")
2052
+ if ((0, import_utils92.isString)(val) && val.slice(0, 2) === "--")
2043
2053
  val = getColor4(val.slice(2));
2044
- if ((0, import_utils82.isArray)(val)) {
2054
+ if ((0, import_utils92.isArray)(val)) {
2045
2055
  return {
2046
2056
  "@light": setGradient(val[0], key, "light"),
2047
2057
  "@dark": setGradient(val[0], key, "dark")
2048
2058
  };
2049
2059
  }
2050
- if ((0, import_utils82.isObject)(val)) {
2060
+ if ((0, import_utils92.isObject)(val)) {
2051
2061
  const obj = {};
2052
2062
  for (const variant in val)
2053
2063
  obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
@@ -2062,7 +2072,7 @@ var require_cjs = __commonJS({
2062
2072
  value: val.value || val
2063
2073
  };
2064
2074
  };
2065
- var import_utils102 = __toESM2(require_cjs42(), 1);
2075
+ var import_utils112 = __toESM2(require_cjs42(), 1);
2066
2076
  var setThemeValue = (theme) => {
2067
2077
  const value = {};
2068
2078
  const { state, media, helpers, ...rest } = theme;
@@ -2085,7 +2095,7 @@ var require_cjs = __commonJS({
2085
2095
  if (CONFIG22.useVariable)
2086
2096
  return getMediaTheme4(value, modifier);
2087
2097
  const { THEME: THEME2 } = CONFIG22;
2088
- if ((0, import_utils102.isString)(value)) {
2098
+ if ((0, import_utils112.isString)(value)) {
2089
2099
  const [theme, subtheme] = value.split(" ");
2090
2100
  const isOurTheme = THEME2[theme];
2091
2101
  if (isOurTheme) {
@@ -2094,7 +2104,7 @@ var require_cjs = __commonJS({
2094
2104
  value = [theme, subtheme || modifier];
2095
2105
  }
2096
2106
  }
2097
- if ((0, import_utils102.isObjectLike)(value) && value[1]) {
2107
+ if ((0, import_utils112.isObjectLike)(value) && value[1]) {
2098
2108
  const themeName = value[0];
2099
2109
  const subThemeName = value[1];
2100
2110
  const { helpers, media, state } = THEME2[themeName];
@@ -2104,11 +2114,11 @@ var require_cjs = __commonJS({
2104
2114
  return getThemeValue(helpers[subThemeName]);
2105
2115
  if (state && state[subThemeName])
2106
2116
  return getThemeValue(state[subThemeName]);
2107
- } else if ((0, import_utils102.isObject)(value))
2117
+ } else if ((0, import_utils112.isObject)(value))
2108
2118
  return setThemeValue(value);
2109
2119
  };
2110
2120
  var setInverseTheme = (theme, variant, value) => {
2111
- if ((0, import_utils102.isObject)(variant)) {
2121
+ if ((0, import_utils112.isObject)(variant)) {
2112
2122
  theme.variants.inverse.value = setThemeValue(variant);
2113
2123
  } else if (variant === true) {
2114
2124
  const { color, background } = value;
@@ -2123,7 +2133,7 @@ var require_cjs = __commonJS({
2123
2133
  var setPseudo = (theme, key, variant, themeValue) => {
2124
2134
  const result = getTheme4(variant);
2125
2135
  themeValue[`&:${key}`] = result;
2126
- if ((0, import_utils102.isObject)(variant) && !variant.value)
2136
+ if ((0, import_utils112.isObject)(variant) && !variant.value)
2127
2137
  variant.value = result;
2128
2138
  };
2129
2139
  var setSelectors = (theme, value) => {
@@ -2141,7 +2151,7 @@ var require_cjs = __commonJS({
2141
2151
  var setPrefersScheme = (theme, key, variant, themeValue) => {
2142
2152
  const result = getTheme4(variant);
2143
2153
  themeValue[`@media (prefers-color-scheme: ${key})`] = result;
2144
- if ((0, import_utils102.isObject)(variant) && !variant.value)
2154
+ if ((0, import_utils112.isObject)(variant) && !variant.value)
2145
2155
  variant.value = result;
2146
2156
  };
2147
2157
  var setMedia = (theme, value) => {
@@ -2167,7 +2177,7 @@ var require_cjs = __commonJS({
2167
2177
  const keys = Object.keys(helpers);
2168
2178
  keys.map((key) => {
2169
2179
  const helper = helpers[key];
2170
- if ((0, import_utils102.isString)(helper))
2180
+ if ((0, import_utils112.isString)(helper))
2171
2181
  helpers[key] = CONFIG22.THEME[helper];
2172
2182
  else
2173
2183
  getThemeValue(helpers[key]);
@@ -2191,7 +2201,7 @@ var require_cjs = __commonJS({
2191
2201
  const CONFIG22 = getActiveConfig4();
2192
2202
  const { CSS_VARS: CSS_VARS2 } = CONFIG22;
2193
2203
  const theme = { value: val };
2194
- if ((0, import_utils102.isObjectLike)(val)) {
2204
+ if ((0, import_utils112.isObjectLike)(val)) {
2195
2205
  for (const param in val) {
2196
2206
  const symb = param.slice(0, 1);
2197
2207
  const value = val[param];
@@ -2219,7 +2229,7 @@ var require_cjs = __commonJS({
2219
2229
  };
2220
2230
  }
2221
2231
  }
2222
- if ((0, import_utils102.isString)(val) && val.slice(0, 2) === "--") {
2232
+ if ((0, import_utils112.isString)(val) && val.slice(0, 2) === "--") {
2223
2233
  const { THEME: THEME2 } = CONFIG22;
2224
2234
  const value = THEME2[val.slice(2)];
2225
2235
  const getReferenced = getMediaTheme4(value, prefers);
@@ -2232,7 +2242,7 @@ var require_cjs = __commonJS({
2232
2242
  const obj = {};
2233
2243
  for (const param in val) {
2234
2244
  const symb = param.slice(0, 1);
2235
- if ((0, import_utils102.isObjectLike)(val[param])) {
2245
+ if ((0, import_utils112.isObjectLike)(val[param])) {
2236
2246
  if (symb === "@") {
2237
2247
  const query = CONFIG22.MEDIA[param.slice(1)];
2238
2248
  const media = `@media screen and ${query}`;
@@ -2252,23 +2262,23 @@ var require_cjs = __commonJS({
2252
2262
  return val;
2253
2263
  };
2254
2264
  var findModifier = (val, modifier) => {
2255
- if ((0, import_utils102.isArray)(modifier))
2265
+ if ((0, import_utils112.isArray)(modifier))
2256
2266
  return findModifierFromArray(val, modifier);
2257
- else if ((0, import_utils102.isString)(modifier) && val[modifier])
2267
+ else if ((0, import_utils112.isString)(modifier) && val[modifier])
2258
2268
  return val[modifier];
2259
2269
  else
2260
2270
  return val;
2261
2271
  };
2262
2272
  var getMediaTheme4 = (val, mod) => {
2263
2273
  const CONFIG22 = getActiveConfig4();
2264
- if ((0, import_utils102.isString)(val) && val.slice(0, 2) === "--")
2274
+ if ((0, import_utils112.isString)(val) && val.slice(0, 2) === "--")
2265
2275
  val = getMediaTheme4(val.slice(2));
2266
- if (!val || !(0, import_utils102.isString)(val)) {
2276
+ if (!val || !(0, import_utils112.isString)(val)) {
2267
2277
  if (CONFIG22.verbose)
2268
2278
  console.warn(val, "- theme is not string");
2269
2279
  return;
2270
2280
  }
2271
- const [name, ...modifier] = (0, import_utils102.isArray)(val) ? val : val.split(" ");
2281
+ const [name, ...modifier] = (0, import_utils112.isArray)(val) ? val : val.split(" ");
2272
2282
  let value = CONFIG22.THEME[name];
2273
2283
  if (value && (modifier || mod)) {
2274
2284
  value = findModifier(value, modifier.length ? modifier : mod);
@@ -2276,7 +2286,7 @@ var require_cjs = __commonJS({
2276
2286
  const r = recursiveTheme(value);
2277
2287
  return r;
2278
2288
  };
2279
- var import_utils112 = __toESM2(require_cjs42(), 1);
2289
+ var import_utils122 = __toESM2(require_cjs42(), 1);
2280
2290
  var setFont = (val, key) => {
2281
2291
  const CSSvar = `--font-${key}`;
2282
2292
  const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
@@ -2293,13 +2303,13 @@ var require_cjs = __commonJS({
2293
2303
  let { value, type } = val;
2294
2304
  if (val.isDefault)
2295
2305
  FONT_FAMILY2.default = key;
2296
- if ((0, import_utils112.isObject)(value))
2306
+ if ((0, import_utils122.isObject)(value))
2297
2307
  value = arrayzeValue(value);
2298
2308
  const CSSvar = `--font-family-${key}`;
2299
2309
  const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
2300
2310
  return { var: CSSvar, value: str, arr: value, type };
2301
2311
  };
2302
- var import_utils142 = __toESM2(require_cjs42(), 1);
2312
+ var import_utils152 = __toESM2(require_cjs42(), 1);
2303
2313
  var runThroughMedia = (props7) => {
2304
2314
  const CONFIG22 = getActiveConfig4();
2305
2315
  const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG22;
@@ -2307,7 +2317,7 @@ var require_cjs = __commonJS({
2307
2317
  const mediaProps = props7[prop];
2308
2318
  if (prop.slice(0, 1) === "@") {
2309
2319
  const { type, base, ratio, range, subSequence, h1Matches, unit } = props7;
2310
- (0, import_utils142.merge)(mediaProps, {
2320
+ (0, import_utils152.merge)(mediaProps, {
2311
2321
  type,
2312
2322
  base,
2313
2323
  ratio,
@@ -2366,13 +2376,13 @@ var require_cjs = __commonJS({
2366
2376
  TYPOGRAPHY2
2367
2377
  );
2368
2378
  };
2369
- var import_utils17 = __toESM2(require_cjs42(), 1);
2379
+ var import_utils18 = __toESM2(require_cjs42(), 1);
2370
2380
  var runThroughMedia2 = (sequenceProps) => {
2371
2381
  for (const prop in sequenceProps) {
2372
2382
  const mediaProps = sequenceProps[prop];
2373
2383
  if (prop.slice(0, 1) === "@") {
2374
2384
  const { type, base, ratio, range, subSequence, h1Matches, unit } = sequenceProps;
2375
- (0, import_utils17.merge)(mediaProps, {
2385
+ (0, import_utils18.merge)(mediaProps, {
2376
2386
  type,
2377
2387
  base,
2378
2388
  ratio,
@@ -2411,7 +2421,7 @@ var require_cjs = __commonJS({
2411
2421
  const stack = arrayzeValue(value);
2412
2422
  if (!stack)
2413
2423
  return;
2414
- if ((0, import_utils17.isString)(value) && value.includes("calc")) {
2424
+ if ((0, import_utils18.isString)(value) && value.includes("calc")) {
2415
2425
  return { [propertyName]: value };
2416
2426
  }
2417
2427
  if (stack.length > 1) {
@@ -2447,7 +2457,7 @@ var require_cjs = __commonJS({
2447
2457
  let sequenceProps = SPACING2[spacingRatio];
2448
2458
  if (!sequenceProps) {
2449
2459
  const { type, base, range, subSequence } = SPACING2;
2450
- sequenceProps = SPACING2[spacingRatio] = (0, import_utils17.merge)({
2460
+ sequenceProps = SPACING2[spacingRatio] = (0, import_utils18.merge)({
2451
2461
  ratio: spacingRatio,
2452
2462
  type: type + "-" + spacingRatio,
2453
2463
  unit,
@@ -2488,11 +2498,11 @@ var require_cjs = __commonJS({
2488
2498
  TIMING2
2489
2499
  );
2490
2500
  };
2491
- var import_utils21 = __toESM2(require_cjs42(), 1);
2501
+ var import_utils222 = __toESM2(require_cjs42(), 1);
2492
2502
  var applyDocument = () => {
2493
2503
  const CONFIG22 = getActiveConfig4();
2494
2504
  const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG22;
2495
- return (0, import_utils21.merge)(DOCUMENT2, {
2505
+ return (0, import_utils222.merge)(DOCUMENT2, {
2496
2506
  theme: THEME2.document,
2497
2507
  fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
2498
2508
  fontSize: TYPOGRAPHY2.base,
@@ -2572,7 +2582,7 @@ var require_cjs = __commonJS({
2572
2582
  }
2573
2583
  }
2574
2584
  };
2575
- var import_utils24 = __toESM2(require_cjs42(), 1);
2585
+ var import_utils25 = __toESM2(require_cjs42(), 1);
2576
2586
  var applyReset = (reset = {}) => {
2577
2587
  const CONFIG22 = getActiveConfig4();
2578
2588
  const { RESET: RESET2, TYPOGRAPHY: TYPOGRAPHY2, DOCUMENT: DOCUMENT2 } = CONFIG22;
@@ -2594,8 +2604,8 @@ var require_cjs = __commonJS({
2594
2604
  const { body, ...templates } = TYPOGRAPHY2.templates;
2595
2605
  const globalTheme = CONFIG22.useDocumentTheme ? getMediaTheme4("document", `@${CONFIG22.globalTheme}`) : {};
2596
2606
  if (RESET2.html)
2597
- (0, import_utils24.overwriteDeep)(RESET2.html, globalTheme);
2598
- return (0, import_utils24.deepMerge)((0, import_utils24.merge)(RESET2, reset), {
2607
+ (0, import_utils25.overwriteDeep)(RESET2.html, globalTheme);
2608
+ return (0, import_utils25.deepMerge)((0, import_utils25.merge)(RESET2, reset), {
2599
2609
  html: {
2600
2610
  position: "absolute",
2601
2611
  // overflow: 'hidden',
@@ -2632,7 +2642,7 @@ var require_cjs = __commonJS({
2632
2642
  });
2633
2643
  }
2634
2644
  };
2635
- var import_utils25 = __toESM2(require_cjs42(), 1);
2645
+ var import_utils26 = __toESM2(require_cjs42(), 1);
2636
2646
  var isBorderStyle = (str) => [
2637
2647
  "none",
2638
2648
  "hidden",
@@ -2703,7 +2713,7 @@ var require_cjs = __commonJS({
2703
2713
  return v;
2704
2714
  }).join(" ");
2705
2715
  };
2706
- var transfromGap4 = (gap) => (0, import_utils25.isString)(gap) && gap.split(" ").map((v) => getSpacingByKey7(v, "gap").gap).join(" ");
2716
+ var transfromGap4 = (gap) => (0, import_utils26.isString)(gap) && gap.split(" ").map((v) => getSpacingByKey7(v, "gap").gap).join(" ");
2707
2717
  var transformTransition = (transition) => {
2708
2718
  const arr = transition.split(" ");
2709
2719
  if (!arr.length)
@@ -2721,7 +2731,7 @@ var require_cjs = __commonJS({
2721
2731
  }).join(" ");
2722
2732
  };
2723
2733
  var transformDuration4 = (duration, props7, propertyName) => {
2724
- if (!(0, import_utils25.isString)(duration))
2734
+ if (!(0, import_utils26.isString)(duration))
2725
2735
  return;
2726
2736
  return duration.split(",").map((v) => getTimingByKey4(v).timing || v).join(",");
2727
2737
  };
@@ -2731,9 +2741,9 @@ var require_cjs = __commonJS({
2731
2741
  return;
2732
2742
  return arr.map(transformTransition).join(",");
2733
2743
  };
2734
- var import_utils26 = __toESM2(require_cjs42(), 1);
2744
+ var import_utils27 = __toESM2(require_cjs42(), 1);
2735
2745
  var setCases = (val, key) => {
2736
- if ((0, import_utils26.isFunction)(val))
2746
+ if ((0, import_utils27.isFunction)(val))
2737
2747
  return val();
2738
2748
  return val;
2739
2749
  };
@@ -9030,13 +9040,13 @@ var require_cjs10 = __commonJS({
9030
9040
  document: () => document4,
9031
9041
  global: () => global,
9032
9042
  self: () => self,
9033
- window: () => window3
9043
+ window: () => window2
9034
9044
  });
9035
9045
  module22.exports = __toCommonJS22(globals_exports);
9036
9046
  var global = globalThis;
9037
9047
  var self = globalThis;
9038
- var window3 = globalThis;
9039
- var document4 = window3.document;
9048
+ var window2 = globalThis;
9049
+ var document4 = window2.document;
9040
9050
  }
9041
9051
  });
9042
9052
  var require_cjs22 = __commonJS2({
@@ -9324,10 +9334,10 @@ var require_cjs10 = __commonJS({
9324
9334
  isFunction: () => isFunction22,
9325
9335
  isNot: () => isNot4,
9326
9336
  isNull: () => isNull,
9327
- isNumber: () => isNumber,
9337
+ isNumber: () => isNumber2,
9328
9338
  isObject: () => isObject7,
9329
9339
  isObjectLike: () => isObjectLike32,
9330
- isString: () => isString8,
9340
+ isString: () => isString9,
9331
9341
  isUndefined: () => isUndefined,
9332
9342
  isValidHtmlTag: () => isValidHtmlTag
9333
9343
  });
@@ -9340,8 +9350,8 @@ var require_cjs10 = __commonJS({
9340
9350
  return false;
9341
9351
  return typeof arg === "object" && arg.constructor === Object;
9342
9352
  };
9343
- var isString8 = (arg) => typeof arg === "string";
9344
- var isNumber = (arg) => typeof arg === "number";
9353
+ var isString9 = (arg) => typeof arg === "string";
9354
+ var isNumber2 = (arg) => typeof arg === "number";
9345
9355
  var isFunction22 = (arg) => typeof arg === "function";
9346
9356
  var isBoolean = (arg) => arg === true || arg === false;
9347
9357
  var isNull = (arg) => arg === null;
@@ -9352,7 +9362,7 @@ var require_cjs10 = __commonJS({
9352
9362
  return typeof arg === "object";
9353
9363
  };
9354
9364
  var isDefined2 = (arg) => {
9355
- return isObject7(arg) || isObjectLike32(arg) || isString8(arg) || isNumber(arg) || isFunction22(arg) || isArray62(arg) || isObjectLike32(arg) || isBoolean(arg) || isNull(arg);
9365
+ return isObject7(arg) || isObjectLike32(arg) || isString9(arg) || isNumber2(arg) || isFunction22(arg) || isArray62(arg) || isObjectLike32(arg) || isBoolean(arg) || isNull(arg);
9356
9366
  };
9357
9367
  var isUndefined = (arg) => {
9358
9368
  return arg === void 0;
@@ -9361,8 +9371,8 @@ var require_cjs10 = __commonJS({
9361
9371
  boolean: isBoolean,
9362
9372
  array: isArray62,
9363
9373
  object: isObject7,
9364
- string: isString8,
9365
- number: isNumber,
9374
+ string: isString9,
9375
+ number: isNumber2,
9366
9376
  null: isNull,
9367
9377
  function: isFunction22,
9368
9378
  objectLike: isObjectLike32,
@@ -9405,6 +9415,9 @@ var require_cjs10 = __commonJS({
9405
9415
  var array_exports = {};
9406
9416
  __export22(array_exports, {
9407
9417
  arrayContainsOtherArray: () => arrayContainsOtherArray,
9418
+ createNestedObject: () => createNestedObject,
9419
+ cutArrayAfterValue: () => cutArrayAfterValue,
9420
+ cutArrayBeforeValue: () => cutArrayBeforeValue,
9408
9421
  joinArrays: () => joinArrays,
9409
9422
  mergeAndCloneIfArray: () => mergeAndCloneIfArray,
9410
9423
  mergeArray: () => mergeArray,
@@ -9444,6 +9457,71 @@ var require_cjs10 = __commonJS({
9444
9457
  var mergeAndCloneIfArray = (obj) => {
9445
9458
  return (0, import_types.isArray)(obj) ? mergeArray(obj) : (0, import_object.deepClone)(obj);
9446
9459
  };
9460
+ var cutArrayBeforeValue = (arr, value) => {
9461
+ const index = arr.indexOf(value);
9462
+ if (index !== -1) {
9463
+ return arr.slice(0, index);
9464
+ }
9465
+ return arr;
9466
+ };
9467
+ var cutArrayAfterValue = (arr, value) => {
9468
+ const index = arr.indexOf(value);
9469
+ if (index !== -1) {
9470
+ return arr.slice(index + 1);
9471
+ }
9472
+ return arr;
9473
+ };
9474
+ var createNestedObject = (arr, lastValue) => {
9475
+ let nestedObject = {};
9476
+ if (arr.length === 0) {
9477
+ return lastValue;
9478
+ }
9479
+ arr.reduce((obj, value, index) => {
9480
+ if (!obj[value]) {
9481
+ obj[value] = {};
9482
+ }
9483
+ if (index === arr.length - 1 && lastValue) {
9484
+ obj[value] = lastValue;
9485
+ }
9486
+ return obj[value];
9487
+ }, nestedObject);
9488
+ return nestedObject;
9489
+ };
9490
+ }
9491
+ });
9492
+ var require_string2 = __commonJS2({
9493
+ "../../node_modules/@domql/utils/dist/cjs/string.js"(exports2, module22) {
9494
+ "use strict";
9495
+ var __defProp22 = Object.defineProperty;
9496
+ var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
9497
+ var __getOwnPropNames22 = Object.getOwnPropertyNames;
9498
+ var __hasOwnProp22 = Object.prototype.hasOwnProperty;
9499
+ var __export22 = (target, all) => {
9500
+ for (var name in all)
9501
+ __defProp22(target, name, { get: all[name], enumerable: true });
9502
+ };
9503
+ var __copyProps22 = (to, from2, except, desc) => {
9504
+ if (from2 && typeof from2 === "object" || typeof from2 === "function") {
9505
+ for (let key of __getOwnPropNames22(from2))
9506
+ if (!__hasOwnProp22.call(to, key) && key !== except)
9507
+ __defProp22(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc22(from2, key)) || desc.enumerable });
9508
+ }
9509
+ return to;
9510
+ };
9511
+ var __toCommonJS22 = (mod) => __copyProps22(__defProp22({}, "__esModule", { value: true }), mod);
9512
+ var string_exports = {};
9513
+ __export22(string_exports, {
9514
+ stringIncludesAny: () => stringIncludesAny
9515
+ });
9516
+ module22.exports = __toCommonJS22(string_exports);
9517
+ var stringIncludesAny = (str, characters2) => {
9518
+ for (const char2 of characters2) {
9519
+ if (str.includes(char2)) {
9520
+ return true;
9521
+ }
9522
+ }
9523
+ return false;
9524
+ };
9447
9525
  }
9448
9526
  });
9449
9527
  var require_object2 = __commonJS2({
@@ -9485,15 +9563,18 @@ var require_cjs10 = __commonJS({
9485
9563
  merge: () => merge5,
9486
9564
  mergeArrayExclude: () => mergeArrayExclude,
9487
9565
  mergeIfExisted: () => mergeIfExisted,
9566
+ objectToString: () => objectToString,
9488
9567
  overwrite: () => overwrite,
9489
9568
  overwriteDeep: () => overwriteDeep2,
9490
9569
  overwriteShallow: () => overwriteShallow4,
9491
- removeFromObject: () => removeFromObject
9570
+ removeFromObject: () => removeFromObject,
9571
+ stringToObject: () => stringToObject
9492
9572
  });
9493
9573
  module22.exports = __toCommonJS22(object_exports);
9494
9574
  var import_globals3 = require_cjs11();
9495
9575
  var import_types = require_types2();
9496
9576
  var import_array = require_array2();
9577
+ var import_string = require_string2();
9497
9578
  var exec4 = (param, element, state, context) => {
9498
9579
  if ((0, import_types.isFunction)(param)) {
9499
9580
  return param(
@@ -9511,7 +9592,7 @@ var require_cjs10 = __commonJS({
9511
9592
  };
9512
9593
  var merge5 = (element, obj, excludeFrom = []) => {
9513
9594
  for (const e in obj) {
9514
- if (excludeFrom.includes(e) || e.includes("__"))
9595
+ if (excludeFrom.includes(e) || e.startsWith("__"))
9515
9596
  continue;
9516
9597
  const elementProp = element[e];
9517
9598
  const objProp = obj[e];
@@ -9523,7 +9604,7 @@ var require_cjs10 = __commonJS({
9523
9604
  };
9524
9605
  var deepMerge3 = (element, extend, excludeFrom = []) => {
9525
9606
  for (const e in extend) {
9526
- if (excludeFrom.includes(e) || e.includes("__"))
9607
+ if (excludeFrom.includes(e) || e.startsWith("__"))
9527
9608
  continue;
9528
9609
  const elementProp = element[e];
9529
9610
  const extendProp = extend[e];
@@ -9538,7 +9619,7 @@ var require_cjs10 = __commonJS({
9538
9619
  var clone = (obj, excludeFrom = []) => {
9539
9620
  const o = {};
9540
9621
  for (const prop in obj) {
9541
- if (excludeFrom.includes(prop) || prop.includes("__"))
9622
+ if (excludeFrom.includes(prop) || prop.startsWith("__"))
9542
9623
  continue;
9543
9624
  o[prop] = obj[prop];
9544
9625
  }
@@ -9550,7 +9631,7 @@ var require_cjs10 = __commonJS({
9550
9631
  }
9551
9632
  const o = {};
9552
9633
  for (const k in obj) {
9553
- if (excludeFrom.includes(k) || k.includes("__"))
9634
+ if (excludeFrom.includes(k) || k.startsWith("__"))
9554
9635
  continue;
9555
9636
  let v = obj[k];
9556
9637
  if (k === "extend" && (0, import_types.isArray)(v)) {
@@ -9571,7 +9652,7 @@ var require_cjs10 = __commonJS({
9571
9652
  var deepClone22 = (obj, excludeFrom = []) => {
9572
9653
  const o = (0, import_types.isArray)(obj) ? [] : {};
9573
9654
  for (const prop in obj) {
9574
- if (excludeFrom.includes(prop) || prop.includes("__"))
9655
+ if (excludeFrom.includes(prop) || prop.startsWith("__"))
9575
9656
  continue;
9576
9657
  let objProp = obj[prop];
9577
9658
  if (prop === "extend" && (0, import_types.isArray)(objProp)) {
@@ -9610,6 +9691,40 @@ var require_cjs10 = __commonJS({
9610
9691
  }
9611
9692
  return stringified;
9612
9693
  };
9694
+ var objectToString = (obj, indent = 0) => {
9695
+ const spaces = " ".repeat(indent);
9696
+ let str = "{\n";
9697
+ for (const [key, value] of Object.entries(obj)) {
9698
+ const keyAllowdChars = (0, import_string.stringIncludesAny)(key, ["-", ":", "@", ".", "!"]);
9699
+ const stringedKey = keyAllowdChars ? `'${key}'` : key;
9700
+ str += `${spaces} ${stringedKey}: `;
9701
+ if ((0, import_types.isArray)(value)) {
9702
+ str += "[\n";
9703
+ for (const element of value) {
9704
+ if ((0, import_types.isObject)(element) && element !== null) {
9705
+ str += `${spaces} ${objectToString(element, indent + 2)},
9706
+ `;
9707
+ } else if ((0, import_types.isString)(element)) {
9708
+ str += `${spaces} '${element}',
9709
+ `;
9710
+ } else {
9711
+ str += `${spaces} ${element},
9712
+ `;
9713
+ }
9714
+ }
9715
+ str += `${spaces} ]`;
9716
+ } else if ((0, import_types.isObject)(value)) {
9717
+ str += objectToString(value, indent + 1);
9718
+ } else if ((0, import_types.isString)(value)) {
9719
+ str += (0, import_string.stringIncludesAny)(value, ["\n", "'"]) ? `\`${value}\`` : `'${value}'`;
9720
+ } else {
9721
+ str += value;
9722
+ }
9723
+ str += ",\n";
9724
+ }
9725
+ str += `${spaces}}`;
9726
+ return str;
9727
+ };
9613
9728
  var detachFunctionsFromObject = (obj, detached = {}) => {
9614
9729
  for (const prop in obj) {
9615
9730
  const objProp = obj[prop];
@@ -9680,6 +9795,16 @@ var require_cjs10 = __commonJS({
9680
9795
  }
9681
9796
  return stringified;
9682
9797
  };
9798
+ var stringToObject = (str) => {
9799
+ let obj;
9800
+ try {
9801
+ obj = import_globals3.window.eval("(" + str + ")");
9802
+ } catch (e) {
9803
+ console.warn(e);
9804
+ }
9805
+ if (obj)
9806
+ return obj;
9807
+ };
9683
9808
  var diffObjects = (original, objToDiff, cache) => {
9684
9809
  for (const e in objToDiff) {
9685
9810
  if (e === "ref")
@@ -9725,7 +9850,7 @@ var require_cjs10 = __commonJS({
9725
9850
  const { ref } = element;
9726
9851
  const changes = {};
9727
9852
  for (const e in params) {
9728
- if (excludeFrom.includes(e) || e.includes("__"))
9853
+ if (excludeFrom.includes(e) || e.startsWith("__"))
9729
9854
  continue;
9730
9855
  const elementProp = element[e];
9731
9856
  const paramsProp = params[e];
@@ -9738,7 +9863,7 @@ var require_cjs10 = __commonJS({
9738
9863
  };
9739
9864
  var overwriteShallow4 = (obj, params, excludeFrom = []) => {
9740
9865
  for (const e in params) {
9741
- if (excludeFrom.includes(e) || e.includes("__"))
9866
+ if (excludeFrom.includes(e) || e.startsWith("__"))
9742
9867
  continue;
9743
9868
  obj[e] = params[e];
9744
9869
  }
@@ -9746,7 +9871,7 @@ var require_cjs10 = __commonJS({
9746
9871
  };
9747
9872
  var overwriteDeep2 = (obj, params, excludeFrom = []) => {
9748
9873
  for (const e in params) {
9749
- if (excludeFrom.includes(e) || e.includes("__"))
9874
+ if (excludeFrom.includes(e) || e.startsWith("__"))
9750
9875
  continue;
9751
9876
  const objProp = obj[e];
9752
9877
  const paramsProp = params[e];
@@ -9921,6 +10046,7 @@ var require_cjs10 = __commonJS({
9921
10046
  __reExport(utils_exports2, require_array2(), module22.exports);
9922
10047
  __reExport(utils_exports2, require_node2(), module22.exports);
9923
10048
  __reExport(utils_exports2, require_log2(), module22.exports);
10049
+ __reExport(utils_exports2, require_string2(), module22.exports);
9924
10050
  }
9925
10051
  });
9926
10052
  var src_exports = {};
@@ -9982,6 +10108,7 @@ var require_cjs10 = __commonJS({
9982
10108
  getFontSizeByKey: () => getFontSizeByKey4,
9983
10109
  getMediaColor: () => getMediaColor7,
9984
10110
  getMediaTheme: () => getMediaTheme4,
10111
+ getRgbTone: () => getRgbTone,
9985
10112
  getSequenceValue: () => getSequenceValue,
9986
10113
  getSequenceValuePropertyPair: () => getSequenceValuePropertyPair,
9987
10114
  getSpacingBasedOnRatio: () => getSpacingBasedOnRatio10,
@@ -10049,6 +10176,7 @@ var require_cjs10 = __commonJS({
10049
10176
  getFontFaceEachString: () => getFontFaceEachString,
10050
10177
  getFontFaceString: () => getFontFaceString,
10051
10178
  getFontFormat: () => getFontFormat,
10179
+ getRgbTone: () => getRgbTone,
10052
10180
  getSequenceValue: () => getSequenceValue,
10053
10181
  getSequenceValuePropertyPair: () => getSequenceValuePropertyPair,
10054
10182
  hexToRgb: () => hexToRgb,
@@ -10070,6 +10198,7 @@ var require_cjs10 = __commonJS({
10070
10198
  setVariables: () => setVariables
10071
10199
  });
10072
10200
  var import_globals = __toESM2(require_cjs11(), 1);
10201
+ var import_utils16 = __toESM2(require_cjs42(), 1);
10073
10202
  var ENV = "development";
10074
10203
  var colorStringToRgbaArray = (color) => {
10075
10204
  if (color === "")
@@ -10122,7 +10251,7 @@ var require_cjs10 = __commonJS({
10122
10251
  return [r, g, b];
10123
10252
  };
10124
10253
  var rgbToHex = (r, g, b) => {
10125
- return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
10254
+ return "#" + (1 << 24 | r << 16 | g << 8 | b).toString(16).slice(1);
10126
10255
  };
10127
10256
  var rgbArrayToHex = ([r, g, b]) => {
10128
10257
  return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
@@ -10174,7 +10303,7 @@ var require_cjs10 = __commonJS({
10174
10303
  g = 255;
10175
10304
  else if (g < 0)
10176
10305
  g = 0;
10177
- return (g | b << 8 | r << 16).toString(16);
10306
+ return ((g | b << 8 | r << 16) + 16777216).toString(16).slice(1);
10178
10307
  };
10179
10308
  var mixTwoRgba = (colorA, colorB, range = 0.5) => {
10180
10309
  const arr = [];
@@ -10196,6 +10325,24 @@ var require_cjs10 = __commonJS({
10196
10325
  arr[3] = opacity;
10197
10326
  return `rgba(${arr})`;
10198
10327
  };
10328
+ var getRgbTone = (rgb, tone) => {
10329
+ if ((0, import_utils16.isString)(rgb))
10330
+ rgb = rgb.split(", ").map((v) => parseFloat(v));
10331
+ if ((0, import_utils16.isNumber)(tone))
10332
+ tone += "";
10333
+ const toHex = rgbArrayToHex(rgb);
10334
+ const abs2 = tone.slice(0, 1);
10335
+ if (abs2 === "-" || abs2 === "+") {
10336
+ const colorShade = getColorShade(toHex, parseFloat(tone));
10337
+ return hexToRgbArray(colorShade).join(", ");
10338
+ } else {
10339
+ const [r, g, b] = rgb;
10340
+ const hsl = rgbToHSL(r, g, b);
10341
+ const [h, s, l] = hsl;
10342
+ const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
10343
+ return newRgb;
10344
+ }
10345
+ };
10199
10346
  var returnSubThemeOrDefault = (orig, theme) => {
10200
10347
  if (!orig)
10201
10348
  return;
@@ -10244,24 +10391,24 @@ var require_cjs10 = __commonJS({
10244
10391
  const keys = Object.keys(LIBRARY);
10245
10392
  return keys.map((key) => getFontFaceEachString(key, LIBRARY[key].value));
10246
10393
  };
10247
- var import_utils42 = __toESM2(require_cjs42(), 1);
10394
+ var import_utils52 = __toESM2(require_cjs42(), 1);
10395
+ var import_utils32 = __toESM2(require_cjs42());
10248
10396
  var import_utils22 = __toESM2(require_cjs42());
10249
- var import_utils16 = __toESM2(require_cjs42());
10250
10397
  var toCamelCase = (str) => {
10251
10398
  return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
10252
10399
  return index === 0 ? word.toLowerCase() : word.toUpperCase();
10253
10400
  }).replaceAll(/\s+/g, "");
10254
10401
  };
10255
- var toDashCase = (val) => val.replace(/[A-Z]/g, (match2, offset) => (offset > 0 ? "-" : "") + match2.toLowerCase()).replace(".", "-");
10402
+ var toDashCase = (val) => val.replace(/[^a-zA-Z0-9]/g, " ").trim().toLowerCase().replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
10256
10403
  var arrayzeValue = (val) => {
10257
- if ((0, import_utils22.isString)(val))
10404
+ if ((0, import_utils32.isString)(val))
10258
10405
  return val.split(" ");
10259
- if ((0, import_utils22.isObject)(val))
10406
+ if ((0, import_utils32.isObject)(val))
10260
10407
  return Object.keys(val).map((v) => val[v]);
10261
- if ((0, import_utils22.isArray)(val))
10408
+ if ((0, import_utils32.isArray)(val))
10262
10409
  return val;
10263
10410
  };
10264
- var import_utils32 = __toESM2(require_cjs42(), 1);
10411
+ var import_utils42 = __toESM2(require_cjs42(), 1);
10265
10412
  var defaultConfig_exports = {};
10266
10413
  __export2(defaultConfig_exports, {
10267
10414
  ANIMATION: () => ANIMATION,
@@ -10432,13 +10579,13 @@ var require_cjs10 = __commonJS({
10432
10579
  CSS_VARS,
10433
10580
  ...defaultConfig_exports
10434
10581
  };
10435
- var cachedConfig = (0, import_utils32.deepClone)(CONFIG4);
10582
+ var cachedConfig = (0, import_utils42.deepClone)(CONFIG4);
10436
10583
  var FACTORY = {
10437
10584
  active: "0",
10438
10585
  0: CONFIG4
10439
10586
  };
10440
10587
  var activateConfig = (def) => {
10441
- if ((0, import_utils32.isDefined)(def)) {
10588
+ if ((0, import_utils42.isDefined)(def)) {
10442
10589
  FACTORY.active = def;
10443
10590
  }
10444
10591
  return FACTORY[def || FACTORY.active];
@@ -10447,10 +10594,10 @@ var require_cjs10 = __commonJS({
10447
10594
  return FACTORY[def || FACTORY.active];
10448
10595
  };
10449
10596
  var setActiveConfig = (newConfig) => {
10450
- if (!(0, import_utils32.isObject)(newConfig))
10597
+ if (!(0, import_utils42.isObject)(newConfig))
10451
10598
  return;
10452
10599
  FACTORY.active = "1";
10453
- FACTORY["1"] = (0, import_utils32.deepMerge)(newConfig, (0, import_utils32.deepClone)(cachedConfig));
10600
+ FACTORY["1"] = (0, import_utils42.deepMerge)(newConfig, (0, import_utils42.deepClone)(cachedConfig));
10454
10601
  return newConfig;
10455
10602
  };
10456
10603
  var numToLetterMap = {
@@ -10559,7 +10706,7 @@ var require_cjs10 = __commonJS({
10559
10706
  unit = UNIT2.default,
10560
10707
  useVariable
10561
10708
  } = sequenceProps;
10562
- if ((0, import_utils42.isString)(value) && value.slice(0, 2) === "--")
10709
+ if ((0, import_utils52.isString)(value) && value.slice(0, 2) === "--")
10563
10710
  return `var(${value})`;
10564
10711
  const prefix2 = `--${toDashCase(sequenceProps.type.replace(".", "-"))}-`;
10565
10712
  const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
@@ -10620,11 +10767,11 @@ var require_cjs10 = __commonJS({
10620
10767
  return sequence[findLetter];
10621
10768
  });
10622
10769
  };
10623
- var import_utils62 = __toESM2(require_cjs42(), 1);
10770
+ var import_utils72 = __toESM2(require_cjs42(), 1);
10624
10771
  var setVariables = (result, key) => {
10625
10772
  const CONFIG22 = getActiveConfig4();
10626
10773
  const { CSS_VARS: CSS_VARS2 } = CONFIG22;
10627
- if ((0, import_utils62.isObjectLike)(result.value)) {
10774
+ if ((0, import_utils72.isObjectLike)(result.value)) {
10628
10775
  } else {
10629
10776
  CSS_VARS2[result.var] = result.value;
10630
10777
  }
@@ -10658,7 +10805,7 @@ var require_cjs10 = __commonJS({
10658
10805
  }
10659
10806
  }
10660
10807
  };
10661
- var import_utils72 = __toESM2(require_cjs42(), 1);
10808
+ var import_utils82 = __toESM2(require_cjs42(), 1);
10662
10809
  var generateSprite = (icons) => {
10663
10810
  const CONFIG22 = getActiveConfig4();
10664
10811
  let sprite = "";
@@ -10672,7 +10819,7 @@ var require_cjs10 = __commonJS({
10672
10819
  return sprite;
10673
10820
  };
10674
10821
  var parseRootAttributes = (htmlString) => {
10675
- if (!(0, import_utils72.isString)(htmlString)) {
10822
+ if (!(0, import_utils82.isString)(htmlString)) {
10676
10823
  return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
10677
10824
  }
10678
10825
  const match2 = htmlString.match(/<svg\s+(.*?)>/);
@@ -10692,7 +10839,7 @@ var require_cjs10 = __commonJS({
10692
10839
  const urlRegex = /url\(#([^)]*)\)/g;
10693
10840
  const matches = code.match(/id="([^"]*)"/g);
10694
10841
  let replacedCode = code;
10695
- if ((0, import_utils72.isArray)(matches)) {
10842
+ if ((0, import_utils82.isArray)(matches)) {
10696
10843
  matches.forEach(() => {
10697
10844
  const randomKey = Math.floor(Math.random() * 1e5);
10698
10845
  replacedCode = code.replace(idRegex, `id="${key}-${randomKey}"`).replace(urlRegex, `url(#${key}-${randomKey})`);
@@ -10745,10 +10892,10 @@ var require_cjs10 = __commonJS({
10745
10892
  setSVG: () => setSVG,
10746
10893
  setTheme: () => setTheme
10747
10894
  });
10748
- var import_utils82 = __toESM2(require_cjs42(), 1);
10895
+ var import_utils92 = __toESM2(require_cjs42(), 1);
10749
10896
  var getColor4 = (value, key, config) => {
10750
10897
  const CONFIG22 = config || getActiveConfig4();
10751
- if (!(0, import_utils82.isString)(value)) {
10898
+ if (!(0, import_utils92.isString)(value)) {
10752
10899
  if (CONFIG22.verbose)
10753
10900
  console.warn(value, "- type for color is not valid");
10754
10901
  return;
@@ -10757,7 +10904,7 @@ var require_cjs10 = __commonJS({
10757
10904
  return `var(${value})`;
10758
10905
  if (key && value[key])
10759
10906
  value = value[key];
10760
- const [name, alpha, tone] = (0, import_utils82.isArray)(value) ? value : value.split(" ");
10907
+ const [name, alpha, tone] = (0, import_utils92.isArray)(value) ? value : value.split(" ");
10761
10908
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG22;
10762
10909
  let val = COLOR2[name] || GRADIENT2[name];
10763
10910
  if (!val) {
@@ -10772,22 +10919,11 @@ var require_cjs10 = __commonJS({
10772
10919
  console.warn(value, " - does not have ", key);
10773
10920
  }
10774
10921
  let rgb = val.rgb;
10775
- if (!rgb)
10922
+ if (!rgb) {
10776
10923
  return CONFIG22.useVariable ? `var(${val.var})` : val.value;
10924
+ }
10777
10925
  if (tone && !val[tone]) {
10778
- const toHex = rgbArrayToHex(rgb.split(", ").map((v) => parseFloat(v)));
10779
- const abs2 = tone.slice(0, 1);
10780
- if (abs2 === "-" || abs2 === "+") {
10781
- rgb = hexToRgbArray(
10782
- getColorShade(toHex, parseFloat(tone))
10783
- ).join(", ");
10784
- } else {
10785
- const [r, g, b] = [...rgb.split(", ").map((v) => parseInt(v))];
10786
- const hsl = rgbToHSL(r, g, b);
10787
- const [h, s, l] = hsl;
10788
- const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
10789
- rgb = newRgb;
10790
- }
10926
+ rgb = getRgbTone(rgb, tone);
10791
10927
  val[tone] = { rgb, var: `${val.var}-${tone}` };
10792
10928
  }
10793
10929
  if (val[tone])
@@ -10800,17 +10936,17 @@ var require_cjs10 = __commonJS({
10800
10936
  const CONFIG22 = config || getActiveConfig4();
10801
10937
  if (!globalTheme)
10802
10938
  globalTheme = CONFIG22.globalTheme;
10803
- if (!(0, import_utils82.isString)(value)) {
10939
+ if (!(0, import_utils92.isString)(value)) {
10804
10940
  if (CONFIG22.verbose)
10805
10941
  console.warn(value, "- type for color is not valid");
10806
10942
  return;
10807
10943
  }
10808
10944
  if (value.slice(0, 2) === "--")
10809
10945
  return `var(${value})`;
10810
- const [name] = (0, import_utils82.isArray)(value) ? value : value.split(" ");
10946
+ const [name] = (0, import_utils92.isArray)(value) ? value : value.split(" ");
10811
10947
  const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG22;
10812
10948
  const val = COLOR2[name] || GRADIENT2[name];
10813
- const isObj = (0, import_utils82.isObject)(val);
10949
+ const isObj = (0, import_utils92.isObject)(val);
10814
10950
  if (isObj && val.value)
10815
10951
  return getColor4(value, `@${globalTheme}`, config);
10816
10952
  else if (isObj) {
@@ -10833,15 +10969,15 @@ var require_cjs10 = __commonJS({
10833
10969
  };
10834
10970
  var setColor = (val, key, suffix) => {
10835
10971
  const CONFIG22 = getActiveConfig4();
10836
- if ((0, import_utils82.isString)(val) && val.slice(0, 2) === "--")
10972
+ if ((0, import_utils92.isString)(val) && val.slice(0, 2) === "--")
10837
10973
  val = getColor4(val.slice(2));
10838
- if ((0, import_utils82.isArray)(val)) {
10974
+ if ((0, import_utils92.isArray)(val)) {
10839
10975
  return {
10840
10976
  "@light": setColor(val[0], key, "light"),
10841
10977
  "@dark": setColor(val[1], key, "dark")
10842
10978
  };
10843
10979
  }
10844
- if ((0, import_utils82.isObject)(val)) {
10980
+ if ((0, import_utils92.isObject)(val)) {
10845
10981
  const obj = {};
10846
10982
  for (const variant in val)
10847
10983
  obj[variant] = setColor(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
@@ -10864,15 +11000,15 @@ var require_cjs10 = __commonJS({
10864
11000
  };
10865
11001
  var setGradient = (val, key, suffix) => {
10866
11002
  const CONFIG22 = getActiveConfig4();
10867
- if ((0, import_utils82.isString)(val) && val.slice(0, 2) === "--")
11003
+ if ((0, import_utils92.isString)(val) && val.slice(0, 2) === "--")
10868
11004
  val = getColor4(val.slice(2));
10869
- if ((0, import_utils82.isArray)(val)) {
11005
+ if ((0, import_utils92.isArray)(val)) {
10870
11006
  return {
10871
11007
  "@light": setGradient(val[0], key, "light"),
10872
11008
  "@dark": setGradient(val[0], key, "dark")
10873
11009
  };
10874
11010
  }
10875
- if ((0, import_utils82.isObject)(val)) {
11011
+ if ((0, import_utils92.isObject)(val)) {
10876
11012
  const obj = {};
10877
11013
  for (const variant in val)
10878
11014
  obj[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
@@ -10887,7 +11023,7 @@ var require_cjs10 = __commonJS({
10887
11023
  value: val.value || val
10888
11024
  };
10889
11025
  };
10890
- var import_utils102 = __toESM2(require_cjs42(), 1);
11026
+ var import_utils112 = __toESM2(require_cjs42(), 1);
10891
11027
  var setThemeValue = (theme) => {
10892
11028
  const value = {};
10893
11029
  const { state, media, helpers, ...rest } = theme;
@@ -10910,7 +11046,7 @@ var require_cjs10 = __commonJS({
10910
11046
  if (CONFIG22.useVariable)
10911
11047
  return getMediaTheme4(value, modifier);
10912
11048
  const { THEME: THEME2 } = CONFIG22;
10913
- if ((0, import_utils102.isString)(value)) {
11049
+ if ((0, import_utils112.isString)(value)) {
10914
11050
  const [theme, subtheme] = value.split(" ");
10915
11051
  const isOurTheme = THEME2[theme];
10916
11052
  if (isOurTheme) {
@@ -10919,7 +11055,7 @@ var require_cjs10 = __commonJS({
10919
11055
  value = [theme, subtheme || modifier];
10920
11056
  }
10921
11057
  }
10922
- if ((0, import_utils102.isObjectLike)(value) && value[1]) {
11058
+ if ((0, import_utils112.isObjectLike)(value) && value[1]) {
10923
11059
  const themeName = value[0];
10924
11060
  const subThemeName = value[1];
10925
11061
  const { helpers, media, state } = THEME2[themeName];
@@ -10929,11 +11065,11 @@ var require_cjs10 = __commonJS({
10929
11065
  return getThemeValue(helpers[subThemeName]);
10930
11066
  if (state && state[subThemeName])
10931
11067
  return getThemeValue(state[subThemeName]);
10932
- } else if ((0, import_utils102.isObject)(value))
11068
+ } else if ((0, import_utils112.isObject)(value))
10933
11069
  return setThemeValue(value);
10934
11070
  };
10935
11071
  var setInverseTheme = (theme, variant, value) => {
10936
- if ((0, import_utils102.isObject)(variant)) {
11072
+ if ((0, import_utils112.isObject)(variant)) {
10937
11073
  theme.variants.inverse.value = setThemeValue(variant);
10938
11074
  } else if (variant === true) {
10939
11075
  const { color, background } = value;
@@ -10948,7 +11084,7 @@ var require_cjs10 = __commonJS({
10948
11084
  var setPseudo = (theme, key, variant, themeValue) => {
10949
11085
  const result = getTheme4(variant);
10950
11086
  themeValue[`&:${key}`] = result;
10951
- if ((0, import_utils102.isObject)(variant) && !variant.value)
11087
+ if ((0, import_utils112.isObject)(variant) && !variant.value)
10952
11088
  variant.value = result;
10953
11089
  };
10954
11090
  var setSelectors = (theme, value) => {
@@ -10966,7 +11102,7 @@ var require_cjs10 = __commonJS({
10966
11102
  var setPrefersScheme = (theme, key, variant, themeValue) => {
10967
11103
  const result = getTheme4(variant);
10968
11104
  themeValue[`@media (prefers-color-scheme: ${key})`] = result;
10969
- if ((0, import_utils102.isObject)(variant) && !variant.value)
11105
+ if ((0, import_utils112.isObject)(variant) && !variant.value)
10970
11106
  variant.value = result;
10971
11107
  };
10972
11108
  var setMedia = (theme, value) => {
@@ -10992,7 +11128,7 @@ var require_cjs10 = __commonJS({
10992
11128
  const keys = Object.keys(helpers);
10993
11129
  keys.map((key) => {
10994
11130
  const helper = helpers[key];
10995
- if ((0, import_utils102.isString)(helper))
11131
+ if ((0, import_utils112.isString)(helper))
10996
11132
  helpers[key] = CONFIG22.THEME[helper];
10997
11133
  else
10998
11134
  getThemeValue(helpers[key]);
@@ -11016,7 +11152,7 @@ var require_cjs10 = __commonJS({
11016
11152
  const CONFIG22 = getActiveConfig4();
11017
11153
  const { CSS_VARS: CSS_VARS2 } = CONFIG22;
11018
11154
  const theme = { value: val };
11019
- if ((0, import_utils102.isObjectLike)(val)) {
11155
+ if ((0, import_utils112.isObjectLike)(val)) {
11020
11156
  for (const param in val) {
11021
11157
  const symb = param.slice(0, 1);
11022
11158
  const value = val[param];
@@ -11044,7 +11180,7 @@ var require_cjs10 = __commonJS({
11044
11180
  };
11045
11181
  }
11046
11182
  }
11047
- if ((0, import_utils102.isString)(val) && val.slice(0, 2) === "--") {
11183
+ if ((0, import_utils112.isString)(val) && val.slice(0, 2) === "--") {
11048
11184
  const { THEME: THEME2 } = CONFIG22;
11049
11185
  const value = THEME2[val.slice(2)];
11050
11186
  const getReferenced = getMediaTheme4(value, prefers);
@@ -11057,7 +11193,7 @@ var require_cjs10 = __commonJS({
11057
11193
  const obj = {};
11058
11194
  for (const param in val) {
11059
11195
  const symb = param.slice(0, 1);
11060
- if ((0, import_utils102.isObjectLike)(val[param])) {
11196
+ if ((0, import_utils112.isObjectLike)(val[param])) {
11061
11197
  if (symb === "@") {
11062
11198
  const query = CONFIG22.MEDIA[param.slice(1)];
11063
11199
  const media = `@media screen and ${query}`;
@@ -11077,23 +11213,23 @@ var require_cjs10 = __commonJS({
11077
11213
  return val;
11078
11214
  };
11079
11215
  var findModifier = (val, modifier) => {
11080
- if ((0, import_utils102.isArray)(modifier))
11216
+ if ((0, import_utils112.isArray)(modifier))
11081
11217
  return findModifierFromArray(val, modifier);
11082
- else if ((0, import_utils102.isString)(modifier) && val[modifier])
11218
+ else if ((0, import_utils112.isString)(modifier) && val[modifier])
11083
11219
  return val[modifier];
11084
11220
  else
11085
11221
  return val;
11086
11222
  };
11087
11223
  var getMediaTheme4 = (val, mod) => {
11088
11224
  const CONFIG22 = getActiveConfig4();
11089
- if ((0, import_utils102.isString)(val) && val.slice(0, 2) === "--")
11225
+ if ((0, import_utils112.isString)(val) && val.slice(0, 2) === "--")
11090
11226
  val = getMediaTheme4(val.slice(2));
11091
- if (!val || !(0, import_utils102.isString)(val)) {
11227
+ if (!val || !(0, import_utils112.isString)(val)) {
11092
11228
  if (CONFIG22.verbose)
11093
11229
  console.warn(val, "- theme is not string");
11094
11230
  return;
11095
11231
  }
11096
- const [name, ...modifier] = (0, import_utils102.isArray)(val) ? val : val.split(" ");
11232
+ const [name, ...modifier] = (0, import_utils112.isArray)(val) ? val : val.split(" ");
11097
11233
  let value = CONFIG22.THEME[name];
11098
11234
  if (value && (modifier || mod)) {
11099
11235
  value = findModifier(value, modifier.length ? modifier : mod);
@@ -11101,7 +11237,7 @@ var require_cjs10 = __commonJS({
11101
11237
  const r = recursiveTheme(value);
11102
11238
  return r;
11103
11239
  };
11104
- var import_utils112 = __toESM2(require_cjs42(), 1);
11240
+ var import_utils122 = __toESM2(require_cjs42(), 1);
11105
11241
  var setFont = (val, key) => {
11106
11242
  const CSSvar = `--font-${key}`;
11107
11243
  const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
@@ -11118,13 +11254,13 @@ var require_cjs10 = __commonJS({
11118
11254
  let { value, type } = val;
11119
11255
  if (val.isDefault)
11120
11256
  FONT_FAMILY2.default = key;
11121
- if ((0, import_utils112.isObject)(value))
11257
+ if ((0, import_utils122.isObject)(value))
11122
11258
  value = arrayzeValue(value);
11123
11259
  const CSSvar = `--font-family-${key}`;
11124
11260
  const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
11125
11261
  return { var: CSSvar, value: str, arr: value, type };
11126
11262
  };
11127
- var import_utils142 = __toESM2(require_cjs42(), 1);
11263
+ var import_utils152 = __toESM2(require_cjs42(), 1);
11128
11264
  var runThroughMedia = (props7) => {
11129
11265
  const CONFIG22 = getActiveConfig4();
11130
11266
  const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG22;
@@ -11132,7 +11268,7 @@ var require_cjs10 = __commonJS({
11132
11268
  const mediaProps = props7[prop];
11133
11269
  if (prop.slice(0, 1) === "@") {
11134
11270
  const { type, base, ratio, range, subSequence, h1Matches, unit } = props7;
11135
- (0, import_utils142.merge)(mediaProps, {
11271
+ (0, import_utils152.merge)(mediaProps, {
11136
11272
  type,
11137
11273
  base,
11138
11274
  ratio,
@@ -11191,13 +11327,13 @@ var require_cjs10 = __commonJS({
11191
11327
  TYPOGRAPHY2
11192
11328
  );
11193
11329
  };
11194
- var import_utils17 = __toESM2(require_cjs42(), 1);
11330
+ var import_utils18 = __toESM2(require_cjs42(), 1);
11195
11331
  var runThroughMedia2 = (sequenceProps) => {
11196
11332
  for (const prop in sequenceProps) {
11197
11333
  const mediaProps = sequenceProps[prop];
11198
11334
  if (prop.slice(0, 1) === "@") {
11199
11335
  const { type, base, ratio, range, subSequence, h1Matches, unit } = sequenceProps;
11200
- (0, import_utils17.merge)(mediaProps, {
11336
+ (0, import_utils18.merge)(mediaProps, {
11201
11337
  type,
11202
11338
  base,
11203
11339
  ratio,
@@ -11236,7 +11372,7 @@ var require_cjs10 = __commonJS({
11236
11372
  const stack = arrayzeValue(value);
11237
11373
  if (!stack)
11238
11374
  return;
11239
- if ((0, import_utils17.isString)(value) && value.includes("calc")) {
11375
+ if ((0, import_utils18.isString)(value) && value.includes("calc")) {
11240
11376
  return { [propertyName]: value };
11241
11377
  }
11242
11378
  if (stack.length > 1) {
@@ -11272,7 +11408,7 @@ var require_cjs10 = __commonJS({
11272
11408
  let sequenceProps = SPACING2[spacingRatio];
11273
11409
  if (!sequenceProps) {
11274
11410
  const { type, base, range, subSequence } = SPACING2;
11275
- sequenceProps = SPACING2[spacingRatio] = (0, import_utils17.merge)({
11411
+ sequenceProps = SPACING2[spacingRatio] = (0, import_utils18.merge)({
11276
11412
  ratio: spacingRatio,
11277
11413
  type: type + "-" + spacingRatio,
11278
11414
  unit,
@@ -11313,11 +11449,11 @@ var require_cjs10 = __commonJS({
11313
11449
  TIMING2
11314
11450
  );
11315
11451
  };
11316
- var import_utils21 = __toESM2(require_cjs42(), 1);
11452
+ var import_utils222 = __toESM2(require_cjs42(), 1);
11317
11453
  var applyDocument = () => {
11318
11454
  const CONFIG22 = getActiveConfig4();
11319
11455
  const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG22;
11320
- return (0, import_utils21.merge)(DOCUMENT2, {
11456
+ return (0, import_utils222.merge)(DOCUMENT2, {
11321
11457
  theme: THEME2.document,
11322
11458
  fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
11323
11459
  fontSize: TYPOGRAPHY2.base,
@@ -11397,7 +11533,7 @@ var require_cjs10 = __commonJS({
11397
11533
  }
11398
11534
  }
11399
11535
  };
11400
- var import_utils24 = __toESM2(require_cjs42(), 1);
11536
+ var import_utils25 = __toESM2(require_cjs42(), 1);
11401
11537
  var applyReset = (reset = {}) => {
11402
11538
  const CONFIG22 = getActiveConfig4();
11403
11539
  const { RESET: RESET2, TYPOGRAPHY: TYPOGRAPHY2, DOCUMENT: DOCUMENT2 } = CONFIG22;
@@ -11419,8 +11555,8 @@ var require_cjs10 = __commonJS({
11419
11555
  const { body, ...templates } = TYPOGRAPHY2.templates;
11420
11556
  const globalTheme = CONFIG22.useDocumentTheme ? getMediaTheme4("document", `@${CONFIG22.globalTheme}`) : {};
11421
11557
  if (RESET2.html)
11422
- (0, import_utils24.overwriteDeep)(RESET2.html, globalTheme);
11423
- return (0, import_utils24.deepMerge)((0, import_utils24.merge)(RESET2, reset), {
11558
+ (0, import_utils25.overwriteDeep)(RESET2.html, globalTheme);
11559
+ return (0, import_utils25.deepMerge)((0, import_utils25.merge)(RESET2, reset), {
11424
11560
  html: {
11425
11561
  position: "absolute",
11426
11562
  // overflow: 'hidden',
@@ -11457,7 +11593,7 @@ var require_cjs10 = __commonJS({
11457
11593
  });
11458
11594
  }
11459
11595
  };
11460
- var import_utils25 = __toESM2(require_cjs42(), 1);
11596
+ var import_utils26 = __toESM2(require_cjs42(), 1);
11461
11597
  var isBorderStyle = (str) => [
11462
11598
  "none",
11463
11599
  "hidden",
@@ -11528,7 +11664,7 @@ var require_cjs10 = __commonJS({
11528
11664
  return v;
11529
11665
  }).join(" ");
11530
11666
  };
11531
- var transfromGap4 = (gap) => (0, import_utils25.isString)(gap) && gap.split(" ").map((v) => getSpacingByKey7(v, "gap").gap).join(" ");
11667
+ var transfromGap4 = (gap) => (0, import_utils26.isString)(gap) && gap.split(" ").map((v) => getSpacingByKey7(v, "gap").gap).join(" ");
11532
11668
  var transformTransition = (transition) => {
11533
11669
  const arr = transition.split(" ");
11534
11670
  if (!arr.length)
@@ -11546,7 +11682,7 @@ var require_cjs10 = __commonJS({
11546
11682
  }).join(" ");
11547
11683
  };
11548
11684
  var transformDuration4 = (duration, props7, propertyName) => {
11549
- if (!(0, import_utils25.isString)(duration))
11685
+ if (!(0, import_utils26.isString)(duration))
11550
11686
  return;
11551
11687
  return duration.split(",").map((v) => getTimingByKey4(v).timing || v).join(",");
11552
11688
  };
@@ -11556,9 +11692,9 @@ var require_cjs10 = __commonJS({
11556
11692
  return;
11557
11693
  return arr.map(transformTransition).join(",");
11558
11694
  };
11559
- var import_utils26 = __toESM2(require_cjs42(), 1);
11695
+ var import_utils27 = __toESM2(require_cjs42(), 1);
11560
11696
  var setCases = (val, key) => {
11561
- if ((0, import_utils26.isFunction)(val))
11697
+ if ((0, import_utils27.isFunction)(val))
11562
11698
  return val();
11563
11699
  return val;
11564
11700
  };
@@ -11659,6 +11795,7 @@ __export(domql_exports, {
11659
11795
  AvatarChooser: () => AvatarChooser,
11660
11796
  Block: () => Block,
11661
11797
  Box: () => Box,
11798
+ Br: () => Br,
11662
11799
  Button: () => Button,
11663
11800
  ButtonSet: () => ButtonSet,
11664
11801
  Caption: () => Caption,
@@ -11697,6 +11834,7 @@ __export(domql_exports, {
11697
11834
  H6: () => H6,
11698
11835
  Headline: () => Headline,
11699
11836
  Hoverable: () => Hoverable,
11837
+ Hr: () => Hr,
11700
11838
  Icon: () => Icon2,
11701
11839
  IconText: () => IconText2,
11702
11840
  Iframe: () => Iframe,
@@ -11755,6 +11893,7 @@ __export(domql_exports, {
11755
11893
  UploadResult: () => UploadResult,
11756
11894
  Video: () => Video,
11757
11895
  XYZ: () => XYZ,
11896
+ calendar: () => calendar,
11758
11897
  getSystemTheme: () => getSystemTheme,
11759
11898
  keySetters: () => keySetters
11760
11899
  });
@@ -11903,6 +12042,11 @@ var Block = {
11903
12042
  columnCount: ({ props: props7 }) => props7.columnCount && { columns: props7.columnCount }
11904
12043
  }
11905
12044
  };
12045
+ var Hr = {
12046
+ tag: "hr",
12047
+ props: { margin: "C1 0" }
12048
+ };
12049
+ var Br = { tag: "br" };
11906
12050
  var Span = { tag: "span" };
11907
12051
  var List = {
11908
12052
  tag: "ul",
@@ -14537,12 +14681,17 @@ var DatePickerDay = {
14537
14681
  extend: Button,
14538
14682
  state: true,
14539
14683
  props: ({ state, key }) => {
14540
- const isSelected = state.parent.parent.activeDay === parseInt(key) + 1;
14684
+ const rootState = state.parent.parent.parent;
14685
+ const date = new Date(state._d);
14686
+ const isSelected = rootState.activeDay === date.toString();
14541
14687
  const gridColumnStart = 7 - state.parent.weekItems.weeks[0].dates.length;
14542
- const isWeekend = state.moment.isoWeekday();
14688
+ const { moment } = state;
14689
+ moment._d = date;
14690
+ const isWeekend = moment.day() === 0 || moment.day() === 6;
14543
14691
  return {
14544
14692
  isSelected,
14545
14693
  isWeekend,
14694
+ date: date.toString(),
14546
14695
  textAlign: "center",
14547
14696
  fontSize: "Z1",
14548
14697
  round: "100%",
@@ -14564,10 +14713,9 @@ var DatePickerDay = {
14564
14713
  },
14565
14714
  on: {
14566
14715
  click: (event, element, state) => {
14567
- state.parent.parent.update({
14568
- active: state.parse()
14716
+ state.parent.parent.parent.update({
14717
+ activeDay: element.props.date
14569
14718
  });
14570
- console.log(state);
14571
14719
  }
14572
14720
  }
14573
14721
  };
@@ -14582,6 +14730,20 @@ var DatePickerGrid = {
14582
14730
  childExtend: DatePickerDay,
14583
14731
  $setStateCollection: (el, s) => {
14584
14732
  return s.days;
14733
+ },
14734
+ on: {
14735
+ render: (el, state) => {
14736
+ const { key } = el;
14737
+ const isSelected = state.parent.parent.activeMonth === parseInt(key);
14738
+ if (isSelected) {
14739
+ window.requestAnimationFrame(() => {
14740
+ el.parent.parent.node.scrollTo({
14741
+ left: el.node.offsetLeft,
14742
+ behavior: "smooth"
14743
+ });
14744
+ });
14745
+ }
14746
+ }
14585
14747
  }
14586
14748
  };
14587
14749
 
@@ -14715,12 +14877,27 @@ var DatePickerMonthsSlider = {
14715
14877
  }
14716
14878
  },
14717
14879
  Button_left: {
14718
- icon: "arrowLeft",
14719
- "@dark": {
14720
- theme: "primary @dark .color-only"
14880
+ props: {
14881
+ icon: "arrowLeft",
14882
+ "@dark": {
14883
+ theme: "primary @dark .color-only"
14884
+ },
14885
+ "@light": {
14886
+ theme: "primary @light .color-only"
14887
+ }
14721
14888
  },
14722
- "@light": {
14723
- theme: "primary @light .color-only"
14889
+ on: {
14890
+ click: (ev, el, s) => {
14891
+ const { activeMonth, activeYear } = s;
14892
+ if (activeMonth > 0)
14893
+ s.update({ activeMonth: activeMonth - 1 });
14894
+ else {
14895
+ s.update({
14896
+ activeYear: activeYear - 1,
14897
+ activeMonth: 11
14898
+ });
14899
+ }
14900
+ }
14724
14901
  }
14725
14902
  },
14726
14903
  Flex: {
@@ -14739,13 +14916,18 @@ var DatePickerMonthsSlider = {
14739
14916
  isSelected: state.activeMonth === parseInt(key),
14740
14917
  ".isSelected": { opacity: "1" }
14741
14918
  }),
14742
- render: (el, state) => {
14743
- const { props: props7 } = el;
14744
- const { isSelected } = props7;
14745
- if (isSelected) {
14746
- window.requestAnimationFrame(() => {
14747
- el.parent.parent.node.scrollLeft = el.node.offsetLeft;
14748
- });
14919
+ on: {
14920
+ update: (el, state) => {
14921
+ const { props: props7 } = el;
14922
+ const { isSelected } = props7;
14923
+ if (isSelected) {
14924
+ window.requestAnimationFrame(() => {
14925
+ el.parent.parent.node.scrollTo({
14926
+ left: el.node.offsetLeft,
14927
+ behavior: "smooth"
14928
+ });
14929
+ });
14930
+ }
14749
14931
  }
14750
14932
  }
14751
14933
  },
@@ -14767,12 +14949,27 @@ var DatePickerMonthsSlider = {
14767
14949
  }
14768
14950
  },
14769
14951
  Button_right: {
14770
- icon: "arrowRight",
14771
- "@dark": {
14772
- theme: "primary @dark .color-only"
14952
+ props: {
14953
+ icon: "arrowRight",
14954
+ "@dark": {
14955
+ theme: "primary @dark .color-only"
14956
+ },
14957
+ "@light": {
14958
+ theme: "primary @light .color-only"
14959
+ }
14773
14960
  },
14774
- "@light": {
14775
- theme: "primary @light .color-only"
14961
+ on: {
14962
+ click: (ev, el, s) => {
14963
+ const { activeMonth, activeYear } = s;
14964
+ if (activeMonth < 11)
14965
+ s.update({ activeMonth: activeMonth + 1 });
14966
+ else {
14967
+ s.update({
14968
+ activeYear: activeYear + 1,
14969
+ activeMonth: 0
14970
+ });
14971
+ }
14972
+ }
14776
14973
  }
14777
14974
  }
14778
14975
  };
@@ -14816,7 +15013,7 @@ var extractMonthDays = (data) => {
14816
15013
  const result = [];
14817
15014
  data.weeks.forEach((week) => {
14818
15015
  week.dates.forEach((date) => {
14819
- result.push(date);
15016
+ result.push({ ...date, _d: date.moment._d.toString() });
14820
15017
  });
14821
15018
  });
14822
15019
  return result;
@@ -14876,6 +15073,8 @@ var DatePicker = {
14876
15073
  activeDay: 14
14877
15074
  },
14878
15075
  props: {
15076
+ width: "fit-content",
15077
+ margin: "0",
14879
15078
  maxHeight: "G+B2"
14880
15079
  },
14881
15080
  DatePickerYears: {