@symbo.ls/scratch 2.11.450 → 2.11.464

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.
@@ -302,6 +302,8 @@ var require_array = __commonJS({
302
302
  arraysEqual: () => arraysEqual,
303
303
  cutArrayAfterValue: () => cutArrayAfterValue,
304
304
  cutArrayBeforeValue: () => cutArrayBeforeValue,
305
+ filterArrays: () => filterArrays,
306
+ filterArraysFast: () => filterArraysFast,
305
307
  getFrequencyInArray: () => getFrequencyInArray,
306
308
  joinArrays: () => joinArrays,
307
309
  mergeAndCloneIfArray: () => mergeAndCloneIfArray,
@@ -410,6 +412,13 @@ var require_array = __commonJS({
410
412
  }
411
413
  return true;
412
414
  };
415
+ var filterArrays = (sourceArr, excludeArr) => {
416
+ return sourceArr.filter((item) => !excludeArr.includes(item));
417
+ };
418
+ var filterArraysFast = (sourceArr, excludeArr) => {
419
+ const excludeSet = new Set(excludeArr);
420
+ return sourceArr.filter((item) => !excludeSet.has(item));
421
+ };
413
422
  }
414
423
  });
415
424
 
@@ -603,6 +612,7 @@ var require_object = __commonJS({
603
612
  diff: () => diff,
604
613
  diffArrays: () => diffArrays,
605
614
  diffObjects: () => diffObjects,
615
+ excludeKeysFromObject: () => excludeKeysFromObject,
606
616
  exec: () => exec,
607
617
  flattenRecursive: () => flattenRecursive,
608
618
  hasOwnProperty: () => hasOwnProperty,
@@ -758,10 +768,10 @@ var require_object = __commonJS({
758
768
  return o;
759
769
  };
760
770
  var deepStringify = (obj, stringified = {}) => {
761
- var _a;
771
+ var _a, _b;
762
772
  if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
763
- console.warn("Trying to clone element or state at", obj);
764
- obj = (_a = obj.parse) == null ? void 0 : _a.call(obj);
773
+ (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
774
+ obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
765
775
  }
766
776
  for (const prop in obj) {
767
777
  const objProp = obj[prop];
@@ -831,7 +841,7 @@ var require_object = __commonJS({
831
841
  if ((0, import_types.isArray)(value)) {
832
842
  str += "[\n";
833
843
  for (const element of value) {
834
- if ((0, import_types.isObject)(element) && element !== null) {
844
+ if ((0, import_types.isObjectLike)(element) && element !== null) {
835
845
  str += `${spaces} ${objectToString(element, indent + 2)},
836
846
  `;
837
847
  } else if ((0, import_types.isString)(element)) {
@@ -930,7 +940,7 @@ var require_object = __commonJS({
930
940
  };
931
941
  var stringToObject = (str, opts = { verbose: true }) => {
932
942
  try {
933
- return import_globals2.window.eval("(" + str + ")");
943
+ return str ? import_globals2.window.eval("(" + str + ")") : {};
934
944
  } catch (e) {
935
945
  if (opts.verbose)
936
946
  console.warn(e);
@@ -1010,20 +1020,27 @@ var require_object = __commonJS({
1010
1020
  return acc;
1011
1021
  }, deletedValues);
1012
1022
  };
1013
- var overwrite = (element, params, excludeFrom = []) => {
1014
- const { ref } = element;
1015
- const changes = {};
1023
+ var overwrite = (element, params, opts = {}) => {
1024
+ const { __ref: ref } = element;
1025
+ const excl = opts.exclude || [];
1026
+ const allowUnderscore = opts.preventUnderscore;
1027
+ const preventCaching = opts.preventCaching;
1016
1028
  for (const e in params) {
1017
- if (excludeFrom.includes(e) || e.startsWith("__"))
1029
+ if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
1018
1030
  continue;
1019
1031
  const elementProp = element[e];
1020
1032
  const paramsProp = params[e];
1021
- if (paramsProp) {
1022
- ref.__cache[e] = changes[e] = elementProp;
1023
- ref[e] = paramsProp;
1033
+ if (paramsProp !== void 0) {
1034
+ element[e] = paramsProp;
1035
+ if (ref && !preventCaching) {
1036
+ ref.__cache[e] = elementProp;
1037
+ }
1038
+ if ((0, import_types.isObject)(opts.diff)) {
1039
+ diff[e] = elementProp;
1040
+ }
1024
1041
  }
1025
1042
  }
1026
- return changes;
1043
+ return element;
1027
1044
  };
1028
1045
  var overwriteShallow = (obj, params, excludeFrom = []) => {
1029
1046
  for (const e in params) {
@@ -1033,23 +1050,26 @@ var require_object = __commonJS({
1033
1050
  }
1034
1051
  return obj;
1035
1052
  };
1036
- var overwriteDeep = (obj, params, excludeFrom = [], visited = /* @__PURE__ */ new WeakMap()) => {
1053
+ var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
1054
+ const excl = opts.exclude || [];
1055
+ const forcedExclude = opts.preventForce ? [] : ["node", "window"];
1037
1056
  if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
1038
1057
  return params;
1039
1058
  }
1040
- if (visited.has(obj)) {
1059
+ if (visited.has(obj))
1041
1060
  return visited.get(obj);
1042
- }
1043
1061
  visited.set(obj, obj);
1044
1062
  for (const e in params) {
1045
- if (e === "__ref" || excludeFrom.includes(e) || e.startsWith("__"))
1063
+ if (!Object.hasOwnProperty.call(params, e))
1064
+ continue;
1065
+ if (excl.includes(e) || forcedExclude && e.startsWith("__"))
1046
1066
  continue;
1047
1067
  const objProp = obj[e];
1048
1068
  const paramsProp = params[e];
1049
1069
  if ((0, import_node.isDOMNode)(paramsProp)) {
1050
1070
  obj[e] = paramsProp;
1051
1071
  } else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
1052
- obj[e] = overwriteDeep(objProp, paramsProp, excludeFrom, visited);
1072
+ obj[e] = overwriteDeep(objProp, paramsProp, opts, visited);
1053
1073
  } else if (paramsProp !== void 0) {
1054
1074
  obj[e] = paramsProp;
1055
1075
  }
@@ -1231,6 +1251,11 @@ var require_object = __commonJS({
1231
1251
  }
1232
1252
  return detect(obj);
1233
1253
  };
1254
+ var excludeKeysFromObject = (obj, excludedKeys) => {
1255
+ const result = { ...obj };
1256
+ excludedKeys.forEach((key) => delete result[key]);
1257
+ return result;
1258
+ };
1234
1259
  }
1235
1260
  });
1236
1261
 
@@ -1386,9 +1411,11 @@ var require_cookie = __commonJS({
1386
1411
  var cookie_exports = {};
1387
1412
  __export2(cookie_exports, {
1388
1413
  getCookie: () => getCookie,
1414
+ getLocalStorage: () => getLocalStorage,
1389
1415
  isMobile: () => isMobile,
1390
1416
  removeCookie: () => removeCookie,
1391
- setCookie: () => setCookie
1417
+ setCookie: () => setCookie,
1418
+ setLocalStorage: () => setLocalStorage
1392
1419
  });
1393
1420
  module2.exports = __toCommonJS2(cookie_exports);
1394
1421
  var import_types = require_types();
@@ -1422,6 +1449,27 @@ var require_cookie = __commonJS({
1422
1449
  return;
1423
1450
  import_utils10.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
1424
1451
  };
1452
+ function getLocalStorage(key) {
1453
+ let savedJSON;
1454
+ if (window.localStorage) {
1455
+ try {
1456
+ savedJSON = JSON.parse(window.localStorage.getItem(key));
1457
+ } catch (e) {
1458
+ }
1459
+ }
1460
+ if (typeof savedJSON !== "undefined") {
1461
+ return savedJSON;
1462
+ }
1463
+ }
1464
+ function setLocalStorage(key, data) {
1465
+ if (data && window.localStorage) {
1466
+ if (typeof data === "object") {
1467
+ window.localStorage.setItem(key, JSON.stringify(data));
1468
+ } else {
1469
+ window.localStorage.setItem(key, data);
1470
+ }
1471
+ }
1472
+ }
1425
1473
  }
1426
1474
  });
1427
1475
 
@@ -1625,7 +1673,9 @@ var require_component = __commonJS({
1625
1673
  applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
1626
1674
  checkIfKeyIsComponent: () => checkIfKeyIsComponent,
1627
1675
  checkIfKeyIsProperty: () => checkIfKeyIsProperty,
1676
+ checkIfSugar: () => checkIfSugar,
1628
1677
  extendizeByKey: () => extendizeByKey,
1678
+ getCapitalCaseKeys: () => getCapitalCaseKeys,
1629
1679
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
1630
1680
  getExtendsInElement: () => getExtendsInElement,
1631
1681
  hasVariantProp: () => hasVariantProp,
@@ -1650,6 +1700,8 @@ var require_component = __commonJS({
1650
1700
  return /^[a-z]*$/.test(firstCharKey);
1651
1701
  };
1652
1702
  var addAdditionalExtend = (newExtend, element) => {
1703
+ if (!newExtend)
1704
+ return element;
1653
1705
  const { extend: elementExtend } = element;
1654
1706
  const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
1655
1707
  const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
@@ -1657,26 +1709,44 @@ var require_component = __commonJS({
1657
1709
  return { ...element, extend };
1658
1710
  };
1659
1711
  var checkIfSugar = (element, parent, key) => {
1660
- const { extend, props, childExtend, extends: extendProps, childrenExtends, childProps, children, on, $collection, $stateCollection, $propsCollection } = element;
1712
+ var _a;
1713
+ const {
1714
+ extend,
1715
+ props,
1716
+ childExtend,
1717
+ extends: extendProps,
1718
+ childExtends,
1719
+ childProps,
1720
+ children,
1721
+ on,
1722
+ $collection,
1723
+ $stateCollection,
1724
+ $propsCollection
1725
+ } = element;
1661
1726
  const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
1662
- return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
1727
+ if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
1728
+ const logErr = (_a = parent || element) == null ? void 0 : _a.error;
1729
+ if (logErr)
1730
+ logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
1731
+ }
1732
+ return !hasComponentAttrs || childProps || extendProps || children || childExtends;
1663
1733
  };
1664
1734
  var extendizeByKey = (element, parent, key) => {
1665
1735
  const { context } = parent;
1666
- const { tag, extend, childrenExtends } = element;
1667
- const isSugar = checkIfSugar(element);
1736
+ const { tag, extend, childExtends } = element;
1737
+ const isSugar = checkIfSugar(element, parent, key);
1668
1738
  const extendFromKey = key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
1669
1739
  const isExtendKeyComponent = context && context.components[extendFromKey];
1670
1740
  if (element === isExtendKeyComponent)
1671
1741
  return element;
1672
1742
  else if (isSugar) {
1673
- const newElem = {
1743
+ const newElem = addAdditionalExtend(element.extends, {
1674
1744
  extend: extendFromKey,
1675
1745
  tag,
1676
1746
  props: { ...element }
1677
- };
1678
- if (childrenExtends)
1679
- newElem.childExtend = childrenExtends;
1747
+ });
1748
+ if (childExtends)
1749
+ newElem.childExtend = childExtends;
1680
1750
  return newElem;
1681
1751
  } else if (!extend || extend === true) {
1682
1752
  return {
@@ -1705,23 +1775,24 @@ var require_component = __commonJS({
1705
1775
  const childKey = childElems[i];
1706
1776
  const childElem = element[childKey];
1707
1777
  const newChild = element.props[childKey];
1778
+ const assignChild = (val) => {
1779
+ element[childKey] = val;
1780
+ delete element.props[childKey];
1781
+ };
1708
1782
  if (newChild == null ? void 0 : newChild.ignoreExtend)
1709
1783
  continue;
1710
- if (!childElem)
1711
- element[childKey] = (0, import__.deepCloneWithExtend)(newChild);
1784
+ if (newChild === null)
1785
+ assignChild(null);
1786
+ else if (!childElem)
1787
+ assignChild((0, import__.deepCloneWithExtend)(newChild));
1712
1788
  else {
1713
- const isSugar = checkIfSugar(childElem);
1714
- if (!isSugar)
1789
+ const isSugarChildElem = checkIfSugar(childElem, parent, key);
1790
+ if (isSugarChildElem)
1715
1791
  continue;
1716
- const inheritedChildElem = element[childKey].props;
1717
- if ((0, import__.isObjectLike)(newChild)) {
1718
- (0, import__.overwriteDeep)(inheritedChildElem, newChild);
1719
- } else if ((0, import__.isFunction)(newChild)) {
1720
- element[childKey] = {
1721
- extend: element[childKey],
1722
- props: newChild
1723
- };
1724
- }
1792
+ assignChild({
1793
+ extend: element[childKey],
1794
+ props: newChild
1795
+ });
1725
1796
  }
1726
1797
  }
1727
1798
  };
@@ -2145,6 +2216,8 @@ var require_cjs2 = __commonJS({
2145
2216
  arraysEqual: () => arraysEqual,
2146
2217
  cutArrayAfterValue: () => cutArrayAfterValue,
2147
2218
  cutArrayBeforeValue: () => cutArrayBeforeValue,
2219
+ filterArrays: () => filterArrays,
2220
+ filterArraysFast: () => filterArraysFast,
2148
2221
  getFrequencyInArray: () => getFrequencyInArray,
2149
2222
  joinArrays: () => joinArrays,
2150
2223
  mergeAndCloneIfArray: () => mergeAndCloneIfArray,
@@ -2253,6 +2326,13 @@ var require_cjs2 = __commonJS({
2253
2326
  }
2254
2327
  return true;
2255
2328
  };
2329
+ var filterArrays = (sourceArr, excludeArr) => {
2330
+ return sourceArr.filter((item) => !excludeArr.includes(item));
2331
+ };
2332
+ var filterArraysFast = (sourceArr, excludeArr) => {
2333
+ const excludeSet = new Set(excludeArr);
2334
+ return sourceArr.filter((item) => !excludeSet.has(item));
2335
+ };
2256
2336
  }
2257
2337
  });
2258
2338
  var require_string2 = __commonJS2({
@@ -2442,9 +2522,11 @@ var require_cjs2 = __commonJS({
2442
2522
  diff: () => diff,
2443
2523
  diffArrays: () => diffArrays,
2444
2524
  diffObjects: () => diffObjects,
2525
+ excludeKeysFromObject: () => excludeKeysFromObject,
2445
2526
  exec: () => exec,
2446
2527
  flattenRecursive: () => flattenRecursive,
2447
2528
  hasOwnProperty: () => hasOwnProperty,
2529
+ isCyclic: () => isCyclic,
2448
2530
  isEmpty: () => isEmpty,
2449
2531
  isEmptyObject: () => isEmptyObject,
2450
2532
  isEqualDeep: () => isEqualDeep,
@@ -2570,28 +2652,36 @@ var require_cjs2 = __commonJS({
2570
2652
  }
2571
2653
  return clone2;
2572
2654
  };
2573
- var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}) => {
2655
+ var deepCloneWithExtend = (obj, excludeFrom = ["node"], options = {}, visited = /* @__PURE__ */ new WeakSet()) => {
2656
+ if ((0, import_types.isObjectLike)(obj)) {
2657
+ if (visited.has(obj)) {
2658
+ return obj;
2659
+ }
2660
+ visited.add(obj);
2661
+ }
2574
2662
  const o = options.window ? (0, import_types.isArray)(obj) ? new options.window.Array([]) : new options.window.Object({}) : (0, import_types.isArray)(obj) ? [] : {};
2575
2663
  for (const prop in obj) {
2576
2664
  if (!Object.prototype.hasOwnProperty.call(obj, prop))
2577
2665
  continue;
2578
2666
  const objProp = obj[prop];
2579
- if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp))
2667
+ if (excludeFrom.includes(prop) || prop.startsWith("__") || options.cleanUndefined && (0, import_types.isUndefined)(objProp) || options.cleanNull && (0, import_types.isNull)(objProp)) {
2580
2668
  continue;
2669
+ }
2581
2670
  if ((0, import_types.isObjectLike)(objProp)) {
2582
- o[prop] = deepCloneWithExtend(objProp, excludeFrom, options);
2671
+ o[prop] = deepCloneWithExtend(objProp, excludeFrom, options, visited);
2583
2672
  } else if ((0, import_types.isFunction)(objProp) && options.window) {
2584
2673
  o[prop] = (options.window || import_globals2.window).eval("(" + objProp.toString() + ")");
2585
- } else
2674
+ } else {
2586
2675
  o[prop] = objProp;
2676
+ }
2587
2677
  }
2588
2678
  return o;
2589
2679
  };
2590
2680
  var deepStringify = (obj, stringified = {}) => {
2591
- var _a;
2681
+ var _a, _b;
2592
2682
  if (obj.node || obj.__ref || obj.parent || obj.__element || obj.parse) {
2593
- console.warn("Trying to clone element or state at", obj);
2594
- obj = (_a = obj.parse) == null ? void 0 : _a.call(obj);
2683
+ (obj.__element || ((_a = obj.parent) == null ? void 0 : _a.__element)).warn("Trying to clone element or state at", obj);
2684
+ obj = (_b = obj.parse) == null ? void 0 : _b.call(obj);
2595
2685
  }
2596
2686
  for (const prop in obj) {
2597
2687
  const objProp = obj[prop];
@@ -2661,7 +2751,7 @@ var require_cjs2 = __commonJS({
2661
2751
  if ((0, import_types.isArray)(value)) {
2662
2752
  str += "[\n";
2663
2753
  for (const element of value) {
2664
- if ((0, import_types.isObject)(element) && element !== null) {
2754
+ if ((0, import_types.isObjectLike)(element) && element !== null) {
2665
2755
  str += `${spaces} ${objectToString(element, indent + 2)},
2666
2756
  `;
2667
2757
  } else if ((0, import_types.isString)(element)) {
@@ -2760,7 +2850,7 @@ var require_cjs2 = __commonJS({
2760
2850
  };
2761
2851
  var stringToObject = (str, opts = { verbose: true }) => {
2762
2852
  try {
2763
- return import_globals2.window.eval("(" + str + ")");
2853
+ return str ? import_globals2.window.eval("(" + str + ")") : {};
2764
2854
  } catch (e) {
2765
2855
  if (opts.verbose)
2766
2856
  console.warn(e);
@@ -2840,20 +2930,27 @@ var require_cjs2 = __commonJS({
2840
2930
  return acc;
2841
2931
  }, deletedValues);
2842
2932
  };
2843
- var overwrite = (element, params, excludeFrom = []) => {
2844
- const { ref } = element;
2845
- const changes = {};
2933
+ var overwrite = (element, params, opts = {}) => {
2934
+ const { __ref: ref } = element;
2935
+ const excl = opts.exclude || [];
2936
+ const allowUnderscore = opts.preventUnderscore;
2937
+ const preventCaching = opts.preventCaching;
2846
2938
  for (const e in params) {
2847
- if (excludeFrom.includes(e) || e.startsWith("__"))
2939
+ if (excl.includes(e) || !allowUnderscore && e.startsWith("__"))
2848
2940
  continue;
2849
2941
  const elementProp = element[e];
2850
2942
  const paramsProp = params[e];
2851
- if (paramsProp) {
2852
- ref.__cache[e] = changes[e] = elementProp;
2853
- ref[e] = paramsProp;
2943
+ if (paramsProp !== void 0) {
2944
+ element[e] = paramsProp;
2945
+ if (ref && !preventCaching) {
2946
+ ref.__cache[e] = elementProp;
2947
+ }
2948
+ if ((0, import_types.isObject)(opts.diff)) {
2949
+ diff[e] = elementProp;
2950
+ }
2854
2951
  }
2855
2952
  }
2856
- return changes;
2953
+ return element;
2857
2954
  };
2858
2955
  var overwriteShallow = (obj, params, excludeFrom = []) => {
2859
2956
  for (const e in params) {
@@ -2863,23 +2960,26 @@ var require_cjs2 = __commonJS({
2863
2960
  }
2864
2961
  return obj;
2865
2962
  };
2866
- var overwriteDeep = (obj, params, excludeFrom = [], visited = /* @__PURE__ */ new WeakMap()) => {
2963
+ var overwriteDeep = (obj, params, opts = {}, visited = /* @__PURE__ */ new WeakMap()) => {
2964
+ const excl = opts.exclude || [];
2965
+ const forcedExclude = opts.preventForce ? [] : ["node", "window"];
2867
2966
  if (!(0, import_types.isObjectLike)(obj) || !(0, import_types.isObjectLike)(params) || (0, import_node.isDOMNode)(obj) || (0, import_node.isDOMNode)(params)) {
2868
2967
  return params;
2869
2968
  }
2870
- if (visited.has(obj)) {
2969
+ if (visited.has(obj))
2871
2970
  return visited.get(obj);
2872
- }
2873
2971
  visited.set(obj, obj);
2874
2972
  for (const e in params) {
2875
- if (e === "__ref" || excludeFrom.includes(e) || e.startsWith("__"))
2973
+ if (!Object.hasOwnProperty.call(params, e))
2974
+ continue;
2975
+ if (excl.includes(e) || forcedExclude && e.startsWith("__"))
2876
2976
  continue;
2877
2977
  const objProp = obj[e];
2878
2978
  const paramsProp = params[e];
2879
2979
  if ((0, import_node.isDOMNode)(paramsProp)) {
2880
2980
  obj[e] = paramsProp;
2881
2981
  } else if ((0, import_types.isObjectLike)(objProp) && (0, import_types.isObjectLike)(paramsProp)) {
2882
- obj[e] = overwriteDeep(objProp, paramsProp, excludeFrom, visited);
2982
+ obj[e] = overwriteDeep(objProp, paramsProp, opts, visited);
2883
2983
  } else if (paramsProp !== void 0) {
2884
2984
  obj[e] = paramsProp;
2885
2985
  }
@@ -3042,6 +3142,30 @@ var require_cjs2 = __commonJS({
3042
3142
  }
3043
3143
  }
3044
3144
  };
3145
+ var isCyclic = (obj) => {
3146
+ const seenObjects = [];
3147
+ function detect(obj2) {
3148
+ if (obj2 && typeof obj2 === "object") {
3149
+ if (seenObjects.indexOf(obj2) !== -1) {
3150
+ return true;
3151
+ }
3152
+ seenObjects.push(obj2);
3153
+ for (const key in obj2) {
3154
+ if (Object.hasOwnProperty.call(obj2, key) && detect(obj2[key])) {
3155
+ console.log(obj2, "cycle at " + key);
3156
+ return true;
3157
+ }
3158
+ }
3159
+ }
3160
+ return false;
3161
+ }
3162
+ return detect(obj);
3163
+ };
3164
+ var excludeKeysFromObject = (obj, excludedKeys) => {
3165
+ const result = { ...obj };
3166
+ excludedKeys.forEach((key) => delete result[key]);
3167
+ return result;
3168
+ };
3045
3169
  }
3046
3170
  });
3047
3171
  var require_function2 = __commonJS2({
@@ -3191,9 +3315,11 @@ var require_cjs2 = __commonJS({
3191
3315
  var cookie_exports = {};
3192
3316
  __export22(cookie_exports, {
3193
3317
  getCookie: () => getCookie,
3318
+ getLocalStorage: () => getLocalStorage,
3194
3319
  isMobile: () => isMobile,
3195
3320
  removeCookie: () => removeCookie,
3196
- setCookie: () => setCookie
3321
+ setCookie: () => setCookie,
3322
+ setLocalStorage: () => setLocalStorage
3197
3323
  });
3198
3324
  module22.exports = __toCommonJS22(cookie_exports);
3199
3325
  var import_types = require_types2();
@@ -3227,6 +3353,27 @@ var require_cjs2 = __commonJS({
3227
3353
  return;
3228
3354
  import_utils32.document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
3229
3355
  };
3356
+ function getLocalStorage(key) {
3357
+ let savedJSON;
3358
+ if (window.localStorage) {
3359
+ try {
3360
+ savedJSON = JSON.parse(window.localStorage.getItem(key));
3361
+ } catch (e) {
3362
+ }
3363
+ }
3364
+ if (typeof savedJSON !== "undefined") {
3365
+ return savedJSON;
3366
+ }
3367
+ }
3368
+ function setLocalStorage(key, data) {
3369
+ if (data && window.localStorage) {
3370
+ if (typeof data === "object") {
3371
+ window.localStorage.setItem(key, JSON.stringify(data));
3372
+ } else {
3373
+ window.localStorage.setItem(key, data);
3374
+ }
3375
+ }
3376
+ }
3230
3377
  }
3231
3378
  });
3232
3379
  var require_tags2 = __commonJS2({
@@ -3426,7 +3573,9 @@ var require_cjs2 = __commonJS({
3426
3573
  applyKeyComponentAsExtend: () => applyKeyComponentAsExtend,
3427
3574
  checkIfKeyIsComponent: () => checkIfKeyIsComponent,
3428
3575
  checkIfKeyIsProperty: () => checkIfKeyIsProperty,
3576
+ checkIfSugar: () => checkIfSugar,
3429
3577
  extendizeByKey: () => extendizeByKey,
3578
+ getCapitalCaseKeys: () => getCapitalCaseKeys,
3430
3579
  getChildrenComponentsByKey: () => getChildrenComponentsByKey,
3431
3580
  getExtendsInElement: () => getExtendsInElement,
3432
3581
  hasVariantProp: () => hasVariantProp,
@@ -3451,6 +3600,8 @@ var require_cjs2 = __commonJS({
3451
3600
  return /^[a-z]*$/.test(firstCharKey);
3452
3601
  };
3453
3602
  var addAdditionalExtend = (newExtend, element) => {
3603
+ if (!newExtend)
3604
+ return element;
3454
3605
  const { extend: elementExtend } = element;
3455
3606
  const originalArray = (0, import__.isArray)(elementExtend) ? elementExtend : [elementExtend];
3456
3607
  const receivedArray = (0, import__.isArray)(newExtend) ? newExtend : [newExtend];
@@ -3458,26 +3609,44 @@ var require_cjs2 = __commonJS({
3458
3609
  return { ...element, extend };
3459
3610
  };
3460
3611
  var checkIfSugar = (element, parent, key) => {
3461
- const { extend, props, childExtend, extends: extendProps, childrenExtends, childProps, children, on, $collection, $stateCollection, $propsCollection } = element;
3612
+ var _a;
3613
+ const {
3614
+ extend,
3615
+ props,
3616
+ childExtend,
3617
+ extends: extendProps,
3618
+ childExtends,
3619
+ childProps,
3620
+ children,
3621
+ on,
3622
+ $collection,
3623
+ $stateCollection,
3624
+ $propsCollection
3625
+ } = element;
3462
3626
  const hasComponentAttrs = extend || childExtend || props || on || $collection || $stateCollection || $propsCollection;
3463
- return !hasComponentAttrs || childProps || extendProps || children || childrenExtends;
3627
+ if (hasComponentAttrs && (childProps || extendProps || children || childExtends)) {
3628
+ const logErr = (_a = parent || element) == null ? void 0 : _a.error;
3629
+ if (logErr)
3630
+ logErr.call(element, "Sugar component includes params for builtin components", { verbose: true });
3631
+ }
3632
+ return !hasComponentAttrs || childProps || extendProps || children || childExtends;
3464
3633
  };
3465
3634
  var extendizeByKey = (element, parent, key) => {
3466
3635
  const { context } = parent;
3467
- const { tag, extend, childrenExtends } = element;
3468
- const isSugar = checkIfSugar(element);
3636
+ const { tag, extend, childExtends } = element;
3637
+ const isSugar = checkIfSugar(element, parent, key);
3469
3638
  const extendFromKey = key.includes("+") ? key.split("+") : key.includes("_") ? [key.split("_")[0]] : key.includes(".") && !checkIfKeyIsComponent(key.split(".")[1]) ? [key.split(".")[0]] : [key];
3470
3639
  const isExtendKeyComponent = context && context.components[extendFromKey];
3471
3640
  if (element === isExtendKeyComponent)
3472
3641
  return element;
3473
3642
  else if (isSugar) {
3474
- const newElem = {
3643
+ const newElem = addAdditionalExtend(element.extends, {
3475
3644
  extend: extendFromKey,
3476
3645
  tag,
3477
3646
  props: { ...element }
3478
- };
3479
- if (childrenExtends)
3480
- newElem.childExtend = childrenExtends;
3647
+ });
3648
+ if (childExtends)
3649
+ newElem.childExtend = childExtends;
3481
3650
  return newElem;
3482
3651
  } else if (!extend || extend === true) {
3483
3652
  return {
@@ -3506,23 +3675,24 @@ var require_cjs2 = __commonJS({
3506
3675
  const childKey = childElems[i];
3507
3676
  const childElem = element[childKey];
3508
3677
  const newChild = element.props[childKey];
3678
+ const assignChild = (val) => {
3679
+ element[childKey] = val;
3680
+ delete element.props[childKey];
3681
+ };
3509
3682
  if (newChild == null ? void 0 : newChild.ignoreExtend)
3510
3683
  continue;
3511
- if (!childElem)
3512
- element[childKey] = (0, import__.deepCloneWithExtend)(newChild);
3684
+ if (newChild === null)
3685
+ assignChild(null);
3686
+ else if (!childElem)
3687
+ assignChild((0, import__.deepCloneWithExtend)(newChild));
3513
3688
  else {
3514
- const isSugar = checkIfSugar(childElem);
3515
- if (!isSugar)
3689
+ const isSugarChildElem = checkIfSugar(childElem, parent, key);
3690
+ if (isSugarChildElem)
3516
3691
  continue;
3517
- const inheritedChildElem = element[childKey].props;
3518
- if ((0, import__.isObjectLike)(newChild)) {
3519
- (0, import__.overwriteDeep)(inheritedChildElem, newChild);
3520
- } else if ((0, import__.isFunction)(newChild)) {
3521
- element[childKey] = {
3522
- extend: element[childKey],
3523
- props: newChild
3524
- };
3525
- }
3692
+ assignChild({
3693
+ extend: element[childKey],
3694
+ props: newChild
3695
+ });
3526
3696
  }
3527
3697
  }
3528
3698
  };
@@ -4114,7 +4284,7 @@ var CONFIG = {
4114
4284
  useVariable: true,
4115
4285
  useReset: true,
4116
4286
  CSS_VARS,
4117
- ...defaultConfig_exports
4287
+ ...void 0 || defaultConfig_exports
4118
4288
  };
4119
4289
  var cachedConfig = (0, import_utils.deepClone)(CONFIG);
4120
4290
  var FACTORY = {