@everymatrix/casino-wagering-bonuses-controller 1.9.1 → 1.10.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.
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).app=t()}(this,(function(){"use strict";function e(){}function t(e,t){
|
|
2
2
|
// @ts-ignore
|
|
3
|
-
for(const n in t)e[n]=t[n];return e}function n(e){return e()}function r(){return Object.create(null)}function o(e){e.forEach(n)}function i(e){return"function"==typeof e}function s(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}
|
|
3
|
+
for(const n in t)e[n]=t[n];return e}function n(e){return e()}function r(){return Object.create(null)}function o(e){e.forEach(n)}function i(e){return"function"==typeof e}function s(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function a(e,t){e.appendChild(t)}function l(e,t,n){e.insertBefore(t,n||null)}function c(e){e.parentNode&&e.parentNode.removeChild(e)}function u(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function h(e){return document.createElement(e)}function f(e){return document.createTextNode(e)}function p(){return f(" ")}function d(){return f("")}function g(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function m(e,t){
|
|
4
4
|
// @ts-ignore
|
|
5
|
-
const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const r in t)null==t[r]?e.removeAttribute(r):"style"===r?e.style.cssText=t[r]:"__value"===r?e.value=e[r]=t[r]:n[r]&&n[r].set?e[r]=t[r]:
|
|
5
|
+
const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const r in t)null==t[r]?e.removeAttribute(r):"style"===r?e.style.cssText=t[r]:"__value"===r?e.value=e[r]=t[r]:n[r]&&n[r].set?e[r]=t[r]:g(e,r,t[r])}function b(e){const t={};for(const n of e)t[n.name]=n.value;return t}let y;function E(e){y=e}
|
|
6
|
+
/**
|
|
7
|
+
* The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
|
|
8
|
+
* It must be called during the component's initialisation (but doesn't need to live *inside* the component;
|
|
9
|
+
* it can be called from an external module).
|
|
10
|
+
*
|
|
11
|
+
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).
|
|
12
|
+
*
|
|
13
|
+
* https://svelte.dev/docs#run-time-svelte-onmount
|
|
14
|
+
*/
|
|
15
|
+
function v(e){(function(){if(!y)throw new Error("Function called outside component initialization");return y})().$$.on_mount.push(e)}const T=[],B=[];let _=[];const w=[],A=Promise.resolve();let H=!1;function C(e){_.push(e)}
|
|
6
16
|
// flush() calls callbacks in this order:
|
|
7
17
|
// 1. All beforeUpdate callbacks, in order: parents before children
|
|
8
18
|
// 2. All bind:this callbacks, in reverse order: children before parents.
|
|
@@ -21,46 +31,769 @@ const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const r in t)null==t[r
|
|
|
21
31
|
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
|
22
32
|
// callback called a second time; the seen_callbacks set, outside the flush()
|
|
23
33
|
// function, guarantees this behavior.
|
|
24
|
-
const
|
|
25
|
-
function
|
|
34
|
+
const S=new Set;let L=0;// Do *not* move this inside the flush() function
|
|
35
|
+
function P(){
|
|
36
|
+
// Do not reenter flush while dirty components are updated, as this can
|
|
37
|
+
// result in an infinite loop. Instead, let the inner flush handle it.
|
|
38
|
+
// Reentrancy is ok afterwards for bindings etc.
|
|
39
|
+
if(0!==L)return;const e=y;do{
|
|
26
40
|
// first, call beforeUpdate functions
|
|
27
41
|
// and update components
|
|
28
|
-
for(
|
|
42
|
+
try{for(;L<T.length;){const e=T[L];L++,E(e),R(e.$$)}}catch(e){
|
|
43
|
+
// reset dirty state to not end up in a deadlocked state and then rethrow
|
|
44
|
+
throw T.length=0,L=0,e}for(E(null),T.length=0,L=0;B.length;)B.pop()();
|
|
29
45
|
// then, once components are updated, call
|
|
30
46
|
// afterUpdate functions. This may cause
|
|
31
47
|
// subsequent updates...
|
|
32
|
-
for(let e=0;e<
|
|
48
|
+
for(let e=0;e<_.length;e+=1){const t=_[e];S.has(t)||(
|
|
33
49
|
// ...so guard against infinite loops
|
|
34
|
-
|
|
50
|
+
S.add(t),t())}_.length=0}while(T.length);for(;w.length;)w.pop()();H=!1,S.clear(),E(e)}function R(e){if(null!==e.fragment){e.update(),o(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(C)}}
|
|
51
|
+
/**
|
|
52
|
+
* Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.
|
|
53
|
+
*/const N=new Set;function O(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];_.forEach((r=>-1===e.indexOf(r)?t.push(r):n.push(r))),n.forEach((e=>e())),_=t}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(t),
|
|
54
|
+
// TODO null out other refs, including component.$$ (but need to
|
|
55
|
+
// preserve final state?)
|
|
56
|
+
n.on_destroy=n.fragment=null,n.ctx=[])}function I(e,t){-1===e.$$.dirty[0]&&(T.push(e),H||(H=!0,A.then(P)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function M(t,s,a,l,u,h,f,p=[-1]){const d=y;E(t);const g=t.$$={fragment:null,ctx:[],
|
|
35
57
|
// state
|
|
36
58
|
props:h,update:e,not_equal:u,bound:r(),
|
|
37
59
|
// lifecycle
|
|
38
|
-
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(
|
|
60
|
+
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(d?d.$$.context:[])),
|
|
39
61
|
// everything else
|
|
40
|
-
callbacks:r(),dirty:
|
|
62
|
+
callbacks:r(),dirty:p,skip_bound:!1,root:s.target||d.$$.root};f&&f(g.root);let m=!1;if(g.ctx=a?a(t,s.props||{},((e,n,...r)=>{const o=r.length?r[0]:n;return g.ctx&&u(g.ctx[e],g.ctx[e]=o)&&(!g.skip_bound&&g.bound[e]&&g.bound[e](o),m&&I(t,e)),n})):[],g.update(),m=!0,o(g.before_update),
|
|
41
63
|
// `false` as a special case of no DOM component
|
|
42
|
-
|
|
64
|
+
g.fragment=!!l&&l(g.ctx),s.target){if(s.hydrate){const e=function(e){return Array.from(e.childNodes)}(s.target);
|
|
43
65
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
44
|
-
|
|
66
|
+
g.fragment&&g.fragment.l(e),e.forEach(c)}else
|
|
45
67
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
|
-
|
|
68
|
+
g.fragment&&g.fragment.c();s.intro&&((b=t.$$.fragment)&&b.i&&(N.delete(b),b.i(v))),function(e,t,r,s){const{fragment:a,after_update:l}=e.$$;a&&a.m(t,r),s||
|
|
47
69
|
// onMount happens before the initial afterUpdate
|
|
48
|
-
|
|
70
|
+
C((()=>{const t=e.$$.on_mount.map(n).filter(i);
|
|
71
|
+
// if the component was destroyed immediately
|
|
72
|
+
// it will update the `$$.on_destroy` reference to `null`.
|
|
73
|
+
// the destructured on_destroy may still reference to the old array
|
|
74
|
+
e.$$.on_destroy?e.$$.on_destroy.push(...t):
|
|
49
75
|
// Edge case - component was destroyed immediately,
|
|
50
76
|
// most likely as a result of a binding initialising
|
|
51
|
-
o(t),e.$$.on_mount=[]})),
|
|
77
|
+
o(t),e.$$.on_mount=[]})),l.forEach(C)}(t,s.target,s.anchor,s.customElement),P()}var b,v;E(d)}let D;"function"==typeof HTMLElement&&(D=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:e}=this.$$;this.$$.on_disconnect=e.map(n).filter(i);
|
|
52
78
|
// @ts-ignore todo: improve typings
|
|
53
79
|
for(const e in this.$$.slotted)
|
|
54
80
|
// @ts-ignore todo: improve typings
|
|
55
|
-
this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,n){this[e]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){
|
|
81
|
+
this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,n){this[e]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){O(this,1),this.$destroy=e}$on(t,n){
|
|
82
|
+
// TODO should this delegate to addEventListener?
|
|
83
|
+
if(!i(n))return e;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const e=r.indexOf(n);-1!==e&&r.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}});var x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function $(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}$((function(e,t){e.exports=function(){const e=e=>t[e]
|
|
84
|
+
/* eslint-disable quote-props */,t={AED:"د.إ",AFN:"؋",ALL:"L",AMD:"֏",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"ман",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BRL:"R$",BSD:"$",BTC:"฿",BTN:"Nu.",BWP:"P",BYR:"p.",BZD:"BZ$",CAD:"$",CDF:"FC",CHF:"CHF",CLP:"$",CNY:"¥",COP:"$",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"دج",EEK:"kr",EGP:"£",ERN:"Nfk",ETB:"Br",ETH:"Ξ",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GGP:"£",GHC:"₵",GHS:"GH₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"ع.د",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"J$",JOD:"JD",JPY:"¥",KES:"KSh",KGS:"лв",KHR:"៛",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"KD",KYD:"$",KZT:"лв",LAK:"₭",LBP:"£",LKR:"₨",LRD:"$",LSL:"M",LTC:"Ł",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MRO:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"﷼",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"Gs",QAR:"﷼",RMB:"¥",RON:"lei",RSD:"Дин.",RUB:"₽",RWF:"R₣",SAR:"﷼",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"$",SHP:"£",SLL:"Le",SOS:"S",SRD:"$",SSP:"£",STD:"Db",SVC:"$",SYP:"£",SZL:"E",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت",TOP:"T$",TRL:"₤",TRY:"₺",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"$",UYU:"$U",UZS:"лв",VEF:"Bs",VND:"₫",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"Ƀ",XCD:"$",XOF:"CFA",XPF:"₣",YER:"﷼",ZAR:"R",ZWD:"Z$"};function n(){}function r(e,t){
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
for(const n in t)e[n]=t[n];return e}function o(e){return e()}function i(){return Object.create(null)}function s(e){e.forEach(o)}function a(e){return"function"==typeof e}function l(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let c;function u(e,t){return c||(c=document.createElement("a")),c.href=t,e===c.href}function h(e,...t){if(null==e)return n;const r=e.subscribe(...t);return r.unsubscribe?()=>r.unsubscribe():r}const f=["",!0,1,"true","contenteditable"];function p(e,t){e.appendChild(t)}function d(e,t,n){e.insertBefore(t,n||null)}function g(e){e.parentNode&&e.parentNode.removeChild(e)}function m(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function b(e){return document.createElement(e)}function y(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function E(e){return document.createTextNode(e)}function v(){return E(" ")}function T(){return E("")}function B(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function _(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function w(e,t){
|
|
87
|
+
// @ts-ignore
|
|
88
|
+
const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const r in t)null==t[r]?e.removeAttribute(r):"style"===r?e.style.cssText=t[r]:"__value"===r?e.value=e[r]=t[r]:n[r]&&n[r].set?e[r]=t[r]:_(e,r,t[r])}function A(e,t){for(const n in t)_(e,n,t[n])}function H(e,t,n){t in e?e[t]="boolean"==typeof e[t]&&""===n||n:_(e,t,n)}function C(e,t){t=""+t,e.data!==t&&(e.data=t)}function S(e,t,n){~f.indexOf(n)?function(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}(e,t):C(e,t)}function L(e){const t={};for(const n of e)t[n.name]=n.value;return t}let P;function R(e){P=e}
|
|
89
|
+
/**
|
|
90
|
+
* The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
|
|
91
|
+
* It must be called during the component's initialisation (but doesn't need to live *inside* the component;
|
|
92
|
+
* it can be called from an external module).
|
|
93
|
+
*
|
|
94
|
+
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).
|
|
95
|
+
*
|
|
96
|
+
* https://svelte.dev/docs#run-time-svelte-onmount
|
|
97
|
+
*/function N(e){(function(){if(!P)throw new Error("Function called outside component initialization");return P})().$$.on_mount.push(e)}const O=[],I=[];let M=[];const D=[],$=Promise.resolve();let U=!1;function G(e){M.push(e)}
|
|
98
|
+
// flush() calls callbacks in this order:
|
|
99
|
+
// 1. All beforeUpdate callbacks, in order: parents before children
|
|
100
|
+
// 2. All bind:this callbacks, in reverse order: children before parents.
|
|
101
|
+
// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT
|
|
102
|
+
// for afterUpdates called during the initial onMount, which are called in
|
|
103
|
+
// reverse order: children before parents.
|
|
104
|
+
// Since callbacks might update component values, which could trigger another
|
|
105
|
+
// call to flush(), the following steps guard against this:
|
|
106
|
+
// 1. During beforeUpdate, any updated components will be added to the
|
|
107
|
+
// dirty_components array and will cause a reentrant call to flush(). Because
|
|
108
|
+
// the flush index is kept outside the function, the reentrant call will pick
|
|
109
|
+
// up where the earlier call left off and go through all dirty components. The
|
|
110
|
+
// current_component value is saved and restored so that the reentrant call will
|
|
111
|
+
// not interfere with the "parent" flush() call.
|
|
112
|
+
// 2. bind:this callbacks cannot trigger new flush() calls.
|
|
113
|
+
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
|
114
|
+
// callback called a second time; the seen_callbacks set, outside the flush()
|
|
115
|
+
// function, guarantees this behavior.
|
|
116
|
+
const k=new Set;let F=0;// Do *not* move this inside the flush() function
|
|
117
|
+
function j(){
|
|
118
|
+
// Do not reenter flush while dirty components are updated, as this can
|
|
119
|
+
// result in an infinite loop. Instead, let the inner flush handle it.
|
|
120
|
+
// Reentrancy is ok afterwards for bindings etc.
|
|
121
|
+
if(0!==F)return;const e=P;do{
|
|
122
|
+
// first, call beforeUpdate functions
|
|
123
|
+
// and update components
|
|
124
|
+
try{for(;F<O.length;){const e=O[F];F++,R(e),V(e.$$)}}catch(e){
|
|
125
|
+
// reset dirty state to not end up in a deadlocked state and then rethrow
|
|
126
|
+
throw O.length=0,F=0,e}for(R(null),O.length=0,F=0;I.length;)I.pop()();
|
|
127
|
+
// then, once components are updated, call
|
|
128
|
+
// afterUpdate functions. This may cause
|
|
129
|
+
// subsequent updates...
|
|
130
|
+
for(let e=0;e<M.length;e+=1){const t=M[e];k.has(t)||(
|
|
131
|
+
// ...so guard against infinite loops
|
|
132
|
+
k.add(t),t())}M.length=0}while(O.length);for(;D.length;)D.pop()();U=!1,k.clear(),R(e)}function V(e){if(null!==e.fragment){e.update(),s(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(G)}}
|
|
133
|
+
/**
|
|
134
|
+
* Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.
|
|
135
|
+
*/const K=new Set;function X(e,t){const n={},r={},o={$$scope:1};let i=e.length;for(;i--;){const s=e[i],a=t[i];if(a){for(const e in s)e in a||(r[e]=1);for(const e in a)o[e]||(n[e]=a[e],o[e]=1);e[i]=a}else for(const e in s)o[e]=1}for(const e in r)e in n||(n[e]=void 0);return n}function Z(e,t){const n=e.$$;null!==n.fragment&&(function(e){const t=[],n=[];M.forEach((r=>-1===e.indexOf(r)?t.push(r):n.push(r))),n.forEach((e=>e())),M=t}(n.after_update),s(n.on_destroy),n.fragment&&n.fragment.d(t),
|
|
56
136
|
// TODO null out other refs, including component.$$ (but need to
|
|
57
137
|
// preserve final state?)
|
|
58
|
-
n.on_destroy=n.fragment=null,n.ctx=[])}(
|
|
138
|
+
n.on_destroy=n.fragment=null,n.ctx=[])}function W(e,t){-1===e.$$.dirty[0]&&(O.push(e),U||(U=!0,$.then(j)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function z(e,t,r,l,c,u,h,f=[-1]){const p=P;R(e);const d=e.$$={fragment:null,ctx:[],
|
|
139
|
+
// state
|
|
140
|
+
props:u,update:n,not_equal:c,bound:i(),
|
|
141
|
+
// lifecycle
|
|
142
|
+
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(p?p.$$.context:[])),
|
|
143
|
+
// everything else
|
|
144
|
+
callbacks:i(),dirty:f,skip_bound:!1,root:t.target||p.$$.root};h&&h(d.root);let m=!1;if(d.ctx=r?r(e,t.props||{},((t,n,...r)=>{const o=r.length?r[0]:n;return d.ctx&&c(d.ctx[t],d.ctx[t]=o)&&(!d.skip_bound&&d.bound[t]&&d.bound[t](o),m&&W(e,t)),n})):[],d.update(),m=!0,s(d.before_update),
|
|
145
|
+
// `false` as a special case of no DOM component
|
|
146
|
+
d.fragment=!!l&&l(d.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);
|
|
147
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
148
|
+
d.fragment&&d.fragment.l(e),e.forEach(g)}else
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
150
|
+
d.fragment&&d.fragment.c();t.intro&&(b=e.$$.fragment)&&b.i&&(K.delete(b),b.i(y)),function(e,t,n,r){const{fragment:i,after_update:l}=e.$$;i&&i.m(t,n),r||
|
|
151
|
+
// onMount happens before the initial afterUpdate
|
|
152
|
+
G((()=>{const t=e.$$.on_mount.map(o).filter(a);
|
|
153
|
+
// if the component was destroyed immediately
|
|
154
|
+
// it will update the `$$.on_destroy` reference to `null`.
|
|
155
|
+
// the destructured on_destroy may still reference to the old array
|
|
156
|
+
e.$$.on_destroy?e.$$.on_destroy.push(...t):
|
|
157
|
+
// Edge case - component was destroyed immediately,
|
|
158
|
+
// most likely as a result of a binding initialising
|
|
159
|
+
s(t),e.$$.on_mount=[]})),l.forEach(G)}(e,t.target,t.anchor,t.customElement),j()}var b,y;R(p)}let Y;
|
|
160
|
+
/* ../casino-wagering-bonus-progress/src/CasinoWageringBonusProgress.svelte generated by Svelte v3.58.0 */function q(e){let t,o,i,s,a,l,c,u=[{class:"ring",r:/*radius*/e[2],cx:/*center*/e[7],cy:/*center*/e[7],"stroke-width":`${/*ringStrokeWidth*/e[4]}px`}],h={};for(let e=0;e<u.length;e+=1)h=r(h,u[e]);let f=[{class:"ring ring-progress "+(/*status*/e[1]===/*BonusStatus*/e[5].InProgress?"active":""),r:/*radius*/e[2],cx:/*center*/e[7],cy:/*center*/e[7],"stroke-width":`${/*ringStrokeWidth*/e[4]}px`,"stroke-dasharray":`${/*circumference*/e[6]} ${/*circumference*/e[6]}`,"stroke-dashoffset":/*circumference*/e[6]-Number(/*percent*/e[0])/100*/*circumference*/e[6]}],m={};for(let e=0;e<f.length;e+=1)m=r(m,f[e]);let b=[{class:"center "+(/*status*/e[1]===/*BonusStatus*/e[5].InProgress?"active":""),r:/*radius*/e[2]-/*ringStrokeWidth*/e[4]/2-3,cx:/*center*/e[7],cy:/*center*/e[7]}],v={};for(let e=0;e<b.length;e+=1)v=r(v,b[e]);let T=[{x:/*center*/e[7],y:/*center*/e[7]}],B={};for(let e=0;e<T.length;e+=1)B=r(B,T[e]);let _=[{width:/*size*/e[3],height:/*size*/e[3]}],w={};for(let e=0;e<_.length;e+=1)w=r(w,_[e]);return{c(){t=y("svg"),o=y("circle"),i=y("circle"),s=y("circle"),a=y("text"),l=E(/*percent*/e[0]),c=E("%"),this.c=n,A(o,h),A(i,m),A(s,v),A(a,B),A(t,w)},m(e,n){d(e,t,n),p(t,o),p(t,i),p(t,s),p(t,a),p(a,l),p(a,c)},p(e,[n]){A(o,h=X(u,[/*radius, center, ringStrokeWidth*/148&n&&{class:"ring",r:/*radius*/e[2],cx:/*center*/e[7],cy:/*center*/e[7],"stroke-width":`${/*ringStrokeWidth*/e[4]}px`}])),A(i,m=X(f,[/*status, BonusStatus, radius, center, ringStrokeWidth, circumference, percent*/247&n&&{class:"ring ring-progress "+(/*status*/e[1]===/*BonusStatus*/e[5].InProgress?"active":""),r:/*radius*/e[2],cx:/*center*/e[7],cy:/*center*/e[7],"stroke-width":`${/*ringStrokeWidth*/e[4]}px`,"stroke-dasharray":`${/*circumference*/e[6]} ${/*circumference*/e[6]}`,"stroke-dashoffset":/*circumference*/e[6]-Number(/*percent*/e[0])/100*/*circumference*/e[6]}])),A(s,v=X(b,[/*status, BonusStatus, radius, ringStrokeWidth, center*/182&n&&{class:"center "+(/*status*/e[1]===/*BonusStatus*/e[5].InProgress?"active":""),r:/*radius*/e[2]-/*ringStrokeWidth*/e[4]/2-3,cx:/*center*/e[7],cy:/*center*/e[7]}])),/*percent*/1&n&&S(l,/*percent*/e[0],B.contenteditable),A(a,B=X(T,[/*center*/128&n&&{x:/*center*/e[7],y:/*center*/e[7]}])),A(t,w=X(_,[/*size*/8&n&&{width:/*size*/e[3],height:/*size*/e[3]}]))},i:n,o:n,d(e){e&&g(t)}}}function J(e,t,n){let r,o,i,s,a,{percent:l=""}=t,{status:c=""}=t;var u;return function(e){e.BeforeClaimed="BeforeClaimed",e.InProgress="active",e.ForfeitedOrCompleted="ForfeitedOrCompleted"}(u||(u={})),e.$$set=e=>{"percent"in e&&n(0,l=e.percent),"status"in e&&n(1,c=e.status)},e.$$.update=()=>{/*size*/8&e.$$.dirty&&n(4,o=r/7.5),/*size, ringStrokeWidth*/24&e.$$.dirty&&n(2,i=r/2-o/2),/*size*/8&e.$$.dirty&&n(7,s=r/2),/*radius*/4&e.$$.dirty&&n(6,a=2*i*Math.PI)},n(3,r=200),[l,c,i,r,o,u,a,s]}"function"==typeof HTMLElement&&(Y=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:e}=this.$$;this.$$.on_disconnect=e.map(o).filter(a);
|
|
161
|
+
// @ts-ignore todo: improve typings
|
|
162
|
+
for(const e in this.$$.slotted)
|
|
163
|
+
// @ts-ignore todo: improve typings
|
|
164
|
+
this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,n){this[e]=n}disconnectedCallback(){s(this.$$.on_disconnect)}$destroy(){Z(this,1),this.$destroy=n}$on(e,t){
|
|
59
165
|
// TODO should this delegate to addEventListener?
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
166
|
+
if(!a(t))return n;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(t),()=>{const e=r.indexOf(t);-1!==e&&r.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}),!customElements.get("casino-wagering-bonus-progress")&&customElements.define("casino-wagering-bonus-progress",class extends Y{constructor(e){super();const t=document.createElement("style");t.textContent=':host{font-family:system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"}*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}text{fill:#FFFFFF;text-anchor:middle;dominant-baseline:middle;font-style:normal;font-weight:700;font-size:36px}circle.ring{stroke:#F2F4F6;fill:transparent}circle.ring-progress{transition:0.35s stroke-dashoffset;stroke:#C4C4C4;transform:rotate(-90deg);transform-origin:50% 50%}circle.ring-progress.active{stroke:#00AEEF}circle.center{fill:#C4C4C4}circle.center.active{fill:#00AEEF}',this.shadowRoot.appendChild(t),z(this,{target:this.shadowRoot,props:L(this.attributes),customElement:!0},J,q,l,{percent:0,status:1},null),e&&(e.target&&d(e.target,this,e.anchor),e.props&&(this.$set(e.props),j()))}static get observedAttributes(){return["percent","status"]}get percent(){return this.$$.ctx[0]}set percent(e){this.$$set({percent:e}),j()}get status(){return this.$$.ctx[1]}set status(e){this.$$set({status:e}),j()}});var Q="data:image/svg+xml,%3csvg width='25' height='25' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg clip-path='url(%23clip0_3490_338)'%3e %3cpath d='M12.5 0C5.60762 0 0 5.60762 0 12.5C0 19.3924 5.60762 25 12.5 25C19.3924 25 25 19.3924 25 12.5C25 5.60762 19.3924 0 12.5 0ZM12.5 23.4375C6.46896 23.4375 1.56251 18.531 1.56251 12.5C1.56251 6.46896 6.46896 1.56251 12.5 1.56251C18.531 1.56251 23.4375 6.46896 23.4375 12.5C23.4375 18.531 18.531 23.4375 12.5 23.4375V23.4375Z' fill='%2300AEEF'/%3e %3cpath d='M13.2813 4.6875H11.7188V12.8235L16.6351 17.7398L17.7399 16.6351L13.2813 12.1765V4.6875Z' fill='%2300AEEF'/%3e %3c/g%3e %3cdefs%3e %3cclipPath id='clip0_3490_338'%3e %3crect width='25' height='25' fill='white'/%3e %3c/clipPath%3e %3c/defs%3e%3c/svg%3e",ee="data:image/svg+xml,%3csvg width='26' height='25' viewBox='0 0 26 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_3490_603)'%3e%3cpath d='M12.502 0C5.60958 0 0.00195312 5.60762 0.00195312 12.5C0.00195312 19.3924 5.60958 25 12.502 25C19.3943 25 25.002 19.3924 25.002 12.5C25.002 5.60762 19.3943 0 12.502 0ZM12.502 23.4375C6.47091 23.4375 1.56446 18.531 1.56446 12.5C1.56446 6.46896 6.47091 1.56251 12.502 1.56251C18.533 1.56251 23.4394 6.46896 23.4394 12.5C23.4394 18.531 18.533 23.4375 12.502 23.4375Z' fill='black'/%3e%3cpath d='M13.2832 4.6875H11.7207V12.8235L16.6371 17.7398L17.7418 16.6351L13.2832 12.1765V4.6875Z' fill='black'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_3490_603'%3e%3crect width='25' height='25' fill='white' transform='translate(0.00195312)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",te="data:image/svg+xml,%3csvg width='25' height='25' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg clip-path='url(%23clip0_3490_347)'%3e %3cpath d='M12.5002 7.5C11.5797 7.5 10.8335 8.2462 10.8335 9.16667V23.3333C10.8335 24.2538 11.5797 25 12.5002 25C13.4206 25 14.1668 24.2538 14.1668 23.3333V9.16667C14.1668 8.2462 13.4206 7.5 12.5002 7.5ZM13.3335 23.3333C13.3335 23.7936 12.9604 24.1667 12.5002 24.1667C12.0399 24.1667 11.6668 23.7936 11.6668 23.3333V9.16667C11.6668 8.70641 12.0399 8.33333 12.5002 8.33333C12.9604 8.33333 13.3335 8.70641 13.3335 9.16667V23.3333Z' fill='%2300AEEF'/%3e %3cpath d='M7.08317 12.5C6.1627 12.5 5.4165 13.2462 5.4165 14.1667V23.3333C5.4165 24.2538 6.1627 25 7.08317 25C8.00364 25 8.74984 24.2538 8.74984 23.3333V14.1667C8.74984 13.2462 8.00364 12.5 7.08317 12.5ZM7.9165 23.3333C7.9165 23.7936 7.54343 24.1667 7.08317 24.1667C6.62291 24.1667 6.24984 23.7936 6.24984 23.3333V14.1667C6.24984 13.7064 6.62291 13.3333 7.08317 13.3333C7.54343 13.3333 7.9165 13.7064 7.9165 14.1667V23.3333Z' fill='%2300AEEF'/%3e %3cpath d='M1.66667 18.333C0.746198 18.333 0 19.0792 0 19.9997V23.333C0 24.2535 0.746198 24.9997 1.66667 24.9997C2.58714 24.9997 3.33333 24.2535 3.33333 23.333V19.9997C3.33333 19.0792 2.58714 18.333 1.66667 18.333ZM2.5 23.333C2.5 23.7933 2.12693 24.1663 1.66667 24.1663C1.20641 24.1663 0.833333 23.7933 0.833333 23.333V19.9997C0.833333 19.5394 1.20641 19.1663 1.66667 19.1663C2.12693 19.1663 2.5 19.5394 2.5 19.9997V23.333Z' fill='%2300AEEF'/%3e %3cpath d='M17.9167 2.5C16.9962 2.5 16.25 3.2462 16.25 4.16667V23.3333C16.25 24.2538 16.9962 25 17.9167 25C18.8371 25 19.5833 24.2538 19.5833 23.3333V4.16667C19.5833 3.2462 18.8371 2.5 17.9167 2.5ZM18.75 23.3333C18.75 23.7936 18.3769 24.1667 17.9167 24.1667C17.4564 24.1667 17.0833 23.7936 17.0833 23.3333V4.16667C17.0833 3.70641 17.4564 3.33333 17.9167 3.33333C18.3769 3.33333 18.75 3.70641 18.75 4.16667V23.3333Z' fill='%2300AEEF'/%3e %3cpath d='M23.3332 0C22.4127 0 21.6665 0.746198 21.6665 1.66667V23.3333C21.6665 24.2538 22.4127 25 23.3332 25C24.2536 25 24.9998 24.2538 24.9998 23.3333V1.66667C24.9998 0.746198 24.2536 0 23.3332 0ZM24.1665 23.3333C24.1665 23.7936 23.7934 24.1667 23.3332 24.1667C22.8729 24.1667 22.4998 23.7936 22.4998 23.3333V1.66667C22.4998 1.20641 22.8729 0.833333 23.3332 0.833333C23.7934 0.833333 24.1665 1.20641 24.1665 1.66667V23.3333Z' fill='%2300AEEF'/%3e %3c/g%3e %3cdefs%3e %3cclipPath id='clip0_3490_347'%3e %3crect width='25' height='25' fill='white'/%3e %3c/clipPath%3e %3c/defs%3e%3c/svg%3e";const ne=(e,t)=>({remainder:e%t,quotient:Math.floor(e/t)}),re=e=>{const t=new Date;return new Date(e).getTime()-t.getTime()},oe=e=>{const t=re(e)/6e4,{quotient:n,remainder:r}=ne(t,1440),{quotient:o,remainder:i}=ne(r,60);return[{value:n,symbol:"d"},{value:o,symbol:"h"},{value:Math.floor(i),symbol:"m"}].map((e=>{return t=e.value,(Math.abs(t)<10?`0${t}`:t)+e.symbol;var t})).join(" ")},ie=(e,t="")=>({part:e,class:[e,t].join(" ")}),se=async(e,t={})=>{let n;return n=await fetch(e,t),n=await n.json(),n
|
|
167
|
+
/******************************************************************************
|
|
168
|
+
Copyright (c) Microsoft Corporation.
|
|
169
|
+
|
|
170
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
171
|
+
purpose with or without fee is hereby granted.
|
|
172
|
+
|
|
173
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
174
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
175
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
176
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
177
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
178
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
179
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
180
|
+
***************************************************************************** */
|
|
181
|
+
/* global Reflect, Promise */};var ae=function(e,t){return ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ae(e,t)};function le(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ae(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ce,ue,he,fe,pe=function(){return pe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},pe.apply(this,arguments)};function de(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function ge(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}!function(e){e.claimable="claimable",e.active="active",e.completed="completed",e.forfeited="forfeited",e.expired="expired",e.released="released",e.closed="closed"}(ce||(ce={})),function(e){e.standard="standard",e.freeBet="freeBet",e.freeRound="freeRound",e.tournamentTicket="tournamentTicket",e.oddsBoost="oddsBoost",e.cashBack="cashBack"}(ue||(ue={})),function(e){e.Money="money",e.BetCount="betcount"}(he||(he={})),function(e){e.en="en",e["zh-hk"]="zh-hk"}(fe||(fe={}));var me="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==x?x:"undefined"!=typeof self?self:{};!function(e,t,n){e(n={path:void 0,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}((function(e,t){
|
|
182
|
+
/** @license
|
|
183
|
+
* eventsource.js
|
|
184
|
+
* Available under MIT License (MIT)
|
|
185
|
+
* https://github.com/Yaffle/EventSource/
|
|
186
|
+
*/
|
|
187
|
+
/*jslint indent: 2, vars: true, plusplus: true */
|
|
188
|
+
/*global setTimeout, clearTimeout */
|
|
189
|
+
!function(n){var r=n.setTimeout,o=n.clearTimeout,i=n.XMLHttpRequest,s=n.XDomainRequest,a=n.ActiveXObject,l=n.EventSource,c=n.document,u=n.Promise,h=n.fetch,f=n.Response,p=n.TextDecoder,d=n.TextEncoder,g=n.AbortController;
|
|
190
|
+
// see #118 (Promise#finally with polyfilled Promise)
|
|
191
|
+
// see #123 (data URLs crash Edge)
|
|
192
|
+
// see #125 (CSP violations)
|
|
193
|
+
// see pull/#138
|
|
194
|
+
// => No way to polyfill Promise#finally
|
|
195
|
+
if("undefined"==typeof window||void 0===c||"readyState"in c||null!=c.body||(// Firefox 2
|
|
196
|
+
c.readyState="loading",window.addEventListener("load",(function(e){c.readyState="complete"}),!1)),null==i&&null!=a&&(// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest_in_IE6
|
|
197
|
+
i=function(){return new a("Microsoft.XMLHTTP")}),null==Object.create&&(Object.create=function(e){function t(){}return t.prototype=e,new t}),Date.now||(Date.now=function(){return(new Date).getTime()}),null==g){var m=h;h=function(e,t){var n=t.signal;return m(e,{headers:t.headers,credentials:t.credentials,cache:t.cache}).then((function(e){var t=e.body.getReader();return n._reader=t,n._aborted&&n._reader.cancel(),{status:e.status,statusText:e.statusText,headers:e.headers,body:{getReader:function(){return t}}}}))},g=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){null!=this.signal._reader&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function b(){this.bitsNeeded=0,this.codePoint=0}b.prototype.decode=function(e){function t(e,t,n){if(1===n)return e>=128>>t&&e<<t<=2047;if(2===n)return e>=2048>>t&&e<<t<=55295||e>=57344>>t&&e<<t<=65535;if(3===n)return e>=65536>>t&&e<<t<=1114111;throw new Error}function n(e,t){if(6===e)return t>>6>15?3:t>31?2:1;if(12===e)return t>15?3:2;if(18===e)return 3;throw new Error}for(var r=65533,o="",i=this.bitsNeeded,s=this.codePoint,a=0;a<e.length;a+=1){var l=e[a];0!==i&&(l<128||l>191||!t(s<<6|63&l,i-6,n(i,s)))&&(i=0,s=r,o+=String.fromCharCode(s)),0===i?(l>=0&&l<=127?(i=0,s=l):l>=192&&l<=223?(i=6,s=31&l):l>=224&&l<=239?(i=12,s=15&l):l>=240&&l<=247?(i=18,s=7&l):(i=0,s=r),0===i||t(s,i,n(i,s))||(i=0,s=r)):(i-=6,s=s<<6|63&l),0===i&&(s<=65535?o+=String.fromCharCode(s):(o+=String.fromCharCode(55296+(s-65535-1>>10)),o+=String.fromCharCode(56320+(s-65535-1&1023))))}return this.bitsNeeded=i,this.codePoint=s,o},
|
|
198
|
+
// IE, Edge
|
|
199
|
+
null!=p&&null!=d&&function(){try{return"test"===(new p).decode((new d).encode("test"),{stream:!0})}catch(e){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+e)}return!1}()||(p=b);var y=function(){};function E(e){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=y,this.onload=y,this.onerror=y,this.onreadystatechange=y,this._contentType="",this._xhr=e,this._sendTimeout=0,this._abort=y}function v(e){return e.replace(/[A-Z]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+32)}))}function T(e){for(
|
|
200
|
+
// Get headers: implemented according to mozilla's example code: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders#Example
|
|
201
|
+
var t=Object.create(null),n=e.split("\r\n"),r=0;r<n.length;r+=1){var o=n[r].split(": "),i=o.shift(),s=o.join(": ");t[v(i)]=s}this._map=t}function B(){}function _(e){this._headers=e}function w(){}function A(){this._listeners=Object.create(null)}function H(e){r((function(){throw e}),0)}function C(e){this.type=e,this.target=void 0}function S(e,t){C.call(this,e),this.data=t.data,this.lastEventId=t.lastEventId}function L(e,t){C.call(this,e),this.status=t.status,this.statusText=t.statusText,this.headers=t.headers}function P(e,t){C.call(this,e),this.error=t.error}E.prototype.open=function(e,t){this._abort(!0);var n=this,s=this._xhr,a=1,l=0;this._abort=function(e){0!==n._sendTimeout&&(o(n._sendTimeout),n._sendTimeout=0),1!==a&&2!==a&&3!==a||(a=4,s.onload=y,s.onerror=y,s.onabort=y,s.onprogress=y,s.onreadystatechange=y,
|
|
202
|
+
// IE 8 - 9: XDomainRequest#abort() does not fire any event
|
|
203
|
+
// Opera < 10: XMLHttpRequest#abort() does not fire any event
|
|
204
|
+
s.abort(),0!==l&&(o(l),l=0),e||(n.readyState=4,n.onabort(null),n.onreadystatechange())),a=0};var c=function(){if(1===a){
|
|
205
|
+
//state = 2;
|
|
206
|
+
var e=0,t="",r=void 0;if("contentType"in s)e=200,t="OK",r=s.contentType;else try{e=s.status,t=s.statusText,r=s.getResponseHeader("Content-Type")}catch(n){
|
|
207
|
+
// IE < 10 throws exception for `xhr.status` when xhr.readyState === 2 || xhr.readyState === 3
|
|
208
|
+
// Opera < 11 throws exception for `xhr.status` when xhr.readyState === 2
|
|
209
|
+
// https://bugs.webkit.org/show_bug.cgi?id=29121
|
|
210
|
+
e=0,t="",r=void 0}0!==e&&(a=2,n.readyState=2,n.status=e,n.statusText=t,n._contentType=r,n.onreadystatechange())}},u=function(){if(c(),2===a||3===a){a=3;var e="";try{e=s.responseText}catch(e){
|
|
211
|
+
// IE 8 - 9 with XMLHttpRequest
|
|
212
|
+
}n.readyState=3,n.responseText=e,n.onprogress()}},h=function(e,t){if(null!=t&&null!=t.preventDefault||(t={preventDefault:y}),
|
|
213
|
+
// Firefox 52 fires "readystatechange" (xhr.readyState === 4) without final "readystatechange" (xhr.readyState === 3)
|
|
214
|
+
// IE 8 fires "onload" without "onprogress"
|
|
215
|
+
u(),1===a||2===a||3===a){if(a=4,0!==l&&(o(l),l=0),n.readyState=4,"load"===e)n.onload(t);else if("error"===e)n.onerror(t);else{if("abort"!==e)throw new TypeError;n.onabort(t)}n.onreadystatechange()}},f=function(){l=r((function(){f()}),500),3===s.readyState&&u()};
|
|
216
|
+
// XDomainRequest#abort removes onprogress, onerror, onload
|
|
217
|
+
"onload"in s&&(s.onload=function(e){h("load",e)}),"onerror"in s&&(s.onerror=function(e){h("error",e)}),
|
|
218
|
+
// improper fix to match Firefox behaviour, but it is better than just ignore abort
|
|
219
|
+
// see https://bugzilla.mozilla.org/show_bug.cgi?id=768596
|
|
220
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=880200
|
|
221
|
+
// https://code.google.com/p/chromium/issues/detail?id=153570
|
|
222
|
+
// IE 8 fires "onload" without "onprogress
|
|
223
|
+
"onabort"in s&&(s.onabort=function(e){h("abort",e)}),"onprogress"in s&&(s.onprogress=u),
|
|
224
|
+
// IE 8 - 9 (XMLHTTPRequest)
|
|
225
|
+
// Opera < 12
|
|
226
|
+
// Firefox < 3.5
|
|
227
|
+
// Firefox 3.5 - 3.6 - ? < 9.0
|
|
228
|
+
// onprogress is not fired sometimes or delayed
|
|
229
|
+
// see also #64 (significant lag in IE 11)
|
|
230
|
+
"onreadystatechange"in s&&(s.onreadystatechange=function(e){!function(e){null!=s&&(// Opera 12
|
|
231
|
+
4===s.readyState?"onload"in s&&"onerror"in s&&"onabort"in s||h(""===s.responseText?"error":"load",e):3===s.readyState?"onprogress"in s||// testing XMLHttpRequest#responseText too many times is too slow in IE 11
|
|
232
|
+
// and in Firefox 3.6
|
|
233
|
+
u():2===s.readyState&&c())}(e)}),!("contentType"in s)&&"ontimeout"in i.prototype||(t+=(-1===t.indexOf("?")?"?":"&")+"padding=true"),s.open(e,t,!0),"readyState"in s&&(
|
|
234
|
+
// workaround for Opera 12 issue with "progress" events
|
|
235
|
+
// #91 (XMLHttpRequest onprogress not fired for streaming response in Edge 14-15-?)
|
|
236
|
+
l=r((function(){f()}),0))},E.prototype.abort=function(){this._abort(!1)},E.prototype.getResponseHeader=function(e){return this._contentType},E.prototype.setRequestHeader=function(e,t){var n=this._xhr;"setRequestHeader"in n&&n.setRequestHeader(e,t)},E.prototype.getAllResponseHeaders=function(){
|
|
237
|
+
// XMLHttpRequest#getAllResponseHeaders returns null for CORS requests in Firefox 3.6.28
|
|
238
|
+
return null!=this._xhr.getAllResponseHeaders&&this._xhr.getAllResponseHeaders()||""},E.prototype.send=function(){
|
|
239
|
+
// loading indicator in Safari < ? (6), Chrome < 14, Firefox
|
|
240
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=736723
|
|
241
|
+
if("ontimeout"in i.prototype&&("sendAsBinary"in i.prototype||"mozAnon"in i.prototype)||null==c||null==c.readyState||"complete"===c.readyState){var e=this._xhr;
|
|
242
|
+
// withCredentials should be set after "open" for Safari and Chrome (< 19 ?)
|
|
243
|
+
"withCredentials"in e&&(e.withCredentials=this.withCredentials);try{
|
|
244
|
+
// xhr.send(); throws "Not enough arguments" in Firefox 3.0
|
|
245
|
+
e.send(void 0)}catch(e){
|
|
246
|
+
// Safari 5.1.7, Opera 12
|
|
247
|
+
throw e}}else{var t=this;t._sendTimeout=r((function(){t._sendTimeout=0,t.send()}),4)}},T.prototype.get=function(e){return this._map[v(e)]},null!=i&&null==i.HEADERS_RECEIVED&&(// IE < 9, Firefox 3.6
|
|
248
|
+
i.HEADERS_RECEIVED=2),B.prototype.open=function(e,t,n,r,o,s,a){e.open("GET",o);var l=0;for(var c in e.onprogress=function(){var t=e.responseText.slice(l);l+=t.length,n(t)},e.onerror=function(e){e.preventDefault(),r(new Error("NetworkError"))},e.onload=function(){r(null)},e.onabort=function(){r(null)},e.onreadystatechange=function(){if(e.readyState===i.HEADERS_RECEIVED){var n=e.status,r=e.statusText,o=e.getResponseHeader("Content-Type"),s=e.getAllResponseHeaders();t(n,r,o,new T(s))}},e.withCredentials=s,a)Object.prototype.hasOwnProperty.call(a,c)&&e.setRequestHeader(c,a[c]);return e.send(),e},_.prototype.get=function(e){return this._headers.get(e)},w.prototype.open=function(e,t,n,r,o,i,s){var a=null,l=new g,c=l.signal,f=new p;return h(o,{headers:s,credentials:i?"include":"same-origin",signal:c,cache:"no-store"}).then((function(e){
|
|
249
|
+
// see https://github.com/promises-aplus/promises-spec/issues/179
|
|
250
|
+
return a=e.body.getReader(),t(e.status,e.statusText,e.headers.get("Content-Type"),new _(e.headers)),new u((function(e,t){var r=function(){a.read().then((function(t){if(t.done)
|
|
251
|
+
//Note: bytes in textDecoder are ignored
|
|
252
|
+
e(void 0);else{var o=f.decode(t.value,{stream:!0});n(o),r()}})).catch((function(e){t(e)}))};r()}))})).catch((function(e){return"AbortError"===e.name?void 0:e})).then((function(e){r(e)})),{abort:function(){null!=a&&a.cancel(),l.abort()}}},A.prototype.dispatchEvent=function(e){e.target=this;var t=this._listeners[e.type];if(null!=t)for(var n=t.length,r=0;r<n;r+=1){var o=t[r];try{"function"==typeof o.handleEvent?o.handleEvent(e):o.call(this,e)}catch(e){H(e)}}},A.prototype.addEventListener=function(e,t){e=String(e);var n=this._listeners,r=n[e];null==r&&(r=[],n[e]=r);for(var o=!1,i=0;i<r.length;i+=1)r[i]===t&&(o=!0);o||r.push(t)},A.prototype.removeEventListener=function(e,t){e=String(e);var n=this._listeners,r=n[e];if(null!=r){for(var o=[],i=0;i<r.length;i+=1)r[i]!==t&&o.push(r[i]);0===o.length?delete n[e]:n[e]=o}},S.prototype=Object.create(C.prototype),L.prototype=Object.create(C.prototype),P.prototype=Object.create(C.prototype);var R=-1,N=0,O=1,I=2,M=-1,D=0,x=1,$=2,U=3,G=/^text\/event\-stream(;.*)?$/i,k=function(e,t){var n=null==e?t:parseInt(e,10);return n!=n&&(n=t),F(n)},F=function(e){return Math.min(Math.max(e,1e3),18e6)},j=function(e,t,n){try{"function"==typeof t&&t.call(e,n)}catch(e){H(e)}};function V(e,t){A.call(this),t=t||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,function(e,t,n){t=String(t);var a=Boolean(n.withCredentials),l=n.lastEventIdQueryParameterName||"lastEventId",c=F(1e3),u=k(n.heartbeatTimeout,45e3),h="",f=c,p=!1,d=0,g=n.headers||{},m=n.Transport,b=K&&null==m?void 0:new E(null!=m?new m:null!=i&&"withCredentials"in i.prototype||null==s?new i:new s),y=null!=m&&"string"!=typeof m?new m:null==b?new w:new B,v=void 0,T=0,_=R,A="",H="",C="",V="",X=D,Z=0,W=0,z=function(t,n,r,o){if(_===N)if(200===t&&null!=r&&G.test(r)){_=O,p=Date.now(),f=c,e.readyState=O;var i=new L("open",{status:t,statusText:n,headers:o});e.dispatchEvent(i),j(e,e.onopen,i)}else{var s="";200!==t?(n&&(n=n.replace(/\s+/g," ")),s="EventSource's response has a status "+t+" "+n+" that is not 200. Aborting the connection."):s="EventSource's response has a Content-Type specifying an unsupported type: "+(null==r?"-":r.replace(/\s+/g," "))+". Aborting the connection.",J(),i=new L("error",{status:t,statusText:n,headers:o}),e.dispatchEvent(i),j(e,e.onerror,i),console.error(s)}},Y=function(t){if(_===O){for(var n=-1,i=0;i<t.length;i+=1)(l=t.charCodeAt(i))!=="\n".charCodeAt(0)&&l!=="\r".charCodeAt(0)||(n=i);var s=(-1!==n?V:"")+t.slice(0,n+1);V=(-1===n?V:"")+t.slice(n+1),""!==t&&(p=Date.now(),d+=t.length);for(var a=0;a<s.length;a+=1){var l=s.charCodeAt(a);if(X===M&&l==="\n".charCodeAt(0))X=D;else if(X===M&&(X=D),l==="\r".charCodeAt(0)||l==="\n".charCodeAt(0)){if(X!==D){X===x&&(W=a+1);var g=s.slice(Z,W-1),m=s.slice(W+(W<a&&s.charCodeAt(W)===" ".charCodeAt(0)?1:0),a);"data"===g?(A+="\n",A+=m):"id"===g?H=m:"event"===g?C=m:"retry"===g?(c=k(m,c),f=c):"heartbeatTimeout"===g&&(u=k(m,u),0!==T&&(o(T),T=r((function(){Q()}),u)))}if(X===D){if(""!==A){h=H,""===C&&(C="message");var b=new S(C,{data:A.slice(1),lastEventId:H});if(e.dispatchEvent(b),"open"===C?j(e,e.onopen,b):"message"===C?j(e,e.onmessage,b):"error"===C&&j(e,e.onerror,b),_===I)return}A="",C=""}X=l==="\r".charCodeAt(0)?M:D}else X===D&&(Z=a,X=x),X===x?l===":".charCodeAt(0)&&(W=a+1,X=$):X===$&&(X=U)}}},q=function(t){if(_===O||_===N){_=R,0!==T&&(o(T),T=0),T=r((function(){Q()}),f),f=F(Math.min(16*c,2*f)),e.readyState=N;var n=new P("error",{error:t});e.dispatchEvent(n),j(e,e.onerror,n),null!=t&&console.error(t)}},J=function(){_=I,null!=v&&(v.abort(),v=void 0),0!==T&&(o(T),T=0),e.readyState=I},Q=function(){if(T=0,_===R){p=!1,d=0,T=r((function(){Q()}),u),_=N,A="",C="",H=h,V="",Z=0,W=0,X=D;
|
|
253
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=428916
|
|
254
|
+
// Request header field Last-Event-ID is not allowed by Access-Control-Allow-Headers.
|
|
255
|
+
var n=t;if("data:"!==t.slice(0,5)&&"blob:"!==t.slice(0,5)&&""!==h){
|
|
256
|
+
// Remove the lastEventId parameter if it's already part of the request URL.
|
|
257
|
+
var o=t.indexOf("?");n=-1===o?t:t.slice(0,o+1)+t.slice(o+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,(function(e,t){return t===l?"":e})),
|
|
258
|
+
// Append the current lastEventId to the request URL.
|
|
259
|
+
n+=(-1===t.indexOf("?")?"?":"&")+l+"="+encodeURIComponent(h)}var i=e.withCredentials,s={Accept:"text/event-stream"},a=e.headers;if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(s[c]=a[c]);try{v=y.open(b,z,Y,q,n,i,s)}catch(e){throw J(),e}}else if(p||null==v){var f=Math.max((p||Date.now())+u-Date.now(),1);p=!1,T=r((function(){Q()}),f)}else q(new Error("No activity within "+u+" milliseconds. "+(_===N?"No response received.":d+" chars received.")+" Reconnecting.")),null!=v&&(v.abort(),v=void 0)};e.url=t,e.readyState=N,e.withCredentials=a,e.headers=g,e._close=J,Q()}(this,e,t)}var K=null!=h&&null!=f&&"body"in f.prototype;V.prototype=Object.create(A.prototype),V.prototype.CONNECTING=N,V.prototype.OPEN=O,V.prototype.CLOSED=I,V.prototype.close=function(){this._close()},V.CONNECTING=N,V.OPEN=O,V.CLOSED=I,V.prototype.withCredentials=void 0;var X,Z=l;null==i||null!=l&&"withCredentials"in l.prototype||(
|
|
260
|
+
// Why replace a native EventSource ?
|
|
261
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=444328
|
|
262
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=831392
|
|
263
|
+
// https://code.google.com/p/chromium/issues/detail?id=260144
|
|
264
|
+
// https://code.google.com/p/chromium/issues/detail?id=225654
|
|
265
|
+
// ...
|
|
266
|
+
Z=V),X=function(e){e.EventSourcePolyfill=V,e.NativeEventSource=l,e.EventSource=Z}(t),void 0!==X&&(e.exports=X)}("undefined"==typeof globalThis?"undefined"!=typeof window?window:"undefined"!=typeof self?self:me:globalThis)}));const be=e=>window.postMessage(e,window.location.href),ye=e=>{const t=(n=e,e=>{Object.keys(n).map((t=>{if(e.data&&e.data.type==t){const r=de(e.data,["type"]);n[t](r)}}))});var n;N((()=>(window.addEventListener("message",t),()=>{window.removeEventListener("message",t)})))},Ee=(e,t)=>{switch(e){case ce.completed:case ce.released:case ce.expired:case ce.closed:case ce.forfeited:return t.other();case ce.active:return t.active();default:throw new Error(`unknown Bonus Status: ${e}`)}},ve=(e,t)=>{switch(e){case ce.completed:case ce.released:return t.completed();case ce.active:case ce.expired:case ce.closed:case ce.forfeited:return t.current();default:throw new Error(`unknown Bonus Status: ${e}`)}},Te=async(e,t,n,r)=>await se(e+"/bonus/claim",{method:"PUT",body:JSON.stringify({bonusCode:n,currency:r}),headers:{"x-SessionId":t,accept:"text/plain","Content-Type":"application/json-patch+json"}}),Be=(t,n)=>{switch(n.type){case ue.standard:case ue.freeBet:return((t,n)=>{let r;switch(n.type){case ue.standard:r="bonus money";break;case ue.freeBet:r="Free Bet"}const o=e(Object.keys(t.increment)[0]);return"percentage"===n.mode?`${100*n.bonusAmount}% up to ${o}${n.capAmount} ${r}`:"fixed"===n.mode?`${o}${n.bonusAmount} ${r}`:void 0})(t,n);case ue.freeRound:return`${n.freespinNumber} Free Spins`;case ue.tournamentTicket:return"Enroll to Tournament Ticket";case ue.oddsBoost:return"Enroll to Odds Boost";case ue.cashBack:return"Enroll to Cash Back"}},_e=(e,t,n)=>{var r;const o=(null===(r=e.wageringProgress)||void 0===r?void 0:r.currentLevel)-1,i=n.length-1,s=e=>e.filter((e=>e.index>=0&&e.index<=i)).map((e=>{const t=n[e.index];return{key:e.key,descriptions:t.bonuses.map((e=>Be(t,e)))}}))
|
|
267
|
+
// .map(line => `${line.key} Level: ${getTitleByIndex(line.index)}`);
|
|
268
|
+
return Ee(e.status,{active:()=>t!==ce.claimable?s([{key:"current",index:o},{key:"next",index:o+1}]):t===ce.claimable?s([{key:"first",index:0},{key:"next",index:1}]):void 0,other:()=>s([{key:"last",index:i},{key:"previous",index:i-1}])})},we=(t,n,r)=>{const{currency:o,currentLevelIncrement:i,gap:s,currentLevel:a}=t.wageringProgress,l=e(o),c=n[a-1];switch(r){case"target":switch(t.wageringType){case he.Money:return`Play for ${l}${i} in total`;case he.BetCount:return`Place ${i}/${null==c?void 0:c.maxContribution} bets of at least ${null==c?void 0:c.minStake} each`}case"remaining":switch(t.wageringType){case he.Money:return`Remaining: ${l}${s}`;case he.BetCount:return`Bets Remaining: ${s} bets`}case"got":const e=He(t);switch(t.wageringType){case he.Money:return`Wagered: ${l}${e}`;case he.BetCount:return`Bets Placed: ${e} bets`}}},Ae=(e,t)=>({target:()=>Ee(e.status,{active:()=>we(e,t,"target"),other:()=>`This bonus is ${e.status}`}),remaining:()=>we(e,t,"remaining"),got:()=>we(e,t,"got")}),He=e=>{if(!e.wageringProgress)return 0;const{currency:t,currentLevelIncrement:n,gap:r,currentLevel:o}=e.wageringProgress;return n-r},Ce=(e,t,n,r)=>{const o=re(e);o<0?n():(r(oe(e)),
|
|
269
|
+
// check if bonus will expire
|
|
270
|
+
o<t&&setTimeout((()=>{be({type:"OnWageringBonusExpired"})}),o))},Se=[];
|
|
271
|
+
/**
|
|
272
|
+
* Create a `Writable` store that allows both updating and reading by subscription.
|
|
273
|
+
* @param {*=}value initial value
|
|
274
|
+
* @param {StartStopNotifier=}start start and stop notifications for subscriptions
|
|
275
|
+
*/function Le(e,t=n){let r;const o=new Set;function i(t){if(l(e,t)&&(e=t,r)){// store is ready
|
|
276
|
+
const t=!Se.length;for(const t of o)t[1](),Se.push(t,e);if(t){for(let e=0;e<Se.length;e+=2)Se[e][0](Se[e+1]);Se.length=0}}}return{set:i,update:function(t){i(t(e))},subscribe:function(s,a=n){const l=[s,a];return o.add(l),1===o.size&&(r=t(i)||n),s(e),()=>{o.delete(l),0===o.size&&r&&(r(),r=null)}}}}function Pe(e,t,r){const o=!Array.isArray(e),i=o?[e]:e,l=t.length<2;return c=e=>{let r=!1;const c=[];let u=0,f=n;const p=()=>{if(u)return;f();const r=t(o?c[0]:c,e);l?e(r):f=a(r)?r:n},d=i.map(((e,t)=>h(e,(e=>{c[t]=e,u&=~(1<<t),r&&p()}),(()=>{u|=1<<t}))));return r=!0,p(),function(){s(d),f(),
|
|
277
|
+
// We need to set this to false because callbacks can still happen despite having unsubscribed:
|
|
278
|
+
// Callbacks might already be placed in the queue which doesn't know it should no longer
|
|
279
|
+
// invoke this derived store.
|
|
280
|
+
r=!1}},{subscribe:Le(r,c).subscribe};
|
|
281
|
+
/**
|
|
282
|
+
* Creates a `Readable` store that allows reading by subscription.
|
|
283
|
+
* @param value initial value
|
|
284
|
+
* @param {StartStopNotifier}start start and stop notifications for subscriptions
|
|
285
|
+
*/var c}var Re=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Ne}(e)}
|
|
286
|
+
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
|
287
|
+
(e)},Ne="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Oe(e,t){return!1!==t.clone&&t.isMergeableObject(e)?$e((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Ie(e,t,n){return e.concat(t).map((function(e){return Oe(e,n)}))}function Me(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function De(e,t){try{return t in e}catch(e){return!1}}
|
|
288
|
+
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
|
289
|
+
function xe(e,t,n){var r={};return n.isMergeableObject(e)&&Me(e).forEach((function(t){r[t]=Oe(e[t],n)})),Me(t).forEach((function(o){(function(e,t){return De(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t));// and also unsafe if they're nonenumerable.
|
|
290
|
+
})(e,o)||(De(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return $e;var n=t.customMerge(e);return"function"==typeof n?n:$e}(o,n)(e[o],t[o],n):r[o]=Oe(t[o],n))})),r}function $e(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Ie,n.isMergeableObject=n.isMergeableObject||Re,
|
|
291
|
+
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
|
292
|
+
// implementations can use it. The caller may not replace it.
|
|
293
|
+
n.cloneUnlessOtherwiseSpecified=Oe;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):xe(e,t,n):Oe(t,n)}$e.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return $e(e,n,t)}),{})};var Ue,Ge,ke,Fe=$e;
|
|
294
|
+
/**
|
|
295
|
+
* Type Guards
|
|
296
|
+
*/function je(e){return e.type===Ge.literal}function Ve(e){return e.type===Ge.argument}function Ke(e){return e.type===Ge.number}function Xe(e){return e.type===Ge.date}function Ze(e){return e.type===Ge.time}function We(e){return e.type===Ge.select}function ze(e){return e.type===Ge.plural}function Ye(e){return e.type===Ge.pound}function qe(e){return e.type===Ge.tag}function Je(e){return!(!e||"object"!=typeof e||e.type!==ke.number)}function Qe(e){return!(!e||"object"!=typeof e||e.type!==ke.dateTime)}
|
|
297
|
+
// @generated from regex-gen.ts
|
|
298
|
+
!function(e){
|
|
299
|
+
/** Argument is unclosed (e.g. `{0`) */
|
|
300
|
+
e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",
|
|
301
|
+
/** Argument is empty (e.g. `{}`). */
|
|
302
|
+
e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",
|
|
303
|
+
/** Argument is malformed (e.g. `{foo!}``) */
|
|
304
|
+
e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",
|
|
305
|
+
/** Expect an argument type (e.g. `{foo,}`) */
|
|
306
|
+
e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",
|
|
307
|
+
/** Unsupported argument type (e.g. `{foo,foo}`) */
|
|
308
|
+
e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",
|
|
309
|
+
/** Expect an argument style (e.g. `{foo, number, }`) */
|
|
310
|
+
e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",
|
|
311
|
+
/** The number skeleton is invalid. */
|
|
312
|
+
e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",
|
|
313
|
+
/** The date time skeleton is invalid. */
|
|
314
|
+
e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",
|
|
315
|
+
/** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */
|
|
316
|
+
e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",
|
|
317
|
+
/** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */
|
|
318
|
+
e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",
|
|
319
|
+
/** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */
|
|
320
|
+
e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",
|
|
321
|
+
/** Missing select argument options (e.g. `{foo, select}`) */
|
|
322
|
+
e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",
|
|
323
|
+
/** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */
|
|
324
|
+
e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",
|
|
325
|
+
/** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */
|
|
326
|
+
e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",
|
|
327
|
+
/** Expecting a selector in `select` argument (e.g `{foo, select}`) */
|
|
328
|
+
e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",
|
|
329
|
+
/** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */
|
|
330
|
+
e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",
|
|
331
|
+
/** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */
|
|
332
|
+
e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",
|
|
333
|
+
/**
|
|
334
|
+
* Expecting a message fragment after the `plural` or `selectordinal` selector
|
|
335
|
+
* (e.g. `{foo, plural, one}`)
|
|
336
|
+
*/
|
|
337
|
+
e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",
|
|
338
|
+
/** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */
|
|
339
|
+
e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",
|
|
340
|
+
/**
|
|
341
|
+
* Duplicate selectors in `plural` or `selectordinal` argument.
|
|
342
|
+
* (e.g. {foo, plural, one {#} one {#}})
|
|
343
|
+
*/
|
|
344
|
+
e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",
|
|
345
|
+
/** Duplicate selectors in `select` argument.
|
|
346
|
+
* (e.g. {foo, select, apple {apple} apple {apple}})
|
|
347
|
+
*/
|
|
348
|
+
e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",
|
|
349
|
+
/** Plural or select argument option must have `other` clause. */
|
|
350
|
+
e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",
|
|
351
|
+
/** The tag is malformed. (e.g. `<bold!>foo</bold!>) */
|
|
352
|
+
e[e.INVALID_TAG=23]="INVALID_TAG",
|
|
353
|
+
/** The tag name is invalid. (e.g. `<123>foo</123>`) */
|
|
354
|
+
e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",
|
|
355
|
+
/** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
|
|
356
|
+
e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",
|
|
357
|
+
/** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
|
|
358
|
+
e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(Ue||(Ue={})),function(e){
|
|
359
|
+
/**
|
|
360
|
+
* Raw text
|
|
361
|
+
*/
|
|
362
|
+
e[e.literal=0]="literal",
|
|
363
|
+
/**
|
|
364
|
+
* Variable w/o any format, e.g `var` in `this is a {var}`
|
|
365
|
+
*/
|
|
366
|
+
e[e.argument=1]="argument",
|
|
367
|
+
/**
|
|
368
|
+
* Variable w/ number format
|
|
369
|
+
*/
|
|
370
|
+
e[e.number=2]="number",
|
|
371
|
+
/**
|
|
372
|
+
* Variable w/ date format
|
|
373
|
+
*/
|
|
374
|
+
e[e.date=3]="date",
|
|
375
|
+
/**
|
|
376
|
+
* Variable w/ time format
|
|
377
|
+
*/
|
|
378
|
+
e[e.time=4]="time",
|
|
379
|
+
/**
|
|
380
|
+
* Variable w/ select format
|
|
381
|
+
*/
|
|
382
|
+
e[e.select=5]="select",
|
|
383
|
+
/**
|
|
384
|
+
* Variable w/ plural format
|
|
385
|
+
*/
|
|
386
|
+
e[e.plural=6]="plural",
|
|
387
|
+
/**
|
|
388
|
+
* Only possible within plural argument.
|
|
389
|
+
* This is the `#` symbol that will be substituted with the count.
|
|
390
|
+
*/
|
|
391
|
+
e[e.pound=7]="pound",
|
|
392
|
+
/**
|
|
393
|
+
* XML-like tag
|
|
394
|
+
*/
|
|
395
|
+
e[e.tag=8]="tag"}(Ge||(Ge={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(ke||(ke={}));var et=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,tt=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
396
|
+
/**
|
|
397
|
+
* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
398
|
+
* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js
|
|
399
|
+
* with some tweaks
|
|
400
|
+
*/
|
|
401
|
+
/**
|
|
402
|
+
* Parse Date time skeleton into Intl.DateTimeFormatOptions
|
|
403
|
+
* Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
404
|
+
* @public
|
|
405
|
+
* @param skeleton skeleton string
|
|
406
|
+
*/function nt(e){var t={};return e.replace(tt,(function(e){var n=e.length;switch(e[0]){
|
|
407
|
+
// Era
|
|
408
|
+
case"G":t.era=4===n?"long":5===n?"narrow":"short";break;
|
|
409
|
+
// Year
|
|
410
|
+
case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
|
|
411
|
+
// Quarter
|
|
412
|
+
case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
413
|
+
// Month
|
|
414
|
+
case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;
|
|
415
|
+
// Week
|
|
416
|
+
case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
417
|
+
// Weekday
|
|
418
|
+
case"E":t.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;
|
|
419
|
+
// Period
|
|
420
|
+
case"a":// AM, PM
|
|
421
|
+
t.hour12=!0;break;case"b":// am, pm, noon, midnight
|
|
422
|
+
case"B":// flexible day periods
|
|
423
|
+
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
424
|
+
// Hour
|
|
425
|
+
case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
|
426
|
+
// Minute
|
|
427
|
+
case"m":t.minute=["numeric","2-digit"][n-1];break;
|
|
428
|
+
// Second
|
|
429
|
+
case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
430
|
+
// Zone
|
|
431
|
+
case"z":// 1..3, 4: specific non-location format
|
|
432
|
+
t.timeZoneName=n<4?"short":"long";break;case"Z":// 1..3, 4, 5: The ISO8601 varios formats
|
|
433
|
+
case"O":// 1, 4: miliseconds in day short, long
|
|
434
|
+
case"v":// 1, 4: generic non-location format
|
|
435
|
+
case"V":// 1, 2, 3, 4: time zone ID or city
|
|
436
|
+
case"X":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
437
|
+
case"x":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
438
|
+
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}
|
|
439
|
+
// @generated from regex-gen.ts
|
|
440
|
+
var rt=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,ot=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,it=/^(@+)?(\+|#+)?[rs]?$/g,st=/(\*)(0+)|(#+)(0+)|(0+)/g,at=/^(0+)$/;function lt(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(it,(function(e,n,r){
|
|
441
|
+
// @@@ case
|
|
442
|
+
return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function ct(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function ut(e){
|
|
443
|
+
// Engineering
|
|
444
|
+
var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!at.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function ht(e){return ct(e)||{}}
|
|
445
|
+
/**
|
|
446
|
+
* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options
|
|
447
|
+
*/function ft(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=o.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=pe(pe(pe({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return pe(pe({},e),ht(t))}),{}));continue;case"engineering":t=pe(pe(pe({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return pe(pe({},e),ht(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;
|
|
448
|
+
// https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
|
|
449
|
+
case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;
|
|
450
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
451
|
+
case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(st,(function(e,n,r,o,i,s){if(n)t.minimumIntegerDigits=r.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}
|
|
452
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
453
|
+
if(at.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(ot.test(o.stem)){
|
|
454
|
+
// Precision
|
|
455
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision
|
|
456
|
+
// precision-integer case
|
|
457
|
+
if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(ot,(function(e,n,r,o,i,s){
|
|
458
|
+
// .000* case (before ICU67 it was .000+)
|
|
459
|
+
return"*"===r?t.minimumFractionDigits=n.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&s?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+s.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var i=o.options[0];
|
|
460
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
|
|
461
|
+
"w"===i?t=pe(pe({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=pe(pe({},t),lt(i)))}
|
|
462
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision
|
|
463
|
+
else if(it.test(o.stem))t=pe(pe({},t),lt(o.stem));else{var s=ct(o.stem);s&&(t=pe(pe({},t),s));var a=ut(o.stem);a&&(t=pe(pe({},t),a))}}return t}
|
|
464
|
+
// @generated from time-data-gen.ts
|
|
465
|
+
// prettier-ignore
|
|
466
|
+
var pt,dt={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};
|
|
467
|
+
/**
|
|
468
|
+
* Returns the best matching date time pattern if a date time skeleton
|
|
469
|
+
* pattern is provided with a locale. Follows the Unicode specification:
|
|
470
|
+
* https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns
|
|
471
|
+
* @param skeleton date time skeleton pattern that possibly includes j, J or C
|
|
472
|
+
* @param locale
|
|
473
|
+
*/
|
|
474
|
+
/**
|
|
475
|
+
* Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)
|
|
476
|
+
* of the given `locale` to the corresponding time pattern.
|
|
477
|
+
* @param locale
|
|
478
|
+
*/function gt(e){var t=e.hourCycle;if(void 0===t&&
|
|
479
|
+
// @ts-ignore hourCycle(s) is not identified yet
|
|
480
|
+
e.hourCycles&&
|
|
481
|
+
// @ts-ignore
|
|
482
|
+
e.hourCycles.length&&(
|
|
483
|
+
// @ts-ignore
|
|
484
|
+
t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}
|
|
485
|
+
// TODO: Once hourCycle is fully supported remove the following with data generation
|
|
486
|
+
var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(dt[n||""]||dt[r||""]||dt["".concat(r,"-001")]||dt["001"])[0]}var mt=new RegExp("^".concat(et.source,"*")),bt=new RegExp("".concat(et.source,"*$"));function yt(e,t){return{start:e,end:t}}
|
|
487
|
+
// #region Ponyfills
|
|
488
|
+
// Consolidate these variables up top for easier toggling during debugging
|
|
489
|
+
var Et=!!String.prototype.startsWith,vt=!!String.fromCodePoint,Tt=!!Object.fromEntries,Bt=!!String.prototype.codePointAt,_t=!!String.prototype.trimStart,wt=!!String.prototype.trimEnd,At=Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Ht=!0;try{
|
|
490
|
+
/**
|
|
491
|
+
* legacy Edge or Xbox One browser
|
|
492
|
+
* Unicode flag support: supported
|
|
493
|
+
* Pattern_Syntax support: not supported
|
|
494
|
+
* See https://github.com/formatjs/formatjs/issues/2822
|
|
495
|
+
*/
|
|
496
|
+
Ht="a"===(null===(pt=It("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===pt?void 0:pt[0])}catch(e){Ht=!1}var Ct,St=Et?// Native
|
|
497
|
+
function(e,t,n){return e.startsWith(t,n)}:// For IE11
|
|
498
|
+
function(e,t,n){return e.slice(n,n+t.length)===t},Lt=vt?String.fromCodePoint:// IE11
|
|
499
|
+
function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n,r="",o=e.length,i=0;o>i;){if((n=e[i++])>1114111)throw RangeError(n+" is not a valid code point");r+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return r},Pt=
|
|
500
|
+
// native
|
|
501
|
+
Tt?Object.fromEntries:// Ponyfill
|
|
502
|
+
function(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n],i=o[0],s=o[1];t[i]=s}return t},Rt=Bt?// Native
|
|
503
|
+
function(e,t){return e.codePointAt(t)}:// IE 11
|
|
504
|
+
function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,o=e.charCodeAt(t);return o<55296||o>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?o:r-56320+(o-55296<<10)+65536}},Nt=_t?// Native
|
|
505
|
+
function(e){return e.trimStart()}:// Ponyfill
|
|
506
|
+
function(e){return e.replace(mt,"")},Ot=wt?// Native
|
|
507
|
+
function(e){return e.trimEnd()}:// Ponyfill
|
|
508
|
+
function(e){return e.replace(bt,"")};
|
|
509
|
+
// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.
|
|
510
|
+
function It(e,t){return new RegExp(e,t)}
|
|
511
|
+
// #endregion
|
|
512
|
+
if(Ht){
|
|
513
|
+
// Native
|
|
514
|
+
var Mt=It("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Ct=function(e,t){var n;return Mt.lastIndex=t,null!==(n=Mt.exec(e)[1])&&void 0!==n?n:""}}else
|
|
515
|
+
// IE11
|
|
516
|
+
Ct=function(e,t){for(var n=[];;){var r=Rt(e,t);if(void 0===r||Ut(r)||Gt(r))break;n.push(r),t+=r>=65536?2:1}return Lt.apply(void 0,n)};var Dt=/** @class */function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var o=this.char();if(123/* `{` */===o){if((i=this.parseArgument(e,n)).err)return i;r.push(i.val)}else{if(125/* `}` */===o&&e>0)break;if(35/* `#` */!==o||"plural"!==t&&"selectordinal"!==t){if(60/* `<` */===o&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(Ue.UNMATCHED_CLOSING_TAG,yt(this.clonePosition(),this.clonePosition()))}if(60/* `<` */===o&&!this.ignoreTag&&xt(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;r.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;r.push(i.val)}}else{var s=this.clonePosition();this.bump(),r.push({type:Ge.pound,location:yt(s,this.clonePosition())})}}}return{val:r,err:null}},
|
|
517
|
+
/**
|
|
518
|
+
* A tag name must start with an ASCII lower/upper case letter. The grammar is based on the
|
|
519
|
+
* [custom element name][] except that a dash is NOT always mandatory and uppercase letters
|
|
520
|
+
* are accepted:
|
|
521
|
+
*
|
|
522
|
+
* ```
|
|
523
|
+
* tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "</" tagName (whitespace)* ">"
|
|
524
|
+
* tagName ::= [a-z] (PENChar)*
|
|
525
|
+
* PENChar ::=
|
|
526
|
+
* "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |
|
|
527
|
+
* [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |
|
|
528
|
+
* [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
|
|
529
|
+
* ```
|
|
530
|
+
*
|
|
531
|
+
* [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
|
|
532
|
+
* NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do
|
|
533
|
+
* since other tag-based engines like React allow it
|
|
534
|
+
*/
|
|
535
|
+
e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();// `<`
|
|
536
|
+
var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))
|
|
537
|
+
// Self closing tag
|
|
538
|
+
return{val:{type:Ge.literal,value:"<".concat(r,"/>"),location:yt(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var i=o.val,s=this.clonePosition();
|
|
539
|
+
// Expecting a close tag
|
|
540
|
+
if(this.bumpIf("</")){if(this.isEOF()||!xt(this.char()))return this.error(Ue.INVALID_TAG,yt(s,this.clonePosition()));var a=this.clonePosition();return r!==this.parseTagName()?this.error(Ue.UNMATCHED_CLOSING_TAG,yt(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:Ge.tag,value:r,children:i,location:yt(n,this.clonePosition())},err:null}:this.error(Ue.INVALID_TAG,yt(s,this.clonePosition())))}return this.error(Ue.UNCLOSED_TAG,yt(n,this.clonePosition()))}return this.error(Ue.INVALID_TAG,yt(n,this.clonePosition()))},
|
|
541
|
+
/**
|
|
542
|
+
* This method assumes that the caller has peeked ahead for the first tag character.
|
|
543
|
+
*/
|
|
544
|
+
e.prototype.parseTagName=function(){var e=this.offset();// the first tag name character
|
|
545
|
+
for(this.bump();!this.isEOF()&&$t(this.char());)this.bump();return this.message.slice(e,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(t);if(o)r+=o;else{var i=this.tryParseUnquoted(e,t);if(i)r+=i;else{var s=this.tryParseLeftAngleBracket();if(!s)break;r+=s}}}var a=yt(n,this.clonePosition());return{val:{type:Ge.literal,value:r,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60/* `<` */!==this.char()||!this.ignoreTag&&(xt(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e;
|
|
546
|
+
/** See `parseTag` function docs. */},
|
|
547
|
+
/**
|
|
548
|
+
* Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes
|
|
549
|
+
* a character that requires quoting (that is, "only where needed"), and works the same in
|
|
550
|
+
* nested messages as on the top level of the pattern. The new behavior is otherwise compatible.
|
|
551
|
+
*/
|
|
552
|
+
e.prototype.tryParseQuote=function(e){if(this.isEOF()||39/* `'` */!==this.char())return null;
|
|
553
|
+
// Parse escaped char following the apostrophe, or early return if there is no escaped char.
|
|
554
|
+
// Check if is valid escaped character
|
|
555
|
+
switch(this.peek()){case 39/* `'` */:
|
|
556
|
+
// double quote, should return as a single quote.
|
|
557
|
+
return this.bump(),this.bump(),"'";
|
|
558
|
+
// '{', '<', '>', '}'
|
|
559
|
+
case 123:case 60:case 62:case 125:break;case 35:// '#'
|
|
560
|
+
if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();// apostrophe
|
|
561
|
+
var t=[this.char()];// escaped char
|
|
562
|
+
// read chars until the optional closing apostrophe is found
|
|
563
|
+
for(this.bump();!this.isEOF();){var n=this.char();if(39/* `'` */===n){if(39/* `'` */!==this.peek()){
|
|
564
|
+
// Optional closing apostrophe.
|
|
565
|
+
this.bump();break}t.push(39),
|
|
566
|
+
// Bump one more time because we need to skip 2 characters.
|
|
567
|
+
this.bump()}else t.push(n);this.bump()}return Lt.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60/* `<` */===n||123/* `{` */===n||35/* `#` */===n&&("plural"===t||"selectordinal"===t)||125/* `}` */===n&&e>0?null:(this.bump(),Lt(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),// `{`
|
|
568
|
+
this.bumpSpace(),this.isEOF())return this.error(Ue.EXPECT_ARGUMENT_CLOSING_BRACE,yt(n,this.clonePosition()));if(125/* `}` */===this.char())return this.bump(),this.error(Ue.EMPTY_ARGUMENT,yt(n,this.clonePosition()));
|
|
569
|
+
// argument name
|
|
570
|
+
var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(Ue.MALFORMED_ARGUMENT,yt(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Ue.EXPECT_ARGUMENT_CLOSING_BRACE,yt(n,this.clonePosition()));switch(this.char()){
|
|
571
|
+
// Simple argument: `{name}`
|
|
572
|
+
case 125/* `}` */:// `}`
|
|
573
|
+
return this.bump(),{val:{type:Ge.argument,
|
|
574
|
+
// value does not include the opening and closing braces.
|
|
575
|
+
value:r,location:yt(n,this.clonePosition())},err:null};
|
|
576
|
+
// Argument with options: `{name, format, ...}`
|
|
577
|
+
case 44/* `,` */:return this.bump(),// `,`
|
|
578
|
+
this.bumpSpace(),this.isEOF()?this.error(Ue.EXPECT_ARGUMENT_CLOSING_BRACE,yt(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(Ue.MALFORMED_ARGUMENT,yt(n,this.clonePosition()))}},
|
|
579
|
+
/**
|
|
580
|
+
* Advance the parser until the end of the identifier, if it is currently on
|
|
581
|
+
* an identifier character. Return an empty string otherwise.
|
|
582
|
+
*/
|
|
583
|
+
e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=Ct(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:yt(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,r){var o,i=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();
|
|
584
|
+
// Parse this range:
|
|
585
|
+
// {name, type, style}
|
|
586
|
+
// ^---^
|
|
587
|
+
switch(s){case"":
|
|
588
|
+
// Expecting a style string number, date, time, plural, selectordinal, or select.
|
|
589
|
+
return this.error(Ue.EXPECT_ARGUMENT_TYPE,yt(i,a));case"number":case"date":case"time":
|
|
590
|
+
// Parse this range:
|
|
591
|
+
// {name, number, style}
|
|
592
|
+
// ^-------^
|
|
593
|
+
this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((b=this.parseSimpleArgStyleIfPossible()).err)return b;if(0===(p=Ot(b.val)).length)return this.error(Ue.EXPECT_ARGUMENT_STYLE,yt(this.clonePosition(),this.clonePosition()));l={style:p,styleLocation:yt(c,this.clonePosition())}}if((y=this.tryParseArgumentClose(r)).err)return y;var u=yt(r,this.clonePosition());
|
|
594
|
+
// Extract style or skeleton
|
|
595
|
+
if(l&&St(null==l?void 0:l.style,"::",0)){
|
|
596
|
+
// Skeleton starts with `::`.
|
|
597
|
+
var h=Nt(l.style.slice(2));if("number"===s)return(b=this.parseNumberSkeletonFromString(h,l.styleLocation)).err?b:{val:{type:Ge.number,value:n,location:u,style:b.val},err:null};if(0===h.length)return this.error(Ue.EXPECT_DATE_TIME_SKELETON,u);var f=h;
|
|
598
|
+
// Get "best match" pattern only if locale is passed, if not, let it
|
|
599
|
+
// pass as-is where `parseDateTimeSkeleton()` will throw an error
|
|
600
|
+
// for unsupported patterns.
|
|
601
|
+
this.locale&&(f=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e.charAt(r);if("j"===o){for(var i=0;r+1<e.length&&e.charAt(r+1)===o;)i++,r++;var s=1+(1&i),a=i<2?1:3+(i>>1),l=gt(t);for("H"!=l&&"k"!=l||(a=0);a-- >0;)n+="a";for(;s-- >0;)n=l+n}else n+="J"===o?"H":o}return n}(h,this.locale));var p={type:ke.dateTime,pattern:f,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?nt(f):{}};return{val:{type:"date"===s?Ge.date:Ge.time,value:n,location:u,style:p},err:null}}
|
|
602
|
+
// Regular style or no style.
|
|
603
|
+
return{val:{type:"number"===s?Ge.number:"date"===s?Ge.date:Ge.time,value:n,location:u,style:null!==(o=null==l?void 0:l.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":
|
|
604
|
+
// Parse this range:
|
|
605
|
+
// {name, plural, options}
|
|
606
|
+
// ^---------^
|
|
607
|
+
var d=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Ue.EXPECT_SELECT_ARGUMENT_OPTIONS,yt(d,pe({},d)));this.bumpSpace();
|
|
608
|
+
// Parse offset:
|
|
609
|
+
// {name, plural, offset:1, options}
|
|
610
|
+
// ^-----^
|
|
611
|
+
// or the first option:
|
|
612
|
+
// {name, plural, one {...} other {...}}
|
|
613
|
+
// ^--^
|
|
614
|
+
var g=this.parseIdentifierIfPossible(),m=0;if("select"!==s&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(Ue.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,yt(this.clonePosition(),this.clonePosition()));var b;if(this.bumpSpace(),(b=this.tryParseDecimalInteger(Ue.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Ue.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return b;
|
|
615
|
+
// Parse another identifier for option parsing
|
|
616
|
+
this.bumpSpace(),g=this.parseIdentifierIfPossible(),m=b.val}var y,E=this.tryParsePluralOrSelectOptions(e,s,t,g);if(E.err)return E;if((y=this.tryParseArgumentClose(r)).err)return y;var v=yt(r,this.clonePosition());return"select"===s?{val:{type:Ge.select,value:n,options:Pt(E.val),location:v},err:null}:{val:{type:Ge.plural,value:n,options:Pt(E.val),offset:m,pluralType:"plural"===s?"cardinal":"ordinal",location:v},err:null};default:return this.error(Ue.INVALID_ARGUMENT_TYPE,yt(i,a))}},e.prototype.tryParseArgumentClose=function(e){
|
|
617
|
+
// Parse: {value, number, ::currency/GBP }
|
|
618
|
+
return this.isEOF()||125/* `}` */!==this.char()?this.error(Ue.EXPECT_ARGUMENT_CLOSING_BRACE,yt(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},
|
|
619
|
+
/**
|
|
620
|
+
* See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659
|
|
621
|
+
*/
|
|
622
|
+
e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();)switch(this.char()){case 39/* `'` */:
|
|
623
|
+
// Treat apostrophe as quoting but include it in the style part.
|
|
624
|
+
// Find the end of the quoted literal text.
|
|
625
|
+
this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Ue.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,yt(n,this.clonePosition()));this.bump();break;case 123/* `{` */:e+=1,this.bump();break;case 125/* `}` */:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");
|
|
626
|
+
// Parse the skeleton
|
|
627
|
+
for(var t=[],n=0,r=e.split(rt).filter((function(e){return e.length>0}));n<r.length;n++){var o=r[n].split("/");if(0===o.length)throw new Error("Invalid number skeleton");for(var i=o[0],s=o.slice(1),a=0,l=s;a<l.length;a++)if(0===l[a].length)throw new Error("Invalid number skeleton");t.push({stem:i,options:s})}return t}(e)}catch(e){return this.error(Ue.INVALID_NUMBER_SKELETON,t)}return{val:{type:ke.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?ft(n):{}},err:null}},
|
|
628
|
+
/**
|
|
629
|
+
* @param nesting_level The current nesting level of messages.
|
|
630
|
+
* This can be positive when parsing message fragment in select or plural argument options.
|
|
631
|
+
* @param parent_arg_type The parent argument's type.
|
|
632
|
+
* @param parsed_first_identifier If provided, this is the first identifier-like selector of
|
|
633
|
+
* the argument. It is a by-product of a previous parsing attempt.
|
|
634
|
+
* @param expecting_close_tag If true, this message is directly or indirectly nested inside
|
|
635
|
+
* between a pair of opening and closing tags. The nested message will not parse beyond
|
|
636
|
+
* the closing tag boundary.
|
|
637
|
+
*/
|
|
638
|
+
e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){
|
|
639
|
+
// Parse:
|
|
640
|
+
// one {one apple}
|
|
641
|
+
// ^--^
|
|
642
|
+
for(var o,i=!1,s=[],a=new Set,l=r.value,c=r.location;;){if(0===l.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;
|
|
643
|
+
// Try parse `={number}` selector
|
|
644
|
+
var h=this.tryParseDecimalInteger(Ue.EXPECT_PLURAL_ARGUMENT_SELECTOR,Ue.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;c=yt(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}
|
|
645
|
+
// Duplicate selector clauses
|
|
646
|
+
if(a.has(l))return this.error("select"===t?Ue.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Ue.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===l&&(i=!0),
|
|
647
|
+
// Parse:
|
|
648
|
+
// one {one apple}
|
|
649
|
+
// ^----------^
|
|
650
|
+
this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?Ue.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Ue.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,yt(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(e+1,t,n);if(p.err)return p;var d=this.tryParseArgumentClose(f);if(d.err)return d;s.push([l,{value:p.val,location:yt(f,this.clonePosition())}]),
|
|
651
|
+
// Keep track of the existing selectors
|
|
652
|
+
a.add(l),
|
|
653
|
+
// Prep next selector clause.
|
|
654
|
+
this.bumpSpace(),l=(o=this.parseIdentifierIfPossible()).value,c=o.location}return 0===s.length?this.error("select"===t?Ue.EXPECT_SELECT_ARGUMENT_SELECTOR:Ue.EXPECT_PLURAL_ARGUMENT_SELECTOR,yt(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(Ue.MISSING_OTHER_CLAUSE,yt(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,i=0;!this.isEOF();){var s=this.char();if(!(s>=48/* `0` */&&s<=57/* `9` */))break;o=!0,i=10*i+(s-48),this.bump()}var a=yt(r,this.clonePosition());return o?At(i*=n)?{val:i,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){
|
|
655
|
+
// This is much faster than `Object.assign` or spread.
|
|
656
|
+
return{offset:this.position.offset,line:this.position.line,column:this.position.column}},
|
|
657
|
+
/**
|
|
658
|
+
* Return the code point at the current position of the parser.
|
|
659
|
+
* Throws if the index is out of bound.
|
|
660
|
+
*/
|
|
661
|
+
e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Rt(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},
|
|
662
|
+
/** Bump the parser to the next UTF-16 code unit. */
|
|
663
|
+
e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10/* '\n' */===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,
|
|
664
|
+
// 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.
|
|
665
|
+
this.position.offset+=e<65536?1:2)}},
|
|
666
|
+
/**
|
|
667
|
+
* If the substring starting at the current position of the parser has
|
|
668
|
+
* the given prefix, then bump the parser to the character immediately
|
|
669
|
+
* following the prefix and return true. Otherwise, don't bump the parser
|
|
670
|
+
* and return false.
|
|
671
|
+
*/
|
|
672
|
+
e.prototype.bumpIf=function(e){if(St(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},
|
|
673
|
+
/**
|
|
674
|
+
* Bump the parser until the pattern character is found and return `true`.
|
|
675
|
+
* Otherwise bump to the end of the file and return `false`.
|
|
676
|
+
*/
|
|
677
|
+
e.prototype.bumpUntil=function(e){var t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},
|
|
678
|
+
/**
|
|
679
|
+
* Bump the parser to the target offset.
|
|
680
|
+
* If target offset is beyond the end of the input, bump the parser to the end of the input.
|
|
681
|
+
*/
|
|
682
|
+
e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},
|
|
683
|
+
/** advance the parser through all whitespace to the next non-whitespace code unit. */
|
|
684
|
+
e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Ut(this.char());)this.bump()},
|
|
685
|
+
/**
|
|
686
|
+
* Peek at the *next* Unicode codepoint in the input without advancing the parser.
|
|
687
|
+
* If the input has been exhausted, then this returns null.
|
|
688
|
+
*/
|
|
689
|
+
e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();
|
|
690
|
+
/**
|
|
691
|
+
* This check if codepoint is alphabet (lower & uppercase)
|
|
692
|
+
* @param codepoint
|
|
693
|
+
* @returns
|
|
694
|
+
*/function xt(e){return e>=97&&e<=122||e>=65&&e<=90}function $t(e){return 45/* '-' */===e||46/* '.' */===e||e>=48&&e<=57/* 0..9 */||95/* '_' */===e||e>=97&&e<=122/** a..z */||e>=65&&e<=90/* A..Z */||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}
|
|
695
|
+
/**
|
|
696
|
+
* Code point equivalent of regex `\p{White_Space}`.
|
|
697
|
+
* From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
|
698
|
+
*/function Ut(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}
|
|
699
|
+
/**
|
|
700
|
+
* Code point equivalent of regex `\p{Pattern_Syntax}`.
|
|
701
|
+
* See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
|
702
|
+
*/function Gt(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function kt(e){e.forEach((function(e){if(delete e.location,We(e)||ze(e))for(var t in e.options)delete e.options[t].location,kt(e.options[t].value);else Ke(e)&&Je(e.style)||(Xe(e)||Ze(e))&&Qe(e.style)?delete e.style.location:qe(e)&&kt(e.children)}))}function Ft(e,t){void 0===t&&(t={}),t=pe({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Dt(e,t).parse();if(n.err){var r=SyntaxError(Ue[n.err.kind]);
|
|
703
|
+
// @ts-expect-error Assign to error object
|
|
704
|
+
throw r.location=n.err.location,
|
|
705
|
+
// @ts-expect-error Assign to error object
|
|
706
|
+
r.originalMessage=n.err.message,r}return(null==t?void 0:t.captureLocation)||kt(n.val),n.val}
|
|
707
|
+
// Main
|
|
708
|
+
function jt(e,t){var n=t&&t.cache?t.cache:qt,r=t&&t.serializer?t.serializer:Wt;return(t&&t.strategy?t.strategy:Zt)(e,{cache:n,serializer:r})}
|
|
709
|
+
// Strategy
|
|
710
|
+
function Vt(e,t,n,r){var o,i=null==(o=r)||"number"==typeof o||"boolean"==typeof o?r:n(r),s=t.get(i);return void 0===s&&(s=e.call(this,r),t.set(i,s)),s}function Kt(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),i=t.get(o);return void 0===i&&(i=e.apply(this,r),t.set(o,i)),i}function Xt(e,t,n,r,o){return n.bind(t,e,r,o)}function Zt(e,t){return Xt(e,this,1===e.length?Vt:Kt,t.cache.create(),t.serializer)}
|
|
711
|
+
// Serializer
|
|
712
|
+
var Wt=function(){return JSON.stringify(arguments)};
|
|
713
|
+
// Cache
|
|
714
|
+
function zt(){this.cache=Object.create(null)}zt.prototype.get=function(e){return this.cache[e]},zt.prototype.set=function(e,t){this.cache[e]=t};var Yt,qt={create:function(){
|
|
715
|
+
// @ts-ignore
|
|
716
|
+
return new zt}},Jt={variadic:function(e,t){return Xt(e,this,Kt,t.cache.create(),t.serializer)},monadic:function(e,t){return Xt(e,this,Vt,t.cache.create(),t.serializer)}};!function(e){
|
|
717
|
+
// When we have a placeholder but no value to format
|
|
718
|
+
e.MISSING_VALUE="MISSING_VALUE",
|
|
719
|
+
// When value supplied is invalid
|
|
720
|
+
e.INVALID_VALUE="INVALID_VALUE",
|
|
721
|
+
// When we need specific Intl API but it's not available
|
|
722
|
+
e.MISSING_INTL_API="MISSING_INTL_API"}(Yt||(Yt={}));var Qt,en=/** @class */function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return le(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),tn=/** @class */function(e){function t(t,n,r,o){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),Yt.INVALID_VALUE,o)||this}return le(t,e),t}(en),nn=/** @class */function(e){function t(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),Yt.INVALID_VALUE,r)||this}return le(t,e),t}(en),rn=/** @class */function(e){function t(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),Yt.MISSING_VALUE,n)||this}return le(t,e),t}(en);function on(e){return"function"==typeof e}
|
|
723
|
+
// TODO(skeleton): add skeleton support
|
|
724
|
+
function sn(e,t,n,r,o,i,
|
|
725
|
+
// For debugging
|
|
726
|
+
s){
|
|
727
|
+
// Hot path for straight simple msg translations
|
|
728
|
+
if(1===e.length&&je(e[0]))return[{type:Qt.literal,value:e[0].value}];for(var a=[],l=0,c=e;l<c.length;l++){var u=c[l];
|
|
729
|
+
// Exit early for string parts.
|
|
730
|
+
if(je(u))a.push({type:Qt.literal,value:u.value});else
|
|
731
|
+
// TODO: should this part be literal type?
|
|
732
|
+
// Replace `#` in plural rules with the actual numeric value.
|
|
733
|
+
if(Ye(u))"number"==typeof i&&a.push({type:Qt.literal,value:n.getNumberFormat(t).format(i)});else{var h=u.value;
|
|
734
|
+
// Enforce that all required values are provided by the caller.
|
|
735
|
+
if(!o||!(h in o))throw new rn(h,s);var f=o[h];if(Ve(u))f&&"string"!=typeof f&&"number"!=typeof f||(f="string"==typeof f||"number"==typeof f?String(f):""),a.push({type:"string"==typeof f?Qt.literal:Qt.object,value:f});else
|
|
736
|
+
// Recursively format plural and select parts' option — which can be a
|
|
737
|
+
// nested pattern structure. The choosing of the option to use is
|
|
738
|
+
// abstracted-by and delegated-to the part helper object.
|
|
739
|
+
if(Xe(u)){var p="string"==typeof u.style?r.date[u.style]:Qe(u.style)?u.style.parsedOptions:void 0;a.push({type:Qt.literal,value:n.getDateTimeFormat(t,p).format(f)})}else if(Ze(u))p="string"==typeof u.style?r.time[u.style]:Qe(u.style)?u.style.parsedOptions:r.time.medium,a.push({type:Qt.literal,value:n.getDateTimeFormat(t,p).format(f)});else if(Ke(u))(p="string"==typeof u.style?r.number[u.style]:Je(u.style)?u.style.parsedOptions:void 0)&&p.scale&&(f*=p.scale||1),a.push({type:Qt.literal,value:n.getNumberFormat(t,p).format(f)});else{if(qe(u)){var d=u.children,g=u.value,m=o[g];if(!on(m))throw new nn(g,"function",s);var b=m(sn(d,t,n,r,o,i).map((function(e){return e.value})));Array.isArray(b)||(b=[b]),a.push.apply(a,b.map((function(e){return{type:"string"==typeof e?Qt.literal:Qt.object,value:e}})))}if(We(u)){if(!(y=u.options[f]||u.options.other))throw new tn(u.value,f,Object.keys(u.options),s);a.push.apply(a,sn(y.value,t,n,r,o))}else if(ze(u)){var y;if(!(y=u.options["=".concat(f)])){if(!Intl.PluralRules)throw new en('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Yt.MISSING_INTL_API,s);var E=n.getPluralRules(t,{type:u.pluralType}).select(f-(u.offset||0));y=u.options[E]||u.options.other}if(!y)throw new tn(u.value,f,Object.keys(u.options),s);a.push.apply(a,sn(y.value,t,n,r,o,f-(u.offset||0)))}}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var n=e[e.length-1];return n&&n.type===Qt.literal&&t.type===Qt.literal?n.value+=t.value:e.push(t),e}),[])}(a)}
|
|
740
|
+
/*
|
|
741
|
+
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
742
|
+
Copyrights licensed under the New BSD License.
|
|
743
|
+
See the accompanying LICENSE file for terms.
|
|
744
|
+
*/
|
|
745
|
+
// -- MessageFormat --------------------------------------------------------
|
|
746
|
+
function an(e,t){return t?Object.keys(e).reduce((function(n,r){var o,i;return n[r]=(o=e[r],(i=t[r])?pe(pe(pe({},o||{}),i||{}),Object.keys(o).reduce((function(e,t){return e[t]=pe(pe({},o[t]),i[t]||{}),e}),{})):o),n}),pe({},e)):e}function ln(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(Qt||(Qt={}));var cn=/** @class */function(){function e(t,n,r,o){var i,s=this;if(void 0===n&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=s.formatToParts(e);
|
|
747
|
+
// Hot path for straight simple msg translations
|
|
748
|
+
if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===Qt.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(e){return sn(s.ast,s.locales,s.formatters,s.formats,e,void 0,s.message)},this.resolvedOptions=function(){return{locale:s.resolvedLocale.toString()}},this.getAst=function(){return s.ast},
|
|
749
|
+
// Defined first because it's used to build the format pattern.
|
|
750
|
+
this.locales=n,this.resolvedLocale=e.resolveLocale(n),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
751
|
+
// Parse string messages into an AST.
|
|
752
|
+
this.ast=e.__parse(t,{ignoreTag:null==o?void 0:o.ignoreTag,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");
|
|
753
|
+
// Creates a new object with the specified `formats` merged with the default
|
|
754
|
+
// formats.
|
|
755
|
+
this.formats=an(e.formats,r),this.formatters=o&&o.formatters||(void 0===(i=this.formatterCache)&&(i={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:jt((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.NumberFormat).bind.apply(e,ge([void 0],t,!1)))}),{cache:ln(i.number),strategy:Jt.variadic}),getDateTimeFormat:jt((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.DateTimeFormat).bind.apply(e,ge([void 0],t,!1)))}),{cache:ln(i.dateTime),strategy:Jt.variadic}),getPluralRules:jt((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.PluralRules).bind.apply(e,ge([void 0],t,!1)))}),{cache:ln(i.pluralRules),strategy:Jt.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])},e.__parse=Ft,
|
|
756
|
+
// Default format options used as the prototype of the `formats` provided to the
|
|
757
|
+
// constructor. These are used when constructing the internal Intl.NumberFormat
|
|
758
|
+
// and Intl.DateTimeFormat instances.
|
|
759
|
+
e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}(),un=cn;
|
|
760
|
+
/*
|
|
761
|
+
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
762
|
+
Copyrights licensed under the New BSD License.
|
|
763
|
+
See the accompanying LICENSE file for terms.
|
|
764
|
+
*/const hn={},fn=(e,t,n)=>n?(t in hn||(hn[t]={}),e in hn[t]||(hn[t][e]=n),n):n,pn=(e,t)=>{if(null==t)return;if(t in hn&&e in hn[t])return hn[t][e];const n=Pn(t);for(let r=0;r<n.length;r++){const o=bn(n[r],e);if(o)return fn(e,t,o)}};let dn;const gn=Le({});function mn(e){return e in dn}function bn(e,t){if(!mn(e))return null;const n=function(e){return dn[e]||null}(e);return function(e,t){if(null==t)return;if(t in e)return e[t];const n=t.split(".");let r=e;for(let e=0;e<n.length;e++)if("object"==typeof r){if(e>0){const t=n.slice(e,n.length).join(".");if(t in r){r=r[t];break}}r=r[n[e]]}else r=void 0;return r}(n,t)}function yn(e,...t){delete hn[e],gn.update((n=>(n[e]=Fe.all([n[e]||{},...t]),n)))}Pe([gn],(([e])=>Object.keys(e))),gn.subscribe((e=>dn=e));const En={};function vn(e){return En[e]}function Tn(e){return null!=e&&Pn(e).some((e=>{var t;return null===(t=vn(e))||void 0===t?void 0:t.size}))}const Bn={};function _n(e){if(!Tn(e))return e in Bn?Bn[e]:Promise.resolve();const t=function(e){return Pn(e).map((e=>{const t=vn(e);return[e,t?[...t]:[]]})).filter((([,e])=>e.length>0))}(e);return Bn[e]=Promise.all(t.map((([e,t])=>function(e,t){const n=Promise.all(t.map((t=>(function(e,t){En[e].delete(t),0===En[e].size&&delete En[e]}(e,t),t().then((e=>e.default||e))))));return n.then((t=>yn(e,...t)))}(e,t)))).then((()=>{if(Tn(e))return _n(e);delete Bn[e]})),Bn[e]}const wn={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function An(){return wn}const Hn=Le(!1);let Cn;const Sn=Le(null);function Ln(e){return e.split("-").map(((e,t,n)=>n.slice(0,t+1).join("-"))).reverse()}function Pn(e,t=An().fallbackLocale){const n=Ln(e);return t?[...new Set([...n,...Ln(t)])]:n}function Rn(){return null!=Cn?Cn:void 0}Sn.subscribe((e=>{Cn=null!=e?e:void 0,"undefined"!=typeof window&&null!=e&&document.documentElement.setAttribute("lang",e)}));const Nn={...Sn,set:e=>{if(e&&function(e){if(null==e)return;const t=Pn(e);for(let e=0;e<t.length;e++){const n=t[e];if(mn(n))return n}}(e)&&Tn(e)){const{loadingDelay:t}=An();let n;return"undefined"!=typeof window&&null!=Rn()&&t?n=window.setTimeout((()=>Hn.set(!0)),t):Hn.set(!0),_n(e).then((()=>{Sn.set(e)})).finally((()=>{clearTimeout(n),Hn.set(!1)}))}return Sn.set(e)}},On=e=>{const t=Object.create(null);return n=>{const r=JSON.stringify(n);return r in t?t[r]:t[r]=e(n)}},In=(e,t)=>{const{formats:n}=An();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Mn=On((({locale:e,format:t,...n})=>{if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return t&&(n=In("number",t)),new Intl.NumberFormat(e,n)})),Dn=On((({locale:e,format:t,...n})=>{if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return t?n=In("date",t):0===Object.keys(n).length&&(n=In("date","short")),new Intl.DateTimeFormat(e,n)})),xn=On((({locale:e,format:t,...n})=>{if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return t?n=In("time",t):0===Object.keys(n).length&&(n=In("time","short")),new Intl.DateTimeFormat(e,n)})),$n=On(((e,t=Rn())=>new un(e,t,An().formats,{ignoreTag:An().ignoreTag}))),Un=(e,t={})=>{var n,r,o,i;let s=t;"object"==typeof e&&(s=e,e=s.id);const{values:a,locale:l=Rn(),default:c}=s;if(null==l)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let u=pn(e,l);if(u){if("string"!=typeof u)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof u}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),u}else u=null!==(i=null!==(o=null===(r=(n=An()).handleMissingMessage)||void 0===r?void 0:r.call(n,{locale:l,id:e,defaultValue:c}))&&void 0!==o?o:c)&&void 0!==i?i:e;if(!a)return u;let h=u;try{h=$n(u,l).format(a)}catch(t){t instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return h},Gn=(e,t)=>(({locale:e=Rn(),...t}={})=>xn({locale:e,...t}))(t).format(e),kn=(e,t)=>(({locale:e=Rn(),...t}={})=>Dn({locale:e,...t}))(t).format(e),Fn=(e,t)=>(({locale:e=Rn(),...t}={})=>Mn({locale:e,...t}))(t).format(e),jn=(e,t=Rn())=>pn(e,t),Vn=Pe([Nn,gn],(()=>Un));Pe([Nn],(()=>Gn)),Pe([Nn],(()=>kn)),Pe([Nn],(()=>Fn)),Pe([Nn,gn],(()=>jn));const Kn=e=>{(({withLocale:e,translations:t})=>{Nn.subscribe((n=>{null==n&&(gn.set(t),Nn.set(e))}));// maybe we will need this to make sure that the i18n is set up only once
|
|
765
|
+
/*dictionary.set(translations);
|
|
766
|
+
locale.set(_locale);*/})({withLocale:"en",translations:{}}),Object.keys(e).forEach((t=>{yn(t,e[t])}))};var Xn,Zn;!function(e){e.level="level",e.current="current",e.next="next",e.first="first",e.last="last",e.previous="previous",e.startChallenge="startChallenge"}(Xn||(Xn={})),function(e){e.level="wageringBonuses.level",e.current="wageringBonuses.current",e.next="wageringBonuses.next",e.first="wageringBonuses.first",e.last="wageringBonuses.last",e.previous="wageringBonuses.previous",e.startChallenge="wageringBonuses.startChallenge"}(Zn||(Zn={}));const Wn={en:{wageringBonuses:{level:"Level",current:"Current",next:"Next",first:"First",last:"Last",previous:"Previous",startChallenge:"START CHALLENGE"}},"zh-hk":{wageringBonuses:{level:"等級",current:"当前",next:"下一個",first:"第一個",last:"最後一個",previous:"上一個",startChallenge:"開始挑戰"}}};
|
|
767
|
+
/* src/CasinoWageringBonus.svelte generated by Svelte v3.58.0 */function zn(e,t,n){const r=e.slice();return r[22]=t[n],r[24]=n,r}function Yn(e,t,n){const r=e.slice();return r[25]=t[n],r[27]=n,r}function qn(e,t,n){const r=e.slice();return r[28]=t[n],r}function Jn(e,t,n){const r=e.slice();return r[31]=t[n],r}function Qn(e,t,n){const r=e.slice();return r[34]=t[n],r}
|
|
768
|
+
// (89:0) {#if bonus && isShowingBonus}
|
|
769
|
+
function er(e){let t,n,o,i,s,a,l,c,u,h,f,y,T,B,_,A,H,C,L,P,R,N,O,I=/*bonus*/(e[1].name||/*bonus*/e[1].presentation?.name.content)+"",M=[ie("BonusInfoTitle","title")],D={};for(let e=0;e<M.length;e+=1)D=r(D,M[e]);let x=/*status*/e[0]===ce.active&&tr(e),$=[ie("BonusInfoWrapper","layout-horizental space-between")],U={};for(let e=0;e<$.length;e+=1)U=r(U,$[e]);let G=/*status*/e[0]===ce.claimable&&nr(e),k=/*status*/e[0]!==ce.claimable&&rr(e),F=[ie("BonusInfo")],j={};for(let e=0;e<F.length;e+=1)j=r(j,F[e]);let V=[ie("RewardsTopBarTitle","title")],K={};for(let e=0;e<V.length;e+=1)K=r(K,V[e]);let X=/*status*/e[0]!==ce.claimable&&sr(e),Z=[ie("RewardsTopBar","layout-horizental space-between")],W={};for(let e=0;e<Z.length;e+=1)W=r(W,Z[e]);let z=/*status*/e[0]!==ce.claimable&&ar(e),Y=/*status*/e[0]===ce.claimable&&ur(e),q=[ie("BonusRewardsLevels")],J={};for(let e=0;e<q.length;e+=1)J=r(J,q[e]);let Q=[ie("SupportsTitle","title")],ee={};for(let e=0;e<Q.length;e+=1)ee=r(ee,Q[e]);let te=Object.keys(/*bonus*/e[1].extension?.bonus.wallet||/*bonus*/e[1].wallet).filter(mr),ne=[];for(let t=0;t<te.length;t+=1)ne[t]=pr(zn(e,te,t));let re=[ie("SupportsList")],oe={};for(let e=0;e<re.length;e+=1)oe=r(oe,re[e]);let se=[ie("SupportsWrapper")],ae={};for(let e=0;e<se.length;e+=1)ae=r(ae,se[e]);let le=[ie("BonusRewards")],ue={};for(let e=0;e<le.length;e+=1)ue=r(ue,le[e]);let he=[ie("Root","layout-horizental")],fe={};for(let e=0;e<he.length;e+=1)fe=r(fe,he[e]);return{c(){t=b("section"),n=b("div"),o=b("section"),i=b("section"),s=E(I),a=v(),x&&x.c(),l=v(),G&&G.c(),c=v(),k&&k.c(),u=v(),h=b("div"),f=b("section"),y=b("div"),T=E("Rewards"),B=v(),X&&X.c(),_=v(),A=b("div"),z&&z.c(),H=v(),Y&&Y.c(),C=v(),L=b("div"),P=b("div"),R=E("Include bets"),N=v(),O=b("div");for(let e=0;e<ne.length;e+=1)ne[e].c();w(i,D),w(o,U),w(n,j),w(y,K),w(f,W),w(A,J),w(P,ee),w(O,oe),w(L,ae),w(h,ue),w(t,fe)},m(e,r){d(e,t,r),p(t,n),p(n,o),p(o,i),p(i,s),p(o,a),x&&x.m(o,null),p(n,l),G&&G.m(n,null),p(n,c),k&&k.m(n,null),p(t,u),p(t,h),p(h,f),p(f,y),p(y,T),p(f,B),X&&X.m(f,null),p(h,_),p(h,A),z&&z.m(A,null),p(A,H),Y&&Y.m(A,null),p(h,C),p(h,L),p(L,P),p(P,R),p(L,N),p(L,O);for(let e=0;e<ne.length;e+=1)ne[e]&&ne[e].m(O,null)},p(e,t){if(/*bonus*/2&t[0]&&I!==(I=/*bonus*/(e[1].name||/*bonus*/e[1].presentation?.name.content)+"")&&S(s,I,D.contenteditable),/*status*/e[0]===ce.active?x?x.p(e,t):(x=tr(e),x.c(),x.m(o,null)):x&&(x.d(1),x=null),/*status*/e[0]===ce.claimable?G?G.p(e,t):(G=nr(e),G.c(),G.m(n,c)):G&&(G.d(1),G=null),/*status*/e[0]!==ce.claimable?k?k.p(e,t):(k=rr(e),k.c(),k.m(n,null)):k&&(k.d(1),k=null),/*status*/e[0]!==ce.claimable?X?X.p(e,t):(X=sr(e),X.c(),X.m(f,null)):X&&(X.d(1),X=null),/*status*/e[0]!==ce.claimable?z?z.p(e,t):(z=ar(e),z.c(),z.m(A,H)):z&&(z.d(1),z=null),/*status*/e[0]===ce.claimable?Y?Y.p(e,t):(Y=ur(e),Y.c(),Y.m(A,null)):Y&&(Y.d(1),Y=null),/*bonus*/2&t[0]){let n;for(te=Object.keys(/*bonus*/e[1].extension?.bonus.wallet||/*bonus*/e[1].wallet).filter(mr),n=0;n<te.length;n+=1){const r=zn(e,te,n);ne[n]?ne[n].p(r,t):(ne[n]=pr(r),ne[n].c(),ne[n].m(O,null))}for(;n<ne.length;n+=1)ne[n].d(1);ne.length=te.length}},d(e){e&&g(t),x&&x.d(),G&&G.d(),k&&k.d(),X&&X.d(),z&&z.d(),Y&&Y.d(),m(ne,e)}}}
|
|
770
|
+
// (97:8) {#if status === BonusStatus.active}
|
|
771
|
+
function tr(e){let t,n,o,i,s,a,l=[ie("BonusInfoExpireDate")],c={};for(let e=0;e<l.length;e+=1)c=r(c,l[e]);let h=[ie("BonusInfoExpire")],f={};for(let e=0;e<h.length;e+=1)f=r(f,h[e]);return{c(){t=b("section"),n=b("img"),i=v(),s=b("span"),a=E(/*expiryTime*/e[6]),_(n,"class","icon"),u(n.src,o=ee)||_(n,"src",o),_(n,"alt","expiryTime"),w(s,c),w(t,f)},m(e,r){d(e,t,r),p(t,n),p(t,i),p(t,s),p(s,a)},p(e,t){/*expiryTime*/64&t[0]&&S(a,/*expiryTime*/e[6],c.contenteditable)},d(e){e&&g(t)}}}
|
|
772
|
+
// (108:6) {#if status === BonusStatus.claimable}
|
|
773
|
+
function nr(e){let t,n,o,i,s,a,l,c,h,f,m,y,T,A,H,L,P,R,N,O,I,M,D,x,$,U,G,k,F,j,V,K=/*bonus*/(e[1].description||"")+"",X=/*levels*/e[2].length+"",Z=/*$_*/e[10](Zn.startChallenge)+"",W=[ie("BonusInfoDescription")],z={};for(let e=0;e<W.length;e+=1)z=r(z,W[e]);let Y=[ie("StatusClaimableInfoLevels")],q={};for(let e=0;e<Y.length;e+=1)q=r(q,Y[e]);let J=[ie("StatusClaimableInfoPeriod")],ee={};for(let e=0;e<J.length;e+=1)ee=r(ee,J[e]);let ne=[ie("StatusClaimableInfo")],re={};for(let e=0;e<ne.length;e+=1)re=r(re,ne[e]);let oe=[ie("StatusClaimableCommandTerms","terms")],se={};for(let e=0;e<oe.length;e+=1)se=r(se,oe[e]);let ae=[ie("StatusClaimableCommand")],le={};for(let e=0;e<ae.length;e+=1)le=r(le,ae[e]);let ce=[ie("StatusClaimable","layout-horizental space-between")],ue={};for(let e=0;e<ce.length;e+=1)ue=r(ue,ce[e]);return{c(){t=b("div"),n=E(K),o=v(),i=b("hr"),s=v(),a=b("section"),l=b("div"),c=b("div"),h=b("img"),m=v(),y=E(X),T=E(" Levels"),A=v(),H=b("div"),L=b("img"),R=v(),N=E(/*endTime*/e[7]),O=v(),I=b("div"),M=b("button"),D=E(Z),$=v(),U=b("div"),G=b("a"),k=E("Terms and Conditions"),w(t,z),_(h,"class","icon"),u(h.src,f=te)||_(h,"src",f),_(h,"alt","Levels"),w(c,q),_(L,"class","icon"),u(L.src,P=Q)||_(L,"src",P),_(L,"alt","EndTime"),w(H,ee),w(l,re),_(M,"type","button"),M.disabled=x=!/*isButtonClickable*/e[8],_(G,"href",F=/*bonus*/e[1].presentation?.url?.content),_(G,"target","__blank"),w(U,se),w(I,le),w(a,ue)},m(r,u){d(r,t,u),p(t,n),d(r,o,u),d(r,i,u),d(r,s,u),d(r,a,u),p(a,l),p(l,c),p(c,h),p(c,m),p(c,y),p(c,T),p(l,A),p(l,H),p(H,L),p(H,R),p(H,N),p(a,O),p(a,I),p(I,M),p(M,D),p(I,$),p(I,U),p(U,G),p(G,k),j||(V=B(M,"click",/*eventStartChallenge*/e[11]),j=!0)},p(e,t){/*bonus*/2&t[0]&&K!==(K=/*bonus*/(e[1].description||"")+"")&&S(n,K,z.contenteditable),/*levels*/4&t[0]&&X!==(X=/*levels*/e[2].length+"")&&S(y,X,q.contenteditable),/*endTime*/128&t[0]&&S(N,/*endTime*/e[7],ee.contenteditable),/*$_*/1024&t[0]&&Z!==(Z=/*$_*/e[10](Zn.startChallenge)+"")&&C(D,Z),/*isButtonClickable*/256&t[0]&&x!==(x=!/*isButtonClickable*/e[8])&&(M.disabled=x),/*bonus*/2&t[0]&&F!==(F=/*bonus*/e[1].presentation?.url?.content)&&_(G,"href",F)},d(e){e&&g(t),e&&g(o),e&&g(i),e&&g(s),e&&g(a),j=!1,V()}}}
|
|
774
|
+
// (149:6) {#if status !== BonusStatus.claimable}
|
|
775
|
+
function rr(e){let t,n,o,i,s,a,l,c,u,h,f,m,y,T,B,A,C,L,P,R,N,O,I,M,D=/*levelsCurrent*/e[3].textWithLength+"",x=/*bonusTypeInfo*/e[5].target()+"",$=[ce.completed,ce.released].includes(/*bonus*/e[1].status),U=[ie("LevelStatus")],G={};for(let e=0;e<U.length;e+=1)G=r(G,U[e]);let k=[ie("LevelStatusWrapper")],F={};for(let e=0;e<k.length;e+=1)F=r(F,k[e]);let j=[ie("BonusTypeTarget","title")],V={};for(let e=0;e<j.length;e+=1)V=r(V,j[e]);let K=/*bonus*/e[1].status===ce.active&&or(e),X=$&&ir(e),Z=[ie("BonusType")],W={};for(let e=0;e<Z.length;e+=1)W=r(W,Z[e]);let z=[ie("BonusTerms","terms")],Y={};for(let e=0;e<z.length;e+=1)Y=r(Y,z[e]);let q=[ie("BonusTypeWrapper")],J={};for(let e=0;e<q.length;e+=1)J=r(J,q[e]);let Q=[ie("AfterClaimedWrapper","layout-horizental space-between")],ee={};for(let e=0;e<Q.length;e+=1)ee=r(ee,Q[e]);return{c(){t=b("hr"),n=v(),o=b("section"),i=b("div"),s=b("casino-wagering-bonus-progress"),l=v(),c=b("div"),u=E("Level\n "),h=E(D),f=v(),m=b("div"),y=b("div"),T=b("div"),B=E(x),A=v(),K&&K.c(),C=v(),X&&X.c(),L=v(),P=b("div"),R=E("Learn more about the challenge rules and included games or events in \n "),N=b("a"),O=E("Terms and Conditions"),M=E("\n section"),H(s,"percent",/*percent*/e[4]),H(s,"status",a=/*bonus*/e[1].status),w(c,G),w(i,F),w(T,V),w(y,W),_(N,"href",I=/*bonus*/e[1]?.url),_(N,"target","__blank"),w(P,Y),w(m,J),w(o,ee)},m(e,r){d(e,t,r),d(e,n,r),d(e,o,r),p(o,i),p(i,s),p(i,l),p(i,c),p(c,u),p(c,h),p(o,f),p(o,m),p(m,y),p(y,T),p(T,B),p(y,A),K&&K.m(y,null),p(y,C),X&&X.m(y,null),p(m,L),p(m,P),p(P,R),p(P,N),p(N,O),p(P,M)},p(e,t){/*percent*/16&t[0]&&H(s,"percent",/*percent*/e[4]),/*bonus*/2&t[0]&&a!==(a=/*bonus*/e[1].status)&&H(s,"status",a),/*levelsCurrent*/8&t[0]&&D!==(D=/*levelsCurrent*/e[3].textWithLength+"")&&S(h,D,G.contenteditable),/*bonusTypeInfo*/32&t[0]&&x!==(x=/*bonusTypeInfo*/e[5].target()+"")&&S(B,x,V.contenteditable),/*bonus*/e[1].status===ce.active?K?K.p(e,t):(K=or(e),K.c(),K.m(y,C)):K&&(K.d(1),K=null),/*bonus*/2&t[0]&&($=[ce.completed,ce.released].includes(/*bonus*/e[1].status)),$?X?X.p(e,t):(X=ir(e),X.c(),X.m(y,null)):X&&(X.d(1),X=null),/*bonus*/2&t[0]&&I!==(I=/*bonus*/e[1]?.url)&&_(N,"href",I)},d(e){e&&g(t),e&&g(n),e&&g(o),K&&K.d(),X&&X.d()}}}
|
|
776
|
+
// (171:12) {#if bonus.status === BonusStatus.active}
|
|
777
|
+
function or(e){let t,n,o,i,s,a=/*bonusTypeInfo*/e[5].remaining()+"",l=/*bonusTypeInfo*/e[5].got()+"",c=[ie("BonusTypeRemaining")],u={};for(let e=0;e<c.length;e+=1)u=r(u,c[e]);let h=[ie("BonusTypeGot")],f={};for(let e=0;e<h.length;e+=1)f=r(f,h[e]);return{c(){t=b("div"),n=E(a),o=v(),i=b("div"),s=E(l),w(t,u),w(i,f)},m(e,r){d(e,t,r),p(t,n),d(e,o,r),d(e,i,r),p(i,s)},p(e,t){/*bonusTypeInfo*/32&t[0]&&a!==(a=/*bonusTypeInfo*/e[5].remaining()+"")&&S(n,a,u.contenteditable),/*bonusTypeInfo*/32&t[0]&&l!==(l=/*bonusTypeInfo*/e[5].got()+"")&&S(s,l,f.contenteditable)},d(e){e&&g(t),e&&g(o),e&&g(i)}}}
|
|
778
|
+
// (180:12) {#if [BonusStatus.completed, BonusStatus.released].includes(bonus.status)}
|
|
779
|
+
function ir(e){let t,n,r,o,i,s,a,l,c,h,f,m=/*bonus*/e[1].status.split("").map(gr).join("")+"",y=/*levelsCurrent*/e[3].textWithLength+"";return{c(){t=b("div"),n=b("img"),o=v(),i=E(m),s=v(),a=b("div"),l=b("img"),h=E("\n Levels finished:\n "),f=E(y),_(n,"class","icon"),u(n.src,r=Q)||_(n,"src",r),_(l,"class","icon"),u(l.src,c=te)||_(l,"src",c)},m(e,r){d(e,t,r),p(t,n),p(t,o),p(t,i),d(e,s,r),d(e,a,r),p(a,l),p(a,h),p(a,f)},p(e,t){/*bonus*/2&t[0]&&m!==(m=/*bonus*/e[1].status.split("").map(gr).join("")+"")&&C(i,m),/*levelsCurrent*/8&t[0]&&y!==(y=/*levelsCurrent*/e[3].textWithLength+"")&&C(f,y)},d(e){e&&g(t),e&&g(s),e&&g(a)}}}
|
|
780
|
+
// (211:8) {#if status !== BonusStatus.claimable}
|
|
781
|
+
function sr(e){let t,o,i,s,a=[ie("RewardsTopBarLinkToDetail")],l={};for(let e=0;e<a.length;e+=1)l=r(l,a[e]);return{c(){t=b("div"),o=b("a"),o.textContent="All Rewards",_(o,"href","javascript:void(0)"),w(t,l)},m(n,r){d(n,t,r),p(t,o),i||(s=B(o,"click",/*click_handler*/e[17]),i=!0)},p:n,d(e){e&&g(t),i=!1,s()}}}
|
|
782
|
+
// (226:8) {#if status !== BonusStatus.claimable}
|
|
783
|
+
function ar(e){let t,n=_e(/*bonus*/e[1],/*status*/e[0],/*levels*/e[2]),r=[];for(let t=0;t<n.length;t+=1)r[t]=cr(Jn(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=T()},m(e,n){for(let t=0;t<r.length;t+=1)r[t]&&r[t].m(e,n);d(e,t,n)},p(e,o){if(/*bonus, status, levels, $_*/1031&o[0]){let i;for(n=_e(/*bonus*/e[1],/*status*/e[0],/*levels*/e[2]),i=0;i<n.length;i+=1){const s=Jn(e,n,i);r[i]?r[i].p(s,o):(r[i]=cr(s),r[i].c(),r[i].m(t.parentNode,t))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(e){m(r,e),e&&g(t)}}}
|
|
784
|
+
// (234:14) {#each reward.descriptions as description}
|
|
785
|
+
function lr(e){let t,n,r=/*description*/e[34]+"";return{c(){t=b("p"),n=E(r)},m(e,r){d(e,t,r),p(t,n)},p(e,t){/*bonus, status, levels*/7&t[0]&&r!==(r=/*description*/e[34]+"")&&C(n,r)},d(e){e&&g(t)}}}
|
|
786
|
+
// (227:10) {#each (getRewards(bonus, status, levels)) as reward}
|
|
787
|
+
function cr(e){let t,n,o,i,s,a,l,c,u,h=/*$_*/e[10](Zn[/*reward*/e[31].key])+"",f=/*$_*/e[10](Zn.level)+"",y=[ie("BonusRewardsLevelsItemPosition")],T={};for(let e=0;e<y.length;e+=1)T=r(T,y[e]);let B=/*reward*/e[31].descriptions,_=[];for(let t=0;t<B.length;t+=1)_[t]=lr(Qn(e,B,t));let A=[ie("BonusRewardsLevelsItem")],H={};for(let e=0;e<A.length;e+=1)H=r(H,A[e]);return{c(){t=b("div"),n=b("div"),o=E(h),i=v(),s=E(f),a=E(":"),l=v(),c=b("div");for(let e=0;e<_.length;e+=1)_[e].c();u=v(),w(n,T),w(t,H)},m(e,r){d(e,t,r),p(t,n),p(n,o),p(n,i),p(n,s),p(n,a),p(t,l),p(t,c);for(let e=0;e<_.length;e+=1)_[e]&&_[e].m(c,null);p(t,u)},p(e,t){if(/*$_, bonus, status, levels*/1031&t[0]&&h!==(h=/*$_*/e[10](Zn[/*reward*/e[31].key])+"")&&S(o,h,T.contenteditable),/*$_*/1024&t[0]&&f!==(f=/*$_*/e[10](Zn.level)+"")&&S(s,f,T.contenteditable),/*bonus, status, levels*/7&t[0]){let n;for(B=/*reward*/e[31].descriptions,n=0;n<B.length;n+=1){const r=Qn(e,B,n);_[n]?_[n].p(r,t):(_[n]=lr(r),_[n].c(),_[n].m(c,null))}for(;n<_.length;n+=1)_[n].d(1);_.length=B.length}},d(e){e&&g(t),m(_,e)}}}
|
|
788
|
+
// (243:8) {#if status === BonusStatus.claimable}
|
|
789
|
+
function ur(e){let t,n=/*bonus*/e[1].levels,r=[];for(let t=0;t<n.length;t+=1)r[t]=fr(Yn(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=T()},m(e,n){for(let t=0;t<r.length;t+=1)r[t]&&r[t].m(e,n);d(e,t,n)},p(e,o){if(/*bonus, $_*/1026&o[0]){let i;for(n=/*bonus*/e[1].levels,i=0;i<n.length;i+=1){const s=Yn(e,n,i);r[i]?r[i].p(s,o):(r[i]=fr(s),r[i].c(),r[i].m(t.parentNode,t))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(e){m(r,e),e&&g(t)}}}
|
|
790
|
+
// (259:14) {#each level.bonuses as levelBonus}
|
|
791
|
+
function hr(e){let t,n,r=Be(/*level*/e[25],/*levelBonus*/e[28])+"";return{c(){t=b("p"),n=E(r)},m(e,r){d(e,t,r),p(t,n)},p(e,t){/*bonus*/2&t[0]&&r!==(r=Be(/*level*/e[25],/*levelBonus*/e[28])+"")&&C(n,r)},d(e){e&&g(t)}}}
|
|
792
|
+
// (244:10) {#each bonus.levels as level, index}
|
|
793
|
+
function fr(e){let t,n,o,i,s,a,l,c,u,h=/*$_*/e[10](Zn.level)+"",f=/*level*/(e[25].maxRepeats>1?`${/*index*/e[27]+1}-${/*index*/e[27]+1+/*level*/e[25].maxRepeats-1}`:e[27]+1)+"",y=[ie("BonusRewardsLevelsItemPosition")],T={};for(let e=0;e<y.length;e+=1)T=r(T,y[e]);let B=/*level*/e[25].bonuses,_=[];for(let t=0;t<B.length;t+=1)_[t]=hr(qn(e,B,t));let A=[ie("BonusRewardsLevelsItem")],H={};for(let e=0;e<A.length;e+=1)H=r(H,A[e]);return{c(){t=b("div"),n=b("div"),o=E(h),i=v(),s=E(f),a=E(":"),l=v(),c=b("div");for(let e=0;e<_.length;e+=1)_[e].c();u=v(),w(n,T),w(t,H)},m(e,r){d(e,t,r),p(t,n),p(n,o),p(n,i),p(n,s),p(n,a),p(t,l),p(t,c);for(let e=0;e<_.length;e+=1)_[e]&&_[e].m(c,null);p(t,u)},p(e,t){if(/*$_*/1024&t[0]&&h!==(h=/*$_*/e[10](Zn.level)+"")&&S(o,h,T.contenteditable),/*bonus*/2&t[0]&&f!==(f=/*level*/(e[25].maxRepeats>1?`${/*index*/e[27]+1}-${/*index*/e[27]+1+/*level*/e[25].maxRepeats-1}`:e[27]+1)+"")&&S(s,f,T.contenteditable),/*bonus*/2&t[0]){let n;for(B=/*level*/e[25].bonuses,n=0;n<B.length;n+=1){const r=qn(e,B,n);_[n]?_[n].p(r,t):(_[n]=hr(r),_[n].c(),_[n].m(c,null))}for(;n<_.length;n+=1)_[n].d(1);_.length=B.length}},d(e){e&&g(t),m(_,e)}}}
|
|
794
|
+
// (274:10) {#each Object.keys(bonus.extension?.bonus.wallet || bonus.wallet).filter(k => ['sports', 'casino'].includes(k)) as support, i}
|
|
795
|
+
function pr(e){let t,n,r,o,i,s,a=/*support*/e[22]+"";function l(){/*click_handler_1*/
|
|
796
|
+
return e[18](/*support*/e[22])}return{c(){t=b("div"),n=b("a"),r=E(a),o=v(),_(n,"href","javascript:void(0)")},m(e,a){d(e,t,a),p(t,n),p(n,r),p(t,o),i||(s=B(n,"click",l),i=!0)},p(t,n){e=t,/*bonus*/2&n[0]&&a!==(a=/*support*/e[22]+"")&&C(r,a)},d(e){e&&g(t),i=!1,s()}}}function dr(e){let t,r=/*bonus*/e[1]&&/*isShowingBonus*/e[9]&&er(e);return{c(){r&&r.c(),t=T(),this.c=n},m(e,n){r&&r.m(e,n),d(e,t,n)},p(e,n){/*bonus*/e[1]&&/*isShowingBonus*/e[9]?r?r.p(e,n):(r=er(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null)},i:n,o:n,d(e){r&&r.d(e),e&&g(t)}}}const gr=(e,t)=>0===t?e.toUpperCase():e,mr=e=>["sports","casino"].includes(e);function br(e,t,n){let r,o;var i,s;i=Vn,s=e=>n(10,o=e),e.$$.on_destroy.push(h(i,s));let a,l,c,u,{rawbonus:f=""}=t,{endpoint:p=""}=t,{currency:d="EUR"}=t,{lang:g=fe.en}=t,{session:m=""}=t,{status:b=ce.claimable}=t,y=[],E="0",v="",T=!0,B=3e4;Kn(Wn);const _=()=>{try{n(1,a=Object.assign({},JSON.parse(f)))}catch(e){console.error(e)}if(a){if(n(2,y=(e=>{const t=[];return e.map((e=>{const{maxRepeats:n,completedTime:r}=e,o=de(e,["maxRepeats","completedTime"]);for(let e=0;e<n;e++)t.push(Object.assign({},o))})),t})(a.levels)),a.bonusWalletID){const e=((e,t)=>({bonusTypeInfo:Ae(e,t),percent:ve(e.status,{completed:()=>"100",current:()=>{if(!e.wageringProgress)return"0";let{currency:t,currentLevelIncrement:n,gap:r,currentLevel:o}=e.wageringProgress;const i=n-r;return String(Math.floor(i/n*100))}}),levelsCurrent:ve(e.status,{completed:()=>({text:t.length,textWithLength:`${t.length}/${t.length}`}),current:()=>{if(!e.wageringProgress)return{current:"0",textWithLength:`0/${t.length}`};const{currentLevel:n}=e.wageringProgress;return{text:n,textWithLength:`${n}/${t.length}`}}})}))(a,y);n(5,c=e.bonusTypeInfo),n(4,E=e.percent),n(3,l=e.levelsCurrent)}w()}},w=()=>{a&&(Ce(a.expiryDate,B,(()=>n(6,u="Expired")),(e=>n(6,u=e))),Ce(a.endTime||a.trigger.endTime,B,(()=>n(7,v="Ended")),(e=>n(7,v=e))))};return N((()=>{const e=setInterval((()=>{w()}),B);return()=>{clearInterval(e)}})),ye({OnWageringBonusButtonStateChanged:e=>n(8,T=e.clickable)}),e.$$set=e=>{"rawbonus"in e&&n(12,f=e.rawbonus),"endpoint"in e&&n(13,p=e.endpoint),"currency"in e&&n(14,d=e.currency),"lang"in e&&n(15,g=e.lang),"session"in e&&n(16,m=e.session),"status"in e&&n(0,b=e.status)},e.$$.update=()=>{var t;/*rawbonus*/4096&e.$$.dirty[0]&&f&&_(),/*lang*/32768&e.$$.dirty[0]&&g&&(t=g,Nn.set(t)),/*status, bonus*/3&e.$$.dirty[0]&&n(9,r=b===ce.claimable||a.status===b)},[b,a,y,l,E,c,u,v,T,r,o,async()=>{m&&(be({type:"OnWageringBonusJoinRequest",bonusID:a.bonusID}),be({type:"OnWageringBonusButtonStateChanged",clickable:!1}),(await Te(p,m,a.code,d)).success&&be({type:"OnWageringBonusClaimed"}),be({type:"OnWageringBonusButtonStateChanged",clickable:!0}))},f,p,d,g,m,()=>be({type:"OnWageringBonusAllRewardsClick",bonusWalletID:a.id}),e=>be({type:"OnWageringBonusSupportClicked",support:e})]}class yr extends Y{constructor(e){super();const t=document.createElement("style");t.textContent=':host{font-family:system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";font-size:24px;line-height:28px;font-style:normal}*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}button{font-size:24px;line-height:28px}hr{margin:18px 0;border-top:1px solid #00AEEF}section.layout-horizental{display:flex;flex-direction:row}section.layout-horizental.space-between{justify-content:space-between}.title{font-weight:700}.terms{font-size:18px;line-height:21px}.icon{width:24px;height:24px;vertical-align:bottom}.Root{border:1px solid #00AEEF;max-width:1300px;padding:28px 0}.Root>div{padding:0 28px}.Root>div:nth-child(1){flex:55%}.Root>div:nth-child(2){flex:45%;border-left:1px solid #00AEEF}.BonusInfoTitle{color:#59CA00}.BonusInfoExpireDate{color:#DC0D1F}.BonusInfoDescription{margin-top:20px}.StatusClaimableInfoPeriod{margin-top:18px}.StatusClaimable>div:nth-child(1){flex:40%}.StatusClaimable>div:nth-child(2){flex:60%}.StatusClaimableCommand button{width:100%;background:#00AEEF;border:1px solid #00AEEF;color:#FFFFFF;cursor:pointer;font-weight:400;padding:30px;transition:0.6s}.StatusClaimableCommand button:disabled{opacity:0.3}.StatusClaimableCommandTerms{margin-top:10px;text-align:center}.StatusClaimableCommandTerms a{color:#000000}.LevelStatus{text-align:center;margin-top:10px}.BonusTypeWrapper{margin-left:30px}.BonusType>div{margin-bottom:20px}.BonusTypeRemaining{color:#00AEEF}.BonusTypeGot{color:#7884A0}.RewardsTopBarTitle{color:#252631;padding-bottom:12px}.BonusRewardsLevels>div{margin-top:5px;padding:12px 0}.BonusRewardsLevelsItem{display:flex}.BonusRewardsLevelsItemPosition{margin-right:5px}.SupportsWrapper{margin-top:35px}.SupportsWrapper div{margin-top:15px}',this.shadowRoot.appendChild(t),z(this,{target:this.shadowRoot,props:L(this.attributes),customElement:!0},br,dr,l,{rawbonus:12,endpoint:13,currency:14,lang:15,session:16,status:0},null,[-1,-1]),e&&(e.target&&d(e.target,this,e.anchor),e.props&&(this.$set(e.props),j()))}static get observedAttributes(){return["rawbonus","endpoint","currency","lang","session","status"]}get rawbonus(){return this.$$.ctx[12]}set rawbonus(e){this.$$set({rawbonus:e}),j()}get endpoint(){return this.$$.ctx[13]}set endpoint(e){this.$$set({endpoint:e}),j()}get currency(){return this.$$.ctx[14]}set currency(e){this.$$set({currency:e}),j()}get lang(){return this.$$.ctx[15]}set lang(e){this.$$set({lang:e}),j()}get session(){return this.$$.ctx[16]}set session(e){this.$$set({session:e}),j()}get status(){return this.$$.ctx[0]}set status(e){this.$$set({status:e}),j()}}var Er,vr;return Er="casino-wagering-bonus",vr=yr,!customElements.get(Er)&&customElements.define(Er,vr),yr}()}));
|
|
64
797
|
/******************************************************************************
|
|
65
798
|
Copyright (c) Microsoft Corporation.
|
|
66
799
|
|
|
@@ -76,7 +809,7 @@ function W(n){let r,o,i,s,a,l,c,u=[{class:"ring",r:/*radius*/n[2],cx:/*center*/n
|
|
|
76
809
|
PERFORMANCE OF THIS SOFTWARE.
|
|
77
810
|
***************************************************************************** */
|
|
78
811
|
/* global Reflect, Promise */
|
|
79
|
-
var
|
|
812
|
+
var U=function(e,t){return U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},U(e,t)};function G(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}U(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var k=function(){return k=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},k.apply(this,arguments)};function F(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function j(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}const V=(e,t="")=>({part:e,class:[e,t].join(" ")}),K=async(e,t={})=>{let n;return n=await fetch(e,t),n=await n.json(),n};var X,Z,W,z;!function(e){e.claimable="claimable",e.active="active",e.completed="completed",e.forfeited="forfeited",e.expired="expired",e.released="released",e.closed="closed"}(X||(X={})),function(e){e.standard="standard",e.freeBet="freeBet",e.freeRound="freeRound",e.tournamentTicket="tournamentTicket",e.oddsBoost="oddsBoost",e.cashBack="cashBack"}(Z||(Z={})),function(e){e.Money="money",e.BetCount="betcount"}(W||(W={})),function(e){e.en="en",e["zh-hk"]="zh-hk"}(z||(z={}));var Y=$((function(e,t){
|
|
80
813
|
/** @license
|
|
81
814
|
* eventsource.js
|
|
82
815
|
* Available under MIT License (MIT)
|
|
@@ -84,7 +817,7 @@ var ne=function(e,t){return ne=Object.setPrototypeOf||{__proto__:[]}instanceof A
|
|
|
84
817
|
*/
|
|
85
818
|
/*jslint indent: 2, vars: true, plusplus: true */
|
|
86
819
|
/*global setTimeout, clearTimeout */
|
|
87
|
-
!function(n){var r=n.setTimeout,o=n.clearTimeout,i=n.XMLHttpRequest,s=n.XDomainRequest,a=n.ActiveXObject,l=n.EventSource,c=n.document,u=n.Promise,h=n.fetch,
|
|
820
|
+
!function(n){var r=n.setTimeout,o=n.clearTimeout,i=n.XMLHttpRequest,s=n.XDomainRequest,a=n.ActiveXObject,l=n.EventSource,c=n.document,u=n.Promise,h=n.fetch,f=n.Response,p=n.TextDecoder,d=n.TextEncoder,g=n.AbortController;
|
|
88
821
|
// see #118 (Promise#finally with polyfilled Promise)
|
|
89
822
|
// see #123 (data URLs crash Edge)
|
|
90
823
|
// see #125 (CSP violations)
|
|
@@ -94,9 +827,9 @@ if("undefined"==typeof window||void 0===c||"readyState"in c||null!=c.body||(// F
|
|
|
94
827
|
c.readyState="loading",window.addEventListener("load",(function(e){c.readyState="complete"}),!1)),null==i&&null!=a&&(// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest_in_IE6
|
|
95
828
|
i=function(){return new a("Microsoft.XMLHTTP")}),null==Object.create&&(Object.create=function(e){function t(){}return t.prototype=e,new t}),Date.now||(Date.now=function(){return(new Date).getTime()}),null==g){var m=h;h=function(e,t){var n=t.signal;return m(e,{headers:t.headers,credentials:t.credentials,cache:t.cache}).then((function(e){var t=e.body.getReader();return n._reader=t,n._aborted&&n._reader.cancel(),{status:e.status,statusText:e.statusText,headers:e.headers,body:{getReader:function(){return t}}}}))},g=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){null!=this.signal._reader&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function b(){this.bitsNeeded=0,this.codePoint=0}b.prototype.decode=function(e){function t(e,t,n){if(1===n)return e>=128>>t&&e<<t<=2047;if(2===n)return e>=2048>>t&&e<<t<=55295||e>=57344>>t&&e<<t<=65535;if(3===n)return e>=65536>>t&&e<<t<=1114111;throw new Error}function n(e,t){if(6===e)return t>>6>15?3:t>31?2:1;if(12===e)return t>15?3:2;if(18===e)return 3;throw new Error}for(var r=65533,o="",i=this.bitsNeeded,s=this.codePoint,a=0;a<e.length;a+=1){var l=e[a];0!==i&&(l<128||l>191||!t(s<<6|63&l,i-6,n(i,s)))&&(i=0,s=r,o+=String.fromCharCode(s)),0===i?(l>=0&&l<=127?(i=0,s=l):l>=192&&l<=223?(i=6,s=31&l):l>=224&&l<=239?(i=12,s=15&l):l>=240&&l<=247?(i=18,s=7&l):(i=0,s=r),0===i||t(s,i,n(i,s))||(i=0,s=r)):(i-=6,s=s<<6|63&l),0===i&&(s<=65535?o+=String.fromCharCode(s):(o+=String.fromCharCode(55296+(s-65535-1>>10)),o+=String.fromCharCode(56320+(s-65535-1&1023))))}return this.bitsNeeded=i,this.codePoint=s,o};
|
|
96
829
|
// IE, Edge
|
|
97
|
-
null!=
|
|
830
|
+
null!=p&&null!=d&&function(){try{return"test"===(new p).decode((new d).encode("test"),{stream:!0})}catch(e){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+e)}return!1}()||(p=b);var y=function(){};function E(e){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=y,this.onload=y,this.onerror=y,this.onreadystatechange=y,this._contentType="",this._xhr=e,this._sendTimeout=0,this._abort=y}function v(e){return e.replace(/[A-Z]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+32)}))}function T(e){for(
|
|
98
831
|
// Get headers: implemented according to mozilla's example code: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders#Example
|
|
99
|
-
var t=Object.create(null),n=e.split("\r\n"),r=0;r<n.length;r+=1){var o=n[r].split(": "),i=o.shift(),s=o.join(": ");t[
|
|
832
|
+
var t=Object.create(null),n=e.split("\r\n"),r=0;r<n.length;r+=1){var o=n[r].split(": "),i=o.shift(),s=o.join(": ");t[v(i)]=s}this._map=t}function B(){}function _(e){this._headers=e}function w(){}function A(){this._listeners=Object.create(null)}function H(e){r((function(){throw e}),0)}function C(e){this.type=e,this.target=void 0}function S(e,t){C.call(this,e),this.data=t.data,this.lastEventId=t.lastEventId}function L(e,t){C.call(this,e),this.status=t.status,this.statusText=t.statusText,this.headers=t.headers}function P(e,t){C.call(this,e),this.error=t.error}E.prototype.open=function(e,t){this._abort(!0);var n=this,s=this._xhr,a=1,l=0;this._abort=function(e){0!==n._sendTimeout&&(o(n._sendTimeout),n._sendTimeout=0),1!==a&&2!==a&&3!==a||(a=4,s.onload=y,s.onerror=y,s.onabort=y,s.onprogress=y,s.onreadystatechange=y,
|
|
100
833
|
// IE 8 - 9: XDomainRequest#abort() does not fire any event
|
|
101
834
|
// Opera < 10: XMLHttpRequest#abort() does not fire any event
|
|
102
835
|
s.abort(),0!==l&&(o(l),l=0),e||(n.readyState=4,n.onabort(null),n.onreadystatechange())),a=0};var c=function(){if(1===a){
|
|
@@ -110,7 +843,7 @@ e=0,t="",r=void 0}0!==e&&(a=2,n.readyState=2,n.status=e,n.statusText=t,n._conten
|
|
|
110
843
|
}n.readyState=3,n.responseText=e,n.onprogress()}},h=function(e,t){if(null!=t&&null!=t.preventDefault||(t={preventDefault:y}),
|
|
111
844
|
// Firefox 52 fires "readystatechange" (xhr.readyState === 4) without final "readystatechange" (xhr.readyState === 3)
|
|
112
845
|
// IE 8 fires "onload" without "onprogress"
|
|
113
|
-
u(),1===a||2===a||3===a){if(a=4,0!==l&&(o(l),l=0),n.readyState=4,"load"===e)n.onload(t);else if("error"===e)n.onerror(t);else{if("abort"!==e)throw new TypeError;n.onabort(t)}n.onreadystatechange()}},
|
|
846
|
+
u(),1===a||2===a||3===a){if(a=4,0!==l&&(o(l),l=0),n.readyState=4,"load"===e)n.onload(t);else if("error"===e)n.onerror(t);else{if("abort"!==e)throw new TypeError;n.onabort(t)}n.onreadystatechange()}},f=function(){l=r((function(){f()}),500),3===s.readyState&&u()};
|
|
114
847
|
// XDomainRequest#abort removes onprogress, onerror, onload
|
|
115
848
|
"onload"in s&&(s.onload=function(e){h("load",e)}),"onerror"in s&&(s.onerror=function(e){h("error",e)}),
|
|
116
849
|
// improper fix to match Firefox behaviour, but it is better than just ignore abort
|
|
@@ -131,9 +864,9 @@ u(),1===a||2===a||3===a){if(a=4,0!==l&&(o(l),l=0),n.readyState=4,"load"===e)n.on
|
|
|
131
864
|
u():2===s.readyState&&c())}(e)}),!("contentType"in s)&&"ontimeout"in i.prototype||(t+=(-1===t.indexOf("?")?"?":"&")+"padding=true"),s.open(e,t,!0),"readyState"in s&&(
|
|
132
865
|
// workaround for Opera 12 issue with "progress" events
|
|
133
866
|
// #91 (XMLHttpRequest onprogress not fired for streaming response in Edge 14-15-?)
|
|
134
|
-
l=r((function(){
|
|
867
|
+
l=r((function(){f()}),0))},E.prototype.abort=function(){this._abort(!1)},E.prototype.getResponseHeader=function(e){return this._contentType},E.prototype.setRequestHeader=function(e,t){var n=this._xhr;"setRequestHeader"in n&&n.setRequestHeader(e,t)},E.prototype.getAllResponseHeaders=function(){
|
|
135
868
|
// XMLHttpRequest#getAllResponseHeaders returns null for CORS requests in Firefox 3.6.28
|
|
136
|
-
return null!=this._xhr.getAllResponseHeaders&&this._xhr.getAllResponseHeaders()||""},
|
|
869
|
+
return null!=this._xhr.getAllResponseHeaders&&this._xhr.getAllResponseHeaders()||""},E.prototype.send=function(){
|
|
137
870
|
// loading indicator in Safari < ? (6), Chrome < 14, Firefox
|
|
138
871
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=736723
|
|
139
872
|
if("ontimeout"in i.prototype&&("sendAsBinary"in i.prototype||"mozAnon"in i.prototype)||null==c||null==c.readyState||"complete"===c.readyState){var e=this._xhr;
|
|
@@ -142,55 +875,55 @@ if("ontimeout"in i.prototype&&("sendAsBinary"in i.prototype||"mozAnon"in i.proto
|
|
|
142
875
|
// xhr.send(); throws "Not enough arguments" in Firefox 3.0
|
|
143
876
|
e.send(void 0)}catch(e){
|
|
144
877
|
// Safari 5.1.7, Opera 12
|
|
145
|
-
throw e}}else{var t=this;t._sendTimeout=r((function(){t._sendTimeout=0,t.send()}),4)}},
|
|
146
|
-
i.HEADERS_RECEIVED=2),
|
|
878
|
+
throw e}}else{var t=this;t._sendTimeout=r((function(){t._sendTimeout=0,t.send()}),4)}},T.prototype.get=function(e){return this._map[v(e)]},null!=i&&null==i.HEADERS_RECEIVED&&(// IE < 9, Firefox 3.6
|
|
879
|
+
i.HEADERS_RECEIVED=2),B.prototype.open=function(e,t,n,r,o,s,a){e.open("GET",o);var l=0;for(var c in e.onprogress=function(){var t=e.responseText.slice(l);l+=t.length,n(t)},e.onerror=function(e){e.preventDefault(),r(new Error("NetworkError"))},e.onload=function(){r(null)},e.onabort=function(){r(null)},e.onreadystatechange=function(){if(e.readyState===i.HEADERS_RECEIVED){var n=e.status,r=e.statusText,o=e.getResponseHeader("Content-Type"),s=e.getAllResponseHeaders();t(n,r,o,new T(s))}},e.withCredentials=s,a)Object.prototype.hasOwnProperty.call(a,c)&&e.setRequestHeader(c,a[c]);return e.send(),e},_.prototype.get=function(e){return this._headers.get(e)},w.prototype.open=function(e,t,n,r,o,i,s){var a=null,l=new g,c=l.signal,f=new p;return h(o,{headers:s,credentials:i?"include":"same-origin",signal:c,cache:"no-store"}).then((function(e){
|
|
147
880
|
// see https://github.com/promises-aplus/promises-spec/issues/179
|
|
148
|
-
return a=e.body.getReader(),t(e.status,e.statusText,e.headers.get("Content-Type"),new
|
|
881
|
+
return a=e.body.getReader(),t(e.status,e.statusText,e.headers.get("Content-Type"),new _(e.headers)),new u((function(e,t){var r=function(){a.read().then((function(t){if(t.done)
|
|
149
882
|
//Note: bytes in textDecoder are ignored
|
|
150
|
-
e(void 0);else{var o=
|
|
883
|
+
e(void 0);else{var o=f.decode(t.value,{stream:!0});n(o),r()}})).catch((function(e){t(e)}))};r()}))})).catch((function(e){return"AbortError"===e.name?void 0:e})).then((function(e){r(e)})),{abort:function(){null!=a&&a.cancel(),l.abort()}}},A.prototype.dispatchEvent=function(e){e.target=this;var t=this._listeners[e.type];if(null!=t)for(var n=t.length,r=0;r<n;r+=1){var o=t[r];try{"function"==typeof o.handleEvent?o.handleEvent(e):o.call(this,e)}catch(e){H(e)}}},A.prototype.addEventListener=function(e,t){e=String(e);var n=this._listeners,r=n[e];null==r&&(r=[],n[e]=r);for(var o=!1,i=0;i<r.length;i+=1)r[i]===t&&(o=!0);o||r.push(t)},A.prototype.removeEventListener=function(e,t){e=String(e);var n=this._listeners,r=n[e];if(null!=r){for(var o=[],i=0;i<r.length;i+=1)r[i]!==t&&o.push(r[i]);0===o.length?delete n[e]:n[e]=o}},S.prototype=Object.create(C.prototype),L.prototype=Object.create(C.prototype),P.prototype=Object.create(C.prototype);var R=-1,N=0,O=1,I=2,M=-1,D=0,x=1,$=2,U=3,G=/^text\/event\-stream(;.*)?$/i,k=function(e,t){var n=null==e?t:parseInt(e,10);return n!=n&&(n=t),F(n)},F=function(e){return Math.min(Math.max(e,1e3),18e6)},j=function(e,t,n){try{"function"==typeof t&&t.call(e,n)}catch(e){H(e)}};function V(e,t){A.call(this),t=t||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,function(e,t,n){t=String(t);var a=Boolean(n.withCredentials),l=n.lastEventIdQueryParameterName||"lastEventId",c=F(1e3),u=k(n.heartbeatTimeout,45e3),h="",f=c,p=!1,d=0,g=n.headers||{},m=n.Transport,b=K&&null==m?void 0:new E(null!=m?new m:null!=i&&"withCredentials"in i.prototype||null==s?new i:new s),y=null!=m&&"string"!=typeof m?new m:null==b?new w:new B,v=void 0,T=0,_=R,A="",H="",C="",V="",X=D,Z=0,W=0,z=function(t,n,r,o){if(_===N)if(200===t&&null!=r&&G.test(r)){_=O,p=Date.now(),f=c,e.readyState=O;var i=new L("open",{status:t,statusText:n,headers:o});e.dispatchEvent(i),j(e,e.onopen,i)}else{var s="";200!==t?(n&&(n=n.replace(/\s+/g," ")),s="EventSource's response has a status "+t+" "+n+" that is not 200. Aborting the connection."):s="EventSource's response has a Content-Type specifying an unsupported type: "+(null==r?"-":r.replace(/\s+/g," "))+". Aborting the connection.",J();i=new L("error",{status:t,statusText:n,headers:o});e.dispatchEvent(i),j(e,e.onerror,i),console.error(s)}},Y=function(t){if(_===O){for(var n=-1,i=0;i<t.length;i+=1){(l=t.charCodeAt(i))!=="\n".charCodeAt(0)&&l!=="\r".charCodeAt(0)||(n=i)}var s=(-1!==n?V:"")+t.slice(0,n+1);V=(-1===n?V:"")+t.slice(n+1),""!==t&&(p=Date.now(),d+=t.length);for(var a=0;a<s.length;a+=1){var l=s.charCodeAt(a);if(X===M&&l==="\n".charCodeAt(0))X=D;else if(X===M&&(X=D),l==="\r".charCodeAt(0)||l==="\n".charCodeAt(0)){if(X!==D){X===x&&(W=a+1);var g=s.slice(Z,W-1),m=s.slice(W+(W<a&&s.charCodeAt(W)===" ".charCodeAt(0)?1:0),a);"data"===g?(A+="\n",A+=m):"id"===g?H=m:"event"===g?C=m:"retry"===g?(c=k(m,c),f=c):"heartbeatTimeout"===g&&(u=k(m,u),0!==T&&(o(T),T=r((function(){Q()}),u)))}if(X===D){if(""!==A){h=H,""===C&&(C="message");var b=new S(C,{data:A.slice(1),lastEventId:H});if(e.dispatchEvent(b),"open"===C?j(e,e.onopen,b):"message"===C?j(e,e.onmessage,b):"error"===C&&j(e,e.onerror,b),_===I)return}A="",C=""}X=l==="\r".charCodeAt(0)?M:D}else X===D&&(Z=a,X=x),X===x?l===":".charCodeAt(0)&&(W=a+1,X=$):X===$&&(X=U)}}},q=function(t){if(_===O||_===N){_=R,0!==T&&(o(T),T=0),T=r((function(){Q()}),f),f=F(Math.min(16*c,2*f)),e.readyState=N;var n=new P("error",{error:t});e.dispatchEvent(n),j(e,e.onerror,n),null!=t&&console.error(t)}},J=function(){_=I,null!=v&&(v.abort(),v=void 0),0!==T&&(o(T),T=0),e.readyState=I},Q=function(){if(T=0,_===R){p=!1,d=0,T=r((function(){Q()}),u),_=N,A="",C="",H=h,V="",Z=0,W=0,X=D;
|
|
151
884
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=428916
|
|
152
885
|
// Request header field Last-Event-ID is not allowed by Access-Control-Allow-Headers.
|
|
153
886
|
var n=t;if("data:"!==t.slice(0,5)&&"blob:"!==t.slice(0,5)&&""!==h){
|
|
154
887
|
// Remove the lastEventId parameter if it's already part of the request URL.
|
|
155
888
|
var o=t.indexOf("?");n=-1===o?t:t.slice(0,o+1)+t.slice(o+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,(function(e,t){return t===l?"":e})),
|
|
156
889
|
// Append the current lastEventId to the request URL.
|
|
157
|
-
n+=(-1===t.indexOf("?")?"?":"&")+l+"="+encodeURIComponent(h)}var i=e.withCredentials,s={Accept:"text/event-stream"},a=e.headers;if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(s[c]=a[c]);try{
|
|
890
|
+
n+=(-1===t.indexOf("?")?"?":"&")+l+"="+encodeURIComponent(h)}var i=e.withCredentials,s={Accept:"text/event-stream"},a=e.headers;if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(s[c]=a[c]);try{v=y.open(b,z,Y,q,n,i,s)}catch(e){throw J(),e}}else if(p||null==v){var f=Math.max((p||Date.now())+u-Date.now(),1);p=!1,T=r((function(){Q()}),f)}else q(new Error("No activity within "+u+" milliseconds. "+(_===N?"No response received.":d+" chars received.")+" Reconnecting.")),null!=v&&(v.abort(),v=void 0)};e.url=t,e.readyState=N,e.withCredentials=a,e.headers=g,e._close=J,Q()}(this,e,t)}var K=null!=h&&null!=f&&"body"in f.prototype;V.prototype=Object.create(A.prototype),V.prototype.CONNECTING=N,V.prototype.OPEN=O,V.prototype.CLOSED=I,V.prototype.close=function(){this._close()},V.CONNECTING=N,V.OPEN=O,V.CLOSED=I,V.prototype.withCredentials=void 0;var X,Z=l;null==i||null!=l&&"withCredentials"in l.prototype||(
|
|
158
891
|
// Why replace a native EventSource ?
|
|
159
892
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=444328
|
|
160
893
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=831392
|
|
161
894
|
// https://code.google.com/p/chromium/issues/detail?id=260144
|
|
162
895
|
// https://code.google.com/p/chromium/issues/detail?id=225654
|
|
163
896
|
// ...
|
|
164
|
-
|
|
165
|
-
// .map(line => `${line.key} Level: ${getTitleByIndex(line.index)}`);
|
|
166
|
-
return be(e.status,{active:()=>t!==oe.claimable?s([{key:"current",index:o},{key:"next",index:o+1}]):t===oe.claimable?s([{key:"first",index:0},{key:"next",index:1}]):void 0,other:()=>s([{key:"last",index:i},{key:"previous",index:i-1}])})},Be=(e,t,n)=>{const{currency:r,currentLevelIncrement:o,gap:i,currentLevel:s}=e.wageringProgress,a=Z(r),l=t[s-1];switch(n){case"target":switch(e.wageringType){case se.Money:return`Play for ${a}${o} in total`;case se.BetCount:return`Place ${o}/${null==l?void 0:l.maxContribution} bets of at least ${null==l?void 0:l.minStake} each`}case"remaining":switch(e.wageringType){case se.Money:return`Remaining: ${a}${i}`;case se.BetCount:return`Bets Remaining: ${i} bets`}case"got":const t=Se(e);switch(e.wageringType){case se.Money:return`Wagered: ${a}${t}`;case se.BetCount:return`Bets Placed: ${t} bets`}}},Ae=(e,t)=>({target:()=>be(e.status,{active:()=>Be(e,t,"target"),other:()=>`This bonus is ${e.status}`}),remaining:()=>Be(e,t,"remaining"),got:()=>Be(e,t,"got")}),Se=e=>{if(!e.wageringProgress)return 0;const{currency:t,currentLevelIncrement:n,gap:r,currentLevel:o}=e.wageringProgress;return n-r},_e=(e,t,n,r)=>{const o=q(e);o<0?n():(r(Q(e)),
|
|
167
|
-
// check if bonus will expire
|
|
168
|
-
o<t&&setTimeout((()=>{fe({type:"OnWageringBonusExpired"})}),o))},He=[];
|
|
897
|
+
Z=V),X=function(e){e.EventSourcePolyfill=V,e.NativeEventSource=l,e.EventSource=Z}(t),void 0!==X&&(e.exports=X)}("undefined"==typeof globalThis?"undefined"!=typeof window?window:"undefined"!=typeof self?self:x:globalThis)}));const q=e=>{const t=(n=e,e=>{Object.keys(n).map((t=>{if(e.data&&e.data.type==t){const r=F(e.data,["type"]);n[t](r)}}))});var n;v((()=>(window.addEventListener("message",t),()=>{window.removeEventListener("message",t)})))},J=(e,t)=>{e&&(e.removeEventListener("message",t),e.close())},Q=(e,t,n,r)=>{if(!n.length)return;const o={bonusWalletIDs:null==n?void 0:n.filter((e=>te(e))).map((e=>e.id)).join(","),XSessionId:t};if(!o.bonusWalletIDs)return;const i=`${e}/bonus/wagering/updates?${(e=>Object.keys(e).map((t=>`${t}=${e[t]}`)).join("&"))(o)}`;return((e,t)=>{let n;return n=EventSource?new EventSource(e):new Y.EventSourcePolyfill(e,{headers:{accept:"text/event-stream"}}),n.addEventListener("message",t),n})(i,r)},ee=async(e,t,n={})=>{const{limit:r,lang:o,status:i}=n,s=F(n,["limit","lang","status"]),a=Object.assign(Object.assign({type:"wagering",pagination:`limit=${r||50},offset=0`,language:o},i&&i!==X.claimable?{status:i}:{}),s),l=i===X.claimable?"claimable":"granted",c=new URL(`${e}/bonus/${l}`);return Object.keys(a).map((e=>{c.searchParams.append(e,a[e])})),await K(c,{headers:Object.assign({},t?{"x-SessionId":t}:{})})},te=e=>!!e.bonusWalletID&&((e,t)=>{switch(e){case X.completed:case X.released:case X.expired:case X.closed:case X.forfeited:return t.other();case X.active:return t.active();default:throw new Error(`unknown Bonus Status: ${e}`)}})(e.status,{active:()=>!0,other:()=>!1}),ne=[];
|
|
169
898
|
/**
|
|
170
899
|
* Create a `Writable` store that allows both updating and reading by subscription.
|
|
171
900
|
* @param {*=}value initial value
|
|
172
901
|
* @param {StartStopNotifier=}start start and stop notifications for subscriptions
|
|
173
902
|
*/
|
|
174
|
-
function
|
|
175
|
-
const e=!
|
|
903
|
+
function re(t,n=e){let r;const o=new Set;function i(e){if(s(t,e)&&(t=e,r)){// store is ready
|
|
904
|
+
const e=!ne.length;for(const e of o)e[1](),ne.push(e,t);if(e){for(let e=0;e<ne.length;e+=2)ne[e][0](ne[e+1]);ne.length=0}}}return{set:i,update:function(e){i(e(t))},subscribe:function(s,a=e){const l=[s,a];return o.add(l),1===o.size&&(r=n(i)||e),s(t),()=>{o.delete(l),0===o.size&&r&&(r(),r=null)}}}}function oe(t,n,r){const s=!Array.isArray(t),a=s?[t]:t,l=n.length<2;return c=t=>{let r=!1;const c=[];let u=0,h=e;const f=()=>{if(u)return;h();const r=n(s?c[0]:c,t);l?t(r):h=i(r)?r:e},p=a.map(((t,n)=>function(t,...n){if(null==t)return e;const r=t.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}(t,(e=>{c[n]=e,u&=~(1<<n),r&&f()}),(()=>{u|=1<<n}))));return r=!0,f(),function(){o(p),h(),
|
|
905
|
+
// We need to set this to false because callbacks can still happen despite having unsubscribed:
|
|
906
|
+
// Callbacks might already be placed in the queue which doesn't know it should no longer
|
|
907
|
+
// invoke this derived store.
|
|
908
|
+
r=!1}},{subscribe:re(r,c).subscribe};
|
|
176
909
|
/**
|
|
177
910
|
* Creates a `Readable` store that allows reading by subscription.
|
|
178
911
|
* @param value initial value
|
|
179
912
|
* @param {StartStopNotifier}start start and stop notifications for subscriptions
|
|
180
913
|
*/
|
|
181
|
-
var c}var
|
|
914
|
+
var c}var ie=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===se}(e)}
|
|
182
915
|
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
|
183
|
-
(e)};var
|
|
916
|
+
(e)};var se="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function ae(e,t){return!1!==t.clone&&t.isMergeableObject(e)?fe((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function le(e,t,n){return e.concat(t).map((function(e){return ae(e,n)}))}function ce(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function ue(e,t){try{return t in e}catch(e){return!1}}
|
|
184
917
|
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
|
185
|
-
function
|
|
186
|
-
})(e,o)||(
|
|
918
|
+
function he(e,t,n){var r={};return n.isMergeableObject(e)&&ce(e).forEach((function(t){r[t]=ae(e[t],n)})),ce(t).forEach((function(o){(function(e,t){return ue(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t));// and also unsafe if they're nonenumerable.
|
|
919
|
+
})(e,o)||(ue(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return fe;var n=t.customMerge(e);return"function"==typeof n?n:fe}(o,n)(e[o],t[o],n):r[o]=ae(t[o],n))})),r}function fe(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||le,n.isMergeableObject=n.isMergeableObject||ie,
|
|
187
920
|
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
|
188
921
|
// implementations can use it. The caller may not replace it.
|
|
189
|
-
n.cloneUnlessOtherwiseSpecified=
|
|
922
|
+
n.cloneUnlessOtherwiseSpecified=ae;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):he(e,t,n):ae(t,n)}fe.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return fe(e,n,t)}),{})};var pe,de,ge,me=fe;
|
|
190
923
|
/**
|
|
191
924
|
* Type Guards
|
|
192
925
|
*/
|
|
193
|
-
function
|
|
926
|
+
function be(e){return e.type===de.literal}function ye(e){return e.type===de.argument}function Ee(e){return e.type===de.number}function ve(e){return e.type===de.date}function Te(e){return e.type===de.time}function Be(e){return e.type===de.select}function _e(e){return e.type===de.plural}function we(e){return e.type===de.pound}function Ae(e){return e.type===de.tag}function He(e){return!(!e||"object"!=typeof e||e.type!==ge.number)}function Ce(e){return!(!e||"object"!=typeof e||e.type!==ge.dateTime)}
|
|
194
927
|
// @generated from regex-gen.ts
|
|
195
928
|
!function(e){
|
|
196
929
|
/** Argument is unclosed (e.g. `{0`) */
|
|
@@ -252,7 +985,7 @@ e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",
|
|
|
252
985
|
/** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
|
|
253
986
|
e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",
|
|
254
987
|
/** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
|
|
255
|
-
e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(
|
|
988
|
+
e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(pe||(pe={})),function(e){
|
|
256
989
|
/**
|
|
257
990
|
* Raw text
|
|
258
991
|
*/
|
|
@@ -289,7 +1022,7 @@ e[e.pound=7]="pound",
|
|
|
289
1022
|
/**
|
|
290
1023
|
* XML-like tag
|
|
291
1024
|
*/
|
|
292
|
-
e[e.tag=8]="tag"}(
|
|
1025
|
+
e[e.tag=8]="tag"}(de||(de={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(ge||(ge={}));var Se=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Le=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
293
1026
|
/**
|
|
294
1027
|
* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
295
1028
|
* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js
|
|
@@ -301,7 +1034,7 @@ e[e.tag=8]="tag"}(Ue||(Ue={})),function(e){e[e.number=0]="number",e[e.dateTime=1
|
|
|
301
1034
|
* @public
|
|
302
1035
|
* @param skeleton skeleton string
|
|
303
1036
|
*/
|
|
304
|
-
function
|
|
1037
|
+
function Pe(e){var t={};return e.replace(Le,(function(e){var n=e.length;switch(e[0]){
|
|
305
1038
|
// Era
|
|
306
1039
|
case"G":t.era=4===n?"long":5===n?"narrow":"short";break;
|
|
307
1040
|
// Year
|
|
@@ -335,33 +1068,33 @@ case"X":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
|
335
1068
|
case"x":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
336
1069
|
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}
|
|
337
1070
|
// @generated from regex-gen.ts
|
|
338
|
-
var
|
|
1071
|
+
var Re=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var Ne=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Oe=/^(@+)?(\+|#+)?[rs]?$/g,Ie=/(\*)(0+)|(#+)(0+)|(0+)/g,Me=/^(0+)$/;function De(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(Oe,(function(e,n,r){
|
|
339
1072
|
// @@@ case
|
|
340
|
-
return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function
|
|
1073
|
+
return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function xe(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function $e(e){
|
|
341
1074
|
// Engineering
|
|
342
|
-
var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!
|
|
1075
|
+
var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!Me.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Ue(e){var t=xe(e);return t||{}}
|
|
343
1076
|
/**
|
|
344
1077
|
* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options
|
|
345
|
-
*/function
|
|
1078
|
+
*/function Ge(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=o.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=k(k(k({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return k(k({},e),Ue(t))}),{}));continue;case"engineering":t=k(k(k({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return k(k({},e),Ue(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;
|
|
346
1079
|
// https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
|
|
347
1080
|
case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;
|
|
348
1081
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
349
|
-
case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(
|
|
1082
|
+
case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(Ie,(function(e,n,r,o,i,s){if(n)t.minimumIntegerDigits=r.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}
|
|
350
1083
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
351
|
-
if(
|
|
1084
|
+
if(Me.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(Ne.test(o.stem)){
|
|
352
1085
|
// Precision
|
|
353
1086
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision
|
|
354
1087
|
// precision-integer case
|
|
355
|
-
if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(
|
|
1088
|
+
if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(Ne,(function(e,n,r,o,i,s){
|
|
356
1089
|
// .000* case (before ICU67 it was .000+)
|
|
357
1090
|
return"*"===r?t.minimumFractionDigits=n.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&s?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+s.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var i=o.options[0];
|
|
358
1091
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
|
|
359
|
-
"w"===i?t=
|
|
1092
|
+
"w"===i?t=k(k({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=k(k({},t),De(i)))}
|
|
360
1093
|
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision
|
|
361
|
-
else if(
|
|
1094
|
+
else if(Oe.test(o.stem))t=k(k({},t),De(o.stem));else{var s=xe(o.stem);s&&(t=k(k({},t),s));var a=$e(o.stem);a&&(t=k(k({},t),a))}}return t}
|
|
362
1095
|
// @generated from time-data-gen.ts
|
|
363
1096
|
// prettier-ignore
|
|
364
|
-
var
|
|
1097
|
+
var ke,Fe={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};
|
|
365
1098
|
/**
|
|
366
1099
|
* Returns the best matching date time pattern if a date time skeleton
|
|
367
1100
|
* pattern is provided with a locale. Follows the Unicode specification:
|
|
@@ -374,7 +1107,7 @@ var ft,dt={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H
|
|
|
374
1107
|
* of the given `locale` to the corresponding time pattern.
|
|
375
1108
|
* @param locale
|
|
376
1109
|
*/
|
|
377
|
-
function
|
|
1110
|
+
function je(e){var t=e.hourCycle;if(void 0===t&&
|
|
378
1111
|
// @ts-ignore hourCycle(s) is not identified yet
|
|
379
1112
|
e.hourCycles&&
|
|
380
1113
|
// @ts-ignore
|
|
@@ -382,37 +1115,37 @@ e.hourCycles.length&&(
|
|
|
382
1115
|
// @ts-ignore
|
|
383
1116
|
t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}
|
|
384
1117
|
// TODO: Once hourCycle is fully supported remove the following with data generation
|
|
385
|
-
var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(
|
|
1118
|
+
var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(Fe[n||""]||Fe[r||""]||Fe["".concat(r,"-001")]||Fe["001"])[0]}var Ve=new RegExp("^".concat(Se.source,"*")),Ke=new RegExp("".concat(Se.source,"*$"));function Xe(e,t){return{start:e,end:t}}
|
|
386
1119
|
// #region Ponyfills
|
|
387
1120
|
// Consolidate these variables up top for easier toggling during debugging
|
|
388
|
-
var
|
|
1121
|
+
var Ze=!!String.prototype.startsWith,We=!!String.fromCodePoint,ze=!!Object.fromEntries,Ye=!!String.prototype.codePointAt,qe=!!String.prototype.trimStart,Je=!!String.prototype.trimEnd,Qe=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},et=!0;try{
|
|
389
1122
|
/**
|
|
390
1123
|
* legacy Edge or Xbox One browser
|
|
391
1124
|
* Unicode flag support: supported
|
|
392
1125
|
* Pattern_Syntax support: not supported
|
|
393
1126
|
* See https://github.com/formatjs/formatjs/issues/2822
|
|
394
1127
|
*/
|
|
395
|
-
|
|
1128
|
+
et="a"===(null===(ke=lt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===ke?void 0:ke[0])}catch(e){et=!1}var tt,nt=Ze?// Native
|
|
396
1129
|
function(e,t,n){return e.startsWith(t,n)}:// For IE11
|
|
397
|
-
function(e,t,n){return e.slice(n,n+t.length)===t},
|
|
398
|
-
function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n,r="",o=e.length,i=0;o>i;){if((n=e[i++])>1114111)throw RangeError(n+" is not a valid code point");r+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return r},
|
|
1130
|
+
function(e,t,n){return e.slice(n,n+t.length)===t},rt=We?String.fromCodePoint:// IE11
|
|
1131
|
+
function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n,r="",o=e.length,i=0;o>i;){if((n=e[i++])>1114111)throw RangeError(n+" is not a valid code point");r+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return r},ot=
|
|
399
1132
|
// native
|
|
400
|
-
|
|
401
|
-
function(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n],i=o[0],s=o[1];t[i]=s}return t},
|
|
1133
|
+
ze?Object.fromEntries:// Ponyfill
|
|
1134
|
+
function(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n],i=o[0],s=o[1];t[i]=s}return t},it=Ye?// Native
|
|
402
1135
|
function(e,t){return e.codePointAt(t)}:// IE 11
|
|
403
|
-
function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,o=e.charCodeAt(t);return o<55296||o>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?o:r-56320+(o-55296<<10)+65536}},
|
|
1136
|
+
function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,o=e.charCodeAt(t);return o<55296||o>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?o:r-56320+(o-55296<<10)+65536}},st=qe?// Native
|
|
404
1137
|
function(e){return e.trimStart()}:// Ponyfill
|
|
405
|
-
function(e){return e.replace(
|
|
1138
|
+
function(e){return e.replace(Ve,"")},at=Je?// Native
|
|
406
1139
|
function(e){return e.trimEnd()}:// Ponyfill
|
|
407
|
-
function(e){return e.replace(
|
|
1140
|
+
function(e){return e.replace(Ke,"")};
|
|
408
1141
|
// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.
|
|
409
|
-
function
|
|
1142
|
+
function lt(e,t){return new RegExp(e,t)}
|
|
410
1143
|
// #endregion
|
|
411
|
-
if(
|
|
1144
|
+
if(et){
|
|
412
1145
|
// Native
|
|
413
|
-
var
|
|
1146
|
+
var ct=lt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");tt=function(e,t){var n;return ct.lastIndex=t,null!==(n=ct.exec(e)[1])&&void 0!==n?n:""}}else
|
|
414
1147
|
// IE11
|
|
415
|
-
|
|
1148
|
+
tt=function(e,t){for(var n=[];;){var r=it(e,t);if(void 0===r||pt(r)||dt(r))break;n.push(r),t+=r>=65536?2:1}return rt.apply(void 0,n)};var ut=/** @class */function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var o=this.char();if(123/* `{` */===o){if((i=this.parseArgument(e,n)).err)return i;r.push(i.val)}else{if(125/* `}` */===o&&e>0)break;if(35/* `#` */!==o||"plural"!==t&&"selectordinal"!==t){if(60/* `<` */===o&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(pe.UNMATCHED_CLOSING_TAG,Xe(this.clonePosition(),this.clonePosition()))}if(60/* `<` */===o&&!this.ignoreTag&&ht(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;r.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;r.push(i.val)}}else{var s=this.clonePosition();this.bump(),r.push({type:de.pound,location:Xe(s,this.clonePosition())})}}}return{val:r,err:null}},
|
|
416
1149
|
/**
|
|
417
1150
|
* A tag name must start with an ASCII lower/upper case letter. The grammar is based on the
|
|
418
1151
|
* [custom element name][] except that a dash is NOT always mandatory and uppercase letters
|
|
@@ -434,14 +1167,14 @@ _t=function(e,t){for(var n=[];;){var r=Rt(e,t);if(void 0===r||kt(r)||Ut(r))break
|
|
|
434
1167
|
e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();// `<`
|
|
435
1168
|
var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))
|
|
436
1169
|
// Self closing tag
|
|
437
|
-
return{val:{type:
|
|
1170
|
+
return{val:{type:de.literal,value:"<".concat(r,"/>"),location:Xe(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var i=o.val,s=this.clonePosition();
|
|
438
1171
|
// Expecting a close tag
|
|
439
|
-
if(this.bumpIf("</")){if(this.isEOF()
|
|
1172
|
+
if(this.bumpIf("</")){if(this.isEOF()||!ht(this.char()))return this.error(pe.INVALID_TAG,Xe(s,this.clonePosition()));var a=this.clonePosition();return r!==this.parseTagName()?this.error(pe.UNMATCHED_CLOSING_TAG,Xe(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:de.tag,value:r,children:i,location:Xe(n,this.clonePosition())},err:null}:this.error(pe.INVALID_TAG,Xe(s,this.clonePosition())))}return this.error(pe.UNCLOSED_TAG,Xe(n,this.clonePosition()))}return this.error(pe.INVALID_TAG,Xe(n,this.clonePosition()))},
|
|
440
1173
|
/**
|
|
441
1174
|
* This method assumes that the caller has peeked ahead for the first tag character.
|
|
442
1175
|
*/
|
|
443
1176
|
e.prototype.parseTagName=function(){var e=this.offset();// the first tag name character
|
|
444
|
-
for(this.bump();!this.isEOF()&&
|
|
1177
|
+
for(this.bump();!this.isEOF()&&ft(this.char());)this.bump();return this.message.slice(e,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(t);if(o)r+=o;else{var i=this.tryParseUnquoted(e,t);if(i)r+=i;else{var s=this.tryParseLeftAngleBracket();if(!s)break;r+=s}}}var a=Xe(n,this.clonePosition());return{val:{type:de.literal,value:r,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60/* `<` */!==this.char()||!this.ignoreTag&&(ht(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e;
|
|
445
1178
|
/** See `parseTag` function docs. */},
|
|
446
1179
|
/**
|
|
447
1180
|
* Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes
|
|
@@ -463,67 +1196,67 @@ for(this.bump();!this.isEOF();){var n=this.char();if(39/* `'` */===n){if(39/* `'
|
|
|
463
1196
|
// Optional closing apostrophe.
|
|
464
1197
|
this.bump();break}t.push(39),
|
|
465
1198
|
// Bump one more time because we need to skip 2 characters.
|
|
466
|
-
this.bump()}else t.push(n);this.bump()}return
|
|
467
|
-
this.bumpSpace(),this.isEOF())return this.error(
|
|
1199
|
+
this.bump()}else t.push(n);this.bump()}return rt.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60/* `<` */===n||123/* `{` */===n||35/* `#` */===n&&("plural"===t||"selectordinal"===t)||125/* `}` */===n&&e>0?null:(this.bump(),rt(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),// `{`
|
|
1200
|
+
this.bumpSpace(),this.isEOF())return this.error(pe.EXPECT_ARGUMENT_CLOSING_BRACE,Xe(n,this.clonePosition()));if(125/* `}` */===this.char())return this.bump(),this.error(pe.EMPTY_ARGUMENT,Xe(n,this.clonePosition()));
|
|
468
1201
|
// argument name
|
|
469
|
-
var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(
|
|
1202
|
+
var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(pe.MALFORMED_ARGUMENT,Xe(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(pe.EXPECT_ARGUMENT_CLOSING_BRACE,Xe(n,this.clonePosition()));switch(this.char()){
|
|
470
1203
|
// Simple argument: `{name}`
|
|
471
1204
|
case 125/* `}` */:// `}`
|
|
472
|
-
return this.bump(),{val:{type:
|
|
1205
|
+
return this.bump(),{val:{type:de.argument,
|
|
473
1206
|
// value does not include the opening and closing braces.
|
|
474
|
-
value:r,location:
|
|
1207
|
+
value:r,location:Xe(n,this.clonePosition())},err:null};
|
|
475
1208
|
// Argument with options: `{name, format, ...}`
|
|
476
1209
|
case 44/* `,` */:return this.bump(),// `,`
|
|
477
|
-
this.bumpSpace(),this.isEOF()?this.error(
|
|
1210
|
+
this.bumpSpace(),this.isEOF()?this.error(pe.EXPECT_ARGUMENT_CLOSING_BRACE,Xe(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(pe.MALFORMED_ARGUMENT,Xe(n,this.clonePosition()))}},
|
|
478
1211
|
/**
|
|
479
1212
|
* Advance the parser until the end of the identifier, if it is currently on
|
|
480
1213
|
* an identifier character. Return an empty string otherwise.
|
|
481
1214
|
*/
|
|
482
|
-
e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=
|
|
1215
|
+
e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=tt(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:Xe(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,r){var o,i=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();
|
|
483
1216
|
// Parse this range:
|
|
484
1217
|
// {name, type, style}
|
|
485
1218
|
// ^---^
|
|
486
1219
|
switch(s){case"":
|
|
487
1220
|
// Expecting a style string number, date, time, plural, selectordinal, or select.
|
|
488
|
-
return this.error(
|
|
1221
|
+
return this.error(pe.EXPECT_ARGUMENT_TYPE,Xe(i,a));case"number":case"date":case"time":
|
|
489
1222
|
// Parse this range:
|
|
490
1223
|
// {name, number, style}
|
|
491
1224
|
// ^-------^
|
|
492
|
-
this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((b=this.parseSimpleArgStyleIfPossible()).err)return b;if(0===(
|
|
1225
|
+
this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((b=this.parseSimpleArgStyleIfPossible()).err)return b;if(0===(p=at(b.val)).length)return this.error(pe.EXPECT_ARGUMENT_STYLE,Xe(this.clonePosition(),this.clonePosition()));l={style:p,styleLocation:Xe(c,this.clonePosition())}}if((y=this.tryParseArgumentClose(r)).err)return y;var u=Xe(r,this.clonePosition());
|
|
493
1226
|
// Extract style or skeleton
|
|
494
|
-
if(l&&
|
|
1227
|
+
if(l&&nt(null==l?void 0:l.style,"::",0)){
|
|
495
1228
|
// Skeleton starts with `::`.
|
|
496
|
-
var h=
|
|
1229
|
+
var h=st(l.style.slice(2));if("number"===s)return(b=this.parseNumberSkeletonFromString(h,l.styleLocation)).err?b:{val:{type:de.number,value:n,location:u,style:b.val},err:null};if(0===h.length)return this.error(pe.EXPECT_DATE_TIME_SKELETON,u);var f=h;
|
|
497
1230
|
// Get "best match" pattern only if locale is passed, if not, let it
|
|
498
1231
|
// pass as-is where `parseDateTimeSkeleton()` will throw an error
|
|
499
1232
|
// for unsupported patterns.
|
|
500
|
-
this.locale&&(
|
|
1233
|
+
this.locale&&(f=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e.charAt(r);if("j"===o){for(var i=0;r+1<e.length&&e.charAt(r+1)===o;)i++,r++;var s=1+(1&i),a=i<2?1:3+(i>>1),l=je(t);for("H"!=l&&"k"!=l||(a=0);a-- >0;)n+="a";for(;s-- >0;)n=l+n}else n+="J"===o?"H":o}return n}(h,this.locale));var p={type:ge.dateTime,pattern:f,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?Pe(f):{}};return{val:{type:"date"===s?de.date:de.time,value:n,location:u,style:p},err:null}}
|
|
501
1234
|
// Regular style or no style.
|
|
502
|
-
return{val:{type:"number"===s?
|
|
1235
|
+
return{val:{type:"number"===s?de.number:"date"===s?de.date:de.time,value:n,location:u,style:null!==(o=null==l?void 0:l.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":
|
|
503
1236
|
// Parse this range:
|
|
504
1237
|
// {name, plural, options}
|
|
505
1238
|
// ^---------^
|
|
506
|
-
var d=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(
|
|
1239
|
+
var d=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(pe.EXPECT_SELECT_ARGUMENT_OPTIONS,Xe(d,k({},d)));this.bumpSpace();
|
|
507
1240
|
// Parse offset:
|
|
508
1241
|
// {name, plural, offset:1, options}
|
|
509
1242
|
// ^-----^
|
|
510
1243
|
// or the first option:
|
|
511
1244
|
// {name, plural, one {...} other {...}}
|
|
512
1245
|
// ^--^
|
|
513
|
-
var g=this.parseIdentifierIfPossible(),m=0;if("select"!==s&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(
|
|
1246
|
+
var g=this.parseIdentifierIfPossible(),m=0;if("select"!==s&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(pe.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Xe(this.clonePosition(),this.clonePosition()));var b;if(this.bumpSpace(),(b=this.tryParseDecimalInteger(pe.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,pe.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return b;
|
|
514
1247
|
// Parse another identifier for option parsing
|
|
515
|
-
this.bumpSpace(),g=this.parseIdentifierIfPossible(),m=b.val}var y,
|
|
1248
|
+
this.bumpSpace(),g=this.parseIdentifierIfPossible(),m=b.val}var y,E=this.tryParsePluralOrSelectOptions(e,s,t,g);if(E.err)return E;if((y=this.tryParseArgumentClose(r)).err)return y;var v=Xe(r,this.clonePosition());return"select"===s?{val:{type:de.select,value:n,options:ot(E.val),location:v},err:null}:{val:{type:de.plural,value:n,options:ot(E.val),offset:m,pluralType:"plural"===s?"cardinal":"ordinal",location:v},err:null};default:return this.error(pe.INVALID_ARGUMENT_TYPE,Xe(i,a))}},e.prototype.tryParseArgumentClose=function(e){
|
|
516
1249
|
// Parse: {value, number, ::currency/GBP }
|
|
517
|
-
return this.isEOF()||125/* `}` */!==this.char()?this.error(
|
|
1250
|
+
return this.isEOF()||125/* `}` */!==this.char()?this.error(pe.EXPECT_ARGUMENT_CLOSING_BRACE,Xe(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},
|
|
518
1251
|
/**
|
|
519
1252
|
* See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659
|
|
520
1253
|
*/
|
|
521
1254
|
e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39/* `'` */:
|
|
522
1255
|
// Treat apostrophe as quoting but include it in the style part.
|
|
523
1256
|
// Find the end of the quoted literal text.
|
|
524
|
-
this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(
|
|
1257
|
+
this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(pe.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Xe(n,this.clonePosition()));this.bump();break;case 123/* `{` */:e+=1,this.bump();break;case 125/* `}` */:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");
|
|
525
1258
|
// Parse the skeleton
|
|
526
|
-
for(var t=e.split(
|
|
1259
|
+
for(var t=e.split(Re).filter((function(e){return e.length>0})),n=[],r=0,o=t;r<o.length;r++){var i=o[r].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var s=i[0],a=i.slice(1),l=0,c=a;l<c.length;l++)if(0===c[l].length)throw new Error("Invalid number skeleton");n.push({stem:s,options:a})}return n}(e)}catch(e){return this.error(pe.INVALID_NUMBER_SKELETON,t)}return{val:{type:ge.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?Ge(n):{}},err:null}},
|
|
527
1260
|
/**
|
|
528
1261
|
* @param nesting_level The current nesting level of messages.
|
|
529
1262
|
* This can be positive when parsing message fragment in select or plural argument options.
|
|
@@ -540,24 +1273,24 @@ e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){
|
|
|
540
1273
|
// ^--^
|
|
541
1274
|
for(var o,i=!1,s=[],a=new Set,l=r.value,c=r.location;;){if(0===l.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;
|
|
542
1275
|
// Try parse `={number}` selector
|
|
543
|
-
var h=this.tryParseDecimalInteger(
|
|
1276
|
+
var h=this.tryParseDecimalInteger(pe.EXPECT_PLURAL_ARGUMENT_SELECTOR,pe.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;c=Xe(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}
|
|
544
1277
|
// Duplicate selector clauses
|
|
545
|
-
if(a.has(l))return this.error("select"===t?
|
|
1278
|
+
if(a.has(l))return this.error("select"===t?pe.DUPLICATE_SELECT_ARGUMENT_SELECTOR:pe.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===l&&(i=!0),
|
|
546
1279
|
// Parse:
|
|
547
1280
|
// one {one apple}
|
|
548
1281
|
// ^----------^
|
|
549
|
-
this.bumpSpace();var
|
|
1282
|
+
this.bumpSpace();var f=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?pe.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:pe.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Xe(this.clonePosition(),this.clonePosition()));var p=this.parseMessage(e+1,t,n);if(p.err)return p;var d=this.tryParseArgumentClose(f);if(d.err)return d;s.push([l,{value:p.val,location:Xe(f,this.clonePosition())}]),
|
|
550
1283
|
// Keep track of the existing selectors
|
|
551
1284
|
a.add(l),
|
|
552
1285
|
// Prep next selector clause.
|
|
553
|
-
this.bumpSpace(),l=(o=this.parseIdentifierIfPossible()).value,c=o.location}return 0===s.length?this.error("select"===t?
|
|
1286
|
+
this.bumpSpace(),l=(o=this.parseIdentifierIfPossible()).value,c=o.location}return 0===s.length?this.error("select"===t?pe.EXPECT_SELECT_ARGUMENT_SELECTOR:pe.EXPECT_PLURAL_ARGUMENT_SELECTOR,Xe(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(pe.MISSING_OTHER_CLAUSE,Xe(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,i=0;!this.isEOF();){var s=this.char();if(!(s>=48/* `0` */&&s<=57/* `9` */))break;o=!0,i=10*i+(s-48),this.bump()}var a=Xe(r,this.clonePosition());return o?Qe(i*=n)?{val:i,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){
|
|
554
1287
|
// This is much faster than `Object.assign` or spread.
|
|
555
1288
|
return{offset:this.position.offset,line:this.position.line,column:this.position.column}},
|
|
556
1289
|
/**
|
|
557
1290
|
* Return the code point at the current position of the parser.
|
|
558
1291
|
* Throws if the index is out of bound.
|
|
559
1292
|
*/
|
|
560
|
-
e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=
|
|
1293
|
+
e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=it(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},
|
|
561
1294
|
/** Bump the parser to the next UTF-16 code unit. */
|
|
562
1295
|
e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10/* '\n' */===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,
|
|
563
1296
|
// 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.
|
|
@@ -568,7 +1301,7 @@ this.position.offset+=e<65536?1:2)}},
|
|
|
568
1301
|
* following the prefix and return true. Otherwise, don't bump the parser
|
|
569
1302
|
* and return false.
|
|
570
1303
|
*/
|
|
571
|
-
e.prototype.bumpIf=function(e){if(
|
|
1304
|
+
e.prototype.bumpIf=function(e){if(nt(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},
|
|
572
1305
|
/**
|
|
573
1306
|
* Bump the parser until the pattern character is found and return `true`.
|
|
574
1307
|
* Otherwise bump to the end of the file and return `false`.
|
|
@@ -580,7 +1313,7 @@ e.prototype.bumpUntil=function(e){var t=this.offset(),n=this.message.indexOf(e,t
|
|
|
580
1313
|
*/
|
|
581
1314
|
e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},
|
|
582
1315
|
/** advance the parser through all whitespace to the next non-whitespace code unit. */
|
|
583
|
-
e.prototype.bumpSpace=function(){for(;!this.isEOF()&&
|
|
1316
|
+
e.prototype.bumpSpace=function(){for(;!this.isEOF()&&pt(this.char());)this.bump()},
|
|
584
1317
|
/**
|
|
585
1318
|
* Peek at the *next* Unicode codepoint in the input without advancing the parser.
|
|
586
1319
|
* If the input has been exhausted, then this returns null.
|
|
@@ -590,153 +1323,108 @@ e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this
|
|
|
590
1323
|
* This check if codepoint is alphabet (lower & uppercase)
|
|
591
1324
|
* @param codepoint
|
|
592
1325
|
* @returns
|
|
593
|
-
*/function
|
|
1326
|
+
*/function ht(e){return e>=97&&e<=122||e>=65&&e<=90}function ft(e){return 45/* '-' */===e||46/* '.' */===e||e>=48&&e<=57/* 0..9 */||95/* '_' */===e||e>=97&&e<=122/** a..z */||e>=65&&e<=90/* A..Z */||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}
|
|
594
1327
|
/**
|
|
595
1328
|
* Code point equivalent of regex `\p{White_Space}`.
|
|
596
1329
|
* From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
|
597
|
-
*/function
|
|
1330
|
+
*/function pt(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}
|
|
598
1331
|
/**
|
|
599
1332
|
* Code point equivalent of regex `\p{Pattern_Syntax}`.
|
|
600
1333
|
* See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
|
601
|
-
*/function
|
|
1334
|
+
*/function dt(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function gt(e){e.forEach((function(e){if(delete e.location,Be(e)||_e(e))for(var t in e.options)delete e.options[t].location,gt(e.options[t].value);else Ee(e)&&He(e.style)||(ve(e)||Te(e))&&Ce(e.style)?delete e.style.location:Ae(e)&>(e.children)}))}function mt(e,t){void 0===t&&(t={}),t=k({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new ut(e,t).parse();if(n.err){var r=SyntaxError(pe[n.err.kind]);
|
|
602
1335
|
// @ts-expect-error Assign to error object
|
|
603
1336
|
throw r.location=n.err.location,
|
|
604
1337
|
// @ts-expect-error Assign to error object
|
|
605
|
-
r.originalMessage=n.err.message,r}return(null==t?void 0:t.captureLocation)||
|
|
1338
|
+
r.originalMessage=n.err.message,r}return(null==t?void 0:t.captureLocation)||gt(n.val),n.val}
|
|
606
1339
|
|
|
607
1340
|
// Main
|
|
608
1341
|
|
|
609
|
-
function
|
|
1342
|
+
function bt(e,t){var n=t&&t.cache?t.cache:At,r=t&&t.serializer?t.serializer:Bt;return(t&&t.strategy?t.strategy:Tt)(e,{cache:n,serializer:r})}
|
|
610
1343
|
|
|
611
1344
|
// Strategy
|
|
612
1345
|
|
|
613
|
-
function
|
|
1346
|
+
function yt(e,t,n,r){var o,i=null==(o=r)||"number"==typeof o||"boolean"==typeof o?r:n(r),s=t.get(i);return void 0===s&&(s=e.call(this,r),t.set(i,s)),s}function Et(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),i=t.get(o);return void 0===i&&(i=e.apply(this,r),t.set(o,i)),i}function vt(e,t,n,r,o){return n.bind(t,e,r,o)}function Tt(e,t){return vt(e,this,1===e.length?yt:Et,t.cache.create(),t.serializer)}
|
|
614
1347
|
// Serializer
|
|
615
|
-
var
|
|
1348
|
+
var Bt=function(){return JSON.stringify(arguments)};
|
|
616
1349
|
|
|
617
1350
|
// Cache
|
|
618
1351
|
|
|
619
|
-
function
|
|
1352
|
+
function _t(){this.cache=Object.create(null)}_t.prototype.get=function(e){return this.cache[e]},_t.prototype.set=function(e,t){this.cache[e]=t};var wt,At={create:function(){
|
|
620
1353
|
// @ts-ignore
|
|
621
|
-
return new
|
|
1354
|
+
return new _t}},Ht={variadic:function(e,t){return vt(e,this,Et,t.cache.create(),t.serializer)},monadic:function(e,t){return vt(e,this,yt,t.cache.create(),t.serializer)}};!function(e){
|
|
622
1355
|
// When we have a placeholder but no value to format
|
|
623
1356
|
e.MISSING_VALUE="MISSING_VALUE",
|
|
624
1357
|
// When value supplied is invalid
|
|
625
1358
|
e.INVALID_VALUE="INVALID_VALUE",
|
|
626
1359
|
// When we need specific Intl API but it's not available
|
|
627
|
-
e.MISSING_INTL_API="MISSING_INTL_API"}(
|
|
1360
|
+
e.MISSING_INTL_API="MISSING_INTL_API"}(wt||(wt={}));var Ct,St=/** @class */function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return G(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),Lt=/** @class */function(e){function t(t,n,r,o){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),wt.INVALID_VALUE,o)||this}return G(t,e),t}(St),Pt=/** @class */function(e){function t(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),wt.INVALID_VALUE,r)||this}return G(t,e),t}(St),Rt=/** @class */function(e){function t(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),wt.MISSING_VALUE,n)||this}return G(t,e),t}(St);function Nt(e){return"function"==typeof e}
|
|
628
1361
|
// TODO(skeleton): add skeleton support
|
|
629
|
-
function
|
|
1362
|
+
function Ot(e,t,n,r,o,i,
|
|
630
1363
|
// For debugging
|
|
631
1364
|
s){
|
|
632
1365
|
// Hot path for straight simple msg translations
|
|
633
|
-
if(1===e.length&&
|
|
1366
|
+
if(1===e.length&&be(e[0]))return[{type:Ct.literal,value:e[0].value}];for(var a=[],l=0,c=e;l<c.length;l++){var u=c[l];
|
|
634
1367
|
// Exit early for string parts.
|
|
635
|
-
if(
|
|
1368
|
+
if(be(u))a.push({type:Ct.literal,value:u.value});else
|
|
636
1369
|
// TODO: should this part be literal type?
|
|
637
1370
|
// Replace `#` in plural rules with the actual numeric value.
|
|
638
|
-
if(
|
|
1371
|
+
if(we(u))"number"==typeof i&&a.push({type:Ct.literal,value:n.getNumberFormat(t).format(i)});else{var h=u.value;
|
|
639
1372
|
// Enforce that all required values are provided by the caller.
|
|
640
|
-
if(!o||!(h in o))throw new
|
|
1373
|
+
if(!o||!(h in o))throw new Rt(h,s);var f=o[h];if(ye(u))f&&"string"!=typeof f&&"number"!=typeof f||(f="string"==typeof f||"number"==typeof f?String(f):""),a.push({type:"string"==typeof f?Ct.literal:Ct.object,value:f});else
|
|
641
1374
|
// Recursively format plural and select parts' option — which can be a
|
|
642
1375
|
// nested pattern structure. The choosing of the option to use is
|
|
643
1376
|
// abstracted-by and delegated-to the part helper object.
|
|
644
|
-
if(
|
|
1377
|
+
if(ve(u)){var p="string"==typeof u.style?r.date[u.style]:Ce(u.style)?u.style.parsedOptions:void 0;a.push({type:Ct.literal,value:n.getDateTimeFormat(t,p).format(f)})}else if(Te(u)){p="string"==typeof u.style?r.time[u.style]:Ce(u.style)?u.style.parsedOptions:r.time.medium;a.push({type:Ct.literal,value:n.getDateTimeFormat(t,p).format(f)})}else if(Ee(u)){(p="string"==typeof u.style?r.number[u.style]:He(u.style)?u.style.parsedOptions:void 0)&&p.scale&&(f*=p.scale||1),a.push({type:Ct.literal,value:n.getNumberFormat(t,p).format(f)})}else{if(Ae(u)){var d=u.children,g=u.value,m=o[g];if(!Nt(m))throw new Pt(g,"function",s);var b=m(Ot(d,t,n,r,o,i).map((function(e){return e.value})));Array.isArray(b)||(b=[b]),a.push.apply(a,b.map((function(e){return{type:"string"==typeof e?Ct.literal:Ct.object,value:e}})))}if(Be(u)){if(!(y=u.options[f]||u.options.other))throw new Lt(u.value,f,Object.keys(u.options),s);a.push.apply(a,Ot(y.value,t,n,r,o))}else if(_e(u)){var y;if(!(y=u.options["=".concat(f)])){if(!Intl.PluralRules)throw new St('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',wt.MISSING_INTL_API,s);var E=n.getPluralRules(t,{type:u.pluralType}).select(f-(u.offset||0));y=u.options[E]||u.options.other}if(!y)throw new Lt(u.value,f,Object.keys(u.options),s);a.push.apply(a,Ot(y.value,t,n,r,o,f-(u.offset||0)))}else;}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var n=e[e.length-1];return n&&n.type===Ct.literal&&t.type===Ct.literal?n.value+=t.value:e.push(t),e}),[])}(a)}
|
|
645
1378
|
/*
|
|
646
1379
|
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
647
1380
|
Copyrights licensed under the New BSD License.
|
|
648
1381
|
See the accompanying LICENSE file for terms.
|
|
649
1382
|
*/
|
|
650
1383
|
// -- MessageFormat --------------------------------------------------------
|
|
651
|
-
function
|
|
1384
|
+
function It(e,t){return t?Object.keys(e).reduce((function(n,r){var o,i;return n[r]=(o=e[r],(i=t[r])?k(k(k({},o||{}),i||{}),Object.keys(o).reduce((function(e,t){return e[t]=k(k({},o[t]),i[t]||{}),e}),{})):o),n}),k({},e)):e}function Mt(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(Ct||(Ct={}));var Dt=/** @class */function(){function e(t,n,r,o){var i,s=this;if(void 0===n&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=s.formatToParts(e);
|
|
652
1385
|
// Hot path for straight simple msg translations
|
|
653
|
-
if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===
|
|
1386
|
+
if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===Ct.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(e){return Ot(s.ast,s.locales,s.formatters,s.formats,e,void 0,s.message)},this.resolvedOptions=function(){return{locale:s.resolvedLocale.toString()}},this.getAst=function(){return s.ast},
|
|
654
1387
|
// Defined first because it's used to build the format pattern.
|
|
655
1388
|
this.locales=n,this.resolvedLocale=e.resolveLocale(n),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
656
1389
|
// Parse string messages into an AST.
|
|
657
1390
|
this.ast=e.__parse(t,{ignoreTag:null==o?void 0:o.ignoreTag,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");
|
|
658
1391
|
// Creates a new object with the specified `formats` merged with the default
|
|
659
1392
|
// formats.
|
|
660
|
-
this.formats=
|
|
1393
|
+
this.formats=It(e.formats,r),this.formatters=o&&o.formatters||(void 0===(i=this.formatterCache)&&(i={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:bt((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.NumberFormat).bind.apply(e,j([void 0],t,!1)))}),{cache:Mt(i.number),strategy:Ht.variadic}),getDateTimeFormat:bt((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.DateTimeFormat).bind.apply(e,j([void 0],t,!1)))}),{cache:Mt(i.dateTime),strategy:Ht.variadic}),getPluralRules:bt((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.PluralRules).bind.apply(e,j([void 0],t,!1)))}),{cache:Mt(i.pluralRules),strategy:Ht.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])},e.__parse=mt,
|
|
661
1394
|
// Default format options used as the prototype of the `formats` provided to the
|
|
662
1395
|
// constructor. These are used when constructing the internal Intl.NumberFormat
|
|
663
1396
|
// and Intl.DateTimeFormat instances.
|
|
664
|
-
e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}(),
|
|
1397
|
+
e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}(),xt=Dt;
|
|
665
1398
|
/*
|
|
666
1399
|
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
667
1400
|
Copyrights licensed under the New BSD License.
|
|
668
1401
|
See the accompanying LICENSE file for terms.
|
|
669
|
-
*/const
|
|
670
|
-
/*! *****************************************************************************
|
|
671
|
-
Copyright (c) Microsoft Corporation.
|
|
672
|
-
|
|
673
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
674
|
-
purpose with or without fee is hereby granted.
|
|
675
|
-
|
|
676
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
677
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
678
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
679
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
680
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
681
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
682
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
683
|
-
***************************************************************************** */function Bn(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}const An={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function Sn(){return An}const _n=Le(!1);let Hn;const Ln=Le(null);function Pn(e){return e.split("-").map(((e,t,n)=>n.slice(0,t+1).join("-"))).reverse()}function Rn(e,t=Sn().fallbackLocale){const n=Pn(e);return t?[...new Set([...n,...Pn(t)])]:n}function In(){return null!=Hn?Hn:void 0}Ln.subscribe((e=>{Hn=null!=e?e:void 0,"undefined"!=typeof window&&null!=e&&document.documentElement.setAttribute("lang",e)}));const On=Object.assign(Object.assign({},Ln),{set:e=>{if(e&&function(e){if(null==e)return;const t=Rn(e);for(let e=0;e<t.length;e++){const n=t[e];if(mn(n))return n}}(e)&&Cn(e)){const{loadingDelay:t}=Sn();let n;return"undefined"!=typeof window&&null!=In()&&t?n=window.setTimeout((()=>_n.set(!0)),t):_n.set(!0),Tn(e).then((()=>{Ln.set(e)})).finally((()=>{clearTimeout(n),_n.set(!1)}))}return Ln.set(e)}}),Mn=e=>{const t=Object.create(null);return n=>{const r=JSON.stringify(n);return r in t?t[r]:t[r]=e(n)}},xn=(e,t)=>{const{formats:n}=Sn();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},Nn=Mn((e=>{var{locale:t,format:n}=e,r=Bn(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(r=xn("number",n)),new Intl.NumberFormat(t,r)})),$n=Mn((e=>{var{locale:t,format:n}=e,r=Bn(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?r=xn("date",n):0===Object.keys(r).length&&(r=xn("date","short")),new Intl.DateTimeFormat(t,r)})),Dn=Mn((e=>{var{locale:t,format:n}=e,r=Bn(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?r=xn("time",n):0===Object.keys(r).length&&(r=xn("time","short")),new Intl.DateTimeFormat(t,r)})),kn=Mn(((e,t=In())=>new un(e,t,Sn().formats,{ignoreTag:Sn().ignoreTag}))),Un=(e,t={})=>{var n,r,o,i;let s=t;"object"==typeof e&&(s=e,e=s.id);const{values:a,locale:l=In(),default:c}=s;if(null==l)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let u=fn(e,l);if(u){if("string"!=typeof u)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof u}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),u}else u=null!==(i=null!==(o=null===(r=(n=Sn()).handleMissingMessage)||void 0===r?void 0:r.call(n,{locale:l,id:e,defaultValue:c}))&&void 0!==o?o:c)&&void 0!==i?i:e;if(!a)return u;let h=u;try{h=kn(u,l).format(a)}catch(t){console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return h},Fn=(e,t)=>((e={})=>{var{locale:t=In()}=e,n=Bn(e,["locale"]);return Dn(Object.assign({locale:t},n))})(t).format(e),Gn=(e,t)=>((e={})=>{var{locale:t=In()}=e,n=Bn(e,["locale"]);return $n(Object.assign({locale:t},n))})(t).format(e),Vn=(e,t)=>((e={})=>{var{locale:t=In()}=e,n=Bn(e,["locale"]);return Nn(Object.assign({locale:t},n))})(t).format(e),jn=(e,t=In())=>fn(e,t),Zn=Pe([On,gn],(()=>Un));Pe([On],(()=>Fn)),Pe([On],(()=>Gn)),Pe([On],(()=>Vn)),Pe([On,gn],(()=>jn));const Kn=e=>{(({withLocale:e,translations:t})=>{On.subscribe((n=>{null==n&&(gn.set(t),On.set(e))}));// maybe we will need this to make sure that the i18n is set up only once
|
|
1402
|
+
*/const $t={},Ut=(e,t,n)=>n?(t in $t||($t[t]={}),e in $t[t]||($t[t][e]=n),n):n,Gt=(e,t)=>{if(null==t)return;if(t in $t&&e in $t[t])return $t[t][e];const n=rn(t);for(let r=0;r<n.length;r++){const o=Vt(n[r],e);if(o)return Ut(e,t,o)}};let kt;const Ft=re({});function jt(e){return e in kt}function Vt(e,t){if(!jt(e))return null;const n=function(e){return kt[e]||null}(e);return function(e,t){if(null==t)return;if(t in e)return e[t];const n=t.split(".");let r=e;for(let e=0;e<n.length;e++)if("object"==typeof r){if(e>0){const t=n.slice(e,n.length).join(".");if(t in r){r=r[t];break}}r=r[n[e]]}else r=void 0;return r}(n,t)}function Kt(e,...t){delete $t[e],Ft.update((n=>(n[e]=me.all([n[e]||{},...t]),n)))}oe([Ft],(([e])=>Object.keys(e))),Ft.subscribe((e=>kt=e));const Xt={};function Zt(e){return Xt[e]}function Wt(e){return null!=e&&rn(e).some((e=>{var t;return null===(t=Zt(e))||void 0===t?void 0:t.size}))}const zt={};function Yt(e){if(!Wt(e))return e in zt?zt[e]:Promise.resolve();const t=function(e){return rn(e).map((e=>{const t=Zt(e);return[e,t?[...t]:[]]})).filter((([,e])=>e.length>0))}(e);return zt[e]=Promise.all(t.map((([e,t])=>function(e,t){const n=Promise.all(t.map((t=>(function(e,t){Xt[e].delete(t),0===Xt[e].size&&delete Xt[e]}(e,t),t().then((e=>e.default||e))))));return n.then((t=>Kt(e,...t)))}(e,t)))).then((()=>{if(Wt(e))return Yt(e);delete zt[e]})),zt[e]}const qt={fallbackLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0};function Jt(){return qt}const Qt=re(!1);let en;const tn=re(null);function nn(e){return e.split("-").map(((e,t,n)=>n.slice(0,t+1).join("-"))).reverse()}function rn(e,t=Jt().fallbackLocale){const n=nn(e);return t?[...new Set([...n,...nn(t)])]:n}function on(){return null!=en?en:void 0}tn.subscribe((e=>{en=null!=e?e:void 0,"undefined"!=typeof window&&null!=e&&document.documentElement.setAttribute("lang",e)}));const sn={...tn,set:e=>{if(e&&function(e){if(null==e)return;const t=rn(e);for(let e=0;e<t.length;e++){const n=t[e];if(jt(n))return n}}(e)&&Wt(e)){const{loadingDelay:t}=Jt();let n;return"undefined"!=typeof window&&null!=on()&&t?n=window.setTimeout((()=>Qt.set(!0)),t):Qt.set(!0),Yt(e).then((()=>{tn.set(e)})).finally((()=>{clearTimeout(n),Qt.set(!1)}))}return tn.set(e)}},an=e=>{const t=Object.create(null);return n=>{const r=JSON.stringify(n);return r in t?t[r]:t[r]=e(n)}},ln=(e,t)=>{const{formats:n}=Jt();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},cn=an((({locale:e,format:t,...n})=>{if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return t&&(n=ln("number",t)),new Intl.NumberFormat(e,n)})),un=an((({locale:e,format:t,...n})=>{if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return t?n=ln("date",t):0===Object.keys(n).length&&(n=ln("date","short")),new Intl.DateTimeFormat(e,n)})),hn=an((({locale:e,format:t,...n})=>{if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return t?n=ln("time",t):0===Object.keys(n).length&&(n=ln("time","short")),new Intl.DateTimeFormat(e,n)})),fn=an(((e,t=on())=>new xt(e,t,Jt().formats,{ignoreTag:Jt().ignoreTag}))),pn=(e,t={})=>{var n,r,o,i;let s=t;"object"==typeof e&&(s=e,e=s.id);const{values:a,locale:l=on(),default:c}=s;if(null==l)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let u=Gt(e,l);if(u){if("string"!=typeof u)return console.warn(`[svelte-i18n] Message with id "${e}" must be of type "string", found: "${typeof u}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),u}else u=null!==(i=null!==(o=null===(r=(n=Jt()).handleMissingMessage)||void 0===r?void 0:r.call(n,{locale:l,id:e,defaultValue:c}))&&void 0!==o?o:c)&&void 0!==i?i:e;if(!a)return u;let h=u;try{h=fn(u,l).format(a)}catch(t){t instanceof Error&&console.warn(`[svelte-i18n] Message "${e}" has syntax error:`,t.message)}return h},dn=(e,t)=>(({locale:e=on(),...t}={})=>hn({locale:e,...t}))(t).format(e),gn=(e,t)=>(({locale:e=on(),...t}={})=>un({locale:e,...t}))(t).format(e),mn=(e,t)=>(({locale:e=on(),...t}={})=>cn({locale:e,...t}))(t).format(e),bn=(e,t=on())=>Gt(e,t);oe([sn,Ft],(()=>pn)),oe([sn],(()=>dn)),oe([sn],(()=>gn)),oe([sn],(()=>mn)),oe([sn,Ft],(()=>bn));const yn=e=>{(({withLocale:e,translations:t})=>{sn.subscribe((n=>{null==n&&(Ft.set(t),sn.set(e))}));// maybe we will need this to make sure that the i18n is set up only once
|
|
684
1403
|
/*dictionary.set(translations);
|
|
685
|
-
locale.set(_locale);*/})({withLocale:"en",translations:{}}),Object.keys(e).forEach((t=>{var n,r;n=t,r=e[t],
|
|
686
|
-
/*
|
|
687
|
-
// (88:0) {#if bonus && isShowingBonus}
|
|
688
|
-
function tr(e){let n,r,o,i,s,a,l,c,u,m,v,E,C,T,B,S,_,H,L,P,R,I,O,M=/*bonus*/(e[1].name||/*bonus*/e[1].presentation?.name.content)+"",x=[ee("BonusInfoTitle","title")],N={};for(let e=0;e<x.length;e+=1)N=t(N,x[e]);let $=/*status*/e[0]===oe.active&&nr(e),D=[ee("BonusInfoWrapper","layout-horizental space-between")],k={};for(let e=0;e<D.length;e+=1)k=t(k,D[e]);let U=/*status*/e[0]===oe.claimable&&rr(e),G=/*status*/e[0]!==oe.claimable&&or(e),V=[ee("BonusInfo")],j={};for(let e=0;e<V.length;e+=1)j=t(j,V[e]);let Z=[ee("RewardsTopBarTitle","title")],K={};for(let e=0;e<Z.length;e+=1)K=t(K,Z[e]);let W=/*status*/e[0]!==oe.claimable&&ar(e),X=[ee("RewardsTopBar","layout-horizental space-between")],z={};for(let e=0;e<X.length;e+=1)z=t(z,X[e]);let Y=/*status*/e[0]!==oe.claimable&&lr(e),J=/*status*/e[0]===oe.claimable&&hr(e),q=[ee("BonusRewardsLevels")],Q={};for(let e=0;e<q.length;e+=1)Q=t(Q,q[e]);let te=[ee("SupportsTitle","title")],ne={};for(let e=0;e<te.length;e+=1)ne=t(ne,te[e]);let re=Object.keys(/*bonus*/e[1].extension?.bonus.wallet||/*bonus*/e[1].wallet).filter(br),ie=[];for(let t=0;t<re.length;t+=1)ie[t]=dr(Yn(e,re,t));let se=[ee("SupportsList")],ae={};for(let e=0;e<se.length;e+=1)ae=t(ae,se[e]);let le=[ee("SupportsWrapper")],ce={};for(let e=0;e<le.length;e+=1)ce=t(ce,le[e]);let ue=[ee("BonusRewards")],he={};for(let e=0;e<ue.length;e+=1)he=t(he,ue[e]);let pe=[ee("Root","layout-horizental")],fe={};for(let e=0;e<pe.length;e+=1)fe=t(fe,pe[e]);return{c(){n=g("section"),r=g("div"),o=g("section"),i=g("section"),s=b(M),a=y(),$&&$.c(),l=y(),U&&U.c(),c=y(),G&&G.c(),u=y(),m=g("div"),v=g("section"),E=g("div"),C=b("Rewards"),T=y(),W&&W.c(),B=y(),S=g("div"),Y&&Y.c(),_=y(),J&&J.c(),H=y(),L=g("div"),P=g("div"),R=b("Include bets"),I=y(),O=g("div");for(let e=0;e<ie.length;e+=1)ie[e].c();w(i,N),w(o,k),w(r,j),w(E,K),w(v,z),w(S,Q),w(P,ne),w(O,ae),w(L,ce),w(m,he),w(n,fe)},m(e,t){p(e,n,t),h(n,r),h(r,o),h(o,i),h(i,s),h(o,a),$&&$.m(o,null),h(r,l),U&&U.m(r,null),h(r,c),G&&G.m(r,null),h(n,u),h(n,m),h(m,v),h(v,E),h(E,C),h(v,T),W&&W.m(v,null),h(m,B),h(m,S),Y&&Y.m(S,null),h(S,_),J&&J.m(S,null),h(m,H),h(m,L),h(L,P),h(P,R),h(L,I),h(L,O);for(let e=0;e<ie.length;e+=1)ie[e].m(O,null)},p(e,t){if(/*bonus*/2&t[0]&&M!==(M=/*bonus*/(e[1].name||/*bonus*/e[1].presentation?.name.content)+"")&&A(s,M),w(i,N=F(x,[ee("BonusInfoTitle","title")])),/*status*/e[0]===oe.active?$?$.p(e,t):($=nr(e),$.c(),$.m(o,null)):$&&($.d(1),$=null),w(o,k=F(D,[ee("BonusInfoWrapper","layout-horizental space-between")])),/*status*/e[0]===oe.claimable?U?U.p(e,t):(U=rr(e),U.c(),U.m(r,c)):U&&(U.d(1),U=null),/*status*/e[0]!==oe.claimable?G?G.p(e,t):(G=or(e),G.c(),G.m(r,null)):G&&(G.d(1),G=null),w(r,j=F(V,[ee("BonusInfo")])),w(E,K=F(Z,[ee("RewardsTopBarTitle","title")])),/*status*/e[0]!==oe.claimable?W?W.p(e,t):(W=ar(e),W.c(),W.m(v,null)):W&&(W.d(1),W=null),w(v,z=F(X,[ee("RewardsTopBar","layout-horizental space-between")])),/*status*/e[0]!==oe.claimable?Y?Y.p(e,t):(Y=lr(e),Y.c(),Y.m(S,_)):Y&&(Y.d(1),Y=null),/*status*/e[0]===oe.claimable?J?J.p(e,t):(J=hr(e),J.c(),J.m(S,null)):J&&(J.d(1),J=null),w(S,Q=F(q,[ee("BonusRewardsLevels")])),w(P,ne=F(te,[ee("SupportsTitle","title")])),/*bonus*/2&t[0]){let n;for(re=Object.keys(/*bonus*/e[1].extension?.bonus.wallet||/*bonus*/e[1].wallet).filter(br),n=0;n<re.length;n+=1){const r=Yn(e,re,n);ie[n]?ie[n].p(r,t):(ie[n]=dr(r),ie[n].c(),ie[n].m(O,null))}for(;n<ie.length;n+=1)ie[n].d(1);ie.length=re.length}w(O,ae=F(se,[ee("SupportsList")])),w(L,ce=F(le,[ee("SupportsWrapper")])),w(m,he=F(ue,[ee("BonusRewards")])),w(n,fe=F(pe,[ee("Root","layout-horizental")]))},d(e){e&&f(n),$&&$.d(),U&&U.d(),G&&G.d(),W&&W.d(),Y&&Y.d(),J&&J.d(),d(ie,e)}}}
|
|
689
|
-
// (96:8) {#if status === BonusStatus.active}
|
|
690
|
-
function nr(e){let n,r,o,i,s,a,l=[ee("BonusInfoExpireDate")],u={};for(let e=0;e<l.length;e+=1)u=t(u,l[e]);let d=[ee("BonusInfoExpire")],m={};for(let e=0;e<d.length;e+=1)m=t(m,d[e]);return{c(){n=g("section"),r=g("img"),i=y(),s=g("span"),a=b(/*expiryTime*/e[6]),C(r,"class","icon"),c(r.src,o="data:image/svg+xml,%3csvg width='26' height='25' viewBox='0 0 26 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_3490_603)'%3e%3cpath d='M12.502 0C5.60958 0 0.00195312 5.60762 0.00195312 12.5C0.00195312 19.3924 5.60958 25 12.502 25C19.3943 25 25.002 19.3924 25.002 12.5C25.002 5.60762 19.3943 0 12.502 0ZM12.502 23.4375C6.47091 23.4375 1.56446 18.531 1.56446 12.5C1.56446 6.46896 6.47091 1.56251 12.502 1.56251C18.533 1.56251 23.4394 6.46896 23.4394 12.5C23.4394 18.531 18.533 23.4375 12.502 23.4375Z' fill='black'/%3e%3cpath d='M13.2832 4.6875H11.7207V12.8235L16.6371 17.7398L17.7418 16.6351L13.2832 12.1765V4.6875Z' fill='black'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_3490_603'%3e%3crect width='25' height='25' fill='white' transform='translate(0.00195312)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e")||C(r,"src","data:image/svg+xml,%3csvg width='26' height='25' viewBox='0 0 26 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_3490_603)'%3e%3cpath d='M12.502 0C5.60958 0 0.00195312 5.60762 0.00195312 12.5C0.00195312 19.3924 5.60958 25 12.502 25C19.3943 25 25.002 19.3924 25.002 12.5C25.002 5.60762 19.3943 0 12.502 0ZM12.502 23.4375C6.47091 23.4375 1.56446 18.531 1.56446 12.5C1.56446 6.46896 6.47091 1.56251 12.502 1.56251C18.533 1.56251 23.4394 6.46896 23.4394 12.5C23.4394 18.531 18.533 23.4375 12.502 23.4375Z' fill='black'/%3e%3cpath d='M13.2832 4.6875H11.7207V12.8235L16.6371 17.7398L17.7418 16.6351L13.2832 12.1765V4.6875Z' fill='black'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_3490_603'%3e%3crect width='25' height='25' fill='white' transform='translate(0.00195312)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e"),C(r,"alt","expiryTime"),w(s,u),w(n,m)},m(e,t){p(e,n,t),h(n,r),h(n,i),h(n,s),h(s,a)},p(e,t){/*expiryTime*/64&t[0]&&A(a,/*expiryTime*/e[6]),w(s,u=F(l,[ee("BonusInfoExpireDate")])),w(n,m=F(d,[ee("BonusInfoExpire")]))},d(e){e&&f(n)}}}
|
|
691
|
-
// (107:6) {#if status === BonusStatus.claimable}
|
|
692
|
-
function rr(e){let n,r,o,i,s,a,l,u,d,m,v,T,B,S,_,H,L,P,R,I,O,M,x,N,$,D,k,U,G,V,j,Z=/*bonus*/(e[1].description||"")+"",K=/*levels*/e[2].length+"",W=/*$_*/e[10](Xn.startChallenge)+"",X=[ee("BonusInfoDescription")],J={};for(let e=0;e<X.length;e+=1)J=t(J,X[e]);let q=[ee("StatusClaimableInfoLevels")],Q={};for(let e=0;e<q.length;e+=1)Q=t(Q,q[e]);let te=[ee("StatusClaimableInfoPeriod")],ne={};for(let e=0;e<te.length;e+=1)ne=t(ne,te[e]);let re=[ee("StatusClaimableInfo")],oe={};for(let e=0;e<re.length;e+=1)oe=t(oe,re[e]);let ie=[ee("StatusClaimableCommandTerms","terms")],se={};for(let e=0;e<ie.length;e+=1)se=t(se,ie[e]);let ae=[ee("StatusClaimableCommand")],le={};for(let e=0;e<ae.length;e+=1)le=t(le,ae[e]);let ce=[ee("StatusClaimable","layout-horizental space-between")],ue={};for(let e=0;e<ce.length;e+=1)ue=t(ue,ce[e]);return{c(){n=g("div"),r=b(Z),o=y(),i=g("hr"),s=y(),a=g("section"),l=g("div"),u=g("div"),d=g("img"),v=y(),T=b(K),B=b(" Levels"),S=y(),_=g("div"),H=g("img"),P=y(),R=b(/*endTime*/e[7]),I=y(),O=g("div"),M=g("button"),x=b(W),$=y(),D=g("div"),k=g("a"),U=b("Terms and Conditions"),w(n,J),C(d,"class","icon"),c(d.src,m=Y)||C(d,"src","data:image/svg+xml,%3csvg width='25' height='25' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg clip-path='url(%23clip0_3490_347)'%3e %3cpath d='M12.5002 7.5C11.5797 7.5 10.8335 8.2462 10.8335 9.16667V23.3333C10.8335 24.2538 11.5797 25 12.5002 25C13.4206 25 14.1668 24.2538 14.1668 23.3333V9.16667C14.1668 8.2462 13.4206 7.5 12.5002 7.5ZM13.3335 23.3333C13.3335 23.7936 12.9604 24.1667 12.5002 24.1667C12.0399 24.1667 11.6668 23.7936 11.6668 23.3333V9.16667C11.6668 8.70641 12.0399 8.33333 12.5002 8.33333C12.9604 8.33333 13.3335 8.70641 13.3335 9.16667V23.3333Z' fill='%2300AEEF'/%3e %3cpath d='M7.08317 12.5C6.1627 12.5 5.4165 13.2462 5.4165 14.1667V23.3333C5.4165 24.2538 6.1627 25 7.08317 25C8.00364 25 8.74984 24.2538 8.74984 23.3333V14.1667C8.74984 13.2462 8.00364 12.5 7.08317 12.5ZM7.9165 23.3333C7.9165 23.7936 7.54343 24.1667 7.08317 24.1667C6.62291 24.1667 6.24984 23.7936 6.24984 23.3333V14.1667C6.24984 13.7064 6.62291 13.3333 7.08317 13.3333C7.54343 13.3333 7.9165 13.7064 7.9165 14.1667V23.3333Z' fill='%2300AEEF'/%3e %3cpath d='M1.66667 18.333C0.746198 18.333 0 19.0792 0 19.9997V23.333C0 24.2535 0.746198 24.9997 1.66667 24.9997C2.58714 24.9997 3.33333 24.2535 3.33333 23.333V19.9997C3.33333 19.0792 2.58714 18.333 1.66667 18.333ZM2.5 23.333C2.5 23.7933 2.12693 24.1663 1.66667 24.1663C1.20641 24.1663 0.833333 23.7933 0.833333 23.333V19.9997C0.833333 19.5394 1.20641 19.1663 1.66667 19.1663C2.12693 19.1663 2.5 19.5394 2.5 19.9997V23.333Z' fill='%2300AEEF'/%3e %3cpath d='M17.9167 2.5C16.9962 2.5 16.25 3.2462 16.25 4.16667V23.3333C16.25 24.2538 16.9962 25 17.9167 25C18.8371 25 19.5833 24.2538 19.5833 23.3333V4.16667C19.5833 3.2462 18.8371 2.5 17.9167 2.5ZM18.75 23.3333C18.75 23.7936 18.3769 24.1667 17.9167 24.1667C17.4564 24.1667 17.0833 23.7936 17.0833 23.3333V4.16667C17.0833 3.70641 17.4564 3.33333 17.9167 3.33333C18.3769 3.33333 18.75 3.70641 18.75 4.16667V23.3333Z' fill='%2300AEEF'/%3e %3cpath d='M23.3332 0C22.4127 0 21.6665 0.746198 21.6665 1.66667V23.3333C21.6665 24.2538 22.4127 25 23.3332 25C24.2536 25 24.9998 24.2538 24.9998 23.3333V1.66667C24.9998 0.746198 24.2536 0 23.3332 0ZM24.1665 23.3333C24.1665 23.7936 23.7934 24.1667 23.3332 24.1667C22.8729 24.1667 22.4998 23.7936 22.4998 23.3333V1.66667C22.4998 1.20641 22.8729 0.833333 23.3332 0.833333C23.7934 0.833333 24.1665 1.20641 24.1665 1.66667V23.3333Z' fill='%2300AEEF'/%3e %3c/g%3e %3cdefs%3e %3cclipPath id='clip0_3490_347'%3e %3crect width='25' height='25' fill='white'/%3e %3c/clipPath%3e %3c/defs%3e%3c/svg%3e"),C(d,"alt","Levels"),w(u,Q),C(H,"class","icon"),c(H.src,L=z)||C(H,"src","data:image/svg+xml,%3csvg width='25' height='25' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg clip-path='url(%23clip0_3490_338)'%3e %3cpath d='M12.5 0C5.60762 0 0 5.60762 0 12.5C0 19.3924 5.60762 25 12.5 25C19.3924 25 25 19.3924 25 12.5C25 5.60762 19.3924 0 12.5 0ZM12.5 23.4375C6.46896 23.4375 1.56251 18.531 1.56251 12.5C1.56251 6.46896 6.46896 1.56251 12.5 1.56251C18.531 1.56251 23.4375 6.46896 23.4375 12.5C23.4375 18.531 18.531 23.4375 12.5 23.4375V23.4375Z' fill='%2300AEEF'/%3e %3cpath d='M13.2813 4.6875H11.7188V12.8235L16.6351 17.7398L17.7399 16.6351L13.2813 12.1765V4.6875Z' fill='%2300AEEF'/%3e %3c/g%3e %3cdefs%3e %3cclipPath id='clip0_3490_338'%3e %3crect width='25' height='25' fill='white'/%3e %3c/clipPath%3e %3c/defs%3e%3c/svg%3e"),C(H,"alt","EndTime"),w(_,ne),w(l,oe),C(M,"type","button"),M.disabled=N=!/*isButtonClickable*/e[8],C(k,"href",G=/*bonus*/e[1].presentation?.url?.content),C(k,"target","__blank"),w(D,se),w(O,le),w(a,ue)},m(t,c){p(t,n,c),h(n,r),p(t,o,c),p(t,i,c),p(t,s,c),p(t,a,c),h(a,l),h(l,u),h(u,d),h(u,v),h(u,T),h(u,B),h(l,S),h(l,_),h(_,H),h(_,P),h(_,R),h(a,I),h(a,O),h(O,M),h(M,x),h(O,$),h(O,D),h(D,k),h(k,U),V||(j=E(M,"click",/*eventStartChallenge*/e[11]),V=!0)},p(e,t){/*bonus*/2&t[0]&&Z!==(Z=/*bonus*/(e[1].description||"")+"")&&A(r,Z),w(n,J=F(X,[ee("BonusInfoDescription")])),/*levels*/4&t[0]&&K!==(K=/*levels*/e[2].length+"")&&A(T,K),w(u,Q=F(q,[ee("StatusClaimableInfoLevels")])),/*endTime*/128&t[0]&&A(R,/*endTime*/e[7]),w(_,ne=F(te,[ee("StatusClaimableInfoPeriod")])),w(l,oe=F(re,[ee("StatusClaimableInfo")])),/*$_*/1024&t[0]&&W!==(W=/*$_*/e[10](Xn.startChallenge)+"")&&A(x,W),/*isButtonClickable*/256&t[0]&&N!==(N=!/*isButtonClickable*/e[8])&&(M.disabled=N),/*bonus*/2&t[0]&&G!==(G=/*bonus*/e[1].presentation?.url?.content)&&C(k,"href",G),w(D,se=F(ie,[ee("StatusClaimableCommandTerms","terms")])),w(O,le=F(ae,[ee("StatusClaimableCommand")])),w(a,ue=F(ce,[ee("StatusClaimable","layout-horizental space-between")]))},d(e){e&&f(n),e&&f(o),e&&f(i),e&&f(s),e&&f(a),V=!1,j()}}}
|
|
693
|
-
// (148:6) {#if status !== BonusStatus.claimable}
|
|
694
|
-
function or(e){let n,r,o,i,s,a,l,c,u,d,m,v,E,T,S,_,H,L,P,R,I,O,M,x,N=/*levelsCurrent*/e[3].textWithLength+"",$=/*bonusTypeInfo*/e[5].target()+"",D=[oe.completed,oe.released].includes(/*bonus*/e[1].status),k=[ee("LevelStatus")],U={};for(let e=0;e<k.length;e+=1)U=t(U,k[e]);let G=[ee("LevelStatusWrapper")],V={};for(let e=0;e<G.length;e+=1)V=t(V,G[e]);let j=[ee("BonusTypeTarget","title")],Z={};for(let e=0;e<j.length;e+=1)Z=t(Z,j[e]);let K=/*bonus*/e[1].status===oe.active&&ir(e),W=D&&sr(e),X=[ee("BonusType")],z={};for(let e=0;e<X.length;e+=1)z=t(z,X[e]);let Y=[ee("BonusTerms","terms")],J={};for(let e=0;e<Y.length;e+=1)J=t(J,Y[e]);let q=[ee("BonusTypeWrapper")],Q={};for(let e=0;e<q.length;e+=1)Q=t(Q,q[e]);let te=[ee("AfterClaimedWrapper","layout-horizental space-between")],ne={};for(let e=0;e<te.length;e+=1)ne=t(ne,te[e]);return{c(){n=g("hr"),r=y(),o=g("section"),i=g("div"),s=g("casino-wagering-bonus-progress"),l=y(),c=g("div"),u=b("Level\n "),d=b(N),m=y(),v=g("div"),E=g("div"),T=g("div"),S=b($),_=y(),K&&K.c(),H=y(),W&&W.c(),L=y(),P=g("div"),R=b("Learn more about the challenge rules and included games or events in \n "),I=g("a"),O=b("Terms and Conditions"),x=b("\n section"),B(s,"percent",/*percent*/e[4]),B(s,"status",a=/*bonus*/e[1].status),w(c,U),w(i,V),w(T,Z),w(E,z),C(I,"href",M=/*bonus*/e[1]?.url),C(I,"target","__blank"),w(P,J),w(v,Q),w(o,ne)},m(e,t){p(e,n,t),p(e,r,t),p(e,o,t),h(o,i),h(i,s),h(i,l),h(i,c),h(c,u),h(c,d),h(o,m),h(o,v),h(v,E),h(E,T),h(T,S),h(E,_),K&&K.m(E,null),h(E,H),W&&W.m(E,null),h(v,L),h(v,P),h(P,R),h(P,I),h(I,O),h(P,x)},p(e,t){/*percent*/16&t[0]&&B(s,"percent",/*percent*/e[4]),/*bonus*/2&t[0]&&a!==(a=/*bonus*/e[1].status)&&B(s,"status",a),/*levelsCurrent*/8&t[0]&&N!==(N=/*levelsCurrent*/e[3].textWithLength+"")&&A(d,N),w(c,U=F(k,[ee("LevelStatus")])),w(i,V=F(G,[ee("LevelStatusWrapper")])),/*bonusTypeInfo*/32&t[0]&&$!==($=/*bonusTypeInfo*/e[5].target()+"")&&A(S,$),w(T,Z=F(j,[ee("BonusTypeTarget","title")])),/*bonus*/e[1].status===oe.active?K?K.p(e,t):(K=ir(e),K.c(),K.m(E,H)):K&&(K.d(1),K=null),/*bonus*/2&t[0]&&(D=[oe.completed,oe.released].includes(/*bonus*/e[1].status)),D?W?W.p(e,t):(W=sr(e),W.c(),W.m(E,null)):W&&(W.d(1),W=null),w(E,z=F(X,[ee("BonusType")])),/*bonus*/2&t[0]&&M!==(M=/*bonus*/e[1]?.url)&&C(I,"href",M),w(P,J=F(Y,[ee("BonusTerms","terms")])),w(v,Q=F(q,[ee("BonusTypeWrapper")])),w(o,ne=F(te,[ee("AfterClaimedWrapper","layout-horizental space-between")]))},d(e){e&&f(n),e&&f(r),e&&f(o),K&&K.d(),W&&W.d()}}}
|
|
695
|
-
// (170:12) {#if bonus.status === BonusStatus.active}
|
|
696
|
-
function ir(e){let n,r,o,i,s,a=/*bonusTypeInfo*/e[5].remaining()+"",l=/*bonusTypeInfo*/e[5].got()+"",c=[ee("BonusTypeRemaining")],u={};for(let e=0;e<c.length;e+=1)u=t(u,c[e]);let d=[ee("BonusTypeGot")],m={};for(let e=0;e<d.length;e+=1)m=t(m,d[e]);return{c(){n=g("div"),r=b(a),o=y(),i=g("div"),s=b(l),w(n,u),w(i,m)},m(e,t){p(e,n,t),h(n,r),p(e,o,t),p(e,i,t),h(i,s)},p(e,t){/*bonusTypeInfo*/32&t[0]&&a!==(a=/*bonusTypeInfo*/e[5].remaining()+"")&&A(r,a),w(n,u=F(c,[ee("BonusTypeRemaining")])),/*bonusTypeInfo*/32&t[0]&&l!==(l=/*bonusTypeInfo*/e[5].got()+"")&&A(s,l),w(i,m=F(d,[ee("BonusTypeGot")]))},d(e){e&&f(n),e&&f(o),e&&f(i)}}}
|
|
697
|
-
// (179:12) {#if [BonusStatus.completed, BonusStatus.released].includes(bonus.status)}
|
|
698
|
-
function sr(e){let t,n,r,o,i,s,a,l,u,d,m,v=/*bonus*/e[1].status.split("").map(mr).join("")+"",E=/*levelsCurrent*/e[3].textWithLength+"";return{c(){t=g("div"),n=g("img"),o=y(),i=b(v),s=y(),a=g("div"),l=g("img"),d=b("\n Levels finished:\n "),m=b(E),C(n,"class","icon"),c(n.src,r=z)||C(n,"src","data:image/svg+xml,%3csvg width='25' height='25' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg clip-path='url(%23clip0_3490_338)'%3e %3cpath d='M12.5 0C5.60762 0 0 5.60762 0 12.5C0 19.3924 5.60762 25 12.5 25C19.3924 25 25 19.3924 25 12.5C25 5.60762 19.3924 0 12.5 0ZM12.5 23.4375C6.46896 23.4375 1.56251 18.531 1.56251 12.5C1.56251 6.46896 6.46896 1.56251 12.5 1.56251C18.531 1.56251 23.4375 6.46896 23.4375 12.5C23.4375 18.531 18.531 23.4375 12.5 23.4375V23.4375Z' fill='%2300AEEF'/%3e %3cpath d='M13.2813 4.6875H11.7188V12.8235L16.6351 17.7398L17.7399 16.6351L13.2813 12.1765V4.6875Z' fill='%2300AEEF'/%3e %3c/g%3e %3cdefs%3e %3cclipPath id='clip0_3490_338'%3e %3crect width='25' height='25' fill='white'/%3e %3c/clipPath%3e %3c/defs%3e%3c/svg%3e"),C(l,"class","icon"),c(l.src,u=Y)||C(l,"src","data:image/svg+xml,%3csvg width='25' height='25' viewBox='0 0 25 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg clip-path='url(%23clip0_3490_347)'%3e %3cpath d='M12.5002 7.5C11.5797 7.5 10.8335 8.2462 10.8335 9.16667V23.3333C10.8335 24.2538 11.5797 25 12.5002 25C13.4206 25 14.1668 24.2538 14.1668 23.3333V9.16667C14.1668 8.2462 13.4206 7.5 12.5002 7.5ZM13.3335 23.3333C13.3335 23.7936 12.9604 24.1667 12.5002 24.1667C12.0399 24.1667 11.6668 23.7936 11.6668 23.3333V9.16667C11.6668 8.70641 12.0399 8.33333 12.5002 8.33333C12.9604 8.33333 13.3335 8.70641 13.3335 9.16667V23.3333Z' fill='%2300AEEF'/%3e %3cpath d='M7.08317 12.5C6.1627 12.5 5.4165 13.2462 5.4165 14.1667V23.3333C5.4165 24.2538 6.1627 25 7.08317 25C8.00364 25 8.74984 24.2538 8.74984 23.3333V14.1667C8.74984 13.2462 8.00364 12.5 7.08317 12.5ZM7.9165 23.3333C7.9165 23.7936 7.54343 24.1667 7.08317 24.1667C6.62291 24.1667 6.24984 23.7936 6.24984 23.3333V14.1667C6.24984 13.7064 6.62291 13.3333 7.08317 13.3333C7.54343 13.3333 7.9165 13.7064 7.9165 14.1667V23.3333Z' fill='%2300AEEF'/%3e %3cpath d='M1.66667 18.333C0.746198 18.333 0 19.0792 0 19.9997V23.333C0 24.2535 0.746198 24.9997 1.66667 24.9997C2.58714 24.9997 3.33333 24.2535 3.33333 23.333V19.9997C3.33333 19.0792 2.58714 18.333 1.66667 18.333ZM2.5 23.333C2.5 23.7933 2.12693 24.1663 1.66667 24.1663C1.20641 24.1663 0.833333 23.7933 0.833333 23.333V19.9997C0.833333 19.5394 1.20641 19.1663 1.66667 19.1663C2.12693 19.1663 2.5 19.5394 2.5 19.9997V23.333Z' fill='%2300AEEF'/%3e %3cpath d='M17.9167 2.5C16.9962 2.5 16.25 3.2462 16.25 4.16667V23.3333C16.25 24.2538 16.9962 25 17.9167 25C18.8371 25 19.5833 24.2538 19.5833 23.3333V4.16667C19.5833 3.2462 18.8371 2.5 17.9167 2.5ZM18.75 23.3333C18.75 23.7936 18.3769 24.1667 17.9167 24.1667C17.4564 24.1667 17.0833 23.7936 17.0833 23.3333V4.16667C17.0833 3.70641 17.4564 3.33333 17.9167 3.33333C18.3769 3.33333 18.75 3.70641 18.75 4.16667V23.3333Z' fill='%2300AEEF'/%3e %3cpath d='M23.3332 0C22.4127 0 21.6665 0.746198 21.6665 1.66667V23.3333C21.6665 24.2538 22.4127 25 23.3332 25C24.2536 25 24.9998 24.2538 24.9998 23.3333V1.66667C24.9998 0.746198 24.2536 0 23.3332 0ZM24.1665 23.3333C24.1665 23.7936 23.7934 24.1667 23.3332 24.1667C22.8729 24.1667 22.4998 23.7936 22.4998 23.3333V1.66667C22.4998 1.20641 22.8729 0.833333 23.3332 0.833333C23.7934 0.833333 24.1665 1.20641 24.1665 1.66667V23.3333Z' fill='%2300AEEF'/%3e %3c/g%3e %3cdefs%3e %3cclipPath id='clip0_3490_347'%3e %3crect width='25' height='25' fill='white'/%3e %3c/clipPath%3e %3c/defs%3e%3c/svg%3e")},m(e,r){p(e,t,r),h(t,n),h(t,o),h(t,i),p(e,s,r),p(e,a,r),h(a,l),h(a,d),h(a,m)},p(e,t){/*bonus*/2&t[0]&&v!==(v=/*bonus*/e[1].status.split("").map(mr).join("")+"")&&A(i,v),/*levelsCurrent*/8&t[0]&&E!==(E=/*levelsCurrent*/e[3].textWithLength+"")&&A(m,E)},d(e){e&&f(t),e&&f(s),e&&f(a)}}}
|
|
699
|
-
// (210:8) {#if status !== BonusStatus.claimable}
|
|
700
|
-
function ar(e){let n,r,o,i,s=[ee("RewardsTopBarLinkToDetail")],a={};for(let e=0;e<s.length;e+=1)a=t(a,s[e]);return{c(){n=g("div"),r=g("a"),r.textContent="All Rewards",C(r,"href","javascript:void(0)"),w(n,a)},m(t,s){p(t,n,s),h(n,r),o||(i=E(r,"click",/*click_handler*/e[17]),o=!0)},p(e,t){w(n,a=F(s,[ee("RewardsTopBarLinkToDetail")]))},d(e){e&&f(n),o=!1,i()}}}
|
|
701
|
-
// (225:8) {#if status !== BonusStatus.claimable}
|
|
702
|
-
function lr(e){let t,n=Te(/*bonus*/e[1],/*status*/e[0],/*levels*/e[2]),r=[];for(let t=0;t<n.length;t+=1)r[t]=ur(Qn(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=v()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);p(e,t,n)},p(e,o){if(/*bonus, status, levels, $_*/1031&o[0]){let i;for(n=Te(/*bonus*/e[1],/*status*/e[0],/*levels*/e[2]),i=0;i<n.length;i+=1){const s=Qn(e,n,i);r[i]?r[i].p(s,o):(r[i]=ur(s),r[i].c(),r[i].m(t.parentNode,t))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(e){d(r,e),e&&f(t)}}}
|
|
703
|
-
// (233:14) {#each reward.descriptions as description}
|
|
704
|
-
function cr(e){let t,n,r=/*description*/e[34]+"";return{c(){t=g("p"),n=b(r)},m(e,r){p(e,t,r),h(t,n)},p(e,t){/*bonus, status, levels*/7&t[0]&&r!==(r=/*description*/e[34]+"")&&A(n,r)},d(e){e&&f(t)}}}
|
|
705
|
-
// (226:10) {#each (getRewards(bonus, status, levels)) as reward}
|
|
706
|
-
function ur(e){let n,r,o,i,s,a,l,c,u,m=/*$_*/e[10](Xn[/*reward*/e[31].key])+"",v=/*$_*/e[10](Xn.level)+"",E=[ee("BonusRewardsLevelsItemPosition")],C={};for(let e=0;e<E.length;e+=1)C=t(C,E[e]);let T=/*reward*/e[31].descriptions,B=[];for(let t=0;t<T.length;t+=1)B[t]=cr(er(e,T,t));let S=[ee("BonusRewardsLevelsItem")],_={};for(let e=0;e<S.length;e+=1)_=t(_,S[e]);return{c(){n=g("div"),r=g("div"),o=b(m),i=y(),s=b(v),a=b(":"),l=y(),c=g("div");for(let e=0;e<B.length;e+=1)B[e].c();u=y(),w(r,C),w(n,_)},m(e,t){p(e,n,t),h(n,r),h(r,o),h(r,i),h(r,s),h(r,a),h(n,l),h(n,c);for(let e=0;e<B.length;e+=1)B[e].m(c,null);h(n,u)},p(e,t){if(/*$_, bonus, status, levels*/1031&t[0]&&m!==(m=/*$_*/e[10](Xn[/*reward*/e[31].key])+"")&&A(o,m),/*$_*/1024&t[0]&&v!==(v=/*$_*/e[10](Xn.level)+"")&&A(s,v),w(r,C=F(E,[ee("BonusRewardsLevelsItemPosition")])),/*bonus, status, levels*/7&t[0]){let n;for(T=/*reward*/e[31].descriptions,n=0;n<T.length;n+=1){const r=er(e,T,n);B[n]?B[n].p(r,t):(B[n]=cr(r),B[n].c(),B[n].m(c,null))}for(;n<B.length;n+=1)B[n].d(1);B.length=T.length}w(n,_=F(S,[ee("BonusRewardsLevelsItem")]))},d(e){e&&f(n),d(B,e)}}}
|
|
707
|
-
// (242:8) {#if status === BonusStatus.claimable}
|
|
708
|
-
function hr(e){let t,n=/*bonus*/e[1].levels,r=[];for(let t=0;t<n.length;t+=1)r[t]=fr(Jn(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=v()},m(e,n){for(let t=0;t<r.length;t+=1)r[t].m(e,n);p(e,t,n)},p(e,o){if(/*bonus, $_*/1026&o[0]){let i;for(n=/*bonus*/e[1].levels,i=0;i<n.length;i+=1){const s=Jn(e,n,i);r[i]?r[i].p(s,o):(r[i]=fr(s),r[i].c(),r[i].m(t.parentNode,t))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(e){d(r,e),e&&f(t)}}}
|
|
709
|
-
// (258:14) {#each level.bonuses as levelBonus}
|
|
710
|
-
function pr(e){let t,n,r=we(/*level*/e[25],/*levelBonus*/e[28])+"";return{c(){t=g("p"),n=b(r)},m(e,r){p(e,t,r),h(t,n)},p(e,t){/*bonus*/2&t[0]&&r!==(r=we(/*level*/e[25],/*levelBonus*/e[28])+"")&&A(n,r)},d(e){e&&f(t)}}}
|
|
711
|
-
// (243:10) {#each bonus.levels as level, index}
|
|
712
|
-
function fr(e){let n,r,o,i,s,a,l,c,u,m=/*$_*/e[10](Xn.level)+"",v=/*level*/(e[25].maxRepeats>1?`${/*index*/e[27]+1}-${/*index*/e[27]+1+/*level*/e[25].maxRepeats-1}`/*index*/:e[27]+1)+"",E=[ee("BonusRewardsLevelsItemPosition")],C={};for(let e=0;e<E.length;e+=1)C=t(C,E[e]);let T=/*level*/e[25].bonuses,B=[];for(let t=0;t<T.length;t+=1)B[t]=pr(qn(e,T,t));let S=[ee("BonusRewardsLevelsItem")],_={};for(let e=0;e<S.length;e+=1)_=t(_,S[e]);return{c(){n=g("div"),r=g("div"),o=b(m),i=y(),s=b(v),a=b(":"),l=y(),c=g("div");for(let e=0;e<B.length;e+=1)B[e].c();u=y(),w(r,C),w(n,_)},m(e,t){p(e,n,t),h(n,r),h(r,o),h(r,i),h(r,s),h(r,a),h(n,l),h(n,c);for(let e=0;e<B.length;e+=1)B[e].m(c,null);h(n,u)},p(e,t){if(/*$_*/1024&t[0]&&m!==(m=/*$_*/e[10](Xn.level)+"")&&A(o,m),/*bonus*/2&t[0]&&v!==(v=/*level*/(e[25].maxRepeats>1?`${/*index*/e[27]+1}-${/*index*/e[27]+1+/*level*/e[25].maxRepeats-1}`/*index*/:e[27]+1)+"")&&A(s,v),w(r,C=F(E,[ee("BonusRewardsLevelsItemPosition")])),/*bonus*/2&t[0]){let n;for(T=/*level*/e[25].bonuses,n=0;n<T.length;n+=1){const r=qn(e,T,n);B[n]?B[n].p(r,t):(B[n]=pr(r),B[n].c(),B[n].m(c,null))}for(;n<B.length;n+=1)B[n].d(1);B.length=T.length}w(n,_=F(S,[ee("BonusRewardsLevelsItem")]))},d(e){e&&f(n),d(B,e)}}}
|
|
713
|
-
// (273:10) {#each Object.keys(bonus.extension?.bonus.wallet || bonus.wallet).filter(k => ['sports', 'casino'].includes(k)) as support, i}
|
|
714
|
-
function dr(e){let t,n,r,o,i,s,a,l=/*support*/e[22]+"";function c(){/*click_handler_1*/
|
|
715
|
-
return e[18](/*support*/e[22])}return{c(){t=g("div"),n=g("a"),r=b(l),i=y(),C(n,"href",o="javascript:void(0)")},m(e,o){p(e,t,o),h(t,n),h(n,r),h(t,i),s||(a=E(n,"click",c),s=!0)},p(t,n){e=t,/*bonus*/2&n[0]&&l!==(l=/*support*/e[22]+"")&&A(r,l)},d(e){e&&f(t),s=!1,a()}}}function gr(t){let n,r=/*bonus*/t[1]&&/*isShowingBonus*/t[9]&&tr(t);return{c(){r&&r.c(),n=v(),this.c=e},m(e,t){r&&r.m(e,t),p(e,n,t)},p(e,t){/*bonus*/e[1]&&/*isShowingBonus*/e[9]?r?r.p(e,t):(r=tr(e),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i:e,o:e,d(e){r&&r.d(e),e&&f(n)}}}const mr=(e,t)=>0===t?e.toUpperCase():e,br=e=>["sports","casino"].includes(e);function yr(e,t,n){let r,o;var i,s;i=Zn,s=e=>n(10,o=e),e.$$.on_destroy.push(u(i,s));let a,l,c,h,{rawbonus:p=""}=t,{endpoint:f=""}=t,{currency:d="EUR"}=t,{lang:g=ae.en}=t,{session:m=""}=t,{status:b=oe.claimable}=t,y=[],v="0",E="",C=!0,w=3e4;const T=()=>{try{n(1,a=Object.assign({},JSON.parse(p)))}catch(e){console.error(e)}if(a){if(n(2,y=(e=>{const t=[];return e.map((e=>{const{maxRepeats:n,completedTime:r}=e,o=ce(e,["maxRepeats","completedTime"]);for(let e=0;e<n;e++)t.push(Object.assign({},o))})),t})(a.levels)),a.bonusWalletID){const e=((e,t)=>({bonusTypeInfo:Ae(e,t),percent:ye(e.status,{completed:()=>"100",current:()=>{if(!e.wageringProgress)return"0";let{currency:t,currentLevelIncrement:n,gap:r,currentLevel:o}=e.wageringProgress;const i=n-r;return String(Math.floor(i/n*100))}}),levelsCurrent:ye(e.status,{completed:()=>({text:t.length,textWithLength:`${t.length}/${t.length}`}),current:()=>{if(!e.wageringProgress)return{current:"0",textWithLength:`0/${t.length}`};const{currentLevel:n}=e.wageringProgress;return{text:n,textWithLength:`${n}/${t.length}`}}})}))(a,y);n(5,c=e.bonusTypeInfo),n(4,v=e.percent),n(3,l=e.levelsCurrent)}B()}},B=()=>{a&&(_e(a.expiryDate,w,(()=>n(6,h="Expired")),(e=>n(6,h=e))),_e(a.endTime||a.trigger.endTime,w,(()=>n(7,E="Ended")),(e=>n(7,E=e))))};H((()=>{const e=setInterval((()=>{B()}),w);return()=>{clearInterval(e)}})),de({OnWageringBonusButtonStateChanged:e=>n(8,C=e.clickable)});return e.$$set=e=>{"rawbonus"in e&&n(12,p=e.rawbonus),"endpoint"in e&&n(13,f=e.endpoint),"currency"in e&&n(14,d=e.currency),"lang"in e&&n(15,g=e.lang),"session"in e&&n(16,m=e.session),"status"in e&&n(0,b=e.status)},e.$$.update=()=>{var t;/*rawbonus*/4096&e.$$.dirty[0]&&p&&T(),/*lang*/32768&e.$$.dirty[0]&&g&&(t=g,On.set(t)),/*status, bonus*/3&e.$$.dirty[0]&&n(9,r=b===oe.claimable||a.status===b)},[b,a,y,l,v,c,h,E,C,r,o,async()=>{if(!m)return;fe({type:"OnWageringBonusJoinRequest",bonusID:a.bonusID}),fe({type:"OnWageringBonusButtonStateChanged",clickable:!1});(await Ee(f,m,a.code,d)).success&&fe({type:"OnWageringBonusClaimed"}),fe({type:"OnWageringBonusButtonStateChanged",clickable:!0})},p,f,d,g,m,()=>fe({type:"OnWageringBonusAllRewardsClick",bonusWalletID:a.id}),e=>fe({type:"OnWageringBonusSupportClicked",support:e})]}var vr,Er;
|
|
716
|
-
/* src/CasinoWageringBonusesController.svelte generated by Svelte v3.48.0 */
|
|
717
|
-
function Cr(e,t,n){const r=e.slice();return r[15]=t[n],r}function wr(e,t,n){const r=e.slice();return r[18]=t[n],r}
|
|
1404
|
+
locale.set(_locale);*/})({withLocale:"en",translations:{}}),Object.keys(e).forEach((t=>{var n,r;n=t,r=e[t],Kt(n,r)}))};var En,vn;!function(e){e.level="level",e.current="current",e.next="next",e.first="first",e.last="last",e.previous="previous",e.startChallenge="startChallenge"}(En||(En={})),function(e){e.level="wageringBonuses.level",e.current="wageringBonuses.current",e.next="wageringBonuses.next",e.first="wageringBonuses.first",e.last="wageringBonuses.last",e.previous="wageringBonuses.previous",e.startChallenge="wageringBonuses.startChallenge"}(vn||(vn={}));const Tn={en:{wageringBonuses:{level:"Level",current:"Current",next:"Next",first:"First",last:"Last",previous:"Previous",startChallenge:"START CHALLENGE"}},"zh-hk":{wageringBonuses:{level:"等級",current:"当前",next:"下一個",first:"第一個",last:"最後一個",previous:"上一個",startChallenge:"開始挑戰"}}};
|
|
1405
|
+
/* src/CasinoWageringBonusesController.svelte generated by Svelte v3.58.0 */function Bn(e,t,n){const r=e.slice();return r[15]=t[n],r}function _n(e,t,n){const r=e.slice();return r[18]=t[n],r}
|
|
718
1406
|
// (87:4) {#each Object.keys(BonusStatus) as _status}
|
|
719
|
-
function
|
|
720
|
-
return e[11](/*_status*/e[18])}return{c(){t=
|
|
1407
|
+
function wn(e){let t,n,r,o,i,s,u=X[/*_status*/e[18]]+"";function d(){/*click_handler*/
|
|
1408
|
+
return e[11](/*_status*/e[18])}return{c(){t=h("li"),n=f(u),r=p(),g(t,"class",o=/*status*/e[0]===X[/*_status*/e[18]]?"active":"")},m(e,o){var c,u,h,f;l(e,t,o),a(t,n),a(t,r),i||(u="click",h=d,(c=t).addEventListener(u,h,f),s=()=>c.removeEventListener(u,h,f),i=!0)},p(n,r){e=n,/*status*/1&r&&o!==(o=/*status*/e[0]===X[/*_status*/e[18]]?"active":"")&&g(t,"class",o)},d(e){e&&c(t),i=!1,s()}}}
|
|
721
1409
|
// (120:4) {:else}
|
|
722
|
-
function
|
|
1410
|
+
function An(t){let n;return{c(){n=f("No wagering bonuses found")},m(e,t){l(e,n,t)},p:e,d(e){e&&c(n)}}}
|
|
723
1411
|
// (118:4) {#if errorMessage}
|
|
724
|
-
function
|
|
1412
|
+
function Hn(e){let t,n,r;return{c(){var o,i,s,a;t=h("div"),n=f("Error: "),r=f(/*errorMessage*/e[7]),o=t,i="color",null===(s="red")?o.style.removeProperty(i):o.style.setProperty(i,s,a?"important":"")},m(e,o){l(e,t,o),a(t,n),a(t,r)},p(e,t){/*errorMessage*/128&t&&function(e,t){t=""+t,e.data!==t&&(e.data=t)}(r,/*errorMessage*/e[7])},d(e){e&&c(t)}}}
|
|
725
1413
|
// (105:2) {#if bonuses.length > 0}
|
|
726
|
-
function
|
|
1414
|
+
function Cn(e){let t,n=/*bonuses*/e[5],r=[];for(let t=0;t<n.length;t+=1)r[t]=Ln(Bn(e,n,t));return{c(){for(let e=0;e<r.length;e+=1)r[e].c();t=d()},m(e,n){for(let t=0;t<r.length;t+=1)r[t]&&r[t].m(e,n);l(e,t,n)},p(e,o){if(/*endpoint, session, lang, currency, JSON, bonuses, status*/63&o){let i;for(n=/*bonuses*/e[5],i=0;i<n.length;i+=1){const s=Bn(e,n,i);r[i]?r[i].p(s,o):(r[i]=Ln(s),r[i].c(),r[i].m(t.parentNode,t))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(e){u(r,e),e&&c(t)}}}
|
|
727
1415
|
// (102:0) {#if isLoading}
|
|
728
|
-
function
|
|
1416
|
+
function Sn(t){let n;return{c(){n=f("Loading, please wait ...")},m(e,t){l(e,n,t)},p:e,d(e){e&&c(n)}}}
|
|
729
1417
|
// (106:4) {#each bonuses as item}
|
|
730
|
-
function
|
|
731
|
-
return e[6]?
|
|
1418
|
+
function Ln(e){let n,r=[{endpoint:/*endpoint*/e[1],session:/*session*/e[3],lang:/*lang*/e[2],currency:/*currency*/e[4],rawbonus:JSON.stringify(/*item*/e[15]),status:/*status*/e[0]}],o={};for(let e=0;e<r.length;e+=1)o=t(o,r[e]);return{c(){n=h("casino-wagering-bonus"),m(n,o)},m(e,t){l(e,n,t)},p(e,t){m(n,o=function(e,t){const n={},r={},o={$$scope:1};let i=e.length;for(;i--;){const s=e[i],a=t[i];if(a){for(const e in s)e in a||(r[e]=1);for(const e in a)o[e]||(n[e]=a[e],o[e]=1);e[i]=a}else for(const e in s)o[e]=1}for(const e in r)e in n||(n[e]=void 0);return n}(r,[/*endpoint, session, lang, currency, bonuses, status*/63&t&&{endpoint:/*endpoint*/e[1],session:/*session*/e[3],lang:/*lang*/e[2],currency:/*currency*/e[4],rawbonus:JSON.stringify(/*item*/e[15]),status:/*status*/e[0]}]))},d(e){e&&c(n)}}}function Pn(n){let r,o,i,s,f=Object.keys(X),g=[];for(let e=0;e<f.length;e+=1)g[e]=wn(_n(n,f,e));let b=[V("WageringTabs")],y={};for(let e=0;e<b.length;e+=1)y=t(y,b[e]);function E(e,t){/*isLoading*/
|
|
1419
|
+
return e[6]?Sn:/*bonuses*/e[5].length>0?Cn:/*errorMessage*/e[7]?Hn:An}let v=E(n),T=v(n);return{c(){r=h("div"),o=h("ul");for(let e=0;e<g.length;e+=1)g[e].c();i=p(),T.c(),s=d(),this.c=e,m(r,y)},m(e,t){l(e,r,t),a(r,o);for(let e=0;e<g.length;e+=1)g[e]&&g[e].m(o,null);l(e,i,t),T.m(e,t),l(e,s,t)},p(e,[t]){if(/*status, BonusStatus, Object, init*/257&t){let n;for(f=Object.keys(X),n=0;n<f.length;n+=1){const r=_n(e,f,n);g[n]?g[n].p(r,t):(g[n]=wn(r),g[n].c(),g[n].m(o,null))}for(;n<g.length;n+=1)g[n].d(1);g.length=f.length}v===(v=E(e))&&T?T.p(e,t):(T.d(1),T=v(e),T&&(T.c(),T.m(s.parentNode,s)))},i:e,o:e,d(e){e&&c(r),u(g,e),e&&c(i),T.d(e),e&&c(s)}}}function Rn(e,t,n){let{endpoint:r=""}=t,{lang:o=z.en}=t,{session:i=""}=t,{currency:s="EUR"}=t,{status:a=X.claimable}=t,{limit:l=""}=t,c=!1;v((()=>(n(10,c=!0),()=>{n(10,c=!1)})));let u,h=[],f=!0,p="";yn(Tn);const d=(g={WageringProgressUpdate:e=>{n(5,h=h.map((t=>{let n=null==e?void 0:e.items[t.bonusWalletID];if(!n)return t;let{status:r,level:o,levelIncrement:i,gap:s}=n,a=Object.assign({},t);return a=Object.assign(Object.assign({},a),{wageringProgress:Object.assign(Object.assign({},a.wageringProgress),{currentLevel:o,currentLevelIncrement:i,gap:s})}),r&&(a=Object.assign(Object.assign({},a),{status:r}),setTimeout((()=>m()),500)),a})))}},e=>{let t=e.data;if(t)try{let e=JSON.parse(t);if(!e)return;Object.keys(g).map((t=>{if(e.messageType==t){const{messageType:n}=e,r=F(e,["messageType"]);
|
|
732
1420
|
// console.log(messageType, restData);
|
|
733
|
-
g[t](r)}}))}catch(e){console.error(e)}});var g;const m=async()=>{c&&a&&o&&i&&r&&(n(6,
|
|
1421
|
+
g[t](r)}}))}catch(e){console.error(e)}});var g;const m=async()=>{c&&a&&o&&i&&r&&(n(6,f=!0),await(async()=>{const e=await ee(r,i,{lang:o,status:a,limit:l});e.success?(n(5,h=e.items||e.bonuses),
|
|
734
1422
|
// if(status !== BonusStatus.claimable){
|
|
735
1423
|
// bonuses = _bonuses.filter(bonus => bonus.status === status)
|
|
736
1424
|
// }else{
|
|
737
1425
|
// bonuses = _bonuses
|
|
738
1426
|
// }
|
|
739
|
-
|
|
1427
|
+
J(u,d),a===X.active&&(u=Q(r,i,h,d))):n(7,p=e.errorMessage)})(),n(6,f=!1))};q({OnWageringBonusClaimed:()=>m(),OnWageringBonusExpired:()=>m()}),v((()=>()=>J(u,d)));return e.$$set=e=>{"endpoint"in e&&n(1,r=e.endpoint),"lang"in e&&n(2,o=e.lang),"session"in e&&n(3,i=e.session),"currency"in e&&n(4,s=e.currency),"status"in e&&n(0,a=e.status),"limit"in e&&n(9,l=e.limit)},e.$$.update=()=>{/*isMounted*/1024&e.$$.dirty&&c&&m(),/*endpoint*/2&e.$$.dirty&&r&&m(),/*lang*/4&e.$$.dirty&&o&&m(),/*session*/8&e.$$.dirty&&i&&m()},[a,r,o,i,s,h,f,p,m,l,c,e=>{a!==X[e]&&(n(0,a=X[e]),m())}]}class Nn extends D{constructor(e){super();const t=document.createElement("style");t.textContent=':host{font-family:system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"}*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box}casino-wagering-bonus::part(Root){margin-bottom:30px}.WageringTabs{margin:20px 0}.WageringTabs li{display:inline;margin:10px 10px 10px 0;padding:10px;border:1px #ccc solid;cursor:pointer}.WageringTabs li.active{border-color:aquamarine;font-weight:700}',this.shadowRoot.appendChild(t),M(this,{target:this.shadowRoot,props:b(this.attributes),customElement:!0},Rn,Pn,s,{endpoint:1,lang:2,session:3,currency:4,status:0,limit:9},null),e&&(e.target&&l(e.target,this,e.anchor),e.props&&(this.$set(e.props),P()))}static get observedAttributes(){return["endpoint","lang","session","currency","status","limit"]}get endpoint(){return this.$$.ctx[1]}set endpoint(e){this.$$set({endpoint:e}),P()}get lang(){return this.$$.ctx[2]}set lang(e){this.$$set({lang:e}),P()}get session(){return this.$$.ctx[3]}set session(e){this.$$set({session:e}),P()}get currency(){return this.$$.ctx[4]}set currency(e){this.$$set({currency:e}),P()}get status(){return this.$$.ctx[0]}set status(e){this.$$set({status:e}),P()}get limit(){return this.$$.ctx[9]}set limit(e){this.$$set({limit:e}),P()}}
|
|
740
1428
|
// @ts-ignore
|
|
741
|
-
return!customElements.get("casino-wagering-bonuses-controller")&&customElements.define("casino-wagering-bonuses-controller",
|
|
1429
|
+
return!customElements.get("casino-wagering-bonuses-controller")&&customElements.define("casino-wagering-bonuses-controller",Nn),Nn}));
|
|
742
1430
|
//# sourceMappingURL=casino-wagering-bonuses-controller.js.map
|