@codee-sh/medusa-plugin-notification-emails 0.1.0 → 0.1.1

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.
Files changed (51) hide show
  1. package/.medusa/server/src/admin/index.js +445 -4410
  2. package/.medusa/server/src/admin/index.mjs +445 -4410
  3. package/.medusa/server/src/api/admin/notification-plugin/render-template/route.js +8 -5
  4. package/.medusa/server/src/hooks/api/preview.js +5 -4
  5. package/.medusa/server/src/subscribers/order-completed.js +14 -62
  6. package/.medusa/server/src/subscribers/order-placed.js +12 -58
  7. package/.medusa/server/src/templates/emails/blocks/components/repeater.js +1 -1
  8. package/.medusa/server/src/templates/emails/contact-form/config.js +5 -21
  9. package/.medusa/server/src/templates/emails/index.js +18 -8
  10. package/.medusa/server/src/templates/emails/order/completed/config.js +221 -0
  11. package/.medusa/server/src/templates/emails/{order-placed → order/completed}/index.js +1 -1
  12. package/.medusa/server/src/templates/emails/{order-completed → order/completed}/translations/en.json +1 -1
  13. package/.medusa/server/src/templates/emails/{order-placed → order/completed}/translations/index.js +1 -1
  14. package/.medusa/server/src/templates/emails/{order-completed → order/completed}/translations/pl.json +1 -1
  15. package/.medusa/server/src/templates/emails/{order-completed → order/placed}/config.js +24 -36
  16. package/.medusa/server/src/templates/emails/{order-completed → order/placed}/index.js +1 -1
  17. package/.medusa/server/src/templates/emails/{order-completed → order/placed}/translations/index.js +1 -1
  18. package/.medusa/server/src/templates/emails/{order-placed → order/placed}/translations/pl.json +1 -1
  19. package/.medusa/server/src/templates/emails/{order-placed → order/updated}/config.js +12 -12
  20. package/.medusa/server/src/templates/emails/order/updated/index.js +7 -0
  21. package/.medusa/server/src/templates/emails/order/updated/translations/en.json +24 -0
  22. package/.medusa/server/src/templates/emails/order/updated/translations/index.js +15 -0
  23. package/.medusa/server/src/templates/emails/order/updated/translations/pl.json +24 -0
  24. package/.medusa/server/src/templates/emails/types.js +2 -1
  25. package/.medusa/server/src/utils/attribute-helpers.js +17 -0
  26. package/.medusa/server/src/utils/data/modules/index.js +15 -0
  27. package/.medusa/server/src/utils/data/modules/inventory/index.js +18 -0
  28. package/.medusa/server/src/utils/data/modules/inventory/inventory.js +108 -0
  29. package/.medusa/server/src/utils/data/modules/order/index.js +18 -0
  30. package/.medusa/server/src/utils/data/modules/order/order.js +415 -0
  31. package/.medusa/server/src/utils/data/modules/product/helpers.js +9 -0
  32. package/.medusa/server/src/utils/data/modules/product/index.js +18 -0
  33. package/.medusa/server/src/utils/data/modules/product/product.js +276 -0
  34. package/.medusa/server/src/utils/data/modules/product-category/index.js +18 -0
  35. package/.medusa/server/src/utils/data/modules/product-category/product-category.js +75 -0
  36. package/.medusa/server/src/utils/data/modules/product-tag/index.js +18 -0
  37. package/.medusa/server/src/utils/data/modules/product-tag/product-tag.js +39 -0
  38. package/.medusa/server/src/utils/data/modules/product-type/index.js +18 -0
  39. package/.medusa/server/src/utils/data/modules/product-type/product-type.js +39 -0
  40. package/.medusa/server/src/utils/data/modules/product-variant/index.js +18 -0
  41. package/.medusa/server/src/utils/data/modules/product-variant/product-variant.js +139 -0
  42. package/.medusa/server/src/utils/i18n/i18n.js +2 -20
  43. package/.medusa/server/src/utils/index.js +7 -1
  44. package/.medusa/server/src/utils/transforms/index.js +42 -0
  45. package/.medusa/server/src/utils/transforms/order-transformer.js +42 -0
  46. package/.medusa/server/src/workflows/order/get-order-by-id.js +23 -0
  47. package/.medusa/server/src/workflows/order/index.js +18 -0
  48. package/.medusa/server/src/workflows/order/steps/get-order-by-id.js +40 -0
  49. package/.medusa/server/src/workflows/order/steps/index.js +18 -0
  50. package/package.json +1 -1
  51. /package/.medusa/server/src/templates/emails/{order-placed → order/placed}/translations/en.json +0 -0
@@ -2044,9 +2044,9 @@ var KeyValuesItem = (props) => {
2044
2044
  var isMyArray = Array.isArray(value);
2045
2045
  var isMySet = value instanceof Set;
2046
2046
  var isMyMap = value instanceof Map;
2047
- var isDate2 = value instanceof Date;
2047
+ var isDate = value instanceof Date;
2048
2048
  var isUrl = value instanceof URL;
2049
- var isMyObject = value && typeof value === "object" && !isMyArray && !isMySet && !isMyMap && !isDate2 && !isUrl;
2049
+ var isMyObject = value && typeof value === "object" && !isMyArray && !isMySet && !isMyMap && !isDate && !isUrl;
2050
2050
  var isNested = isMyObject || isMyArray || isMySet || isMyMap;
2051
2051
  if (isNested) {
2052
2052
  var myValue = isMySet ? Array.from(value) : isMyMap ? Object.fromEntries(value) : value;
@@ -2995,7 +2995,8 @@ const useOrder = (params, options) => {
2995
2995
  const usePreview = (params, options) => {
2996
2996
  const {
2997
2997
  templateName,
2998
- templateData,
2998
+ context,
2999
+ contextType,
2999
3000
  locale,
3000
3001
  extraKey = [],
3001
3002
  enabled = false
@@ -3013,4367 +3014,18 @@ const usePreview = (params, options) => {
3013
3014
  method: "POST",
3014
3015
  body: {
3015
3016
  templateName,
3016
- templateData,
3017
+ context,
3018
+ contextType,
3017
3019
  locale
3018
3020
  }
3019
3021
  });
3020
3022
  },
3021
3023
  staleTime: 0,
3022
- enabled: enabled && !!templateName && !!templateData && !!locale,
3024
+ enabled: enabled && !!templateName && !!context && !!locale,
3023
3025
  ...options
3024
3026
  });
3025
3027
  return { data, ...rest };
3026
3028
  };
