@everymatrix/casino-wagering-bonuses-controller 1.1.0 → 1.1.2
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,8 @@
|
|
|
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
|
|
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}let a,l;function c(e,t){return a||(a=document.createElement("a")),a.href=t,e===a.href}function u(t,...n){if(null==t)return e;const r=t.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}function h(e,t){e.appendChild(t)}function p(e,t,n){e.insertBefore(t,n||null)}function f(e){e.parentNode.removeChild(e)}function d(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function g(e){return document.createElement(e)}function m(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function b(e){return document.createTextNode(e)}function y(){return b(" ")}function v(){return b("")}function E(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function C(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function w(e,t){
|
|
4
4
|
// @ts-ignore
|
|
5
|
-
const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const
|
|
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]:C(e,r,t[r])}function T(e,t){for(const n in t)C(e,n,t[n])}function B(e,t,n){t in e?e[t]="boolean"==typeof e[t]&&""===n||n:C(e,t,n)}function A(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function S(e){const t={};for(const n of e)t[n.name]=n.value;return t}function _(e){l=e}function H(e){(function(){if(!l)throw new Error("Function called outside component initialization");return l})().$$.on_mount.push(e)}const L=[],P=[],R=[],I=[],O=Promise.resolve();let M=!1;function x(e){R.push(e)}
|
|
6
6
|
// flush() calls callbacks in this order:
|
|
7
7
|
// 1. All beforeUpdate callbacks, in order: parents before children
|
|
8
8
|
// 2. All bind:this callbacks, in reverse order: children before parents.
|
|
@@ -21,45 +21,62 @@ const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const o in t)null==t[o
|
|
|
21
21
|
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
|
22
22
|
// callback called a second time; the seen_callbacks set, outside the flush()
|
|
23
23
|
// function, guarantees this behavior.
|
|
24
|
-
const
|
|
25
|
-
function
|
|
24
|
+
const N=new Set;let $=0;// Do *not* move this inside the flush() function
|
|
25
|
+
function D(){const e=l;do{
|
|
26
26
|
// first, call beforeUpdate functions
|
|
27
27
|
// and update components
|
|
28
|
-
for(
|
|
28
|
+
for(;$<L.length;){const e=L[$];$++,_(e),U(e.$$)}for(_(null),L.length=0,$=0;P.length;)P.pop()();
|
|
29
29
|
// then, once components are updated, call
|
|
30
30
|
// afterUpdate functions. This may cause
|
|
31
31
|
// subsequent updates...
|
|
32
|
-
for(let e=0;e<
|
|
32
|
+
for(let e=0;e<R.length;e+=1){const t=R[e];N.has(t)||(
|
|
33
33
|
// ...so guard against infinite loops
|
|
34
|
-
|
|
34
|
+
N.add(t),t())}R.length=0}while(L.length);for(;I.length;)I.pop()();M=!1,N.clear(),_(e)}function U(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(x)}}const k=new Set;function F(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 G(e,t){-1===e.$$.dirty[0]&&(L.push(e),M||(M=!0,O.then(D)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function V(t,s,a,c,u,h,p,d=[-1]){const g=l;_(t);const m=t.$$={fragment:null,ctx:null,
|
|
35
35
|
// state
|
|
36
|
-
props:
|
|
36
|
+
props:h,update:e,not_equal:u,bound:r(),
|
|
37
37
|
// lifecycle
|
|
38
|
-
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(
|
|
38
|
+
on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(g?g.$$.context:[])),
|
|
39
39
|
// everything else
|
|
40
|
-
callbacks:
|
|
40
|
+
callbacks:r(),dirty:d,skip_bound:!1,root:s.target||g.$$.root};p&&p(m.root);let b=!1;if(m.ctx=a?a(t,s.props||{},((e,n,...r)=>{const o=r.length?r[0]:n;return m.ctx&&u(m.ctx[e],m.ctx[e]=o)&&(!m.skip_bound&&m.bound[e]&&m.bound[e](o),b&&G(t,e)),n})):[],m.update(),b=!0,o(m.before_update),
|
|
41
41
|
// `false` as a special case of no DOM component
|
|
42
|
-
m.fragment=!!c&&c(m.ctx),
|
|
42
|
+
m.fragment=!!c&&c(m.ctx),s.target){if(s.hydrate){const e=function(e){return Array.from(e.childNodes)}(s.target);
|
|
43
43
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
44
|
-
m.fragment&&m.fragment.l(e),e.forEach(
|
|
44
|
+
m.fragment&&m.fragment.l(e),e.forEach(f)}else
|
|
45
45
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
|
-
m.fragment&&m.fragment.c();
|
|
46
|
+
m.fragment&&m.fragment.c();s.intro&&((y=t.$$.fragment)&&y.i&&(k.delete(y),y.i(v))),function(e,t,r,s){const{fragment:a,on_mount:l,on_destroy:c,after_update:u}=e.$$;a&&a.m(t,r),s||
|
|
47
47
|
// onMount happens before the initial afterUpdate
|
|
48
|
-
|
|
48
|
+
x((()=>{const t=l.map(n).filter(i);c?c.push(...t):
|
|
49
49
|
// Edge case - component was destroyed immediately,
|
|
50
50
|
// most likely as a result of a binding initialising
|
|
51
|
-
|
|
52
|
-
/* ../casino-wagering-bonus-progress/src/CasinoWageringBonusProgress.svelte generated by Svelte v3.48.0 */
|
|
53
|
-
function H(n){let o,r,s,i,a,l,c,h=[{class:"ring",r:/*radius*/n[2],cx:/*center*/n[7],cy:/*center*/n[7],"stroke-width":`${/*ringStrokeWidth*/n[4]}px`}],f={};for(let e=0;e<h.length;e+=1)f=t(f,h[e]);let v=[{class:"ring ring-progress "+(/*status*/n[1]===/*BonusStatus*/n[5].InProgress?"active":""),r:/*radius*/n[2],cx:/*center*/n[7],cy:/*center*/n[7],"stroke-width":`${/*ringStrokeWidth*/n[4]}px`,"stroke-dasharray":`${/*circumference*/n[6]} ${/*circumference*/n[6]}`,"stroke-dashoffset":/*circumference*/n[6]-Number(/*percent*/n[0])/100*/*circumference*/n[6]}],C={};for(let e=0;e<v.length;e+=1)C=t(C,v[e]);let y=[{class:"center "+(/*status*/n[1]===/*BonusStatus*/n[5].InProgress?"active":""),r:/*radius*/n[2]-/*ringStrokeWidth*/n[4]/2-3,cx:/*center*/n[7],cy:/*center*/n[7]}],w={};for(let e=0;e<y.length;e+=1)w=t(w,y[e]);let b=[{x:/*center*/n[7],y:/*center*/n[7]}],$={};for(let e=0;e<b.length;e+=1)$=t($,b[e]);let T=[{width:/*size*/n[3],height:/*size*/n[3]}],S={};for(let e=0;e<T.length;e+=1)S=t(S,T[e]);return{c(){o=g("svg"),r=g("circle"),s=g("circle"),i=g("circle"),a=g("text"),l=m(/*percent*/n[0]),c=m("%"),this.c=e,x(r,f),x(s,C),x(i,w),x(a,$),x(o,S)},m(e,t){d(e,o,t),u(o,r),u(o,s),u(o,i),u(o,a),u(a,l),u(a,c)},p(e,[t]){x(r,f=Z(h,[/*radius, center, ringStrokeWidth*/148&t&&{class:"ring",r:/*radius*/e[2],cx:/*center*/e[7],cy:/*center*/e[7],"stroke-width":`${/*ringStrokeWidth*/e[4]}px`}])),x(s,C=Z(v,[/*status, BonusStatus, radius, center, ringStrokeWidth, circumference, percent*/247&t&&{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]}])),x(i,w=Z(y,[/*status, BonusStatus, radius, ringStrokeWidth, center*/182&t&&{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&t&&E(l,/*percent*/e[0]),x(a,$=Z(b,[/*center*/128&t&&{x:/*center*/e[7],y:/*center*/e[7]}])),x(o,S=Z(T,[/*size*/8&t&&{width:/*size*/e[3],height:/*size*/e[3]}]))},i:e,o:e,d(e){e&&p(o)}}}function z(e,t,n){let o,r,s,i,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,r=o/7.5),/*size, ringStrokeWidth*/24&e.$$.dirty&&n(2,s=o/2-r/2),/*size*/8&e.$$.dirty&&n(7,i=o/2),/*radius*/4&e.$$.dirty&&n(6,a=2*s*Math.PI)},n(3,o=200),[l,c,s,o,r,u,a,i]}"function"==typeof HTMLElement&&(N=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:e}=this.$$;this.$$.on_disconnect=e.map(n).filter(s);
|
|
51
|
+
o(t),e.$$.on_mount=[]})),u.forEach(x)}(t,s.target,s.anchor,s.customElement),D()}var y,v;_(g)}let j;"function"==typeof HTMLElement&&(j=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:e}=this.$$;this.$$.on_disconnect=e.map(n).filter(i);
|
|
54
52
|
// @ts-ignore todo: improve typings
|
|
55
53
|
for(const e in this.$$.slotted)
|
|
56
54
|
// @ts-ignore todo: improve typings
|
|
57
|
-
this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,n){this[e]=n}disconnectedCallback(){
|
|
55
|
+
this.appendChild(this.$$.slotted[e])}attributeChangedCallback(e,t,n){this[e]=n}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){!function(e,t){const n=e.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(t),
|
|
58
56
|
// TODO null out other refs, including component.$$ (but need to
|
|
59
57
|
// preserve final state?)
|
|
60
58
|
n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=e}$on(e,t){
|
|
61
59
|
// TODO should this delegate to addEventListener?
|
|
62
|
-
const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.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)}})
|
|
60
|
+
const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.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)}});const Z=e=>K[e]
|
|
61
|
+
/* eslint-disable quote-props */,K={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$"};
|
|
62
|
+
/* ../casino-wagering-bonus-progress/src/CasinoWageringBonusProgress.svelte generated by Svelte v3.48.0 */
|
|
63
|
+
function W(n){let r,o,i,s,a,l,c,u=[{class:"ring",r:/*radius*/n[2],cx:/*center*/n[7],cy:/*center*/n[7],"stroke-width":`${/*ringStrokeWidth*/n[4]}px`}],d={};for(let e=0;e<u.length;e+=1)d=t(d,u[e]);let g=[{class:"ring ring-progress "+(/*status*/n[1]===/*BonusStatus*/n[5].InProgress?"active":""),r:/*radius*/n[2],cx:/*center*/n[7],cy:/*center*/n[7],"stroke-width":`${/*ringStrokeWidth*/n[4]}px`,"stroke-dasharray":`${/*circumference*/n[6]} ${/*circumference*/n[6]}`,"stroke-dashoffset":/*circumference*/n[6]-Number(/*percent*/n[0])/100*/*circumference*/n[6]}],y={};for(let e=0;e<g.length;e+=1)y=t(y,g[e]);let v=[{class:"center "+(/*status*/n[1]===/*BonusStatus*/n[5].InProgress?"active":""),r:/*radius*/n[2]-/*ringStrokeWidth*/n[4]/2-3,cx:/*center*/n[7],cy:/*center*/n[7]}],E={};for(let e=0;e<v.length;e+=1)E=t(E,v[e]);let C=[{x:/*center*/n[7],y:/*center*/n[7]}],w={};for(let e=0;e<C.length;e+=1)w=t(w,C[e]);let B=[{width:/*size*/n[3],height:/*size*/n[3]}],S={};for(let e=0;e<B.length;e+=1)S=t(S,B[e]);return{c(){r=m("svg"),o=m("circle"),i=m("circle"),s=m("circle"),a=m("text"),l=b(/*percent*/n[0]),c=b("%"),this.c=e,T(o,d),T(i,y),T(s,E),T(a,w),T(r,S)},m(e,t){p(e,r,t),h(r,o),h(r,i),h(r,s),h(r,a),h(a,l),h(a,c)},p(e,[t]){T(o,d=F(u,[/*radius, center, ringStrokeWidth*/148&t&&{class:"ring",r:/*radius*/e[2],cx:/*center*/e[7],cy:/*center*/e[7],"stroke-width":`${/*ringStrokeWidth*/e[4]}px`}])),T(i,y=F(g,[/*status, BonusStatus, radius, center, ringStrokeWidth, circumference, percent*/247&t&&{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]}])),T(s,E=F(v,[/*status, BonusStatus, radius, ringStrokeWidth, center*/182&t&&{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&t&&A(l,/*percent*/e[0]),T(a,w=F(C,[/*center*/128&t&&{x:/*center*/e[7],y:/*center*/e[7]}])),T(r,S=F(B,[/*size*/8&t&&{width:/*size*/e[3],height:/*size*/e[3]}]))},i:e,o:e,d(e){e&&f(r)}}}function X(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]}!customElements.get("casino-wagering-bonus-progress")&&customElements.define("casino-wagering-bonus-progress",class extends j{constructor(e){super(),this.shadowRoot.innerHTML="<style>: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}</style>",V(this,{target:this.shadowRoot,props:S(this.attributes),customElement:!0},X,W,s,{percent:0,status:1},null),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),D()))}static get observedAttributes(){return["percent","status"]}get percent(){return this.$$.ctx[0]}set percent(e){this.$$set({percent:e}),D()}get status(){return this.$$.ctx[1]}set status(e){this.$$set({status:e}),D()}});var z="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",Y="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";function J(e,t){var n,r,o;try{n=e.toString().split(".")[1].length}catch(e){n=0}try{r=t.toString().split(".")[1].length}catch(e){r=0}return((e*(o=Math.pow(10,Math.max(n,r)))-t*o)/o).toFixed(n>=r?n:r)}const q=(e,t)=>({remainder:e%t,quotient:Math.floor(e/t)}),Q=e=>{const t=new Date;return new Date(e).getTime()-t.getTime()},ee=e=>{const t=Q(e)/6e4,{quotient:n,remainder:r}=q(t,1440),{quotient:o,remainder:i}=q(r,60),s=Math.floor(i);return[{value:n,symbol:"d"},{value:o,symbol:"h"},{value:s,symbol:"m"}].map((e=>{return t=e.value,(Math.abs(t)<10?`0${t}`:t)+e.symbol;var t})).join(" ")},te=(e,t="")=>({part:e,class:[e,t].join(" ")}),ne=async(e,t={})=>{let n;return n=await fetch(e,t),n=await n.json(),n};
|
|
64
|
+
/******************************************************************************
|
|
65
|
+
Copyright (c) Microsoft Corporation.
|
|
66
|
+
|
|
67
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
68
|
+
purpose with or without fee is hereby granted.
|
|
69
|
+
|
|
70
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
71
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
72
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
73
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
74
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
75
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
76
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
77
|
+
***************************************************************************** */
|
|
78
|
+
/* global Reflect, Promise */
|
|
79
|
+
var re=function(e,t){return re=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])},re(e,t)};function oe(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}re(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ie,se,ae,le,ce=function(){return ce=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},ce.apply(this,arguments)};function ue(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 he(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"}(ie||(ie={})),function(e){e.standard="standard",e.freeBet="freeBet",e.freeRound="freeRound",e.tournamentTicket="tournamentTicket",e.oddsBoost="oddsBoost",e.cashBack="cashBack"}(se||(se={})),function(e){e.Money="money",e.BetCount="betcount"}(ae||(ae={})),function(e){e.en="en",e.zh="zh"}(le||(le={}));var pe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var fe=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){
|
|
63
80
|
/** @license
|
|
64
81
|
* eventsource.js
|
|
65
82
|
* Available under MIT License (MIT)
|
|
@@ -67,118 +84,659 @@ const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{co
|
|
|
67
84
|
*/
|
|
68
85
|
/*jslint indent: 2, vars: true, plusplus: true */
|
|
69
86
|
/*global setTimeout, clearTimeout */
|
|
70
|
-
!function(n){var
|
|
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,p=n.Response,f=n.TextDecoder,d=n.TextEncoder,g=n.AbortController;
|
|
71
88
|
// see #118 (Promise#finally with polyfilled Promise)
|
|
72
89
|
// see #123 (data URLs crash Edge)
|
|
73
90
|
// see #125 (CSP violations)
|
|
74
91
|
// see pull/#138
|
|
75
92
|
// => No way to polyfill Promise#finally
|
|
76
93
|
if("undefined"==typeof window||void 0===c||"readyState"in c||null!=c.body||(// Firefox 2
|
|
77
|
-
c.readyState="loading",window.addEventListener("load",(function(e){c.readyState="complete"}),!1)),null==
|
|
78
|
-
|
|
94
|
+
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
|
+
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};
|
|
79
96
|
// IE, Edge
|
|
80
|
-
null!=
|
|
97
|
+
null!=f&&null!=d&&function(){try{return"test"===(new f).decode((new d).encode("test"),{stream:!0})}catch(e){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+e)}return!1}()||(f=b);var y=function(){};function v(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 E(e){return e.replace(/[A-Z]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+32)}))}function C(e){for(
|
|
81
98
|
// Get headers: implemented according to mozilla's example code: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders#Example
|
|
82
|
-
var t=Object.create(null),n=e.split("\r\n"),
|
|
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[E(i)]=s}this._map=t}function w(){}function T(e){this._headers=e}function B(){}function A(){this._listeners=Object.create(null)}function S(e){r((function(){throw e}),0)}function _(e){this.type=e,this.target=void 0}function H(e,t){_.call(this,e),this.data=t.data,this.lastEventId=t.lastEventId}function L(e,t){_.call(this,e),this.status=t.status,this.statusText=t.statusText,this.headers=t.headers}function P(e,t){_.call(this,e),this.error=t.error}v.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,
|
|
83
100
|
// IE 8 - 9: XDomainRequest#abort() does not fire any event
|
|
84
101
|
// Opera < 10: XMLHttpRequest#abort() does not fire any event
|
|
85
|
-
|
|
102
|
+
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){
|
|
86
103
|
//state = 2;
|
|
87
|
-
var e=0,t="",
|
|
104
|
+
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){
|
|
88
105
|
// IE < 10 throws exception for `xhr.status` when xhr.readyState === 2 || xhr.readyState === 3
|
|
89
106
|
// Opera < 11 throws exception for `xhr.status` when xhr.readyState === 2
|
|
90
107
|
// https://bugs.webkit.org/show_bug.cgi?id=29121
|
|
91
|
-
e=0,t="",
|
|
108
|
+
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){
|
|
92
109
|
// IE 8 - 9 with XMLHttpRequest
|
|
93
|
-
}n.readyState=3,n.responseText=e,n.onprogress()}},
|
|
110
|
+
}n.readyState=3,n.responseText=e,n.onprogress()}},h=function(e,t){if(null!=t&&null!=t.preventDefault||(t={preventDefault:y}),
|
|
94
111
|
// Firefox 52 fires "readystatechange" (xhr.readyState === 4) without final "readystatechange" (xhr.readyState === 3)
|
|
95
112
|
// IE 8 fires "onload" without "onprogress"
|
|
96
|
-
u(),1===a||2===a||3===a){if(a=4,0!==l&&(
|
|
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()}},p=function(){l=r((function(){p()}),500),3===s.readyState&&u()};
|
|
97
114
|
// XDomainRequest#abort removes onprogress, onerror, onload
|
|
98
|
-
"onload"in
|
|
115
|
+
"onload"in s&&(s.onload=function(e){h("load",e)}),"onerror"in s&&(s.onerror=function(e){h("error",e)}),
|
|
99
116
|
// improper fix to match Firefox behaviour, but it is better than just ignore abort
|
|
100
117
|
// see https://bugzilla.mozilla.org/show_bug.cgi?id=768596
|
|
101
118
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=880200
|
|
102
119
|
// https://code.google.com/p/chromium/issues/detail?id=153570
|
|
103
120
|
// IE 8 fires "onload" without "onprogress
|
|
104
|
-
"onabort"in
|
|
121
|
+
"onabort"in s&&(s.onabort=function(e){h("abort",e)}),"onprogress"in s&&(s.onprogress=u),
|
|
105
122
|
// IE 8 - 9 (XMLHTTPRequest)
|
|
106
123
|
// Opera < 12
|
|
107
124
|
// Firefox < 3.5
|
|
108
125
|
// Firefox 3.5 - 3.6 - ? < 9.0
|
|
109
126
|
// onprogress is not fired sometimes or delayed
|
|
110
127
|
// see also #64 (significant lag in IE 11)
|
|
111
|
-
"onreadystatechange"in
|
|
112
|
-
4===
|
|
128
|
+
"onreadystatechange"in s&&(s.onreadystatechange=function(e){!function(e){null!=s&&(// Opera 12
|
|
129
|
+
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
|
|
113
130
|
// and in Firefox 3.6
|
|
114
|
-
u():2===
|
|
131
|
+
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&&(
|
|
115
132
|
// workaround for Opera 12 issue with "progress" events
|
|
116
133
|
// #91 (XMLHttpRequest onprogress not fired for streaming response in Edge 14-15-?)
|
|
117
|
-
l=
|
|
134
|
+
l=r((function(){p()}),0))},v.prototype.abort=function(){this._abort(!1)},v.prototype.getResponseHeader=function(e){return this._contentType},v.prototype.setRequestHeader=function(e,t){var n=this._xhr;"setRequestHeader"in n&&n.setRequestHeader(e,t)},v.prototype.getAllResponseHeaders=function(){
|
|
118
135
|
// XMLHttpRequest#getAllResponseHeaders returns null for CORS requests in Firefox 3.6.28
|
|
119
|
-
return null!=this._xhr.getAllResponseHeaders&&this._xhr.getAllResponseHeaders()||""},
|
|
136
|
+
return null!=this._xhr.getAllResponseHeaders&&this._xhr.getAllResponseHeaders()||""},v.prototype.send=function(){
|
|
120
137
|
// loading indicator in Safari < ? (6), Chrome < 14, Firefox
|
|
121
138
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=736723
|
|
122
|
-
if("ontimeout"in
|
|
139
|
+
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;
|
|
123
140
|
// withCredentials should be set after "open" for Safari and Chrome (< 19 ?)
|
|
124
141
|
"withCredentials"in e&&(e.withCredentials=this.withCredentials);try{
|
|
125
142
|
// xhr.send(); throws "Not enough arguments" in Firefox 3.0
|
|
126
143
|
e.send(void 0)}catch(e){
|
|
127
144
|
// Safari 5.1.7, Opera 12
|
|
128
|
-
throw e}}else{var t=this;t._sendTimeout=
|
|
129
|
-
|
|
145
|
+
throw e}}else{var t=this;t._sendTimeout=r((function(){t._sendTimeout=0,t.send()}),4)}},C.prototype.get=function(e){return this._map[E(e)]},null!=i&&null==i.HEADERS_RECEIVED&&(// IE < 9, Firefox 3.6
|
|
146
|
+
i.HEADERS_RECEIVED=2),w.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 C(s))}},e.withCredentials=s,a)Object.prototype.hasOwnProperty.call(a,c)&&e.setRequestHeader(c,a[c]);return e.send(),e},T.prototype.get=function(e){return this._headers.get(e)},B.prototype.open=function(e,t,n,r,o,i,s){var a=null,l=new g,c=l.signal,p=new f;return h(o,{headers:s,credentials:i?"include":"same-origin",signal:c,cache:"no-store"}).then((function(e){
|
|
130
147
|
// see https://github.com/promises-aplus/promises-spec/issues/179
|
|
131
|
-
return a=e.body.getReader(),t(e.status,e.statusText,e.headers.get("Content-Type"),new
|
|
148
|
+
return a=e.body.getReader(),t(e.status,e.statusText,e.headers.get("Content-Type"),new T(e.headers)),new u((function(e,t){var r=function(){a.read().then((function(t){if(t.done)
|
|
132
149
|
//Note: bytes in textDecoder are ignored
|
|
133
|
-
e(void 0);else{var
|
|
150
|
+
e(void 0);else{var o=p.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){S(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}},H.prototype=Object.create(_.prototype),L.prototype=Object.create(_.prototype),P.prototype=Object.create(_.prototype);var R=-1,I=-1,O=/^text\/event\-stream(;.*)?$/i,M=function(e,t){var n=null==e?t:parseInt(e,10);return n!=n&&(n=t),x(n)},x=function(e){return Math.min(Math.max(e,1e3),18e6)},N=function(e,t,n){try{"function"==typeof t&&t.call(e,n)}catch(e){S(e)}};function $(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=x(1e3),u=M(n.heartbeatTimeout,45e3),h="",p=c,f=!1,d=0,g=n.headers||{},m=n.Transport,b=D&&null==m?void 0:new v(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 B:new w,E=void 0,C=0,T=R,A="",S="",_="",$="",U=0,k=0,F=0,G=function(t,n,r,o){if(0===T)if(200===t&&null!=r&&O.test(r)){T=1,f=Date.now(),p=c,e.readyState=1;var i=new L("open",{status:t,statusText:n,headers:o});e.dispatchEvent(i),N(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.",Z();i=new L("error",{status:t,statusText:n,headers:o});e.dispatchEvent(i),N(e,e.onerror,i),console.error(s)}},V=function(t){if(1===T){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?$:"")+t.slice(0,n+1);$=(-1===n?$:"")+t.slice(n+1),""!==t&&(f=Date.now(),d+=t.length);for(var a=0;a<s.length;a+=1){var l=s.charCodeAt(a);if(U===I&&l==="\n".charCodeAt(0))U=0;else if(U===I&&(U=0),l==="\r".charCodeAt(0)||l==="\n".charCodeAt(0)){if(0!==U){1===U&&(F=a+1);var g=s.slice(k,F-1),m=s.slice(F+(F<a&&s.charCodeAt(F)===" ".charCodeAt(0)?1:0),a);"data"===g?(A+="\n",A+=m):"id"===g?S=m:"event"===g?_=m:"retry"===g?(c=M(m,c),p=c):"heartbeatTimeout"===g&&(u=M(m,u),0!==C&&(o(C),C=r((function(){K()}),u)))}if(0===U){if(""!==A){h=S,""===_&&(_="message");var b=new H(_,{data:A.slice(1),lastEventId:S});if(e.dispatchEvent(b),"open"===_?N(e,e.onopen,b):"message"===_?N(e,e.onmessage,b):"error"===_&&N(e,e.onerror,b),2===T)return}A="",_=""}U=l==="\r".charCodeAt(0)?I:0}else 0===U&&(k=a,U=1),1===U?l===":".charCodeAt(0)&&(F=a+1,U=2):2===U&&(U=3)}}},j=function(t){if(1===T||0===T){T=R,0!==C&&(o(C),C=0),C=r((function(){K()}),p),p=x(Math.min(16*c,2*p)),e.readyState=0;var n=new P("error",{error:t});e.dispatchEvent(n),N(e,e.onerror,n),null!=t&&console.error(t)}},Z=function(){T=2,null!=E&&(E.abort(),E=void 0),0!==C&&(o(C),C=0),e.readyState=2},K=function(){if(C=0,T===R){f=!1,d=0,C=r((function(){K()}),u),T=0,A="",_="",S=h,$="",k=0,F=0,U=0;
|
|
134
151
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=428916
|
|
135
152
|
// Request header field Last-Event-ID is not allowed by Access-Control-Allow-Headers.
|
|
136
|
-
var n=t;if("data:"!==t.slice(0,5)&&"blob:"!==t.slice(0,5)&&""!==
|
|
153
|
+
var n=t;if("data:"!==t.slice(0,5)&&"blob:"!==t.slice(0,5)&&""!==h){
|
|
137
154
|
// Remove the lastEventId parameter if it's already part of the request URL.
|
|
138
|
-
var
|
|
155
|
+
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})),
|
|
139
156
|
// Append the current lastEventId to the request URL.
|
|
140
|
-
n+=(-1===t.indexOf("?")?"?":"&")+l+"="+encodeURIComponent(
|
|
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{E=y.open(b,G,V,j,n,i,s)}catch(e){throw Z(),e}}else if(f||null==E){var p=Math.max((f||Date.now())+u-Date.now(),1);f=!1,C=r((function(){K()}),p)}else j(new Error("No activity within "+u+" milliseconds. "+(0===T?"No response received.":d+" chars received.")+" Reconnecting.")),null!=E&&(E.abort(),E=void 0)};e.url=t,e.readyState=0,e.withCredentials=a,e.headers=g,e._close=Z,K()}(this,e,t)}var D=null!=h&&null!=p&&"body"in p.prototype;$.prototype=Object.create(A.prototype),$.prototype.CONNECTING=0,$.prototype.OPEN=1,$.prototype.CLOSED=2,$.prototype.close=function(){this._close()},$.CONNECTING=0,$.OPEN=1,$.CLOSED=2,$.prototype.withCredentials=void 0;var U=l;null==i||null!=l&&"withCredentials"in l.prototype||(
|
|
141
158
|
// Why replace a native EventSource ?
|
|
142
159
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=444328
|
|
143
160
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=831392
|
|
144
161
|
// https://code.google.com/p/chromium/issues/detail?id=260144
|
|
145
162
|
// https://code.google.com/p/chromium/issues/detail?id=225654
|
|
146
163
|
// ...
|
|
147
|
-
|
|
148
|
-
//
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
//
|
|
166
|
-
|
|
167
|
-
//
|
|
168
|
-
function
|
|
169
|
-
|
|
170
|
-
|
|
164
|
+
U=$),r((function(){if(-1!==["Asia/Anadyr","Asia/Barnaul","Asia/Chita","Asia/Irkutsk","Asia/Kamchatka","Asia/Khandyga","Asia/Krasnoyarsk","Asia/Magadan","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Sakhalin","Asia/Srednekolymsk","Asia/Tomsk","Asia/Ust-Nera","Asia/Vladivostok","Asia/Yakutsk","Asia/Yekaterinburg","Europe/Astrakhan","Europe/Kaliningrad","Europe/Kirov","Europe/Moscow","Europe/Samara","Europe/Saratov","Europe/Simferopol","Europe/Ulyanovsk","Europe/Volgograd","W-SU"].indexOf((new Intl.DateTimeFormat).resolvedOptions().timeZone)){var e=function(e){return"[97m[1m"+e+"[22m[37m"},t=["","🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦","","[37m24 февраля "+e("Россия напала на Украину")+".","","Народ Украины всеобще мобилизован и готов защищать свою страну от вражеского вторжения. "+e("91% украинцев полностью поддерживает своего президента Владимира Зеленского")+" и его ответные действия на нападение России.","","Весь мир осудил необоснованное вторжение и решил ввести "+e("невиданные ранее санкции против России")+". С каждым новым днем они будут ощущаться все сильнее и сильнее среди мирных граждан.","","В то же время, "+e("российское правительство ограничивает доступ граждан к внешней информации")+", насаждая однобокие формулировки и версии происходящего.","","В качестве надежного источника информации загрузите безопасный браузер Tor:","",e("https://www.torproject.org/"),"","И посетите:","",e("https://www.bbcweb3hytmzhn5d532owbu6oqadra5z3ar726vq5kgwwn6aucdccrad.onion/russian"),"","🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦","",e("Прекратите эту бессмысленную войну! Остановите военного преступника Путина!")+"[39m","","🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦 🇷🇺 🇺🇦",""].join("\n");alert(t),window.open("http://www.change.org/NetVoyne")}}),15e3),function(n){var r=function(e){e.EventSourcePolyfill=$,e.NativeEventSource=l,e.EventSource=U}(t);void 0!==r&&(e.exports=r)}()}("undefined"==typeof globalThis?"undefined"!=typeof window?window:"undefined"!=typeof self?self:pe:globalThis)}));const de=e=>window.postMessage(e,window.location.href),ge=e=>{const t=(n=e,e=>{Object.keys(n).map((t=>{if(e.data&&e.data.type==t){const r=ue(e.data,["type"]);n[t](r)}}))});var n;H((()=>(window.addEventListener("message",t),()=>{window.removeEventListener("message",t)})))},me=(e,t)=>{e&&(e.removeEventListener("message",t),e.close())},be=(e,t,n,r)=>{if(!n.length)return;const o={bonusWalletIDs:null==n?void 0:n.filter((e=>we(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 fe.EventSourcePolyfill(e,{headers:{accept:"text/event-stream"}}),n.addEventListener("message",t),n})(i,r)},ye=(e,t)=>{switch(e){case ie.completed:case ie.released:case ie.expired:case ie.closed:case ie.forfeited:return t.other();case ie.active:return t.active();default:throw new Error(`unknown Bonus Status: ${e}`)}},ve=(e,t)=>{switch(e){case ie.completed:case ie.released:return t.completed();case ie.active:case ie.expired:case ie.closed:case ie.forfeited:return t.current();default:throw new Error(`unknown Bonus Status: ${e}`)}},Ee=async(e,t,n={})=>{const{limit:r,lang:o,status:i}=n,s=ue(n,["limit","lang","status"]),a=Object.assign(Object.assign({type:"wagering",pagination:`limit=${r||50},offset=0`,language:o},i&&i!==ie.claimable?{status:i}:{}),s),l=i===ie.claimable?"claimable":"granted",c=new URL(`${e}/bonus/${l}`);return Object.keys(a).map((e=>{c.searchParams.append(e,a[e])})),await ne(c,{headers:Object.assign({},t?{"x-SessionId":t}:{})})},Ce=async(e,t,n,r)=>await ne(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"}}),we=e=>!!e.bonusWalletID&&ye(e.status,{active:()=>!0,other:()=>!1}),Te=(e,t)=>{switch(t.type){case se.standard:case se.freeBet:return((e,t)=>{let n;switch(t.type){case se.standard:n="bonus money";break;case se.freeBet:n="Free Bet"}const r=Z(Object.keys(e.increment)[0]);return"percentage"===t.mode?`${100*t.bonusAmount}% up to ${r}${t.capAmount} ${n}`:"fixed"===t.mode?`${r}${t.bonusAmount} ${n}`:void 0})(e,t);case se.freeRound:return`${t.freespinNumber} Free Spins`;case se.tournamentTicket:return"Enroll to Tournament Ticket";case se.oddsBoost:return"Enroll to Odds Boost";case se.cashBack:return"Enroll to Cash Back"}},Be=(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=>Te(t,e)))}}))
|
|
165
|
+
// .map(line => `${line.key} Level: ${getTitleByIndex(line.index)}`);
|
|
166
|
+
return ye(e.status,{active:()=>t!==ie.claimable?s([{key:"current",index:o},{key:"next",index:o+1}]):t===ie.claimable?s([{key:"first",index:0},{key:"next",index:1}]):void 0,other:()=>s([{key:"last",index:i},{key:"previous",index:i-1}])})},Ae=(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 ae.Money:return`Play for ${a}${o} in total`;case ae.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 ae.Money:return`Remaining: ${a}${i}`;case ae.BetCount:return`Bets Remaining: ${i} bets`}case"got":const t=_e(e);switch(e.wageringType){case ae.Money:return`Wagered: ${a}${t}`;case ae.BetCount:return`Bets Placed: ${t} bets`}}},Se=(e,t)=>({target:()=>ye(e.status,{active:()=>Ae(e,t,"target"),other:()=>`This bonus is ${e.status}`}),remaining:()=>Ae(e,t,"remaining"),got:()=>Ae(e,t,"got")}),_e=e=>{if(!e.wageringProgress)return 0;const{currency:t,currentLevelIncrement:n,gap:r,currentLevel:o}=e.wageringProgress;return Number(J(n,r))},He=(e,t,n,r)=>{const o=Q(e);o<0?n():(r(ee(e)),
|
|
167
|
+
// check if bonus will expire
|
|
168
|
+
o<t&&setTimeout((()=>{de({type:"OnWageringBonusExpired"})}),o))},Le=[];
|
|
169
|
+
/**
|
|
170
|
+
* Create a `Writable` store that allows both updating and reading by subscription.
|
|
171
|
+
* @param {*=}value initial value
|
|
172
|
+
* @param {StartStopNotifier=}start start and stop notifications for subscriptions
|
|
173
|
+
*/
|
|
174
|
+
function Pe(t,n=e){let r;const o=new Set;function i(e){if(s(t,e)&&(t=e,r)){// store is ready
|
|
175
|
+
const e=!Le.length;for(const e of o)e[1](),Le.push(e,t);if(e){for(let e=0;e<Le.length;e+=2)Le[e][0](Le[e+1]);Le.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=null)}}}}function Re(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 h=0,p=e;const f=()=>{if(h)return;p();const r=n(s?c[0]:c,t);l?t(r):p=i(r)?r:e},d=a.map(((e,t)=>u(e,(e=>{c[t]=e,h&=~(1<<t),r&&f()}),(()=>{h|=1<<t}))));return r=!0,f(),function(){o(d),p()}},{subscribe:Pe(r,c).subscribe};
|
|
176
|
+
/**
|
|
177
|
+
* Creates a `Readable` store that allows reading by subscription.
|
|
178
|
+
* @param value initial value
|
|
179
|
+
* @param {StartStopNotifier}start start and stop notifications for subscriptions
|
|
180
|
+
*/
|
|
181
|
+
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===Oe}(e)}
|
|
182
|
+
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
|
183
|
+
(e)};var Oe="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Me(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Ue((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function xe(e,t,n){return e.concat(t).map((function(e){return Me(e,n)}))}function Ne(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function $e(e,t){try{return t in e}catch(e){return!1}}
|
|
184
|
+
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
|
185
|
+
function De(e,t,n){var r={};return n.isMergeableObject(e)&&Ne(e).forEach((function(t){r[t]=Me(e[t],n)})),Ne(t).forEach((function(o){(function(e,t){return $e(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t));// and also unsafe if they're nonenumerable.
|
|
186
|
+
})(e,o)||($e(e,o)&&n.isMergeableObject(t[o])?r[o]=function(e,t){if(!t.customMerge)return Ue;var n=t.customMerge(e);return"function"==typeof n?n:Ue}(o,n)(e[o],t[o],n):r[o]=Me(t[o],n))})),r}function Ue(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||xe,n.isMergeableObject=n.isMergeableObject||Ie,
|
|
187
|
+
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
|
188
|
+
// implementations can use it. The caller may not replace it.
|
|
189
|
+
n.cloneUnlessOtherwiseSpecified=Me;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):De(e,t,n):Me(t,n)}Ue.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Ue(e,n,t)}),{})};var ke,Fe,Ge,Ve=Ue;
|
|
190
|
+
/**
|
|
191
|
+
* Type Guards
|
|
192
|
+
*/
|
|
193
|
+
function je(e){return e.type===Fe.literal}function Ze(e){return e.type===Fe.argument}function Ke(e){return e.type===Fe.number}function We(e){return e.type===Fe.date}function Xe(e){return e.type===Fe.time}function ze(e){return e.type===Fe.select}function Ye(e){return e.type===Fe.plural}function Je(e){return e.type===Fe.pound}function qe(e){return e.type===Fe.tag}function Qe(e){return!(!e||"object"!=typeof e||e.type!==Ge.number)}function et(e){return!(!e||"object"!=typeof e||e.type!==Ge.dateTime)}
|
|
194
|
+
// @generated from regex-gen.ts
|
|
195
|
+
!function(e){
|
|
196
|
+
/** Argument is unclosed (e.g. `{0`) */
|
|
197
|
+
e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",
|
|
198
|
+
/** Argument is empty (e.g. `{}`). */
|
|
199
|
+
e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",
|
|
200
|
+
/** Argument is malformed (e.g. `{foo!}``) */
|
|
201
|
+
e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",
|
|
202
|
+
/** Expect an argument type (e.g. `{foo,}`) */
|
|
203
|
+
e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",
|
|
204
|
+
/** Unsupported argument type (e.g. `{foo,foo}`) */
|
|
205
|
+
e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",
|
|
206
|
+
/** Expect an argument style (e.g. `{foo, number, }`) */
|
|
207
|
+
e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",
|
|
208
|
+
/** The number skeleton is invalid. */
|
|
209
|
+
e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",
|
|
210
|
+
/** The date time skeleton is invalid. */
|
|
211
|
+
e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",
|
|
212
|
+
/** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */
|
|
213
|
+
e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",
|
|
214
|
+
/** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */
|
|
215
|
+
e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",
|
|
216
|
+
/** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */
|
|
217
|
+
e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",
|
|
218
|
+
/** Missing select argument options (e.g. `{foo, select}`) */
|
|
219
|
+
e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",
|
|
220
|
+
/** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */
|
|
221
|
+
e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",
|
|
222
|
+
/** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */
|
|
223
|
+
e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",
|
|
224
|
+
/** Expecting a selector in `select` argument (e.g `{foo, select}`) */
|
|
225
|
+
e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",
|
|
226
|
+
/** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */
|
|
227
|
+
e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",
|
|
228
|
+
/** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */
|
|
229
|
+
e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",
|
|
230
|
+
/**
|
|
231
|
+
* Expecting a message fragment after the `plural` or `selectordinal` selector
|
|
232
|
+
* (e.g. `{foo, plural, one}`)
|
|
233
|
+
*/
|
|
234
|
+
e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",
|
|
235
|
+
/** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */
|
|
236
|
+
e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",
|
|
237
|
+
/**
|
|
238
|
+
* Duplicate selectors in `plural` or `selectordinal` argument.
|
|
239
|
+
* (e.g. {foo, plural, one {#} one {#}})
|
|
240
|
+
*/
|
|
241
|
+
e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",
|
|
242
|
+
/** Duplicate selectors in `select` argument.
|
|
243
|
+
* (e.g. {foo, select, apple {apple} apple {apple}})
|
|
244
|
+
*/
|
|
245
|
+
e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",
|
|
246
|
+
/** Plural or select argument option must have `other` clause. */
|
|
247
|
+
e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",
|
|
248
|
+
/** The tag is malformed. (e.g. `<bold!>foo</bold!>) */
|
|
249
|
+
e[e.INVALID_TAG=23]="INVALID_TAG",
|
|
250
|
+
/** The tag name is invalid. (e.g. `<123>foo</123>`) */
|
|
251
|
+
e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",
|
|
252
|
+
/** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */
|
|
253
|
+
e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",
|
|
254
|
+
/** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */
|
|
255
|
+
e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(ke||(ke={})),function(e){
|
|
256
|
+
/**
|
|
257
|
+
* Raw text
|
|
258
|
+
*/
|
|
259
|
+
e[e.literal=0]="literal",
|
|
260
|
+
/**
|
|
261
|
+
* Variable w/o any format, e.g `var` in `this is a {var}`
|
|
262
|
+
*/
|
|
263
|
+
e[e.argument=1]="argument",
|
|
264
|
+
/**
|
|
265
|
+
* Variable w/ number format
|
|
266
|
+
*/
|
|
267
|
+
e[e.number=2]="number",
|
|
268
|
+
/**
|
|
269
|
+
* Variable w/ date format
|
|
270
|
+
*/
|
|
271
|
+
e[e.date=3]="date",
|
|
272
|
+
/**
|
|
273
|
+
* Variable w/ time format
|
|
274
|
+
*/
|
|
275
|
+
e[e.time=4]="time",
|
|
276
|
+
/**
|
|
277
|
+
* Variable w/ select format
|
|
278
|
+
*/
|
|
279
|
+
e[e.select=5]="select",
|
|
280
|
+
/**
|
|
281
|
+
* Variable w/ plural format
|
|
282
|
+
*/
|
|
283
|
+
e[e.plural=6]="plural",
|
|
284
|
+
/**
|
|
285
|
+
* Only possible within plural argument.
|
|
286
|
+
* This is the `#` symbol that will be substituted with the count.
|
|
287
|
+
*/
|
|
288
|
+
e[e.pound=7]="pound",
|
|
289
|
+
/**
|
|
290
|
+
* XML-like tag
|
|
291
|
+
*/
|
|
292
|
+
e[e.tag=8]="tag"}(Fe||(Fe={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(Ge||(Ge={}));var tt=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,nt=/(?:[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
|
+
/**
|
|
294
|
+
* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
295
|
+
* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js
|
|
296
|
+
* with some tweaks
|
|
297
|
+
*/
|
|
298
|
+
/**
|
|
299
|
+
* Parse Date time skeleton into Intl.DateTimeFormatOptions
|
|
300
|
+
* Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
301
|
+
* @public
|
|
302
|
+
* @param skeleton skeleton string
|
|
303
|
+
*/
|
|
304
|
+
function rt(e){var t={};return e.replace(nt,(function(e){var n=e.length;switch(e[0]){
|
|
305
|
+
// Era
|
|
306
|
+
case"G":t.era=4===n?"long":5===n?"narrow":"short";break;
|
|
307
|
+
// Year
|
|
308
|
+
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");
|
|
309
|
+
// Quarter
|
|
310
|
+
case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
311
|
+
// Month
|
|
312
|
+
case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;
|
|
313
|
+
// Week
|
|
314
|
+
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");
|
|
315
|
+
// Weekday
|
|
316
|
+
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;
|
|
317
|
+
// Period
|
|
318
|
+
case"a":// AM, PM
|
|
319
|
+
t.hour12=!0;break;case"b":// am, pm, noon, midnight
|
|
320
|
+
case"B":// flexible day periods
|
|
321
|
+
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
322
|
+
// Hour
|
|
323
|
+
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");
|
|
324
|
+
// Minute
|
|
325
|
+
case"m":t.minute=["numeric","2-digit"][n-1];break;
|
|
326
|
+
// Second
|
|
327
|
+
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");
|
|
328
|
+
// Zone
|
|
329
|
+
case"z":// 1..3, 4: specific non-location format
|
|
330
|
+
t.timeZoneName=n<4?"short":"long";break;case"Z":// 1..3, 4, 5: The ISO8601 varios formats
|
|
331
|
+
case"O":// 1, 4: miliseconds in day short, long
|
|
332
|
+
case"v":// 1, 4: generic non-location format
|
|
333
|
+
case"V":// 1, 2, 3, 4: time zone ID or city
|
|
334
|
+
case"X":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
335
|
+
case"x":// 1, 2, 3, 4: The ISO8601 varios formats
|
|
336
|
+
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}
|
|
337
|
+
// @generated from regex-gen.ts
|
|
338
|
+
var ot=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;var it=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,st=/^(@+)?(\+|#+)?[rs]?$/g,at=/(\*)(0+)|(#+)(0+)|(0+)/g,lt=/^(0+)$/;function ct(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(st,(function(e,n,r){
|
|
339
|
+
// @@@ 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 ut(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 ht(e){
|
|
341
|
+
// 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)),!lt.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function pt(e){var t=ut(e);return t||{}}
|
|
343
|
+
/**
|
|
344
|
+
* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options
|
|
345
|
+
*/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=ce(ce(ce({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return ce(ce({},e),pt(t))}),{}));continue;case"engineering":t=ce(ce(ce({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return ce(ce({},e),pt(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;
|
|
346
|
+
// https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
|
|
347
|
+
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
|
+
// 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(at,(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
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width
|
|
351
|
+
if(lt.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(it.test(o.stem)){
|
|
352
|
+
// Precision
|
|
353
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision
|
|
354
|
+
// precision-integer case
|
|
355
|
+
if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(it,(function(e,n,r,o,i,s){
|
|
356
|
+
// .000* case (before ICU67 it was .000+)
|
|
357
|
+
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
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display
|
|
359
|
+
"w"===i?t=ce(ce({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=ce(ce({},t),ct(i)))}
|
|
360
|
+
// https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision
|
|
361
|
+
else if(st.test(o.stem))t=ce(ce({},t),ct(o.stem));else{var s=ut(o.stem);s&&(t=ce(ce({},t),s));var a=ht(o.stem);a&&(t=ce(ce({},t),a))}}return t}
|
|
362
|
+
// @generated from time-data-gen.ts
|
|
363
|
+
// prettier-ignore
|
|
364
|
+
var dt,gt={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
|
+
/**
|
|
366
|
+
* Returns the best matching date time pattern if a date time skeleton
|
|
367
|
+
* pattern is provided with a locale. Follows the Unicode specification:
|
|
368
|
+
* https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns
|
|
369
|
+
* @param skeleton date time skeleton pattern that possibly includes j, J or C
|
|
370
|
+
* @param locale
|
|
371
|
+
*/
|
|
372
|
+
/**
|
|
373
|
+
* Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)
|
|
374
|
+
* of the given `locale` to the corresponding time pattern.
|
|
375
|
+
* @param locale
|
|
376
|
+
*/
|
|
377
|
+
function mt(e){var t=e.hourCycle;if(void 0===t&&
|
|
378
|
+
// @ts-ignore hourCycle(s) is not identified yet
|
|
379
|
+
e.hourCycles&&
|
|
380
|
+
// @ts-ignore
|
|
381
|
+
e.hourCycles.length&&(
|
|
382
|
+
// @ts-ignore
|
|
383
|
+
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
|
+
// 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),(gt[n||""]||gt[r||""]||gt["".concat(r,"-001")]||gt["001"])[0]}var bt=new RegExp("^".concat(tt.source,"*")),yt=new RegExp("".concat(tt.source,"*$"));function vt(e,t){return{start:e,end:t}}
|
|
386
|
+
// #region Ponyfills
|
|
387
|
+
// Consolidate these variables up top for easier toggling during debugging
|
|
388
|
+
var Et=!!String.prototype.startsWith,Ct=!!String.fromCodePoint,wt=!!Object.fromEntries,Tt=!!String.prototype.codePointAt,Bt=!!String.prototype.trimStart,At=!!String.prototype.trimEnd,St=!!Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},_t=!0;try{
|
|
389
|
+
/**
|
|
390
|
+
* legacy Edge or Xbox One browser
|
|
391
|
+
* Unicode flag support: supported
|
|
392
|
+
* Pattern_Syntax support: not supported
|
|
393
|
+
* See https://github.com/formatjs/formatjs/issues/2822
|
|
394
|
+
*/
|
|
395
|
+
_t="a"===(null===(dt=xt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===dt?void 0:dt[0])}catch(e){_t=!1}var Ht,Lt=Et?// Native
|
|
396
|
+
function(e,t,n){return e.startsWith(t,n)}:// For IE11
|
|
397
|
+
function(e,t,n){return e.slice(n,n+t.length)===t},Pt=Ct?String.fromCodePoint:// IE11
|
|
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},Rt=
|
|
399
|
+
// native
|
|
400
|
+
wt?Object.fromEntries:// Ponyfill
|
|
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},It=Tt?// Native
|
|
402
|
+
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}},Ot=Bt?// Native
|
|
404
|
+
function(e){return e.trimStart()}:// Ponyfill
|
|
405
|
+
function(e){return e.replace(bt,"")},Mt=At?// Native
|
|
406
|
+
function(e){return e.trimEnd()}:// Ponyfill
|
|
407
|
+
function(e){return e.replace(yt,"")};
|
|
408
|
+
// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.
|
|
409
|
+
function xt(e,t){return new RegExp(e,t)}
|
|
410
|
+
// #endregion
|
|
411
|
+
if(_t){
|
|
412
|
+
// Native
|
|
413
|
+
var Nt=xt("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Ht=function(e,t){var n;return Nt.lastIndex=t,null!==(n=Nt.exec(e)[1])&&void 0!==n?n:""}}else
|
|
414
|
+
// IE11
|
|
415
|
+
Ht=function(e,t){for(var n=[];;){var r=It(e,t);if(void 0===r||kt(r)||Ft(r))break;n.push(r),t+=r>=65536?2:1}return Pt.apply(void 0,n)};var $t=/** @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(ke.UNMATCHED_CLOSING_TAG,vt(this.clonePosition(),this.clonePosition()))}if(60/* `<` */===o&&!this.ignoreTag&&Dt(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:Fe.pound,location:vt(s,this.clonePosition())})}}}return{val:r,err:null}},
|
|
416
|
+
/**
|
|
417
|
+
* A tag name must start with an ASCII lower/upper case letter. The grammar is based on the
|
|
418
|
+
* [custom element name][] except that a dash is NOT always mandatory and uppercase letters
|
|
419
|
+
* are accepted:
|
|
420
|
+
*
|
|
421
|
+
* ```
|
|
422
|
+
* tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "</" tagName (whitespace)* ">"
|
|
423
|
+
* tagName ::= [a-z] (PENChar)*
|
|
424
|
+
* PENChar ::=
|
|
425
|
+
* "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |
|
|
426
|
+
* [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |
|
|
427
|
+
* [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
|
|
428
|
+
* ```
|
|
429
|
+
*
|
|
430
|
+
* [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name
|
|
431
|
+
* NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do
|
|
432
|
+
* since other tag-based engines like React allow it
|
|
433
|
+
*/
|
|
434
|
+
e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();// `<`
|
|
435
|
+
var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))
|
|
436
|
+
// Self closing tag
|
|
437
|
+
return{val:{type:Fe.literal,value:"<".concat(r,"/>"),location:vt(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
|
+
// Expecting a close tag
|
|
439
|
+
if(this.bumpIf("</")){if(this.isEOF()||!Dt(this.char()))return this.error(ke.INVALID_TAG,vt(s,this.clonePosition()));var a=this.clonePosition();return r!==this.parseTagName()?this.error(ke.UNMATCHED_CLOSING_TAG,vt(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:Fe.tag,value:r,children:i,location:vt(n,this.clonePosition())},err:null}:this.error(ke.INVALID_TAG,vt(s,this.clonePosition())))}return this.error(ke.UNCLOSED_TAG,vt(n,this.clonePosition()))}return this.error(ke.INVALID_TAG,vt(n,this.clonePosition()))},
|
|
440
|
+
/**
|
|
441
|
+
* This method assumes that the caller has peeked ahead for the first tag character.
|
|
442
|
+
*/
|
|
443
|
+
e.prototype.parseTagName=function(){var e=this.offset();// the first tag name character
|
|
444
|
+
for(this.bump();!this.isEOF()&&Ut(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=vt(n,this.clonePosition());return{val:{type:Fe.literal,value:r,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60/* `<` */!==this.char()||!this.ignoreTag&&(Dt(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e;
|
|
445
|
+
/** See `parseTag` function docs. */},
|
|
446
|
+
/**
|
|
447
|
+
* Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes
|
|
448
|
+
* a character that requires quoting (that is, "only where needed"), and works the same in
|
|
449
|
+
* nested messages as on the top level of the pattern. The new behavior is otherwise compatible.
|
|
450
|
+
*/
|
|
451
|
+
e.prototype.tryParseQuote=function(e){if(this.isEOF()||39/* `'` */!==this.char())return null;
|
|
452
|
+
// Parse escaped char following the apostrophe, or early return if there is no escaped char.
|
|
453
|
+
// Check if is valid escaped character
|
|
454
|
+
switch(this.peek()){case 39/* `'` */:
|
|
455
|
+
// double quote, should return as a single quote.
|
|
456
|
+
return this.bump(),this.bump(),"'";
|
|
457
|
+
// '{', '<', '>', '}'
|
|
458
|
+
case 123:case 60:case 62:case 125:break;case 35:// '#'
|
|
459
|
+
if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();// apostrophe
|
|
460
|
+
var t=[this.char()];// escaped char
|
|
461
|
+
// read chars until the optional closing apostrophe is found
|
|
462
|
+
for(this.bump();!this.isEOF();){var n=this.char();if(39/* `'` */===n){if(39/* `'` */!==this.peek()){
|
|
463
|
+
// Optional closing apostrophe.
|
|
464
|
+
this.bump();break}t.push(39),
|
|
465
|
+
// Bump one more time because we need to skip 2 characters.
|
|
466
|
+
this.bump()}else t.push(n);this.bump()}return Pt.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(),Pt(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),// `{`
|
|
467
|
+
this.bumpSpace(),this.isEOF())return this.error(ke.EXPECT_ARGUMENT_CLOSING_BRACE,vt(n,this.clonePosition()));if(125/* `}` */===this.char())return this.bump(),this.error(ke.EMPTY_ARGUMENT,vt(n,this.clonePosition()));
|
|
468
|
+
// argument name
|
|
469
|
+
var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(ke.MALFORMED_ARGUMENT,vt(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(ke.EXPECT_ARGUMENT_CLOSING_BRACE,vt(n,this.clonePosition()));switch(this.char()){
|
|
470
|
+
// Simple argument: `{name}`
|
|
471
|
+
case 125/* `}` */:// `}`
|
|
472
|
+
return this.bump(),{val:{type:Fe.argument,
|
|
473
|
+
// value does not include the opening and closing braces.
|
|
474
|
+
value:r,location:vt(n,this.clonePosition())},err:null};
|
|
475
|
+
// Argument with options: `{name, format, ...}`
|
|
476
|
+
case 44/* `,` */:return this.bump(),// `,`
|
|
477
|
+
this.bumpSpace(),this.isEOF()?this.error(ke.EXPECT_ARGUMENT_CLOSING_BRACE,vt(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(ke.MALFORMED_ARGUMENT,vt(n,this.clonePosition()))}},
|
|
478
|
+
/**
|
|
479
|
+
* Advance the parser until the end of the identifier, if it is currently on
|
|
480
|
+
* an identifier character. Return an empty string otherwise.
|
|
481
|
+
*/
|
|
482
|
+
e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=Ht(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:vt(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,r){var o,i=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();
|
|
483
|
+
// Parse this range:
|
|
484
|
+
// {name, type, style}
|
|
485
|
+
// ^---^
|
|
486
|
+
switch(s){case"":
|
|
487
|
+
// Expecting a style string number, date, time, plural, selectordinal, or select.
|
|
488
|
+
return this.error(ke.EXPECT_ARGUMENT_TYPE,vt(i,a));case"number":case"date":case"time":
|
|
489
|
+
// Parse this range:
|
|
490
|
+
// {name, number, style}
|
|
491
|
+
// ^-------^
|
|
492
|
+
this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((b=this.parseSimpleArgStyleIfPossible()).err)return b;if(0===(f=Mt(b.val)).length)return this.error(ke.EXPECT_ARGUMENT_STYLE,vt(this.clonePosition(),this.clonePosition()));l={style:f,styleLocation:vt(c,this.clonePosition())}}if((y=this.tryParseArgumentClose(r)).err)return y;var u=vt(r,this.clonePosition());
|
|
493
|
+
// Extract style or skeleton
|
|
494
|
+
if(l&&Lt(null==l?void 0:l.style,"::",0)){
|
|
495
|
+
// Skeleton starts with `::`.
|
|
496
|
+
var h=Ot(l.style.slice(2));if("number"===s)return(b=this.parseNumberSkeletonFromString(h,l.styleLocation)).err?b:{val:{type:Fe.number,value:n,location:u,style:b.val},err:null};if(0===h.length)return this.error(ke.EXPECT_DATE_TIME_SKELETON,u);var p=h;
|
|
497
|
+
// Get "best match" pattern only if locale is passed, if not, let it
|
|
498
|
+
// pass as-is where `parseDateTimeSkeleton()` will throw an error
|
|
499
|
+
// for unsupported patterns.
|
|
500
|
+
this.locale&&(p=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=mt(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 f={type:Ge.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?rt(p):{}};return{val:{type:"date"===s?Fe.date:Fe.time,value:n,location:u,style:f},err:null}}
|
|
501
|
+
// Regular style or no style.
|
|
502
|
+
return{val:{type:"number"===s?Fe.number:"date"===s?Fe.date:Fe.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
|
+
// Parse this range:
|
|
504
|
+
// {name, plural, options}
|
|
505
|
+
// ^---------^
|
|
506
|
+
var d=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(ke.EXPECT_SELECT_ARGUMENT_OPTIONS,vt(d,ce({},d)));this.bumpSpace();
|
|
507
|
+
// Parse offset:
|
|
508
|
+
// {name, plural, offset:1, options}
|
|
509
|
+
// ^-----^
|
|
510
|
+
// or the first option:
|
|
511
|
+
// {name, plural, one {...} other {...}}
|
|
512
|
+
// ^--^
|
|
513
|
+
var g=this.parseIdentifierIfPossible(),m=0;if("select"!==s&&"offset"===g.value){if(!this.bumpIf(":"))return this.error(ke.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,vt(this.clonePosition(),this.clonePosition()));var b;if(this.bumpSpace(),(b=this.tryParseDecimalInteger(ke.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,ke.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return b;
|
|
514
|
+
// Parse another identifier for option parsing
|
|
515
|
+
this.bumpSpace(),g=this.parseIdentifierIfPossible(),m=b.val}var y,v=this.tryParsePluralOrSelectOptions(e,s,t,g);if(v.err)return v;if((y=this.tryParseArgumentClose(r)).err)return y;var E=vt(r,this.clonePosition());return"select"===s?{val:{type:Fe.select,value:n,options:Rt(v.val),location:E},err:null}:{val:{type:Fe.plural,value:n,options:Rt(v.val),offset:m,pluralType:"plural"===s?"cardinal":"ordinal",location:E},err:null};default:return this.error(ke.INVALID_ARGUMENT_TYPE,vt(i,a))}},e.prototype.tryParseArgumentClose=function(e){
|
|
516
|
+
// Parse: {value, number, ::currency/GBP }
|
|
517
|
+
return this.isEOF()||125/* `}` */!==this.char()?this.error(ke.EXPECT_ARGUMENT_CLOSING_BRACE,vt(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},
|
|
518
|
+
/**
|
|
519
|
+
* See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659
|
|
520
|
+
*/
|
|
521
|
+
e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();){switch(this.char()){case 39/* `'` */:
|
|
522
|
+
// Treat apostrophe as quoting but include it in the style part.
|
|
523
|
+
// Find the end of the quoted literal text.
|
|
524
|
+
this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(ke.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,vt(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
|
+
// Parse the skeleton
|
|
526
|
+
for(var t=e.split(ot).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(ke.INVALID_NUMBER_SKELETON,t)}return{val:{type:Ge.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?ft(n):{}},err:null}},
|
|
527
|
+
/**
|
|
528
|
+
* @param nesting_level The current nesting level of messages.
|
|
529
|
+
* This can be positive when parsing message fragment in select or plural argument options.
|
|
530
|
+
* @param parent_arg_type The parent argument's type.
|
|
531
|
+
* @param parsed_first_identifier If provided, this is the first identifier-like selector of
|
|
532
|
+
* the argument. It is a by-product of a previous parsing attempt.
|
|
533
|
+
* @param expecting_close_tag If true, this message is directly or indirectly nested inside
|
|
534
|
+
* between a pair of opening and closing tags. The nested message will not parse beyond
|
|
535
|
+
* the closing tag boundary.
|
|
536
|
+
*/
|
|
537
|
+
e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){
|
|
538
|
+
// Parse:
|
|
539
|
+
// one {one apple}
|
|
540
|
+
// ^--^
|
|
541
|
+
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
|
+
// Try parse `={number}` selector
|
|
543
|
+
var h=this.tryParseDecimalInteger(ke.EXPECT_PLURAL_ARGUMENT_SELECTOR,ke.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;c=vt(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}
|
|
544
|
+
// Duplicate selector clauses
|
|
545
|
+
if(a.has(l))return this.error("select"===t?ke.DUPLICATE_SELECT_ARGUMENT_SELECTOR:ke.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===l&&(i=!0),
|
|
546
|
+
// Parse:
|
|
547
|
+
// one {one apple}
|
|
548
|
+
// ^----------^
|
|
549
|
+
this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?ke.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:ke.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,vt(this.clonePosition(),this.clonePosition()));var f=this.parseMessage(e+1,t,n);if(f.err)return f;var d=this.tryParseArgumentClose(p);if(d.err)return d;s.push([l,{value:f.val,location:vt(p,this.clonePosition())}]),
|
|
550
|
+
// Keep track of the existing selectors
|
|
551
|
+
a.add(l),
|
|
552
|
+
// Prep next selector clause.
|
|
553
|
+
this.bumpSpace(),l=(o=this.parseIdentifierIfPossible()).value,c=o.location}return 0===s.length?this.error("select"===t?ke.EXPECT_SELECT_ARGUMENT_SELECTOR:ke.EXPECT_PLURAL_ARGUMENT_SELECTOR,vt(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(ke.MISSING_OTHER_CLAUSE,vt(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=vt(r,this.clonePosition());return o?St(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
|
+
// This is much faster than `Object.assign` or spread.
|
|
555
|
+
return{offset:this.position.offset,line:this.position.line,column:this.position.column}},
|
|
556
|
+
/**
|
|
557
|
+
* Return the code point at the current position of the parser.
|
|
558
|
+
* Throws if the index is out of bound.
|
|
559
|
+
*/
|
|
560
|
+
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
|
+
/** Bump the parser to the next UTF-16 code unit. */
|
|
562
|
+
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
|
+
// 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.
|
|
564
|
+
this.position.offset+=e<65536?1:2)}},
|
|
565
|
+
/**
|
|
566
|
+
* If the substring starting at the current position of the parser has
|
|
567
|
+
* the given prefix, then bump the parser to the character immediately
|
|
568
|
+
* following the prefix and return true. Otherwise, don't bump the parser
|
|
569
|
+
* and return false.
|
|
570
|
+
*/
|
|
571
|
+
e.prototype.bumpIf=function(e){if(Lt(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},
|
|
572
|
+
/**
|
|
573
|
+
* Bump the parser until the pattern character is found and return `true`.
|
|
574
|
+
* Otherwise bump to the end of the file and return `false`.
|
|
575
|
+
*/
|
|
576
|
+
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)},
|
|
577
|
+
/**
|
|
578
|
+
* Bump the parser to the target offset.
|
|
579
|
+
* If target offset is beyond the end of the input, bump the parser to the end of the input.
|
|
580
|
+
*/
|
|
581
|
+
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
|
+
/** advance the parser through all whitespace to the next non-whitespace code unit. */
|
|
583
|
+
e.prototype.bumpSpace=function(){for(;!this.isEOF()&&kt(this.char());)this.bump()},
|
|
584
|
+
/**
|
|
585
|
+
* Peek at the *next* Unicode codepoint in the input without advancing the parser.
|
|
586
|
+
* If the input has been exhausted, then this returns null.
|
|
587
|
+
*/
|
|
588
|
+
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}();
|
|
589
|
+
/**
|
|
590
|
+
* This check if codepoint is alphabet (lower & uppercase)
|
|
591
|
+
* @param codepoint
|
|
592
|
+
* @returns
|
|
593
|
+
*/function Dt(e){return e>=97&&e<=122||e>=65&&e<=90}function Ut(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
|
+
/**
|
|
595
|
+
* Code point equivalent of regex `\p{White_Space}`.
|
|
596
|
+
* From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
|
597
|
+
*/function kt(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}
|
|
598
|
+
/**
|
|
599
|
+
* Code point equivalent of regex `\p{Pattern_Syntax}`.
|
|
600
|
+
* See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt
|
|
601
|
+
*/function Ft(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,ze(e)||Ye(e))for(var t in e.options)delete e.options[t].location,Gt(e.options[t].value);else Ke(e)&&Qe(e.style)||(We(e)||Xe(e))&&et(e.style)?delete e.style.location:qe(e)&&Gt(e.children)}))}function Vt(e,t){void 0===t&&(t={}),t=ce({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new $t(e,t).parse();if(n.err){var r=SyntaxError(ke[n.err.kind]);
|
|
602
|
+
// @ts-expect-error Assign to error object
|
|
603
|
+
throw r.location=n.err.location,
|
|
604
|
+
// @ts-expect-error Assign to error object
|
|
605
|
+
r.originalMessage=n.err.message,r}return(null==t?void 0:t.captureLocation)||Gt(n.val),n.val}
|
|
606
|
+
|
|
607
|
+
// Main
|
|
608
|
+
|
|
609
|
+
function jt(e,t){var n=t&&t.cache?t.cache:qt,r=t&&t.serializer?t.serializer:zt;return(t&&t.strategy?t.strategy:Xt)(e,{cache:n,serializer:r})}
|
|
610
|
+
|
|
611
|
+
// Strategy
|
|
612
|
+
|
|
613
|
+
function Zt(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 Wt(e,t,n,r,o){return n.bind(t,e,r,o)}function Xt(e,t){return Wt(e,this,1===e.length?Zt:Kt,t.cache.create(),t.serializer)}
|
|
614
|
+
// Serializer
|
|
615
|
+
var zt=function(){return JSON.stringify(arguments)};
|
|
616
|
+
|
|
617
|
+
// Cache
|
|
618
|
+
|
|
619
|
+
function Yt(){this.cache=Object.create(null)}Yt.prototype.get=function(e){return this.cache[e]},Yt.prototype.set=function(e,t){this.cache[e]=t};var Jt,qt={create:function(){
|
|
620
|
+
// @ts-ignore
|
|
621
|
+
return new Yt}},Qt={variadic:function(e,t){return Wt(e,this,Kt,t.cache.create(),t.serializer)},monadic:function(e,t){return Wt(e,this,Zt,t.cache.create(),t.serializer)}};!function(e){
|
|
622
|
+
// When we have a placeholder but no value to format
|
|
623
|
+
e.MISSING_VALUE="MISSING_VALUE",
|
|
624
|
+
// When value supplied is invalid
|
|
625
|
+
e.INVALID_VALUE="INVALID_VALUE",
|
|
626
|
+
// When we need specific Intl API but it's not available
|
|
627
|
+
e.MISSING_INTL_API="MISSING_INTL_API"}(Jt||(Jt={}));var en,tn=/** @class */function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return oe(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),nn=/** @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('", "'),'"'),Jt.INVALID_VALUE,o)||this}return oe(t,e),t}(tn),rn=/** @class */function(e){function t(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),Jt.INVALID_VALUE,r)||this}return oe(t,e),t}(tn),on=/** @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,'"'),Jt.MISSING_VALUE,n)||this}return oe(t,e),t}(tn);function sn(e){return"function"==typeof e}
|
|
628
|
+
// TODO(skeleton): add skeleton support
|
|
629
|
+
function an(e,t,n,r,o,i,
|
|
630
|
+
// For debugging
|
|
631
|
+
s){
|
|
632
|
+
// Hot path for straight simple msg translations
|
|
633
|
+
if(1===e.length&&je(e[0]))return[{type:en.literal,value:e[0].value}];for(var a=[],l=0,c=e;l<c.length;l++){var u=c[l];
|
|
634
|
+
// Exit early for string parts.
|
|
635
|
+
if(je(u))a.push({type:en.literal,value:u.value});else
|
|
636
|
+
// TODO: should this part be literal type?
|
|
637
|
+
// Replace `#` in plural rules with the actual numeric value.
|
|
638
|
+
if(Je(u))"number"==typeof i&&a.push({type:en.literal,value:n.getNumberFormat(t).format(i)});else{var h=u.value;
|
|
639
|
+
// Enforce that all required values are provided by the caller.
|
|
640
|
+
if(!o||!(h in o))throw new on(h,s);var p=o[h];if(Ze(u))p&&"string"!=typeof p&&"number"!=typeof p||(p="string"==typeof p||"number"==typeof p?String(p):""),a.push({type:"string"==typeof p?en.literal:en.object,value:p});else
|
|
641
|
+
// Recursively format plural and select parts' option — which can be a
|
|
642
|
+
// nested pattern structure. The choosing of the option to use is
|
|
643
|
+
// abstracted-by and delegated-to the part helper object.
|
|
644
|
+
if(We(u)){var f="string"==typeof u.style?r.date[u.style]:et(u.style)?u.style.parsedOptions:void 0;a.push({type:en.literal,value:n.getDateTimeFormat(t,f).format(p)})}else if(Xe(u)){f="string"==typeof u.style?r.time[u.style]:et(u.style)?u.style.parsedOptions:r.time.medium;a.push({type:en.literal,value:n.getDateTimeFormat(t,f).format(p)})}else if(Ke(u)){(f="string"==typeof u.style?r.number[u.style]:Qe(u.style)?u.style.parsedOptions:void 0)&&f.scale&&(p*=f.scale||1),a.push({type:en.literal,value:n.getNumberFormat(t,f).format(p)})}else{if(qe(u)){var d=u.children,g=u.value,m=o[g];if(!sn(m))throw new rn(g,"function",s);var b=m(an(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?en.literal:en.object,value:e}})))}if(ze(u)){if(!(y=u.options[p]||u.options.other))throw new nn(u.value,p,Object.keys(u.options),s);a.push.apply(a,an(y.value,t,n,r,o))}else if(Ye(u)){var y;if(!(y=u.options["=".concat(p)])){if(!Intl.PluralRules)throw new tn('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Jt.MISSING_INTL_API,s);var v=n.getPluralRules(t,{type:u.pluralType}).select(p-(u.offset||0));y=u.options[v]||u.options.other}if(!y)throw new nn(u.value,p,Object.keys(u.options),s);a.push.apply(a,an(y.value,t,n,r,o,p-(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===en.literal&&t.type===en.literal?n.value+=t.value:e.push(t),e}),[])}(a)}
|
|
645
|
+
/*
|
|
646
|
+
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
647
|
+
Copyrights licensed under the New BSD License.
|
|
648
|
+
See the accompanying LICENSE file for terms.
|
|
649
|
+
*/
|
|
650
|
+
// -- MessageFormat --------------------------------------------------------
|
|
651
|
+
function ln(e,t){return t?Object.keys(e).reduce((function(n,r){var o,i;return n[r]=(o=e[r],(i=t[r])?ce(ce(ce({},o||{}),i||{}),Object.keys(o).reduce((function(e,t){return e[t]=ce(ce({},o[t]),i[t]||{}),e}),{})):o),n}),ce({},e)):e}function cn(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"}(en||(en={}));var un=/** @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
|
+
// 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===en.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 an(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
|
+
// Defined first because it's used to build the format pattern.
|
|
655
|
+
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
|
+
// Parse string messages into an AST.
|
|
657
|
+
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
|
+
// Creates a new object with the specified `formats` merged with the default
|
|
659
|
+
// formats.
|
|
660
|
+
this.formats=ln(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,he([void 0],t,!1)))}),{cache:cn(i.number),strategy:Qt.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,he([void 0],t,!1)))}),{cache:cn(i.dateTime),strategy:Qt.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,he([void 0],t,!1)))}),{cache:cn(i.pluralRules),strategy:Qt.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=Vt,
|
|
661
|
+
// Default format options used as the prototype of the `formats` provided to the
|
|
662
|
+
// constructor. These are used when constructing the internal Intl.NumberFormat
|
|
663
|
+
// 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}(),hn=un;
|
|
665
|
+
/*
|
|
666
|
+
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
|
|
667
|
+
Copyrights licensed under the New BSD License.
|
|
668
|
+
See the accompanying LICENSE file for terms.
|
|
669
|
+
*/const pn={},fn=(e,t,n)=>n?(t in pn||(pn[t]={}),e in pn[t]||(pn[t][e]=n),n):n,dn=(e,t)=>{if(null==t)return;if(t in pn&&e in pn[t])return pn[t][e];const n=In(t);for(let r=0;r<n.length;r++){const o=yn(n[r],e);if(o)return fn(e,t,o)}};let gn;const mn=Pe({});function bn(e){return e in gn}function yn(e,t){if(!bn(e))return null;const n=function(e){return gn[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 vn(e,...t){delete pn[e],mn.update((n=>(n[e]=Ve.all([n[e]||{},...t]),n)))}Re([mn],(([e])=>Object.keys(e))),mn.subscribe((e=>gn=e));const En={};function Cn(e){return En[e]}function wn(e){return null!=e&&In(e).some((e=>{var t;return null===(t=Cn(e))||void 0===t?void 0:t.size}))}const Tn={};function Bn(e){if(!wn(e))return e in Tn?Tn[e]:Promise.resolve();const t=function(e){return In(e).map((e=>{const t=Cn(e);return[e,t?[...t]:[]]})).filter((([,e])=>e.length>0))}(e);return Tn[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=>vn(e,...t)))}(e,t)))).then((()=>{if(wn(e))return Bn(e);delete Tn[e]})),Tn[e]}
|
|
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 An(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 Sn={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 _n(){return Sn}const Hn=Pe(!1);let Ln;const Pn=Pe(null);function Rn(e){return e.split("-").map(((e,t,n)=>n.slice(0,t+1).join("-"))).reverse()}function In(e,t=_n().fallbackLocale){const n=Rn(e);return t?[...new Set([...n,...Rn(t)])]:n}function On(){return null!=Ln?Ln:void 0}Pn.subscribe((e=>{Ln=null!=e?e:void 0,"undefined"!=typeof window&&null!=e&&document.documentElement.setAttribute("lang",e)}));const Mn=Object.assign(Object.assign({},Pn),{set:e=>{if(e&&function(e){if(null==e)return;const t=In(e);for(let e=0;e<t.length;e++){const n=t[e];if(bn(n))return n}}(e)&&wn(e)){const{loadingDelay:t}=_n();let n;return"undefined"!=typeof window&&null!=On()&&t?n=window.setTimeout((()=>Hn.set(!0)),t):Hn.set(!0),Bn(e).then((()=>{Pn.set(e)})).finally((()=>{clearTimeout(n),Hn.set(!1)}))}return Pn.set(e)}}),xn=e=>{const t=Object.create(null);return n=>{const r=JSON.stringify(n);return r in t?t[r]:t[r]=e(n)}},Nn=(e,t)=>{const{formats:n}=_n();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},$n=xn((e=>{var{locale:t,format:n}=e,r=An(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(r=Nn("number",n)),new Intl.NumberFormat(t,r)})),Dn=xn((e=>{var{locale:t,format:n}=e,r=An(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?r=Nn("date",n):0===Object.keys(r).length&&(r=Nn("date","short")),new Intl.DateTimeFormat(t,r)})),Un=xn((e=>{var{locale:t,format:n}=e,r=An(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?r=Nn("time",n):0===Object.keys(r).length&&(r=Nn("time","short")),new Intl.DateTimeFormat(t,r)})),kn=xn(((e,t=On())=>new hn(e,t,_n().formats,{ignoreTag:_n().ignoreTag}))),Fn=(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=dn(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=_n()).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},Gn=(e,t)=>((e={})=>{var{locale:t=On()}=e,n=An(e,["locale"]);return Un(Object.assign({locale:t},n))})(t).format(e),Vn=(e,t)=>((e={})=>{var{locale:t=On()}=e,n=An(e,["locale"]);return Dn(Object.assign({locale:t},n))})(t).format(e),jn=(e,t)=>((e={})=>{var{locale:t=On()}=e,n=An(e,["locale"]);return $n(Object.assign({locale:t},n))})(t).format(e),Zn=(e,t=On())=>dn(e,t),Kn=Re([Mn,mn],(()=>Fn));Re([Mn],(()=>Gn)),Re([Mn],(()=>Vn)),Re([Mn],(()=>jn)),Re([Mn,mn],(()=>Zn));const Wn=e=>{(({withLocale:e,translations:t})=>{Mn.subscribe((n=>{null==n&&(mn.set(t),Mn.set(e))}));// maybe we will need this to make sure that the i18n is set up only once
|
|
684
|
+
/*dictionary.set(translations);
|
|
685
|
+
locale.set(_locale);*/})({withLocale:"en",translations:{}}),Object.keys(e).forEach((t=>{var n,r;n=t,r=e[t],vn(n,r)}))};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 Yn={en:{wageringBonuses:{level:"Level",current:"Current",next:"Next",first:"First",last:"Last",previous:"Previous",startChallenge:"START CHALLENGE"}},zh:{wageringBonuses:{level:"等級",current:"当前",next:"下一個",first:"第一個",last:"最後一個",previous:"上一個",startChallenge:"開始挑戰"}}};
|
|
686
|
+
/* ../casino-wagering-bonus/src/CasinoWageringBonus.svelte generated by Svelte v3.48.0 */function Jn(e,t,n){const r=e.slice();return r[22]=t[n],r[24]=n,r}function qn(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 er(e,t,n){const r=e.slice();return r[31]=t[n],r}function tr(e,t,n){const r=e.slice();return r[34]=t[n],r}
|
|
687
|
+
// (88:0) {#if bonus && isShowingBonus}
|
|
688
|
+
function nr(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=[te("BonusInfoTitle","title")],N={};for(let e=0;e<x.length;e+=1)N=t(N,x[e]);let $=/*status*/e[0]===ie.active&&rr(e),D=[te("BonusInfoWrapper","layout-horizental space-between")],U={};for(let e=0;e<D.length;e+=1)U=t(U,D[e]);let k=/*status*/e[0]===ie.claimable&&or(e),G=/*status*/e[0]!==ie.claimable&&ir(e),V=[te("BonusInfo")],j={};for(let e=0;e<V.length;e+=1)j=t(j,V[e]);let Z=[te("RewardsTopBarTitle","title")],K={};for(let e=0;e<Z.length;e+=1)K=t(K,Z[e]);let W=/*status*/e[0]!==ie.claimable&&lr(e),X=[te("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]!==ie.claimable&&cr(e),J=/*status*/e[0]===ie.claimable&&pr(e),q=[te("BonusRewardsLevels")],Q={};for(let e=0;e<q.length;e+=1)Q=t(Q,q[e]);let ee=[te("SupportsTitle","title")],ne={};for(let e=0;e<ee.length;e+=1)ne=t(ne,ee[e]);let re=Object.keys(/*bonus*/e[1].extension?.bonus.wallet||/*bonus*/e[1].wallet).filter(br),oe=[];for(let t=0;t<re.length;t+=1)oe[t]=gr(Jn(e,re,t));let se=[te("SupportsList")],ae={};for(let e=0;e<se.length;e+=1)ae=t(ae,se[e]);let le=[te("SupportsWrapper")],ce={};for(let e=0;e<le.length;e+=1)ce=t(ce,le[e]);let ue=[te("BonusRewards")],he={};for(let e=0;e<ue.length;e+=1)he=t(he,ue[e]);let pe=[te("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(),k&&k.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<oe.length;e+=1)oe[e].c();w(i,N),w(o,U),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),k&&k.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<oe.length;e+=1)oe[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,[te("BonusInfoTitle","title")])),/*status*/e[0]===ie.active?$?$.p(e,t):($=rr(e),$.c(),$.m(o,null)):$&&($.d(1),$=null),w(o,U=F(D,[te("BonusInfoWrapper","layout-horizental space-between")])),/*status*/e[0]===ie.claimable?k?k.p(e,t):(k=or(e),k.c(),k.m(r,c)):k&&(k.d(1),k=null),/*status*/e[0]!==ie.claimable?G?G.p(e,t):(G=ir(e),G.c(),G.m(r,null)):G&&(G.d(1),G=null),w(r,j=F(V,[te("BonusInfo")])),w(E,K=F(Z,[te("RewardsTopBarTitle","title")])),/*status*/e[0]!==ie.claimable?W?W.p(e,t):(W=lr(e),W.c(),W.m(v,null)):W&&(W.d(1),W=null),w(v,z=F(X,[te("RewardsTopBar","layout-horizental space-between")])),/*status*/e[0]!==ie.claimable?Y?Y.p(e,t):(Y=cr(e),Y.c(),Y.m(S,_)):Y&&(Y.d(1),Y=null),/*status*/e[0]===ie.claimable?J?J.p(e,t):(J=pr(e),J.c(),J.m(S,null)):J&&(J.d(1),J=null),w(S,Q=F(q,[te("BonusRewardsLevels")])),w(P,ne=F(ee,[te("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=Jn(e,re,n);oe[n]?oe[n].p(r,t):(oe[n]=gr(r),oe[n].c(),oe[n].m(O,null))}for(;n<oe.length;n+=1)oe[n].d(1);oe.length=re.length}w(O,ae=F(se,[te("SupportsList")])),w(L,ce=F(le,[te("SupportsWrapper")])),w(m,he=F(ue,[te("BonusRewards")])),w(n,fe=F(pe,[te("Root","layout-horizental")]))},d(e){e&&f(n),$&&$.d(),k&&k.d(),G&&G.d(),W&&W.d(),Y&&Y.d(),J&&J.d(),d(oe,e)}}}
|
|
689
|
+
// (96:8) {#if status === BonusStatus.active}
|
|
690
|
+
function rr(e){let n,r,o,i,s,a,l=[te("BonusInfoExpireDate")],u={};for(let e=0;e<l.length;e+=1)u=t(u,l[e]);let d=[te("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,[te("BonusInfoExpireDate")])),w(n,m=F(d,[te("BonusInfoExpire")]))},d(e){e&&f(n)}}}
|
|
691
|
+
// (107:6) {#if status === BonusStatus.claimable}
|
|
692
|
+
function or(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,U,k,G,V,j,Z=/*bonus*/(e[1].description||"")+"",K=/*levels*/e[2].length+"",W=/*$_*/e[10](zn.startChallenge)+"",X=[te("BonusInfoDescription")],J={};for(let e=0;e<X.length;e+=1)J=t(J,X[e]);let q=[te("StatusClaimableInfoLevels")],Q={};for(let e=0;e<q.length;e+=1)Q=t(Q,q[e]);let ee=[te("StatusClaimableInfoPeriod")],ne={};for(let e=0;e<ee.length;e+=1)ne=t(ne,ee[e]);let re=[te("StatusClaimableInfo")],oe={};for(let e=0;e<re.length;e+=1)oe=t(oe,re[e]);let ie=[te("StatusClaimableCommandTerms","terms")],se={};for(let e=0;e<ie.length;e+=1)se=t(se,ie[e]);let ae=[te("StatusClaimableCommand")],le={};for(let e=0;e<ae.length;e+=1)le=t(le,ae[e]);let ce=[te("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"),U=g("a"),k=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(U,"href",G=/*bonus*/e[1].termsUrl),C(U,"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,U),h(U,k),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,[te("BonusInfoDescription")])),/*levels*/4&t[0]&&K!==(K=/*levels*/e[2].length+"")&&A(T,K),w(u,Q=F(q,[te("StatusClaimableInfoLevels")])),/*endTime*/128&t[0]&&A(R,/*endTime*/e[7]),w(_,ne=F(ee,[te("StatusClaimableInfoPeriod")])),w(l,oe=F(re,[te("StatusClaimableInfo")])),/*$_*/1024&t[0]&&W!==(W=/*$_*/e[10](zn.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].termsUrl)&&C(U,"href",G),w(D,se=F(ie,[te("StatusClaimableCommandTerms","terms")])),w(O,le=F(ae,[te("StatusClaimableCommand")])),w(a,ue=F(ce,[te("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 ir(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=[ie.completed,ie.released].includes(/*bonus*/e[1].status),U=[te("LevelStatus")],k={};for(let e=0;e<U.length;e+=1)k=t(k,U[e]);let G=[te("LevelStatusWrapper")],V={};for(let e=0;e<G.length;e+=1)V=t(V,G[e]);let j=[te("BonusTypeTarget","title")],Z={};for(let e=0;e<j.length;e+=1)Z=t(Z,j[e]);let K=/*bonus*/e[1].status===ie.active&&sr(e),W=D&&ar(e),X=[te("BonusType")],z={};for(let e=0;e<X.length;e+=1)z=t(z,X[e]);let Y=[te("BonusTerms","terms")],J={};for(let e=0;e<Y.length;e+=1)J=t(J,Y[e]);let q=[te("BonusTypeWrapper")],Q={};for(let e=0;e<q.length;e+=1)Q=t(Q,q[e]);let ee=[te("AfterClaimedWrapper","layout-horizental space-between")],ne={};for(let e=0;e<ee.length;e+=1)ne=t(ne,ee[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 Terms and Conditions\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,k),w(i,V),w(T,Z),w(E,z),C(I,"href",M=/*bonus*/e[1].termsUrl),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,k=F(U,[te("LevelStatus")])),w(i,V=F(G,[te("LevelStatusWrapper")])),/*bonusTypeInfo*/32&t[0]&&$!==($=/*bonusTypeInfo*/e[5].target()+"")&&A(S,$),w(T,Z=F(j,[te("BonusTypeTarget","title")])),/*bonus*/e[1].status===ie.active?K?K.p(e,t):(K=sr(e),K.c(),K.m(E,H)):K&&(K.d(1),K=null),/*bonus*/2&t[0]&&(D=[ie.completed,ie.released].includes(/*bonus*/e[1].status)),D?W?W.p(e,t):(W=ar(e),W.c(),W.m(E,null)):W&&(W.d(1),W=null),w(E,z=F(X,[te("BonusType")])),/*bonus*/2&t[0]&&M!==(M=/*bonus*/e[1].termsUrl)&&C(I,"href",M),w(P,J=F(Y,[te("BonusTerms","terms")])),w(v,Q=F(q,[te("BonusTypeWrapper")])),w(o,ne=F(ee,[te("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 sr(e){let n,r,o,i,s,a=/*bonusTypeInfo*/e[5].remaining()+"",l=/*bonusTypeInfo*/e[5].got()+"",c=[te("BonusTypeRemaining")],u={};for(let e=0;e<c.length;e+=1)u=t(u,c[e]);let d=[te("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,[te("BonusTypeRemaining")])),/*bonusTypeInfo*/32&t[0]&&l!==(l=/*bonusTypeInfo*/e[5].got()+"")&&A(s,l),w(i,m=F(d,[te("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 ar(e){let t,n,r,o,i,s,a,l,u,d,m=/*levelsCurrent*/e[3].textWithLength+"";return{c(){t=g("div"),n=g("img"),o=b("\n Completed"),i=y(),s=g("div"),a=g("img"),u=b("\n Levels finished:\n "),d=b(m),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(a,"class","icon"),c(a.src,l=Y)||C(a,"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),p(e,i,r),p(e,s,r),h(s,a),h(s,u),h(s,d)},p(e,t){/*levelsCurrent*/8&t[0]&&m!==(m=/*levelsCurrent*/e[3].textWithLength+"")&&A(d,m)},d(e){e&&f(t),e&&f(i),e&&f(s)}}}
|
|
699
|
+
// (211:8) {#if status !== BonusStatus.claimable}
|
|
700
|
+
function lr(e){let n,r,o,i,s=[te("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,[te("RewardsTopBarLinkToDetail")]))},d(e){e&&f(n),o=!1,i()}}}
|
|
701
|
+
// (226:8) {#if status !== BonusStatus.claimable}
|
|
702
|
+
function cr(e){let t,n=Be(/*bonus*/e[1],/*status*/e[0],/*levels*/e[2]),r=[];for(let t=0;t<n.length;t+=1)r[t]=hr(er(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=Be(/*bonus*/e[1],/*status*/e[0],/*levels*/e[2]),i=0;i<n.length;i+=1){const s=er(e,n,i);r[i]?r[i].p(s,o):(r[i]=hr(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
|
+
// (234:14) {#each reward.descriptions as description}
|
|
704
|
+
function ur(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
|
+
// (227:10) {#each (getRewards(bonus, status, levels)) as reward}
|
|
706
|
+
function hr(e){let n,r,o,i,s,a,l,c,u,m=/*$_*/e[10](zn[/*reward*/e[31].key])+"",v=/*$_*/e[10](zn.level)+"",E=[te("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]=ur(tr(e,T,t));let S=[te("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](zn[/*reward*/e[31].key])+"")&&A(o,m),/*$_*/1024&t[0]&&v!==(v=/*$_*/e[10](zn.level)+"")&&A(s,v),w(r,C=F(E,[te("BonusRewardsLevelsItemPosition")])),/*bonus, status, levels*/7&t[0]){let n;for(T=/*reward*/e[31].descriptions,n=0;n<T.length;n+=1){const r=tr(e,T,n);B[n]?B[n].p(r,t):(B[n]=ur(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,[te("BonusRewardsLevelsItem")]))},d(e){e&&f(n),d(B,e)}}}
|
|
707
|
+
// (243:8) {#if status === BonusStatus.claimable}
|
|
708
|
+
function pr(e){let t,n=/*bonus*/e[1].levels,r=[];for(let t=0;t<n.length;t+=1)r[t]=dr(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, $_*/1026&o[0]){let i;for(n=/*bonus*/e[1].levels,i=0;i<n.length;i+=1){const s=qn(e,n,i);r[i]?r[i].p(s,o):(r[i]=dr(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
|
+
// (259:14) {#each level.bonuses as levelBonus}
|
|
710
|
+
function fr(e){let t,n,r=Te(/*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=Te(/*level*/e[25],/*levelBonus*/e[28])+"")&&A(n,r)},d(e){e&&f(t)}}}
|
|
711
|
+
// (244:10) {#each bonus.levels as level, index}
|
|
712
|
+
function dr(e){let n,r,o,i,s,a,l,c,u,m=/*$_*/e[10](zn.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=[te("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]=fr(Qn(e,T,t));let S=[te("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](zn.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,[te("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]=fr(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,[te("BonusRewardsLevelsItem")]))},d(e){e&&f(n),d(B,e)}}}
|
|
713
|
+
// (274:10) {#each Object.keys(bonus.extension?.bonus.wallet || bonus.wallet).filter(k => ['sports', 'casino'].includes(k)) as support, i}
|
|
714
|
+
function gr(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 mr(t){let n,r=/*bonus*/t[1]&&/*isShowingBonus*/t[9]&&nr(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=nr(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 br=e=>["sports","casino"].includes(e);function yr(e,t,n){let r,o;var i,s;i=Kn,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=le.en}=t,{session:m=""}=t,{status:b=ie.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=ue(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:Se(e,t),percent:ve(e.status,{completed:()=>"100",current:()=>{if(!e.wageringProgress)return"0";const{currency:t,currentLevelIncrement:n,gap:r,currentLevel:o}=e.wageringProgress,i=Number(J(n,r));return String(Math.ceil(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,v=e.percent),n(3,l=e.levelsCurrent)}B()}},B=()=>{a&&(He(a.expiryDate,w,(()=>n(6,h="Expired")),(e=>n(6,h=e))),He(a.endTime||a.trigger.endTime,w,(()=>n(7,E="Ended")),(e=>n(7,E=e))))};H((()=>{const e=setInterval((()=>{B()}),w);return()=>{clearInterval(e)}})),ge({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,Mn.set(t)),/*status, bonus*/3&e.$$.dirty[0]&&n(9,r=b===ie.claimable||a.status===b)},[b,a,y,l,v,c,h,E,C,r,o,async()=>{if(!m)return;de({type:"OnWageringBonusJoinRequest",bonusID:a.bonusID}),de({type:"OnWageringBonusButtonStateChanged",clickable:!1});(await Ce(f,m,a.code,d)).success&&de({type:"OnWageringBonusClaimed"}),de({type:"OnWageringBonusButtonStateChanged",clickable:!0})},p,f,d,g,m,()=>de({type:"OnWageringBonusAllRewardsClick",bonusWalletID:a.id}),e=>de({type:"OnWageringBonusSupportClicked",support:e})]}var vr,Er;
|
|
171
716
|
/* src/CasinoWageringBonusesController.svelte generated by Svelte v3.48.0 */
|
|
172
|
-
function
|
|
173
|
-
// (
|
|
174
|
-
function
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
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}
|
|
718
|
+
// (87:4) {#each Object.keys(BonusStatus) as _status}
|
|
719
|
+
function Tr(e){let t,n,r,o,i,s,a=ie[/*_status*/e[18]]+"";function l(){/*click_handler*/
|
|
720
|
+
return e[11](/*_status*/e[18])}return{c(){t=g("li"),n=b(a),r=y(),C(t,"class",o=/*status*/e[0]===ie[/*_status*/e[18]]?"active":"")},m(e,o){p(e,t,o),h(t,n),h(t,r),i||(s=E(t,"click",l),i=!0)},p(n,r){e=n,/*status*/1&r&&o!==(o=/*status*/e[0]===ie[/*_status*/e[18]]?"active":"")&&C(t,"class",o)},d(e){e&&f(t),i=!1,s()}}}
|
|
721
|
+
// (120:4) {:else}
|
|
722
|
+
function Br(t){let n;return{c(){n=b("No wagering bonuses found")},m(e,t){p(e,n,t)},p:e,d(e){e&&f(n)}}}
|
|
723
|
+
// (118:4) {#if errorMessage}
|
|
724
|
+
function Ar(e){let t,n,r;return{c(){var o,i,s,a;t=g("div"),n=b("Error: "),r=b(/*errorMessage*/e[7]),o=t,i="color",null===(s="red")?o.style.removeProperty(i):o.style.setProperty(i,s,a?"important":"")},m(e,o){p(e,t,o),h(t,n),h(t,r)},p(e,t){/*errorMessage*/128&t&&A(r,/*errorMessage*/e[7])},d(e){e&&f(t)}}}
|
|
725
|
+
// (105:2) {#if bonuses.length > 0}
|
|
726
|
+
function Sr(e){let t,n=/*bonuses*/e[5],r=[];for(let t=0;t<n.length;t+=1)r[t]=Hr(Cr(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(/*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=Cr(e,n,i);r[i]?r[i].p(s,o):(r[i]=Hr(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)}}}
|
|
727
|
+
// (102:0) {#if isLoading}
|
|
728
|
+
function _r(t){let n;return{c(){n=b("Loading, please wait ...")},m(e,t){p(e,n,t)},p:e,d(e){e&&f(n)}}}
|
|
729
|
+
// (106:4) {#each bonuses as item}
|
|
730
|
+
function Hr(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=g("casino-wagering-bonus"),w(n,o)},m(e,t){p(e,n,t)},p(e,t){w(n,o=F(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&&f(n)}}}function Lr(n){let r,o,i,s,a=Object.keys(ie),l=[];for(let e=0;e<a.length;e+=1)l[e]=Tr(wr(n,a,e));let c=[te("WageringTabs")],u={};for(let e=0;e<c.length;e+=1)u=t(u,c[e]);function m(e,t){/*isLoading*/
|
|
731
|
+
return e[6]?_r:/*bonuses*/e[5].length>0?Sr:/*errorMessage*/e[7]?Ar:Br}let b=m(n),E=b(n);return{c(){r=g("div"),o=g("ul");for(let e=0;e<l.length;e+=1)l[e].c();i=y(),E.c(),s=v(),this.c=e,w(r,u)},m(e,t){p(e,r,t),h(r,o);for(let e=0;e<l.length;e+=1)l[e].m(o,null);p(e,i,t),E.m(e,t),p(e,s,t)},p(e,[t]){if(/*status, BonusStatus, Object, init*/257&t){let n;for(a=Object.keys(ie),n=0;n<a.length;n+=1){const r=wr(e,a,n);l[n]?l[n].p(r,t):(l[n]=Tr(r),l[n].c(),l[n].m(o,null))}for(;n<l.length;n+=1)l[n].d(1);l.length=a.length}w(r,u=F(c,[te("WageringTabs")])),b===(b=m(e))&&E?E.p(e,t):(E.d(1),E=b(e),E&&(E.c(),E.m(s.parentNode,s)))},i:e,o:e,d(e){e&&f(r),d(l,e),e&&f(i),E.d(e),e&&f(s)}}}function Pr(e,t,n){let{endpoint:r=""}=t,{lang:o=le.en}=t,{session:i=""}=t,{currency:s="EUR"}=t,{status:a=ie.claimable}=t,{limit:l=""}=t,c=!1;H((()=>(n(10,c=!0),()=>{n(10,c=!1)})));let u,h=[],p=!0,f="";Wn(Yn);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=ue(e,["messageType"]);
|
|
732
|
+
// 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,p=!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
|
+
// if(status !== BonusStatus.claimable){
|
|
735
|
+
// bonuses = _bonuses.filter(bonus => bonus.status === status)
|
|
736
|
+
// }else{
|
|
737
|
+
// bonuses = _bonuses
|
|
738
|
+
// }
|
|
739
|
+
me(u,d),a===ie.active&&(u=be(r,i,h,d))):n(7,f=e.errorMessage)})(),n(6,p=!1))};ge({OnWageringBonusClaimed:()=>m(),OnWageringBonusExpired:()=>m()}),H((()=>()=>me(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,p,f,m,l,c,e=>{a!==ie[e]&&(n(0,a=ie[e]),m())}]}vr="casino-wagering-bonus",Er=class extends j{constructor(e){super(),this.shadowRoot.innerHTML="<style>: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}</style>",V(this,{target:this.shadowRoot,props:S(this.attributes),customElement:!0},yr,mr,s,{rawbonus:12,endpoint:13,currency:14,lang:15,session:16,status:0},null,[-1,-1]),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),D()))}static get observedAttributes(){return["rawbonus","endpoint","currency","lang","session","status"]}get rawbonus(){return this.$$.ctx[12]}set rawbonus(e){this.$$set({rawbonus:e}),D()}get endpoint(){return this.$$.ctx[13]}set endpoint(e){this.$$set({endpoint:e}),D()}get currency(){return this.$$.ctx[14]}set currency(e){this.$$set({currency:e}),D()}get lang(){return this.$$.ctx[15]}set lang(e){this.$$set({lang:e}),D()}get session(){return this.$$.ctx[16]}set session(e){this.$$set({session:e}),D()}get status(){return this.$$.ctx[0]}set status(e){this.$$set({status:e}),D()}},!customElements.get(vr)&&customElements.define(vr,Er);class Rr extends j{constructor(e){super(),this.shadowRoot.innerHTML="<style>: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}</style>",V(this,{target:this.shadowRoot,props:S(this.attributes),customElement:!0},Pr,Lr,s,{endpoint:1,lang:2,session:3,currency:4,status:0,limit:9},null),e&&(e.target&&p(e.target,this,e.anchor),e.props&&(this.$set(e.props),D()))}static get observedAttributes(){return["endpoint","lang","session","currency","status","limit"]}get endpoint(){return this.$$.ctx[1]}set endpoint(e){this.$$set({endpoint:e}),D()}get lang(){return this.$$.ctx[2]}set lang(e){this.$$set({lang:e}),D()}get session(){return this.$$.ctx[3]}set session(e){this.$$set({session:e}),D()}get currency(){return this.$$.ctx[4]}set currency(e){this.$$set({currency:e}),D()}get status(){return this.$$.ctx[0]}set status(e){this.$$set({status:e}),D()}get limit(){return this.$$.ctx[9]}set limit(e){this.$$set({limit:e}),D()}}
|
|
740
|
+
// @ts-ignore
|
|
741
|
+
return!customElements.get("casino-wagering-bonuses-controller")&&customElements.define("casino-wagering-bonuses-controller",Rr),Rr}));
|
|
184
742
|
//# sourceMappingURL=casino-wagering-bonuses-controller.js.map
|