(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(self, () => { return /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (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/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { StockTicker: () => (/* binding */ StockTicker) }); ;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.mjs /****************************************************************************** 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(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 = 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() { 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() { 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 () { 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() { 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(); } /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources, }); ;// CONCATENATED MODULE: ./node_modules/@lit/reactive-element/css-tag.js /** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const css_tag_t=globalThis,e=css_tag_t.ShadowRoot&&(void 0===css_tag_t.ShadyCSS||css_tag_t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n("string"==typeof t?t:t+"",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=css_tag_t.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t; //# sourceMappingURL=css-tag.js.map ;// CONCATENATED MODULE: ./node_modules/@lit/reactive-element/reactive-element.js /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const{is:reactive_element_i,defineProperty:reactive_element_e,getOwnPropertyDescriptor:reactive_element_r,getOwnPropertyNames:h,getOwnPropertySymbols:reactive_element_o,getPrototypeOf:reactive_element_n}=Object,a=globalThis,reactive_element_c=a.trustedTypes,l=reactive_element_c?reactive_element_c.emptyScript:"",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!reactive_element_i(t,s),y={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:f};Symbol.metadata??=Symbol("metadata"),a.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&reactive_element_e(this.prototype,t,r)}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=reactive_element_r(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(d("elementProperties")))return;const t=reactive_element_n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d("properties"))){const t=this.properties,s=[...h(t),...reactive_element_o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c(s))}else void 0!==s&&i.push(c(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$EC(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f)(this[t],s))return;this.P(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.P(s,this[s],i)}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[d("elementProperties")]=new Map,b[d("finalized")]=new Map,p?.({ReactiveElement:b}),(a.reactiveElementVersions??=[]).push("2.0.4"); //# sourceMappingURL=reactive-element.js.map ;// CONCATENATED MODULE: ./node_modules/lit-html/lit-html.js /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ const lit_html_t=globalThis,lit_html_i=lit_html_t.trustedTypes,lit_html_s=lit_html_i?lit_html_i.createPolicy("lit-html",{createHTML:t=>t}):void 0,lit_html_e="$lit$",lit_html_h=`lit$${Math.random().toFixed(9).slice(2)}$`,lit_html_o="?"+lit_html_h,lit_html_n=`<${lit_html_o}>`,lit_html_r=document,lit_html_l=()=>lit_html_r.createComment(""),lit_html_c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,lit_html_a=Array.isArray,lit_html_u=t=>lit_html_a(t)||"function"==typeof t?.[Symbol.iterator],lit_html_d="[ \t\n\f\r]",lit_html_f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${lit_html_d}(?:([^\\s"'>=/]+)(${lit_html_d}*=${lit_html_d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),lit_html_p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,lit_html_y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=lit_html_y(1),lit_html_b=lit_html_y(2),w=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),A=new WeakMap,E=lit_html_r.createTreeWalker(lit_html_r,129);function C(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==lit_html_s?lit_html_s.createHTML(i):i}const P=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"":"",c=lit_html_f;for(let i=0;i"===u[0]?(c=r??lit_html_f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:lit_html_p):c===g||c===lit_html_p?c=m:c===v||c===_?c=lit_html_f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===lit_html_f?s+lit_html_n:d>=0?(o.push(a),s.slice(0,d)+lit_html_e+s.slice(d)+lit_html_h+x):s+lit_html_h+(-2===d?i:x)}return[C(t,l+(t[s]||"")+(2===i?"":"")),o]};class V{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=P(t,s);if(this.el=V.createElement(f,n),E.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=E.nextNode())&&d.length0){r.textContent=lit_html_i?lit_html_i.emptyScript:"";for(let i=0;i2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=T}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=N(this,t,i,0),o=!lit_html_c(t)||t!==this._$AH&&t!==w,o&&(this._$AH=t);else{const e=t;let n,r;for(t=h[0],n=0;n{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new M(i.insertBefore(lit_html_l(),t),t,void 0,s??{})}return h._$AI(t),h}; //# sourceMappingURL=lit-html.js.map ;// CONCATENATED MODULE: ./node_modules/lit-element/lit-element.js /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */class lit_element_s extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=j(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return w}}lit_element_s._$litElement$=!0,lit_element_s[("finalized","finalized")]=!0,globalThis.litElementHydrateSupport?.({LitElement:lit_element_s});const lit_element_r=globalThis.litElementPolyfillSupport;lit_element_r?.({LitElement:lit_element_s});const lit_element_o={_$AK:(t,e,i)=>{t._$AK(e,i)},_$AL:t=>t._$AL};(globalThis.litElementVersions??=[]).push("4.0.6"); //# sourceMappingURL=lit-element.js.map ;// CONCATENATED MODULE: ./node_modules/lit/index.js //# sourceMappingURL=index.js.map ;// CONCATENATED MODULE: ./node_modules/@lit/reactive-element/decorators/property.js /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */const property_o={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:f},property_r=(t=property_o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(r.name,t),"accessor"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.P(o,void 0,t),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t)}}throw Error("Unsupported decorator location: "+n)};function property_n(t){return(e,o)=>"object"==typeof o?property_r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)} //# sourceMappingURL=property.js.map ;// CONCATENATED MODULE: ./node_modules/@lit/reactive-element/decorators/state.js /** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function state_r(r){return t({...r,state:!0,attribute:!1})} //# sourceMappingURL=state.js.map ;// CONCATENATED MODULE: ./node_modules/lit/decorators.js //# sourceMappingURL=decorators.js.map ;// CONCATENATED MODULE: ./src/components/cascade-stock-ticker/cascade-stock-ticker.styles.ts const cssPropDefaults = {}; /* harmony default export */ const cascade_stock_ticker_styles = (i ` a:active, a:focus, a:hover, a:link, a:visited { text-decoration: none; color: inherit; } .row-stock-data { font-family: Segoe UI, "Helvetica Neue", Helvetica, Arial, sans-serif; } .IRStock.stock-chart-container:focus { outline: dotted white 3px; } .IRStock.MicrosoftCorp_price { float: left; width: 200px; padding: 20px 30px 0 0; } *, :after, :before { box-sizing: inherit; } .IRStock .MicrosoftCorp_last { padding: 0; line-height: 62px; font-family: Segoe UI, "Helvetica Neue", Helvetica, Arial, sans-serif; } .c-heading-2 { font-size: 46px; line-height: 56px; padding: 37px 0 3px; } .c-heading-1, .c-heading-2 { letter-spacing: -0.01em; font-weight: 100; } .MicrosoftCorp_Change, .MicrosoftCorp_percentChange_none { color: #308500; } .c-subheading-4 { padding: 9px 0 3px; font-weight: 400; } .c-heading-6, .c-paragraph-2, .c-subheading-4 { font-size: 18px; line-height: 24px; } .MicrosoftCorp_percentChange { color: #b40000; } .IRStock.chart_details { float: left; width: 230px; padding: 25px 30px 0 0; font-size: 15px; } .filters.eventfilters.c-subheading-2, .c-subheading-2 { padding: 26px 0 2px; display: inline-block; } .c-subheading-2 { padding: 4px 0 8px; font-weight: 200; } .c-heading-4, .c-subheading-2 { font-size: 24px; line-height: 28px; } .IRStock table { width: 200px; border-spacing: 0; border-collapse: collapse; } .IRStock table tr { border-bottom: 1px solid #e6e6e6; } .MicrosoftCorp_left { text-align: left; line-height: 1; } legend, td, th { padding: 0; } .MicrosoftCorp_right { text-align: right; } .IRStock.stock-chart-container { float: left; width: 290px; } .IRStock svg { min-width: 160px; font-family: "Segoe UI"; font-size: 18px; font-weight: normal; fill: rgb(66, 68, 68); } .IRStock.left [data-grid*="col-"] { padding-right: 20px; } .chart_des { float: inline-start; } text { display: block; white-space: nowrap; } body { font-family: Segoe UI, "Helvetica Neue", Helvetica, Arial, sans-serif; } style attribute { font-family: "Segoe UI"; font-size: 18px; font-weight: normal; fill: rgb(66, 68, 68); } .IRStock .chart.left { color: #424444; } .IRStock.left [data-grid*="col-"] { padding-right: 20px; } .IRStock svg { min-width: 160px; } .IRStock .MicrosoftCorp_last { padding: 0; line-height: 62px; } .IRStock .chart_details { padding-top: 25px; } .IRStock .chart { float: left; } .IRStock .chart.right { text-align: left; } .MicrosoftCorp_Change, .MicrosoftCorp_percentChange_none { color: #308500; } .MicrosoftCorp_left { text-align: left; line-height: 1; } .MicrosoftCorp_right { text-align: right; } .IRStock .MicrosoftCorp_price { float: left; width: 200px; padding-top: 20px; padding-right: 30px; } .IRStock .stock-chart-container { float: left; width: 290px; } .IRStock .chart_details { float: left; width: 230px; padding-right: 30px; font-size: 15px; } .IRStock.left [data-grid*="col-"] { padding-right: 20px; } [data-grid~="col-12"] { width: 100%; } [data-grid*="col-"] { float: left; min-height: 1px; } [data-grid*="col-"], [data-grid~="container"] { box-sizing: border-box; zoom: 1; } [data-grid*="col-"]:after, [data-grid~="container"]:after { clear: both; } a.c-hyperlink:active { background: 0 0; color: #005293; -ms-transform: none; transform: none; } a.c-hyperlink:focus, a.c-hyperlink:hover { color: #005da6; text-decoration: underline; } a.c-hyperlink { text-decoration: underline; color: #0067b8; } /* Responsive Styles */ @media screen and (min-width: 910px) { .IRAR .IRAR-stock-right { padding-top: 21px; clear: both; } } @media screen and (max-width: 1260px) and (min-width: 910px) { .IRStock .stock-chart-container, .chart_des { width: 412px; } .IRAR .IRAR-stock-right { padding-top: 28px; clear: both; } } @media screen and (max-width: 910px) { .IRStock[data-grid~="col-9"], .IRAR[data-grid~="col-3"] { width: 100% !important; float: none; display: block; } .IRAR.right > h2 { text-align: center; padding: 32px 0 0; } .IRStock .MicrosoftCorp_price, .IRStock .stock-chart-container, .IRStock .chart_details { float: none; padding-right: 0; padding-top: 0; } .IRStock .chart_details { padding-top: 25px; padding-bottom: 15px; } .IRStock .stock-chart-container { width: 95%; margin-left: -2%; padding-bottom: 10px; } .IRAR .IRAR-stock-right { margin-left: 120px; display: table-cell; height: 100px; vertical-align: middle; } .IRAR .IRAR-stock .ARImg .c-image-mobile { display: block; } .IRStock .chart_details, .IRStock .chart_details table { width: 100%; } #stock-chart-container-0_gTxt, #stock-chart-container-0_y1, #stock-chart-container-0_y0 { font-size: 15px; } } @media screen and (max-width: 910px) { .IRStock[data-grid~="col-9"], .IRAR[data-grid~="col-3"] { width: 100% !important; float: none; display: block; } .IRAR.right > h2 { text-align: center; padding: 32px 0 0; } .IRStock .MicrosoftCorp_price, .IRStock .stock-chart-container, .IRStock .chart_details { float: none; padding-right: 0; padding-top: 0; } .IRStock .chart_details { padding-top: 25px; padding-bottom: 15px; } .IRStock .stock-chart-container { width: 95%; margin-left: -2%; padding-bottom: 10px; } .IRAR .IRAR-stock-right { margin-left: 120px; display: table-cell; height: 100px; vertical-align: middle; } .IRAR .IRAR-stock .ARImg .c-image-mobile { display: block; } .IRStock .chart_details, .IRStock .chart_details table { width: 100%; } #stock-chart-container-0_gTxt, #stock-chart-container-0_y1, #stock-chart-container-0_y0 { font-size: 15px; } } @media screen and (max-width: 910px) { .IRStock .chart_details, .IRStock .chart_details table { width: 100%; } } @media screen and (max-width: 910px) { .IRStock .chart_details { padding-top: 25px; padding-bottom: 15px; } } @media screen and (max-width: 910px) { .IRStock .MicrosoftCorp_price, .IRStock .stock-chart-container, .IRStock .chart_details { float: none; padding-right: 0; padding-top: 0; } } @media (max-width: 767px) { .c-subheading-2 { padding: 8px 0 4px; } } @media (max-width: 767px) { .c-heading-4, .c-subheading-2 { font-size: 20px; line-height: 24px; } } `); ;// 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 = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {})); continue; case 'engineering': result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, 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 = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' }); } else if (opt) { result = __assign(__assign({}, 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 = __assign(__assign({}, result), parseSignificantPrecision(token.stem)); continue; } var signOpts = parseSign(token.stem); if (signOpts) { result = __assign(__assign({}, result), signOpts); } var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem); if (conciseScientificAndEngineeringOpts) { result = __assign(__assign({}, 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, __assign({}, 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 = __assign({ 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)); ;// CONCATENATED MODULE: ./node_modules/@formatjs/fast-memoize/lib/index.js // // 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 () { 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, }; ;// 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) { __extends(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) { __extends(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) { __extends(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) { __extends(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 __assign(__assign(__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) { all[k] = __assign(__assign({}, 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; }, __assign({}, defaultConfig)); } function createFastMemoizeCache(store) { return { create: function () { return { get: function (key) { return store[key]; }, set: function (key, value) { store[key] = value; }, }; }, }; } function createDefaultFormatters(cache) { if (cache === void 0) { cache = { number: {}, dateTime: {}, pluralRules: {}, }; } return { getNumberFormat: 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, __spreadArray([void 0], args, false)))(); }, { cache: createFastMemoizeCache(cache.number), strategy: strategies.variadic, }), getDateTimeFormat: 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, __spreadArray([void 0], args, false)))(); }, { cache: createFastMemoizeCache(cache.dateTime), strategy: strategies.variadic, }), getPluralRules: 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, __spreadArray([void 0], args, false)))(); }, { cache: createFastMemoizeCache(cache.pluralRules), strategy: 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 = __rest(_a, ["formatters"]); // Parse string messages into an AST. this.ast = IntlMessageFormat.__parse(message, __assign(__assign({}, 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 () { 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 */ const lib = (IntlMessageFormat); ;// CONCATENATED MODULE: ./node_modules/@skagit/sdk/dist/services/localization/i18nManager.js /** * @desc A singleton class that manages the localization settings. * @note "lang" and "dir" settings are only checked once at instantiation. */ class I18nManager { constructor() { this.lang = i18nValidate('lang', document?.documentElement?.getAttribute('lang')); this.dir = i18nValidate('dir', document?.documentElement?.getAttribute('dir')); const documentElementObserver = new MutationObserver(() => { document.dispatchEvent(new CustomEvent('localeChanged', { detail: { lang: (this.lang = i18nValidate('lang', document.documentElement.lang)), dir: (this.dir = i18nValidate('dir', document.documentElement.dir)), }, })); }); documentElementObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['dir', 'lang'], }); } } function i18nValidate(type, value) { if (type === 'lang') { if (!value) return 'en-us'; return value.includes('-') && value.length >= 5 ? value.toLowerCase() : 'en-us'; } if (type === 'dir') { if (!value) return 'ltr'; return value.match(/^(ltr|rtl)$/i) ? value.toLowerCase() : 'ltr'; } console.warn('Invalid validation type!'); return ''; } const getI18nManager = (function () { let i18nManager; return function () { if (!i18nManager) i18nManager = new I18nManager(); return i18nManager; }; })(); //# sourceMappingURL=i18nManager.js.map ;// CONCATENATED MODULE: ./node_modules/@skagit/sdk/dist/services/localization/i18nMixin.js const I18nMixin = (superClass) => { class SubClass extends superClass { constructor() { super(...arguments); this.i18nManager = getI18nManager(); this.locChangeHandler = (event) => { this.lang = event.detail.lang; this.dir = event.detail.dir; this.requestUpdate(); }; } connectedCallback() { super.connectedCallback(); this.lang = this.i18nManager?.lang || 'en-us'; this.dir = this.i18nManager?.dir || 'ltr'; document.addEventListener('localeChanged', this.locChangeHandler); } disconnectedCallback() { super.disconnectedCallback(); document.removeEventListener('localeChanged', this.locChangeHandler); } /** * @desc Returns a translated message given a key to the static dictionary. * @param {string} key - The key of the string to translate. * @param {Record} interpolations - The values to interpolate into the string. * @return {string} The translated string. */ msg(key, interpolations) { /* istanbul ignore if */ if (!key || !this.lang) return ''; let message = this.translations?.[key]; const dict = this.constructor.dict; if (!message) message = dict?.[key] || ''; return this.format(message, interpolations); } /** * @desc Returns a message interpolated with the provided indexed values. * @param {string} message - The format of the string. * @param {Record} interpolations - The values to interpolate into the string. * @return {string} The formatted string. */ format(message, interpolations) { const formatter = new lib(message, this.lang); return formatter.format(interpolations); } } SubClass.dict = {}; __decorate([ property_n({ type: Object, reflect: false }) ], SubClass.prototype, "translations", void 0); return SubClass; }; const WithLocalization = I18nMixin(lit_element_s); //# sourceMappingURL=i18nMixin.js.map ;// CONCATENATED MODULE: ./node_modules/@skagit/sdk/dist/util/define-elements.js /* eslint-disable no-negated-condition, no-undef, no-console */ /** * Class decorator factory that checks whether a custom element is already registered. * If it is not, it defines the decorated class as a custom element. * * ```js * @defineCustomElement('my-element') * class MyElement extends LitElement { * render() { * return html``; * } * } * ``` * @category Decorator * @param tagName The tag name of the custom element to define. */ const defineCustomElement = (tagName) => (classOrTarget, context) => { if (customElements.get(tagName)) { console.warn(`${tagName} is already defined.`); return; } if (context !== undefined) { context.addInitializer(() => { customElements.define(tagName, classOrTarget); }); } else { customElements.define(tagName, classOrTarget); } }; //# sourceMappingURL=define-elements.js.map ;// CONCATENATED MODULE: ./src/components/cascade-stock-ticker/StockChart.ts class StockChart { constructor(options, shadowRoot) { this.shadowRoot = shadowRoot; this.defVal = { containerId: "chart_container", data: [], PricePreviousClose: null, style: {}, backgroundColor: "white", stroke: "gray", strokeWidth: 1, fill: "steelblue", fillOpacity: "0.85", }; const defStyle = { fontFamily: "Segoe UI", fontSize: "20px", fontWeight: "bold", fill: "#424444", }; this.opts = { ...this.defVal, ...options }; this.opts.style = { ...defStyle, ...this.opts.style }; this.makeSVG = function (tag, attrs) { const el = document.createElementNS("http://www.w3.org/2000/svg", tag); for (const k in attrs) { el.setAttribute(k, attrs[k]); } return el; }; } draw() { if (this.opts.containerId) { const element = this.shadowRoot.getElementById(this.opts.containerId); if (element) { while (element.firstChild) { element.removeChild(element.firstChild); } } if (!this.opts.data) { const element = this.shadowRoot.getElementById(this.opts.containerId); if (element) { element.style.display = "none"; } return; } if (!Array.isArray(this.opts.data) || !this.opts.data.map) { const element = this.shadowRoot.getElementById(this.opts.containerId); if (element) { element.style.display = "none"; } return; } // get the max price from data array var max = Math.max.apply(Math, this.opts.data.map(function (o) { return o.P; })); if (this.opts.PricePreviousClose && this.opts.PricePreviousClose > max) max = this.opts.PricePreviousClose; // get the min price from data array var min = Math.min.apply(Math, this.opts.data.map(function (o) { return o.P; })); if (this.opts.PricePreviousClose && this.opts.PricePreviousClose < min) min = this.opts.PricePreviousClose; // actual min value in scale Y var minAxisY = parseFloat(min.toString()) - 0.1; // actual max value in scale Y var maxAxisY = parseFloat(max.toString()) + 0.1; var startPointX = 90; // the trended line default start point X var startPointY = 205; // the trended line default start point Y var margin = 20; // the whole chart margin value, four margin values are same var topY = margin + 25; // the top Y axis line point Y var defWidth = 430; // the whole chart default width var defHeight = 230; // the whole chart default height var totalMinutes = 390; //9:30 am through 16:00 pm, a total of 390 minutes. var xLength = defWidth - margin * 2; // axis width var yLength = startPointY - topY; // axis length var xScale = (xLength - startPointX + margin) / totalMinutes; // X scale value var yScale = parseFloat((yLength / (maxAxisY - minAxisY)).toString()).toFixed(2); // Y scale value var todayDate = this.opts.data[0].T; todayDate = new Date(todayDate.replace(/ /g, "T")); var startTime = new Date(todayDate.getFullYear(), todayDate.getMonth(), todayDate.getDate(), 9, 30, 0, 0); // the default start time is 9:30 am var xStart = startPointX + ((todayDate - Number(startTime)) / 1000 / 60) * xScale; // calculate the trended line actual start point X let containerElement = this.shadowRoot.getElementById(this.opts.containerId); let containerWidth = containerElement ? containerElement.offsetWidth : 0; if (containerWidth == 0) containerWidth = defWidth; // append svg element var svg; if (navigator.userAgent.indexOf("MSIE") !== -1 || !!window.ActiveXObject || "ActiveXObject" in window) { svg = this.makeSVG("svg", { width: ((defWidth * containerWidth) / defWidth).toString(), height: ((defHeight * containerWidth) / defWidth).toString(), viewBox: "0 0 " + (defWidth * containerWidth) / defWidth + " 0", focusable: "false", /*preserveAspectRatio: 'xMidYMin meet'*/ }); } else { svg = this.makeSVG("svg", { /*width: defWidth * containerWidth / defWidth, height: defHeight * containerWidth / defWidth,*/ viewBox: "0 0 " + (defWidth * containerWidth) / defWidth + " " + (defHeight * containerWidth) / defWidth, focusable: "false", /*preserveAspectRatio: 'xMidYMin meet'*/ }); } if (element) { element.appendChild(svg); svg.setAttribute("aria-labelledby", "title desc"); svg.setAttribute("role", "img"); if (this.opts.style) { Object.entries(this.opts.style).forEach(([key, value]) => { // Specify the type of the index expression as 'number' svg.style[key] = value; }); } //append title element in svg var gtitle = this.makeSVG("title", { id: "title" }); gtitle.textContent = "MSFT stock day chart showing stock value at various times"; svg.appendChild(gtitle); //append desc element in svg var gdesc = this.makeSVG("desc", { id: "desc" }); var strdesc = ""; var hours = 0; var mins = 0; for (var i = 0; i < this.opts.data.length; i++) { var dateTemp = new Date(this.opts.data[i].T.replace(/ /g, "T")); hours = dateTemp.getHours(); mins = dateTemp.getMinutes(); if (hours == 10 && mins == 0) { strdesc += "At 10am, stock value is " + this.opts.data[i].P; } if (hours == 12 && mins == 0) { strdesc += ", At 12pm, stock value is " + this.opts.data[i].P; } if (hours == 14 && mins == 0) { strdesc += ", At 2pm, stock value is " + this.opts.data[i].P; } if (hours == 16 && mins == 0) { strdesc += ", At 4pm, stock value is " + this.opts.data[i].P; } } gdesc.textContent = strdesc; svg.appendChild(gdesc); // append gPath element in svg var gPath = this.makeSVG("g", { id: this.opts.containerId + "_gPath", transform: "scale(" + containerWidth / defWidth + ")", }); svg.appendChild(gPath); // append rect element in gPath gPath.appendChild(this.makeSVG("rect", { x: (0).toString(), y: (0).toString(), width: defWidth.toString(), height: defHeight.toString(), fill: this.opts.backgroundColor || "", // Assign an empty string if this.opts.backgroundColor is undefined })); // append Y axis line at top in gPath gPath.appendChild(this.makeSVG("line", { x1: (startPointX - 0.5).toString(), y1: topY.toString(), x2: (defWidth - margin + 0.5).toString(), y2: topY.toString(), stroke: this.opts.stroke || "", "stroke-width": this.opts.strokeWidth?.toString() || "", })); // append Y axis line at middle in gPath gPath.appendChild(this.makeSVG("line", { x1: (startPointX - 0.5).toString(), y1: ((startPointY - topY) / 2 + topY).toString(), x2: (defWidth - margin + 0.5).toString(), y2: ((startPointY - topY) / 2 + topY).toString(), stroke: this.opts.stroke || "", "stroke-width": this.opts.strokeWidth?.toString() || "", })); // append Y axis line at bottom in gPath gPath.appendChild(this.makeSVG("line", { x1: (startPointX - 0.5).toString(), y1: startPointY.toString(), x2: (defWidth - margin + 0.5).toString(), y2: startPointY.toString(), stroke: this.opts.stroke || "", "stroke-width": this.opts.strokeWidth?.toString() || "", })); // append X axis line 1 in gPath gPath.appendChild(this.makeSVG("line", { x1: startPointX.toString(), y1: topY.toString(), x2: startPointX.toString(), y2: startPointY.toString(), stroke: this.opts.stroke || "", "stroke-width": this.opts.strokeWidth?.toString() || "", })); // append X axis line 2 in gPath gPath.appendChild(this.makeSVG("line", { x1: (xScale * 30 + startPointX).toString(), y1: topY.toString(), x2: (xScale * 30 + startPointX).toString(), y2: startPointY.toString(), stroke: this.opts.stroke || "", "stroke-width": this.opts.strokeWidth?.toString() || "", })); // append X axis line 3 in gPath gPath.appendChild(this.makeSVG("line", { x1: (xScale * 150 + startPointX).toString(), y1: topY.toString(), x2: (xScale * 150 + startPointX).toString(), y2: startPointY.toString(), stroke: this.opts.stroke || "", "stroke-width": this.opts.strokeWidth?.toString() || "", })); // append X axis line 4 in gPath gPath.appendChild(this.makeSVG("line", { x1: (xScale * 270 + startPointX).toString(), y1: topY.toString(), x2: (xScale * 270 + startPointX).toString(), y2: startPointY.toString(), stroke: this.opts.stroke || "", "stroke-width": this.opts.strokeWidth?.toString() || "", })); // append X axis line 5 in gPath gPath.appendChild(this.makeSVG("line", { x1: (xScale * 390 + startPointX).toString(), y1: topY.toString(), x2: (xScale * 390 + startPointX).toString(), y2: startPointY.toString(), stroke: this.opts.stroke || "", "stroke-width": this.opts.strokeWidth?.toString() || "", })); // append Y scale label at bottom in gPath var textY1 = this.makeSVG("text", { x: (margin - 10).toString(), y: (startPointY - 1).toString(), id: this.opts.containerId + "_y0", }); textY1.textContent = "$" + minAxisY.toFixed(2); gPath.appendChild(textY1); // append Y scale label at middle in gPath var textY2 = this.makeSVG("text", { x: (margin - 10).toString(), y: ((startPointY - topY) / 2 + topY - 1).toString(), id: this.opts.containerId + "_y1", }); textY2.textContent = "$" + (minAxisY + (maxAxisY - minAxisY) / 2).toFixed(2); gPath.appendChild(textY2); // append gTxt element in gPath var gTxt = this.makeSVG("g", { id: this.opts.containerId + "_gTxt" }); gPath.appendChild(gTxt); // append X scale label 1 in gTxt var textX1 = this.makeSVG("text", { x: (xScale * 30 + startPointX - 20).toString(), y: (margin + 15).toString(), }); //textX1.textContent = (todayDate).getShortMonthName() + todayDate.getDate(); textX1.textContent = "10am"; gTxt.appendChild(textX1); // append X scale label 2 in gTxt var textX2 = this.makeSVG("text", { x: (xScale * 150 + startPointX - 20).toString(), y: (margin + 15).toString(), }); textX2.textContent = "12pm"; gTxt.appendChild(textX2); // append X scale label 3 in gTxt var textX3 = this.makeSVG("text", { x: (xScale * 270 + startPointX - 20).toString(), y: (margin + 15).toString(), }); textX3.textContent = "2pm"; gTxt.appendChild(textX3); // append X scale label 4 in gTxt var textX4 = this.makeSVG("text", { x: (xScale * 390 + startPointX - 35).toString(), y: (margin + 15).toString(), }); textX4.textContent = "4pm"; gTxt.appendChild(textX4); let textElements = this.shadowRoot.querySelectorAll("text"); textElements.forEach((element) => { element.setAttribute("aria-hidden", "true"); }); var d = "M" + xStart + "," + startPointY; var x, y; for (var i = 0, ci; (ci = this.opts.data[i]); i++) { if (typeof ci !== "undefined") { var currTime = this.isSafari() ? this.toJSDate(ci.T) : new Date(ci.T); var duration = (Number(currTime) - todayDate) / 1000 / 60; x = parseFloat((xStart + xScale * duration).toString()).toFixed(2); y = startPointY - Number(parseFloat(((ci.P - minAxisY) * Number(yScale)).toString()).toFixed(2)); d = d + "L" + x + "," + y; } } d = d + "L" + x + "," + startPointY + " Z"; // append path element in gPath gPath.appendChild(this.makeSVG("path", { id: this.opts.containerId + "_area", d: d, fill: this.opts.fill || "", "fill-opacity": this.opts.fillOpacity || "", })); if (this.opts.PricePreviousClose) { // append ycp orange line gPath.appendChild(this.makeSVG("line", { x1: (startPointX - 0.5).toString(), y1: (startPointY - Number(parseFloat(((this.opts.PricePreviousClose - minAxisY) * Number(yScale)).toString()).toFixed(2))).toString(), x2: (defWidth - margin + 0.5).toString(), y2: (startPointY - Number(parseFloat(((this.opts.PricePreviousClose - minAxisY) * Number(yScale)).toString()).toFixed(2))).toString(), stroke: "#FF8C00", "stroke-dasharray": "4,4", "stroke-width": this.opts.strokeWidth == null ? "1" : (this.opts.strokeWidth + 1).toString(), })); } } } } toJSDate(dateTime) { var dateTimeArr = dateTime.split(" "); var date = dateTimeArr[0].split("-"); var time = dateTimeArr[1].split(":"); return new Date(date[0], date[1], date[2], time[0], time[1], time[2], 0); } isSafari() { var is_safari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor); return is_safari; } } /* harmony default export */ const cascade_stock_ticker_StockChart = (StockChart); ;// CONCATENATED MODULE: ./src/components/cascade-stock-ticker/Chartutils.ts class ResponseModel { } class ResponseChartModel { } class ResponseChartModelPT { } class PTObj { } class ChartSeriesPT { } class ChartSeries { } class Display { } class LocalizedAttributes { } function formatDate(date) { const yyyy = date.getFullYear(); const MM = String(date.getMonth() + 1).padStart(2, "0"); // Months are zero based const dd = String(date.getDate()).padStart(2, "0"); const HH = String(date.getHours()).padStart(2, "0"); const mm = String(date.getMinutes()).padStart(2, "0"); const ss = String(date.getSeconds()).padStart(2, "0"); return `${yyyy}-${MM}-${dd} ${HH}:${mm}:${ss}`; } const options = { timeZone: "America/New_York", year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: false, }; function convertResponse(retext) { let retextJson = JSON.parse(JSON.stringify(retext)); let baseJsonObj = JSON.parse(`{ "id": "Chart1D1M:a1xzim", "PreHoursSeries": null, "AfterHoursSeries": null, "Series": { "PT": [ { "P": "", "T": "" } ], "StartTime": "", "EndTime": "" }, "PricePreviousClose": "", "ChartType": "1D1M", "ExchangeId": "r6dwop", "ExchangeCode": "XNAS", "ExchangeName": "Nasdaq Stock Market", "OfferingStatus": "regular", "DisplayName": "Microsoft Corp", "ShortName": "Microsoft", "SecurityType": "stock", "InstrumentId": "a1xzim", "Symbol": "MSFT", "Country": "US", "Market": "en-us", "LocalizedAttributes": { "enus": null }, "TimeLastUpdated": "", "Currency": "USD", "_p": "a1xzim", "_t": "Chart", "_etag": "", "_rid": "", "_self": "", "_attachments": null, "_ts": 1580839600 }`); let chartM; let intN = 0; if (retextJson && retextJson.value && retextJson.value.length > 0) { chartM = retextJson.value[0]; let series = chartM.series; /*------------------chart price data-start------------------*/ let P = series.prices; let T = series.timeStamps; baseJsonObj.Series.PT = []; for (let i = 0, j = 0; i < P.length; i++, j++) { let pto = new PTObj(); pto.P = P[i]; let dateForConvert = new Date(T[j].toString()).setHours(new Date(T[j].toString()).getHours() - intN); let dateValStr = new Intl.DateTimeFormat("en-US", options).format(dateForConvert); pto.T = formatDate(new Date(dateValStr)); baseJsonObj.Series.PT.push(pto); } /*------------------chart price data-end------------------*/ if (series != null && series.startTime != null && series.endTime != null) { //Convert all the time to Eastern Time. if (series.startTime && series.endTime) { let startDateTime = new Date(series.startTime).setHours(new Date(series.startTime).getHours() - intN); let endDateTime = new Date(series.endTime).setHours(new Date(series.endTime).getHours() - intN); let timeLastUpdated = new Date(chartM.timeLastUpdated).setHours(new Date(chartM.timeLastUpdated).getHours() - intN); baseJsonObj.Series.StartTime = new Date(startDateTime); baseJsonObj.Series.EndTime = formatDate(new Date(endDateTime)); if (new Date(startDateTime).getDate() === new Date(timeLastUpdated).getDate()) { if (new Date(timeLastUpdated).getTime() >= new Date(startDateTime).getTime() && new Date(timeLastUpdated).getTime() <= new Date(endDateTime).getTime()) { baseJsonObj.Series.EndTime = formatDate(new Date(timeLastUpdated)); } } } } baseJsonObj.PricePreviousClose = chartM.pricePreviousClose; baseJsonObj.ChartType = chartM.chartType; baseJsonObj.ExchangeId = chartM.exchangeId; baseJsonObj.DisplayName = chartM.displayName; baseJsonObj.ShortName = chartM.shortName; baseJsonObj.SecurityType = chartM.securityType; baseJsonObj.InstrumentId = chartM.instrumentId; baseJsonObj.Symbol = chartM.symbol; baseJsonObj.TimeLastUpdated = chartM.timeLastUpdated; baseJsonObj._p = chartM._p; baseJsonObj._t = chartM._t; } return JSON.stringify(baseJsonObj); } ;// CONCATENATED MODULE: ./src/components/cascade-stock-ticker/index.ts let StockTicker = class StockTicker extends WithLocalization { constructor() { super(...arguments); /** * Visibility of the control. * * @remarks * HTML Attribute: visible */ this.stockDetailsUrl = ""; this.visible = true; this.price = ""; this.price52wLow = ""; this.price52wHigh = ""; this.priceChange = ""; this.priceChangePercent = ""; this.marketCap = ""; this.volume = ""; this.timeLastUpdated = ""; this.quotesDetailsUrl = ""; this.chartDetailsUrl = ""; } quotesDataRender(dataQuote) { if (dataQuote) { const quote = dataQuote.value[0]; this.price = quote.price.toFixed(2); this.price52wLow = quote.price52wLow.toFixed(2); this.price52wHigh = quote.price52wHigh.toFixed(2); this.priceChange = quote.priceChange.toFixed(2); this.priceChangePercent = quote.priceChangePercent.toFixed(2); this.volume = (quote.accumulatedVolume / 1000000).toFixed(2); this.marketCap = (quote.marketCap / 1000000000).toFixed(2); } } async marketDataApiCall(url) { try { const response = await fetch(url); if (response.ok) { const data = await response.json(); if (Object.keys(data).length > 0) { return data; } } } catch (error) { console.log("error:", error); } } async connectedCallback() { super.connectedCallback(); this.marketDataApiCall(this.quotesDetailsUrl) .then((data) => { this.quotesDataRender(data); let quote = data.value[0]; this.marketDataApiCall(this.chartDetailsUrl) .then((data) => { data = JSON.parse(convertResponse(data)); this.chartDataRender(quote, data, this.shadowRoot); }) .catch((error) => { console.log("error:", error); }); }) .catch((error) => { console.log("error:", error); }); } // strating of the chartUtils.ts file generateStockChart(quote, shadowRoot, data) { let options = { timeZone: "America/New_York", // Specify the timezone you want to use year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: true, }; let dataJson = JSON.parse(JSON.stringify(data)); let quoteJson; if (quote) { quoteJson = JSON.parse(JSON.stringify(quote)); } let date = dataJson.Series != null && typeof dataJson.Series.EndTime !== "undefined" ? dataJson.Series.EndTime : quoteJson.datePreviousClose.toString(); this.timeLastUpdated = new Intl.DateTimeFormat("en-US", options).format(new Date(date)) + " - ET"; if (data.length == 0 || typeof data.Series == "undefined" || data.Series == null) return; var _data = []; var startTime = data.Series.PT[0].T; for (var i = 0, ci; (ci = data.Series.PT[i]); i++) { _data.push({ P: ci.P, T: i == 0 ? startTime : ci.T, }); } shadowRoot .querySelectorAll(".stock-chart-container") .forEach((element, i) => { var _id = "stock-chart-container-" + i.toString(); element.id = _id; try { var stockChart = new cascade_stock_ticker_StockChart({ containerId: _id, fill: "#5f5f5f", style: { fontSize: "18px", fill: "#424444", fontWeight: "normal", }, data: _data, PricePreviousClose: data.PricePreviousClose, }, shadowRoot); stockChart.draw(); } catch (err) { console.info(err.message); element.style.display = "none"; } }); } chartDataRender(quote, dataChart, shadowRoot) { if (dataChart) { this.generateStockChart(quote, shadowRoot, dataChart); } } render() { const formatter = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", }); const formattedPriceChange = formatter.format(parseFloat(this.priceChange)); const formattedPriceChangePercent = this.priceChangePercent + "%"; const priceChangeColor = parseFloat(this.priceChange) >= 0 ? "MicrosoftCorp_percentChange_none" : "MicrosoftCorp_percentChange"; const priceChangeSymbol = parseFloat(this.priceChange) >= 0 ? "+" : ""; return x `
$${this.price}
${priceChangeSymbol}${formattedPriceChange} (${priceChangeSymbol}${formattedPriceChangePercent})
stock details table
Volume ${this.volume} Mil
Market Cap ${this.marketCap} Bil
52 Week High ${this.price52wHigh}
52 Week Low ${this.price52wLow}
`; } }; StockTicker.styles = [cascade_stock_ticker_styles]; StockTicker.dict = { localizedtText: "Default English Version", }; __decorate([ property_n({ type: String }) ], StockTicker.prototype, "stockDetailsUrl", void 0); __decorate([ property_n({ attribute: "visible", type: Boolean }) ], StockTicker.prototype, "visible", void 0); __decorate([ property_n({ type: String }) ], StockTicker.prototype, "price", void 0); __decorate([ property_n({ type: String }) ], StockTicker.prototype, "price52wLow", void 0); __decorate([ property_n({ type: String }) ], StockTicker.prototype, "price52wHigh", void 0); __decorate([ property_n({ type: String }) ], StockTicker.prototype, "priceChange", void 0); __decorate([ property_n({ type: String }) ], StockTicker.prototype, "priceChangePercent", void 0); __decorate([ property_n({ type: String }) ], StockTicker.prototype, "marketCap", void 0); __decorate([ property_n({ type: String }) ], StockTicker.prototype, "volume", void 0); __decorate([ property_n({ type: String }) ], StockTicker.prototype, "timeLastUpdated", void 0); __decorate([ property_n({ type: String }) ], StockTicker.prototype, "quotesDetailsUrl", void 0); __decorate([ property_n({ type: String }) ], StockTicker.prototype, "chartDetailsUrl", void 0); StockTicker = __decorate([ defineCustomElement("cascade-stock-ticker") ], StockTicker); /******/ return __webpack_exports__; /******/ })() ; }); //# sourceMappingURL=cascade-stock-ticker.min.js.map