1"use strict"; 2(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[9878],{ 3 4/***/ 41377: 5/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 6 7/* harmony export */ __webpack_require__.d(__webpack_exports__, { 8/* harmony export */ A: function() { return /* binding */ strategies; }, 9/* harmony export */ H: function() { return /* binding */ memoize; } 10/* harmony export */ }); 11//#region packages/fast-memoize/index.ts 12function memoize(fn, options) { 13 const cache = options && options.cache ? options.cache : cacheDefault; 14 const serializer = options && options.serializer ? options.serializer : serializerDefault; 15 return (options && options.strategy ? options.strategy : strategyDefault)(fn, { 16 cache, 17 serializer 18 }); 19} 20function isPrimitive(value) { 21 return value == null || typeof value === "number" || typeof value === "boolean"; 22} 23function monadic(fn, cache, serializer, arg) { 24 const cacheKey = isPrimitive(arg) ? arg : serializer(arg); 25 let computedValue = cache.get(cacheKey); 26 if (typeof computedValue === "undefined") { 27 computedValue = fn.call(this, arg); 28 cache.set(cacheKey, computedValue); 29 } 30 return computedValue; 31} 32function variadic(fn, cache, serializer) { 33 const args = Array.prototype.slice.call(arguments, 3); 34 const cacheKey = serializer(args); 35 let computedValue = cache.get(cacheKey); 36 if (typeof computedValue === "undefined") { 37 computedValue = fn.apply(this, args); 38 cache.set(cacheKey, computedValue); 39 } 40 return computedValue; 41} 42function assemble(fn, context, strategy, cache, serialize) { 43 return strategy.bind(context, fn, cache, serialize); 44} 45function strategyDefault(fn, options) { 46 const strategy = fn.length === 1 ? monadic : variadic; 47 return assemble(fn, this, strategy, options.cache.create(), options.serializer); 48} 49function strategyVariadic(fn, options) { 50 return assemble(fn, this, variadic, options.cache.create(), options.serializer); 51} 52function strategyMonadic(fn, options) { 53 return assemble(fn, this, monadic, options.cache.create(), options.serializer); 54} 55const serializerDefault = function() { 56 return JSON.stringify(arguments); 57}; 58var ObjectWithoutPrototypeCache = class { 59 constructor() { 60 this.cache = Object.create(null); 61 } 62 get(key) { 63 return this.cache[key]; 64 } 65 set(key, value) { 66 this.cache[key] = value; 67 } 68}; 69const cacheDefault = { create: function create() { 70 return new ObjectWithoutPrototypeCache(); 71} }; 72const strategies = { 73 variadic: strategyVariadic, 74 monadic: strategyMonadic 75}; 76//#endregion 77 78 79//# sourceMappingURL=index.js.map 80 81/***/ }), 82 83/***/ 49878: 84/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 85 86/* harmony export */ __webpack_require__.d(__webpack_exports__, { 87/* harmony export */ "default": function() { return /* binding */ t; } 88/* harmony export */ }); 89/* harmony import */ var use_intl_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55773); 90/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44951); 91/* __next_internal_client_entry_do_not_use__ default auto */ 92 93function t(param) { 94 let { locale: t, ...e } = param; 95 if (!t) throw new Error(void 0); 96 return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(use_intl_react__WEBPACK_IMPORTED_MODULE_0__/* .IntlProvider */ .Pj, { 97 locale: t, 98 ...e 99 }); 100} 101 102 103 104/***/ }), 105 106/***/ 80723: 107/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 108 109/* harmony export */ __webpack_require__.d(__webpack_exports__, { 110/* harmony export */ I: function() { return /* binding */ a; }, 111/* harmony export */ a: function() { return /* binding */ r; }, 112/* harmony export */ b: function() { return /* binding */ s; }, 113/* harmony export */ c: function() { return /* binding */ l; }, 114/* harmony export */ m: function() { return /* binding */ i; } 115/* harmony export */ }); 116/* harmony import */ var _formatjs_fast_memoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41377); 117class a extends Error{constructor(e,t){let a=e;t&&(a+=": "+t),super(a),this.code=e,t&&(this.originalMessage=t)}}var r=function(e){return e.MISSING_MESSAGE="MISSING_MESSAGE",e.MISSING_FORMAT="MISSING_FORMAT",e.ENVIRONMENT_FALLBACK="ENVIRONMENT_FALLBACK",e.INSUFFICIENT_PATH="INSUFFICIENT_PATH",e.INVALID_MESSAGE="INVALID_MESSAGE",e.INVALID_KEY="INVALID_KEY",e.FORMATTING_ERROR="FORMATTING_ERROR",e}(r||{});function s(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function i(a,r){return (0,_formatjs_fast_memoize__WEBPACK_IMPORTED_MODULE_0__/* .memoize */ .H)(a,{cache:(s=r,{create:()=>({get:e=>s[e],set(e,t){s[e]=t}})}),strategy:_formatjs_fast_memoize__WEBPACK_IMPORTED_MODULE_0__/* .strategies */ .A.variadic});var s}function I(e,t){return i(((...t)=>new e(...t)),t)}function l(e){return{getDateTimeFormat:I(Intl.DateTimeFormat,e.dateTime),getNumberFormat:I(Intl.NumberFormat,e.number),getPluralRules:I(Intl.PluralRules,e.pluralRules),getRelativeTimeFormat:I(Intl.RelativeTimeFormat,e.relativeTime),getListFormat:I(Intl.ListFormat,e.list),getDisplayNames:I(Intl.DisplayNames,e.displayNames)}} 118 119 120/***/ }), 121 122/***/ 19080: 123/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 124 125 126// EXPORTS 127__webpack_require__.d(__webpack_exports__, { 128 a: function() { return /* binding */ f; },
vendor: 12,843 bytes, lines 129-531
129 c: function() { return /* binding */ S; }, 130 i: function() { return /* binding */ M; }, 131 r: function() { return /* binding */ l; } 132}); 133 134// UNUSED EXPORTS: b, d 135 136// EXTERNAL MODULE: ./node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/react/index.js 137var react = __webpack_require__(25529); 138// EXTERNAL MODULE: ./node_modules/.pnpm/@[email protected]/node_modules/@formatjs/fast-memoize/index.js 139var fast_memoize = __webpack_require__(41377); 140;// CONCATENATED MODULE: ./node_modules/.pnpm/@[email protected]/node_modules/@formatjs/icu-skeleton-parser/index.js 141//#region packages/icu-skeleton-parser/date-time.ts 142/** 143* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table 144* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js 145* with some tweaks 146*/ 147const DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; 148/** 149* Parse Date time skeleton into Intl.DateTimeFormatOptions 150* Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table 151* @public 152* @param skeleton skeleton string 153*/ 154function parseDateTimeSkeleton(skeleton) { 155 const result = {}; 156 skeleton.replace(DATE_TIME_REGEX, (match) => { 157 const len = match.length; 158 switch (match[0]) { 159 case "G": 160 result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short"; 161 break; 162 case "y": 163 result.year = len === 2 ? "2-digit" : "numeric"; 164 break; 165 case "Y": 166 case "u": 167 case "U": 168 case "r": throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead"); 169 case "q": 170 case "Q": throw new RangeError("`q/Q` (quarter) patterns are not supported"); 171 case "M": 172 case "L": 173 result.month = [ 174 "numeric", 175 "2-digit", 176 "short", 177 "long", 178 "narrow" 179 ][len - 1]; 180 break; 181 case "w": 182 case "W": throw new RangeError("`w/W` (week) patterns are not supported"); 183 case "d": 184 result.day = ["numeric", "2-digit"][len - 1]; 185 break; 186 case "D": 187 case "F": 188 case "g": throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead"); 189 case "E": 190 result.weekday = len === 4 ? "long" : len === 5 ? "narrow" : "short"; 191 break; 192 case "e": 193 if (len < 4) throw new RangeError("`e..eee` (weekday) patterns are not supported"); 194 result.weekday = [ 195 "short", 196 "long", 197 "narrow", 198 "short" 199 ][len - 4]; 200 break; 201 case "c": 202 if (len < 4) throw new RangeError("`c..ccc` (weekday) patterns are not supported"); 203 result.weekday = [ 204 "short", 205 "long", 206 "narrow", 207 "short" 208 ][len - 4]; 209 break; 210 case "a": 211 result.hour12 = true; 212 break; 213 case "b": 214 case "B": throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead"); 215 case "h": 216 result.hourCycle = "h12"; 217 result.hour = ["numeric", "2-digit"][len - 1]; 218 break; 219 case "H": 220 result.hourCycle = "h23"; 221 result.hour = ["numeric", "2-digit"][len - 1]; 222 break; 223 case "K": 224 result.hourCycle = "h11"; 225 result.hour = ["numeric", "2-digit"][len - 1]; 226 break; 227 case "k": 228 result.hourCycle = "h24"; 229 result.hour = ["numeric", "2-digit"][len - 1]; 230 break; 231 case "j": 232 case "J": 233 case "C": throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead"); 234 case "m": 235 result.minute = ["numeric", "2-digit"][len - 1]; 236 break; 237 case "s": 238 result.second = ["numeric", "2-digit"][len - 1]; 239 break; 240 case "S": 241 case "A": throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead"); 242 case "z": 243 result.timeZoneName = len < 4 ? "short" : "long"; 244 break; 245 case "Z": 246 case "O": 247 case "v": 248 case "V": 249 case "X": 250 case "x": throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead"); 251 } 252 return ""; 253 }); 254 return result; 255} 256//#endregion 257//#region node_modules/.aspect_rules_js/@[email protected]/node_modules/@formatjs_generated/unicode/icu-skeleton-parser-regex.js 258const WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; 259//#endregion 260//#region packages/icu-skeleton-parser/number.ts 261function parseNumberSkeletonFromString(skeleton) { 262 if (skeleton.length === 0) throw new Error("Number skeleton cannot be empty"); 263 const stringTokens = skeleton.split(WHITE_SPACE_REGEX).filter((x) => x.length > 0); 264 const tokens = []; 265 for (const stringToken of stringTokens) { 266 let stemAndOptions = stringToken.split("/"); 267 if (stemAndOptions.length === 0) throw new Error("Invalid number skeleton"); 268 const [stem, ...options] = stemAndOptions; 269 for (const option of options) if (option.length === 0) throw new Error("Invalid number skeleton"); 270 tokens.push({ 271 stem, 272 options 273 }); 274 } 275 return tokens; 276} 277function icuUnitToEcma(unit) { 278 return unit.replace(/^(.*?)-/, ""); 279} 280const FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g; 281const SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g; 282const INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g; 283const CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/; 284function parseSignificantPrecision(str) { 285 const result = {}; 286 if (str[str.length - 1] === "r") result.roundingPriority = "morePrecision"; 287 else if (str[str.length - 1] === "s") result.roundingPriority = "lessPrecision"; 288 str.replace(SIGNIFICANT_PRECISION_REGEX, function(_, g1, g2) { 289 if (typeof g2 !== "string") { 290 result.minimumSignificantDigits = g1.length; 291 result.maximumSignificantDigits = g1.length; 292 } else if (g2 === "+") result.minimumSignificantDigits = g1.length; 293 else if (g1[0] === "#") result.maximumSignificantDigits = g1.length; 294 else { 295 result.minimumSignificantDigits = g1.length; 296 result.maximumSignificantDigits = g1.length + (typeof g2 === "string" ? g2.length : 0); 297 } 298 return ""; 299 }); 300 return result; 301} 302function parseSign(str) { 303 switch (str) { 304 case "sign-auto": return { signDisplay: "auto" }; 305 case "sign-accounting": 306 case "()": return { currencySign: "accounting" }; 307 case "sign-always": 308 case "+!": return { signDisplay: "always" }; 309 case "sign-accounting-always": 310 case "()!": return { 311 signDisplay: "always", 312 currencySign: "accounting" 313 }; 314 case "sign-except-zero": 315 case "+?": return { signDisplay: "exceptZero" }; 316 case "sign-accounting-except-zero": 317 case "()?": return { 318 signDisplay: "exceptZero", 319 currencySign: "accounting" 320 }; 321 case "sign-never": 322 case "+_": return { signDisplay: "never" }; 323 } 324} 325function parseConciseScientificAndEngineeringStem(stem) { 326 let result; 327 if (stem[0] === "E" && stem[1] === "E") { 328 result = { notation: "engineering" }; 329 stem = stem.slice(2); 330 } else if (stem[0] === "E") { 331 result = { notation: "scientific" }; 332 stem = stem.slice(1); 333 } 334 if (result) { 335 const signDisplay = stem.slice(0, 2); 336 if (signDisplay === "+!") { 337 result.signDisplay = "always"; 338 stem = stem.slice(2); 339 } else if (signDisplay === "+?") { 340 result.signDisplay = "exceptZero"; 341 stem = stem.slice(2); 342 } 343 if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) throw new Error("Malformed concise eng/scientific notation"); 344 result.minimumIntegerDigits = stem.length; 345 } 346 return result; 347} 348function parseNotationOptions(opt) { 349 const result = {}; 350 const signOpts = parseSign(opt); 351 if (signOpts) return signOpts; 352 return result; 353} 354/** 355* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options 356*/ 357function parseNumberSkeleton(tokens) { 358 let result = {}; 359 for (const token of tokens) { 360 switch (token.stem) { 361 case "percent": 362 case "%": 363 result.style = "percent"; 364 continue; 365 case "%x100": 366 result.style = "percent"; 367 result.scale = 100; 368 continue; 369 case "currency": 370 result.style = "currency"; 371 result.currency = token.options[0]; 372 continue; 373 case "group-off": 374 case ",_": 375 result.useGrouping = false; 376 continue; 377 case "precision-integer": 378 case ".": 379 result.maximumFractionDigits = 0; 380 continue; 381 case "measure-unit": 382 case "unit": 383 result.style = "unit"; 384 result.unit = icuUnitToEcma(token.options[0]); 385 continue; 386 case "compact-short": 387 case "K": 388 result.notation = "compact"; 389 result.compactDisplay = "short"; 390 continue; 391 case "compact-long": 392 case "KK": 393 result.notation = "compact"; 394 result.compactDisplay = "long"; 395 continue; 396 case "scientific": 397 result = { 398 ...result, 399 notation: "scientific", 400 ...token.options.reduce((all, opt) => ({ 401 ...all, 402 ...parseNotationOptions(opt) 403 }), {}) 404 }; 405 continue; 406 case "engineering": 407 result = { 408 ...result, 409 notation: "engineering", 410 ...token.options.reduce((all, opt) => ({ 411 ...all, 412 ...parseNotationOptions(opt) 413 }), {}) 414 }; 415 continue; 416 case "notation-simple": 417 result.notation = "standard"; 418 continue; 419 case "unit-width-narrow": 420 result.currencyDisplay = "narrowSymbol"; 421 result.unitDisplay = "narrow"; 422 continue; 423 case "unit-width-short": 424 result.currencyDisplay = "code"; 425 result.unitDisplay = "short"; 426 continue; 427 case "unit-width-full-name": 428 result.currencyDisplay = "name"; 429 result.unitDisplay = "long"; 430 continue; 431 case "unit-width-iso-code": 432 result.currencyDisplay = "symbol"; 433 continue; 434 case "scale": 435 result.scale = parseFloat(token.options[0]); 436 continue; 437 case "rounding-mode-floor": 438 result.roundingMode = "floor"; 439 continue; 440 case "rounding-mode-ceiling": 441 result.roundingMode = "ceil"; 442 continue; 443 case "rounding-mode-down": 444 result.roundingMode = "trunc"; 445 continue; 446 case "rounding-mode-up": 447 result.roundingMode = "expand"; 448 continue; 449 case "rounding-mode-half-even": 450 result.roundingMode = "halfEven"; 451 continue; 452 case "rounding-mode-half-down": 453 result.roundingMode = "halfTrunc"; 454 continue; 455 case "rounding-mode-half-up": 456 result.roundingMode = "halfExpand"; 457 continue; 458 case "integer-width": 459 if (token.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option"); 460 token.options[0].replace(INTEGER_WIDTH_REGEX, function(_, g1, g2, g3, g4, g5) { 461 if (g1) result.minimumIntegerDigits = g2.length; 462 else if (g3 && g4) throw new Error("We currently do not support maximum integer digits"); 463 else if (g5) throw new Error("We currently do not support exact integer digits"); 464 return ""; 465 }); 466 continue; 467 } 468 if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) { 469 result.minimumIntegerDigits = token.stem.length; 470 continue; 471 } 472 if (FRACTION_PRECISION_REGEX.test(token.stem)) { 473 if (token.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option"); 474 token.stem.replace(FRACTION_PRECISION_REGEX, function(_, g1, g2, g3, g4, g5) { 475 if (g2 === "*") result.minimumFractionDigits = g1.length; 476 else if (g3 && g3[0] === "#") result.maximumFractionDigits = g3.length; 477 else if (g4 && g5) { 478 result.minimumFractionDigits = g4.length; 479 result.maximumFractionDigits = g4.length + g5.length; 480 } else { 481 result.minimumFractionDigits = g1.length; 482 result.maximumFractionDigits = g1.length; 483 } 484 return ""; 485 }); 486 const opt = token.options[0]; 487 if (opt === "w") result = { 488 ...result, 489 trailingZeroDisplay: "stripIfInteger" 490 }; 491 else if (opt) result = { 492 ...result, 493 ...parseSignificantPrecision(opt) 494 }; 495 continue; 496 } 497 if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) { 498 result = { 499 ...result, 500 ...parseSignificantPrecision(token.stem) 501 }; 502 continue; 503 } 504 const signOpts = parseSign(token.stem); 505 if (signOpts) result = { 506 ...result, 507 ...signOpts 508 }; 509 const conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem); 510 if (conciseScientificAndEngineeringOpts) result = { 511 ...result, 512 ...conciseScientificAndEngineeringOpts 513 }; 514 } 515 return result; 516} 517//#endregion 518 519 520//# sourceMappingURL=index.js.map 521;// CONCATENATED MODULE: ./node_modules/.pnpm/@[email protected]/node_modules/@formatjs/icu-messageformat-parser/index.js 522 523//#region packages/icu-messageformat-parser/error.ts 524let ErrorKind = /* @__PURE__ */ function(ErrorKind) { 525 /** Argument is unclosed (e.g. `{0`) */ 526 ErrorKind[ErrorKind["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE"; 527 /** Argument is empty (e.g. `{}`). */ 528 ErrorKind[ErrorKind["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT"; 529 /** Argument is malformed (e.g. `{foo!}``) */ 530 ErrorKind[ErrorKind["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT"; 531 /** Expect an argument type (e.g. `{foo,}`) */
vendor: 16,384 bytes, lines 532-1872
532 ErrorKind[ErrorKind["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE"; 533 /** Unsupported argument type (e.g. `{foo,foo}`) */ 534 ErrorKind[ErrorKind["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE"; 535 /** Expect an argument style (e.g. `{foo, number, }`) */ 536 ErrorKind[ErrorKind["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE"; 537 /** The number skeleton is invalid. */ 538 ErrorKind[ErrorKind["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON"; 539 /** The date time skeleton is invalid. */ 540 ErrorKind[ErrorKind["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON"; 541 /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */ 542 ErrorKind[ErrorKind["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON"; 543 /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */ 544 ErrorKind[ErrorKind["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON"; 545 /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */ 546 ErrorKind[ErrorKind["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"; 547 /** Missing select argument options (e.g. `{foo, select}`) */ 548 ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS"; 549 /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */ 550 ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"; 551 /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */ 552 ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"; 553 /** Expecting a selector in `select` argument (e.g `{foo, select}`) */ 554 ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR"; 555 /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */ 556 ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR"; 557 /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */ 558 ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"; 559 /** 560 * Expecting a message fragment after the `plural` or `selectordinal` selector 561 * (e.g. `{foo, plural, one}`) 562 */ 563 ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"; 564 /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */ 565 ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR"; 566 /** 567 * Duplicate selectors in `plural` or `selectordinal` argument. 568 * (e.g. {foo, plural, one {#} one {#}}) 569 */ 570 ErrorKind[ErrorKind["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR"; 571 /** Duplicate selectors in `select` argument. 572 * (e.g. {foo, select, apple {apple} apple {apple}}) 573 */ 574 ErrorKind[ErrorKind["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR"; 575 /** Plural or select argument option must have `other` clause. */ 576 ErrorKind[ErrorKind["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE"; 577 /** The tag is malformed. (e.g. `<bold!>foo</bold!>) */ 578 ErrorKind[ErrorKind["INVALID_TAG"] = 23] = "INVALID_TAG"; 579 /** The tag name is invalid. (e.g. `<123>foo</123>`) */ 580 ErrorKind[ErrorKind["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME"; 581 /** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */ 582 ErrorKind[ErrorKind["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG"; 583 /** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */ 584 ErrorKind[ErrorKind["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG"; 585 return ErrorKind; 586}({}); 587//#endregion 588//#region packages/icu-messageformat-parser/types.ts 589let TYPE = /* @__PURE__ */ function(TYPE) { 590 /** 591 * Raw text 592 */ 593 TYPE[TYPE["literal"] = 0] = "literal"; 594 /** 595 * Variable w/o any format, e.g `var` in `this is a {var}` 596 */ 597 TYPE[TYPE["argument"] = 1] = "argument"; 598 /** 599 * Variable w/ number format 600 */ 601 TYPE[TYPE["number"] = 2] = "number"; 602 /** 603 * Variable w/ date format 604 */ 605 TYPE[TYPE["date"] = 3] = "date"; 606 /** 607 * Variable w/ time format 608 */ 609 TYPE[TYPE["time"] = 4] = "time"; 610 /** 611 * Variable w/ select format 612 */ 613 TYPE[TYPE["select"] = 5] = "select"; 614 /** 615 * Variable w/ plural format 616 */ 617 TYPE[TYPE["plural"] = 6] = "plural"; 618 /** 619 * Only possible within plural argument. 620 * This is the `#` symbol that will be substituted with the count. 621 */ 622 TYPE[TYPE["pound"] = 7] = "pound"; 623 /** 624 * XML-like tag 625 */ 626 TYPE[TYPE["tag"] = 8] = "tag"; 627 return TYPE; 628}({}); 629let SKELETON_TYPE = /* @__PURE__ */ function(SKELETON_TYPE) { 630 SKELETON_TYPE[SKELETON_TYPE["number"] = 0] = "number"; 631 SKELETON_TYPE[SKELETON_TYPE["dateTime"] = 1] = "dateTime"; 632 return SKELETON_TYPE; 633}({}); 634/** 635* Type Guards 636*/ 637function isLiteralElement(el) { 638 return el.type === 0; 639} 640function isArgumentElement(el) { 641 return el.type === 1; 642} 643function isNumberElement(el) { 644 return el.type === 2; 645} 646function isDateElement(el) { 647 return el.type === 3; 648} 649function isTimeElement(el) { 650 return el.type === 4; 651} 652function isSelectElement(el) { 653 return el.type === 5; 654} 655function isPluralElement(el) { 656 return el.type === 6; 657} 658function isPoundElement(el) { 659 return el.type === 7; 660} 661function isTagElement(el) { 662 return el.type === 8; 663} 664function isNumberSkeleton(el) { 665 return !!(el && typeof el === "object" && el.type === 0); 666} 667function isDateTimeSkeleton(el) { 668 return !!(el && typeof el === "object" && el.type === 1); 669} 670function createLiteralElement(value) { 671 return { 672 type: 0, 673 value 674 }; 675} 676function createNumberElement(value, style) { 677 return { 678 type: 2, 679 value, 680 style 681 }; 682} 683//#endregion 684//#region node_modules/.aspect_rules_js/@[email protected]/node_modules/@formatjs_generated/unicode/icu-messageformat-parser-regex.js 685const SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/; 686//#endregion 687//#region node_modules/.aspect_rules_js/@[email protected]/node_modules/@formatjs_generated/cldr.core/time-data.js 688const timeData = { 689 "001": ["H", "h"], 690 "419": [ 691 "h", 692 "H", 693 "hB", 694 "hb" 695 ], 696 "AC": [ 697 "H", 698 "h", 699 "hb", 700 "hB" 701 ], 702 "AD": ["H", "hB"], 703 "AE": [ 704 "h", 705 "hB", 706 "hb", 707 "H" 708 ], 709 "AF": [ 710 "H", 711 "hb", 712 "hB", 713 "h" 714 ], 715 "AG": [ 716 "h", 717 "hb", 718 "H", 719 "hB" 720 ], 721 "AI": [ 722 "H", 723 "h", 724 "hb", 725 "hB" 726 ], 727 "AL": [ 728 "h", 729 "H", 730 "hB" 731 ], 732 "AM": ["H", "hB"], 733 "AO": ["H", "hB"], 734 "AR": [ 735 "h", 736 "H", 737 "hB", 738 "hb" 739 ], 740 "AS": ["h", "H"], 741 "AT": ["H", "hB"], 742 "AU": [ 743 "h", 744 "hb", 745 "H", 746 "hB" 747 ], 748 "AW": ["H", "hB"], 749 "AX": ["H"], 750 "AZ": [ 751 "H", 752 "hB", 753 "h" 754 ], 755 "BA": [ 756 "H", 757 "hB", 758 "h" 759 ], 760 "BB": [ 761 "h", 762 "hb", 763 "H", 764 "hB" 765 ], 766 "BD": [ 767 "h", 768 "hB", 769 "H" 770 ], 771 "BE": ["H", "hB"], 772 "BF": ["H", "hB"], 773 "BG": [ 774 "H", 775 "hB", 776 "h" 777 ], 778 "BH": [ 779 "h", 780 "hB", 781 "hb", 782 "H" 783 ], 784 "BI": ["H", "h"], 785 "BJ": ["H", "hB"], 786 "BL": ["H", "hB"], 787 "BM": [ 788 "h", 789 "hb", 790 "H", 791 "hB" 792 ], 793 "BN": [ 794 "hb", 795 "hB", 796 "h", 797 "H" 798 ], 799 "BO": [ 800 "h", 801 "H", 802 "hB", 803 "hb" 804 ], 805 "BQ": ["H"], 806 "BR": ["H", "hB"], 807 "BS": [ 808 "h", 809 "hb", 810 "H", 811 "hB" 812 ], 813 "BT": ["h", "H"], 814 "BW": [ 815 "H", 816 "h", 817 "hb", 818 "hB" 819 ], 820 "BY": ["H", "h"], 821 "BZ": [ 822 "H", 823 "h", 824 "hb", 825 "hB" 826 ], 827 "CA": [ 828 "h", 829 "hb", 830 "H", 831 "hB" 832 ], 833 "CC": [ 834 "H", 835 "h", 836 "hb", 837 "hB" 838 ], 839 "CD": ["hB", "H"], 840 "CF": [ 841 "H", 842 "h", 843 "hB" 844 ], 845 "CG": ["H", "hB"], 846 "CH": [ 847 "H", 848 "hB", 849 "h" 850 ], 851 "CI": ["H", "hB"], 852 "CK": [ 853 "H", 854 "h", 855 "hb", 856 "hB" 857 ], 858 "CL": [ 859 "h", 860 "H", 861 "hB", 862 "hb" 863 ], 864 "CM": [ 865 "H", 866 "h", 867 "hB" 868 ], 869 "CN": [ 870 "H", 871 "hB", 872 "hb", 873 "h" 874 ], 875 "CO": [ 876 "h", 877 "H", 878 "hB", 879 "hb" 880 ], 881 "CP": ["H"], 882 "CR": [ 883 "h", 884 "H", 885 "hB", 886 "hb" 887 ], 888 "CU": [ 889 "h", 890 "H", 891 "hB", 892 "hb" 893 ], 894 "CV": ["H", "hB"], 895 "CW": ["H", "hB"], 896 "CX": [ 897 "H", 898 "h", 899 "hb", 900 "hB" 901 ], 902 "CY": [ 903 "h", 904 "H", 905 "hb", 906 "hB" 907 ], 908 "CZ": ["H"], 909 "DE": ["H", "hB"], 910 "DG": [ 911 "H", 912 "h", 913 "hb", 914 "hB" 915 ], 916 "DJ": ["h", "H"], 917 "DK": ["H"], 918 "DM": [ 919 "h", 920 "hb", 921 "H", 922 "hB" 923 ], 924 "DO": [ 925 "h", 926 "H", 927 "hB", 928 "hb" 929 ], 930 "DZ": [ 931 "h", 932 "hB", 933 "hb", 934 "H" 935 ], 936 "EA": [ 937 "H", 938 "h", 939 "hB", 940 "hb" 941 ], 942 "EC": [ 943 "h", 944 "H", 945 "hB", 946 "hb" 947 ], 948 "EE": ["H", "hB"], 949 "EG": [ 950 "h", 951 "hB", 952 "hb", 953 "H" 954 ], 955 "EH": [ 956 "h", 957 "hB", 958 "hb", 959 "H" 960 ], 961 "ER": ["h", "H"], 962 "ES": [ 963 "H", 964 "hB", 965 "h", 966 "hb" 967 ], 968 "ET": [ 969 "hB", 970 "hb", 971 "h", 972 "H" 973 ], 974 "FI": ["H"], 975 "FJ": [ 976 "h", 977 "hb", 978 "H", 979 "hB" 980 ], 981 "FK": [ 982 "H", 983 "h", 984 "hb", 985 "hB" 986 ], 987 "FM": [ 988 "h", 989 "hb", 990 "H", 991 "hB" 992 ], 993 "FO": ["H", "h"], 994 "FR": ["H", "hB"], 995 "GA": ["H", "hB"], 996 "GB": [ 997 "H", 998 "h", 999 "hb", 1000 "hB" 1001 ], 1002 "GD": [ 1003 "h", 1004 "hb", 1005 "H", 1006 "hB" 1007 ], 1008 "GE": [ 1009 "H", 1010 "hB", 1011 "h" 1012 ], 1013 "GF": ["H", "hB"], 1014 "GG": [ 1015 "H", 1016 "h", 1017 "hb", 1018 "hB" 1019 ], 1020 "GH": ["h", "H"], 1021 "GI": [ 1022 "H", 1023 "h", 1024 "hb", 1025 "hB" 1026 ], 1027 "GL": ["H", "h"], 1028 "GM": [ 1029 "h", 1030 "hb", 1031 "H", 1032 "hB" 1033 ], 1034 "GN": ["H", "hB"], 1035 "GP": ["H", "hB"], 1036 "GQ": [ 1037 "H", 1038 "hB", 1039 "h", 1040 "hb" 1041 ], 1042 "GR": [ 1043 "h", 1044 "H", 1045 "hb", 1046 "hB" 1047 ], 1048 "GS": [ 1049 "H", 1050 "h", 1051 "hb", 1052 "hB" 1053 ], 1054 "GT": [ 1055 "h", 1056 "H", 1057 "hB", 1058 "hb" 1059 ], 1060 "GU": [ 1061 "h", 1062 "hb", 1063 "H", 1064 "hB" 1065 ], 1066 "GW": ["H", "hB"], 1067 "GY": [ 1068 "h", 1069 "hb", 1070 "H", 1071 "hB" 1072 ], 1073 "HK": [ 1074 "h", 1075 "hB", 1076 "hb", 1077 "H" 1078 ], 1079 "HN": [ 1080 "h", 1081 "H", 1082 "hB", 1083 "hb" 1084 ], 1085 "HR": ["H", "hB"], 1086 "HU": ["H", "h"], 1087 "IC": [ 1088 "H", 1089 "h", 1090 "hB", 1091 "hb" 1092 ], 1093 "ID": ["H"], 1094 "IE": [ 1095 "H", 1096 "h", 1097 "hb", 1098 "hB" 1099 ], 1100 "IL": ["H", "hB"], 1101 "IM": [ 1102 "H", 1103 "h", 1104 "hb", 1105 "hB" 1106 ], 1107 "IN": ["h", "H"], 1108 "IO": [ 1109 "H", 1110 "h", 1111 "hb", 1112 "hB" 1113 ], 1114 "IQ": [ 1115 "h", 1116 "hB", 1117 "hb", 1118 "H" 1119 ], 1120 "IR": ["hB", "H"], 1121 "IS": ["H"], 1122 "IT": ["H", "hB"], 1123 "JE": [ 1124 "H", 1125 "h", 1126 "hb", 1127 "hB" 1128 ], 1129 "JM": [ 1130 "h", 1131 "hb", 1132 "H", 1133 "hB" 1134 ], 1135 "JO": [ 1136 "h", 1137 "hB", 1138 "hb", 1139 "H" 1140 ], 1141 "JP": [ 1142 "H", 1143 "K", 1144 "h" 1145 ], 1146 "KE": [ 1147 "hB", 1148 "hb", 1149 "H", 1150 "h" 1151 ], 1152 "KG": [ 1153 "H", 1154 "h", 1155 "hB", 1156 "hb" 1157 ], 1158 "KH": [ 1159 "hB", 1160 "h", 1161 "H", 1162 "hb" 1163 ], 1164 "KI": [ 1165 "h", 1166 "hb", 1167 "H", 1168 "hB" 1169 ], 1170 "KM": [ 1171 "H", 1172 "h", 1173 "hB", 1174 "hb" 1175 ], 1176 "KN": [ 1177 "h", 1178 "hb", 1179 "H", 1180 "hB" 1181 ], 1182 "KP": [ 1183 "h", 1184 "H", 1185 "hB", 1186 "hb" 1187 ], 1188 "KR": [ 1189 "h", 1190 "H", 1191 "hB", 1192 "hb" 1193 ], 1194 "KW": [ 1195 "h", 1196 "hB", 1197 "hb", 1198 "H" 1199 ], 1200 "KY": [ 1201 "h", 1202 "hb", 1203 "H", 1204 "hB" 1205 ], 1206 "KZ": ["H", "hB"], 1207 "LA": [ 1208 "H", 1209 "hb", 1210 "hB", 1211 "h" 1212 ], 1213 "LB": [ 1214 "h", 1215 "hB", 1216 "hb", 1217 "H" 1218 ], 1219 "LC": [ 1220 "h", 1221 "hb", 1222 "H", 1223 "hB" 1224 ], 1225 "LI": [ 1226 "H", 1227 "hB", 1228 "h" 1229 ], 1230 "LK": [ 1231 "H", 1232 "h", 1233 "hB", 1234 "hb" 1235 ], 1236 "LR": [ 1237 "h", 1238 "hb", 1239 "H", 1240 "hB" 1241 ], 1242 "LS": ["h", "H"], 1243 "LT": [ 1244 "H", 1245 "h", 1246 "hb", 1247 "hB" 1248 ], 1249 "LU": [ 1250 "H", 1251 "h", 1252 "hB" 1253 ], 1254 "LV": [ 1255 "H", 1256 "hB", 1257 "hb", 1258 "h" 1259 ], 1260 "LY": [ 1261 "h", 1262 "hB", 1263 "hb", 1264 "H" 1265 ], 1266 "MA": [ 1267 "H", 1268 "h", 1269 "hB", 1270 "hb" 1271 ], 1272 "MC": ["H", "hB"], 1273 "MD": ["H", "hB"], 1274 "ME": [ 1275 "H", 1276 "hB", 1277 "h" 1278 ], 1279 "MF": ["H", "hB"], 1280 "MG": ["H", "h"], 1281 "MH": [ 1282 "h", 1283 "hb", 1284 "H", 1285 "hB" 1286 ], 1287 "MK": [ 1288 "H", 1289 "h", 1290 "hb", 1291 "hB" 1292 ], 1293 "ML": ["H"], 1294 "MM": [ 1295 "hB", 1296 "hb", 1297 "H", 1298 "h" 1299 ], 1300 "MN": [ 1301 "H", 1302 "h", 1303 "hb", 1304 "hB" 1305 ], 1306 "MO": [ 1307 "h", 1308 "hB", 1309 "hb", 1310 "H" 1311 ], 1312 "MP": [ 1313 "h", 1314 "hb", 1315 "H", 1316 "hB" 1317 ], 1318 "MQ": ["H", "hB"], 1319 "MR": [ 1320 "h", 1321 "hB", 1322 "hb", 1323 "H" 1324 ], 1325 "MS": [ 1326 "H", 1327 "h", 1328 "hb", 1329 "hB" 1330 ], 1331 "MT": ["H", "h"], 1332 "MU": ["H", "h"], 1333 "MV": ["H", "h"], 1334 "MW": [ 1335 "h", 1336 "hb", 1337 "H", 1338 "hB" 1339 ], 1340 "MX": [ 1341 "h", 1342 "H", 1343 "hB", 1344 "hb" 1345 ], 1346 "MY": [ 1347 "hb", 1348 "hB", 1349 "h", 1350 "H" 1351 ], 1352 "MZ": ["H", "hB"], 1353 "NA": [ 1354 "h", 1355 "H", 1356 "hB", 1357 "hb" 1358 ], 1359 "NC": ["H", "hB"], 1360 "NE": ["H"], 1361 "NF": [ 1362 "H", 1363 "h", 1364 "hb", 1365 "hB" 1366 ], 1367 "NG": [ 1368 "H", 1369 "h", 1370 "hb", 1371 "hB" 1372 ], 1373 "NI": [ 1374 "h", 1375 "H", 1376 "hB", 1377 "hb" 1378 ], 1379 "NL": ["H", "hB"], 1380 "NO": ["H", "h"], 1381 "NP": [ 1382 "H", 1383 "h", 1384 "hB" 1385 ], 1386 "NR": [ 1387 "H", 1388 "h", 1389 "hb", 1390 "hB" 1391 ], 1392 "NU": [ 1393 "H", 1394 "h", 1395 "hb", 1396 "hB" 1397 ], 1398 "NZ": [ 1399 "h", 1400 "hb", 1401 "H", 1402 "hB" 1403 ], 1404 "OM": [ 1405 "h", 1406 "hB", 1407 "hb", 1408 "H" 1409 ], 1410 "PA": [ 1411 "h", 1412 "H", 1413 "hB", 1414 "hb" 1415 ], 1416 "PE": [ 1417 "h", 1418 "H", 1419 "hB", 1420 "hb" 1421 ], 1422 "PF": [ 1423 "H", 1424 "h", 1425 "hB" 1426 ], 1427 "PG": ["h", "H"], 1428 "PH": [ 1429 "h", 1430 "hB", 1431 "hb", 1432 "H" 1433 ], 1434 "PK": [ 1435 "h", 1436 "hB", 1437 "H" 1438 ], 1439 "PL": ["H", "h"], 1440 "PM": ["H", "hB"], 1441 "PN": [ 1442 "H", 1443 "h", 1444 "hb", 1445 "hB" 1446 ], 1447 "PR": [ 1448 "h", 1449 "H", 1450 "hB", 1451 "hb" 1452 ], 1453 "PS": [ 1454 "h", 1455 "hB", 1456 "hb", 1457 "H" 1458 ], 1459 "PT": ["H", "hB"], 1460 "PW": ["h", "H"], 1461 "PY": [ 1462 "h", 1463 "H", 1464 "hB", 1465 "hb" 1466 ], 1467 "QA": [ 1468 "h", 1469 "hB", 1470 "hb", 1471 "H" 1472 ], 1473 "RE": ["H", "hB"], 1474 "RO": ["H", "hB"], 1475 "RS": [ 1476 "H", 1477 "hB", 1478 "h" 1479 ], 1480 "RU": ["H"], 1481 "RW": ["H", "h"], 1482 "SA": [ 1483 "h", 1484 "hB", 1485 "hb", 1486 "H" 1487 ], 1488 "SB": [ 1489 "h", 1490 "hb", 1491 "H", 1492 "hB" 1493 ], 1494 "SC": [ 1495 "H", 1496 "h", 1497 "hB" 1498 ], 1499 "SD": [ 1500 "h", 1501 "hB", 1502 "hb", 1503 "H" 1504 ], 1505 "SE": ["H"], 1506 "SG": [ 1507 "h", 1508 "hb", 1509 "H", 1510 "hB" 1511 ], 1512 "SH": [ 1513 "H", 1514 "h", 1515 "hb", 1516 "hB" 1517 ], 1518 "SI": ["H", "hB"], 1519 "SJ": ["H"], 1520 "SK": ["H"], 1521 "SL": [ 1522 "h", 1523 "hb", 1524 "H", 1525 "hB" 1526 ], 1527 "SM": [ 1528 "H", 1529 "h", 1530 "hB" 1531 ], 1532 "SN": [ 1533 "H", 1534 "h", 1535 "hB" 1536 ], 1537 "SO": ["h", "H"], 1538 "SR": ["H", "hB"], 1539 "SS": [ 1540 "h", 1541 "hb", 1542 "H", 1543 "hB" 1544 ], 1545 "ST": ["H", "hB"], 1546 "SV": [ 1547 "h", 1548 "H", 1549 "hB", 1550 "hb" 1551 ], 1552 "SX": [ 1553 "H", 1554 "h", 1555 "hb", 1556 "hB" 1557 ], 1558 "SY": [ 1559 "h", 1560 "hB", 1561 "hb", 1562 "H" 1563 ], 1564 "SZ": [ 1565 "h", 1566 "hb", 1567 "H", 1568 "hB" 1569 ], 1570 "TA": [ 1571 "H", 1572 "h", 1573 "hb", 1574 "hB" 1575 ], 1576 "TC": [ 1577 "h", 1578 "hb", 1579 "H", 1580 "hB" 1581 ], 1582 "TD": [ 1583 "h", 1584 "H", 1585 "hB" 1586 ], 1587 "TF": [ 1588 "H", 1589 "h", 1590 "hB" 1591 ], 1592 "TG": ["H", "hB"], 1593 "TH": ["H", "h"], 1594 "TJ": ["H", "h"], 1595 "TL": [ 1596 "H", 1597 "hB", 1598 "hb", 1599 "h" 1600 ], 1601 "TM": ["H", "h"], 1602 "TN": [ 1603 "h", 1604 "hB", 1605 "hb", 1606 "H" 1607 ], 1608 "TO": ["h", "H"], 1609 "TR": ["H", "hB"], 1610 "TT": [ 1611 "h", 1612 "hb", 1613 "H", 1614 "hB" 1615 ], 1616 "TW": [ 1617 "hB", 1618 "hb", 1619 "h", 1620 "H" 1621 ], 1622 "TZ": [ 1623 "hB", 1624 "hb", 1625 "H", 1626 "h" 1627 ], 1628 "UA": [ 1629 "H", 1630 "hB", 1631 "h" 1632 ], 1633 "UG": [ 1634 "hB", 1635 "hb", 1636 "H", 1637 "h" 1638 ], 1639 "UM": [ 1640 "h", 1641 "hb", 1642 "H", 1643 "hB" 1644 ], 1645 "US": [ 1646 "h", 1647 "hb", 1648 "H", 1649 "hB" 1650 ], 1651 "UY": [ 1652 "h", 1653 "H", 1654 "hB", 1655 "hb" 1656 ], 1657 "UZ": [ 1658 "H", 1659 "hB", 1660 "h" 1661 ], 1662 "VA": [ 1663 "H", 1664 "h", 1665 "hB" 1666 ], 1667 "VC": [ 1668 "h", 1669 "hb", 1670 "H", 1671 "hB" 1672 ], 1673 "VE": [ 1674 "h", 1675 "H", 1676 "hB", 1677 "hb" 1678 ], 1679 "VG": [ 1680 "h", 1681 "hb", 1682 "H", 1683 "hB" 1684 ], 1685 "VI": [ 1686 "h", 1687 "hb", 1688 "H", 1689 "hB" 1690 ], 1691 "VN": ["H", "h"], 1692 "VU": ["h", "H"], 1693 "WF": ["H", "hB"], 1694 "WS": ["h", "H"], 1695 "XK": [ 1696 "H", 1697 "hB", 1698 "h" 1699 ], 1700 "YE": [ 1701 "h", 1702 "hB", 1703 "hb", 1704 "H" 1705 ], 1706 "YT": ["H", "hB"], 1707 "ZA": [ 1708 "H", 1709 "h", 1710 "hb", 1711 "hB" 1712 ], 1713 "ZM": [ 1714 "h", 1715 "hb", 1716 "H", 1717 "hB" 1718 ], 1719 "ZW": ["H", "h"], 1720 "af-ZA": [ 1721 "H", 1722 "h", 1723 "hB", 1724 "hb" 1725 ], 1726 "ar-001": [ 1727 "h", 1728 "hB", 1729 "hb", 1730 "H" 1731 ], 1732 "ca-ES": [ 1733 "H", 1734 "h", 1735 "hB" 1736 ], 1737 "en-001": [ 1738 "h", 1739 "hb", 1740 "H", 1741 "hB" 1742 ], 1743 "en-HK": [ 1744 "h", 1745 "hb", 1746 "H", 1747 "hB" 1748 ], 1749 "en-IL": [ 1750 "H", 1751 "h", 1752 "hb", 1753 "hB" 1754 ], 1755 "en-MY": [ 1756 "h", 1757 "hb", 1758 "H", 1759 "hB" 1760 ], 1761 "es-BR": [ 1762 "H", 1763 "h", 1764 "hB", 1765 "hb" 1766 ], 1767 "es-ES": [ 1768 "H", 1769 "h", 1770 "hB", 1771 "hb" 1772 ], 1773 "es-GQ": [ 1774 "H", 1775 "h", 1776 "hB", 1777 "hb" 1778 ], 1779 "fr-CA": [ 1780 "H", 1781 "h", 1782 "hB" 1783 ], 1784 "gl-ES": [ 1785 "H", 1786 "h", 1787 "hB" 1788 ], 1789 "gu-IN": [ 1790 "hB", 1791 "hb", 1792 "h", 1793 "H" 1794 ], 1795 "hi-IN": [ 1796 "hB", 1797 "h", 1798 "H" 1799 ], 1800 "it-CH": [ 1801 "H", 1802 "h", 1803 "hB" 1804 ], 1805 "it-IT": [ 1806 "H", 1807 "h", 1808 "hB" 1809 ], 1810 "kn-IN": [ 1811 "hB", 1812 "h", 1813 "H" 1814 ], 1815 "ku-SY": ["H", "hB"], 1816 "ml-IN": [ 1817 "hB", 1818 "h", 1819 "H" 1820 ], 1821 "mr-IN": [ 1822 "hB", 1823 "hb", 1824 "h", 1825 "H" 1826 ], 1827 "pa-IN": [ 1828 "hB", 1829 "hb", 1830 "h", 1831 "H" 1832 ], 1833 "ta-IN": [ 1834 "hB", 1835 "h", 1836 "hb", 1837 "H" 1838 ], 1839 "te-IN": [ 1840 "hB", 1841 "h", 1842 "H" 1843 ], 1844 "zu-ZA": [ 1845 "H", 1846 "hB", 1847 "hb", 1848 "h" 1849 ] 1850}; 1851//#endregion 1852//#region packages/icu-messageformat-parser/date-time-pattern-generator.ts 1853/** 1854* Returns the best matching date time pattern if a date time skeleton 1855* pattern is provided with a locale. Follows the Unicode specification: 1856* https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns 1857* @param skeleton date time skeleton pattern that possibly includes j, J or C 1858* @param locale 1859*/ 1860function getBestPattern(skeleton, locale) { 1861 let skeletonCopy = ""; 1862 for (let patternPos = 0; patternPos < skeleton.length; patternPos++) { 1863 const patternChar = skeleton.charAt(patternPos); 1864 if (patternChar === "j") { 1865 let extraLength = 0; 1866 while (patternPos + 1 < skeleton.length && skeleton.charAt(patternPos + 1) === patternChar) { 1867 extraLength++; 1868 patternPos++; 1869 } 1870 let hourLen = 1 + (extraLength & 1); 1871 let dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1); 1872 let dayPeriodChar = "a"
vendor: 5,728 bytes, lines 1872-2043
1872; 1873 let hourChar = getDefaultHourSymbolFromLocale(locale); 1874 if (hourChar == "H" || hourChar == "k") dayPeriodLen = 0; 1875 while (dayPeriodLen-- > 0) skeletonCopy += dayPeriodChar; 1876 while (hourLen-- > 0) skeletonCopy = hourChar + skeletonCopy; 1877 } else if (patternChar === "J") skeletonCopy += "H"; 1878 else skeletonCopy += patternChar; 1879 } 1880 return skeletonCopy; 1881} 1882/** 1883* Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle) 1884* of the given `locale` to the corresponding time pattern. 1885* @param locale 1886*/ 1887function getDefaultHourSymbolFromLocale(locale) { 1888 let hourCycle = locale.hourCycle; 1889 if (hourCycle === void 0 && locale.hourCycles && locale.hourCycles.length) hourCycle = locale.hourCycles[0]; 1890 if (hourCycle) switch (hourCycle) { 1891 case "h24": return "k"; 1892 case "h23": return "H"; 1893 case "h12": return "h"; 1894 case "h11": return "K"; 1895 default: throw new Error("Invalid hourCycle"); 1896 } 1897 const languageTag = locale.language; 1898 let regionTag; 1899 if (languageTag !== "root") regionTag = locale.maximize().region; 1900 return (timeData[regionTag || ""] || timeData[languageTag || ""] || timeData[`${languageTag}-001`] || timeData["001"])[0]; 1901} 1902//#endregion 1903//#region packages/icu-messageformat-parser/parser.ts 1904const SPACE_SEPARATOR_START_REGEX = new RegExp(`^${SPACE_SEPARATOR_REGEX.source}*`); 1905const SPACE_SEPARATOR_END_REGEX = new RegExp(`${SPACE_SEPARATOR_REGEX.source}*$`); 1906function createLocation(start, end) { 1907 return { 1908 start, 1909 end 1910 }; 1911} 1912const hasNativeFromEntries = !!Object.fromEntries; 1913const hasTrimStart = !!String.prototype.trimStart; 1914const hasTrimEnd = !!String.prototype.trimEnd; 1915const fromEntries = hasNativeFromEntries ? Object.fromEntries : function fromEntries(entries) { 1916 const obj = {}; 1917 for (const [k, v] of entries) obj[k] = v; 1918 return obj; 1919}; 1920const trimStart = hasTrimStart ? function trimStart(s) { 1921 return s.trimStart(); 1922} : function trimStart(s) { 1923 return s.replace(SPACE_SEPARATOR_START_REGEX, ""); 1924}; 1925const trimEnd = hasTrimEnd ? function trimEnd(s) { 1926 return s.trimEnd(); 1927} : function trimEnd(s) { 1928 return s.replace(SPACE_SEPARATOR_END_REGEX, ""); 1929}; 1930const IDENTIFIER_PREFIX_RE = /* @__PURE__ */ new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); 1931function matchIdentifierAtIndex(s, index) { 1932 IDENTIFIER_PREFIX_RE.lastIndex = index; 1933 return IDENTIFIER_PREFIX_RE.exec(s)[1] ?? ""; 1934} 1935function plainTopLevelEndPosition(message) { 1936 if (message.length === 0) return null; 1937 let line = 1; 1938 let column = 1; 1939 for (let offset = 0; offset < message.length;) { 1940 const code = message.charCodeAt(offset); 1941 switch (code) { 1942 case 35: 1943 case 39: 1944 case 60: 1945 case 123: 1946 case 125: return null; 1947 } 1948 if (code === 10) { 1949 line++; 1950 column = 1; 1951 offset++; 1952 } else { 1953 column++; 1954 if (code >= 55296 && code <= 56319 && offset + 1 < message.length) { 1955 const next = message.charCodeAt(offset + 1); 1956 offset += next >= 56320 && next <= 57343 ? 2 : 1; 1957 } else offset++; 1958 } 1959 } 1960 return { 1961 offset: message.length, 1962 line, 1963 column 1964 }; 1965} 1966var Parser = class { 1967 constructor(message, options = {}) { 1968 this.message = message; 1969 this.position = { 1970 offset: 0, 1971 line: 1, 1972 column: 1 1973 }; 1974 this.ignoreTag = !!options.ignoreTag; 1975 this.locale = options.locale; 1976 this.requiresOtherClause = !!options.requiresOtherClause; 1977 this.shouldParseSkeletons = !!options.shouldParseSkeletons; 1978 } 1979 parse() { 1980 if (this.offset() !== 0) throw Error("parser can only be used once"); 1981 if (this.message.length > 0) { 1982 const firstCode = this.message.charCodeAt(0); 1983 if (firstCode !== 35 && firstCode !== 39 && firstCode !== 60 && firstCode !== 123 && firstCode !== 125) { 1984 const plainEndPosition = plainTopLevelEndPosition(this.message); 1985 if (plainEndPosition) { 1986 const start = this.clonePosition(); 1987 this.position = plainEndPosition; 1988 return { 1989 val: [{ 1990 type: 0, 1991 value: this.message, 1992 location: createLocation(start, this.clonePosition()) 1993 }], 1994 err: null 1995 }; 1996 } 1997 } 1998 } 1999 return this.parseMessage(0, "", false); 2000 } 2001 parseMessage(nestingLevel, parentArgType, expectingCloseTag) { 2002 let elements = []; 2003 while (!this.isEOF()) { 2004 const char = this.char(); 2005 if (char === 123) { 2006 const result = this.parseArgument(nestingLevel, expectingCloseTag); 2007 if (result.err) return result; 2008 elements.push(result.val); 2009 } else if (char === 125 && nestingLevel > 0) break; 2010 else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) { 2011 const position = this.clonePosition(); 2012 this.bump(); 2013 elements.push({ 2014 type: 7, 2015 location: createLocation(position, this.clonePosition()) 2016 }); 2017 } else if (char === 60 && !this.ignoreTag && this.peek() === 47) if (expectingCloseTag) break; 2018 else return this.error(26, createLocation(this.clonePosition(), this.clonePosition())); 2019 else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) { 2020 const result = this.parseTag(nestingLevel, parentArgType); 2021 if (result.err) return result; 2022 elements.push(result.val); 2023 } else { 2024 const result = this.parseLiteral(nestingLevel, parentArgType); 2025 if (result.err) return result; 2026 elements.push(result.val); 2027 } 2028 } 2029 return { 2030 val: elements, 2031 err: null 2032 }; 2033 } 2034 /** 2035 * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the 2036 * [custom element name][] except that a dash is NOT always mandatory and uppercase letters 2037 * are accepted: 2038 * 2039 * ``` 2040 * tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "</" tagName (whitespace)* ">" 2041 * tagName ::= [a-z] (PENChar)* 2042 * PENChar ::= 2043 * "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6
2043] | [#xD8-#xF6] | [#xF8-#x37D] | 2044 * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] | 2045 * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] 2046 * ``` 2047 * 2048 * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name 2049 * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do 2050 * since other tag-based engines like React allow it 2051 */ 2052 parseTag(nestingLevel, parentArgType) { 2053 const startPosition = this.clonePosition(); 2054 this.bump(); 2055 const tagName = this.parseTagName(); 2056 this.bumpSpace(); 2057 if (this.bumpIf("/>")) return { 2058 val: { 2059 type: 0, 2060 value: `<${tagName}/>`, 2061 location: createLocation(startPosition, this.clonePosition()) 2062 }, 2063 err: null 2064 }; 2065 else if (this.bumpIf(">")) { 2066 const childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true); 2067 if (childrenResult.err) return childrenResult; 2068 const children = childrenResult.val; 2069 const endTagStartPosition = this.clonePosition(); 2070 if (this.bumpIf("</")) { 2071 if (this.isEOF() || !_isAlpha(this.char())) return this.error(23, createLocation(endTagStartPosition, this.clonePosition())); 2072 const closingTagNameStartPosition = this.clonePosition(); 2073 if (tagName !== this.parseTagName()) return this.error(26, createLocation(closingTagNameStartPosition, this.clonePosition())); 2074 this.bumpSpace(); 2075 if (!this.bumpIf(">")) return this.error(23, createLocation(endTagStartPosition, this.clonePosition())); 2076 return { 2077 val: { 2078 type: 8, 2079 value: tagName, 2080 children, 2081 location: createLocation(startPosition, this.clonePosition()) 2082 }, 2083 err: null 2084 }; 2085 } else return this.error(27, createLocation(startPosition, this.clonePosition())); 2086 } else return this.error(23, createLocation(startPosition, this.clonePosition())); 2087 } 2088 /** 2089 * This method assumes that the caller has peeked ahead for the first tag character. 2090 */ 2091 parseTagName() { 2092 const startOffset = this.offset(); 2093 this.bump(); 2094 while (!this.isEOF() && _isPotentialElementNameChar(this.char())) this.bump(); 2095 return this.message.slice(startOffset, this.offset()); 2096 } 2097 parseLiteral(nestingLevel, parentArgType) { 2098 const start = this.clonePosition(); 2099 let value = ""; 2100 while (true) { 2101 const parseQuoteResult = this.tryParseQuote(parentArgType); 2102 if (parseQuoteResult) { 2103 value += parseQuoteResult; 2104 continue; 2105 } 2106 const parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType); 2107 if (parseUnquotedResult) { 2108 value += parseUnquotedResult; 2109 continue; 2110 } 2111 const parseLeftAngleResult = this.tryParseLeftAngleBracket(); 2112 if (parseLeftAngleResult) { 2113 value += parseLeftAngleResult; 2114 continue; 2115 } 2116 break; 2117 } 2118 const location = createLocation(start, this.clonePosition()); 2119 return { 2120 val: { 2121 type: 0, 2122 value, 2123 location 2124 }, 2125 err: null 2126 }; 2127 } 2128 tryParseLeftAngleBracket() { 2129 if (!this.isEOF() && this.char() === 60 && (this.ignoreTag || !_isAlphaOrSlash(this.peek() || 0))) { 2130 this.bump(); 2131 return "<"; 2132 } 2133 return null; 2134 } 2135 /** 2136 * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes 2137 * a character that requires quoting (that is, "only where needed"), and works the same in 2138 * nested messages as on the top level of the pattern. The new behavior is otherwise compatible. 2139 */ 2140 tryParseQuote(parentArgType) { 2141 if (this.isEOF() || this.char() !== 39) return null; 2142 switch (this.peek()) { 2143 case 39: 2144 this.bump(); 2145 this.bump(); 2146 return "'"; 2147 case 123: 2148 case 60: 2149 case 62: 2150 case 125: break; 2151 case 35: 2152 if (parentArgType === "plural" || parentArgType === "selectordinal") break; 2153 return null; 2154 default: return null; 2155 } 2156 this.bump(); 2157 const codePoints = [this.char()]; 2158 this.bump(); 2159 while (!this.isEOF()) { 2160 const ch = this.char(); 2161 if (ch === 39) if (this.peek() === 39) { 2162 codePoints.push(39); 2163 this.bump(); 2164 } else { 2165 this.bump(); 2166 break; 2167 } 2168 else codePoints.push(ch); 2169 this.bump(); 2170 } 2171 return String.fromCodePoint(...codePoints); 2172 } 2173 tryParseUnquoted(nestingLevel, parentArgType) { 2174 if (this.isEOF()) return null; 2175 const ch = this.char(); 2176 if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0) return null; 2177 else { 2178 this.bump(); 2179 return String.fromCodePoint(ch); 2180 } 2181 } 2182 parseArgument(nestingLevel, expectingCloseTag) { 2183 const openingBracePosition = this.clonePosition(); 2184 this.bump(); 2185 this.bumpSpace(); 2186 if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); 2187 if (this.char() === 125) { 2188 this.bump(); 2189 return this.error(2, createLocation(openingBracePosition, this.clonePosition())); 2190 } 2191 let value = this.parseIdentifierIfPossible().value; 2192 if (!value) return this.error(3, createLocation(openingBracePosition, this.clonePosition())); 2193 this.bumpSpace(); 2194 if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); 2195 switch (this.char()) { 2196 case 125: 2197 this.bump(); 2198 return { 2199 val: { 2200 type: 1, 2201 value, 2202 location: createLocation(openingBracePosition, this.clonePosition()) 2203 }, 2204 err: null 2205 }; 2206 case 44: 2207 this.bump(); 2208 this.bumpSpace(); 2209 if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); 2210 return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition); 2211 default: return this.error(3, createLocation(openingBracePosition, this.clonePosition())); 2212 } 2213 } 2214 /** 2215 * Advance the parser until the end of the identifier, if it is currently on 2216 * an identifier character. Return an empty string otherwise. 2217 */ 2218 parseIdentifierIfPossible() { 2219 const startingPosition = this.clonePosition(); 2220 const startOffset = this.offset();
vendor: 5,323 bytes, lines 2221-2382
2221 const value = matchIdentifierAtIndex(this.message, startOffset); 2222 const endOffset = startOffset + value.length; 2223 this.bumpTo(endOffset); 2224 return { 2225 value, 2226 location: createLocation(startingPosition, this.clonePosition()) 2227 }; 2228 } 2229 parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition) { 2230 let typeStartPosition = this.clonePosition(); 2231 let argType = this.parseIdentifierIfPossible().value; 2232 let typeEndPosition = this.clonePosition(); 2233 switch (argType) { 2234 case "": return this.error(4, createLocation(typeStartPosition, typeEndPosition)); 2235 case "number": 2236 case "date": 2237 case "time": { 2238 this.bumpSpace(); 2239 let styleAndLocation = null; 2240 if (this.bumpIf(",")) { 2241 this.bumpSpace(); 2242 const styleStartPosition = this.clonePosition(); 2243 const result = this.parseSimpleArgStyleIfPossible(); 2244 if (result.err) return result; 2245 const style = trimEnd(result.val); 2246 if (style.length === 0) return this.error(6, createLocation(this.clonePosition(), this.clonePosition())); 2247 styleAndLocation = { 2248 style, 2249 styleLocation: createLocation(styleStartPosition, this.clonePosition()) 2250 }; 2251 } 2252 const argCloseResult = this.tryParseArgumentClose(openingBracePosition); 2253 if (argCloseResult.err) return argCloseResult; 2254 const location = createLocation(openingBracePosition, this.clonePosition()); 2255 if (styleAndLocation && styleAndLocation.style.startsWith("::")) { 2256 let skeleton = trimStart(styleAndLocation.style.slice(2)); 2257 if (argType === "number") { 2258 const result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation); 2259 if (result.err) return result; 2260 return { 2261 val: { 2262 type: 2, 2263 value, 2264 location, 2265 style: result.val 2266 }, 2267 err: null 2268 }; 2269 } else { 2270 if (skeleton.length === 0) return this.error(10, location); 2271 let dateTimePattern = skeleton; 2272 if (this.locale) dateTimePattern = getBestPattern(skeleton, this.locale); 2273 const style = { 2274 type: 1, 2275 pattern: dateTimePattern, 2276 location: styleAndLocation.styleLocation, 2277 parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {} 2278 }; 2279 return { 2280 val: { 2281 type: argType === "date" ? 3 : 4, 2282 value, 2283 location, 2284 style 2285 }, 2286 err: null 2287 }; 2288 } 2289 } 2290 return { 2291 val: { 2292 type: argType === "number" ? 2 : argType === "date" ? 3 : 4, 2293 value, 2294 location, 2295 style: styleAndLocation?.style ?? null 2296 }, 2297 err: null 2298 }; 2299 } 2300 case "plural": 2301 case "selectordinal": 2302 case "select": { 2303 const typeEndPosition = this.clonePosition(); 2304 this.bumpSpace(); 2305 if (!this.bumpIf(",")) return this.error(12, createLocation(typeEndPosition, { ...typeEndPosition })); 2306 this.bumpSpace(); 2307 let identifierAndLocation = this.parseIdentifierIfPossible(); 2308 let pluralOffset = 0; 2309 if (argType !== "select" && identifierAndLocation.value === "offset") { 2310 if (!this.bumpIf(":")) return this.error(13, createLocation(this.clonePosition(), this.clonePosition())); 2311 this.bumpSpace(); 2312 const result = this.tryParseDecimalInteger(13, 14); 2313 if (result.err) return result; 2314 this.bumpSpace(); 2315 identifierAndLocation = this.parseIdentifierIfPossible(); 2316 pluralOffset = result.val; 2317 } 2318 const optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation); 2319 if (optionsResult.err) return optionsResult; 2320 const argCloseResult = this.tryParseArgumentClose(openingBracePosition); 2321 if (argCloseResult.err) return argCloseResult; 2322 const location = createLocation(openingBracePosition, this.clonePosition()); 2323 if (argType === "select") return { 2324 val: { 2325 type: 5, 2326 value, 2327 options: fromEntries(optionsResult.val), 2328 location 2329 }, 2330 err: null 2331 }; 2332 else return { 2333 val: { 2334 type: 6, 2335 value, 2336 options: fromEntries(optionsResult.val), 2337 offset: pluralOffset, 2338 pluralType: argType === "plural" ? "cardinal" : "ordinal", 2339 location 2340 }, 2341 err: null 2342 }; 2343 } 2344 default: return this.error(5, createLocation(typeStartPosition, typeEndPosition)); 2345 } 2346 } 2347 tryParseArgumentClose(openingBracePosition) { 2348 if (this.isEOF() || this.char() !== 125) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); 2349 this.bump(); 2350 return { 2351 val: true, 2352 err: null 2353 }; 2354 } 2355 /** 2356 * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659 2357 */ 2358 parseSimpleArgStyleIfPossible() { 2359 let nestedBraces = 0; 2360 const startPosition = this.clonePosition(); 2361 while (!this.isEOF()) switch (this.char()) { 2362 case 39: { 2363 this.bump(); 2364 let apostrophePosition = this.clonePosition(); 2365 if (!this.bumpUntil("'")) return this.error(11, createLocation(apostrophePosition, this.clonePosition())); 2366 this.bump(); 2367 break; 2368 } 2369 case 123: 2370 nestedBraces += 1; 2371 this.bump(); 2372 break; 2373 case 125: 2374 if (nestedBraces > 0) nestedBraces -= 1; 2375 else return { 2376 val: this.message.slice(startPosition.offset, this.offset()), 2377 err: null 2378 }; 2379 break; 2380 default: 2381 this.bump(); 2382 break
vendor: 8,286 bytes, lines 2382-2614
2382; 2383 } 2384 return { 2385 val: this.message.slice(startPosition.offset, this.offset()), 2386 err: null 2387 }; 2388 } 2389 parseNumberSkeletonFromString(skeleton, location) { 2390 let tokens = []; 2391 try { 2392 tokens = parseNumberSkeletonFromString(skeleton); 2393 } catch { 2394 return this.error(7, location); 2395 } 2396 return { 2397 val: { 2398 type: 0, 2399 tokens, 2400 location, 2401 parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens) : {} 2402 }, 2403 err: null 2404 }; 2405 } 2406 /** 2407 * @param nesting_level The current nesting level of messages. 2408 * This can be positive when parsing message fragment in select or plural argument options. 2409 * @param parent_arg_type The parent argument's type. 2410 * @param parsed_first_identifier If provided, this is the first identifier-like selector of 2411 * the argument. It is a by-product of a previous parsing attempt. 2412 * @param expecting_close_tag If true, this message is directly or indirectly nested inside 2413 * between a pair of opening and closing tags. The nested message will not parse beyond 2414 * the closing tag boundary. 2415 */ 2416 tryParsePluralOrSelectOptions(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) { 2417 let hasOtherClause = false; 2418 const options = []; 2419 const parsedSelectors = /* @__PURE__ */ new Set(); 2420 let { value: selector, location: selectorLocation } = parsedFirstIdentifier; 2421 while (true) { 2422 if (selector.length === 0) { 2423 const startPosition = this.clonePosition(); 2424 if (parentArgType !== "select" && this.bumpIf("=")) { 2425 const result = this.tryParseDecimalInteger(16, 19); 2426 if (result.err) return result; 2427 selectorLocation = createLocation(startPosition, this.clonePosition()); 2428 selector = this.message.slice(startPosition.offset, this.offset()); 2429 } else break; 2430 } 2431 if (parsedSelectors.has(selector)) return this.error(parentArgType === "select" ? 21 : 20, selectorLocation); 2432 if (selector === "other") hasOtherClause = true; 2433 this.bumpSpace(); 2434 const openingBracePosition = this.clonePosition(); 2435 if (!this.bumpIf("{")) return this.error(parentArgType === "select" ? 17 : 18, createLocation(this.clonePosition(), this.clonePosition())); 2436 const fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag); 2437 if (fragmentResult.err) return fragmentResult; 2438 const argCloseResult = this.tryParseArgumentClose(openingBracePosition); 2439 if (argCloseResult.err) return argCloseResult; 2440 options.push([selector, { 2441 value: fragmentResult.val, 2442 location: createLocation(openingBracePosition, this.clonePosition()) 2443 }]); 2444 parsedSelectors.add(selector); 2445 this.bumpSpace(); 2446 ({value: selector, location: selectorLocation} = this.parseIdentifierIfPossible()); 2447 } 2448 if (options.length === 0) return this.error(parentArgType === "select" ? 15 : 16, createLocation(this.clonePosition(), this.clonePosition())); 2449 if (this.requiresOtherClause && !hasOtherClause) return this.error(22, createLocation(this.clonePosition(), this.clonePosition())); 2450 return { 2451 val: options, 2452 err: null 2453 }; 2454 } 2455 tryParseDecimalInteger(expectNumberError, invalidNumberError) { 2456 let sign = 1; 2457 const startingPosition = this.clonePosition(); 2458 if (this.bumpIf("+")) {} else if (this.bumpIf("-")) sign = -1; 2459 let hasDigits = false; 2460 let decimal = 0; 2461 while (!this.isEOF()) { 2462 const ch = this.char(); 2463 if (ch >= 48 && ch <= 57) { 2464 hasDigits = true; 2465 decimal = decimal * 10 + (ch - 48); 2466 this.bump(); 2467 } else break; 2468 } 2469 const location = createLocation(startingPosition, this.clonePosition()); 2470 if (!hasDigits) return this.error(expectNumberError, location); 2471 decimal *= sign; 2472 if (!Number.isSafeInteger(decimal)) return this.error(invalidNumberError, location); 2473 return { 2474 val: decimal, 2475 err: null 2476 }; 2477 } 2478 offset() { 2479 return this.position.offset; 2480 } 2481 isEOF() { 2482 return this.offset() === this.message.length; 2483 } 2484 clonePosition() { 2485 return { 2486 offset: this.position.offset, 2487 line: this.position.line, 2488 column: this.position.column 2489 }; 2490 } 2491 /** 2492 * Return the code point at the current position of the parser. 2493 * Throws if the index is out of bound. 2494 */ 2495 char() { 2496 const offset = this.position.offset; 2497 if (offset >= this.message.length) throw Error("out of bound"); 2498 const code = this.message.codePointAt(offset); 2499 if (code === void 0) throw Error(`Offset ${offset} is at invalid UTF-16 code unit boundary`); 2500 return code; 2501 } 2502 error(kind, location) { 2503 return { 2504 val: null, 2505 err: { 2506 kind, 2507 message: this.message, 2508 location 2509 } 2510 }; 2511 } 2512 /** Bump the parser to the next UTF-16 code unit. */ 2513 bump() { 2514 if (this.isEOF()) return; 2515 const code = this.char(); 2516 if (code === 10) { 2517 this.position.line += 1; 2518 this.position.column = 1; 2519 this.position.offset += 1; 2520 } else { 2521 this.position.column += 1; 2522 this.position.offset += code < 65536 ? 1 : 2; 2523 } 2524 } 2525 /** 2526 * If the substring starting at the current position of the parser has 2527 * the given prefix, then bump the parser to the character immediately 2528 * following the prefix and return true. Otherwise, don't bump the parser 2529 * and return false. 2530 */ 2531 bumpIf(prefix) { 2532 if (this.message.startsWith(prefix, this.offset())) { 2533 for (let i = 0; i < prefix.length; i++) this.bump(); 2534 return true; 2535 } 2536 return false; 2537 } 2538 /** 2539 * Bump the parser until the pattern character is found and return `true`. 2540 * Otherwise bump to the end of the file and return `false`. 2541 */ 2542 bumpUntil(pattern) { 2543 const currentOffset = this.offset(); 2544 const index = this.message.indexOf(pattern, currentOffset); 2545 if (index >= 0) { 2546 this.bumpTo(index); 2547 return true; 2548 } else { 2549 this.bumpTo(this.message.length); 2550 return false; 2551 } 2552 } 2553 /** 2554 * Bump the parser to the target offset. 2555 * If target offset is beyond the end of the input, bump the parser to the end of the input. 2556 */ 2557 bumpTo(targetOffset) { 2558 if (this.offset() > targetOffset) throw Error(`targetOffset ${targetOffset} must be greater than or equal to the current offset ${this.offset()}`); 2559 targetOffset = Math.min(targetOffset, this.message.length); 2560 while (true) { 2561 const offset = this.offset(); 2562 if (offset === targetOffset) break; 2563 if (offset > targetOffset) throw Error(`targetOffset ${targetOffset} is at invalid UTF-16 code unit boundary`); 2564 this.bump(); 2565 if (this.isEOF()) break; 2566 } 2567 } 2568 /** advance the parser through all whitespace to the next non-whitespace code unit. */ 2569 bumpSpace() { 2570 while (!this.isEOF() && _isWhiteSpace(this.char())) this.bump(); 2571 } 2572 /** 2573 * Peek at the *next* Unicode codepoint in the input without advancing the parser. 2574 * If the input has been exhausted, then this returns null. 2575 */ 2576 peek() { 2577 if (this.isEOF()) return null; 2578 const code = this.char(); 2579 const offset = this.offset(); 2580 return this.message.charCodeAt(offset + (code >= 65536 ? 2 : 1)) ?? null; 2581 } 2582}; 2583/** 2584* This check if codepoint is alphabet (lower & uppercase) 2585* @param codepoint 2586* @returns 2587*/ 2588function _isAlpha(codepoint) { 2589 return codepoint >= 97 && codepoint <= 122 || codepoint >= 65 && codepoint <= 90; 2590} 2591function _isAlphaOrSlash(codepoint) { 2592 return _isAlpha(codepoint) || codepoint === 47; 2593} 2594/** See `parseTag` function docs. */ 2595function _isPotentialElementNameChar(c) { 2596 return c === 45 || c === 46 || c >= 48 && c <= 57 || c === 95 || c >= 97 && c <= 122 || c >= 65 && c <= 90 || c == 183 || c >= 192 && c <= 214 || c >= 216 && c <= 246 || c >= 248 && c <= 893 || c >= 895 && c <= 8191 || c >= 8204 && c <= 8205 || c >= 8255 && c <= 8256 || c >= 8304 && c <= 8591 || c >= 11264 && c <= 12271 || c >= 12289 && c <= 55295 || c >= 63744 && c <= 64975 || c >= 65008 && c <= 65533 || c >= 65536 && c <= 983039; 2597} 2598/** 2599* Code point equivalent of regex `\p{White_Space}`. 2600* From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt 2601*/ 2602function _isWhiteSpace(c) { 2603 return c >= 9 && c <= 13 || c === 32 || c === 133 || c >= 8206 && c <= 8207 || c === 8232 || c === 8233; 2604} 2605//#endregion 2606//#region packages/icu-messageformat-parser/manipulator.ts 2607/** 2608* Collect all variables in an AST to Record<string, TYPE> 2609* @param ast AST to collect variables from 2610* @param vars Record of variable name to variable type 2611*/ 2612function collectVariables(ast, vars = /* @__PURE__ */ new Map()) { 2613 ast.forEach((el) => { 2614 if (isArgumentElement(el) || isDateElement(el) || isTimeElement(el) || isNumberElement(el))
2614if (vars.has(el.value)) { 2615 const existingType = vars.get(el.value); 2616 if (existingType !== el.type && existingType !== 6 && existingType !== 5) throw new Error(`Variable ${el.value} has conflicting types`); 2617 } else vars.set(el.value, el.type); 2618 if (isPluralElement(el) || isSelectElement(el)) { 2619 vars.set(el.value, el.type); 2620 Object.keys(el.options).forEach((k) => { 2621 collectVariables(el.options[k].value, vars); 2622 }); 2623 } 2624 if (isTagElement(el)) { 2625 vars.set(el.value, el.type); 2626 collectVariables(el.children, vars); 2627 } 2628 }); 2629} 2630/** 2631* Check if 2 ASTs are structurally the same. This primarily means that 2632* they have the same variables with the same type 2633* @param a 2634* @param b
vendor: 6,273 bytes, lines 2635-2813
2635* @returns 2636*/ 2637function isStructurallySame(a, b) { 2638 const aVars = /* @__PURE__ */ new Map(); 2639 const bVars = /* @__PURE__ */ new Map(); 2640 collectVariables(a, aVars); 2641 collectVariables(b, bVars); 2642 if (aVars.size !== bVars.size) return { 2643 success: false, 2644 error: /* @__PURE__ */ new Error(`Different number of variables: [${Array.from(aVars.keys()).join(", ")}] vs [${Array.from(bVars.keys()).join(", ")}]`) 2645 }; 2646 return Array.from(aVars.entries()).reduce((result, [key, type]) => { 2647 if (!result.success) return result; 2648 const bType = bVars.get(key); 2649 if (bType == null) return { 2650 success: false, 2651 error: /* @__PURE__ */ new Error(`Missing variable ${key} in message`) 2652 }; 2653 if (bType !== type) return { 2654 success: false, 2655 error: /* @__PURE__ */ new Error(`Variable ${key} has conflicting types: ${TYPE[type]} vs ${TYPE[bType]}`) 2656 }; 2657 return result; 2658 }, { success: true }); 2659} 2660//#endregion 2661//#region packages/icu-messageformat-parser/index.ts 2662function pruneLocation(els) { 2663 els.forEach((el) => { 2664 delete el.location; 2665 if (isSelectElement(el) || isPluralElement(el)) for (const k in el.options) { 2666 delete el.options[k].location; 2667 pruneLocation(el.options[k].value); 2668 } 2669 else if (isNumberElement(el) && isNumberSkeleton(el.style)) delete el.style.location; 2670 else if ((isDateElement(el) || isTimeElement(el)) && isDateTimeSkeleton(el.style)) delete el.style.location; 2671 else if (isTagElement(el)) pruneLocation(el.children); 2672 }); 2673} 2674function parse(message, opts = {}) { 2675 opts = { 2676 shouldParseSkeletons: true, 2677 requiresOtherClause: true, 2678 ...opts 2679 }; 2680 const result = new Parser(message, opts).parse(); 2681 if (result.err) { 2682 const error = SyntaxError(ErrorKind[result.err.kind]); 2683 error.location = result.err.location; 2684 error.originalMessage = result.err.message; 2685 throw error; 2686 } 2687 if (!opts?.captureLocation) pruneLocation(result.val); 2688 return result.val; 2689} 2690const _Parser = (/* unused pure expression or super */ null && (Parser)); 2691//#endregion 2692 2693 2694//# sourceMappingURL=index.js.map 2695;// CONCATENATED MODULE: ./node_modules/.pnpm/[email protected]/node_modules/intl-messageformat/index.js 2696 2697 2698//#region packages/intl-messageformat/error.ts 2699let ErrorCode = /* @__PURE__ */ function(ErrorCode) { 2700 ErrorCode["MISSING_VALUE"] = "MISSING_VALUE"; 2701 ErrorCode["INVALID_VALUE"] = "INVALID_VALUE"; 2702 ErrorCode["MISSING_INTL_API"] = "MISSING_INTL_API"; 2703 return ErrorCode; 2704}({}); 2705var FormatError = class extends Error { 2706 constructor(msg, code, originalMessage) { 2707 super(msg); 2708 this.code = code; 2709 this.originalMessage = originalMessage; 2710 } 2711 toString() { 2712 return `[formatjs Error: ${this.code}] ${this.message}`; 2713 } 2714}; 2715var InvalidValueError = class extends FormatError { 2716 constructor(variableId, value, options, originalMessage) { 2717 super(`Invalid values for "${variableId}": "${value}". Options are "${Object.keys(options).join("\", \"")}"`, "INVALID_VALUE", originalMessage); 2718 } 2719}; 2720var InvalidValueTypeError = class extends FormatError { 2721 constructor(value, type, originalMessage) { 2722 super(`Value for "${value}" must be of type ${type}`, "INVALID_VALUE", originalMessage); 2723 } 2724}; 2725var MissingValueError = class extends FormatError { 2726 constructor(variableId, originalMessage) { 2727 super(`The intl string context variable "${variableId}" was not provided to the string "${originalMessage}"`, "MISSING_VALUE", originalMessage); 2728 } 2729}; 2730//#endregion 2731//#region packages/intl-messageformat/formatters.ts 2732let PART_TYPE = /* @__PURE__ */ function(PART_TYPE) { 2733 PART_TYPE[PART_TYPE["literal"] = 0] = "literal"; 2734 PART_TYPE[PART_TYPE["object"] = 1] = "object"; 2735 return PART_TYPE; 2736}({}); 2737function mergeLiteral(parts) { 2738 if (parts.length < 2) return parts; 2739 return parts.reduce((all, part) => { 2740 const lastPart = all[all.length - 1]; 2741 if (!lastPart || lastPart.type !== 0 || part.type !== 0) all.push(part); 2742 else lastPart.value += part.value; 2743 return all; 2744 }, []); 2745} 2746function isFormatXMLElementFn(el) { 2747 return typeof el === "function"; 2748} 2749function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) { 2750 if (els.length === 1 && isLiteralElement(els[0])) return [{ 2751 type: 0, 2752 value: els[0].value 2753 }]; 2754 const result = []; 2755 for (const el of els) { 2756 if (isLiteralElement(el)) { 2757 result.push({ 2758 type: 0, 2759 value: el.value 2760 }); 2761 continue; 2762 } 2763 if (isPoundElement(el)) { 2764 if (typeof currentPluralValue === "number") result.push({ 2765 type: 0, 2766 value: formatters.getNumberFormat(locales).format(currentPluralValue) 2767 }); 2768 continue; 2769 } 2770 const { value: varName } = el; 2771 if (!(values && varName in values)) throw new MissingValueError(varName, originalMessage); 2772 let value = values[varName]; 2773 if (isArgumentElement(el)) { 2774 if (!value || typeof value === "string" || typeof value === "number" || typeof value === "bigint") value = typeof value === "string" || typeof value === "number" || typeof value === "bigint" ? String(value) : ""; 2775 result.push({ 2776 type: typeof value === "string" ? 0 : 1, 2777 value 2778 }); 2779 continue; 2780 } 2781 if (isDateElement(el)) { 2782 const style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0; 2783 result.push({ 2784 type: 0, 2785 value: formatters.getDateTimeFormat(locales, style).format(value) 2786 }); 2787 continue; 2788 } 2789 if (isTimeElement(el)) { 2790 const style = typeof el.style === "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium; 2791 result.push({ 2792 type: 0, 2793 value: formatters.getDateTimeFormat(locales, style).format(value) 2794 }); 2795 continue; 2796 } 2797 if (isNumberElement(el)) { 2798 const style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0; 2799 if (style && style.scale) { 2800 const scale = style.scale || 1; 2801 if (typeof value === "bigint") { 2802 if (!Number.isInteger(scale)) throw new TypeError(`Cannot apply fractional scale ${scale} to bigint value. Scale must be an integer when formatting bigint.`); 2803 value = value * BigInt(scale); 2804 } else value = value * scale; 2805 } 2806 result.push({ 2807 type: 0, 2808 value: formatters.getNumberFormat(locales, style).format(value) 2809 }); 2810 continue; 2811 } 2812 if (isTagElement(el)) { 2813 const { children, value } = el;
vendor: 7,681 bytes, lines 2814-3026
2814 const formatFn = values[value]; 2815 if (!isFormatXMLElementFn(formatFn)) throw new InvalidValueTypeError(value, "function", originalMessage); 2816 let chunks = formatFn(formatToParts(children, locales, formatters, formats, values, currentPluralValue).map((p) => p.value)); 2817 if (!Array.isArray(chunks)) chunks = [chunks]; 2818 result.push(...chunks.map((c) => { 2819 return { 2820 type: typeof c === "string" ? 0 : 1, 2821 value: c 2822 }; 2823 })); 2824 } 2825 if (isSelectElement(el)) { 2826 const key = value; 2827 const opt = (Object.prototype.hasOwnProperty.call(el.options, key) ? el.options[key] : void 0) || el.options.other; 2828 if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); 2829 result.push(...formatToParts(opt.value, locales, formatters, formats, values)); 2830 continue; 2831 } 2832 if (isPluralElement(el)) { 2833 const exactKey = `=${value}`; 2834 let opt = Object.prototype.hasOwnProperty.call(el.options, exactKey) ? el.options[exactKey] : void 0; 2835 if (!opt) { 2836 if (!Intl.PluralRules) throw new FormatError(`Intl.PluralRules is not available in this environment. 2837Try polyfilling it using "@formatjs/intl-pluralrules" 2838`, "MISSING_INTL_API", originalMessage); 2839 const numericValue = typeof value === "bigint" ? Number(value) : value; 2840 const rule = formatters.getPluralRules(locales, { type: el.pluralType }).select(numericValue - (el.offset || 0)); 2841 opt = (Object.prototype.hasOwnProperty.call(el.options, rule) ? el.options[rule] : void 0) || el.options.other; 2842 } 2843 if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); 2844 const numericValue = typeof value === "bigint" ? Number(value) : value; 2845 result.push(...formatToParts(opt.value, locales, formatters, formats, values, numericValue - (el.offset || 0))); 2846 continue; 2847 } 2848 } 2849 return mergeLiteral(result); 2850} 2851//#endregion 2852//#region packages/intl-messageformat/core.ts 2853function mergeConfig(c1, c2) { 2854 if (!c2) return c1; 2855 return { 2856 ...c1, 2857 ...c2, 2858 ...Object.keys(c1).reduce((all, k) => { 2859 all[k] = { 2860 ...c1[k], 2861 ...c2[k] 2862 }; 2863 return all; 2864 }, {}) 2865 }; 2866} 2867function mergeConfigs(defaultConfig, configs) { 2868 if (!configs) return defaultConfig; 2869 return Object.keys(defaultConfig).reduce((all, k) => { 2870 all[k] = mergeConfig(defaultConfig[k], configs[k]); 2871 return all; 2872 }, { ...defaultConfig }); 2873} 2874function createFastMemoizeCache(store) { 2875 return { create() { 2876 return { 2877 get(key) { 2878 return store[key]; 2879 }, 2880 set(key, value) { 2881 store[key] = value; 2882 } 2883 }; 2884 } }; 2885} 2886function createDefaultFormatters(cache = { 2887 number: {}, 2888 dateTime: {}, 2889 pluralRules: {} 2890}) { 2891 return { 2892 getNumberFormat: (0,fast_memoize/* memoize */.H)((...args) => new Intl.NumberFormat(...args), { 2893 cache: createFastMemoizeCache(cache.number), 2894 strategy: fast_memoize/* strategies */.A.variadic 2895 }), 2896 getDateTimeFormat: (0,fast_memoize/* memoize */.H)((...args) => new Intl.DateTimeFormat(...args), { 2897 cache: createFastMemoizeCache(cache.dateTime), 2898 strategy: fast_memoize/* strategies */.A.variadic 2899 }), 2900 getPluralRules: (0,fast_memoize/* memoize */.H)((...args) => new Intl.PluralRules(...args), { 2901 cache: createFastMemoizeCache(cache.pluralRules), 2902 strategy: fast_memoize/* strategies */.A.variadic 2903 }) 2904 }; 2905} 2906var IntlMessageFormat = class IntlMessageFormat { 2907 constructor(message, locales = IntlMessageFormat.defaultLocale, overrideFormats, opts) { 2908 this.formatterCache = { 2909 number: {}, 2910 dateTime: {}, 2911 pluralRules: {} 2912 }; 2913 this.format = (values) => { 2914 const parts = this.formatToParts(values); 2915 if (parts.length === 1) return parts[0].value; 2916 const result = parts.reduce((all, part) => { 2917 if (!all.length || part.type !== 0 || typeof all[all.length - 1] !== "string") all.push(part.value); 2918 else all[all.length - 1] += part.value; 2919 return all; 2920 }, []); 2921 if (result.length <= 1) return result[0] || ""; 2922 return result; 2923 }; 2924 this.formatToParts = (values) => formatToParts(this.ast, this.locales, this.formatters, this.formats, values, void 0, this.message); 2925 this.resolvedOptions = () => ({ locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0] }); 2926 this.getAst = () => this.ast; 2927 this.locales = locales; 2928 this.resolvedLocale = IntlMessageFormat.resolveLocale(locales); 2929 if (typeof message === "string") { 2930 this.message = message; 2931 if (!IntlMessageFormat.__parse) throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`"); 2932 const { ...parseOpts } = opts || {}; 2933 this.ast = IntlMessageFormat.__parse(message, { 2934 ...parseOpts, 2935 locale: this.resolvedLocale 2936 }); 2937 } else this.ast = message; 2938 if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST."); 2939 this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats); 2940 this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache); 2941 } 2942 static { 2943 this.memoizedDefaultLocale = null; 2944 } 2945 static get defaultLocale() { 2946 if (!IntlMessageFormat.memoizedDefaultLocale) IntlMessageFormat.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale; 2947 return IntlMessageFormat.memoizedDefaultLocale; 2948 } 2949 static { 2950 this.resolveLocale = (locales) => { 2951 if (typeof Intl.Locale === "undefined") return; 2952 const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales); 2953 if (supportedLocales.length > 0) return new Intl.Locale(supportedLocales[0]); 2954 return new Intl.Locale(typeof locales === "string" ? locales : locales[0]); 2955 }; 2956 } 2957 static { 2958 this.__parse = parse; 2959 } 2960 static { 2961 this.formats = { 2962 number: { 2963 integer: { maximumFractionDigits: 0 }, 2964 currency: { style: "currency" }, 2965 percent: { style: "percent" } 2966 }, 2967 date: { 2968 short: { 2969 month: "numeric", 2970 day: "numeric", 2971 year: "2-digit" 2972 }, 2973 medium: { 2974 month: "short", 2975 day: "numeric", 2976 year: "numeric" 2977 }, 2978 long: { 2979 month: "long", 2980 day: "numeric", 2981 year: "numeric" 2982 }, 2983 full: { 2984 weekday: "long", 2985 month: "long", 2986 day: "numeric", 2987 year: "numeric" 2988 } 2989 }, 2990 time: { 2991 short: { 2992 hour: "numeric", 2993 minute: "numeric" 2994 }, 2995 medium: { 2996 hour: "numeric", 2997 minute: "numeric", 2998 second: "numeric" 2999 }, 3000 long: { 3001 hour: "numeric", 3002 minute: "numeric", 3003 second: "numeric", 3004 timeZoneName: "short" 3005 }, 3006 full: { 3007 hour: "numeric", 3008 minute: "numeric", 3009 second: "numeric", 3010 timeZoneName: "short" 3011 } 3012 } 3013 }; 3014 } 3015}; 3016//#endregion 3017//#region packages/intl-messageformat/index.ts 3018var intl_messageformat_default = (/* unused pure expression or super */ null && (IntlMessageFormat)); 3019//#endregion 3020 3021 3022//# sourceMappingURL=index.js.map 3023// EXTERNAL MODULE: ./node_modules/.pnpm/[email protected][email protected]/node_modules/use-intl/dist/esm/production/formatters-CJcico0N.js 3024var formatters_CJcico0N = __webpack_require__(80723); 3025;// CONCATENATED MODULE: ./node_modules/.pnpm/[email protected][email protected]/node_modules/use-intl/dist/esm/production/format-message/index.js 3026function m(...[m,s,i,n]){if(Array.isArray(s))throw new formatters_CJcico0N.I(formatters_CJcico0N.a.INVALID_MESSAGE,void 0);if("object"==typeof s)throw new formatters_CJcico0N.I(formatters_CJcico0N.a.INSUFFICIENT_PATH,void 0);if("string"==typeof s){const t=function(t,e){return e||/'[{}<#|']/.test(t)?void 0:t}(s,i);if(t)return t}const{cache:f,formats:c,formatters:g,globalFormats:u,locale:d,timeZone:A}=n;let p;g.getMessageFormat||(g.getMessageFormat=function(e,r){return (0,formatters_CJcico0N.m)(((...e)=>new IntlMessageFormat(e[0],e[1],e[2],{formatters:r,...e[3]})),e.message)}(f,g));
3026try{p=g.getMessageFormat(s,d,function(e,r,o){const a=IntlMessageFormat.formats.date,m=IntlMessageFormat.formats.time,s={...e?.dateTime,...r?.dateTime},i={date:{...a,...s},time:{...m,...s},number:{...e?.number,...r?.number}};return o&&["date","time"].forEach((t=>{const e=i[t];for(const[t,r]of Object.entries(e))e[t]={timeZone:o,...r}})),i}(u,c,A),{formatters:{...g,getDateTimeFormat:(t,e)=>g.getDateTimeFormat(t,{...e,timeZone:e?.timeZone??A})}})}catch(t){throw new formatters_CJcico0N.I(formatters_CJcico0N.a.INVALID_MESSAGE,void 0)}const w=p.format(i);return (0,react.isValidElement)(w)||Array.isArray(w)||"string"==typeof w?w:String(w)}m.raw=!0; 3027 3028;// CONCATENATED MODULE: ./node_modules/.pnpm/[email protected][email protected]/node_modules/use-intl/dist/esm/production/initializeConfig-CHgjheii.js 3029function c(...e){return e.filter(Boolean).join(".")}function i(e){return c(e.namespace,e.key)}function u(e){console.error(e)}function initializeConfig_CHgjheii_m(e,t,r,n){const o=c(n,r);if(!t)throw new Error(o);let a=t;return r.split(".").forEach((t=>{const r=a[t];if(null==t||null==r)throw new Error(o+` (${e})`);a=r})),a}function f(a){const s=function(e,t,r){try{if(!t)throw new Error(void 0);const n=r?initializeConfig_CHgjheii_m(e,t,r):t;if(!n)throw new Error(r);return n}catch(e){return new formatters_CJcico0N.I(formatters_CJcico0N.a.MISSING_MESSAGE,e.message)}}(a.locale,a.messages,a.namespace);return function({cache:a,formats:s,formatters:u,getMessageFallback:f=i,locale:l,messagesOrError:g,namespace:y,onError:h,timeZone:w}){const E=g instanceof formatters_CJcico0N.I;function d(e,t,r,o){const a=new formatters_CJcico0N.I(t,r);return h(a),o??f({error:a,key:e,namespace:y})}function p(i,p,S,M){const T=M;let N;if(E){if(!T)return h(g),f({error:g,key:i,namespace:y});N=T}else{const e=g;try{N=initializeConfig_CHgjheii_m(l,e,i,y)}catch(e){if(!T)return d(i,formatters_CJcico0N.a.MISSING_MESSAGE,e.message,T);N=T}}try{const n=c(y,i);return m(n,N,p?function(r){const n={};return Object.keys(r).forEach((o=>{let a=0;const s=r[o];let c;c="function"==typeof s?r=>{const n=s(r);return (0,react.isValidElement)(n)?(0,react.cloneElement)(n,{key:o+a++}):n}:s,n[o]=c})),n}(p):p,{cache:a,formatters:u,globalFormats:s,formats:S,locale:l,timeZone:w})}catch(e){let t,r;return e instanceof formatters_CJcico0N.I?(t=e.code,r=e.originalMessage):(t=formatters_CJcico0N.a.FORMATTING_ERROR,r=e.message),d(i,t,r,T)}}function S(e,t,r,n){const a=p(e,t,r,n);return"string"!=typeof a?d(e,formatters_CJcico0N.a.INVALID_MESSAGE,void 0):a}return S.rich=p,S.markup=(e,t,r,n)=>p(e,t,r,n),S.raw=e=>{if(E)return h(g),f({error:g,key:e,namespace:y});const t=g;try{return initializeConfig_CHgjheii_m(l,t,e,y)}catch(t){return d(e,formatters_CJcico0N.a.MISSING_MESSAGE,t.message)}},S.has=e=>{if(E)return!1;try{return initializeConfig_CHgjheii_m(l,g,e,y),!0}catch{return!1}},S}({...a,messagesOrError:s})}function l(e,t){return e===t?void 0:e.slice((t+".").length)}const g=3600,y=86400,h=7*y,w=2628e3,E=7884e3,d=365*y,p={second:1,seconds:1,minute:60,minutes:60,hour:g,hours:g,day:y,days:y,week:h,weeks:h,month:w,months:w,quarter:E,quarters:E,year:d,years:d};function S(e){const{_cache:t=(0,formatters_CJcico0N.b)(),_formatters:r=(0,formatters_CJcico0N.c)(t),formats:c,locale:i,onError:m=u,timeZone:f}=e;function l(e){return e?.timeZone||(f?e={...e,timeZone:f}:m(new formatters_CJcico0N.I(formatters_CJcico0N.a.ENVIRONMENT_FALLBACK,void 0))),e}function E(e,t,r,a,s){let c;try{c=function(e,t,r){let a;if("string"==typeof t){const r=t;if(a=e?.[r],!a){const e=new formatters_CJcico0N.I(formatters_CJcico0N.a.MISSING_FORMAT,void 0);throw m(e),e}}else a=t;return r&&(a={...a,...r}),a}(r,e,t)}catch{return s()}try{return a(c)}catch(e){return m(new formatters_CJcico0N.I(formatters_CJcico0N.a.FORMATTING_ERROR,e.message)),s()}}function S(e,t,n){return E(t,n,c?.dateTime,(t=>(t=l(t),r.getDateTimeFormat(i,t).format(e))),(()=>String(e)))}function M(){return e.now?e.now:(m(new formatters_CJcico0N.I(formatters_CJcico0N.a.ENVIRONMENT_FALLBACK,void 0)),new Date)}return{dateTime:S,number:function(e,t,n){return E(t,n,c?.number,(t=>r.getNumberFormat(i,t).format(e)),(()=>String(e)))},relativeTime:function(e,t){try{let n,o;const a={};t instanceof Date||"number"==typeof t?n=new Date(t):t&&(n=null!=t.now?new Date(t.now):M(),o=t.unit,a.style=t.style,a.numberingSystem=t.numberingSystem),n||(n=M());const s=(new Date(e).getTime()-n.getTime())/1e3;o||(o=function(e){const t=Math.abs(e);return t<60?"second":t<g?"minute":t<y?"hour":t<h?"day":t<w?"week":t<
3029d?"month":"year"}(s)),a.numeric="second"===o?"auto":"always";const c=function(e,t){return Math.round(e/p[t])}(s,o);return r.getRelativeTimeFormat(i,a).format(c,o)}catch(t){return m(new formatters_CJcico0N.I(formatters_CJcico0N.a.FORMATTING_ERROR,t.message)),String(e)}},list:function(e,t,n){const o=[],a=new Map;let s=0;for(const t of e){let e;"object"==typeof t?(e=String(s),a.set(e,t)):e=String(t),o.push(e),s++}return E(t,n,c?.list,(e=>{const t=r.getListFormat(i,e).formatToParts(o).map((e=>"literal"===e.type?e.value:a.get(e.value)||e.value));return a.size>0?t:t.join("")}),(()=>String(e)))},dateTimeRange:function(e,t,n,o){return E(n,o,c?.dateTime,(n=>(n=l(n),r.getDateTimeFormat(i,n).formatRange(e,t))),(()=>[S(e),S(t)].join("âââ")))},displayName:function(e,t,n){return E(t,n,c?.displayName,(t=>r.getDisplayNames(i,t).of(e)),(()=>e))}}}function M({formats:e,getMessageFallback:t,messages:r,onError:n,...o}){return{...o,formats:e||void 0,messages:r||void 0,onError:n||u,getMessageFallback:t||i}} 3030 3031 3032/***/ }), 3033 3034/***/ 55773: 3035/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { 3036 3037/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3038/* harmony export */ Gb: function() { return /* binding */ I; }, 3039/* harmony export */ Pj: function() { return /* binding */ w; }, 3040/* harmony export */ T_: function() { return /* binding */ v; }, 3041/* harmony export */ bU: function() { return /* binding */ Z; } 3042/* harmony export */ }); 3043/* unused harmony exports _useExtracted, useMessages, useNow, useTimeZone */ 3044/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25529); 3045/* harmony import */ var _formatters_CJcico0N_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(80723); 3046/* harmony import */ var _initializeConfig_CHgjheii_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(19080); 3047/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(44951); 3048const g=(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)(void 0);function w({children:e,formats:o,getMessageFallback:a,locale:c,messages:i,now:l,onError:f,timeZone:u}){const w=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(g),p=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>w?.cache||(0,_formatters_CJcico0N_js__WEBPACK_IMPORTED_MODULE_1__.b)()),[c,w?.cache]),E=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>w?.formatters||(0,_formatters_CJcico0N_js__WEBPACK_IMPORTED_MODULE_1__.c)(p)),[p,w?.formatters]),h=(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>({...(0,_initializeConfig_CHgjheii_js__WEBPACK_IMPORTED_MODULE_2__.i)({locale:c,formats:void 0===o?w?.formats:o,getMessageFallback:a||w?.getMessageFallback,messages:void 0===i?w?.messages:i,now:l||w?.now,onError:f||w?.onError,timeZone:u||w?.timeZone}),formatters:E,cache:p})),[p,o,E,a,c,i,l,f,w,u]);return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(g.Provider,{value:h,children:e})}function p(){const e=(0,react__WEBPACK_IMPORTED_MODULE_0__.useContext)(g);if(!e)throw new Error(void 0);return e}let E=!1;const h="undefined"==typeof window;function v(e){return function(e,r,o){const{cache:a,formats:n,formatters:s,getMessageFallback:m,locale:u,onError:d,timeZone:g}=p(),w=e[o],v=(0,_initializeConfig_CHgjheii_js__WEBPACK_IMPORTED_MODULE_2__.r)(r,o);return g||E||!h||(E=!0,d(new _formatters_CJcico0N_js__WEBPACK_IMPORTED_MODULE_1__.I(_formatters_CJcico0N_js__WEBPACK_IMPORTED_MODULE_1__.a.ENVIRONMENT_FALLBACK,void 0))),(0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>(0,_initializeConfig_CHgjheii_js__WEBPACK_IMPORTED_MODULE_2__.a)({cache:a,formatters:s,getMessageFallback:m,messages:w,namespace:v,onError:d,formats:n,locale:u,timeZone:g})),[a,s,m,w,v,d,n,u,g])}({"!":p().messages},e?`!.${e}`:"!","!")}function Z(){return p().locale}function k(){return new Date}function b(e){const r=e?.updateInterval,{now:t}=p(),[n,s]=o(t||k());return a((()=>{if(!r)return;const e=setInterval((()=>{s(k())}),r);return()=>{clearInterval(e)}}),[t,r]),null==r&&t?t:n}function x(){return p().timeZone}function F(){const e=p();if(!e.messages)throw new Error(void 0);return e.messages}function I(){const{formats:e,formatters:r,locale:o,now:a,onError:n,timeZone:s}=p();return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)((()=>(0,_initializeConfig_CHgjheii_js__WEBPACK_IMPORTED_MODULE_2__.c)({formats:e,locale:o,now:a,onError:n,timeZone:s,_formatters:r})),[e,r,a,o,n,s])}
3048function M(e){throw v(e),new Error("[next-intl] `useExtracted` was called in production without compilation. Include modules that call `useExtracted` in `srcPath` and use `transpilePackages` for 3rd-party packages.")} 3049 3050 3051/***/ }) 3052 3053}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.