gt-react 10.19.7 → 10.19.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/browser.cjs.min.cjs +1 -1
- package/dist/browser.cjs.min.cjs.map +1 -1
- package/dist/browser.esm.min.mjs +1 -1
- package/dist/browser.esm.min.mjs.map +1 -1
- package/dist/i18n-context/browser-i18n-manager/BrowserI18nManager.d.ts.map +1 -1
- package/dist/i18n-context/browser-i18n-manager/utils/determineLocale.d.ts.map +1 -1
- package/dist/macros.cjs.min.cjs +1 -1
- package/dist/macros.cjs.min.cjs.map +1 -1
- package/dist/macros.esm.min.mjs +1 -1
- package/dist/macros.esm.min.mjs.map +1 -1
- package/dist/shared/messages.d.ts +1 -0
- package/dist/shared/messages.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserI18nManager.d.ts","sourceRoot":"","sources":["../../../src/i18n-context/browser-i18n-manager/BrowserI18nManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"BrowserI18nManager.d.ts","sourceRoot":"","sources":["../../../src/i18n-context/browser-i18n-manager/BrowserI18nManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAG9E;;GAEG;AACH,KAAK,mCAAmC,GACtC,4BAA4B,CAAC,qBAAqB,CAAC,GAAG;IACpD,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC,CAAC;AAEJ;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,WAAW,CACjD,qBAAqB,EACrB,WAAW,CACZ;IACC,yCAAyC;IACzC,OAAO,CAAC,cAAc,CAAC,CAAiB;IAExC,iEAAiE;IACjE,OAAO,CAAC,mBAAmB,CAAgD;IAE3E,gEAAgE;IAChE,OAAO,CAAC,gBAAgB,CAAS;gBAErB,MAAM,EAAE,mCAAmC;IAmDvD;;OAEG;IACH,iBAAiB,IAAI,OAAO;IAI5B;;;OAGG;IACH,SAAS,IAAI,MAAM;IAInB;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK/B;;;;OAIG;IACH,+BAA+B,CAC7B,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GACjC,4BAA4B,GAAG,SAAS;IAa3C;;OAEG;IACH,aAAa,CACX,cAAc,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAA;KAAE,GAAG,cAAc,GACvE,IAAI;CA4BR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"determineLocale.d.ts","sourceRoot":"","sources":["../../../../src/i18n-context/browser-i18n-manager/utils/determineLocale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,aAAa,EACb,OAAO,EACP,aAAa,EACb,gBAA0C,EAC1C,SAAS,GACV,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"determineLocale.d.ts","sourceRoot":"","sources":["../../../../src/i18n-context/browser-i18n-manager/utils/determineLocale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,aAAa,EACb,OAAO,EACP,aAAa,EACb,gBAA0C,EAC1C,SAAS,GACV,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GAAG,MAAM,CAoCT"}
|
package/dist/macros.cjs.min.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("generaltranslation/core"),t=require("generaltranslation");const r="en",n="https://cdn.gtx.dev";function o(e){if(void 0===e)return;if(null===e)return"null";if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(let r=0;r<e.length;r++)r&&(t+=","),t+=o(e[r])||"null";return t+"]"}const t=Object.keys(e).sort();let r="";for(const n of t){const t=o(e[n]);t&&(r&&(r+=","),r+=JSON.stringify(n)+":"+t)}return"{"+r+"}"}function i(e){return o(e)??""}function s(e,t,r=""){const n=(o=e)instanceof Uint8Array||ArrayBuffer.isView(o)&&"Uint8Array"===o.constructor.name&&"BYTES_PER_ELEMENT"in o&&1===o.BYTES_PER_ELEMENT;var o;const i=e?.length;if(!n||void 0!==t){const t=(r&&`"${r}" `)+"expected Uint8Array"+""+", got "+(n?`length=${i}`:"type="+typeof e);if(!n)throw new TypeError(t);throw new RangeError(t)}return e}function a(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function c(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function l(e,t){return e<<32-t|e>>>t}const u=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),f=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function p(e,t={}){const r=(t,r)=>e(r).update(t).digest(),n=e(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.canXOF=n.canXOF,r.create=t=>e(t),Object.assign(r,t),Object.freeze(r)}const d=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function g(e,t,r){return e&t^~e&r}function m(e,t,r){return e&t^e&r^t&r}class y{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,n){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=h(this.buffer)}update(e){a(this),s(e);const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let i=0;i<o;){const s=Math.min(n-this.pos,o-i);if(s===n){const t=h(e);for(;n<=o-i;i+=n)this.process(t,i);continue}r.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){a(this),function(e,t){s(e,void 0,"digestInto() output");const r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:i}=this;t[i++]=128,c(this.buffer.subarray(i)),this.padOffset>n-i&&(this.process(r,0),i=0);for(let e=i;e<n;e++)t[e]=0;r.setBigUint64(n-8,BigInt(8*this.length),o),this.process(r,0);const l=h(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const f=u/4,p=this.get();if(f>p.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<f;e++)l.setUint32(4*e,p[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:s}=this;return e.destroyed=i,e.finished=o,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const b=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),E=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),_=new Uint32Array(64);class v extends y{constructor(e){super(64,e,8,!1)}get(){const{A:e,B:t,C:r,D:n,E:o,F:i,G:s,H:a}=this;return[e,t,r,n,o,i,s,a]}set(e,t,r,n,o,i,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|i,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)_[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=_[e-15],r=_[e-2],n=l(t,7)^l(t,18)^t>>>3,o=l(r,17)^l(r,19)^r>>>10;_[e]=o+_[e-7]+n+_[e-16]|0}let{A:r,B:n,C:o,D:i,E:s,F:a,G:c,H:h}=this;for(let e=0;e<64;e++){const t=h+(l(s,6)^l(s,11)^l(s,25))+g(s,a,c)+E[e]+_[e]|0,u=(l(r,2)^l(r,13)^l(r,22))+m(r,n,o)|0;h=c,c=a,a=s,s=i+t|0,i=o,o=n,n=r,r=t+u|0}r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,i=i+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,h=h+this.H|0,this.set(r,n,o,i,s,a,c,h)}roundClean(){c(_)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),c(this.buffer)}}class T extends v{A=0|b[0];B=0|b[1];C=0|b[2];D=0|b[3];E=0|b[4];F=0|b[5];G=0|b[6];H=0|b[7];constructor(){super(32)}}const H=p(()=>new T,d(1));var B=function(e,t){return B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},B(e,t)};function L(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var w=function(){return w=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},w.apply(this,arguments)};function A(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function C(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function P(e,t){return function(r,n){t(r,n,e)}}function S(e,t,r,n,o,i){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,c=n.kind,h="getter"===c?"get":"setter"===c?"set":"value",l=!t&&e?n.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f=!1,p=r.length-1;p>=0;p--){var d={};for(var g in n)d[g]="access"===g?{}:n[g];for(var g in n.access)d.access[g]=n.access[g];d.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(e||null))};var m=(0,r[p])("accessor"===c?{get:u.get,set:u.set}:u[h],d);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=s(m.get))&&(u.get=a),(a=s(m.set))&&(u.set=a),(a=s(m.init))&&o.unshift(a)}else(a=s(m))&&("field"===c?o.unshift(a):u[h]=a)}l&&Object.defineProperty(l,n.name,u),f=!0}function I(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function M(e){return"symbol"==typeof e?e:"".concat(e)}function O(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function R(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function N(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})}function U(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}var G=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function D(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||G(t,e,r)}function k(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function j(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function x(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(j(arguments[t]));return e}function F(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n}function K(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function $(e){return this instanceof $?(this.v=e,this):new $(e)}function V(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",function(e){return function(t){return Promise.resolve(t).then(e,h)}}),n[Symbol.asyncIterator]=function(){return this},n;function s(e,t){o[e]&&(n[e]=function(t){return new Promise(function(r,n){i.push([e,t,r,n])>1||a(e,t)})},t&&(n[e]=t(n[e])))}function a(e,t){try{(r=o[e](t)).value instanceof $?Promise.resolve(r.value.v).then(c,h):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function c(e){a("next",e)}function h(e){a("throw",e)}function l(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function X(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:$(e[n](t)),done:!1}:o?o(t):t}:o}}function Y(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=k(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,o){(function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)})(n,o,(t=e[r](t)).done,t.value)})}}}function q(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var W=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},Z=function(e){return Z=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},Z(e)};function z(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Z(e),n=0;n<r.length;n++)"default"!==r[n]&&G(t,e,r[n]);return W(t,e),t}function Q(e){return e&&e.__esModule?e:{default:e}}function J(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function ee(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function te(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function re(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var ne="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function oe(e){function t(t){e.error=e.hasError?new ne(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function o(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(e){return t(e),o()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function ie(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,r,n,o,i){return r?t?".jsx":".js":!n||o&&i?n+o+"."+i.toLowerCase()+"js":e}):e}var se,ae,ce,he={__extends:L,__assign:w,__rest:A,__decorate:C,__param:P,__esDecorate:S,__runInitializers:I,__propKey:M,__setFunctionName:O,__metadata:R,__awaiter:N,__generator:U,__createBinding:G,__exportStar:D,__values:k,__read:j,__spread:x,__spreadArrays:F,__spreadArray:K,__await:$,__asyncGenerator:V,__asyncDelegator:X,__asyncValues:Y,__makeTemplateObject:q,__importStar:z,__importDefault:Q,__classPrivateFieldGet:J,__classPrivateFieldSet:ee,__classPrivateFieldIn:te,__addDisposableResource:re,__disposeResources:oe,__rewriteRelativeImportExtension:ie},le=Object.freeze({__proto__:null,__addDisposableResource:re,get __assign(){return w},__asyncDelegator:X,__asyncGenerator:V,__asyncValues:Y,__await:$,__awaiter:N,__classPrivateFieldGet:J,__classPrivateFieldIn:te,__classPrivateFieldSet:ee,__createBinding:G,__decorate:C,__disposeResources:oe,__esDecorate:S,__exportStar:D,__extends:L,__generator:U,__importDefault:Q,__importStar:z,__makeTemplateObject:q,__metadata:R,__param:P,__propKey:M,__read:j,__rest:A,__rewriteRelativeImportExtension:ie,__runInitializers:I,__setFunctionName:O,__spread:x,__spreadArray:K,__spreadArrays:F,__values:k,default:he});!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(se||(se={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(ae||(ae={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(ce||(ce={}));var ue=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,fe=/(?:[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;function pe(e){var t={};return e.replace(fe,function(e){var r=e.length;switch(e[0]){case"G":t.era=4===r?"long":5===r?"narrow":"short";break;case"y":t.year=2===r?"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");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===r?"long":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-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");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var de=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function ge(e){return e.replace(/^(.*?)-/,"")}var me=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,ye=/^(@+)?(\+|#+)?[rs]?$/g,be=/(\*)(0+)|(#+)(0+)|(0+)/g,Ee=/^(0+)$/;function _e(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(ye,function(e,r,n){return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""}),t}function ve(e){switch(e){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 Te(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!Ee.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function He(e){var t=ve(e);return t||{}}function Be(e){for(var t={},r=0,n=e;r<n.length;r++){var o=n[r];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=ge(o.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=w(w(w({},t),{notation:"scientific"}),o.options.reduce(function(e,t){return w(w({},e),He(t))},{}));continue;case"engineering":t=w(w(w({},t),{notation:"engineering"}),o.options.reduce(function(e,t){return w(w({},e),He(t))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(be,function(e,r,n,o,i,s){if(r)t.minimumIntegerDigits=n.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Ee.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(me.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(me,function(e,r,n,o,i,s){return"*"===n?t.minimumFractionDigits=r.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&s?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+s.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});var i=o.options[0];"w"===i?t=w(w({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=w(w({},t),_e(i)))}else if(ye.test(o.stem))t=w(w({},t),_e(o.stem));else{var s=ve(o.stem);s&&(t=w(w({},t),s));var a=Te(o.stem);a&&(t=w(w({},t),a))}}return t}var Le,we={"001":["H","h"],419:["h","H","hB","hb"],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","H","hB","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","H","hB","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","H","hB","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"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["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"]};function Ae(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r,n=e.language;return"root"!==n&&(r=e.maximize().region),(we[r||""]||we[n||""]||we["".concat(n,"-001")]||we["001"])[0]}var Ce=new RegExp("^".concat(ue.source,"*")),Pe=new RegExp("".concat(ue.source,"*$"));function Se(e,t){return{start:e,end:t}}var Ie=!!String.prototype.startsWith&&"_a".startsWith("a",1),Me=!!String.fromCodePoint,Oe=!!Object.fromEntries,Re=!!String.prototype.codePointAt,Ne=!!String.prototype.trimStart,Ue=!!String.prototype.trimEnd,Ge=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},De=!0;try{De="a"===(null===(Le=Xe("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===Le?void 0:Le[0])}catch(e){De=!1}var ke,je=Ie?function(e,t,r){return e.startsWith(t,r)}:function(e,t,r){return e.slice(r,r+t.length)===t},xe=Me?String.fromCodePoint:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r,n="",o=e.length,i=0;o>i;){if((r=e[i++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},Fe=Oe?Object.fromEntries:function(e){for(var t={},r=0,n=e;r<n.length;r++){var o=n[r],i=o[0],s=o[1];t[i]=s}return t},Ke=Re?function(e,t){return e.codePointAt(t)}:function(e,t){var r=e.length;if(!(t<0||t>=r)){var n,o=e.charCodeAt(t);return o<55296||o>56319||t+1===r||(n=e.charCodeAt(t+1))<56320||n>57343?o:n-56320+(o-55296<<10)+65536}},$e=Ne?function(e){return e.trimStart()}:function(e){return e.replace(Ce,"")},Ve=Ue?function(e){return e.trimEnd()}:function(e){return e.replace(Pe,"")};function Xe(e,t){return new RegExp(e,t)}if(De){var Ye=Xe("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");ke=function(e,t){var r;return Ye.lastIndex=t,null!==(r=Ye.exec(e)[1])&&void 0!==r?r:""}}else ke=function(e,t){for(var r=[];;){var n=Ke(e,t);if(void 0===n||ze(n)||Qe(n))break;r.push(n),t+=n>=65536?2:1}return xe.apply(void 0,r)};var qe=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,r){for(var n=[];!this.isEOF();){var o=this.char();if(123===o){if((i=this.parseArgument(e,r)).err)return i;n.push(i.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(se.UNMATCHED_CLOSING_TAG,Se(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&We(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;n.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;n.push(i.val)}}else{var s=this.clonePosition();this.bump(),n.push({type:ae.pound,location:Se(s,this.clonePosition())})}}}return{val:n,err:null}},e.prototype.parseTag=function(e,t){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:ae.literal,value:"<".concat(n,"/>"),location:Se(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var i=o.val,s=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!We(this.char()))return this.error(se.INVALID_TAG,Se(s,this.clonePosition()));var a=this.clonePosition();return n!==this.parseTagName()?this.error(se.UNMATCHED_CLOSING_TAG,Se(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:ae.tag,value:n,children:i,location:Se(r,this.clonePosition())},err:null}:this.error(se.INVALID_TAG,Se(s,this.clonePosition())))}return this.error(se.UNCLOSED_TAG,Se(r,this.clonePosition()))}return this.error(se.INVALID_TAG,Se(r,this.clonePosition()))},e.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&Ze(this.char());)this.bump();return this.message.slice(e,this.offset())},e.prototype.parseLiteral=function(e,t){for(var r=this.clonePosition(),n="";;){var o=this.tryParseQuote(t);if(o)n+=o;else{var i=this.tryParseUnquoted(e,t);if(i)n+=i;else{var s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}}}var a=Se(r,this.clonePosition());return{val:{type:ae.literal,value:n,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(We(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(r);this.bump()}return xe.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),xe(r))},e.prototype.parseArgument=function(e,t){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(se.EXPECT_ARGUMENT_CLOSING_BRACE,Se(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(se.EMPTY_ARGUMENT,Se(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(se.MALFORMED_ARGUMENT,Se(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(se.EXPECT_ARGUMENT_CLOSING_BRACE,Se(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:ae.argument,value:n,location:Se(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(se.EXPECT_ARGUMENT_CLOSING_BRACE,Se(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(se.MALFORMED_ARGUMENT,Se(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),r=ke(this.message,t),n=t+r.length;return this.bumpTo(n),{value:r,location:Se(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,r,n){var o,i=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(s){case"":return this.error(se.EXPECT_ARGUMENT_TYPE,Se(i,a));case"number":case"date":case"time":this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var h=this.clonePosition();if((y=this.parseSimpleArgStyleIfPossible()).err)return y;if(0===(p=Ve(y.val)).length)return this.error(se.EXPECT_ARGUMENT_STYLE,Se(this.clonePosition(),this.clonePosition()));c={style:p,styleLocation:Se(h,this.clonePosition())}}if((b=this.tryParseArgumentClose(n)).err)return b;var l=Se(n,this.clonePosition());if(c&&je(null==c?void 0:c.style,"::",0)){var u=$e(c.style.slice(2));if("number"===s)return(y=this.parseNumberSkeletonFromString(u,c.styleLocation)).err?y:{val:{type:ae.number,value:r,location:l,style:y.val},err:null};if(0===u.length)return this.error(se.EXPECT_DATE_TIME_SKELETON,l);var f=u;this.locale&&(f=function(e,t){for(var r="",n=0;n<e.length;n++){var o=e.charAt(n);if("j"===o){for(var i=0;n+1<e.length&&e.charAt(n+1)===o;)i++,n++;var s=1+(1&i),a=i<2?1:3+(i>>1),c=Ae(t);for("H"!=c&&"k"!=c||(a=0);a-- >0;)r+="a";for(;s-- >0;)r=c+r}else r+="J"===o?"H":o}return r}(u,this.locale));var p={type:ce.dateTime,pattern:f,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?pe(f):{}};return{val:{type:"date"===s?ae.date:ae.time,value:r,location:l,style:p},err:null}}return{val:{type:"number"===s?ae.number:"date"===s?ae.date:ae.time,value:r,location:l,style:null!==(o=null==c?void 0:c.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":var d=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(se.EXPECT_SELECT_ARGUMENT_OPTIONS,Se(d,w({},d)));this.bumpSpace();var g=this.parseIdentifierIfPossible(),m=0;if("select"!==s&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(se.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Se(this.clonePosition(),this.clonePosition()));var y;if(this.bumpSpace(),(y=this.tryParseDecimalInteger(se.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,se.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return y;this.bumpSpace(),g=this.parseIdentifierIfPossible(),m=y.val}var b,E=this.tryParsePluralOrSelectOptions(e,s,t,g);if(E.err)return E;if((b=this.tryParseArgumentClose(n)).err)return b;var _=Se(n,this.clonePosition());return"select"===s?{val:{type:ae.select,value:r,options:Fe(E.val),location:_},err:null}:{val:{type:ae.plural,value:r,options:Fe(E.val),offset:m,pluralType:"plural"===s?"cardinal":"ordinal",location:_},err:null};default:return this.error(se.INVALID_ARGUMENT_TYPE,Se(i,a))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(se.EXPECT_ARGUMENT_CLOSING_BRACE,Se(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(se.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Se(r,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var r=[];try{r=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],r=0,n=e.split(de).filter(function(e){return e.length>0});r<n.length;r++){var o=n[r].split("/");if(0===o.length)throw new Error("Invalid number skeleton");for(var i=o[0],s=o.slice(1),a=0,c=s;a<c.length;a++)if(0===c[a].length)throw new Error("Invalid number skeleton");t.push({stem:i,options:s})}return t}(e)}catch(e){return this.error(se.INVALID_NUMBER_SKELETON,t)}return{val:{type:ce.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?Be(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,r,n){for(var o,i=!1,s=[],a=new Set,c=n.value,h=n.location;;){if(0===c.length){var l=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var u=this.tryParseDecimalInteger(se.EXPECT_PLURAL_ARGUMENT_SELECTOR,se.INVALID_PLURAL_ARGUMENT_SELECTOR);if(u.err)return u;h=Se(l,this.clonePosition()),c=this.message.slice(l.offset,this.offset())}if(a.has(c))return this.error("select"===t?se.DUPLICATE_SELECT_ARGUMENT_SELECTOR:se.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,h);"other"===c&&(i=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?se.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:se.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Se(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(e+1,t,r);if(p.err)return p;var d=this.tryParseArgumentClose(f);if(d.err)return d;s.push([c,{value:p.val,location:Se(f,this.clonePosition())}]),a.add(c),this.bumpSpace(),c=(o=this.parseIdentifierIfPossible()).value,h=o.location}return 0===s.length?this.error("select"===t?se.EXPECT_SELECT_ARGUMENT_SELECTOR:se.EXPECT_PLURAL_ARGUMENT_SELECTOR,Se(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(se.MISSING_OTHER_CLAUSE,Se(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var r=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var o=!1,i=0;!this.isEOF();){var s=this.char();if(!(s>=48&&s<=57))break;o=!0,i=10*i+(s-48),this.bump()}var a=Se(n,this.clonePosition());return o?Ge(i*=r)?{val:i,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Ke(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(je(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&ze(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),r=this.message.charCodeAt(t+(e>=65536?2:1));return null!=r?r:null},e}();function We(e){return e>=97&&e<=122||e>=65&&e<=90}function Ze(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function ze(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Qe(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function Je(e){e.forEach(function(e){if(delete e.location,function(e){return e.type===ae.select}(e)||function(e){return e.type===ae.plural}(e))for(var t in e.options)delete e.options[t].location,Je(e.options[t].value);else(function(e){return e.type===ae.number})(e)&&function(e){return!(!e||"object"!=typeof e||e.type!==ce.number)}(e.style)?delete e.style.location:!function(e){return e.type===ae.date}(e)&&!function(e){return e.type===ae.time}(e)||!function(e){return!(!e||"object"!=typeof e||e.type!==ce.dateTime)}(e.style)?function(e){return e.type===ae.tag}(e)&&Je(e.children):delete e.style.location})}function et(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){var r=!1;try{r=this instanceof e}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var tt,rt={};function nt(){if(tt)return rt;var e,t;return tt=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.SKELETON_TYPE=rt.TYPE=void 0,rt.isLiteralElement=function(t){return t.type===e.literal},rt.isArgumentElement=function(t){return t.type===e.argument},rt.isNumberElement=function(t){return t.type===e.number},rt.isDateElement=function(t){return t.type===e.date},rt.isTimeElement=function(t){return t.type===e.time},rt.isSelectElement=function(t){return t.type===e.select},rt.isPluralElement=function(t){return t.type===e.plural},rt.isPoundElement=function(t){return t.type===e.pound},rt.isTagElement=function(t){return t.type===e.tag},rt.isNumberSkeleton=function(e){return!(!e||"object"!=typeof e||e.type!==t.number)},rt.isDateTimeSkeleton=function(e){return!(!e||"object"!=typeof e||e.type!==t.dateTime)},rt.createLiteralElement=function(t){return{type:e.literal,value:t}},rt.createNumberElement=function(t,r){return{type:e.number,value:t,style:r}},function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(e||(rt.TYPE=e={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(t||(rt.SKELETON_TYPE=t={})),rt}var ot,it=nt(),st={},at=et(le);var ct=function(){if(ot)return st;ot=1,Object.defineProperty(st,"__esModule",{value:!0}),st.printAST=r,st.doPrintAST=n,st.printDateTimeSkeleton=s;var e=at,t=nt();function r(e){return n(e,!1)}function n(a,c){var h=a.map(function(h,l){return(0,t.isLiteralElement)(h)?function(e,t,r,n){var i=e.value,s=i;r||"'"!==s[0]||(s="''".concat(s.slice(1)));n||"'"!==s[s.length-1]||(s="".concat(s.slice(0,s.length-1),"''"));return s=o(s),t?s.replace("#","'#'"):s}(h,c,0===l,l===a.length-1):(0,t.isArgumentElement)(h)?function(e){var t=e.value;return"{".concat(t,"}")}(h):(0,t.isDateElement)(h)||(0,t.isTimeElement)(h)||(0,t.isNumberElement)(h)?function(e){return"{".concat(e.value,", ").concat(t.TYPE[e.type]).concat(e.style?", ".concat((r=e.style,"string"==typeof r?o(r):r.type===t.SKELETON_TYPE.dateTime?"::".concat(s(r)):"::".concat(r.tokens.map(i).join(" ")))):"","}");var r}(h):(0,t.isPluralElement)(h)?function(t){var r="cardinal"===t.pluralType?"plural":"selectordinal",o=[t.value,r,e.__spreadArray([t.offset?"offset:".concat(t.offset):""],Object.keys(t.options).map(function(e){return"".concat(e,"{").concat(n(t.options[e].value,!0),"}")}),!0).filter(Boolean).join(" ")].join(",");return"{".concat(o,"}")}(h):(0,t.isSelectElement)(h)?function(e){var t=[e.value,"select",Object.keys(e.options).map(function(t){return"".concat(t,"{").concat(n(e.options[t].value,!1),"}")}).join(" ")].join(",");return"{".concat(t,"}")}(h):(0,t.isPoundElement)(h)?"#":(0,t.isTagElement)(h)?function(e){return"<".concat(e.value,">").concat(r(e.children),"</").concat(e.value,">")}(h):void 0});return h.join("")}function o(e){return e.replace(/([{}](?:[\s\S]*[{}])?)/,"'$1'")}function i(e){var t=e.stem,r=e.options;return 0===r.length?t:"".concat(t).concat(r.map(function(e){return"/".concat(e)}).join(""))}function s(e){return e.pattern}return st}();function ht({icuString:e,shouldVisit:t,visitor:r,options:{recurseIntoVisited:n=!0,...o}}){const i=function(e,t){void 0===t&&(t={}),t=w({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new qe(e,t).parse();if(r.err){var n=SyntaxError(se[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return(null==t?void 0:t.captureLocation)||Je(r.val),r.val}(e,o);return s(i),i;function s(e){e.map(a)}function a(e){let o=!1;t(e)&&(r(e),o=!0),o&&!n||(e.type===ae.select||e.type===ae.plural?Object.values(e.options).map(e=>e.value).map(s):e.type===ae.tag&&s(e.children))}}const lt="_gt_",ut=new RegExp(`^${lt}\\d+$`),ft=new RegExp(`^${lt}$`);function pt(e){return e.type===it.TYPE.select&&ut.test(e.value)&&!!e.options.other&&(0===e.options.other.value.length||e.options.other.value.length>0&&e.options.other.value[0]?.type===it.TYPE.literal)}function dt(e){return e.type===it.TYPE.select&&ft.test(e.value)&&!!e.options.other&&(0===e.options.other.value.length||e.options.other.value.length>0&&e.options.other.value[0]?.type===it.TYPE.literal)}function gt(e){if(!e.includes("_gt_"))return e;const t=[];ht({icuString:e,shouldVisit:dt,visitor:function(e){t.push({start:e.location?.start.offset??0,end:e.location?.end.offset??0,otherStart:e.options.other.location?.start.offset??0,otherEnd:e.options.other.location?.end.offset??0})},options:{recurseIntoVisited:!1,captureLocation:!0}});const r=[];let n=0;for(let o=0;o<t.length;o++){const{start:i,end:s,otherStart:a,otherEnd:c}=t[o];r.push(e.slice(n,i)),r.push(e.slice(i,i+4+1)),r.push(String(o+1)),r.push(e.slice(i+4+1,a)),r.push("{}"),r.push(e.slice(c,s)),n=s}return r.push(e.slice(n,e.length)),r.join("")}var mt={warn(e){console.warn(e)},error(e){console.error(e)},info(e){console.info(e)},debug(e){console.debug(e)}};const yt=e=>`String interpolation failed for message: "${e}".`;function bt(t,r){if(!t)return t;const n=r.$_fallback,o=function(e){return Object.fromEntries(Object.entries(e).filter(([e])=>"$id"!==e&&"$context"!==e&&"$maxChars"!==e&&"$hash"!==e&&"$_hash"!==e&&"$_source"!==e&&"$_fallback"!==e&&"$format"!==e&&"$_locales"!==e&&"$locale"!==e))}(r);try{const s=function(e){if(!e.includes("_gt_"))return{};let t=1;const r={};return ht({icuString:e,shouldVisit:dt,visitor:function(e){r[e.value+t]=e.options.other.value.length?e.options.other.value[0]?.value:"",t+=1},options:{recurseIntoVisited:!1}}),r}(n||"");return e.formatCutoff(function(t,r,n,o){try{return e.formatMessage(t,{variables:r,locales:n,dataFormat:o})}catch{return mt.warn(yt(t)),t}}(Object.keys(s).length?(i=t).includes("_gt_")?ct.printAST(ht({icuString:i,shouldVisit:pt,visitor:function(e){e.type=it.TYPE.argument,delete e.options},options:{recurseIntoVisited:!1}})):i:t,{...o,...s,[lt]:"other"},r.$locale??r.$_locales,r.$format),{maxChars:r.$maxChars})}catch{return mt.warn(yt(t)),null!=r.$_fallback?bt(r.$_fallback,{...r,$_fallback:void 0}):e.formatCutoff(t,{maxChars:r.$maxChars})}var i}function Et(e){return function(e){if(s(e),u)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=f[e[r]];return t}(H(function(e){if("string"!=typeof e)throw new TypeError("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e))).slice(0,16)}const _t=e=>{if(e&&"object"==typeof e){const t={};if("c"in e&&e.c&&(t.c=vt(e.c)),"d"in e){const r=e?.d;r?.b&&(t.b=Object.fromEntries(Object.entries(r.b).map(([e,t])=>[e,vt(t)]))),r?.t&&(t.t=r.t)}return function(e){const t=e;if(t&&"object"==typeof t&&"string"==typeof t.k){const e=Object.keys(t);if(1===e.length)return!0;if(2===e.length){if("number"==typeof t.i)return!0;if("string"==typeof t.v)return!0}if(3===e.length&&"string"==typeof t.v&&"number"==typeof t.i)return!0}return!1}(e)?{k:e.k,...e.v&&{v:e.v}}:t}return e};function vt(e){return Array.isArray(e)?e.map(_t):_t(e)}function Tt(e){return e.loadTranslations?"custom":e.cacheUrl?"remote":void 0!==e.cacheUrl&&e.cacheUrl!==n||!e.projectId?"disabled":"gt-remote"}function Ht(e){return void 0!==e.runtimeUrl&&"https://runtime2.gtx.dev"!==e.runtimeUrl||!e.projectId||!e.devApiKey&&!e.apiKey?e.runtimeUrl?"custom":"disabled":"gt"}function Bt(e){return"gt-remote"===Tt(e)||"gt"===Ht(e)}function Lt(t){const r=[];return r.push(...function(e){const t=[],{projectId:r,loadTranslations:n}=e;switch(Tt(e)){case"remote":case"gt-remote":r||t.push({type:"warning",message:"projectId is required when loading translations from a remote store"});break;case"custom":n||t.push({type:"error",message:"loadTranslations is required when loading translations from a custom loader"})}return t}(t)),r.push(...function(e){const t=[];switch(Ht(e)){case"custom":case"gt":e.projectId||t.push({type:"warning",message:"projectId is required"}),e.devApiKey||e.apiKey||t.push({type:"warning",message:"devApiKey or apiKey is required"})}return t}(t)),r.push(...function(t){const r=[];if(!Bt(t))return r;const{defaultLocale:n,locales:o,customMapping:i}=t;return new Set([...n?[n]:[],...o||[]]).forEach(t=>{e.isValidLocale(t,i)||r.push({type:"error",message:`Invalid locale: ${t}`})}),r}(t)),r}var wt=class{};var At=class extends wt{constructor(...e){super(...e),this.type="fallback-storage-adapter",this.storage={}}getItem(e){return this.storage[e]}setItem(e,t){this.storage[e]=t}removeItem(e){delete this.storage[e]}};function Ct(t){const r=function(e){const{cacheUrl:t=n,projectId:r,_versionId:o,_branchId:i}=e;return`${t}/${r}/[locale]`+(o?`/${o}`:"")+(i?`?branchId=${i}`:"")}(t);return async n=>{n=e.resolveCanonicalLocale(n,t.customMapping);const o=r.replace("[locale]",n),i=await fetch(o);if(!i.ok)throw new Error(`Failed to load translations from ${o}`);return await i.json()}}var Pt=class{constructor(e,t){this.cache={},this.fallbackPromises={},this.cache=structuredClone(e),this.onHit=t?.onHit,this.onMiss=t?.onMiss}setCache(e,t){this.cache[e]=t}getCache(e){const t=this.genKey(e);return this.cache[t]}getInternalCache(){return this.cache}async missCache(e){const t=this.genKey(e);if(void 0!==this.fallbackPromises[t])return await this.fallbackPromises[t];const r=this.fallback(e);this.fallbackPromises[t]=r;try{const e=await r;return this.cache[t]=e,e}finally{delete this.fallbackPromises[t]}}};function St(e,t){return function({source:e,context:t,id:r,maxChars:n,dataFormat:o},s=Et){let a;return a="JSX"===o?vt(e):e,s(i({source:a,...r&&{id:r},...t&&{context:t},...null!=n&&{maxChars:Math.abs(n)},...o&&{dataFormat:o}}))}({source:"ICU"===t.$format?gt(e):e,...t?.$context&&{context:t.$context},...t?.$id&&{id:t.$id},..."$maxChars"in t&&null!=t.$maxChars&&{maxChars:Math.abs(t.$maxChars)},dataFormat:t.$format})}var It=class extends Pt{constructor({init:e,translateMany:t,lifecycle:r}){super(e,r),this._queue=[],this._batchTimer=null,this._activeRequests=0,this._translateMany=t}get(e){const t=this.getCache(e);return null!=t&&this.onHit&&this.onHit({inputKey:e,cacheKey:this.genKey(e),cacheValue:t,outputValue:t}),t}async miss(e){const t=await this.missCache(e);return null!=t&&this.onMiss&&this.onMiss({inputKey:e,cacheKey:this.genKey(e),cacheValue:t,outputValue:t}),t}genKey(e){return St(e.message,e.options)}fallback(e){const t=this._enqueueTranslation(e);return this._queue.length>=25?this._flushNow():this._scheduleBatch(),t}_flushNow(){this._batchTimer&&(clearTimeout(this._batchTimer),this._batchTimer=null),this._drainQueue()}_scheduleBatch(){this._batchTimer||(this._batchTimer=setTimeout(()=>{this._batchTimer=null,this._drainQueue()},50))}_drainQueue(){for(;this._queue.length>0&&this._activeRequests<100;){const e=this._queue.splice(0,25);this._sendBatchRequest(e)}this._queue.length>0&&this._scheduleBatch()}_enqueueTranslation(e){const t=this.genKey(e),r=e.options;return new Promise((n,o)=>{this._queue.push({key:t,source:e.message,metadata:{...r?.$context&&{context:r.$context},...r?.$id&&{id:r.$id},..."$maxChars"in r&&null!=r.$maxChars&&{$maxChars:Math.abs(r.$maxChars)},dataFormat:r.$format},resolve:e=>n(e),reject:o})})}async _sendBatchRequest(e){this._activeRequests++;const t=function(e){return e.reduce((e,t)=>(e[t.key]={source:t.source,metadata:t.metadata},e),{})}(e),r=await this._sendBatchRequestWithErrorHandling(e,t);r&&this._handleTranslationResponse(e,r),this._activeRequests--}async _sendBatchRequestWithErrorHandling(e,t){try{return await this._translateMany(t)}catch(t){for(const r of e)r.reject(t);return}}_handleTranslationResponse(e,t){for(const r of e){const{key:e}=r,n=t[e];if(n&&n.success){const t=n.translation;this.setCache(e,t),r.resolve(t)}else r.reject(n?.error)}}};var Mt=class extends Pt{constructor({init:e={},ttl:t,loadTranslations:r,createTranslateMany:n,lifecycle:{onLocalesCacheHit:o,onLocalesCacheMiss:i,onTranslationsCacheHit:s,onTranslationsCacheMiss:a}}){super(e,{onHit:o,onMiss:i}),this.ttl=6e4,this.ttl=null===t?-1:t??6e4,this._translationLoader=r,this._createTranslateMany=n,this._onTranslationsCacheHit=s,this._onTranslationsCacheMiss=a}get(e){const t=this.getCache(e);if(!t||t.expiresAt>0&&t.expiresAt<Date.now())return;const r=t.translationsCache;return null!=r&&this.onHit&&this.onHit({inputKey:e,cacheKey:this.genKey(e),cacheValue:t,outputValue:r}),r}async miss(e){const t=await this.missCache(e),r=t.translationsCache;return null!=r&&this.onMiss&&this.onMiss({inputKey:e,cacheKey:this.genKey(e),cacheValue:t,outputValue:r}),r}genKey(e){return e}async fallback(e){const t=this._translationLoader(e),r=this.ttl<0?this.ttl:Date.now()+this.ttl;return{translationsCache:new It({init:await t,lifecycle:this._createTranslationsCacheLifecycle(e),translateMany:this._createTranslateMany(e)}),expiresAt:r}}_createTranslationsCacheLifecycle(e){return{onHit:this._onTranslationsCacheHit?t=>this._onTranslationsCacheHit({locale:e,...t}):void 0,onMiss:this._onTranslationsCacheMiss?t=>this._onTranslationsCacheMiss({locale:e,...t}):void 0}}};var Ot=class{constructor(){this.listeners={}}getOrCreateListeners(e){return this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e]}subscribe(e,t){const r=this.getOrCreateListeners(e);return r.add(t),()=>{r.delete(t)}}emit(e,t){this.listeners[e]?.forEach(e=>e(t))}};var Rt=class extends Ot{constructor(t){super(),this.resolveTranslationSync=(e,t={})=>this.lookupTranslation(e,t),function(e,t="",r=!0){if(e.forEach(e=>{switch(e.type){case"error":mt.error(t+e.message);break;case"warning":mt.warn(t+e.message)}}),r&&e.some(e=>"error"===e.type))throw new Error("Validation errors occurred")}(Lt(t),"I18nManager: "),this.config=function(e){const t=Bt(e),n=function({defaultLocale:e,locales:t,customMapping:r}){return{defaultLocale:e,locales:Array.from(new Set([e,...t])),customMapping:r||{}}}({defaultLocale:e.defaultLocale||r,locales:e.locales||[r],customMapping:e.customMapping});return{environment:e.environment||"production",enableI18n:void 0===e.enableI18n||e.enableI18n,projectId:e.projectId,devApiKey:e.devApiKey,apiKey:e.apiKey,runtimeUrl:e.runtimeUrl,_versionId:e._versionId,...t?Nt(n):n}}(t),this.localeConfig=new e.LocaleConfig({defaultLocale:this.config.defaultLocale,locales:this.config.locales,customMapping:this.config.customMapping}),this.storeAdapter=t.storeAdapter??new At;const n=function(e){return function({type:e,remoteTranslationLoaderParams:t,loadTranslations:r}){"disabled"===e&&mt.warn("I18nManager: No translation loader found. No translations will be loaded.");const{cacheUrl:n,projectId:o,_versionId:i,_branchId:s,customMapping:a}=t;switch(e){case"remote":case"gt-remote":return Ct({cacheUrl:n||"",projectId:o||"",_versionId:i,_branchId:s,customMapping:a});case"custom":return r;case"disabled":return async e=>({})}}({loadTranslations:e.loadTranslations,type:Tt(e),remoteTranslationLoaderParams:{cacheUrl:e.cacheUrl,projectId:e.projectId,_versionId:e._versionId,_branchId:e._branchId,customMapping:e.customMapping}})}(t),o=(i=this.getGTClassClean(),s=12e3,e=>t=>i.translateMany(t,{targetLocale:e},s));var i,s,a;!function({onLocalesCacheHit:e,onLocalesCacheMiss:t,onTranslationsCacheHit:r,onTranslationsCacheMiss:n},o){e&&o("locales-cache-hit",t=>{e({...t,value:t.translations})}),t&&o("locales-cache-miss",e=>{t({...e,value:e.translations})}),r&&o("translations-cache-hit",e=>{r({...e,value:e.translation})}),n&&o("translations-cache-miss",e=>{n({...e,value:e.translation})})}(t.lifecycle??{},(...e)=>this.subscribe(...e)),this.localesCache=new Mt({loadTranslations:n,createTranslateMany:o,lifecycle:(a=(...e)=>this.emit(...e),{onLocalesCacheHit:e=>{a("locales-cache-hit",{locale:e.inputKey,translations:e.outputValue.getInternalCache()})},onLocalesCacheMiss:e=>{a("locales-cache-miss",{locale:e.inputKey,translations:e.outputValue.getInternalCache()})},onTranslationsCacheHit:e=>{a("translations-cache-hit",{locale:e.locale,hash:e.cacheKey,translation:e.outputValue})},onTranslationsCacheMiss:e=>{a("translations-cache-miss",{locale:e.locale,hash:e.cacheKey,translation:e.outputValue})}})})}subscribeToTranslationsCacheMiss(e,t,r){return this.subscribe("translations-cache-miss",n=>{n.locale===t&&n.hash===r&&e(n)})}getAdapterType(){return this.storeAdapter.type}getLocale(){const e=this.storeAdapter.getItem("locale");return e||(mt.warn("getLocale() invoked outside of translation context, falling back to default locale"),this.config.defaultLocale)}setLocale(e){try{const t=this.resolveLocale(e),r=this.getLocale();this.storeAdapter.setItem("locale",t),this.emit("locale-update",{previousLocale:r,newLocale:t})}catch(e){this.handleError(e)}}getDefaultLocale(){return this.config.defaultLocale}getLocales(){return this.config.locales}getVersionId(){return this.config._versionId}getGTClass(){return this.getGTClassClean(this.getLocale())}isTranslationEnabled(){return this.config.enableI18n}getTranslationLoader(){return e=>this.loadTranslations(e)}async loadTranslations(e=this.getLocale()){try{const t=this.resolveLocale(e);if(!this.requiresTranslation(t))return{};let r=this.localesCache.get(t);return r||(r=await this.localesCache.miss(t)),r.getInternalCache()}catch(e){return this.handleError(e),{}}}lookupTranslation(e,t={}){try{const{locale:r,options:n}=this.resolveLookupParams(t);if(!this.requiresTranslation(r))return e;const o=this.localesCache.get(r);if(!o)return;return o.get({message:e,options:n})}catch(e){return void this.handleError(e)}}async lookupTranslationWithFallback(e,t={}){try{const{locale:r,options:n}=this.resolveLookupParams(t);if(!this.requiresTranslation(r))return e;let o=this.localesCache.get(r);o||(o=await this.localesCache.miss(r));let i=o.get({message:e,options:n});return null==i&&(i=await o.miss({message:e,options:n})),i}catch(e){return void this.handleError(e)}}async getLookupTranslation(e=this.getLocale(),t=[]){try{const r=this.resolveLocale(e);if(!this.requiresTranslation(r))return e=>e;const n=function(e,t,r){return e.flatMap(e=>{const n=e.options.$locale;if(null==n)return[e];try{const o=r(n);return o!==t?[]:[{message:e.message,options:{...e.options,$locale:o}}]}catch{return[]}})}(t,r,e=>this.resolveLocale(e));n.length!==t.length&&mt.warn(`I18nManager: getLookupTranslation(): prefetchEntries must all be the same locale, ignoring all entries that are not for ${r}`);let o=this.localesCache.get(r);return o||(o=await this.localesCache.miss(r)),o?(await Promise.all(n.filter(e=>null==o.get(e)).map(e=>o.miss(e))),(e,t={})=>o.get({message:e,options:this.resolveLookupOptions(t)})):()=>{}}catch(e){return this.handleError(e),e=>e}}async getTranslations(e=this.getLocale()){try{return this.loadTranslations(e)}catch(e){return this.handleError(e),{}}}async getTranslationResolver(e=this.getLocale()){return this.getLookupTranslation(e)}requiresTranslation(e=this.getLocale()){const t=this.getDefaultLocale(),r=this.getLocales();return this.isTranslationEnabled()&&this.localeConfig.requiresTranslation(e,t,r)}requiresDialectTranslation(e=this.getLocale()){const t=this.getDefaultLocale();return this.requiresTranslation(e)&&this.localeConfig.isSameLanguage(t,e)}handleError(e){if("development"===this.config.environment)throw e;mt.error("I18nManager: "+e)}resolveLocale(e){const t=this.localeConfig.determineLocale(e);if(!this.localeConfig.isValidLocale(e)||!t)throw new Error(`I18nManager: validateLocale(): locale ${e} is not valid`);return t}resolveLookupParams(e={}){const t=this.resolveLocale(e.$locale??this.getLocale());return{locale:t,options:this.resolveLookupOptions(e,t)}}resolveLookupOptions(e={},t){return e.$locale?{...e,$locale:t??this.resolveLocale(e.$locale)}:e}getGTClassClean(e){return new t.GT({sourceLocale:this.config.defaultLocale,targetLocale:e,locales:this.config.locales,customMapping:this.config.customMapping,projectId:this.config.projectId,baseUrl:this.config.runtimeUrl||void 0,apiKey:this.config.apiKey,devApiKey:this.config.devApiKey})}};function Nt(t){return{defaultLocale:e.standardizeLocale(t.defaultLocale),locales:t.locales.map(r=>("string"==typeof t.customMapping?.[r]?t.customMapping?.[r]:t.customMapping?.[r]?.code)?r:e.standardizeLocale(r)),customMapping:Object.fromEntries(Object.entries(t.customMapping||{}).map(([t,r])=>[t,"string"==typeof r?e.standardizeLocale(r):{...r,...r.code?{code:e.standardizeLocale(r.code)}:{}}]))}}let Ut;function Gt(){return Ut||(mt.warn("getI18nManager(): Translation failed because I18nManager not initialized."),Ut=new Rt({defaultLocale:r,locales:[r]})),Ut}function Dt({source:e,target:t,options:r}){const n=Gt();return null!=t?kt(t,{$locale:n.getLocale(),$_fallback:e,...r}):kt(e,{$locale:n.getDefaultLocale(),...r})}function kt(t,r){switch(r.$format??"STRING"){case"ICU":return bt(t,r);case"I18NEXT":case"STRING":return function(t,r){return e.formatCutoff(t,{locales:r.$locale??r.$_locales,maxChars:r.$maxChars})}(t,r);default:return t}}function jt(e,t){return{$format:t,...e}}const xt=(e,t={})=>function(e,t){const r=jt(t,"STRING"),n=Gt().lookupTranslation(e,r);if(null!=n)return Dt({source:e,target:n,options:r})}(e,{$format:"ICU",...t}),Ft=(e,t={})=>function(e,t){const r=jt(t,"STRING");return Dt({source:e,target:Gt().lookupTranslation(e,r),options:r})}(e,{$format:"ICU",...t});globalThis.t=(e,...t)=>{var r;return"undefined"==typeof window&&console.warn(`gt-react Warning: Translation failed for t("${"string"==typeof(r=e)?r:"`"+(null==r?void 0:r.join("${}"))+"`"}") because it was used outside of a browser environment. Falling back to original message.`),"string"==typeof e?Ft(e,t.at(0)):function(e,t){const r=function(e,t){return e.map((e,r)=>{var n;return e+(null!==(n=t[r])&&void 0!==n?n:"")}).join("")}(e,t),n=xt(r);if(n)return n;const{message:o,variables:i}=function(e,t){const r=[],n={};let o=0;for(let i=0;i<e.length;i++)if(r.push(e[i]),i<t.length){const e=o.toString();r.push(`{${e}}`),n[e]=t[i],o++}return{message:r.join(""),variables:n}}(e,t);return Ft(o,i)}(e,t)};
|
|
1
|
+
"use strict";var e=require("generaltranslation/core"),t=require("generaltranslation");const r="en",n="https://cdn.gtx.dev";function o(e){if(void 0===e)return;if(null===e)return"null";if("number"==typeof e)return isFinite(e)?""+e:"null";if("object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(let r=0;r<e.length;r++)r&&(t+=","),t+=o(e[r])||"null";return t+"]"}const t=Object.keys(e).sort();let r="";for(const n of t){const t=o(e[n]);t&&(r&&(r+=","),r+=JSON.stringify(n)+":"+t)}return"{"+r+"}"}function i(e){return o(e)??""}function s(e,t,r=""){const n=(o=e)instanceof Uint8Array||ArrayBuffer.isView(o)&&"Uint8Array"===o.constructor.name&&"BYTES_PER_ELEMENT"in o&&1===o.BYTES_PER_ELEMENT;var o;const i=e?.length;if(!n||void 0!==t){const t=(r&&`"${r}" `)+"expected Uint8Array"+""+", got "+(n?`length=${i}`:"type="+typeof e);if(!n)throw new TypeError(t);throw new RangeError(t)}return e}function a(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function c(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function l(e,t){return e<<32-t|e>>>t}const u=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),f=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function p(e,t={}){const r=(t,r)=>e(r).update(t).digest(),n=e(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.canXOF=n.canXOF,r.create=t=>e(t),Object.assign(r,t),Object.freeze(r)}const d=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function g(e,t,r){return e&t^~e&r}function m(e,t,r){return e&t^e&r^t&r}class y{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,n){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=h(this.buffer)}update(e){a(this),s(e);const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let i=0;i<o;){const s=Math.min(n-this.pos,o-i);if(s===n){const t=h(e);for(;n<=o-i;i+=n)this.process(t,i);continue}r.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){a(this),function(e,t){s(e,void 0,"digestInto() output");const r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:i}=this;t[i++]=128,c(this.buffer.subarray(i)),this.padOffset>n-i&&(this.process(r,0),i=0);for(let e=i;e<n;e++)t[e]=0;r.setBigUint64(n-8,BigInt(8*this.length),o),this.process(r,0);const l=h(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const f=u/4,p=this.get();if(f>p.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<f;e++)l.setUint32(4*e,p[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:o,destroyed:i,pos:s}=this;return e.destroyed=i,e.finished=o,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const b=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),E=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),_=new Uint32Array(64);class v extends y{constructor(e){super(64,e,8,!1)}get(){const{A:e,B:t,C:r,D:n,E:o,F:i,G:s,H:a}=this;return[e,t,r,n,o,i,s,a]}set(e,t,r,n,o,i,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|o,this.F=0|i,this.G=0|s,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)_[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=_[e-15],r=_[e-2],n=l(t,7)^l(t,18)^t>>>3,o=l(r,17)^l(r,19)^r>>>10;_[e]=o+_[e-7]+n+_[e-16]|0}let{A:r,B:n,C:o,D:i,E:s,F:a,G:c,H:h}=this;for(let e=0;e<64;e++){const t=h+(l(s,6)^l(s,11)^l(s,25))+g(s,a,c)+E[e]+_[e]|0,u=(l(r,2)^l(r,13)^l(r,22))+m(r,n,o)|0;h=c,c=a,a=s,s=i+t|0,i=o,o=n,n=r,r=t+u|0}r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,i=i+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,h=h+this.H|0,this.set(r,n,o,i,s,a,c,h)}roundClean(){c(_)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),c(this.buffer)}}class T extends v{A=0|b[0];B=0|b[1];C=0|b[2];D=0|b[3];E=0|b[4];F=0|b[5];G=0|b[6];H=0|b[7];constructor(){super(32)}}const H=p(()=>new T,d(1));var B=function(e,t){return B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},B(e,t)};function L(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var w=function(){return w=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},w.apply(this,arguments)};function A(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function C(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function P(e,t){return function(r,n){t(r,n,e)}}function S(e,t,r,n,o,i){function s(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,c=n.kind,h="getter"===c?"get":"setter"===c?"set":"value",l=!t&&e?n.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f=!1,p=r.length-1;p>=0;p--){var d={};for(var g in n)d[g]="access"===g?{}:n[g];for(var g in n.access)d.access[g]=n.access[g];d.addInitializer=function(e){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(s(e||null))};var m=(0,r[p])("accessor"===c?{get:u.get,set:u.set}:u[h],d);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=s(m.get))&&(u.get=a),(a=s(m.set))&&(u.set=a),(a=s(m.init))&&o.unshift(a)}else(a=s(m))&&("field"===c?o.unshift(a):u[h]=a)}l&&Object.defineProperty(l,n.name,u),f=!0}function I(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function M(e){return"symbol"==typeof e?e:"".concat(e)}function O(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function R(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function N(e,t,r,n){return new(r||(r=Promise))(function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,a)}c((n=n.apply(e,t||[])).next())})}function U(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}var G=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function D(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||G(t,e,r)}function k(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function j(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function x(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(j(arguments[t]));return e}function F(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)n[o]=i[s];return n}function $(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function K(e){return this instanceof K?(this.v=e,this):new K(e)}function V(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",function(e){return function(t){return Promise.resolve(t).then(e,h)}}),n[Symbol.asyncIterator]=function(){return this},n;function s(e,t){o[e]&&(n[e]=function(t){return new Promise(function(r,n){i.push([e,t,r,n])>1||a(e,t)})},t&&(n[e]=t(n[e])))}function a(e,t){try{(r=o[e](t)).value instanceof K?Promise.resolve(r.value.v).then(c,h):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function c(e){a("next",e)}function h(e){a("throw",e)}function l(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function X(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:K(e[n](t)),done:!1}:o?o(t):t}:o}}function Y(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=k(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,o){(function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)})(n,o,(t=e[r](t)).done,t.value)})}}}function q(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var W=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},Z=function(e){return Z=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},Z(e)};function z(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=Z(e),n=0;n<r.length;n++)"default"!==r[n]&&G(t,e,r[n]);return W(t,e),t}function Q(e){return e&&e.__esModule?e:{default:e}}function J(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function ee(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function te(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function re(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(o=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var ne="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function oe(e){function t(t){e.error=e.hasError?new ne(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function o(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(e){return t(e),o()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function ie(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,r,n,o,i){return r?t?".jsx":".js":!n||o&&i?n+o+"."+i.toLowerCase()+"js":e}):e}var se,ae,ce,he={__extends:L,__assign:w,__rest:A,__decorate:C,__param:P,__esDecorate:S,__runInitializers:I,__propKey:M,__setFunctionName:O,__metadata:R,__awaiter:N,__generator:U,__createBinding:G,__exportStar:D,__values:k,__read:j,__spread:x,__spreadArrays:F,__spreadArray:$,__await:K,__asyncGenerator:V,__asyncDelegator:X,__asyncValues:Y,__makeTemplateObject:q,__importStar:z,__importDefault:Q,__classPrivateFieldGet:J,__classPrivateFieldSet:ee,__classPrivateFieldIn:te,__addDisposableResource:re,__disposeResources:oe,__rewriteRelativeImportExtension:ie},le=Object.freeze({__proto__:null,__addDisposableResource:re,get __assign(){return w},__asyncDelegator:X,__asyncGenerator:V,__asyncValues:Y,__await:K,__awaiter:N,__classPrivateFieldGet:J,__classPrivateFieldIn:te,__classPrivateFieldSet:ee,__createBinding:G,__decorate:C,__disposeResources:oe,__esDecorate:S,__exportStar:D,__extends:L,__generator:U,__importDefault:Q,__importStar:z,__makeTemplateObject:q,__metadata:R,__param:P,__propKey:M,__read:j,__rest:A,__rewriteRelativeImportExtension:ie,__runInitializers:I,__setFunctionName:O,__spread:x,__spreadArray:$,__spreadArrays:F,__values:k,default:he});!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(se||(se={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(ae||(ae={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(ce||(ce={}));var ue=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,fe=/(?:[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;function pe(e){var t={};return e.replace(fe,function(e){var r=e.length;switch(e[0]){case"G":t.era=4===r?"long":5===r?"narrow":"short";break;case"y":t.year=2===r?"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");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===r?"long":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-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");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var de=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function ge(e){return e.replace(/^(.*?)-/,"")}var me=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,ye=/^(@+)?(\+|#+)?[rs]?$/g,be=/(\*)(0+)|(#+)(0+)|(0+)/g,Ee=/^(0+)$/;function _e(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(ye,function(e,r,n){return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""}),t}function ve(e){switch(e){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 Te(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!Ee.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function He(e){var t=ve(e);return t||{}}function Be(e){for(var t={},r=0,n=e;r<n.length;r++){var o=n[r];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=ge(o.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=w(w(w({},t),{notation:"scientific"}),o.options.reduce(function(e,t){return w(w({},e),He(t))},{}));continue;case"engineering":t=w(w(w({},t),{notation:"engineering"}),o.options.reduce(function(e,t){return w(w({},e),He(t))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(be,function(e,r,n,o,i,s){if(r)t.minimumIntegerDigits=n.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Ee.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(me.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(me,function(e,r,n,o,i,s){return"*"===n?t.minimumFractionDigits=r.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&s?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+s.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});var i=o.options[0];"w"===i?t=w(w({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=w(w({},t),_e(i)))}else if(ye.test(o.stem))t=w(w({},t),_e(o.stem));else{var s=ve(o.stem);s&&(t=w(w({},t),s));var a=Te(o.stem);a&&(t=w(w({},t),a))}}return t}var Le,we={"001":["H","h"],419:["h","H","hB","hb"],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","H","hB","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","H","hB","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","H","hB","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"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["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"]};function Ae(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r,n=e.language;return"root"!==n&&(r=e.maximize().region),(we[r||""]||we[n||""]||we["".concat(n,"-001")]||we["001"])[0]}var Ce=new RegExp("^".concat(ue.source,"*")),Pe=new RegExp("".concat(ue.source,"*$"));function Se(e,t){return{start:e,end:t}}var Ie=!!String.prototype.startsWith&&"_a".startsWith("a",1),Me=!!String.fromCodePoint,Oe=!!Object.fromEntries,Re=!!String.prototype.codePointAt,Ne=!!String.prototype.trimStart,Ue=!!String.prototype.trimEnd,Ge=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},De=!0;try{De="a"===(null===(Le=Xe("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===Le?void 0:Le[0])}catch(e){De=!1}var ke,je=Ie?function(e,t,r){return e.startsWith(t,r)}:function(e,t,r){return e.slice(r,r+t.length)===t},xe=Me?String.fromCodePoint:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r,n="",o=e.length,i=0;o>i;){if((r=e[i++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},Fe=Oe?Object.fromEntries:function(e){for(var t={},r=0,n=e;r<n.length;r++){var o=n[r],i=o[0],s=o[1];t[i]=s}return t},$e=Re?function(e,t){return e.codePointAt(t)}:function(e,t){var r=e.length;if(!(t<0||t>=r)){var n,o=e.charCodeAt(t);return o<55296||o>56319||t+1===r||(n=e.charCodeAt(t+1))<56320||n>57343?o:n-56320+(o-55296<<10)+65536}},Ke=Ne?function(e){return e.trimStart()}:function(e){return e.replace(Ce,"")},Ve=Ue?function(e){return e.trimEnd()}:function(e){return e.replace(Pe,"")};function Xe(e,t){return new RegExp(e,t)}if(De){var Ye=Xe("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");ke=function(e,t){var r;return Ye.lastIndex=t,null!==(r=Ye.exec(e)[1])&&void 0!==r?r:""}}else ke=function(e,t){for(var r=[];;){var n=$e(e,t);if(void 0===n||ze(n)||Qe(n))break;r.push(n),t+=n>=65536?2:1}return xe.apply(void 0,r)};var qe=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,r){for(var n=[];!this.isEOF();){var o=this.char();if(123===o){if((i=this.parseArgument(e,r)).err)return i;n.push(i.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(se.UNMATCHED_CLOSING_TAG,Se(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&We(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;n.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;n.push(i.val)}}else{var s=this.clonePosition();this.bump(),n.push({type:ae.pound,location:Se(s,this.clonePosition())})}}}return{val:n,err:null}},e.prototype.parseTag=function(e,t){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:ae.literal,value:"<".concat(n,"/>"),location:Se(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var i=o.val,s=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!We(this.char()))return this.error(se.INVALID_TAG,Se(s,this.clonePosition()));var a=this.clonePosition();return n!==this.parseTagName()?this.error(se.UNMATCHED_CLOSING_TAG,Se(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:ae.tag,value:n,children:i,location:Se(r,this.clonePosition())},err:null}:this.error(se.INVALID_TAG,Se(s,this.clonePosition())))}return this.error(se.UNCLOSED_TAG,Se(r,this.clonePosition()))}return this.error(se.INVALID_TAG,Se(r,this.clonePosition()))},e.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&Ze(this.char());)this.bump();return this.message.slice(e,this.offset())},e.prototype.parseLiteral=function(e,t){for(var r=this.clonePosition(),n="";;){var o=this.tryParseQuote(t);if(o)n+=o;else{var i=this.tryParseUnquoted(e,t);if(i)n+=i;else{var s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}}}var a=Se(r,this.clonePosition());return{val:{type:ae.literal,value:n,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(We(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(r);this.bump()}return xe.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),xe(r))},e.prototype.parseArgument=function(e,t){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(se.EXPECT_ARGUMENT_CLOSING_BRACE,Se(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(se.EMPTY_ARGUMENT,Se(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(se.MALFORMED_ARGUMENT,Se(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(se.EXPECT_ARGUMENT_CLOSING_BRACE,Se(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:ae.argument,value:n,location:Se(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(se.EXPECT_ARGUMENT_CLOSING_BRACE,Se(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(se.MALFORMED_ARGUMENT,Se(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),r=ke(this.message,t),n=t+r.length;return this.bumpTo(n),{value:r,location:Se(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,r,n){var o,i=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(s){case"":return this.error(se.EXPECT_ARGUMENT_TYPE,Se(i,a));case"number":case"date":case"time":this.bumpSpace();var c=null;if(this.bumpIf(",")){this.bumpSpace();var h=this.clonePosition();if((y=this.parseSimpleArgStyleIfPossible()).err)return y;if(0===(p=Ve(y.val)).length)return this.error(se.EXPECT_ARGUMENT_STYLE,Se(this.clonePosition(),this.clonePosition()));c={style:p,styleLocation:Se(h,this.clonePosition())}}if((b=this.tryParseArgumentClose(n)).err)return b;var l=Se(n,this.clonePosition());if(c&&je(null==c?void 0:c.style,"::",0)){var u=Ke(c.style.slice(2));if("number"===s)return(y=this.parseNumberSkeletonFromString(u,c.styleLocation)).err?y:{val:{type:ae.number,value:r,location:l,style:y.val},err:null};if(0===u.length)return this.error(se.EXPECT_DATE_TIME_SKELETON,l);var f=u;this.locale&&(f=function(e,t){for(var r="",n=0;n<e.length;n++){var o=e.charAt(n);if("j"===o){for(var i=0;n+1<e.length&&e.charAt(n+1)===o;)i++,n++;var s=1+(1&i),a=i<2?1:3+(i>>1),c=Ae(t);for("H"!=c&&"k"!=c||(a=0);a-- >0;)r+="a";for(;s-- >0;)r=c+r}else r+="J"===o?"H":o}return r}(u,this.locale));var p={type:ce.dateTime,pattern:f,location:c.styleLocation,parsedOptions:this.shouldParseSkeletons?pe(f):{}};return{val:{type:"date"===s?ae.date:ae.time,value:r,location:l,style:p},err:null}}return{val:{type:"number"===s?ae.number:"date"===s?ae.date:ae.time,value:r,location:l,style:null!==(o=null==c?void 0:c.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":var d=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(se.EXPECT_SELECT_ARGUMENT_OPTIONS,Se(d,w({},d)));this.bumpSpace();var g=this.parseIdentifierIfPossible(),m=0;if("select"!==s&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(se.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Se(this.clonePosition(),this.clonePosition()));var y;if(this.bumpSpace(),(y=this.tryParseDecimalInteger(se.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,se.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return y;this.bumpSpace(),g=this.parseIdentifierIfPossible(),m=y.val}var b,E=this.tryParsePluralOrSelectOptions(e,s,t,g);if(E.err)return E;if((b=this.tryParseArgumentClose(n)).err)return b;var _=Se(n,this.clonePosition());return"select"===s?{val:{type:ae.select,value:r,options:Fe(E.val),location:_},err:null}:{val:{type:ae.plural,value:r,options:Fe(E.val),offset:m,pluralType:"plural"===s?"cardinal":"ordinal",location:_},err:null};default:return this.error(se.INVALID_ARGUMENT_TYPE,Se(i,a))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(se.EXPECT_ARGUMENT_CLOSING_BRACE,Se(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(se.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Se(r,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var r=[];try{r=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],r=0,n=e.split(de).filter(function(e){return e.length>0});r<n.length;r++){var o=n[r].split("/");if(0===o.length)throw new Error("Invalid number skeleton");for(var i=o[0],s=o.slice(1),a=0,c=s;a<c.length;a++)if(0===c[a].length)throw new Error("Invalid number skeleton");t.push({stem:i,options:s})}return t}(e)}catch(e){return this.error(se.INVALID_NUMBER_SKELETON,t)}return{val:{type:ce.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?Be(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,r,n){for(var o,i=!1,s=[],a=new Set,c=n.value,h=n.location;;){if(0===c.length){var l=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var u=this.tryParseDecimalInteger(se.EXPECT_PLURAL_ARGUMENT_SELECTOR,se.INVALID_PLURAL_ARGUMENT_SELECTOR);if(u.err)return u;h=Se(l,this.clonePosition()),c=this.message.slice(l.offset,this.offset())}if(a.has(c))return this.error("select"===t?se.DUPLICATE_SELECT_ARGUMENT_SELECTOR:se.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,h);"other"===c&&(i=!0),this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?se.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:se.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Se(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(e+1,t,r);if(p.err)return p;var d=this.tryParseArgumentClose(f);if(d.err)return d;s.push([c,{value:p.val,location:Se(f,this.clonePosition())}]),a.add(c),this.bumpSpace(),c=(o=this.parseIdentifierIfPossible()).value,h=o.location}return 0===s.length?this.error("select"===t?se.EXPECT_SELECT_ARGUMENT_SELECTOR:se.EXPECT_PLURAL_ARGUMENT_SELECTOR,Se(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(se.MISSING_OTHER_CLAUSE,Se(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var r=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var o=!1,i=0;!this.isEOF();){var s=this.char();if(!(s>=48&&s<=57))break;o=!0,i=10*i+(s-48),this.bump()}var a=Se(n,this.clonePosition());return o?Ge(i*=r)?{val:i,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=$e(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(je(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&ze(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),r=this.message.charCodeAt(t+(e>=65536?2:1));return null!=r?r:null},e}();function We(e){return e>=97&&e<=122||e>=65&&e<=90}function Ze(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function ze(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Qe(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function Je(e){e.forEach(function(e){if(delete e.location,function(e){return e.type===ae.select}(e)||function(e){return e.type===ae.plural}(e))for(var t in e.options)delete e.options[t].location,Je(e.options[t].value);else(function(e){return e.type===ae.number})(e)&&function(e){return!(!e||"object"!=typeof e||e.type!==ce.number)}(e.style)?delete e.style.location:!function(e){return e.type===ae.date}(e)&&!function(e){return e.type===ae.time}(e)||!function(e){return!(!e||"object"!=typeof e||e.type!==ce.dateTime)}(e.style)?function(e){return e.type===ae.tag}(e)&&Je(e.children):delete e.style.location})}function et(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){var r=!1;try{r=this instanceof e}catch{}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}var tt,rt={};function nt(){if(tt)return rt;var e,t;return tt=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.SKELETON_TYPE=rt.TYPE=void 0,rt.isLiteralElement=function(t){return t.type===e.literal},rt.isArgumentElement=function(t){return t.type===e.argument},rt.isNumberElement=function(t){return t.type===e.number},rt.isDateElement=function(t){return t.type===e.date},rt.isTimeElement=function(t){return t.type===e.time},rt.isSelectElement=function(t){return t.type===e.select},rt.isPluralElement=function(t){return t.type===e.plural},rt.isPoundElement=function(t){return t.type===e.pound},rt.isTagElement=function(t){return t.type===e.tag},rt.isNumberSkeleton=function(e){return!(!e||"object"!=typeof e||e.type!==t.number)},rt.isDateTimeSkeleton=function(e){return!(!e||"object"!=typeof e||e.type!==t.dateTime)},rt.createLiteralElement=function(t){return{type:e.literal,value:t}},rt.createNumberElement=function(t,r){return{type:e.number,value:t,style:r}},function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(e||(rt.TYPE=e={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(t||(rt.SKELETON_TYPE=t={})),rt}var ot,it=nt(),st={},at=et(le);var ct=function(){if(ot)return st;ot=1,Object.defineProperty(st,"__esModule",{value:!0}),st.printAST=r,st.doPrintAST=n,st.printDateTimeSkeleton=s;var e=at,t=nt();function r(e){return n(e,!1)}function n(a,c){var h=a.map(function(h,l){return(0,t.isLiteralElement)(h)?function(e,t,r,n){var i=e.value,s=i;r||"'"!==s[0]||(s="''".concat(s.slice(1)));n||"'"!==s[s.length-1]||(s="".concat(s.slice(0,s.length-1),"''"));return s=o(s),t?s.replace("#","'#'"):s}(h,c,0===l,l===a.length-1):(0,t.isArgumentElement)(h)?function(e){var t=e.value;return"{".concat(t,"}")}(h):(0,t.isDateElement)(h)||(0,t.isTimeElement)(h)||(0,t.isNumberElement)(h)?function(e){return"{".concat(e.value,", ").concat(t.TYPE[e.type]).concat(e.style?", ".concat((r=e.style,"string"==typeof r?o(r):r.type===t.SKELETON_TYPE.dateTime?"::".concat(s(r)):"::".concat(r.tokens.map(i).join(" ")))):"","}");var r}(h):(0,t.isPluralElement)(h)?function(t){var r="cardinal"===t.pluralType?"plural":"selectordinal",o=[t.value,r,e.__spreadArray([t.offset?"offset:".concat(t.offset):""],Object.keys(t.options).map(function(e){return"".concat(e,"{").concat(n(t.options[e].value,!0),"}")}),!0).filter(Boolean).join(" ")].join(",");return"{".concat(o,"}")}(h):(0,t.isSelectElement)(h)?function(e){var t=[e.value,"select",Object.keys(e.options).map(function(t){return"".concat(t,"{").concat(n(e.options[t].value,!1),"}")}).join(" ")].join(",");return"{".concat(t,"}")}(h):(0,t.isPoundElement)(h)?"#":(0,t.isTagElement)(h)?function(e){return"<".concat(e.value,">").concat(r(e.children),"</").concat(e.value,">")}(h):void 0});return h.join("")}function o(e){return e.replace(/([{}](?:[\s\S]*[{}])?)/,"'$1'")}function i(e){var t=e.stem,r=e.options;return 0===r.length?t:"".concat(t).concat(r.map(function(e){return"/".concat(e)}).join(""))}function s(e){return e.pattern}return st}();function ht({icuString:e,shouldVisit:t,visitor:r,options:{recurseIntoVisited:n=!0,...o}}){const i=function(e,t){void 0===t&&(t={}),t=w({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var r=new qe(e,t).parse();if(r.err){var n=SyntaxError(se[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return(null==t?void 0:t.captureLocation)||Je(r.val),r.val}(e,o);return s(i),i;function s(e){e.map(a)}function a(e){let o=!1;t(e)&&(r(e),o=!0),o&&!n||(e.type===ae.select||e.type===ae.plural?Object.values(e.options).map(e=>e.value).map(s):e.type===ae.tag&&s(e.children))}}const lt="_gt_",ut=new RegExp(`^${lt}\\d+$`),ft=new RegExp(`^${lt}$`);function pt(e){return e.type===it.TYPE.select&&ut.test(e.value)&&!!e.options.other&&(0===e.options.other.value.length||e.options.other.value.length>0&&e.options.other.value[0]?.type===it.TYPE.literal)}function dt(e){return e.type===it.TYPE.select&&ft.test(e.value)&&!!e.options.other&&(0===e.options.other.value.length||e.options.other.value.length>0&&e.options.other.value[0]?.type===it.TYPE.literal)}function gt(e){if(!e.includes("_gt_"))return e;const t=[];ht({icuString:e,shouldVisit:dt,visitor:function(e){t.push({start:e.location?.start.offset??0,end:e.location?.end.offset??0,otherStart:e.options.other.location?.start.offset??0,otherEnd:e.options.other.location?.end.offset??0})},options:{recurseIntoVisited:!1,captureLocation:!0}});const r=[];let n=0;for(let o=0;o<t.length;o++){const{start:i,end:s,otherStart:a,otherEnd:c}=t[o];r.push(e.slice(n,i)),r.push(e.slice(i,i+4+1)),r.push(String(o+1)),r.push(e.slice(i+4+1,a)),r.push("{}"),r.push(e.slice(c,s)),n=s}return r.push(e.slice(n,e.length)),r.join("")}var mt={warn(e){console.warn(e)},error(e){console.error(e)},info(e){console.info(e)},debug(e){console.debug(e)}};const yt=e=>`String interpolation failed for message: "${e}".`;function bt(t,r){if(!t)return t;const n=r.$_fallback,o=function(e){return Object.fromEntries(Object.entries(e).filter(([e])=>"$id"!==e&&"$context"!==e&&"$maxChars"!==e&&"$hash"!==e&&"$_hash"!==e&&"$_source"!==e&&"$_fallback"!==e&&"$format"!==e&&"$_locales"!==e&&"$locale"!==e))}(r);try{const s=function(e){if(!e.includes("_gt_"))return{};let t=1;const r={};return ht({icuString:e,shouldVisit:dt,visitor:function(e){r[e.value+t]=e.options.other.value.length?e.options.other.value[0]?.value:"",t+=1},options:{recurseIntoVisited:!1}}),r}(n||"");return e.formatCutoff(function(t,r,n,o){try{return e.formatMessage(t,{variables:r,locales:n,dataFormat:o})}catch{return mt.warn(yt(t)),t}}(Object.keys(s).length?(i=t).includes("_gt_")?ct.printAST(ht({icuString:i,shouldVisit:pt,visitor:function(e){e.type=it.TYPE.argument,delete e.options},options:{recurseIntoVisited:!1}})):i:t,{...o,...s,[lt]:"other"},r.$locale??r.$_locales,r.$format),{maxChars:r.$maxChars})}catch{return mt.warn(yt(t)),null!=r.$_fallback?bt(r.$_fallback,{...r,$_fallback:void 0}):e.formatCutoff(t,{maxChars:r.$maxChars})}var i}function Et(e){return function(e){if(s(e),u)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=f[e[r]];return t}(H(function(e){if("string"!=typeof e)throw new TypeError("string expected");return new Uint8Array((new TextEncoder).encode(e))}(e))).slice(0,16)}const _t=e=>{if(e&&"object"==typeof e){const t={};if("c"in e&&e.c&&(t.c=vt(e.c)),"d"in e){const r=e?.d;r?.b&&(t.b=Object.fromEntries(Object.entries(r.b).map(([e,t])=>[e,vt(t)]))),r?.t&&(t.t=r.t)}return function(e){const t=e;if(t&&"object"==typeof t&&"string"==typeof t.k){const e=Object.keys(t);if(1===e.length)return!0;if(2===e.length){if("number"==typeof t.i)return!0;if("string"==typeof t.v)return!0}if(3===e.length&&"string"==typeof t.v&&"number"==typeof t.i)return!0}return!1}(e)?{k:e.k,...e.v&&{v:e.v}}:t}return e};function vt(e){return Array.isArray(e)?e.map(_t):_t(e)}function Tt(e){return e.loadTranslations?"custom":e.cacheUrl?"remote":void 0!==e.cacheUrl&&e.cacheUrl!==n||!e.projectId?"disabled":"gt-remote"}function Ht(e){return void 0!==e.runtimeUrl&&"https://runtime2.gtx.dev"!==e.runtimeUrl||!e.projectId||!e.devApiKey&&!e.apiKey?e.runtimeUrl?"custom":"disabled":"gt"}function Bt(e){return"gt-remote"===Tt(e)||"gt"===Ht(e)}function Lt(t){const r=[];return r.push(...function(e){const t=[],{projectId:r,loadTranslations:n}=e;switch(Tt(e)){case"remote":case"gt-remote":r||t.push({type:"warning",message:"projectId is required when loading translations from a remote store"});break;case"custom":n||t.push({type:"error",message:"loadTranslations is required when loading translations from a custom loader"})}return t}(t)),r.push(...function(e){const t=[];switch(Ht(e)){case"custom":case"gt":e.projectId||t.push({type:"warning",message:"projectId is required"}),e.devApiKey||e.apiKey||t.push({type:"warning",message:"devApiKey or apiKey is required"})}return t}(t)),r.push(...function(t){const r=[];if(!Bt(t))return r;const{defaultLocale:n,locales:o,customMapping:i}=t;return new Set([...n?[n]:[],...o||[]]).forEach(t=>{e.isValidLocale(t,i)||r.push({type:"error",message:`Invalid locale: ${t}`})}),r}(t)),r}var wt=class{};var At=class extends wt{constructor(...e){super(...e),this.type="fallback-storage-adapter",this.storage={}}getItem(e){return this.storage[e]}setItem(e,t){this.storage[e]=t}removeItem(e){delete this.storage[e]}};function Ct(t){const r=function(e){const{cacheUrl:t=n,projectId:r,_versionId:o,_branchId:i}=e;return`${t}/${r}/[locale]`+(o?`/${o}`:"")+(i?`?branchId=${i}`:"")}(t);return async n=>{n=e.resolveCanonicalLocale(n,t.customMapping);const o=r.replace("[locale]",n),i=await fetch(o);if(!i.ok)throw new Error(`Failed to load translations from ${o}`);return await i.json()}}var Pt=class{constructor(e,t){this.cache={},this.fallbackPromises={},this.cache=structuredClone(e),this.onHit=t?.onHit,this.onMiss=t?.onMiss}setCache(e,t){this.cache[e]=t}getCache(e){const t=this.genKey(e);return this.cache[t]}getInternalCache(){return this.cache}async missCache(e){const t=this.genKey(e);if(void 0!==this.fallbackPromises[t])return await this.fallbackPromises[t];const r=this.fallback(e);this.fallbackPromises[t]=r;try{const e=await r;return this.cache[t]=e,e}finally{delete this.fallbackPromises[t]}}};function St(e,t){return function({source:e,context:t,id:r,maxChars:n,dataFormat:o},s=Et){let a;return a="JSX"===o?vt(e):e,s(i({source:a,...r&&{id:r},...t&&{context:t},...null!=n&&{maxChars:Math.abs(n)},...o&&{dataFormat:o}}))}({source:"ICU"===t.$format?gt(e):e,...t?.$context&&{context:t.$context},...t?.$id&&{id:t.$id},..."$maxChars"in t&&null!=t.$maxChars&&{maxChars:Math.abs(t.$maxChars)},dataFormat:t.$format})}var It=class extends Pt{constructor({init:e,translateMany:t,lifecycle:r}){super(e,r),this._queue=[],this._batchTimer=null,this._activeRequests=0,this._translateMany=t}get(e){const t=this.getCache(e);return null!=t&&this.onHit&&this.onHit({inputKey:e,cacheKey:this.genKey(e),cacheValue:t,outputValue:t}),t}async miss(e){const t=await this.missCache(e);return null!=t&&this.onMiss&&this.onMiss({inputKey:e,cacheKey:this.genKey(e),cacheValue:t,outputValue:t}),t}genKey(e){return St(e.message,e.options)}fallback(e){const t=this._enqueueTranslation(e);return this._queue.length>=25?this._flushNow():this._scheduleBatch(),t}_flushNow(){this._batchTimer&&(clearTimeout(this._batchTimer),this._batchTimer=null),this._drainQueue()}_scheduleBatch(){this._batchTimer||(this._batchTimer=setTimeout(()=>{this._batchTimer=null,this._drainQueue()},50))}_drainQueue(){for(;this._queue.length>0&&this._activeRequests<100;){const e=this._queue.splice(0,25);this._sendBatchRequest(e)}this._queue.length>0&&this._scheduleBatch()}_enqueueTranslation(e){const t=this.genKey(e),r=e.options;return new Promise((n,o)=>{this._queue.push({key:t,source:e.message,metadata:{...r?.$context&&{context:r.$context},...r?.$id&&{id:r.$id},..."$maxChars"in r&&null!=r.$maxChars&&{$maxChars:Math.abs(r.$maxChars)},dataFormat:r.$format},resolve:e=>n(e),reject:o})})}async _sendBatchRequest(e){this._activeRequests++;const t=function(e){return e.reduce((e,t)=>(e[t.key]={source:t.source,metadata:t.metadata},e),{})}(e),r=await this._sendBatchRequestWithErrorHandling(e,t);r&&this._handleTranslationResponse(e,r),this._activeRequests--}async _sendBatchRequestWithErrorHandling(e,t){try{return await this._translateMany(t)}catch(t){for(const r of e)r.reject(t);return}}_handleTranslationResponse(e,t){for(const r of e){const{key:e}=r,n=t[e];if(n&&n.success){const t=n.translation;this.setCache(e,t),r.resolve(t)}else r.reject(n?.error)}}};var Mt=class extends Pt{constructor({init:e={},ttl:t,loadTranslations:r,createTranslateMany:n,lifecycle:{onLocalesCacheHit:o,onLocalesCacheMiss:i,onTranslationsCacheHit:s,onTranslationsCacheMiss:a}}){super(e,{onHit:o,onMiss:i}),this.ttl=6e4,this.ttl=null===t?-1:t??6e4,this._translationLoader=r,this._createTranslateMany=n,this._onTranslationsCacheHit=s,this._onTranslationsCacheMiss=a}get(e){const t=this.getCache(e);if(!t||t.expiresAt>0&&t.expiresAt<Date.now())return;const r=t.translationsCache;return null!=r&&this.onHit&&this.onHit({inputKey:e,cacheKey:this.genKey(e),cacheValue:t,outputValue:r}),r}async miss(e){const t=await this.missCache(e),r=t.translationsCache;return null!=r&&this.onMiss&&this.onMiss({inputKey:e,cacheKey:this.genKey(e),cacheValue:t,outputValue:r}),r}genKey(e){return e}async fallback(e){const t=this._translationLoader(e),r=this.ttl<0?this.ttl:Date.now()+this.ttl;return{translationsCache:new It({init:await t,lifecycle:this._createTranslationsCacheLifecycle(e),translateMany:this._createTranslateMany(e)}),expiresAt:r}}_createTranslationsCacheLifecycle(e){return{onHit:this._onTranslationsCacheHit?t=>this._onTranslationsCacheHit({locale:e,...t}):void 0,onMiss:this._onTranslationsCacheMiss?t=>this._onTranslationsCacheMiss({locale:e,...t}):void 0}}};var Ot=class{constructor(){this.listeners={}}getOrCreateListeners(e){return this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e]}subscribe(e,t){const r=this.getOrCreateListeners(e);return r.add(t),()=>{r.delete(t)}}emit(e,t){this.listeners[e]?.forEach(e=>e(t))}};var Rt=class extends Ot{constructor(t){super(),this.resolveTranslationSync=(e,t={})=>this.lookupTranslation(e,t),function(e,t="",r=!0){if(e.forEach(e=>{switch(e.type){case"error":mt.error(t+e.message);break;case"warning":mt.warn(t+e.message)}}),r&&e.some(e=>"error"===e.type))throw new Error("Validation errors occurred")}(Lt(t),"I18nManager: "),this.config=function(e){const t=Bt(e),n=function({defaultLocale:e,locales:t,customMapping:r}){return{defaultLocale:e,locales:Array.from(new Set([e,...t])),customMapping:r||{}}}({defaultLocale:e.defaultLocale||r,locales:e.locales||[r],customMapping:e.customMapping});return{environment:e.environment||"production",enableI18n:void 0===e.enableI18n||e.enableI18n,projectId:e.projectId,devApiKey:e.devApiKey,apiKey:e.apiKey,runtimeUrl:e.runtimeUrl,_versionId:e._versionId,...t?Nt(n):n}}(t),this.localeConfig=new e.LocaleConfig({defaultLocale:this.config.defaultLocale,locales:this.config.locales,customMapping:this.config.customMapping}),this.storeAdapter=t.storeAdapter??new At;const n=function(e){return function({type:e,remoteTranslationLoaderParams:t,loadTranslations:r}){"disabled"===e&&mt.warn("I18nManager: No translation loader found. No translations will be loaded.");const{cacheUrl:n,projectId:o,_versionId:i,_branchId:s,customMapping:a}=t;switch(e){case"remote":case"gt-remote":return Ct({cacheUrl:n||"",projectId:o||"",_versionId:i,_branchId:s,customMapping:a});case"custom":return r;case"disabled":return async e=>({})}}({loadTranslations:e.loadTranslations,type:Tt(e),remoteTranslationLoaderParams:{cacheUrl:e.cacheUrl,projectId:e.projectId,_versionId:e._versionId,_branchId:e._branchId,customMapping:e.customMapping}})}(t),o=(i=this.getGTClassClean(),s=12e3,e=>t=>i.translateMany(t,{targetLocale:e},s));var i,s,a;!function({onLocalesCacheHit:e,onLocalesCacheMiss:t,onTranslationsCacheHit:r,onTranslationsCacheMiss:n},o){e&&o("locales-cache-hit",t=>{e({...t,value:t.translations})}),t&&o("locales-cache-miss",e=>{t({...e,value:e.translations})}),r&&o("translations-cache-hit",e=>{r({...e,value:e.translation})}),n&&o("translations-cache-miss",e=>{n({...e,value:e.translation})})}(t.lifecycle??{},(...e)=>this.subscribe(...e)),this.localesCache=new Mt({loadTranslations:n,createTranslateMany:o,lifecycle:(a=(...e)=>this.emit(...e),{onLocalesCacheHit:e=>{a("locales-cache-hit",{locale:e.inputKey,translations:e.outputValue.getInternalCache()})},onLocalesCacheMiss:e=>{a("locales-cache-miss",{locale:e.inputKey,translations:e.outputValue.getInternalCache()})},onTranslationsCacheHit:e=>{a("translations-cache-hit",{locale:e.locale,hash:e.cacheKey,translation:e.outputValue})},onTranslationsCacheMiss:e=>{a("translations-cache-miss",{locale:e.locale,hash:e.cacheKey,translation:e.outputValue})}})})}subscribeToTranslationsCacheMiss(e,t,r){return this.subscribe("translations-cache-miss",n=>{n.locale===t&&n.hash===r&&e(n)})}getAdapterType(){return this.storeAdapter.type}getLocale(){const e=this.storeAdapter.getItem("locale");return e||(mt.warn("getLocale() invoked outside of translation context, falling back to default locale"),this.config.defaultLocale)}setLocale(e){try{const t=this.resolveLocale(e),r=this.getLocale();this.storeAdapter.setItem("locale",t),this.emit("locale-update",{previousLocale:r,newLocale:t})}catch(e){this.handleError(e)}}getDefaultLocale(){return this.config.defaultLocale}getLocales(){return this.config.locales}getVersionId(){return this.config._versionId}getGTClass(){return this.getGTClassClean(this.getLocale())}isTranslationEnabled(){return this.config.enableI18n}getTranslationLoader(){return e=>this.loadTranslations(e)}async loadTranslations(e=this.getLocale()){try{const t=this.resolveLocale(e);if(!this.requiresTranslation(t))return{};let r=this.localesCache.get(t);return r||(r=await this.localesCache.miss(t)),r.getInternalCache()}catch(e){return this.handleError(e),{}}}lookupTranslation(e,t={}){try{const{locale:r,options:n}=this.resolveLookupParams(t);if(!this.requiresTranslation(r))return e;const o=this.localesCache.get(r);if(!o)return;return o.get({message:e,options:n})}catch(e){return void this.handleError(e)}}async lookupTranslationWithFallback(e,t={}){try{const{locale:r,options:n}=this.resolveLookupParams(t);if(!this.requiresTranslation(r))return e;let o=this.localesCache.get(r);o||(o=await this.localesCache.miss(r));let i=o.get({message:e,options:n});return null==i&&(i=await o.miss({message:e,options:n})),i}catch(e){return void this.handleError(e)}}async getLookupTranslation(e=this.getLocale(),t=[]){try{const r=this.resolveLocale(e);if(!this.requiresTranslation(r))return e=>e;const n=function(e,t,r){return e.flatMap(e=>{const n=e.options.$locale;if(null==n)return[e];try{const o=r(n);return o!==t?[]:[{message:e.message,options:{...e.options,$locale:o}}]}catch{return[]}})}(t,r,e=>this.resolveLocale(e));n.length!==t.length&&mt.warn(`I18nManager: getLookupTranslation(): prefetchEntries must all be the same locale, ignoring all entries that are not for ${r}`);let o=this.localesCache.get(r);return o||(o=await this.localesCache.miss(r)),o?(await Promise.all(n.filter(e=>null==o.get(e)).map(e=>o.miss(e))),(e,t={})=>o.get({message:e,options:this.resolveLookupOptions(t)})):()=>{}}catch(e){return this.handleError(e),e=>e}}async getTranslations(e=this.getLocale()){try{return this.loadTranslations(e)}catch(e){return this.handleError(e),{}}}async getTranslationResolver(e=this.getLocale()){return this.getLookupTranslation(e)}requiresTranslation(e=this.getLocale()){const t=this.getDefaultLocale(),r=this.getLocales();return this.isTranslationEnabled()&&this.localeConfig.requiresTranslation(e,t,r)}requiresDialectTranslation(e=this.getLocale()){const t=this.getDefaultLocale();return this.requiresTranslation(e)&&this.localeConfig.isSameLanguage(t,e)}handleError(e){if("development"===this.config.environment)throw e;mt.error("I18nManager: "+e)}resolveLocale(e){const t=this.localeConfig.determineLocale(e);if(!this.localeConfig.isValidLocale(e)||!t)throw new Error(`I18nManager: validateLocale(): locale ${e} is not valid`);return t}resolveLookupParams(e={}){const t=this.resolveLocale(e.$locale??this.getLocale());return{locale:t,options:this.resolveLookupOptions(e,t)}}resolveLookupOptions(e={},t){return e.$locale?{...e,$locale:t??this.resolveLocale(e.$locale)}:e}getGTClassClean(e){return new t.GT({sourceLocale:this.config.defaultLocale,targetLocale:e,locales:this.config.locales,customMapping:this.config.customMapping,projectId:this.config.projectId,baseUrl:this.config.runtimeUrl||void 0,apiKey:this.config.apiKey,devApiKey:this.config.devApiKey})}};function Nt(t){return{defaultLocale:e.standardizeLocale(t.defaultLocale),locales:t.locales.map(r=>("string"==typeof t.customMapping?.[r]?t.customMapping?.[r]:t.customMapping?.[r]?.code)?r:e.standardizeLocale(r)),customMapping:Object.fromEntries(Object.entries(t.customMapping||{}).map(([t,r])=>[t,"string"==typeof r?e.standardizeLocale(r):{...r,...r.code?{code:e.standardizeLocale(r.code)}:{}}]))}}let Ut;function Gt(){return Ut||(mt.warn("getI18nManager(): Translation failed because I18nManager not initialized."),Ut=new Rt({defaultLocale:r,locales:[r]})),Ut}function Dt({source:e,target:t,options:r}){return null!=t?kt(t,{$_fallback:e,...r}):kt(e,{...r,$locale:Gt().getDefaultLocale()})}function kt(t,r){switch(r.$format??"STRING"){case"ICU":return bt(t,r);case"I18NEXT":case"STRING":return function(t,r){return e.formatCutoff(t,{locales:r.$locale??r.$_locales,maxChars:r.$maxChars})}(t,r);default:return t}}function jt(e,t){const{$format:r=t,$locale:n,...o}=e;return{...o,$format:r,$locale:n??Gt().getLocale()}}const xt=(e,t={})=>function(e,t){const r=jt(t,"STRING"),n=Gt().lookupTranslation(e,r);if(null!=n)return Dt({source:e,target:n,options:r})}(e,{$format:"ICU",...t}),Ft=(e,t={})=>function(e,t){const r=jt(t,"STRING");return Dt({source:e,target:Gt().lookupTranslation(e,r),options:r})}(e,{$format:"ICU",...t});globalThis.t=(e,...t)=>{var r;return"undefined"==typeof window&&console.warn(`gt-react Warning: Translation failed for t("${"string"==typeof(r=e)?r:"`"+(null==r?void 0:r.join("${}"))+"`"}") because it was used outside of a browser environment. Falling back to original message.`),"string"==typeof e?Ft(e,t.at(0)):function(e,t){const r=function(e,t){return e.map((e,r)=>{var n;return e+(null!==(n=t[r])&&void 0!==n?n:"")}).join("")}(e,t),n=xt(r);if(n)return n;const{message:o,variables:i}=function(e,t){const r=[],n={};let o=0;for(let i=0;i<e.length;i++)if(r.push(e[i]),i<t.length){const e=o.toString();r.push(`{${e}}`),n[e]=t[i],o++}return{message:r.join(""),variables:n}}(e,t);return Ft(o,i)}(e,t)};
|
|
2
2
|
//# sourceMappingURL=macros.cjs.min.cjs.map
|