@sunggang/ui-lib 0.1.56 → 0.1.58
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.css +0 -248
- package/index.esm.js +2027 -488
- package/package.json +1 -6
- package/src/index.d.ts +0 -1
- package/src/Type/index.d.ts +0 -19
- package/src/components/ui/checkbox.d.ts +0 -4
- package/src/components/ui/dropdown-menu.d.ts +0 -27
- package/src/components/ui/input.d.ts +0 -5
- package/src/components/ui/table.d.ts +0 -10
- package/src/lib/DataTable/Pagination.d.ts +0 -6
- package/src/lib/DataTable/fake.d.ts +0 -68
- package/src/lib/DataTable/index.d.ts +0 -4
package/index.esm.js
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
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';
|
|
5
4
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
6
5
|
import { clsx } from 'clsx';
|
|
7
6
|
import { twMerge } from 'tailwind-merge';
|
|
8
|
-
import { format } from 'date-fns';
|
|
7
|
+
import { format, addDays } from 'date-fns';
|
|
9
8
|
import { Calendar as Calendar$1 } from 'lucide-react';
|
|
10
9
|
import { Slot } from '@radix-ui/react-slot';
|
|
11
10
|
import { cva } from 'class-variance-authority';
|
|
12
11
|
import { DayPicker } from 'react-day-picker';
|
|
13
|
-
import { zhTW } from 'date-fns/locale
|
|
12
|
+
import { zhTW } from 'date-fns/locale';
|
|
14
13
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
15
14
|
import { Calendar as Calendar$2, DateRange } from 'react-date-range';
|
|
16
|
-
import * as locales from 'react-date-range/dist/locale
|
|
17
|
-
import
|
|
18
|
-
import format$1 from 'date-fns/format/index.js';
|
|
19
|
-
import '@tanstack/react-table';
|
|
20
|
-
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
21
|
-
import { ChevronRightIcon, CheckIcon, DotFilledIcon } from '@radix-ui/react-icons';
|
|
15
|
+
import * as locales from 'react-date-range/dist/locale';
|
|
16
|
+
import format$1 from 'date-fns/format';
|
|
22
17
|
|
|
23
18
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
24
19
|
function getDefaultExportFromCjs(x) {
|
|
@@ -64555,14 +64550,14 @@ var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
|
64555
64550
|
* This source code is licensed under the MIT license found in the
|
|
64556
64551
|
* LICENSE file in the root directory of this source tree.
|
|
64557
64552
|
*/
|
|
64558
|
-
function _instanceof$
|
|
64553
|
+
function _instanceof$4(left, right) {
|
|
64559
64554
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
64560
64555
|
return !!right[Symbol.hasInstance](left);
|
|
64561
64556
|
} else {
|
|
64562
64557
|
return left instanceof right;
|
|
64563
64558
|
}
|
|
64564
64559
|
}
|
|
64565
|
-
function _type_of$
|
|
64560
|
+
function _type_of$2(obj) {
|
|
64566
64561
|
"@swc/helpers - typeof";
|
|
64567
64562
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
64568
64563
|
}
|
|
@@ -64606,7 +64601,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
64606
64601
|
// This is intentionally an invariant that gets caught. It's the same
|
|
64607
64602
|
// behavior as without this statement except with a better message.
|
|
64608
64603
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
64609
|
-
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$
|
|
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`.");
|
|
64610
64605
|
err.name = "Invariant Violation";
|
|
64611
64606
|
throw err;
|
|
64612
64607
|
}
|
|
@@ -64614,10 +64609,10 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
64614
64609
|
} catch (ex) {
|
|
64615
64610
|
error = ex;
|
|
64616
64611
|
}
|
|
64617
|
-
if (error && !_instanceof$
|
|
64618
|
-
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$
|
|
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).");
|
|
64619
64614
|
}
|
|
64620
|
-
if (_instanceof$
|
|
64615
|
+
if (_instanceof$4(error, Error) && !(error.message in loggedTypeFailures)) {
|
|
64621
64616
|
// Only monitor this failure once because there tends to be a lot of the
|
|
64622
64617
|
// same error.
|
|
64623
64618
|
loggedTypeFailures[error.message] = true;
|
|
@@ -64645,14 +64640,14 @@ var checkPropTypes_1 = checkPropTypes$1;
|
|
|
64645
64640
|
* This source code is licensed under the MIT license found in the
|
|
64646
64641
|
* LICENSE file in the root directory of this source tree.
|
|
64647
64642
|
*/
|
|
64648
|
-
function _instanceof$
|
|
64643
|
+
function _instanceof$3(left, right) {
|
|
64649
64644
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
64650
64645
|
return !!right[Symbol.hasInstance](left);
|
|
64651
64646
|
} else {
|
|
64652
64647
|
return left instanceof right;
|
|
64653
64648
|
}
|
|
64654
64649
|
}
|
|
64655
|
-
function _type_of(obj) {
|
|
64650
|
+
function _type_of$1(obj) {
|
|
64656
64651
|
"@swc/helpers - typeof";
|
|
64657
64652
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
64658
64653
|
}
|
|
@@ -64870,7 +64865,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
64870
64865
|
}
|
|
64871
64866
|
for(var i = 0; i < propValue.length; i++){
|
|
64872
64867
|
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret$1);
|
|
64873
|
-
if (_instanceof$
|
|
64868
|
+
if (_instanceof$3(error, Error)) {
|
|
64874
64869
|
return error;
|
|
64875
64870
|
}
|
|
64876
64871
|
}
|
|
@@ -64902,7 +64897,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
64902
64897
|
}
|
|
64903
64898
|
function createInstanceTypeChecker(expectedClass) {
|
|
64904
64899
|
function validate(props, propName, componentName, location, propFullName) {
|
|
64905
|
-
if (!_instanceof$
|
|
64900
|
+
if (!_instanceof$3(props[propName], expectedClass)) {
|
|
64906
64901
|
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
64907
64902
|
var actualClassName = getClassName(props[propName]);
|
|
64908
64903
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
@@ -64953,7 +64948,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
64953
64948
|
for(var key in propValue){
|
|
64954
64949
|
if (has(propValue, key)) {
|
|
64955
64950
|
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret$1);
|
|
64956
|
-
if (_instanceof$
|
|
64951
|
+
if (_instanceof$3(error, Error)) {
|
|
64957
64952
|
return error;
|
|
64958
64953
|
}
|
|
64959
64954
|
}
|
|
@@ -65051,7 +65046,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
65051
65046
|
return createChainableTypeChecker(validate);
|
|
65052
65047
|
}
|
|
65053
65048
|
function isNode(propValue) {
|
|
65054
|
-
switch(typeof propValue === "undefined" ? "undefined" : _type_of(propValue)){
|
|
65049
|
+
switch(typeof propValue === "undefined" ? "undefined" : _type_of$1(propValue)){
|
|
65055
65050
|
case "number":
|
|
65056
65051
|
case "string":
|
|
65057
65052
|
case "undefined":
|
|
@@ -65108,18 +65103,18 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
65108
65103
|
return true;
|
|
65109
65104
|
}
|
|
65110
65105
|
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
65111
|
-
if (typeof Symbol === "function" && _instanceof$
|
|
65106
|
+
if (typeof Symbol === "function" && _instanceof$3(propValue, Symbol)) {
|
|
65112
65107
|
return true;
|
|
65113
65108
|
}
|
|
65114
65109
|
return false;
|
|
65115
65110
|
}
|
|
65116
65111
|
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
65117
65112
|
function getPropType(propValue) {
|
|
65118
|
-
var propType = typeof propValue === "undefined" ? "undefined" : _type_of(propValue);
|
|
65113
|
+
var propType = typeof propValue === "undefined" ? "undefined" : _type_of$1(propValue);
|
|
65119
65114
|
if (Array.isArray(propValue)) {
|
|
65120
65115
|
return "array";
|
|
65121
65116
|
}
|
|
65122
|
-
if (_instanceof$
|
|
65117
|
+
if (_instanceof$3(propValue, RegExp)) {
|
|
65123
65118
|
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
65124
65119
|
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
65125
65120
|
// passes PropTypes.object.
|
|
@@ -65138,9 +65133,9 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
65138
65133
|
}
|
|
65139
65134
|
var propType = getPropType(propValue);
|
|
65140
65135
|
if (propType === "object") {
|
|
65141
|
-
if (_instanceof$
|
|
65136
|
+
if (_instanceof$3(propValue, Date)) {
|
|
65142
65137
|
return "date";
|
|
65143
|
-
} else if (_instanceof$
|
|
65138
|
+
} else if (_instanceof$3(propValue, RegExp)) {
|
|
65144
65139
|
return "regexp";
|
|
65145
65140
|
}
|
|
65146
65141
|
}
|
|
@@ -65262,7 +65257,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
65262
65257
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
65263
65258
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
65264
65259
|
PERFORMANCE OF THIS SOFTWARE.
|
|
65265
|
-
***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */ function _instanceof$
|
|
65260
|
+
***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */ function _instanceof$2(left, right) {
|
|
65266
65261
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
65267
65262
|
return !!right[Symbol.hasInstance](left);
|
|
65268
65263
|
} else {
|
|
@@ -65271,7 +65266,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
65271
65266
|
}
|
|
65272
65267
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
65273
65268
|
function adopt(value) {
|
|
65274
|
-
return _instanceof$
|
|
65269
|
+
return _instanceof$2(value, P) ? value : new P(function(resolve) {
|
|
65275
65270
|
resolve(value);
|
|
65276
65271
|
});
|
|
65277
65272
|
}
|
|
@@ -66072,7 +66067,7 @@ var _default = function(file, acceptedFiles) {
|
|
|
66072
66067
|
return true;
|
|
66073
66068
|
};
|
|
66074
66069
|
|
|
66075
|
-
function _instanceof(left, right) {
|
|
66070
|
+
function _instanceof$1(left, right) {
|
|
66076
66071
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
66077
66072
|
return !!right[Symbol.hasInstance](left);
|
|
66078
66073
|
} else {
|
|
@@ -66385,7 +66380,7 @@ function isIeOrEdge() {
|
|
|
66385
66380
|
* @param {any} v
|
|
66386
66381
|
* @returns {boolean} True if v is an abort exception.
|
|
66387
66382
|
*/ function isAbort(v) {
|
|
66388
|
-
return _instanceof(v, DOMException) && (v.name === "AbortError" || v.code === v.ABORT_ERR);
|
|
66383
|
+
return _instanceof$1(v, DOMException) && (v.name === "AbortError" || v.code === v.ABORT_ERR);
|
|
66389
66384
|
}
|
|
66390
66385
|
/**
|
|
66391
66386
|
* Check if v is a security error.
|
|
@@ -66394,7 +66389,7 @@ function isIeOrEdge() {
|
|
|
66394
66389
|
* @param {any} v
|
|
66395
66390
|
* @returns {boolean} True if v is a security error.
|
|
66396
66391
|
*/ function isSecurityError(v) {
|
|
66397
|
-
return _instanceof(v, DOMException) && (v.name === "SecurityError" || v.code === v.SECURITY_ERR);
|
|
66392
|
+
return _instanceof$1(v, DOMException) && (v.name === "SecurityError" || v.code === v.SECURITY_ERR);
|
|
66398
66393
|
}
|
|
66399
66394
|
/**
|
|
66400
66395
|
* Check if v is a MIME type string.
|
|
@@ -67452,6 +67447,1960 @@ function v4(options, buf, offset) {
|
|
|
67452
67447
|
return stringify(rnds);
|
|
67453
67448
|
}
|
|
67454
67449
|
|
|
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
|
+
|
|
67455
69404
|
function _array_like_to_array$3(arr, len) {
|
|
67456
69405
|
if (len == null || len > arr.length) len = arr.length;
|
|
67457
69406
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
@@ -67463,7 +69412,7 @@ function _array_with_holes$3(arr) {
|
|
|
67463
69412
|
function _array_without_holes(arr) {
|
|
67464
69413
|
if (Array.isArray(arr)) return _array_like_to_array$3(arr);
|
|
67465
69414
|
}
|
|
67466
|
-
function _define_property$
|
|
69415
|
+
function _define_property$4(obj, key, value) {
|
|
67467
69416
|
if (key in obj) {
|
|
67468
69417
|
Object.defineProperty(obj, key, {
|
|
67469
69418
|
value: value,
|
|
@@ -67509,7 +69458,7 @@ function _non_iterable_rest$3() {
|
|
|
67509
69458
|
function _non_iterable_spread() {
|
|
67510
69459
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
67511
69460
|
}
|
|
67512
|
-
function _object_spread$
|
|
69461
|
+
function _object_spread$4(target) {
|
|
67513
69462
|
for(var i = 1; i < arguments.length; i++){
|
|
67514
69463
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
67515
69464
|
var ownKeys = Object.keys(source);
|
|
@@ -67519,12 +69468,12 @@ function _object_spread$7(target) {
|
|
|
67519
69468
|
}));
|
|
67520
69469
|
}
|
|
67521
69470
|
ownKeys.forEach(function(key) {
|
|
67522
|
-
_define_property$
|
|
69471
|
+
_define_property$4(target, key, source[key]);
|
|
67523
69472
|
});
|
|
67524
69473
|
}
|
|
67525
69474
|
return target;
|
|
67526
69475
|
}
|
|
67527
|
-
function ownKeys$
|
|
69476
|
+
function ownKeys$2(object, enumerableOnly) {
|
|
67528
69477
|
var keys = Object.keys(object);
|
|
67529
69478
|
if (Object.getOwnPropertySymbols) {
|
|
67530
69479
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -67537,12 +69486,12 @@ function ownKeys$3(object, enumerableOnly) {
|
|
|
67537
69486
|
}
|
|
67538
69487
|
return keys;
|
|
67539
69488
|
}
|
|
67540
|
-
function _object_spread_props$
|
|
69489
|
+
function _object_spread_props$2(target, source) {
|
|
67541
69490
|
source = source != null ? source : {};
|
|
67542
69491
|
if (Object.getOwnPropertyDescriptors) {
|
|
67543
69492
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
67544
69493
|
} else {
|
|
67545
|
-
ownKeys$
|
|
69494
|
+
ownKeys$2(Object(source)).forEach(function(key) {
|
|
67546
69495
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
67547
69496
|
});
|
|
67548
69497
|
}
|
|
@@ -67603,11 +69552,11 @@ var DropImage = function(param) {
|
|
|
67603
69552
|
return /*#__PURE__*/ jsxs("section", {
|
|
67604
69553
|
className: "w-full",
|
|
67605
69554
|
children: [
|
|
67606
|
-
/*#__PURE__*/ jsxs("div", _object_spread_props$
|
|
69555
|
+
/*#__PURE__*/ jsxs("div", _object_spread_props$2(_object_spread$4({}, getRootProps({
|
|
67607
69556
|
className: "dropzone"
|
|
67608
69557
|
})), {
|
|
67609
69558
|
children: [
|
|
67610
|
-
/*#__PURE__*/ jsx("input", _object_spread$
|
|
69559
|
+
/*#__PURE__*/ jsx("input", _object_spread$4({}, getInputProps())),
|
|
67611
69560
|
/*#__PURE__*/ jsx("div", {
|
|
67612
69561
|
className: "flex justify-between",
|
|
67613
69562
|
children: /*#__PURE__*/ jsx("div", {
|
|
@@ -68048,7 +69997,7 @@ function cn() {
|
|
|
68048
69997
|
return twMerge(clsx(inputs));
|
|
68049
69998
|
}
|
|
68050
69999
|
|
|
68051
|
-
function _define_property$
|
|
70000
|
+
function _define_property$3(obj, key, value) {
|
|
68052
70001
|
if (key in obj) {
|
|
68053
70002
|
Object.defineProperty(obj, key, {
|
|
68054
70003
|
value: value,
|
|
@@ -68061,7 +70010,7 @@ function _define_property$6(obj, key, value) {
|
|
|
68061
70010
|
}
|
|
68062
70011
|
return obj;
|
|
68063
70012
|
}
|
|
68064
|
-
function _object_spread$
|
|
70013
|
+
function _object_spread$3(target) {
|
|
68065
70014
|
for(var i = 1; i < arguments.length; i++){
|
|
68066
70015
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
68067
70016
|
var ownKeys = Object.keys(source);
|
|
@@ -68071,12 +70020,12 @@ function _object_spread$6(target) {
|
|
|
68071
70020
|
}));
|
|
68072
70021
|
}
|
|
68073
70022
|
ownKeys.forEach(function(key) {
|
|
68074
|
-
_define_property$
|
|
70023
|
+
_define_property$3(target, key, source[key]);
|
|
68075
70024
|
});
|
|
68076
70025
|
}
|
|
68077
70026
|
return target;
|
|
68078
70027
|
}
|
|
68079
|
-
function ownKeys$
|
|
70028
|
+
function ownKeys$1(object, enumerableOnly) {
|
|
68080
70029
|
var keys = Object.keys(object);
|
|
68081
70030
|
if (Object.getOwnPropertySymbols) {
|
|
68082
70031
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -68089,20 +70038,20 @@ function ownKeys$2(object, enumerableOnly) {
|
|
|
68089
70038
|
}
|
|
68090
70039
|
return keys;
|
|
68091
70040
|
}
|
|
68092
|
-
function _object_spread_props$
|
|
70041
|
+
function _object_spread_props$1(target, source) {
|
|
68093
70042
|
source = source != null ? source : {};
|
|
68094
70043
|
if (Object.getOwnPropertyDescriptors) {
|
|
68095
70044
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
68096
70045
|
} else {
|
|
68097
|
-
ownKeys$
|
|
70046
|
+
ownKeys$1(Object(source)).forEach(function(key) {
|
|
68098
70047
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
68099
70048
|
});
|
|
68100
70049
|
}
|
|
68101
70050
|
return target;
|
|
68102
70051
|
}
|
|
68103
|
-
function _object_without_properties$
|
|
70052
|
+
function _object_without_properties$3(source, excluded) {
|
|
68104
70053
|
if (source == null) return {};
|
|
68105
|
-
var target = _object_without_properties_loose$
|
|
70054
|
+
var target = _object_without_properties_loose$3(source, excluded);
|
|
68106
70055
|
var key, i;
|
|
68107
70056
|
if (Object.getOwnPropertySymbols) {
|
|
68108
70057
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -68115,7 +70064,7 @@ function _object_without_properties$6(source, excluded) {
|
|
|
68115
70064
|
}
|
|
68116
70065
|
return target;
|
|
68117
70066
|
}
|
|
68118
|
-
function _object_without_properties_loose$
|
|
70067
|
+
function _object_without_properties_loose$3(source, excluded) {
|
|
68119
70068
|
if (source == null) return {};
|
|
68120
70069
|
var target = {};
|
|
68121
70070
|
var sourceKeys = Object.keys(source);
|
|
@@ -68128,10 +70077,10 @@ function _object_without_properties_loose$6(source, excluded) {
|
|
|
68128
70077
|
return target;
|
|
68129
70078
|
}
|
|
68130
70079
|
var Switch = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68131
|
-
var className = _param.className, props = _object_without_properties$
|
|
70080
|
+
var className = _param.className, props = _object_without_properties$3(_param, [
|
|
68132
70081
|
"className"
|
|
68133
70082
|
]);
|
|
68134
|
-
return /*#__PURE__*/ jsx(SwitchPrimitives.Root, _object_spread_props$
|
|
70083
|
+
return /*#__PURE__*/ jsx(SwitchPrimitives.Root, _object_spread_props$1(_object_spread$3({
|
|
68135
70084
|
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)
|
|
68136
70085
|
}, props), {
|
|
68137
70086
|
ref: ref,
|
|
@@ -68142,7 +70091,7 @@ var Switch = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
68142
70091
|
});
|
|
68143
70092
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
68144
70093
|
|
|
68145
|
-
function _define_property$
|
|
70094
|
+
function _define_property$2(obj, key, value) {
|
|
68146
70095
|
if (key in obj) {
|
|
68147
70096
|
Object.defineProperty(obj, key, {
|
|
68148
70097
|
value: value,
|
|
@@ -68155,7 +70104,7 @@ function _define_property$5(obj, key, value) {
|
|
|
68155
70104
|
}
|
|
68156
70105
|
return obj;
|
|
68157
70106
|
}
|
|
68158
|
-
function _object_spread$
|
|
70107
|
+
function _object_spread$2(target) {
|
|
68159
70108
|
for(var i = 1; i < arguments.length; i++){
|
|
68160
70109
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
68161
70110
|
var ownKeys = Object.keys(source);
|
|
@@ -68165,14 +70114,14 @@ function _object_spread$5(target) {
|
|
|
68165
70114
|
}));
|
|
68166
70115
|
}
|
|
68167
70116
|
ownKeys.forEach(function(key) {
|
|
68168
|
-
_define_property$
|
|
70117
|
+
_define_property$2(target, key, source[key]);
|
|
68169
70118
|
});
|
|
68170
70119
|
}
|
|
68171
70120
|
return target;
|
|
68172
70121
|
}
|
|
68173
|
-
function _object_without_properties$
|
|
70122
|
+
function _object_without_properties$2(source, excluded) {
|
|
68174
70123
|
if (source == null) return {};
|
|
68175
|
-
var target = _object_without_properties_loose$
|
|
70124
|
+
var target = _object_without_properties_loose$2(source, excluded);
|
|
68176
70125
|
var key, i;
|
|
68177
70126
|
if (Object.getOwnPropertySymbols) {
|
|
68178
70127
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -68185,7 +70134,7 @@ function _object_without_properties$5(source, excluded) {
|
|
|
68185
70134
|
}
|
|
68186
70135
|
return target;
|
|
68187
70136
|
}
|
|
68188
|
-
function _object_without_properties_loose$
|
|
70137
|
+
function _object_without_properties_loose$2(source, excluded) {
|
|
68189
70138
|
if (source == null) return {};
|
|
68190
70139
|
var target = {};
|
|
68191
70140
|
var sourceKeys = Object.keys(source);
|
|
@@ -68220,14 +70169,14 @@ var buttonVariants = cva("inline-flex items-center justify-center whitespace-now
|
|
|
68220
70169
|
}
|
|
68221
70170
|
});
|
|
68222
70171
|
var Button = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68223
|
-
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$
|
|
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, [
|
|
68224
70173
|
"className",
|
|
68225
70174
|
"variant",
|
|
68226
70175
|
"size",
|
|
68227
70176
|
"asChild"
|
|
68228
70177
|
]);
|
|
68229
70178
|
var Comp = asChild ? Slot : "button";
|
|
68230
|
-
return /*#__PURE__*/ jsx(Comp, _object_spread$
|
|
70179
|
+
return /*#__PURE__*/ jsx(Comp, _object_spread$2({
|
|
68231
70180
|
className: cn(buttonVariants({
|
|
68232
70181
|
variant: variant,
|
|
68233
70182
|
size: size,
|
|
@@ -68237,7 +70186,7 @@ var Button = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
68237
70186
|
}, props));
|
|
68238
70187
|
});
|
|
68239
70188
|
|
|
68240
|
-
function _define_property$
|
|
70189
|
+
function _define_property$1(obj, key, value) {
|
|
68241
70190
|
if (key in obj) {
|
|
68242
70191
|
Object.defineProperty(obj, key, {
|
|
68243
70192
|
value: value,
|
|
@@ -68268,7 +70217,7 @@ function _object_destructuring_empty(o) {
|
|
|
68268
70217
|
if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
|
|
68269
70218
|
return o;
|
|
68270
70219
|
}
|
|
68271
|
-
function _object_spread$
|
|
70220
|
+
function _object_spread$1(target) {
|
|
68272
70221
|
for(var i = 1; i < arguments.length; i++){
|
|
68273
70222
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
68274
70223
|
var ownKeys = Object.keys(source);
|
|
@@ -68278,12 +70227,12 @@ function _object_spread$4(target) {
|
|
|
68278
70227
|
}));
|
|
68279
70228
|
}
|
|
68280
70229
|
ownKeys.forEach(function(key) {
|
|
68281
|
-
_define_property$
|
|
70230
|
+
_define_property$1(target, key, source[key]);
|
|
68282
70231
|
});
|
|
68283
70232
|
}
|
|
68284
70233
|
return target;
|
|
68285
70234
|
}
|
|
68286
|
-
function ownKeys
|
|
70235
|
+
function ownKeys(object, enumerableOnly) {
|
|
68287
70236
|
var keys = Object.keys(object);
|
|
68288
70237
|
if (Object.getOwnPropertySymbols) {
|
|
68289
70238
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -68296,20 +70245,20 @@ function ownKeys$1(object, enumerableOnly) {
|
|
|
68296
70245
|
}
|
|
68297
70246
|
return keys;
|
|
68298
70247
|
}
|
|
68299
|
-
function _object_spread_props
|
|
70248
|
+
function _object_spread_props(target, source) {
|
|
68300
70249
|
source = source != null ? source : {};
|
|
68301
70250
|
if (Object.getOwnPropertyDescriptors) {
|
|
68302
70251
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
68303
70252
|
} else {
|
|
68304
|
-
ownKeys
|
|
70253
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
68305
70254
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
68306
70255
|
});
|
|
68307
70256
|
}
|
|
68308
70257
|
return target;
|
|
68309
70258
|
}
|
|
68310
|
-
function _object_without_properties$
|
|
70259
|
+
function _object_without_properties$1(source, excluded) {
|
|
68311
70260
|
if (source == null) return {};
|
|
68312
|
-
var target = _object_without_properties_loose$
|
|
70261
|
+
var target = _object_without_properties_loose$1(source, excluded);
|
|
68313
70262
|
var key, i;
|
|
68314
70263
|
if (Object.getOwnPropertySymbols) {
|
|
68315
70264
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -68322,7 +70271,7 @@ function _object_without_properties$4(source, excluded) {
|
|
|
68322
70271
|
}
|
|
68323
70272
|
return target;
|
|
68324
70273
|
}
|
|
68325
|
-
function _object_without_properties_loose$
|
|
70274
|
+
function _object_without_properties_loose$1(source, excluded) {
|
|
68326
70275
|
if (source == null) return {};
|
|
68327
70276
|
var target = {};
|
|
68328
70277
|
var sourceKeys = Object.keys(source);
|
|
@@ -68335,15 +70284,15 @@ function _object_without_properties_loose$4(source, excluded) {
|
|
|
68335
70284
|
return target;
|
|
68336
70285
|
}
|
|
68337
70286
|
function Calendar(_param) {
|
|
68338
|
-
var className = _param.className, classNames = _param.classNames, _param_showOutsideDays = _param.showOutsideDays, showOutsideDays = _param_showOutsideDays === void 0 ? true : _param_showOutsideDays, props = _object_without_properties$
|
|
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, [
|
|
68339
70288
|
"className",
|
|
68340
70289
|
"classNames",
|
|
68341
70290
|
"showOutsideDays"
|
|
68342
70291
|
]);
|
|
68343
|
-
return /*#__PURE__*/ jsx(DayPicker, _object_spread_props
|
|
70292
|
+
return /*#__PURE__*/ jsx(DayPicker, _object_spread_props(_object_spread$1({
|
|
68344
70293
|
showOutsideDays: showOutsideDays,
|
|
68345
70294
|
className: cn("p-3", className),
|
|
68346
|
-
classNames: _object_spread$
|
|
70295
|
+
classNames: _object_spread$1({
|
|
68347
70296
|
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
68348
70297
|
month: "space-y-4",
|
|
68349
70298
|
caption: "flex justify-center pt-1 relative items-center",
|
|
@@ -68395,7 +70344,7 @@ function Calendar(_param) {
|
|
|
68395
70344
|
}
|
|
68396
70345
|
Calendar.displayName = "Calendar";
|
|
68397
70346
|
|
|
68398
|
-
function _define_property
|
|
70347
|
+
function _define_property(obj, key, value) {
|
|
68399
70348
|
if (key in obj) {
|
|
68400
70349
|
Object.defineProperty(obj, key, {
|
|
68401
70350
|
value: value,
|
|
@@ -68408,7 +70357,7 @@ function _define_property$3(obj, key, value) {
|
|
|
68408
70357
|
}
|
|
68409
70358
|
return obj;
|
|
68410
70359
|
}
|
|
68411
|
-
function _object_spread
|
|
70360
|
+
function _object_spread(target) {
|
|
68412
70361
|
for(var i = 1; i < arguments.length; i++){
|
|
68413
70362
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
68414
70363
|
var ownKeys = Object.keys(source);
|
|
@@ -68418,14 +70367,14 @@ function _object_spread$3(target) {
|
|
|
68418
70367
|
}));
|
|
68419
70368
|
}
|
|
68420
70369
|
ownKeys.forEach(function(key) {
|
|
68421
|
-
_define_property
|
|
70370
|
+
_define_property(target, key, source[key]);
|
|
68422
70371
|
});
|
|
68423
70372
|
}
|
|
68424
70373
|
return target;
|
|
68425
70374
|
}
|
|
68426
|
-
function _object_without_properties
|
|
70375
|
+
function _object_without_properties(source, excluded) {
|
|
68427
70376
|
if (source == null) return {};
|
|
68428
|
-
var target = _object_without_properties_loose
|
|
70377
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
68429
70378
|
var key, i;
|
|
68430
70379
|
if (Object.getOwnPropertySymbols) {
|
|
68431
70380
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -68438,7 +70387,7 @@ function _object_without_properties$3(source, excluded) {
|
|
|
68438
70387
|
}
|
|
68439
70388
|
return target;
|
|
68440
70389
|
}
|
|
68441
|
-
function _object_without_properties_loose
|
|
70390
|
+
function _object_without_properties_loose(source, excluded) {
|
|
68442
70391
|
if (source == null) return {};
|
|
68443
70392
|
var target = {};
|
|
68444
70393
|
var sourceKeys = Object.keys(source);
|
|
@@ -68453,13 +70402,13 @@ function _object_without_properties_loose$3(source, excluded) {
|
|
|
68453
70402
|
var Popover = PopoverPrimitive.Root;
|
|
68454
70403
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
68455
70404
|
var PopoverContent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68456
|
-
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
|
|
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, [
|
|
68457
70406
|
"className",
|
|
68458
70407
|
"align",
|
|
68459
70408
|
"sideOffset"
|
|
68460
70409
|
]);
|
|
68461
70410
|
return /*#__PURE__*/ jsx(PopoverPrimitive.Portal, {
|
|
68462
|
-
children: /*#__PURE__*/ jsx(PopoverPrimitive.Content, _object_spread
|
|
70411
|
+
children: /*#__PURE__*/ jsx(PopoverPrimitive.Content, _object_spread({
|
|
68463
70412
|
ref: ref,
|
|
68464
70413
|
align: align,
|
|
68465
70414
|
sideOffset: sideOffset,
|
|
@@ -68680,414 +70629,4 @@ var ReactDateRange = function(param) {
|
|
|
68680
70629
|
});
|
|
68681
70630
|
};
|
|
68682
70631
|
|
|
68683
|
-
function _define_property$2(obj, key, value) {
|
|
68684
|
-
if (key in obj) {
|
|
68685
|
-
Object.defineProperty(obj, key, {
|
|
68686
|
-
value: value,
|
|
68687
|
-
enumerable: true,
|
|
68688
|
-
configurable: true,
|
|
68689
|
-
writable: true
|
|
68690
|
-
});
|
|
68691
|
-
} else {
|
|
68692
|
-
obj[key] = value;
|
|
68693
|
-
}
|
|
68694
|
-
return obj;
|
|
68695
|
-
}
|
|
68696
|
-
function _object_spread$2(target) {
|
|
68697
|
-
for(var i = 1; i < arguments.length; i++){
|
|
68698
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
68699
|
-
var ownKeys = Object.keys(source);
|
|
68700
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
68701
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
68702
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
68703
|
-
}));
|
|
68704
|
-
}
|
|
68705
|
-
ownKeys.forEach(function(key) {
|
|
68706
|
-
_define_property$2(target, key, source[key]);
|
|
68707
|
-
});
|
|
68708
|
-
}
|
|
68709
|
-
return target;
|
|
68710
|
-
}
|
|
68711
|
-
function ownKeys(object, enumerableOnly) {
|
|
68712
|
-
var keys = Object.keys(object);
|
|
68713
|
-
if (Object.getOwnPropertySymbols) {
|
|
68714
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
68715
|
-
if (enumerableOnly) {
|
|
68716
|
-
symbols = symbols.filter(function(sym) {
|
|
68717
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
68718
|
-
});
|
|
68719
|
-
}
|
|
68720
|
-
keys.push.apply(keys, symbols);
|
|
68721
|
-
}
|
|
68722
|
-
return keys;
|
|
68723
|
-
}
|
|
68724
|
-
function _object_spread_props(target, source) {
|
|
68725
|
-
source = source != null ? source : {};
|
|
68726
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
68727
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
68728
|
-
} else {
|
|
68729
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
68730
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
68731
|
-
});
|
|
68732
|
-
}
|
|
68733
|
-
return target;
|
|
68734
|
-
}
|
|
68735
|
-
function _object_without_properties$2(source, excluded) {
|
|
68736
|
-
if (source == null) return {};
|
|
68737
|
-
var target = _object_without_properties_loose$2(source, excluded);
|
|
68738
|
-
var key, i;
|
|
68739
|
-
if (Object.getOwnPropertySymbols) {
|
|
68740
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
68741
|
-
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
68742
|
-
key = sourceSymbolKeys[i];
|
|
68743
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
68744
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
68745
|
-
target[key] = source[key];
|
|
68746
|
-
}
|
|
68747
|
-
}
|
|
68748
|
-
return target;
|
|
68749
|
-
}
|
|
68750
|
-
function _object_without_properties_loose$2(source, excluded) {
|
|
68751
|
-
if (source == null) return {};
|
|
68752
|
-
var target = {};
|
|
68753
|
-
var sourceKeys = Object.keys(source);
|
|
68754
|
-
var key, i;
|
|
68755
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
68756
|
-
key = sourceKeys[i];
|
|
68757
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
68758
|
-
target[key] = source[key];
|
|
68759
|
-
}
|
|
68760
|
-
return target;
|
|
68761
|
-
}
|
|
68762
|
-
var DropdownMenuSubTrigger = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68763
|
-
var className = _param.className, inset = _param.inset, children = _param.children, props = _object_without_properties$2(_param, [
|
|
68764
|
-
"className",
|
|
68765
|
-
"inset",
|
|
68766
|
-
"children"
|
|
68767
|
-
]);
|
|
68768
|
-
return /*#__PURE__*/ jsxs(DropdownMenuPrimitive.SubTrigger, _object_spread_props(_object_spread$2({
|
|
68769
|
-
ref: ref,
|
|
68770
|
-
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)
|
|
68771
|
-
}, props), {
|
|
68772
|
-
children: [
|
|
68773
|
-
children,
|
|
68774
|
-
/*#__PURE__*/ jsx(ChevronRightIcon, {
|
|
68775
|
-
className: "ml-auto h-4 w-4"
|
|
68776
|
-
})
|
|
68777
|
-
]
|
|
68778
|
-
}));
|
|
68779
|
-
});
|
|
68780
|
-
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
68781
|
-
var DropdownMenuSubContent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68782
|
-
var className = _param.className, props = _object_without_properties$2(_param, [
|
|
68783
|
-
"className"
|
|
68784
|
-
]);
|
|
68785
|
-
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.SubContent, _object_spread$2({
|
|
68786
|
-
ref: ref,
|
|
68787
|
-
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)
|
|
68788
|
-
}, props));
|
|
68789
|
-
});
|
|
68790
|
-
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
68791
|
-
var DropdownMenuContent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68792
|
-
var className = _param.className, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties$2(_param, [
|
|
68793
|
-
"className",
|
|
68794
|
-
"sideOffset"
|
|
68795
|
-
]);
|
|
68796
|
-
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Portal, {
|
|
68797
|
-
children: /*#__PURE__*/ jsx(DropdownMenuPrimitive.Content, _object_spread$2({
|
|
68798
|
-
ref: ref,
|
|
68799
|
-
sideOffset: sideOffset,
|
|
68800
|
-
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)
|
|
68801
|
-
}, props))
|
|
68802
|
-
});
|
|
68803
|
-
});
|
|
68804
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
68805
|
-
var DropdownMenuItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68806
|
-
var className = _param.className, inset = _param.inset, props = _object_without_properties$2(_param, [
|
|
68807
|
-
"className",
|
|
68808
|
-
"inset"
|
|
68809
|
-
]);
|
|
68810
|
-
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Item, _object_spread$2({
|
|
68811
|
-
ref: ref,
|
|
68812
|
-
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)
|
|
68813
|
-
}, props));
|
|
68814
|
-
});
|
|
68815
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
68816
|
-
var DropdownMenuCheckboxItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68817
|
-
var className = _param.className, children = _param.children, checked = _param.checked, props = _object_without_properties$2(_param, [
|
|
68818
|
-
"className",
|
|
68819
|
-
"children",
|
|
68820
|
-
"checked"
|
|
68821
|
-
]);
|
|
68822
|
-
return /*#__PURE__*/ jsxs(DropdownMenuPrimitive.CheckboxItem, _object_spread_props(_object_spread$2({
|
|
68823
|
-
ref: ref,
|
|
68824
|
-
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),
|
|
68825
|
-
checked: checked
|
|
68826
|
-
}, props), {
|
|
68827
|
-
children: [
|
|
68828
|
-
/*#__PURE__*/ jsx("span", {
|
|
68829
|
-
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
68830
|
-
children: /*#__PURE__*/ jsx(DropdownMenuPrimitive.ItemIndicator, {
|
|
68831
|
-
children: /*#__PURE__*/ jsx(CheckIcon, {
|
|
68832
|
-
className: "h-4 w-4"
|
|
68833
|
-
})
|
|
68834
|
-
})
|
|
68835
|
-
}),
|
|
68836
|
-
children
|
|
68837
|
-
]
|
|
68838
|
-
}));
|
|
68839
|
-
});
|
|
68840
|
-
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
68841
|
-
var DropdownMenuRadioItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68842
|
-
var className = _param.className, children = _param.children, props = _object_without_properties$2(_param, [
|
|
68843
|
-
"className",
|
|
68844
|
-
"children"
|
|
68845
|
-
]);
|
|
68846
|
-
return /*#__PURE__*/ jsxs(DropdownMenuPrimitive.RadioItem, _object_spread_props(_object_spread$2({
|
|
68847
|
-
ref: ref,
|
|
68848
|
-
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)
|
|
68849
|
-
}, props), {
|
|
68850
|
-
children: [
|
|
68851
|
-
/*#__PURE__*/ jsx("span", {
|
|
68852
|
-
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
68853
|
-
children: /*#__PURE__*/ jsx(DropdownMenuPrimitive.ItemIndicator, {
|
|
68854
|
-
children: /*#__PURE__*/ jsx(DotFilledIcon, {
|
|
68855
|
-
className: "h-4 w-4 fill-current"
|
|
68856
|
-
})
|
|
68857
|
-
})
|
|
68858
|
-
}),
|
|
68859
|
-
children
|
|
68860
|
-
]
|
|
68861
|
-
}));
|
|
68862
|
-
});
|
|
68863
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
68864
|
-
var DropdownMenuLabel = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68865
|
-
var className = _param.className, inset = _param.inset, props = _object_without_properties$2(_param, [
|
|
68866
|
-
"className",
|
|
68867
|
-
"inset"
|
|
68868
|
-
]);
|
|
68869
|
-
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Label, _object_spread$2({
|
|
68870
|
-
ref: ref,
|
|
68871
|
-
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)
|
|
68872
|
-
}, props));
|
|
68873
|
-
});
|
|
68874
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
68875
|
-
var DropdownMenuSeparator = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68876
|
-
var className = _param.className, props = _object_without_properties$2(_param, [
|
|
68877
|
-
"className"
|
|
68878
|
-
]);
|
|
68879
|
-
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Separator, _object_spread$2({
|
|
68880
|
-
ref: ref,
|
|
68881
|
-
className: cn("-mx-1 my-1 h-px bg-muted", className)
|
|
68882
|
-
}, props));
|
|
68883
|
-
});
|
|
68884
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
68885
|
-
|
|
68886
|
-
function _define_property$1(obj, key, value) {
|
|
68887
|
-
if (key in obj) {
|
|
68888
|
-
Object.defineProperty(obj, key, {
|
|
68889
|
-
value: value,
|
|
68890
|
-
enumerable: true,
|
|
68891
|
-
configurable: true,
|
|
68892
|
-
writable: true
|
|
68893
|
-
});
|
|
68894
|
-
} else {
|
|
68895
|
-
obj[key] = value;
|
|
68896
|
-
}
|
|
68897
|
-
return obj;
|
|
68898
|
-
}
|
|
68899
|
-
function _object_spread$1(target) {
|
|
68900
|
-
for(var i = 1; i < arguments.length; i++){
|
|
68901
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
68902
|
-
var ownKeys = Object.keys(source);
|
|
68903
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
68904
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
68905
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
68906
|
-
}));
|
|
68907
|
-
}
|
|
68908
|
-
ownKeys.forEach(function(key) {
|
|
68909
|
-
_define_property$1(target, key, source[key]);
|
|
68910
|
-
});
|
|
68911
|
-
}
|
|
68912
|
-
return target;
|
|
68913
|
-
}
|
|
68914
|
-
function _object_without_properties$1(source, excluded) {
|
|
68915
|
-
if (source == null) return {};
|
|
68916
|
-
var target = _object_without_properties_loose$1(source, excluded);
|
|
68917
|
-
var key, i;
|
|
68918
|
-
if (Object.getOwnPropertySymbols) {
|
|
68919
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
68920
|
-
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
68921
|
-
key = sourceSymbolKeys[i];
|
|
68922
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
68923
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
68924
|
-
target[key] = source[key];
|
|
68925
|
-
}
|
|
68926
|
-
}
|
|
68927
|
-
return target;
|
|
68928
|
-
}
|
|
68929
|
-
function _object_without_properties_loose$1(source, excluded) {
|
|
68930
|
-
if (source == null) return {};
|
|
68931
|
-
var target = {};
|
|
68932
|
-
var sourceKeys = Object.keys(source);
|
|
68933
|
-
var key, i;
|
|
68934
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
68935
|
-
key = sourceKeys[i];
|
|
68936
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
68937
|
-
target[key] = source[key];
|
|
68938
|
-
}
|
|
68939
|
-
return target;
|
|
68940
|
-
}
|
|
68941
|
-
var Input = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68942
|
-
var className = _param.className, type = _param.type, props = _object_without_properties$1(_param, [
|
|
68943
|
-
"className",
|
|
68944
|
-
"type"
|
|
68945
|
-
]);
|
|
68946
|
-
return /*#__PURE__*/ jsx("input", _object_spread$1({
|
|
68947
|
-
type: type,
|
|
68948
|
-
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),
|
|
68949
|
-
ref: ref
|
|
68950
|
-
}, props));
|
|
68951
|
-
});
|
|
68952
|
-
Input.displayName = "Input";
|
|
68953
|
-
|
|
68954
|
-
function _define_property(obj, key, value) {
|
|
68955
|
-
if (key in obj) {
|
|
68956
|
-
Object.defineProperty(obj, key, {
|
|
68957
|
-
value: value,
|
|
68958
|
-
enumerable: true,
|
|
68959
|
-
configurable: true,
|
|
68960
|
-
writable: true
|
|
68961
|
-
});
|
|
68962
|
-
} else {
|
|
68963
|
-
obj[key] = value;
|
|
68964
|
-
}
|
|
68965
|
-
return obj;
|
|
68966
|
-
}
|
|
68967
|
-
function _object_spread(target) {
|
|
68968
|
-
for(var i = 1; i < arguments.length; i++){
|
|
68969
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
68970
|
-
var ownKeys = Object.keys(source);
|
|
68971
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
68972
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
68973
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
68974
|
-
}));
|
|
68975
|
-
}
|
|
68976
|
-
ownKeys.forEach(function(key) {
|
|
68977
|
-
_define_property(target, key, source[key]);
|
|
68978
|
-
});
|
|
68979
|
-
}
|
|
68980
|
-
return target;
|
|
68981
|
-
}
|
|
68982
|
-
function _object_without_properties(source, excluded) {
|
|
68983
|
-
if (source == null) return {};
|
|
68984
|
-
var target = _object_without_properties_loose(source, excluded);
|
|
68985
|
-
var key, i;
|
|
68986
|
-
if (Object.getOwnPropertySymbols) {
|
|
68987
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
68988
|
-
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
68989
|
-
key = sourceSymbolKeys[i];
|
|
68990
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
68991
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
68992
|
-
target[key] = source[key];
|
|
68993
|
-
}
|
|
68994
|
-
}
|
|
68995
|
-
return target;
|
|
68996
|
-
}
|
|
68997
|
-
function _object_without_properties_loose(source, excluded) {
|
|
68998
|
-
if (source == null) return {};
|
|
68999
|
-
var target = {};
|
|
69000
|
-
var sourceKeys = Object.keys(source);
|
|
69001
|
-
var key, i;
|
|
69002
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
69003
|
-
key = sourceKeys[i];
|
|
69004
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
69005
|
-
target[key] = source[key];
|
|
69006
|
-
}
|
|
69007
|
-
return target;
|
|
69008
|
-
}
|
|
69009
|
-
var Table = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69010
|
-
var className = _param.className, props = _object_without_properties(_param, [
|
|
69011
|
-
"className"
|
|
69012
|
-
]);
|
|
69013
|
-
return /*#__PURE__*/ jsx("div", {
|
|
69014
|
-
className: "relative w-full overflow-auto",
|
|
69015
|
-
children: /*#__PURE__*/ jsx("table", _object_spread({
|
|
69016
|
-
ref: ref,
|
|
69017
|
-
className: cn("w-full caption-bottom text-sm", className)
|
|
69018
|
-
}, props))
|
|
69019
|
-
});
|
|
69020
|
-
});
|
|
69021
|
-
Table.displayName = "Table";
|
|
69022
|
-
var TableHeader = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69023
|
-
var className = _param.className, props = _object_without_properties(_param, [
|
|
69024
|
-
"className"
|
|
69025
|
-
]);
|
|
69026
|
-
return /*#__PURE__*/ jsx("thead", _object_spread({
|
|
69027
|
-
ref: ref,
|
|
69028
|
-
className: cn("[&_tr]:border-b", className)
|
|
69029
|
-
}, props));
|
|
69030
|
-
});
|
|
69031
|
-
TableHeader.displayName = "TableHeader";
|
|
69032
|
-
var TableBody = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69033
|
-
var className = _param.className, props = _object_without_properties(_param, [
|
|
69034
|
-
"className"
|
|
69035
|
-
]);
|
|
69036
|
-
return /*#__PURE__*/ jsx("tbody", _object_spread({
|
|
69037
|
-
ref: ref,
|
|
69038
|
-
className: cn("[&_tr:last-child]:border-0", className)
|
|
69039
|
-
}, props));
|
|
69040
|
-
});
|
|
69041
|
-
TableBody.displayName = "TableBody";
|
|
69042
|
-
var TableFooter = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69043
|
-
var className = _param.className, props = _object_without_properties(_param, [
|
|
69044
|
-
"className"
|
|
69045
|
-
]);
|
|
69046
|
-
return /*#__PURE__*/ jsx("tfoot", _object_spread({
|
|
69047
|
-
ref: ref,
|
|
69048
|
-
className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className)
|
|
69049
|
-
}, props));
|
|
69050
|
-
});
|
|
69051
|
-
TableFooter.displayName = "TableFooter";
|
|
69052
|
-
var TableRow = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69053
|
-
var className = _param.className, props = _object_without_properties(_param, [
|
|
69054
|
-
"className"
|
|
69055
|
-
]);
|
|
69056
|
-
return /*#__PURE__*/ jsx("tr", _object_spread({
|
|
69057
|
-
ref: ref,
|
|
69058
|
-
className: cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className)
|
|
69059
|
-
}, props));
|
|
69060
|
-
});
|
|
69061
|
-
TableRow.displayName = "TableRow";
|
|
69062
|
-
var TableHead = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69063
|
-
var className = _param.className, props = _object_without_properties(_param, [
|
|
69064
|
-
"className"
|
|
69065
|
-
]);
|
|
69066
|
-
return /*#__PURE__*/ jsx("th", _object_spread({
|
|
69067
|
-
ref: ref,
|
|
69068
|
-
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)
|
|
69069
|
-
}, props));
|
|
69070
|
-
});
|
|
69071
|
-
TableHead.displayName = "TableHead";
|
|
69072
|
-
var TableCell = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69073
|
-
var className = _param.className, props = _object_without_properties(_param, [
|
|
69074
|
-
"className"
|
|
69075
|
-
]);
|
|
69076
|
-
return /*#__PURE__*/ jsx("td", _object_spread({
|
|
69077
|
-
ref: ref,
|
|
69078
|
-
className: cn("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className)
|
|
69079
|
-
}, props));
|
|
69080
|
-
});
|
|
69081
|
-
TableCell.displayName = "TableCell";
|
|
69082
|
-
var TableCaption = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69083
|
-
var className = _param.className, props = _object_without_properties(_param, [
|
|
69084
|
-
"className"
|
|
69085
|
-
]);
|
|
69086
|
-
return /*#__PURE__*/ jsx("caption", _object_spread({
|
|
69087
|
-
ref: ref,
|
|
69088
|
-
className: cn("mt-4 text-sm text-muted-foreground", className)
|
|
69089
|
-
}, props));
|
|
69090
|
-
});
|
|
69091
|
-
TableCaption.displayName = "TableCaption";
|
|
69092
|
-
|
|
69093
70632
|
export { CkEditor, CustomUpload, DateRangePicker, DropImage, ReactDateRange, Spin, Switch, UiLibrary };
|