3027
- function toDate(argument) {
3028
- const argStr = Object.prototype.toString.call(argument);
3029
- if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") {
3030
- return new argument.constructor(+argument);
3031
- } else if (typeof argument === "number" || argStr === "[object Number]" || typeof argument === "string" || argStr === "[object String]") {
3032
- return new Date(argument);
3033
- } else {
3034
- return /* @__PURE__ */ new Date(NaN);
3035
- }
3036
- }
3037
- function constructFrom(date, value) {
3038
- if (date instanceof Date) {
3039
- return new date.constructor(value);
3040
- } else {
3041
- return new Date(value);
3042
- }
3043
- }
3044
- const millisecondsInWeek = 6048e5;
3045
- const millisecondsInDay = 864e5;
3046
- let defaultOptions = {};
3047
- function getDefaultOptions() {
3048
- return defaultOptions;
3049
- }
3050
- function startOfWeek(date, options) {
3051
- var _a, _b, _c, _d;
3052
- const defaultOptions2 = getDefaultOptions();
3053
- const weekStartsOn = (options == null ? void 0 : options.weekStartsOn) ?? ((_b = (_a = options == null ? void 0 : options.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.weekStartsOn) ?? defaultOptions2.weekStartsOn ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.weekStartsOn) ?? 0;
3054
- const _date = toDate(date);
3055
- const day = _date.getDay();
3056
- const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
3057
- _date.setDate(_date.getDate() - diff);
3058
- _date.setHours(0, 0, 0, 0);
3059
- return _date;
3060
- }
3061
- function startOfISOWeek(date) {
3062
- return startOfWeek(date, { weekStartsOn: 1 });
3063
- }
3064
- function getISOWeekYear(date) {
3065
- const _date = toDate(date);
3066
- const year = _date.getFullYear();
3067
- const fourthOfJanuaryOfNextYear = constructFrom(date, 0);
3068
- fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
3069
- fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
3070
- const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
3071
- const fourthOfJanuaryOfThisYear = constructFrom(date, 0);
3072
- fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
3073
- fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
3074
- const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
3075
- if (_date.getTime() >= startOfNextYear.getTime()) {
3076
- return year + 1;
3077
- } else if (_date.getTime() >= startOfThisYear.getTime()) {
3078
- return year;
3079
- } else {
3080
- return year - 1;
3081
- }
3082
- }
3083
- function startOfDay(date) {
3084
- const _date = toDate(date);
3085
- _date.setHours(0, 0, 0, 0);
3086
- return _date;
3087
- }
3088
- function getTimezoneOffsetInMilliseconds(date) {
3089
- const _date = toDate(date);
3090
- const utcDate = new Date(
3091
- Date.UTC(
3092
- _date.getFullYear(),
3093
- _date.getMonth(),
3094
- _date.getDate(),
3095
- _date.getHours(),
3096
- _date.getMinutes(),
3097
- _date.getSeconds(),
3098
- _date.getMilliseconds()
3099
- )
3100
- );
3101
- utcDate.setUTCFullYear(_date.getFullYear());
3102
- return +date - +utcDate;
3103
- }
3104
- function differenceInCalendarDays(dateLeft, dateRight) {
3105
- const startOfDayLeft = startOfDay(dateLeft);
3106
- const startOfDayRight = startOfDay(dateRight);
3107
- const timestampLeft = +startOfDayLeft - getTimezoneOffsetInMilliseconds(startOfDayLeft);
3108
- const timestampRight = +startOfDayRight - getTimezoneOffsetInMilliseconds(startOfDayRight);
3109
- return Math.round((timestampLeft - timestampRight) / millisecondsInDay);
3110
- }
3111
- function startOfISOWeekYear(date) {
3112
- const year = getISOWeekYear(date);
3113
- const fourthOfJanuary = constructFrom(date, 0);
3114
- fourthOfJanuary.setFullYear(year, 0, 4);
3115
- fourthOfJanuary.setHours(0, 0, 0, 0);
3116
- return startOfISOWeek(fourthOfJanuary);
3117
- }
3118
- function isDate(value) {
3119
- return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
3120
- }
3121
- function isValid(date) {
3122
- if (!isDate(date) && typeof date !== "number") {
3123
- return false;
3124
- }
3125
- const _date = toDate(date);
3126
- return !isNaN(Number(_date));
3127
- }
3128
- function startOfYear(date) {
3129
- const cleanDate = toDate(date);
3130
- const _date = constructFrom(date, 0);
3131
- _date.setFullYear(cleanDate.getFullYear(), 0, 1);
3132
- _date.setHours(0, 0, 0, 0);
3133
- return _date;
3134
- }
3135
- const formatDistanceLocale$2 = {
3136
- lessThanXSeconds: {
3137
- one: "less than a second",
3138
- other: "less than {{count}} seconds"
3139
- },
3140
- xSeconds: {
3141
- one: "1 second",
3142
- other: "{{count}} seconds"
3143
- },
3144
- halfAMinute: "half a minute",
3145
- lessThanXMinutes: {
3146
- one: "less than a minute",
3147
- other: "less than {{count}} minutes"
3148
- },
3149
- xMinutes: {
3150
- one: "1 minute",
3151
- other: "{{count}} minutes"
3152
- },
3153
- aboutXHours: {
3154
- one: "about 1 hour",
3155
- other: "about {{count}} hours"
3156
- },
3157
- xHours: {
3158
- one: "1 hour",
3159
- other: "{{count}} hours"
3160
- },
3161
- xDays: {
3162
- one: "1 day",
3163
- other: "{{count}} days"
3164
- },
3165
- aboutXWeeks: {
3166
- one: "about 1 week",
3167
- other: "about {{count}} weeks"
3168
- },
3169
- xWeeks: {
3170
- one: "1 week",
3171
- other: "{{count}} weeks"
3172
- },
3173
- aboutXMonths: {
3174
- one: "about 1 month",
3175
- other: "about {{count}} months"
3176
- },
3177
- xMonths: {
3178
- one: "1 month",
3179
- other: "{{count}} months"
3180
- },
3181
- aboutXYears: {
3182
- one: "about 1 year",
3183
- other: "about {{count}} years"
3184
- },
3185
- xYears: {
3186
- one: "1 year",
3187
- other: "{{count}} years"
3188
- },
3189
- overXYears: {
3190
- one: "over 1 year",
3191
- other: "over {{count}} years"
3192
- },
3193
- almostXYears: {
3194
- one: "almost 1 year",
3195
- other: "almost {{count}} years"
3196
- }
3197
- };
3198
- const formatDistance$2 = (token, count, options) => {
3199
- let result;
3200
- const tokenValue = formatDistanceLocale$2[token];
3201
- if (typeof tokenValue === "string") {
3202
- result = tokenValue;
3203
- } else if (count === 1) {
3204
- result = tokenValue.one;
3205
- } else {
3206
- result = tokenValue.other.replace("{{count}}", count.toString());
3207
- }
3208
- if (options == null ? void 0 : options.addSuffix) {
3209
- if (options.comparison && options.comparison > 0) {
3210
- return "in " + result;
3211
- } else {
3212
- return result + " ago";
3213
- }
3214
- }
3215
- return result;
3216
- };
3217
- function buildFormatLongFn(args) {
3218
- return (options = {}) => {
3219
- const width = options.width ? String(options.width) : args.defaultWidth;
3220
- const format2 = args.formats[width] || args.formats[args.defaultWidth];
3221
- return format2;
3222
- };
3223
- }
3224
- const dateFormats$2 = {
3225
- full: "EEEE, MMMM do, y",
3226
- long: "MMMM do, y",
3227
- medium: "MMM d, y",
3228
- short: "MM/dd/yyyy"
3229
- };
3230
- const timeFormats$2 = {
3231
- full: "h:mm:ss a zzzz",
3232
- long: "h:mm:ss a z",
3233
- medium: "h:mm:ss a",
3234
- short: "h:mm a"
3235
- };
3236
- const dateTimeFormats$2 = {
3237
- full: "{{date}} 'at' {{time}}",
3238
- long: "{{date}} 'at' {{time}}",
3239
- medium: "{{date}}, {{time}}",
3240
- short: "{{date}}, {{time}}"
3241
- };
3242
- const formatLong$2 = {
3243
- date: buildFormatLongFn({
3244
- formats: dateFormats$2,
3245
- defaultWidth: "full"
3246
- }),
3247
- time: buildFormatLongFn({
3248
- formats: timeFormats$2,
3249
- defaultWidth: "full"
3250
- }),
3251
- dateTime: buildFormatLongFn({
3252
- formats: dateTimeFormats$2,
3253
- defaultWidth: "full"
3254
- })
3255
- };
3256
- const formatRelativeLocale$2 = {
3257
- lastWeek: "'last' eeee 'at' p",
3258
- yesterday: "'yesterday at' p",
3259
- today: "'today at' p",
3260
- tomorrow: "'tomorrow at' p",
3261
- nextWeek: "eeee 'at' p",
3262
- other: "P"
3263
- };
3264
- const formatRelative$2 = (token, _date, _baseDate, _options) => formatRelativeLocale$2[token];
3265
- function buildLocalizeFn(args) {
3266
- return (value, options) => {
3267
- const context = (options == null ? void 0 : options.context) ? String(options.context) : "standalone";
3268
- let valuesArray;
3269
- if (context === "formatting" && args.formattingValues) {
3270
- const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
3271
- const width = (options == null ? void 0 : options.width) ? String(options.width) : defaultWidth;
3272
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
3273
- } else {
3274
- const defaultWidth = args.defaultWidth;
3275
- const width = (options == null ? void 0 : options.width) ? String(options.width) : args.defaultWidth;
3276
- valuesArray = args.values[width] || args.values[defaultWidth];
3277
- }
3278
- const index = args.argumentCallback ? args.argumentCallback(value) : value;
3279
- return valuesArray[index];
3280
- };
3281
- }
3282
- const eraValues$2 = {
3283
- narrow: ["B", "A"],
3284
- abbreviated: ["BC", "AD"],
3285
- wide: ["Before Christ", "Anno Domini"]
3286
- };
3287
- const quarterValues$2 = {
3288
- narrow: ["1", "2", "3", "4"],
3289
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
3290
- wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
3291
- };
3292
- const monthValues$2 = {
3293
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
3294
- abbreviated: [
3295
- "Jan",
3296
- "Feb",
3297
- "Mar",
3298
- "Apr",
3299
- "May",
3300
- "Jun",
3301
- "Jul",
3302
- "Aug",
3303
- "Sep",
3304
- "Oct",
3305
- "Nov",
3306
- "Dec"
3307
- ],
3308
- wide: [
3309
- "January",
3310
- "February",
3311
- "March",
3312
- "April",
3313
- "May",
3314
- "June",
3315
- "July",
3316
- "August",
3317
- "September",
3318
- "October",
3319
- "November",
3320
- "December"
3321
- ]
3322
- };
3323
- const dayValues$2 = {
3324
- narrow: ["S", "M", "T", "W", "T", "F", "S"],
3325
- short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
3326
- abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
3327
- wide: [
3328
- "Sunday",
3329
- "Monday",
3330
- "Tuesday",
3331
- "Wednesday",
3332
- "Thursday",
3333
- "Friday",
3334
- "Saturday"
3335
- ]
3336
- };
3337
- const dayPeriodValues$2 = {
3338
- narrow: {
3339
- am: "a",
3340
- pm: "p",
3341
- midnight: "mi",
3342
- noon: "n",
3343
- morning: "morning",
3344
- afternoon: "afternoon",
3345
- evening: "evening",
3346
- night: "night"
3347
- },
3348
- abbreviated: {
3349
- am: "AM",
3350
- pm: "PM",
3351
- midnight: "midnight",
3352
- noon: "noon",
3353
- morning: "morning",
3354
- afternoon: "afternoon",
3355
- evening: "evening",
3356
- night: "night"
3357
- },
3358
- wide: {
3359
- am: "a.m.",
3360
- pm: "p.m.",
3361
- midnight: "midnight",
3362
- noon: "noon",
3363
- morning: "morning",
3364
- afternoon: "afternoon",
3365
- evening: "evening",
3366
- night: "night"
3367
- }
3368
- };
3369
- const formattingDayPeriodValues$1 = {
3370
- narrow: {
3371
- am: "a",
3372
- pm: "p",
3373
- midnight: "mi",
3374
- noon: "n",
3375
- morning: "in the morning",
3376
- afternoon: "in the afternoon",
3377
- evening: "in the evening",
3378
- night: "at night"
3379
- },
3380
- abbreviated: {
3381
- am: "AM",
3382
- pm: "PM",
3383
- midnight: "midnight",
3384
- noon: "noon",
3385
- morning: "in the morning",
3386
- afternoon: "in the afternoon",
3387
- evening: "in the evening",
3388
- night: "at night"
3389
- },
3390
- wide: {
3391
- am: "a.m.",
3392
- pm: "p.m.",
3393
- midnight: "midnight",
3394
- noon: "noon",
3395
- morning: "in the morning",
3396
- afternoon: "in the afternoon",
3397
- evening: "in the evening",
3398
- night: "at night"
3399
- }
3400
- };
3401
- const ordinalNumber$2 = (dirtyNumber, _options) => {
3402
- const number = Number(dirtyNumber);
3403
- const rem100 = number % 100;
3404
- if (rem100 > 20 || rem100 < 10) {
3405
- switch (rem100 % 10) {
3406
- case 1:
3407
- return number + "st";
3408
- case 2:
3409
- return number + "nd";
3410
- case 3:
3411
- return number + "rd";
3412
- }
3413
- }
3414
- return number + "th";
3415
- };
3416
- const localize$2 = {
3417
- ordinalNumber: ordinalNumber$2,
3418
- era: buildLocalizeFn({
3419
- values: eraValues$2,
3420
- defaultWidth: "wide"
3421
- }),
3422
- quarter: buildLocalizeFn({
3423
- values: quarterValues$2,
3424
- defaultWidth: "wide",
3425
- argumentCallback: (quarter) => quarter - 1
3426
- }),
3427
- month: buildLocalizeFn({
3428
- values: monthValues$2,
3429
- defaultWidth: "wide"
3430
- }),
3431
- day: buildLocalizeFn({
3432
- values: dayValues$2,
3433
- defaultWidth: "wide"
3434
- }),
3435
- dayPeriod: buildLocalizeFn({
3436
- values: dayPeriodValues$2,
3437
- defaultWidth: "wide",
3438
- formattingValues: formattingDayPeriodValues$1,
3439
- defaultFormattingWidth: "wide"
3440
- })
3441
- };
3442
- function buildMatchFn(args) {
3443
- return (string, options = {}) => {
3444
- const width = options.width;
3445
- const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
3446
- const matchResult = string.match(matchPattern);
3447
- if (!matchResult) {
3448
- return null;
3449
- }
3450
- const matchedString = matchResult[0];
3451
- const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
3452
- const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
3453
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
3454
- findKey(parsePatterns, (pattern) => pattern.test(matchedString))
3455
- );
3456
- let value;
3457
- value = args.valueCallback ? args.valueCallback(key) : key;
3458
- value = options.valueCallback ? (
3459
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
3460
- options.valueCallback(value)
3461
- ) : value;
3462
- const rest = string.slice(matchedString.length);
3463
- return { value, rest };
3464
- };
3465
- }
3466
- function findKey(object, predicate) {
3467
- for (const key in object) {
3468
- if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
3469
- return key;
3470
- }
3471
- }
3472
- return void 0;
3473
- }
3474
- function findIndex(array, predicate) {
3475
- for (let key = 0; key < array.length; key++) {
3476
- if (predicate(array[key])) {
3477
- return key;
3478
- }
3479
- }
3480
- return void 0;
3481
- }
3482
- function buildMatchPatternFn(args) {
3483
- return (string, options = {}) => {
3484
- const matchResult = string.match(args.matchPattern);
3485
- if (!matchResult) return null;
3486
- const matchedString = matchResult[0];
3487
- const parseResult = string.match(args.parsePattern);
3488
- if (!parseResult) return null;
3489
- let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
3490
- value = options.valueCallback ? options.valueCallback(value) : value;
3491
- const rest = string.slice(matchedString.length);
3492
- return { value, rest };
3493
- };
3494
- }
3495
- const matchOrdinalNumberPattern$2 = /^(\d+)(th|st|nd|rd)?/i;
3496
- const parseOrdinalNumberPattern$2 = /\d+/i;
3497
- const matchEraPatterns$2 = {
3498
- narrow: /^(b|a)/i,
3499
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
3500
- wide: /^(before christ|before common era|anno domini|common era)/i
3501
- };
3502
- const parseEraPatterns$2 = {
3503
- any: [/^b/i, /^(a|c)/i]
3504
- };
3505
- const matchQuarterPatterns$2 = {
3506
- narrow: /^[1234]/i,
3507
- abbreviated: /^q[1234]/i,
3508
- wide: /^[1234](th|st|nd|rd)? quarter/i
3509
- };
3510
- const parseQuarterPatterns$2 = {
3511
- any: [/1/i, /2/i, /3/i, /4/i]
3512
- };
3513
- const matchMonthPatterns$2 = {
3514
- narrow: /^[jfmasond]/i,
3515
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
3516
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
3517
- };
3518
- const parseMonthPatterns$2 = {
3519
- narrow: [
3520
- /^j/i,
3521
- /^f/i,
3522
- /^m/i,
3523
- /^a/i,
3524
- /^m/i,
3525
- /^j/i,
3526
- /^j/i,
3527
- /^a/i,
3528
- /^s/i,
3529
- /^o/i,
3530
- /^n/i,
3531
- /^d/i
3532
- ],
3533
- any: [
3534
- /^ja/i,
3535
- /^f/i,
3536
- /^mar/i,
3537
- /^ap/i,
3538
- /^may/i,
3539
- /^jun/i,
3540
- /^jul/i,
3541
- /^au/i,
3542
- /^s/i,
3543
- /^o/i,
3544
- /^n/i,
3545
- /^d/i
3546
- ]
3547
- };
3548
- const matchDayPatterns$2 = {
3549
- narrow: /^[smtwf]/i,
3550
- short: /^(su|mo|tu|we|th|fr|sa)/i,
3551
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
3552
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
3553
- };
3554
- const parseDayPatterns$2 = {
3555
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
3556
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
3557
- };
3558
- const matchDayPeriodPatterns$2 = {
3559
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
3560
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
3561
- };
3562
- const parseDayPeriodPatterns$2 = {
3563
- any: {
3564
- am: /^a/i,
3565
- pm: /^p/i,
3566
- midnight: /^mi/i,
3567
- noon: /^no/i,
3568
- morning: /morning/i,
3569
- afternoon: /afternoon/i,
3570
- evening: /evening/i,
3571
- night: /night/i
3572
- }
3573
- };
3574
- const match$2 = {
3575
- ordinalNumber: buildMatchPatternFn({
3576
- matchPattern: matchOrdinalNumberPattern$2,
3577
- parsePattern: parseOrdinalNumberPattern$2,
3578
- valueCallback: (value) => parseInt(value, 10)
3579
- }),
3580
- era: buildMatchFn({
3581
- matchPatterns: matchEraPatterns$2,
3582
- defaultMatchWidth: "wide",
3583
- parsePatterns: parseEraPatterns$2,
3584
- defaultParseWidth: "any"
3585
- }),
3586
- quarter: buildMatchFn({
3587
- matchPatterns: matchQuarterPatterns$2,
3588
- defaultMatchWidth: "wide",
3589
- parsePatterns: parseQuarterPatterns$2,
3590
- defaultParseWidth: "any",
3591
- valueCallback: (index) => index + 1
3592
- }),
3593
- month: buildMatchFn({
3594
- matchPatterns: matchMonthPatterns$2,
3595
- defaultMatchWidth: "wide",
3596
- parsePatterns: parseMonthPatterns$2,
3597
- defaultParseWidth: "any"
3598
- }),
3599
- day: buildMatchFn({
3600
- matchPatterns: matchDayPatterns$2,
3601
- defaultMatchWidth: "wide",
3602
- parsePatterns: parseDayPatterns$2,
3603
- defaultParseWidth: "any"
3604
- }),
3605
- dayPeriod: buildMatchFn({
3606
- matchPatterns: matchDayPeriodPatterns$2,
3607
- defaultMatchWidth: "any",
3608
- parsePatterns: parseDayPeriodPatterns$2,
3609
- defaultParseWidth: "any"
3610
- })
3611
- };
3612
- const enUS = {
3613
- code: "en-US",
3614
- formatDistance: formatDistance$2,
3615
- formatLong: formatLong$2,
3616
- formatRelative: formatRelative$2,
3617
- localize: localize$2,
3618
- match: match$2,
3619
- options: {
3620
- weekStartsOn: 0,
3621
- firstWeekContainsDate: 1
3622
- }
3623
- };
3624
- function getDayOfYear(date) {
3625
- const _date = toDate(date);
3626
- const diff = differenceInCalendarDays(_date, startOfYear(_date));
3627
- const dayOfYear = diff + 1;
3628
- return dayOfYear;
3629
- }
3630
- function getISOWeek(date) {
3631
- const _date = toDate(date);
3632
- const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
3633
- return Math.round(diff / millisecondsInWeek) + 1;
3634
- }
3635
- function getWeekYear(date, options) {
3636
- var _a, _b, _c, _d;
3637
- const _date = toDate(date);
3638
- const year = _date.getFullYear();
3639
- const defaultOptions2 = getDefaultOptions();
3640
- const firstWeekContainsDate = (options == null ? void 0 : options.firstWeekContainsDate) ?? ((_b = (_a = options == null ? void 0 : options.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.firstWeekContainsDate) ?? defaultOptions2.firstWeekContainsDate ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.firstWeekContainsDate) ?? 1;
3641
- const firstWeekOfNextYear = constructFrom(date, 0);
3642
- firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
3643
- firstWeekOfNextYear.setHours(0, 0, 0, 0);
3644
- const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
3645
- const firstWeekOfThisYear = constructFrom(date, 0);
3646
- firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
3647
- firstWeekOfThisYear.setHours(0, 0, 0, 0);
3648
- const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
3649
- if (_date.getTime() >= startOfNextYear.getTime()) {
3650
- return year + 1;
3651
- } else if (_date.getTime() >= startOfThisYear.getTime()) {
3652
- return year;
3653
- } else {
3654
- return year - 1;
3655
- }
3656
- }
3657
- function startOfWeekYear(date, options) {
3658
- var _a, _b, _c, _d;
3659
- const defaultOptions2 = getDefaultOptions();
3660
- const firstWeekContainsDate = (options == null ? void 0 : options.firstWeekContainsDate) ?? ((_b = (_a = options == null ? void 0 : options.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.firstWeekContainsDate) ?? defaultOptions2.firstWeekContainsDate ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.firstWeekContainsDate) ?? 1;
3661
- const year = getWeekYear(date, options);
3662
- const firstWeek = constructFrom(date, 0);
3663
- firstWeek.setFullYear(year, 0, firstWeekContainsDate);
3664
- firstWeek.setHours(0, 0, 0, 0);
3665
- const _date = startOfWeek(firstWeek, options);
3666
- return _date;
3667
- }
3668
- function getWeek(date, options) {
3669
- const _date = toDate(date);
3670
- const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
3671
- return Math.round(diff / millisecondsInWeek) + 1;
3672
- }
3673
- function addLeadingZeros(number, targetLength) {
3674
- const sign = number < 0 ? "-" : "";
3675
- const output = Math.abs(number).toString().padStart(targetLength, "0");
3676
- return sign + output;
3677
- }
3678
- const lightFormatters = {
3679
- // Year
3680
- y(date, token) {
3681
- const signedYear = date.getFullYear();
3682
- const year = signedYear > 0 ? signedYear : 1 - signedYear;
3683
- return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
3684
- },
3685
- // Month
3686
- M(date, token) {
3687
- const month = date.getMonth();
3688
- return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
3689
- },
3690
- // Day of the month
3691
- d(date, token) {
3692
- return addLeadingZeros(date.getDate(), token.length);
3693
- },
3694
- // AM or PM
3695
- a(date, token) {
3696
- const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
3697
- switch (token) {
3698
- case "a":
3699
- case "aa":
3700
- return dayPeriodEnumValue.toUpperCase();
3701
- case "aaa":
3702
- return dayPeriodEnumValue;
3703
- case "aaaaa":
3704
- return dayPeriodEnumValue[0];
3705
- case "aaaa":
3706
- default:
3707
- return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
3708
- }
3709
- },
3710
- // Hour [1-12]
3711
- h(date, token) {
3712
- return addLeadingZeros(date.getHours() % 12 || 12, token.length);
3713
- },
3714
- // Hour [0-23]
3715
- H(date, token) {
3716
- return addLeadingZeros(date.getHours(), token.length);
3717
- },
3718
- // Minute
3719
- m(date, token) {
3720
- return addLeadingZeros(date.getMinutes(), token.length);
3721
- },
3722
- // Second
3723
- s(date, token) {
3724
- return addLeadingZeros(date.getSeconds(), token.length);
3725
- },
3726
- // Fraction of second
3727
- S(date, token) {
3728
- const numberOfDigits = token.length;
3729
- const milliseconds = date.getMilliseconds();
3730
- const fractionalSeconds = Math.trunc(
3731
- milliseconds * Math.pow(10, numberOfDigits - 3)
3732
- );
3733
- return addLeadingZeros(fractionalSeconds, token.length);
3734
- }
3735
- };
3736
- const dayPeriodEnum = {
3737
- midnight: "midnight",
3738
- noon: "noon",
3739
- morning: "morning",
3740
- afternoon: "afternoon",
3741
- evening: "evening",
3742
- night: "night"
3743
- };
3744
- const formatters = {
3745
- // Era
3746
- G: function(date, token, localize2) {
3747
- const era = date.getFullYear() > 0 ? 1 : 0;
3748
- switch (token) {
3749
- case "G":
3750
- case "GG":
3751
- case "GGG":
3752
- return localize2.era(era, { width: "abbreviated" });
3753
- case "GGGGG":
3754
- return localize2.era(era, { width: "narrow" });
3755
- case "GGGG":
3756
- default:
3757
- return localize2.era(era, { width: "wide" });
3758
- }
3759
- },
3760
- // Year
3761
- y: function(date, token, localize2) {
3762
- if (token === "yo") {
3763
- const signedYear = date.getFullYear();
3764
- const year = signedYear > 0 ? signedYear : 1 - signedYear;
3765
- return localize2.ordinalNumber(year, { unit: "year" });
3766
- }
3767
- return lightFormatters.y(date, token);
3768
- },
3769
- // Local week-numbering year
3770
- Y: function(date, token, localize2, options) {
3771
- const signedWeekYear = getWeekYear(date, options);
3772
- const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
3773
- if (token === "YY") {
3774
- const twoDigitYear = weekYear % 100;
3775
- return addLeadingZeros(twoDigitYear, 2);
3776
- }
3777
- if (token === "Yo") {
3778
- return localize2.ordinalNumber(weekYear, { unit: "year" });
3779
- }
3780
- return addLeadingZeros(weekYear, token.length);
3781
- },
3782
- // ISO week-numbering year
3783
- R: function(date, token) {
3784
- const isoWeekYear = getISOWeekYear(date);
3785
- return addLeadingZeros(isoWeekYear, token.length);
3786
- },
3787
- // Extended year. This is a single number designating the year of this calendar system.
3788
- // The main difference between `y` and `u` localizers are B.C. years:
3789
- // | Year | `y` | `u` |
3790
- // |------|-----|-----|
3791
- // | AC 1 | 1 | 1 |
3792
- // | BC 1 | 1 | 0 |
3793
- // | BC 2 | 2 | -1 |
3794
- // Also `yy` always returns the last two digits of a year,
3795
- // while `uu` pads single digit years to 2 characters and returns other years unchanged.
3796
- u: function(date, token) {
3797
- const year = date.getFullYear();
3798
- return addLeadingZeros(year, token.length);
3799
- },
3800
- // Quarter
3801
- Q: function(date, token, localize2) {
3802
- const quarter = Math.ceil((date.getMonth() + 1) / 3);
3803
- switch (token) {
3804
- case "Q":
3805
- return String(quarter);
3806
- case "QQ":
3807
- return addLeadingZeros(quarter, 2);
3808
- case "Qo":
3809
- return localize2.ordinalNumber(quarter, { unit: "quarter" });
3810
- case "QQQ":
3811
- return localize2.quarter(quarter, {
3812
- width: "abbreviated",
3813
- context: "formatting"
3814
- });
3815
- case "QQQQQ":
3816
- return localize2.quarter(quarter, {
3817
- width: "narrow",
3818
- context: "formatting"
3819
- });
3820
- case "QQQQ":
3821
- default:
3822
- return localize2.quarter(quarter, {
3823
- width: "wide",
3824
- context: "formatting"
3825
- });
3826
- }
3827
- },
3828
- // Stand-alone quarter
3829
- q: function(date, token, localize2) {
3830
- const quarter = Math.ceil((date.getMonth() + 1) / 3);
3831
- switch (token) {
3832
- case "q":
3833
- return String(quarter);
3834
- case "qq":
3835
- return addLeadingZeros(quarter, 2);
3836
- case "qo":
3837
- return localize2.ordinalNumber(quarter, { unit: "quarter" });
3838
- case "qqq":
3839
- return localize2.quarter(quarter, {
3840
- width: "abbreviated",
3841
- context: "standalone"
3842
- });
3843
- case "qqqqq":
3844
- return localize2.quarter(quarter, {
3845
- width: "narrow",
3846
- context: "standalone"
3847
- });
3848
- case "qqqq":
3849
- default:
3850
- return localize2.quarter(quarter, {
3851
- width: "wide",
3852
- context: "standalone"
3853
- });
3854
- }
3855
- },
3856
- // Month
3857
- M: function(date, token, localize2) {
3858
- const month = date.getMonth();
3859
- switch (token) {
3860
- case "M":
3861
- case "MM":
3862
- return lightFormatters.M(date, token);
3863
- case "Mo":
3864
- return localize2.ordinalNumber(month + 1, { unit: "month" });
3865
- case "MMM":
3866
- return localize2.month(month, {
3867
- width: "abbreviated",
3868
- context: "formatting"
3869
- });
3870
- case "MMMMM":
3871
- return localize2.month(month, {
3872
- width: "narrow",
3873
- context: "formatting"
3874
- });
3875
- case "MMMM":
3876
- default:
3877
- return localize2.month(month, { width: "wide", context: "formatting" });
3878
- }
3879
- },
3880
- // Stand-alone month
3881
- L: function(date, token, localize2) {
3882
- const month = date.getMonth();
3883
- switch (token) {
3884
- case "L":
3885
- return String(month + 1);
3886
- case "LL":
3887
- return addLeadingZeros(month + 1, 2);
3888
- case "Lo":
3889
- return localize2.ordinalNumber(month + 1, { unit: "month" });
3890
- case "LLL":
3891
- return localize2.month(month, {
3892
- width: "abbreviated",
3893
- context: "standalone"
3894
- });
3895
- case "LLLLL":
3896
- return localize2.month(month, {
3897
- width: "narrow",
3898
- context: "standalone"
3899
- });
3900
- case "LLLL":
3901
- default:
3902
- return localize2.month(month, { width: "wide", context: "standalone" });
3903
- }
3904
- },
3905
- // Local week of year
3906
- w: function(date, token, localize2, options) {
3907
- const week = getWeek(date, options);
3908
- if (token === "wo") {
3909
- return localize2.ordinalNumber(week, { unit: "week" });
3910
- }
3911
- return addLeadingZeros(week, token.length);
3912
- },
3913
- // ISO week of year
3914
- I: function(date, token, localize2) {
3915
- const isoWeek = getISOWeek(date);
3916
- if (token === "Io") {
3917
- return localize2.ordinalNumber(isoWeek, { unit: "week" });
3918
- }
3919
- return addLeadingZeros(isoWeek, token.length);
3920
- },
3921
- // Day of the month
3922
- d: function(date, token, localize2) {
3923
- if (token === "do") {
3924
- return localize2.ordinalNumber(date.getDate(), { unit: "date" });
3925
- }
3926
- return lightFormatters.d(date, token);
3927
- },
3928
- // Day of year
3929
- D: function(date, token, localize2) {
3930
- const dayOfYear = getDayOfYear(date);
3931
- if (token === "Do") {
3932
- return localize2.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
3933
- }
3934
- return addLeadingZeros(dayOfYear, token.length);
3935
- },
3936
- // Day of week
3937
- E: function(date, token, localize2) {
3938
- const dayOfWeek = date.getDay();
3939
- switch (token) {
3940
- case "E":
3941
- case "EE":
3942
- case "EEE":
3943
- return localize2.day(dayOfWeek, {
3944
- width: "abbreviated",
3945
- context: "formatting"
3946
- });
3947
- case "EEEEE":
3948
- return localize2.day(dayOfWeek, {
3949
- width: "narrow",
3950
- context: "formatting"
3951
- });
3952
- case "EEEEEE":
3953
- return localize2.day(dayOfWeek, {
3954
- width: "short",
3955
- context: "formatting"
3956
- });
3957
- case "EEEE":
3958
- default:
3959
- return localize2.day(dayOfWeek, {
3960
- width: "wide",
3961
- context: "formatting"
3962
- });
3963
- }
3964
- },
3965
- // Local day of week
3966
- e: function(date, token, localize2, options) {
3967
- const dayOfWeek = date.getDay();
3968
- const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
3969
- switch (token) {
3970
- case "e":
3971
- return String(localDayOfWeek);
3972
- case "ee":
3973
- return addLeadingZeros(localDayOfWeek, 2);
3974
- case "eo":
3975
- return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
3976
- case "eee":
3977
- return localize2.day(dayOfWeek, {
3978
- width: "abbreviated",
3979
- context: "formatting"
3980
- });
3981
- case "eeeee":
3982
- return localize2.day(dayOfWeek, {
3983
- width: "narrow",
3984
- context: "formatting"
3985
- });
3986
- case "eeeeee":
3987
- return localize2.day(dayOfWeek, {
3988
- width: "short",
3989
- context: "formatting"
3990
- });
3991
- case "eeee":
3992
- default:
3993
- return localize2.day(dayOfWeek, {
3994
- width: "wide",
3995
- context: "formatting"
3996
- });
3997
- }
3998
- },
3999
- // Stand-alone local day of week
4000
- c: function(date, token, localize2, options) {
4001
- const dayOfWeek = date.getDay();
4002
- const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
4003
- switch (token) {
4004
- case "c":
4005
- return String(localDayOfWeek);
4006
- case "cc":
4007
- return addLeadingZeros(localDayOfWeek, token.length);
4008
- case "co":
4009
- return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
4010
- case "ccc":
4011
- return localize2.day(dayOfWeek, {
4012
- width: "abbreviated",
4013
- context: "standalone"
4014
- });
4015
- case "ccccc":
4016
- return localize2.day(dayOfWeek, {
4017
- width: "narrow",
4018
- context: "standalone"
4019
- });
4020
- case "cccccc":
4021
- return localize2.day(dayOfWeek, {
4022
- width: "short",
4023
- context: "standalone"
4024
- });
4025
- case "cccc":
4026
- default:
4027
- return localize2.day(dayOfWeek, {
4028
- width: "wide",
4029
- context: "standalone"
4030
- });
4031
- }
4032
- },
4033
- // ISO day of week
4034
- i: function(date, token, localize2) {
4035
- const dayOfWeek = date.getDay();
4036
- const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
4037
- switch (token) {
4038
- case "i":
4039
- return String(isoDayOfWeek);
4040
- case "ii":
4041
- return addLeadingZeros(isoDayOfWeek, token.length);
4042
- case "io":
4043
- return localize2.ordinalNumber(isoDayOfWeek, { unit: "day" });
4044
- case "iii":
4045
- return localize2.day(dayOfWeek, {
4046
- width: "abbreviated",
4047
- context: "formatting"
4048
- });
4049
- case "iiiii":
4050
- return localize2.day(dayOfWeek, {
4051
- width: "narrow",
4052
- context: "formatting"
4053
- });
4054
- case "iiiiii":
4055
- return localize2.day(dayOfWeek, {
4056
- width: "short",
4057
- context: "formatting"
4058
- });
4059
- case "iiii":
4060
- default:
4061
- return localize2.day(dayOfWeek, {
4062
- width: "wide",
4063
- context: "formatting"
4064
- });
4065
- }
4066
- },
4067
- // AM or PM
4068
- a: function(date, token, localize2) {
4069
- const hours = date.getHours();
4070
- const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
4071
- switch (token) {
4072
- case "a":
4073
- case "aa":
4074
- return localize2.dayPeriod(dayPeriodEnumValue, {
4075
- width: "abbreviated",
4076
- context: "formatting"
4077
- });
4078
- case "aaa":
4079
- return localize2.dayPeriod(dayPeriodEnumValue, {
4080
- width: "abbreviated",
4081
- context: "formatting"
4082
- }).toLowerCase();
4083
- case "aaaaa":
4084
- return localize2.dayPeriod(dayPeriodEnumValue, {
4085
- width: "narrow",
4086
- context: "formatting"
4087
- });
4088
- case "aaaa":
4089
- default:
4090
- return localize2.dayPeriod(dayPeriodEnumValue, {
4091
- width: "wide",
4092
- context: "formatting"
4093
- });
4094
- }
4095
- },
4096
- // AM, PM, midnight, noon
4097
- b: function(date, token, localize2) {
4098
- const hours = date.getHours();
4099
- let dayPeriodEnumValue;
4100
- if (hours === 12) {
4101
- dayPeriodEnumValue = dayPeriodEnum.noon;
4102
- } else if (hours === 0) {
4103
- dayPeriodEnumValue = dayPeriodEnum.midnight;
4104
- } else {
4105
- dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
4106
- }
4107
- switch (token) {
4108
- case "b":
4109
- case "bb":
4110
- return localize2.dayPeriod(dayPeriodEnumValue, {
4111
- width: "abbreviated",
4112
- context: "formatting"
4113
- });
4114
- case "bbb":
4115
- return localize2.dayPeriod(dayPeriodEnumValue, {
4116
- width: "abbreviated",
4117
- context: "formatting"
4118
- }).toLowerCase();
4119
- case "bbbbb":
4120
- return localize2.dayPeriod(dayPeriodEnumValue, {
4121
- width: "narrow",
4122
- context: "formatting"
4123
- });
4124
- case "bbbb":
4125
- default:
4126
- return localize2.dayPeriod(dayPeriodEnumValue, {
4127
- width: "wide",
4128
- context: "formatting"
4129
- });
4130
- }
4131
- },
4132
- // in the morning, in the afternoon, in the evening, at night
4133
- B: function(date, token, localize2) {
4134
- const hours = date.getHours();
4135
- let dayPeriodEnumValue;
4136
- if (hours >= 17) {
4137
- dayPeriodEnumValue = dayPeriodEnum.evening;
4138
- } else if (hours >= 12) {
4139
- dayPeriodEnumValue = dayPeriodEnum.afternoon;
4140
- } else if (hours >= 4) {
4141
- dayPeriodEnumValue = dayPeriodEnum.morning;
4142
- } else {
4143
- dayPeriodEnumValue = dayPeriodEnum.night;
4144
- }
4145
- switch (token) {
4146
- case "B":
4147
- case "BB":
4148
- case "BBB":
4149
- return localize2.dayPeriod(dayPeriodEnumValue, {
4150
- width: "abbreviated",
4151
- context: "formatting"
4152
- });
4153
- case "BBBBB":
4154
- return localize2.dayPeriod(dayPeriodEnumValue, {
4155
- width: "narrow",
4156
- context: "formatting"
4157
- });
4158
- case "BBBB":
4159
- default:
4160
- return localize2.dayPeriod(dayPeriodEnumValue, {
4161
- width: "wide",
4162
- context: "formatting"
4163
- });
4164
- }
4165
- },
4166
- // Hour [1-12]
4167
- h: function(date, token, localize2) {
4168
- if (token === "ho") {
4169
- let hours = date.getHours() % 12;
4170
- if (hours === 0) hours = 12;
4171
- return localize2.ordinalNumber(hours, { unit: "hour" });
4172
- }
4173
- return lightFormatters.h(date, token);
4174
- },
4175
- // Hour [0-23]
4176
- H: function(date, token, localize2) {
4177
- if (token === "Ho") {
4178
- return localize2.ordinalNumber(date.getHours(), { unit: "hour" });
4179
- }
4180
- return lightFormatters.H(date, token);
4181
- },
4182
- // Hour [0-11]
4183
- K: function(date, token, localize2) {
4184
- const hours = date.getHours() % 12;
4185
- if (token === "Ko") {
4186
- return localize2.ordinalNumber(hours, { unit: "hour" });
4187
- }
4188
- return addLeadingZeros(hours, token.length);
4189
- },
4190
- // Hour [1-24]
4191
- k: function(date, token, localize2) {
4192
- let hours = date.getHours();
4193
- if (hours === 0) hours = 24;
4194
- if (token === "ko") {
4195
- return localize2.ordinalNumber(hours, { unit: "hour" });
4196
- }
4197
- return addLeadingZeros(hours, token.length);
4198
- },
4199
- // Minute
4200
- m: function(date, token, localize2) {
4201
- if (token === "mo") {
4202
- return localize2.ordinalNumber(date.getMinutes(), { unit: "minute" });
4203
- }
4204
- return lightFormatters.m(date, token);
4205
- },
4206
- // Second
4207
- s: function(date, token, localize2) {
4208
- if (token === "so") {
4209
- return localize2.ordinalNumber(date.getSeconds(), { unit: "second" });
4210
- }
4211
- return lightFormatters.s(date, token);
4212
- },
4213
- // Fraction of second
4214
- S: function(date, token) {
4215
- return lightFormatters.S(date, token);
4216
- },
4217
- // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
4218
- X: function(date, token, _localize) {
4219
- const timezoneOffset = date.getTimezoneOffset();
4220
- if (timezoneOffset === 0) {
4221
- return "Z";
4222
- }
4223
- switch (token) {
4224
- case "X":
4225
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
4226
- case "XXXX":
4227
- case "XX":
4228
- return formatTimezone(timezoneOffset);
4229
- case "XXXXX":
4230
- case "XXX":
4231
- default:
4232
- return formatTimezone(timezoneOffset, ":");
4233
- }
4234
- },
4235
- // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
4236
- x: function(date, token, _localize) {
4237
- const timezoneOffset = date.getTimezoneOffset();
4238
- switch (token) {
4239
- case "x":
4240
- return formatTimezoneWithOptionalMinutes(timezoneOffset);
4241
- case "xxxx":
4242
- case "xx":
4243
- return formatTimezone(timezoneOffset);
4244
- case "xxxxx":
4245
- case "xxx":
4246
- default:
4247
- return formatTimezone(timezoneOffset, ":");
4248
- }
4249
- },
4250
- // Timezone (GMT)
4251
- O: function(date, token, _localize) {
4252
- const timezoneOffset = date.getTimezoneOffset();
4253
- switch (token) {
4254
- case "O":
4255
- case "OO":
4256
- case "OOO":
4257
- return "GMT" + formatTimezoneShort(timezoneOffset, ":");
4258
- case "OOOO":
4259
- default:
4260
- return "GMT" + formatTimezone(timezoneOffset, ":");
4261
- }
4262
- },
4263
- // Timezone (specific non-location)
4264
- z: function(date, token, _localize) {
4265
- const timezoneOffset = date.getTimezoneOffset();
4266
- switch (token) {
4267
- case "z":
4268
- case "zz":
4269
- case "zzz":
4270
- return "GMT" + formatTimezoneShort(timezoneOffset, ":");
4271
- case "zzzz":
4272
- default:
4273
- return "GMT" + formatTimezone(timezoneOffset, ":");
4274
- }
4275
- },
4276
- // Seconds timestamp
4277
- t: function(date, token, _localize) {
4278
- const timestamp = Math.trunc(date.getTime() / 1e3);
4279
- return addLeadingZeros(timestamp, token.length);
4280
- },
4281
- // Milliseconds timestamp
4282
- T: function(date, token, _localize) {
4283
- const timestamp = date.getTime();
4284
- return addLeadingZeros(timestamp, token.length);
4285
- }
4286
- };
4287
- function formatTimezoneShort(offset, delimiter = "") {
4288
- const sign = offset > 0 ? "-" : "+";
4289
- const absOffset = Math.abs(offset);
4290
- const hours = Math.trunc(absOffset / 60);
4291
- const minutes = absOffset % 60;
4292
- if (minutes === 0) {
4293
- return sign + String(hours);
4294
- }
4295
- return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
4296
- }
4297
- function formatTimezoneWithOptionalMinutes(offset, delimiter) {
4298
- if (offset % 60 === 0) {
4299
- const sign = offset > 0 ? "-" : "+";
4300
- return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
4301
- }
4302
- return formatTimezone(offset, delimiter);
4303
- }
4304
- function formatTimezone(offset, delimiter = "") {
4305
- const sign = offset > 0 ? "-" : "+";
4306
- const absOffset = Math.abs(offset);
4307
- const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
4308
- const minutes = addLeadingZeros(absOffset % 60, 2);
4309
- return sign + hours + delimiter + minutes;
4310
- }
4311
- const dateLongFormatter = (pattern, formatLong2) => {
4312
- switch (pattern) {
4313
- case "P":
4314
- return formatLong2.date({ width: "short" });
4315
- case "PP":
4316
- return formatLong2.date({ width: "medium" });
4317
- case "PPP":
4318
- return formatLong2.date({ width: "long" });
4319
- case "PPPP":
4320
- default:
4321
- return formatLong2.date({ width: "full" });
4322
- }
4323
- };
4324
- const timeLongFormatter = (pattern, formatLong2) => {
4325
- switch (pattern) {
4326
- case "p":
4327
- return formatLong2.time({ width: "short" });
4328
- case "pp":
4329
- return formatLong2.time({ width: "medium" });
4330
- case "ppp":
4331
- return formatLong2.time({ width: "long" });
4332
- case "pppp":
4333
- default:
4334
- return formatLong2.time({ width: "full" });
4335
- }
4336
- };
4337
- const dateTimeLongFormatter = (pattern, formatLong2) => {
4338
- const matchResult = pattern.match(/(P+)(p+)?/) || [];
4339
- const datePattern = matchResult[1];
4340
- const timePattern = matchResult[2];
4341
- if (!timePattern) {
4342
- return dateLongFormatter(pattern, formatLong2);
4343
- }
4344
- let dateTimeFormat;
4345
- switch (datePattern) {
4346
- case "P":
4347
- dateTimeFormat = formatLong2.dateTime({ width: "short" });
4348
- break;
4349
- case "PP":
4350
- dateTimeFormat = formatLong2.dateTime({ width: "medium" });
4351
- break;
4352
- case "PPP":
4353
- dateTimeFormat = formatLong2.dateTime({ width: "long" });
4354
- break;
4355
- case "PPPP":
4356
- default:
4357
- dateTimeFormat = formatLong2.dateTime({ width: "full" });
4358
- break;
4359
- }
4360
- return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
4361
- };
4362
- const longFormatters = {
4363
- p: timeLongFormatter,
4364
- P: dateTimeLongFormatter
4365
- };
4366
- const dayOfYearTokenRE = /^D+$/;
4367
- const weekYearTokenRE = /^Y+$/;
4368
- const throwTokens = ["D", "DD", "YY", "YYYY"];
4369
- function isProtectedDayOfYearToken(token) {
4370
- return dayOfYearTokenRE.test(token);
4371
- }
4372
- function isProtectedWeekYearToken(token) {
4373
- return weekYearTokenRE.test(token);
4374
- }
4375
- function warnOrThrowProtectedError(token, format2, input) {
4376
- const _message = message(token, format2, input);
4377
- console.warn(_message);
4378
- if (throwTokens.includes(token)) throw new RangeError(_message);
4379
- }
4380
- function message(token, format2, input) {
4381
- const subject = token[0] === "Y" ? "years" : "days of the month";
4382
- return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format2}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
4383
- }
4384
- const formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
4385
- const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
4386
- const escapedStringRegExp = /^'([^]*?)'?$/;
4387
- const doubleQuoteRegExp = /''/g;
4388
- const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
4389
- function format(date, formatStr, options) {
4390
- var _a, _b, _c, _d, _e, _f, _g, _h;
4391
- const defaultOptions2 = getDefaultOptions();
4392
- const locale = (options == null ? void 0 : options.locale) ?? defaultOptions2.locale ?? enUS;
4393
- const firstWeekContainsDate = (options == null ? void 0 : options.firstWeekContainsDate) ?? ((_b = (_a = options == null ? void 0 : options.locale) == null ? void 0 : _a.options) == null ? void 0 : _b.firstWeekContainsDate) ?? defaultOptions2.firstWeekContainsDate ?? ((_d = (_c = defaultOptions2.locale) == null ? void 0 : _c.options) == null ? void 0 : _d.firstWeekContainsDate) ?? 1;
4394
- const weekStartsOn = (options == null ? void 0 : options.weekStartsOn) ?? ((_f = (_e = options == null ? void 0 : options.locale) == null ? void 0 : _e.options) == null ? void 0 : _f.weekStartsOn) ?? defaultOptions2.weekStartsOn ?? ((_h = (_g = defaultOptions2.locale) == null ? void 0 : _g.options) == null ? void 0 : _h.weekStartsOn) ?? 0;
4395
- const originalDate = toDate(date);
4396
- if (!isValid(originalDate)) {
4397
- throw new RangeError("Invalid time value");
4398
- }
4399
- let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
4400
- const firstCharacter = substring[0];
4401
- if (firstCharacter === "p" || firstCharacter === "P") {
4402
- const longFormatter = longFormatters[firstCharacter];
4403
- return longFormatter(substring, locale.formatLong);
4404
- }
4405
- return substring;
4406
- }).join("").match(formattingTokensRegExp).map((substring) => {
4407
- if (substring === "''") {
4408
- return { isToken: false, value: "'" };
4409
- }
4410
- const firstCharacter = substring[0];
4411
- if (firstCharacter === "'") {
4412
- return { isToken: false, value: cleanEscapedString(substring) };
4413
- }
4414
- if (formatters[firstCharacter]) {
4415
- return { isToken: true, value: substring };
4416
- }
4417
- if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
4418
- throw new RangeError(
4419
- "Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
4420
- );
4421
- }
4422
- return { isToken: false, value: substring };
4423
- });
4424
- if (locale.localize.preprocessor) {
4425
- parts = locale.localize.preprocessor(originalDate, parts);
4426
- }
4427
- const formatterOptions = {
4428
- firstWeekContainsDate,
4429
- weekStartsOn,
4430
- locale
4431
- };
4432
- return parts.map((part) => {
4433
- if (!part.isToken) return part.value;
4434
- const token = part.value;
4435
- if (!(options == null ? void 0 : options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(token) || !(options == null ? void 0 : options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(token)) {
4436
- warnOrThrowProtectedError(token, formatStr, String(date));
4437
- }
4438
- const formatter = formatters[token[0]];
4439
- return formatter(originalDate, token, locale.localize, formatterOptions);
4440
- }).join("");
4441
- }
4442
- function cleanEscapedString(input) {
4443
- const matched = input.match(escapedStringRegExp);
4444
- if (!matched) {
4445
- return input;
4446
- }
4447
- return matched[1].replace(doubleQuoteRegExp, "'");
4448
- }
4449
- function isSameWeek(dateLeft, dateRight, options) {
4450
- const dateLeftStartOfWeek = startOfWeek(dateLeft, options);
4451
- const dateRightStartOfWeek = startOfWeek(dateRight, options);
4452
- return +dateLeftStartOfWeek === +dateRightStartOfWeek;
4453
- }
4454
- const formatDistanceLocale$1 = {
4455
- lessThanXSeconds: {
4456
- standalone: {
4457
- one: "weniger als 1 Sekunde",
4458
- other: "weniger als {{count}} Sekunden"
4459
- },
4460
- withPreposition: {
4461
- one: "weniger als 1 Sekunde",
4462
- other: "weniger als {{count}} Sekunden"
4463
- }
4464
- },
4465
- xSeconds: {
4466
- standalone: {
4467
- one: "1 Sekunde",
4468
- other: "{{count}} Sekunden"
4469
- },
4470
- withPreposition: {
4471
- one: "1 Sekunde",
4472
- other: "{{count}} Sekunden"
4473
- }
4474
- },
4475
- halfAMinute: {
4476
- standalone: "eine halbe Minute",
4477
- withPreposition: "einer halben Minute"
4478
- },
4479
- lessThanXMinutes: {
4480
- standalone: {
4481
- one: "weniger als 1 Minute",
4482
- other: "weniger als {{count}} Minuten"
4483
- },
4484
- withPreposition: {
4485
- one: "weniger als 1 Minute",
4486
- other: "weniger als {{count}} Minuten"
4487
- }
4488
- },
4489
- xMinutes: {
4490
- standalone: {
4491
- one: "1 Minute",
4492
- other: "{{count}} Minuten"
4493
- },
4494
- withPreposition: {
4495
- one: "1 Minute",
4496
- other: "{{count}} Minuten"
4497
- }
4498
- },
4499
- aboutXHours: {
4500
- standalone: {
4501
- one: "etwa 1 Stunde",
4502
- other: "etwa {{count}} Stunden"
4503
- },
4504
- withPreposition: {
4505
- one: "etwa 1 Stunde",
4506
- other: "etwa {{count}} Stunden"
4507
- }
4508
- },
4509
- xHours: {
4510
- standalone: {
4511
- one: "1 Stunde",
4512
- other: "{{count}} Stunden"
4513
- },
4514
- withPreposition: {
4515
- one: "1 Stunde",
4516
- other: "{{count}} Stunden"
4517
- }
4518
- },
4519
- xDays: {
4520
- standalone: {
4521
- one: "1 Tag",
4522
- other: "{{count}} Tage"
4523
- },
4524
- withPreposition: {
4525
- one: "1 Tag",
4526
- other: "{{count}} Tagen"
4527
- }
4528
- },
4529
- aboutXWeeks: {
4530
- standalone: {
4531
- one: "etwa 1 Woche",
4532
- other: "etwa {{count}} Wochen"
4533
- },
4534
- withPreposition: {
4535
- one: "etwa 1 Woche",
4536
- other: "etwa {{count}} Wochen"
4537
- }
4538
- },
4539
- xWeeks: {
4540
- standalone: {
4541
- one: "1 Woche",
4542
- other: "{{count}} Wochen"
4543
- },
4544
- withPreposition: {
4545
- one: "1 Woche",
4546
- other: "{{count}} Wochen"
4547
- }
4548
- },
4549
- aboutXMonths: {
4550
- standalone: {
4551
- one: "etwa 1 Monat",
4552
- other: "etwa {{count}} Monate"
4553
- },
4554
- withPreposition: {
4555
- one: "etwa 1 Monat",
4556
- other: "etwa {{count}} Monaten"
4557
- }
4558
- },
4559
- xMonths: {
4560
- standalone: {
4561
- one: "1 Monat",
4562
- other: "{{count}} Monate"
4563
- },
4564
- withPreposition: {
4565
- one: "1 Monat",
4566
- other: "{{count}} Monaten"
4567
- }
4568
- },
4569
- aboutXYears: {
4570
- standalone: {
4571
- one: "etwa 1 Jahr",
4572
- other: "etwa {{count}} Jahre"
4573
- },
4574
- withPreposition: {
4575
- one: "etwa 1 Jahr",
4576
- other: "etwa {{count}} Jahren"
4577
- }
4578
- },
4579
- xYears: {
4580
- standalone: {
4581
- one: "1 Jahr",
4582
- other: "{{count}} Jahre"
4583
- },
4584
- withPreposition: {
4585
- one: "1 Jahr",
4586
- other: "{{count}} Jahren"
4587
- }
4588
- },
4589
- overXYears: {
4590
- standalone: {
4591
- one: "mehr als 1 Jahr",
4592
- other: "mehr als {{count}} Jahre"
4593
- },
4594
- withPreposition: {
4595
- one: "mehr als 1 Jahr",
4596
- other: "mehr als {{count}} Jahren"
4597
- }
4598
- },
4599
- almostXYears: {
4600
- standalone: {
4601
- one: "fast 1 Jahr",
4602
- other: "fast {{count}} Jahre"
4603
- },
4604
- withPreposition: {
4605
- one: "fast 1 Jahr",
4606
- other: "fast {{count}} Jahren"
4607
- }
4608
- }
4609
- };
4610
- const formatDistance$1 = (token, count, options) => {
4611
- let result;
4612
- const tokenValue = (options == null ? void 0 : options.addSuffix) ? formatDistanceLocale$1[token].withPreposition : formatDistanceLocale$1[token].standalone;
4613
- if (typeof tokenValue === "string") {
4614
- result = tokenValue;
4615
- } else if (count === 1) {
4616
- result = tokenValue.one;
4617
- } else {
4618
- result = tokenValue.other.replace("{{count}}", String(count));
4619
- }
4620
- if (options == null ? void 0 : options.addSuffix) {
4621
- if (options.comparison && options.comparison > 0) {
4622
- return "in " + result;
4623
- } else {
4624
- return "vor " + result;
4625
- }
4626
- }
4627
- return result;
4628
- };
4629
- const dateFormats$1 = {
4630
- full: "EEEE, do MMMM y",
4631
- // Montag, 7. Januar 2018
4632
- long: "do MMMM y",
4633
- // 7. Januar 2018
4634
- medium: "do MMM y",
4635
- // 7. Jan. 2018
4636
- short: "dd.MM.y"
4637
- // 07.01.2018
4638
- };
4639
- const timeFormats$1 = {
4640
- full: "HH:mm:ss zzzz",
4641
- long: "HH:mm:ss z",
4642
- medium: "HH:mm:ss",
4643
- short: "HH:mm"
4644
- };
4645
- const dateTimeFormats$1 = {
4646
- full: "{{date}} 'um' {{time}}",
4647
- long: "{{date}} 'um' {{time}}",
4648
- medium: "{{date}} {{time}}",
4649
- short: "{{date}} {{time}}"
4650
- };
4651
- const formatLong$1 = {
4652
- date: buildFormatLongFn({
4653
- formats: dateFormats$1,
4654
- defaultWidth: "full"
4655
- }),
4656
- time: buildFormatLongFn({
4657
- formats: timeFormats$1,
4658
- defaultWidth: "full"
4659
- }),
4660
- dateTime: buildFormatLongFn({
4661
- formats: dateTimeFormats$1,
4662
- defaultWidth: "full"
4663
- })
4664
- };
4665
- const formatRelativeLocale$1 = {
4666
- lastWeek: "'letzten' eeee 'um' p",
4667
- yesterday: "'gestern um' p",
4668
- today: "'heute um' p",
4669
- tomorrow: "'morgen um' p",
4670
- nextWeek: "eeee 'um' p",
4671
- other: "P"
4672
- };
4673
- const formatRelative$1 = (token, _date, _baseDate, _options) => formatRelativeLocale$1[token];
4674
- const eraValues$1 = {
4675
- narrow: ["v.Chr.", "n.Chr."],
4676
- abbreviated: ["v.Chr.", "n.Chr."],
4677
- wide: ["vor Christus", "nach Christus"]
4678
- };
4679
- const quarterValues$1 = {
4680
- narrow: ["1", "2", "3", "4"],
4681
- abbreviated: ["Q1", "Q2", "Q3", "Q4"],
4682
- wide: ["1. Quartal", "2. Quartal", "3. Quartal", "4. Quartal"]
4683
- };
4684
- const monthValues$1 = {
4685
- narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
4686
- abbreviated: [
4687
- "Jan",
4688
- "Feb",
4689
- "Mär",
4690
- "Apr",
4691
- "Mai",
4692
- "Jun",
4693
- "Jul",
4694
- "Aug",
4695
- "Sep",
4696
- "Okt",
4697
- "Nov",
4698
- "Dez"
4699
- ],
4700
- wide: [
4701
- "Januar",
4702
- "Februar",
4703
- "März",
4704
- "April",
4705
- "Mai",
4706
- "Juni",
4707
- "Juli",
4708
- "August",
4709
- "September",
4710
- "Oktober",
4711
- "November",
4712
- "Dezember"
4713
- ]
4714
- };
4715
- const formattingMonthValues = {
4716
- narrow: monthValues$1.narrow,
4717
- abbreviated: [
4718
- "Jan.",
4719
- "Feb.",
4720
- "März",
4721
- "Apr.",
4722
- "Mai",
4723
- "Juni",
4724
- "Juli",
4725
- "Aug.",
4726
- "Sep.",
4727
- "Okt.",
4728
- "Nov.",
4729
- "Dez."
4730
- ],
4731
- wide: monthValues$1.wide
4732
- };
4733
- const dayValues$1 = {
4734
- narrow: ["S", "M", "D", "M", "D", "F", "S"],
4735
- short: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
4736
- abbreviated: ["So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."],
4737
- wide: [
4738
- "Sonntag",
4739
- "Montag",
4740
- "Dienstag",
4741
- "Mittwoch",
4742
- "Donnerstag",
4743
- "Freitag",
4744
- "Samstag"
4745
- ]
4746
- };
4747
- const dayPeriodValues$1 = {
4748
- narrow: {
4749
- am: "vm.",
4750
- pm: "nm.",
4751
- midnight: "Mitternacht",
4752
- noon: "Mittag",
4753
- morning: "Morgen",
4754
- afternoon: "Nachm.",
4755
- evening: "Abend",
4756
- night: "Nacht"
4757
- },
4758
- abbreviated: {
4759
- am: "vorm.",
4760
- pm: "nachm.",
4761
- midnight: "Mitternacht",
4762
- noon: "Mittag",
4763
- morning: "Morgen",
4764
- afternoon: "Nachmittag",
4765
- evening: "Abend",
4766
- night: "Nacht"
4767
- },
4768
- wide: {
4769
- am: "vormittags",
4770
- pm: "nachmittags",
4771
- midnight: "Mitternacht",
4772
- noon: "Mittag",
4773
- morning: "Morgen",
4774
- afternoon: "Nachmittag",
4775
- evening: "Abend",
4776
- night: "Nacht"
4777
- }
4778
- };
4779
- const formattingDayPeriodValues = {
4780
- narrow: {
4781
- am: "vm.",
4782
- pm: "nm.",
4783
- midnight: "Mitternacht",
4784
- noon: "Mittag",
4785
- morning: "morgens",
4786
- afternoon: "nachm.",
4787
- evening: "abends",
4788
- night: "nachts"
4789
- },
4790
- abbreviated: {
4791
- am: "vorm.",
4792
- pm: "nachm.",
4793
- midnight: "Mitternacht",
4794
- noon: "Mittag",
4795
- morning: "morgens",
4796
- afternoon: "nachmittags",
4797
- evening: "abends",
4798
- night: "nachts"
4799
- },
4800
- wide: {
4801
- am: "vormittags",
4802
- pm: "nachmittags",
4803
- midnight: "Mitternacht",
4804
- noon: "Mittag",
4805
- morning: "morgens",
4806
- afternoon: "nachmittags",
4807
- evening: "abends",
4808
- night: "nachts"
4809
- }
4810
- };
4811
- const ordinalNumber$1 = (dirtyNumber) => {
4812
- const number = Number(dirtyNumber);
4813
- return number + ".";
4814
- };
4815
- const localize$1 = {
4816
- ordinalNumber: ordinalNumber$1,
4817
- era: buildLocalizeFn({
4818
- values: eraValues$1,
4819
- defaultWidth: "wide"
4820
- }),
4821
- quarter: buildLocalizeFn({
4822
- values: quarterValues$1,
4823
- defaultWidth: "wide",
4824
- argumentCallback: (quarter) => quarter - 1
4825
- }),
4826
- month: buildLocalizeFn({
4827
- values: monthValues$1,
4828
- formattingValues: formattingMonthValues,
4829
- defaultWidth: "wide"
4830
- }),
4831
- day: buildLocalizeFn({
4832
- values: dayValues$1,
4833
- defaultWidth: "wide"
4834
- }),
4835
- dayPeriod: buildLocalizeFn({
4836
- values: dayPeriodValues$1,
4837
- defaultWidth: "wide",
4838
- formattingValues: formattingDayPeriodValues,
4839
- defaultFormattingWidth: "wide"
4840
- })
4841
- };
4842
- const matchOrdinalNumberPattern$1 = /^(\d+)(\.)?/i;
4843
- const parseOrdinalNumberPattern$1 = /\d+/i;
4844
- const matchEraPatterns$1 = {
4845
- narrow: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
4846
- abbreviated: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
4847
- wide: /^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i
4848
- };
4849
- const parseEraPatterns$1 = {
4850
- any: [/^v/i, /^n/i]
4851
- };
4852
- const matchQuarterPatterns$1 = {
4853
- narrow: /^[1234]/i,
4854
- abbreviated: /^q[1234]/i,
4855
- wide: /^[1234](\.)? Quartal/i
4856
- };
4857
- const parseQuarterPatterns$1 = {
4858
- any: [/1/i, /2/i, /3/i, /4/i]
4859
- };
4860
- const matchMonthPatterns$1 = {
4861
- narrow: /^[jfmasond]/i,
4862
- abbreviated: /^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,
4863
- wide: /^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i
4864
- };
4865
- const parseMonthPatterns$1 = {
4866
- narrow: [
4867
- /^j/i,
4868
- /^f/i,
4869
- /^m/i,
4870
- /^a/i,
4871
- /^m/i,
4872
- /^j/i,
4873
- /^j/i,
4874
- /^a/i,
4875
- /^s/i,
4876
- /^o/i,
4877
- /^n/i,
4878
- /^d/i
4879
- ],
4880
- any: [
4881
- /^j[aä]/i,
4882
- /^f/i,
4883
- /^mär/i,
4884
- /^ap/i,
4885
- /^mai/i,
4886
- /^jun/i,
4887
- /^jul/i,
4888
- /^au/i,
4889
- /^s/i,
4890
- /^o/i,
4891
- /^n/i,
4892
- /^d/i
4893
- ]
4894
- };
4895
- const matchDayPatterns$1 = {
4896
- narrow: /^[smdmf]/i,
4897
- short: /^(so|mo|di|mi|do|fr|sa)/i,
4898
- abbreviated: /^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,
4899
- wide: /^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i
4900
- };
4901
- const parseDayPatterns$1 = {
4902
- any: [/^so/i, /^mo/i, /^di/i, /^mi/i, /^do/i, /^f/i, /^sa/i]
4903
- };
4904
- const matchDayPeriodPatterns$1 = {
4905
- narrow: /^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
4906
- abbreviated: /^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
4907
- wide: /^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i
4908
- };
4909
- const parseDayPeriodPatterns$1 = {
4910
- any: {
4911
- am: /^v/i,
4912
- pm: /^n/i,
4913
- midnight: /^Mitte/i,
4914
- noon: /^Mitta/i,
4915
- morning: /morgens/i,
4916
- afternoon: /nachmittags/i,
4917
- // will never be matched. Afternoon is matched by `pm`
4918
- evening: /abends/i,
4919
- night: /nachts/i
4920
- // will never be matched. Night is matched by `pm`
4921
- }
4922
- };
4923
- const match$1 = {
4924
- ordinalNumber: buildMatchPatternFn({
4925
- matchPattern: matchOrdinalNumberPattern$1,
4926
- parsePattern: parseOrdinalNumberPattern$1,
4927
- valueCallback: (value) => parseInt(value)
4928
- }),
4929
- era: buildMatchFn({
4930
- matchPatterns: matchEraPatterns$1,
4931
- defaultMatchWidth: "wide",
4932
- parsePatterns: parseEraPatterns$1,
4933
- defaultParseWidth: "any"
4934
- }),
4935
- quarter: buildMatchFn({
4936
- matchPatterns: matchQuarterPatterns$1,
4937
- defaultMatchWidth: "wide",
4938
- parsePatterns: parseQuarterPatterns$1,
4939
- defaultParseWidth: "any",
4940
- valueCallback: (index) => index + 1
4941
- }),
4942
- month: buildMatchFn({
4943
- matchPatterns: matchMonthPatterns$1,
4944
- defaultMatchWidth: "wide",
4945
- parsePatterns: parseMonthPatterns$1,
4946
- defaultParseWidth: "any"
4947
- }),
4948
- day: buildMatchFn({
4949
- matchPatterns: matchDayPatterns$1,
4950
- defaultMatchWidth: "wide",
4951
- parsePatterns: parseDayPatterns$1,
4952
- defaultParseWidth: "any"
4953
- }),
4954
- dayPeriod: buildMatchFn({
4955
- matchPatterns: matchDayPeriodPatterns$1,
4956
- defaultMatchWidth: "wide",
4957
- parsePatterns: parseDayPeriodPatterns$1,
4958
- defaultParseWidth: "any"
4959
- })
4960
- };
4961
- const de = {
4962
- code: "de",
4963
- formatDistance: formatDistance$1,
4964
- formatLong: formatLong$1,
4965
- formatRelative: formatRelative$1,
4966
- localize: localize$1,
4967
- match: match$1,
4968
- options: {
4969
- weekStartsOn: 1,
4970
- firstWeekContainsDate: 4
4971
- }
4972
- };
4973
- const formatDistanceLocale = {
4974
- lessThanXSeconds: {
4975
- one: {
4976
- regular: "mniej niż sekunda",
4977
- past: "mniej niż sekundę",
4978
- future: "mniej niż sekundę"
4979
- },
4980
- twoFour: "mniej niż {{count}} sekundy",
4981
- other: "mniej niż {{count}} sekund"
4982
- },
4983
- xSeconds: {
4984
- one: {
4985
- regular: "sekunda",
4986
- past: "sekundę",
4987
- future: "sekundę"
4988
- },
4989
- twoFour: "{{count}} sekundy",
4990
- other: "{{count}} sekund"
4991
- },
4992
- halfAMinute: {
4993
- one: "pół minuty",
4994
- twoFour: "pół minuty",
4995
- other: "pół minuty"
4996
- },
4997
- lessThanXMinutes: {
4998
- one: {
4999
- regular: "mniej niż minuta",
5000
- past: "mniej niż minutę",
5001
- future: "mniej niż minutę"
5002
- },
5003
- twoFour: "mniej niż {{count}} minuty",
5004
- other: "mniej niż {{count}} minut"
5005
- },
5006
- xMinutes: {
5007
- one: {
5008
- regular: "minuta",
5009
- past: "minutę",
5010
- future: "minutę"
5011
- },
5012
- twoFour: "{{count}} minuty",
5013
- other: "{{count}} minut"
5014
- },
5015
- aboutXHours: {
5016
- one: {
5017
- regular: "około godziny",
5018
- past: "około godziny",
5019
- future: "około godzinę"
5020
- },
5021
- twoFour: "około {{count}} godziny",
5022
- other: "około {{count}} godzin"
5023
- },
5024
- xHours: {
5025
- one: {
5026
- regular: "godzina",
5027
- past: "godzinę",
5028
- future: "godzinę"
5029
- },
5030
- twoFour: "{{count}} godziny",
5031
- other: "{{count}} godzin"
5032
- },
5033
- xDays: {
5034
- one: {
5035
- regular: "dzień",
5036
- past: "dzień",
5037
- future: "1 dzień"
5038
- },
5039
- twoFour: "{{count}} dni",
5040
- other: "{{count}} dni"
5041
- },
5042
- aboutXWeeks: {
5043
- one: "około tygodnia",
5044
- twoFour: "około {{count}} tygodni",
5045
- other: "około {{count}} tygodni"
5046
- },
5047
- xWeeks: {
5048
- one: "tydzień",
5049
- twoFour: "{{count}} tygodnie",
5050
- other: "{{count}} tygodni"
5051
- },
5052
- aboutXMonths: {
5053
- one: "około miesiąc",
5054
- twoFour: "około {{count}} miesiące",
5055
- other: "około {{count}} miesięcy"
5056
- },
5057
- xMonths: {
5058
- one: "miesiąc",
5059
- twoFour: "{{count}} miesiące",
5060
- other: "{{count}} miesięcy"
5061
- },
5062
- aboutXYears: {
5063
- one: "około rok",
5064
- twoFour: "około {{count}} lata",
5065
- other: "około {{count}} lat"
5066
- },
5067
- xYears: {
5068
- one: "rok",
5069
- twoFour: "{{count}} lata",
5070
- other: "{{count}} lat"
5071
- },
5072
- overXYears: {
5073
- one: "ponad rok",
5074
- twoFour: "ponad {{count}} lata",
5075
- other: "ponad {{count}} lat"
5076
- },
5077
- almostXYears: {
5078
- one: "prawie rok",
5079
- twoFour: "prawie {{count}} lata",
5080
- other: "prawie {{count}} lat"
5081
- }
5082
- };
5083
- function declensionGroup(scheme, count) {
5084
- if (count === 1) {
5085
- return scheme.one;
5086
- }
5087
- const rem100 = count % 100;
5088
- if (rem100 <= 20 && rem100 > 10) {
5089
- return scheme.other;
5090
- }
5091
- const rem10 = rem100 % 10;
5092
- if (rem10 >= 2 && rem10 <= 4) {
5093
- return scheme.twoFour;
5094
- }
5095
- return scheme.other;
5096
- }
5097
- function declension(scheme, count, time) {
5098
- const group = declensionGroup(scheme, count);
5099
- const finalText = typeof group === "string" ? group : group[time];
5100
- return finalText.replace("{{count}}", String(count));
5101
- }
5102
- const formatDistance = (token, count, options) => {
5103
- const scheme = formatDistanceLocale[token];
5104
- if (!(options == null ? void 0 : options.addSuffix)) {
5105
- return declension(scheme, count, "regular");
5106
- }
5107
- if (options.comparison && options.comparison > 0) {
5108
- return "za " + declension(scheme, count, "future");
5109
- } else {
5110
- return declension(scheme, count, "past") + " temu";
5111
- }
5112
- };
5113
- const dateFormats = {
5114
- full: "EEEE, do MMMM y",
5115
- long: "do MMMM y",
5116
- medium: "do MMM y",
5117
- short: "dd.MM.y"
5118
- };
5119
- const timeFormats = {
5120
- full: "HH:mm:ss zzzz",
5121
- long: "HH:mm:ss z",
5122
- medium: "HH:mm:ss",
5123
- short: "HH:mm"
5124
- };
5125
- const dateTimeFormats = {
5126
- full: "{{date}} {{time}}",
5127
- long: "{{date}} {{time}}",
5128
- medium: "{{date}}, {{time}}",
5129
- short: "{{date}}, {{time}}"
5130
- };
5131
- const formatLong = {
5132
- date: buildFormatLongFn({
5133
- formats: dateFormats,
5134
- defaultWidth: "full"
5135
- }),
5136
- time: buildFormatLongFn({
5137
- formats: timeFormats,
5138
- defaultWidth: "full"
5139
- }),
5140
- dateTime: buildFormatLongFn({
5141
- formats: dateTimeFormats,
5142
- defaultWidth: "full"
5143
- })
5144
- };
5145
- const adjectivesLastWeek = {
5146
- masculine: "ostatni",
5147
- feminine: "ostatnia"
5148
- };
5149
- const adjectivesThisWeek = {
5150
- masculine: "ten",
5151
- feminine: "ta"
5152
- };
5153
- const adjectivesNextWeek = {
5154
- masculine: "następny",
5155
- feminine: "następna"
5156
- };
5157
- const dayGrammaticalGender = {
5158
- 0: "feminine",
5159
- 1: "masculine",
5160
- 2: "masculine",
5161
- 3: "feminine",
5162
- 4: "masculine",
5163
- 5: "masculine",
5164
- 6: "feminine"
5165
- };
5166
- function dayAndTimeWithAdjective(token, date, baseDate, options) {
5167
- let adjectives;
5168
- if (isSameWeek(date, baseDate, options)) {
5169
- adjectives = adjectivesThisWeek;
5170
- } else if (token === "lastWeek") {
5171
- adjectives = adjectivesLastWeek;
5172
- } else if (token === "nextWeek") {
5173
- adjectives = adjectivesNextWeek;
5174
- } else {
5175
- throw new Error(`Cannot determine adjectives for token ${token}`);
5176
- }
5177
- const day = date.getDay();
5178
- const grammaticalGender = dayGrammaticalGender[day];
5179
- const adjective = adjectives[grammaticalGender];
5180
- return `'${adjective}' eeee 'o' p`;
5181
- }
5182
- const formatRelativeLocale = {
5183
- lastWeek: dayAndTimeWithAdjective,
5184
- yesterday: "'wczoraj o' p",
5185
- today: "'dzisiaj o' p",
5186
- tomorrow: "'jutro o' p",
5187
- nextWeek: dayAndTimeWithAdjective,
5188
- other: "P"
5189
- };
5190
- const formatRelative = (token, date, baseDate, options) => {
5191
- const format2 = formatRelativeLocale[token];
5192
- if (typeof format2 === "function") {
5193
- return format2(token, date, baseDate, options);
5194
- }
5195
- return format2;
5196
- };
5197
- const eraValues = {
5198
- narrow: ["p.n.e.", "n.e."],
5199
- abbreviated: ["p.n.e.", "n.e."],
5200
- wide: ["przed naszą erą", "naszej ery"]
5201
- };
5202
- const quarterValues = {
5203
- narrow: ["1", "2", "3", "4"],
5204
- abbreviated: ["I kw.", "II kw.", "III kw.", "IV kw."],
5205
- wide: ["I kwartał", "II kwartał", "III kwartał", "IV kwartał"]
5206
- };
5207
- const monthValues = {
5208
- narrow: ["S", "L", "M", "K", "M", "C", "L", "S", "W", "P", "L", "G"],
5209
- abbreviated: [
5210
- "sty",
5211
- "lut",
5212
- "mar",
5213
- "kwi",
5214
- "maj",
5215
- "cze",
5216
- "lip",
5217
- "sie",
5218
- "wrz",
5219
- "paź",
5220
- "lis",
5221
- "gru"
5222
- ],
5223
- wide: [
5224
- "styczeń",
5225
- "luty",
5226
- "marzec",
5227
- "kwiecień",
5228
- "maj",
5229
- "czerwiec",
5230
- "lipiec",
5231
- "sierpień",
5232
- "wrzesień",
5233
- "październik",
5234
- "listopad",
5235
- "grudzień"
5236
- ]
5237
- };
5238
- const monthFormattingValues = {
5239
- narrow: ["s", "l", "m", "k", "m", "c", "l", "s", "w", "p", "l", "g"],
5240
- abbreviated: [
5241
- "sty",
5242
- "lut",
5243
- "mar",
5244
- "kwi",
5245
- "maj",
5246
- "cze",
5247
- "lip",
5248
- "sie",
5249
- "wrz",
5250
- "paź",
5251
- "lis",
5252
- "gru"
5253
- ],
5254
- wide: [
5255
- "stycznia",
5256
- "lutego",
5257
- "marca",
5258
- "kwietnia",
5259
- "maja",
5260
- "czerwca",
5261
- "lipca",
5262
- "sierpnia",
5263
- "września",
5264
- "października",
5265
- "listopada",
5266
- "grudnia"
5267
- ]
5268
- };
5269
- const dayValues = {
5270
- narrow: ["N", "P", "W", "Ś", "C", "P", "S"],
5271
- short: ["nie", "pon", "wto", "śro", "czw", "pią", "sob"],
5272
- abbreviated: ["niedz.", "pon.", "wt.", "śr.", "czw.", "pt.", "sob."],
5273
- wide: [
5274
- "niedziela",
5275
- "poniedziałek",
5276
- "wtorek",
5277
- "środa",
5278
- "czwartek",
5279
- "piątek",
5280
- "sobota"
5281
- ]
5282
- };
5283
- const dayFormattingValues = {
5284
- narrow: ["n", "p", "w", "ś", "c", "p", "s"],
5285
- short: ["nie", "pon", "wto", "śro", "czw", "pią", "sob"],
5286
- abbreviated: ["niedz.", "pon.", "wt.", "śr.", "czw.", "pt.", "sob."],
5287
- wide: [
5288
- "niedziela",
5289
- "poniedziałek",
5290
- "wtorek",
5291
- "środa",
5292
- "czwartek",
5293
- "piątek",
5294
- "sobota"
5295
- ]
5296
- };
5297
- const dayPeriodValues = {
5298
- narrow: {
5299
- am: "a",
5300
- pm: "p",
5301
- midnight: "półn.",
5302
- noon: "poł",
5303
- morning: "rano",
5304
- afternoon: "popoł.",
5305
- evening: "wiecz.",
5306
- night: "noc"
5307
- },
5308
- abbreviated: {
5309
- am: "AM",
5310
- pm: "PM",
5311
- midnight: "północ",
5312
- noon: "południe",
5313
- morning: "rano",
5314
- afternoon: "popołudnie",
5315
- evening: "wieczór",
5316
- night: "noc"
5317
- },
5318
- wide: {
5319
- am: "AM",
5320
- pm: "PM",
5321
- midnight: "północ",
5322
- noon: "południe",
5323
- morning: "rano",
5324
- afternoon: "popołudnie",
5325
- evening: "wieczór",
5326
- night: "noc"
5327
- }
5328
- };
5329
- const dayPeriodFormattingValues = {
5330
- narrow: {
5331
- am: "a",
5332
- pm: "p",
5333
- midnight: "o półn.",
5334
- noon: "w poł.",
5335
- morning: "rano",
5336
- afternoon: "po poł.",
5337
- evening: "wiecz.",
5338
- night: "w nocy"
5339
- },
5340
- abbreviated: {
5341
- am: "AM",
5342
- pm: "PM",
5343
- midnight: "o północy",
5344
- noon: "w południe",
5345
- morning: "rano",
5346
- afternoon: "po południu",
5347
- evening: "wieczorem",
5348
- night: "w nocy"
5349
- },
5350
- wide: {
5351
- am: "AM",
5352
- pm: "PM",
5353
- midnight: "o północy",
5354
- noon: "w południe",
5355
- morning: "rano",
5356
- afternoon: "po południu",
5357
- evening: "wieczorem",
5358
- night: "w nocy"
5359
- }
5360
- };
5361
- const ordinalNumber = (dirtyNumber, _options) => {
5362
- return String(dirtyNumber);
5363
- };
5364
- const localize = {
5365
- ordinalNumber,
5366
- era: buildLocalizeFn({
5367
- values: eraValues,
5368
- defaultWidth: "wide"
5369
- }),
5370
- quarter: buildLocalizeFn({
5371
- values: quarterValues,
5372
- defaultWidth: "wide",
5373
- argumentCallback: (quarter) => quarter - 1
5374
- }),
5375
- month: buildLocalizeFn({
5376
- values: monthValues,
5377
- defaultWidth: "wide",
5378
- formattingValues: monthFormattingValues,
5379
- defaultFormattingWidth: "wide"
5380
- }),
5381
- day: buildLocalizeFn({
5382
- values: dayValues,
5383
- defaultWidth: "wide",
5384
- formattingValues: dayFormattingValues,
5385
- defaultFormattingWidth: "wide"
5386
- }),
5387
- dayPeriod: buildLocalizeFn({
5388
- values: dayPeriodValues,
5389
- defaultWidth: "wide",
5390
- formattingValues: dayPeriodFormattingValues,
5391
- defaultFormattingWidth: "wide"
5392
- })
5393
- };
5394
- const matchOrdinalNumberPattern = /^(\d+)?/i;
5395
- const parseOrdinalNumberPattern = /\d+/i;
5396
- const matchEraPatterns = {
5397
- narrow: /^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,
5398
- abbreviated: /^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,
5399
- wide: /^(przed\s*nasz(ą|a)\s*er(ą|a)|naszej\s*ery)/i
5400
- };
5401
- const parseEraPatterns = {
5402
- any: [/^p/i, /^n/i]
5403
- };
5404
- const matchQuarterPatterns = {
5405
- narrow: /^[1234]/i,
5406
- abbreviated: /^(I|II|III|IV)\s*kw\.?/i,
5407
- wide: /^(I|II|III|IV)\s*kwarta(ł|l)/i
5408
- };
5409
- const parseQuarterPatterns = {
5410
- narrow: [/1/i, /2/i, /3/i, /4/i],
5411
- any: [/^I kw/i, /^II kw/i, /^III kw/i, /^IV kw/i]
5412
- };
5413
- const matchMonthPatterns = {
5414
- narrow: /^[slmkcwpg]/i,
5415
- abbreviated: /^(sty|lut|mar|kwi|maj|cze|lip|sie|wrz|pa(ź|z)|lis|gru)/i,
5416
- wide: /^(stycznia|stycze(ń|n)|lutego|luty|marca|marzec|kwietnia|kwiecie(ń|n)|maja|maj|czerwca|czerwiec|lipca|lipiec|sierpnia|sierpie(ń|n)|wrze(ś|s)nia|wrzesie(ń|n)|pa(ź|z)dziernika|pa(ź|z)dziernik|listopada|listopad|grudnia|grudzie(ń|n))/i
5417
- };
5418
- const parseMonthPatterns = {
5419
- narrow: [
5420
- /^s/i,
5421
- /^l/i,
5422
- /^m/i,
5423
- /^k/i,
5424
- /^m/i,
5425
- /^c/i,
5426
- /^l/i,
5427
- /^s/i,
5428
- /^w/i,
5429
- /^p/i,
5430
- /^l/i,
5431
- /^g/i
5432
- ],
5433
- any: [
5434
- /^st/i,
5435
- /^lu/i,
5436
- /^mar/i,
5437
- /^k/i,
5438
- /^maj/i,
5439
- /^c/i,
5440
- /^lip/i,
5441
- /^si/i,
5442
- /^w/i,
5443
- /^p/i,
5444
- /^lis/i,
5445
- /^g/i
5446
- ]
5447
- };
5448
- const matchDayPatterns = {
5449
- narrow: /^[npwścs]/i,
5450
- short: /^(nie|pon|wto|(ś|s)ro|czw|pi(ą|a)|sob)/i,
5451
- abbreviated: /^(niedz|pon|wt|(ś|s)r|czw|pt|sob)\.?/i,
5452
- wide: /^(niedziela|poniedzia(ł|l)ek|wtorek|(ś|s)roda|czwartek|pi(ą|a)tek|sobota)/i
5453
- };
5454
- const parseDayPatterns = {
5455
- narrow: [/^n/i, /^p/i, /^w/i, /^ś/i, /^c/i, /^p/i, /^s/i],
5456
- abbreviated: [/^n/i, /^po/i, /^w/i, /^(ś|s)r/i, /^c/i, /^pt/i, /^so/i],
5457
- any: [/^n/i, /^po/i, /^w/i, /^(ś|s)r/i, /^c/i, /^pi/i, /^so/i]
5458
- };
5459
- const matchDayPeriodPatterns = {
5460
- narrow: /^(^a$|^p$|pó(ł|l)n\.?|o\s*pó(ł|l)n\.?|po(ł|l)\.?|w\s*po(ł|l)\.?|po\s*po(ł|l)\.?|rano|wiecz\.?|noc|w\s*nocy)/i,
5461
- any: /^(am|pm|pó(ł|l)noc|o\s*pó(ł|l)nocy|po(ł|l)udnie|w\s*po(ł|l)udnie|popo(ł|l)udnie|po\s*po(ł|l)udniu|rano|wieczór|wieczorem|noc|w\s*nocy)/i
5462
- };
5463
- const parseDayPeriodPatterns = {
5464
- narrow: {
5465
- am: /^a$/i,
5466
- pm: /^p$/i,
5467
- midnight: /pó(ł|l)n/i,
5468
- noon: /po(ł|l)/i,
5469
- morning: /rano/i,
5470
- afternoon: /po\s*po(ł|l)/i,
5471
- evening: /wiecz/i,
5472
- night: /noc/i
5473
- },
5474
- any: {
5475
- am: /^am/i,
5476
- pm: /^pm/i,
5477
- midnight: /pó(ł|l)n/i,
5478
- noon: /po(ł|l)/i,
5479
- morning: /rano/i,
5480
- afternoon: /po\s*po(ł|l)/i,
5481
- evening: /wiecz/i,
5482
- night: /noc/i
5483
- }
5484
- };
5485
- const match = {
5486
- ordinalNumber: buildMatchPatternFn({
5487
- matchPattern: matchOrdinalNumberPattern,
5488
- parsePattern: parseOrdinalNumberPattern,
5489
- valueCallback: (value) => parseInt(value, 10)
5490
- }),
5491
- era: buildMatchFn({
5492
- matchPatterns: matchEraPatterns,
5493
- defaultMatchWidth: "wide",
5494
- parsePatterns: parseEraPatterns,
5495
- defaultParseWidth: "any"
5496
- }),
5497
- quarter: buildMatchFn({
5498
- matchPatterns: matchQuarterPatterns,
5499
- defaultMatchWidth: "wide",
5500
- parsePatterns: parseQuarterPatterns,
5501
- defaultParseWidth: "any",
5502
- valueCallback: (index) => index + 1
5503
- }),
5504
- month: buildMatchFn({
5505
- matchPatterns: matchMonthPatterns,
5506
- defaultMatchWidth: "wide",
5507
- parsePatterns: parseMonthPatterns,
5508
- defaultParseWidth: "any"
5509
- }),
5510
- day: buildMatchFn({
5511
- matchPatterns: matchDayPatterns,
5512
- defaultMatchWidth: "wide",
5513
- parsePatterns: parseDayPatterns,
5514
- defaultParseWidth: "any"
5515
- }),
5516
- dayPeriod: buildMatchFn({
5517
- matchPatterns: matchDayPeriodPatterns,
5518
- defaultMatchWidth: "any",
5519
- parsePatterns: parseDayPeriodPatterns,
5520
- defaultParseWidth: "any"
5521
- })
5522
- };
5523
- const pl = {
5524
- code: "pl",
5525
- formatDistance,
5526
- formatLong,
5527
- formatRelative,
5528
- localize,
5529
- match,
5530
- options: {
5531
- weekStartsOn: 1,
5532
- firstWeekContainsDate: 4
5533
- }
5534
- };
5535
- const localeMap = {
5536
- pl,
5537
- en: enUS,
5538
- "en-US": enUS,
5539
- de
5540
- };
5541
- function getDateLocale(localeCode = "pl") {
5542
- return localeMap[localeCode] || pl;
5543
- }
5544
- function formatDate({
5545
- date,
5546
- includeTime = false,
5547
- localeCode = "pl"
5548
- }) {
5549
- const ensuredDate = new Date(date);
5550
- if (isNaN(ensuredDate.getTime())) {
5551
- return "";
5552
- }
5553
- const locale = getDateLocale(localeCode);
5554
- const timeFormat = includeTime ? "p" : "";
5555
- return format(ensuredDate, `PP ${timeFormat}`, {
5556
- locale
5557
- });
5558
- }
5559
- function getCountryByIso2(iso2) {
5560
- if (!iso2) {
5561
- return;
5562
- }
5563
- return countries.find((c) => c.iso_2.toLowerCase() === iso2.toLowerCase());
5564
- }
5565
- const countries = [
5566
- {
5567
- iso_2: "af",
5568
- iso_3: "afg",
5569
- num_code: "4",
5570
- name: "AFGHANISTAN",
5571
- display_name: "Afghanistan"
5572
- },
5573
- {
5574
- iso_2: "al",
5575
- iso_3: "alb",
5576
- num_code: "8",
5577
- name: "ALBANIA",
5578
- display_name: "Albania"
5579
- },
5580
- {
5581
- iso_2: "dz",
5582
- iso_3: "dza",
5583
- num_code: "12",
5584
- name: "ALGERIA",
5585
- display_name: "Algeria"
5586
- },
5587
- {
5588
- iso_2: "as",
5589
- iso_3: "asm",
5590
- num_code: "16",
5591
- name: "AMERICAN SAMOA",
5592
- display_name: "American Samoa"
5593
- },
5594
- {
5595
- iso_2: "ad",
5596
- iso_3: "and",
5597
- num_code: "20",
5598
- name: "ANDORRA",
5599
- display_name: "Andorra"
5600
- },
5601
- {
5602
- iso_2: "ao",
5603
- iso_3: "ago",
5604
- num_code: "24",
5605
- name: "ANGOLA",
5606
- display_name: "Angola"
5607
- },
5608
- {
5609
- iso_2: "ai",
5610
- iso_3: "aia",
5611
- num_code: "660",
5612
- name: "ANGUILLA",
5613
- display_name: "Anguilla"
5614
- },
5615
- {
5616
- iso_2: "aq",
5617
- iso_3: "ata",
5618
- num_code: "10",
5619
- name: "ANTARCTICA",
5620
- display_name: "Antarctica"
5621
- },
5622
- {
5623
- iso_2: "ag",
5624
- iso_3: "atg",
5625
- num_code: "28",
5626
- name: "ANTIGUA AND BARBUDA",
5627
- display_name: "Antigua and Barbuda"
5628
- },
5629
- {
5630
- iso_2: "ar",
5631
- iso_3: "arg",
5632
- num_code: "32",
5633
- name: "ARGENTINA",
5634
- display_name: "Argentina"
5635
- },
5636
- {
5637
- iso_2: "am",
5638
- iso_3: "arm",
5639
- num_code: "51",
5640
- name: "ARMENIA",
5641
- display_name: "Armenia"
5642
- },
5643
- {
5644
- iso_2: "aw",
5645
- iso_3: "abw",
5646
- num_code: "533",
5647
- name: "ARUBA",
5648
- display_name: "Aruba"
5649
- },
5650
- {
5651
- iso_2: "au",
5652
- iso_3: "aus",
5653
- num_code: "36",
5654
- name: "AUSTRALIA",
5655
- display_name: "Australia"
5656
- },
5657
- {
5658
- iso_2: "at",
5659
- iso_3: "aut",
5660
- num_code: "40",
5661
- name: "AUSTRIA",
5662
- display_name: "Austria"
5663
- },
5664
- {
5665
- iso_2: "az",
5666
- iso_3: "aze",
5667
- num_code: "31",
5668
- name: "AZERBAIJAN",
5669
- display_name: "Azerbaijan"
5670
- },
5671
- {
5672
- iso_2: "bs",
5673
- iso_3: "bhs",
5674
- num_code: "44",
5675
- name: "BAHAMAS",
5676
- display_name: "Bahamas"
5677
- },
5678
- {
5679
- iso_2: "bh",
5680
- iso_3: "bhr",
5681
- num_code: "48",
5682
- name: "BAHRAIN",
5683
- display_name: "Bahrain"
5684
- },
5685
- {
5686
- iso_2: "bd",
5687
- iso_3: "bgd",
5688
- num_code: "50",
5689
- name: "BANGLADESH",
5690
- display_name: "Bangladesh"
5691
- },
5692
- {
5693
- iso_2: "bb",
5694
- iso_3: "brb",
5695
- num_code: "52",
5696
- name: "BARBADOS",
5697
- display_name: "Barbados"
5698
- },
5699
- {
5700
- iso_2: "by",
5701
- iso_3: "blr",
5702
- num_code: "112",
5703
- name: "BELARUS",
5704
- display_name: "Belarus"
5705
- },
5706
- {
5707
- iso_2: "be",
5708
- iso_3: "bel",
5709
- num_code: "56",
5710
- name: "BELGIUM",
5711
- display_name: "Belgium"
5712
- },
5713
- {
5714
- iso_2: "bz",
5715
- iso_3: "blz",
5716
- num_code: "84",
5717
- name: "BELIZE",
5718
- display_name: "Belize"
5719
- },
5720
- {
5721
- iso_2: "bj",
5722
- iso_3: "ben",
5723
- num_code: "204",
5724
- name: "BENIN",
5725
- display_name: "Benin"
5726
- },
5727
- {
5728
- iso_2: "bm",
5729
- iso_3: "bmu",
5730
- num_code: "60",
5731
- name: "BERMUDA",
5732
- display_name: "Bermuda"
5733
- },
5734
- {
5735
- iso_2: "bt",
5736
- iso_3: "btn",
5737
- num_code: "64",
5738
- name: "BHUTAN",
5739
- display_name: "Bhutan"
5740
- },
5741
- {
5742
- iso_2: "bo",
5743
- iso_3: "bol",
5744
- num_code: "68",
5745
- name: "BOLIVIA",
5746
- display_name: "Bolivia"
5747
- },
5748
- {
5749
- iso_2: "bq",
5750
- iso_3: "bes",
5751
- num_code: "535",
5752
- name: "BONAIRE, SINT EUSTATIUS AND SABA",
5753
- display_name: "Bonaire, Sint Eustatius and Saba"
5754
- },
5755
- {
5756
- iso_2: "ba",
5757
- iso_3: "bih",
5758
- num_code: "70",
5759
- name: "BOSNIA AND HERZEGOVINA",
5760
- display_name: "Bosnia and Herzegovina"
5761
- },
5762
- {
5763
- iso_2: "bw",
5764
- iso_3: "bwa",
5765
- num_code: "72",
5766
- name: "BOTSWANA",
5767
- display_name: "Botswana"
5768
- },
5769
- {
5770
- iso_2: "bv",
5771
- iso_3: "bvd",
5772
- num_code: "74",
5773
- name: "BOUVET ISLAND",
5774
- display_name: "Bouvet Island"
5775
- },
5776
- {
5777
- iso_2: "br",
5778
- iso_3: "bra",
5779
- num_code: "76",
5780
- name: "BRAZIL",
5781
- display_name: "Brazil"
5782
- },
5783
- {
5784
- iso_2: "io",
5785
- iso_3: "iot",
5786
- num_code: "86",
5787
- name: "BRITISH INDIAN OCEAN TERRITORY",
5788
- display_name: "British Indian Ocean Territory"
5789
- },
5790
- {
5791
- iso_2: "bn",
5792
- iso_3: "brn",
5793
- num_code: "96",
5794
- name: "BRUNEI DARUSSALAM",
5795
- display_name: "Brunei Darussalam"
5796
- },
5797
- {
5798
- iso_2: "bg",
5799
- iso_3: "bgr",
5800
- num_code: "100",
5801
- name: "BULGARIA",
5802
- display_name: "Bulgaria"
5803
- },
5804
- {
5805
- iso_2: "bf",
5806
- iso_3: "bfa",
5807
- num_code: "854",
5808
- name: "BURKINA FASO",
5809
- display_name: "Burkina Faso"
5810
- },
5811
- {
5812
- iso_2: "bi",
5813
- iso_3: "bdi",
5814
- num_code: "108",
5815
- name: "BURUNDI",
5816
- display_name: "Burundi"
5817
- },
5818
- {
5819
- iso_2: "kh",
5820
- iso_3: "khm",
5821
- num_code: "116",
5822
- name: "CAMBODIA",
5823
- display_name: "Cambodia"
5824
- },
5825
- {
5826
- iso_2: "cm",
5827
- iso_3: "cmr",
5828
- num_code: "120",
5829
- name: "CAMEROON",
5830
- display_name: "Cameroon"
5831
- },
5832
- {
5833
- iso_2: "ca",
5834
- iso_3: "can",
5835
- num_code: "124",
5836
- name: "CANADA",
5837
- display_name: "Canada"
5838
- },
5839
- {
5840
- iso_2: "cv",
5841
- iso_3: "cpv",
5842
- num_code: "132",
5843
- name: "CAPE VERDE",
5844
- display_name: "Cape Verde"
5845
- },
5846
- {
5847
- iso_2: "ky",
5848
- iso_3: "cym",
5849
- num_code: "136",
5850
- name: "CAYMAN ISLANDS",
5851
- display_name: "Cayman Islands"
5852
- },
5853
- {
5854
- iso_2: "cf",
5855
- iso_3: "caf",
5856
- num_code: "140",
5857
- name: "CENTRAL AFRICAN REPUBLIC",
5858
- display_name: "Central African Republic"
5859
- },
5860
- {
5861
- iso_2: "td",
5862
- iso_3: "tcd",
5863
- num_code: "148",
5864
- name: "CHAD",
5865
- display_name: "Chad"
5866
- },
5867
- {
5868
- iso_2: "cl",
5869
- iso_3: "chl",
5870
- num_code: "152",
5871
- name: "CHILE",
5872
- display_name: "Chile"
5873
- },
5874
- {
5875
- iso_2: "cn",
5876
- iso_3: "chn",
5877
- num_code: "156",
5878
- name: "CHINA",
5879
- display_name: "China"
5880
- },
5881
- {
5882
- iso_2: "cx",
5883
- iso_3: "cxr",
5884
- num_code: "162",
5885
- name: "CHRISTMAS ISLAND",
5886
- display_name: "Christmas Island"
5887
- },
5888
- {
5889
- iso_2: "cc",
5890
- iso_3: "cck",
5891
- num_code: "166",
5892
- name: "COCOS (KEELING) ISLANDS",
5893
- display_name: "Cocos (Keeling) Islands"
5894
- },
5895
- {
5896
- iso_2: "co",
5897
- iso_3: "col",
5898
- num_code: "170",
5899
- name: "COLOMBIA",
5900
- display_name: "Colombia"
5901
- },
5902
- {
5903
- iso_2: "km",
5904
- iso_3: "com",
5905
- num_code: "174",
5906
- name: "COMOROS",
5907
- display_name: "Comoros"
5908
- },
5909
- {
5910
- iso_2: "cg",
5911
- iso_3: "cog",
5912
- num_code: "178",
5913
- name: "CONGO",
5914
- display_name: "Congo"
5915
- },
5916
- {
5917
- iso_2: "cd",
5918
- iso_3: "cod",
5919
- num_code: "180",
5920
- name: "CONGO, THE DEMOCRATIC REPUBLIC OF THE",
5921
- display_name: "Congo, the Democratic Republic of the"
5922
- },
5923
- {
5924
- iso_2: "ck",
5925
- iso_3: "cok",
5926
- num_code: "184",
5927
- name: "COOK ISLANDS",
5928
- display_name: "Cook Islands"
5929
- },
5930
- {
5931
- iso_2: "cr",
5932
- iso_3: "cri",
5933
- num_code: "188",
5934
- name: "COSTA RICA",
5935
- display_name: "Costa Rica"
5936
- },
5937
- {
5938
- iso_2: "ci",
5939
- iso_3: "civ",
5940
- num_code: "384",
5941
- name: "COTE D'IVOIRE",
5942
- display_name: "Cote D'Ivoire"
5943
- },
5944
- {
5945
- iso_2: "hr",
5946
- iso_3: "hrv",
5947
- num_code: "191",
5948
- name: "CROATIA",
5949
- display_name: "Croatia"
5950
- },
5951
- {
5952
- iso_2: "cu",
5953
- iso_3: "cub",
5954
- num_code: "192",
5955
- name: "CUBA",
5956
- display_name: "Cuba"
5957
- },
5958
- {
5959
- iso_2: "cw",
5960
- iso_3: "cuw",
5961
- num_code: "531",
5962
- name: "CURAÇAO",
5963
- display_name: "Curaçao"
5964
- },
5965
- {
5966
- iso_2: "cy",
5967
- iso_3: "cyp",
5968
- num_code: "196",
5969
- name: "CYPRUS",
5970
- display_name: "Cyprus"
5971
- },
5972
- {
5973
- iso_2: "cz",
5974
- iso_3: "cze",
5975
- num_code: "203",
5976
- name: "CZECH REPUBLIC",
5977
- display_name: "Czech Republic"
5978
- },
5979
- {
5980
- iso_2: "dk",
5981
- iso_3: "dnk",
5982
- num_code: "208",
5983
- name: "DENMARK",
5984
- display_name: "Denmark"
5985
- },
5986
- {
5987
- iso_2: "dj",
5988
- iso_3: "dji",
5989
- num_code: "262",
5990
- name: "DJIBOUTI",
5991
- display_name: "Djibouti"
5992
- },
5993
- {
5994
- iso_2: "dm",
5995
- iso_3: "dma",
5996
- num_code: "212",
5997
- name: "DOMINICA",
5998
- display_name: "Dominica"
5999
- },
6000
- {
6001
- iso_2: "do",
6002
- iso_3: "dom",
6003
- num_code: "214",
6004
- name: "DOMINICAN REPUBLIC",
6005
- display_name: "Dominican Republic"
6006
- },
6007
- {
6008
- iso_2: "ec",
6009
- iso_3: "ecu",
6010
- num_code: "218",
6011
- name: "ECUADOR",
6012
- display_name: "Ecuador"
6013
- },
6014
- {
6015
- iso_2: "eg",
6016
- iso_3: "egy",
6017
- num_code: "818",
6018
- name: "EGYPT",
6019
- display_name: "Egypt"
6020
- },
6021
- {
6022
- iso_2: "sv",
6023
- iso_3: "slv",
6024
- num_code: "222",
6025
- name: "EL SALVADOR",
6026
- display_name: "El Salvador"
6027
- },
6028
- {
6029
- iso_2: "gq",
6030
- iso_3: "gnq",
6031
- num_code: "226",
6032
- name: "EQUATORIAL GUINEA",
6033
- display_name: "Equatorial Guinea"
6034
- },
6035
- {
6036
- iso_2: "er",
6037
- iso_3: "eri",
6038
- num_code: "232",
6039
- name: "ERITREA",
6040
- display_name: "Eritrea"
6041
- },
6042
- {
6043
- iso_2: "ee",
6044
- iso_3: "est",
6045
- num_code: "233",
6046
- name: "ESTONIA",
6047
- display_name: "Estonia"
6048
- },
6049
- {
6050
- iso_2: "et",
6051
- iso_3: "eth",
6052
- num_code: "231",
6053
- name: "ETHIOPIA",
6054
- display_name: "Ethiopia"
6055
- },
6056
- {
6057
- iso_2: "fk",
6058
- iso_3: "flk",
6059
- num_code: "238",
6060
- name: "FALKLAND ISLANDS (MALVINAS)",
6061
- display_name: "Falkland Islands (Malvinas)"
6062
- },
6063
- {
6064
- iso_2: "fo",
6065
- iso_3: "fro",
6066
- num_code: "234",
6067
- name: "FAROE ISLANDS",
6068
- display_name: "Faroe Islands"
6069
- },
6070
- {
6071
- iso_2: "fj",
6072
- iso_3: "fji",
6073
- num_code: "242",
6074
- name: "FIJI",
6075
- display_name: "Fiji"
6076
- },
6077
- {
6078
- iso_2: "fi",
6079
- iso_3: "fin",
6080
- num_code: "246",
6081
- name: "FINLAND",
6082
- display_name: "Finland"
6083
- },
6084
- {
6085
- iso_2: "fr",
6086
- iso_3: "fra",
6087
- num_code: "250",
6088
- name: "FRANCE",
6089
- display_name: "France"
6090
- },
6091
- {
6092
- iso_2: "gf",
6093
- iso_3: "guf",
6094
- num_code: "254",
6095
- name: "FRENCH GUIANA",
6096
- display_name: "French Guiana"
6097
- },
6098
- {
6099
- iso_2: "pf",
6100
- iso_3: "pyf",
6101
- num_code: "258",
6102
- name: "FRENCH POLYNESIA",
6103
- display_name: "French Polynesia"
6104
- },
6105
- {
6106
- iso_2: "tf",
6107
- iso_3: "atf",
6108
- num_code: "260",
6109
- name: "FRENCH SOUTHERN TERRITORIES",
6110
- display_name: "French Southern Territories"
6111
- },
6112
- {
6113
- iso_2: "ga",
6114
- iso_3: "gab",
6115
- num_code: "266",
6116
- name: "GABON",
6117
- display_name: "Gabon"
6118
- },
6119
- {
6120
- iso_2: "gm",
6121
- iso_3: "gmb",
6122
- num_code: "270",
6123
- name: "GAMBIA",
6124
- display_name: "Gambia"
6125
- },
6126
- {
6127
- iso_2: "ge",
6128
- iso_3: "geo",
6129
- num_code: "268",
6130
- name: "GEORGIA",
6131
- display_name: "Georgia"
6132
- },
6133
- {
6134
- iso_2: "de",
6135
- iso_3: "deu",
6136
- num_code: "276",
6137
- name: "GERMANY",
6138
- display_name: "Germany"
6139
- },
6140
- {
6141
- iso_2: "gh",
6142
- iso_3: "gha",
6143
- num_code: "288",
6144
- name: "GHANA",
6145
- display_name: "Ghana"
6146
- },
6147
- {
6148
- iso_2: "gi",
6149
- iso_3: "gib",
6150
- num_code: "292",
6151
- name: "GIBRALTAR",
6152
- display_name: "Gibraltar"
6153
- },
6154
- {
6155
- iso_2: "gr",
6156
- iso_3: "grc",
6157
- num_code: "300",
6158
- name: "GREECE",
6159
- display_name: "Greece"
6160
- },
6161
- {
6162
- iso_2: "gl",
6163
- iso_3: "grl",
6164
- num_code: "304",
6165
- name: "GREENLAND",
6166
- display_name: "Greenland"
6167
- },
6168
- {
6169
- iso_2: "gd",
6170
- iso_3: "grd",
6171
- num_code: "308",
6172
- name: "GRENADA",
6173
- display_name: "Grenada"
6174
- },
6175
- {
6176
- iso_2: "gp",
6177
- iso_3: "glp",
6178
- num_code: "312",
6179
- name: "GUADELOUPE",
6180
- display_name: "Guadeloupe"
6181
- },
6182
- {
6183
- iso_2: "gu",
6184
- iso_3: "gum",
6185
- num_code: "316",
6186
- name: "GUAM",
6187
- display_name: "Guam"
6188
- },
6189
- {
6190
- iso_2: "gt",
6191
- iso_3: "gtm",
6192
- num_code: "320",
6193
- name: "GUATEMALA",
6194
- display_name: "Guatemala"
6195
- },
6196
- {
6197
- iso_2: "gg",
6198
- iso_3: "ggy",
6199
- num_code: "831",
6200
- name: "GUERNSEY",
6201
- display_name: "Guernsey"
6202
- },
6203
- {
6204
- iso_2: "gn",
6205
- iso_3: "gin",
6206
- num_code: "324",
6207
- name: "GUINEA",
6208
- display_name: "Guinea"
6209
- },
6210
- {
6211
- iso_2: "gw",
6212
- iso_3: "gnb",
6213
- num_code: "624",
6214
- name: "GUINEA-BISSAU",
6215
- display_name: "Guinea-Bissau"
6216
- },
6217
- {
6218
- iso_2: "gy",
6219
- iso_3: "guy",
6220
- num_code: "328",
6221
- name: "GUYANA",
6222
- display_name: "Guyana"
6223
- },
6224
- {
6225
- iso_2: "ht",
6226
- iso_3: "hti",
6227
- num_code: "332",
6228
- name: "HAITI",
6229
- display_name: "Haiti"
6230
- },
6231
- {
6232
- iso_2: "hm",
6233
- iso_3: "hmd",
6234
- num_code: "334",
6235
- name: "HEARD ISLAND AND MCDONALD ISLANDS",
6236
- display_name: "Heard Island And Mcdonald Islands"
6237
- },
6238
- {
6239
- iso_2: "va",
6240
- iso_3: "vat",
6241
- num_code: "336",
6242
- name: "HOLY SEE (VATICAN CITY STATE)",
6243
- display_name: "Holy See (Vatican City State)"
6244
- },
6245
- {
6246
- iso_2: "hn",
6247
- iso_3: "hnd",
6248
- num_code: "340",
6249
- name: "HONDURAS",
6250
- display_name: "Honduras"
6251
- },
6252
- {
6253
- iso_2: "hk",
6254
- iso_3: "hkg",
6255
- num_code: "344",
6256
- name: "HONG KONG",
6257
- display_name: "Hong Kong"
6258
- },
6259
- {
6260
- iso_2: "hu",
6261
- iso_3: "hun",
6262
- num_code: "348",
6263
- name: "HUNGARY",
6264
- display_name: "Hungary"
6265
- },
6266
- {
6267
- iso_2: "is",
6268
- iso_3: "isl",
6269
- num_code: "352",
6270
- name: "ICELAND",
6271
- display_name: "Iceland"
6272
- },
6273
- {
6274
- iso_2: "in",
6275
- iso_3: "ind",
6276
- num_code: "356",
6277
- name: "INDIA",
6278
- display_name: "India"
6279
- },
6280
- {
6281
- iso_2: "id",
6282
- iso_3: "idn",
6283
- num_code: "360",
6284
- name: "INDONESIA",
6285
- display_name: "Indonesia"
6286
- },
6287
- {
6288
- iso_2: "ir",
6289
- iso_3: "irn",
6290
- num_code: "364",
6291
- name: "IRAN, ISLAMIC REPUBLIC OF",
6292
- display_name: "Iran, Islamic Republic of"
6293
- },
6294
- {
6295
- iso_2: "iq",
6296
- iso_3: "irq",
6297
- num_code: "368",
6298
- name: "IRAQ",
6299
- display_name: "Iraq"
6300
- },
6301
- {
6302
- iso_2: "ie",
6303
- iso_3: "irl",
6304
- num_code: "372",
6305
- name: "IRELAND",
6306
- display_name: "Ireland"
6307
- },
6308
- {
6309
- iso_2: "im",
6310
- iso_3: "imn",
6311
- num_code: "833",
6312
- name: "ISLE OF MAN",
6313
- display_name: "Isle Of Man"
6314
- },
6315
- {
6316
- iso_2: "il",
6317
- iso_3: "isr",
6318
- num_code: "376",
6319
- name: "ISRAEL",
6320
- display_name: "Israel"
6321
- },
6322
- {
6323
- iso_2: "it",
6324
- iso_3: "ita",
6325
- num_code: "380",
6326
- name: "ITALY",
6327
- display_name: "Italy"
6328
- },
6329
- {
6330
- iso_2: "jm",
6331
- iso_3: "jam",
6332
- num_code: "388",
6333
- name: "JAMAICA",
6334
- display_name: "Jamaica"
6335
- },
6336
- {
6337
- iso_2: "jp",
6338
- iso_3: "jpn",
6339
- num_code: "392",
6340
- name: "JAPAN",
6341
- display_name: "Japan"
6342
- },
6343
- {
6344
- iso_2: "je",
6345
- iso_3: "jey",
6346
- num_code: "832",
6347
- name: "JERSEY",
6348
- display_name: "Jersey"
6349
- },
6350
- {
6351
- iso_2: "jo",
6352
- iso_3: "jor",
6353
- num_code: "400",
6354
- name: "JORDAN",
6355
- display_name: "Jordan"
6356
- },
6357
- {
6358
- iso_2: "kz",
6359
- iso_3: "kaz",
6360
- num_code: "398",
6361
- name: "KAZAKHSTAN",
6362
- display_name: "Kazakhstan"
6363
- },
6364
- {
6365
- iso_2: "ke",
6366
- iso_3: "ken",
6367
- num_code: "404",
6368
- name: "KENYA",
6369
- display_name: "Kenya"
6370
- },
6371
- {
6372
- iso_2: "ki",
6373
- iso_3: "kir",
6374
- num_code: "296",
6375
- name: "KIRIBATI",
6376
- display_name: "Kiribati"
6377
- },
6378
- {
6379
- iso_2: "kp",
6380
- iso_3: "prk",
6381
- num_code: "408",
6382
- name: "KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF",
6383
- display_name: "Korea, Democratic People's Republic of"
6384
- },
6385
- {
6386
- iso_2: "kr",
6387
- iso_3: "kor",
6388
- num_code: "410",
6389
- name: "KOREA, REPUBLIC OF",
6390
- display_name: "Korea, Republic of"
6391
- },
6392
- {
6393
- iso_2: "xk",
6394
- iso_3: "xkx",
6395
- num_code: "900",
6396
- name: "KOSOVO",
6397
- display_name: "Kosovo"
6398
- },
6399
- {
6400
- iso_2: "kw",
6401
- iso_3: "kwt",
6402
- num_code: "414",
6403
- name: "KUWAIT",
6404
- display_name: "Kuwait"
6405
- },
6406
- {
6407
- iso_2: "kg",
6408
- iso_3: "kgz",
6409
- num_code: "417",
6410
- name: "KYRGYZSTAN",
6411
- display_name: "Kyrgyzstan"
6412
- },
6413
- {
6414
- iso_2: "la",
6415
- iso_3: "lao",
6416
- num_code: "418",
6417
- name: "LAO PEOPLE'S DEMOCRATIC REPUBLIC",
6418
- display_name: "Lao People's Democratic Republic"
6419
- },
6420
- {
6421
- iso_2: "lv",
6422
- iso_3: "lva",
6423
- num_code: "428",
6424
- name: "LATVIA",
6425
- display_name: "Latvia"
6426
- },
6427
- {
6428
- iso_2: "lb",
6429
- iso_3: "lbn",
6430
- num_code: "422",
6431
- name: "LEBANON",
6432
- display_name: "Lebanon"
6433
- },
6434
- {
6435
- iso_2: "ls",
6436
- iso_3: "lso",
6437
- num_code: "426",
6438
- name: "LESOTHO",
6439
- display_name: "Lesotho"
6440
- },
6441
- {
6442
- iso_2: "lr",
6443
- iso_3: "lbr",
6444
- num_code: "430",
6445
- name: "LIBERIA",
6446
- display_name: "Liberia"
6447
- },
6448
- {
6449
- iso_2: "ly",
6450
- iso_3: "lby",
6451
- num_code: "434",
6452
- name: "LIBYA",
6453
- display_name: "Libya"
6454
- },
6455
- {
6456
- iso_2: "li",
6457
- iso_3: "lie",
6458
- num_code: "438",
6459
- name: "LIECHTENSTEIN",
6460
- display_name: "Liechtenstein"
6461
- },
6462
- {
6463
- iso_2: "lt",
6464
- iso_3: "ltu",
6465
- num_code: "440",
6466
- name: "LITHUANIA",
6467
- display_name: "Lithuania"
6468
- },
6469
- {
6470
- iso_2: "lu",
6471
- iso_3: "lux",
6472
- num_code: "442",
6473
- name: "LUXEMBOURG",
6474
- display_name: "Luxembourg"
6475
- },
6476
- {
6477
- iso_2: "mo",
6478
- iso_3: "mac",
6479
- num_code: "446",
6480
- name: "MACAO",
6481
- display_name: "Macao"
6482
- },
6483
- {
6484
- iso_2: "mg",
6485
- iso_3: "mdg",
6486
- num_code: "450",
6487
- name: "MADAGASCAR",
6488
- display_name: "Madagascar"
6489
- },
6490
- {
6491
- iso_2: "mw",
6492
- iso_3: "mwi",
6493
- num_code: "454",
6494
- name: "MALAWI",
6495
- display_name: "Malawi"
6496
- },
6497
- {
6498
- iso_2: "my",
6499
- iso_3: "mys",
6500
- num_code: "458",
6501
- name: "MALAYSIA",
6502
- display_name: "Malaysia"
6503
- },
6504
- {
6505
- iso_2: "mv",
6506
- iso_3: "mdv",
6507
- num_code: "462",
6508
- name: "MALDIVES",
6509
- display_name: "Maldives"
6510
- },
6511
- {
6512
- iso_2: "ml",
6513
- iso_3: "mli",
6514
- num_code: "466",
6515
- name: "MALI",
6516
- display_name: "Mali"
6517
- },
6518
- {
6519
- iso_2: "mt",
6520
- iso_3: "mlt",
6521
- num_code: "470",
6522
- name: "MALTA",
6523
- display_name: "Malta"
6524
- },
6525
- {
6526
- iso_2: "mh",
6527
- iso_3: "mhl",
6528
- num_code: "584",
6529
- name: "MARSHALL ISLANDS",
6530
- display_name: "Marshall Islands"
6531
- },
6532
- {
6533
- iso_2: "mq",
6534
- iso_3: "mtq",
6535
- num_code: "474",
6536
- name: "MARTINIQUE",
6537
- display_name: "Martinique"
6538
- },
6539
- {
6540
- iso_2: "mr",
6541
- iso_3: "mrt",
6542
- num_code: "478",
6543
- name: "MAURITANIA",
6544
- display_name: "Mauritania"
6545
- },
6546
- {
6547
- iso_2: "mu",
6548
- iso_3: "mus",
6549
- num_code: "480",
6550
- name: "MAURITIUS",
6551
- display_name: "Mauritius"
6552
- },
6553
- {
6554
- iso_2: "yt",
6555
- iso_3: "myt",
6556
- num_code: "175",
6557
- name: "MAYOTTE",
6558
- display_name: "Mayotte"
6559
- },
6560
- {
6561
- iso_2: "mx",
6562
- iso_3: "mex",
6563
- num_code: "484",
6564
- name: "MEXICO",
6565
- display_name: "Mexico"
6566
- },
6567
- {
6568
- iso_2: "fm",
6569
- iso_3: "fsm",
6570
- num_code: "583",
6571
- name: "MICRONESIA, FEDERATED STATES OF",
6572
- display_name: "Micronesia, Federated States of"
6573
- },
6574
- {
6575
- iso_2: "md",
6576
- iso_3: "mda",
6577
- num_code: "498",
6578
- name: "MOLDOVA, REPUBLIC OF",
6579
- display_name: "Moldova, Republic of"
6580
- },
6581
- {
6582
- iso_2: "mc",
6583
- iso_3: "mco",
6584
- num_code: "492",
6585
- name: "MONACO",
6586
- display_name: "Monaco"
6587
- },
6588
- {
6589
- iso_2: "mn",
6590
- iso_3: "mng",
6591
- num_code: "496",
6592
- name: "MONGOLIA",
6593
- display_name: "Mongolia"
6594
- },
6595
- {
6596
- iso_2: "me",
6597
- iso_3: "mne",
6598
- num_code: "499",
6599
- name: "MONTENEGRO",
6600
- display_name: "Montenegro"
6601
- },
6602
- {
6603
- iso_2: "ms",
6604
- iso_3: "msr",
6605
- num_code: "500",
6606
- name: "MONTSERRAT",
6607
- display_name: "Montserrat"
6608
- },
6609
- {
6610
- iso_2: "ma",
6611
- iso_3: "mar",
6612
- num_code: "504",
6613
- name: "MOROCCO",
6614
- display_name: "Morocco"
6615
- },
6616
- {
6617
- iso_2: "mz",
6618
- iso_3: "moz",
6619
- num_code: "508",
6620
- name: "MOZAMBIQUE",
6621
- display_name: "Mozambique"
6622
- },
6623
- {
6624
- iso_2: "mm",
6625
- iso_3: "mmr",
6626
- num_code: "104",
6627
- name: "MYANMAR",
6628
- display_name: "Myanmar"
6629
- },
6630
- {
6631
- iso_2: "na",
6632
- iso_3: "nam",
6633
- num_code: "516",
6634
- name: "NAMIBIA",
6635
- display_name: "Namibia"
6636
- },
6637
- {
6638
- iso_2: "nr",
6639
- iso_3: "nru",
6640
- num_code: "520",
6641
- name: "NAURU",
6642
- display_name: "Nauru"
6643
- },
6644
- {
6645
- iso_2: "np",
6646
- iso_3: "npl",
6647
- num_code: "524",
6648
- name: "NEPAL",
6649
- display_name: "Nepal"
6650
- },
6651
- {
6652
- iso_2: "nl",
6653
- iso_3: "nld",
6654
- num_code: "528",
6655
- name: "NETHERLANDS",
6656
- display_name: "Netherlands"
6657
- },
6658
- {
6659
- iso_2: "nc",
6660
- iso_3: "ncl",
6661
- num_code: "540",
6662
- name: "NEW CALEDONIA",
6663
- display_name: "New Caledonia"
6664
- },
6665
- {
6666
- iso_2: "nz",
6667
- iso_3: "nzl",
6668
- num_code: "554",
6669
- name: "NEW ZEALAND",
6670
- display_name: "New Zealand"
6671
- },
6672
- {
6673
- iso_2: "ni",
6674
- iso_3: "nic",
6675
- num_code: "558",
6676
- name: "NICARAGUA",
6677
- display_name: "Nicaragua"
6678
- },
6679
- {
6680
- iso_2: "ne",
6681
- iso_3: "ner",
6682
- num_code: "562",
6683
- name: "NIGER",
6684
- display_name: "Niger"
6685
- },
6686
- {
6687
- iso_2: "ng",
6688
- iso_3: "nga",
6689
- num_code: "566",
6690
- name: "NIGERIA",
6691
- display_name: "Nigeria"
6692
- },
6693
- {
6694
- iso_2: "nu",
6695
- iso_3: "niu",
6696
- num_code: "570",
6697
- name: "NIUE",
6698
- display_name: "Niue"
6699
- },
6700
- {
6701
- iso_2: "nf",
6702
- iso_3: "nfk",
6703
- num_code: "574",
6704
- name: "NORFOLK ISLAND",
6705
- display_name: "Norfolk Island"
6706
- },
6707
- {
6708
- iso_2: "mk",
6709
- iso_3: "mkd",
6710
- num_code: "807",
6711
- name: "NORTH MACEDONIA",
6712
- display_name: "North Macedonia"
6713
- },
6714
- {
6715
- iso_2: "mp",
6716
- iso_3: "mnp",
6717
- num_code: "580",
6718
- name: "NORTHERN MARIANA ISLANDS",
6719
- display_name: "Northern Mariana Islands"
6720
- },
6721
- {
6722
- iso_2: "no",
6723
- iso_3: "nor",
6724
- num_code: "578",
6725
- name: "NORWAY",
6726
- display_name: "Norway"
6727
- },
6728
- {
6729
- iso_2: "om",
6730
- iso_3: "omn",
6731
- num_code: "512",
6732
- name: "OMAN",
6733
- display_name: "Oman"
6734
- },
6735
- {
6736
- iso_2: "pk",
6737
- iso_3: "pak",
6738
- num_code: "586",
6739
- name: "PAKISTAN",
6740
- display_name: "Pakistan"
6741
- },
6742
- {
6743
- iso_2: "pw",
6744
- iso_3: "plw",
6745
- num_code: "585",
6746
- name: "PALAU",
6747
- display_name: "Palau"
6748
- },
6749
- {
6750
- iso_2: "ps",
6751
- iso_3: "pse",
6752
- num_code: "275",
6753
- name: "PALESTINIAN TERRITORY, OCCUPIED",
6754
- display_name: "Palestinian Territory, Occupied"
6755
- },
6756
- {
6757
- iso_2: "pa",
6758
- iso_3: "pan",
6759
- num_code: "591",
6760
- name: "PANAMA",
6761
- display_name: "Panama"
6762
- },
6763
- {
6764
- iso_2: "pg",
6765
- iso_3: "png",
6766
- num_code: "598",
6767
- name: "PAPUA NEW GUINEA",
6768
- display_name: "Papua New Guinea"
6769
- },
6770
- {
6771
- iso_2: "py",
6772
- iso_3: "pry",
6773
- num_code: "600",
6774
- name: "PARAGUAY",
6775
- display_name: "Paraguay"
6776
- },
6777
- {
6778
- iso_2: "pe",
6779
- iso_3: "per",
6780
- num_code: "604",
6781
- name: "PERU",
6782
- display_name: "Peru"
6783
- },
6784
- {
6785
- iso_2: "ph",
6786
- iso_3: "phl",
6787
- num_code: "608",
6788
- name: "PHILIPPINES",
6789
- display_name: "Philippines"
6790
- },
6791
- {
6792
- iso_2: "pn",
6793
- iso_3: "pcn",
6794
- num_code: "612",
6795
- name: "PITCAIRN",
6796
- display_name: "Pitcairn"
6797
- },
6798
- {
6799
- iso_2: "pl",
6800
- iso_3: "pol",
6801
- num_code: "616",
6802
- name: "POLAND",
6803
- display_name: "Poland"
6804
- },
6805
- {
6806
- iso_2: "pt",
6807
- iso_3: "prt",
6808
- num_code: "620",
6809
- name: "PORTUGAL",
6810
- display_name: "Portugal"
6811
- },
6812
- {
6813
- iso_2: "pr",
6814
- iso_3: "pri",
6815
- num_code: "630",
6816
- name: "PUERTO RICO",
6817
- display_name: "Puerto Rico"
6818
- },
6819
- {
6820
- iso_2: "qa",
6821
- iso_3: "qat",
6822
- num_code: "634",
6823
- name: "QATAR",
6824
- display_name: "Qatar"
6825
- },
6826
- {
6827
- iso_2: "re",
6828
- iso_3: "reu",
6829
- num_code: "638",
6830
- name: "REUNION",
6831
- display_name: "Reunion"
6832
- },
6833
- {
6834
- iso_2: "ro",
6835
- iso_3: "rom",
6836
- num_code: "642",
6837
- name: "ROMANIA",
6838
- display_name: "Romania"
6839
- },
6840
- {
6841
- iso_2: "ru",
6842
- iso_3: "rus",
6843
- num_code: "643",
6844
- name: "RUSSIAN FEDERATION",
6845
- display_name: "Russian Federation"
6846
- },
6847
- {
6848
- iso_2: "rw",
6849
- iso_3: "rwa",
6850
- num_code: "646",
6851
- name: "RWANDA",
6852
- display_name: "Rwanda"
6853
- },
6854
- {
6855
- iso_2: "bl",
6856
- iso_3: "blm",
6857
- num_code: "652",
6858
- name: "SAINT BARTHÉLEMY",
6859
- display_name: "Saint Barthélemy"
6860
- },
6861
- {
6862
- iso_2: "sh",
6863
- iso_3: "shn",
6864
- num_code: "654",
6865
- name: "SAINT HELENA",
6866
- display_name: "Saint Helena"
6867
- },
6868
- {
6869
- iso_2: "kn",
6870
- iso_3: "kna",
6871
- num_code: "659",
6872
- name: "SAINT KITTS AND NEVIS",
6873
- display_name: "Saint Kitts and Nevis"
6874
- },
6875
- {
6876
- iso_2: "lc",
6877
- iso_3: "lca",
6878
- num_code: "662",
6879
- name: "SAINT LUCIA",
6880
- display_name: "Saint Lucia"
6881
- },
6882
- {
6883
- iso_2: "mf",
6884
- iso_3: "maf",
6885
- num_code: "663",
6886
- name: "SAINT MARTIN (FRENCH PART)",
6887
- display_name: "Saint Martin (French part)"
6888
- },
6889
- {
6890
- iso_2: "pm",
6891
- iso_3: "spm",
6892
- num_code: "666",
6893
- name: "SAINT PIERRE AND MIQUELON",
6894
- display_name: "Saint Pierre and Miquelon"
6895
- },
6896
- {
6897
- iso_2: "vc",
6898
- iso_3: "vct",
6899
- num_code: "670",
6900
- name: "SAINT VINCENT AND THE GRENADINES",
6901
- display_name: "Saint Vincent and the Grenadines"
6902
- },
6903
- {
6904
- iso_2: "ws",
6905
- iso_3: "wsm",
6906
- num_code: "882",
6907
- name: "SAMOA",
6908
- display_name: "Samoa"
6909
- },
6910
- {
6911
- iso_2: "sm",
6912
- iso_3: "smr",
6913
- num_code: "674",
6914
- name: "SAN MARINO",
6915
- display_name: "San Marino"
6916
- },
6917
- {
6918
- iso_2: "st",
6919
- iso_3: "stp",
6920
- num_code: "678",
6921
- name: "SAO TOME AND PRINCIPE",
6922
- display_name: "Sao Tome and Principe"
6923
- },
6924
- {
6925
- iso_2: "sa",
6926
- iso_3: "sau",
6927
- num_code: "682",
6928
- name: "SAUDI ARABIA",
6929
- display_name: "Saudi Arabia"
6930
- },
6931
- {
6932
- iso_2: "sn",
6933
- iso_3: "sen",
6934
- num_code: "686",
6935
- name: "SENEGAL",
6936
- display_name: "Senegal"
6937
- },
6938
- {
6939
- iso_2: "rs",
6940
- iso_3: "srb",
6941
- num_code: "688",
6942
- name: "SERBIA",
6943
- display_name: "Serbia"
6944
- },
6945
- {
6946
- iso_2: "sc",
6947
- iso_3: "syc",
6948
- num_code: "690",
6949
- name: "SEYCHELLES",
6950
- display_name: "Seychelles"
6951
- },
6952
- {
6953
- iso_2: "sl",
6954
- iso_3: "sle",
6955
- num_code: "694",
6956
- name: "SIERRA LEONE",
6957
- display_name: "Sierra Leone"
6958
- },
6959
- {
6960
- iso_2: "sg",
6961
- iso_3: "sgp",
6962
- num_code: "702",
6963
- name: "SINGAPORE",
6964
- display_name: "Singapore"
6965
- },
6966
- {
6967
- iso_2: "sx",
6968
- iso_3: "sxm",
6969
- num_code: "534",
6970
- name: "SINT MAARTEN",
6971
- display_name: "Sint Maarten"
6972
- },
6973
- {
6974
- iso_2: "sk",
6975
- iso_3: "svk",
6976
- num_code: "703",
6977
- name: "SLOVAKIA",
6978
- display_name: "Slovakia"
6979
- },
6980
- {
6981
- iso_2: "si",
6982
- iso_3: "svn",
6983
- num_code: "705",
6984
- name: "SLOVENIA",
6985
- display_name: "Slovenia"
6986
- },
6987
- {
6988
- iso_2: "sb",
6989
- iso_3: "slb",
6990
- num_code: "90",
6991
- name: "SOLOMON ISLANDS",
6992
- display_name: "Solomon Islands"
6993
- },
6994
- {
6995
- iso_2: "so",
6996
- iso_3: "som",
6997
- num_code: "706",
6998
- name: "SOMALIA",
6999
- display_name: "Somalia"
7000
- },
7001
- {
7002
- iso_2: "za",
7003
- iso_3: "zaf",
7004
- num_code: "710",
7005
- name: "SOUTH AFRICA",
7006
- display_name: "South Africa"
7007
- },
7008
- {
7009
- iso_2: "gs",
7010
- iso_3: "sgs",
7011
- num_code: "239",
7012
- name: "SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS",
7013
- display_name: "South Georgia and the South Sandwich Islands"
7014
- },
7015
- {
7016
- iso_2: "ss",
7017
- iso_3: "ssd",
7018
- num_code: "728",
7019
- name: "SOUTH SUDAN",
7020
- display_name: "South Sudan"
7021
- },
7022
- {
7023
- iso_2: "es",
7024
- iso_3: "esp",
7025
- num_code: "724",
7026
- name: "SPAIN",
7027
- display_name: "Spain"
7028
- },
7029
- {
7030
- iso_2: "lk",
7031
- iso_3: "lka",
7032
- num_code: "144",
7033
- name: "SRI LANKA",
7034
- display_name: "Sri Lanka"
7035
- },
7036
- {
7037
- iso_2: "sd",
7038
- iso_3: "sdn",
7039
- num_code: "729",
7040
- name: "SUDAN",
7041
- display_name: "Sudan"
7042
- },
7043
- {
7044
- iso_2: "sr",
7045
- iso_3: "sur",
7046
- num_code: "740",
7047
- name: "SURINAME",
7048
- display_name: "Suriname"
7049
- },
7050
- {
7051
- iso_2: "sj",
7052
- iso_3: "sjm",
7053
- num_code: "744",
7054
- name: "SVALBARD AND JAN MAYEN",
7055
- display_name: "Svalbard and Jan Mayen"
7056
- },
7057
- {
7058
- iso_2: "sz",
7059
- iso_3: "swz",
7060
- num_code: "748",
7061
- name: "SWAZILAND",
7062
- display_name: "Swaziland"
7063
- },
7064
- {
7065
- iso_2: "se",
7066
- iso_3: "swe",
7067
- num_code: "752",
7068
- name: "SWEDEN",
7069
- display_name: "Sweden"
7070
- },
7071
- {
7072
- iso_2: "ch",
7073
- iso_3: "che",
7074
- num_code: "756",
7075
- name: "SWITZERLAND",
7076
- display_name: "Switzerland"
7077
- },
7078
- {
7079
- iso_2: "sy",
7080
- iso_3: "syr",
7081
- num_code: "760",
7082
- name: "SYRIAN ARAB REPUBLIC",
7083
- display_name: "Syrian Arab Republic"
7084
- },
7085
- {
7086
- iso_2: "tw",
7087
- iso_3: "twn",
7088
- num_code: "158",
7089
- name: "TAIWAN, PROVINCE OF CHINA",
7090
- display_name: "Taiwan, Province of China"
7091
- },
7092
- {
7093
- iso_2: "tj",
7094
- iso_3: "tjk",
7095
- num_code: "762",
7096
- name: "TAJIKISTAN",
7097
- display_name: "Tajikistan"
7098
- },
7099
- {
7100
- iso_2: "tz",
7101
- iso_3: "tza",
7102
- num_code: "834",
7103
- name: "TANZANIA, UNITED REPUBLIC OF",
7104
- display_name: "Tanzania, United Republic of"
7105
- },
7106
- {
7107
- iso_2: "th",
7108
- iso_3: "tha",
7109
- num_code: "764",
7110
- name: "THAILAND",
7111
- display_name: "Thailand"
7112
- },
7113
- {
7114
- iso_2: "tl",
7115
- iso_3: "tls",
7116
- num_code: "626",
7117
- name: "TIMOR LESTE",
7118
- display_name: "Timor Leste"
7119
- },
7120
- {
7121
- iso_2: "tg",
7122
- iso_3: "tgo",
7123
- num_code: "768",
7124
- name: "TOGO",
7125
- display_name: "Togo"
7126
- },
7127
- {
7128
- iso_2: "tk",
7129
- iso_3: "tkl",
7130
- num_code: "772",
7131
- name: "TOKELAU",
7132
- display_name: "Tokelau"
7133
- },
7134
- {
7135
- iso_2: "to",
7136
- iso_3: "ton",
7137
- num_code: "776",
7138
- name: "TONGA",
7139
- display_name: "Tonga"
7140
- },
7141
- {
7142
- iso_2: "tt",
7143
- iso_3: "tto",
7144
- num_code: "780",
7145
- name: "TRINIDAD AND TOBAGO",
7146
- display_name: "Trinidad and Tobago"
7147
- },
7148
- {
7149
- iso_2: "tn",
7150
- iso_3: "tun",
7151
- num_code: "788",
7152
- name: "TUNISIA",
7153
- display_name: "Tunisia"
7154
- },
7155
- {
7156
- iso_2: "tr",
7157
- iso_3: "tur",
7158
- num_code: "792",
7159
- name: "TURKEY",
7160
- display_name: "Turkey"
7161
- },
7162
- {
7163
- iso_2: "tm",
7164
- iso_3: "tkm",
7165
- num_code: "795",
7166
- name: "TURKMENISTAN",
7167
- display_name: "Turkmenistan"
7168
- },
7169
- {
7170
- iso_2: "tc",
7171
- iso_3: "tca",
7172
- num_code: "796",
7173
- name: "TURKS AND CAICOS ISLANDS",
7174
- display_name: "Turks and Caicos Islands"
7175
- },
7176
- {
7177
- iso_2: "tv",
7178
- iso_3: "tuv",
7179
- num_code: "798",
7180
- name: "TUVALU",
7181
- display_name: "Tuvalu"
7182
- },
7183
- {
7184
- iso_2: "ug",
7185
- iso_3: "uga",
7186
- num_code: "800",
7187
- name: "UGANDA",
7188
- display_name: "Uganda"
7189
- },
7190
- {
7191
- iso_2: "ua",
7192
- iso_3: "ukr",
7193
- num_code: "804",
7194
- name: "UKRAINE",
7195
- display_name: "Ukraine"
7196
- },
7197
- {
7198
- iso_2: "ae",
7199
- iso_3: "are",
7200
- num_code: "784",
7201
- name: "UNITED ARAB EMIRATES",
7202
- display_name: "United Arab Emirates"
7203
- },
7204
- {
7205
- iso_2: "gb",
7206
- iso_3: "gbr",
7207
- num_code: "826",
7208
- name: "UNITED KINGDOM",
7209
- display_name: "United Kingdom"
7210
- },
7211
- {
7212
- iso_2: "us",
7213
- iso_3: "usa",
7214
- num_code: "840",
7215
- name: "UNITED STATES",
7216
- display_name: "United States"
7217
- },
7218
- {
7219
- iso_2: "um",
7220
- iso_3: "umi",
7221
- num_code: "581",
7222
- name: "UNITED STATES MINOR OUTLYING ISLANDS",
7223
- display_name: "United States Minor Outlying Islands"
7224
- },
7225
- {
7226
- iso_2: "uy",
7227
- iso_3: "ury",
7228
- num_code: "858",
7229
- name: "URUGUAY",
7230
- display_name: "Uruguay"
7231
- },
7232
- {
7233
- iso_2: "uz",
7234
- iso_3: "uzb",
7235
- num_code: "860",
7236
- name: "UZBEKISTAN",
7237
- display_name: "Uzbekistan"
7238
- },
7239
- {
7240
- iso_2: "vu",
7241
- iso_3: "vut",
7242
- num_code: "548",
7243
- name: "VANUATU",
7244
- display_name: "Vanuatu"
7245
- },
7246
- {
7247
- iso_2: "ve",
7248
- iso_3: "ven",
7249
- num_code: "862",
7250
- name: "VENEZUELA",
7251
- display_name: "Venezuela"
7252
- },
7253
- {
7254
- iso_2: "vn",
7255
- iso_3: "vnm",
7256
- num_code: "704",
7257
- name: "VIET NAM",
7258
- display_name: "Viet Nam"
7259
- },
7260
- {
7261
- iso_2: "vg",
7262
- iso_3: "vgb",
7263
- num_code: "92",
7264
- name: "VIRGIN ISLANDS, BRITISH",
7265
- display_name: "Virgin Islands, British"
7266
- },
7267
- {
7268
- iso_2: "vi",
7269
- iso_3: "vir",
7270
- num_code: "850",
7271
- name: "VIRGIN ISLANDS, U.S.",
7272
- display_name: "Virgin Islands, U.S."
7273
- },
7274
- {
7275
- iso_2: "wf",
7276
- iso_3: "wlf",
7277
- num_code: "876",
7278
- name: "WALLIS AND FUTUNA",
7279
- display_name: "Wallis and Futuna"
7280
- },
7281
- {
7282
- iso_2: "eh",
7283
- iso_3: "esh",
7284
- num_code: "732",
7285
- name: "WESTERN SAHARA",
7286
- display_name: "Western Sahara"
7287
- },
7288
- {
7289
- iso_2: "ye",
7290
- iso_3: "yem",
7291
- num_code: "887",
7292
- name: "YEMEN",
7293
- display_name: "Yemen"
7294
- },
7295
- {
7296
- iso_2: "zm",
7297
- iso_3: "zmb",
7298
- num_code: "894",
7299
- name: "ZAMBIA",
7300
- display_name: "Zambia"
7301
- },
7302
- {
7303
- iso_2: "zw",
7304
- iso_3: "zwe",
7305
- num_code: "716",
7306
- name: "ZIMBABWE",
7307
- display_name: "Zimbabwe"
7308
- },
7309
- {
7310
- iso_2: "ax",
7311
- iso_3: "ala",
7312
- num_code: "248",
7313
- name: "ÅLAND ISLANDS",
7314
- display_name: "Åland Islands"
7315
- }
7316
- ];
7317
- const getFormattedAddress = ({
7318
- address
7319
- }) => {
7320
- if (!address) {
7321
- return [];
7322
- }
7323
- const {
7324
- first_name,
7325
- last_name,
7326
- company,
7327
- address_1,
7328
- address_2,
7329
- city,
7330
- postal_code,
7331
- province,
7332
- country,
7333
- country_code
7334
- } = address;
7335
- const name = [first_name, last_name].filter(Boolean).join(" ");
7336
- const formattedAddress = [];
7337
- if (name) {
7338
- formattedAddress.push(name);
7339
- }
7340
- if (company) {
7341
- formattedAddress.push(company);
7342
- }
7343
- if (address_1) {
7344
- formattedAddress.push(address_1);
7345
- }
7346
- if (address_2) {
7347
- formattedAddress.push(address_2);
7348
- }
7349
- const cityProvincePostal = [city, province, postal_code].filter(Boolean).join(" ");
7350
- if (cityProvincePostal) {
7351
- formattedAddress.push(cityProvincePostal);
7352
- }
7353
- if (country) {
7354
- formattedAddress.push(country.display_name);
7355
- } else if (country_code) {
7356
- const country2 = getCountryByIso2(country_code);
7357
- if (country2) {
7358
- formattedAddress.push(country2.display_name);
7359
- } else {
7360
- formattedAddress.push(country_code.toUpperCase());
7361
- }
7362
- }
7363
- return formattedAddress;
7364
- };
7365
- const getLocaleAmount = (amount, currencyCode) => {
7366
- const formatter = new Intl.NumberFormat([], {
7367
- style: "currency",
7368
- currencyDisplay: "narrowSymbol",
7369
- currency: currencyCode
7370
- });
7371
- return formatter.format(amount);
7372
- };
7373
- const getTotalCaptured = (paymentCollections) => paymentCollections.reduce((acc, paymentCollection) => {
7374
- acc = acc + (paymentCollection.captured_amount - paymentCollection.refunded_amount);
7375
- return acc;
7376
- }, 0);
7377
3029
  function SectionBlock({
7378
3030
  id,
7379
3031
  props,
@@ -7585,8 +3237,415 @@ const TEMPLATES_NAMES = {
7585
3237
  INVENTORY_LEVEL: "inventory-level",
7586
3238
  ORDER_PLACED: "order-placed",
7587
3239
  ORDER_COMPLETED: "order-completed",
3240
+ ORDER_UPDATED: "order-updated",
7588
3241
  CONTACT_FORM: "contact-form"
7589
3242
  };
3243
+ const ORDER_ATTRIBUTES = [
3244
+ // Basic fields
3245
+ {
3246
+ value: "order.id",
3247
+ label: "ID",
3248
+ description: "Unique identifier of the order"
3249
+ },
3250
+ {
3251
+ value: "order.display_id",
3252
+ label: "Display ID",
3253
+ description: "Human-readable order number displayed to customers"
3254
+ },
3255
+ {
3256
+ value: "order.custom_display_id",
3257
+ label: "Custom Display ID",
3258
+ description: "Custom order identifier set by the merchant"
3259
+ },
3260
+ {
3261
+ value: "order.status",
3262
+ label: "Status",
3263
+ description: "Current status of the order"
3264
+ },
3265
+ {
3266
+ value: "order.locale",
3267
+ label: "Locale",
3268
+ description: "Locale code for the order (language and region)"
3269
+ },
3270
+ {
3271
+ value: "order.email",
3272
+ label: "Email",
3273
+ description: "Customer email address associated with the order"
3274
+ },
3275
+ {
3276
+ value: "order.currency_code",
3277
+ label: "Currency Code",
3278
+ description: "ISO 4217 currency code for the order"
3279
+ },
3280
+ {
3281
+ value: "order.region_id",
3282
+ label: "Region ID",
3283
+ description: "Unique identifier of the region"
3284
+ },
3285
+ {
3286
+ value: "order.created_at",
3287
+ label: "Created At",
3288
+ description: "Date and time when the order was created (ISO 8601 format)"
3289
+ },
3290
+ {
3291
+ value: "order.updated_at",
3292
+ label: "Updated At",
3293
+ description: "Date and time when the order was last updated (ISO 8601 format)"
3294
+ },
3295
+ // Totals
3296
+ {
3297
+ value: "order.total",
3298
+ label: "Total",
3299
+ description: "Total amount of the order including taxes, shipping, and discounts"
3300
+ },
3301
+ {
3302
+ value: "order.subtotal",
3303
+ label: "Subtotal",
3304
+ description: "Subtotal amount before taxes and shipping"
3305
+ },
3306
+ {
3307
+ value: "order.tax_total",
3308
+ label: "Tax Total",
3309
+ description: "Total amount of taxes applied to the order"
3310
+ },
3311
+ {
3312
+ value: "order.original_total",
3313
+ label: "Original Total",
3314
+ description: "Original total amount before any changes or adjustments"
3315
+ },
3316
+ {
3317
+ value: "order.original_subtotal",
3318
+ label: "Original Subtotal",
3319
+ description: "Original subtotal before any changes or adjustments"
3320
+ },
3321
+ {
3322
+ value: "order.original_tax_total",
3323
+ label: "Original Tax Total",
3324
+ description: "Original tax total before any changes or adjustments"
3325
+ },
3326
+ {
3327
+ value: "order.discount_total",
3328
+ label: "Discount Total",
3329
+ description: "Total amount of discounts applied to the order"
3330
+ },
3331
+ {
3332
+ value: "order.discount_tax_total",
3333
+ label: "Discount Tax Total",
3334
+ description: "Tax amount on discounts applied to the order"
3335
+ },
3336
+ // Shipping (specific fields, not *)
3337
+ {
3338
+ value: "order.shipping_methods.amount",
3339
+ label: "Shipping Methods Amount",
3340
+ description: "Total shipping cost for all shipping methods. This is an array - operator 'eq' checks if ANY value matches",
3341
+ type: "array",
3342
+ isRelation: true,
3343
+ relationType: "shipping_methods"
3344
+ },
3345
+ {
3346
+ value: "order.shipping_methods.subtotal",
3347
+ label: "Shipping Methods Subtotal",
3348
+ description: "Shipping subtotal before taxes. This is an array - operator 'eq' checks if ANY value matches",
3349
+ type: "array",
3350
+ isRelation: true,
3351
+ relationType: "shipping_methods"
3352
+ },
3353
+ {
3354
+ value: "order.shipping_methods.tax_total",
3355
+ label: "Shipping Methods Tax Total",
3356
+ description: "Tax amount on shipping. This is an array - operator 'eq' checks if ANY value matches",
3357
+ type: "array",
3358
+ isRelation: true,
3359
+ relationType: "shipping_methods"
3360
+ },
3361
+ {
3362
+ value: "order.shipping_methods.original_total",
3363
+ label: "Shipping Methods Original Total",
3364
+ description: "Original shipping total before adjustments. This is an array - operator 'eq' checks if ANY value matches",
3365
+ type: "array",
3366
+ isRelation: true,
3367
+ relationType: "shipping_methods"
3368
+ },
3369
+ {
3370
+ value: "order.shipping_methods.original_subtotal",
3371
+ label: "Shipping Methods Original Subtotal",
3372
+ description: "Original shipping subtotal before adjustments. This is an array - operator 'eq' checks if ANY value matches",
3373
+ type: "array",
3374
+ isRelation: true,
3375
+ relationType: "shipping_methods"
3376
+ },
3377
+ {
3378
+ value: "order.shipping_methods.original_tax_total",
3379
+ label: "Shipping Methods Original Tax Total",
3380
+ description: "Original shipping tax total before adjustments. This is an array - operator 'eq' checks if ANY value matches",
3381
+ type: "array",
3382
+ isRelation: true,
3383
+ relationType: "shipping_methods"
3384
+ },
3385
+ {
3386
+ value: "order.shipping_methods.discount_total",
3387
+ label: "Shipping Methods Discount Total",
3388
+ description: "Total shipping discounts applied. This is an array - operator 'eq' checks if ANY value matches",
3389
+ type: "array",
3390
+ isRelation: true,
3391
+ relationType: "shipping_methods"
3392
+ },
3393
+ {
3394
+ value: "order.shipping_methods.discount_subtotal",
3395
+ label: "Shipping Methods Discount Subtotal",
3396
+ description: "Shipping discount subtotal. This is an array - operator 'eq' checks if ANY value matches",
3397
+ type: "array",
3398
+ isRelation: true,
3399
+ relationType: "shipping_methods"
3400
+ },
3401
+ {
3402
+ value: "order.shipping_methods.discount_tax_total",
3403
+ label: "Shipping Methods Discount Tax Total",
3404
+ description: "Tax amount on shipping discounts. This is an array - operator 'eq' checks if ANY value matches",
3405
+ type: "array",
3406
+ isRelation: true,
3407
+ relationType: "shipping_methods"
3408
+ },
3409
+ // Summary (specific fields)
3410
+ {
3411
+ value: "order.summary.total",
3412
+ label: "Summary Total",
3413
+ description: "Summary total amount including all adjustments"
3414
+ },
3415
+ {
3416
+ value: "order.summary.subtotal",
3417
+ label: "Summary Subtotal",
3418
+ description: "Summary subtotal amount"
3419
+ },
3420
+ {
3421
+ value: "order.summary.tax_total",
3422
+ label: "Summary Tax Total",
3423
+ description: "Summary tax total amount"
3424
+ },
3425
+ {
3426
+ value: "order.summary.discount_total",
3427
+ label: "Summary Discount Total",
3428
+ description: "Summary discount total amount"
3429
+ },
3430
+ {
3431
+ value: "order.summary.original_order_total",
3432
+ label: "Summary Original Order Total",
3433
+ description: "Summary original order total before adjustments"
3434
+ },
3435
+ {
3436
+ value: "order.summary.current_order_total",
3437
+ label: "Summary Current Order Total",
3438
+ description: "Summary current order total after all adjustments"
3439
+ },
3440
+ {
3441
+ value: "order.summary.paid_total",
3442
+ label: "Summary Paid Total",
3443
+ description: "Total amount that has been paid for this order"
3444
+ },
3445
+ {
3446
+ value: "order.summary.refunded_total",
3447
+ label: "Summary Refunded Total",
3448
+ description: "Total amount that has been refunded for this order"
3449
+ },
3450
+ {
3451
+ value: "order.summary.accounting_total",
3452
+ label: "Summary Accounting Total",
3453
+ description: "Total amount for accounting purposes"
3454
+ },
3455
+ {
3456
+ value: "order.summary.credit_line_total",
3457
+ label: "Summary Credit Line Total",
3458
+ description: "Total amount from credit lines applied to this order"
3459
+ },
3460
+ {
3461
+ value: "order.summary.transaction_total",
3462
+ label: "Summary Transaction Total",
3463
+ description: "Total amount of all transactions for this order"
3464
+ },
3465
+ {
3466
+ value: "order.summary.pending_difference",
3467
+ label: "Summary Pending Difference",
3468
+ description: "Difference between expected and actual payment amounts"
3469
+ },
3470
+ // Customer relation
3471
+ {
3472
+ value: "order.customer.id",
3473
+ label: "Customer ID",
3474
+ description: "Unique identifier of the customer who placed the order"
3475
+ },
3476
+ {
3477
+ value: "order.customer.email",
3478
+ label: "Customer Email",
3479
+ description: "Email address of the customer who placed the order"
3480
+ },
3481
+ {
3482
+ value: "order.customer.first_name",
3483
+ label: "Customer First Name",
3484
+ description: "First name of the customer"
3485
+ },
3486
+ {
3487
+ value: "order.customer.last_name",
3488
+ label: "Customer Last Name",
3489
+ description: "Last name of the customer"
3490
+ },
3491
+ // Sales channel relation
3492
+ {
3493
+ value: "order.sales_channel.id",
3494
+ label: "Sales Channel ID",
3495
+ description: "Unique identifier of the sales channel"
3496
+ },
3497
+ {
3498
+ value: "order.sales_channel.name",
3499
+ label: "Sales Channel Name",
3500
+ description: "Name of the sales channel"
3501
+ },
3502
+ // Shipping address
3503
+ {
3504
+ value: "order.shipping_address.first_name",
3505
+ label: "Shipping First Name",
3506
+ description: "First name for shipping address"
3507
+ },
3508
+ {
3509
+ value: "order.shipping_address.last_name",
3510
+ label: "Shipping Last Name",
3511
+ description: "Last name for shipping address"
3512
+ },
3513
+ {
3514
+ value: "order.shipping_address.address_1",
3515
+ label: "Shipping Address 1",
3516
+ description: "Primary street address for shipping"
3517
+ },
3518
+ {
3519
+ value: "order.shipping_address.city",
3520
+ label: "Shipping City",
3521
+ description: "City for shipping address"
3522
+ },
3523
+ {
3524
+ value: "order.shipping_address.country_code",
3525
+ label: "Shipping Country Code",
3526
+ description: "ISO 3166-1 alpha-2 country code for shipping"
3527
+ },
3528
+ {
3529
+ value: "order.shipping_address.postal_code",
3530
+ label: "Shipping Postal Code",
3531
+ description: "Postal/ZIP code for shipping address"
3532
+ },
3533
+ // Billing address
3534
+ {
3535
+ value: "order.billing_address.first_name",
3536
+ label: "Billing First Name",
3537
+ description: "First name for billing address"
3538
+ },
3539
+ {
3540
+ value: "order.billing_address.last_name",
3541
+ label: "Billing Last Name",
3542
+ description: "Last name for billing address"
3543
+ },
3544
+ {
3545
+ value: "order.billing_address.address_1",
3546
+ label: "Billing Address 1",
3547
+ description: "Primary street address for billing"
3548
+ },
3549
+ {
3550
+ value: "order.billing_address.city",
3551
+ label: "Billing City",
3552
+ description: "City for billing address"
3553
+ },
3554
+ {
3555
+ value: "order.billing_address.country_code",
3556
+ label: "Billing Country Code",
3557
+ description: "ISO 3166-1 alpha-2 country code for billing"
3558
+ },
3559
+ {
3560
+ value: "order.billing_address.postal_code",
3561
+ label: "Billing Postal Code",
3562
+ description: "Postal/ZIP code for billing address"
3563
+ },
3564
+ // Items (specific fields, not *)
3565
+ {
3566
+ value: "order.items.id",
3567
+ label: "Item ID",
3568
+ description: "Unique identifier of the order item"
3569
+ },
3570
+ {
3571
+ value: "order.items.quantity",
3572
+ label: "Item Quantity",
3573
+ description: "Quantity of this item in the order"
3574
+ },
3575
+ {
3576
+ value: "order.items.title",
3577
+ label: "Item Title",
3578
+ description: "Title/name of the order item"
3579
+ },
3580
+ {
3581
+ value: "order.items.unit_price",
3582
+ label: "Item Unit Price",
3583
+ description: "Price per unit of this item"
3584
+ },
3585
+ {
3586
+ value: "order.items.variant.id",
3587
+ label: "Item Variant ID",
3588
+ description: "Unique identifier of the product variant"
3589
+ },
3590
+ {
3591
+ value: "order.items.variant.sku",
3592
+ label: "Item Variant SKU",
3593
+ description: "SKU (Stock Keeping Unit) of the product variant"
3594
+ },
3595
+ {
3596
+ value: "order.items.product.id",
3597
+ label: "Item Product ID",
3598
+ description: "Unique identifier of the product"
3599
+ },
3600
+ {
3601
+ value: "order.items.product.title",
3602
+ label: "Item Product Title",
3603
+ description: "Title/name of the product"
3604
+ },
3605
+ // Payment collections
3606
+ {
3607
+ value: "order.payment_collections.id",
3608
+ label: "Payment Collection ID",
3609
+ description: "Unique identifier of the payment collection"
3610
+ },
3611
+ {
3612
+ value: "order.payment_collections.status",
3613
+ label: "Payment Collection Status",
3614
+ description: "Status of payment collections for this order"
3615
+ },
3616
+ {
3617
+ value: "order.payment_collections.amount",
3618
+ label: "Payment Collection Amount",
3619
+ description: "Amount of the payment collection"
3620
+ },
3621
+ // Fulfillments
3622
+ {
3623
+ value: "order.fulfillments.id",
3624
+ label: "Fulfillment ID",
3625
+ description: "Unique identifier of the fulfillment"
3626
+ },
3627
+ {
3628
+ value: "order.fulfillments.status",
3629
+ label: "Fulfillment Status",
3630
+ description: "Status of fulfillments for this order"
3631
+ }
3632
+ ];
3633
+ [
3634
+ // Basic fields from ORDER_ATTRIBUTES
3635
+ ...ORDER_ATTRIBUTES.map((attr) => attr.value),
3636
+ // Technical relations required for totals calculation
3637
+ // These fields are not available in UI rules, but are needed for correct data retrieval
3638
+ "order.items.*",
3639
+ "order.items.tax_lines.*",
3640
+ "order.items.adjustments.*",
3641
+ "order.shipping_methods.*",
3642
+ "order.shipping_methods.tax_lines.*",
3643
+ "order.shipping_methods.adjustments.*",
3644
+ "order.fulfillments.*",
3645
+ "order.credit_lines.*",
3646
+ "order.summary.*",
3647
+ "order.payment_collections.*"
3648
+ ];
7590
3649
  const baseTemplateConfig = {
7591
3650
  [TEMPLATES_NAMES.BASE_TEMPLATE]: {
7592
3651
  getHtml: async (data, options) => {
@@ -7610,61 +3669,34 @@ const baseTemplateConfig = {
7610
3669
  [TEMPLATES_NAMES.ORDER_COMPLETED]: {
7611
3670
  ...baseTemplateConfig[TEMPLATES_NAMES.BASE_TEMPLATE]
7612
3671
  },
3672
+ [TEMPLATES_NAMES.ORDER_UPDATED]: {
3673
+ ...baseTemplateConfig[TEMPLATES_NAMES.BASE_TEMPLATE]
3674
+ },
7613
3675
  [TEMPLATES_NAMES.INVENTORY_LEVEL]: {
7614
3676
  ...baseTemplateConfig[TEMPLATES_NAMES.BASE_TEMPLATE]
7615
3677
  }
7616
3678
  });
7617
3679
  const OrderPlacedTemplate = ({ orderId }) => {
7618
- const [templateData, setTemplateData] = useState(null);
7619
- const [previewData, setPreviewData] = useState(null);
3680
+ const [context, setContext] = useState(null);
3681
+ const [previewContext, setPreviewData] = useState(null);
7620
3682
  const { data: order, isLoading: isOrderLoading } = useOrder({
7621
3683
  order_id: orderId,
7622
3684
  enabled: !!orderId
7623
3685
  });
7624
3686
  useEffect(() => {
7625
- var _a, _b;
7626
3687
  if (order == null ? void 0 : order.display_id) {
7627
- const shippingAddressText = getFormattedAddress({ address: order.shipping_address }).join("<br/>");
7628
- const billingAddressText = getFormattedAddress({ address: order.billing_address }).join("<br/>");
7629
- const templateData2 = {
7630
- orderNumber: `#${order.display_id}`,
7631
- customerName: order.email,
7632
- customerEmail: order.email,
7633
- orderDate: formatDate({ date: order.created_at, includeTime: true, localeCode: "pl" }),
7634
- totalAmount: order.items.reduce((acc, item) => {
7635
- var _a2, _b2, _c;
7636
- return acc + (((_c = (_b2 = (_a2 = item.variant) == null ? void 0 : _a2.prices) == null ? void 0 : _b2[0]) == null ? void 0 : _c.amount) || 0) * item.quantity;
7637
- }, 0),
7638
- currency_code: order.currency_code,
7639
- items: order.items.map((item) => ({
7640
- thumbnail: item.thumbnail == null ? "" : item.thumbnail,
7641
- title: item.title,
7642
- quantity: item.quantity,
7643
- price: getLocaleAmount(item.unit_price, order.currency_code)
7644
- })),
7645
- shippingAddress: shippingAddressText,
7646
- billingAddress: billingAddressText,
7647
- summary: {
7648
- total: getLocaleAmount(order.summary.original_order_total, order.currency_code),
7649
- paid_total: getLocaleAmount(getTotalCaptured(order.payment_collections || []), order.currency_code),
7650
- tax_total: getLocaleAmount(order.tax_total, order.currency_code),
7651
- discount_total: getLocaleAmount(order.discount_total, order.currency_code)
7652
- },
7653
- sales_channel: {
7654
- name: (_a = order == null ? void 0 : order.sales_channel) == null ? void 0 : _a.name,
7655
- description: (_b = order == null ? void 0 : order.sales_channel) == null ? void 0 : _b.description
7656
- }
7657
- };
7658
- console.log(order);
7659
- setTemplateData(templateData2);
3688
+ setContext({
3689
+ order
3690
+ });
7660
3691
  }
7661
3692
  }, [order]);
7662
3693
  const { data: preview } = usePreview({
7663
3694
  templateName: TEMPLATES_NAMES.ORDER_PLACED,
7664
- templateData,
3695
+ context,
3696
+ contextType: "order",
7665
3697
  locale: "pl",
7666
- enabled: !!templateData,
7667
- extraKey: [templateData, orderId]
3698
+ enabled: !!context,
3699
+ extraKey: [context, orderId]
7668
3700
  });
7669
3701
  useEffect(() => {
7670
3702
  if (isOrderLoading) {
@@ -7682,10 +3714,10 @@ const OrderPlacedTemplate = ({ orderId }) => {
7682
3714
  orderId,
7683
3715
  "..."
7684
3716
  ] }),
7685
- previewData && /* @__PURE__ */ jsx("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsx(
3717
+ previewContext && /* @__PURE__ */ jsx("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsx(
7686
3718
  "iframe",
7687
3719
  {
7688
- srcDoc: (previewData == null ? void 0 : previewData.html) || "",
3720
+ srcDoc: (previewContext == null ? void 0 : previewContext.html) || "",
7689
3721
  style: { width: "100%", border: "none", minHeight: "600px" },
7690
3722
  sandbox: "allow-same-origin"
7691
3723
  }
@@ -7728,17 +3760,20 @@ const contactFormMockData = {
7728
3760
  message: "Test messages"
7729
3761
  };
7730
3762
  const ContactFormTemplate = () => {
7731
- const [templateData, setTemplateData] = useState(null);
7732
- const [previewData, setPreviewData] = useState(null);
3763
+ const [context, setContext] = useState(null);
3764
+ const [previewContext, setPreviewData] = useState(null);
7733
3765
  useEffect(() => {
7734
- setTemplateData(contactFormMockData);
3766
+ setContext({
3767
+ contact_form: contactFormMockData
3768
+ });
7735
3769
  }, []);
7736
3770
  const { data: preview, isLoading: isPreviewLoading } = usePreview({
7737
3771
  templateName: TEMPLATES_NAMES.CONTACT_FORM,
7738
- templateData,
3772
+ context,
3773
+ contextType: "contact_form",
7739
3774
  locale: "pl",
7740
- enabled: !!templateData,
7741
- extraKey: [templateData]
3775
+ enabled: !!context,
3776
+ extraKey: [context]
7742
3777
  });
7743
3778
  useEffect(() => {
7744
3779
  if (preview) {
@@ -7747,10 +3782,10 @@ const ContactFormTemplate = () => {
7747
3782
  }, [preview]);
7748
3783
  return /* @__PURE__ */ jsxs("div", { className: "px-6 py-4", children: [
7749
3784
  isPreviewLoading && /* @__PURE__ */ jsx(Alert, { variant: "info", children: "Loading preview..." }),
7750
- previewData && /* @__PURE__ */ jsx("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsx(
3785
+ previewContext && /* @__PURE__ */ jsx("div", { className: "px-6 py-4", children: /* @__PURE__ */ jsx(
7751
3786
  "iframe",
7752
3787
  {
7753
- srcDoc: (previewData == null ? void 0 : previewData.html) || "",
3788
+ srcDoc: (previewContext == null ? void 0 : previewContext.html) || "",
7754
3789
  style: { width: "100%", border: "none", minHeight: "600px" },
7755
3790
  sandbox: "allow-same-origin"
7756
3791
  }
@@ -7835,17 +3870,17 @@ const menuItemModule = {
7835
3870
  path: "/notifications-emails",
7836
3871
  nested: void 0
7837
3872
  },
7838
- {
7839
- label: config$1.label,
7840
- icon: config$1.icon,
7841
- path: "/notifications-emails/list",
7842
- nested: void 0
7843
- },
7844
3873
  {
7845
3874
  label: config.label,
7846
3875
  icon: config.icon,
7847
3876
  path: "/notifications-emails/render",
7848
3877
  nested: void 0
3878
+ },
3879
+ {
3880
+ label: config$1.label,
3881
+ icon: config$1.icon,
3882
+ path: "/notifications-emails/list",
3883
+ nested: void 0
7849
3884
  }
7850
3885
  ]
7851
3886
  };