@sunggang/ui-lib 0.1.44 → 0.1.46

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/index.esm.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import React__default, { useMemo, useRef, useReducer, useEffect, useCallback, forwardRef, useImperativeHandle, Fragment, useState } from 'react';
4
+ import { Icon } from '@iconify/react';
4
5
  import * as SwitchPrimitives from '@radix-ui/react-switch';
5
6
  import { clsx } from 'clsx';
6
7
  import { twMerge } from 'tailwind-merge';
@@ -14,6 +15,9 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
14
15
  import { Calendar as Calendar$2, DateRange } from 'react-date-range';
15
16
  import * as locales from 'react-date-range/dist/locale';
16
17
  import format$1 from 'date-fns/format';
18
+ import '@tanstack/react-table';
19
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
20
+ import { ChevronRightIcon, CheckIcon, DotFilledIcon } from '@radix-ui/react-icons';
17
21
 
18
22
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
19
23
  function getDefaultExportFromCjs(x) {
@@ -64550,14 +64554,14 @@ var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
64550
64554
  * This source code is licensed under the MIT license found in the
64551
64555
  * LICENSE file in the root directory of this source tree.
64552
64556
  */
64553
- function _instanceof$4(left, right) {
64557
+ function _instanceof$3(left, right) {
64554
64558
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
64555
64559
  return !!right[Symbol.hasInstance](left);
64556
64560
  } else {
64557
64561
  return left instanceof right;
64558
64562
  }
64559
64563
  }
64560
- function _type_of$2(obj) {
64564
+ function _type_of$1(obj) {
64561
64565
  "@swc/helpers - typeof";
64562
64566
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
64563
64567
  }
@@ -64601,7 +64605,7 @@ if (process.env.NODE_ENV !== "production") {
64601
64605
  // This is intentionally an invariant that gets caught. It's the same
64602
64606
  // behavior as without this statement except with a better message.
64603
64607
  if (typeof typeSpecs[typeSpecName] !== "function") {
64604
- var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; " + "it must be a function, usually from the `prop-types` package, but received `" + _type_of$2(typeSpecs[typeSpecName]) + "`." + "This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
64608
+ var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; " + "it must be a function, usually from the `prop-types` package, but received `" + _type_of$1(typeSpecs[typeSpecName]) + "`." + "This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
64605
64609
  err.name = "Invariant Violation";
64606
64610
  throw err;
64607
64611
  }
@@ -64609,10 +64613,10 @@ if (process.env.NODE_ENV !== "production") {
64609
64613
  } catch (ex) {
64610
64614
  error = ex;
64611
64615
  }
64612
- if (error && !_instanceof$4(error, Error)) {
64613
- printWarning$1((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker " + "function must return `null` or an `Error` but returned a " + (typeof error === "undefined" ? "undefined" : _type_of$2(error)) + ". " + "You may have forgotten to pass an argument to the type checker " + "creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and " + "shape all require an argument).");
64616
+ if (error && !_instanceof$3(error, Error)) {
64617
+ printWarning$1((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker " + "function must return `null` or an `Error` but returned a " + (typeof error === "undefined" ? "undefined" : _type_of$1(error)) + ". " + "You may have forgotten to pass an argument to the type checker " + "creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and " + "shape all require an argument).");
64614
64618
  }
64615
- if (_instanceof$4(error, Error) && !(error.message in loggedTypeFailures)) {
64619
+ if (_instanceof$3(error, Error) && !(error.message in loggedTypeFailures)) {
64616
64620
  // Only monitor this failure once because there tends to be a lot of the
64617
64621
  // same error.
64618
64622
  loggedTypeFailures[error.message] = true;
@@ -64640,14 +64644,14 @@ var checkPropTypes_1 = checkPropTypes$1;
64640
64644
  * This source code is licensed under the MIT license found in the
64641
64645
  * LICENSE file in the root directory of this source tree.
64642
64646
  */
64643
- function _instanceof$3(left, right) {
64647
+ function _instanceof$2(left, right) {
64644
64648
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
64645
64649
  return !!right[Symbol.hasInstance](left);
64646
64650
  } else {
64647
64651
  return left instanceof right;
64648
64652
  }
64649
64653
  }
64650
- function _type_of$1(obj) {
64654
+ function _type_of(obj) {
64651
64655
  "@swc/helpers - typeof";
64652
64656
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
64653
64657
  }
@@ -64865,7 +64869,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
64865
64869
  }
64866
64870
  for(var i = 0; i < propValue.length; i++){
64867
64871
  var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret$1);
64868
- if (_instanceof$3(error, Error)) {
64872
+ if (_instanceof$2(error, Error)) {
64869
64873
  return error;
64870
64874
  }
64871
64875
  }
@@ -64897,7 +64901,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
64897
64901
  }
64898
64902
  function createInstanceTypeChecker(expectedClass) {
64899
64903
  function validate(props, propName, componentName, location, propFullName) {
64900
- if (!_instanceof$3(props[propName], expectedClass)) {
64904
+ if (!_instanceof$2(props[propName], expectedClass)) {
64901
64905
  var expectedClassName = expectedClass.name || ANONYMOUS;
64902
64906
  var actualClassName = getClassName(props[propName]);
64903
64907
  return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
@@ -64948,7 +64952,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
64948
64952
  for(var key in propValue){
64949
64953
  if (has(propValue, key)) {
64950
64954
  var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret$1);
64951
- if (_instanceof$3(error, Error)) {
64955
+ if (_instanceof$2(error, Error)) {
64952
64956
  return error;
64953
64957
  }
64954
64958
  }
@@ -65046,7 +65050,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
65046
65050
  return createChainableTypeChecker(validate);
65047
65051
  }
65048
65052
  function isNode(propValue) {
65049
- switch(typeof propValue === "undefined" ? "undefined" : _type_of$1(propValue)){
65053
+ switch(typeof propValue === "undefined" ? "undefined" : _type_of(propValue)){
65050
65054
  case "number":
65051
65055
  case "string":
65052
65056
  case "undefined":
@@ -65103,18 +65107,18 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
65103
65107
  return true;
65104
65108
  }
65105
65109
  // Fallback for non-spec compliant Symbols which are polyfilled.
65106
- if (typeof Symbol === "function" && _instanceof$3(propValue, Symbol)) {
65110
+ if (typeof Symbol === "function" && _instanceof$2(propValue, Symbol)) {
65107
65111
  return true;
65108
65112
  }
65109
65113
  return false;
65110
65114
  }
65111
65115
  // Equivalent of `typeof` but with special handling for array and regexp.
65112
65116
  function getPropType(propValue) {
65113
- var propType = typeof propValue === "undefined" ? "undefined" : _type_of$1(propValue);
65117
+ var propType = typeof propValue === "undefined" ? "undefined" : _type_of(propValue);
65114
65118
  if (Array.isArray(propValue)) {
65115
65119
  return "array";
65116
65120
  }
65117
- if (_instanceof$3(propValue, RegExp)) {
65121
+ if (_instanceof$2(propValue, RegExp)) {
65118
65122
  // Old webkits (at least until Android 4.0) return 'function' rather than
65119
65123
  // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
65120
65124
  // passes PropTypes.object.
@@ -65133,9 +65137,9 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
65133
65137
  }
65134
65138
  var propType = getPropType(propValue);
65135
65139
  if (propType === "object") {
65136
- if (_instanceof$3(propValue, Date)) {
65140
+ if (_instanceof$2(propValue, Date)) {
65137
65141
  return "date";
65138
- } else if (_instanceof$3(propValue, RegExp)) {
65142
+ } else if (_instanceof$2(propValue, RegExp)) {
65139
65143
  return "regexp";
65140
65144
  }
65141
65145
  }
@@ -65257,7 +65261,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
65257
65261
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
65258
65262
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
65259
65263
  PERFORMANCE OF THIS SOFTWARE.
65260
- ***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */ function _instanceof$2(left, right) {
65264
+ ***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */ function _instanceof$1(left, right) {
65261
65265
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
65262
65266
  return !!right[Symbol.hasInstance](left);
65263
65267
  } else {
@@ -65266,7 +65270,7 @@ PERFORMANCE OF THIS SOFTWARE.
65266
65270
  }
65267
65271
  function __awaiter(thisArg, _arguments, P, generator) {
65268
65272
  function adopt(value) {
65269
- return _instanceof$2(value, P) ? value : new P(function(resolve) {
65273
+ return _instanceof$1(value, P) ? value : new P(function(resolve) {
65270
65274
  resolve(value);
65271
65275
  });
65272
65276
  }
@@ -66067,7 +66071,7 @@ var _default = function(file, acceptedFiles) {
66067
66071
  return true;
66068
66072
  };
66069
66073
 
66070
- function _instanceof$1(left, right) {
66074
+ function _instanceof(left, right) {
66071
66075
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
66072
66076
  return !!right[Symbol.hasInstance](left);
66073
66077
  } else {
@@ -66380,7 +66384,7 @@ function isIeOrEdge() {
66380
66384
  * @param {any} v
66381
66385
  * @returns {boolean} True if v is an abort exception.
66382
66386
  */ function isAbort(v) {
66383
- return _instanceof$1(v, DOMException) && (v.name === "AbortError" || v.code === v.ABORT_ERR);
66387
+ return _instanceof(v, DOMException) && (v.name === "AbortError" || v.code === v.ABORT_ERR);
66384
66388
  }
66385
66389
  /**
66386
66390
  * Check if v is a security error.
@@ -66389,7 +66393,7 @@ function isIeOrEdge() {
66389
66393
  * @param {any} v
66390
66394
  * @returns {boolean} True if v is a security error.
66391
66395
  */ function isSecurityError(v) {
66392
- return _instanceof$1(v, DOMException) && (v.name === "SecurityError" || v.code === v.SECURITY_ERR);
66396
+ return _instanceof(v, DOMException) && (v.name === "SecurityError" || v.code === v.SECURITY_ERR);
66393
66397
  }
66394
66398
  /**
66395
66399
  * Check if v is a MIME type string.
@@ -67447,1972 +67451,18 @@ function v4(options, buf, offset) {
67447
67451
  return stringify(rnds);
67448
67452
  }
67449
67453
 
67450
- function _assert_this_initialized(self) {
67451
- if (self === void 0) {
67452
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
67453
- }
67454
- return self;
67455
- }
67456
- function _class_call_check(instance, Constructor) {
67457
- if (!(instance instanceof Constructor)) {
67458
- throw new TypeError("Cannot call a class as a function");
67459
- }
67460
- }
67461
- function _defineProperties(target, props) {
67462
- for(var i = 0; i < props.length; i++){
67463
- var descriptor = props[i];
67464
- descriptor.enumerable = descriptor.enumerable || false;
67465
- descriptor.configurable = true;
67466
- if ("value" in descriptor) descriptor.writable = true;
67467
- Object.defineProperty(target, descriptor.key, descriptor);
67468
- }
67469
- }
67470
- function _create_class(Constructor, protoProps, staticProps) {
67471
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
67472
- if (staticProps) _defineProperties(Constructor, staticProps);
67473
- return Constructor;
67474
- }
67475
- function _define_property$5(obj, key, value) {
67476
- if (key in obj) {
67477
- Object.defineProperty(obj, key, {
67478
- value: value,
67479
- enumerable: true,
67480
- configurable: true,
67481
- writable: true
67482
- });
67483
- } else {
67484
- obj[key] = value;
67485
- }
67486
- return obj;
67487
- }
67488
- function _get_prototype_of(o) {
67489
- _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
67490
- return o.__proto__ || Object.getPrototypeOf(o);
67491
- };
67492
- return _get_prototype_of(o);
67493
- }
67494
- function _inherits(subClass, superClass) {
67495
- if (typeof superClass !== "function" && superClass !== null) {
67496
- throw new TypeError("Super expression must either be null or a function");
67497
- }
67498
- subClass.prototype = Object.create(superClass && superClass.prototype, {
67499
- constructor: {
67500
- value: subClass,
67501
- writable: true,
67502
- configurable: true
67503
- }
67504
- });
67505
- if (superClass) _set_prototype_of(subClass, superClass);
67506
- }
67507
- function _instanceof(left, right) {
67508
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
67509
- return !!right[Symbol.hasInstance](left);
67510
- } else {
67511
- return left instanceof right;
67512
- }
67513
- }
67514
- function _object_spread$5(target) {
67515
- for(var i = 1; i < arguments.length; i++){
67516
- var source = arguments[i] != null ? arguments[i] : {};
67517
- var ownKeys = Object.keys(source);
67518
- if (typeof Object.getOwnPropertySymbols === "function") {
67519
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
67520
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
67521
- }));
67522
- }
67523
- ownKeys.forEach(function(key) {
67524
- _define_property$5(target, key, source[key]);
67525
- });
67526
- }
67527
- return target;
67528
- }
67529
- function ownKeys$3(object, enumerableOnly) {
67530
- var keys = Object.keys(object);
67531
- if (Object.getOwnPropertySymbols) {
67532
- var symbols = Object.getOwnPropertySymbols(object);
67533
- if (enumerableOnly) {
67534
- symbols = symbols.filter(function(sym) {
67535
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
67536
- });
67537
- }
67538
- keys.push.apply(keys, symbols);
67539
- }
67540
- return keys;
67541
- }
67542
- function _object_spread_props$3(target, source) {
67543
- source = source != null ? source : {};
67544
- if (Object.getOwnPropertyDescriptors) {
67545
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
67546
- } else {
67547
- ownKeys$3(Object(source)).forEach(function(key) {
67548
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
67549
- });
67550
- }
67551
- return target;
67552
- }
67553
- function _possible_constructor_return(self, call) {
67554
- if (call && (_type_of(call) === "object" || typeof call === "function")) {
67555
- return call;
67556
- }
67557
- return _assert_this_initialized(self);
67558
- }
67559
- function _set_prototype_of(o, p) {
67560
- _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
67561
- o.__proto__ = p;
67562
- return o;
67563
- };
67564
- return _set_prototype_of(o, p);
67565
- }
67566
- function _type_of(obj) {
67567
- "@swc/helpers - typeof";
67568
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
67569
- }
67570
- function _is_native_reflect_construct() {
67571
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
67572
- if (Reflect.construct.sham) return false;
67573
- if (typeof Proxy === "function") return true;
67574
- try {
67575
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
67576
- return true;
67577
- } catch (e) {
67578
- return false;
67579
- }
67580
- }
67581
- function _create_super(Derived) {
67582
- var hasNativeReflectConstruct = _is_native_reflect_construct();
67583
- return function _createSuperInternal() {
67584
- var Super = _get_prototype_of(Derived), result;
67585
- if (hasNativeReflectConstruct) {
67586
- var NewTarget = _get_prototype_of(this).constructor;
67587
- result = Reflect.construct(Super, arguments, NewTarget);
67588
- } else {
67589
- result = Super.apply(this, arguments);
67590
- }
67591
- return _possible_constructor_return(this, result);
67592
- };
67593
- }
67594
- var matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
67595
- var stringToIcon = function(value, validate, allowSimpleName) {
67596
- var provider = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
67597
- var colonSeparated = value.split(":");
67598
- if (value.slice(0, 1) === "@") {
67599
- if (colonSeparated.length < 2 || colonSeparated.length > 3) {
67600
- return null;
67601
- }
67602
- provider = colonSeparated.shift().slice(1);
67603
- }
67604
- if (colonSeparated.length > 3 || !colonSeparated.length) {
67605
- return null;
67606
- }
67607
- if (colonSeparated.length > 1) {
67608
- var name2 = colonSeparated.pop();
67609
- var prefix = colonSeparated.pop();
67610
- var result = {
67611
- // Allow provider without '@': "provider:prefix:name"
67612
- provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
67613
- prefix: prefix,
67614
- name: name2
67615
- };
67616
- return validate && !validateIconName(result) ? null : result;
67617
- }
67618
- var name = colonSeparated[0];
67619
- var dashSeparated = name.split("-");
67620
- if (dashSeparated.length > 1) {
67621
- var result1 = {
67622
- provider: provider,
67623
- prefix: dashSeparated.shift(),
67624
- name: dashSeparated.join("-")
67625
- };
67626
- return validate && !validateIconName(result1) ? null : result1;
67627
- }
67628
- if (allowSimpleName && provider === "") {
67629
- var result2 = {
67630
- provider: provider,
67631
- prefix: "",
67632
- name: name
67633
- };
67634
- return validate && !validateIconName(result2, allowSimpleName) ? null : result2;
67635
- }
67636
- return null;
67637
- };
67638
- var validateIconName = function(icon, allowSimpleName) {
67639
- if (!icon) {
67640
- return false;
67641
- }
67642
- return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName));
67643
- };
67644
- var defaultIconDimensions = Object.freeze({
67645
- left: 0,
67646
- top: 0,
67647
- width: 16,
67648
- height: 16
67649
- });
67650
- var defaultIconTransformations = Object.freeze({
67651
- rotate: 0,
67652
- vFlip: false,
67653
- hFlip: false
67654
- });
67655
- var defaultIconProps = Object.freeze(_object_spread$5({}, defaultIconDimensions, defaultIconTransformations));
67656
- var defaultExtendedIconProps = Object.freeze(_object_spread_props$3(_object_spread$5({}, defaultIconProps), {
67657
- body: "",
67658
- hidden: false
67659
- }));
67660
- function mergeIconTransformations(obj1, obj2) {
67661
- var result = {};
67662
- if (!obj1.hFlip !== !obj2.hFlip) {
67663
- result.hFlip = true;
67664
- }
67665
- if (!obj1.vFlip !== !obj2.vFlip) {
67666
- result.vFlip = true;
67667
- }
67668
- var rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
67669
- if (rotate) {
67670
- result.rotate = rotate;
67671
- }
67672
- return result;
67673
- }
67674
- function mergeIconData(parent, child) {
67675
- var result = mergeIconTransformations(parent, child);
67676
- for(var key in defaultExtendedIconProps){
67677
- if (key in defaultIconTransformations) {
67678
- if (key in parent && !(key in result)) {
67679
- result[key] = defaultIconTransformations[key];
67680
- }
67681
- } else if (key in child) {
67682
- result[key] = child[key];
67683
- } else if (key in parent) {
67684
- result[key] = parent[key];
67685
- }
67686
- }
67687
- return result;
67688
- }
67689
- function getIconsTree(data, names) {
67690
- var icons = data.icons;
67691
- var aliases = data.aliases || /* @__PURE__ */ Object.create(null);
67692
- var resolved = /* @__PURE__ */ Object.create(null);
67693
- function resolve(name) {
67694
- if (icons[name]) {
67695
- return resolved[name] = [];
67696
- }
67697
- if (!(name in resolved)) {
67698
- resolved[name] = null;
67699
- var parent = aliases[name] && aliases[name].parent;
67700
- var value = parent && resolve(parent);
67701
- if (value) {
67702
- resolved[name] = [
67703
- parent
67704
- ].concat(value);
67705
- }
67706
- }
67707
- return resolved[name];
67708
- }
67709
- (names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
67710
- return resolved;
67711
- }
67712
- function internalGetIconData(data, name, tree) {
67713
- var icons = data.icons;
67714
- var aliases = data.aliases || /* @__PURE__ */ Object.create(null);
67715
- var currentProps = {};
67716
- function parse(name2) {
67717
- currentProps = mergeIconData(icons[name2] || aliases[name2], currentProps);
67718
- }
67719
- parse(name);
67720
- tree.forEach(parse);
67721
- return mergeIconData(data, currentProps);
67722
- }
67723
- function parseIconSet(data, callback) {
67724
- var names = [];
67725
- if (typeof data !== "object" || typeof data.icons !== "object") {
67726
- return names;
67727
- }
67728
- if (_instanceof(data.not_found, Array)) {
67729
- data.not_found.forEach(function(name) {
67730
- callback(name, null);
67731
- names.push(name);
67732
- });
67733
- }
67734
- var tree = getIconsTree(data);
67735
- for(var name in tree){
67736
- var item = tree[name];
67737
- if (item) {
67738
- callback(name, internalGetIconData(data, name, item));
67739
- names.push(name);
67740
- }
67741
- }
67742
- return names;
67743
- }
67744
- var optionalPropertyDefaults = _object_spread$5({
67745
- provider: "",
67746
- aliases: {},
67747
- not_found: {}
67748
- }, defaultIconDimensions);
67749
- function checkOptionalProps(item, defaults) {
67750
- for(var prop in defaults){
67751
- if (prop in item && _type_of(item[prop]) !== _type_of(defaults[prop])) {
67752
- return false;
67753
- }
67754
- }
67755
- return true;
67756
- }
67757
- function quicklyValidateIconSet(obj) {
67758
- if (typeof obj !== "object" || obj === null) {
67759
- return null;
67760
- }
67761
- var data = obj;
67762
- if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") {
67763
- return null;
67764
- }
67765
- if (!checkOptionalProps(obj, optionalPropertyDefaults)) {
67766
- return null;
67767
- }
67768
- var icons = data.icons;
67769
- for(var name in icons){
67770
- var icon = icons[name];
67771
- if (!name.match(matchIconName) || typeof icon.body !== "string" || !checkOptionalProps(icon, defaultExtendedIconProps)) {
67772
- return null;
67773
- }
67774
- }
67775
- var aliases = data.aliases || /* @__PURE__ */ Object.create(null);
67776
- for(var name1 in aliases){
67777
- var icon1 = aliases[name1];
67778
- var parent = icon1.parent;
67779
- if (!name1.match(matchIconName) || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(icon1, defaultExtendedIconProps)) {
67780
- return null;
67781
- }
67782
- }
67783
- return data;
67784
- }
67785
- var dataStorage = /* @__PURE__ */ Object.create(null);
67786
- function newStorage(provider, prefix) {
67787
- return {
67788
- provider: provider,
67789
- prefix: prefix,
67790
- icons: /* @__PURE__ */ Object.create(null),
67791
- missing: /* @__PURE__ */ new Set()
67792
- };
67793
- }
67794
- function getStorage(provider, prefix) {
67795
- var providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
67796
- return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
67797
- }
67798
- function addIconSet(storage, data) {
67799
- if (!quicklyValidateIconSet(data)) {
67800
- return [];
67801
- }
67802
- return parseIconSet(data, function(name, icon) {
67803
- if (icon) {
67804
- storage.icons[name] = icon;
67805
- } else {
67806
- storage.missing.add(name);
67807
- }
67808
- });
67809
- }
67810
- function addIconToStorage(storage, name, icon) {
67811
- try {
67812
- if (typeof icon.body === "string") {
67813
- storage.icons[name] = _object_spread$5({}, icon);
67814
- return true;
67815
- }
67816
- } catch (err) {}
67817
- return false;
67818
- }
67819
- var simpleNames = false;
67820
- function allowSimpleNames(allow) {
67821
- if (typeof allow === "boolean") {
67822
- simpleNames = allow;
67823
- }
67824
- return simpleNames;
67825
- }
67826
- function getIconData(name) {
67827
- var icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
67828
- if (icon) {
67829
- var storage = getStorage(icon.provider, icon.prefix);
67830
- var iconName = icon.name;
67831
- return storage.icons[iconName] || (storage.missing.has(iconName) ? null : void 0);
67832
- }
67833
- }
67834
- function addIcon(name, data) {
67835
- var icon = stringToIcon(name, true, simpleNames);
67836
- if (!icon) {
67837
- return false;
67838
- }
67839
- var storage = getStorage(icon.provider, icon.prefix);
67840
- return addIconToStorage(storage, icon.name, data);
67841
- }
67842
- function addCollection(data, provider) {
67843
- if (typeof data !== "object") {
67844
- return false;
67845
- }
67846
- if (typeof provider !== "string") {
67847
- provider = data.provider || "";
67848
- }
67849
- if (simpleNames && !provider && !data.prefix) {
67850
- var added = false;
67851
- if (quicklyValidateIconSet(data)) {
67852
- data.prefix = "";
67853
- parseIconSet(data, function(name, icon) {
67854
- if (icon && addIcon(name, icon)) {
67855
- added = true;
67856
- }
67857
- });
67858
- }
67859
- return added;
67860
- }
67861
- var prefix = data.prefix;
67862
- if (!validateIconName({
67863
- provider: provider,
67864
- prefix: prefix,
67865
- name: "a"
67866
- })) {
67867
- return false;
67868
- }
67869
- var storage = getStorage(provider, prefix);
67870
- return !!addIconSet(storage, data);
67871
- }
67872
- var defaultIconSizeCustomisations = Object.freeze({
67873
- width: null,
67874
- height: null
67875
- });
67876
- var defaultIconCustomisations = Object.freeze(_object_spread$5({}, defaultIconSizeCustomisations, defaultIconTransformations));
67877
- var unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
67878
- var unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
67879
- function calculateSize(size, ratio, precision) {
67880
- if (ratio === 1) {
67881
- return size;
67882
- }
67883
- precision = precision || 100;
67884
- if (typeof size === "number") {
67885
- return Math.ceil(size * ratio * precision) / precision;
67886
- }
67887
- if (typeof size !== "string") {
67888
- return size;
67889
- }
67890
- var oldParts = size.split(unitsSplit);
67891
- if (oldParts === null || !oldParts.length) {
67892
- return size;
67893
- }
67894
- var newParts = [];
67895
- var code = oldParts.shift();
67896
- var isNumber = unitsTest.test(code);
67897
- while(true){
67898
- if (isNumber) {
67899
- var num = parseFloat(code);
67900
- if (isNaN(num)) {
67901
- newParts.push(code);
67902
- } else {
67903
- newParts.push(Math.ceil(num * ratio * precision) / precision);
67904
- }
67905
- } else {
67906
- newParts.push(code);
67907
- }
67908
- code = oldParts.shift();
67909
- if (code === void 0) {
67910
- return newParts.join("");
67911
- }
67912
- isNumber = !isNumber;
67913
- }
67914
- }
67915
- var isUnsetKeyword = function(value) {
67916
- return value === "unset" || value === "undefined" || value === "none";
67917
- };
67918
- function iconToSVG(icon, customisations) {
67919
- var fullIcon = _object_spread$5({}, defaultIconProps, icon);
67920
- var fullCustomisations = _object_spread$5({}, defaultIconCustomisations, customisations);
67921
- var box = {
67922
- left: fullIcon.left,
67923
- top: fullIcon.top,
67924
- width: fullIcon.width,
67925
- height: fullIcon.height
67926
- };
67927
- var body = fullIcon.body;
67928
- [
67929
- fullIcon,
67930
- fullCustomisations
67931
- ].forEach(function(props) {
67932
- var transformations = [];
67933
- var hFlip = props.hFlip;
67934
- var vFlip = props.vFlip;
67935
- var rotation = props.rotate;
67936
- if (hFlip) {
67937
- if (vFlip) {
67938
- rotation += 2;
67939
- } else {
67940
- transformations.push("translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")");
67941
- transformations.push("scale(-1 1)");
67942
- box.top = box.left = 0;
67943
- }
67944
- } else if (vFlip) {
67945
- transformations.push("translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")");
67946
- transformations.push("scale(1 -1)");
67947
- box.top = box.left = 0;
67948
- }
67949
- var tempValue;
67950
- if (rotation < 0) {
67951
- rotation -= Math.floor(rotation / 4) * 4;
67952
- }
67953
- rotation = rotation % 4;
67954
- switch(rotation){
67955
- case 1:
67956
- tempValue = box.height / 2 + box.top;
67957
- transformations.unshift("rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")");
67958
- break;
67959
- case 2:
67960
- transformations.unshift("rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")");
67961
- break;
67962
- case 3:
67963
- tempValue = box.width / 2 + box.left;
67964
- transformations.unshift("rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")");
67965
- break;
67966
- }
67967
- if (rotation % 2 === 1) {
67968
- if (box.left !== box.top) {
67969
- tempValue = box.left;
67970
- box.left = box.top;
67971
- box.top = tempValue;
67972
- }
67973
- if (box.width !== box.height) {
67974
- tempValue = box.width;
67975
- box.width = box.height;
67976
- box.height = tempValue;
67977
- }
67978
- }
67979
- if (transformations.length) {
67980
- body = '<g transform="' + transformations.join(" ") + '">' + body + "</g>";
67981
- }
67982
- });
67983
- var customisationsWidth = fullCustomisations.width;
67984
- var customisationsHeight = fullCustomisations.height;
67985
- var boxWidth = box.width;
67986
- var boxHeight = box.height;
67987
- var width;
67988
- var height;
67989
- if (customisationsWidth === null) {
67990
- height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
67991
- width = calculateSize(height, boxWidth / boxHeight);
67992
- } else {
67993
- width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
67994
- height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
67995
- }
67996
- var attributes = {};
67997
- var setAttr = function(prop, value) {
67998
- if (!isUnsetKeyword(value)) {
67999
- attributes[prop] = value.toString();
68000
- }
68001
- };
68002
- setAttr("width", width);
68003
- setAttr("height", height);
68004
- attributes.viewBox = box.left.toString() + " " + box.top.toString() + " " + boxWidth.toString() + " " + boxHeight.toString();
68005
- return {
68006
- attributes: attributes,
68007
- body: body
68008
- };
68009
- }
68010
- var regex = /\sid="(\S+)"/g;
68011
- var randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
68012
- var counter = 0;
68013
- function replaceIDs(body) {
68014
- var prefix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : randomPrefix;
68015
- var ids = [];
68016
- var match;
68017
- while(match = regex.exec(body)){
68018
- ids.push(match[1]);
68019
- }
68020
- if (!ids.length) {
68021
- return body;
68022
- }
68023
- var suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
68024
- ids.forEach(function(id) {
68025
- var newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
68026
- var escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
68027
- body = body.replace(// Allowed characters before id: [#;"]
68028
- // Allowed characters after id: [)"], .[a-z]
68029
- new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"), "$1" + newID + suffix + "$3");
68030
- });
68031
- body = body.replace(new RegExp(suffix, "g"), "");
68032
- return body;
68033
- }
68034
- var storage = /* @__PURE__ */ Object.create(null);
68035
- function setAPIModule(provider, item) {
68036
- storage[provider] = item;
68037
- }
68038
- function getAPIModule(provider) {
68039
- return storage[provider] || storage[""];
68040
- }
68041
- function createAPIConfig(source) {
68042
- var resources;
68043
- if (typeof source.resources === "string") {
68044
- resources = [
68045
- source.resources
68046
- ];
68047
- } else {
68048
- resources = source.resources;
68049
- if (!_instanceof(resources, Array) || !resources.length) {
68050
- return null;
68051
- }
68052
- }
68053
- var result = {
68054
- // API hosts
68055
- resources: resources,
68056
- // Root path
68057
- path: source.path || "/",
68058
- // URL length limit
68059
- maxURL: source.maxURL || 500,
68060
- // Timeout before next host is used.
68061
- rotate: source.rotate || 750,
68062
- // Timeout before failing query.
68063
- timeout: source.timeout || 5e3,
68064
- // Randomise default API end point.
68065
- random: source.random === true,
68066
- // Start index
68067
- index: source.index || 0,
68068
- // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
68069
- dataAfterTimeout: source.dataAfterTimeout !== false
68070
- };
68071
- return result;
68072
- }
68073
- var configStorage = /* @__PURE__ */ Object.create(null);
68074
- var fallBackAPISources = [
68075
- "https://api.simplesvg.com",
68076
- "https://api.unisvg.com"
68077
- ];
68078
- var fallBackAPI = [];
68079
- while(fallBackAPISources.length > 0){
68080
- if (fallBackAPISources.length === 1) {
68081
- fallBackAPI.push(fallBackAPISources.shift());
68082
- } else {
68083
- if (Math.random() > 0.5) {
68084
- fallBackAPI.push(fallBackAPISources.shift());
68085
- } else {
68086
- fallBackAPI.push(fallBackAPISources.pop());
68087
- }
68088
- }
68089
- }
68090
- configStorage[""] = createAPIConfig({
68091
- resources: [
68092
- "https://api.iconify.design"
68093
- ].concat(fallBackAPI)
68094
- });
68095
- function addAPIProvider(provider, customConfig) {
68096
- var config = createAPIConfig(customConfig);
68097
- if (config === null) {
68098
- return false;
68099
- }
68100
- configStorage[provider] = config;
68101
- return true;
68102
- }
68103
- function getAPIConfig(provider) {
68104
- return configStorage[provider];
68105
- }
68106
- var detectFetch = function() {
68107
- var callback;
68108
- try {
68109
- callback = fetch;
68110
- if (typeof callback === "function") {
68111
- return callback;
68112
- }
68113
- } catch (err) {}
68114
- };
68115
- var fetchModule = detectFetch();
68116
- function calculateMaxLength(provider, prefix) {
68117
- var config = getAPIConfig(provider);
68118
- if (!config) {
68119
- return 0;
68120
- }
68121
- var result;
68122
- if (!config.maxURL) {
68123
- result = 0;
68124
- } else {
68125
- var maxHostLength = 0;
68126
- config.resources.forEach(function(item) {
68127
- var host = item;
68128
- maxHostLength = Math.max(maxHostLength, host.length);
68129
- });
68130
- var url = prefix + ".json?icons=";
68131
- result = config.maxURL - maxHostLength - config.path.length - url.length;
68132
- }
68133
- return result;
68134
- }
68135
- function shouldAbort(status) {
68136
- return status === 404;
68137
- }
68138
- var prepare = function(provider, prefix, icons) {
68139
- var results = [];
68140
- var maxLength = calculateMaxLength(provider, prefix);
68141
- var type = "icons";
68142
- var item = {
68143
- type: type,
68144
- provider: provider,
68145
- prefix: prefix,
68146
- icons: []
68147
- };
68148
- var length = 0;
68149
- icons.forEach(function(name, index) {
68150
- length += name.length + 1;
68151
- if (length >= maxLength && index > 0) {
68152
- results.push(item);
68153
- item = {
68154
- type: type,
68155
- provider: provider,
68156
- prefix: prefix,
68157
- icons: []
68158
- };
68159
- length = name.length;
68160
- }
68161
- item.icons.push(name);
68162
- });
68163
- results.push(item);
68164
- return results;
68165
- };
68166
- function getPath(provider) {
68167
- if (typeof provider === "string") {
68168
- var config = getAPIConfig(provider);
68169
- if (config) {
68170
- return config.path;
68171
- }
68172
- }
68173
- return "/";
68174
- }
68175
- var send = function(host, params, callback) {
68176
- if (!fetchModule) {
68177
- callback("abort", 424);
68178
- return;
68179
- }
68180
- var path = getPath(params.provider);
68181
- switch(params.type){
68182
- case "icons":
68183
- {
68184
- var prefix = params.prefix;
68185
- var icons = params.icons;
68186
- var iconsList = icons.join(",");
68187
- var urlParams = new URLSearchParams({
68188
- icons: iconsList
68189
- });
68190
- path += prefix + ".json?" + urlParams.toString();
68191
- break;
68192
- }
68193
- case "custom":
68194
- {
68195
- var uri = params.uri;
68196
- path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
68197
- break;
68198
- }
68199
- default:
68200
- callback("abort", 400);
68201
- return;
68202
- }
68203
- var defaultError = 503;
68204
- fetchModule(host + path).then(function(response) {
68205
- var status = response.status;
68206
- if (status !== 200) {
68207
- setTimeout(function() {
68208
- callback(shouldAbort(status) ? "abort" : "next", status);
68209
- });
68210
- return;
68211
- }
68212
- defaultError = 501;
68213
- return response.json();
68214
- }).then(function(data) {
68215
- if (typeof data !== "object" || data === null) {
68216
- setTimeout(function() {
68217
- if (data === 404) {
68218
- callback("abort", data);
68219
- } else {
68220
- callback("next", defaultError);
68221
- }
68222
- });
68223
- return;
68224
- }
68225
- setTimeout(function() {
68226
- callback("success", data);
68227
- });
68228
- }).catch(function() {
68229
- callback("next", defaultError);
68230
- });
68231
- };
68232
- var fetchAPIModule = {
68233
- prepare: prepare,
68234
- send: send
68235
- };
68236
- function sortIcons(icons) {
68237
- var result = {
68238
- loaded: [],
68239
- missing: [],
68240
- pending: []
68241
- };
68242
- var storage = /* @__PURE__ */ Object.create(null);
68243
- icons.sort(function(a, b) {
68244
- if (a.provider !== b.provider) {
68245
- return a.provider.localeCompare(b.provider);
68246
- }
68247
- if (a.prefix !== b.prefix) {
68248
- return a.prefix.localeCompare(b.prefix);
68249
- }
68250
- return a.name.localeCompare(b.name);
68251
- });
68252
- var lastIcon = {
68253
- provider: "",
68254
- prefix: "",
68255
- name: ""
68256
- };
68257
- icons.forEach(function(icon) {
68258
- if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {
68259
- return;
68260
- }
68261
- lastIcon = icon;
68262
- var provider = icon.provider;
68263
- var prefix = icon.prefix;
68264
- var name = icon.name;
68265
- var providerStorage = storage[provider] || (storage[provider] = /* @__PURE__ */ Object.create(null));
68266
- var localStorage = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
68267
- var list;
68268
- if (name in localStorage.icons) {
68269
- list = result.loaded;
68270
- } else if (prefix === "" || localStorage.missing.has(name)) {
68271
- list = result.missing;
68272
- } else {
68273
- list = result.pending;
68274
- }
68275
- var item = {
68276
- provider: provider,
68277
- prefix: prefix,
68278
- name: name
68279
- };
68280
- list.push(item);
68281
- });
68282
- return result;
68283
- }
68284
- function removeCallback(storages, id) {
68285
- storages.forEach(function(storage) {
68286
- var items = storage.loaderCallbacks;
68287
- if (items) {
68288
- storage.loaderCallbacks = items.filter(function(row) {
68289
- return row.id !== id;
68290
- });
68291
- }
68292
- });
68293
- }
68294
- function updateCallbacks(storage) {
68295
- if (!storage.pendingCallbacksFlag) {
68296
- storage.pendingCallbacksFlag = true;
68297
- setTimeout(function() {
68298
- storage.pendingCallbacksFlag = false;
68299
- var items = storage.loaderCallbacks ? storage.loaderCallbacks.slice(0) : [];
68300
- if (!items.length) {
68301
- return;
68302
- }
68303
- var hasPending = false;
68304
- var provider = storage.provider;
68305
- var prefix = storage.prefix;
68306
- items.forEach(function(item) {
68307
- var icons = item.icons;
68308
- var oldLength = icons.pending.length;
68309
- icons.pending = icons.pending.filter(function(icon) {
68310
- if (icon.prefix !== prefix) {
68311
- return true;
68312
- }
68313
- var name = icon.name;
68314
- if (storage.icons[name]) {
68315
- icons.loaded.push({
68316
- provider: provider,
68317
- prefix: prefix,
68318
- name: name
68319
- });
68320
- } else if (storage.missing.has(name)) {
68321
- icons.missing.push({
68322
- provider: provider,
68323
- prefix: prefix,
68324
- name: name
68325
- });
68326
- } else {
68327
- hasPending = true;
68328
- return true;
68329
- }
68330
- return false;
68331
- });
68332
- if (icons.pending.length !== oldLength) {
68333
- if (!hasPending) {
68334
- removeCallback([
68335
- storage
68336
- ], item.id);
68337
- }
68338
- item.callback(icons.loaded.slice(0), icons.missing.slice(0), icons.pending.slice(0), item.abort);
68339
- }
68340
- });
68341
- });
68342
- }
68343
- }
68344
- var idCounter = 0;
68345
- function storeCallback(callback, icons, pendingSources) {
68346
- var id = idCounter++;
68347
- var abort = removeCallback.bind(null, pendingSources, id);
68348
- if (!icons.pending.length) {
68349
- return abort;
68350
- }
68351
- var item = {
68352
- id: id,
68353
- icons: icons,
68354
- callback: callback,
68355
- abort: abort
68356
- };
68357
- pendingSources.forEach(function(storage) {
68358
- (storage.loaderCallbacks || (storage.loaderCallbacks = [])).push(item);
68359
- });
68360
- return abort;
68361
- }
68362
- function listToIcons(list) {
68363
- var validate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, simpleNames = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
68364
- var result = [];
68365
- list.forEach(function(item) {
68366
- var icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames) : item;
68367
- if (icon) {
68368
- result.push(icon);
68369
- }
68370
- });
68371
- return result;
68372
- }
68373
- // src/config.ts
68374
- var defaultConfig = {
68375
- resources: [],
68376
- index: 0,
68377
- timeout: 2e3,
68378
- rotate: 750,
68379
- random: false,
68380
- dataAfterTimeout: false
68381
- };
68382
- // src/query.ts
68383
- function sendQuery(config, payload, query, done) {
68384
- var resourcesCount = config.resources.length;
68385
- var startIndex = config.random ? Math.floor(Math.random() * resourcesCount) : config.index;
68386
- var resources;
68387
- if (config.random) {
68388
- var list = config.resources.slice(0);
68389
- resources = [];
68390
- while(list.length > 1){
68391
- var nextIndex = Math.floor(Math.random() * list.length);
68392
- resources.push(list[nextIndex]);
68393
- list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
68394
- }
68395
- resources = resources.concat(list);
68396
- } else {
68397
- resources = config.resources.slice(startIndex).concat(config.resources.slice(0, startIndex));
68398
- }
68399
- var startTime = Date.now();
68400
- var status = "pending";
68401
- var queriesSent = 0;
68402
- var lastError;
68403
- var timer = null;
68404
- var queue = [];
68405
- var doneCallbacks = [];
68406
- if (typeof done === "function") {
68407
- doneCallbacks.push(done);
68408
- }
68409
- function resetTimer() {
68410
- if (timer) {
68411
- clearTimeout(timer);
68412
- timer = null;
68413
- }
68414
- }
68415
- function abort() {
68416
- if (status === "pending") {
68417
- status = "aborted";
68418
- }
68419
- resetTimer();
68420
- queue.forEach(function(item) {
68421
- if (item.status === "pending") {
68422
- item.status = "aborted";
68423
- }
68424
- });
68425
- queue = [];
68426
- }
68427
- function subscribe(callback, overwrite) {
68428
- if (overwrite) {
68429
- doneCallbacks = [];
68430
- }
68431
- if (typeof callback === "function") {
68432
- doneCallbacks.push(callback);
68433
- }
68434
- }
68435
- function getQueryStatus() {
68436
- return {
68437
- startTime: startTime,
68438
- payload: payload,
68439
- status: status,
68440
- queriesSent: queriesSent,
68441
- queriesPending: queue.length,
68442
- subscribe: subscribe,
68443
- abort: abort
68444
- };
68445
- }
68446
- function failQuery() {
68447
- status = "failed";
68448
- doneCallbacks.forEach(function(callback) {
68449
- callback(void 0, lastError);
68450
- });
68451
- }
68452
- function clearQueue() {
68453
- queue.forEach(function(item) {
68454
- if (item.status === "pending") {
68455
- item.status = "aborted";
68456
- }
68457
- });
68458
- queue = [];
68459
- }
68460
- function moduleResponse(item, response, data) {
68461
- var isError = response !== "success";
68462
- queue = queue.filter(function(queued) {
68463
- return queued !== item;
68464
- });
68465
- switch(status){
68466
- case "pending":
68467
- break;
68468
- case "failed":
68469
- if (isError || !config.dataAfterTimeout) {
68470
- return;
68471
- }
68472
- break;
68473
- default:
68474
- return;
68475
- }
68476
- if (response === "abort") {
68477
- lastError = data;
68478
- failQuery();
68479
- return;
68480
- }
68481
- if (isError) {
68482
- lastError = data;
68483
- if (!queue.length) {
68484
- if (!resources.length) {
68485
- failQuery();
68486
- } else {
68487
- execNext();
68488
- }
68489
- }
68490
- return;
68491
- }
68492
- resetTimer();
68493
- clearQueue();
68494
- if (!config.random) {
68495
- var index = config.resources.indexOf(item.resource);
68496
- if (index !== -1 && index !== config.index) {
68497
- config.index = index;
68498
- }
68499
- }
68500
- status = "completed";
68501
- doneCallbacks.forEach(function(callback) {
68502
- callback(data);
68503
- });
68504
- }
68505
- function execNext() {
68506
- if (status !== "pending") {
68507
- return;
68508
- }
68509
- resetTimer();
68510
- var resource = resources.shift();
68511
- if (resource === void 0) {
68512
- if (queue.length) {
68513
- timer = setTimeout(function() {
68514
- resetTimer();
68515
- if (status === "pending") {
68516
- clearQueue();
68517
- failQuery();
68518
- }
68519
- }, config.timeout);
68520
- return;
68521
- }
68522
- failQuery();
68523
- return;
68524
- }
68525
- var item = {
68526
- status: "pending",
68527
- resource: resource,
68528
- callback: function(status2, data) {
68529
- moduleResponse(item, status2, data);
68530
- }
68531
- };
68532
- queue.push(item);
68533
- queriesSent++;
68534
- timer = setTimeout(execNext, config.rotate);
68535
- query(resource, payload, item.callback);
68536
- }
68537
- setTimeout(execNext);
68538
- return getQueryStatus;
68539
- }
68540
- // src/index.ts
68541
- function initRedundancy(cfg) {
68542
- var config = _object_spread$5({}, defaultConfig, cfg);
68543
- var queries = [];
68544
- function cleanup() {
68545
- queries = queries.filter(function(item) {
68546
- return item().status === "pending";
68547
- });
68548
- }
68549
- function query(payload, queryCallback, doneCallback) {
68550
- var query2 = sendQuery(config, payload, queryCallback, function(data, error) {
68551
- cleanup();
68552
- if (doneCallback) {
68553
- doneCallback(data, error);
68554
- }
68555
- });
68556
- queries.push(query2);
68557
- return query2;
68558
- }
68559
- function find(callback) {
68560
- return queries.find(function(value) {
68561
- return callback(value);
68562
- }) || null;
68563
- }
68564
- var instance = {
68565
- query: query,
68566
- find: find,
68567
- setIndex: function(index) {
68568
- config.index = index;
68569
- },
68570
- getIndex: function() {
68571
- return config.index;
68572
- },
68573
- cleanup: cleanup
68574
- };
68575
- return instance;
68576
- }
68577
- function emptyCallback$1() {}
68578
- var redundancyCache = /* @__PURE__ */ Object.create(null);
68579
- function getRedundancyCache(provider) {
68580
- if (!redundancyCache[provider]) {
68581
- var config = getAPIConfig(provider);
68582
- if (!config) {
68583
- return;
68584
- }
68585
- var redundancy = initRedundancy(config);
68586
- var cachedReundancy = {
68587
- config: config,
68588
- redundancy: redundancy
68589
- };
68590
- redundancyCache[provider] = cachedReundancy;
68591
- }
68592
- return redundancyCache[provider];
68593
- }
68594
- function sendAPIQuery(target, query, callback) {
68595
- var redundancy;
68596
- var send;
68597
- if (typeof target === "string") {
68598
- var api = getAPIModule(target);
68599
- if (!api) {
68600
- callback(void 0, 424);
68601
- return emptyCallback$1;
68602
- }
68603
- send = api.send;
68604
- var cached = getRedundancyCache(target);
68605
- if (cached) {
68606
- redundancy = cached.redundancy;
68607
- }
68608
- } else {
68609
- var config = createAPIConfig(target);
68610
- if (config) {
68611
- redundancy = initRedundancy(config);
68612
- var moduleKey = target.resources ? target.resources[0] : "";
68613
- var api1 = getAPIModule(moduleKey);
68614
- if (api1) {
68615
- send = api1.send;
68616
- }
68617
- }
68618
- }
68619
- if (!redundancy || !send) {
68620
- callback(void 0, 424);
68621
- return emptyCallback$1;
68622
- }
68623
- return redundancy.query(query, send, callback)().abort;
68624
- }
68625
- var browserCacheVersion = "iconify2";
68626
- var browserCachePrefix = "iconify";
68627
- var browserCacheCountKey = browserCachePrefix + "-count";
68628
- var browserCacheVersionKey = browserCachePrefix + "-version";
68629
- var browserStorageHour = 36e5;
68630
- var browserStorageCacheExpiration = 168;
68631
- function getStoredItem(func, key) {
68632
- try {
68633
- return func.getItem(key);
68634
- } catch (err) {}
68635
- }
68636
- function setStoredItem(func, key, value) {
68637
- try {
68638
- func.setItem(key, value);
68639
- return true;
68640
- } catch (err) {}
68641
- }
68642
- function removeStoredItem(func, key) {
68643
- try {
68644
- func.removeItem(key);
68645
- } catch (err) {}
68646
- }
68647
- function setBrowserStorageItemsCount(storage, value) {
68648
- return setStoredItem(storage, browserCacheCountKey, value.toString());
68649
- }
68650
- function getBrowserStorageItemsCount(storage) {
68651
- return parseInt(getStoredItem(storage, browserCacheCountKey)) || 0;
68652
- }
68653
- var browserStorageConfig = {
68654
- local: true,
68655
- session: true
68656
- };
68657
- var browserStorageEmptyItems = {
68658
- local: /* @__PURE__ */ new Set(),
68659
- session: /* @__PURE__ */ new Set()
68660
- };
68661
- var browserStorageStatus = false;
68662
- function setBrowserStorageStatus(status) {
68663
- browserStorageStatus = status;
68664
- }
68665
- var _window = typeof window === "undefined" ? {} : window;
68666
- function getBrowserStorage(key) {
68667
- var attr = key + "Storage";
68668
- try {
68669
- if (_window && _window[attr] && typeof _window[attr].length === "number") {
68670
- return _window[attr];
68671
- }
68672
- } catch (err) {}
68673
- browserStorageConfig[key] = false;
68674
- }
68675
- function iterateBrowserStorage(key, callback) {
68676
- var func = getBrowserStorage(key);
68677
- if (!func) {
68678
- return;
68679
- }
68680
- var version = getStoredItem(func, browserCacheVersionKey);
68681
- if (version !== browserCacheVersion) {
68682
- if (version) {
68683
- var total2 = getBrowserStorageItemsCount(func);
68684
- for(var i = 0; i < total2; i++){
68685
- removeStoredItem(func, browserCachePrefix + i.toString());
68686
- }
68687
- }
68688
- setStoredItem(func, browserCacheVersionKey, browserCacheVersion);
68689
- setBrowserStorageItemsCount(func, 0);
68690
- return;
68691
- }
68692
- var minTime = Math.floor(Date.now() / browserStorageHour) - browserStorageCacheExpiration;
68693
- var parseItem = function(index) {
68694
- var name = browserCachePrefix + index.toString();
68695
- var item = getStoredItem(func, name);
68696
- if (typeof item !== "string") {
68697
- return;
68698
- }
68699
- try {
68700
- var data = JSON.parse(item);
68701
- if (typeof data === "object" && typeof data.cached === "number" && data.cached > minTime && typeof data.provider === "string" && typeof data.data === "object" && typeof data.data.prefix === "string" && // Valid item: run callback
68702
- callback(data, index)) {
68703
- return true;
68704
- }
68705
- } catch (err) {}
68706
- removeStoredItem(func, name);
68707
- };
68708
- var total = getBrowserStorageItemsCount(func);
68709
- for(var i1 = total - 1; i1 >= 0; i1--){
68710
- if (!parseItem(i1)) {
68711
- if (i1 === total - 1) {
68712
- total--;
68713
- setBrowserStorageItemsCount(func, total);
68714
- } else {
68715
- browserStorageEmptyItems[key].add(i1);
68716
- }
68717
- }
68718
- }
68719
- }
68720
- function initBrowserStorage() {
68721
- if (browserStorageStatus) {
68722
- return;
68723
- }
68724
- setBrowserStorageStatus(true);
68725
- for(var key in browserStorageConfig){
68726
- iterateBrowserStorage(key, function(item) {
68727
- var iconSet = item.data;
68728
- var provider = item.provider;
68729
- var prefix = iconSet.prefix;
68730
- var storage = getStorage(provider, prefix);
68731
- if (!addIconSet(storage, iconSet).length) {
68732
- return false;
68733
- }
68734
- var lastModified = iconSet.lastModified || -1;
68735
- storage.lastModifiedCached = storage.lastModifiedCached ? Math.min(storage.lastModifiedCached, lastModified) : lastModified;
68736
- return true;
68737
- });
68738
- }
68739
- }
68740
- function updateLastModified(storage, lastModified) {
68741
- var lastValue = storage.lastModifiedCached;
68742
- if (// Matches or newer
68743
- lastValue && lastValue >= lastModified) {
68744
- return lastValue === lastModified;
68745
- }
68746
- storage.lastModifiedCached = lastModified;
68747
- if (lastValue) {
68748
- for(var key in browserStorageConfig){
68749
- iterateBrowserStorage(key, function(item) {
68750
- var iconSet = item.data;
68751
- return item.provider !== storage.provider || iconSet.prefix !== storage.prefix || iconSet.lastModified === lastModified;
68752
- });
68753
- }
68754
- }
68755
- return true;
68756
- }
68757
- function storeInBrowserStorage(storage, data) {
68758
- if (!browserStorageStatus) {
68759
- initBrowserStorage();
68760
- }
68761
- function store(key) {
68762
- var func;
68763
- if (!browserStorageConfig[key] || !(func = getBrowserStorage(key))) {
68764
- return;
68765
- }
68766
- var set = browserStorageEmptyItems[key];
68767
- var index;
68768
- if (set.size) {
68769
- set.delete(index = Array.from(set).shift());
68770
- } else {
68771
- index = getBrowserStorageItemsCount(func);
68772
- if (!setBrowserStorageItemsCount(func, index + 1)) {
68773
- return;
68774
- }
68775
- }
68776
- var item = {
68777
- cached: Math.floor(Date.now() / browserStorageHour),
68778
- provider: storage.provider,
68779
- data: data
68780
- };
68781
- return setStoredItem(func, browserCachePrefix + index.toString(), JSON.stringify(item));
68782
- }
68783
- if (data.lastModified && !updateLastModified(storage, data.lastModified)) {
68784
- return;
68785
- }
68786
- if (!Object.keys(data.icons).length) {
68787
- return;
68788
- }
68789
- if (data.not_found) {
68790
- data = Object.assign({}, data);
68791
- delete data.not_found;
68792
- }
68793
- if (!store("local")) {
68794
- store("session");
68795
- }
68796
- }
68797
- function emptyCallback() {}
68798
- function loadedNewIcons(storage) {
68799
- if (!storage.iconsLoaderFlag) {
68800
- storage.iconsLoaderFlag = true;
68801
- setTimeout(function() {
68802
- storage.iconsLoaderFlag = false;
68803
- updateCallbacks(storage);
68804
- });
68805
- }
68806
- }
68807
- function loadNewIcons(storage, icons) {
68808
- if (!storage.iconsToLoad) {
68809
- storage.iconsToLoad = icons;
68810
- } else {
68811
- storage.iconsToLoad = storage.iconsToLoad.concat(icons).sort();
68812
- }
68813
- if (!storage.iconsQueueFlag) {
68814
- storage.iconsQueueFlag = true;
68815
- setTimeout(function() {
68816
- storage.iconsQueueFlag = false;
68817
- var provider = storage.provider, prefix = storage.prefix;
68818
- var icons2 = storage.iconsToLoad;
68819
- delete storage.iconsToLoad;
68820
- var api;
68821
- if (!icons2 || !(api = getAPIModule(provider))) {
68822
- return;
68823
- }
68824
- var params = api.prepare(provider, prefix, icons2);
68825
- params.forEach(function(item) {
68826
- sendAPIQuery(provider, item, function(data) {
68827
- if (typeof data !== "object") {
68828
- item.icons.forEach(function(name) {
68829
- storage.missing.add(name);
68830
- });
68831
- } else {
68832
- try {
68833
- var parsed = addIconSet(storage, data);
68834
- if (!parsed.length) {
68835
- return;
68836
- }
68837
- var pending = storage.pendingIcons;
68838
- if (pending) {
68839
- parsed.forEach(function(name) {
68840
- pending.delete(name);
68841
- });
68842
- }
68843
- storeInBrowserStorage(storage, data);
68844
- } catch (err) {
68845
- console.error(err);
68846
- }
68847
- }
68848
- loadedNewIcons(storage);
68849
- });
68850
- });
68851
- });
68852
- }
68853
- }
68854
- var loadIcons = function(icons, callback) {
68855
- var cleanedIcons = listToIcons(icons, true, allowSimpleNames());
68856
- var sortedIcons = sortIcons(cleanedIcons);
68857
- if (!sortedIcons.pending.length) {
68858
- var callCallback = true;
68859
- if (callback) {
68860
- setTimeout(function() {
68861
- if (callCallback) {
68862
- callback(sortedIcons.loaded, sortedIcons.missing, sortedIcons.pending, emptyCallback);
68863
- }
68864
- });
68865
- }
68866
- return function() {
68867
- callCallback = false;
68868
- };
68869
- }
68870
- var newIcons = /* @__PURE__ */ Object.create(null);
68871
- var sources = [];
68872
- var lastProvider, lastPrefix;
68873
- sortedIcons.pending.forEach(function(icon) {
68874
- var provider = icon.provider, prefix = icon.prefix;
68875
- if (prefix === lastPrefix && provider === lastProvider) {
68876
- return;
68877
- }
68878
- lastProvider = provider;
68879
- lastPrefix = prefix;
68880
- sources.push(getStorage(provider, prefix));
68881
- var providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
68882
- if (!providerNewIcons[prefix]) {
68883
- providerNewIcons[prefix] = [];
68884
- }
68885
- });
68886
- sortedIcons.pending.forEach(function(icon) {
68887
- var provider = icon.provider, prefix = icon.prefix, name = icon.name;
68888
- var storage = getStorage(provider, prefix);
68889
- var pendingQueue = storage.pendingIcons || (storage.pendingIcons = /* @__PURE__ */ new Set());
68890
- if (!pendingQueue.has(name)) {
68891
- pendingQueue.add(name);
68892
- newIcons[provider][prefix].push(name);
68893
- }
68894
- });
68895
- sources.forEach(function(storage) {
68896
- var provider = storage.provider, prefix = storage.prefix;
68897
- if (newIcons[provider][prefix].length) {
68898
- loadNewIcons(storage, newIcons[provider][prefix]);
68899
- }
68900
- });
68901
- return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
68902
- };
68903
- function mergeCustomisations(defaults, item) {
68904
- var result = _object_spread$5({}, defaults);
68905
- for(var key in item){
68906
- var value = item[key];
68907
- var valueType = typeof value === "undefined" ? "undefined" : _type_of(value);
68908
- if (key in defaultIconSizeCustomisations) {
68909
- if (value === null || value && (valueType === "string" || valueType === "number")) {
68910
- result[key] = value;
68911
- }
68912
- } else if (valueType === _type_of(result[key])) {
68913
- result[key] = key === "rotate" ? value % 4 : value;
68914
- }
68915
- }
68916
- return result;
68917
- }
68918
- var separator = /[\s,]+/;
68919
- function flipFromString(custom, flip) {
68920
- flip.split(separator).forEach(function(str) {
68921
- var value = str.trim();
68922
- switch(value){
68923
- case "horizontal":
68924
- custom.hFlip = true;
68925
- break;
68926
- case "vertical":
68927
- custom.vFlip = true;
68928
- break;
68929
- }
68930
- });
68931
- }
68932
- function rotateFromString(value) {
68933
- var defaultValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
68934
- var units = value.replace(/^-?[0-9.]*/, "");
68935
- function cleanup(value2) {
68936
- while(value2 < 0){
68937
- value2 += 4;
68938
- }
68939
- return value2 % 4;
68940
- }
68941
- if (units === "") {
68942
- var num = parseInt(value);
68943
- return isNaN(num) ? 0 : cleanup(num);
68944
- } else if (units !== value) {
68945
- var split = 0;
68946
- switch(units){
68947
- case "%":
68948
- split = 25;
68949
- break;
68950
- case "deg":
68951
- split = 90;
68952
- }
68953
- if (split) {
68954
- var num1 = parseFloat(value.slice(0, value.length - units.length));
68955
- if (isNaN(num1)) {
68956
- return 0;
68957
- }
68958
- num1 = num1 / split;
68959
- return num1 % 1 === 0 ? cleanup(num1) : 0;
68960
- }
68961
- }
68962
- return defaultValue;
68963
- }
68964
- function iconToHTML(body, attributes) {
68965
- var renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
68966
- for(var attr in attributes){
68967
- renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
68968
- }
68969
- return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
68970
- }
68971
- function encodeSVGforURL(svg) {
68972
- return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
68973
- }
68974
- function svgToData(svg) {
68975
- return "data:image/svg+xml," + encodeSVGforURL(svg);
68976
- }
68977
- function svgToURL(svg) {
68978
- return 'url("' + svgToData(svg) + '")';
68979
- }
68980
- var policy;
68981
- function createPolicy() {
68982
- try {
68983
- policy = window.trustedTypes.createPolicy("iconify", {
68984
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
68985
- createHTML: function(s) {
68986
- return s;
68987
- }
68988
- });
68989
- } catch (err) {
68990
- policy = null;
68991
- }
68992
- }
68993
- function cleanUpInnerHTML(html) {
68994
- if (policy === void 0) {
68995
- createPolicy();
68996
- }
68997
- return policy ? policy.createHTML(html) : html;
68998
- }
68999
- var defaultExtendedIconCustomisations = _object_spread_props$3(_object_spread$5({}, defaultIconCustomisations), {
69000
- inline: false
69001
- });
69002
- /**
69003
- * Default SVG attributes
69004
- */ var svgDefaults = {
69005
- "xmlns": "http://www.w3.org/2000/svg",
69006
- "xmlnsXlink": "http://www.w3.org/1999/xlink",
69007
- "aria-hidden": true,
69008
- "role": "img"
69009
- };
69010
- /**
69011
- * Style modes
69012
- */ var commonProps = {
69013
- display: "inline-block"
69014
- };
69015
- var monotoneProps = {
69016
- backgroundColor: "currentColor"
69017
- };
69018
- var coloredProps = {
69019
- backgroundColor: "transparent"
69020
- };
69021
- // Dynamically add common props to variables above
69022
- var propsToAdd = {
69023
- Image: "var(--svg)",
69024
- Repeat: "no-repeat",
69025
- Size: "100% 100%"
69026
- };
69027
- var propsToAddTo = {
69028
- WebkitMask: monotoneProps,
69029
- mask: monotoneProps,
69030
- background: coloredProps
69031
- };
69032
- for(var prefix in propsToAddTo){
69033
- var list = propsToAddTo[prefix];
69034
- for(var prop in propsToAdd){
69035
- list[prefix + prop] = propsToAdd[prop];
69036
- }
69037
- }
69038
- /**
69039
- * Default values for customisations for inline icon
69040
- */ var inlineDefaults = _object_spread_props$3(_object_spread$5({}, defaultExtendedIconCustomisations), {
69041
- inline: true
69042
- });
69043
- /**
69044
- * Fix size: add 'px' to numbers
69045
- */ function fixSize(value) {
69046
- return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
69047
- }
69048
- /**
69049
- * Render icon
69050
- */ var render = function(// Icon must be validated before calling this function
69051
- icon, // Partial properties
69052
- props, // True if icon should have vertical-align added
69053
- inline, // Optional reference for SVG/SPAN, extracted by React.forwardRef()
69054
- ref) {
69055
- // Get default properties
69056
- var defaultProps = inline ? inlineDefaults : defaultExtendedIconCustomisations;
69057
- // Get all customisations
69058
- var customisations = mergeCustomisations(defaultProps, props);
69059
- // Check mode
69060
- var mode = props.mode || "svg";
69061
- // Create style
69062
- var style = {};
69063
- var customStyle = props.style || {};
69064
- // Create SVG component properties
69065
- var componentProps = _object_spread_props$3(_object_spread$5({}, mode === "svg" ? svgDefaults : {}), {
69066
- ref: ref
69067
- });
69068
- // Get element properties
69069
- for(var key in props){
69070
- var value = props[key];
69071
- if (value === void 0) {
69072
- continue;
69073
- }
69074
- switch(key){
69075
- // Properties to ignore
69076
- case "icon":
69077
- case "style":
69078
- case "children":
69079
- case "onLoad":
69080
- case "mode":
69081
- case "_ref":
69082
- case "_inline":
69083
- break;
69084
- // Boolean attributes
69085
- case "inline":
69086
- case "hFlip":
69087
- case "vFlip":
69088
- customisations[key] = value === true || value === "true" || value === 1;
69089
- break;
69090
- // Flip as string: 'horizontal,vertical'
69091
- case "flip":
69092
- if (typeof value === "string") {
69093
- flipFromString(customisations, value);
69094
- }
69095
- break;
69096
- // Color: copy to style
69097
- case "color":
69098
- style.color = value;
69099
- break;
69100
- // Rotation as string
69101
- case "rotate":
69102
- if (typeof value === "string") {
69103
- customisations[key] = rotateFromString(value);
69104
- } else if (typeof value === "number") {
69105
- customisations[key] = value;
69106
- }
69107
- break;
69108
- // Remove aria-hidden
69109
- case "ariaHidden":
69110
- case "aria-hidden":
69111
- if (value !== true && value !== "true") {
69112
- delete componentProps["aria-hidden"];
69113
- }
69114
- break;
69115
- // Copy missing property if it does not exist in customisations
69116
- default:
69117
- if (defaultProps[key] === void 0) {
69118
- componentProps[key] = value;
69119
- }
69120
- }
69121
- }
69122
- // Generate icon
69123
- var item = iconToSVG(icon, customisations);
69124
- var renderAttribs = item.attributes;
69125
- // Inline display
69126
- if (customisations.inline) {
69127
- style.verticalAlign = "-0.125em";
69128
- }
69129
- if (mode === "svg") {
69130
- // Add style
69131
- componentProps.style = _object_spread$5({}, style, customStyle);
69132
- // Add icon stuff
69133
- Object.assign(componentProps, renderAttribs);
69134
- // Counter for ids based on "id" property to render icons consistently on server and client
69135
- var localCounter = 0;
69136
- var id = props.id;
69137
- if (typeof id === "string") {
69138
- // Convert '-' to '_' to avoid errors in animations
69139
- id = id.replace(/-/g, "_");
69140
- }
69141
- // Add icon stuff
69142
- componentProps.dangerouslySetInnerHTML = {
69143
- __html: cleanUpInnerHTML(replaceIDs(item.body, id ? function() {
69144
- return id + "ID" + localCounter++;
69145
- } : "iconifyReact"))
69146
- };
69147
- return React__default.createElement("svg", componentProps);
69148
- }
69149
- // Render <span> with style
69150
- var body = icon.body, width = icon.width, height = icon.height;
69151
- var useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
69152
- // Generate SVG
69153
- var html = iconToHTML(body, _object_spread_props$3(_object_spread$5({}, renderAttribs), {
69154
- width: width + "",
69155
- height: height + ""
69156
- }));
69157
- // Generate style
69158
- componentProps.style = _object_spread$5(_object_spread_props$3(_object_spread$5({}, style), {
69159
- "--svg": svgToURL(html),
69160
- "width": fixSize(renderAttribs.width),
69161
- "height": fixSize(renderAttribs.height)
69162
- }), commonProps, useMask ? monotoneProps : coloredProps, customStyle);
69163
- return React__default.createElement("span", componentProps);
69164
- };
69165
- /**
69166
- * Initialise stuff
69167
- */ // Enable short names
69168
- allowSimpleNames(true);
69169
- // Set API module
69170
- setAPIModule("", fetchAPIModule);
69171
- /**
69172
- * Browser stuff
69173
- */ if (typeof document !== "undefined" && typeof window !== "undefined") {
69174
- // Set cache and load existing cache
69175
- initBrowserStorage();
69176
- var _window1 = window;
69177
- // Load icons from global "IconifyPreload"
69178
- if (_window1.IconifyPreload !== void 0) {
69179
- var preload = _window1.IconifyPreload;
69180
- var err = "Invalid IconifyPreload syntax.";
69181
- if (typeof preload === "object" && preload !== null) {
69182
- (_instanceof(preload, Array) ? preload : [
69183
- preload
69184
- ]).forEach(function(item) {
69185
- try {
69186
- if (// Check if item is an object and not null/array
69187
- typeof item !== "object" || item === null || _instanceof(item, Array) || // Check for 'icons' and 'prefix'
69188
- typeof item.icons !== "object" || typeof item.prefix !== "string" || // Add icon set
69189
- !addCollection(item)) {
69190
- console.error(err);
69191
- }
69192
- } catch (e) {
69193
- console.error(err);
69194
- }
69195
- });
69196
- }
69197
- }
69198
- // Set API from global "IconifyProviders"
69199
- if (_window1.IconifyProviders !== void 0) {
69200
- var providers = _window1.IconifyProviders;
69201
- if (typeof providers === "object" && providers !== null) {
69202
- for(var key in providers){
69203
- var err1 = "IconifyProviders[" + key + "] is invalid.";
69204
- try {
69205
- var value = providers[key];
69206
- if (typeof value !== "object" || !value || value.resources === void 0) {
69207
- continue;
69208
- }
69209
- if (!addAPIProvider(key, value)) {
69210
- console.error(err1);
69211
- }
69212
- } catch (e) {
69213
- console.error(err1);
69214
- }
69215
- }
69216
- }
69217
- }
69218
- }
69219
- var IconComponent = /*#__PURE__*/ function(_React_Component) {
69220
- _inherits(IconComponent, _React_Component);
69221
- var _super = _create_super(IconComponent);
69222
- function IconComponent(props) {
69223
- _class_call_check(this, IconComponent);
69224
- var _this;
69225
- _this = _super.call(this, props);
69226
- _this.state = {
69227
- // Render placeholder before component is mounted
69228
- icon: null
69229
- };
69230
- return _this;
69231
- }
69232
- _create_class(IconComponent, [
69233
- {
69234
- /**
69235
- * Abort loading icon
69236
- */ key: "_abortLoading",
69237
- value: function _abortLoading() {
69238
- if (this._loading) {
69239
- this._loading.abort();
69240
- this._loading = null;
69241
- }
69242
- }
69243
- },
69244
- {
69245
- /**
69246
- * Update state
69247
- */ key: "_setData",
69248
- value: function _setData(icon) {
69249
- if (this.state.icon !== icon) {
69250
- this.setState({
69251
- icon: icon
69252
- });
69253
- }
69254
- }
69255
- },
69256
- {
69257
- /**
69258
- * Check if icon should be loaded
69259
- */ key: "_checkIcon",
69260
- value: function _checkIcon(changed) {
69261
- var state = this.state;
69262
- var icon = this.props.icon;
69263
- // Icon is an object
69264
- if (typeof icon === "object" && icon !== null && typeof icon.body === "string") {
69265
- // Stop loading
69266
- this._icon = "";
69267
- this._abortLoading();
69268
- if (changed || state.icon === null) {
69269
- // Set data if it was changed
69270
- this._setData({
69271
- data: icon
69272
- });
69273
- }
69274
- return;
69275
- }
69276
- // Invalid icon?
69277
- var iconName;
69278
- if (typeof icon !== "string" || (iconName = stringToIcon(icon, false, true)) === null) {
69279
- this._abortLoading();
69280
- this._setData(null);
69281
- return;
69282
- }
69283
- // Load icon
69284
- var data = getIconData(iconName);
69285
- if (!data) {
69286
- // Icon data is not available
69287
- if (!this._loading || this._loading.name !== icon) {
69288
- // New icon to load
69289
- this._abortLoading();
69290
- this._icon = "";
69291
- this._setData(null);
69292
- if (data !== null) {
69293
- // Icon was not loaded
69294
- this._loading = {
69295
- name: icon,
69296
- abort: loadIcons([
69297
- iconName
69298
- ], this._checkIcon.bind(this, false))
69299
- };
69300
- }
69301
- }
69302
- return;
69303
- }
69304
- // Icon data is available
69305
- if (this._icon !== icon || state.icon === null) {
69306
- // New icon or icon has been loaded
69307
- this._abortLoading();
69308
- this._icon = icon;
69309
- // Add classes
69310
- var classes = [
69311
- "iconify"
69312
- ];
69313
- if (iconName.prefix !== "") {
69314
- classes.push("iconify--" + iconName.prefix);
69315
- }
69316
- if (iconName.provider !== "") {
69317
- classes.push("iconify--" + iconName.provider);
69318
- }
69319
- // Set data
69320
- this._setData({
69321
- data: data,
69322
- classes: classes
69323
- });
69324
- if (this.props.onLoad) {
69325
- this.props.onLoad(icon);
69326
- }
69327
- }
69328
- }
69329
- },
69330
- {
69331
- /**
69332
- * Component mounted
69333
- */ key: "componentDidMount",
69334
- value: function componentDidMount() {
69335
- this._checkIcon(false);
69336
- }
69337
- },
69338
- {
69339
- /**
69340
- * Component updated
69341
- */ key: "componentDidUpdate",
69342
- value: function componentDidUpdate(oldProps) {
69343
- if (oldProps.icon !== this.props.icon) {
69344
- this._checkIcon(true);
69345
- }
69346
- }
69347
- },
69348
- {
69349
- /**
69350
- * Abort loading
69351
- */ key: "componentWillUnmount",
69352
- value: function componentWillUnmount() {
69353
- this._abortLoading();
69354
- }
69355
- },
69356
- {
69357
- /**
69358
- * Render
69359
- */ key: "render",
69360
- value: function render1() {
69361
- var props = this.props;
69362
- var icon = this.state.icon;
69363
- if (icon === null) {
69364
- // Render placeholder
69365
- return props.children ? props.children : React__default.createElement("span", {});
69366
- }
69367
- // Add classes
69368
- var newProps = props;
69369
- if (icon.classes) {
69370
- newProps = _object_spread_props$3(_object_spread$5({}, props), {
69371
- className: (typeof props.className === "string" ? props.className + " " : "") + icon.classes.join(" ")
69372
- });
69373
- }
69374
- // Render icon
69375
- return render(_object_spread$5({}, defaultIconProps, icon.data), newProps, props._inline, props._ref);
69376
- }
69377
- }
69378
- ]);
69379
- return IconComponent;
69380
- }(React__default.Component);
69381
- /**
69382
- * Block icon
69383
- *
69384
- * @param props - Component properties
69385
- */ var Icon = React__default.forwardRef(function Icon(props, ref) {
69386
- var newProps = _object_spread_props$3(_object_spread$5({}, props), {
69387
- _ref: ref,
69388
- _inline: false
69389
- });
69390
- return React__default.createElement(IconComponent, newProps);
69391
- });
69392
- /**
69393
- * Inline icon (has negative verticalAlign that makes it behave like icon font)
69394
- *
69395
- * @param props - Component properties
69396
- */ React__default.forwardRef(function InlineIcon(props, ref) {
69397
- var newProps = _object_spread_props$3(_object_spread$5({}, props), {
69398
- _ref: ref,
69399
- _inline: true
69400
- });
69401
- return React__default.createElement(IconComponent, newProps);
69402
- });
69403
-
69404
- function _array_like_to_array$4(arr, len) {
67454
+ function _array_like_to_array$3(arr, len) {
69405
67455
  if (len == null || len > arr.length) len = arr.length;
69406
67456
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
69407
67457
  return arr2;
69408
67458
  }
69409
- function _array_with_holes$4(arr) {
67459
+ function _array_with_holes$3(arr) {
69410
67460
  if (Array.isArray(arr)) return arr;
69411
67461
  }
69412
67462
  function _array_without_holes(arr) {
69413
- if (Array.isArray(arr)) return _array_like_to_array$4(arr);
67463
+ if (Array.isArray(arr)) return _array_like_to_array$3(arr);
69414
67464
  }
69415
- function _define_property$4(obj, key, value) {
67465
+ function _define_property$7(obj, key, value) {
69416
67466
  if (key in obj) {
69417
67467
  Object.defineProperty(obj, key, {
69418
67468
  value: value,
@@ -69428,7 +67478,7 @@ function _define_property$4(obj, key, value) {
69428
67478
  function _iterable_to_array(iter) {
69429
67479
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
69430
67480
  }
69431
- function _iterable_to_array_limit$4(arr, i) {
67481
+ function _iterable_to_array_limit$3(arr, i) {
69432
67482
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
69433
67483
  if (_i == null) return;
69434
67484
  var _arr = [];
@@ -69452,13 +67502,13 @@ function _iterable_to_array_limit$4(arr, i) {
69452
67502
  }
69453
67503
  return _arr;
69454
67504
  }
69455
- function _non_iterable_rest$4() {
67505
+ function _non_iterable_rest$3() {
69456
67506
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
69457
67507
  }
69458
67508
  function _non_iterable_spread() {
69459
67509
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
69460
67510
  }
69461
- function _object_spread$4(target) {
67511
+ function _object_spread$7(target) {
69462
67512
  for(var i = 1; i < arguments.length; i++){
69463
67513
  var source = arguments[i] != null ? arguments[i] : {};
69464
67514
  var ownKeys = Object.keys(source);
@@ -69468,12 +67518,12 @@ function _object_spread$4(target) {
69468
67518
  }));
69469
67519
  }
69470
67520
  ownKeys.forEach(function(key) {
69471
- _define_property$4(target, key, source[key]);
67521
+ _define_property$7(target, key, source[key]);
69472
67522
  });
69473
67523
  }
69474
67524
  return target;
69475
67525
  }
69476
- function ownKeys$2(object, enumerableOnly) {
67526
+ function ownKeys$3(object, enumerableOnly) {
69477
67527
  var keys = Object.keys(object);
69478
67528
  if (Object.getOwnPropertySymbols) {
69479
67529
  var symbols = Object.getOwnPropertySymbols(object);
@@ -69486,34 +67536,34 @@ function ownKeys$2(object, enumerableOnly) {
69486
67536
  }
69487
67537
  return keys;
69488
67538
  }
69489
- function _object_spread_props$2(target, source) {
67539
+ function _object_spread_props$3(target, source) {
69490
67540
  source = source != null ? source : {};
69491
67541
  if (Object.getOwnPropertyDescriptors) {
69492
67542
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
69493
67543
  } else {
69494
- ownKeys$2(Object(source)).forEach(function(key) {
67544
+ ownKeys$3(Object(source)).forEach(function(key) {
69495
67545
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
69496
67546
  });
69497
67547
  }
69498
67548
  return target;
69499
67549
  }
69500
- function _sliced_to_array$4(arr, i) {
69501
- return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$4();
67550
+ function _sliced_to_array$3(arr, i) {
67551
+ return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
69502
67552
  }
69503
67553
  function _to_consumable_array(arr) {
69504
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread();
67554
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread();
69505
67555
  }
69506
- function _unsupported_iterable_to_array$4(o, minLen) {
67556
+ function _unsupported_iterable_to_array$3(o, minLen) {
69507
67557
  if (!o) return;
69508
- if (typeof o === "string") return _array_like_to_array$4(o, minLen);
67558
+ if (typeof o === "string") return _array_like_to_array$3(o, minLen);
69509
67559
  var n = Object.prototype.toString.call(o).slice(8, -1);
69510
67560
  if (n === "Object" && o.constructor) n = o.constructor.name;
69511
67561
  if (n === "Map" || n === "Set") return Array.from(n);
69512
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
67562
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
69513
67563
  }
69514
67564
  var DropImage = function(param) {
69515
67565
  var _param_preview = param.preview, preview = _param_preview === void 0 ? true : _param_preview, setFiles = param.setFiles, imageUrls = param.imageUrls, setImageUrls = param.setImageUrls;
69516
- var _useState = _sliced_to_array$4(useState([]), 2), previewFiles = _useState[0], setPreviewFiles = _useState[1];
67566
+ var _useState = _sliced_to_array$3(useState([]), 2), previewFiles = _useState[0], setPreviewFiles = _useState[1];
69517
67567
  var _useDropzone = useDropzone({
69518
67568
  accept: {
69519
67569
  "image/png": [
@@ -69552,11 +67602,11 @@ var DropImage = function(param) {
69552
67602
  return /*#__PURE__*/ jsxs("section", {
69553
67603
  className: "w-full",
69554
67604
  children: [
69555
- /*#__PURE__*/ jsxs("div", _object_spread_props$2(_object_spread$4({}, getRootProps({
67605
+ /*#__PURE__*/ jsxs("div", _object_spread_props$3(_object_spread$7({}, getRootProps({
69556
67606
  className: "dropzone"
69557
67607
  })), {
69558
67608
  children: [
69559
- /*#__PURE__*/ jsx("input", _object_spread$4({}, getInputProps())),
67609
+ /*#__PURE__*/ jsx("input", _object_spread$7({}, getInputProps())),
69560
67610
  /*#__PURE__*/ jsx("div", {
69561
67611
  className: "flex justify-between",
69562
67612
  children: /*#__PURE__*/ jsx("div", {
@@ -69740,15 +67790,15 @@ var Modal = function(param) {
69740
67790
  });
69741
67791
  };
69742
67792
 
69743
- function _array_like_to_array$3(arr, len) {
67793
+ function _array_like_to_array$2(arr, len) {
69744
67794
  if (len == null || len > arr.length) len = arr.length;
69745
67795
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
69746
67796
  return arr2;
69747
67797
  }
69748
- function _array_with_holes$3(arr) {
67798
+ function _array_with_holes$2(arr) {
69749
67799
  if (Array.isArray(arr)) return arr;
69750
67800
  }
69751
- function _iterable_to_array_limit$3(arr, i) {
67801
+ function _iterable_to_array_limit$2(arr, i) {
69752
67802
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
69753
67803
  if (_i == null) return;
69754
67804
  var _arr = [];
@@ -69772,23 +67822,23 @@ function _iterable_to_array_limit$3(arr, i) {
69772
67822
  }
69773
67823
  return _arr;
69774
67824
  }
69775
- function _non_iterable_rest$3() {
67825
+ function _non_iterable_rest$2() {
69776
67826
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
69777
67827
  }
69778
- function _sliced_to_array$3(arr, i) {
69779
- return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
67828
+ function _sliced_to_array$2(arr, i) {
67829
+ return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
69780
67830
  }
69781
- function _unsupported_iterable_to_array$3(o, minLen) {
67831
+ function _unsupported_iterable_to_array$2(o, minLen) {
69782
67832
  if (!o) return;
69783
- if (typeof o === "string") return _array_like_to_array$3(o, minLen);
67833
+ if (typeof o === "string") return _array_like_to_array$2(o, minLen);
69784
67834
  var n = Object.prototype.toString.call(o).slice(8, -1);
69785
67835
  if (n === "Object" && o.constructor) n = o.constructor.name;
69786
67836
  if (n === "Map" || n === "Set") return Array.from(n);
69787
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
67837
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
69788
67838
  }
69789
67839
  var BaseTemplate = function(param) {
69790
67840
  var file = param.file, imageUrl = param.imageUrl;
69791
- var _useState = _sliced_to_array$3(useState(null), 2), tempImage = _useState[0], setTempImage = _useState[1];
67841
+ var _useState = _sliced_to_array$2(useState(null), 2), tempImage = _useState[0], setTempImage = _useState[1];
69792
67842
  useEffect(function() {
69793
67843
  var fileReader;
69794
67844
  var isCancel = false;
@@ -69849,15 +67899,15 @@ var BaseTemplate = function(param) {
69849
67899
  });
69850
67900
  };
69851
67901
 
69852
- function _array_like_to_array$2(arr, len) {
67902
+ function _array_like_to_array$1(arr, len) {
69853
67903
  if (len == null || len > arr.length) len = arr.length;
69854
67904
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
69855
67905
  return arr2;
69856
67906
  }
69857
- function _array_with_holes$2(arr) {
67907
+ function _array_with_holes$1(arr) {
69858
67908
  if (Array.isArray(arr)) return arr;
69859
67909
  }
69860
- function _iterable_to_array_limit$2(arr, i) {
67910
+ function _iterable_to_array_limit$1(arr, i) {
69861
67911
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
69862
67912
  if (_i == null) return;
69863
67913
  var _arr = [];
@@ -69881,25 +67931,25 @@ function _iterable_to_array_limit$2(arr, i) {
69881
67931
  }
69882
67932
  return _arr;
69883
67933
  }
69884
- function _non_iterable_rest$2() {
67934
+ function _non_iterable_rest$1() {
69885
67935
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
69886
67936
  }
69887
- function _sliced_to_array$2(arr, i) {
69888
- return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
67937
+ function _sliced_to_array$1(arr, i) {
67938
+ return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1();
69889
67939
  }
69890
- function _unsupported_iterable_to_array$2(o, minLen) {
67940
+ function _unsupported_iterable_to_array$1(o, minLen) {
69891
67941
  if (!o) return;
69892
- if (typeof o === "string") return _array_like_to_array$2(o, minLen);
67942
+ if (typeof o === "string") return _array_like_to_array$1(o, minLen);
69893
67943
  var n = Object.prototype.toString.call(o).slice(8, -1);
69894
67944
  if (n === "Object" && o.constructor) n = o.constructor.name;
69895
67945
  if (n === "Map" || n === "Set") return Array.from(n);
69896
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
67946
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
69897
67947
  }
69898
67948
  var CustomUpload = function(param) {
69899
67949
  var className = param.className, children = param.children, file = param.file, setFile = param.setFile, imageUrl = param.imageUrl, setImageUrl = param.setImageUrl;
69900
67950
  var imageMimeType = /image\/(png|jpg|jpeg)/i;
69901
67951
  var DEFAULT_IMAGE_SIZE_LIMIT_IN_BYTES = 5120000; // 5000 KB
69902
- var _useState = _sliced_to_array$2(useState(null), 2), modal = _useState[0], setModal = _useState[1];
67952
+ var _useState = _sliced_to_array$1(useState(null), 2), modal = _useState[0], setModal = _useState[1];
69903
67953
  var hiddenFileInput = useRef(null);
69904
67954
  var handleImageClick = function() {
69905
67955
  var _hiddenFileInput_current;
@@ -69997,7 +68047,7 @@ function cn() {
69997
68047
  return twMerge(clsx(inputs));
69998
68048
  }
69999
68049
 
70000
- function _define_property$3(obj, key, value) {
68050
+ function _define_property$6(obj, key, value) {
70001
68051
  if (key in obj) {
70002
68052
  Object.defineProperty(obj, key, {
70003
68053
  value: value,
@@ -70010,7 +68060,7 @@ function _define_property$3(obj, key, value) {
70010
68060
  }
70011
68061
  return obj;
70012
68062
  }
70013
- function _object_spread$3(target) {
68063
+ function _object_spread$6(target) {
70014
68064
  for(var i = 1; i < arguments.length; i++){
70015
68065
  var source = arguments[i] != null ? arguments[i] : {};
70016
68066
  var ownKeys = Object.keys(source);
@@ -70020,12 +68070,12 @@ function _object_spread$3(target) {
70020
68070
  }));
70021
68071
  }
70022
68072
  ownKeys.forEach(function(key) {
70023
- _define_property$3(target, key, source[key]);
68073
+ _define_property$6(target, key, source[key]);
70024
68074
  });
70025
68075
  }
70026
68076
  return target;
70027
68077
  }
70028
- function ownKeys$1(object, enumerableOnly) {
68078
+ function ownKeys$2(object, enumerableOnly) {
70029
68079
  var keys = Object.keys(object);
70030
68080
  if (Object.getOwnPropertySymbols) {
70031
68081
  var symbols = Object.getOwnPropertySymbols(object);
@@ -70038,20 +68088,20 @@ function ownKeys$1(object, enumerableOnly) {
70038
68088
  }
70039
68089
  return keys;
70040
68090
  }
70041
- function _object_spread_props$1(target, source) {
68091
+ function _object_spread_props$2(target, source) {
70042
68092
  source = source != null ? source : {};
70043
68093
  if (Object.getOwnPropertyDescriptors) {
70044
68094
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
70045
68095
  } else {
70046
- ownKeys$1(Object(source)).forEach(function(key) {
68096
+ ownKeys$2(Object(source)).forEach(function(key) {
70047
68097
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
70048
68098
  });
70049
68099
  }
70050
68100
  return target;
70051
68101
  }
70052
- function _object_without_properties$3(source, excluded) {
68102
+ function _object_without_properties$6(source, excluded) {
70053
68103
  if (source == null) return {};
70054
- var target = _object_without_properties_loose$3(source, excluded);
68104
+ var target = _object_without_properties_loose$6(source, excluded);
70055
68105
  var key, i;
70056
68106
  if (Object.getOwnPropertySymbols) {
70057
68107
  var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
@@ -70064,7 +68114,7 @@ function _object_without_properties$3(source, excluded) {
70064
68114
  }
70065
68115
  return target;
70066
68116
  }
70067
- function _object_without_properties_loose$3(source, excluded) {
68117
+ function _object_without_properties_loose$6(source, excluded) {
70068
68118
  if (source == null) return {};
70069
68119
  var target = {};
70070
68120
  var sourceKeys = Object.keys(source);
@@ -70077,10 +68127,10 @@ function _object_without_properties_loose$3(source, excluded) {
70077
68127
  return target;
70078
68128
  }
70079
68129
  var Switch = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
70080
- var className = _param.className, props = _object_without_properties$3(_param, [
68130
+ var className = _param.className, props = _object_without_properties$6(_param, [
70081
68131
  "className"
70082
68132
  ]);
70083
- return /*#__PURE__*/ jsx(SwitchPrimitives.Root, _object_spread_props$1(_object_spread$3({
68133
+ return /*#__PURE__*/ jsx(SwitchPrimitives.Root, _object_spread_props$2(_object_spread$6({
70084
68134
  className: cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className)
70085
68135
  }, props), {
70086
68136
  ref: ref,
@@ -70091,7 +68141,7 @@ var Switch = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
70091
68141
  });
70092
68142
  Switch.displayName = SwitchPrimitives.Root.displayName;
70093
68143
 
70094
- function _define_property$2(obj, key, value) {
68144
+ function _define_property$5(obj, key, value) {
70095
68145
  if (key in obj) {
70096
68146
  Object.defineProperty(obj, key, {
70097
68147
  value: value,
@@ -70104,7 +68154,7 @@ function _define_property$2(obj, key, value) {
70104
68154
  }
70105
68155
  return obj;
70106
68156
  }
70107
- function _object_spread$2(target) {
68157
+ function _object_spread$5(target) {
70108
68158
  for(var i = 1; i < arguments.length; i++){
70109
68159
  var source = arguments[i] != null ? arguments[i] : {};
70110
68160
  var ownKeys = Object.keys(source);
@@ -70114,14 +68164,14 @@ function _object_spread$2(target) {
70114
68164
  }));
70115
68165
  }
70116
68166
  ownKeys.forEach(function(key) {
70117
- _define_property$2(target, key, source[key]);
68167
+ _define_property$5(target, key, source[key]);
70118
68168
  });
70119
68169
  }
70120
68170
  return target;
70121
68171
  }
70122
- function _object_without_properties$2(source, excluded) {
68172
+ function _object_without_properties$5(source, excluded) {
70123
68173
  if (source == null) return {};
70124
- var target = _object_without_properties_loose$2(source, excluded);
68174
+ var target = _object_without_properties_loose$5(source, excluded);
70125
68175
  var key, i;
70126
68176
  if (Object.getOwnPropertySymbols) {
70127
68177
  var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
@@ -70134,7 +68184,7 @@ function _object_without_properties$2(source, excluded) {
70134
68184
  }
70135
68185
  return target;
70136
68186
  }
70137
- function _object_without_properties_loose$2(source, excluded) {
68187
+ function _object_without_properties_loose$5(source, excluded) {
70138
68188
  if (source == null) return {};
70139
68189
  var target = {};
70140
68190
  var sourceKeys = Object.keys(source);
@@ -70169,14 +68219,14 @@ var buttonVariants = cva("inline-flex items-center justify-center whitespace-now
70169
68219
  }
70170
68220
  });
70171
68221
  var Button = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
70172
- var className = _param.className, variant = _param.variant, size = _param.size, _param_asChild = _param.asChild, asChild = _param_asChild === void 0 ? false : _param_asChild, props = _object_without_properties$2(_param, [
68222
+ var className = _param.className, variant = _param.variant, size = _param.size, _param_asChild = _param.asChild, asChild = _param_asChild === void 0 ? false : _param_asChild, props = _object_without_properties$5(_param, [
70173
68223
  "className",
70174
68224
  "variant",
70175
68225
  "size",
70176
68226
  "asChild"
70177
68227
  ]);
70178
68228
  var Comp = asChild ? Slot : "button";
70179
- return /*#__PURE__*/ jsx(Comp, _object_spread$2({
68229
+ return /*#__PURE__*/ jsx(Comp, _object_spread$5({
70180
68230
  className: cn(buttonVariants({
70181
68231
  variant: variant,
70182
68232
  size: size,
@@ -70186,7 +68236,7 @@ var Button = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
70186
68236
  }, props));
70187
68237
  });
70188
68238
 
70189
- function _define_property$1(obj, key, value) {
68239
+ function _define_property$4(obj, key, value) {
70190
68240
  if (key in obj) {
70191
68241
  Object.defineProperty(obj, key, {
70192
68242
  value: value,
@@ -70217,7 +68267,7 @@ function _object_destructuring_empty(o) {
70217
68267
  if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
70218
68268
  return o;
70219
68269
  }
70220
- function _object_spread$1(target) {
68270
+ function _object_spread$4(target) {
70221
68271
  for(var i = 1; i < arguments.length; i++){
70222
68272
  var source = arguments[i] != null ? arguments[i] : {};
70223
68273
  var ownKeys = Object.keys(source);
@@ -70227,12 +68277,12 @@ function _object_spread$1(target) {
70227
68277
  }));
70228
68278
  }
70229
68279
  ownKeys.forEach(function(key) {
70230
- _define_property$1(target, key, source[key]);
68280
+ _define_property$4(target, key, source[key]);
70231
68281
  });
70232
68282
  }
70233
68283
  return target;
70234
68284
  }
70235
- function ownKeys(object, enumerableOnly) {
68285
+ function ownKeys$1(object, enumerableOnly) {
70236
68286
  var keys = Object.keys(object);
70237
68287
  if (Object.getOwnPropertySymbols) {
70238
68288
  var symbols = Object.getOwnPropertySymbols(object);
@@ -70245,20 +68295,20 @@ function ownKeys(object, enumerableOnly) {
70245
68295
  }
70246
68296
  return keys;
70247
68297
  }
70248
- function _object_spread_props(target, source) {
68298
+ function _object_spread_props$1(target, source) {
70249
68299
  source = source != null ? source : {};
70250
68300
  if (Object.getOwnPropertyDescriptors) {
70251
68301
  Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
70252
68302
  } else {
70253
- ownKeys(Object(source)).forEach(function(key) {
68303
+ ownKeys$1(Object(source)).forEach(function(key) {
70254
68304
  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
70255
68305
  });
70256
68306
  }
70257
68307
  return target;
70258
68308
  }
70259
- function _object_without_properties$1(source, excluded) {
68309
+ function _object_without_properties$4(source, excluded) {
70260
68310
  if (source == null) return {};
70261
- var target = _object_without_properties_loose$1(source, excluded);
68311
+ var target = _object_without_properties_loose$4(source, excluded);
70262
68312
  var key, i;
70263
68313
  if (Object.getOwnPropertySymbols) {
70264
68314
  var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
@@ -70271,7 +68321,7 @@ function _object_without_properties$1(source, excluded) {
70271
68321
  }
70272
68322
  return target;
70273
68323
  }
70274
- function _object_without_properties_loose$1(source, excluded) {
68324
+ function _object_without_properties_loose$4(source, excluded) {
70275
68325
  if (source == null) return {};
70276
68326
  var target = {};
70277
68327
  var sourceKeys = Object.keys(source);
@@ -70284,15 +68334,15 @@ function _object_without_properties_loose$1(source, excluded) {
70284
68334
  return target;
70285
68335
  }
70286
68336
  function Calendar(_param) {
70287
- var className = _param.className, classNames = _param.classNames, _param_showOutsideDays = _param.showOutsideDays, showOutsideDays = _param_showOutsideDays === void 0 ? true : _param_showOutsideDays, props = _object_without_properties$1(_param, [
68337
+ var className = _param.className, classNames = _param.classNames, _param_showOutsideDays = _param.showOutsideDays, showOutsideDays = _param_showOutsideDays === void 0 ? true : _param_showOutsideDays, props = _object_without_properties$4(_param, [
70288
68338
  "className",
70289
68339
  "classNames",
70290
68340
  "showOutsideDays"
70291
68341
  ]);
70292
- return /*#__PURE__*/ jsx(DayPicker, _object_spread_props(_object_spread$1({
68342
+ return /*#__PURE__*/ jsx(DayPicker, _object_spread_props$1(_object_spread$4({
70293
68343
  showOutsideDays: showOutsideDays,
70294
68344
  className: cn("p-3", className),
70295
- classNames: _object_spread$1({
68345
+ classNames: _object_spread$4({
70296
68346
  months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
70297
68347
  month: "space-y-4",
70298
68348
  caption: "flex justify-center pt-1 relative items-center",
@@ -70344,7 +68394,7 @@ function Calendar(_param) {
70344
68394
  }
70345
68395
  Calendar.displayName = "Calendar";
70346
68396
 
70347
- function _define_property(obj, key, value) {
68397
+ function _define_property$3(obj, key, value) {
70348
68398
  if (key in obj) {
70349
68399
  Object.defineProperty(obj, key, {
70350
68400
  value: value,
@@ -70357,7 +68407,7 @@ function _define_property(obj, key, value) {
70357
68407
  }
70358
68408
  return obj;
70359
68409
  }
70360
- function _object_spread(target) {
68410
+ function _object_spread$3(target) {
70361
68411
  for(var i = 1; i < arguments.length; i++){
70362
68412
  var source = arguments[i] != null ? arguments[i] : {};
70363
68413
  var ownKeys = Object.keys(source);
@@ -70367,14 +68417,14 @@ function _object_spread(target) {
70367
68417
  }));
70368
68418
  }
70369
68419
  ownKeys.forEach(function(key) {
70370
- _define_property(target, key, source[key]);
68420
+ _define_property$3(target, key, source[key]);
70371
68421
  });
70372
68422
  }
70373
68423
  return target;
70374
68424
  }
70375
- function _object_without_properties(source, excluded) {
68425
+ function _object_without_properties$3(source, excluded) {
70376
68426
  if (source == null) return {};
70377
- var target = _object_without_properties_loose(source, excluded);
68427
+ var target = _object_without_properties_loose$3(source, excluded);
70378
68428
  var key, i;
70379
68429
  if (Object.getOwnPropertySymbols) {
70380
68430
  var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
@@ -70387,7 +68437,7 @@ function _object_without_properties(source, excluded) {
70387
68437
  }
70388
68438
  return target;
70389
68439
  }
70390
- function _object_without_properties_loose(source, excluded) {
68440
+ function _object_without_properties_loose$3(source, excluded) {
70391
68441
  if (source == null) return {};
70392
68442
  var target = {};
70393
68443
  var sourceKeys = Object.keys(source);
@@ -70402,13 +68452,13 @@ function _object_without_properties_loose(source, excluded) {
70402
68452
  var Popover = PopoverPrimitive.Root;
70403
68453
  var PopoverTrigger = PopoverPrimitive.Trigger;
70404
68454
  var PopoverContent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
70405
- var className = _param.className, _param_align = _param.align, align = _param_align === void 0 ? "center" : _param_align, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties(_param, [
68455
+ var className = _param.className, _param_align = _param.align, align = _param_align === void 0 ? "center" : _param_align, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties$3(_param, [
70406
68456
  "className",
70407
68457
  "align",
70408
68458
  "sideOffset"
70409
68459
  ]);
70410
68460
  return /*#__PURE__*/ jsx(PopoverPrimitive.Portal, {
70411
- children: /*#__PURE__*/ jsx(PopoverPrimitive.Content, _object_spread({
68461
+ children: /*#__PURE__*/ jsx(PopoverPrimitive.Content, _object_spread$3({
70412
68462
  ref: ref,
70413
68463
  align: align,
70414
68464
  sideOffset: sideOffset,
@@ -70418,61 +68468,11 @@ var PopoverContent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
70418
68468
  });
70419
68469
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
70420
68470
 
70421
- function _array_like_to_array$1(arr, len) {
70422
- if (len == null || len > arr.length) len = arr.length;
70423
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
70424
- return arr2;
70425
- }
70426
- function _array_with_holes$1(arr) {
70427
- if (Array.isArray(arr)) return arr;
70428
- }
70429
- function _iterable_to_array_limit$1(arr, i) {
70430
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
70431
- if (_i == null) return;
70432
- var _arr = [];
70433
- var _n = true;
70434
- var _d = false;
70435
- var _s, _e;
70436
- try {
70437
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
70438
- _arr.push(_s.value);
70439
- if (i && _arr.length === i) break;
70440
- }
70441
- } catch (err) {
70442
- _d = true;
70443
- _e = err;
70444
- } finally{
70445
- try {
70446
- if (!_n && _i["return"] != null) _i["return"]();
70447
- } finally{
70448
- if (_d) throw _e;
70449
- }
70450
- }
70451
- return _arr;
70452
- }
70453
- function _non_iterable_rest$1() {
70454
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
70455
- }
70456
- function _sliced_to_array$1(arr, i) {
70457
- return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1();
70458
- }
70459
- function _unsupported_iterable_to_array$1(o, minLen) {
70460
- if (!o) return;
70461
- if (typeof o === "string") return _array_like_to_array$1(o, minLen);
70462
- var n = Object.prototype.toString.call(o).slice(8, -1);
70463
- if (n === "Object" && o.constructor) n = o.constructor.name;
70464
- if (n === "Map" || n === "Set") return Array.from(n);
70465
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
70466
- }
70467
68471
  function DateRangePicker(param) {
70468
- var className = param.className, inputClassName = param.inputClassName, disable = param.disable, _param_isShowCleanBtn = param.isShowCleanBtn, isShowCleanBtn = _param_isShowCleanBtn === void 0 ? true : _param_isShowCleanBtn, onChange = param.onChange, dates = param.dates;
70469
- var _useState = _sliced_to_array$1(useState({
70470
- from: (dates === null || dates === void 0 ? void 0 : dates.from) || undefined,
70471
- to: (dates === null || dates === void 0 ? void 0 : dates.to) || undefined
70472
- }), 2), date = _useState[0], setDate = _useState[1];
68472
+ var className = param.className, inputClassName = param.inputClassName, disable = param.disable, _param_isShowCleanBtn = param.isShowCleanBtn, isShowCleanBtn = _param_isShowCleanBtn === void 0 ? true : _param_isShowCleanBtn, onChange = param.onChange, dates = param.dates, setDates = param.setDates;
70473
68473
  var handleDateChange = function(newDate) {
70474
68474
  if (newDate) {
70475
- setDate(newDate);
68475
+ setDates(newDate);
70476
68476
  if (onChange) onChange(newDate);
70477
68477
  }
70478
68478
  };
@@ -70488,19 +68488,19 @@ function DateRangePicker(param) {
70488
68488
  children: /*#__PURE__*/ jsxs(Button, {
70489
68489
  id: "date",
70490
68490
  variant: "outline",
70491
- className: cn("w-[300px] justify-start text-left font-normal", !date && "text-muted-foreground", inputClassName),
68491
+ className: cn("w-[300px] justify-start text-left font-normal", !dates && "text-muted-foreground", inputClassName),
70492
68492
  children: [
70493
68493
  /*#__PURE__*/ jsx(Calendar$1, {
70494
68494
  className: "mr-2 h-4 w-4"
70495
68495
  }),
70496
- (date === null || date === void 0 ? void 0 : date.from) ? date.to ? /*#__PURE__*/ jsxs(Fragment$1, {
68496
+ (dates === null || dates === void 0 ? void 0 : dates.from) ? dates.to ? /*#__PURE__*/ jsxs(Fragment$1, {
70497
68497
  children: [
70498
- format(date.from, "yyyy-MM-dd"),
68498
+ format(dates.from, "yyyy-MM-dd"),
70499
68499
  " -",
70500
68500
  " ",
70501
- format(date.to, "yyyy-MM-dd")
68501
+ format(dates.to, "yyyy-MM-dd")
70502
68502
  ]
70503
- }) : format(date.from, "yyyy-MM-dd") : /*#__PURE__*/ jsx("span", {
68503
+ }) : format(dates.from, "yyyy-MM-dd") : /*#__PURE__*/ jsx("span", {
70504
68504
  children: "請選擇日期"
70505
68505
  })
70506
68506
  ]
@@ -70512,8 +68512,8 @@ function DateRangePicker(param) {
70512
68512
  children: /*#__PURE__*/ jsx(Calendar, {
70513
68513
  initialFocus: true,
70514
68514
  mode: "range",
70515
- defaultMonth: date === null || date === void 0 ? void 0 : date.from,
70516
- selected: date,
68515
+ defaultMonth: dates === null || dates === void 0 ? void 0 : dates.from,
68516
+ selected: dates,
70517
68517
  onSelect: handleDateChange,
70518
68518
  numberOfMonths: 2
70519
68519
  })
@@ -70525,7 +68525,7 @@ function DateRangePicker(param) {
70525
68525
  variant: "ghost",
70526
68526
  className: cn("justify-start text-left font-normal"),
70527
68527
  onClick: function() {
70528
- return setDate(undefined);
68528
+ return setDates(undefined);
70529
68529
  },
70530
68530
  children: "清除日期"
70531
68531
  })
@@ -70652,12 +68652,10 @@ var ReactDateRange = function(param) {
70652
68652
  ref: refOne,
70653
68653
  children: [
70654
68654
  open && (item === null || item === void 0 ? void 0 : item.type) === "date" && /*#__PURE__*/ jsx(Calendar$2, {
70655
- showDateDisplay: true,
70656
68655
  data: calendarData,
70657
68656
  locale: locales[locale],
70658
68657
  dateDisplayFormat: item === null || item === void 0 ? void 0 : item.dateDisplayFormat,
70659
68658
  onChange: function(value) {
70660
- console.log(value);
70661
68659
  setCalendarData(value);
70662
68660
  if (onChange) onChange(value);
70663
68661
  setOpen(false);
@@ -70681,4 +68679,414 @@ var ReactDateRange = function(param) {
70681
68679
  });
70682
68680
  };
70683
68681
 
68682
+ function _define_property$2(obj, key, value) {
68683
+ if (key in obj) {
68684
+ Object.defineProperty(obj, key, {
68685
+ value: value,
68686
+ enumerable: true,
68687
+ configurable: true,
68688
+ writable: true
68689
+ });
68690
+ } else {
68691
+ obj[key] = value;
68692
+ }
68693
+ return obj;
68694
+ }
68695
+ function _object_spread$2(target) {
68696
+ for(var i = 1; i < arguments.length; i++){
68697
+ var source = arguments[i] != null ? arguments[i] : {};
68698
+ var ownKeys = Object.keys(source);
68699
+ if (typeof Object.getOwnPropertySymbols === "function") {
68700
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
68701
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
68702
+ }));
68703
+ }
68704
+ ownKeys.forEach(function(key) {
68705
+ _define_property$2(target, key, source[key]);
68706
+ });
68707
+ }
68708
+ return target;
68709
+ }
68710
+ function ownKeys(object, enumerableOnly) {
68711
+ var keys = Object.keys(object);
68712
+ if (Object.getOwnPropertySymbols) {
68713
+ var symbols = Object.getOwnPropertySymbols(object);
68714
+ if (enumerableOnly) {
68715
+ symbols = symbols.filter(function(sym) {
68716
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
68717
+ });
68718
+ }
68719
+ keys.push.apply(keys, symbols);
68720
+ }
68721
+ return keys;
68722
+ }
68723
+ function _object_spread_props(target, source) {
68724
+ source = source != null ? source : {};
68725
+ if (Object.getOwnPropertyDescriptors) {
68726
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
68727
+ } else {
68728
+ ownKeys(Object(source)).forEach(function(key) {
68729
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
68730
+ });
68731
+ }
68732
+ return target;
68733
+ }
68734
+ function _object_without_properties$2(source, excluded) {
68735
+ if (source == null) return {};
68736
+ var target = _object_without_properties_loose$2(source, excluded);
68737
+ var key, i;
68738
+ if (Object.getOwnPropertySymbols) {
68739
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
68740
+ for(i = 0; i < sourceSymbolKeys.length; i++){
68741
+ key = sourceSymbolKeys[i];
68742
+ if (excluded.indexOf(key) >= 0) continue;
68743
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
68744
+ target[key] = source[key];
68745
+ }
68746
+ }
68747
+ return target;
68748
+ }
68749
+ function _object_without_properties_loose$2(source, excluded) {
68750
+ if (source == null) return {};
68751
+ var target = {};
68752
+ var sourceKeys = Object.keys(source);
68753
+ var key, i;
68754
+ for(i = 0; i < sourceKeys.length; i++){
68755
+ key = sourceKeys[i];
68756
+ if (excluded.indexOf(key) >= 0) continue;
68757
+ target[key] = source[key];
68758
+ }
68759
+ return target;
68760
+ }
68761
+ var DropdownMenuSubTrigger = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
68762
+ var className = _param.className, inset = _param.inset, children = _param.children, props = _object_without_properties$2(_param, [
68763
+ "className",
68764
+ "inset",
68765
+ "children"
68766
+ ]);
68767
+ return /*#__PURE__*/ jsxs(DropdownMenuPrimitive.SubTrigger, _object_spread_props(_object_spread$2({
68768
+ ref: ref,
68769
+ className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent", inset && "pl-8", className)
68770
+ }, props), {
68771
+ children: [
68772
+ children,
68773
+ /*#__PURE__*/ jsx(ChevronRightIcon, {
68774
+ className: "ml-auto h-4 w-4"
68775
+ })
68776
+ ]
68777
+ }));
68778
+ });
68779
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
68780
+ var DropdownMenuSubContent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
68781
+ var className = _param.className, props = _object_without_properties$2(_param, [
68782
+ "className"
68783
+ ]);
68784
+ return /*#__PURE__*/ jsx(DropdownMenuPrimitive.SubContent, _object_spread$2({
68785
+ ref: ref,
68786
+ className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className)
68787
+ }, props));
68788
+ });
68789
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
68790
+ var DropdownMenuContent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
68791
+ var className = _param.className, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties$2(_param, [
68792
+ "className",
68793
+ "sideOffset"
68794
+ ]);
68795
+ return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Portal, {
68796
+ children: /*#__PURE__*/ jsx(DropdownMenuPrimitive.Content, _object_spread$2({
68797
+ ref: ref,
68798
+ sideOffset: sideOffset,
68799
+ className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className)
68800
+ }, props))
68801
+ });
68802
+ });
68803
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
68804
+ var DropdownMenuItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
68805
+ var className = _param.className, inset = _param.inset, props = _object_without_properties$2(_param, [
68806
+ "className",
68807
+ "inset"
68808
+ ]);
68809
+ return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Item, _object_spread$2({
68810
+ ref: ref,
68811
+ className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className)
68812
+ }, props));
68813
+ });
68814
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
68815
+ var DropdownMenuCheckboxItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
68816
+ var className = _param.className, children = _param.children, checked = _param.checked, props = _object_without_properties$2(_param, [
68817
+ "className",
68818
+ "children",
68819
+ "checked"
68820
+ ]);
68821
+ return /*#__PURE__*/ jsxs(DropdownMenuPrimitive.CheckboxItem, _object_spread_props(_object_spread$2({
68822
+ ref: ref,
68823
+ className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
68824
+ checked: checked
68825
+ }, props), {
68826
+ children: [
68827
+ /*#__PURE__*/ jsx("span", {
68828
+ className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
68829
+ children: /*#__PURE__*/ jsx(DropdownMenuPrimitive.ItemIndicator, {
68830
+ children: /*#__PURE__*/ jsx(CheckIcon, {
68831
+ className: "h-4 w-4"
68832
+ })
68833
+ })
68834
+ }),
68835
+ children
68836
+ ]
68837
+ }));
68838
+ });
68839
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
68840
+ var DropdownMenuRadioItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
68841
+ var className = _param.className, children = _param.children, props = _object_without_properties$2(_param, [
68842
+ "className",
68843
+ "children"
68844
+ ]);
68845
+ return /*#__PURE__*/ jsxs(DropdownMenuPrimitive.RadioItem, _object_spread_props(_object_spread$2({
68846
+ ref: ref,
68847
+ className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)
68848
+ }, props), {
68849
+ children: [
68850
+ /*#__PURE__*/ jsx("span", {
68851
+ className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
68852
+ children: /*#__PURE__*/ jsx(DropdownMenuPrimitive.ItemIndicator, {
68853
+ children: /*#__PURE__*/ jsx(DotFilledIcon, {
68854
+ className: "h-4 w-4 fill-current"
68855
+ })
68856
+ })
68857
+ }),
68858
+ children
68859
+ ]
68860
+ }));
68861
+ });
68862
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
68863
+ var DropdownMenuLabel = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
68864
+ var className = _param.className, inset = _param.inset, props = _object_without_properties$2(_param, [
68865
+ "className",
68866
+ "inset"
68867
+ ]);
68868
+ return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Label, _object_spread$2({
68869
+ ref: ref,
68870
+ className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)
68871
+ }, props));
68872
+ });
68873
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
68874
+ var DropdownMenuSeparator = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
68875
+ var className = _param.className, props = _object_without_properties$2(_param, [
68876
+ "className"
68877
+ ]);
68878
+ return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Separator, _object_spread$2({
68879
+ ref: ref,
68880
+ className: cn("-mx-1 my-1 h-px bg-muted", className)
68881
+ }, props));
68882
+ });
68883
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
68884
+
68885
+ function _define_property$1(obj, key, value) {
68886
+ if (key in obj) {
68887
+ Object.defineProperty(obj, key, {
68888
+ value: value,
68889
+ enumerable: true,
68890
+ configurable: true,
68891
+ writable: true
68892
+ });
68893
+ } else {
68894
+ obj[key] = value;
68895
+ }
68896
+ return obj;
68897
+ }
68898
+ function _object_spread$1(target) {
68899
+ for(var i = 1; i < arguments.length; i++){
68900
+ var source = arguments[i] != null ? arguments[i] : {};
68901
+ var ownKeys = Object.keys(source);
68902
+ if (typeof Object.getOwnPropertySymbols === "function") {
68903
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
68904
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
68905
+ }));
68906
+ }
68907
+ ownKeys.forEach(function(key) {
68908
+ _define_property$1(target, key, source[key]);
68909
+ });
68910
+ }
68911
+ return target;
68912
+ }
68913
+ function _object_without_properties$1(source, excluded) {
68914
+ if (source == null) return {};
68915
+ var target = _object_without_properties_loose$1(source, excluded);
68916
+ var key, i;
68917
+ if (Object.getOwnPropertySymbols) {
68918
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
68919
+ for(i = 0; i < sourceSymbolKeys.length; i++){
68920
+ key = sourceSymbolKeys[i];
68921
+ if (excluded.indexOf(key) >= 0) continue;
68922
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
68923
+ target[key] = source[key];
68924
+ }
68925
+ }
68926
+ return target;
68927
+ }
68928
+ function _object_without_properties_loose$1(source, excluded) {
68929
+ if (source == null) return {};
68930
+ var target = {};
68931
+ var sourceKeys = Object.keys(source);
68932
+ var key, i;
68933
+ for(i = 0; i < sourceKeys.length; i++){
68934
+ key = sourceKeys[i];
68935
+ if (excluded.indexOf(key) >= 0) continue;
68936
+ target[key] = source[key];
68937
+ }
68938
+ return target;
68939
+ }
68940
+ var Input = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
68941
+ var className = _param.className, type = _param.type, props = _object_without_properties$1(_param, [
68942
+ "className",
68943
+ "type"
68944
+ ]);
68945
+ return /*#__PURE__*/ jsx("input", _object_spread$1({
68946
+ type: type,
68947
+ className: cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", className),
68948
+ ref: ref
68949
+ }, props));
68950
+ });
68951
+ Input.displayName = "Input";
68952
+
68953
+ function _define_property(obj, key, value) {
68954
+ if (key in obj) {
68955
+ Object.defineProperty(obj, key, {
68956
+ value: value,
68957
+ enumerable: true,
68958
+ configurable: true,
68959
+ writable: true
68960
+ });
68961
+ } else {
68962
+ obj[key] = value;
68963
+ }
68964
+ return obj;
68965
+ }
68966
+ function _object_spread(target) {
68967
+ for(var i = 1; i < arguments.length; i++){
68968
+ var source = arguments[i] != null ? arguments[i] : {};
68969
+ var ownKeys = Object.keys(source);
68970
+ if (typeof Object.getOwnPropertySymbols === "function") {
68971
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
68972
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
68973
+ }));
68974
+ }
68975
+ ownKeys.forEach(function(key) {
68976
+ _define_property(target, key, source[key]);
68977
+ });
68978
+ }
68979
+ return target;
68980
+ }
68981
+ function _object_without_properties(source, excluded) {
68982
+ if (source == null) return {};
68983
+ var target = _object_without_properties_loose(source, excluded);
68984
+ var key, i;
68985
+ if (Object.getOwnPropertySymbols) {
68986
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
68987
+ for(i = 0; i < sourceSymbolKeys.length; i++){
68988
+ key = sourceSymbolKeys[i];
68989
+ if (excluded.indexOf(key) >= 0) continue;
68990
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
68991
+ target[key] = source[key];
68992
+ }
68993
+ }
68994
+ return target;
68995
+ }
68996
+ function _object_without_properties_loose(source, excluded) {
68997
+ if (source == null) return {};
68998
+ var target = {};
68999
+ var sourceKeys = Object.keys(source);
69000
+ var key, i;
69001
+ for(i = 0; i < sourceKeys.length; i++){
69002
+ key = sourceKeys[i];
69003
+ if (excluded.indexOf(key) >= 0) continue;
69004
+ target[key] = source[key];
69005
+ }
69006
+ return target;
69007
+ }
69008
+ var Table = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
69009
+ var className = _param.className, props = _object_without_properties(_param, [
69010
+ "className"
69011
+ ]);
69012
+ return /*#__PURE__*/ jsx("div", {
69013
+ className: "relative w-full overflow-auto",
69014
+ children: /*#__PURE__*/ jsx("table", _object_spread({
69015
+ ref: ref,
69016
+ className: cn("w-full caption-bottom text-sm", className)
69017
+ }, props))
69018
+ });
69019
+ });
69020
+ Table.displayName = "Table";
69021
+ var TableHeader = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
69022
+ var className = _param.className, props = _object_without_properties(_param, [
69023
+ "className"
69024
+ ]);
69025
+ return /*#__PURE__*/ jsx("thead", _object_spread({
69026
+ ref: ref,
69027
+ className: cn("[&_tr]:border-b", className)
69028
+ }, props));
69029
+ });
69030
+ TableHeader.displayName = "TableHeader";
69031
+ var TableBody = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
69032
+ var className = _param.className, props = _object_without_properties(_param, [
69033
+ "className"
69034
+ ]);
69035
+ return /*#__PURE__*/ jsx("tbody", _object_spread({
69036
+ ref: ref,
69037
+ className: cn("[&_tr:last-child]:border-0", className)
69038
+ }, props));
69039
+ });
69040
+ TableBody.displayName = "TableBody";
69041
+ var TableFooter = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
69042
+ var className = _param.className, props = _object_without_properties(_param, [
69043
+ "className"
69044
+ ]);
69045
+ return /*#__PURE__*/ jsx("tfoot", _object_spread({
69046
+ ref: ref,
69047
+ className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className)
69048
+ }, props));
69049
+ });
69050
+ TableFooter.displayName = "TableFooter";
69051
+ var TableRow = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
69052
+ var className = _param.className, props = _object_without_properties(_param, [
69053
+ "className"
69054
+ ]);
69055
+ return /*#__PURE__*/ jsx("tr", _object_spread({
69056
+ ref: ref,
69057
+ className: cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className)
69058
+ }, props));
69059
+ });
69060
+ TableRow.displayName = "TableRow";
69061
+ var TableHead = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
69062
+ var className = _param.className, props = _object_without_properties(_param, [
69063
+ "className"
69064
+ ]);
69065
+ return /*#__PURE__*/ jsx("th", _object_spread({
69066
+ ref: ref,
69067
+ className: cn("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className)
69068
+ }, props));
69069
+ });
69070
+ TableHead.displayName = "TableHead";
69071
+ var TableCell = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
69072
+ var className = _param.className, props = _object_without_properties(_param, [
69073
+ "className"
69074
+ ]);
69075
+ return /*#__PURE__*/ jsx("td", _object_spread({
69076
+ ref: ref,
69077
+ className: cn("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className)
69078
+ }, props));
69079
+ });
69080
+ TableCell.displayName = "TableCell";
69081
+ var TableCaption = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
69082
+ var className = _param.className, props = _object_without_properties(_param, [
69083
+ "className"
69084
+ ]);
69085
+ return /*#__PURE__*/ jsx("caption", _object_spread({
69086
+ ref: ref,
69087
+ className: cn("mt-4 text-sm text-muted-foreground", className)
69088
+ }, props));
69089
+ });
69090
+ TableCaption.displayName = "TableCaption";
69091
+
70684
69092
  export { CkEditor, CustomUpload, DateRangePicker, DropImage, ReactDateRange, Spin, Switch, UiLibrary };