diff --git a/packages/webviews/flatjs-evolve.config.ts b/packages/webviews/flatjs-evolve.config.ts index 1cbe38d..e318290 100644 --- a/packages/webviews/flatjs-evolve.config.ts +++ b/packages/webviews/flatjs-evolve.config.ts @@ -6,17 +6,17 @@ import { import { createLaunchEditorMiddleware } from '@flatjs/evolve-launch-editor'; const getHeadBeforeScripts = (serveMode: boolean) => { return [ - 'https://file.40017.cn/tcsk/react/dayjs@1.11.11/dayjs.min.js', + 'https://unpkg.com/dayjs@1.11.11/dayjs.min.js', ...(serveMode ? [ - 'https://file.40017.cn/tcsk/react/react@18.2.0/react.development.js', - 'https://file.40017.cn/tcsk/react/react-dom@18.2.0/react-dom.development.js', - 'https://file.40017.cn/tcsk/react/antd@5.17.0/antd.js', + 'https://unpkg.com/react@18.2.0/umd/react.development.js', + 'https://unpkg.com/react-dom@18.2.0/umd/react-dom.development.js', + 'https://unpkg.com/antd@5.17.0/dist/antd.js', ] : [ - 'https://file.40017.cn/tcsk/react/react@18.2.0/react.production.min.js', - 'https://file.40017.cn/tcsk/react/react-dom@18.2.0/react-dom.production.min.js', - 'https://file.40017.cn/tcsk/react/antd@5.17.0/antd.min.js', + 'https://unpkg.com/react@18.2.0/umd/react.production.min.js', + 'https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js', + 'https://unpkg.com/antd@5.17.0/dist/antd.min.js', ]), ]; }; diff --git a/packages/webviews/flatjs-plugin-ci.config.ts b/packages/webviews/flatjs-plugin-ci.config.ts deleted file mode 100644 index 78ee49f..0000000 --- a/packages/webviews/flatjs-plugin-ci.config.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { defineConfig } from '@flatjs/cli-plugin-ci'; - -export default defineConfig({ - buildEvolve: { - publishNow: true, - packNow: true, - publishFolder: ['shared'], - timestamp: 'dynamic', - cleanNodeModules: true, - }, - publishFtp: { - connection: { - port: 21, - host: '10.177.54.229', - user: 'webapps', - password: 'webapps', - }, - }, - publishCdn: { - connection: { - uploadApi: 'http://apisix.itcjf.com/cicd/file_upload/v1', - // uploadApi: ' http://172.25.82.62:80/cicd/file_upload/v1', - headers: { - apikey: 'AqIRvLZ2xkg0suZ', - host: 'cicd-prod', - }, - }, - }, -}); diff --git a/packages/webviews/package.json b/packages/webviews/package.json index 456b326..f52b3a9 100644 --- a/packages/webviews/package.json +++ b/packages/webviews/package.json @@ -14,7 +14,7 @@ ], "scripts": { "clean": "rimraf --no-glob ./dist ./coverage ./tsconfig.tsbuildinfo", - "lint": "eslint . --cache --cache-location .cache/eslint/main.eslintcache", + "lint": "eslint .", "test": "run-s test-unit", "test-unit": "vitest run --passWithNoTests", "test-unit-watch": "vitest watch --ui", @@ -24,8 +24,7 @@ "ci:checkRequirements": "npx flat ci checkRequirements", "build": "npx flat build evolve", "serve": "npx flat serve evolve", - "parallel": "npx flat ci parallel --prefix abc", - "postinstall": "is-ci || yarn husky" + "prepare": "yarn husky" }, "dependencies": { "@dimjs/lang": "next", diff --git a/packages/webviews/public/biz/template/shared-chunks/i18n-en.065303b29a7906699f56.js b/packages/webviews/public/biz/template/shared-chunks/i18n-en.065303b29a7906699f56.js deleted file mode 100644 index ca31ce7..0000000 --- a/packages/webviews/public/biz/template/shared-chunks/i18n-en.065303b29a7906699f56.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -(self["webpackChunkwebviews"] = self["webpackChunkwebviews"] || []).push([["biz/template/shared-chunks/i18n-en"],{ - -/***/ "./src/i18n/en.json": -/***/ (function(module) { - -module.exports = /*#__PURE__*/JSON.parse('{"Index":{"title":"Home","description":"This is the home page.","rich":"This is a rich text.","globalDefaults":"{globalString}"},"LocaleLayout":{"title":"next-intl example","description":"This is an example of using next-intl in the `app` directory."},"Client":{"title":"Client","description":"This page hydrates on the client side."},"Nested":{"title":"Nested","description":"This is a nested page.","children":{"title":"children Nested"}},"Navigation":{"home":"Home","client":"Client page","nested":"Nested page","newsArticle":"News article #{articleId}"},"NotFound":{"title":"This page was not found (404)"},"LocaleSwitcher":{"switchLocale":"Switch to {locale, select, de {German} en {English} other {Unknown}}"},"Counter":{"count":"Current count:","increment":"Increment"},"ClientCounter":{"count":"Current count: {count}","increment":"Increment"},"ApiRoute":{"hello":"Hello {name}!"},"useNamedRoute":{"home":"/","client":"/client","nested":"/nested"}}'); - -/***/ }) - -}]); \ No newline at end of file diff --git a/packages/webviews/public/dashboard/assets/pc-404-324d40f4.png b/packages/webviews/public/dashboard/assets/pc-404-324d40f4.png deleted file mode 100644 index cc8fa37..0000000 Binary files a/packages/webviews/public/dashboard/assets/pc-404-324d40f4.png and /dev/null differ diff --git a/packages/webviews/public/dashboard/bundle.css b/packages/webviews/public/dashboard/bundle.css deleted file mode 100644 index 702c2b6..0000000 --- a/packages/webviews/public/dashboard/bundle.css +++ /dev/null @@ -1,3 +0,0 @@ -.LLMBIb0dtHtuFj7zwEN_{background:url(../dashboard/assets/pc-404-324d40f4.png);color:blue;font-weight:"bold"} -@font-face{font-family:FZHuangTJXSJF;font-style:normal;font-weight:400;src:url(../dashboard/fonts/FZHuangTJXSJF-a1c8f180.eot);src:url(../dashboard/fonts/FZHuangTJXSJF-a1c8f180.eot?#iefix) format("embedded-opentype"),url(../dashboard/fonts/FZHuangTJXSJF-107b77a6.woff) format("woff"),url(../dashboard/fonts/FZHuangTJXSJF-c85b17ff.svg#FZHuangTJXSJF) format("svg")}.flat-font{font-family:FZHuangTJXSJF;font-weight:700} -*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent;--tw-shadow:0 0 transparent;--tw-shadow-colored:0 0 transparent;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 transparent;--tw-ring-shadow:0 0 transparent;--tw-shadow:0 0 transparent;--tw-shadow-colored:0 0 transparent;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.m-2{margin:.5rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.mb-2{margin-bottom:.5rem}.ml-1{margin-left:.25rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.flex{display:flex}.w-80{width:20rem}.max-w-2xl{max-width:42rem}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.text-center{text-align:center}.text-\[min\(4\.5vw\2c 1rem\)\]{font-size:min(4.5vw,1rem)}.text-\[min\(4vw\2c \.875rem\)\]{font-size:min(4vw,.875rem)}.font-light{font-weight:300}.font-semibold{font-weight:600}.leading-\[min\(5vw\2c 1\.25rem\)\]{line-height:min(5vw,1.25rem)}.leading-\[min\(6vw\2c 1\.75rem\)\]{line-height:min(6vw,1.75rem)}.text-gray-600{--tw-text-opacity:1;color:#4b5563;color:rgba(75,85,99,var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:#dc2626;color:rgba(220,38,38,var(--tw-text-opacity))}.text-red-700{--tw-text-opacity:1;color:#b91c1c;color:rgba(185,28,28,var(--tw-text-opacity))}.text-red-800{--tw-text-opacity:1;color:#991b1b;color:rgba(153,27,27,var(--tw-text-opacity))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}@media (min-width:640px){.sm\:text-base{font-size:1rem;line-height:1.5rem}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}} diff --git a/packages/webviews/public/dashboard/bundle.js b/packages/webviews/public/dashboard/bundle.js deleted file mode 100644 index 33f05c0..0000000 --- a/packages/webviews/public/dashboard/bundle.js +++ /dev/null @@ -1,24599 +0,0 @@ -/******/ (function() { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "../../node_modules/@formatjs/fast-memoize/lib/index.js": -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ memoize: function() { return /* binding */ memoize; }, -/* harmony export */ strategies: function() { return /* binding */ strategies; } -/* harmony export */ }); -// -// Main -// -function memoize(fn, options) { - var cache = options && options.cache ? options.cache : cacheDefault; - var serializer = options && options.serializer ? options.serializer : serializerDefault; - var strategy = options && options.strategy ? options.strategy : strategyDefault; - return strategy(fn, { - cache: cache, - serializer: serializer - }); -} -// -// Strategy -// -function isPrimitive(value) { - return value == null || typeof value === 'number' || typeof value === 'boolean'; // || typeof value === "string" 'unsafe' primitive for our needs -} -function monadic(fn, cache, serializer, arg) { - var cacheKey = isPrimitive(arg) ? arg : serializer(arg); - var computedValue = cache.get(cacheKey); - if (typeof computedValue === 'undefined') { - computedValue = fn.call(this, arg); - cache.set(cacheKey, computedValue); - } - return computedValue; -} -function variadic(fn, cache, serializer) { - var args = Array.prototype.slice.call(arguments, 3); - var cacheKey = serializer(args); - var computedValue = cache.get(cacheKey); - if (typeof computedValue === 'undefined') { - computedValue = fn.apply(this, args); - cache.set(cacheKey, computedValue); - } - return computedValue; -} -function assemble(fn, context, strategy, cache, serialize) { - return strategy.bind(context, fn, cache, serialize); -} -function strategyDefault(fn, options) { - var strategy = fn.length === 1 ? monadic : variadic; - return assemble(fn, this, strategy, options.cache.create(), options.serializer); -} -function strategyVariadic(fn, options) { - return assemble(fn, this, variadic, options.cache.create(), options.serializer); -} -function strategyMonadic(fn, options) { - return assemble(fn, this, monadic, options.cache.create(), options.serializer); -} -// -// Serializer -// -var serializerDefault = function serializerDefault() { - return JSON.stringify(arguments); -}; -// -// Cache -// -function ObjectWithoutPrototypeCache() { - this.cache = Object.create(null); -} -ObjectWithoutPrototypeCache.prototype.get = function (key) { - return this.cache[key]; -}; -ObjectWithoutPrototypeCache.prototype.set = function (key, value) { - this.cache[key] = value; -}; -var cacheDefault = { - create: function create() { - // @ts-ignore - return new ObjectWithoutPrototypeCache(); - } -}; -var strategies = { - variadic: strategyVariadic, - monadic: strategyMonadic -}; - -/***/ }), - -/***/ "../../node_modules/intl-messageformat/lib/index.js": -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { - -// ESM COMPAT FLAG -__webpack_require__.r(__webpack_exports__); - -// EXPORTS -__webpack_require__.d(__webpack_exports__, { - ErrorCode: function() { return /* reexport */ ErrorCode; }, - FormatError: function() { return /* reexport */ FormatError; }, - IntlMessageFormat: function() { return /* reexport */ IntlMessageFormat; }, - InvalidValueError: function() { return /* reexport */ InvalidValueError; }, - InvalidValueTypeError: function() { return /* reexport */ InvalidValueTypeError; }, - MissingValueError: function() { return /* reexport */ MissingValueError; }, - PART_TYPE: function() { return /* reexport */ PART_TYPE; }, - "default": function() { return /* binding */ intl_messageformat_lib; }, - formatToParts: function() { return /* reexport */ formatToParts; }, - isFormatXMLElementFn: function() { return /* reexport */ isFormatXMLElementFn; } -}); - -// EXTERNAL MODULE: ../../node_modules/tslib/tslib.es6.mjs -var tslib_es6 = __webpack_require__("../../node_modules/tslib/tslib.es6.mjs"); -;// CONCATENATED MODULE: ../../node_modules/@formatjs/icu-messageformat-parser/lib/error.js -var ErrorKind; -(function (ErrorKind) { - /** Argument is unclosed (e.g. `{0`) */ - ErrorKind[ErrorKind["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE"; - /** Argument is empty (e.g. `{}`). */ - ErrorKind[ErrorKind["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT"; - /** Argument is malformed (e.g. `{foo!}``) */ - ErrorKind[ErrorKind["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT"; - /** Expect an argument type (e.g. `{foo,}`) */ - ErrorKind[ErrorKind["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE"; - /** Unsupported argument type (e.g. `{foo,foo}`) */ - ErrorKind[ErrorKind["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE"; - /** Expect an argument style (e.g. `{foo, number, }`) */ - ErrorKind[ErrorKind["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE"; - /** The number skeleton is invalid. */ - ErrorKind[ErrorKind["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON"; - /** The date time skeleton is invalid. */ - ErrorKind[ErrorKind["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON"; - /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */ - ErrorKind[ErrorKind["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON"; - /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */ - ErrorKind[ErrorKind["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON"; - /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */ - ErrorKind[ErrorKind["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"; - /** Missing select argument options (e.g. `{foo, select}`) */ - ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS"; - /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */ - ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"; - /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */ - ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"; - /** Expecting a selector in `select` argument (e.g `{foo, select}`) */ - ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR"; - /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */ - ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR"; - /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */ - ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"; - /** - * Expecting a message fragment after the `plural` or `selectordinal` selector - * (e.g. `{foo, plural, one}`) - */ - ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"; - /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */ - ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR"; - /** - * Duplicate selectors in `plural` or `selectordinal` argument. - * (e.g. {foo, plural, one {#} one {#}}) - */ - ErrorKind[ErrorKind["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR"; - /** Duplicate selectors in `select` argument. - * (e.g. {foo, select, apple {apple} apple {apple}}) - */ - ErrorKind[ErrorKind["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR"; - /** Plural or select argument option must have `other` clause. */ - ErrorKind[ErrorKind["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE"; - /** The tag is malformed. (e.g. `foo) */ - ErrorKind[ErrorKind["INVALID_TAG"] = 23] = "INVALID_TAG"; - /** The tag name is invalid. (e.g. `<123>foo`) */ - ErrorKind[ErrorKind["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME"; - /** The closing tag does not match the opening tag. (e.g. `foo`) */ - ErrorKind[ErrorKind["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG"; - /** The opening tag has unmatched closing tag. (e.g. `foo`) */ - ErrorKind[ErrorKind["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG"; -})(ErrorKind || (ErrorKind = {})); -;// CONCATENATED MODULE: ../../node_modules/@formatjs/icu-messageformat-parser/lib/types.js -var TYPE; -(function (TYPE) { - /** - * Raw text - */ - TYPE[TYPE["literal"] = 0] = "literal"; - /** - * Variable w/o any format, e.g `var` in `this is a {var}` - */ - TYPE[TYPE["argument"] = 1] = "argument"; - /** - * Variable w/ number format - */ - TYPE[TYPE["number"] = 2] = "number"; - /** - * Variable w/ date format - */ - TYPE[TYPE["date"] = 3] = "date"; - /** - * Variable w/ time format - */ - TYPE[TYPE["time"] = 4] = "time"; - /** - * Variable w/ select format - */ - TYPE[TYPE["select"] = 5] = "select"; - /** - * Variable w/ plural format - */ - TYPE[TYPE["plural"] = 6] = "plural"; - /** - * Only possible within plural argument. - * This is the `#` symbol that will be substituted with the count. - */ - TYPE[TYPE["pound"] = 7] = "pound"; - /** - * XML-like tag - */ - TYPE[TYPE["tag"] = 8] = "tag"; -})(TYPE || (TYPE = {})); -var SKELETON_TYPE; -(function (SKELETON_TYPE) { - SKELETON_TYPE[SKELETON_TYPE["number"] = 0] = "number"; - SKELETON_TYPE[SKELETON_TYPE["dateTime"] = 1] = "dateTime"; -})(SKELETON_TYPE || (SKELETON_TYPE = {})); -/** - * Type Guards - */ -function isLiteralElement(el) { - return el.type === TYPE.literal; -} -function isArgumentElement(el) { - return el.type === TYPE.argument; -} -function isNumberElement(el) { - return el.type === TYPE.number; -} -function isDateElement(el) { - return el.type === TYPE.date; -} -function isTimeElement(el) { - return el.type === TYPE.time; -} -function isSelectElement(el) { - return el.type === TYPE.select; -} -function isPluralElement(el) { - return el.type === TYPE.plural; -} -function isPoundElement(el) { - return el.type === TYPE.pound; -} -function isTagElement(el) { - return el.type === TYPE.tag; -} -function isNumberSkeleton(el) { - return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number); -} -function isDateTimeSkeleton(el) { - return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime); -} -function createLiteralElement(value) { - return { - type: TYPE.literal, - value: value - }; -} -function createNumberElement(value, style) { - return { - type: TYPE.number, - value: value, - style: style - }; -} -;// CONCATENATED MODULE: ../../node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js -// @generated from regex-gen.ts -var SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/; -var WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/; -;// CONCATENATED MODULE: ../../node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js -/** - * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table - * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js - * with some tweaks - */ -var DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; -/** - * Parse Date time skeleton into Intl.DateTimeFormatOptions - * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table - * @public - * @param skeleton skeleton string - */ -function parseDateTimeSkeleton(skeleton) { - var result = {}; - skeleton.replace(DATE_TIME_REGEX, function (match) { - var len = match.length; - switch (match[0]) { - // Era - case 'G': - result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short'; - break; - // Year - case 'y': - result.year = len === 2 ? '2-digit' : 'numeric'; - break; - case 'Y': - case 'u': - case 'U': - case 'r': - throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead'); - // Quarter - case 'q': - case 'Q': - throw new RangeError('`q/Q` (quarter) patterns are not supported'); - // Month - case 'M': - case 'L': - result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1]; - break; - // Week - case 'w': - case 'W': - throw new RangeError('`w/W` (week) patterns are not supported'); - case 'd': - result.day = ['numeric', '2-digit'][len - 1]; - break; - case 'D': - case 'F': - case 'g': - throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead'); - // Weekday - case 'E': - result.weekday = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short'; - break; - case 'e': - if (len < 4) { - throw new RangeError('`e..eee` (weekday) patterns are not supported'); - } - result.weekday = ['short', 'long', 'narrow', 'short'][len - 4]; - break; - case 'c': - if (len < 4) { - throw new RangeError('`c..ccc` (weekday) patterns are not supported'); - } - result.weekday = ['short', 'long', 'narrow', 'short'][len - 4]; - break; - // Period - case 'a': - // AM, PM - result.hour12 = true; - break; - case 'b': // am, pm, noon, midnight - case 'B': - // flexible day periods - throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead'); - // Hour - case 'h': - result.hourCycle = 'h12'; - result.hour = ['numeric', '2-digit'][len - 1]; - break; - case 'H': - result.hourCycle = 'h23'; - result.hour = ['numeric', '2-digit'][len - 1]; - break; - case 'K': - result.hourCycle = 'h11'; - result.hour = ['numeric', '2-digit'][len - 1]; - break; - case 'k': - result.hourCycle = 'h24'; - result.hour = ['numeric', '2-digit'][len - 1]; - break; - case 'j': - case 'J': - case 'C': - throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead'); - // Minute - case 'm': - result.minute = ['numeric', '2-digit'][len - 1]; - break; - // Second - case 's': - result.second = ['numeric', '2-digit'][len - 1]; - break; - case 'S': - case 'A': - throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead'); - // Zone - case 'z': - // 1..3, 4: specific non-location format - result.timeZoneName = len < 4 ? 'short' : 'long'; - break; - case 'Z': // 1..3, 4, 5: The ISO8601 varios formats - case 'O': // 1, 4: milliseconds in day short, long - case 'v': // 1, 4: generic non-location format - case 'V': // 1, 2, 3, 4: time zone ID or city - case 'X': // 1, 2, 3, 4: The ISO8601 varios formats - case 'x': - // 1, 2, 3, 4: The ISO8601 varios formats - throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead'); - } - return ''; - }); - return result; -} -;// CONCATENATED MODULE: ../../node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js -// @generated from regex-gen.ts -var regex_generated_WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; -;// CONCATENATED MODULE: ../../node_modules/@formatjs/icu-skeleton-parser/lib/number.js - - -function parseNumberSkeletonFromString(skeleton) { - if (skeleton.length === 0) { - throw new Error('Number skeleton cannot be empty'); - } - // Parse the skeleton - var stringTokens = skeleton.split(regex_generated_WHITE_SPACE_REGEX).filter(function (x) { - return x.length > 0; - }); - var tokens = []; - for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) { - var stringToken = stringTokens_1[_i]; - var stemAndOptions = stringToken.split('/'); - if (stemAndOptions.length === 0) { - throw new Error('Invalid number skeleton'); - } - var stem = stemAndOptions[0], - options = stemAndOptions.slice(1); - for (var _a = 0, options_1 = options; _a < options_1.length; _a++) { - var option = options_1[_a]; - if (option.length === 0) { - throw new Error('Invalid number skeleton'); - } - } - tokens.push({ - stem: stem, - options: options - }); - } - return tokens; -} -function icuUnitToEcma(unit) { - return unit.replace(/^(.*?)-/, ''); -} -var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g; -var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g; -var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g; -var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/; -function parseSignificantPrecision(str) { - var result = {}; - if (str[str.length - 1] === 'r') { - result.roundingPriority = 'morePrecision'; - } else if (str[str.length - 1] === 's') { - result.roundingPriority = 'lessPrecision'; - } - str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) { - // @@@ case - if (typeof g2 !== 'string') { - result.minimumSignificantDigits = g1.length; - result.maximumSignificantDigits = g1.length; - } - // @@@+ case - else if (g2 === '+') { - result.minimumSignificantDigits = g1.length; - } - // .### case - else if (g1[0] === '#') { - result.maximumSignificantDigits = g1.length; - } - // .@@## or .@@@ case - else { - result.minimumSignificantDigits = g1.length; - result.maximumSignificantDigits = g1.length + (typeof g2 === 'string' ? g2.length : 0); - } - return ''; - }); - return result; -} -function parseSign(str) { - switch (str) { - case 'sign-auto': - return { - signDisplay: 'auto' - }; - case 'sign-accounting': - case '()': - return { - currencySign: 'accounting' - }; - case 'sign-always': - case '+!': - return { - signDisplay: 'always' - }; - case 'sign-accounting-always': - case '()!': - return { - signDisplay: 'always', - currencySign: 'accounting' - }; - case 'sign-except-zero': - case '+?': - return { - signDisplay: 'exceptZero' - }; - case 'sign-accounting-except-zero': - case '()?': - return { - signDisplay: 'exceptZero', - currencySign: 'accounting' - }; - case 'sign-never': - case '+_': - return { - signDisplay: 'never' - }; - } -} -function parseConciseScientificAndEngineeringStem(stem) { - // Engineering - var result; - if (stem[0] === 'E' && stem[1] === 'E') { - result = { - notation: 'engineering' - }; - stem = stem.slice(2); - } else if (stem[0] === 'E') { - result = { - notation: 'scientific' - }; - stem = stem.slice(1); - } - if (result) { - var signDisplay = stem.slice(0, 2); - if (signDisplay === '+!') { - result.signDisplay = 'always'; - stem = stem.slice(2); - } else if (signDisplay === '+?') { - result.signDisplay = 'exceptZero'; - stem = stem.slice(2); - } - if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) { - throw new Error('Malformed concise eng/scientific notation'); - } - result.minimumIntegerDigits = stem.length; - } - return result; -} -function parseNotationOptions(opt) { - var result = {}; - var signOpts = parseSign(opt); - if (signOpts) { - return signOpts; - } - return result; -} -/** - * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options - */ -function parseNumberSkeleton(tokens) { - var result = {}; - for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) { - var token = tokens_1[_i]; - switch (token.stem) { - case 'percent': - case '%': - result.style = 'percent'; - continue; - case '%x100': - result.style = 'percent'; - result.scale = 100; - continue; - case 'currency': - result.style = 'currency'; - result.currency = token.options[0]; - continue; - case 'group-off': - case ',_': - result.useGrouping = false; - continue; - case 'precision-integer': - case '.': - result.maximumFractionDigits = 0; - continue; - case 'measure-unit': - case 'unit': - result.style = 'unit'; - result.unit = icuUnitToEcma(token.options[0]); - continue; - case 'compact-short': - case 'K': - result.notation = 'compact'; - result.compactDisplay = 'short'; - continue; - case 'compact-long': - case 'KK': - result.notation = 'compact'; - result.compactDisplay = 'long'; - continue; - case 'scientific': - result = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, result), { - notation: 'scientific' - }), token.options.reduce(function (all, opt) { - return (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, all), parseNotationOptions(opt)); - }, {})); - continue; - case 'engineering': - result = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, result), { - notation: 'engineering' - }), token.options.reduce(function (all, opt) { - return (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, all), parseNotationOptions(opt)); - }, {})); - continue; - case 'notation-simple': - result.notation = 'standard'; - continue; - // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h - case 'unit-width-narrow': - result.currencyDisplay = 'narrowSymbol'; - result.unitDisplay = 'narrow'; - continue; - case 'unit-width-short': - result.currencyDisplay = 'code'; - result.unitDisplay = 'short'; - continue; - case 'unit-width-full-name': - result.currencyDisplay = 'name'; - result.unitDisplay = 'long'; - continue; - case 'unit-width-iso-code': - result.currencyDisplay = 'symbol'; - continue; - case 'scale': - result.scale = parseFloat(token.options[0]); - continue; - case 'rounding-mode-floor': - result.roundingMode = 'floor'; - continue; - case 'rounding-mode-ceiling': - result.roundingMode = 'ceil'; - continue; - case 'rounding-mode-down': - result.roundingMode = 'trunc'; - continue; - case 'rounding-mode-up': - result.roundingMode = 'expand'; - continue; - case 'rounding-mode-half-even': - result.roundingMode = 'halfEven'; - continue; - case 'rounding-mode-half-down': - result.roundingMode = 'halfTrunc'; - continue; - case 'rounding-mode-half-up': - result.roundingMode = 'halfExpand'; - continue; - // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width - case 'integer-width': - if (token.options.length > 1) { - throw new RangeError('integer-width stems only accept a single optional option'); - } - token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) { - if (g1) { - result.minimumIntegerDigits = g2.length; - } else if (g3 && g4) { - throw new Error('We currently do not support maximum integer digits'); - } else if (g5) { - throw new Error('We currently do not support exact integer digits'); - } - return ''; - }); - continue; - } - // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width - if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) { - result.minimumIntegerDigits = token.stem.length; - continue; - } - if (FRACTION_PRECISION_REGEX.test(token.stem)) { - // Precision - // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision - // precision-integer case - if (token.options.length > 1) { - throw new RangeError('Fraction-precision stems only accept a single optional option'); - } - token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) { - // .000* case (before ICU67 it was .000+) - if (g2 === '*') { - result.minimumFractionDigits = g1.length; - } - // .### case - else if (g3 && g3[0] === '#') { - result.maximumFractionDigits = g3.length; - } - // .00## case - else if (g4 && g5) { - result.minimumFractionDigits = g4.length; - result.maximumFractionDigits = g4.length + g5.length; - } else { - result.minimumFractionDigits = g1.length; - result.maximumFractionDigits = g1.length; - } - return ''; - }); - var opt = token.options[0]; - // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display - if (opt === 'w') { - result = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, result), { - trailingZeroDisplay: 'stripIfInteger' - }); - } else if (opt) { - result = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, result), parseSignificantPrecision(opt)); - } - continue; - } - // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision - if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) { - result = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, result), parseSignificantPrecision(token.stem)); - continue; - } - var signOpts = parseSign(token.stem); - if (signOpts) { - result = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, result), signOpts); - } - var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem); - if (conciseScientificAndEngineeringOpts) { - result = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, result), conciseScientificAndEngineeringOpts); - } - } - return result; -} -;// CONCATENATED MODULE: ../../node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js -// @generated from time-data-gen.ts -// prettier-ignore -var timeData = { - "001": ["H", "h"], - "AC": ["H", "h", "hb", "hB"], - "AD": ["H", "hB"], - "AE": ["h", "hB", "hb", "H"], - "AF": ["H", "hb", "hB", "h"], - "AG": ["h", "hb", "H", "hB"], - "AI": ["H", "h", "hb", "hB"], - "AL": ["h", "H", "hB"], - "AM": ["H", "hB"], - "AO": ["H", "hB"], - "AR": ["H", "h", "hB", "hb"], - "AS": ["h", "H"], - "AT": ["H", "hB"], - "AU": ["h", "hb", "H", "hB"], - "AW": ["H", "hB"], - "AX": ["H"], - "AZ": ["H", "hB", "h"], - "BA": ["H", "hB", "h"], - "BB": ["h", "hb", "H", "hB"], - "BD": ["h", "hB", "H"], - "BE": ["H", "hB"], - "BF": ["H", "hB"], - "BG": ["H", "hB", "h"], - "BH": ["h", "hB", "hb", "H"], - "BI": ["H", "h"], - "BJ": ["H", "hB"], - "BL": ["H", "hB"], - "BM": ["h", "hb", "H", "hB"], - "BN": ["hb", "hB", "h", "H"], - "BO": ["H", "hB", "h", "hb"], - "BQ": ["H"], - "BR": ["H", "hB"], - "BS": ["h", "hb", "H", "hB"], - "BT": ["h", "H"], - "BW": ["H", "h", "hb", "hB"], - "BY": ["H", "h"], - "BZ": ["H", "h", "hb", "hB"], - "CA": ["h", "hb", "H", "hB"], - "CC": ["H", "h", "hb", "hB"], - "CD": ["hB", "H"], - "CF": ["H", "h", "hB"], - "CG": ["H", "hB"], - "CH": ["H", "hB", "h"], - "CI": ["H", "hB"], - "CK": ["H", "h", "hb", "hB"], - "CL": ["H", "h", "hB", "hb"], - "CM": ["H", "h", "hB"], - "CN": ["H", "hB", "hb", "h"], - "CO": ["h", "H", "hB", "hb"], - "CP": ["H"], - "CR": ["H", "h", "hB", "hb"], - "CU": ["H", "h", "hB", "hb"], - "CV": ["H", "hB"], - "CW": ["H", "hB"], - "CX": ["H", "h", "hb", "hB"], - "CY": ["h", "H", "hb", "hB"], - "CZ": ["H"], - "DE": ["H", "hB"], - "DG": ["H", "h", "hb", "hB"], - "DJ": ["h", "H"], - "DK": ["H"], - "DM": ["h", "hb", "H", "hB"], - "DO": ["h", "H", "hB", "hb"], - "DZ": ["h", "hB", "hb", "H"], - "EA": ["H", "h", "hB", "hb"], - "EC": ["H", "hB", "h", "hb"], - "EE": ["H", "hB"], - "EG": ["h", "hB", "hb", "H"], - "EH": ["h", "hB", "hb", "H"], - "ER": ["h", "H"], - "ES": ["H", "hB", "h", "hb"], - "ET": ["hB", "hb", "h", "H"], - "FI": ["H"], - "FJ": ["h", "hb", "H", "hB"], - "FK": ["H", "h", "hb", "hB"], - "FM": ["h", "hb", "H", "hB"], - "FO": ["H", "h"], - "FR": ["H", "hB"], - "GA": ["H", "hB"], - "GB": ["H", "h", "hb", "hB"], - "GD": ["h", "hb", "H", "hB"], - "GE": ["H", "hB", "h"], - "GF": ["H", "hB"], - "GG": ["H", "h", "hb", "hB"], - "GH": ["h", "H"], - "GI": ["H", "h", "hb", "hB"], - "GL": ["H", "h"], - "GM": ["h", "hb", "H", "hB"], - "GN": ["H", "hB"], - "GP": ["H", "hB"], - "GQ": ["H", "hB", "h", "hb"], - "GR": ["h", "H", "hb", "hB"], - "GT": ["H", "h", "hB", "hb"], - "GU": ["h", "hb", "H", "hB"], - "GW": ["H", "hB"], - "GY": ["h", "hb", "H", "hB"], - "HK": ["h", "hB", "hb", "H"], - "HN": ["H", "h", "hB", "hb"], - "HR": ["H", "hB"], - "HU": ["H", "h"], - "IC": ["H", "h", "hB", "hb"], - "ID": ["H"], - "IE": ["H", "h", "hb", "hB"], - "IL": ["H", "hB"], - "IM": ["H", "h", "hb", "hB"], - "IN": ["h", "H"], - "IO": ["H", "h", "hb", "hB"], - "IQ": ["h", "hB", "hb", "H"], - "IR": ["hB", "H"], - "IS": ["H"], - "IT": ["H", "hB"], - "JE": ["H", "h", "hb", "hB"], - "JM": ["h", "hb", "H", "hB"], - "JO": ["h", "hB", "hb", "H"], - "JP": ["H", "K", "h"], - "KE": ["hB", "hb", "H", "h"], - "KG": ["H", "h", "hB", "hb"], - "KH": ["hB", "h", "H", "hb"], - "KI": ["h", "hb", "H", "hB"], - "KM": ["H", "h", "hB", "hb"], - "KN": ["h", "hb", "H", "hB"], - "KP": ["h", "H", "hB", "hb"], - "KR": ["h", "H", "hB", "hb"], - "KW": ["h", "hB", "hb", "H"], - "KY": ["h", "hb", "H", "hB"], - "KZ": ["H", "hB"], - "LA": ["H", "hb", "hB", "h"], - "LB": ["h", "hB", "hb", "H"], - "LC": ["h", "hb", "H", "hB"], - "LI": ["H", "hB", "h"], - "LK": ["H", "h", "hB", "hb"], - "LR": ["h", "hb", "H", "hB"], - "LS": ["h", "H"], - "LT": ["H", "h", "hb", "hB"], - "LU": ["H", "h", "hB"], - "LV": ["H", "hB", "hb", "h"], - "LY": ["h", "hB", "hb", "H"], - "MA": ["H", "h", "hB", "hb"], - "MC": ["H", "hB"], - "MD": ["H", "hB"], - "ME": ["H", "hB", "h"], - "MF": ["H", "hB"], - "MG": ["H", "h"], - "MH": ["h", "hb", "H", "hB"], - "MK": ["H", "h", "hb", "hB"], - "ML": ["H"], - "MM": ["hB", "hb", "H", "h"], - "MN": ["H", "h", "hb", "hB"], - "MO": ["h", "hB", "hb", "H"], - "MP": ["h", "hb", "H", "hB"], - "MQ": ["H", "hB"], - "MR": ["h", "hB", "hb", "H"], - "MS": ["H", "h", "hb", "hB"], - "MT": ["H", "h"], - "MU": ["H", "h"], - "MV": ["H", "h"], - "MW": ["h", "hb", "H", "hB"], - "MX": ["H", "h", "hB", "hb"], - "MY": ["hb", "hB", "h", "H"], - "MZ": ["H", "hB"], - "NA": ["h", "H", "hB", "hb"], - "NC": ["H", "hB"], - "NE": ["H"], - "NF": ["H", "h", "hb", "hB"], - "NG": ["H", "h", "hb", "hB"], - "NI": ["H", "h", "hB", "hb"], - "NL": ["H", "hB"], - "NO": ["H", "h"], - "NP": ["H", "h", "hB"], - "NR": ["H", "h", "hb", "hB"], - "NU": ["H", "h", "hb", "hB"], - "NZ": ["h", "hb", "H", "hB"], - "OM": ["h", "hB", "hb", "H"], - "PA": ["h", "H", "hB", "hb"], - "PE": ["H", "hB", "h", "hb"], - "PF": ["H", "h", "hB"], - "PG": ["h", "H"], - "PH": ["h", "hB", "hb", "H"], - "PK": ["h", "hB", "H"], - "PL": ["H", "h"], - "PM": ["H", "hB"], - "PN": ["H", "h", "hb", "hB"], - "PR": ["h", "H", "hB", "hb"], - "PS": ["h", "hB", "hb", "H"], - "PT": ["H", "hB"], - "PW": ["h", "H"], - "PY": ["H", "h", "hB", "hb"], - "QA": ["h", "hB", "hb", "H"], - "RE": ["H", "hB"], - "RO": ["H", "hB"], - "RS": ["H", "hB", "h"], - "RU": ["H"], - "RW": ["H", "h"], - "SA": ["h", "hB", "hb", "H"], - "SB": ["h", "hb", "H", "hB"], - "SC": ["H", "h", "hB"], - "SD": ["h", "hB", "hb", "H"], - "SE": ["H"], - "SG": ["h", "hb", "H", "hB"], - "SH": ["H", "h", "hb", "hB"], - "SI": ["H", "hB"], - "SJ": ["H"], - "SK": ["H"], - "SL": ["h", "hb", "H", "hB"], - "SM": ["H", "h", "hB"], - "SN": ["H", "h", "hB"], - "SO": ["h", "H"], - "SR": ["H", "hB"], - "SS": ["h", "hb", "H", "hB"], - "ST": ["H", "hB"], - "SV": ["H", "h", "hB", "hb"], - "SX": ["H", "h", "hb", "hB"], - "SY": ["h", "hB", "hb", "H"], - "SZ": ["h", "hb", "H", "hB"], - "TA": ["H", "h", "hb", "hB"], - "TC": ["h", "hb", "H", "hB"], - "TD": ["h", "H", "hB"], - "TF": ["H", "h", "hB"], - "TG": ["H", "hB"], - "TH": ["H", "h"], - "TJ": ["H", "h"], - "TL": ["H", "hB", "hb", "h"], - "TM": ["H", "h"], - "TN": ["h", "hB", "hb", "H"], - "TO": ["h", "H"], - "TR": ["H", "hB"], - "TT": ["h", "hb", "H", "hB"], - "TW": ["hB", "hb", "h", "H"], - "TZ": ["hB", "hb", "H", "h"], - "UA": ["H", "hB", "h"], - "UG": ["hB", "hb", "H", "h"], - "UM": ["h", "hb", "H", "hB"], - "US": ["h", "hb", "H", "hB"], - "UY": ["H", "h", "hB", "hb"], - "UZ": ["H", "hB", "h"], - "VA": ["H", "h", "hB"], - "VC": ["h", "hb", "H", "hB"], - "VE": ["h", "H", "hB", "hb"], - "VG": ["h", "hb", "H", "hB"], - "VI": ["h", "hb", "H", "hB"], - "VN": ["H", "h"], - "VU": ["h", "H"], - "WF": ["H", "hB"], - "WS": ["h", "H"], - "XK": ["H", "hB", "h"], - "YE": ["h", "hB", "hb", "H"], - "YT": ["H", "hB"], - "ZA": ["H", "h", "hb", "hB"], - "ZM": ["h", "hb", "H", "hB"], - "ZW": ["H", "h"], - "af-ZA": ["H", "h", "hB", "hb"], - "ar-001": ["h", "hB", "hb", "H"], - "ca-ES": ["H", "h", "hB"], - "en-001": ["h", "hb", "H", "hB"], - "es-BO": ["H", "h", "hB", "hb"], - "es-BR": ["H", "h", "hB", "hb"], - "es-EC": ["H", "h", "hB", "hb"], - "es-ES": ["H", "h", "hB", "hb"], - "es-GQ": ["H", "h", "hB", "hb"], - "es-PE": ["H", "h", "hB", "hb"], - "fr-CA": ["H", "h", "hB"], - "gl-ES": ["H", "h", "hB"], - "gu-IN": ["hB", "hb", "h", "H"], - "hi-IN": ["hB", "h", "H"], - "it-CH": ["H", "h", "hB"], - "it-IT": ["H", "h", "hB"], - "kn-IN": ["hB", "h", "H"], - "ml-IN": ["hB", "h", "H"], - "mr-IN": ["hB", "hb", "h", "H"], - "pa-IN": ["hB", "hb", "h", "H"], - "ta-IN": ["hB", "h", "hb", "H"], - "te-IN": ["hB", "h", "H"], - "zu-ZA": ["H", "hB", "hb", "h"] -}; -;// CONCATENATED MODULE: ../../node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js - -/** - * Returns the best matching date time pattern if a date time skeleton - * pattern is provided with a locale. Follows the Unicode specification: - * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns - * @param skeleton date time skeleton pattern that possibly includes j, J or C - * @param locale - */ -function getBestPattern(skeleton, locale) { - var skeletonCopy = ''; - for (var patternPos = 0; patternPos < skeleton.length; patternPos++) { - var patternChar = skeleton.charAt(patternPos); - if (patternChar === 'j') { - var extraLength = 0; - while (patternPos + 1 < skeleton.length && skeleton.charAt(patternPos + 1) === patternChar) { - extraLength++; - patternPos++; - } - var hourLen = 1 + (extraLength & 1); - var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1); - var dayPeriodChar = 'a'; - var hourChar = getDefaultHourSymbolFromLocale(locale); - if (hourChar == 'H' || hourChar == 'k') { - dayPeriodLen = 0; - } - while (dayPeriodLen-- > 0) { - skeletonCopy += dayPeriodChar; - } - while (hourLen-- > 0) { - skeletonCopy = hourChar + skeletonCopy; - } - } else if (patternChar === 'J') { - skeletonCopy += 'H'; - } else { - skeletonCopy += patternChar; - } - } - return skeletonCopy; -} -/** - * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle) - * of the given `locale` to the corresponding time pattern. - * @param locale - */ -function getDefaultHourSymbolFromLocale(locale) { - var hourCycle = locale.hourCycle; - if (hourCycle === undefined && - // @ts-ignore hourCycle(s) is not identified yet - locale.hourCycles && - // @ts-ignore - locale.hourCycles.length) { - // @ts-ignore - hourCycle = locale.hourCycles[0]; - } - if (hourCycle) { - switch (hourCycle) { - case 'h24': - return 'k'; - case 'h23': - return 'H'; - case 'h12': - return 'h'; - case 'h11': - return 'K'; - default: - throw new Error('Invalid hourCycle'); - } - } - // TODO: Once hourCycle is fully supported remove the following with data generation - var languageTag = locale.language; - var regionTag; - if (languageTag !== 'root') { - regionTag = locale.maximize().region; - } - var hourCycles = timeData[regionTag || ''] || timeData[languageTag || ''] || timeData["".concat(languageTag, "-001")] || timeData['001']; - return hourCycles[0]; -} -;// CONCATENATED MODULE: ../../node_modules/@formatjs/icu-messageformat-parser/lib/parser.js -var _a; - - - - - - -var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*")); -var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$")); -function createLocation(start, end) { - return { - start: start, - end: end - }; -} -// #region Ponyfills -// Consolidate these variables up top for easier toggling during debugging -var hasNativeStartsWith = !!String.prototype.startsWith && '_a'.startsWith('a', 1); -var hasNativeFromCodePoint = !!String.fromCodePoint; -var hasNativeFromEntries = !!Object.fromEntries; -var hasNativeCodePointAt = !!String.prototype.codePointAt; -var hasTrimStart = !!String.prototype.trimStart; -var hasTrimEnd = !!String.prototype.trimEnd; -var hasNativeIsSafeInteger = !!Number.isSafeInteger; -var isSafeInteger = hasNativeIsSafeInteger ? Number.isSafeInteger : function (n) { - return typeof n === 'number' && isFinite(n) && Math.floor(n) === n && Math.abs(n) <= 0x1fffffffffffff; -}; -// IE11 does not support y and u. -var REGEX_SUPPORTS_U_AND_Y = true; -try { - var re = RE('([^\\p{White_Space}\\p{Pattern_Syntax}]*)', 'yu'); - /** - * legacy Edge or Xbox One browser - * Unicode flag support: supported - * Pattern_Syntax support: not supported - * See https://github.com/formatjs/formatjs/issues/2822 - */ - REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a'; -} catch (_) { - REGEX_SUPPORTS_U_AND_Y = false; -} -var startsWith = hasNativeStartsWith ? -// Native -function startsWith(s, search, position) { - return s.startsWith(search, position); -} : -// For IE11 -function startsWith(s, search, position) { - return s.slice(position, position + search.length) === search; -}; -var fromCodePoint = hasNativeFromCodePoint ? String.fromCodePoint : -// IE11 -function fromCodePoint() { - var codePoints = []; - for (var _i = 0; _i < arguments.length; _i++) { - codePoints[_i] = arguments[_i]; - } - var elements = ''; - var length = codePoints.length; - var i = 0; - var code; - while (length > i) { - code = codePoints[i++]; - if (code > 0x10ffff) throw RangeError(code + ' is not a valid code point'); - elements += code < 0x10000 ? String.fromCharCode(code) : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00); - } - return elements; -}; -var fromEntries = -// native -hasNativeFromEntries ? Object.fromEntries : -// Ponyfill -function fromEntries(entries) { - var obj = {}; - for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { - var _a = entries_1[_i], - k = _a[0], - v = _a[1]; - obj[k] = v; - } - return obj; -}; -var codePointAt = hasNativeCodePointAt ? -// Native -function codePointAt(s, index) { - return s.codePointAt(index); -} : -// IE 11 -function codePointAt(s, index) { - var size = s.length; - if (index < 0 || index >= size) { - return undefined; - } - var first = s.charCodeAt(index); - var second; - return first < 0xd800 || first > 0xdbff || index + 1 === size || (second = s.charCodeAt(index + 1)) < 0xdc00 || second > 0xdfff ? first : (first - 0xd800 << 10) + (second - 0xdc00) + 0x10000; -}; -var trimStart = hasTrimStart ? -// Native -function trimStart(s) { - return s.trimStart(); -} : -// Ponyfill -function trimStart(s) { - return s.replace(SPACE_SEPARATOR_START_REGEX, ''); -}; -var trimEnd = hasTrimEnd ? -// Native -function trimEnd(s) { - return s.trimEnd(); -} : -// Ponyfill -function trimEnd(s) { - return s.replace(SPACE_SEPARATOR_END_REGEX, ''); -}; -// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11. -function RE(s, flag) { - return new RegExp(s, flag); -} -// #endregion -var matchIdentifierAtIndex; -if (REGEX_SUPPORTS_U_AND_Y) { - // Native - var IDENTIFIER_PREFIX_RE_1 = RE('([^\\p{White_Space}\\p{Pattern_Syntax}]*)', 'yu'); - matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) { - var _a; - IDENTIFIER_PREFIX_RE_1.lastIndex = index; - var match = IDENTIFIER_PREFIX_RE_1.exec(s); - return (_a = match[1]) !== null && _a !== void 0 ? _a : ''; - }; -} else { - // IE11 - matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) { - var match = []; - while (true) { - var c = codePointAt(s, index); - if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) { - break; - } - match.push(c); - index += c >= 0x10000 ? 2 : 1; - } - return fromCodePoint.apply(void 0, match); - }; -} -var parser_Parser = /** @class */function () { - function Parser(message, options) { - if (options === void 0) { - options = {}; - } - this.message = message; - this.position = { - offset: 0, - line: 1, - column: 1 - }; - this.ignoreTag = !!options.ignoreTag; - this.locale = options.locale; - this.requiresOtherClause = !!options.requiresOtherClause; - this.shouldParseSkeletons = !!options.shouldParseSkeletons; - } - Parser.prototype.parse = function () { - if (this.offset() !== 0) { - throw Error('parser can only be used once'); - } - return this.parseMessage(0, '', false); - }; - Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) { - var elements = []; - while (!this.isEOF()) { - var char = this.char(); - if (char === 123 /* `{` */) { - var result = this.parseArgument(nestingLevel, expectingCloseTag); - if (result.err) { - return result; - } - elements.push(result.val); - } else if (char === 125 /* `}` */ && nestingLevel > 0) { - break; - } else if (char === 35 /* `#` */ && (parentArgType === 'plural' || parentArgType === 'selectordinal')) { - var position = this.clonePosition(); - this.bump(); - elements.push({ - type: TYPE.pound, - location: createLocation(position, this.clonePosition()) - }); - } else if (char === 60 /* `<` */ && !this.ignoreTag && this.peek() === 47 // char code for '/' - ) { - if (expectingCloseTag) { - break; - } else { - return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition())); - } - } else if (char === 60 /* `<` */ && !this.ignoreTag && _isAlpha(this.peek() || 0)) { - var result = this.parseTag(nestingLevel, parentArgType); - if (result.err) { - return result; - } - elements.push(result.val); - } else { - var result = this.parseLiteral(nestingLevel, parentArgType); - if (result.err) { - return result; - } - elements.push(result.val); - } - } - return { - val: elements, - err: null - }; - }; - /** - * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the - * [custom element name][] except that a dash is NOT always mandatory and uppercase letters - * are accepted: - * - * ``` - * tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "" - * tagName ::= [a-z] (PENChar)* - * PENChar ::= - * "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] | - * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] | - * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] - * ``` - * - * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name - * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do - * since other tag-based engines like React allow it - */ - Parser.prototype.parseTag = function (nestingLevel, parentArgType) { - var startPosition = this.clonePosition(); - this.bump(); // `<` - var tagName = this.parseTagName(); - this.bumpSpace(); - if (this.bumpIf('/>')) { - // Self closing tag - return { - val: { - type: TYPE.literal, - value: "<".concat(tagName, "/>"), - location: createLocation(startPosition, this.clonePosition()) - }, - err: null - }; - } else if (this.bumpIf('>')) { - var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true); - if (childrenResult.err) { - return childrenResult; - } - var children = childrenResult.val; - // Expecting a close tag - var endTagStartPosition = this.clonePosition(); - if (this.bumpIf('')) { - return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition())); - } - return { - val: { - type: TYPE.tag, - value: tagName, - children: children, - location: createLocation(startPosition, this.clonePosition()) - }, - err: null - }; - } else { - return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition())); - } - } else { - return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition())); - } - }; - /** - * This method assumes that the caller has peeked ahead for the first tag character. - */ - Parser.prototype.parseTagName = function () { - var startOffset = this.offset(); - this.bump(); // the first tag name character - while (!this.isEOF() && _isPotentialElementNameChar(this.char())) { - this.bump(); - } - return this.message.slice(startOffset, this.offset()); - }; - Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) { - var start = this.clonePosition(); - var value = ''; - while (true) { - var parseQuoteResult = this.tryParseQuote(parentArgType); - if (parseQuoteResult) { - value += parseQuoteResult; - continue; - } - var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType); - if (parseUnquotedResult) { - value += parseUnquotedResult; - continue; - } - var parseLeftAngleResult = this.tryParseLeftAngleBracket(); - if (parseLeftAngleResult) { - value += parseLeftAngleResult; - continue; - } - break; - } - var location = createLocation(start, this.clonePosition()); - return { - val: { - type: TYPE.literal, - value: value, - location: location - }, - err: null - }; - }; - Parser.prototype.tryParseLeftAngleBracket = function () { - if (!this.isEOF() && this.char() === 60 /* `<` */ && (this.ignoreTag || - // If at the opening tag or closing tag position, bail. - !_isAlphaOrSlash(this.peek() || 0))) { - this.bump(); // `<` - return '<'; - } - return null; - }; - /** - * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes - * a character that requires quoting (that is, "only where needed"), and works the same in - * nested messages as on the top level of the pattern. The new behavior is otherwise compatible. - */ - Parser.prototype.tryParseQuote = function (parentArgType) { - if (this.isEOF() || this.char() !== 39 /* `'` */) { - return null; - } - // Parse escaped char following the apostrophe, or early return if there is no escaped char. - // Check if is valid escaped character - switch (this.peek()) { - case 39 /* `'` */: - // double quote, should return as a single quote. - this.bump(); - this.bump(); - return "'"; - // '{', '<', '>', '}' - case 123: - case 60: - case 62: - case 125: - break; - case 35: - // '#' - if (parentArgType === 'plural' || parentArgType === 'selectordinal') { - break; - } - return null; - default: - return null; - } - this.bump(); // apostrophe - var codePoints = [this.char()]; // escaped char - this.bump(); - // read chars until the optional closing apostrophe is found - while (!this.isEOF()) { - var ch = this.char(); - if (ch === 39 /* `'` */) { - if (this.peek() === 39 /* `'` */) { - codePoints.push(39); - // Bump one more time because we need to skip 2 characters. - this.bump(); - } else { - // Optional closing apostrophe. - this.bump(); - break; - } - } else { - codePoints.push(ch); - } - this.bump(); - } - return fromCodePoint.apply(void 0, codePoints); - }; - Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) { - if (this.isEOF()) { - return null; - } - var ch = this.char(); - if (ch === 60 /* `<` */ || ch === 123 /* `{` */ || ch === 35 /* `#` */ && (parentArgType === 'plural' || parentArgType === 'selectordinal') || ch === 125 /* `}` */ && nestingLevel > 0) { - return null; - } else { - this.bump(); - return fromCodePoint(ch); - } - }; - Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) { - var openingBracePosition = this.clonePosition(); - this.bump(); // `{` - this.bumpSpace(); - if (this.isEOF()) { - return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())); - } - if (this.char() === 125 /* `}` */) { - this.bump(); - return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition())); - } - // argument name - var value = this.parseIdentifierIfPossible().value; - if (!value) { - return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition())); - } - this.bumpSpace(); - if (this.isEOF()) { - return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())); - } - switch (this.char()) { - // Simple argument: `{name}` - case 125 /* `}` */: - { - this.bump(); // `}` - return { - val: { - type: TYPE.argument, - // value does not include the opening and closing braces. - value: value, - location: createLocation(openingBracePosition, this.clonePosition()) - }, - err: null - }; - } - // Argument with options: `{name, format, ...}` - case 44 /* `,` */: - { - this.bump(); // `,` - this.bumpSpace(); - if (this.isEOF()) { - return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())); - } - return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition); - } - default: - return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition())); - } - }; - /** - * Advance the parser until the end of the identifier, if it is currently on - * an identifier character. Return an empty string otherwise. - */ - Parser.prototype.parseIdentifierIfPossible = function () { - var startingPosition = this.clonePosition(); - var startOffset = this.offset(); - var value = matchIdentifierAtIndex(this.message, startOffset); - var endOffset = startOffset + value.length; - this.bumpTo(endOffset); - var endPosition = this.clonePosition(); - var location = createLocation(startingPosition, endPosition); - return { - value: value, - location: location - }; - }; - Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) { - var _a; - // Parse this range: - // {name, type, style} - // ^---^ - var typeStartPosition = this.clonePosition(); - var argType = this.parseIdentifierIfPossible().value; - var typeEndPosition = this.clonePosition(); - switch (argType) { - case '': - // Expecting a style string number, date, time, plural, selectordinal, or select. - return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition)); - case 'number': - case 'date': - case 'time': - { - // Parse this range: - // {name, number, style} - // ^-------^ - this.bumpSpace(); - var styleAndLocation = null; - if (this.bumpIf(',')) { - this.bumpSpace(); - var styleStartPosition = this.clonePosition(); - var result = this.parseSimpleArgStyleIfPossible(); - if (result.err) { - return result; - } - var style = trimEnd(result.val); - if (style.length === 0) { - return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition())); - } - var styleLocation = createLocation(styleStartPosition, this.clonePosition()); - styleAndLocation = { - style: style, - styleLocation: styleLocation - }; - } - var argCloseResult = this.tryParseArgumentClose(openingBracePosition); - if (argCloseResult.err) { - return argCloseResult; - } - var location_1 = createLocation(openingBracePosition, this.clonePosition()); - // Extract style or skeleton - if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) { - // Skeleton starts with `::`. - var skeleton = trimStart(styleAndLocation.style.slice(2)); - if (argType === 'number') { - var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation); - if (result.err) { - return result; - } - return { - val: { - type: TYPE.number, - value: value, - location: location_1, - style: result.val - }, - err: null - }; - } else { - if (skeleton.length === 0) { - return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1); - } - var dateTimePattern = skeleton; - // Get "best match" pattern only if locale is passed, if not, let it - // pass as-is where `parseDateTimeSkeleton()` will throw an error - // for unsupported patterns. - if (this.locale) { - dateTimePattern = getBestPattern(skeleton, this.locale); - } - var style = { - type: SKELETON_TYPE.dateTime, - pattern: dateTimePattern, - location: styleAndLocation.styleLocation, - parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {} - }; - var type = argType === 'date' ? TYPE.date : TYPE.time; - return { - val: { - type: type, - value: value, - location: location_1, - style: style - }, - err: null - }; - } - } - // Regular style or no style. - return { - val: { - type: argType === 'number' ? TYPE.number : argType === 'date' ? TYPE.date : TYPE.time, - value: value, - location: location_1, - style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null - }, - err: null - }; - } - case 'plural': - case 'selectordinal': - case 'select': - { - // Parse this range: - // {name, plural, options} - // ^---------^ - var typeEndPosition_1 = this.clonePosition(); - this.bumpSpace(); - if (!this.bumpIf(',')) { - return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, (0,tslib_es6/* __assign */.Cl)({}, typeEndPosition_1))); - } - this.bumpSpace(); - // Parse offset: - // {name, plural, offset:1, options} - // ^-----^ - // - // or the first option: - // - // {name, plural, one {...} other {...}} - // ^--^ - var identifierAndLocation = this.parseIdentifierIfPossible(); - var pluralOffset = 0; - if (argType !== 'select' && identifierAndLocation.value === 'offset') { - if (!this.bumpIf(':')) { - return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition())); - } - this.bumpSpace(); - var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE); - if (result.err) { - return result; - } - // Parse another identifier for option parsing - this.bumpSpace(); - identifierAndLocation = this.parseIdentifierIfPossible(); - pluralOffset = result.val; - } - var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation); - if (optionsResult.err) { - return optionsResult; - } - var argCloseResult = this.tryParseArgumentClose(openingBracePosition); - if (argCloseResult.err) { - return argCloseResult; - } - var location_2 = createLocation(openingBracePosition, this.clonePosition()); - if (argType === 'select') { - return { - val: { - type: TYPE.select, - value: value, - options: fromEntries(optionsResult.val), - location: location_2 - }, - err: null - }; - } else { - return { - val: { - type: TYPE.plural, - value: value, - options: fromEntries(optionsResult.val), - offset: pluralOffset, - pluralType: argType === 'plural' ? 'cardinal' : 'ordinal', - location: location_2 - }, - err: null - }; - } - } - default: - return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition)); - } - }; - Parser.prototype.tryParseArgumentClose = function (openingBracePosition) { - // Parse: {value, number, ::currency/GBP } - // - if (this.isEOF() || this.char() !== 125 /* `}` */) { - return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition())); - } - this.bump(); // `}` - return { - val: true, - err: null - }; - }; - /** - * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659 - */ - Parser.prototype.parseSimpleArgStyleIfPossible = function () { - var nestedBraces = 0; - var startPosition = this.clonePosition(); - while (!this.isEOF()) { - var ch = this.char(); - switch (ch) { - case 39 /* `'` */: - { - // Treat apostrophe as quoting but include it in the style part. - // Find the end of the quoted literal text. - this.bump(); - var apostrophePosition = this.clonePosition(); - if (!this.bumpUntil("'")) { - return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition())); - } - this.bump(); - break; - } - case 123 /* `{` */: - { - nestedBraces += 1; - this.bump(); - break; - } - case 125 /* `}` */: - { - if (nestedBraces > 0) { - nestedBraces -= 1; - } else { - return { - val: this.message.slice(startPosition.offset, this.offset()), - err: null - }; - } - break; - } - default: - this.bump(); - break; - } - } - return { - val: this.message.slice(startPosition.offset, this.offset()), - err: null - }; - }; - Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) { - var tokens = []; - try { - tokens = parseNumberSkeletonFromString(skeleton); - } catch (e) { - return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location); - } - return { - val: { - type: SKELETON_TYPE.number, - tokens: tokens, - location: location, - parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens) : {} - }, - err: null - }; - }; - /** - * @param nesting_level The current nesting level of messages. - * This can be positive when parsing message fragment in select or plural argument options. - * @param parent_arg_type The parent argument's type. - * @param parsed_first_identifier If provided, this is the first identifier-like selector of - * the argument. It is a by-product of a previous parsing attempt. - * @param expecting_close_tag If true, this message is directly or indirectly nested inside - * between a pair of opening and closing tags. The nested message will not parse beyond - * the closing tag boundary. - */ - Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) { - var _a; - var hasOtherClause = false; - var options = []; - var parsedSelectors = new Set(); - var selector = parsedFirstIdentifier.value, - selectorLocation = parsedFirstIdentifier.location; - // Parse: - // one {one apple} - // ^--^ - while (true) { - if (selector.length === 0) { - var startPosition = this.clonePosition(); - if (parentArgType !== 'select' && this.bumpIf('=')) { - // Try parse `={number}` selector - var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR); - if (result.err) { - return result; - } - selectorLocation = createLocation(startPosition, this.clonePosition()); - selector = this.message.slice(startPosition.offset, this.offset()); - } else { - break; - } - } - // Duplicate selector clauses - if (parsedSelectors.has(selector)) { - return this.error(parentArgType === 'select' ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation); - } - if (selector === 'other') { - hasOtherClause = true; - } - // Parse: - // one {one apple} - // ^----------^ - this.bumpSpace(); - var openingBracePosition = this.clonePosition(); - if (!this.bumpIf('{')) { - return this.error(parentArgType === 'select' ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition())); - } - var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag); - if (fragmentResult.err) { - return fragmentResult; - } - var argCloseResult = this.tryParseArgumentClose(openingBracePosition); - if (argCloseResult.err) { - return argCloseResult; - } - options.push([selector, { - value: fragmentResult.val, - location: createLocation(openingBracePosition, this.clonePosition()) - }]); - // Keep track of the existing selectors - parsedSelectors.add(selector); - // Prep next selector clause. - this.bumpSpace(); - _a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location; - } - if (options.length === 0) { - return this.error(parentArgType === 'select' ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition())); - } - if (this.requiresOtherClause && !hasOtherClause) { - return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition())); - } - return { - val: options, - err: null - }; - }; - Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) { - var sign = 1; - var startingPosition = this.clonePosition(); - if (this.bumpIf('+')) {} else if (this.bumpIf('-')) { - sign = -1; - } - var hasDigits = false; - var decimal = 0; - while (!this.isEOF()) { - var ch = this.char(); - if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) { - hasDigits = true; - decimal = decimal * 10 + (ch - 48); - this.bump(); - } else { - break; - } - } - var location = createLocation(startingPosition, this.clonePosition()); - if (!hasDigits) { - return this.error(expectNumberError, location); - } - decimal *= sign; - if (!isSafeInteger(decimal)) { - return this.error(invalidNumberError, location); - } - return { - val: decimal, - err: null - }; - }; - Parser.prototype.offset = function () { - return this.position.offset; - }; - Parser.prototype.isEOF = function () { - return this.offset() === this.message.length; - }; - Parser.prototype.clonePosition = function () { - // This is much faster than `Object.assign` or spread. - return { - offset: this.position.offset, - line: this.position.line, - column: this.position.column - }; - }; - /** - * Return the code point at the current position of the parser. - * Throws if the index is out of bound. - */ - Parser.prototype.char = function () { - var offset = this.position.offset; - if (offset >= this.message.length) { - throw Error('out of bound'); - } - var code = codePointAt(this.message, offset); - if (code === undefined) { - throw Error("Offset ".concat(offset, " is at invalid UTF-16 code unit boundary")); - } - return code; - }; - Parser.prototype.error = function (kind, location) { - return { - val: null, - err: { - kind: kind, - message: this.message, - location: location - } - }; - }; - /** Bump the parser to the next UTF-16 code unit. */ - Parser.prototype.bump = function () { - if (this.isEOF()) { - return; - } - var code = this.char(); - if (code === 10 /* '\n' */) { - this.position.line += 1; - this.position.column = 1; - this.position.offset += 1; - } else { - this.position.column += 1; - // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair. - this.position.offset += code < 0x10000 ? 1 : 2; - } - }; - /** - * If the substring starting at the current position of the parser has - * the given prefix, then bump the parser to the character immediately - * following the prefix and return true. Otherwise, don't bump the parser - * and return false. - */ - Parser.prototype.bumpIf = function (prefix) { - if (startsWith(this.message, prefix, this.offset())) { - for (var i = 0; i < prefix.length; i++) { - this.bump(); - } - return true; - } - return false; - }; - /** - * Bump the parser until the pattern character is found and return `true`. - * Otherwise bump to the end of the file and return `false`. - */ - Parser.prototype.bumpUntil = function (pattern) { - var currentOffset = this.offset(); - var index = this.message.indexOf(pattern, currentOffset); - if (index >= 0) { - this.bumpTo(index); - return true; - } else { - this.bumpTo(this.message.length); - return false; - } - }; - /** - * Bump the parser to the target offset. - * If target offset is beyond the end of the input, bump the parser to the end of the input. - */ - Parser.prototype.bumpTo = function (targetOffset) { - if (this.offset() > targetOffset) { - throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset())); - } - targetOffset = Math.min(targetOffset, this.message.length); - while (true) { - var offset = this.offset(); - if (offset === targetOffset) { - break; - } - if (offset > targetOffset) { - throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary")); - } - this.bump(); - if (this.isEOF()) { - break; - } - } - }; - /** advance the parser through all whitespace to the next non-whitespace code unit. */ - Parser.prototype.bumpSpace = function () { - while (!this.isEOF() && _isWhiteSpace(this.char())) { - this.bump(); - } - }; - /** - * Peek at the *next* Unicode codepoint in the input without advancing the parser. - * If the input has been exhausted, then this returns null. - */ - Parser.prototype.peek = function () { - if (this.isEOF()) { - return null; - } - var code = this.char(); - var offset = this.offset(); - var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1)); - return nextCode !== null && nextCode !== void 0 ? nextCode : null; - }; - return Parser; -}(); - -/** - * This check if codepoint is alphabet (lower & uppercase) - * @param codepoint - * @returns - */ -function _isAlpha(codepoint) { - return codepoint >= 97 && codepoint <= 122 || codepoint >= 65 && codepoint <= 90; -} -function _isAlphaOrSlash(codepoint) { - return _isAlpha(codepoint) || codepoint === 47; /* '/' */ -} -/** See `parseTag` function docs. */ -function _isPotentialElementNameChar(c) { - return c === 45 /* '-' */ || c === 46 /* '.' */ || c >= 48 && c <= 57 /* 0..9 */ || c === 95 /* '_' */ || c >= 97 && c <= 122 /** a..z */ || c >= 65 && c <= 90 /* A..Z */ || c == 0xb7 || c >= 0xc0 && c <= 0xd6 || c >= 0xd8 && c <= 0xf6 || c >= 0xf8 && c <= 0x37d || c >= 0x37f && c <= 0x1fff || c >= 0x200c && c <= 0x200d || c >= 0x203f && c <= 0x2040 || c >= 0x2070 && c <= 0x218f || c >= 0x2c00 && c <= 0x2fef || c >= 0x3001 && c <= 0xd7ff || c >= 0xf900 && c <= 0xfdcf || c >= 0xfdf0 && c <= 0xfffd || c >= 0x10000 && c <= 0xeffff; -} -/** - * Code point equivalent of regex `\p{White_Space}`. - * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt - */ -function _isWhiteSpace(c) { - return c >= 0x0009 && c <= 0x000d || c === 0x0020 || c === 0x0085 || c >= 0x200e && c <= 0x200f || c === 0x2028 || c === 0x2029; -} -/** - * Code point equivalent of regex `\p{Pattern_Syntax}`. - * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt - */ -function _isPatternSyntax(c) { - return c >= 0x0021 && c <= 0x0023 || c === 0x0024 || c >= 0x0025 && c <= 0x0027 || c === 0x0028 || c === 0x0029 || c === 0x002a || c === 0x002b || c === 0x002c || c === 0x002d || c >= 0x002e && c <= 0x002f || c >= 0x003a && c <= 0x003b || c >= 0x003c && c <= 0x003e || c >= 0x003f && c <= 0x0040 || c === 0x005b || c === 0x005c || c === 0x005d || c === 0x005e || c === 0x0060 || c === 0x007b || c === 0x007c || c === 0x007d || c === 0x007e || c === 0x00a1 || c >= 0x00a2 && c <= 0x00a5 || c === 0x00a6 || c === 0x00a7 || c === 0x00a9 || c === 0x00ab || c === 0x00ac || c === 0x00ae || c === 0x00b0 || c === 0x00b1 || c === 0x00b6 || c === 0x00bb || c === 0x00bf || c === 0x00d7 || c === 0x00f7 || c >= 0x2010 && c <= 0x2015 || c >= 0x2016 && c <= 0x2017 || c === 0x2018 || c === 0x2019 || c === 0x201a || c >= 0x201b && c <= 0x201c || c === 0x201d || c === 0x201e || c === 0x201f || c >= 0x2020 && c <= 0x2027 || c >= 0x2030 && c <= 0x2038 || c === 0x2039 || c === 0x203a || c >= 0x203b && c <= 0x203e || c >= 0x2041 && c <= 0x2043 || c === 0x2044 || c === 0x2045 || c === 0x2046 || c >= 0x2047 && c <= 0x2051 || c === 0x2052 || c === 0x2053 || c >= 0x2055 && c <= 0x205e || c >= 0x2190 && c <= 0x2194 || c >= 0x2195 && c <= 0x2199 || c >= 0x219a && c <= 0x219b || c >= 0x219c && c <= 0x219f || c === 0x21a0 || c >= 0x21a1 && c <= 0x21a2 || c === 0x21a3 || c >= 0x21a4 && c <= 0x21a5 || c === 0x21a6 || c >= 0x21a7 && c <= 0x21ad || c === 0x21ae || c >= 0x21af && c <= 0x21cd || c >= 0x21ce && c <= 0x21cf || c >= 0x21d0 && c <= 0x21d1 || c === 0x21d2 || c === 0x21d3 || c === 0x21d4 || c >= 0x21d5 && c <= 0x21f3 || c >= 0x21f4 && c <= 0x22ff || c >= 0x2300 && c <= 0x2307 || c === 0x2308 || c === 0x2309 || c === 0x230a || c === 0x230b || c >= 0x230c && c <= 0x231f || c >= 0x2320 && c <= 0x2321 || c >= 0x2322 && c <= 0x2328 || c === 0x2329 || c === 0x232a || c >= 0x232b && c <= 0x237b || c === 0x237c || c >= 0x237d && c <= 0x239a || c >= 0x239b && c <= 0x23b3 || c >= 0x23b4 && c <= 0x23db || c >= 0x23dc && c <= 0x23e1 || c >= 0x23e2 && c <= 0x2426 || c >= 0x2427 && c <= 0x243f || c >= 0x2440 && c <= 0x244a || c >= 0x244b && c <= 0x245f || c >= 0x2500 && c <= 0x25b6 || c === 0x25b7 || c >= 0x25b8 && c <= 0x25c0 || c === 0x25c1 || c >= 0x25c2 && c <= 0x25f7 || c >= 0x25f8 && c <= 0x25ff || c >= 0x2600 && c <= 0x266e || c === 0x266f || c >= 0x2670 && c <= 0x2767 || c === 0x2768 || c === 0x2769 || c === 0x276a || c === 0x276b || c === 0x276c || c === 0x276d || c === 0x276e || c === 0x276f || c === 0x2770 || c === 0x2771 || c === 0x2772 || c === 0x2773 || c === 0x2774 || c === 0x2775 || c >= 0x2794 && c <= 0x27bf || c >= 0x27c0 && c <= 0x27c4 || c === 0x27c5 || c === 0x27c6 || c >= 0x27c7 && c <= 0x27e5 || c === 0x27e6 || c === 0x27e7 || c === 0x27e8 || c === 0x27e9 || c === 0x27ea || c === 0x27eb || c === 0x27ec || c === 0x27ed || c === 0x27ee || c === 0x27ef || c >= 0x27f0 && c <= 0x27ff || c >= 0x2800 && c <= 0x28ff || c >= 0x2900 && c <= 0x2982 || c === 0x2983 || c === 0x2984 || c === 0x2985 || c === 0x2986 || c === 0x2987 || c === 0x2988 || c === 0x2989 || c === 0x298a || c === 0x298b || c === 0x298c || c === 0x298d || c === 0x298e || c === 0x298f || c === 0x2990 || c === 0x2991 || c === 0x2992 || c === 0x2993 || c === 0x2994 || c === 0x2995 || c === 0x2996 || c === 0x2997 || c === 0x2998 || c >= 0x2999 && c <= 0x29d7 || c === 0x29d8 || c === 0x29d9 || c === 0x29da || c === 0x29db || c >= 0x29dc && c <= 0x29fb || c === 0x29fc || c === 0x29fd || c >= 0x29fe && c <= 0x2aff || c >= 0x2b00 && c <= 0x2b2f || c >= 0x2b30 && c <= 0x2b44 || c >= 0x2b45 && c <= 0x2b46 || c >= 0x2b47 && c <= 0x2b4c || c >= 0x2b4d && c <= 0x2b73 || c >= 0x2b74 && c <= 0x2b75 || c >= 0x2b76 && c <= 0x2b95 || c === 0x2b96 || c >= 0x2b97 && c <= 0x2bff || c >= 0x2e00 && c <= 0x2e01 || c === 0x2e02 || c === 0x2e03 || c === 0x2e04 || c === 0x2e05 || c >= 0x2e06 && c <= 0x2e08 || c === 0x2e09 || c === 0x2e0a || c === 0x2e0b || c === 0x2e0c || c === 0x2e0d || c >= 0x2e0e && c <= 0x2e16 || c === 0x2e17 || c >= 0x2e18 && c <= 0x2e19 || c === 0x2e1a || c === 0x2e1b || c === 0x2e1c || c === 0x2e1d || c >= 0x2e1e && c <= 0x2e1f || c === 0x2e20 || c === 0x2e21 || c === 0x2e22 || c === 0x2e23 || c === 0x2e24 || c === 0x2e25 || c === 0x2e26 || c === 0x2e27 || c === 0x2e28 || c === 0x2e29 || c >= 0x2e2a && c <= 0x2e2e || c === 0x2e2f || c >= 0x2e30 && c <= 0x2e39 || c >= 0x2e3a && c <= 0x2e3b || c >= 0x2e3c && c <= 0x2e3f || c === 0x2e40 || c === 0x2e41 || c === 0x2e42 || c >= 0x2e43 && c <= 0x2e4f || c >= 0x2e50 && c <= 0x2e51 || c === 0x2e52 || c >= 0x2e53 && c <= 0x2e7f || c >= 0x3001 && c <= 0x3003 || c === 0x3008 || c === 0x3009 || c === 0x300a || c === 0x300b || c === 0x300c || c === 0x300d || c === 0x300e || c === 0x300f || c === 0x3010 || c === 0x3011 || c >= 0x3012 && c <= 0x3013 || c === 0x3014 || c === 0x3015 || c === 0x3016 || c === 0x3017 || c === 0x3018 || c === 0x3019 || c === 0x301a || c === 0x301b || c === 0x301c || c === 0x301d || c >= 0x301e && c <= 0x301f || c === 0x3020 || c === 0x3030 || c === 0xfd3e || c === 0xfd3f || c >= 0xfe45 && c <= 0xfe46; -} -;// CONCATENATED MODULE: ../../node_modules/@formatjs/icu-messageformat-parser/lib/index.js - - - - -function pruneLocation(els) { - els.forEach(function (el) { - delete el.location; - if (isSelectElement(el) || isPluralElement(el)) { - for (var k in el.options) { - delete el.options[k].location; - pruneLocation(el.options[k].value); - } - } else if (isNumberElement(el) && isNumberSkeleton(el.style)) { - delete el.style.location; - } else if ((isDateElement(el) || isTimeElement(el)) && isDateTimeSkeleton(el.style)) { - delete el.style.location; - } else if (isTagElement(el)) { - pruneLocation(el.children); - } - }); -} -function parse(message, opts) { - if (opts === void 0) { - opts = {}; - } - opts = (0,tslib_es6/* __assign */.Cl)({ - shouldParseSkeletons: true, - requiresOtherClause: true - }, opts); - var result = new parser_Parser(message, opts).parse(); - if (result.err) { - var error = SyntaxError(ErrorKind[result.err.kind]); - // @ts-expect-error Assign to error object - error.location = result.err.location; - // @ts-expect-error Assign to error object - error.originalMessage = result.err.message; - throw error; - } - if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) { - pruneLocation(result.val); - } - return result.val; -} - -// only for testing -var _Parser = (/* unused pure expression or super */ null && (Parser)); -// EXTERNAL MODULE: ../../node_modules/@formatjs/fast-memoize/lib/index.js -var lib = __webpack_require__("../../node_modules/@formatjs/fast-memoize/lib/index.js"); -;// CONCATENATED MODULE: ../../node_modules/intl-messageformat/lib/src/error.js - -var ErrorCode; -(function (ErrorCode) { - // When we have a placeholder but no value to format - ErrorCode["MISSING_VALUE"] = "MISSING_VALUE"; - // When value supplied is invalid - ErrorCode["INVALID_VALUE"] = "INVALID_VALUE"; - // When we need specific Intl API but it's not available - ErrorCode["MISSING_INTL_API"] = "MISSING_INTL_API"; -})(ErrorCode || (ErrorCode = {})); -var FormatError = /** @class */function (_super) { - (0,tslib_es6/* __extends */.C6)(FormatError, _super); - function FormatError(msg, code, originalMessage) { - var _this = _super.call(this, msg) || this; - _this.code = code; - _this.originalMessage = originalMessage; - return _this; - } - FormatError.prototype.toString = function () { - return "[formatjs Error: ".concat(this.code, "] ").concat(this.message); - }; - return FormatError; -}(Error); - -var InvalidValueError = /** @class */function (_super) { - (0,tslib_es6/* __extends */.C6)(InvalidValueError, _super); - function InvalidValueError(variableId, value, options, originalMessage) { - return _super.call(this, "Invalid values for \"".concat(variableId, "\": \"").concat(value, "\". Options are \"").concat(Object.keys(options).join('", "'), "\""), ErrorCode.INVALID_VALUE, originalMessage) || this; - } - return InvalidValueError; -}(FormatError); - -var InvalidValueTypeError = /** @class */function (_super) { - (0,tslib_es6/* __extends */.C6)(InvalidValueTypeError, _super); - function InvalidValueTypeError(value, type, originalMessage) { - return _super.call(this, "Value for \"".concat(value, "\" must be of type ").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this; - } - return InvalidValueTypeError; -}(FormatError); - -var MissingValueError = /** @class */function (_super) { - (0,tslib_es6/* __extends */.C6)(MissingValueError, _super); - function MissingValueError(variableId, originalMessage) { - return _super.call(this, "The intl string context variable \"".concat(variableId, "\" was not provided to the string \"").concat(originalMessage, "\""), ErrorCode.MISSING_VALUE, originalMessage) || this; - } - return MissingValueError; -}(FormatError); - -;// CONCATENATED MODULE: ../../node_modules/intl-messageformat/lib/src/formatters.js - - -var PART_TYPE; -(function (PART_TYPE) { - PART_TYPE[PART_TYPE["literal"] = 0] = "literal"; - PART_TYPE[PART_TYPE["object"] = 1] = "object"; -})(PART_TYPE || (PART_TYPE = {})); -function mergeLiteral(parts) { - if (parts.length < 2) { - return parts; - } - return parts.reduce(function (all, part) { - var lastPart = all[all.length - 1]; - if (!lastPart || lastPart.type !== PART_TYPE.literal || part.type !== PART_TYPE.literal) { - all.push(part); - } else { - lastPart.value += part.value; - } - return all; - }, []); -} -function isFormatXMLElementFn(el) { - return typeof el === 'function'; -} -// TODO(skeleton): add skeleton support -function formatToParts(els, locales, formatters, formats, values, currentPluralValue, -// For debugging -originalMessage) { - // Hot path for straight simple msg translations - if (els.length === 1 && isLiteralElement(els[0])) { - return [{ - type: PART_TYPE.literal, - value: els[0].value - }]; - } - var result = []; - for (var _i = 0, els_1 = els; _i < els_1.length; _i++) { - var el = els_1[_i]; - // Exit early for string parts. - if (isLiteralElement(el)) { - result.push({ - type: PART_TYPE.literal, - value: el.value - }); - continue; - } - // TODO: should this part be literal type? - // Replace `#` in plural rules with the actual numeric value. - if (isPoundElement(el)) { - if (typeof currentPluralValue === 'number') { - result.push({ - type: PART_TYPE.literal, - value: formatters.getNumberFormat(locales).format(currentPluralValue) - }); - } - continue; - } - var varName = el.value; - // Enforce that all required values are provided by the caller. - if (!(values && varName in values)) { - throw new MissingValueError(varName, originalMessage); - } - var value = values[varName]; - if (isArgumentElement(el)) { - if (!value || typeof value === 'string' || typeof value === 'number') { - value = typeof value === 'string' || typeof value === 'number' ? String(value) : ''; - } - result.push({ - type: typeof value === 'string' ? PART_TYPE.literal : PART_TYPE.object, - value: value - }); - continue; - } - // Recursively format plural and select parts' option — which can be a - // nested pattern structure. The choosing of the option to use is - // abstracted-by and delegated-to the part helper object. - if (isDateElement(el)) { - var style = typeof el.style === 'string' ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : undefined; - result.push({ - type: PART_TYPE.literal, - value: formatters.getDateTimeFormat(locales, style).format(value) - }); - continue; - } - if (isTimeElement(el)) { - var style = typeof el.style === 'string' ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium; - result.push({ - type: PART_TYPE.literal, - value: formatters.getDateTimeFormat(locales, style).format(value) - }); - continue; - } - if (isNumberElement(el)) { - var style = typeof el.style === 'string' ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : undefined; - if (style && style.scale) { - value = value * (style.scale || 1); - } - result.push({ - type: PART_TYPE.literal, - value: formatters.getNumberFormat(locales, style).format(value) - }); - continue; - } - if (isTagElement(el)) { - var children = el.children, - value_1 = el.value; - var formatFn = values[value_1]; - if (!isFormatXMLElementFn(formatFn)) { - throw new InvalidValueTypeError(value_1, 'function', originalMessage); - } - var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue); - var chunks = formatFn(parts.map(function (p) { - return p.value; - })); - if (!Array.isArray(chunks)) { - chunks = [chunks]; - } - result.push.apply(result, chunks.map(function (c) { - return { - type: typeof c === 'string' ? PART_TYPE.literal : PART_TYPE.object, - value: c - }; - })); - } - if (isSelectElement(el)) { - var opt = el.options[value] || el.options.other; - if (!opt) { - throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); - } - result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values)); - continue; - } - if (isPluralElement(el)) { - var opt = el.options["=".concat(value)]; - if (!opt) { - if (!Intl.PluralRules) { - throw new FormatError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n", ErrorCode.MISSING_INTL_API, originalMessage); - } - var rule = formatters.getPluralRules(locales, { - type: el.pluralType - }).select(value - (el.offset || 0)); - opt = el.options[rule] || el.options.other; - } - if (!opt) { - throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); - } - result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0))); - continue; - } - } - return mergeLiteral(result); -} -;// CONCATENATED MODULE: ../../node_modules/intl-messageformat/lib/src/core.js -/* -Copyright (c) 2014, Yahoo! Inc. All rights reserved. -Copyrights licensed under the New BSD License. -See the accompanying LICENSE file for terms. -*/ - - - - -// -- MessageFormat -------------------------------------------------------- -function mergeConfig(c1, c2) { - if (!c2) { - return c1; - } - return (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, c1 || {}), c2 || {}), Object.keys(c1).reduce(function (all, k) { - all[k] = (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, c1[k]), c2[k] || {}); - return all; - }, {})); -} -function mergeConfigs(defaultConfig, configs) { - if (!configs) { - return defaultConfig; - } - return Object.keys(defaultConfig).reduce(function (all, k) { - all[k] = mergeConfig(defaultConfig[k], configs[k]); - return all; - }, (0,tslib_es6/* __assign */.Cl)({}, defaultConfig)); -} -function createFastMemoizeCache(store) { - return { - create: function create() { - return { - get: function get(key) { - return store[key]; - }, - set: function set(key, value) { - store[key] = value; - } - }; - } - }; -} -function createDefaultFormatters(cache) { - if (cache === void 0) { - cache = { - number: {}, - dateTime: {}, - pluralRules: {} - }; - } - return { - getNumberFormat: (0,lib.memoize)(function () { - var _a; - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return new ((_a = Intl.NumberFormat).bind.apply(_a, (0,tslib_es6/* __spreadArray */.fX)([void 0], args, false)))(); - }, { - cache: createFastMemoizeCache(cache.number), - strategy: lib.strategies.variadic - }), - getDateTimeFormat: (0,lib.memoize)(function () { - var _a; - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return new ((_a = Intl.DateTimeFormat).bind.apply(_a, (0,tslib_es6/* __spreadArray */.fX)([void 0], args, false)))(); - }, { - cache: createFastMemoizeCache(cache.dateTime), - strategy: lib.strategies.variadic - }), - getPluralRules: (0,lib.memoize)(function () { - var _a; - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return new ((_a = Intl.PluralRules).bind.apply(_a, (0,tslib_es6/* __spreadArray */.fX)([void 0], args, false)))(); - }, { - cache: createFastMemoizeCache(cache.pluralRules), - strategy: lib.strategies.variadic - }) - }; -} -var IntlMessageFormat = /** @class */function () { - function IntlMessageFormat(message, locales, overrideFormats, opts) { - var _this = this; - if (locales === void 0) { - locales = IntlMessageFormat.defaultLocale; - } - this.formatterCache = { - number: {}, - dateTime: {}, - pluralRules: {} - }; - this.format = function (values) { - var parts = _this.formatToParts(values); - // Hot path for straight simple msg translations - if (parts.length === 1) { - return parts[0].value; - } - var result = parts.reduce(function (all, part) { - if (!all.length || part.type !== PART_TYPE.literal || typeof all[all.length - 1] !== 'string') { - all.push(part.value); - } else { - all[all.length - 1] += part.value; - } - return all; - }, []); - if (result.length <= 1) { - return result[0] || ''; - } - return result; - }; - this.formatToParts = function (values) { - return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message); - }; - this.resolvedOptions = function () { - var _a; - return { - locale: ((_a = _this.resolvedLocale) === null || _a === void 0 ? void 0 : _a.toString()) || Intl.NumberFormat.supportedLocalesOf(_this.locales)[0] - }; - }; - this.getAst = function () { - return _this.ast; - }; - // Defined first because it's used to build the format pattern. - this.locales = locales; - this.resolvedLocale = IntlMessageFormat.resolveLocale(locales); - if (typeof message === 'string') { - this.message = message; - if (!IntlMessageFormat.__parse) { - throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`'); - } - var _a = opts || {}, - formatters = _a.formatters, - parseOpts = (0,tslib_es6/* __rest */.Tt)(_a, ["formatters"]); - // Parse string messages into an AST. - this.ast = IntlMessageFormat.__parse(message, (0,tslib_es6/* __assign */.Cl)((0,tslib_es6/* __assign */.Cl)({}, parseOpts), { - locale: this.resolvedLocale - })); - } else { - this.ast = message; - } - if (!Array.isArray(this.ast)) { - throw new TypeError('A message must be provided as a String or AST.'); - } - // Creates a new object with the specified `formats` merged with the default - // formats. - this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats); - this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache); - } - Object.defineProperty(IntlMessageFormat, "defaultLocale", { - get: function get() { - if (!IntlMessageFormat.memoizedDefaultLocale) { - IntlMessageFormat.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale; - } - return IntlMessageFormat.memoizedDefaultLocale; - }, - enumerable: false, - configurable: true - }); - IntlMessageFormat.memoizedDefaultLocale = null; - IntlMessageFormat.resolveLocale = function (locales) { - if (typeof Intl.Locale === 'undefined') { - return; - } - var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales); - if (supportedLocales.length > 0) { - return new Intl.Locale(supportedLocales[0]); - } - return new Intl.Locale(typeof locales === 'string' ? locales : locales[0]); - }; - IntlMessageFormat.__parse = parse; - // Default format options used as the prototype of the `formats` provided to the - // constructor. These are used when constructing the internal Intl.NumberFormat - // and Intl.DateTimeFormat instances. - IntlMessageFormat.formats = { - number: { - integer: { - maximumFractionDigits: 0 - }, - currency: { - style: 'currency' - }, - percent: { - style: 'percent' - } - }, - date: { - short: { - month: 'numeric', - day: 'numeric', - year: '2-digit' - }, - medium: { - month: 'short', - day: 'numeric', - year: 'numeric' - }, - long: { - month: 'long', - day: 'numeric', - year: 'numeric' - }, - full: { - weekday: 'long', - month: 'long', - day: 'numeric', - year: 'numeric' - } - }, - time: { - short: { - hour: 'numeric', - minute: 'numeric' - }, - medium: { - hour: 'numeric', - minute: 'numeric', - second: 'numeric' - }, - long: { - hour: 'numeric', - minute: 'numeric', - second: 'numeric', - timeZoneName: 'short' - }, - full: { - hour: 'numeric', - minute: 'numeric', - second: 'numeric', - timeZoneName: 'short' - } - } - }; - return IntlMessageFormat; -}(); - -;// CONCATENATED MODULE: ../../node_modules/intl-messageformat/lib/index.js -/* -Copyright (c) 2014, Yahoo! Inc. All rights reserved. -Copyrights licensed under the New BSD License. -See the accompanying LICENSE file for terms. -*/ - - - - - -/* harmony default export */ var intl_messageformat_lib = (IntlMessageFormat); - -/***/ }), - -/***/ "../../node_modules/react-dom/client.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -var __webpack_unused_export__; - - -var m = __webpack_require__("react-dom"); -if (true) { - exports.H = m.createRoot; - __webpack_unused_export__ = m.hydrateRoot; -} else { var i; } - -/***/ }), - -/***/ "../../node_modules/react/cjs/react-jsx-runtime.production.min.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -/** - * @license React - * react-jsx-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - - -var f = __webpack_require__("react"), - k = Symbol.for("react.element"), - l = Symbol.for("react.fragment"), - m = Object.prototype.hasOwnProperty, - n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, - p = { - key: !0, - ref: !0, - __self: !0, - __source: !0 - }; -function q(c, a, g) { - var b, - d = {}, - e = null, - h = null; - void 0 !== g && (e = "" + g); - void 0 !== a.key && (e = "" + a.key); - void 0 !== a.ref && (h = a.ref); - for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]); - if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]); - return { - $$typeof: k, - type: c, - key: e, - ref: h, - props: d, - _owner: n.current - }; -} -exports.Fragment = l; -exports.jsx = q; -exports.jsxs = q; - -/***/ }), - -/***/ "../../node_modules/react/jsx-runtime.js": -/***/ (function(module, __unused_webpack_exports, __webpack_require__) { - - - -if (true) { - module.exports = __webpack_require__("../../node_modules/react/cjs/react-jsx-runtime.production.min.js"); -} else {} - -/***/ }), - -/***/ "../../node_modules/use-intl/dist/production/IntlContext-DcFt0tgW.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -var t = (__webpack_require__("react").createContext)(void 0); -exports.IntlContext = t; - -/***/ }), - -/***/ "../../node_modules/use-intl/dist/production/_IntlProvider.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } -function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -Object.defineProperty(exports, "__esModule", ({ - value: !0 -})); -var e = __webpack_require__("react"), - r = __webpack_require__("../../node_modules/use-intl/dist/production/initializeConfig-BLiF0aUh.js"), - t = __webpack_require__("../../node_modules/use-intl/dist/production/IntlContext-DcFt0tgW.js"); -function a(e) { - return e && e.__esModule ? e : { - default: e - }; -} -__webpack_require__("../../node_modules/@formatjs/fast-memoize/lib/index.js"), __webpack_require__("../../node_modules/intl-messageformat/lib/index.js"); -var o = a(e); -exports.IntlProvider = function (a) { - var s = a.children, - n = a.defaultTranslationValues, - l = a.formats, - i = a.getMessageFallback, - u = a.locale, - m = a.messages, - f = a.now, - c = a.onError, - d = a.timeZone; - var g = e.useMemo(function () { - return r.createFormatters(); - }, [u]), - v = e.useMemo(function () { - return _objectSpread(_objectSpread({}, r.initializeConfig({ - locale: u, - defaultTranslationValues: n, - formats: l, - getMessageFallback: i, - messages: m, - now: f, - onError: c, - timeZone: d - })), {}, { - formatters: g - }); - }, [n, l, g, i, u, m, f, c, d]); - return o.default.createElement(t.IntlContext.Provider, { - value: v - }, s); -}; - -/***/ }), - -/***/ "../../node_modules/use-intl/dist/production/_useLocale-CpTrqBDt.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -var t = __webpack_require__("react"), - e = __webpack_require__("../../node_modules/use-intl/dist/production/IntlContext-DcFt0tgW.js"); -function r() { - var r = t.useContext(e.IntlContext); - if (!r) throw new Error(void 0); - return r; -} -exports.useIntlContext = r, exports.useLocale = function () { - return r().locale; -}; - -/***/ }), - -/***/ "../../node_modules/use-intl/dist/production/core.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -var _excluded = ["_formatters", "getMessageFallback", "messages", "namespace", "onError"], - _excluded2 = ["messages", "namespace"]; -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } -function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } -function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; } -Object.defineProperty(exports, "__esModule", ({ - value: !0 -})); -var e = __webpack_require__("../../node_modules/use-intl/dist/production/createFormatter-DdXLo8F4.js"), - r = __webpack_require__("../../node_modules/use-intl/dist/production/initializeConfig-BLiF0aUh.js"); -__webpack_require__("react"), __webpack_require__("../../node_modules/intl-messageformat/lib/index.js"), __webpack_require__("../../node_modules/@formatjs/fast-memoize/lib/index.js"), exports.IntlError = e.IntlError, exports.IntlErrorCode = e.IntlErrorCode, exports.createFormatter = e.createFormatter, exports._createFormatters = r.createFormatters, exports.initializeConfig = r.initializeConfig, exports.createTranslator = function (t) { - var _t$_formatters = t._formatters, - a = _t$_formatters === void 0 ? r.createFormatters() : _t$_formatters, - _t$getMessageFallback = t.getMessageFallback, - s = _t$getMessageFallback === void 0 ? r.defaultGetMessageFallback : _t$getMessageFallback, - o = t.messages, - n = t.namespace, - _t$onError = t.onError, - i = _t$onError === void 0 ? r.defaultOnError : _t$onError, - c = _objectWithoutProperties(t, _excluded); - return function (r, t) { - var a = r.messages, - s = r.namespace, - o = _objectWithoutProperties(r, _excluded2); - return a = a[t], s = e.resolveNamespace(s, t), e.createBaseTranslator(_objectSpread(_objectSpread({}, o), {}, { - messages: a, - namespace: s - })); - }(_objectSpread(_objectSpread({}, c), {}, { - onError: i, - formatters: a, - getMessageFallback: s, - messages: { - "!": o - }, - namespace: n ? "!.".concat(n) : "!" - }), "!"); -}; - -/***/ }), - -/***/ "../../node_modules/use-intl/dist/production/createFormatter-DdXLo8F4.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n2 = 0, F = function F() {}; return { s: F, n: function n() { return _n2 >= r.length ? { done: !0 } : { done: !1, value: r[_n2++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } -function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } -function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } -function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } -function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } -function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } -function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } -function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); } -function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; } -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } } -function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } -function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } -var e = __webpack_require__("react"), - t = __webpack_require__("../../node_modules/intl-messageformat/lib/index.js"), - r = __webpack_require__("../../node_modules/use-intl/dist/production/initializeConfig-BLiF0aUh.js"); -function n(e) { - return e && e.__esModule ? e : { - default: e - }; -} -var o = n(t); -function i(e, t, r) { - return (t = function (e) { - var t = function (e, t) { - if ("object" != typeof e || !e) return e; - var r = e[Symbol.toPrimitive]; - if (void 0 !== r) { - var n = r.call(e, t || "default"); - if ("object" != typeof n) return n; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return ("string" === t ? String : Number)(e); - }(e, "string"); - return "symbol" == typeof t ? t : t + ""; - }(t)) in e ? Object.defineProperty(e, t, { - value: r, - enumerable: !0, - configurable: !0, - writable: !0 - }) : e[t] = r, e; -} -var a = function (e) { - return e.MISSING_MESSAGE = "MISSING_MESSAGE", e.MISSING_FORMAT = "MISSING_FORMAT", e.ENVIRONMENT_FALLBACK = "ENVIRONMENT_FALLBACK", e.INSUFFICIENT_PATH = "INSUFFICIENT_PATH", e.INVALID_MESSAGE = "INVALID_MESSAGE", e.INVALID_KEY = "INVALID_KEY", e.FORMATTING_ERROR = "FORMATTING_ERROR", e; -}({}); -var s = /*#__PURE__*/function (_Error) { - function s(e, t) { - var _this; - _classCallCheck(this, s); - var r = e; - t && (r += ": " + t), _this = _callSuper(this, s, [r]), i(_assertThisInitialized(_this), "code", void 0), i(_assertThisInitialized(_this), "originalMessage", void 0), _this.code = e, t && (_this.originalMessage = t); - return _this; - } - _inherits(s, _Error); - return _createClass(s); -}( /*#__PURE__*/_wrapNativeSuper(Error)); -function u(e, t) { - return e ? Object.keys(e).reduce(function (r, n) { - return r[n] = _objectSpread({ - timeZone: t - }, e[n]), r; - }, {}) : e; -} -function c(e, t, n, o) { - var i = r.joinPath(o, n); - if (!t) throw new Error(i); - var a = t; - return n.split(".").forEach(function (t) { - var r = a[t]; - if (null == t || null == r) throw new Error(i + " (".concat(e, ")")); - a = r; - }), a; -} -var l = 60, - m = 60 * l, - f = 24 * m, - E = 7 * f, - d = f * (365 / 12), - g = 3 * d, - I = 365 * f, - S = { - second: 1, - seconds: 1, - minute: l, - minutes: l, - hour: m, - hours: m, - day: f, - days: f, - week: E, - weeks: E, - month: d, - months: d, - quarter: g, - quarters: g, - year: I, - years: I - }; -exports.IntlError = s, exports.IntlErrorCode = a, exports.createBaseTranslator = function (t) { - var n = function (e, t, n) { - var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : r.defaultOnError; - try { - if (!t) throw new Error(void 0); - var _r = n ? c(e, t, n) : t; - if (!_r) throw new Error(n); - return _r; - } catch (e) { - var _t = new s(a.MISSING_MESSAGE, e.message); - return o(_t), _t; - } - }(t.locale, t.messages, t.namespace, t.onError); - return function (t) { - var n = t.defaultTranslationValues, - i = t.formats, - l = t.formatters, - _t$getMessageFallback = t.getMessageFallback, - m = _t$getMessageFallback === void 0 ? r.defaultGetMessageFallback : _t$getMessageFallback, - f = t.locale, - E = t.messagesOrError, - d = t.namespace, - g = t.onError, - I = t.timeZone; - function S(e, t, r) { - var n = new s(t, r); - return g(n), m({ - error: n, - key: e, - namespace: d - }); - } - function y(t, r, g) { - if (E instanceof s) return m({ - error: E, - key: t, - namespace: d - }); - var y = E; - var T, N; - try { - T = c(f, y, t, d); - } catch (e) { - return S(t, a.MISSING_MESSAGE, e.message); - } - if ("object" == typeof T) { - var _e, _r2; - return _e = Array.isArray(T) ? a.INVALID_MESSAGE : a.INSUFFICIENT_PATH, S(t, _e, _r2); - } - var A = function (e, t) { - if (t) return; - var r = e.replace(/'([{}])/gi, "$1"); - return /<|{/.test(r) ? void 0 : r; - }(T, r); - if (A) return A; - try { - N = l.getMessageFormat(T, f, function (e, t) { - var r = t ? _objectSpread(_objectSpread({}, e), {}, { - dateTime: u(e.dateTime, t) - }) : e, - n = o.default.formats.date, - i = t ? u(n, t) : n, - a = o.default.formats.time, - s = t ? u(a, t) : a; - return _objectSpread(_objectSpread({}, r), {}, { - date: _objectSpread(_objectSpread({}, i), null == r ? void 0 : r.dateTime), - time: _objectSpread(_objectSpread({}, s), null == r ? void 0 : r.dateTime) - }); - }(_objectSpread(_objectSpread({}, i), g), I), { - formatters: _objectSpread(_objectSpread({}, l), {}, { - getDateTimeFormat: function getDateTimeFormat(e, t) { - return l.getDateTimeFormat(e, _objectSpread({ - timeZone: I - }, t)); - } - }) - }); - } catch (e) { - var _r3 = e; - return S(t, a.INVALID_MESSAGE, _r3.message); - } - try { - var _t2 = N.format(function (t) { - if (0 === Object.keys(t).length) return; - var r = {}; - return Object.keys(t).forEach(function (n) { - var o = 0; - var i = t[n]; - var a; - a = "function" == typeof i ? function (t) { - var r = i(t); - return e.isValidElement(r) ? e.cloneElement(r, { - key: n + o++ - }) : r; - } : i, r[n] = a; - }), r; - }(_objectSpread(_objectSpread({}, n), r))); - if (null == _t2) throw new Error(void 0); - return e.isValidElement(_t2) || Array.isArray(_t2) || "string" == typeof _t2 ? _t2 : String(_t2); - } catch (e) { - return S(t, a.FORMATTING_ERROR, e.message); - } - } - function T(e, t, r) { - var n = y(e, t, r); - return "string" != typeof n ? S(e, a.INVALID_MESSAGE, void 0) : n; - } - return T.rich = y, T.markup = function (e, t, r) { - var n = y(e, t, r); - if ("string" != typeof n) { - var _t3 = new s(a.FORMATTING_ERROR, void 0); - return g(_t3), m({ - error: _t3, - key: e, - namespace: d - }); - } - return n; - }, T.raw = function (e) { - if (E instanceof s) return m({ - error: E, - key: e, - namespace: d - }); - var t = E; - try { - return c(f, t, e, d); - } catch (t) { - return S(e, a.MISSING_MESSAGE, t.message); - } - }, T; - }(_objectSpread(_objectSpread({}, t), {}, { - messagesOrError: n - })); -}, exports.createFormatter = function (e) { - var _e$_formatters = e._formatters, - t = _e$_formatters === void 0 ? r.createFormatters() : _e$_formatters, - n = e.formats, - o = e.locale, - i = e.now, - _e$onError = e.onError, - u = _e$onError === void 0 ? r.defaultOnError : _e$onError, - c = e.timeZone; - function g(e) { - var t; - return null !== (t = e) && void 0 !== t && t.timeZone || (c ? e = _objectSpread(_objectSpread({}, e), {}, { - timeZone: c - }) : u(new s(a.ENVIRONMENT_FALLBACK, void 0))), e; - } - function y(e, t, r, n) { - var o; - try { - o = function (e, t) { - var r; - if ("string" == typeof t) { - if (r = null == e ? void 0 : e[t], !r) { - var _e2 = new s(a.MISSING_FORMAT, void 0); - throw u(_e2), _e2; - } - } else r = t; - return r; - }(t, e); - } catch (e) { - return n(); - } - try { - return r(o); - } catch (e) { - return u(new s(a.FORMATTING_ERROR, e.message)), n(); - } - } - function T(e, r) { - return y(r, null == n ? void 0 : n.dateTime, function (r) { - return r = g(r), t.getDateTimeFormat(o, r).format(e); - }, function () { - return String(e); - }); - } - function N() { - return i || (u(new s(a.ENVIRONMENT_FALLBACK, void 0)), new Date()); - } - return { - dateTime: T, - number: function number(e, r) { - return y(r, null == n ? void 0 : n.number, function (r) { - return t.getNumberFormat(o, r).format(e); - }, function () { - return String(e); - }); - }, - relativeTime: function relativeTime(e, r) { - try { - var _n, _i; - var _a = {}; - r instanceof Date || "number" == typeof r ? _n = new Date(r) : r && (_n = null != r.now ? new Date(r.now) : N(), _i = r.unit, _a.style = r.style, _a.numberingSystem = r.numberingSystem), _n || (_n = N()); - var _s = (new Date(e).getTime() - _n.getTime()) / 1e3; - _i || (_i = function (e) { - var t = Math.abs(e); - return t < l ? "second" : t < m ? "minute" : t < f ? "hour" : t < E ? "day" : t < d ? "week" : t < I ? "month" : "year"; - }(_s)), _a.numeric = "second" === _i ? "auto" : "always"; - var _u = function (e, t) { - return Math.round(e / S[t]); - }(_s, _i); - return t.getRelativeTimeFormat(o, _a).format(_u, _i); - } catch (t) { - return u(new s(a.FORMATTING_ERROR, t.message)), String(e); - } - }, - list: function list(e, r) { - var i = [], - a = new Map(); - var s = 0; - var _iterator = _createForOfIteratorHelper(e), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var _t4 = _step.value; - var _e3 = void 0; - "object" == typeof _t4 ? (_e3 = String(s), a.set(_e3, _t4)) : _e3 = String(_t4), i.push(_e3), s++; - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - return y(r, null == n ? void 0 : n.list, function (e) { - var r = t.getListFormat(o, e).formatToParts(i).map(function (e) { - return "literal" === e.type ? e.value : a.get(e.value) || e.value; - }); - return a.size > 0 ? r : r.join(""); - }, function () { - return String(e); - }); - }, - dateTimeRange: function dateTimeRange(e, r, i) { - return y(i, null == n ? void 0 : n.dateTime, function (n) { - return n = g(n), t.getDateTimeFormat(o, n).formatRange(e, r); - }, function () { - return [T(e), T(r)].join(" – "); - }); - } - }; -}, exports.resolveNamespace = function (e, t) { - return e === t ? void 0 : e.slice((t + ".").length); -}; - -/***/ }), - -/***/ "../../node_modules/use-intl/dist/production/index.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -var __webpack_unused_export__; - - -__webpack_unused_export__ = ({ - value: !0 -}); -var e = __webpack_require__("../../node_modules/use-intl/dist/production/createFormatter-DdXLo8F4.js"), - r = __webpack_require__("../../node_modules/use-intl/dist/production/core.js"), - t = __webpack_require__("../../node_modules/use-intl/dist/production/initializeConfig-BLiF0aUh.js"), - s = __webpack_require__("../../node_modules/use-intl/dist/production/_IntlProvider.js"), - o = __webpack_require__("../../node_modules/use-intl/dist/production/react.js"), - a = __webpack_require__("../../node_modules/use-intl/dist/production/_useLocale-CpTrqBDt.js"); -__webpack_require__("react"), __webpack_require__("../../node_modules/intl-messageformat/lib/index.js"), __webpack_require__("../../node_modules/@formatjs/fast-memoize/lib/index.js"), __webpack_require__("../../node_modules/use-intl/dist/production/IntlContext-DcFt0tgW.js"), __webpack_unused_export__ = e.IntlError, __webpack_unused_export__ = e.IntlErrorCode, __webpack_unused_export__ = e.createFormatter, __webpack_unused_export__ = r.createTranslator, __webpack_unused_export__ = t.createFormatters, __webpack_unused_export__ = t.initializeConfig, exports.Dk = s.IntlProvider, exports.kc = o.useFormatter, __webpack_unused_export__ = o.useMessages, exports.cB = o.useNow, exports.pH = o.useTimeZone, exports.c3 = o.useTranslations, __webpack_unused_export__ = a.useLocale; - -/***/ }), - -/***/ "../../node_modules/use-intl/dist/production/initializeConfig-BLiF0aUh.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -var _excluded = ["getMessageFallback", "messages", "onError"]; -function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; } -function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; } -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } -function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; } -function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -var e = __webpack_require__("../../node_modules/@formatjs/fast-memoize/lib/index.js"); -function t(e) { - return e && e.__esModule ? e : { - default: e - }; -} -var r = t(__webpack_require__("../../node_modules/intl-messageformat/lib/index.js")); -function a() { - for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++) t[r] = arguments[r]; - return t.filter(Boolean).join("."); -} -function n(e) { - return a(e.namespace, e.key); -} -function s(e) { - console.error(e); -} -function l(t, r) { - return e.memoize(t, { - cache: (a = r, { - create: function create() { - return { - get: function get(e) { - return a[e]; - }, - set: function set(e, t) { - a[e] = t; - } - }; - } - }), - strategy: e.strategies.variadic - }); - var a; -} -function o(e, t) { - return l(function () { - for (var t = arguments.length, r = new Array(t), a = 0; a < t; a++) r[a] = arguments[a]; - return _construct(e, r); - }, t); -} -exports.createFormatters = function () { - var e = { - dateTime: {}, - number: {}, - message: {}, - relativeTime: {}, - pluralRules: {}, - list: {}, - displayNames: {} - }, - t = o(Intl.DateTimeFormat, e.dateTime), - a = o(Intl.NumberFormat, e.number), - n = o(Intl.PluralRules, e.pluralRules), - s = o(Intl.RelativeTimeFormat, e.relativeTime), - i = o(Intl.ListFormat, e.list), - m = o(Intl.DisplayNames, e.displayNames), - u = l(function () { - return new r.default(arguments.length <= 0 ? void 0 : arguments[0], arguments.length <= 1 ? void 0 : arguments[1], arguments.length <= 2 ? void 0 : arguments[2], _objectSpread({ - formatters: { - getNumberFormat: a, - getDateTimeFormat: t, - getPluralRules: n - } - }, arguments.length <= 3 ? void 0 : arguments[3])); - }, e.message); - return { - getDateTimeFormat: t, - getNumberFormat: a, - getPluralRules: n, - getMessageFormat: u, - getRelativeTimeFormat: s, - getListFormat: i, - getDisplayNames: m - }; -}, exports.defaultGetMessageFallback = n, exports.defaultOnError = s, exports.initializeConfig = function (e) { - var t = e.getMessageFallback, - r = e.messages, - a = e.onError, - l = _objectWithoutProperties(e, _excluded); - return _objectSpread(_objectSpread({}, l), {}, { - messages: r, - onError: a || s, - getMessageFallback: t || n - }); -}, exports.joinPath = a; - -/***/ }), - -/***/ "../../node_modules/use-intl/dist/production/react.js": -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - - -function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } -function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } -function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } -function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } -Object.defineProperty(exports, "__esModule", ({ - value: !0 -})); -var e = __webpack_require__("../../node_modules/use-intl/dist/production/_IntlProvider.js"), - t = __webpack_require__("../../node_modules/use-intl/dist/production/_useLocale-CpTrqBDt.js"), - r = __webpack_require__("react"), - o = __webpack_require__("../../node_modules/use-intl/dist/production/createFormatter-DdXLo8F4.js"); -__webpack_require__("../../node_modules/use-intl/dist/production/initializeConfig-BLiF0aUh.js"), __webpack_require__("../../node_modules/@formatjs/fast-memoize/lib/index.js"), __webpack_require__("../../node_modules/intl-messageformat/lib/index.js"), __webpack_require__("../../node_modules/use-intl/dist/production/IntlContext-DcFt0tgW.js"); -var n = !1; -var s = "undefined" == typeof window; -function a() { - return new Date(); -} -exports.IntlProvider = e.IntlProvider, exports.useLocale = t.useLocale, exports.useFormatter = function () { - var _t$useIntlContext = t.useIntlContext(), - e = _t$useIntlContext.formats, - n = _t$useIntlContext.formatters, - s = _t$useIntlContext.locale, - a = _t$useIntlContext.now, - u = _t$useIntlContext.onError, - l = _t$useIntlContext.timeZone; - return r.useMemo(function () { - return o.createFormatter({ - formats: e, - locale: s, - now: a, - onError: u, - timeZone: l, - _formatters: n - }); - }, [e, n, a, s, u, l]); -}, exports.useMessages = function () { - var e = t.useIntlContext(); - if (!e.messages) throw new Error(void 0); - return e.messages; -}, exports.useNow = function (e) { - var o = null == e ? void 0 : e.updateInterval, - _t$useIntlContext2 = t.useIntlContext(), - n = _t$useIntlContext2.now, - _r$useState = r.useState(n || a()), - _r$useState2 = _slicedToArray(_r$useState, 2), - s = _r$useState2[0], - u = _r$useState2[1]; - return r.useEffect(function () { - if (!o) return; - var e = setInterval(function () { - u(a()); - }, o); - return function () { - clearInterval(e); - }; - }, [n, o]), null == o && n ? n : s; -}, exports.useTimeZone = function () { - return t.useIntlContext().timeZone; -}, exports.useTranslations = function (e) { - return function (e, a, u) { - var _t$useIntlContext3 = t.useIntlContext(), - l = _t$useIntlContext3.defaultTranslationValues, - i = _t$useIntlContext3.formats, - c = _t$useIntlContext3.formatters, - m = _t$useIntlContext3.getMessageFallback, - f = _t$useIntlContext3.locale, - I = _t$useIntlContext3.onError, - d = _t$useIntlContext3.timeZone; - return e = e[u], a = o.resolveNamespace(a, u), d || n || !s || (n = !0, I(new o.IntlError(o.IntlErrorCode.ENVIRONMENT_FALLBACK, void 0))), r.useMemo(function () { - return o.createBaseTranslator({ - formatters: c, - getMessageFallback: m, - messages: e, - defaultTranslationValues: l, - namespace: a, - onError: I, - formats: i, - locale: f, - timeZone: d - }); - }, [c, m, e, l, a, I, i, f, d]); - }({ - "!": t.useIntlContext().messages - }, e ? "!.".concat(e) : "!", "!"); -}; - -/***/ }), - -/***/ "react": -/***/ (function(module) { - -module.exports = React; - -/***/ }), - -/***/ "react-dom": -/***/ (function(module) { - -module.exports = ReactDOM; - -/***/ }), - -/***/ "../../node_modules/tslib/tslib.es6.mjs": -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { - -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ C6: function() { return /* binding */ __extends; }, -/* harmony export */ Cg: function() { return /* binding */ __decorate; }, -/* harmony export */ Cl: function() { return /* binding */ _assign; }, -/* harmony export */ Tt: function() { return /* binding */ __rest; }, -/* harmony export */ fX: function() { return /* binding */ __spreadArray; } -/* harmony export */ }); -/* unused harmony exports __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources */ -/****************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise, SuppressedError, Symbol */ - -var _extendStatics = function extendStatics(d, b) { - _extendStatics = Object.setPrototypeOf || { - __proto__: [] - } instanceof Array && function (d, b) { - d.__proto__ = b; - } || function (d, b) { - for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; - }; - return _extendStatics(d, b); -}; -function __extends(d, b) { - if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - _extendStatics(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -var _assign = function __assign() { - _assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return _assign.apply(this, arguments); -}; - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; - } - return t; -} -function __decorate(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} -function __param(paramIndex, decorator) { - return function (target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { - function accept(f) { - if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); - return f; - } - var kind = contextIn.kind, - key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; - var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; - var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); - var _, - done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context = {}; - for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context.access[p] = contextIn.access[p]; - context.addInitializer = function (f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); - }; - var result = (0, decorators[i])(kind === "accessor" ? { - get: descriptor.get, - set: descriptor.set - } : descriptor[key], context); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_);else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -; -function __runInitializers(thisArg, initializers, value) { - var useValue = arguments.length > 2; - for (var i = 0; i < initializers.length; i++) { - value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); - } - return useValue ? value : void 0; -} -; -function __propKey(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -; -function __setFunctionName(f, name, prefix) { - if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; - return Object.defineProperty(f, "name", { - configurable: true, - value: prefix ? "".concat(prefix, " ", name) : name - }); -} -; -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function (resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { - label: 0, - sent: function sent() { - if (t[0] & 1) throw t[1]; - return t[1]; - }, - trys: [], - ops: [] - }, - f, - y, - t, - g; - return g = { - next: verb(0), - "throw": verb(1), - "return": verb(2) - }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { - return this; - }), g; - function verb(n) { - return function (v) { - return step([n, v]); - }; - } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: - case 1: - t = op; - break; - case 4: - _.label++; - return { - value: op[1], - done: false - }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } catch (e) { - op = [6, e]; - y = 0; - } finally { - f = t = 0; - } - if (op[0] & 5) throw op[1]; - return { - value: op[0] ? op[1] : void 0, - done: true - }; - } -} -var __createBinding = Object.create ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function get() { - return m[k]; - } - }; - } - Object.defineProperty(o, k2, desc); -} : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}; -function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, - m = s && o[s], - i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function next() { - if (o && i >= o.length) o = void 0; - return { - value: o && o[i++], - done: !o - }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), - r, - ar = [], - e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } catch (error) { - e = { - error: error - }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} - -/** @deprecated */ -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; - return r; -} -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), - i, - q = []; - return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { - return this; - }, i; - function awaitReturn(f) { - return function (v) { - return Promise.resolve(v).then(f, reject); - }; - } - function verb(n, f) { - if (g[n]) { - i[n] = function (v) { - return new Promise(function (a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; - if (f) i[n] = f(i[n]); - } - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); - } - function fulfill(value) { - resume("next", value); - } - function reject(value) { - resume("throw", value); - } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); - } -} -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { - throw e; - }), verb("return"), i[Symbol.iterator] = function () { - return this; - }, i; - function verb(n, f) { - i[n] = o[n] ? function (v) { - return (p = !p) ? { - value: __await(o[n](v)), - done: false - } : f ? f(v) : v; - } : f; - } -} -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], - i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { - return this; - }, i); - function verb(n) { - i[n] = o[n] && function (v) { - return new Promise(function (resolve, reject) { - v = o[n](v), settle(resolve, reject, v.done, v.value); - }); - }; - } - function settle(resolve, reject, d, v) { - Promise.resolve(v).then(function (v) { - resolve({ - value: v, - done: d - }); - }, reject); - } -} -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { - value: raw - }); - } else { - cooked.raw = raw; - } - return cooked; -} -; -var __setModuleDefault = Object.create ? function (o, v) { - Object.defineProperty(o, "default", { - enumerable: true, - value: v - }); -} : function (o, v) { - o["default"] = v; -}; -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} -function __importDefault(mod) { - return mod && mod.__esModule ? mod : { - default: mod - }; -} -function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} -function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; -} -function __classPrivateFieldIn(state, receiver) { - if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); -} -function __addDisposableResource(env, value, async) { - if (value !== null && value !== void 0) { - if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); - var dispose, inner; - if (async) { - if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); - dispose = value[Symbol.asyncDispose]; - } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; - } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function dispose() { - try { - inner.call(this); - } catch (e) { - return Promise.reject(e); - } - }; - env.stack.push({ - value: value, - dispose: dispose, - async: async - }); - } else if (async) { - env.stack.push({ - async: true - }); - } - return value; -} -var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; -}; -function __disposeResources(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - function next() { - while (env.stack.length) { - var rec = env.stack.pop(); - try { - var result = rec.dispose && rec.dispose.call(rec.value); - if (rec.async) return Promise.resolve(result).then(next, function (e) { - fail(e); - return next(); - }); - } catch (e) { - fail(e); - } - } - if (env.hasError) throw env.error; - } - return next(); -} -/* unused harmony default export */ var __WEBPACK_DEFAULT_EXPORT__ = ({ - __extends: __extends, - __assign: _assign, - __rest: __rest, - __decorate: __decorate, - __param: __param, - __metadata: __metadata, - __awaiter: __awaiter, - __generator: __generator, - __createBinding: __createBinding, - __exportStar: __exportStar, - __values: __values, - __read: __read, - __spread: __spread, - __spreadArrays: __spreadArrays, - __spreadArray: __spreadArray, - __await: __await, - __asyncGenerator: __asyncGenerator, - __asyncDelegator: __asyncDelegator, - __asyncValues: __asyncValues, - __makeTemplateObject: __makeTemplateObject, - __importStar: __importStar, - __importDefault: __importDefault, - __classPrivateFieldGet: __classPrivateFieldGet, - __classPrivateFieldSet: __classPrivateFieldSet, - __classPrivateFieldIn: __classPrivateFieldIn, - __addDisposableResource: __addDisposableResource, - __disposeResources: __disposeResources -}); - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = __webpack_modules__; -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/create fake namespace object */ -/******/ !function() { -/******/ var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__; }; -/******/ var leafPrototypes; -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 16: return value when it's Promise-like -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = this(value); -/******/ if(mode & 8) return value; -/******/ if(typeof value === 'object' && value) { -/******/ if((mode & 4) && value.__esModule) return value; -/******/ if((mode & 16) && typeof value.then === 'function') return value; -/******/ } -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ var def = {}; -/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; -/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { -/******/ Object.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; }; }); -/******/ } -/******/ def['default'] = function() { return value; }; -/******/ __webpack_require__.d(ns, def); -/******/ return ns; -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/define property getters */ -/******/ !function() { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = function(exports, definition) { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/ensure chunk */ -/******/ !function() { -/******/ __webpack_require__.f = {}; -/******/ // This file contains only the entry chunk. -/******/ // The chunk loading function for additional chunks -/******/ __webpack_require__.e = function(chunkId) { -/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) { -/******/ __webpack_require__.f[key](chunkId, promises); -/******/ return promises; -/******/ }, [])); -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/get javascript chunk filename */ -/******/ !function() { -/******/ // This function allow to reference async chunks -/******/ __webpack_require__.u = function(chunkId) { -/******/ // return url for filenames based on template -/******/ return "" + chunkId + "." + "065303b29a7906699f56" + ".js"; -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/get mini-css chunk filename */ -/******/ !function() { -/******/ // This function allow to reference async chunks -/******/ __webpack_require__.miniCssF = function(chunkId) { -/******/ // return url for filenames based on template -/******/ return undefined; -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/global */ -/******/ !function() { -/******/ __webpack_require__.g = (function() { -/******/ if (typeof globalThis === 'object') return globalThis; -/******/ try { -/******/ return this || new Function('return this')(); -/******/ } catch (e) { -/******/ if (typeof window === 'object') return window; -/******/ } -/******/ })(); -/******/ }(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ !function() { -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } -/******/ }(); -/******/ -/******/ /* webpack/runtime/load script */ -/******/ !function() { -/******/ var inProgress = {}; -/******/ var dataWebpackPrefix = "webviews:"; -/******/ // loadScript function to load a script via script tag -/******/ __webpack_require__.l = function(url, done, key, chunkId) { -/******/ if(inProgress[url]) { inProgress[url].push(done); return; } -/******/ var script, needAttach; -/******/ if(key !== undefined) { -/******/ var scripts = document.getElementsByTagName("script"); -/******/ for(var i = 0; i < scripts.length; i++) { -/******/ var s = scripts[i]; -/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; } -/******/ } -/******/ } -/******/ if(!script) { -/******/ needAttach = true; -/******/ script = document.createElement('script'); -/******/ -/******/ script.charset = 'utf-8'; -/******/ script.timeout = 120; -/******/ if (__webpack_require__.nc) { -/******/ script.setAttribute("nonce", __webpack_require__.nc); -/******/ } -/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key); -/******/ -/******/ script.src = url; -/******/ } -/******/ inProgress[url] = [done]; -/******/ var onScriptComplete = function(prev, event) { -/******/ // avoid mem leaks in IE. -/******/ script.onerror = script.onload = null; -/******/ clearTimeout(timeout); -/******/ var doneFns = inProgress[url]; -/******/ delete inProgress[url]; -/******/ script.parentNode && script.parentNode.removeChild(script); -/******/ doneFns && doneFns.forEach(function(fn) { return fn(event); }); -/******/ if(prev) return prev(event); -/******/ } -/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); -/******/ script.onerror = onScriptComplete.bind(null, script.onerror); -/******/ script.onload = onScriptComplete.bind(null, script.onload); -/******/ needAttach && document.head.appendChild(script); -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ !function() { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ }(); -/******/ -/******/ /* webpack/runtime/publicPath */ -/******/ !function() { -/******/ var scriptUrl; -/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; -/******/ var document = __webpack_require__.g.document; -/******/ if (!scriptUrl && document) { -/******/ if (document.currentScript) -/******/ scriptUrl = document.currentScript.src; -/******/ if (!scriptUrl) { -/******/ var scripts = document.getElementsByTagName("script"); -/******/ if(scripts.length) { -/******/ var i = scripts.length - 1; -/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; -/******/ } -/******/ } -/******/ } -/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration -/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic. -/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); -/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); -/******/ __webpack_require__.p = scriptUrl + "../"; -/******/ }(); -/******/ -/******/ /* webpack/runtime/compat */ -/******/ // Dynamic assets path override(`@flatjs/evolve`) plugin-multi-html-cdn`) -/******/ -/******/ (function () { -/******/ var flatjsMultiCdn = { -/******/ cdnConfig: {"me":["http://localhost:8000/public/"],"rc":["https://file.40017.cn/jinfu/"],"prod":["./"],"ntv":["https://file.40017.cn/jinfu/"]}, -/******/ cdnResolver: function envResolver() { -/******/ return ~location.href.indexOf('localhost') ? 'me' : undefined; -/******/ }, -/******/ cdnFinder: function cdnFinder(cdnConfig, envResolver) { -/******/ const regex = /[?&]env(=([^&#]*)|&|#|$)/; -/******/ const locationHref = window.location.href; -/******/ const results = regex.exec(locationHref); -/******/ let env = results && results[2] -/******/ ? decodeURIComponent(results[2].replace(/\+/g, ' ')) -/******/ : 'prod'; -/******/ // If we have customized cdn resolver using it first. -/******/ env = (envResolver && envResolver(locationHref)) || env; -/******/ const matchedCdnList = cdnConfig[env] || cdnConfig['prod'] || []; -/******/ const matchedCdn = matchedCdnList[Math.floor(Math.random() * matchedCdnList.length)]; -/******/ // ensure has endfix slash -/******/ return matchedCdn.replace(/\/$/, '') + '/'; -/******/ } -/******/ }; -/******/ var runtimeCDNBase = flatjsMultiCdn.cdnFinder(flatjsMultiCdn.cdnConfig, flatjsMultiCdn.cdnResolver); -/******/ window.$evolve = window.$evolve || {}; -/******/ window.$evolve.runtimeCDNBase=runtimeCDNBase; -/******/ -/******/ __webpack_require__.p = runtimeCDNBase || __webpack_require__.p; -/******/ })(); -/******/ -/******/ /* webpack/runtime/jsonp chunk loading */ -/******/ !function() { -/******/ // no baseURI -/******/ -/******/ // object to store loaded and loading chunks -/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched -/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded -/******/ var installedChunks = { -/******/ "dashboard": 0 -/******/ }; -/******/ -/******/ __webpack_require__.f.j = function(chunkId, promises) { -/******/ // JSONP chunk loading for javascript -/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; -/******/ if(installedChunkData !== 0) { // 0 means "already installed". -/******/ -/******/ // a Promise means "currently loading". -/******/ if(installedChunkData) { -/******/ promises.push(installedChunkData[2]); -/******/ } else { -/******/ if(true) { // all chunks have JS -/******/ // setup Promise in chunk cache -/******/ var promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; }); -/******/ promises.push(installedChunkData[2] = promise); -/******/ -/******/ // start chunk loading -/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); -/******/ // create error before stack unwound to get useful stacktrace later -/******/ var error = new Error(); -/******/ var loadingEnded = function(event) { -/******/ if(__webpack_require__.o(installedChunks, chunkId)) { -/******/ installedChunkData = installedChunks[chunkId]; -/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; -/******/ if(installedChunkData) { -/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); -/******/ var realSrc = event && event.target && event.target.src; -/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; -/******/ error.name = 'ChunkLoadError'; -/******/ error.type = errorType; -/******/ error.request = realSrc; -/******/ installedChunkData[1](error); -/******/ } -/******/ } -/******/ }; -/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); -/******/ } -/******/ } -/******/ } -/******/ }; -/******/ -/******/ // no prefetching -/******/ -/******/ // no preloaded -/******/ -/******/ // no HMR -/******/ -/******/ // no HMR manifest -/******/ -/******/ // no on chunks loaded -/******/ -/******/ // install a JSONP callback for chunk loading -/******/ var webpackJsonpCallback = function(parentChunkLoadingFunction, data) { -/******/ var chunkIds = data[0]; -/******/ var moreModules = data[1]; -/******/ var runtime = data[2]; -/******/ // add "moreModules" to the modules object, -/******/ // then flag all "chunkIds" as loaded and fire callback -/******/ var moduleId, chunkId, i = 0; -/******/ if(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) { -/******/ for(moduleId in moreModules) { -/******/ if(__webpack_require__.o(moreModules, moduleId)) { -/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; -/******/ } -/******/ } -/******/ if(runtime) var result = runtime(__webpack_require__); -/******/ } -/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); -/******/ for(;i < chunkIds.length; i++) { -/******/ chunkId = chunkIds[i]; -/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { -/******/ installedChunks[chunkId][0](); -/******/ } -/******/ installedChunks[chunkId] = 0; -/******/ } -/******/ -/******/ } -/******/ -/******/ var chunkLoadingGlobal = self["webpackChunkwebviews"] = self["webpackChunkwebviews"] || []; -/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); -/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); -/******/ }(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; - -// EXTERNAL MODULE: ../../node_modules/react-dom/client.js -var client = __webpack_require__("../../node_modules/react-dom/client.js"); -// EXTERNAL MODULE: external "React" -var external_React_ = __webpack_require__("react"); -// EXTERNAL MODULE: ../../node_modules/react/jsx-runtime.js -var jsx_runtime = __webpack_require__("../../node_modules/react/jsx-runtime.js"); -;// CONCATENATED MODULE: ./src/components/FileInspector/FileInspector.tsx -function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } -function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } -function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } -function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } - - - - -var FileInspector = function FileInspector() { - var _useState = useState(false), - _useState2 = _slicedToArray(_useState, 2), - active = _useState2[0], - setActive = _useState2[1]; - return /*#__PURE__*/_jsx(Inspector, { - active: active, - onActiveChange: setActive, - onInspectElement: gotoServerEditor, - children: /*#__PURE__*/_jsx("div", { - className: "mx-auto max-w-2xl", - children: /*#__PURE__*/_jsx("div", { - className: "text-center", - children: /*#__PURE__*/_jsxs("div", { - className: "mt-8 flex flex-col items-center justify-center gap-x-6", - children: [/*#__PURE__*/_jsx("div", { - className: "mb-2 mt-6 text-[min(4.5vw,1rem)] font-light leading-[min(6vw,1.75rem)] text-gray-600 sm:text-lg", - children: "try shortcuts or click \u2193" - }), /*#__PURE__*/_jsxs("button", { - className: "group flex items-center text-[min(4vw,.875rem)] leading-[min(5vw,1.25rem)] sm:text-base", - onClick: function onClick() { - return setActive(true); - }, - children: [/*#__PURE__*/_jsx("span", { - children: "Ctrl + Shift + Command + C" - }), /*#__PURE__*/_jsx("span", { - className: "ml-1", - children: "\uD83C\uDF6D" - })] - })] - }) - }) - }) - }); -}; -;// CONCATENATED MODULE: ../../node_modules/tailwind-merge/dist/bundle-mjs.mjs -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } -function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function bundle_mjs_slicedToArray(r, e) { return bundle_mjs_arrayWithHoles(r) || bundle_mjs_iterableToArrayLimit(r, e) || bundle_mjs_unsupportedIterableToArray(r, e) || bundle_mjs_nonIterableRest(); } -function bundle_mjs_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function bundle_mjs_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } -function bundle_mjs_arrayWithHoles(r) { if (Array.isArray(r)) return r; } -function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || bundle_mjs_unsupportedIterableToArray(r) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function bundle_mjs_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return bundle_mjs_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? bundle_mjs_arrayLikeToArray(r, a) : void 0; } } -function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } -function _arrayWithoutHoles(r) { if (Array.isArray(r)) return bundle_mjs_arrayLikeToArray(r); } -function bundle_mjs_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } -var CLASS_PART_SEPARATOR = '-'; -function createClassGroupUtils(config) { - var classMap = createClassMap(config); - var conflictingClassGroups = config.conflictingClassGroups, - conflictingClassGroupModifiers = config.conflictingClassGroupModifiers; - function getClassGroupId(className) { - var classParts = className.split(CLASS_PART_SEPARATOR); - // Classes like `-inset-1` produce an empty string as first classPart. We assume that classes for negative values are used correctly and remove it from classParts. - if (classParts[0] === '' && classParts.length !== 1) { - classParts.shift(); - } - return getGroupRecursive(classParts, classMap) || getGroupIdForArbitraryProperty(className); - } - function getConflictingClassGroupIds(classGroupId, hasPostfixModifier) { - var conflicts = conflictingClassGroups[classGroupId] || []; - if (hasPostfixModifier && conflictingClassGroupModifiers[classGroupId]) { - return [].concat(_toConsumableArray(conflicts), _toConsumableArray(conflictingClassGroupModifiers[classGroupId])); - } - return conflicts; - } - return { - getClassGroupId: getClassGroupId, - getConflictingClassGroupIds: getConflictingClassGroupIds - }; -} -function getGroupRecursive(classParts, classPartObject) { - var _classPartObject$vali; - if (classParts.length === 0) { - return classPartObject.classGroupId; - } - var currentClassPart = classParts[0]; - var nextClassPartObject = classPartObject.nextPart.get(currentClassPart); - var classGroupFromNextClassPart = nextClassPartObject ? getGroupRecursive(classParts.slice(1), nextClassPartObject) : undefined; - if (classGroupFromNextClassPart) { - return classGroupFromNextClassPart; - } - if (classPartObject.validators.length === 0) { - return undefined; - } - var classRest = classParts.join(CLASS_PART_SEPARATOR); - return (_classPartObject$vali = classPartObject.validators.find(function (_ref) { - var validator = _ref.validator; - return validator(classRest); - })) === null || _classPartObject$vali === void 0 ? void 0 : _classPartObject$vali.classGroupId; -} -var arbitraryPropertyRegex = /^\[(.+)\]$/; -function getGroupIdForArbitraryProperty(className) { - if (arbitraryPropertyRegex.test(className)) { - var arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1]; - var property = arbitraryPropertyClassName === null || arbitraryPropertyClassName === void 0 ? void 0 : arbitraryPropertyClassName.substring(0, arbitraryPropertyClassName.indexOf(':')); - if (property) { - // I use two dots here because one dot is used as prefix for class groups in plugins - return 'arbitrary..' + property; - } - } -} -/** - * Exported for testing only - */ -function createClassMap(config) { - var theme = config.theme, - prefix = config.prefix; - var classMap = { - nextPart: new Map(), - validators: [] - }; - var prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix); - prefixedClassGroupEntries.forEach(function (_ref2) { - var _ref3 = bundle_mjs_slicedToArray(_ref2, 2), - classGroupId = _ref3[0], - classGroup = _ref3[1]; - processClassesRecursively(classGroup, classMap, classGroupId, theme); - }); - return classMap; -} -function processClassesRecursively(classGroup, classPartObject, classGroupId, theme) { - classGroup.forEach(function (classDefinition) { - if (typeof classDefinition === 'string') { - var classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition); - classPartObjectToEdit.classGroupId = classGroupId; - return; - } - if (typeof classDefinition === 'function') { - if (isThemeGetter(classDefinition)) { - processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme); - return; - } - classPartObject.validators.push({ - validator: classDefinition, - classGroupId: classGroupId - }); - return; - } - Object.entries(classDefinition).forEach(function (_ref4) { - var _ref5 = bundle_mjs_slicedToArray(_ref4, 2), - key = _ref5[0], - classGroup = _ref5[1]; - processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme); - }); - }); -} -function getPart(classPartObject, path) { - var currentClassPartObject = classPartObject; - path.split(CLASS_PART_SEPARATOR).forEach(function (pathPart) { - if (!currentClassPartObject.nextPart.has(pathPart)) { - currentClassPartObject.nextPart.set(pathPart, { - nextPart: new Map(), - validators: [] - }); - } - currentClassPartObject = currentClassPartObject.nextPart.get(pathPart); - }); - return currentClassPartObject; -} -function isThemeGetter(func) { - return func.isThemeGetter; -} -function getPrefixedClassGroupEntries(classGroupEntries, prefix) { - if (!prefix) { - return classGroupEntries; - } - return classGroupEntries.map(function (_ref6) { - var _ref7 = bundle_mjs_slicedToArray(_ref6, 2), - classGroupId = _ref7[0], - classGroup = _ref7[1]; - var prefixedClassGroup = classGroup.map(function (classDefinition) { - if (typeof classDefinition === 'string') { - return prefix + classDefinition; - } - if (typeof classDefinition === 'object') { - return Object.fromEntries(Object.entries(classDefinition).map(function (_ref8) { - var _ref9 = bundle_mjs_slicedToArray(_ref8, 2), - key = _ref9[0], - value = _ref9[1]; - return [prefix + key, value]; - })); - } - return classDefinition; - }); - return [classGroupId, prefixedClassGroup]; - }); -} - -// LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance -function createLruCache(maxCacheSize) { - if (maxCacheSize < 1) { - return { - get: function get() { - return undefined; - }, - set: function set() {} - }; - } - var cacheSize = 0; - var cache = new Map(); - var previousCache = new Map(); - function update(key, value) { - cache.set(key, value); - cacheSize++; - if (cacheSize > maxCacheSize) { - cacheSize = 0; - previousCache = cache; - cache = new Map(); - } - } - return { - get: function get(key) { - var value = cache.get(key); - if (value !== undefined) { - return value; - } - if ((value = previousCache.get(key)) !== undefined) { - update(key, value); - return value; - } - }, - set: function set(key, value) { - if (cache.has(key)) { - cache.set(key, value); - } else { - update(key, value); - } - } - }; -} -var IMPORTANT_MODIFIER = '!'; -function createParseClassName(config) { - var separator = config.separator, - experimentalParseClassName = config.experimentalParseClassName; - var isSeparatorSingleCharacter = separator.length === 1; - var firstSeparatorCharacter = separator[0]; - var separatorLength = separator.length; - // parseClassName inspired by https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js - function parseClassName(className) { - var modifiers = []; - var bracketDepth = 0; - var modifierStart = 0; - var postfixModifierPosition; - for (var index = 0; index < className.length; index++) { - var currentCharacter = className[index]; - if (bracketDepth === 0) { - if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) { - modifiers.push(className.slice(modifierStart, index)); - modifierStart = index + separatorLength; - continue; - } - if (currentCharacter === '/') { - postfixModifierPosition = index; - continue; - } - } - if (currentCharacter === '[') { - bracketDepth++; - } else if (currentCharacter === ']') { - bracketDepth--; - } - } - var baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart); - var hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER); - var baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier; - var maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined; - return { - modifiers: modifiers, - hasImportantModifier: hasImportantModifier, - baseClassName: baseClassName, - maybePostfixModifierPosition: maybePostfixModifierPosition - }; - } - if (experimentalParseClassName) { - return function parseClassNameExperimental(className) { - return experimentalParseClassName({ - className: className, - parseClassName: parseClassName - }); - }; - } - return parseClassName; -} -/** - * Sorts modifiers according to following schema: - * - Predefined modifiers are sorted alphabetically - * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it - */ -function sortModifiers(modifiers) { - if (modifiers.length <= 1) { - return modifiers; - } - var sortedModifiers = []; - var unsortedModifiers = []; - modifiers.forEach(function (modifier) { - var isArbitraryVariant = modifier[0] === '['; - if (isArbitraryVariant) { - sortedModifiers.push.apply(sortedModifiers, _toConsumableArray(unsortedModifiers.sort()).concat([modifier])); - unsortedModifiers = []; - } else { - unsortedModifiers.push(modifier); - } - }); - sortedModifiers.push.apply(sortedModifiers, _toConsumableArray(unsortedModifiers.sort())); - return sortedModifiers; -} -function createConfigUtils(config) { - return _objectSpread({ - cache: createLruCache(config.cacheSize), - parseClassName: createParseClassName(config) - }, createClassGroupUtils(config)); -} -var SPLIT_CLASSES_REGEX = /\s+/; -function mergeClassList(classList, configUtils) { - var parseClassName = configUtils.parseClassName, - getClassGroupId = configUtils.getClassGroupId, - getConflictingClassGroupIds = configUtils.getConflictingClassGroupIds; - /** - * Set of classGroupIds in following format: - * `{importantModifier}{variantModifiers}{classGroupId}` - * @example 'float' - * @example 'hover:focus:bg-color' - * @example 'md:!pr' - */ - var classGroupsInConflict = new Set(); - return classList.trim().split(SPLIT_CLASSES_REGEX).map(function (originalClassName) { - var _parseClassName = parseClassName(originalClassName), - modifiers = _parseClassName.modifiers, - hasImportantModifier = _parseClassName.hasImportantModifier, - baseClassName = _parseClassName.baseClassName, - maybePostfixModifierPosition = _parseClassName.maybePostfixModifierPosition; - var hasPostfixModifier = Boolean(maybePostfixModifierPosition); - var classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName); - if (!classGroupId) { - if (!hasPostfixModifier) { - return { - isTailwindClass: false, - originalClassName: originalClassName - }; - } - classGroupId = getClassGroupId(baseClassName); - if (!classGroupId) { - return { - isTailwindClass: false, - originalClassName: originalClassName - }; - } - hasPostfixModifier = false; - } - var variantModifier = sortModifiers(modifiers).join(':'); - var modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier; - return { - isTailwindClass: true, - modifierId: modifierId, - classGroupId: classGroupId, - originalClassName: originalClassName, - hasPostfixModifier: hasPostfixModifier - }; - }).reverse() - // Last class in conflict wins, so we need to filter conflicting classes in reverse order. - .filter(function (parsed) { - if (!parsed.isTailwindClass) { - return true; - } - var modifierId = parsed.modifierId, - classGroupId = parsed.classGroupId, - hasPostfixModifier = parsed.hasPostfixModifier; - var classId = modifierId + classGroupId; - if (classGroupsInConflict.has(classId)) { - return false; - } - classGroupsInConflict.add(classId); - getConflictingClassGroupIds(classGroupId, hasPostfixModifier).forEach(function (group) { - return classGroupsInConflict.add(modifierId + group); - }); - return true; - }).reverse().map(function (parsed) { - return parsed.originalClassName; - }).join(' '); -} - -/** - * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better. - * - * Specifically: - * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js - * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts - * - * Original code has MIT license: Copyright (c) Luke Edwards (lukeed.com) - */ -function twJoin() { - var index = 0; - var argument; - var resolvedValue; - var string = ''; - while (index < arguments.length) { - if (argument = arguments[index++]) { - if (resolvedValue = toValue(argument)) { - string && (string += ' '); - string += resolvedValue; - } - } - } - return string; -} -function toValue(mix) { - if (typeof mix === 'string') { - return mix; - } - var resolvedValue; - var string = ''; - for (var k = 0; k < mix.length; k++) { - if (mix[k]) { - if (resolvedValue = toValue(mix[k])) { - string && (string += ' '); - string += resolvedValue; - } - } - } - return string; -} -function createTailwindMerge(createConfigFirst) { - for (var _len = arguments.length, createConfigRest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - createConfigRest[_key - 1] = arguments[_key]; - } - var configUtils; - var cacheGet; - var cacheSet; - var functionToCall = initTailwindMerge; - function initTailwindMerge(classList) { - var config = createConfigRest.reduce(function (previousConfig, createConfigCurrent) { - return createConfigCurrent(previousConfig); - }, createConfigFirst()); - configUtils = createConfigUtils(config); - cacheGet = configUtils.cache.get; - cacheSet = configUtils.cache.set; - functionToCall = tailwindMerge; - return tailwindMerge(classList); - } - function tailwindMerge(classList) { - var cachedResult = cacheGet(classList); - if (cachedResult) { - return cachedResult; - } - var result = mergeClassList(classList, configUtils); - cacheSet(classList, result); - return result; - } - return function callTailwindMerge() { - return functionToCall(twJoin.apply(null, arguments)); - }; -} -function fromTheme(key) { - var themeGetter = function themeGetter(theme) { - return theme[key] || []; - }; - themeGetter.isThemeGetter = true; - return themeGetter; -} -var arbitraryValueRegex = /^\[(?:([a-z-]+):)?(.+)\]$/i; -var fractionRegex = /^\d+\/\d+$/; -var stringLengths = /*#__PURE__*/new Set(['px', 'full', 'screen']); -var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/; -var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/; -var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/; -// Shadow always begins with x and y offset separated by underscore optionally prepended by inset -var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/; -var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/; -function isLength(value) { - return isNumber(value) || stringLengths.has(value) || fractionRegex.test(value); -} -function isArbitraryLength(value) { - return getIsArbitraryValue(value, 'length', isLengthOnly); -} -function isNumber(value) { - return Boolean(value) && !Number.isNaN(Number(value)); -} -function isArbitraryNumber(value) { - return getIsArbitraryValue(value, 'number', isNumber); -} -function isInteger(value) { - return Boolean(value) && Number.isInteger(Number(value)); -} -function isPercent(value) { - return value.endsWith('%') && isNumber(value.slice(0, -1)); -} -function isArbitraryValue(value) { - return arbitraryValueRegex.test(value); -} -function isTshirtSize(value) { - return tshirtUnitRegex.test(value); -} -var sizeLabels = /*#__PURE__*/new Set(['length', 'size', 'percentage']); -function isArbitrarySize(value) { - return getIsArbitraryValue(value, sizeLabels, isNever); -} -function isArbitraryPosition(value) { - return getIsArbitraryValue(value, 'position', isNever); -} -var imageLabels = /*#__PURE__*/new Set(['image', 'url']); -function isArbitraryImage(value) { - return getIsArbitraryValue(value, imageLabels, isImage); -} -function isArbitraryShadow(value) { - return getIsArbitraryValue(value, '', isShadow); -} -function isAny() { - return true; -} -function getIsArbitraryValue(value, label, testValue) { - var result = arbitraryValueRegex.exec(value); - if (result) { - if (result[1]) { - return typeof label === 'string' ? result[1] === label : label.has(result[1]); - } - return testValue(result[2]); - } - return false; -} -function isLengthOnly(value) { - // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths. - // For example, `hsl(0 0% 0%)` would be classified as a length without this check. - // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough. - return lengthUnitRegex.test(value) && !colorFunctionRegex.test(value); -} -function isNever() { - return false; -} -function isShadow(value) { - return shadowRegex.test(value); -} -function isImage(value) { - return imageRegex.test(value); -} -var validators = /*#__PURE__*/Object.defineProperty({ - __proto__: null, - isAny: isAny, - isArbitraryImage: isArbitraryImage, - isArbitraryLength: isArbitraryLength, - isArbitraryNumber: isArbitraryNumber, - isArbitraryPosition: isArbitraryPosition, - isArbitraryShadow: isArbitraryShadow, - isArbitrarySize: isArbitrarySize, - isArbitraryValue: isArbitraryValue, - isInteger: isInteger, - isLength: isLength, - isNumber: isNumber, - isPercent: isPercent, - isTshirtSize: isTshirtSize -}, Symbol.toStringTag, { - value: 'Module' -}); -function getDefaultConfig() { - var colors = fromTheme('colors'); - var spacing = fromTheme('spacing'); - var blur = fromTheme('blur'); - var brightness = fromTheme('brightness'); - var borderColor = fromTheme('borderColor'); - var borderRadius = fromTheme('borderRadius'); - var borderSpacing = fromTheme('borderSpacing'); - var borderWidth = fromTheme('borderWidth'); - var contrast = fromTheme('contrast'); - var grayscale = fromTheme('grayscale'); - var hueRotate = fromTheme('hueRotate'); - var invert = fromTheme('invert'); - var gap = fromTheme('gap'); - var gradientColorStops = fromTheme('gradientColorStops'); - var gradientColorStopPositions = fromTheme('gradientColorStopPositions'); - var inset = fromTheme('inset'); - var margin = fromTheme('margin'); - var opacity = fromTheme('opacity'); - var padding = fromTheme('padding'); - var saturate = fromTheme('saturate'); - var scale = fromTheme('scale'); - var sepia = fromTheme('sepia'); - var skew = fromTheme('skew'); - var space = fromTheme('space'); - var translate = fromTheme('translate'); - var getOverscroll = function getOverscroll() { - return ['auto', 'contain', 'none']; - }; - var getOverflow = function getOverflow() { - return ['auto', 'hidden', 'clip', 'visible', 'scroll']; - }; - var getSpacingWithAutoAndArbitrary = function getSpacingWithAutoAndArbitrary() { - return ['auto', isArbitraryValue, spacing]; - }; - var getSpacingWithArbitrary = function getSpacingWithArbitrary() { - return [isArbitraryValue, spacing]; - }; - var getLengthWithEmptyAndArbitrary = function getLengthWithEmptyAndArbitrary() { - return ['', isLength, isArbitraryLength]; - }; - var getNumberWithAutoAndArbitrary = function getNumberWithAutoAndArbitrary() { - return ['auto', isNumber, isArbitraryValue]; - }; - var getPositions = function getPositions() { - return ['bottom', 'center', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top', 'top']; - }; - var getLineStyles = function getLineStyles() { - return ['solid', 'dashed', 'dotted', 'double', 'none']; - }; - var getBlendModes = function getBlendModes() { - return ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity']; - }; - var getAlign = function getAlign() { - return ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch']; - }; - var getZeroAndEmpty = function getZeroAndEmpty() { - return ['', '0', isArbitraryValue]; - }; - var getBreaks = function getBreaks() { - return ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column']; - }; - var getNumber = function getNumber() { - return [isNumber, isArbitraryNumber]; - }; - var getNumberAndArbitrary = function getNumberAndArbitrary() { - return [isNumber, isArbitraryValue]; - }; - return { - cacheSize: 500, - separator: ':', - theme: { - colors: [isAny], - spacing: [isLength, isArbitraryLength], - blur: ['none', '', isTshirtSize, isArbitraryValue], - brightness: getNumber(), - borderColor: [colors], - borderRadius: ['none', '', 'full', isTshirtSize, isArbitraryValue], - borderSpacing: getSpacingWithArbitrary(), - borderWidth: getLengthWithEmptyAndArbitrary(), - contrast: getNumber(), - grayscale: getZeroAndEmpty(), - hueRotate: getNumberAndArbitrary(), - invert: getZeroAndEmpty(), - gap: getSpacingWithArbitrary(), - gradientColorStops: [colors], - gradientColorStopPositions: [isPercent, isArbitraryLength], - inset: getSpacingWithAutoAndArbitrary(), - margin: getSpacingWithAutoAndArbitrary(), - opacity: getNumber(), - padding: getSpacingWithArbitrary(), - saturate: getNumber(), - scale: getNumber(), - sepia: getZeroAndEmpty(), - skew: getNumberAndArbitrary(), - space: getSpacingWithArbitrary(), - translate: getSpacingWithArbitrary() - }, - classGroups: { - // Layout - /** - * Aspect Ratio - * @see https://tailwindcss.com/docs/aspect-ratio - */ - aspect: [{ - aspect: ['auto', 'square', 'video', isArbitraryValue] - }], - /** - * Container - * @see https://tailwindcss.com/docs/container - */ - container: ['container'], - /** - * Columns - * @see https://tailwindcss.com/docs/columns - */ - columns: [{ - columns: [isTshirtSize] - }], - /** - * Break After - * @see https://tailwindcss.com/docs/break-after - */ - 'break-after': [{ - 'break-after': getBreaks() - }], - /** - * Break Before - * @see https://tailwindcss.com/docs/break-before - */ - 'break-before': [{ - 'break-before': getBreaks() - }], - /** - * Break Inside - * @see https://tailwindcss.com/docs/break-inside - */ - 'break-inside': [{ - 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column'] - }], - /** - * Box Decoration Break - * @see https://tailwindcss.com/docs/box-decoration-break - */ - 'box-decoration': [{ - 'box-decoration': ['slice', 'clone'] - }], - /** - * Box Sizing - * @see https://tailwindcss.com/docs/box-sizing - */ - box: [{ - box: ['border', 'content'] - }], - /** - * Display - * @see https://tailwindcss.com/docs/display - */ - display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'], - /** - * Floats - * @see https://tailwindcss.com/docs/float - */ - float: [{ - float: ['right', 'left', 'none', 'start', 'end'] - }], - /** - * Clear - * @see https://tailwindcss.com/docs/clear - */ - clear: [{ - clear: ['left', 'right', 'both', 'none', 'start', 'end'] - }], - /** - * Isolation - * @see https://tailwindcss.com/docs/isolation - */ - isolation: ['isolate', 'isolation-auto'], - /** - * Object Fit - * @see https://tailwindcss.com/docs/object-fit - */ - 'object-fit': [{ - object: ['contain', 'cover', 'fill', 'none', 'scale-down'] - }], - /** - * Object Position - * @see https://tailwindcss.com/docs/object-position - */ - 'object-position': [{ - object: [].concat(_toConsumableArray(getPositions()), [isArbitraryValue]) - }], - /** - * Overflow - * @see https://tailwindcss.com/docs/overflow - */ - overflow: [{ - overflow: getOverflow() - }], - /** - * Overflow X - * @see https://tailwindcss.com/docs/overflow - */ - 'overflow-x': [{ - 'overflow-x': getOverflow() - }], - /** - * Overflow Y - * @see https://tailwindcss.com/docs/overflow - */ - 'overflow-y': [{ - 'overflow-y': getOverflow() - }], - /** - * Overscroll Behavior - * @see https://tailwindcss.com/docs/overscroll-behavior - */ - overscroll: [{ - overscroll: getOverscroll() - }], - /** - * Overscroll Behavior X - * @see https://tailwindcss.com/docs/overscroll-behavior - */ - 'overscroll-x': [{ - 'overscroll-x': getOverscroll() - }], - /** - * Overscroll Behavior Y - * @see https://tailwindcss.com/docs/overscroll-behavior - */ - 'overscroll-y': [{ - 'overscroll-y': getOverscroll() - }], - /** - * Position - * @see https://tailwindcss.com/docs/position - */ - position: ['static', 'fixed', 'absolute', 'relative', 'sticky'], - /** - * Top / Right / Bottom / Left - * @see https://tailwindcss.com/docs/top-right-bottom-left - */ - inset: [{ - inset: [inset] - }], - /** - * Right / Left - * @see https://tailwindcss.com/docs/top-right-bottom-left - */ - 'inset-x': [{ - 'inset-x': [inset] - }], - /** - * Top / Bottom - * @see https://tailwindcss.com/docs/top-right-bottom-left - */ - 'inset-y': [{ - 'inset-y': [inset] - }], - /** - * Start - * @see https://tailwindcss.com/docs/top-right-bottom-left - */ - start: [{ - start: [inset] - }], - /** - * End - * @see https://tailwindcss.com/docs/top-right-bottom-left - */ - end: [{ - end: [inset] - }], - /** - * Top - * @see https://tailwindcss.com/docs/top-right-bottom-left - */ - top: [{ - top: [inset] - }], - /** - * Right - * @see https://tailwindcss.com/docs/top-right-bottom-left - */ - right: [{ - right: [inset] - }], - /** - * Bottom - * @see https://tailwindcss.com/docs/top-right-bottom-left - */ - bottom: [{ - bottom: [inset] - }], - /** - * Left - * @see https://tailwindcss.com/docs/top-right-bottom-left - */ - left: [{ - left: [inset] - }], - /** - * Visibility - * @see https://tailwindcss.com/docs/visibility - */ - visibility: ['visible', 'invisible', 'collapse'], - /** - * Z-Index - * @see https://tailwindcss.com/docs/z-index - */ - z: [{ - z: ['auto', isInteger, isArbitraryValue] - }], - // Flexbox and Grid - /** - * Flex Basis - * @see https://tailwindcss.com/docs/flex-basis - */ - basis: [{ - basis: getSpacingWithAutoAndArbitrary() - }], - /** - * Flex Direction - * @see https://tailwindcss.com/docs/flex-direction - */ - 'flex-direction': [{ - flex: ['row', 'row-reverse', 'col', 'col-reverse'] - }], - /** - * Flex Wrap - * @see https://tailwindcss.com/docs/flex-wrap - */ - 'flex-wrap': [{ - flex: ['wrap', 'wrap-reverse', 'nowrap'] - }], - /** - * Flex - * @see https://tailwindcss.com/docs/flex - */ - flex: [{ - flex: ['1', 'auto', 'initial', 'none', isArbitraryValue] - }], - /** - * Flex Grow - * @see https://tailwindcss.com/docs/flex-grow - */ - grow: [{ - grow: getZeroAndEmpty() - }], - /** - * Flex Shrink - * @see https://tailwindcss.com/docs/flex-shrink - */ - shrink: [{ - shrink: getZeroAndEmpty() - }], - /** - * Order - * @see https://tailwindcss.com/docs/order - */ - order: [{ - order: ['first', 'last', 'none', isInteger, isArbitraryValue] - }], - /** - * Grid Template Columns - * @see https://tailwindcss.com/docs/grid-template-columns - */ - 'grid-cols': [{ - 'grid-cols': [isAny] - }], - /** - * Grid Column Start / End - * @see https://tailwindcss.com/docs/grid-column - */ - 'col-start-end': [{ - col: ['auto', { - span: ['full', isInteger, isArbitraryValue] - }, isArbitraryValue] - }], - /** - * Grid Column Start - * @see https://tailwindcss.com/docs/grid-column - */ - 'col-start': [{ - 'col-start': getNumberWithAutoAndArbitrary() - }], - /** - * Grid Column End - * @see https://tailwindcss.com/docs/grid-column - */ - 'col-end': [{ - 'col-end': getNumberWithAutoAndArbitrary() - }], - /** - * Grid Template Rows - * @see https://tailwindcss.com/docs/grid-template-rows - */ - 'grid-rows': [{ - 'grid-rows': [isAny] - }], - /** - * Grid Row Start / End - * @see https://tailwindcss.com/docs/grid-row - */ - 'row-start-end': [{ - row: ['auto', { - span: [isInteger, isArbitraryValue] - }, isArbitraryValue] - }], - /** - * Grid Row Start - * @see https://tailwindcss.com/docs/grid-row - */ - 'row-start': [{ - 'row-start': getNumberWithAutoAndArbitrary() - }], - /** - * Grid Row End - * @see https://tailwindcss.com/docs/grid-row - */ - 'row-end': [{ - 'row-end': getNumberWithAutoAndArbitrary() - }], - /** - * Grid Auto Flow - * @see https://tailwindcss.com/docs/grid-auto-flow - */ - 'grid-flow': [{ - 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense'] - }], - /** - * Grid Auto Columns - * @see https://tailwindcss.com/docs/grid-auto-columns - */ - 'auto-cols': [{ - 'auto-cols': ['auto', 'min', 'max', 'fr', isArbitraryValue] - }], - /** - * Grid Auto Rows - * @see https://tailwindcss.com/docs/grid-auto-rows - */ - 'auto-rows': [{ - 'auto-rows': ['auto', 'min', 'max', 'fr', isArbitraryValue] - }], - /** - * Gap - * @see https://tailwindcss.com/docs/gap - */ - gap: [{ - gap: [gap] - }], - /** - * Gap X - * @see https://tailwindcss.com/docs/gap - */ - 'gap-x': [{ - 'gap-x': [gap] - }], - /** - * Gap Y - * @see https://tailwindcss.com/docs/gap - */ - 'gap-y': [{ - 'gap-y': [gap] - }], - /** - * Justify Content - * @see https://tailwindcss.com/docs/justify-content - */ - 'justify-content': [{ - justify: ['normal'].concat(_toConsumableArray(getAlign())) - }], - /** - * Justify Items - * @see https://tailwindcss.com/docs/justify-items - */ - 'justify-items': [{ - 'justify-items': ['start', 'end', 'center', 'stretch'] - }], - /** - * Justify Self - * @see https://tailwindcss.com/docs/justify-self - */ - 'justify-self': [{ - 'justify-self': ['auto', 'start', 'end', 'center', 'stretch'] - }], - /** - * Align Content - * @see https://tailwindcss.com/docs/align-content - */ - 'align-content': [{ - content: ['normal'].concat(_toConsumableArray(getAlign()), ['baseline']) - }], - /** - * Align Items - * @see https://tailwindcss.com/docs/align-items - */ - 'align-items': [{ - items: ['start', 'end', 'center', 'baseline', 'stretch'] - }], - /** - * Align Self - * @see https://tailwindcss.com/docs/align-self - */ - 'align-self': [{ - self: ['auto', 'start', 'end', 'center', 'stretch', 'baseline'] - }], - /** - * Place Content - * @see https://tailwindcss.com/docs/place-content - */ - 'place-content': [{ - 'place-content': [].concat(_toConsumableArray(getAlign()), ['baseline']) - }], - /** - * Place Items - * @see https://tailwindcss.com/docs/place-items - */ - 'place-items': [{ - 'place-items': ['start', 'end', 'center', 'baseline', 'stretch'] - }], - /** - * Place Self - * @see https://tailwindcss.com/docs/place-self - */ - 'place-self': [{ - 'place-self': ['auto', 'start', 'end', 'center', 'stretch'] - }], - // Spacing - /** - * Padding - * @see https://tailwindcss.com/docs/padding - */ - p: [{ - p: [padding] - }], - /** - * Padding X - * @see https://tailwindcss.com/docs/padding - */ - px: [{ - px: [padding] - }], - /** - * Padding Y - * @see https://tailwindcss.com/docs/padding - */ - py: [{ - py: [padding] - }], - /** - * Padding Start - * @see https://tailwindcss.com/docs/padding - */ - ps: [{ - ps: [padding] - }], - /** - * Padding End - * @see https://tailwindcss.com/docs/padding - */ - pe: [{ - pe: [padding] - }], - /** - * Padding Top - * @see https://tailwindcss.com/docs/padding - */ - pt: [{ - pt: [padding] - }], - /** - * Padding Right - * @see https://tailwindcss.com/docs/padding - */ - pr: [{ - pr: [padding] - }], - /** - * Padding Bottom - * @see https://tailwindcss.com/docs/padding - */ - pb: [{ - pb: [padding] - }], - /** - * Padding Left - * @see https://tailwindcss.com/docs/padding - */ - pl: [{ - pl: [padding] - }], - /** - * Margin - * @see https://tailwindcss.com/docs/margin - */ - m: [{ - m: [margin] - }], - /** - * Margin X - * @see https://tailwindcss.com/docs/margin - */ - mx: [{ - mx: [margin] - }], - /** - * Margin Y - * @see https://tailwindcss.com/docs/margin - */ - my: [{ - my: [margin] - }], - /** - * Margin Start - * @see https://tailwindcss.com/docs/margin - */ - ms: [{ - ms: [margin] - }], - /** - * Margin End - * @see https://tailwindcss.com/docs/margin - */ - me: [{ - me: [margin] - }], - /** - * Margin Top - * @see https://tailwindcss.com/docs/margin - */ - mt: [{ - mt: [margin] - }], - /** - * Margin Right - * @see https://tailwindcss.com/docs/margin - */ - mr: [{ - mr: [margin] - }], - /** - * Margin Bottom - * @see https://tailwindcss.com/docs/margin - */ - mb: [{ - mb: [margin] - }], - /** - * Margin Left - * @see https://tailwindcss.com/docs/margin - */ - ml: [{ - ml: [margin] - }], - /** - * Space Between X - * @see https://tailwindcss.com/docs/space - */ - 'space-x': [{ - 'space-x': [space] - }], - /** - * Space Between X Reverse - * @see https://tailwindcss.com/docs/space - */ - 'space-x-reverse': ['space-x-reverse'], - /** - * Space Between Y - * @see https://tailwindcss.com/docs/space - */ - 'space-y': [{ - 'space-y': [space] - }], - /** - * Space Between Y Reverse - * @see https://tailwindcss.com/docs/space - */ - 'space-y-reverse': ['space-y-reverse'], - // Sizing - /** - * Width - * @see https://tailwindcss.com/docs/width - */ - w: [{ - w: ['auto', 'min', 'max', 'fit', 'svw', 'lvw', 'dvw', isArbitraryValue, spacing] - }], - /** - * Min-Width - * @see https://tailwindcss.com/docs/min-width - */ - 'min-w': [{ - 'min-w': [isArbitraryValue, spacing, 'min', 'max', 'fit'] - }], - /** - * Max-Width - * @see https://tailwindcss.com/docs/max-width - */ - 'max-w': [{ - 'max-w': [isArbitraryValue, spacing, 'none', 'full', 'min', 'max', 'fit', 'prose', { - screen: [isTshirtSize] - }, isTshirtSize] - }], - /** - * Height - * @see https://tailwindcss.com/docs/height - */ - h: [{ - h: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit', 'svh', 'lvh', 'dvh'] - }], - /** - * Min-Height - * @see https://tailwindcss.com/docs/min-height - */ - 'min-h': [{ - 'min-h': [isArbitraryValue, spacing, 'min', 'max', 'fit', 'svh', 'lvh', 'dvh'] - }], - /** - * Max-Height - * @see https://tailwindcss.com/docs/max-height - */ - 'max-h': [{ - 'max-h': [isArbitraryValue, spacing, 'min', 'max', 'fit', 'svh', 'lvh', 'dvh'] - }], - /** - * Size - * @see https://tailwindcss.com/docs/size - */ - size: [{ - size: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit'] - }], - // Typography - /** - * Font Size - * @see https://tailwindcss.com/docs/font-size - */ - 'font-size': [{ - text: ['base', isTshirtSize, isArbitraryLength] - }], - /** - * Font Smoothing - * @see https://tailwindcss.com/docs/font-smoothing - */ - 'font-smoothing': ['antialiased', 'subpixel-antialiased'], - /** - * Font Style - * @see https://tailwindcss.com/docs/font-style - */ - 'font-style': ['italic', 'not-italic'], - /** - * Font Weight - * @see https://tailwindcss.com/docs/font-weight - */ - 'font-weight': [{ - font: ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black', isArbitraryNumber] - }], - /** - * Font Family - * @see https://tailwindcss.com/docs/font-family - */ - 'font-family': [{ - font: [isAny] - }], - /** - * Font Variant Numeric - * @see https://tailwindcss.com/docs/font-variant-numeric - */ - 'fvn-normal': ['normal-nums'], - /** - * Font Variant Numeric - * @see https://tailwindcss.com/docs/font-variant-numeric - */ - 'fvn-ordinal': ['ordinal'], - /** - * Font Variant Numeric - * @see https://tailwindcss.com/docs/font-variant-numeric - */ - 'fvn-slashed-zero': ['slashed-zero'], - /** - * Font Variant Numeric - * @see https://tailwindcss.com/docs/font-variant-numeric - */ - 'fvn-figure': ['lining-nums', 'oldstyle-nums'], - /** - * Font Variant Numeric - * @see https://tailwindcss.com/docs/font-variant-numeric - */ - 'fvn-spacing': ['proportional-nums', 'tabular-nums'], - /** - * Font Variant Numeric - * @see https://tailwindcss.com/docs/font-variant-numeric - */ - 'fvn-fraction': ['diagonal-fractions', 'stacked-fractons'], - /** - * Letter Spacing - * @see https://tailwindcss.com/docs/letter-spacing - */ - tracking: [{ - tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest', isArbitraryValue] - }], - /** - * Line Clamp - * @see https://tailwindcss.com/docs/line-clamp - */ - 'line-clamp': [{ - 'line-clamp': ['none', isNumber, isArbitraryNumber] - }], - /** - * Line Height - * @see https://tailwindcss.com/docs/line-height - */ - leading: [{ - leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose', isLength, isArbitraryValue] - }], - /** - * List Style Image - * @see https://tailwindcss.com/docs/list-style-image - */ - 'list-image': [{ - 'list-image': ['none', isArbitraryValue] - }], - /** - * List Style Type - * @see https://tailwindcss.com/docs/list-style-type - */ - 'list-style-type': [{ - list: ['none', 'disc', 'decimal', isArbitraryValue] - }], - /** - * List Style Position - * @see https://tailwindcss.com/docs/list-style-position - */ - 'list-style-position': [{ - list: ['inside', 'outside'] - }], - /** - * Placeholder Color - * @deprecated since Tailwind CSS v3.0.0 - * @see https://tailwindcss.com/docs/placeholder-color - */ - 'placeholder-color': [{ - placeholder: [colors] - }], - /** - * Placeholder Opacity - * @see https://tailwindcss.com/docs/placeholder-opacity - */ - 'placeholder-opacity': [{ - 'placeholder-opacity': [opacity] - }], - /** - * Text Alignment - * @see https://tailwindcss.com/docs/text-align - */ - 'text-alignment': [{ - text: ['left', 'center', 'right', 'justify', 'start', 'end'] - }], - /** - * Text Color - * @see https://tailwindcss.com/docs/text-color - */ - 'text-color': [{ - text: [colors] - }], - /** - * Text Opacity - * @see https://tailwindcss.com/docs/text-opacity - */ - 'text-opacity': [{ - 'text-opacity': [opacity] - }], - /** - * Text Decoration - * @see https://tailwindcss.com/docs/text-decoration - */ - 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'], - /** - * Text Decoration Style - * @see https://tailwindcss.com/docs/text-decoration-style - */ - 'text-decoration-style': [{ - decoration: [].concat(_toConsumableArray(getLineStyles()), ['wavy']) - }], - /** - * Text Decoration Thickness - * @see https://tailwindcss.com/docs/text-decoration-thickness - */ - 'text-decoration-thickness': [{ - decoration: ['auto', 'from-font', isLength, isArbitraryLength] - }], - /** - * Text Underline Offset - * @see https://tailwindcss.com/docs/text-underline-offset - */ - 'underline-offset': [{ - 'underline-offset': ['auto', isLength, isArbitraryValue] - }], - /** - * Text Decoration Color - * @see https://tailwindcss.com/docs/text-decoration-color - */ - 'text-decoration-color': [{ - decoration: [colors] - }], - /** - * Text Transform - * @see https://tailwindcss.com/docs/text-transform - */ - 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'], - /** - * Text Overflow - * @see https://tailwindcss.com/docs/text-overflow - */ - 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'], - /** - * Text Wrap - * @see https://tailwindcss.com/docs/text-wrap - */ - 'text-wrap': [{ - text: ['wrap', 'nowrap', 'balance', 'pretty'] - }], - /** - * Text Indent - * @see https://tailwindcss.com/docs/text-indent - */ - indent: [{ - indent: getSpacingWithArbitrary() - }], - /** - * Vertical Alignment - * @see https://tailwindcss.com/docs/vertical-align - */ - 'vertical-align': [{ - align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryValue] - }], - /** - * Whitespace - * @see https://tailwindcss.com/docs/whitespace - */ - whitespace: [{ - whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces'] - }], - /** - * Word Break - * @see https://tailwindcss.com/docs/word-break - */ - break: [{ - break: ['normal', 'words', 'all', 'keep'] - }], - /** - * Hyphens - * @see https://tailwindcss.com/docs/hyphens - */ - hyphens: [{ - hyphens: ['none', 'manual', 'auto'] - }], - /** - * Content - * @see https://tailwindcss.com/docs/content - */ - content: [{ - content: ['none', isArbitraryValue] - }], - // Backgrounds - /** - * Background Attachment - * @see https://tailwindcss.com/docs/background-attachment - */ - 'bg-attachment': [{ - bg: ['fixed', 'local', 'scroll'] - }], - /** - * Background Clip - * @see https://tailwindcss.com/docs/background-clip - */ - 'bg-clip': [{ - 'bg-clip': ['border', 'padding', 'content', 'text'] - }], - /** - * Background Opacity - * @deprecated since Tailwind CSS v3.0.0 - * @see https://tailwindcss.com/docs/background-opacity - */ - 'bg-opacity': [{ - 'bg-opacity': [opacity] - }], - /** - * Background Origin - * @see https://tailwindcss.com/docs/background-origin - */ - 'bg-origin': [{ - 'bg-origin': ['border', 'padding', 'content'] - }], - /** - * Background Position - * @see https://tailwindcss.com/docs/background-position - */ - 'bg-position': [{ - bg: [].concat(_toConsumableArray(getPositions()), [isArbitraryPosition]) - }], - /** - * Background Repeat - * @see https://tailwindcss.com/docs/background-repeat - */ - 'bg-repeat': [{ - bg: ['no-repeat', { - repeat: ['', 'x', 'y', 'round', 'space'] - }] - }], - /** - * Background Size - * @see https://tailwindcss.com/docs/background-size - */ - 'bg-size': [{ - bg: ['auto', 'cover', 'contain', isArbitrarySize] - }], - /** - * Background Image - * @see https://tailwindcss.com/docs/background-image - */ - 'bg-image': [{ - bg: ['none', { - 'gradient-to': ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl'] - }, isArbitraryImage] - }], - /** - * Background Color - * @see https://tailwindcss.com/docs/background-color - */ - 'bg-color': [{ - bg: [colors] - }], - /** - * Gradient Color Stops From Position - * @see https://tailwindcss.com/docs/gradient-color-stops - */ - 'gradient-from-pos': [{ - from: [gradientColorStopPositions] - }], - /** - * Gradient Color Stops Via Position - * @see https://tailwindcss.com/docs/gradient-color-stops - */ - 'gradient-via-pos': [{ - via: [gradientColorStopPositions] - }], - /** - * Gradient Color Stops To Position - * @see https://tailwindcss.com/docs/gradient-color-stops - */ - 'gradient-to-pos': [{ - to: [gradientColorStopPositions] - }], - /** - * Gradient Color Stops From - * @see https://tailwindcss.com/docs/gradient-color-stops - */ - 'gradient-from': [{ - from: [gradientColorStops] - }], - /** - * Gradient Color Stops Via - * @see https://tailwindcss.com/docs/gradient-color-stops - */ - 'gradient-via': [{ - via: [gradientColorStops] - }], - /** - * Gradient Color Stops To - * @see https://tailwindcss.com/docs/gradient-color-stops - */ - 'gradient-to': [{ - to: [gradientColorStops] - }], - // Borders - /** - * Border Radius - * @see https://tailwindcss.com/docs/border-radius - */ - rounded: [{ - rounded: [borderRadius] - }], - /** - * Border Radius Start - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-s': [{ - 'rounded-s': [borderRadius] - }], - /** - * Border Radius End - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-e': [{ - 'rounded-e': [borderRadius] - }], - /** - * Border Radius Top - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-t': [{ - 'rounded-t': [borderRadius] - }], - /** - * Border Radius Right - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-r': [{ - 'rounded-r': [borderRadius] - }], - /** - * Border Radius Bottom - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-b': [{ - 'rounded-b': [borderRadius] - }], - /** - * Border Radius Left - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-l': [{ - 'rounded-l': [borderRadius] - }], - /** - * Border Radius Start Start - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-ss': [{ - 'rounded-ss': [borderRadius] - }], - /** - * Border Radius Start End - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-se': [{ - 'rounded-se': [borderRadius] - }], - /** - * Border Radius End End - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-ee': [{ - 'rounded-ee': [borderRadius] - }], - /** - * Border Radius End Start - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-es': [{ - 'rounded-es': [borderRadius] - }], - /** - * Border Radius Top Left - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-tl': [{ - 'rounded-tl': [borderRadius] - }], - /** - * Border Radius Top Right - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-tr': [{ - 'rounded-tr': [borderRadius] - }], - /** - * Border Radius Bottom Right - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-br': [{ - 'rounded-br': [borderRadius] - }], - /** - * Border Radius Bottom Left - * @see https://tailwindcss.com/docs/border-radius - */ - 'rounded-bl': [{ - 'rounded-bl': [borderRadius] - }], - /** - * Border Width - * @see https://tailwindcss.com/docs/border-width - */ - 'border-w': [{ - border: [borderWidth] - }], - /** - * Border Width X - * @see https://tailwindcss.com/docs/border-width - */ - 'border-w-x': [{ - 'border-x': [borderWidth] - }], - /** - * Border Width Y - * @see https://tailwindcss.com/docs/border-width - */ - 'border-w-y': [{ - 'border-y': [borderWidth] - }], - /** - * Border Width Start - * @see https://tailwindcss.com/docs/border-width - */ - 'border-w-s': [{ - 'border-s': [borderWidth] - }], - /** - * Border Width End - * @see https://tailwindcss.com/docs/border-width - */ - 'border-w-e': [{ - 'border-e': [borderWidth] - }], - /** - * Border Width Top - * @see https://tailwindcss.com/docs/border-width - */ - 'border-w-t': [{ - 'border-t': [borderWidth] - }], - /** - * Border Width Right - * @see https://tailwindcss.com/docs/border-width - */ - 'border-w-r': [{ - 'border-r': [borderWidth] - }], - /** - * Border Width Bottom - * @see https://tailwindcss.com/docs/border-width - */ - 'border-w-b': [{ - 'border-b': [borderWidth] - }], - /** - * Border Width Left - * @see https://tailwindcss.com/docs/border-width - */ - 'border-w-l': [{ - 'border-l': [borderWidth] - }], - /** - * Border Opacity - * @see https://tailwindcss.com/docs/border-opacity - */ - 'border-opacity': [{ - 'border-opacity': [opacity] - }], - /** - * Border Style - * @see https://tailwindcss.com/docs/border-style - */ - 'border-style': [{ - border: [].concat(_toConsumableArray(getLineStyles()), ['hidden']) - }], - /** - * Divide Width X - * @see https://tailwindcss.com/docs/divide-width - */ - 'divide-x': [{ - 'divide-x': [borderWidth] - }], - /** - * Divide Width X Reverse - * @see https://tailwindcss.com/docs/divide-width - */ - 'divide-x-reverse': ['divide-x-reverse'], - /** - * Divide Width Y - * @see https://tailwindcss.com/docs/divide-width - */ - 'divide-y': [{ - 'divide-y': [borderWidth] - }], - /** - * Divide Width Y Reverse - * @see https://tailwindcss.com/docs/divide-width - */ - 'divide-y-reverse': ['divide-y-reverse'], - /** - * Divide Opacity - * @see https://tailwindcss.com/docs/divide-opacity - */ - 'divide-opacity': [{ - 'divide-opacity': [opacity] - }], - /** - * Divide Style - * @see https://tailwindcss.com/docs/divide-style - */ - 'divide-style': [{ - divide: getLineStyles() - }], - /** - * Border Color - * @see https://tailwindcss.com/docs/border-color - */ - 'border-color': [{ - border: [borderColor] - }], - /** - * Border Color X - * @see https://tailwindcss.com/docs/border-color - */ - 'border-color-x': [{ - 'border-x': [borderColor] - }], - /** - * Border Color Y - * @see https://tailwindcss.com/docs/border-color - */ - 'border-color-y': [{ - 'border-y': [borderColor] - }], - /** - * Border Color Top - * @see https://tailwindcss.com/docs/border-color - */ - 'border-color-t': [{ - 'border-t': [borderColor] - }], - /** - * Border Color Right - * @see https://tailwindcss.com/docs/border-color - */ - 'border-color-r': [{ - 'border-r': [borderColor] - }], - /** - * Border Color Bottom - * @see https://tailwindcss.com/docs/border-color - */ - 'border-color-b': [{ - 'border-b': [borderColor] - }], - /** - * Border Color Left - * @see https://tailwindcss.com/docs/border-color - */ - 'border-color-l': [{ - 'border-l': [borderColor] - }], - /** - * Divide Color - * @see https://tailwindcss.com/docs/divide-color - */ - 'divide-color': [{ - divide: [borderColor] - }], - /** - * Outline Style - * @see https://tailwindcss.com/docs/outline-style - */ - 'outline-style': [{ - outline: [''].concat(_toConsumableArray(getLineStyles())) - }], - /** - * Outline Offset - * @see https://tailwindcss.com/docs/outline-offset - */ - 'outline-offset': [{ - 'outline-offset': [isLength, isArbitraryValue] - }], - /** - * Outline Width - * @see https://tailwindcss.com/docs/outline-width - */ - 'outline-w': [{ - outline: [isLength, isArbitraryLength] - }], - /** - * Outline Color - * @see https://tailwindcss.com/docs/outline-color - */ - 'outline-color': [{ - outline: [colors] - }], - /** - * Ring Width - * @see https://tailwindcss.com/docs/ring-width - */ - 'ring-w': [{ - ring: getLengthWithEmptyAndArbitrary() - }], - /** - * Ring Width Inset - * @see https://tailwindcss.com/docs/ring-width - */ - 'ring-w-inset': ['ring-inset'], - /** - * Ring Color - * @see https://tailwindcss.com/docs/ring-color - */ - 'ring-color': [{ - ring: [colors] - }], - /** - * Ring Opacity - * @see https://tailwindcss.com/docs/ring-opacity - */ - 'ring-opacity': [{ - 'ring-opacity': [opacity] - }], - /** - * Ring Offset Width - * @see https://tailwindcss.com/docs/ring-offset-width - */ - 'ring-offset-w': [{ - 'ring-offset': [isLength, isArbitraryLength] - }], - /** - * Ring Offset Color - * @see https://tailwindcss.com/docs/ring-offset-color - */ - 'ring-offset-color': [{ - 'ring-offset': [colors] - }], - // Effects - /** - * Box Shadow - * @see https://tailwindcss.com/docs/box-shadow - */ - shadow: [{ - shadow: ['', 'inner', 'none', isTshirtSize, isArbitraryShadow] - }], - /** - * Box Shadow Color - * @see https://tailwindcss.com/docs/box-shadow-color - */ - 'shadow-color': [{ - shadow: [isAny] - }], - /** - * Opacity - * @see https://tailwindcss.com/docs/opacity - */ - opacity: [{ - opacity: [opacity] - }], - /** - * Mix Blend Mode - * @see https://tailwindcss.com/docs/mix-blend-mode - */ - 'mix-blend': [{ - 'mix-blend': [].concat(_toConsumableArray(getBlendModes()), ['plus-lighter', 'plus-darker']) - }], - /** - * Background Blend Mode - * @see https://tailwindcss.com/docs/background-blend-mode - */ - 'bg-blend': [{ - 'bg-blend': getBlendModes() - }], - // Filters - /** - * Filter - * @deprecated since Tailwind CSS v3.0.0 - * @see https://tailwindcss.com/docs/filter - */ - filter: [{ - filter: ['', 'none'] - }], - /** - * Blur - * @see https://tailwindcss.com/docs/blur - */ - blur: [{ - blur: [blur] - }], - /** - * Brightness - * @see https://tailwindcss.com/docs/brightness - */ - brightness: [{ - brightness: [brightness] - }], - /** - * Contrast - * @see https://tailwindcss.com/docs/contrast - */ - contrast: [{ - contrast: [contrast] - }], - /** - * Drop Shadow - * @see https://tailwindcss.com/docs/drop-shadow - */ - 'drop-shadow': [{ - 'drop-shadow': ['', 'none', isTshirtSize, isArbitraryValue] - }], - /** - * Grayscale - * @see https://tailwindcss.com/docs/grayscale - */ - grayscale: [{ - grayscale: [grayscale] - }], - /** - * Hue Rotate - * @see https://tailwindcss.com/docs/hue-rotate - */ - 'hue-rotate': [{ - 'hue-rotate': [hueRotate] - }], - /** - * Invert - * @see https://tailwindcss.com/docs/invert - */ - invert: [{ - invert: [invert] - }], - /** - * Saturate - * @see https://tailwindcss.com/docs/saturate - */ - saturate: [{ - saturate: [saturate] - }], - /** - * Sepia - * @see https://tailwindcss.com/docs/sepia - */ - sepia: [{ - sepia: [sepia] - }], - /** - * Backdrop Filter - * @deprecated since Tailwind CSS v3.0.0 - * @see https://tailwindcss.com/docs/backdrop-filter - */ - 'backdrop-filter': [{ - 'backdrop-filter': ['', 'none'] - }], - /** - * Backdrop Blur - * @see https://tailwindcss.com/docs/backdrop-blur - */ - 'backdrop-blur': [{ - 'backdrop-blur': [blur] - }], - /** - * Backdrop Brightness - * @see https://tailwindcss.com/docs/backdrop-brightness - */ - 'backdrop-brightness': [{ - 'backdrop-brightness': [brightness] - }], - /** - * Backdrop Contrast - * @see https://tailwindcss.com/docs/backdrop-contrast - */ - 'backdrop-contrast': [{ - 'backdrop-contrast': [contrast] - }], - /** - * Backdrop Grayscale - * @see https://tailwindcss.com/docs/backdrop-grayscale - */ - 'backdrop-grayscale': [{ - 'backdrop-grayscale': [grayscale] - }], - /** - * Backdrop Hue Rotate - * @see https://tailwindcss.com/docs/backdrop-hue-rotate - */ - 'backdrop-hue-rotate': [{ - 'backdrop-hue-rotate': [hueRotate] - }], - /** - * Backdrop Invert - * @see https://tailwindcss.com/docs/backdrop-invert - */ - 'backdrop-invert': [{ - 'backdrop-invert': [invert] - }], - /** - * Backdrop Opacity - * @see https://tailwindcss.com/docs/backdrop-opacity - */ - 'backdrop-opacity': [{ - 'backdrop-opacity': [opacity] - }], - /** - * Backdrop Saturate - * @see https://tailwindcss.com/docs/backdrop-saturate - */ - 'backdrop-saturate': [{ - 'backdrop-saturate': [saturate] - }], - /** - * Backdrop Sepia - * @see https://tailwindcss.com/docs/backdrop-sepia - */ - 'backdrop-sepia': [{ - 'backdrop-sepia': [sepia] - }], - // Tables - /** - * Border Collapse - * @see https://tailwindcss.com/docs/border-collapse - */ - 'border-collapse': [{ - border: ['collapse', 'separate'] - }], - /** - * Border Spacing - * @see https://tailwindcss.com/docs/border-spacing - */ - 'border-spacing': [{ - 'border-spacing': [borderSpacing] - }], - /** - * Border Spacing X - * @see https://tailwindcss.com/docs/border-spacing - */ - 'border-spacing-x': [{ - 'border-spacing-x': [borderSpacing] - }], - /** - * Border Spacing Y - * @see https://tailwindcss.com/docs/border-spacing - */ - 'border-spacing-y': [{ - 'border-spacing-y': [borderSpacing] - }], - /** - * Table Layout - * @see https://tailwindcss.com/docs/table-layout - */ - 'table-layout': [{ - table: ['auto', 'fixed'] - }], - /** - * Caption Side - * @see https://tailwindcss.com/docs/caption-side - */ - caption: [{ - caption: ['top', 'bottom'] - }], - // Transitions and Animation - /** - * Tranisition Property - * @see https://tailwindcss.com/docs/transition-property - */ - transition: [{ - transition: ['none', 'all', '', 'colors', 'opacity', 'shadow', 'transform', isArbitraryValue] - }], - /** - * Transition Duration - * @see https://tailwindcss.com/docs/transition-duration - */ - duration: [{ - duration: getNumberAndArbitrary() - }], - /** - * Transition Timing Function - * @see https://tailwindcss.com/docs/transition-timing-function - */ - ease: [{ - ease: ['linear', 'in', 'out', 'in-out', isArbitraryValue] - }], - /** - * Transition Delay - * @see https://tailwindcss.com/docs/transition-delay - */ - delay: [{ - delay: getNumberAndArbitrary() - }], - /** - * Animation - * @see https://tailwindcss.com/docs/animation - */ - animate: [{ - animate: ['none', 'spin', 'ping', 'pulse', 'bounce', isArbitraryValue] - }], - // Transforms - /** - * Transform - * @see https://tailwindcss.com/docs/transform - */ - transform: [{ - transform: ['', 'gpu', 'none'] - }], - /** - * Scale - * @see https://tailwindcss.com/docs/scale - */ - scale: [{ - scale: [scale] - }], - /** - * Scale X - * @see https://tailwindcss.com/docs/scale - */ - 'scale-x': [{ - 'scale-x': [scale] - }], - /** - * Scale Y - * @see https://tailwindcss.com/docs/scale - */ - 'scale-y': [{ - 'scale-y': [scale] - }], - /** - * Rotate - * @see https://tailwindcss.com/docs/rotate - */ - rotate: [{ - rotate: [isInteger, isArbitraryValue] - }], - /** - * Translate X - * @see https://tailwindcss.com/docs/translate - */ - 'translate-x': [{ - 'translate-x': [translate] - }], - /** - * Translate Y - * @see https://tailwindcss.com/docs/translate - */ - 'translate-y': [{ - 'translate-y': [translate] - }], - /** - * Skew X - * @see https://tailwindcss.com/docs/skew - */ - 'skew-x': [{ - 'skew-x': [skew] - }], - /** - * Skew Y - * @see https://tailwindcss.com/docs/skew - */ - 'skew-y': [{ - 'skew-y': [skew] - }], - /** - * Transform Origin - * @see https://tailwindcss.com/docs/transform-origin - */ - 'transform-origin': [{ - origin: ['center', 'top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left', isArbitraryValue] - }], - // Interactivity - /** - * Accent Color - * @see https://tailwindcss.com/docs/accent-color - */ - accent: [{ - accent: ['auto', colors] - }], - /** - * Appearance - * @see https://tailwindcss.com/docs/appearance - */ - appearance: [{ - appearance: ['none', 'auto'] - }], - /** - * Cursor - * @see https://tailwindcss.com/docs/cursor - */ - cursor: [{ - cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryValue] - }], - /** - * Caret Color - * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities - */ - 'caret-color': [{ - caret: [colors] - }], - /** - * Pointer Events - * @see https://tailwindcss.com/docs/pointer-events - */ - 'pointer-events': [{ - 'pointer-events': ['none', 'auto'] - }], - /** - * Resize - * @see https://tailwindcss.com/docs/resize - */ - resize: [{ - resize: ['none', 'y', 'x', ''] - }], - /** - * Scroll Behavior - * @see https://tailwindcss.com/docs/scroll-behavior - */ - 'scroll-behavior': [{ - scroll: ['auto', 'smooth'] - }], - /** - * Scroll Margin - * @see https://tailwindcss.com/docs/scroll-margin - */ - 'scroll-m': [{ - 'scroll-m': getSpacingWithArbitrary() - }], - /** - * Scroll Margin X - * @see https://tailwindcss.com/docs/scroll-margin - */ - 'scroll-mx': [{ - 'scroll-mx': getSpacingWithArbitrary() - }], - /** - * Scroll Margin Y - * @see https://tailwindcss.com/docs/scroll-margin - */ - 'scroll-my': [{ - 'scroll-my': getSpacingWithArbitrary() - }], - /** - * Scroll Margin Start - * @see https://tailwindcss.com/docs/scroll-margin - */ - 'scroll-ms': [{ - 'scroll-ms': getSpacingWithArbitrary() - }], - /** - * Scroll Margin End - * @see https://tailwindcss.com/docs/scroll-margin - */ - 'scroll-me': [{ - 'scroll-me': getSpacingWithArbitrary() - }], - /** - * Scroll Margin Top - * @see https://tailwindcss.com/docs/scroll-margin - */ - 'scroll-mt': [{ - 'scroll-mt': getSpacingWithArbitrary() - }], - /** - * Scroll Margin Right - * @see https://tailwindcss.com/docs/scroll-margin - */ - 'scroll-mr': [{ - 'scroll-mr': getSpacingWithArbitrary() - }], - /** - * Scroll Margin Bottom - * @see https://tailwindcss.com/docs/scroll-margin - */ - 'scroll-mb': [{ - 'scroll-mb': getSpacingWithArbitrary() - }], - /** - * Scroll Margin Left - * @see https://tailwindcss.com/docs/scroll-margin - */ - 'scroll-ml': [{ - 'scroll-ml': getSpacingWithArbitrary() - }], - /** - * Scroll Padding - * @see https://tailwindcss.com/docs/scroll-padding - */ - 'scroll-p': [{ - 'scroll-p': getSpacingWithArbitrary() - }], - /** - * Scroll Padding X - * @see https://tailwindcss.com/docs/scroll-padding - */ - 'scroll-px': [{ - 'scroll-px': getSpacingWithArbitrary() - }], - /** - * Scroll Padding Y - * @see https://tailwindcss.com/docs/scroll-padding - */ - 'scroll-py': [{ - 'scroll-py': getSpacingWithArbitrary() - }], - /** - * Scroll Padding Start - * @see https://tailwindcss.com/docs/scroll-padding - */ - 'scroll-ps': [{ - 'scroll-ps': getSpacingWithArbitrary() - }], - /** - * Scroll Padding End - * @see https://tailwindcss.com/docs/scroll-padding - */ - 'scroll-pe': [{ - 'scroll-pe': getSpacingWithArbitrary() - }], - /** - * Scroll Padding Top - * @see https://tailwindcss.com/docs/scroll-padding - */ - 'scroll-pt': [{ - 'scroll-pt': getSpacingWithArbitrary() - }], - /** - * Scroll Padding Right - * @see https://tailwindcss.com/docs/scroll-padding - */ - 'scroll-pr': [{ - 'scroll-pr': getSpacingWithArbitrary() - }], - /** - * Scroll Padding Bottom - * @see https://tailwindcss.com/docs/scroll-padding - */ - 'scroll-pb': [{ - 'scroll-pb': getSpacingWithArbitrary() - }], - /** - * Scroll Padding Left - * @see https://tailwindcss.com/docs/scroll-padding - */ - 'scroll-pl': [{ - 'scroll-pl': getSpacingWithArbitrary() - }], - /** - * Scroll Snap Align - * @see https://tailwindcss.com/docs/scroll-snap-align - */ - 'snap-align': [{ - snap: ['start', 'end', 'center', 'align-none'] - }], - /** - * Scroll Snap Stop - * @see https://tailwindcss.com/docs/scroll-snap-stop - */ - 'snap-stop': [{ - snap: ['normal', 'always'] - }], - /** - * Scroll Snap Type - * @see https://tailwindcss.com/docs/scroll-snap-type - */ - 'snap-type': [{ - snap: ['none', 'x', 'y', 'both'] - }], - /** - * Scroll Snap Type Strictness - * @see https://tailwindcss.com/docs/scroll-snap-type - */ - 'snap-strictness': [{ - snap: ['mandatory', 'proximity'] - }], - /** - * Touch Action - * @see https://tailwindcss.com/docs/touch-action - */ - touch: [{ - touch: ['auto', 'none', 'manipulation'] - }], - /** - * Touch Action X - * @see https://tailwindcss.com/docs/touch-action - */ - 'touch-x': [{ - 'touch-pan': ['x', 'left', 'right'] - }], - /** - * Touch Action Y - * @see https://tailwindcss.com/docs/touch-action - */ - 'touch-y': [{ - 'touch-pan': ['y', 'up', 'down'] - }], - /** - * Touch Action Pinch Zoom - * @see https://tailwindcss.com/docs/touch-action - */ - 'touch-pz': ['touch-pinch-zoom'], - /** - * User Select - * @see https://tailwindcss.com/docs/user-select - */ - select: [{ - select: ['none', 'text', 'all', 'auto'] - }], - /** - * Will Change - * @see https://tailwindcss.com/docs/will-change - */ - 'will-change': [{ - 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryValue] - }], - // SVG - /** - * Fill - * @see https://tailwindcss.com/docs/fill - */ - fill: [{ - fill: [colors, 'none'] - }], - /** - * Stroke Width - * @see https://tailwindcss.com/docs/stroke-width - */ - 'stroke-w': [{ - stroke: [isLength, isArbitraryLength, isArbitraryNumber] - }], - /** - * Stroke - * @see https://tailwindcss.com/docs/stroke - */ - stroke: [{ - stroke: [colors, 'none'] - }], - // Accessibility - /** - * Screen Readers - * @see https://tailwindcss.com/docs/screen-readers - */ - sr: ['sr-only', 'not-sr-only'], - /** - * Forced Color Adjust - * @see https://tailwindcss.com/docs/forced-color-adjust - */ - 'forced-color-adjust': [{ - 'forced-color-adjust': ['auto', 'none'] - }] - }, - conflictingClassGroups: { - overflow: ['overflow-x', 'overflow-y'], - overscroll: ['overscroll-x', 'overscroll-y'], - inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'], - 'inset-x': ['right', 'left'], - 'inset-y': ['top', 'bottom'], - flex: ['basis', 'grow', 'shrink'], - gap: ['gap-x', 'gap-y'], - p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'], - px: ['pr', 'pl'], - py: ['pt', 'pb'], - m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'], - mx: ['mr', 'ml'], - my: ['mt', 'mb'], - size: ['w', 'h'], - 'font-size': ['leading'], - 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'], - 'fvn-ordinal': ['fvn-normal'], - 'fvn-slashed-zero': ['fvn-normal'], - 'fvn-figure': ['fvn-normal'], - 'fvn-spacing': ['fvn-normal'], - 'fvn-fraction': ['fvn-normal'], - 'line-clamp': ['display', 'overflow'], - rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'], - 'rounded-s': ['rounded-ss', 'rounded-es'], - 'rounded-e': ['rounded-se', 'rounded-ee'], - 'rounded-t': ['rounded-tl', 'rounded-tr'], - 'rounded-r': ['rounded-tr', 'rounded-br'], - 'rounded-b': ['rounded-br', 'rounded-bl'], - 'rounded-l': ['rounded-tl', 'rounded-bl'], - 'border-spacing': ['border-spacing-x', 'border-spacing-y'], - 'border-w': ['border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'], - 'border-w-x': ['border-w-r', 'border-w-l'], - 'border-w-y': ['border-w-t', 'border-w-b'], - 'border-color': ['border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'], - 'border-color-x': ['border-color-r', 'border-color-l'], - 'border-color-y': ['border-color-t', 'border-color-b'], - 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'], - 'scroll-mx': ['scroll-mr', 'scroll-ml'], - 'scroll-my': ['scroll-mt', 'scroll-mb'], - 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'], - 'scroll-px': ['scroll-pr', 'scroll-pl'], - 'scroll-py': ['scroll-pt', 'scroll-pb'], - touch: ['touch-x', 'touch-y', 'touch-pz'], - 'touch-x': ['touch'], - 'touch-y': ['touch'], - 'touch-pz': ['touch'] - }, - conflictingClassGroupModifiers: { - 'font-size': ['leading'] - } - }; -} - -/** - * @param baseConfig Config where other config will be merged into. This object will be mutated. - * @param configExtension Partial config to merge into the `baseConfig`. - */ -function mergeConfigs(baseConfig, _ref10) { - var cacheSize = _ref10.cacheSize, - prefix = _ref10.prefix, - separator = _ref10.separator, - experimentalParseClassName = _ref10.experimentalParseClassName, - _ref10$extend = _ref10.extend, - extend = _ref10$extend === void 0 ? {} : _ref10$extend, - _ref10$override = _ref10.override, - override = _ref10$override === void 0 ? {} : _ref10$override; - overrideProperty(baseConfig, 'cacheSize', cacheSize); - overrideProperty(baseConfig, 'prefix', prefix); - overrideProperty(baseConfig, 'separator', separator); - overrideProperty(baseConfig, 'experimentalParseClassName', experimentalParseClassName); - for (var configKey in override) { - overrideConfigProperties(baseConfig[configKey], override[configKey]); - } - for (var key in extend) { - mergeConfigProperties(baseConfig[key], extend[key]); - } - return baseConfig; -} -function overrideProperty(baseObject, overrideKey, overrideValue) { - if (overrideValue !== undefined) { - baseObject[overrideKey] = overrideValue; - } -} -function overrideConfigProperties(baseObject, overrideObject) { - if (overrideObject) { - for (var key in overrideObject) { - overrideProperty(baseObject, key, overrideObject[key]); - } - } -} -function mergeConfigProperties(baseObject, mergeObject) { - if (mergeObject) { - for (var key in mergeObject) { - var mergeValue = mergeObject[key]; - if (mergeValue !== undefined) { - baseObject[key] = (baseObject[key] || []).concat(mergeValue); - } - } - } -} -function extendTailwindMerge(configExtension) { - for (var _len2 = arguments.length, createConfig = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - createConfig[_key2 - 1] = arguments[_key2]; - } - return typeof configExtension === 'function' ? createTailwindMerge.apply(void 0, [getDefaultConfig, configExtension].concat(createConfig)) : createTailwindMerge.apply(void 0, [function () { - return mergeConfigs(getDefaultConfig(), configExtension); - }].concat(createConfig)); -} -var twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig); - -// EXTERNAL MODULE: ../../node_modules/use-intl/dist/production/index.js -var production = __webpack_require__("../../node_modules/use-intl/dist/production/index.js"); -;// CONCATENATED MODULE: ./src/i18n/zh.json -var zh_namespaceObject = /*#__PURE__*/JSON.parse('{"Index":{"title":"首页","description":"这是首页","rich":"这个是富文本标签 rich.","globalDefaults":"{globalString}"},"LocaleLayout":{"title":"next-intl","description":"This is an example of using next-intl in the `app` directory."},"Client":{"title":"客户端","description":"This page hydrates on the client side."},"Nested":{"title":"嵌套","description":"This is a nested page.","children":{"title":"children Nested"}},"Navigation":{"home":"首页","client":"客户端页面 page","nested":"嵌套页面 page","newsArticle":"News article #{articleId}"},"NotFound":{"title":"This page was not found (404)"},"LocaleSwitcher":{"switchLocale":"Switch to {locale, select, de {German} en {English} other {Unknown}}"},"Counter":{"count":"Current count:","increment":"Increment"},"ClientCounter":{"count":"Current count: {count}","increment":"Increment"},"ApiRoute":{"hello":"Hello {name}!"},"useNamedRoute":{"home":"/","client":"/client","nested":"/nested"}}'); -;// CONCATENATED MODULE: ./src/components/I18nProvider/I18nProvider.tsx -function I18nProvider_slicedToArray(r, e) { return I18nProvider_arrayWithHoles(r) || I18nProvider_iterableToArrayLimit(r, e) || I18nProvider_unsupportedIterableToArray(r, e) || I18nProvider_nonIterableRest(); } -function I18nProvider_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function I18nProvider_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return I18nProvider_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? I18nProvider_arrayLikeToArray(r, a) : void 0; } } -function I18nProvider_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } -function I18nProvider_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } -function I18nProvider_arrayWithHoles(r) { if (Array.isArray(r)) return r; } - - - - -var I18nProvider = function I18nProvider(_ref) { - var locale = _ref.locale, - children = _ref.children; - var _useState = (0,external_React_.useState)(zh_namespaceObject), - _useState2 = I18nProvider_slicedToArray(_useState, 2), - messages = _useState2[0], - setMessages = _useState2[1]; - var handleError = function handleError(error) { - if (error.message === ( true ? 'MISSING_MESSAGE' : 0)) { - // Do nothing, this error is triggered on purpose - } else { - console.error(JSON.stringify(error.message)); - } - }; - var handleMessageFallback = function handleMessageFallback(info) { - return ( - // '`getMessageFalback` called for ' + - [info.namespace, info.key].filter(function (part) { - return part; - }).join('.') - ); - }; - var loadingMessages = (0,external_React_.useCallback)(function () { - return new Promise(function ($return, $error) { - var _messages; - var $Try_3_Post = function () { - try { - return $return(); - } catch ($boundEx) { - return $error($boundEx); - } - }; - var $Try_3_Catch = function (_unused) { - try { - setMessages(zh_namespaceObject); - return $Try_3_Post(); - } catch ($boundEx) { - return $error($boundEx); - } - }; - try { - if (locale === 'en') { - return Promise.resolve(__webpack_require__.e(/* import() | biz/template/shared-chunks/i18n-en */ "biz/template/shared-chunks/i18n-en").then(__webpack_require__.t.bind(__webpack_require__, "./src/i18n/en.json", 19))).then(function ($await_5) { - try { - _messages = $await_5.default; - setMessages(_messages); - return $If_4.call(this); - } catch ($boundEx) { - return $Try_3_Catch($boundEx); - } - }.bind(this), $Try_3_Catch); - } - // else if (locale === 'de') ? - function $If_4() { - return $Try_3_Post(); - } - return $If_4.call(this); - } catch (_unused) { - $Try_3_Catch(_unused) - } - }); - }, [locale]); - (0,external_React_.useEffect)(function () { - void loadingMessages(); - }, [loadingMessages, locale]); - return /*#__PURE__*/(0,jsx_runtime.jsx)(production/* IntlProvider */.Dk, { - defaultTranslationValues: { - globalString: 'Global string', - highlight: function highlight(chunks) { - return /*#__PURE__*/(0,jsx_runtime.jsx)("strong", { - children: chunks - }); - } - }, - now: new Date(), - messages: messages, - timeZone: "Asia/Shanghai", - locale: locale, - formats: { - dateTime: { - medium: { - dateStyle: 'medium', - timeStyle: 'short', - hour12: false - } - } - }, - onError: handleError, - getMessageFallback: handleMessageFallback, - children: children - }); -}; -;// CONCATENATED MODULE: ./src/components/I18nProvider/index.ts - -;// CONCATENATED MODULE: ../../node_modules/@dimjs/utils/dist/string/str-camel-case.js -/*! @flatjs/forge MIT @dimjs/utils */ -var r = function r(t) { - return (t || "").split(/[\s-_]+/).filter(function (r) { - return !!r; - }).map(function (r, t) { - if (t === 0) { - return r.toLowerCase(); - } - return r.charAt(0).toUpperCase() + r.slice(1).toLowerCase(); - }).join(""); -}; - -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/platform.js -/** - * A reference to globalThis, with support - * for browsers that don't yet support the spec. - * @public - */ -var $global = function () { - if (typeof globalThis !== "undefined") { - // We're running in a modern environment. - return globalThis; - } - if (typeof global !== "undefined") { - // We're running in NodeJS - return global; - } - if (typeof self !== "undefined") { - // We're running in a worker. - return self; - } - if (typeof window !== "undefined") { - // We're running in the browser's main thread. - return window; - } - try { - // Hopefully we never get here... - // Not all environments allow eval and Function. Use only as a last resort: - // eslint-disable-next-line no-new-func - return new Function("return this")(); - } catch (_a) { - // If all fails, give up and create an object. - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions - return {}; - } -}(); -// API-only Polyfill for trustedTypes -if ($global.trustedTypes === void 0) { - $global.trustedTypes = { - createPolicy: function createPolicy(n, r) { - return r; - } - }; -} -var propConfig = { - configurable: false, - enumerable: false, - writable: false -}; -if ($global.FAST === void 0) { - Reflect.defineProperty($global, "FAST", Object.assign({ - value: Object.create(null) - }, propConfig)); -} -/** - * The FAST global. - * @internal - */ -var FAST = $global.FAST; -if (FAST.getById === void 0) { - var storage = Object.create(null); - Reflect.defineProperty(FAST, "getById", Object.assign({ - value: function value(id, initialize) { - var found = storage[id]; - if (found === void 0) { - found = initialize ? storage[id] = initialize() : null; - } - return found; - } - }, propConfig)); -} -/** - * A readonly, empty array. - * @remarks - * Typically returned by APIs that return arrays when there are - * no actual items to return. - * @internal - */ -var emptyArray = Object.freeze([]); -/** - * Creates a function capable of locating metadata associated with a type. - * @returns A metadata locator function. - * @internal - */ -function createMetadataLocator() { - var metadataLookup = new WeakMap(); - return function (target) { - var metadata = metadataLookup.get(target); - if (metadata === void 0) { - var currentTarget = Reflect.getPrototypeOf(target); - while (metadata === void 0 && currentTarget !== null) { - metadata = metadataLookup.get(currentTarget); - currentTarget = Reflect.getPrototypeOf(currentTarget); - } - metadata = metadata === void 0 ? [] : metadata.slice(0); - metadataLookup.set(target, metadata); - } - return metadata; - }; -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/dom.js - -var updateQueue = $global.FAST.getById(1 /* updateQueue */, function () { - var tasks = []; - var pendingErrors = []; - function throwFirstError() { - if (pendingErrors.length) { - throw pendingErrors.shift(); - } - } - function tryRunTask(task) { - try { - task.call(); - } catch (error) { - pendingErrors.push(error); - setTimeout(throwFirstError, 0); - } - } - function process() { - var capacity = 1024; - var index = 0; - while (index < tasks.length) { - tryRunTask(tasks[index]); - index++; - // Prevent leaking memory for long chains of recursive calls to `DOM.queueUpdate`. - // If we call `DOM.queueUpdate` within a task scheduled by `DOM.queueUpdate`, the queue will - // grow, but to avoid an O(n) walk for every task we execute, we don't - // shift tasks off the queue after they have been executed. - // Instead, we periodically shift 1024 tasks off the queue. - if (index > capacity) { - // Manually shift all values starting at the index back to the - // beginning of the queue. - for (var scan = 0, newLength = tasks.length - index; scan < newLength; scan++) { - tasks[scan] = tasks[scan + index]; - } - tasks.length -= index; - index = 0; - } - } - tasks.length = 0; - } - function enqueue(callable) { - if (tasks.length < 1) { - $global.requestAnimationFrame(process); - } - tasks.push(callable); - } - return Object.freeze({ - enqueue: enqueue, - process: process - }); -}); -/* eslint-disable */ -var fastHTMLPolicy = $global.trustedTypes.createPolicy("fast-html", { - createHTML: function createHTML(html) { - return html; - } -}); -/* eslint-enable */ -var htmlPolicy = fastHTMLPolicy; -var marker = "fast-".concat(Math.random().toString(36).substring(2, 8)); -/** @internal */ -var _interpolationStart = "".concat(marker, "{"); -/** @internal */ -var _interpolationEnd = "}".concat(marker); -/** - * Common DOM APIs. - * @public - */ -var DOM = Object.freeze({ - /** - * Indicates whether the DOM supports the adoptedStyleSheets feature. - */ - supportsAdoptedStyleSheets: Array.isArray(document.adoptedStyleSheets) && "replace" in CSSStyleSheet.prototype, - /** - * Sets the HTML trusted types policy used by the templating engine. - * @param policy - The policy to set for HTML. - * @remarks - * This API can only be called once, for security reasons. It should be - * called by the application developer at the start of their program. - */ - setHTMLPolicy: function setHTMLPolicy(policy) { - if (htmlPolicy !== fastHTMLPolicy) { - throw new Error("The HTML policy can only be set once."); - } - htmlPolicy = policy; - }, - /** - * Turns a string into trusted HTML using the configured trusted types policy. - * @param html - The string to turn into trusted HTML. - * @remarks - * Used internally by the template engine when creating templates - * and setting innerHTML. - */ - createHTML: function createHTML(html) { - return htmlPolicy.createHTML(html); - }, - /** - * Determines if the provided node is a template marker used by the runtime. - * @param node - The node to test. - */ - isMarker: function isMarker(node) { - return node && node.nodeType === 8 && node.data.startsWith(marker); - }, - /** - * Given a marker node, extract the {@link HTMLDirective} index from the placeholder. - * @param node - The marker node to extract the index from. - */ - extractDirectiveIndexFromMarker: function extractDirectiveIndexFromMarker(node) { - return parseInt(node.data.replace("".concat(marker, ":"), "")); - }, - /** - * Creates a placeholder string suitable for marking out a location *within* - * an attribute value or HTML content. - * @param index - The directive index to create the placeholder for. - * @remarks - * Used internally by binding directives. - */ - createInterpolationPlaceholder: function createInterpolationPlaceholder(index) { - return "".concat(_interpolationStart).concat(index).concat(_interpolationEnd); - }, - /** - * Creates a placeholder that manifests itself as an attribute on an - * element. - * @param attributeName - The name of the custom attribute. - * @param index - The directive index to create the placeholder for. - * @remarks - * Used internally by attribute directives such as `ref`, `slotted`, and `children`. - */ - createCustomAttributePlaceholder: function createCustomAttributePlaceholder(attributeName, index) { - return "".concat(attributeName, "=\"").concat(this.createInterpolationPlaceholder(index), "\""); - }, - /** - * Creates a placeholder that manifests itself as a marker within the DOM structure. - * @param index - The directive index to create the placeholder for. - * @remarks - * Used internally by structural directives such as `repeat`. - */ - createBlockPlaceholder: function createBlockPlaceholder(index) { - return ""); - }, - /** - * Schedules DOM update work in the next async batch. - * @param callable - The callable function or object to queue. - */ - queueUpdate: updateQueue.enqueue, - /** - * Immediately processes all work previously scheduled - * through queueUpdate. - * @remarks - * This also forces nextUpdate promises - * to resolve. - */ - processUpdates: updateQueue.process, - /** - * Resolves with the next DOM update. - */ - nextUpdate: function nextUpdate() { - return new Promise(updateQueue.enqueue); - }, - /** - * Sets an attribute value on an element. - * @param element - The element to set the attribute value on. - * @param attributeName - The attribute name to set. - * @param value - The value of the attribute to set. - * @remarks - * If the value is `null` or `undefined`, the attribute is removed, otherwise - * it is set to the provided value using the standard `setAttribute` API. - */ - setAttribute: function setAttribute(element, attributeName, value) { - if (value === null || value === undefined) { - element.removeAttribute(attributeName); - } else { - element.setAttribute(attributeName, value); - } - }, - /** - * Sets a boolean attribute value. - * @param element - The element to set the boolean attribute value on. - * @param attributeName - The attribute name to set. - * @param value - The value of the attribute to set. - * @remarks - * If the value is true, the attribute is added; otherwise it is removed. - */ - setBooleanAttribute: function setBooleanAttribute(element, attributeName, value) { - value ? element.setAttribute(attributeName, "") : element.removeAttribute(attributeName); - }, - /** - * Removes all the child nodes of the provided parent node. - * @param parent - The node to remove the children from. - */ - removeChildNodes: function removeChildNodes(parent) { - for (var child = parent.firstChild; child !== null; child = parent.firstChild) { - parent.removeChild(child); - } - }, - /** - * Creates a TreeWalker configured to walk a template fragment. - * @param fragment - The fragment to walk. - */ - createTemplateWalker: function createTemplateWalker(fragment) { - return document.createTreeWalker(fragment, 133, - // element, text, comment - null, false); - } -}); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js -function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, notifier_toPropertyKey(o.key), o); } } -function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function notifier_toPropertyKey(t) { var i = notifier_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function notifier_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -/** - * An implementation of {@link Notifier} that efficiently keeps track of - * subscribers interested in a specific change notification on an - * observable source. - * - * @remarks - * This set is optimized for the most common scenario of 1 or 2 subscribers. - * With this in mind, it can store a subscriber in an internal field, allowing it to avoid Array#push operations. - * If the set ever exceeds two subscribers, it upgrades to an array automatically. - * @public - */ -var SubscriberSet = /*#__PURE__*/function () { - /** - * Creates an instance of SubscriberSet for the specified source. - * @param source - The object source that subscribers will receive notifications from. - * @param initialSubscriber - An initial subscriber to changes. - */ - function SubscriberSet(source, initialSubscriber) { - _classCallCheck(this, SubscriberSet); - this.sub1 = void 0; - this.sub2 = void 0; - this.spillover = void 0; - this.source = source; - this.sub1 = initialSubscriber; - } - /** - * Checks whether the provided subscriber has been added to this set. - * @param subscriber - The subscriber to test for inclusion in this set. - */ - return _createClass(SubscriberSet, [{ - key: "has", - value: function has(subscriber) { - return this.spillover === void 0 ? this.sub1 === subscriber || this.sub2 === subscriber : this.spillover.indexOf(subscriber) !== -1; - } - /** - * Subscribes to notification of changes in an object's state. - * @param subscriber - The object that is subscribing for change notification. - */ - }, { - key: "subscribe", - value: function subscribe(subscriber) { - var spillover = this.spillover; - if (spillover === void 0) { - if (this.has(subscriber)) { - return; - } - if (this.sub1 === void 0) { - this.sub1 = subscriber; - return; - } - if (this.sub2 === void 0) { - this.sub2 = subscriber; - return; - } - this.spillover = [this.sub1, this.sub2, subscriber]; - this.sub1 = void 0; - this.sub2 = void 0; - } else { - var index = spillover.indexOf(subscriber); - if (index === -1) { - spillover.push(subscriber); - } - } - } - /** - * Unsubscribes from notification of changes in an object's state. - * @param subscriber - The object that is unsubscribing from change notification. - */ - }, { - key: "unsubscribe", - value: function unsubscribe(subscriber) { - var spillover = this.spillover; - if (spillover === void 0) { - if (this.sub1 === subscriber) { - this.sub1 = void 0; - } else if (this.sub2 === subscriber) { - this.sub2 = void 0; - } - } else { - var index = spillover.indexOf(subscriber); - if (index !== -1) { - spillover.splice(index, 1); - } - } - } - /** - * Notifies all subscribers. - * @param args - Data passed along to subscribers during notification. - */ - }, { - key: "notify", - value: function notify(args) { - var spillover = this.spillover; - var source = this.source; - if (spillover === void 0) { - var sub1 = this.sub1; - var sub2 = this.sub2; - if (sub1 !== void 0) { - sub1.handleChange(source, args); - } - if (sub2 !== void 0) { - sub2.handleChange(source, args); - } - } else { - for (var i = 0, ii = spillover.length; i < ii; ++i) { - spillover[i].handleChange(source, args); - } - } - } - }]); -}(); -/** - * An implementation of Notifier that allows subscribers to be notified - * of individual property changes on an object. - * @public - */ -var PropertyChangeNotifier = /*#__PURE__*/function () { - /** - * Creates an instance of PropertyChangeNotifier for the specified source. - * @param source - The object source that subscribers will receive notifications from. - */ - function PropertyChangeNotifier(source) { - _classCallCheck(this, PropertyChangeNotifier); - this.subscribers = {}; - this.sourceSubscribers = null; - this.source = source; - } - /** - * Notifies all subscribers, based on the specified property. - * @param propertyName - The property name, passed along to subscribers during notification. - */ - return _createClass(PropertyChangeNotifier, [{ - key: "notify", - value: function notify(propertyName) { - var _a; - var subscribers = this.subscribers[propertyName]; - if (subscribers !== void 0) { - subscribers.notify(propertyName); - } - (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.notify(propertyName); - } - /** - * Subscribes to notification of changes in an object's state. - * @param subscriber - The object that is subscribing for change notification. - * @param propertyToWatch - The name of the property that the subscriber is interested in watching for changes. - */ - }, { - key: "subscribe", - value: function subscribe(subscriber, propertyToWatch) { - var _a; - if (propertyToWatch) { - var subscribers = this.subscribers[propertyToWatch]; - if (subscribers === void 0) { - this.subscribers[propertyToWatch] = subscribers = new SubscriberSet(this.source); - } - subscribers.subscribe(subscriber); - } else { - this.sourceSubscribers = (_a = this.sourceSubscribers) !== null && _a !== void 0 ? _a : new SubscriberSet(this.source); - this.sourceSubscribers.subscribe(subscriber); - } - } - /** - * Unsubscribes from notification of changes in an object's state. - * @param subscriber - The object that is unsubscribing from change notification. - * @param propertyToUnwatch - The name of the property that the subscriber is no longer interested in watching. - */ - }, { - key: "unsubscribe", - value: function unsubscribe(subscriber, propertyToUnwatch) { - var _a; - if (propertyToUnwatch) { - var subscribers = this.subscribers[propertyToUnwatch]; - if (subscribers !== void 0) { - subscribers.unsubscribe(subscriber); - } - } else { - (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.unsubscribe(subscriber); - } - } - }]); -}(); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/observation/observable.js -function observable_defineProperty(e, r, t) { return (r = observable_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } -function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } -function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } -function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } -function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } -function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } -function observable_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function observable_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, observable_toPropertyKey(o.key), o); } } -function observable_createClass(e, r, t) { return r && observable_defineProperties(e.prototype, r), t && observable_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function observable_toPropertyKey(t) { var i = observable_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function observable_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } - - - -/** - * Common Observable APIs. - * @public - */ -var Observable = FAST.getById(2 /* observable */, function () { - var volatileRegex = /(:|&&|\|\||if)/; - var notifierLookup = new WeakMap(); - var queueUpdate = DOM.queueUpdate; - var watcher = void 0; - var createArrayObserver = function createArrayObserver(array) { - throw new Error("Must call enableArrayObservation before observing arrays."); - }; - function getNotifier(source) { - var found = source.$fastController || notifierLookup.get(source); - if (found === void 0) { - if (Array.isArray(source)) { - found = createArrayObserver(source); - } else { - notifierLookup.set(source, found = new PropertyChangeNotifier(source)); - } - } - return found; - } - var getAccessors = createMetadataLocator(); - var DefaultObservableAccessor = /*#__PURE__*/function () { - function DefaultObservableAccessor(name) { - observable_classCallCheck(this, DefaultObservableAccessor); - this.name = name; - this.field = "_".concat(name); - this.callback = "".concat(name, "Changed"); - } - return observable_createClass(DefaultObservableAccessor, [{ - key: "getValue", - value: function getValue(source) { - if (watcher !== void 0) { - watcher.watch(source, this.name); - } - return source[this.field]; - } - }, { - key: "setValue", - value: function setValue(source, newValue) { - var field = this.field; - var oldValue = source[field]; - if (oldValue !== newValue) { - source[field] = newValue; - var callback = source[this.callback]; - if (typeof callback === "function") { - callback.call(source, oldValue, newValue); - } - getNotifier(source).notify(this.name); - } - } - }]); - }(); - var BindingObserverImplementation = /*#__PURE__*/function (_SubscriberSet) { - function BindingObserverImplementation(binding, initialSubscriber) { - var _this; - var isVolatileBinding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - observable_classCallCheck(this, BindingObserverImplementation); - _this = _callSuper(this, BindingObserverImplementation, [binding, initialSubscriber]); - _this.binding = binding; - _this.isVolatileBinding = isVolatileBinding; - _this.needsRefresh = true; - _this.needsQueue = true; - _this.first = _this; - _this.last = null; - _this.propertySource = void 0; - _this.propertyName = void 0; - _this.notifier = void 0; - _this.next = void 0; - return _this; - } - _inherits(BindingObserverImplementation, _SubscriberSet); - return observable_createClass(BindingObserverImplementation, [{ - key: "observe", - value: function observe(source, context) { - if (this.needsRefresh && this.last !== null) { - this.disconnect(); - } - var previousWatcher = watcher; - watcher = this.needsRefresh ? this : void 0; - this.needsRefresh = this.isVolatileBinding; - var result = this.binding(source, context); - watcher = previousWatcher; - return result; - } - }, { - key: "disconnect", - value: function disconnect() { - if (this.last !== null) { - var current = this.first; - while (current !== void 0) { - current.notifier.unsubscribe(this, current.propertyName); - current = current.next; - } - this.last = null; - this.needsRefresh = this.needsQueue = true; - } - } - }, { - key: "watch", - value: function watch(propertySource, propertyName) { - var prev = this.last; - var notifier = getNotifier(propertySource); - var current = prev === null ? this.first : {}; - current.propertySource = propertySource; - current.propertyName = propertyName; - current.notifier = notifier; - notifier.subscribe(this, propertyName); - if (prev !== null) { - if (!this.needsRefresh) { - // Declaring the variable prior to assignment below circumvents - // a bug in Angular's optimization process causing infinite recursion - // of this watch() method. Details https://github.com/microsoft/fast/issues/4969 - var prevValue; - watcher = void 0; - /* eslint-disable-next-line */ - prevValue = prev.propertySource[prev.propertyName]; - /* eslint-disable-next-line @typescript-eslint/no-this-alias */ - watcher = this; - if (propertySource === prevValue) { - this.needsRefresh = true; - } - } - prev.next = current; - } - this.last = current; - } - }, { - key: "handleChange", - value: function handleChange() { - if (this.needsQueue) { - this.needsQueue = false; - queueUpdate(this); - } - } - }, { - key: "call", - value: function call() { - if (this.last !== null) { - this.needsQueue = true; - this.notify(this); - } - } - }, { - key: "records", - value: function records() { - var _next = this.first; - return observable_defineProperty({ - next: function next() { - var current = _next; - if (current === undefined) { - return { - value: void 0, - done: true - }; - } else { - _next = _next.next; - return { - value: current, - done: false - }; - } - } - }, Symbol.iterator, function () { - return this; - }); - } - }]); - }(SubscriberSet); - return Object.freeze({ - /** - * @internal - * @param factory - The factory used to create array observers. - */ - setArrayObserverFactory: function setArrayObserverFactory(factory) { - createArrayObserver = factory; - }, - /** - * Gets a notifier for an object or Array. - * @param source - The object or Array to get the notifier for. - */ - getNotifier: getNotifier, - /** - * Records a property change for a source object. - * @param source - The object to record the change against. - * @param propertyName - The property to track as changed. - */ - track: function track(source, propertyName) { - if (watcher !== void 0) { - watcher.watch(source, propertyName); - } - }, - /** - * Notifies watchers that the currently executing property getter or function is volatile - * with respect to its observable dependencies. - */ - trackVolatile: function trackVolatile() { - if (watcher !== void 0) { - watcher.needsRefresh = true; - } - }, - /** - * Notifies subscribers of a source object of changes. - * @param source - the object to notify of changes. - * @param args - The change args to pass to subscribers. - */ - notify: function notify(source, args) { - getNotifier(source).notify(args); - }, - /** - * Defines an observable property on an object or prototype. - * @param target - The target object to define the observable on. - * @param nameOrAccessor - The name of the property to define as observable; - * or a custom accessor that specifies the property name and accessor implementation. - */ - defineProperty: function defineProperty(target, nameOrAccessor) { - if (typeof nameOrAccessor === "string") { - nameOrAccessor = new DefaultObservableAccessor(nameOrAccessor); - } - getAccessors(target).push(nameOrAccessor); - Reflect.defineProperty(target, nameOrAccessor.name, { - enumerable: true, - get: function get() { - return nameOrAccessor.getValue(this); - }, - set: function set(newValue) { - nameOrAccessor.setValue(this, newValue); - } - }); - }, - /** - * Finds all the observable accessors defined on the target, - * including its prototype chain. - * @param target - The target object to search for accessor on. - */ - getAccessors: getAccessors, - /** - * Creates a {@link BindingObserver} that can watch the - * provided {@link Binding} for changes. - * @param binding - The binding to observe. - * @param initialSubscriber - An initial subscriber to changes in the binding value. - * @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation. - */ - binding: function binding(_binding, initialSubscriber) { - var isVolatileBinding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.isVolatileBinding(_binding); - return new BindingObserverImplementation(_binding, initialSubscriber, isVolatileBinding); - }, - /** - * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated - * on every evaluation of the value. - * @param binding - The binding to inspect. - */ - isVolatileBinding: function isVolatileBinding(binding) { - return volatileRegex.test(binding.toString()); - } - }); -}); -/** - * Decorator: Defines an observable property on the target. - * @param target - The target to define the observable on. - * @param nameOrAccessor - The property name or accessor to define the observable as. - * @public - */ -function observable(target, nameOrAccessor) { - Observable.defineProperty(target, nameOrAccessor); -} -/** - * Decorator: Marks a property getter as having volatile observable dependencies. - * @param target - The target that the property is defined on. - * @param name - The property name. - * @param name - The existing descriptor. - * @public - */ -function observable_volatile(target, name, descriptor) { - return Object.assign({}, descriptor, { - get: function get() { - Observable.trackVolatile(); - return descriptor.get.apply(this); - } - }); -} -var contextEvent = FAST.getById(3 /* contextEvent */, function () { - var current = null; - return { - get: function get() { - return current; - }, - set: function set(event) { - current = event; - } - }; -}); -/** - * Provides additional contextual information available to behaviors and expressions. - * @public - */ -var ExecutionContext = /*#__PURE__*/function () { - function ExecutionContext() { - observable_classCallCheck(this, ExecutionContext); - /** - * The index of the current item within a repeat context. - */ - this.index = 0; - /** - * The length of the current collection within a repeat context. - */ - this.length = 0; - /** - * The parent data object within a repeat context. - */ - this.parent = null; - /** - * The parent execution context when in nested context scenarios. - */ - this.parentContext = null; - } - /** - * The current event within an event handler. - */ - return observable_createClass(ExecutionContext, [{ - key: "event", - get: function get() { - return contextEvent.get(); - } - /** - * Indicates whether the current item within a repeat context - * has an even index. - */ - }, { - key: "isEven", - get: function get() { - return this.index % 2 === 0; - } - /** - * Indicates whether the current item within a repeat context - * has an odd index. - */ - }, { - key: "isOdd", - get: function get() { - return this.index % 2 !== 0; - } - /** - * Indicates whether the current item within a repeat context - * is the first item in the collection. - */ - }, { - key: "isFirst", - get: function get() { - return this.index === 0; - } - /** - * Indicates whether the current item within a repeat context - * is somewhere in the middle of the collection. - */ - }, { - key: "isInMiddle", - get: function get() { - return !this.isFirst && !this.isLast; - } - /** - * Indicates whether the current item within a repeat context - * is the last item in the collection. - */ - }, { - key: "isLast", - get: function get() { - return this.index === this.length - 1; - } - /** - * Sets the event for the current execution context. - * @param event - The event to set. - * @internal - */ - }], [{ - key: "setEvent", - value: function setEvent(event) { - contextEvent.set(event); - } - }]); -}(); -Observable.defineProperty(ExecutionContext.prototype, "index"); -Observable.defineProperty(ExecutionContext.prototype, "length"); -/** - * The default execution context used in binding expressions. - * @public - */ -var defaultExecutionContext = Object.seal(new ExecutionContext()); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js -function element_styles_callSuper(t, o, e) { return o = element_styles_getPrototypeOf(o), element_styles_possibleConstructorReturn(t, element_styles_isNativeReflectConstruct() ? Reflect.construct(o, e || [], element_styles_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function element_styles_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return element_styles_assertThisInitialized(t); } -function element_styles_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function element_styles_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (element_styles_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } -function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = element_styles_getPrototypeOf(t));); return t; } -function element_styles_getPrototypeOf(t) { return element_styles_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, element_styles_getPrototypeOf(t); } -function element_styles_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && element_styles_setPrototypeOf(t, e); } -function element_styles_setPrototypeOf(t, e) { return element_styles_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, element_styles_setPrototypeOf(t, e); } -function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = element_styles_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } -function element_styles_toConsumableArray(r) { return element_styles_arrayWithoutHoles(r) || element_styles_iterableToArray(r) || element_styles_unsupportedIterableToArray(r) || element_styles_nonIterableSpread(); } -function element_styles_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function element_styles_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return element_styles_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? element_styles_arrayLikeToArray(r, a) : void 0; } } -function element_styles_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } -function element_styles_arrayWithoutHoles(r) { if (Array.isArray(r)) return element_styles_arrayLikeToArray(r); } -function element_styles_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } -function element_styles_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function element_styles_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, element_styles_toPropertyKey(o.key), o); } } -function element_styles_createClass(e, r, t) { return r && element_styles_defineProperties(e.prototype, r), t && element_styles_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function element_styles_toPropertyKey(t) { var i = element_styles_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function element_styles_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } - -/** - * Represents styles that can be applied to a custom element. - * @public - */ -var element_styles_ElementStyles = /*#__PURE__*/function () { - function ElementStyles() { - element_styles_classCallCheck(this, ElementStyles); - this.targets = new WeakSet(); - } - /** @internal */ - return element_styles_createClass(ElementStyles, [{ - key: "addStylesTo", - value: function addStylesTo(target) { - this.targets.add(target); - } - /** @internal */ - }, { - key: "removeStylesFrom", - value: function removeStylesFrom(target) { - this.targets.delete(target); - } - /** @internal */ - }, { - key: "isAttachedTo", - value: function isAttachedTo(target) { - return this.targets.has(target); - } - /** - * Associates behaviors with this set of styles. - * @param behaviors - The behaviors to associate. - */ - }, { - key: "withBehaviors", - value: function withBehaviors() { - for (var _len = arguments.length, behaviors = new Array(_len), _key = 0; _key < _len; _key++) { - behaviors[_key] = arguments[_key]; - } - this.behaviors = this.behaviors === null ? behaviors : this.behaviors.concat(behaviors); - return this; - } - }]); -}(); -/** - * Create ElementStyles from ComposableStyles. - */ -element_styles_ElementStyles.create = function () { - if (DOM.supportsAdoptedStyleSheets) { - var styleSheetCache = new Map(); - return function (styles) { - return ( - // eslint-disable-next-line @typescript-eslint/no-use-before-define - new AdoptedStyleSheetsStyles(styles, styleSheetCache) - ); - }; - } - // eslint-disable-next-line @typescript-eslint/no-use-before-define - return function (styles) { - return new StyleElementStyles(styles); - }; -}(); -function reduceStyles(styles) { - return styles.map(function (x) { - return x instanceof element_styles_ElementStyles ? reduceStyles(x.styles) : [x]; - }).reduce(function (prev, curr) { - return prev.concat(curr); - }, []); -} -function reduceBehaviors(styles) { - return styles.map(function (x) { - return x instanceof element_styles_ElementStyles ? x.behaviors : null; - }).reduce(function (prev, curr) { - if (curr === null) { - return prev; - } - if (prev === null) { - prev = []; - } - return prev.concat(curr); - }, null); -} -/** - * A Symbol that can be added to a CSSStyleSheet to cause it to be prepended (rather than appended) to adoptedStyleSheets. - * @public - */ -var prependToAdoptedStyleSheetsSymbol = Symbol("prependToAdoptedStyleSheets"); -function separateSheetsToPrepend(sheets) { - var prepend = []; - var append = []; - sheets.forEach(function (x) { - return (x[prependToAdoptedStyleSheetsSymbol] ? prepend : append).push(x); - }); - return { - prepend: prepend, - append: append - }; -} -var addAdoptedStyleSheets = function addAdoptedStyleSheets(target, sheets) { - var _separateSheetsToPrep = separateSheetsToPrepend(sheets), - prepend = _separateSheetsToPrep.prepend, - append = _separateSheetsToPrep.append; - target.adoptedStyleSheets = [].concat(element_styles_toConsumableArray(prepend), element_styles_toConsumableArray(target.adoptedStyleSheets), element_styles_toConsumableArray(append)); -}; -var removeAdoptedStyleSheets = function removeAdoptedStyleSheets(target, sheets) { - target.adoptedStyleSheets = target.adoptedStyleSheets.filter(function (x) { - return sheets.indexOf(x) === -1; - }); -}; -if (DOM.supportsAdoptedStyleSheets) { - try { - // Test if browser implementation uses FrozenArray. - // If not, use push / splice to alter the stylesheets - // in place. This circumvents a bug in Safari 16.4 where - // periodically, assigning the array would previously - // cause sheets to be removed. - document.adoptedStyleSheets.push(); - document.adoptedStyleSheets.splice(); - addAdoptedStyleSheets = function addAdoptedStyleSheets(target, sheets) { - var _target$adoptedStyleS, _target$adoptedStyleS2; - var _separateSheetsToPrep2 = separateSheetsToPrepend(sheets), - prepend = _separateSheetsToPrep2.prepend, - append = _separateSheetsToPrep2.append; - (_target$adoptedStyleS = target.adoptedStyleSheets).splice.apply(_target$adoptedStyleS, [0, 0].concat(element_styles_toConsumableArray(prepend))); - (_target$adoptedStyleS2 = target.adoptedStyleSheets).push.apply(_target$adoptedStyleS2, element_styles_toConsumableArray(append)); - }; - removeAdoptedStyleSheets = function removeAdoptedStyleSheets(target, sheets) { - var _iterator = _createForOfIteratorHelper(sheets), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var sheet = _step.value; - var index = target.adoptedStyleSheets.indexOf(sheet); - if (index !== -1) { - target.adoptedStyleSheets.splice(index, 1); - } - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - }; - } catch (e) { - // Do nothing if an error is thrown, the default - // case handles FrozenArray. - } -} -/** - * https://wicg.github.io/construct-stylesheets/ - * https://developers.google.com/web/updates/2019/02/constructable-stylesheets - * - * @internal - */ -var AdoptedStyleSheetsStyles = /*#__PURE__*/function (_ElementStyles) { - function AdoptedStyleSheetsStyles(styles, styleSheetCache) { - var _this; - element_styles_classCallCheck(this, AdoptedStyleSheetsStyles); - _this = element_styles_callSuper(this, AdoptedStyleSheetsStyles); - _this.styles = styles; - _this.styleSheetCache = styleSheetCache; - _this._styleSheets = void 0; - _this.behaviors = reduceBehaviors(styles); - return _this; - } - element_styles_inherits(AdoptedStyleSheetsStyles, _ElementStyles); - return element_styles_createClass(AdoptedStyleSheetsStyles, [{ - key: "styleSheets", - get: function get() { - if (this._styleSheets === void 0) { - var styles = this.styles; - var styleSheetCache = this.styleSheetCache; - this._styleSheets = reduceStyles(styles).map(function (x) { - if (x instanceof CSSStyleSheet) { - return x; - } - var sheet = styleSheetCache.get(x); - if (sheet === void 0) { - sheet = new CSSStyleSheet(); - sheet.replaceSync(x); - styleSheetCache.set(x, sheet); - } - return sheet; - }); - } - return this._styleSheets; - } - }, { - key: "addStylesTo", - value: function addStylesTo(target) { - addAdoptedStyleSheets(target, this.styleSheets); - _get(element_styles_getPrototypeOf(AdoptedStyleSheetsStyles.prototype), "addStylesTo", this).call(this, target); - } - }, { - key: "removeStylesFrom", - value: function removeStylesFrom(target) { - removeAdoptedStyleSheets(target, this.styleSheets); - _get(element_styles_getPrototypeOf(AdoptedStyleSheetsStyles.prototype), "removeStylesFrom", this).call(this, target); - } - }]); -}(element_styles_ElementStyles); -var styleClassId = 0; -function getNextStyleClass() { - return "fast-style-class-".concat(++styleClassId); -} -/** - * @internal - */ -var StyleElementStyles = /*#__PURE__*/function (_ElementStyles2) { - function StyleElementStyles(styles) { - var _this2; - element_styles_classCallCheck(this, StyleElementStyles); - _this2 = element_styles_callSuper(this, StyleElementStyles); - _this2.styles = styles; - _this2.behaviors = null; - _this2.behaviors = reduceBehaviors(styles); - _this2.styleSheets = reduceStyles(styles); - _this2.styleClass = getNextStyleClass(); - return _this2; - } - element_styles_inherits(StyleElementStyles, _ElementStyles2); - return element_styles_createClass(StyleElementStyles, [{ - key: "addStylesTo", - value: function addStylesTo(target) { - var styleSheets = this.styleSheets; - var styleClass = this.styleClass; - target = this.normalizeTarget(target); - for (var i = 0; i < styleSheets.length; i++) { - var element = document.createElement("style"); - element.innerHTML = styleSheets[i]; - element.className = styleClass; - target.append(element); - } - _get(element_styles_getPrototypeOf(StyleElementStyles.prototype), "addStylesTo", this).call(this, target); - } - }, { - key: "removeStylesFrom", - value: function removeStylesFrom(target) { - target = this.normalizeTarget(target); - var styles = target.querySelectorAll(".".concat(this.styleClass)); - for (var i = 0, ii = styles.length; i < ii; ++i) { - target.removeChild(styles[i]); - } - _get(element_styles_getPrototypeOf(StyleElementStyles.prototype), "removeStylesFrom", this).call(this, target); - } - }, { - key: "isAttachedTo", - value: function isAttachedTo(target) { - return _get(element_styles_getPrototypeOf(StyleElementStyles.prototype), "isAttachedTo", this).call(this, this.normalizeTarget(target)); - } - }, { - key: "normalizeTarget", - value: function normalizeTarget(target) { - return target === document ? document.body : target; - } - }]); -}(element_styles_ElementStyles); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/components/attributes.js -function attributes_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function attributes_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, attributes_toPropertyKey(o.key), o); } } -function attributes_createClass(e, r, t) { return r && attributes_defineProperties(e.prototype, r), t && attributes_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function attributes_toPropertyKey(t) { var i = attributes_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function attributes_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } - - - -/** - * Metadata used to configure a custom attribute's behavior. - * @public - */ -var AttributeConfiguration = Object.freeze({ - /** - * Locates all attribute configurations associated with a type. - */ - locate: createMetadataLocator() -}); -/** - * A {@link ValueConverter} that converts to and from `boolean` values. - * @remarks - * Used automatically when the `boolean` {@link AttributeMode} is selected. - * @public - */ -var booleanConverter = { - toView: function toView(value) { - return value ? "true" : "false"; - }, - fromView: function fromView(value) { - if (value === null || value === void 0 || value === "false" || value === false || value === 0) { - return false; - } - return true; - } -}; -/** - * A {@link ValueConverter} that converts to and from `number` values. - * @remarks - * This converter allows for nullable numbers, returning `null` if the - * input was `null`, `undefined`, or `NaN`. - * @public - */ -var nullableNumberConverter = { - toView: function toView(value) { - if (value === null || value === undefined) { - return null; - } - var number = value * 1; - return isNaN(number) ? null : number.toString(); - }, - fromView: function fromView(value) { - if (value === null || value === undefined) { - return null; - } - var number = value * 1; - return isNaN(number) ? null : number; - } -}; -/** - * An implementation of {@link Accessor} that supports reactivity, - * change callbacks, attribute reflection, and type conversion for - * custom elements. - * @public - */ -var AttributeDefinition = /*#__PURE__*/function () { - /** - * Creates an instance of AttributeDefinition. - * @param Owner - The class constructor that owns this attribute. - * @param name - The name of the property associated with the attribute. - * @param attribute - The name of the attribute in HTML. - * @param mode - The {@link AttributeMode} that describes the behavior of this attribute. - * @param converter - A {@link ValueConverter} that integrates with the property getter/setter - * to convert values to and from a DOM string. - */ - function AttributeDefinition(Owner, name) { - var attribute = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : name.toLowerCase(); - var mode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "reflect"; - var converter = arguments.length > 4 ? arguments[4] : undefined; - attributes_classCallCheck(this, AttributeDefinition); - this.guards = new Set(); - this.Owner = Owner; - this.name = name; - this.attribute = attribute; - this.mode = mode; - this.converter = converter; - this.fieldName = "_".concat(name); - this.callbackName = "".concat(name, "Changed"); - this.hasCallback = this.callbackName in Owner.prototype; - if (mode === "boolean" && converter === void 0) { - this.converter = booleanConverter; - } - } - /** - * Sets the value of the attribute/property on the source element. - * @param source - The source element to access. - * @param value - The value to set the attribute/property to. - */ - return attributes_createClass(AttributeDefinition, [{ - key: "setValue", - value: function setValue(source, newValue) { - var oldValue = source[this.fieldName]; - var converter = this.converter; - if (converter !== void 0) { - newValue = converter.fromView(newValue); - } - if (oldValue !== newValue) { - source[this.fieldName] = newValue; - this.tryReflectToAttribute(source); - if (this.hasCallback) { - source[this.callbackName](oldValue, newValue); - } - source.$fastController.notify(this.name); - } - } - /** - * Gets the value of the attribute/property on the source element. - * @param source - The source element to access. - */ - }, { - key: "getValue", - value: function getValue(source) { - Observable.track(source, this.name); - return source[this.fieldName]; - } - /** @internal */ - }, { - key: "onAttributeChangedCallback", - value: function onAttributeChangedCallback(element, value) { - if (this.guards.has(element)) { - return; - } - this.guards.add(element); - this.setValue(element, value); - this.guards.delete(element); - } - }, { - key: "tryReflectToAttribute", - value: function tryReflectToAttribute(element) { - var _this = this; - var mode = this.mode; - var guards = this.guards; - if (guards.has(element) || mode === "fromView") { - return; - } - DOM.queueUpdate(function () { - guards.add(element); - var latestValue = element[_this.fieldName]; - switch (mode) { - case "reflect": - var converter = _this.converter; - DOM.setAttribute(element, _this.attribute, converter !== void 0 ? converter.toView(latestValue) : latestValue); - break; - case "boolean": - DOM.setBooleanAttribute(element, _this.attribute, latestValue); - break; - } - guards.delete(element); - }); - } - /** - * Collects all attribute definitions associated with the owner. - * @param Owner - The class constructor to collect attribute for. - * @param attributeLists - Any existing attributes to collect and merge with those associated with the owner. - * @internal - */ - }], [{ - key: "collect", - value: function collect(Owner) { - var attributes = []; - for (var _len = arguments.length, attributeLists = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - attributeLists[_key - 1] = arguments[_key]; - } - attributeLists.push(AttributeConfiguration.locate(Owner)); - for (var i = 0, ii = attributeLists.length; i < ii; ++i) { - var list = attributeLists[i]; - if (list === void 0) { - continue; - } - for (var j = 0, jj = list.length; j < jj; ++j) { - var config = list[j]; - if (typeof config === "string") { - attributes.push(new AttributeDefinition(Owner, config)); - } else { - attributes.push(new AttributeDefinition(Owner, config.property, config.attribute, config.mode, config.converter)); - } - } - } - return attributes; - } - }]); -}(); -function attr(configOrTarget, prop) { - var config; - function decorator($target, $prop) { - if (arguments.length > 1) { - // Non invocation: - // - @attr - // Invocation with or w/o opts: - // - @attr() - // - @attr({...opts}) - config.property = $prop; - } - AttributeConfiguration.locate($target.constructor).push(config); - } - if (arguments.length > 1) { - // Non invocation: - // - @attr - config = {}; - decorator(configOrTarget, prop); - return; - } - // Invocation with or w/o opts: - // - @attr() - // - @attr({...opts}) - config = configOrTarget === void 0 ? {} : configOrTarget; - return decorator; -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js -function fast_definitions_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function fast_definitions_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, fast_definitions_toPropertyKey(o.key), o); } } -function fast_definitions_createClass(e, r, t) { return r && fast_definitions_defineProperties(e.prototype, r), t && fast_definitions_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function fast_definitions_toPropertyKey(t) { var i = fast_definitions_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function fast_definitions_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } - - - - -var defaultShadowOptions = { - mode: "open" -}; -var defaultElementOptions = {}; -var fastRegistry = FAST.getById(4 /* elementRegistry */, function () { - var typeToDefinition = new Map(); - return Object.freeze({ - register: function register(definition) { - if (typeToDefinition.has(definition.type)) { - return false; - } - typeToDefinition.set(definition.type, definition); - return true; - }, - getByType: function getByType(key) { - return typeToDefinition.get(key); - } - }); -}); -/** - * Defines metadata for a FASTElement. - * @public - */ -var fast_definitions_FASTElementDefinition = /*#__PURE__*/function () { - /** - * Creates an instance of FASTElementDefinition. - * @param type - The type this definition is being created for. - * @param nameOrConfig - The name of the element to define or a config object - * that describes the element to define. - */ - function FASTElementDefinition(type) { - var nameOrConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : type.definition; - fast_definitions_classCallCheck(this, FASTElementDefinition); - if (typeof nameOrConfig === "string") { - nameOrConfig = { - name: nameOrConfig - }; - } - this.type = type; - this.name = nameOrConfig.name; - this.template = nameOrConfig.template; - var attributes = AttributeDefinition.collect(type, nameOrConfig.attributes); - var observedAttributes = new Array(attributes.length); - var propertyLookup = {}; - var attributeLookup = {}; - for (var i = 0, ii = attributes.length; i < ii; ++i) { - var current = attributes[i]; - observedAttributes[i] = current.attribute; - propertyLookup[current.name] = current; - attributeLookup[current.attribute] = current; - } - this.attributes = attributes; - this.observedAttributes = observedAttributes; - this.propertyLookup = propertyLookup; - this.attributeLookup = attributeLookup; - this.shadowOptions = nameOrConfig.shadowOptions === void 0 ? defaultShadowOptions : nameOrConfig.shadowOptions === null ? void 0 : Object.assign(Object.assign({}, defaultShadowOptions), nameOrConfig.shadowOptions); - this.elementOptions = nameOrConfig.elementOptions === void 0 ? defaultElementOptions : Object.assign(Object.assign({}, defaultElementOptions), nameOrConfig.elementOptions); - this.styles = nameOrConfig.styles === void 0 ? void 0 : Array.isArray(nameOrConfig.styles) ? element_styles_ElementStyles.create(nameOrConfig.styles) : nameOrConfig.styles instanceof element_styles_ElementStyles ? nameOrConfig.styles : element_styles_ElementStyles.create([nameOrConfig.styles]); - } - /** - * Indicates if this element has been defined in at least one registry. - */ - return fast_definitions_createClass(FASTElementDefinition, [{ - key: "isDefined", - get: function get() { - return !!fastRegistry.getByType(this.type); - } - /** - * Defines a custom element based on this definition. - * @param registry - The element registry to define the element in. - */ - }, { - key: "define", - value: function define() { - var registry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : customElements; - var type = this.type; - if (fastRegistry.register(this)) { - var attributes = this.attributes; - var proto = type.prototype; - for (var i = 0, ii = attributes.length; i < ii; ++i) { - Observable.defineProperty(proto, attributes[i]); - } - Reflect.defineProperty(type, "observedAttributes", { - value: this.observedAttributes, - enumerable: true - }); - } - if (!registry.get(this.name)) { - registry.define(this.name, type, this.elementOptions); - } - return this; - } - }]); -}(); -/** - * Gets the element definition associated with the specified type. - * @param type - The custom element type to retrieve the definition for. - */ -fast_definitions_FASTElementDefinition.forType = fastRegistry.getByType; -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise */ - -var _extendStatics = function extendStatics(d, b) { - _extendStatics = Object.setPrototypeOf || { - __proto__: [] - } instanceof Array && function (d, b) { - d.__proto__ = b; - } || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - }; - return _extendStatics(d, b); -}; -function __extends(d, b) { - _extendStatics(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -var _assign = function __assign() { - _assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - return _assign.apply(this, arguments); -}; - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; - } - return t; -} -function __decorate(decorators, target, key, desc) { - var c = arguments.length, - r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, - d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} -function __param(paramIndex, decorator) { - return function (target, key) { - decorator(target, key, paramIndex); - }; -} -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function (resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { - label: 0, - sent: function sent() { - if (t[0] & 1) throw t[1]; - return t[1]; - }, - trys: [], - ops: [] - }, - f, - y, - t, - g; - return g = { - next: verb(0), - "throw": verb(1), - "return": verb(2) - }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { - return this; - }), g; - function verb(n) { - return function (v) { - return step([n, v]); - }; - } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: - case 1: - t = op; - break; - case 4: - _.label++; - return { - value: op[1], - done: false - }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } catch (e) { - op = [6, e]; - y = 0; - } finally { - f = t = 0; - } - if (op[0] & 5) throw op[1]; - return { - value: op[0] ? op[1] : void 0, - done: true - }; - } -} -function __createBinding(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -} -function __exportStar(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; -} -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, - m = s && o[s], - i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function next() { - if (o && i >= o.length) o = void 0; - return { - value: o && o[i++], - done: !o - }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), - r, - ar = [], - e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } catch (error) { - e = { - error: error - }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); - return ar; -} -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; - return r; -} -; -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), - i, - q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function (v) { - return new Promise(function (a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); - } - function fulfill(value) { - resume("next", value); - } - function reject(value) { - resume("throw", value); - } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); - } -} -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { - throw e; - }), verb("return"), i[Symbol.iterator] = function () { - return this; - }, i; - function verb(n, f) { - i[n] = o[n] ? function (v) { - return (p = !p) ? { - value: __await(o[n](v)), - done: n === "return" - } : f ? f(v) : v; - } : f; - } -} -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], - i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { - return this; - }, i); - function verb(n) { - i[n] = o[n] && function (v) { - return new Promise(function (resolve, reject) { - v = o[n](v), settle(resolve, reject, v.done, v.value); - }); - }; - } - function settle(resolve, reject, d, v) { - Promise.resolve(v).then(function (v) { - resolve({ - value: v, - done: d - }); - }, reject); - } -} -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { - value: raw - }); - } else { - cooked.raw = raw; - } - return cooked; -} -; -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result.default = mod; - return result; -} -function __importDefault(mod) { - return mod && mod.__esModule ? mod : { - default: mod - }; -} -function __classPrivateFieldGet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - return privateMap.get(receiver); -} -function __classPrivateFieldSet(receiver, privateMap, value) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - privateMap.set(receiver, value); - return value; -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/components/controller.js -function controller_slicedToArray(r, e) { return controller_arrayWithHoles(r) || controller_iterableToArrayLimit(r, e) || controller_unsupportedIterableToArray(r, e) || controller_nonIterableRest(); } -function controller_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function controller_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } -function controller_arrayWithHoles(r) { if (Array.isArray(r)) return r; } -function controller_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = controller_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } -function controller_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return controller_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? controller_arrayLikeToArray(r, a) : void 0; } } -function controller_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } -function controller_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function controller_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, controller_toPropertyKey(o.key), o); } } -function controller_createClass(e, r, t) { return r && controller_defineProperties(e.prototype, r), t && controller_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function controller_toPropertyKey(t) { var i = controller_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function controller_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function controller_callSuper(t, o, e) { return o = controller_getPrototypeOf(o), controller_possibleConstructorReturn(t, controller_isNativeReflectConstruct() ? Reflect.construct(o, e || [], controller_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function controller_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return controller_assertThisInitialized(t); } -function controller_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function controller_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (controller_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function controller_getPrototypeOf(t) { return controller_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, controller_getPrototypeOf(t); } -function controller_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && controller_setPrototypeOf(t, e); } -function controller_setPrototypeOf(t, e) { return controller_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, controller_setPrototypeOf(t, e); } - - - - -var shadowRoots = new WeakMap(); -var defaultEventOptions = { - bubbles: true, - composed: true, - cancelable: true -}; -function getShadowRoot(element) { - return element.shadowRoot || shadowRoots.get(element) || null; -} -/** - * Controls the lifecycle and rendering of a `FASTElement`. - * @public - */ -var Controller = /*#__PURE__*/function (_PropertyChangeNotifi) { - /** - * Creates a Controller to control the specified element. - * @param element - The element to be controlled by this controller. - * @param definition - The element definition metadata that instructs this - * controller in how to handle rendering and other platform integrations. - * @internal - */ - function Controller(element, definition) { - var _this; - controller_classCallCheck(this, Controller); - _this = controller_callSuper(this, Controller, [element]); - _this.boundObservables = null; - _this.behaviors = null; - _this.needsInitialization = true; - _this._template = null; - _this._styles = null; - _this._isConnected = false; - /** - * This allows Observable.getNotifier(...) to return the Controller - * when the notifier for the Controller itself is being requested. The - * result is that the Observable system does not need to create a separate - * instance of Notifier for observables on the Controller. The component and - * the controller will now share the same notifier, removing one-object construct - * per web component instance. - */ - _this.$fastController = _this; - /** - * The view associated with the custom element. - * @remarks - * If `null` then the element is managing its own rendering. - */ - _this.view = null; - _this.element = element; - _this.definition = definition; - var shadowOptions = definition.shadowOptions; - if (shadowOptions !== void 0) { - var shadowRoot = element.attachShadow(shadowOptions); - if (shadowOptions.mode === "closed") { - shadowRoots.set(element, shadowRoot); - } - } - // Capture any observable values that were set by the binding engine before - // the browser upgraded the element. Then delete the property since it will - // shadow the getter/setter that is required to make the observable operate. - // Later, in the connect callback, we'll re-apply the values. - var accessors = Observable.getAccessors(element); - if (accessors.length > 0) { - var boundObservables = _this.boundObservables = Object.create(null); - for (var i = 0, ii = accessors.length; i < ii; ++i) { - var propertyName = accessors[i].name; - var value = element[propertyName]; - if (value !== void 0) { - delete element[propertyName]; - boundObservables[propertyName] = value; - } - } - } - return _this; - } - /** - * Indicates whether or not the custom element has been - * connected to the document. - */ - controller_inherits(Controller, _PropertyChangeNotifi); - return controller_createClass(Controller, [{ - key: "isConnected", - get: function get() { - Observable.track(this, "isConnected"); - return this._isConnected; - } - }, { - key: "setIsConnected", - value: function setIsConnected(value) { - this._isConnected = value; - Observable.notify(this, "isConnected"); - } - /** - * Gets/sets the template used to render the component. - * @remarks - * This value can only be accurately read after connect but can be set at any time. - */ - }, { - key: "template", - get: function get() { - return this._template; - }, - set: function set(value) { - if (this._template === value) { - return; - } - this._template = value; - if (!this.needsInitialization) { - this.renderTemplate(value); - } - } - /** - * Gets/sets the primary styles used for the component. - * @remarks - * This value can only be accurately read after connect but can be set at any time. - */ - }, { - key: "styles", - get: function get() { - return this._styles; - }, - set: function set(value) { - if (this._styles === value) { - return; - } - if (this._styles !== null) { - this.removeStyles(this._styles); - } - this._styles = value; - if (!this.needsInitialization && value !== null) { - this.addStyles(value); - } - } - /** - * Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot. - * @param styles - The styles to add. - */ - }, { - key: "addStyles", - value: function addStyles(styles) { - var target = getShadowRoot(this.element) || this.element.getRootNode(); - if (styles instanceof HTMLStyleElement) { - target.append(styles); - } else if (!styles.isAttachedTo(target)) { - var sourceBehaviors = styles.behaviors; - styles.addStylesTo(target); - if (sourceBehaviors !== null) { - this.addBehaviors(sourceBehaviors); - } - } - } - /** - * Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot. - * @param styles - the styles to remove. - */ - }, { - key: "removeStyles", - value: function removeStyles(styles) { - var target = getShadowRoot(this.element) || this.element.getRootNode(); - if (styles instanceof HTMLStyleElement) { - target.removeChild(styles); - } else if (styles.isAttachedTo(target)) { - var sourceBehaviors = styles.behaviors; - styles.removeStylesFrom(target); - if (sourceBehaviors !== null) { - this.removeBehaviors(sourceBehaviors); - } - } - } - /** - * Adds behaviors to this element. - * @param behaviors - The behaviors to add. - */ - }, { - key: "addBehaviors", - value: function addBehaviors(behaviors) { - var targetBehaviors = this.behaviors || (this.behaviors = new Map()); - var length = behaviors.length; - var behaviorsToBind = []; - for (var i = 0; i < length; ++i) { - var behavior = behaviors[i]; - if (targetBehaviors.has(behavior)) { - targetBehaviors.set(behavior, targetBehaviors.get(behavior) + 1); - } else { - targetBehaviors.set(behavior, 1); - behaviorsToBind.push(behavior); - } - } - if (this._isConnected) { - var element = this.element; - for (var _i = 0; _i < behaviorsToBind.length; ++_i) { - behaviorsToBind[_i].bind(element, defaultExecutionContext); - } - } - } - /** - * Removes behaviors from this element. - * @param behaviors - The behaviors to remove. - * @param force - Forces unbinding of behaviors. - */ - }, { - key: "removeBehaviors", - value: function removeBehaviors(behaviors) { - var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var targetBehaviors = this.behaviors; - if (targetBehaviors === null) { - return; - } - var length = behaviors.length; - var behaviorsToUnbind = []; - for (var i = 0; i < length; ++i) { - var behavior = behaviors[i]; - if (targetBehaviors.has(behavior)) { - var count = targetBehaviors.get(behavior) - 1; - count === 0 || force ? targetBehaviors.delete(behavior) && behaviorsToUnbind.push(behavior) : targetBehaviors.set(behavior, count); - } - } - if (this._isConnected) { - var element = this.element; - for (var _i2 = 0; _i2 < behaviorsToUnbind.length; ++_i2) { - behaviorsToUnbind[_i2].unbind(element); - } - } - } - /** - * Runs connected lifecycle behavior on the associated element. - */ - }, { - key: "onConnectedCallback", - value: function onConnectedCallback() { - if (this._isConnected) { - return; - } - var element = this.element; - if (this.needsInitialization) { - this.finishInitialization(); - } else if (this.view !== null) { - this.view.bind(element, defaultExecutionContext); - } - var behaviors = this.behaviors; - if (behaviors !== null) { - var _iterator = controller_createForOfIteratorHelper(behaviors), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var _step$value = controller_slicedToArray(_step.value, 1), - behavior = _step$value[0]; - behavior.bind(element, defaultExecutionContext); - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - } - this.setIsConnected(true); - } - /** - * Runs disconnected lifecycle behavior on the associated element. - */ - }, { - key: "onDisconnectedCallback", - value: function onDisconnectedCallback() { - if (!this._isConnected) { - return; - } - this.setIsConnected(false); - var view = this.view; - if (view !== null) { - view.unbind(); - } - var behaviors = this.behaviors; - if (behaviors !== null) { - var element = this.element; - var _iterator2 = controller_createForOfIteratorHelper(behaviors), - _step2; - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - var _step2$value = controller_slicedToArray(_step2.value, 1), - behavior = _step2$value[0]; - behavior.unbind(element); - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } - } - } - /** - * Runs the attribute changed callback for the associated element. - * @param name - The name of the attribute that changed. - * @param oldValue - The previous value of the attribute. - * @param newValue - The new value of the attribute. - */ - }, { - key: "onAttributeChangedCallback", - value: function onAttributeChangedCallback(name, oldValue, newValue) { - var attrDef = this.definition.attributeLookup[name]; - if (attrDef !== void 0) { - attrDef.onAttributeChangedCallback(this.element, newValue); - } - } - /** - * Emits a custom HTML event. - * @param type - The type name of the event. - * @param detail - The event detail object to send with the event. - * @param options - The event options. By default bubbles and composed. - * @remarks - * Only emits events if connected. - */ - }, { - key: "emit", - value: function emit(type, detail, options) { - if (this._isConnected) { - return this.element.dispatchEvent(new CustomEvent(type, Object.assign(Object.assign({ - detail: detail - }, defaultEventOptions), options))); - } - return false; - } - }, { - key: "finishInitialization", - value: function finishInitialization() { - var element = this.element; - var boundObservables = this.boundObservables; - // If we have any observables that were bound, re-apply their values. - if (boundObservables !== null) { - var propertyNames = Object.keys(boundObservables); - for (var i = 0, ii = propertyNames.length; i < ii; ++i) { - var propertyName = propertyNames[i]; - element[propertyName] = boundObservables[propertyName]; - } - this.boundObservables = null; - } - var definition = this.definition; - // 1. Template overrides take top precedence. - if (this._template === null) { - if (this.element.resolveTemplate) { - // 2. Allow for element instance overrides next. - this._template = this.element.resolveTemplate(); - } else if (definition.template) { - // 3. Default to the static definition. - this._template = definition.template || null; - } - } - // If we have a template after the above process, render it. - // If there's no template, then the element author has opted into - // custom rendering and they will managed the shadow root's content themselves. - if (this._template !== null) { - this.renderTemplate(this._template); - } - // 1. Styles overrides take top precedence. - if (this._styles === null) { - if (this.element.resolveStyles) { - // 2. Allow for element instance overrides next. - this._styles = this.element.resolveStyles(); - } else if (definition.styles) { - // 3. Default to the static definition. - this._styles = definition.styles || null; - } - } - // If we have styles after the above process, add them. - if (this._styles !== null) { - this.addStyles(this._styles); - } - this.needsInitialization = false; - } - }, { - key: "renderTemplate", - value: function renderTemplate(template) { - var element = this.element; - // When getting the host to render to, we start by looking - // up the shadow root. If there isn't one, then that means - // we're doing a Light DOM render to the element's direct children. - var host = getShadowRoot(element) || element; - if (this.view !== null) { - // If there's already a view, we need to unbind and remove through dispose. - this.view.dispose(); - this.view = null; - } else if (!this.needsInitialization) { - // If there was previous custom rendering, we need to clear out the host. - DOM.removeChildNodes(host); - } - if (template) { - // If a new template was provided, render it. - this.view = template.render(element, host, element); - } - } - /** - * Locates or creates a controller for the specified element. - * @param element - The element to return the controller for. - * @remarks - * The specified element must have a {@link FASTElementDefinition} - * registered either through the use of the {@link customElement} - * decorator or a call to `FASTElement.define`. - */ - }], [{ - key: "forCustomElement", - value: function forCustomElement(element) { - var controller = element.$fastController; - if (controller !== void 0) { - return controller; - } - var definition = fast_definitions_FASTElementDefinition.forType(element.constructor); - if (definition === void 0) { - throw new Error("Missing FASTElement definition."); - } - return element.$fastController = new Controller(element, definition); - } - }]); -}(PropertyChangeNotifier); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js -function fast_element_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function fast_element_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, fast_element_toPropertyKey(o.key), o); } } -function fast_element_createClass(e, r, t) { return r && fast_element_defineProperties(e.prototype, r), t && fast_element_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function fast_element_toPropertyKey(t) { var i = fast_element_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function fast_element_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function fast_element_callSuper(t, o, e) { return o = fast_element_getPrototypeOf(o), fast_element_possibleConstructorReturn(t, fast_element_isNativeReflectConstruct() ? Reflect.construct(o, e || [], fast_element_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function fast_element_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return fast_element_assertThisInitialized(t); } -function fast_element_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function fast_element_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (fast_element_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function fast_element_getPrototypeOf(t) { return fast_element_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, fast_element_getPrototypeOf(t); } -function fast_element_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && fast_element_setPrototypeOf(t, e); } -function fast_element_setPrototypeOf(t, e) { return fast_element_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, fast_element_setPrototypeOf(t, e); } - - -/* eslint-disable-next-line @typescript-eslint/explicit-function-return-type */ -function createFASTElement(BaseType) { - return /*#__PURE__*/function (_BaseType) { - function _class() { - var _this; - fast_element_classCallCheck(this, _class); - /* eslint-disable-next-line */ - _this = fast_element_callSuper(this, _class); - Controller.forCustomElement(_this); - return _this; - } - fast_element_inherits(_class, _BaseType); - return fast_element_createClass(_class, [{ - key: "$emit", - value: function $emit(type, detail, options) { - return this.$fastController.emit(type, detail, options); - } - }, { - key: "connectedCallback", - value: function connectedCallback() { - this.$fastController.onConnectedCallback(); - } - }, { - key: "disconnectedCallback", - value: function disconnectedCallback() { - this.$fastController.onDisconnectedCallback(); - } - }, { - key: "attributeChangedCallback", - value: function attributeChangedCallback(name, oldValue, newValue) { - this.$fastController.onAttributeChangedCallback(name, oldValue, newValue); - } - }]); - }(BaseType); -} -/** - * A minimal base class for FASTElements that also provides - * static helpers for working with FASTElements. - * @public - */ -var FASTElement = Object.assign(createFASTElement(HTMLElement), { - /** - * Creates a new FASTElement base class inherited from the - * provided base type. - * @param BaseType - The base element type to inherit from. - */ - from: function from(BaseType) { - return createFASTElement(BaseType); - }, - /** - * Defines a platform custom element based on the provided type and definition. - * @param type - The custom element type to define. - * @param nameOrDef - The name of the element to define or a definition object - * that describes the element to define. - */ - define: function define(type, nameOrDef) { - return new fast_definitions_FASTElementDefinition(type, nameOrDef).define().type; - } -}); -/** - * Decorator: Defines a platform custom element based on `FASTElement`. - * @param nameOrDef - The name of the element to define or a definition object - * that describes the element to define. - * @public - */ -function customElement(nameOrDef) { - /* eslint-disable-next-line @typescript-eslint/explicit-function-return-type */ - return function (type) { - new FASTElementDefinition(type, nameOrDef).define(); - }; -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/di/di.js -function _construct(t, e, r) { if (di_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && di_setPrototypeOf(p, r.prototype), p; } -function di_setPrototypeOf(t, e) { return di_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, di_setPrototypeOf(t, e); } -function di_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (di_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function di_toConsumableArray(r) { return di_arrayWithoutHoles(r) || di_iterableToArray(r) || di_unsupportedIterableToArray(r) || di_nonIterableSpread(); } -function di_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function di_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return di_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? di_arrayLikeToArray(r, a) : void 0; } } -function di_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } -function di_arrayWithoutHoles(r) { if (Array.isArray(r)) return di_arrayLikeToArray(r); } -function di_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } -function di_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function di_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, di_toPropertyKey(o.key), o); } } -function di_createClass(e, r, t) { return r && di_defineProperties(e.prototype, r), t && di_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function di_toPropertyKey(t) { var i = di_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function di_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -/** - * Big thanks to https://github.com/fkleuver and the https://github.com/aurelia/aurelia project - * for the bulk of this code and many of the associated tests. - */ - -// Tiny polyfill for TypeScript's Reflect metadata API. -var metadataByTarget = new Map(); -if (!("metadata" in Reflect)) { - Reflect.metadata = function (key, value) { - return function (target) { - Reflect.defineMetadata(key, value, target); - }; - }; - Reflect.defineMetadata = function (key, value, target) { - var metadata = metadataByTarget.get(target); - if (metadata === void 0) { - metadataByTarget.set(target, metadata = new Map()); - } - metadata.set(key, value); - }; - Reflect.getOwnMetadata = function (key, target) { - var metadata = metadataByTarget.get(target); - if (metadata !== void 0) { - return metadata.get(key); - } - return void 0; - }; -} -/** - * A utility class used that constructs and registers resolvers for a dependency - * injection container. Supports a standard set of object lifetimes. - * @public - */ -var ResolverBuilder = /*#__PURE__*/function () { - /** - * - * @param container - The container to create resolvers for. - * @param key - The key to register resolvers under. - */ - function ResolverBuilder(container, key) { - di_classCallCheck(this, ResolverBuilder); - this.container = container; - this.key = key; - } - /** - * Creates a resolver for an existing object instance. - * @param value - The instance to resolve. - * @returns The resolver. - */ - return di_createClass(ResolverBuilder, [{ - key: "instance", - value: function instance(value) { - return this.registerResolver(0 /* instance */, value); - } - /** - * Creates a resolver that enforces a singleton lifetime. - * @param value - The type to create and cache the singleton for. - * @returns The resolver. - */ - }, { - key: "singleton", - value: function singleton(value) { - return this.registerResolver(1 /* singleton */, value); - } - /** - * Creates a resolver that creates a new instance for every dependency request. - * @param value - The type to create instances of. - * @returns - The resolver. - */ - }, { - key: "transient", - value: function transient(value) { - return this.registerResolver(2 /* transient */, value); - } - /** - * Creates a resolver that invokes a callback function for every dependency resolution - * request, allowing custom logic to return the dependency. - * @param value - The callback to call during resolution. - * @returns The resolver. - */ - }, { - key: "callback", - value: function callback(value) { - return this.registerResolver(3 /* callback */, value); - } - /** - * Creates a resolver that invokes a callback function the first time that a dependency - * resolution is requested. The returned value is then cached and provided for all - * subsequent requests. - * @param value - The callback to call during the first resolution. - * @returns The resolver. - */ - }, { - key: "cachedCallback", - value: function cachedCallback(value) { - return this.registerResolver(3 /* callback */, cacheCallbackResult(value)); - } - /** - * Aliases the current key to a different key. - * @param destinationKey - The key to point the alias to. - * @returns The resolver. - */ - }, { - key: "aliasTo", - value: function aliasTo(destinationKey) { - return this.registerResolver(5 /* alias */, destinationKey); - } - }, { - key: "registerResolver", - value: function registerResolver(strategy, state) { - var container = this.container, - key = this.key; - /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ - this.container = this.key = void 0; - return container.registerResolver(key, new ResolverImpl(key, strategy, state)); - } - }]); -}(); -function cloneArrayWithPossibleProps(source) { - var clone = source.slice(); - var keys = Object.keys(source); - var len = keys.length; - var key; - for (var i = 0; i < len; ++i) { - key = keys[i]; - if (!isArrayIndex(key)) { - clone[key] = source[key]; - } - } - return clone; -} -/** - * A set of default resolvers useful in configuring a container. - * @public - */ -var DefaultResolver = Object.freeze({ - /** - * Disables auto-registration and throws for all un-registered dependencies. - * @param key - The key to create the resolver for. - */ - none: function none(key) { - throw Error("".concat(key.toString(), " not registered, did you forget to add @singleton()?")); - }, - /** - * Provides default singleton resolution behavior during auto-registration. - * @param key - The key to create the resolver for. - * @returns The resolver. - */ - singleton: function singleton(key) { - return new ResolverImpl(key, 1 /* singleton */, key); - }, - /** - * Provides default transient resolution behavior during auto-registration. - * @param key - The key to create the resolver for. - * @returns The resolver. - */ - transient: function transient(key) { - return new ResolverImpl(key, 2 /* transient */, key); - } -}); -/** - * Configuration for a dependency injection container. - * @public - */ -var ContainerConfiguration = Object.freeze({ - /** - * The default configuration used when creating a DOM-disconnected container. - * @remarks - * The default creates a root container, with no parent container. It does not handle - * owner requests and it uses singleton resolution behavior for auto-registration. - */ - default: Object.freeze({ - parentLocator: function parentLocator() { - return null; - }, - responsibleForOwnerRequests: false, - defaultResolver: DefaultResolver.singleton - }) -}); -var dependencyLookup = new Map(); -function getParamTypes(key) { - return function (Type) { - return Reflect.getOwnMetadata(key, Type); - }; -} -var rootDOMContainer = null; -/** - * The gateway to dependency injection APIs. - * @public - */ -var DI = Object.freeze({ - /** - * Creates a new dependency injection container. - * @param config - The configuration for the container. - * @returns A newly created dependency injection container. - */ - createContainer: function createContainer(config) { - return new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config)); - }, - /** - * Finds the dependency injection container responsible for providing dependencies - * to the specified node. - * @param node - The node to find the responsible container for. - * @returns The container responsible for providing dependencies to the node. - * @remarks - * This will be the same as the parent container if the specified node - * does not itself host a container configured with responsibleForOwnerRequests. - */ - findResponsibleContainer: function findResponsibleContainer(node) { - var owned = node.$$container$$; - if (owned && owned.responsibleForOwnerRequests) { - return owned; - } - return DI.findParentContainer(node); - }, - /** - * Find the dependency injection container up the DOM tree from this node. - * @param node - The node to find the parent container for. - * @returns The parent container of this node. - * @remarks - * This will be the same as the responsible container if the specified node - * does not itself host a container configured with responsibleForOwnerRequests. - */ - findParentContainer: function findParentContainer(node) { - var event = new CustomEvent(DILocateParentEventType, { - bubbles: true, - composed: true, - cancelable: true, - detail: { - container: void 0 - } - }); - node.dispatchEvent(event); - return event.detail.container || DI.getOrCreateDOMContainer(); - }, - /** - * Returns a dependency injection container if one is explicitly owned by the specified - * node. If one is not owned, then a new container is created and assigned to the node. - * @param node - The node to find or create the container for. - * @param config - The configuration for the container if one needs to be created. - * @returns The located or created container. - * @remarks - * This API does not search for a responsible or parent container. It looks only for a container - * directly defined on the specified node and creates one at that location if one does not - * already exist. - */ - getOrCreateDOMContainer: function getOrCreateDOMContainer(node, config) { - if (!node) { - return rootDOMContainer || (rootDOMContainer = new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config, { - parentLocator: function parentLocator() { - return null; - } - }))); - } - return node.$$container$$ || new ContainerImpl(node, Object.assign({}, ContainerConfiguration.default, config, { - parentLocator: DI.findParentContainer - })); - }, - /** - * Gets the "design:paramtypes" metadata for the specified type. - * @param Type - The type to get the metadata for. - * @returns The metadata array or undefined if no metadata is found. - */ - getDesignParamtypes: getParamTypes("design:paramtypes"), - /** - * Gets the "di:paramtypes" metadata for the specified type. - * @param Type - The type to get the metadata for. - * @returns The metadata array or undefined if no metadata is found. - */ - getAnnotationParamtypes: getParamTypes("di:paramtypes"), - /** - * - * @param Type - Gets the "di:paramtypes" metadata for the specified type. If none is found, - * an empty metadata array is created and added. - * @returns The metadata array. - */ - getOrCreateAnnotationParamTypes: function getOrCreateAnnotationParamTypes(Type) { - var annotationParamtypes = this.getAnnotationParamtypes(Type); - if (annotationParamtypes === void 0) { - Reflect.defineMetadata("di:paramtypes", annotationParamtypes = [], Type); - } - return annotationParamtypes; - }, - /** - * Gets the dependency keys representing what is needed to instantiate the specified type. - * @param Type - The type to get the dependencies for. - * @returns An array of dependency keys. - */ - getDependencies: function getDependencies(Type) { - // Note: Every detail of this getDependencies method is pretty deliberate at the moment, and probably not yet 100% tested from every possible angle, - // so be careful with making changes here as it can have a huge impact on complex end user apps. - // Preferably, only make changes to the dependency resolution process via a RFC. - var dependencies = dependencyLookup.get(Type); - if (dependencies === void 0) { - // Type.length is the number of constructor parameters. If this is 0, it could mean the class has an empty constructor - // but it could also mean the class has no constructor at all (in which case it inherits the constructor from the prototype). - // Non-zero constructor length + no paramtypes means emitDecoratorMetadata is off, or the class has no decorator. - // We're not doing anything with the above right now, but it's good to keep in mind for any future issues. - var _inject = Type.inject; - if (_inject === void 0) { - // design:paramtypes is set by tsc when emitDecoratorMetadata is enabled. - var designParamtypes = DI.getDesignParamtypes(Type); - // di:paramtypes is set by the parameter decorator from DI.createInterface or by @inject - var annotationParamtypes = DI.getAnnotationParamtypes(Type); - if (designParamtypes === void 0) { - if (annotationParamtypes === void 0) { - // Only go up the prototype if neither static inject nor any of the paramtypes is defined, as - // there is no sound way to merge a type's deps with its prototype's deps - var Proto = Object.getPrototypeOf(Type); - if (typeof Proto === "function" && Proto !== Function.prototype) { - dependencies = cloneArrayWithPossibleProps(DI.getDependencies(Proto)); - } else { - dependencies = []; - } - } else { - // No design:paramtypes so just use the di:paramtypes - dependencies = cloneArrayWithPossibleProps(annotationParamtypes); - } - } else if (annotationParamtypes === void 0) { - // No di:paramtypes so just use the design:paramtypes - dependencies = cloneArrayWithPossibleProps(designParamtypes); - } else { - // We've got both, so merge them (in case of conflict on same index, di:paramtypes take precedence) - dependencies = cloneArrayWithPossibleProps(designParamtypes); - var len = annotationParamtypes.length; - var auAnnotationParamtype; - for (var i = 0; i < len; ++i) { - auAnnotationParamtype = annotationParamtypes[i]; - if (auAnnotationParamtype !== void 0) { - dependencies[i] = auAnnotationParamtype; - } - } - var keys = Object.keys(annotationParamtypes); - len = keys.length; - var key; - for (var _i = 0; _i < len; ++_i) { - key = keys[_i]; - if (!isArrayIndex(key)) { - dependencies[key] = annotationParamtypes[key]; - } - } - } - } else { - // Ignore paramtypes if we have static inject - dependencies = cloneArrayWithPossibleProps(_inject); - } - dependencyLookup.set(Type, dependencies); - } - return dependencies; - }, - /** - * Defines a property on a web component class. The value of this property will - * be resolved from the dependency injection container responsible for the element - * instance, based on where it is connected in the DOM. - * @param target - The target to define the property on. - * @param propertyName - The name of the property to define. - * @param key - The dependency injection key. - * @param respectConnection - Indicates whether or not to update the property value if the - * hosting component is disconnected and then re-connected at a different location in the DOM. - * @remarks - * The respectConnection option is only applicable to elements that descend from FASTElement. - */ - defineProperty: function defineProperty(target, propertyName, key) { - var respectConnection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - var diPropertyKey = "$di_".concat(propertyName); - Reflect.defineProperty(target, propertyName, { - get: function get() { - var _this = this; - var value = this[diPropertyKey]; - if (value === void 0) { - var container = this instanceof HTMLElement ? DI.findResponsibleContainer(this) : DI.getOrCreateDOMContainer(); - value = container.get(key); - this[diPropertyKey] = value; - if (respectConnection && this instanceof FASTElement) { - var notifier = this.$fastController; - var handleChange = function handleChange() { - var newContainer = DI.findResponsibleContainer(_this); - var newValue = newContainer.get(key); - var oldValue = _this[diPropertyKey]; - if (newValue !== oldValue) { - _this[diPropertyKey] = value; - notifier.notify(propertyName); - } - }; - notifier.subscribe({ - handleChange: handleChange - }, "isConnected"); - } - } - return value; - } - }); - }, - /** - * Creates a dependency injection key. - * @param nameConfigOrCallback - A friendly name for the key or a lambda that configures a - * default resolution for the dependency. - * @param configuror - If a friendly name was provided for the first parameter, then an optional - * lambda that configures a default resolution for the dependency can be provided second. - * @returns The created key. - * @remarks - * The created key can be used as a property decorator or constructor parameter decorator, - * in addition to its standard use in an inject array or through direct container APIs. - */ - createInterface: function createInterface(nameConfigOrCallback, configuror) { - var configure = typeof nameConfigOrCallback === "function" ? nameConfigOrCallback : configuror; - var friendlyName = typeof nameConfigOrCallback === "string" ? nameConfigOrCallback : nameConfigOrCallback && "friendlyName" in nameConfigOrCallback ? nameConfigOrCallback.friendlyName || defaultFriendlyName : defaultFriendlyName; - var respectConnection = typeof nameConfigOrCallback === "string" ? false : nameConfigOrCallback && "respectConnection" in nameConfigOrCallback ? nameConfigOrCallback.respectConnection || false : false; - var Interface = function _target(target, property, index) { - if (target == null || (this instanceof _target ? this.constructor : void 0) !== undefined) { - throw new Error("No registration for interface: '".concat(Interface.friendlyName, "'")); - } - if (property) { - DI.defineProperty(target, property, Interface, respectConnection); - } else { - var annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); - annotationParamtypes[index] = Interface; - } - }; - Interface.$isInterface = true; - Interface.friendlyName = friendlyName == null ? "(anonymous)" : friendlyName; - if (configure != null) { - Interface.register = function (container, key) { - return configure(new ResolverBuilder(container, key !== null && key !== void 0 ? key : Interface)); - }; - } - Interface.toString = function toString() { - return "InterfaceSymbol<".concat(Interface.friendlyName, ">"); - }; - return Interface; - }, - /** - * A decorator that specifies what to inject into its target. - * @param dependencies - The dependencies to inject. - * @returns The decorator to be applied to the target class. - * @remarks - * The decorator can be used to decorate a class, listing all of the classes dependencies. - * Or it can be used to decorate a constructor paramter, indicating what to inject for that - * parameter. - * Or it can be used for a web component property, indicating what that property should resolve to. - */ - inject: function inject() { - for (var _len = arguments.length, dependencies = new Array(_len), _key = 0; _key < _len; _key++) { - dependencies[_key] = arguments[_key]; - } - return function (target, key, descriptor) { - if (typeof descriptor === "number") { - // It's a parameter decorator. - var annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); - var dep = dependencies[0]; - if (dep !== void 0) { - annotationParamtypes[descriptor] = dep; - } - } else if (key) { - DI.defineProperty(target, key, dependencies[0]); - } else { - var _annotationParamtypes = descriptor ? DI.getOrCreateAnnotationParamTypes(descriptor.value) : DI.getOrCreateAnnotationParamTypes(target); - var _dep; - for (var i = 0; i < dependencies.length; ++i) { - _dep = dependencies[i]; - if (_dep !== void 0) { - _annotationParamtypes[i] = _dep; - } - } - } - }; - }, - /** - * Registers the `target` class as a transient dependency; each time the dependency is resolved - * a new instance will be created. - * - * @param target - The class / constructor function to register as transient. - * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. - * - * @example - * On an existing class - * ```ts - * class Foo { } - * DI.transient(Foo); - * ``` - * - * @example - * Inline declaration - * - * ```ts - * const Foo = DI.transient(class { }); - * // Foo is now strongly typed with register - * Foo.register(container); - * ``` - * - * @public - */ - transient: function transient(target) { - target.register = function register(container) { - var registration = Registration.transient(target, target); - return registration.register(container); - }; - target.registerInRequestor = false; - return target; - }, - /** - * Registers the `target` class as a singleton dependency; the class will only be created once. Each - * consecutive time the dependency is resolved, the same instance will be returned. - * - * @param target - The class / constructor function to register as a singleton. - * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. - * @example - * On an existing class - * ```ts - * class Foo { } - * DI.singleton(Foo); - * ``` - * - * @example - * Inline declaration - * ```ts - * const Foo = DI.singleton(class { }); - * // Foo is now strongly typed with register - * Foo.register(container); - * ``` - * - * @public - */ - singleton: function singleton(target) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultSingletonOptions; - target.register = function register(container) { - var registration = Registration.singleton(target, target); - return registration.register(container); - }; - target.registerInRequestor = options.scoped; - return target; - } -}); -/** - * The interface key that resolves the dependency injection container itself. - * @public - */ -var Container = DI.createInterface("Container"); -/** - * The interface key that resolves the service locator itself. - * @public - */ -var ServiceLocator = (/* unused pure expression or super */ null && (Container)); -function createResolver(getter) { - return function (key) { - var resolver = function resolver(target, property, descriptor) { - DI.inject(resolver)(target, property, descriptor); - }; - resolver.$isResolver = true; - resolver.resolve = function (handler, requestor) { - return getter(key, handler, requestor); - }; - return resolver; - }; -} -/** - * A decorator that specifies what to inject into its target. - * @param dependencies - The dependencies to inject. - * @returns The decorator to be applied to the target class. - * @remarks - * The decorator can be used to decorate a class, listing all of the classes dependencies. - * Or it can be used to decorate a constructor paramter, indicating what to inject for that - * parameter. - * Or it can be used for a web component property, indicating what that property should resolve to. - * - * @public - */ -var inject = DI.inject; -function transientDecorator(target) { - return DI.transient(target); -} -function di_transient(target) { - return target == null ? transientDecorator : transientDecorator(target); -} -var defaultSingletonOptions = { - scoped: false -}; -function singletonDecorator(target) { - return DI.singleton(target); -} -/** - * @public - */ -function singleton(targetOrOptions) { - if (typeof targetOrOptions === "function") { - return DI.singleton(targetOrOptions); - } - return function ($target) { - return DI.singleton($target, targetOrOptions); - }; -} -function createAllResolver(getter) { - return function (key, searchAncestors) { - searchAncestors = !!searchAncestors; - var resolver = function resolver(target, property, descriptor) { - DI.inject(resolver)(target, property, descriptor); - }; - resolver.$isResolver = true; - resolver.resolve = function (handler, requestor) { - /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ - return getter(key, handler, requestor, searchAncestors); - }; - return resolver; - }; -} -/** - * A decorator and DI resolver that will resolve an array of all dependencies - * registered with the specified key. - * @param key - The key to resolve all dependencies for. - * @param searchAncestors - [optional] Indicates whether to search ancestor containers. - * @public - */ -var di_all = createAllResolver(function (key, handler, requestor, searchAncestors) { - return requestor.getAll(key, searchAncestors); -}); -/** - * A decorator that lazily injects a dependency depending on whether the `Key` is present at the time of function call. - * - * @example - * You need to make your argument a function that returns the type, for example - * ```ts - * class Foo { - * constructor( @lazy('random') public random: () => number ) - * } - * const foo = container.get(Foo); // instanceof Foo - * foo.random(); // throws - * ``` - * would throw an exception because you haven't registered `'random'` before calling the method. - * @example - * This, would give you a new 'Math.random()' number each time. - * ```ts - * class Foo { - * constructor( @lazy('random') public random: () => random ) - * } - * container.register(Registration.callback('random', Math.random )); - * container.get(Foo).random(); // some random number - * container.get(Foo).random(); // another random number - * ``` - * - * `@lazy` does not manage the lifecycle of the underlying key. If you want a singleton, you have to register as a - * `singleton`, `transient` would also behave as you would expect, providing you a new instance each time. - * - * @param key - The key to lazily resolve. - * see {@link DI.createInterface} on interactions with interfaces - * - * @public - */ -var lazy = createResolver(function (key, handler, requestor) { - return function () { - return requestor.get(key); - }; -}); -/** - * A decorator that allows you to optionally inject a dependency depending on whether the [[`Key`]] is present, for example: - * @example - * ```ts - * class Foo { - * constructor( @inject('mystring') public str: string = 'somestring' ) - * } - * container.get(Foo); // throws - * ``` - * would fail - * - * @example - * ```ts - * class Foo { - * constructor( @optional('mystring') public str: string = 'somestring' ) - * } - * container.get(Foo).str // somestring - * ``` - * if you use it without a default it will inject `undefined`, so remember to mark your input type as - * possibly `undefined`! - * - * @param key - The key to optionally resolve. - * see {@link DI.createInterface} on interactions with interfaces - * - * @public - */ -var optional = createResolver(function (key, handler, requestor) { - if (requestor.has(key, true)) { - return requestor.get(key); - } else { - return undefined; - } -}); -/** - * A decorator that tells the container not to try to inject a dependency. - * - * @public - */ -function ignore(target, property, descriptor) { - DI.inject(ignore)(target, property, descriptor); -} -// Hack: casting below used to prevent TS from generate a namespace which can't be commented -// and results in documentation validation errors. -ignore.$isResolver = true; -ignore.resolve = function () { - return undefined; -}; -/** - * A decorator that indicates that a new instance should be injected scoped to the - * container that requested the instance. - * @param key - The dependency key for the new instance. - * @remarks - * This creates a resolver with an instance strategy pointing to the new instance, effectively - * making this a singleton, scoped to the container or DOM's subtree. - * - * @public - */ -var newInstanceForScope = createResolver(function (key, handler, requestor) { - var instance = createNewInstance(key, handler); - var resolver = new ResolverImpl(key, 0 /* instance */, instance); - requestor.registerResolver(key, resolver); - return instance; -}); -/** - * A decorator that indicates that a new instance should be injected. - * @param key - The dependency key for the new instance. - * @remarks - * The instance is not internally cached with a resolver as newInstanceForScope does. - * - * @public - */ -var newInstanceOf = createResolver(function (key, handler, _requestor) { - return createNewInstance(key, handler); -}); -function createNewInstance(key, handler) { - /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ - return handler.getFactory(key).construct(handler); -} -/** @internal */ -var ResolverImpl = /*#__PURE__*/function () { - function ResolverImpl(key, strategy, state) { - di_classCallCheck(this, ResolverImpl); - this.key = key; - this.strategy = strategy; - this.state = state; - this.resolving = false; - } - return di_createClass(ResolverImpl, [{ - key: "$isResolver", - get: function get() { - return true; - } - }, { - key: "register", - value: function register(container) { - return container.registerResolver(this.key, this); - } - }, { - key: "resolve", - value: function resolve(handler, requestor) { - switch (this.strategy) { - case 0 /* instance */: - return this.state; - case 1 /* singleton */: - { - if (this.resolving) { - throw new Error("Cyclic dependency found: ".concat(this.state.name)); - } - this.resolving = true; - this.state = handler.getFactory(this.state).construct(requestor); - this.strategy = 0 /* instance */; - this.resolving = false; - return this.state; - } - case 2 /* transient */: - { - // Always create transients from the requesting container - var factory = handler.getFactory(this.state); - if (factory === null) { - throw new Error("Resolver for ".concat(String(this.key), " returned a null factory")); - } - return factory.construct(requestor); - } - case 3 /* callback */: - return this.state(handler, requestor, this); - case 4 /* array */: - return this.state[0].resolve(handler, requestor); - case 5 /* alias */: - return requestor.get(this.state); - default: - throw new Error("Invalid resolver strategy specified: ".concat(this.strategy, ".")); - } - } - }, { - key: "getFactory", - value: function getFactory(container) { - var _a, _b, _c; - switch (this.strategy) { - case 1 /* singleton */: - case 2 /* transient */: - return container.getFactory(this.state); - case 5 /* alias */: - return (_c = (_b = (_a = container.getResolver(this.state)) === null || _a === void 0 ? void 0 : _a.getFactory) === null || _b === void 0 ? void 0 : _b.call(_a, container)) !== null && _c !== void 0 ? _c : null; - default: - return null; - } - } - }]); -}(); -function containerGetKey(d) { - return this.get(d); -} -function transformInstance(inst, transform) { - return transform(inst); -} -/** @internal */ -var FactoryImpl = /*#__PURE__*/function () { - function FactoryImpl(Type, dependencies) { - di_classCallCheck(this, FactoryImpl); - this.Type = Type; - this.dependencies = dependencies; - this.transformers = null; - } - return di_createClass(FactoryImpl, [{ - key: "construct", - value: function construct(container, dynamicDependencies) { - var instance; - if (dynamicDependencies === void 0) { - instance = _construct(this.Type, di_toConsumableArray(this.dependencies.map(containerGetKey, container))); - } else { - instance = _construct(this.Type, di_toConsumableArray(this.dependencies.map(containerGetKey, container)).concat(di_toConsumableArray(dynamicDependencies))); - } - if (this.transformers == null) { - return instance; - } - return this.transformers.reduce(transformInstance, instance); - } - }, { - key: "registerTransformer", - value: function registerTransformer(transformer) { - (this.transformers || (this.transformers = [])).push(transformer); - } - }]); -}(); -var containerResolver = { - $isResolver: true, - resolve: function resolve(handler, requestor) { - return requestor; - } -}; -function isRegistry(obj) { - return typeof obj.register === "function"; -} -function isSelfRegistry(obj) { - return isRegistry(obj) && typeof obj.registerInRequestor === "boolean"; -} -function isRegisterInRequester(obj) { - return isSelfRegistry(obj) && obj.registerInRequestor; -} -function isClass(obj) { - return obj.prototype !== void 0; -} -var InstrinsicTypeNames = new Set(["Array", "ArrayBuffer", "Boolean", "DataView", "Date", "Error", "EvalError", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Number", "Object", "Promise", "RangeError", "ReferenceError", "RegExp", "Set", "SharedArrayBuffer", "String", "SyntaxError", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "URIError", "WeakMap", "WeakSet"]); -var DILocateParentEventType = "__DI_LOCATE_PARENT__"; -var factories = new Map(); -/** - * @internal - */ -var ContainerImpl = /*#__PURE__*/function () { - function ContainerImpl(owner, config) { - var _this2 = this; - di_classCallCheck(this, ContainerImpl); - this.owner = owner; - this.config = config; - this._parent = void 0; - this.registerDepth = 0; - this.context = null; - if (owner !== null) { - owner.$$container$$ = this; - } - this.resolvers = new Map(); - this.resolvers.set(Container, containerResolver); - if (owner instanceof Node) { - owner.addEventListener(DILocateParentEventType, function (e) { - if (e.composedPath()[0] !== _this2.owner) { - e.detail.container = _this2; - e.stopImmediatePropagation(); - } - }); - } - } - return di_createClass(ContainerImpl, [{ - key: "parent", - get: function get() { - if (this._parent === void 0) { - this._parent = this.config.parentLocator(this.owner); - } - return this._parent; - } - }, { - key: "depth", - get: function get() { - return this.parent === null ? 0 : this.parent.depth + 1; - } - }, { - key: "responsibleForOwnerRequests", - get: function get() { - return this.config.responsibleForOwnerRequests; - } - }, { - key: "registerWithContext", - value: function registerWithContext(context) { - this.context = context; - for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - params[_key2 - 1] = arguments[_key2]; - } - this.register.apply(this, params); - this.context = null; - return this; - } - }, { - key: "register", - value: function register() { - if (++this.registerDepth === 100) { - throw new Error("Unable to autoregister dependency"); - // Most likely cause is trying to register a plain object that does not have a - // register method and is not a class constructor - } - var current; - var keys; - var value; - var j; - var jj; - var context = this.context; - for (var i = 0, ii = arguments.length; i < ii; ++i) { - current = i < 0 || arguments.length <= i ? undefined : arguments[i]; - if (!isObject(current)) { - continue; - } - if (isRegistry(current)) { - current.register(this, context); - } else if (isClass(current)) { - Registration.singleton(current, current).register(this); - } else { - keys = Object.keys(current); - j = 0; - jj = keys.length; - for (; j < jj; ++j) { - value = current[keys[j]]; - if (!isObject(value)) { - continue; - } - // note: we could remove this if-branch and call this.register directly - // - the extra check is just a perf tweak to create fewer unnecessary arrays by the spread operator - if (isRegistry(value)) { - value.register(this, context); - } else { - this.register(value); - } - } - } - } - --this.registerDepth; - return this; - } - }, { - key: "registerResolver", - value: function registerResolver(key, resolver) { - validateKey(key); - var resolvers = this.resolvers; - var result = resolvers.get(key); - if (result == null) { - resolvers.set(key, resolver); - } else if (result instanceof ResolverImpl && result.strategy === 4 /* array */) { - result.state.push(resolver); - } else { - resolvers.set(key, new ResolverImpl(key, 4 /* array */, [result, resolver])); - } - return resolver; - } - }, { - key: "registerTransformer", - value: function registerTransformer(key, transformer) { - var resolver = this.getResolver(key); - if (resolver == null) { - return false; - } - if (resolver.getFactory) { - var factory = resolver.getFactory(this); - if (factory == null) { - return false; - } - // This type cast is a bit of a hacky one, necessary due to the duplicity of IResolverLike. - // Problem is that that interface's type arg can be of type Key, but the getFactory method only works on - // type Constructable. So the return type of that optional method has this additional constraint, which - // seems to confuse the type checker. - factory.registerTransformer(transformer); - return true; - } - return false; - } - }, { - key: "getResolver", - value: function getResolver(key) { - var autoRegister = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - validateKey(key); - if (key.resolve !== void 0) { - return key; - } - /* eslint-disable-next-line @typescript-eslint/no-this-alias */ - var current = this; - var resolver; - while (current != null) { - resolver = current.resolvers.get(key); - if (resolver == null) { - if (current.parent == null) { - var handler = isRegisterInRequester(key) ? this : current; - return autoRegister ? this.jitRegister(key, handler) : null; - } - current = current.parent; - } else { - return resolver; - } - } - return null; - } - }, { - key: "has", - value: function has(key) { - var searchAncestors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - return this.resolvers.has(key) ? true : searchAncestors && this.parent != null ? this.parent.has(key, true) : false; - } - }, { - key: "get", - value: function get(key) { - validateKey(key); - if (key.$isResolver) { - return key.resolve(this, this); - } - /* eslint-disable-next-line @typescript-eslint/no-this-alias */ - var current = this; - var resolver; - while (current != null) { - resolver = current.resolvers.get(key); - if (resolver == null) { - if (current.parent == null) { - var handler = isRegisterInRequester(key) ? this : current; - resolver = this.jitRegister(key, handler); - return resolver.resolve(current, this); - } - current = current.parent; - } else { - return resolver.resolve(current, this); - } - } - throw new Error("Unable to resolve key: ".concat(String(key))); - } - }, { - key: "getAll", - value: function getAll(key) { - var searchAncestors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - validateKey(key); - /* eslint-disable-next-line @typescript-eslint/no-this-alias */ - var requestor = this; - var current = requestor; - var resolver; - if (searchAncestors) { - var resolutions = emptyArray; - while (current != null) { - resolver = current.resolvers.get(key); - if (resolver != null) { - resolutions = resolutions.concat( /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ - buildAllResponse(resolver, current, requestor)); - } - current = current.parent; - } - return resolutions; - } else { - while (current != null) { - resolver = current.resolvers.get(key); - if (resolver == null) { - current = current.parent; - if (current == null) { - return emptyArray; - } - } else { - return buildAllResponse(resolver, current, requestor); - } - } - } - return emptyArray; - } - }, { - key: "getFactory", - value: function getFactory(Type) { - var factory = factories.get(Type); - if (factory === void 0) { - if (isNativeFunction(Type)) { - throw new Error("".concat(Type.name, " is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.")); - } - factories.set(Type, factory = new FactoryImpl(Type, DI.getDependencies(Type))); - } - return factory; - } - }, { - key: "registerFactory", - value: function registerFactory(key, factory) { - factories.set(key, factory); - } - }, { - key: "createChild", - value: function createChild(config) { - var _this3 = this; - return new ContainerImpl(null, Object.assign({}, this.config, config, { - parentLocator: function parentLocator() { - return _this3; - } - })); - } - }, { - key: "jitRegister", - value: function jitRegister(keyAsValue, handler) { - if (typeof keyAsValue !== "function") { - throw new Error("Attempted to jitRegister something that is not a constructor: '".concat(keyAsValue, "'. Did you forget to register this dependency?")); - } - if (InstrinsicTypeNames.has(keyAsValue.name)) { - throw new Error("Attempted to jitRegister an intrinsic type: ".concat(keyAsValue.name, ". Did you forget to add @inject(Key)")); - } - if (isRegistry(keyAsValue)) { - var registrationResolver = keyAsValue.register(handler); - if (!(registrationResolver instanceof Object) || registrationResolver.resolve == null) { - var newResolver = handler.resolvers.get(keyAsValue); - if (newResolver != void 0) { - return newResolver; - } - throw new Error("A valid resolver was not returned from the static register method"); - } - return registrationResolver; - } else if (keyAsValue.$isInterface) { - throw new Error("Attempted to jitRegister an interface: ".concat(keyAsValue.friendlyName)); - } else { - var resolver = this.config.defaultResolver(keyAsValue, handler); - handler.resolvers.set(keyAsValue, resolver); - return resolver; - } - } - }]); -}(); -var cache = new WeakMap(); -function cacheCallbackResult(fun) { - return function (handler, requestor, resolver) { - if (cache.has(resolver)) { - return cache.get(resolver); - } - var t = fun(handler, requestor, resolver); - cache.set(resolver, t); - return t; - }; -} -/** - * You can use the resulting Registration of any of the factory methods - * to register with the container. - * - * @example - * ``` - * class Foo {} - * const container = DI.createContainer(); - * container.register(Registration.instance(Foo, new Foo())); - * container.get(Foo); - * ``` - * - * @public - */ -var Registration = Object.freeze({ - /** - * Allows you to pass an instance. - * Every time you request this {@link Key} you will get this instance back. - * - * @example - * ``` - * Registration.instance(Foo, new Foo())); - * ``` - * - * @param key - The key to register the instance under. - * @param value - The instance to return when the key is requested. - */ - instance: function instance(key, value) { - return new ResolverImpl(key, 0 /* instance */, value); - }, - /** - * Creates an instance from the class. - * Every time you request this {@link Key} you will get the same one back. - * - * @example - * ``` - * Registration.singleton(Foo, Foo); - * ``` - * - * @param key - The key to register the singleton under. - * @param value - The class to instantiate as a singleton when first requested. - */ - singleton: function singleton(key, value) { - return new ResolverImpl(key, 1 /* singleton */, value); - }, - /** - * Creates an instance from a class. - * Every time you request this {@link Key} you will get a new instance. - * - * @example - * ``` - * Registration.instance(Foo, Foo); - * ``` - * - * @param key - The key to register the instance type under. - * @param value - The class to instantiate each time the key is requested. - */ - transient: function transient(key, value) { - return new ResolverImpl(key, 2 /* transient */, value); - }, - /** - * Delegates to a callback function to provide the dependency. - * Every time you request this {@link Key} the callback will be invoked to provide - * the dependency. - * - * @example - * ``` - * Registration.callback(Foo, () => new Foo()); - * Registration.callback(Bar, (c: Container) => new Bar(c.get(Foo))); - * ``` - * - * @param key - The key to register the callback for. - * @param callback - The function that is expected to return the dependency. - */ - callback: function callback(key, _callback) { - return new ResolverImpl(key, 3 /* callback */, _callback); - }, - /** - * Delegates to a callback function to provide the dependency and then caches the - * dependency for future requests. - * - * @example - * ``` - * Registration.cachedCallback(Foo, () => new Foo()); - * Registration.cachedCallback(Bar, (c: Container) => new Bar(c.get(Foo))); - * ``` - * - * @param key - The key to register the callback for. - * @param callback - The function that is expected to return the dependency. - * @remarks - * If you pass the same Registration to another container, the same cached value will be used. - * Should all references to the resolver returned be removed, the cache will expire. - */ - cachedCallback: function cachedCallback(key, callback) { - return new ResolverImpl(key, 3 /* callback */, cacheCallbackResult(callback)); - }, - /** - * Creates an alternate {@link Key} to retrieve an instance by. - * - * @example - * ``` - * Register.singleton(Foo, Foo) - * Register.aliasTo(Foo, MyFoos); - * - * container.getAll(MyFoos) // contains an instance of Foo - * ``` - * - * @param originalKey - The original key that has been registered. - * @param aliasKey - The alias to the original key. - */ - aliasTo: function aliasTo(originalKey, aliasKey) { - return new ResolverImpl(aliasKey, 5 /* alias */, originalKey); - } -}); -/** @internal */ -function validateKey(key) { - if (key === null || key === void 0) { - throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?"); - } -} -function buildAllResponse(resolver, handler, requestor) { - if (resolver instanceof ResolverImpl && resolver.strategy === 4 /* array */) { - var state = resolver.state; - var i = state.length; - var results = new Array(i); - while (i--) { - results[i] = state[i].resolve(handler, requestor); - } - return results; - } - return [resolver.resolve(handler, requestor)]; -} -var defaultFriendlyName = "(anonymous)"; -function isObject(value) { - return typeof value === "object" && value !== null || typeof value === "function"; -} -/** - * Determine whether the value is a native function. - * - * @param fn - The function to check. - * @returns `true` is the function is a native function, otherwise `false` - */ -var isNativeFunction = function () { - var lookup = new WeakMap(); - var isNative = false; - var sourceText = ""; - var i = 0; - return function (fn) { - isNative = lookup.get(fn); - if (isNative === void 0) { - sourceText = fn.toString(); - i = sourceText.length; - // http://www.ecma-international.org/ecma-262/#prod-NativeFunction - isNative = - // 29 is the length of 'function () { [native code] }' which is the smallest length of a native function string - i >= 29 && - // 100 seems to be a safe upper bound of the max length of a native function. In Chrome and FF it's 56, in Edge it's 61. - i <= 100 && - // This whole heuristic *could* be tricked by a comment. Do we need to care about that? - sourceText.charCodeAt(i - 1) === 0x7d && - // } - // TODO: the spec is a little vague about the precise constraints, so we do need to test this across various browsers to make sure just one whitespace is a safe assumption. - sourceText.charCodeAt(i - 2) <= 0x20 && - // whitespace - sourceText.charCodeAt(i - 3) === 0x5d && - // ] - sourceText.charCodeAt(i - 4) === 0x65 && - // e - sourceText.charCodeAt(i - 5) === 0x64 && - // d - sourceText.charCodeAt(i - 6) === 0x6f && - // o - sourceText.charCodeAt(i - 7) === 0x63 && - // c - sourceText.charCodeAt(i - 8) === 0x20 && - // - sourceText.charCodeAt(i - 9) === 0x65 && - // e - sourceText.charCodeAt(i - 10) === 0x76 && - // v - sourceText.charCodeAt(i - 11) === 0x69 && - // i - sourceText.charCodeAt(i - 12) === 0x74 && - // t - sourceText.charCodeAt(i - 13) === 0x61 && - // a - sourceText.charCodeAt(i - 14) === 0x6e && - // n - sourceText.charCodeAt(i - 15) === 0x58; // [ - lookup.set(fn, isNative); - } - return isNative; - }; -}(); -var isNumericLookup = {}; -function isArrayIndex(value) { - switch (typeof value) { - case "number": - return value >= 0 && (value | 0) === value; - case "string": - { - var result = isNumericLookup[value]; - if (result !== void 0) { - return result; - } - var length = value.length; - if (length === 0) { - return isNumericLookup[value] = false; - } - var ch = 0; - for (var i = 0; i < length; ++i) { - ch = value.charCodeAt(i); - if (i === 0 && ch === 0x30 && length > 1 /* must not start with 0 */ || ch < 0x30 /* 0 */ || ch > 0x39 /* 9 */) { - return isNumericLookup[value] = false; - } - } - return isNumericLookup[value] = true; - } - default: - return false; - } -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js -function component_presentation_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function component_presentation_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, component_presentation_toPropertyKey(o.key), o); } } -function component_presentation_createClass(e, r, t) { return r && component_presentation_defineProperties(e.prototype, r), t && component_presentation_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function component_presentation_toPropertyKey(t) { var i = component_presentation_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function component_presentation_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } - - -function presentationKeyFromTag(tagName) { - return "".concat(tagName.toLowerCase(), ":presentation"); -} -var presentationRegistry = new Map(); -/** - * An API gateway to component presentation features. - * @public - */ -var ComponentPresentation = Object.freeze({ - /** - * Defines a component presentation for an element. - * @param tagName - The element name to define the presentation for. - * @param presentation - The presentation that will be applied to matching elements. - * @param container - The dependency injection container to register the configuration in. - * @public - */ - define: function define(tagName, presentation, container) { - var key = presentationKeyFromTag(tagName); - var existing = presentationRegistry.get(key); - if (existing === void 0) { - presentationRegistry.set(key, presentation); - } else { - // false indicates that we have more than one presentation - // registered for a tagName and we must resolve through DI - presentationRegistry.set(key, false); - } - container.register(Registration.instance(key, presentation)); - }, - /** - * Finds a component presentation for the specified element name, - * searching the DOM hierarchy starting from the provided element. - * @param tagName - The name of the element to locate the presentation for. - * @param element - The element to begin the search from. - * @returns The component presentation or null if none is found. - * @public - */ - forTag: function forTag(tagName, element) { - var key = presentationKeyFromTag(tagName); - var existing = presentationRegistry.get(key); - if (existing === false) { - var container = DI.findResponsibleContainer(element); - return container.get(key); - } - return existing || null; - } -}); -/** - * The default implementation of ComponentPresentation, used by FoundationElement. - * @public - */ -var DefaultComponentPresentation = /*#__PURE__*/function () { - /** - * Creates an instance of DefaultComponentPresentation. - * @param template - The template to apply to the element. - * @param styles - The styles to apply to the element. - * @public - */ - function DefaultComponentPresentation(template, styles) { - component_presentation_classCallCheck(this, DefaultComponentPresentation); - this.template = template || null; - this.styles = styles === void 0 ? null : Array.isArray(styles) ? element_styles_ElementStyles.create(styles) : styles instanceof element_styles_ElementStyles ? styles : element_styles_ElementStyles.create([styles]); - } - /** - * Applies the presentation details to the specified element. - * @param element - The element to apply the presentation details to. - * @public - */ - return component_presentation_createClass(DefaultComponentPresentation, [{ - key: "applyTo", - value: function applyTo(element) { - var controller = element.$fastController; - if (controller.template === null) { - controller.template = this.template; - } - if (controller.styles === null) { - controller.styles = this.styles; - } - } - }]); -}(); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js -function foundation_element_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function foundation_element_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, foundation_element_toPropertyKey(o.key), o); } } -function foundation_element_createClass(e, r, t) { return r && foundation_element_defineProperties(e.prototype, r), t && foundation_element_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function foundation_element_toPropertyKey(t) { var i = foundation_element_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function foundation_element_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function foundation_element_callSuper(t, o, e) { return o = foundation_element_getPrototypeOf(o), foundation_element_possibleConstructorReturn(t, foundation_element_isNativeReflectConstruct() ? Reflect.construct(o, e || [], foundation_element_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function foundation_element_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return foundation_element_assertThisInitialized(t); } -function foundation_element_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function foundation_element_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (foundation_element_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function foundation_element_get() { return foundation_element_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = foundation_element_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, foundation_element_get.apply(null, arguments); } -function foundation_element_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = foundation_element_getPrototypeOf(t));); return t; } -function foundation_element_getPrototypeOf(t) { return foundation_element_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, foundation_element_getPrototypeOf(t); } -function foundation_element_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && foundation_element_setPrototypeOf(t, e); } -function foundation_element_setPrototypeOf(t, e) { return foundation_element_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, foundation_element_setPrototypeOf(t, e); } - - - -/** - * Defines a foundation element class that: - * 1. Connects the element to its ComponentPresentation - * 2. Allows resolving the element template from the instance or ComponentPresentation - * 3. Allows resolving the element styles from the instance or ComponentPresentation - * - * @public - */ -var FoundationElement = /*#__PURE__*/function (_FASTElement) { - function FoundationElement() { - var _this; - foundation_element_classCallCheck(this, FoundationElement); - _this = foundation_element_callSuper(this, FoundationElement, arguments); - _this._presentation = void 0; - return _this; - } - /** - * A property which resolves the ComponentPresentation instance - * for the current component. - * @public - */ - foundation_element_inherits(FoundationElement, _FASTElement); - return foundation_element_createClass(FoundationElement, [{ - key: "$presentation", - get: function get() { - if (this._presentation === void 0) { - this._presentation = ComponentPresentation.forTag(this.tagName, this); - } - return this._presentation; - } - }, { - key: "templateChanged", - value: function templateChanged() { - if (this.template !== undefined) { - this.$fastController.template = this.template; - } - } - }, { - key: "stylesChanged", - value: function stylesChanged() { - if (this.styles !== undefined) { - this.$fastController.styles = this.styles; - } - } - /** - * The connected callback for this FASTElement. - * @remarks - * This method is invoked by the platform whenever this FoundationElement - * becomes connected to the document. - * @public - */ - }, { - key: "connectedCallback", - value: function connectedCallback() { - if (this.$presentation !== null) { - this.$presentation.applyTo(this); - } - foundation_element_get(foundation_element_getPrototypeOf(FoundationElement.prototype), "connectedCallback", this).call(this); - } - /** - * Defines an element registry function with a set of element definition defaults. - * @param elementDefinition - The definition of the element to create the registry - * function for. - * @public - */ - }], [{ - key: "compose", - value: function compose(elementDefinition) { - var _this2 = this; - return function () { - var overrideDefinition = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - return new FoundationElementRegistry(_this2 === FoundationElement ? /*#__PURE__*/function (_FoundationElement) { - function _class() { - foundation_element_classCallCheck(this, _class); - return foundation_element_callSuper(this, _class, arguments); - } - foundation_element_inherits(_class, _FoundationElement); - return foundation_element_createClass(_class); - }(FoundationElement) : _this2, elementDefinition, overrideDefinition); - }; - } - }]); -}(FASTElement); -__decorate([observable], FoundationElement.prototype, "template", void 0); -__decorate([observable], FoundationElement.prototype, "styles", void 0); -function resolveOption(option, context, definition) { - if (typeof option === "function") { - return option(context, definition); - } - return option; -} -/** - * Registry capable of defining presentation properties for a DOM Container hierarchy. - * - * @internal - */ -/* eslint-disable @typescript-eslint/no-unused-vars */ -var FoundationElementRegistry = /*#__PURE__*/function () { - function FoundationElementRegistry(type, elementDefinition, overrideDefinition) { - foundation_element_classCallCheck(this, FoundationElementRegistry); - this.type = type; - this.elementDefinition = elementDefinition; - this.overrideDefinition = overrideDefinition; - this.definition = Object.assign(Object.assign({}, this.elementDefinition), this.overrideDefinition); - } - return foundation_element_createClass(FoundationElementRegistry, [{ - key: "register", - value: function register(container, context) { - var definition = this.definition; - var overrideDefinition = this.overrideDefinition; - var prefix = definition.prefix || context.elementPrefix; - var name = "".concat(prefix, "-").concat(definition.baseName); - context.tryDefineElement({ - name: name, - type: this.type, - baseClass: this.elementDefinition.baseClass, - callback: function callback(x) { - var presentation = new DefaultComponentPresentation(resolveOption(definition.template, x, definition), resolveOption(definition.styles, x, definition)); - x.definePresentation(presentation); - var shadowOptions = resolveOption(definition.shadowOptions, x, definition); - if (x.shadowRootMode) { - // If the design system has overridden the shadow root mode, we need special handling. - if (shadowOptions) { - // If there are shadow options present in the definition, then - // either the component itself has specified an option or the - // registry function has overridden it. - if (!overrideDefinition.shadowOptions) { - // There were shadow options provided by the component and not overridden by - // the registry. - shadowOptions.mode = x.shadowRootMode; - } - } else if (shadowOptions !== null) { - // If the component author did not provide shadow options, - // and did not null them out (light dom opt-in) then they - // were relying on the FASTElement default. So, if the - // design system provides a mode, we need to create the options - // to override the default. - shadowOptions = { - mode: x.shadowRootMode - }; - } - } - x.defineElement({ - elementOptions: resolveOption(definition.elementOptions, x, definition), - shadowOptions: shadowOptions, - attributes: resolveOption(definition.attributes, x, definition) - }); - } - }); - } - }]); -}(); -/* eslint-enable @typescript-eslint/no-unused-vars */ -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-react-wrapper/dist/esm/index.js -function esm_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function esm_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, esm_toPropertyKey(o.key), o); } } -function esm_createClass(e, r, t) { return r && esm_defineProperties(e.prototype, r), t && esm_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function esm_toPropertyKey(t) { var i = esm_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function esm_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function esm_callSuper(t, o, e) { return o = esm_getPrototypeOf(o), esm_possibleConstructorReturn(t, esm_isNativeReflectConstruct() ? Reflect.construct(o, e || [], esm_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function esm_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return esm_assertThisInitialized(t); } -function esm_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function esm_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (esm_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function esm_getPrototypeOf(t) { return esm_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, esm_getPrototypeOf(t); } -function esm_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && esm_setPrototypeOf(t, e); } -function esm_setPrototypeOf(t, e) { return esm_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, esm_setPrototypeOf(t, e); } -function esm_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = esm_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } -function esm_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return esm_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? esm_arrayLikeToArray(r, a) : void 0; } } -function esm_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } - - -var reservedReactProperties = new Set(["children", "localName", "ref", "style", "className"]); -var emptyProps = Object.freeze(Object.create(null)); -var DEFAULT_CACHE_NAME = "_default"; -// This will be a two levels cache Map> -// to distinguish components of same type but different tag name. -// Default name: '_default' -var wrappersCache = new Map(); -// There are 2 kinds of refs and there's no built in React API to set one. -function setRef(ref, value) { - if (typeof ref === "function") { - ref(value); - } else { - ref.current = value; - } -} -function getTagName(type, config) { - if (!config.name) { - /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ - var definition = fast_definitions_FASTElementDefinition.forType(type); - if (definition) { - config.name = definition.name; - } else { - throw new Error("React wrappers must wrap a FASTElement or be configured with a name."); - } - } - return config.name; -} -function getElementEvents(config) { - return config.events || (config.events = {}); -} -function keyIsValid(type, config, name) { - if (reservedReactProperties.has(name)) { - console.warn("".concat(getTagName(type, config), " contains property ").concat(name, " which is a React ") + "reserved property. It will be used by React and not set on " + "the element."); - return false; - } - return true; -} -function getElementKeys(type, config) { - if (!config.keys) { - if (config.properties) { - config.keys = new Set(config.properties.concat(Object.keys(getElementEvents(config)))); - } else { - var keys = new Set(Object.keys(getElementEvents(config))); - var accessors = Observable.getAccessors(type.prototype); - if (accessors.length > 0) { - var _iterator = esm_createForOfIteratorHelper(accessors), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var a = _step.value; - if (keyIsValid(type, config, a.name)) { - keys.add(a.name); - } - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - } else { - for (var p in type.prototype) { - if (!(p in HTMLElement.prototype) && keyIsValid(type, config, p)) { - keys.add(p); - } - } - } - config.keys = keys; - } - } - return config.keys; -} -/** - * @param React - The React module, typically imported from the `react` npm - * package - * @param designSystem - A design system to register the components with. - * @public - */ -function provideReactWrapper(React, designSystem) { - var registrations = []; - var registry = { - register: function register(container) { - for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - rest[_key - 1] = arguments[_key]; - } - registrations.forEach(function (x) { - return x.register.apply(x, [container].concat(rest)); - }); - registrations = []; - } - }; - function wrap(type) { - var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var _a, _b; - if (type instanceof FoundationElementRegistry) { - if (designSystem) { - designSystem.register(type); - } else { - registrations.push(type); - } - type = type.type; - } - var cachedCandidates = wrappersCache.get(type); - if (cachedCandidates) { - var cachedWrapper = cachedCandidates.get((_a = config.name) !== null && _a !== void 0 ? _a : DEFAULT_CACHE_NAME); - if (cachedWrapper) { - return cachedWrapper; - } - } - var ReactComponent = /*#__PURE__*/function (_React$Component) { - function ReactComponent() { - var _this; - esm_classCallCheck(this, ReactComponent); - _this = esm_callSuper(this, ReactComponent, arguments); - _this._element = null; - return _this; - } - esm_inherits(ReactComponent, _React$Component); - return esm_createClass(ReactComponent, [{ - key: "_updateElement", - value: function _updateElement(oldProps) { - var element = this._element; - if (element === null) { - return; - } - var currentProps = this.props; - var previousProps = oldProps || emptyProps; - var events = getElementEvents(config); - for (var key in this._elementProps) { - var newValue = currentProps[key]; - var event = events[key]; - if (event === undefined) { - element[key] = newValue; - } else { - var oldValue = previousProps[key]; - if (newValue === oldValue) { - continue; - } - if (oldValue !== undefined) { - element.removeEventListener(event, oldValue); - } - if (newValue !== undefined) { - element.addEventListener(event, newValue); - } - } - } - } - }, { - key: "componentDidMount", - value: function componentDidMount() { - this._updateElement(); - } - }, { - key: "componentDidUpdate", - value: function componentDidUpdate(old) { - this._updateElement(old); - } - }, { - key: "render", - value: function render() { - var _this2 = this; - // Since refs only get fulfilled once, pass a new one if the user's - // ref changed. This allows refs to be fulfilled as expected, going from - // having a value to null. - var userRef = this.props.__forwardedRef; - if (this._ref === undefined || this._userRef !== userRef) { - this._ref = function (value) { - if (_this2._element === null) { - _this2._element = value; - } - if (userRef !== null) { - setRef(userRef, value); - } - _this2._userRef = userRef; - }; - } - // Filter class properties and pass the remaining attributes to React. - // This allows attributes to use framework rules - // for setting attributes and render correctly under SSR. - var newReactProps = { - ref: this._ref - }; - var newElementProps = this._elementProps = {}; - var elementKeys = getElementKeys(type, config); - var currentProps = this.props; - for (var k in currentProps) { - var v = currentProps[k]; - if (elementKeys.has(k)) { - newElementProps[k] = v; - } else { - // React does *not* handle `className` for custom elements so - // coerce it to `class` so it's handled correctly. - newReactProps[k === "className" ? "class" : k] = v; - } - } - return React.createElement(getTagName(type, config), newReactProps); - } - }]); - }(React.Component); - var reactComponent = React.forwardRef(function (props, ref) { - return React.createElement(ReactComponent, Object.assign(Object.assign({}, props), { - __forwardedRef: ref - }), props === null || props === void 0 ? void 0 : props.children); - }); - if (!wrappersCache.has(type)) { - wrappersCache.set(type, new Map()); - } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - wrappersCache.get(type).set((_b = config.name) !== null && _b !== void 0 ? _b : DEFAULT_CACHE_NAME, reactComponent); - return reactComponent; - } - return { - wrap: wrap, - registry: registry - }; -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js -function badge_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, badge_toPropertyKey(o.key), o); } } -function badge_createClass(e, r, t) { return r && badge_defineProperties(e.prototype, r), t && badge_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function badge_toPropertyKey(t) { var i = badge_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function badge_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function badge_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function badge_callSuper(t, o, e) { return o = badge_getPrototypeOf(o), badge_possibleConstructorReturn(t, badge_isNativeReflectConstruct() ? Reflect.construct(o, e || [], badge_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function badge_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return badge_assertThisInitialized(t); } -function badge_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function badge_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (badge_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function badge_getPrototypeOf(t) { return badge_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, badge_getPrototypeOf(t); } -function badge_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && badge_setPrototypeOf(t, e); } -function badge_setPrototypeOf(t, e) { return badge_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, badge_setPrototypeOf(t, e); } - - - -/** - * A Badge Custom HTML Element. - * @slot - The default slot for the badge - * @csspart control - The element representing the badge, which wraps the default slot - * - * @public - */ -var Badge = /*#__PURE__*/function (_FoundationElement) { - function Badge() { - var _this; - badge_classCallCheck(this, Badge); - _this = badge_callSuper(this, Badge, arguments); - _this.generateBadgeStyle = function () { - if (!_this.fill && !_this.color) { - return; - } - var fill = "background-color: var(--badge-fill-".concat(_this.fill, ");"); - var color = "color: var(--badge-color-".concat(_this.color, ");"); - if (_this.fill && !_this.color) { - return fill; - } else if (_this.color && !_this.fill) { - return color; - } else { - return "".concat(color, " ").concat(fill); - } - }; - return _this; - } - badge_inherits(Badge, _FoundationElement); - return badge_createClass(Badge); -}(FoundationElement); -__decorate([attr({ - attribute: "fill" -})], Badge.prototype, "fill", void 0); -__decorate([attr({ - attribute: "color" -})], Badge.prototype, "color", void 0); -__decorate([attr({ - mode: "boolean" -})], Badge.prototype, "circular", void 0); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js -function html_directive_callSuper(t, o, e) { return o = html_directive_getPrototypeOf(o), html_directive_possibleConstructorReturn(t, html_directive_isNativeReflectConstruct() ? Reflect.construct(o, e || [], html_directive_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function html_directive_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return html_directive_assertThisInitialized(t); } -function html_directive_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function html_directive_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (html_directive_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function html_directive_getPrototypeOf(t) { return html_directive_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, html_directive_getPrototypeOf(t); } -function html_directive_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && html_directive_setPrototypeOf(t, e); } -function html_directive_setPrototypeOf(t, e) { return html_directive_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, html_directive_setPrototypeOf(t, e); } -function html_directive_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, html_directive_toPropertyKey(o.key), o); } } -function html_directive_createClass(e, r, t) { return r && html_directive_defineProperties(e.prototype, r), t && html_directive_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function html_directive_toPropertyKey(t) { var i = html_directive_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function html_directive_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function html_directive_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } - -/** - * Instructs the template engine to apply behavior to a node. - * @public - */ -var HTMLDirective = /*#__PURE__*/html_directive_createClass(function HTMLDirective() { - html_directive_classCallCheck(this, HTMLDirective); - /** - * The index of the DOM node to which the created behavior will apply. - */ - this.targetIndex = 0; -}); -/** - * A {@link HTMLDirective} that targets a named attribute or property on a node. - * @public - */ -var TargetedHTMLDirective = /*#__PURE__*/function (_HTMLDirective) { - function TargetedHTMLDirective() { - var _this; - html_directive_classCallCheck(this, TargetedHTMLDirective); - _this = html_directive_callSuper(this, TargetedHTMLDirective, arguments); - /** - * Creates a placeholder string based on the directive's index within the template. - * @param index - The index of the directive within the template. - */ - _this.createPlaceholder = DOM.createInterpolationPlaceholder; - return _this; - } - html_directive_inherits(TargetedHTMLDirective, _HTMLDirective); - return html_directive_createClass(TargetedHTMLDirective); -}(HTMLDirective); -/** - * A directive that attaches special behavior to an element via a custom attribute. - * @public - */ -var AttachedBehaviorHTMLDirective = /*#__PURE__*/function (_HTMLDirective2) { - /** - * - * @param name - The name of the behavior; used as a custom attribute on the element. - * @param behavior - The behavior to instantiate and attach to the element. - * @param options - Options to pass to the behavior during creation. - */ - function AttachedBehaviorHTMLDirective(name, behavior, options) { - var _this2; - html_directive_classCallCheck(this, AttachedBehaviorHTMLDirective); - _this2 = html_directive_callSuper(this, AttachedBehaviorHTMLDirective); - _this2.name = name; - _this2.behavior = behavior; - _this2.options = options; - return _this2; - } - /** - * Creates a placeholder string based on the directive's index within the template. - * @param index - The index of the directive within the template. - * @remarks - * Creates a custom attribute placeholder. - */ - html_directive_inherits(AttachedBehaviorHTMLDirective, _HTMLDirective2); - return html_directive_createClass(AttachedBehaviorHTMLDirective, [{ - key: "createPlaceholder", - value: function createPlaceholder(index) { - return DOM.createCustomAttributePlaceholder(this.name, index); - } - /** - * Creates a behavior for the provided target node. - * @param target - The node instance to create the behavior for. - * @remarks - * Creates an instance of the `behavior` type this directive was constructed with - * and passes the target and options to that `behavior`'s constructor. - */ - }, { - key: "createBehavior", - value: function createBehavior(target) { - return new this.behavior(target, this.options); - } - }]); -}(HTMLDirective); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/templating/binding.js -function binding_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function binding_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, binding_toPropertyKey(o.key), o); } } -function binding_createClass(e, r, t) { return r && binding_defineProperties(e.prototype, r), t && binding_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function binding_toPropertyKey(t) { var i = binding_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function binding_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function binding_callSuper(t, o, e) { return o = binding_getPrototypeOf(o), binding_possibleConstructorReturn(t, binding_isNativeReflectConstruct() ? Reflect.construct(o, e || [], binding_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function binding_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return binding_assertThisInitialized(t); } -function binding_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function binding_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (binding_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function binding_getPrototypeOf(t) { return binding_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, binding_getPrototypeOf(t); } -function binding_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && binding_setPrototypeOf(t, e); } -function binding_setPrototypeOf(t, e) { return binding_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, binding_setPrototypeOf(t, e); } - - - -function normalBind(source, context) { - this.source = source; - this.context = context; - if (this.bindingObserver === null) { - this.bindingObserver = Observable.binding(this.binding, this, this.isBindingVolatile); - } - this.updateTarget(this.bindingObserver.observe(source, context)); -} -function triggerBind(source, context) { - this.source = source; - this.context = context; - this.target.addEventListener(this.targetName, this); -} -function normalUnbind() { - this.bindingObserver.disconnect(); - this.source = null; - this.context = null; -} -function contentUnbind() { - this.bindingObserver.disconnect(); - this.source = null; - this.context = null; - var view = this.target.$fastView; - if (view !== void 0 && view.isComposed) { - view.unbind(); - view.needsBindOnly = true; - } -} -function triggerUnbind() { - this.target.removeEventListener(this.targetName, this); - this.source = null; - this.context = null; -} -function updateAttributeTarget(value) { - DOM.setAttribute(this.target, this.targetName, value); -} -function updateBooleanAttributeTarget(value) { - DOM.setBooleanAttribute(this.target, this.targetName, value); -} -function updateContentTarget(value) { - // If there's no actual value, then this equates to the - // empty string for the purposes of content bindings. - if (value === null || value === undefined) { - value = ""; - } - // If the value has a "create" method, then it's a template-like. - if (value.create) { - this.target.textContent = ""; - var view = this.target.$fastView; - // If there's no previous view that we might be able to - // reuse then create a new view from the template. - if (view === void 0) { - view = value.create(); - } else { - // If there is a previous view, but it wasn't created - // from the same template as the new value, then we - // need to remove the old view if it's still in the DOM - // and create a new view from the template. - if (this.target.$fastTemplate !== value) { - if (view.isComposed) { - view.remove(); - view.unbind(); - } - view = value.create(); - } - } - // It's possible that the value is the same as the previous template - // and that there's actually no need to compose it. - if (!view.isComposed) { - view.isComposed = true; - view.bind(this.source, this.context); - view.insertBefore(this.target); - this.target.$fastView = view; - this.target.$fastTemplate = value; - } else if (view.needsBindOnly) { - view.needsBindOnly = false; - view.bind(this.source, this.context); - } - } else { - var _view = this.target.$fastView; - // If there is a view and it's currently composed into - // the DOM, then we need to remove it. - if (_view !== void 0 && _view.isComposed) { - _view.isComposed = false; - _view.remove(); - if (_view.needsBindOnly) { - _view.needsBindOnly = false; - } else { - _view.unbind(); - } - } - this.target.textContent = value; - } -} -function updatePropertyTarget(value) { - this.target[this.targetName] = value; -} -function updateClassTarget(value) { - var classVersions = this.classVersions || Object.create(null); - var target = this.target; - var version = this.version || 0; - // Add the classes, tracking the version at which they were added. - if (value !== null && value !== undefined && value.length) { - var names = value.split(/\s+/); - for (var i = 0, ii = names.length; i < ii; ++i) { - var currentName = names[i]; - if (currentName === "") { - continue; - } - classVersions[currentName] = version; - target.classList.add(currentName); - } - } - this.classVersions = classVersions; - this.version = version + 1; - // If this is the first call to add classes, there's no need to remove old ones. - if (version === 0) { - return; - } - // Remove classes from the previous version. - version -= 1; - for (var name in classVersions) { - if (classVersions[name] === version) { - target.classList.remove(name); - } - } -} -/** - * A directive that configures data binding to element content and attributes. - * @public - */ -var HTMLBindingDirective = /*#__PURE__*/function (_TargetedHTMLDirectiv) { - /** - * Creates an instance of BindingDirective. - * @param binding - A binding that returns the data used to update the DOM. - */ - function HTMLBindingDirective(binding) { - var _this; - binding_classCallCheck(this, HTMLBindingDirective); - _this = binding_callSuper(this, HTMLBindingDirective); - _this.binding = binding; - _this.bind = normalBind; - _this.unbind = normalUnbind; - _this.updateTarget = updateAttributeTarget; - _this.isBindingVolatile = Observable.isVolatileBinding(_this.binding); - return _this; - } - /** - * Gets/sets the name of the attribute or property that this - * binding is targeting. - */ - binding_inherits(HTMLBindingDirective, _TargetedHTMLDirectiv); - return binding_createClass(HTMLBindingDirective, [{ - key: "targetName", - get: function get() { - return this.originalTargetName; - }, - set: function set(value) { - this.originalTargetName = value; - if (value === void 0) { - return; - } - switch (value[0]) { - case ":": - this.cleanedTargetName = value.substr(1); - this.updateTarget = updatePropertyTarget; - if (this.cleanedTargetName === "innerHTML") { - var binding = this.binding; - this.binding = function (s, c) { - return DOM.createHTML(binding(s, c)); - }; - } - break; - case "?": - this.cleanedTargetName = value.substr(1); - this.updateTarget = updateBooleanAttributeTarget; - break; - case "@": - this.cleanedTargetName = value.substr(1); - this.bind = triggerBind; - this.unbind = triggerUnbind; - break; - default: - this.cleanedTargetName = value; - if (value === "class") { - this.updateTarget = updateClassTarget; - } - break; - } - } - /** - * Makes this binding target the content of an element rather than - * a particular attribute or property. - */ - }, { - key: "targetAtContent", - value: function targetAtContent() { - this.updateTarget = updateContentTarget; - this.unbind = contentUnbind; - } - /** - * Creates the runtime BindingBehavior instance based on the configuration - * information stored in the BindingDirective. - * @param target - The target node that the binding behavior should attach to. - */ - }, { - key: "createBehavior", - value: function createBehavior(target) { - /* eslint-disable-next-line @typescript-eslint/no-use-before-define */ - return new BindingBehavior(target, this.binding, this.isBindingVolatile, this.bind, this.unbind, this.updateTarget, this.cleanedTargetName); - } - }]); -}(TargetedHTMLDirective); -/** - * A behavior that updates content and attributes based on a configured - * BindingDirective. - * @public - */ -var BindingBehavior = /*#__PURE__*/function () { - /** - * Creates an instance of BindingBehavior. - * @param target - The target of the data updates. - * @param binding - The binding that returns the latest value for an update. - * @param isBindingVolatile - Indicates whether the binding has volatile dependencies. - * @param bind - The operation to perform during binding. - * @param unbind - The operation to perform during unbinding. - * @param updateTarget - The operation to perform when updating. - * @param targetName - The name of the target attribute or property to update. - */ - function BindingBehavior(target, binding, isBindingVolatile, bind, unbind, updateTarget, targetName) { - binding_classCallCheck(this, BindingBehavior); - /** @internal */ - this.source = null; - /** @internal */ - this.context = null; - /** @internal */ - this.bindingObserver = null; - this.target = target; - this.binding = binding; - this.isBindingVolatile = isBindingVolatile; - this.bind = bind; - this.unbind = unbind; - this.updateTarget = updateTarget; - this.targetName = targetName; - } - /** @internal */ - return binding_createClass(BindingBehavior, [{ - key: "handleChange", - value: function handleChange() { - this.updateTarget(this.bindingObserver.observe(this.source, this.context)); - } - /** @internal */ - }, { - key: "handleEvent", - value: function handleEvent(event) { - ExecutionContext.setEvent(event); - var result = this.binding(this.source, this.context); - ExecutionContext.setEvent(null); - if (result !== true) { - event.preventDefault(); - } - } - }]); -}(); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js -function compiler_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function compiler_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, compiler_toPropertyKey(o.key), o); } } -function compiler_createClass(e, r, t) { return r && compiler_defineProperties(e.prototype, r), t && compiler_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function compiler_toPropertyKey(t) { var i = compiler_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function compiler_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } - - -var sharedContext = null; -var CompilationContext = /*#__PURE__*/function () { - function CompilationContext() { - compiler_classCallCheck(this, CompilationContext); - } - return compiler_createClass(CompilationContext, [{ - key: "addFactory", - value: function addFactory(factory) { - factory.targetIndex = this.targetIndex; - this.behaviorFactories.push(factory); - } - }, { - key: "captureContentBinding", - value: function captureContentBinding(directive) { - directive.targetAtContent(); - this.addFactory(directive); - } - }, { - key: "reset", - value: function reset() { - this.behaviorFactories = []; - this.targetIndex = -1; - } - }, { - key: "release", - value: function release() { - /* eslint-disable-next-line @typescript-eslint/no-this-alias */ - sharedContext = this; - } - }], [{ - key: "borrow", - value: function borrow(directives) { - var shareable = sharedContext || new CompilationContext(); - shareable.directives = directives; - shareable.reset(); - sharedContext = null; - return shareable; - } - }]); -}(); -function createAggregateBinding(parts) { - if (parts.length === 1) { - return parts[0]; - } - var targetName; - var partCount = parts.length; - var finalParts = parts.map(function (x) { - if (typeof x === "string") { - return function () { - return x; - }; - } - targetName = x.targetName || targetName; - return x.binding; - }); - var binding = function binding(scope, context) { - var output = ""; - for (var i = 0; i < partCount; ++i) { - output += finalParts[i](scope, context); - } - return output; - }; - var directive = new HTMLBindingDirective(binding); - directive.targetName = targetName; - return directive; -} -var interpolationEndLength = _interpolationEnd.length; -function parseContent(context, value) { - var valueParts = value.split(_interpolationStart); - if (valueParts.length === 1) { - return null; - } - var bindingParts = []; - for (var i = 0, ii = valueParts.length; i < ii; ++i) { - var current = valueParts[i]; - var index = current.indexOf(_interpolationEnd); - var literal = void 0; - if (index === -1) { - literal = current; - } else { - var directiveIndex = parseInt(current.substring(0, index)); - bindingParts.push(context.directives[directiveIndex]); - literal = current.substring(index + interpolationEndLength); - } - if (literal !== "") { - bindingParts.push(literal); - } - } - return bindingParts; -} -function compileAttributes(context, node) { - var includeBasicValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var attributes = node.attributes; - var _loop = function _loop(_i, _ii) { - var attr = attributes[_i]; - var attrValue = attr.value; - var parseResult = parseContent(context, attrValue); - var result = null; - if (parseResult === null) { - if (includeBasicValues) { - result = new HTMLBindingDirective(function () { - return attrValue; - }); - result.targetName = attr.name; - } - } else { - result = createAggregateBinding(parseResult); - } - if (result !== null) { - node.removeAttributeNode(attr); - _i--; - _ii--; - context.addFactory(result); - } - i = _i, ii = _ii; - }; - for (var i = 0, ii = attributes.length; i < ii; ++i) { - _loop(i, ii); - } -} -function compileContent(context, node, walker) { - var parseResult = parseContent(context, node.textContent); - if (parseResult !== null) { - var lastNode = node; - for (var i = 0, ii = parseResult.length; i < ii; ++i) { - var currentPart = parseResult[i]; - var currentNode = i === 0 ? node : lastNode.parentNode.insertBefore(document.createTextNode(""), lastNode.nextSibling); - if (typeof currentPart === "string") { - currentNode.textContent = currentPart; - } else { - currentNode.textContent = " "; - context.captureContentBinding(currentPart); - } - lastNode = currentNode; - context.targetIndex++; - if (currentNode !== node) { - walker.nextNode(); - } - } - context.targetIndex--; - } -} -/** - * Compiles a template and associated directives into a raw compilation - * result which include a cloneable DocumentFragment and factories capable - * of attaching runtime behavior to nodes within the fragment. - * @param template - The template to compile. - * @param directives - The directives referenced by the template. - * @remarks - * The template that is provided for compilation is altered in-place - * and cannot be compiled again. If the original template must be preserved, - * it is recommended that you clone the original and pass the clone to this API. - * @public - */ -function compileTemplate(template, directives) { - var fragment = template.content; - // https://bugs.chromium.org/p/chromium/issues/detail?id=1111864 - document.adoptNode(fragment); - var context = CompilationContext.borrow(directives); - compileAttributes(context, template, true); - var hostBehaviorFactories = context.behaviorFactories; - context.reset(); - var walker = DOM.createTemplateWalker(fragment); - var node; - while (node = walker.nextNode()) { - context.targetIndex++; - switch (node.nodeType) { - case 1: - // element node - compileAttributes(context, node); - break; - case 3: - // text node - compileContent(context, node, walker); - break; - case 8: - // comment - if (DOM.isMarker(node)) { - context.addFactory(directives[DOM.extractDirectiveIndexFromMarker(node)]); - } - } - } - var targetOffset = 0; - if ( - // If the first node in a fragment is a marker, that means it's an unstable first node, - // because something like a when, repeat, etc. could add nodes before the marker. - // To mitigate this, we insert a stable first node. However, if we insert a node, - // that will alter the result of the TreeWalker. So, we also need to offset the target index. - DOM.isMarker(fragment.firstChild) || - // Or if there is only one node and a directive, it means the template's content - // is *only* the directive. In that case, HTMLView.dispose() misses any nodes inserted by - // the directive. Inserting a new node ensures proper disposal of nodes added by the directive. - fragment.childNodes.length === 1 && directives.length) { - fragment.insertBefore(document.createComment(""), fragment.firstChild); - targetOffset = -1; - } - var viewBehaviorFactories = context.behaviorFactories; - context.release(); - return { - fragment: fragment, - viewBehaviorFactories: viewBehaviorFactories, - hostBehaviorFactories: hostBehaviorFactories, - targetOffset: targetOffset - }; -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/templating/view.js -function view_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function view_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, view_toPropertyKey(o.key), o); } } -function view_createClass(e, r, t) { return r && view_defineProperties(e.prototype, r), t && view_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function view_toPropertyKey(t) { var i = view_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function view_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -// A singleton Range instance used to efficiently remove ranges of DOM nodes. -// See the implementation of HTMLView below for further details. -var range = document.createRange(); -/** - * The standard View implementation, which also implements ElementView and SyntheticView. - * @public - */ -var HTMLView = /*#__PURE__*/function () { - /** - * Constructs an instance of HTMLView. - * @param fragment - The html fragment that contains the nodes for this view. - * @param behaviors - The behaviors to be applied to this view. - */ - function HTMLView(fragment, behaviors) { - view_classCallCheck(this, HTMLView); - this.fragment = fragment; - this.behaviors = behaviors; - /** - * The data that the view is bound to. - */ - this.source = null; - /** - * The execution context the view is running within. - */ - this.context = null; - this.firstChild = fragment.firstChild; - this.lastChild = fragment.lastChild; - } - /** - * Appends the view's DOM nodes to the referenced node. - * @param node - The parent node to append the view's DOM nodes to. - */ - return view_createClass(HTMLView, [{ - key: "appendTo", - value: function appendTo(node) { - node.appendChild(this.fragment); - } - /** - * Inserts the view's DOM nodes before the referenced node. - * @param node - The node to insert the view's DOM before. - */ - }, { - key: "insertBefore", - value: function insertBefore(node) { - if (this.fragment.hasChildNodes()) { - node.parentNode.insertBefore(this.fragment, node); - } else { - var end = this.lastChild; - if (node.previousSibling === end) return; - var parentNode = node.parentNode; - var current = this.firstChild; - var next; - while (current !== end) { - next = current.nextSibling; - parentNode.insertBefore(current, node); - current = next; - } - parentNode.insertBefore(end, node); - } - } - /** - * Removes the view's DOM nodes. - * The nodes are not disposed and the view can later be re-inserted. - */ - }, { - key: "remove", - value: function remove() { - var fragment = this.fragment; - var end = this.lastChild; - var current = this.firstChild; - var next; - while (current !== end) { - next = current.nextSibling; - fragment.appendChild(current); - current = next; - } - fragment.appendChild(end); - } - /** - * Removes the view and unbinds its behaviors, disposing of DOM nodes afterward. - * Once a view has been disposed, it cannot be inserted or bound again. - */ - }, { - key: "dispose", - value: function dispose() { - var parent = this.firstChild.parentNode; - var end = this.lastChild; - var current = this.firstChild; - var next; - while (current !== end) { - next = current.nextSibling; - parent.removeChild(current); - current = next; - } - parent.removeChild(end); - var behaviors = this.behaviors; - var oldSource = this.source; - for (var i = 0, ii = behaviors.length; i < ii; ++i) { - behaviors[i].unbind(oldSource); - } - } - /** - * Binds a view's behaviors to its binding source. - * @param source - The binding source for the view's binding behaviors. - * @param context - The execution context to run the behaviors within. - */ - }, { - key: "bind", - value: function bind(source, context) { - var behaviors = this.behaviors; - if (this.source === source) { - return; - } else if (this.source !== null) { - var oldSource = this.source; - this.source = source; - this.context = context; - for (var i = 0, ii = behaviors.length; i < ii; ++i) { - var current = behaviors[i]; - current.unbind(oldSource); - current.bind(source, context); - } - } else { - this.source = source; - this.context = context; - for (var _i = 0, _ii = behaviors.length; _i < _ii; ++_i) { - behaviors[_i].bind(source, context); - } - } - } - /** - * Unbinds a view's behaviors from its binding source. - */ - }, { - key: "unbind", - value: function unbind() { - if (this.source === null) { - return; - } - var behaviors = this.behaviors; - var oldSource = this.source; - for (var i = 0, ii = behaviors.length; i < ii; ++i) { - behaviors[i].unbind(oldSource); - } - this.source = null; - } - /** - * Efficiently disposes of a contiguous range of synthetic view instances. - * @param views - A contiguous range of views to be disposed. - */ - }], [{ - key: "disposeContiguousBatch", - value: function disposeContiguousBatch(views) { - if (views.length === 0) { - return; - } - range.setStartBefore(views[0].firstChild); - range.setEndAfter(views[views.length - 1].lastChild); - range.deleteContents(); - for (var i = 0, ii = views.length; i < ii; ++i) { - var view = views[i]; - var behaviors = view.behaviors; - var oldSource = view.source; - for (var j = 0, jj = behaviors.length; j < jj; ++j) { - behaviors[j].unbind(oldSource); - } - } - } - }]); -}(); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/templating/template.js -function template_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function template_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, template_toPropertyKey(o.key), o); } } -function template_createClass(e, r, t) { return r && template_defineProperties(e.prototype, r), t && template_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function template_toPropertyKey(t) { var i = template_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function template_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } - - - - - - -/** - * A template capable of creating HTMLView instances or rendering directly to DOM. - * @public - */ -/* eslint-disable-next-line @typescript-eslint/no-unused-vars */ -var ViewTemplate = /*#__PURE__*/function () { - /** - * Creates an instance of ViewTemplate. - * @param html - The html representing what this template will instantiate, including placeholders for directives. - * @param directives - The directives that will be connected to placeholders in the html. - */ - function ViewTemplate(html, directives) { - template_classCallCheck(this, ViewTemplate); - this.behaviorCount = 0; - this.hasHostBehaviors = false; - this.fragment = null; - this.targetOffset = 0; - this.viewBehaviorFactories = null; - this.hostBehaviorFactories = null; - this.html = html; - this.directives = directives; - } - /** - * Creates an HTMLView instance based on this template definition. - * @param hostBindingTarget - The element that host behaviors will be bound to. - */ - return template_createClass(ViewTemplate, [{ - key: "create", - value: function create(hostBindingTarget) { - if (this.fragment === null) { - var template; - var _html = this.html; - if (typeof _html === "string") { - template = document.createElement("template"); - template.innerHTML = DOM.createHTML(_html); - var fec = template.content.firstElementChild; - if (fec !== null && fec.tagName === "TEMPLATE") { - template = fec; - } - } else { - template = _html; - } - var result = compileTemplate(template, this.directives); - this.fragment = result.fragment; - this.viewBehaviorFactories = result.viewBehaviorFactories; - this.hostBehaviorFactories = result.hostBehaviorFactories; - this.targetOffset = result.targetOffset; - this.behaviorCount = this.viewBehaviorFactories.length + this.hostBehaviorFactories.length; - this.hasHostBehaviors = this.hostBehaviorFactories.length > 0; - } - var fragment = this.fragment.cloneNode(true); - var viewFactories = this.viewBehaviorFactories; - var behaviors = new Array(this.behaviorCount); - var walker = DOM.createTemplateWalker(fragment); - var behaviorIndex = 0; - var targetIndex = this.targetOffset; - var node = walker.nextNode(); - for (var ii = viewFactories.length; behaviorIndex < ii; ++behaviorIndex) { - var factory = viewFactories[behaviorIndex]; - var factoryIndex = factory.targetIndex; - while (node !== null) { - if (targetIndex === factoryIndex) { - behaviors[behaviorIndex] = factory.createBehavior(node); - break; - } else { - node = walker.nextNode(); - targetIndex++; - } - } - } - if (this.hasHostBehaviors) { - var hostFactories = this.hostBehaviorFactories; - for (var i = 0, _ii = hostFactories.length; i < _ii; ++i, ++behaviorIndex) { - behaviors[behaviorIndex] = hostFactories[i].createBehavior(hostBindingTarget); - } - } - return new HTMLView(fragment, behaviors); - } - /** - * Creates an HTMLView from this template, binds it to the source, and then appends it to the host. - * @param source - The data source to bind the template to. - * @param host - The Element where the template will be rendered. - * @param hostBindingTarget - An HTML element to target the host bindings at if different from the - * host that the template is being attached to. - */ - }, { - key: "render", - value: function render(source, host, hostBindingTarget) { - if (typeof host === "string") { - host = document.getElementById(host); - } - if (hostBindingTarget === void 0) { - hostBindingTarget = host; - } - var view = this.create(hostBindingTarget); - view.bind(source, defaultExecutionContext); - view.appendTo(host); - return view; - } - }]); -}(); -// Much thanks to LitHTML for working this out! -var lastAttributeNameRegex = /* eslint-disable-next-line no-control-regex */ -/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; -/** - * Transforms a template literal string into a renderable ViewTemplate. - * @param strings - The string fragments that are interpolated with the values. - * @param values - The values that are interpolated with the string fragments. - * @remarks - * The html helper supports interpolation of strings, numbers, binding expressions, - * other template instances, and Directive instances. - * @public - */ -function html(strings) { - var _arguments = arguments; - var directives = []; - var html = ""; - var _loop = function _loop() { - var currentString = strings[i]; - var value = i + 1 < 1 || _arguments.length <= i + 1 ? undefined : _arguments[i + 1]; - html += currentString; - if (value instanceof ViewTemplate) { - var template = value; - value = function value() { - return template; - }; - } - if (typeof value === "function") { - value = new HTMLBindingDirective(value); - } - if (value instanceof TargetedHTMLDirective) { - var match = lastAttributeNameRegex.exec(currentString); - if (match !== null) { - value.targetName = match[2]; - } - } - if (value instanceof HTMLDirective) { - // Since not all values are directives, we can't use i - // as the index for the placeholder. Instead, we need to - // use directives.length to get the next index. - html += value.createPlaceholder(directives.length); - directives.push(value); - } else { - html += value; - } - }; - for (var i = 0, ii = strings.length - 1; i < ii; ++i) { - _loop(); - } - html += strings[strings.length - 1]; - return new ViewTemplate(html, directives); -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js -var _templateObject; -function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); } - -/** - * The template for the {@link @microsoft/fast-foundation#Badge} component. - * @public - */ -var badgeTemplate = function badgeTemplate(context, definition) { - return html(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n \n"])), function (x) { - return x.circular ? "circular" : ""; - }, function (x) { - return x.generateBadgeStyle(); - }); -}; -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js -function css_directive_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function css_directive_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, css_directive_toPropertyKey(o.key), o); } } -function css_directive_createClass(e, r, t) { return r && css_directive_defineProperties(e.prototype, r), t && css_directive_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function css_directive_toPropertyKey(t) { var i = css_directive_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function css_directive_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -/** - * Directive for use in {@link css}. - * - * @public - */ -var css_directive_CSSDirective = /*#__PURE__*/function () { - function CSSDirective() { - css_directive_classCallCheck(this, CSSDirective); - } - return css_directive_createClass(CSSDirective, [{ - key: "createCSS", - value: - /** - * Creates a CSS fragment to interpolate into the CSS document. - * @returns - the string to interpolate into CSS - */ - function createCSS() { - return ""; - } - /** - * Creates a behavior to bind to the host element. - * @returns - the behavior to bind to the host element, or undefined. - */ - }, { - key: "createBehavior", - value: function createBehavior() { - return undefined; - } - }]); -}(); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/styles/css.js -function css_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function css_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, css_toPropertyKey(o.key), o); } } -function css_createClass(e, r, t) { return r && css_defineProperties(e.prototype, r), t && css_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function css_toPropertyKey(t) { var i = css_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function css_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function css_callSuper(t, o, e) { return o = css_getPrototypeOf(o), css_possibleConstructorReturn(t, css_isNativeReflectConstruct() ? Reflect.construct(o, e || [], css_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function css_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return css_assertThisInitialized(t); } -function css_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function css_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (css_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function css_getPrototypeOf(t) { return css_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, css_getPrototypeOf(t); } -function css_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && css_setPrototypeOf(t, e); } -function css_setPrototypeOf(t, e) { return css_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, css_setPrototypeOf(t, e); } -function css_toConsumableArray(r) { return css_arrayWithoutHoles(r) || css_iterableToArray(r) || css_unsupportedIterableToArray(r) || css_nonIterableSpread(); } -function css_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function css_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return css_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? css_arrayLikeToArray(r, a) : void 0; } } -function css_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } -function css_arrayWithoutHoles(r) { if (Array.isArray(r)) return css_arrayLikeToArray(r); } -function css_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } - - -function collectStyles(strings, values) { - var styles = []; - var cssString = ""; - var behaviors = []; - for (var i = 0, ii = strings.length - 1; i < ii; ++i) { - cssString += strings[i]; - var value = values[i]; - if (value instanceof css_directive_CSSDirective) { - var behavior = value.createBehavior(); - value = value.createCSS(); - if (behavior) { - behaviors.push(behavior); - } - } - if (value instanceof element_styles_ElementStyles || value instanceof CSSStyleSheet) { - if (cssString.trim() !== "") { - styles.push(cssString); - cssString = ""; - } - styles.push(value); - } else { - cssString += value; - } - } - cssString += strings[strings.length - 1]; - if (cssString.trim() !== "") { - styles.push(cssString); - } - return { - styles: styles, - behaviors: behaviors - }; -} -/** - * Transforms a template literal string into styles. - * @param strings - The string fragments that are interpolated with the values. - * @param values - The values that are interpolated with the string fragments. - * @remarks - * The css helper supports interpolation of strings and ElementStyle instances. - * @public - */ -function css(strings) { - for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - values[_key - 1] = arguments[_key]; - } - var _collectStyles = collectStyles(strings, values), - styles = _collectStyles.styles, - behaviors = _collectStyles.behaviors; - var elementStyles = element_styles_ElementStyles.create(styles); - if (behaviors.length) { - elementStyles.withBehaviors.apply(elementStyles, css_toConsumableArray(behaviors)); - } - return elementStyles; -} -var CSSPartial = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_CSSDirective) { - function CSSPartial(styles, behaviors) { - var _this; - css_classCallCheck(this, CSSPartial); - _this = css_callSuper(this, CSSPartial); - _this.behaviors = behaviors; - _this.css = ""; - var stylesheets = styles.reduce(function (accumulated, current) { - if (typeof current === "string") { - _this.css += current; - } else { - accumulated.push(current); - } - return accumulated; - }, []); - if (stylesheets.length) { - _this.styles = ElementStyles.create(stylesheets); - } - return _this; - } - css_inherits(CSSPartial, _CSSDirective); - return css_createClass(CSSPartial, [{ - key: "createBehavior", - value: function createBehavior() { - return this; - } - }, { - key: "createCSS", - value: function createCSS() { - return this.css; - } - }, { - key: "bind", - value: function bind(el) { - if (this.styles) { - el.$fastController.addStyles(this.styles); - } - if (this.behaviors.length) { - el.$fastController.addBehaviors(this.behaviors); - } - } - }, { - key: "unbind", - value: function unbind(el) { - if (this.styles) { - el.$fastController.removeStyles(this.styles); - } - if (this.behaviors.length) { - el.$fastController.removeBehaviors(this.behaviors); - } - } - }]); -}(CSSDirective))); -/** - * Transforms a template literal string into partial CSS. - * @param strings - The string fragments that are interpolated with the values. - * @param values - The values that are interpolated with the string fragments. - * @public - */ -function cssPartial(strings) { - for (var _len2 = arguments.length, values = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - values[_key2 - 1] = arguments[_key2]; - } - var _collectStyles2 = collectStyles(strings, values), - styles = _collectStyles2.styles, - behaviors = _collectStyles2.behaviors; - return new CSSPartial(styles, behaviors); -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js -/** - * A CSS fragment to set `display: none;` when the host is hidden using the [hidden] attribute. - * @public - */ -var display_hidden = ":host([hidden]){display:none}"; -/** - * Applies a CSS display property. - * Also adds CSS rules to not display the element when the [hidden] attribute is applied to the element. - * @param display - The CSS display property value - * @public - */ -function display(displayValue) { - return "".concat(display_hidden, ":host{display:").concat(displayValue, "}"); -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js -/** - * Retrieves the "composed parent" element of a node, ignoring DOM tree boundaries. - * When the parent of a node is a shadow-root, it will return the host - * element of the shadow root. Otherwise it will return the parent node or null if - * no parent node exists. - * @param element - The element for which to retrieve the composed parent - * - * @public - */ -function composedParent(element) { - var parentNode = element.parentElement; - if (parentNode) { - return parentNode; - } else { - var rootNode = element.getRootNode(); - if (rootNode.host instanceof HTMLElement) { - // this is shadow-root - return rootNode.host; - } - } - return null; -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js - -/** - * Determines if the reference element contains the test element in a "composed" DOM tree that - * ignores shadow DOM boundaries. - * - * Returns true of the test element is a descendent of the reference, or exist in - * a shadow DOM that is a logical descendent of the reference. Otherwise returns false. - * @param reference - The element to test for containment against. - * @param test - The element being tested for containment. - * - * @public - */ -function composedContains(reference, test) { - var current = test; - while (current !== null) { - if (current === reference) { - return true; - } - current = composedParent(current); - } - return false; -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js -function custom_property_manager_slicedToArray(r, e) { return custom_property_manager_arrayWithHoles(r) || custom_property_manager_iterableToArrayLimit(r, e) || custom_property_manager_unsupportedIterableToArray(r, e) || custom_property_manager_nonIterableRest(); } -function custom_property_manager_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function custom_property_manager_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } -function custom_property_manager_arrayWithHoles(r) { if (Array.isArray(r)) return r; } -function custom_property_manager_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = custom_property_manager_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } -function custom_property_manager_toConsumableArray(r) { return custom_property_manager_arrayWithoutHoles(r) || custom_property_manager_iterableToArray(r) || custom_property_manager_unsupportedIterableToArray(r) || custom_property_manager_nonIterableSpread(); } -function custom_property_manager_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function custom_property_manager_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return custom_property_manager_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? custom_property_manager_arrayLikeToArray(r, a) : void 0; } } -function custom_property_manager_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } -function custom_property_manager_arrayWithoutHoles(r) { if (Array.isArray(r)) return custom_property_manager_arrayLikeToArray(r); } -function custom_property_manager_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } -function custom_property_manager_callSuper(t, o, e) { return o = custom_property_manager_getPrototypeOf(o), custom_property_manager_possibleConstructorReturn(t, custom_property_manager_isNativeReflectConstruct() ? Reflect.construct(o, e || [], custom_property_manager_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function custom_property_manager_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return custom_property_manager_assertThisInitialized(t); } -function custom_property_manager_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function custom_property_manager_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (custom_property_manager_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function custom_property_manager_getPrototypeOf(t) { return custom_property_manager_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, custom_property_manager_getPrototypeOf(t); } -function custom_property_manager_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && custom_property_manager_setPrototypeOf(t, e); } -function custom_property_manager_setPrototypeOf(t, e) { return custom_property_manager_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, custom_property_manager_setPrototypeOf(t, e); } -function custom_property_manager_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function custom_property_manager_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, custom_property_manager_toPropertyKey(o.key), o); } } -function custom_property_manager_createClass(e, r, t) { return r && custom_property_manager_defineProperties(e.prototype, r), t && custom_property_manager_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function custom_property_manager_toPropertyKey(t) { var i = custom_property_manager_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function custom_property_manager_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } - - -var defaultElement = document.createElement("div"); -function isFastElement(element) { - return element instanceof FASTElement; -} -var QueuedStyleSheetTarget = /*#__PURE__*/function () { - function QueuedStyleSheetTarget() { - custom_property_manager_classCallCheck(this, QueuedStyleSheetTarget); - } - return custom_property_manager_createClass(QueuedStyleSheetTarget, [{ - key: "setProperty", - value: function setProperty(name, value) { - var _this = this; - DOM.queueUpdate(function () { - return _this.target.setProperty(name, value); - }); - } - }, { - key: "removeProperty", - value: function removeProperty(name) { - var _this2 = this; - DOM.queueUpdate(function () { - return _this2.target.removeProperty(name); - }); - } - }]); -}(); -/** - * Handles setting properties for a FASTElement using Constructable Stylesheets - */ -var ConstructableStyleSheetTarget = /*#__PURE__*/function (_QueuedStyleSheetTarg) { - function ConstructableStyleSheetTarget(source) { - var _this3; - custom_property_manager_classCallCheck(this, ConstructableStyleSheetTarget); - _this3 = custom_property_manager_callSuper(this, ConstructableStyleSheetTarget); - var sheet = new CSSStyleSheet(); - sheet[prependToAdoptedStyleSheetsSymbol] = true; - _this3.target = sheet.cssRules[sheet.insertRule(":host{}")].style; - source.$fastController.addStyles(element_styles_ElementStyles.create([sheet])); - return _this3; - } - custom_property_manager_inherits(ConstructableStyleSheetTarget, _QueuedStyleSheetTarg); - return custom_property_manager_createClass(ConstructableStyleSheetTarget); -}(QueuedStyleSheetTarget); -var DocumentStyleSheetTarget = /*#__PURE__*/function (_QueuedStyleSheetTarg2) { - function DocumentStyleSheetTarget() { - var _this4; - custom_property_manager_classCallCheck(this, DocumentStyleSheetTarget); - _this4 = custom_property_manager_callSuper(this, DocumentStyleSheetTarget); - var sheet = new CSSStyleSheet(); - _this4.target = sheet.cssRules[sheet.insertRule(":root{}")].style; - document.adoptedStyleSheets = [].concat(custom_property_manager_toConsumableArray(document.adoptedStyleSheets), [sheet]); - return _this4; - } - custom_property_manager_inherits(DocumentStyleSheetTarget, _QueuedStyleSheetTarg2); - return custom_property_manager_createClass(DocumentStyleSheetTarget); -}(QueuedStyleSheetTarget); -var HeadStyleElementStyleSheetTarget = /*#__PURE__*/function (_QueuedStyleSheetTarg3) { - function HeadStyleElementStyleSheetTarget() { - var _this5; - custom_property_manager_classCallCheck(this, HeadStyleElementStyleSheetTarget); - _this5 = custom_property_manager_callSuper(this, HeadStyleElementStyleSheetTarget); - _this5.style = document.createElement("style"); - document.head.appendChild(_this5.style); - var sheet = _this5.style.sheet; - // Because the HTMLStyleElement has been appended, - // there shouldn't exist a case where `sheet` is null, - // but if-check it just in case. - if (sheet) { - // https://github.com/jsdom/jsdom uses https://github.com/NV/CSSOM for it's CSSOM implementation, - // which implements the DOM Level 2 spec for CSSStyleSheet where insertRule() requires an index argument. - var index = sheet.insertRule(":root{}", sheet.cssRules.length); - _this5.target = sheet.cssRules[index].style; - } - return _this5; - } - custom_property_manager_inherits(HeadStyleElementStyleSheetTarget, _QueuedStyleSheetTarg3); - return custom_property_manager_createClass(HeadStyleElementStyleSheetTarget); -}(QueuedStyleSheetTarget); -/** - * Handles setting properties for a FASTElement using an HTMLStyleElement - */ -var StyleElementStyleSheetTarget = /*#__PURE__*/function () { - function StyleElementStyleSheetTarget(target) { - custom_property_manager_classCallCheck(this, StyleElementStyleSheetTarget); - this.store = new Map(); - this.target = null; - var controller = target.$fastController; - this.style = document.createElement("style"); - controller.addStyles(this.style); - Observable.getNotifier(controller).subscribe(this, "isConnected"); - this.handleChange(controller, "isConnected"); - } - return custom_property_manager_createClass(StyleElementStyleSheetTarget, [{ - key: "targetChanged", - value: function targetChanged() { - if (this.target !== null) { - var _iterator = custom_property_manager_createForOfIteratorHelper(this.store.entries()), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var _step$value = custom_property_manager_slicedToArray(_step.value, 2), - key = _step$value[0], - value = _step$value[1]; - this.target.setProperty(key, value); - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - } - } - }, { - key: "setProperty", - value: function setProperty(name, value) { - var _this6 = this; - this.store.set(name, value); - DOM.queueUpdate(function () { - if (_this6.target !== null) { - _this6.target.setProperty(name, value); - } - }); - } - }, { - key: "removeProperty", - value: function removeProperty(name) { - var _this7 = this; - this.store.delete(name); - DOM.queueUpdate(function () { - if (_this7.target !== null) { - _this7.target.removeProperty(name); - } - }); - } - }, { - key: "handleChange", - value: function handleChange(source, key) { - // HTMLStyleElement.sheet is null if the element isn't connected to the DOM, - // so this method reacts to changes in DOM connection for the element hosting - // the HTMLStyleElement. - // - // All rules applied via the CSSOM also get cleared when the element disconnects, - // so we need to add a new rule each time and populate it with the stored properties - var sheet = this.style.sheet; - if (sheet) { - // Safari will throw if we try to use the return result of insertRule() - // to index the rule inline, so store as a const prior to indexing. - // https://github.com/jsdom/jsdom uses https://github.com/NV/CSSOM for it's CSSOM implementation, - // which implements the DOM Level 2 spec for CSSStyleSheet where insertRule() requires an index argument. - var index = sheet.insertRule(":host{}", sheet.cssRules.length); - this.target = sheet.cssRules[index].style; - } else { - this.target = null; - } - } - }]); -}(); -__decorate([observable], StyleElementStyleSheetTarget.prototype, "target", void 0); -/** - * Handles setting properties for a normal HTMLElement - */ -var ElementStyleSheetTarget = /*#__PURE__*/function () { - function ElementStyleSheetTarget(source) { - custom_property_manager_classCallCheck(this, ElementStyleSheetTarget); - this.target = source.style; - } - return custom_property_manager_createClass(ElementStyleSheetTarget, [{ - key: "setProperty", - value: function setProperty(name, value) { - var _this8 = this; - DOM.queueUpdate(function () { - return _this8.target.setProperty(name, value); - }); - } - }, { - key: "removeProperty", - value: function removeProperty(name) { - var _this9 = this; - DOM.queueUpdate(function () { - return _this9.target.removeProperty(name); - }); - } - }]); -}(); -/** - * Controls emission for default values. This control is capable - * of emitting to multiple {@link PropertyTarget | PropertyTargets}, - * and only emits if it has at least one root. - * - * @internal - */ -var RootStyleSheetTarget = /*#__PURE__*/function () { - function RootStyleSheetTarget() { - custom_property_manager_classCallCheck(this, RootStyleSheetTarget); - } - return custom_property_manager_createClass(RootStyleSheetTarget, [{ - key: "setProperty", - value: function setProperty(name, value) { - RootStyleSheetTarget.properties[name] = value; - var _iterator2 = custom_property_manager_createForOfIteratorHelper(RootStyleSheetTarget.roots.values()), - _step2; - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - var target = _step2.value; - PropertyTargetManager.getOrCreate(RootStyleSheetTarget.normalizeRoot(target)).setProperty(name, value); - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } - } - }, { - key: "removeProperty", - value: function removeProperty(name) { - delete RootStyleSheetTarget.properties[name]; - var _iterator3 = custom_property_manager_createForOfIteratorHelper(RootStyleSheetTarget.roots.values()), - _step3; - try { - for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { - var target = _step3.value; - PropertyTargetManager.getOrCreate(RootStyleSheetTarget.normalizeRoot(target)).removeProperty(name); - } - } catch (err) { - _iterator3.e(err); - } finally { - _iterator3.f(); - } - } - }], [{ - key: "registerRoot", - value: function registerRoot(root) { - var roots = RootStyleSheetTarget.roots; - if (!roots.has(root)) { - roots.add(root); - var target = PropertyTargetManager.getOrCreate(this.normalizeRoot(root)); - for (var key in RootStyleSheetTarget.properties) { - target.setProperty(key, RootStyleSheetTarget.properties[key]); - } - } - } - }, { - key: "unregisterRoot", - value: function unregisterRoot(root) { - var roots = RootStyleSheetTarget.roots; - if (roots.has(root)) { - roots.delete(root); - var target = PropertyTargetManager.getOrCreate(RootStyleSheetTarget.normalizeRoot(root)); - for (var key in RootStyleSheetTarget.properties) { - target.removeProperty(key); - } - } - } - /** - * Returns the document when provided the default element, - * otherwise is a no-op - * @param root - the root to normalize - */ - }, { - key: "normalizeRoot", - value: function normalizeRoot(root) { - return root === defaultElement ? document : root; - } - }]); -}(); -RootStyleSheetTarget.roots = new Set(); -RootStyleSheetTarget.properties = {}; -// Caches PropertyTarget instances -var propertyTargetCache = new WeakMap(); -// Use Constructable StyleSheets for FAST elements when supported, otherwise use -// HTMLStyleElement instances -var propertyTargetCtor = DOM.supportsAdoptedStyleSheets ? ConstructableStyleSheetTarget : StyleElementStyleSheetTarget; -/** - * Manages creation and caching of PropertyTarget instances. - * - * @internal - */ -var PropertyTargetManager = Object.freeze({ - getOrCreate: function getOrCreate(source) { - if (propertyTargetCache.has(source)) { - /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ - return propertyTargetCache.get(source); - } - var target; - if (source === defaultElement) { - target = new RootStyleSheetTarget(); - } else if (source instanceof Document) { - target = DOM.supportsAdoptedStyleSheets ? new DocumentStyleSheetTarget() : new HeadStyleElementStyleSheetTarget(); - } else if (isFastElement(source)) { - target = new propertyTargetCtor(source); - } else { - target = new ElementStyleSheetTarget(source); - } - propertyTargetCache.set(source, target); - return target; - } -}); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js -function design_token_slicedToArray(r, e) { return design_token_arrayWithHoles(r) || design_token_iterableToArrayLimit(r, e) || design_token_unsupportedIterableToArray(r, e) || design_token_nonIterableRest(); } -function design_token_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function design_token_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } -function design_token_arrayWithHoles(r) { if (Array.isArray(r)) return r; } -function design_token_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = design_token_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } -function design_token_toConsumableArray(r) { return design_token_arrayWithoutHoles(r) || design_token_iterableToArray(r) || design_token_unsupportedIterableToArray(r) || design_token_nonIterableSpread(); } -function design_token_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function design_token_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return design_token_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? design_token_arrayLikeToArray(r, a) : void 0; } } -function design_token_iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } -function design_token_arrayWithoutHoles(r) { if (Array.isArray(r)) return design_token_arrayLikeToArray(r); } -function design_token_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } -function design_token_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function design_token_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, design_token_toPropertyKey(o.key), o); } } -function design_token_createClass(e, r, t) { return r && design_token_defineProperties(e.prototype, r), t && design_token_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function design_token_toPropertyKey(t) { var i = design_token_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function design_token_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function design_token_callSuper(t, o, e) { return o = design_token_getPrototypeOf(o), design_token_possibleConstructorReturn(t, design_token_isNativeReflectConstruct() ? Reflect.construct(o, e || [], design_token_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function design_token_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return design_token_assertThisInitialized(t); } -function design_token_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function design_token_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (design_token_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function design_token_getPrototypeOf(t) { return design_token_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, design_token_getPrototypeOf(t); } -function design_token_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && design_token_setPrototypeOf(t, e); } -function design_token_setPrototypeOf(t, e) { return design_token_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, design_token_setPrototypeOf(t, e); } - - - - - - -/** - * Implementation of {@link (DesignToken:interface)} - */ -var DesignTokenImpl = /*#__PURE__*/function (_CSSDirective) { - function DesignTokenImpl(configuration) { - var _this; - design_token_classCallCheck(this, DesignTokenImpl); - _this = design_token_callSuper(this, DesignTokenImpl); - _this.subscribers = new WeakMap(); - _this._appliedTo = new Set(); - _this.name = configuration.name; - if (configuration.cssCustomPropertyName !== null) { - _this.cssCustomProperty = "--".concat(configuration.cssCustomPropertyName); - _this.cssVar = "var(".concat(_this.cssCustomProperty, ")"); - } - _this.id = DesignTokenImpl.uniqueId(); - DesignTokenImpl.tokensById.set(_this.id, _this); - return _this; - } - design_token_inherits(DesignTokenImpl, _CSSDirective); - return design_token_createClass(DesignTokenImpl, [{ - key: "appliedTo", - get: function get() { - return design_token_toConsumableArray(this._appliedTo); - } - }, { - key: "getOrCreateSubscriberSet", - value: function getOrCreateSubscriberSet() { - var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this; - return this.subscribers.get(target) || this.subscribers.set(target, new Set()) && this.subscribers.get(target); - } - }, { - key: "createCSS", - value: function createCSS() { - return this.cssVar || ""; - } - }, { - key: "getValueFor", - value: function getValueFor(element) { - var value = DesignTokenNode.getOrCreate(element).get(this); - if (value !== undefined) { - return value; - } - throw new Error("Value could not be retrieved for token named \"".concat(this.name, "\". Ensure the value is set for ").concat(element, " or an ancestor of ").concat(element, ".")); - } - }, { - key: "setValueFor", - value: function setValueFor(element, value) { - this._appliedTo.add(element); - if (value instanceof DesignTokenImpl) { - value = this.alias(value); - } - DesignTokenNode.getOrCreate(element).set(this, value); - return this; - } - }, { - key: "deleteValueFor", - value: function deleteValueFor(element) { - this._appliedTo.delete(element); - if (DesignTokenNode.existsFor(element)) { - DesignTokenNode.getOrCreate(element).delete(this); - } - return this; - } - }, { - key: "withDefault", - value: function withDefault(value) { - this.setValueFor(defaultElement, value); - return this; - } - }, { - key: "subscribe", - value: function subscribe(subscriber, target) { - var subscriberSet = this.getOrCreateSubscriberSet(target); - if (target && !DesignTokenNode.existsFor(target)) { - DesignTokenNode.getOrCreate(target); - } - if (!subscriberSet.has(subscriber)) { - subscriberSet.add(subscriber); - } - } - }, { - key: "unsubscribe", - value: function unsubscribe(subscriber, target) { - var list = this.subscribers.get(target || this); - if (list && list.has(subscriber)) { - list.delete(subscriber); - } - } - /** - * Notifies subscribers that the value for an element has changed. - * @param element - The element to emit a notification for - */ - }, { - key: "notify", - value: function notify(element) { - var record = Object.freeze({ - token: this, - target: element - }); - if (this.subscribers.has(this)) { - this.subscribers.get(this).forEach(function (sub) { - return sub.handleChange(record); - }); - } - if (this.subscribers.has(element)) { - this.subscribers.get(element).forEach(function (sub) { - return sub.handleChange(record); - }); - } - } - /** - * Alias the token to the provided token. - * @param token - the token to alias to - */ - }, { - key: "alias", - value: function alias(token) { - return function (target) { - return token.getValueFor(target); - }; - } - }], [{ - key: "from", - value: function from(nameOrConfig) { - return new DesignTokenImpl({ - name: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.name, - cssCustomPropertyName: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.cssCustomPropertyName === void 0 ? nameOrConfig.name : nameOrConfig.cssCustomPropertyName - }); - } - }, { - key: "isCSSDesignToken", - value: function isCSSDesignToken(token) { - return typeof token.cssCustomProperty === "string"; - } - }, { - key: "isDerivedDesignTokenValue", - value: function isDerivedDesignTokenValue(value) { - return typeof value === "function"; - } - /** - * Gets a token by ID. Returns undefined if the token was not found. - * @param id - The ID of the token - * @returns - */ - }, { - key: "getTokenById", - value: function getTokenById(id) { - return DesignTokenImpl.tokensById.get(id); - } - }]); -}(css_directive_CSSDirective); -DesignTokenImpl.uniqueId = function () { - var id = 0; - return function () { - id++; - return id.toString(16); - }; -}(); -/** - * Token storage by token ID - */ -DesignTokenImpl.tokensById = new Map(); -var CustomPropertyReflector = /*#__PURE__*/function () { - function CustomPropertyReflector() { - design_token_classCallCheck(this, CustomPropertyReflector); - } - return design_token_createClass(CustomPropertyReflector, [{ - key: "startReflection", - value: function startReflection(token, target) { - token.subscribe(this, target); - this.handleChange({ - token: token, - target: target - }); - } - }, { - key: "stopReflection", - value: function stopReflection(token, target) { - token.unsubscribe(this, target); - this.remove(token, target); - } - }, { - key: "handleChange", - value: function handleChange(record) { - var token = record.token, - target = record.target; - this.add(token, target); - } - }, { - key: "add", - value: function add(token, target) { - PropertyTargetManager.getOrCreate(target).setProperty(token.cssCustomProperty, this.resolveCSSValue(DesignTokenNode.getOrCreate(target).get(token))); - } - }, { - key: "remove", - value: function remove(token, target) { - PropertyTargetManager.getOrCreate(target).removeProperty(token.cssCustomProperty); - } - }, { - key: "resolveCSSValue", - value: function resolveCSSValue(value) { - return value && typeof value.createCSS === "function" ? value.createCSS() : value; - } - }]); -}(); -/** - * A light wrapper around BindingObserver to handle value caching and - * token notification - */ -var DesignTokenBindingObserver = /*#__PURE__*/function () { - function DesignTokenBindingObserver(source, token, node) { - design_token_classCallCheck(this, DesignTokenBindingObserver); - this.source = source; - this.token = token; - this.node = node; - this.dependencies = new Set(); - this.observer = Observable.binding(source, this, false); - // This is a little bit hacky because it's using internal APIs of BindingObserverImpl. - // BindingObserverImpl queues updates to batch it's notifications which doesn't work for this - // scenario because the DesignToken.getValueFor API is not async. Without this, using DesignToken.getValueFor() - // after DesignToken.setValueFor() when setting a dependency of the value being retrieved can return a stale - // value. Assigning .handleChange to .call forces immediate invocation of this classes handleChange() method, - // allowing resolution of values synchronously. - // TODO: https://github.com/microsoft/fast/issues/5110 - this.observer.handleChange = this.observer.call; - this.handleChange(); - } - return design_token_createClass(DesignTokenBindingObserver, [{ - key: "disconnect", - value: function disconnect() { - this.observer.disconnect(); - } - /** - * @internal - */ - }, { - key: "handleChange", - value: function handleChange() { - this.node.store.set(this.token, this.observer.observe(this.node.target, defaultExecutionContext)); - } - }]); -}(); -/** - * Stores resolved token/value pairs and notifies on changes - */ -var Store = /*#__PURE__*/function () { - function Store() { - design_token_classCallCheck(this, Store); - this.values = new Map(); - } - return design_token_createClass(Store, [{ - key: "set", - value: function set(token, value) { - if (this.values.get(token) !== value) { - this.values.set(token, value); - Observable.getNotifier(this).notify(token.id); - } - } - }, { - key: "get", - value: function get(token) { - Observable.track(this, token.id); - return this.values.get(token); - } - }, { - key: "delete", - value: function _delete(token) { - this.values.delete(token); - } - }, { - key: "all", - value: function all() { - return this.values.entries(); - } - }]); -}(); -var nodeCache = new WeakMap(); -var childToParent = new WeakMap(); -/** - * A node responsible for setting and getting token values, - * emitting values to CSS custom properties, and maintaining - * inheritance structures. - */ -var DesignTokenNode = /*#__PURE__*/function () { - function DesignTokenNode(target) { - var _this2 = this; - design_token_classCallCheck(this, DesignTokenNode); - this.target = target; - /** - * Stores all resolved token values for a node - */ - this.store = new Store(); - /** - * All children assigned to the node - */ - this.children = []; - /** - * All values explicitly assigned to the node in their raw form - */ - this.assignedValues = new Map(); - /** - * Tokens currently being reflected to CSS custom properties - */ - this.reflecting = new Set(); - /** - * Binding observers for assigned and inherited derived values. - */ - this.bindingObservers = new Map(); - /** - * Emits notifications to token when token values - * change the DesignTokenNode - */ - this.tokenValueChangeHandler = { - handleChange: function handleChange(source, arg) { - var token = DesignTokenImpl.getTokenById(arg); - if (token) { - // Notify any token subscribers - token.notify(_this2.target); - _this2.updateCSSTokenReflection(source, token); - } - } - }; - nodeCache.set(target, this); - // Map store change notifications to token change notifications - Observable.getNotifier(this.store).subscribe(this.tokenValueChangeHandler); - if (target instanceof FASTElement) { - target.$fastController.addBehaviors([this]); - } else if (target.isConnected) { - this.bind(); - } - } - /** - * Returns a DesignTokenNode for an element. - * Creates a new instance if one does not already exist for a node, - * otherwise returns the cached instance - * - * @param target - The HTML element to retrieve a DesignTokenNode for - */ - return design_token_createClass(DesignTokenNode, [{ - key: "parent", - get: - /** - * The parent DesignTokenNode, or null. - */ - function get() { - return childToParent.get(this) || null; - } - }, { - key: "updateCSSTokenReflection", - value: function updateCSSTokenReflection(source, token) { - if (DesignTokenImpl.isCSSDesignToken(token)) { - var parent = this.parent; - var reflecting = this.isReflecting(token); - if (parent) { - var parentValue = parent.get(token); - var sourceValue = source.get(token); - if (parentValue !== sourceValue && !reflecting) { - this.reflectToCSS(token); - } else if (parentValue === sourceValue && reflecting) { - this.stopReflectToCSS(token); - } - } else if (!reflecting) { - this.reflectToCSS(token); - } - } - } - /** - * Checks if a token has been assigned an explicit value the node. - * @param token - the token to check. - */ - }, { - key: "has", - value: function has(token) { - return this.assignedValues.has(token); - } - /** - * Gets the value of a token for a node - * @param token - The token to retrieve the value for - * @returns - */ - }, { - key: "get", - value: function get(token) { - var value = this.store.get(token); - if (value !== undefined) { - return value; - } - var raw = this.getRaw(token); - if (raw !== undefined) { - this.hydrate(token, raw); - return this.get(token); - } - } - /** - * Retrieves the raw assigned value of a token from the nearest assigned node. - * @param token - The token to retrieve a raw value for - * @returns - */ - }, { - key: "getRaw", - value: function getRaw(token) { - var _a; - if (this.assignedValues.has(token)) { - return this.assignedValues.get(token); - } - return (_a = DesignTokenNode.findClosestAssignedNode(token, this)) === null || _a === void 0 ? void 0 : _a.getRaw(token); - } - /** - * Sets a token to a value for a node - * @param token - The token to set - * @param value - The value to set the token to - */ - }, { - key: "set", - value: function set(token, value) { - if (DesignTokenImpl.isDerivedDesignTokenValue(this.assignedValues.get(token))) { - this.tearDownBindingObserver(token); - } - this.assignedValues.set(token, value); - if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { - this.setupBindingObserver(token, value); - } else { - this.store.set(token, value); - } - } - /** - * Deletes a token value for the node. - * @param token - The token to delete the value for - */ - }, { - key: "delete", - value: function _delete(token) { - this.assignedValues.delete(token); - this.tearDownBindingObserver(token); - var upstream = this.getRaw(token); - if (upstream) { - this.hydrate(token, upstream); - } else { - this.store.delete(token); - } - } - /** - * Invoked when the DesignTokenNode.target is attached to the document - */ - }, { - key: "bind", - value: function bind() { - var parent = DesignTokenNode.findParent(this); - if (parent) { - parent.appendChild(this); - } - var _iterator = design_token_createForOfIteratorHelper(this.assignedValues.keys()), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var key = _step.value; - key.notify(this.target); - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - } - /** - * Invoked when the DesignTokenNode.target is detached from the document - */ - }, { - key: "unbind", - value: function unbind() { - if (this.parent) { - var parent = childToParent.get(this); - parent.removeChild(this); - } - } - /** - * Appends a child to a parent DesignTokenNode. - * @param child - The child to append to the node - */ - }, { - key: "appendChild", - value: function appendChild(child) { - if (child.parent) { - childToParent.get(child).removeChild(child); - } - var reParent = this.children.filter(function (x) { - return child.contains(x); - }); - childToParent.set(child, this); - this.children.push(child); - reParent.forEach(function (x) { - return child.appendChild(x); - }); - Observable.getNotifier(this.store).subscribe(child); - // How can we not notify *every* subscriber? - var _iterator2 = design_token_createForOfIteratorHelper(this.store.all()), - _step2; - try { - for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { - var _step2$value = design_token_slicedToArray(_step2.value, 2), - token = _step2$value[0], - value = _step2$value[1]; - child.hydrate(token, this.bindingObservers.has(token) ? this.getRaw(token) : value); - } - } catch (err) { - _iterator2.e(err); - } finally { - _iterator2.f(); - } - } - /** - * Removes a child from a node. - * @param child - The child to remove. - */ - }, { - key: "removeChild", - value: function removeChild(child) { - var childIndex = this.children.indexOf(child); - if (childIndex !== -1) { - this.children.splice(childIndex, 1); - } - Observable.getNotifier(this.store).unsubscribe(child); - return child.parent === this ? childToParent.delete(child) : false; - } - /** - * Tests whether a provided node is contained by - * the calling node. - * @param test - The node to test - */ - }, { - key: "contains", - value: function contains(test) { - return composedContains(this.target, test.target); - } - /** - * Instructs the node to reflect a design token for the provided token. - * @param token - The design token to reflect - */ - }, { - key: "reflectToCSS", - value: function reflectToCSS(token) { - if (!this.isReflecting(token)) { - this.reflecting.add(token); - DesignTokenNode.cssCustomPropertyReflector.startReflection(token, this.target); - } - } - /** - * Stops reflecting a DesignToken to CSS - * @param token - The design token to stop reflecting - */ - }, { - key: "stopReflectToCSS", - value: function stopReflectToCSS(token) { - if (this.isReflecting(token)) { - this.reflecting.delete(token); - DesignTokenNode.cssCustomPropertyReflector.stopReflection(token, this.target); - } - } - /** - * Determines if a token is being reflected to CSS for a node. - * @param token - The token to check for reflection - * @returns - */ - }, { - key: "isReflecting", - value: function isReflecting(token) { - return this.reflecting.has(token); - } - /** - * Handle changes to upstream tokens - * @param source - The parent DesignTokenNode - * @param property - The token ID that changed - */ - }, { - key: "handleChange", - value: function handleChange(source, property) { - var token = DesignTokenImpl.getTokenById(property); - if (!token) { - return; - } - this.hydrate(token, this.getRaw(token)); - this.updateCSSTokenReflection(this.store, token); - } - /** - * Hydrates a token with a DesignTokenValue, making retrieval available. - * @param token - The token to hydrate - * @param value - The value to hydrate - */ - }, { - key: "hydrate", - value: function hydrate(token, value) { - if (!this.has(token)) { - var observer = this.bindingObservers.get(token); - if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { - if (observer) { - // If the binding source doesn't match, we need - // to update the binding - if (observer.source !== value) { - this.tearDownBindingObserver(token); - this.setupBindingObserver(token, value); - } - } else { - this.setupBindingObserver(token, value); - } - } else { - if (observer) { - this.tearDownBindingObserver(token); - } - this.store.set(token, value); - } - } - } - /** - * Sets up a binding observer for a derived token value that notifies token - * subscribers on change. - * - * @param token - The token to notify when the binding updates - * @param source - The binding source - */ - }, { - key: "setupBindingObserver", - value: function setupBindingObserver(token, source) { - var binding = new DesignTokenBindingObserver(source, token, this); - this.bindingObservers.set(token, binding); - return binding; - } - /** - * Tear down a binding observer for a token. - */ - }, { - key: "tearDownBindingObserver", - value: function tearDownBindingObserver(token) { - if (this.bindingObservers.has(token)) { - this.bindingObservers.get(token).disconnect(); - this.bindingObservers.delete(token); - return true; - } - return false; - } - }], [{ - key: "getOrCreate", - value: function getOrCreate(target) { - return nodeCache.get(target) || new DesignTokenNode(target); - } - /** - * Determines if a DesignTokenNode has been created for a target - * @param target - The element to test - */ - }, { - key: "existsFor", - value: function existsFor(target) { - return nodeCache.has(target); - } - /** - * Searches for and return the nearest parent DesignTokenNode. - * Null is returned if no node is found or the node provided is for a default element. - */ - }, { - key: "findParent", - value: function findParent(node) { - if (!(defaultElement === node.target)) { - var parent = composedParent(node.target); - while (parent !== null) { - if (nodeCache.has(parent)) { - return nodeCache.get(parent); - } - parent = composedParent(parent); - } - return DesignTokenNode.getOrCreate(defaultElement); - } - return null; - } - /** - * Finds the closest node with a value explicitly assigned for a token, otherwise null. - * @param token - The token to look for - * @param start - The node to start looking for value assignment - * @returns - */ - }, { - key: "findClosestAssignedNode", - value: function findClosestAssignedNode(token, start) { - var current = start; - do { - if (current.has(token)) { - return current; - } - current = current.parent ? current.parent : current.target !== defaultElement ? DesignTokenNode.getOrCreate(defaultElement) : null; - } while (current !== null); - return null; - } - }]); -}(); -/** - * Responsible for reflecting tokens to CSS custom properties - */ -DesignTokenNode.cssCustomPropertyReflector = new CustomPropertyReflector(); -__decorate([observable], DesignTokenNode.prototype, "children", void 0); -function create(nameOrConfig) { - return DesignTokenImpl.from(nameOrConfig); -} -/* eslint-enable @typescript-eslint/no-unused-vars */ -/** - * Factory object for creating {@link (DesignToken:interface)} instances. - * @public - */ -var DesignToken = Object.freeze({ - create: create, - /** - * Informs DesignToken that an HTMLElement for which tokens have - * been set has been connected to the document. - * - * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness - * in all scenarios, so invoking this method manually is necessary when: - * - * 1. Token values are set for an HTMLElement. - * 2. The HTMLElement does not inherit from FASTElement. - * 3. The HTMLElement is not connected to the document when token values are set. - * - * @param element - The element to notify - * @returns - true if notification was successful, otherwise false. - */ - notifyConnection: function notifyConnection(element) { - if (!element.isConnected || !DesignTokenNode.existsFor(element)) { - return false; - } - DesignTokenNode.getOrCreate(element).bind(); - return true; - }, - /** - * Informs DesignToken that an HTMLElement for which tokens have - * been set has been disconnected to the document. - * - * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness - * in all scenarios, so invoking this method manually is necessary when: - * - * 1. Token values are set for an HTMLElement. - * 2. The HTMLElement does not inherit from FASTElement. - * - * @param element - The element to notify - * @returns - true if notification was successful, otherwise false. - */ - notifyDisconnection: function notifyDisconnection(element) { - if (element.isConnected || !DesignTokenNode.existsFor(element)) { - return false; - } - DesignTokenNode.getOrCreate(element).unbind(); - return true; - }, - /** - * Registers and element or document as a DesignToken root. - * {@link CSSDesignToken | CSSDesignTokens} with default values assigned via - * {@link (DesignToken:interface).withDefault} will emit CSS custom properties to all - * registered roots. - * @param target - The root to register - */ - registerRoot: function registerRoot() { - var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultElement; - RootStyleSheetTarget.registerRoot(target); - }, - /** - * Unregister an element or document as a DesignToken root. - * @param target - The root to deregister - */ - unregisterRoot: function unregisterRoot() { - var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultElement; - RootStyleSheetTarget.unregisterRoot(target); - } -}); -/* eslint-enable @typescript-eslint/no-non-null-assertion */ -;// CONCATENATED MODULE: ../../node_modules/@vscode/webview-ui-toolkit/dist/utilities/theme/applyTheme.js -function applyTheme_slicedToArray(r, e) { return applyTheme_arrayWithHoles(r) || applyTheme_iterableToArrayLimit(r, e) || applyTheme_unsupportedIterableToArray(r, e) || applyTheme_nonIterableRest(); } -function applyTheme_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function applyTheme_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } -function applyTheme_arrayWithHoles(r) { if (Array.isArray(r)) return r; } -function applyTheme_createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = applyTheme_unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } -function applyTheme_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return applyTheme_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? applyTheme_arrayLikeToArray(r, a) : void 0; } } -function applyTheme_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -/** - * Configures a MutationObserver to watch for Visual Studio Code theme changes and - * applies the current Visual Studio Code theme to the toolkit components. - */ -function initThemeChangeListener(tokenMappings) { - window.addEventListener('load', function () { - var observer = new MutationObserver(function () { - applyCurrentTheme(tokenMappings); - }); - observer.observe(document.body, { - attributes: true, - attributeFilter: ['class'] - }); - applyCurrentTheme(tokenMappings); - }); -} -/** - * Applies the current Visual Studio Code theme to the toolkit components. - */ -function applyCurrentTheme(tokenMappings) { - // Get all the styles applied to the tag in the webview HTML - // Importantly this includes all the CSS variables associated with the - // current Visual Studio Code theme - var styles = getComputedStyle(document.body); - var body = document.querySelector('body'); - if (body) { - var themeKind = body.getAttribute('data-vscode-theme-kind'); - var _iterator = applyTheme_createForOfIteratorHelper(tokenMappings), - _step; - try { - for (_iterator.s(); !(_step = _iterator.n()).done;) { - var _step$value = applyTheme_slicedToArray(_step.value, 2), - vscodeTokenName = _step$value[0], - toolkitToken = _step$value[1]; - var value = styles.getPropertyValue(vscodeTokenName).toString(); - // Handle a couple of styling edge cases when a high contrast theme is applied - if (themeKind === 'vscode-high-contrast') { - // Developer note: - // - // There are a handful of VS Code theme tokens that have no value when a high - // contrast theme is applied. - // - // This is an issue because when no value is set the toolkit tokens will fall - // back to their default color values (aka the VS Code dark theme color palette). - // This results in the backgrounds of a couple of components having default dark - // theme colors––thus breaking the high contrast theme. - // - // The below code, catches these tokens which have no value and are also background - // tokens, then overrides their value to be transparent. - if (value.length === 0 && toolkitToken.name.includes('background')) { - value = 'transparent'; - } - // Set icon button hover to be transparent in high contrast themes - if (toolkitToken.name === 'button-icon-hover-background') { - value = 'transparent'; - } - } else if (themeKind === 'vscode-high-contrast-light') { - if (value.length === 0 && toolkitToken.name.includes('background')) { - // Set button variant hover backgrounds to correct values based on VS Code core source: - // https://github.com/microsoft/vscode/blob/fd0ee4f77e354de10ae591c9e97fe5ad41b398fc/src/vs/platform/theme/common/colorRegistry.ts#L270-L276 - switch (toolkitToken.name) { - case 'button-primary-hover-background': - value = '#0F4A85'; - break; - case 'button-secondary-hover-background': - value = 'transparent'; - break; - case 'button-icon-hover-background': - value = 'transparent'; - break; - } - } - } else { - // Set contrast-active-border token to be transparent in non-high-contrast themes - if (toolkitToken.name === 'contrast-active-border') { - value = 'transparent'; - } - } - toolkitToken.setValueFor(body, value); - } - } catch (err) { - _iterator.e(err); - } finally { - _iterator.f(); - } - } -} -;// CONCATENATED MODULE: ../../node_modules/@vscode/webview-ui-toolkit/dist/utilities/design-tokens/create.js -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - - -/** - * A mapping of all the Visual Studio Code theme CSS variables mapped to the - * toolkit design tokens. - */ -var tokenMappings = new Map(); -/** - * Boolean flag that ensures the VS Code theme listener is initialized once. - */ -var isThemeListenerInitialized = false; -/** - * Given a design token name, return a new FAST CSSDesignToken. - * - * @remarks A VS Code theme CSS variable can be optionally passed to be - * associated with the design token. - * - * @remarks On the first execution the VS Code theme listener will also be - * initialized. - * - * @param name A design token name. - * @param vscodeThemeVar A VS Code theme CSS variable name to be associated with - * the design token. - * @returns A FAST CSSDesignToken that emits a CSS custom property. - */ -function create_create(name, vscodeThemeVar) { - var designToken = DesignToken.create(name); - if (vscodeThemeVar) { - // If the fake vscode token is passed in, attach a unique ID to it so that it can - // be added to the tokenMappings map without overriding a previous fake token value - if (vscodeThemeVar.includes('--fake-vscode-token')) { - var uniqueId = 'id' + Math.random().toString(16).slice(2); - vscodeThemeVar = "".concat(vscodeThemeVar, "-").concat(uniqueId); - } - tokenMappings.set(vscodeThemeVar, designToken); - } - if (!isThemeListenerInitialized) { - initThemeChangeListener(tokenMappings); - isThemeListenerInitialized = true; - } - return designToken; -} -;// CONCATENATED MODULE: ../../node_modules/@vscode/webview-ui-toolkit/dist/design-tokens.js -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/** - * Developer note: - * - * There are some tokens defined in this file that make use of `--fake-vscode-token`. This is - * done when a toolkit token should be added to the tokenMappings map (and subsequently altered - * in the applyTheme function) but does not have a corresponding VS Code token that can be used. - * - * An example is buttonIconHoverBackground token which does not have a corresponding VS Code token - * at this time (it's a hardcoded value in VS Code), but needs to be adjusted to be transparent when a - * high contrast theme is applied. - * - * As a rule of thumb, if there are special cases where a token needs to be adjusted based on the - * VS Code theme and does not have a corresponding VS Code token, `--fake-vscode-token` can be used - * to indicate that it should be added to the tokenMappings map and thus make it accessible to the - * applyTheme function where it can be dynamically adjusted. - */ -/** - * Global design tokens. - */ -var background = create_create('background', '--vscode-editor-background').withDefault('#1e1e1e'); -var borderWidth = create_create('border-width').withDefault(1); -var contrastActiveBorder = create_create('contrast-active-border', '--vscode-contrastActiveBorder').withDefault('#f38518'); -var contrastBorder = create_create('contrast-border', '--vscode-contrastBorder').withDefault('#6fc3df'); -var cornerRadius = create_create('corner-radius').withDefault(0); -var cornerRadiusRound = create_create('corner-radius-round').withDefault(2); -var designUnit = create_create('design-unit').withDefault(4); -var disabledOpacity = create_create('disabled-opacity').withDefault(0.4); -var focusBorder = create_create('focus-border', '--vscode-focusBorder').withDefault('#007fd4'); -var fontFamily = create_create('font-family', '--vscode-font-family').withDefault('-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol'); -var fontWeight = create_create('font-weight', '--vscode-font-weight').withDefault('400'); -var foreground = create_create('foreground', '--vscode-foreground').withDefault('#cccccc'); -var inputHeight = create_create('input-height').withDefault('26'); -var inputMinWidth = create_create('input-min-width').withDefault('100px'); -var typeRampBaseFontSize = create_create('type-ramp-base-font-size', '--vscode-font-size').withDefault('13px'); -var typeRampBaseLineHeight = create_create('type-ramp-base-line-height').withDefault('normal'); -var typeRampMinus1FontSize = create_create('type-ramp-minus1-font-size').withDefault('11px'); -var typeRampMinus1LineHeight = create_create('type-ramp-minus1-line-height').withDefault('16px'); -var typeRampMinus2FontSize = create_create('type-ramp-minus2-font-size').withDefault('9px'); -var typeRampMinus2LineHeight = create_create('type-ramp-minus2-line-height').withDefault('16px'); -var typeRampPlus1FontSize = create_create('type-ramp-plus1-font-size').withDefault('16px'); -var typeRampPlus1LineHeight = create_create('type-ramp-plus1-line-height').withDefault('24px'); -var scrollbarWidth = create_create('scrollbarWidth').withDefault('10px'); -var scrollbarHeight = create_create('scrollbarHeight').withDefault('10px'); -var scrollbarSliderBackground = create_create('scrollbar-slider-background', '--vscode-scrollbarSlider-background').withDefault('#79797966'); -var scrollbarSliderHoverBackground = create_create('scrollbar-slider-hover-background', '--vscode-scrollbarSlider-hoverBackground').withDefault('#646464b3'); -var scrollbarSliderActiveBackground = create_create('scrollbar-slider-active-background', '--vscode-scrollbarSlider-activeBackground').withDefault('#bfbfbf66'); -/** - * Badge design tokens. - */ -var badgeBackground = create_create('badge-background', '--vscode-badge-background').withDefault('#4d4d4d'); -var badgeForeground = create_create('badge-foreground', '--vscode-badge-foreground').withDefault('#ffffff'); -/** - * Button design tokens. - */ -// Note: Button border is used only for high contrast themes and should be left as transparent otherwise. -var buttonBorder = create_create('button-border', '--vscode-button-border').withDefault('transparent'); -var buttonIconBackground = create_create('button-icon-background').withDefault('transparent'); -var buttonIconCornerRadius = create_create('button-icon-corner-radius').withDefault('5px'); -var buttonIconFocusBorderOffset = create_create('button-icon-outline-offset').withDefault(0); -// Note usage of `--fake-vscode-token` (refer to doc comment at top of file for explanation). -var buttonIconHoverBackground = create_create('button-icon-hover-background', '--fake-vscode-token').withDefault('rgba(90, 93, 94, 0.31)'); -var buttonIconPadding = create_create('button-icon-padding').withDefault('3px'); -var buttonPrimaryBackground = create_create('button-primary-background', '--vscode-button-background').withDefault('#0e639c'); -var buttonPrimaryForeground = create_create('button-primary-foreground', '--vscode-button-foreground').withDefault('#ffffff'); -var buttonPrimaryHoverBackground = create_create('button-primary-hover-background', '--vscode-button-hoverBackground').withDefault('#1177bb'); -var buttonSecondaryBackground = create_create('button-secondary-background', '--vscode-button-secondaryBackground').withDefault('#3a3d41'); -var buttonSecondaryForeground = create_create('button-secondary-foreground', '--vscode-button-secondaryForeground').withDefault('#ffffff'); -var buttonSecondaryHoverBackground = create_create('button-secondary-hover-background', '--vscode-button-secondaryHoverBackground').withDefault('#45494e'); -var buttonPaddingHorizontal = create_create('button-padding-horizontal').withDefault('11px'); -var buttonPaddingVertical = create_create('button-padding-vertical').withDefault('4px'); -/** - * Checkbox design tokens. - */ -var checkboxBackground = create_create('checkbox-background', '--vscode-checkbox-background').withDefault('#3c3c3c'); -var checkboxBorder = create_create('checkbox-border', '--vscode-checkbox-border').withDefault('#3c3c3c'); -var checkboxCornerRadius = create_create('checkbox-corner-radius').withDefault(3); -var checkboxForeground = create_create('checkbox-foreground', '--vscode-checkbox-foreground').withDefault('#f0f0f0'); -/** - * Data Grid design tokens - */ -var listActiveSelectionBackground = create_create('list-active-selection-background', '--vscode-list-activeSelectionBackground').withDefault('#094771'); -var listActiveSelectionForeground = create_create('list-active-selection-foreground', '--vscode-list-activeSelectionForeground').withDefault('#ffffff'); -var listHoverBackground = create_create('list-hover-background', '--vscode-list-hoverBackground').withDefault('#2a2d2e'); -/** - * Divider design tokens. - */ -var dividerBackground = create_create('divider-background', '--vscode-settings-dropdownListBorder').withDefault('#454545'); -/** - * Dropdown design tokens. - */ -var dropdownBackground = create_create('dropdown-background', '--vscode-dropdown-background').withDefault('#3c3c3c'); -var dropdownBorder = create_create('dropdown-border', '--vscode-dropdown-border').withDefault('#3c3c3c'); -var dropdownForeground = create_create('dropdown-foreground', '--vscode-dropdown-foreground').withDefault('#f0f0f0'); -var dropdownListMaxHeight = create_create('dropdown-list-max-height').withDefault('200px'); -/** - * Text Field & Area design tokens. - */ -var inputBackground = create_create('input-background', '--vscode-input-background').withDefault('#3c3c3c'); -var inputForeground = create_create('input-foreground', '--vscode-input-foreground').withDefault('#cccccc'); -var inputPlaceholderForeground = create_create('input-placeholder-foreground', '--vscode-input-placeholderForeground').withDefault('#cccccc'); -/** - * Link design tokens. - */ -var linkActiveForeground = create_create('link-active-foreground', '--vscode-textLink-activeForeground').withDefault('#3794ff'); -var linkForeground = create_create('link-foreground', '--vscode-textLink-foreground').withDefault('#3794ff'); -/** - * Progress ring design tokens. - */ -var progressBackground = create_create('progress-background', '--vscode-progressBar-background').withDefault('#0e70c0'); -/** - * Panels design tokens. - */ -var panelTabActiveBorder = create_create('panel-tab-active-border', '--vscode-panelTitle-activeBorder').withDefault('#e7e7e7'); -var panelTabActiveForeground = create_create('panel-tab-active-foreground', '--vscode-panelTitle-activeForeground').withDefault('#e7e7e7'); -var panelTabForeground = create_create('panel-tab-foreground', '--vscode-panelTitle-inactiveForeground').withDefault('#e7e7e799'); -var panelViewBackground = create_create('panel-view-background', '--vscode-panel-background').withDefault('#1e1e1e'); -var panelViewBorder = create_create('panel-view-border', '--vscode-panel-border').withDefault('#80808059'); -/** - * Tag design tokens. - */ -var tagCornerRadius = create_create('tag-corner-radius').withDefault('2px'); -;// CONCATENATED MODULE: ../../node_modules/@vscode/webview-ui-toolkit/dist/badge/badge.styles.js -var badge_styles_templateObject; -function badge_styles_taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); } -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - - - -var badgeStyles = function badgeStyles(context, definition) { - return css(badge_styles_templateObject || (badge_styles_templateObject = badge_styles_taggedTemplateLiteral(["\n\t", " :host {\n\t\tbox-sizing: border-box;\n\t\tfont-family: ", ";\n\t\tfont-size: ", ";\n\t\tline-height: ", ";\n\t\ttext-align: center;\n\t}\n\t.control {\n\t\talign-items: center;\n\t\tbackground-color: ", ";\n\t\tborder: calc(", " * 1px) solid ", ";\n\t\tborder-radius: 11px;\n\t\tbox-sizing: border-box;\n\t\tcolor: ", ";\n\t\tdisplay: flex;\n\t\theight: calc(", " * 4px);\n\t\tjustify-content: center;\n\t\tmin-width: calc(", " * 4px + 2px);\n\t\tmin-height: calc(", " * 4px + 2px);\n\t\tpadding: 3px 6px;\n\t}\n"])), display('inline-block'), fontFamily, typeRampMinus1FontSize, typeRampMinus1LineHeight, badgeBackground, borderWidth, buttonBorder, badgeForeground, designUnit, designUnit, designUnit); -}; -;// CONCATENATED MODULE: ../../node_modules/@vscode/webview-ui-toolkit/dist/badge/index.js -function dist_badge_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function dist_badge_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, dist_badge_toPropertyKey(o.key), o); } } -function dist_badge_createClass(e, r, t) { return r && dist_badge_defineProperties(e.prototype, r), t && dist_badge_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function dist_badge_toPropertyKey(t) { var i = dist_badge_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function dist_badge_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function dist_badge_callSuper(t, o, e) { return o = dist_badge_getPrototypeOf(o), dist_badge_possibleConstructorReturn(t, dist_badge_isNativeReflectConstruct() ? Reflect.construct(o, e || [], dist_badge_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function dist_badge_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return dist_badge_assertThisInitialized(t); } -function dist_badge_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function dist_badge_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (dist_badge_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function badge_get() { return badge_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = badge_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, badge_get.apply(null, arguments); } -function badge_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = dist_badge_getPrototypeOf(t));); return t; } -function dist_badge_getPrototypeOf(t) { return dist_badge_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, dist_badge_getPrototypeOf(t); } -function dist_badge_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && dist_badge_setPrototypeOf(t, e); } -function dist_badge_setPrototypeOf(t, e) { return dist_badge_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, dist_badge_setPrototypeOf(t, e); } -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - - -/** - * The Visual Studio Code badge class. - * - * @public - */ -var badge_Badge = /*#__PURE__*/function (_FoundationBadge) { - function Badge() { - dist_badge_classCallCheck(this, Badge); - return dist_badge_callSuper(this, Badge, arguments); - } - dist_badge_inherits(Badge, _FoundationBadge); - return dist_badge_createClass(Badge, [{ - key: "connectedCallback", - value: - /** - * Component lifecycle method that runs when the component is inserted - * into the DOM. - * - * @internal - */ - function connectedCallback() { - badge_get(dist_badge_getPrototypeOf(Badge.prototype), "connectedCallback", this).call(this); - // This will override any usage of the circular attribute - // inherited by the FAST Foundation Badge component so - // that VSCode Badges are always circular - if (!this.circular) { - this.circular = true; - } - } - }]); -}(Badge); -/** - * The Visual Studio Code badge component registration. - * - * @remarks - * HTML Element: `` - * - * @public - */ -var vsCodeBadge = badge_Badge.compose({ - baseName: 'badge', - template: badgeTemplate, - styles: badgeStyles -}); -// EXTERNAL MODULE: ../../node_modules/tslib/tslib.es6.mjs -var tslib_es6 = __webpack_require__("../../node_modules/tslib/tslib.es6.mjs"); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js -function aria_global_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, aria_global_toPropertyKey(o.key), o); } } -function aria_global_createClass(e, r, t) { return r && aria_global_defineProperties(e.prototype, r), t && aria_global_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function aria_global_toPropertyKey(t) { var i = aria_global_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function aria_global_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function aria_global_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } - - -/** - * Some states and properties are applicable to all host language elements regardless of whether a role is applied. - * The following global states and properties are supported by all roles and by all base markup elements. - * {@link https://www.w3.org/TR/wai-aria-1.1/#global_states} - * - * This is intended to be used as a mixin. Be sure you extend FASTElement. - * - * @public - */ -var ARIAGlobalStatesAndProperties = /*#__PURE__*/aria_global_createClass(function ARIAGlobalStatesAndProperties() { - aria_global_classCallCheck(this, ARIAGlobalStatesAndProperties); -}); -__decorate([attr({ - attribute: "aria-atomic" -})], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", void 0); -__decorate([attr({ - attribute: "aria-busy" -})], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", void 0); -__decorate([attr({ - attribute: "aria-controls" -})], ARIAGlobalStatesAndProperties.prototype, "ariaControls", void 0); -__decorate([attr({ - attribute: "aria-current" -})], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", void 0); -__decorate([attr({ - attribute: "aria-describedby" -})], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", void 0); -__decorate([attr({ - attribute: "aria-details" -})], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", void 0); -__decorate([attr({ - attribute: "aria-disabled" -})], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", void 0); -__decorate([attr({ - attribute: "aria-errormessage" -})], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", void 0); -__decorate([attr({ - attribute: "aria-flowto" -})], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", void 0); -__decorate([attr({ - attribute: "aria-haspopup" -})], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", void 0); -__decorate([attr({ - attribute: "aria-hidden" -})], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", void 0); -__decorate([attr({ - attribute: "aria-invalid" -})], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", void 0); -__decorate([attr({ - attribute: "aria-keyshortcuts" -})], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", void 0); -__decorate([attr({ - attribute: "aria-label" -})], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", void 0); -__decorate([attr({ - attribute: "aria-labelledby" -})], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", void 0); -__decorate([attr({ - attribute: "aria-live" -})], ARIAGlobalStatesAndProperties.prototype, "ariaLive", void 0); -__decorate([attr({ - attribute: "aria-owns" -})], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", void 0); -__decorate([attr({ - attribute: "aria-relevant" -})], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", void 0); -__decorate([attr({ - attribute: "aria-roledescription" -})], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-element/dist/esm/templating/ref.js -function ref_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function ref_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, ref_toPropertyKey(o.key), o); } } -function ref_createClass(e, r, t) { return r && ref_defineProperties(e.prototype, r), t && ref_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function ref_toPropertyKey(t) { var i = ref_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function ref_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } - -/** - * The runtime behavior for template references. - * @public - */ -var RefBehavior = /*#__PURE__*/function () { - /** - * Creates an instance of RefBehavior. - * @param target - The element to reference. - * @param propertyName - The name of the property to assign the reference to. - */ - function RefBehavior(target, propertyName) { - ref_classCallCheck(this, RefBehavior); - this.target = target; - this.propertyName = propertyName; - } - /** - * Bind this behavior to the source. - * @param source - The source to bind to. - * @param context - The execution context that the binding is operating within. - */ - return ref_createClass(RefBehavior, [{ - key: "bind", - value: function bind(source) { - source[this.propertyName] = this.target; - } - /** - * Unbinds this behavior from the source. - * @param source - The source to unbind from. - */ - /* eslint-disable-next-line @typescript-eslint/no-empty-function */ - }, { - key: "unbind", - value: function unbind() {} - }]); -}(); -/** - * A directive that observes the updates a property with a reference to the element. - * @param propertyName - The name of the property to assign the reference to. - * @public - */ -function ref(propertyName) { - return new AttachedBehaviorHTMLDirective("fast-ref", RefBehavior, propertyName); -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js -var start_end_templateObject, _templateObject2, _templateObject3, _templateObject4; -function start_end_taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); } -function start_end_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function start_end_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, start_end_toPropertyKey(o.key), o); } } -function start_end_createClass(e, r, t) { return r && start_end_defineProperties(e.prototype, r), t && start_end_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function start_end_toPropertyKey(t) { var i = start_end_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function start_end_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } - -/** - * A mixin class implementing start and end elements. - * These are generally used to decorate text elements with icons or other visual indicators. - * @public - */ -var StartEnd = /*#__PURE__*/function () { - function StartEnd() { - start_end_classCallCheck(this, StartEnd); - } - return start_end_createClass(StartEnd, [{ - key: "handleStartContentChange", - value: function handleStartContentChange() { - this.startContainer.classList.toggle("start", this.start.assignedNodes().length > 0); - } - }, { - key: "handleEndContentChange", - value: function handleEndContentChange() { - this.endContainer.classList.toggle("end", this.end.assignedNodes().length > 0); - } - }]); -}(); -/** - * The template for the end element. - * For use with {@link StartEnd} - * - * @public - */ -var endSlotTemplate = function endSlotTemplate(context, definition) { - return html(start_end_templateObject || (start_end_templateObject = start_end_taggedTemplateLiteral(["\n \n \n ", "\n \n \n"])), ref("endContainer"), function (x) { - return definition.end ? "end" : void 0; - }, ref("end"), function (x) { - return x.handleEndContentChange(); - }, definition.end || ""); -}; -/** - * The template for the start element. - * For use with {@link StartEnd} - * - * @public - */ -var startSlotTemplate = function startSlotTemplate(context, definition) { - return html(_templateObject2 || (_templateObject2 = start_end_taggedTemplateLiteral(["\n \n \n ", "\n \n \n"])), ref("startContainer"), function (x) { - return definition.start ? "start" : void 0; - }, ref("start"), function (x) { - return x.handleStartContentChange(); - }, definition.start || ""); -}; -/** - * The template for the end element. - * For use with {@link StartEnd} - * - * @public - * @deprecated - use endSlotTemplate - */ -var endTemplate = html(_templateObject3 || (_templateObject3 = start_end_taggedTemplateLiteral(["\n \n \n \n"])), ref("endContainer"), ref("end"), function (x) { - return x.handleEndContentChange(); -}); -/** - * The template for the start element. - * For use with {@link StartEnd} - * - * @public - * @deprecated - use startSlotTemplate - */ -var startTemplate = html(_templateObject4 || (_templateObject4 = start_end_taggedTemplateLiteral(["\n \n \n \n"])), ref("startContainer"), ref("start"), function (x) { - return x.handleStartContentChange(); -}); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js - -/** - * Apply mixins to a constructor. - * Sourced from {@link https://www.typescriptlang.org/docs/handbook/mixins.html | TypeScript Documentation }. - * @public - */ -function applyMixins(derivedCtor) { - var derivedAttributes = AttributeConfiguration.locate(derivedCtor); - for (var _len = arguments.length, baseCtors = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - baseCtors[_key - 1] = arguments[_key]; - } - baseCtors.forEach(function (baseCtor) { - Object.getOwnPropertyNames(baseCtor.prototype).forEach(function (name) { - if (name !== "constructor") { - Object.defineProperty(derivedCtor.prototype, name, /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ - Object.getOwnPropertyDescriptor(baseCtor.prototype, name)); - } - }); - var baseAttributes = AttributeConfiguration.locate(baseCtor); - baseAttributes.forEach(function (x) { - return derivedAttributes.push(x); - }); - }); -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-web-utilities/dist/key-codes.js -/** - * Key Code values - * @deprecated - KeyCodes are deprecated, use individual string key exports - */ -var KeyCodes; -(function (KeyCodes) { - KeyCodes[KeyCodes["alt"] = 18] = "alt"; - KeyCodes[KeyCodes["arrowDown"] = 40] = "arrowDown"; - KeyCodes[KeyCodes["arrowLeft"] = 37] = "arrowLeft"; - KeyCodes[KeyCodes["arrowRight"] = 39] = "arrowRight"; - KeyCodes[KeyCodes["arrowUp"] = 38] = "arrowUp"; - KeyCodes[KeyCodes["back"] = 8] = "back"; - KeyCodes[KeyCodes["backSlash"] = 220] = "backSlash"; - KeyCodes[KeyCodes["break"] = 19] = "break"; - KeyCodes[KeyCodes["capsLock"] = 20] = "capsLock"; - KeyCodes[KeyCodes["closeBracket"] = 221] = "closeBracket"; - KeyCodes[KeyCodes["colon"] = 186] = "colon"; - KeyCodes[KeyCodes["colon2"] = 59] = "colon2"; - KeyCodes[KeyCodes["comma"] = 188] = "comma"; - KeyCodes[KeyCodes["ctrl"] = 17] = "ctrl"; - KeyCodes[KeyCodes["delete"] = 46] = "delete"; - KeyCodes[KeyCodes["end"] = 35] = "end"; - KeyCodes[KeyCodes["enter"] = 13] = "enter"; - KeyCodes[KeyCodes["equals"] = 187] = "equals"; - KeyCodes[KeyCodes["equals2"] = 61] = "equals2"; - KeyCodes[KeyCodes["equals3"] = 107] = "equals3"; - KeyCodes[KeyCodes["escape"] = 27] = "escape"; - KeyCodes[KeyCodes["forwardSlash"] = 191] = "forwardSlash"; - KeyCodes[KeyCodes["function1"] = 112] = "function1"; - KeyCodes[KeyCodes["function10"] = 121] = "function10"; - KeyCodes[KeyCodes["function11"] = 122] = "function11"; - KeyCodes[KeyCodes["function12"] = 123] = "function12"; - KeyCodes[KeyCodes["function2"] = 113] = "function2"; - KeyCodes[KeyCodes["function3"] = 114] = "function3"; - KeyCodes[KeyCodes["function4"] = 115] = "function4"; - KeyCodes[KeyCodes["function5"] = 116] = "function5"; - KeyCodes[KeyCodes["function6"] = 117] = "function6"; - KeyCodes[KeyCodes["function7"] = 118] = "function7"; - KeyCodes[KeyCodes["function8"] = 119] = "function8"; - KeyCodes[KeyCodes["function9"] = 120] = "function9"; - KeyCodes[KeyCodes["home"] = 36] = "home"; - KeyCodes[KeyCodes["insert"] = 45] = "insert"; - KeyCodes[KeyCodes["menu"] = 93] = "menu"; - KeyCodes[KeyCodes["minus"] = 189] = "minus"; - KeyCodes[KeyCodes["minus2"] = 109] = "minus2"; - KeyCodes[KeyCodes["numLock"] = 144] = "numLock"; - KeyCodes[KeyCodes["numPad0"] = 96] = "numPad0"; - KeyCodes[KeyCodes["numPad1"] = 97] = "numPad1"; - KeyCodes[KeyCodes["numPad2"] = 98] = "numPad2"; - KeyCodes[KeyCodes["numPad3"] = 99] = "numPad3"; - KeyCodes[KeyCodes["numPad4"] = 100] = "numPad4"; - KeyCodes[KeyCodes["numPad5"] = 101] = "numPad5"; - KeyCodes[KeyCodes["numPad6"] = 102] = "numPad6"; - KeyCodes[KeyCodes["numPad7"] = 103] = "numPad7"; - KeyCodes[KeyCodes["numPad8"] = 104] = "numPad8"; - KeyCodes[KeyCodes["numPad9"] = 105] = "numPad9"; - KeyCodes[KeyCodes["numPadDivide"] = 111] = "numPadDivide"; - KeyCodes[KeyCodes["numPadDot"] = 110] = "numPadDot"; - KeyCodes[KeyCodes["numPadMinus"] = 109] = "numPadMinus"; - KeyCodes[KeyCodes["numPadMultiply"] = 106] = "numPadMultiply"; - KeyCodes[KeyCodes["numPadPlus"] = 107] = "numPadPlus"; - KeyCodes[KeyCodes["openBracket"] = 219] = "openBracket"; - KeyCodes[KeyCodes["pageDown"] = 34] = "pageDown"; - KeyCodes[KeyCodes["pageUp"] = 33] = "pageUp"; - KeyCodes[KeyCodes["period"] = 190] = "period"; - KeyCodes[KeyCodes["print"] = 44] = "print"; - KeyCodes[KeyCodes["quote"] = 222] = "quote"; - KeyCodes[KeyCodes["scrollLock"] = 145] = "scrollLock"; - KeyCodes[KeyCodes["shift"] = 16] = "shift"; - KeyCodes[KeyCodes["space"] = 32] = "space"; - KeyCodes[KeyCodes["tab"] = 9] = "tab"; - KeyCodes[KeyCodes["tilde"] = 192] = "tilde"; - KeyCodes[KeyCodes["windowsLeft"] = 91] = "windowsLeft"; - KeyCodes[KeyCodes["windowsOpera"] = 219] = "windowsOpera"; - KeyCodes[KeyCodes["windowsRight"] = 92] = "windowsRight"; -})(KeyCodes || (KeyCodes = {})); -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeAlt = 18; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeArrowDown = 40; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeArrowLeft = 37; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeArrowRight = 39; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeArrowUp = 38; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeBack = 8; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeBackSlash = 220; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeBreak = 19; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeCapsLock = 20; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeCloseBracket = 221; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeColon = 186; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeColon2 = 59; // Opera and Firefox -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeComma = 188; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeCtrl = 17; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeDelete = 46; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeEnd = 35; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeEnter = 13; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeEquals = 187; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeEquals2 = 61; // Opera -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeEquals3 = 107; // Firefox -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeEscape = 27; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeForwardSlash = 191; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeFunction1 = 112; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeFunction10 = 121; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeFunction11 = 122; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeFunction12 = 123; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeFunction2 = 113; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeFunction3 = 114; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeFunction4 = 115; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeFunction5 = 116; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeFunction6 = 117; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeFunction7 = 118; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeFunction8 = 119; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeFunction9 = 120; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeHome = 36; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeInsert = 45; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeMenu = 93; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeMinus = 189; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeMinus2 = 109; // Opera and Firefox -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumLock = 144; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPad0 = 96; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPad1 = 97; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPad2 = 98; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPad3 = 99; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPad4 = 100; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPad5 = 101; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPad6 = 102; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPad7 = 103; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPad8 = 104; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPad9 = 105; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPadDivide = 111; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPadDot = 110; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPadMinus = 109; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPadMultiply = 106; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeNumPadPlus = 107; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeOpenBracket = 219; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodePageDown = 34; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodePageUp = 33; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodePeriod = 190; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodePrint = 44; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeQuote = 222; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeScrollLock = 145; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeShift = 16; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeSpace = 32; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeTab = 9; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeTilde = 192; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeWindowsLeft = 91; -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeWindowsOpera = 219; // Opera -/** - * @deprecated - KeyCodes are deprecated, use string key exports - */ -var keyCodeWindowsRight = 92; -/** - * String values for use with KeyboardEvent.key - */ -var keyArrowDown = "ArrowDown"; -var keyArrowLeft = "ArrowLeft"; -var keyArrowRight = "ArrowRight"; -var keyArrowUp = "ArrowUp"; -var keyEnter = "Enter"; -var keyEscape = "Escape"; -var keyHome = "Home"; -var keyEnd = "End"; -var keyFunction2 = "F2"; -var keyPageDown = "PageDown"; -var keyPageUp = "PageUp"; -var keySpace = " "; -var keyTab = "Tab"; -var keyBackspace = "Backspace"; -var keyDelete = "Delete"; -var ArrowKeys = { - ArrowDown: keyArrowDown, - ArrowLeft: keyArrowLeft, - ArrowRight: keyArrowRight, - ArrowUp: keyArrowUp -}; -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js -function form_associated_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function form_associated_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, form_associated_toPropertyKey(o.key), o); } } -function form_associated_createClass(e, r, t) { return r && form_associated_defineProperties(e.prototype, r), t && form_associated_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function form_associated_toPropertyKey(t) { var i = form_associated_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function form_associated_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function form_associated_callSuper(t, o, e) { return o = form_associated_getPrototypeOf(o), form_associated_possibleConstructorReturn(t, form_associated_isNativeReflectConstruct() ? Reflect.construct(o, e || [], form_associated_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function form_associated_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return form_associated_assertThisInitialized(t); } -function form_associated_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function form_associated_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (form_associated_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function form_associated_get() { return form_associated_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = form_associated_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, form_associated_get.apply(null, arguments); } -function form_associated_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = form_associated_getPrototypeOf(t));); return t; } -function form_associated_getPrototypeOf(t) { return form_associated_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, form_associated_getPrototypeOf(t); } -function form_associated_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && form_associated_setPrototypeOf(t, e); } -function form_associated_setPrototypeOf(t, e) { return form_associated_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, form_associated_setPrototypeOf(t, e); } - - -var proxySlotName = "form-associated-proxy"; -var ElementInternalsKey = "ElementInternals"; -/** - * @alpha - */ -var supportsElementInternals = ElementInternalsKey in window && "setFormValue" in window[ElementInternalsKey].prototype; -var InternalsMap = new WeakMap(); -/** - * Base function for providing Custom Element Form Association. - * - * @alpha - */ -function FormAssociated(BaseCtor) { - var C = /*#__PURE__*/function (_BaseCtor) { - function C() { - var _this; - form_associated_classCallCheck(this, C); - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - _this = form_associated_callSuper(this, C, [].concat(args)); - /** - * Track whether the value has been changed from the initial value - */ - _this.dirtyValue = false; - /** - * Sets the element's disabled state. A disabled element will not be included during form submission. - * - * @remarks - * HTML Attribute: disabled - */ - _this.disabled = false; - /** - * These are events that are still fired by the proxy - * element based on user / programmatic interaction. - * - * The proxy implementation should be transparent to - * the app author, so block these events from emitting. - */ - _this.proxyEventsToBlock = ["change", "click"]; - _this.proxyInitialized = false; - _this.required = false; - _this.initialValue = _this.initialValue || ""; - if (!_this.elementInternals) { - // When elementInternals is not supported, formResetCallback is - // bound to an event listener, so ensure the handler's `this` - // context is correct. - _this.formResetCallback = _this.formResetCallback.bind(_this); - } - return _this; - } - /** - * Must evaluate to true to enable elementInternals. - * Feature detects API support and resolve respectively - * - * @internal - */ - form_associated_inherits(C, _BaseCtor); - return form_associated_createClass(C, [{ - key: "validity", - get: - /** - * Returns the validity state of the element - * - * @alpha - */ - function get() { - return this.elementInternals ? this.elementInternals.validity : this.proxy.validity; - } - /** - * Retrieve a reference to the associated form. - * Returns null if not associated to any form. - * - * @alpha - */ - }, { - key: "form", - get: function get() { - return this.elementInternals ? this.elementInternals.form : this.proxy.form; - } - /** - * Retrieve the localized validation message, - * or custom validation message if set. - * - * @alpha - */ - }, { - key: "validationMessage", - get: function get() { - return this.elementInternals ? this.elementInternals.validationMessage : this.proxy.validationMessage; - } - /** - * Whether the element will be validated when the - * form is submitted - */ - }, { - key: "willValidate", - get: function get() { - return this.elementInternals ? this.elementInternals.willValidate : this.proxy.willValidate; - } - /** - * A reference to all associated label elements - */ - }, { - key: "labels", - get: function get() { - if (this.elementInternals) { - return Object.freeze(Array.from(this.elementInternals.labels)); - } else if (this.proxy instanceof HTMLElement && this.proxy.ownerDocument && this.id) { - // Labels associated by wrapping the element: - var parentLabels = this.proxy.labels; - // Labels associated using the `for` attribute - var forLabels = Array.from(this.proxy.getRootNode().querySelectorAll("[for='".concat(this.id, "']"))); - var labels = parentLabels ? forLabels.concat(Array.from(parentLabels)) : forLabels; - return Object.freeze(labels); - } else { - return emptyArray; - } - } - /** - * Invoked when the `value` property changes - * @param previous - the previous value - * @param next - the new value - * - * @remarks - * If elements extending `FormAssociated` implement a `valueChanged` method - * They must be sure to invoke `super.valueChanged(previous, next)` to ensure - * proper functioning of `FormAssociated` - */ - }, { - key: "valueChanged", - value: function valueChanged(previous, next) { - this.dirtyValue = true; - if (this.proxy instanceof HTMLElement) { - this.proxy.value = this.value; - } - this.currentValue = this.value; - this.setFormValue(this.value); - this.validate(); - } - }, { - key: "currentValueChanged", - value: function currentValueChanged() { - this.value = this.currentValue; - } - /** - * Invoked when the `initialValue` property changes - * - * @param previous - the previous value - * @param next - the new value - * - * @remarks - * If elements extending `FormAssociated` implement a `initialValueChanged` method - * They must be sure to invoke `super.initialValueChanged(previous, next)` to ensure - * proper functioning of `FormAssociated` - */ - }, { - key: "initialValueChanged", - value: function initialValueChanged(previous, next) { - // If the value is clean and the component is connected to the DOM - // then set value equal to the attribute value. - if (!this.dirtyValue) { - this.value = this.initialValue; - this.dirtyValue = false; - } - } - /** - * Invoked when the `disabled` property changes - * - * @param previous - the previous value - * @param next - the new value - * - * @remarks - * If elements extending `FormAssociated` implement a `disabledChanged` method - * They must be sure to invoke `super.disabledChanged(previous, next)` to ensure - * proper functioning of `FormAssociated` - */ - }, { - key: "disabledChanged", - value: function disabledChanged(previous, next) { - var _this2 = this; - if (this.proxy instanceof HTMLElement) { - this.proxy.disabled = this.disabled; - } - DOM.queueUpdate(function () { - return _this2.classList.toggle("disabled", _this2.disabled); - }); - } - /** - * Invoked when the `name` property changes - * - * @param previous - the previous value - * @param next - the new value - * - * @remarks - * If elements extending `FormAssociated` implement a `nameChanged` method - * They must be sure to invoke `super.nameChanged(previous, next)` to ensure - * proper functioning of `FormAssociated` - */ - }, { - key: "nameChanged", - value: function nameChanged(previous, next) { - if (this.proxy instanceof HTMLElement) { - this.proxy.name = this.name; - } - } - /** - * Invoked when the `required` property changes - * - * @param previous - the previous value - * @param next - the new value - * - * @remarks - * If elements extending `FormAssociated` implement a `requiredChanged` method - * They must be sure to invoke `super.requiredChanged(previous, next)` to ensure - * proper functioning of `FormAssociated` - */ - }, { - key: "requiredChanged", - value: function requiredChanged(prev, next) { - var _this3 = this; - if (this.proxy instanceof HTMLElement) { - this.proxy.required = this.required; - } - DOM.queueUpdate(function () { - return _this3.classList.toggle("required", _this3.required); - }); - this.validate(); - } - /** - * The element internals object. Will only exist - * in browsers supporting the attachInternals API - */ - }, { - key: "elementInternals", - get: function get() { - if (!supportsElementInternals) { - return null; - } - var internals = InternalsMap.get(this); - if (!internals) { - internals = this.attachInternals(); - InternalsMap.set(this, internals); - } - return internals; - } - /** - * @internal - */ - }, { - key: "connectedCallback", - value: function connectedCallback() { - form_associated_get(form_associated_getPrototypeOf(C.prototype), "connectedCallback", this).call(this); - this.addEventListener("keypress", this._keypressHandler); - if (!this.value) { - this.value = this.initialValue; - this.dirtyValue = false; - } - if (!this.elementInternals) { - this.attachProxy(); - if (this.form) { - this.form.addEventListener("reset", this.formResetCallback); - } - } - } - /** - * @internal - */ - }, { - key: "disconnectedCallback", - value: function disconnectedCallback() { - var _this4 = this; - form_associated_get(form_associated_getPrototypeOf(C.prototype), "disconnectedCallback", this).call(this); - this.proxyEventsToBlock.forEach(function (name) { - return _this4.proxy.removeEventListener(name, _this4.stopPropagation); - }); - if (!this.elementInternals && this.form) { - this.form.removeEventListener("reset", this.formResetCallback); - } - } - /** - * Return the current validity of the element. - */ - }, { - key: "checkValidity", - value: function checkValidity() { - return this.elementInternals ? this.elementInternals.checkValidity() : this.proxy.checkValidity(); - } - /** - * Return the current validity of the element. - * If false, fires an invalid event at the element. - */ - }, { - key: "reportValidity", - value: function reportValidity() { - return this.elementInternals ? this.elementInternals.reportValidity() : this.proxy.reportValidity(); - } - /** - * Set the validity of the control. In cases when the elementInternals object is not - * available (and the proxy element is used to report validity), this function will - * do nothing unless a message is provided, at which point the setCustomValidity method - * of the proxy element will be invoked with the provided message. - * @param flags - Validity flags - * @param message - Optional message to supply - * @param anchor - Optional element used by UA to display an interactive validation UI - */ - }, { - key: "setValidity", - value: function setValidity(flags, message, anchor) { - if (this.elementInternals) { - this.elementInternals.setValidity(flags, message, anchor); - } else if (typeof message === "string") { - this.proxy.setCustomValidity(message); - } - } - /** - * Invoked when a connected component's form or fieldset has its disabled - * state changed. - * @param disabled - the disabled value of the form / fieldset - */ - }, { - key: "formDisabledCallback", - value: function formDisabledCallback(disabled) { - this.disabled = disabled; - } - }, { - key: "formResetCallback", - value: function formResetCallback() { - this.value = this.initialValue; - this.dirtyValue = false; - } - /** - * Attach the proxy element to the DOM - */ - }, { - key: "attachProxy", - value: function attachProxy() { - var _this5 = this; - var _a; - if (!this.proxyInitialized) { - this.proxyInitialized = true; - this.proxy.style.display = "none"; - this.proxyEventsToBlock.forEach(function (name) { - return _this5.proxy.addEventListener(name, _this5.stopPropagation); - }); - // These are typically mapped to the proxy during - // property change callbacks, but during initialization - // on the initial call of the callback, the proxy is - // still undefined. We should find a better way to address this. - this.proxy.disabled = this.disabled; - this.proxy.required = this.required; - if (typeof this.name === "string") { - this.proxy.name = this.name; - } - if (typeof this.value === "string") { - this.proxy.value = this.value; - } - this.proxy.setAttribute("slot", proxySlotName); - this.proxySlot = document.createElement("slot"); - this.proxySlot.setAttribute("name", proxySlotName); - } - (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(this.proxySlot); - this.appendChild(this.proxy); - } - /** - * Detach the proxy element from the DOM - */ - }, { - key: "detachProxy", - value: function detachProxy() { - var _a; - this.removeChild(this.proxy); - (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(this.proxySlot); - } - /** {@inheritDoc (FormAssociated:interface).validate} */ - }, { - key: "validate", - value: function validate(anchor) { - if (this.proxy instanceof HTMLElement) { - this.setValidity(this.proxy.validity, this.proxy.validationMessage, anchor); - } - } - /** - * Associates the provided value (and optional state) with the parent form. - * @param value - The value to set - * @param state - The state object provided to during session restores and when autofilling. - */ - }, { - key: "setFormValue", - value: function setFormValue(value, state) { - if (this.elementInternals) { - this.elementInternals.setFormValue(value, state || value); - } - } - }, { - key: "_keypressHandler", - value: function _keypressHandler(e) { - switch (e.key) { - case keyEnter: - if (this.form instanceof HTMLFormElement) { - // Implicit submission - var defaultButton = this.form.querySelector("[type=submit]"); - defaultButton === null || defaultButton === void 0 ? void 0 : defaultButton.click(); - } - break; - } - } - /** - * Used to stop propagation of proxy element events - * @param e - Event object - */ - }, { - key: "stopPropagation", - value: function stopPropagation(e) { - e.stopPropagation(); - } - }], [{ - key: "formAssociated", - get: function get() { - return supportsElementInternals; - } - }]); - }(BaseCtor); - attr({ - mode: "boolean" - })(C.prototype, "disabled"); - attr({ - mode: "fromView", - attribute: "value" - })(C.prototype, "initialValue"); - attr({ - attribute: "current-value" - })(C.prototype, "currentValue"); - attr(C.prototype, "name"); - attr({ - mode: "boolean" - })(C.prototype, "required"); - observable(C.prototype, "value"); - return C; -} -/** - * @alpha - */ -function CheckableFormAssociated(BaseCtor) { - var C = /*#__PURE__*/function (_FormAssociated) { - function C() { - form_associated_classCallCheck(this, C); - return form_associated_callSuper(this, C, arguments); - } - form_associated_inherits(C, _FormAssociated); - return form_associated_createClass(C); - }(FormAssociated(BaseCtor)); - var D = /*#__PURE__*/function (_C) { - function D() { - var _this6; - form_associated_classCallCheck(this, D); - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - _this6 = form_associated_callSuper(this, D, [args]); - /** - * Tracks whether the "checked" property has been changed. - * This is necessary to provide consistent behavior with - * normal input checkboxes - */ - _this6.dirtyChecked = false; - /** - * Provides the default checkedness of the input element - * Passed down to proxy - * - * @public - * @remarks - * HTML Attribute: checked - */ - _this6.checkedAttribute = false; - /** - * The checked state of the control. - * - * @public - */ - _this6.checked = false; - // Re-initialize dirtyChecked because initialization of other values - // causes it to become true - _this6.dirtyChecked = false; - return _this6; - } - form_associated_inherits(D, _C); - return form_associated_createClass(D, [{ - key: "checkedAttributeChanged", - value: function checkedAttributeChanged() { - this.defaultChecked = this.checkedAttribute; - } - /** - * @internal - */ - }, { - key: "defaultCheckedChanged", - value: function defaultCheckedChanged() { - if (!this.dirtyChecked) { - // Setting this.checked will cause us to enter a dirty state, - // but if we are clean when defaultChecked is changed, we want to stay - // in a clean state, so reset this.dirtyChecked - this.checked = this.defaultChecked; - this.dirtyChecked = false; - } - } - }, { - key: "checkedChanged", - value: function checkedChanged(prev, next) { - if (!this.dirtyChecked) { - this.dirtyChecked = true; - } - this.currentChecked = this.checked; - this.updateForm(); - if (this.proxy instanceof HTMLInputElement) { - this.proxy.checked = this.checked; - } - if (prev !== undefined) { - this.$emit("change"); - } - this.validate(); - } - }, { - key: "currentCheckedChanged", - value: function currentCheckedChanged(prev, next) { - this.checked = this.currentChecked; - } - }, { - key: "updateForm", - value: function updateForm() { - var value = this.checked ? this.value : null; - this.setFormValue(value, value); - } - }, { - key: "connectedCallback", - value: function connectedCallback() { - form_associated_get(form_associated_getPrototypeOf(D.prototype), "connectedCallback", this).call(this); - this.updateForm(); - } - }, { - key: "formResetCallback", - value: function formResetCallback() { - form_associated_get(form_associated_getPrototypeOf(D.prototype), "formResetCallback", this).call(this); - this.checked = !!this.checkedAttribute; - this.dirtyChecked = false; - } - }]); - }(C); - attr({ - attribute: "checked", - mode: "boolean" - })(D.prototype, "checkedAttribute"); - attr({ - attribute: "current-checked", - converter: booleanConverter - })(D.prototype, "currentChecked"); - observable(D.prototype, "defaultChecked"); - observable(D.prototype, "checked"); - return D; -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js -function button_form_associated_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, button_form_associated_toPropertyKey(o.key), o); } } -function button_form_associated_createClass(e, r, t) { return r && button_form_associated_defineProperties(e.prototype, r), t && button_form_associated_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function button_form_associated_toPropertyKey(t) { var i = button_form_associated_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function button_form_associated_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function button_form_associated_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function button_form_associated_callSuper(t, o, e) { return o = button_form_associated_getPrototypeOf(o), button_form_associated_possibleConstructorReturn(t, button_form_associated_isNativeReflectConstruct() ? Reflect.construct(o, e || [], button_form_associated_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function button_form_associated_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return button_form_associated_assertThisInitialized(t); } -function button_form_associated_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function button_form_associated_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (button_form_associated_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function button_form_associated_getPrototypeOf(t) { return button_form_associated_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, button_form_associated_getPrototypeOf(t); } -function button_form_associated_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && button_form_associated_setPrototypeOf(t, e); } -function button_form_associated_setPrototypeOf(t, e) { return button_form_associated_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, button_form_associated_setPrototypeOf(t, e); } - - -var _Button = /*#__PURE__*/function (_FoundationElement) { - function _Button() { - button_form_associated_classCallCheck(this, _Button); - return button_form_associated_callSuper(this, _Button, arguments); - } - button_form_associated_inherits(_Button, _FoundationElement); - return button_form_associated_createClass(_Button); -}(FoundationElement); -/** - * A form-associated base class for the {@link @microsoft/fast-foundation#(Button:class)} component. - * - * @internal - */ -var FormAssociatedButton = /*#__PURE__*/function (_FormAssociated) { - function FormAssociatedButton() { - var _this; - button_form_associated_classCallCheck(this, FormAssociatedButton); - _this = button_form_associated_callSuper(this, FormAssociatedButton, arguments); - _this.proxy = document.createElement("input"); - return _this; - } - button_form_associated_inherits(FormAssociatedButton, _FormAssociated); - return button_form_associated_createClass(FormAssociatedButton); -}(FormAssociated(_Button)); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/button/button.js -function button_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function button_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, button_toPropertyKey(o.key), o); } } -function button_createClass(e, r, t) { return r && button_defineProperties(e.prototype, r), t && button_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function button_toPropertyKey(t) { var i = button_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function button_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function button_callSuper(t, o, e) { return o = button_getPrototypeOf(o), button_possibleConstructorReturn(t, button_isNativeReflectConstruct() ? Reflect.construct(o, e || [], button_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function button_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return button_assertThisInitialized(t); } -function button_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function button_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (button_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function button_get() { return button_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = button_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, button_get.apply(null, arguments); } -function button_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = button_getPrototypeOf(t));); return t; } -function button_getPrototypeOf(t) { return button_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, button_getPrototypeOf(t); } -function button_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && button_setPrototypeOf(t, e); } -function button_setPrototypeOf(t, e) { return button_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, button_setPrototypeOf(t, e); } - - - - - -/** - * A Button Custom HTML Element. - * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | \n"])), function (x) { - return x.autofocus; - }, function (x) { - return x.disabled; - }, function (x) { - return x.formId; - }, function (x) { - return x.formaction; - }, function (x) { - return x.formenctype; - }, function (x) { - return x.formmethod; - }, function (x) { - return x.formnovalidate; - }, function (x) { - return x.formtarget; - }, function (x) { - return x.name; - }, function (x) { - return x.type; - }, function (x) { - return x.value; - }, function (x) { - return x.ariaAtomic; - }, function (x) { - return x.ariaBusy; - }, function (x) { - return x.ariaControls; - }, function (x) { - return x.ariaCurrent; - }, function (x) { - return x.ariaDescribedby; - }, function (x) { - return x.ariaDetails; - }, function (x) { - return x.ariaDisabled; - }, function (x) { - return x.ariaErrormessage; - }, function (x) { - return x.ariaExpanded; - }, function (x) { - return x.ariaFlowto; - }, function (x) { - return x.ariaHaspopup; - }, function (x) { - return x.ariaHidden; - }, function (x) { - return x.ariaInvalid; - }, function (x) { - return x.ariaKeyshortcuts; - }, function (x) { - return x.ariaLabel; - }, function (x) { - return x.ariaLabelledby; - }, function (x) { - return x.ariaLive; - }, function (x) { - return x.ariaOwns; - }, function (x) { - return x.ariaPressed; - }, function (x) { - return x.ariaRelevant; - }, function (x) { - return x.ariaRoledescription; - }, ref("control"), startSlotTemplate(context, definition), slotted("defaultSlottedContent"), endSlotTemplate(context, definition)); -}; -;// CONCATENATED MODULE: ../../node_modules/exenv-es6/dist/can-use-dom.js -/** - * Checks if the DOM is available to access and use - */ -function can_use_dom_canUseDOM() { - return !!(typeof window !== "undefined" && window.document && window.document.createElement); -} -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-web-utilities/dist/dom.js - -/** - * A test that ensures that all arguments are HTML Elements - */ -function isHTMLElement() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - return args.every(function (arg) { - return arg instanceof HTMLElement; - }); -} -/** - * Returns all displayed elements inside of a root node that match a provided selector - */ -function getDisplayedNodes(rootNode, selector) { - if (!rootNode || !selector || !isHTMLElement(rootNode)) { - return; - } - var nodes = Array.from(rootNode.querySelectorAll(selector)); - // offsetParent will be null if the element isn't currently displayed, - // so this will allow us to operate only on visible nodes - return nodes.filter(function (node) { - return node.offsetParent !== null; - }); -} -/** - * Gets the numeric key code associated with a keyboard event. This method is for use with DOM level 3 events - * that still use the deprecated keyCode property. - */ -function getKeyCode(event) { - return event === null ? null : event.which || event.keyCode || event.charCode; -} -/** - * Returns the nonce used in the page, if any. - * - * Based on https://github.com/cssinjs/jss/blob/master/packages/jss/src/DomRenderer.js - */ -function getNonce() { - var node = document.querySelector('meta[property="csp-nonce"]'); - if (node) { - return node.getAttribute("content"); - } else { - return null; - } -} -/** - * Test if the document supports :focus-visible - */ -var _canUseFocusVisible; -function canUseFocusVisible() { - if (typeof _canUseFocusVisible === "boolean") { - return _canUseFocusVisible; - } - if (!can_use_dom_canUseDOM()) { - _canUseFocusVisible = false; - return _canUseFocusVisible; - } - // Check to see if the document supports the focus-visible element - var styleElement = document.createElement("style"); - // If nonces are present on the page, use it when creating the style element - // to test focus-visible support. - var styleNonce = getNonce(); - if (styleNonce !== null) { - styleElement.setAttribute("nonce", styleNonce); - } - document.head.appendChild(styleElement); - try { - styleElement.sheet.insertRule("foo:focus-visible {color:inherit}", 0); - _canUseFocusVisible = true; - } catch (e) { - _canUseFocusVisible = false; - } finally { - document.head.removeChild(styleElement); - } - return _canUseFocusVisible; -} -var _canUseCssGrid; -function canUseCssGrid() { - if (typeof _canUseCssGrid === "boolean") { - return _canUseCssGrid; - } - try { - _canUseCssGrid = CSS.supports("display", "grid"); - } catch (_a) { - _canUseCssGrid = false; - } - return _canUseCssGrid; -} -function canUseForcedColors() { - return canUseDOM() && (window.matchMedia("(forced-colors: none)").matches || window.matchMedia("(forced-colors: active)").matches); -} -function resetDocumentCache() { - _canUseCssGrid = undefined; - _canUseFocusVisible = undefined; -} -/** - * @deprecated Use 'canUseForcedColors' instead - */ -var canUsedForcedColors = (/* unused pure expression or super */ null && (canUseForcedColors)); -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js - -/** - * The string representing the focus selector to be used. Value - * will be "focus-visible" when https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo - * is supported and "focus" when it is not. - * - * @public - */ -var focusVisible = canUseFocusVisible() ? "focus-visible" : "focus"; -;// CONCATENATED MODULE: ../../node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js -/** - * The CSS value for disabled cursors. - * @public - */ -var disabledCursor = "not-allowed"; -;// CONCATENATED MODULE: ../../node_modules/@vscode/webview-ui-toolkit/dist/button/button.styles.js -var button_styles_templateObject, button_styles_templateObject2, button_styles_templateObject3, button_styles_templateObject4, _templateObject5; -function button_styles_taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); } -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - - - -/** - * Developer note: - * - * The prettier-ignore command is used on this block of code because when removed the - * '.control:${focusVisible}' CSS selector will be automatically reformatted to - * '.control: ${focusVisible}' (note the space between the colon and dollar sign). - * - * This results in non-valid CSS that will not render a focus outline on base buttons. - * - * Additionally, this prettier command must be declared on the entire code block and not - * directly above the CSS selector line because the below code block is a template literal - * string which will end up being used directly in the final component CSS. - * - * Thus having '// prettier-ignore' directly in the final CSS will also break the component - * styling. - * - * @internal - */ -// prettier-ignore -var BaseButtonStyles = css(button_styles_templateObject || (button_styles_templateObject = button_styles_taggedTemplateLiteral(["\n\t", " :host {\n\t\toutline: none;\n\t\tfont-family: ", ";\n\t\tfont-size: ", ";\n\t\tline-height: ", ";\n\t\tcolor: ", ";\n\t\tbackground: ", ";\n\t\tborder-radius: calc(", " * 1px);\n\t\tfill: currentColor;\n\t\tcursor: pointer;\n\t}\n\t.control {\n\t\tbackground: transparent;\n\t\theight: inherit;\n\t\tflex-grow: 1;\n\t\tbox-sizing: border-box;\n\t\tdisplay: inline-flex;\n\t\tjustify-content: center;\n\t\talign-items: center;\n\t\tpadding: ", " ", ";\n\t\twhite-space: wrap;\n\t\toutline: none;\n\t\ttext-decoration: none;\n\t\tborder: calc(", " * 1px) solid ", ";\n\t\tcolor: inherit;\n\t\tborder-radius: inherit;\n\t\tfill: inherit;\n\t\tcursor: inherit;\n\t\tfont-family: inherit;\n\t}\n\t:host(:hover) {\n\t\tbackground: ", ";\n\t}\n\t:host(:active) {\n\t\tbackground: ", ";\n\t}\n\t.control:", " {\n\t\toutline: calc(", " * 1px) solid ", ";\n\t\toutline-offset: calc(", " * 2px);\n\t}\n\t.control::-moz-focus-inner {\n\t\tborder: 0;\n\t}\n\t:host([disabled]) {\n\t\topacity: ", ";\n\t\tbackground: ", ";\n\t\tcursor: ", ";\n\t}\n\t.content {\n\t\tdisplay: flex;\n\t}\n\t.start {\n\t\tdisplay: flex;\n\t}\n\t::slotted(svg),\n\t::slotted(span) {\n\t\twidth: calc(", " * 4px);\n\t\theight: calc(", " * 4px);\n\t}\n\t.start {\n\t\tmargin-inline-end: 8px;\n\t}\n"])), display('inline-flex'), fontFamily, typeRampBaseFontSize, typeRampBaseLineHeight, buttonPrimaryForeground, buttonPrimaryBackground, cornerRadiusRound, buttonPaddingVertical, buttonPaddingHorizontal, borderWidth, buttonBorder, buttonPrimaryHoverBackground, buttonPrimaryBackground, focusVisible, borderWidth, focusBorder, borderWidth, disabledOpacity, buttonPrimaryBackground, disabledCursor, designUnit, designUnit); -/** - * @internal - */ -var PrimaryButtonStyles = css(button_styles_templateObject2 || (button_styles_templateObject2 = button_styles_taggedTemplateLiteral(["\n\t:host([appearance='primary']) {\n\t\tbackground: ", ";\n\t\tcolor: ", ";\n\t}\n\t:host([appearance='primary']:hover) {\n\t\tbackground: ", ";\n\t}\n\t:host([appearance='primary']:active) .control:active {\n\t\tbackground: ", ";\n\t}\n\t:host([appearance='primary']) .control:", " {\n\t\toutline: calc(", " * 1px) solid ", ";\n\t\toutline-offset: calc(", " * 2px);\n\t}\n\t:host([appearance='primary'][disabled]) {\n\t\tbackground: ", ";\n\t}\n"])), buttonPrimaryBackground, buttonPrimaryForeground, buttonPrimaryHoverBackground, buttonPrimaryBackground, focusVisible, borderWidth, focusBorder, borderWidth, buttonPrimaryBackground); -/** - * @internal - */ -var SecondaryButtonStyles = css(button_styles_templateObject3 || (button_styles_templateObject3 = button_styles_taggedTemplateLiteral(["\n\t:host([appearance='secondary']) {\n\t\tbackground: ", ";\n\t\tcolor: ", ";\n\t}\n\t:host([appearance='secondary']:hover) {\n\t\tbackground: ", ";\n\t}\n\t:host([appearance='secondary']:active) .control:active {\n\t\tbackground: ", ";\n\t}\n\t:host([appearance='secondary']) .control:", " {\n\t\toutline: calc(", " * 1px) solid ", ";\n\t\toutline-offset: calc(", " * 2px);\n\t}\n\t:host([appearance='secondary'][disabled]) {\n\t\tbackground: ", ";\n\t}\n"])), buttonSecondaryBackground, buttonSecondaryForeground, buttonSecondaryHoverBackground, buttonSecondaryBackground, focusVisible, borderWidth, focusBorder, borderWidth, buttonSecondaryBackground); -/** - * @internal - */ -var IconButtonStyles = css(button_styles_templateObject4 || (button_styles_templateObject4 = button_styles_taggedTemplateLiteral(["\n\t:host([appearance='icon']) {\n\t\tbackground: ", ";\n\t\tborder-radius: ", ";\n\t\tcolor: ", ";\n\t}\n\t:host([appearance='icon']:hover) {\n\t\tbackground: ", ";\n\t\toutline: 1px dotted ", ";\n\t\toutline-offset: -1px;\n\t}\n\t:host([appearance='icon']) .control {\n\t\tpadding: ", ";\n\t\tborder: none;\n\t}\n\t:host([appearance='icon']:active) .control:active {\n\t\tbackground: ", ";\n\t}\n\t:host([appearance='icon']) .control:", " {\n\t\toutline: calc(", " * 1px) solid ", ";\n\t\toutline-offset: ", ";\n\t}\n\t:host([appearance='icon'][disabled]) {\n\t\tbackground: ", ";\n\t}\n"])), buttonIconBackground, buttonIconCornerRadius, foreground, buttonIconHoverBackground, contrastActiveBorder, buttonIconPadding, buttonIconHoverBackground, focusVisible, borderWidth, focusBorder, buttonIconFocusBorderOffset, buttonIconBackground); -var buttonStyles = function buttonStyles(context, definition) { - return css(_templateObject5 || (_templateObject5 = button_styles_taggedTemplateLiteral(["\n\t", "\n\t", "\n\t", "\n\t", "\n"])), BaseButtonStyles, PrimaryButtonStyles, SecondaryButtonStyles, IconButtonStyles); -}; -;// CONCATENATED MODULE: ../../node_modules/@vscode/webview-ui-toolkit/dist/button/index.js -function dist_button_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } -function dist_button_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, dist_button_toPropertyKey(o.key), o); } } -function dist_button_createClass(e, r, t) { return r && dist_button_defineProperties(e.prototype, r), t && dist_button_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } -function dist_button_toPropertyKey(t) { var i = dist_button_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } -function dist_button_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function dist_button_callSuper(t, o, e) { return o = dist_button_getPrototypeOf(o), dist_button_possibleConstructorReturn(t, dist_button_isNativeReflectConstruct() ? Reflect.construct(o, e || [], dist_button_getPrototypeOf(t).constructor) : o.apply(t, e)); } -function dist_button_possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return dist_button_assertThisInitialized(t); } -function dist_button_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } -function dist_button_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (dist_button_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } -function dist_button_get() { return dist_button_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = dist_button_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, dist_button_get.apply(null, arguments); } -function dist_button_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = dist_button_getPrototypeOf(t));); return t; } -function dist_button_getPrototypeOf(t) { return dist_button_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, dist_button_getPrototypeOf(t); } -function dist_button_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && dist_button_setPrototypeOf(t, e); } -function dist_button_setPrototypeOf(t, e) { return dist_button_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, dist_button_setPrototypeOf(t, e); } -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - - - - -/** - * The Visual Studio Code button class. - * - * @public - */ -var button_Button = /*#__PURE__*/function (_FoundationButton) { - function Button() { - dist_button_classCallCheck(this, Button); - return dist_button_callSuper(this, Button, arguments); - } - dist_button_inherits(Button, _FoundationButton); - return dist_button_createClass(Button, [{ - key: "connectedCallback", - value: - /** - * Component lifecycle method that runs when the component is inserted - * into the DOM. - * - * @internal - */ - function connectedCallback() { - dist_button_get(dist_button_getPrototypeOf(Button.prototype), "connectedCallback", this).call(this); - // If the appearance property has not been set, set it to the - // value of the appearance attribute. - if (!this.appearance) { - var appearanceValue = this.getAttribute('appearance'); - this.appearance = appearanceValue; - } - } - /** - * Component lifecycle method that runs when an attribute of the - * element is changed. - * - * @param attrName - The attribute that was changed - * @param oldVal - The old value of the attribute - * @param newVal - The new value of the attribute - * - * @internal - */ - }, { - key: "attributeChangedCallback", - value: function attributeChangedCallback(attrName, oldVal, newVal) { - // In the case when an icon only button is created add a default ARIA - // label to the button since there is no longer button text to use - // as the label - if (attrName === 'appearance' && newVal === 'icon') { - // Only set the ARIA label to the default text if an aria-label attribute - // does not exist on the button - var ariaLabelValue = this.getAttribute('aria-label'); - if (!ariaLabelValue) { - this.ariaLabel = 'Icon Button'; - } - } - // In the case when the aria-label attribute has been defined on the - // , this will programmatically propogate the value to - // the