@everymatrix/player-profile-info 1.92.2 → 1.92.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/{PlayerAccountBiometricsAction-BA9Ie2Za.js → PlayerAccountBiometricsAction-BAGMeJ7n.js} +1 -1
- package/components/{PlayerAccountBiometricsAction-BT9CnaZn.cjs → PlayerAccountBiometricsAction-C80Si6jU.cjs} +1 -1
- package/components/{PlayerAccountBiometricsAction-CdjRpYV-.js → PlayerAccountBiometricsAction-Dyt5-VKL.js} +1 -1
- package/components/{PlayerProfileInfo-CTEj5Rw2.js → PlayerProfileInfo-BD3Smhlz.js} +2 -2
- package/components/{PlayerProfileInfo-DWSJ3IK_.js → PlayerProfileInfo-D7JsveZr.js} +2 -2
- package/components/{PlayerProfileInfo-BjnZ5Gd8.cjs → PlayerProfileInfo-DeA5q7TR.cjs} +1 -1
- package/components/QrSessionGenerator-98YJa0kO.cjs +8 -0
- package/components/{QrSessionGenerator-BwR-VKzG.js → QrSessionGenerator-_j3dUSs4.js} +458 -465
- package/components/{QrSessionGenerator-B4KOHnOP.js → QrSessionGenerator-mkYXTmck.js} +487 -460
- package/es2015/player-profile-info.cjs +1 -1
- package/es2015/player-profile-info.js +1 -1
- package/esnext/player-profile-info.js +1 -1
- package/package.json +1 -1
- package/components/QrSessionGenerator-Cf0niVes.cjs +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";if(typeof window!="undefined"){let n=function(e){return function(...s){try{return e.apply(this,s)}catch(t){if(t instanceof DOMException&&t.message.includes("has already been used with this registry")||t.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw t}}};customElements.define=n(customElements.define),Promise.resolve().then(()=>require("../components/PlayerProfileInfo-
|
|
1
|
+
"use strict";if(typeof window!="undefined"){let n=function(e){return function(...s){try{return e.apply(this,s)}catch(t){if(t instanceof DOMException&&t.message.includes("has already been used with this registry")||t.message.includes("Cannot define multiple custom elements with the same tag name"))return!1;throw t}}};customElements.define=n(customElements.define),Promise.resolve().then(()=>require("../components/PlayerProfileInfo-DeA5q7TR.cjs")).then(e=>e.PlayerProfileInfo_ce).then(({default:e})=>{!customElements.get("player-profile-info")&&customElements.define("player-profile-info",e.element)})}
|
|
@@ -10,7 +10,7 @@ if (typeof window != "undefined") {
|
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
-
customElements.define = n(customElements.define), import("../components/PlayerProfileInfo-
|
|
13
|
+
customElements.define = n(customElements.define), import("../components/PlayerProfileInfo-BD3Smhlz.js").then((e) => e.P).then(({ default: e }) => {
|
|
14
14
|
!customElements.get("player-profile-info") && customElements.define("player-profile-info", e.element);
|
|
15
15
|
});
|
|
16
16
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";var dt=(e,t,n)=>new Promise((o,r)=>{var i=l=>{try{a(n.next(l))}catch(c){r(c)}},s=l=>{try{a(n.throw(l))}catch(c){r(c)}},a=l=>l.done?o(l.value):Promise.resolve(l.value).then(i,s);a((n=n.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./PlayerProfileInfo-BjnZ5Gd8.cjs");function gt(e,t){u.addMessages(e,t)}function kt(e){u.$locale.set(e)}const ht={en:{titleQRSessionGenerator:"Scan the QR Code to access your account on retail devices.",generateQRButton:"Generate QR",unauthorized:"Authentication failed.",failedToFetch:"Cannot generate QR, Please try again.",unexpectedError:"Unexpected error occurred. Please try again later."},fr:{titleQRSessionGenerator:"Scannez le code QR pour accéder à votre compte sur les appareils en magasin.",generateQRButton:"Générer des QR",unauthorized:"L'authentification a échoué.",failedToFetch:"Impossible de générer le code QR, veuillez réessayer.",unexpectedError:"Une erreur inattendue s'est produite. Veuillez réessayer plus tard."}};var K={},Ft=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},pt={},M={};let lt;const zt=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];M.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};M.getSymbolTotalCodewords=function(t){return zt[t]};M.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};M.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');lt=t};M.isKanjiModeEnabled=function(){return typeof lt!="undefined"};M.toSJIS=function(t){return lt(t)};var Y={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(o){return o&&typeof o.bit!="undefined"&&o.bit>=0&&o.bit<4},e.from=function(o,r){if(e.isValid(o))return o;try{return t(o)}catch(i){return r}}})(Y);function Ct(){this.buffer=[],this.length=0}Ct.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var vt=Ct;function Q(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Q.prototype.set=function(e,t,n,o){const r=e*this.size+t;this.data[r]=n,o&&(this.reservedBit[r]=!0)};Q.prototype.get=function(e,t){return this.data[e*this.size+t]};Q.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};Q.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Ot=Q,Et={};(function(e){const t=M.getSymbolSize;e.getRowColCoords=function(o){if(o===1)return[];const r=Math.floor(o/7)+2,i=t(o),s=i===145?26:Math.ceil((i-13)/(2*r-2))*2,a=[i-7];for(let l=1;l<r-1;l++)a[l]=a[l-1]-s;return a.push(6),a.reverse()},e.getPositions=function(o){const r=[],i=e.getRowColCoords(o),s=i.length;for(let a=0;a<s;a++)for(let l=0;l<s;l++)a===0&&l===0||a===0&&l===s-1||a===s-1&&l===0||r.push([i[a],i[l]]);return r}})(Et);var bt={};const Vt=M.getSymbolSize,mt=7;bt.getPositions=function(t){const n=Vt(t);return[[0,0],[n-mt,0],[0,n-mt]]};var Bt={};(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(r){return r!=null&&r!==""&&!isNaN(r)&&r>=0&&r<=7},e.from=function(r){return e.isValid(r)?parseInt(r,10):void 0},e.getPenaltyN1=function(r){const i=r.size;let s=0,a=0,l=0,c=null,f=null;for(let B=0;B<i;B++){a=l=0,c=f=null;for(let g=0;g<i;g++){let h=r.get(B,g);h===c?a++:(a>=5&&(s+=t.N1+(a-5)),c=h,a=1),h=r.get(g,B),h===f?l++:(l>=5&&(s+=t.N1+(l-5)),f=h,l=1)}a>=5&&(s+=t.N1+(a-5)),l>=5&&(s+=t.N1+(l-5))}return s},e.getPenaltyN2=function(r){const i=r.size;let s=0;for(let a=0;a<i-1;a++)for(let l=0;l<i-1;l++){const c=r.get(a,l)+r.get(a,l+1)+r.get(a+1,l)+r.get(a+1,l+1);(c===4||c===0)&&s++}return s*t.N2},e.getPenaltyN3=function(r){const i=r.size;let s=0,a=0,l=0;for(let c=0;c<i;c++){a=l=0;for(let f=0;f<i;f++)a=a<<1&2047|r.get(c,f),f>=10&&(a===1488||a===93)&&s++,l=l<<1&2047|r.get(f,c),f>=10&&(l===1488||l===93)&&s++}return s*t.N3},e.getPenaltyN4=function(r){let i=0;const s=r.data.length;for(let l=0;l<s;l++)i+=r.data[l];return Math.abs(Math.ceil(i*100/s/5)-10)*t.N4};function n(o,r,i){switch(o){case e.Patterns.PATTERN000:return(r+i)%2===0;case e.Patterns.PATTERN001:return r%2===0;case e.Patterns.PATTERN010:return i%3===0;case e.Patterns.PATTERN011:return(r+i)%3===0;case e.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(i/3))%2===0;case e.Patterns.PATTERN101:return r*i%2+r*i%3===0;case e.Patterns.PATTERN110:return(r*i%2+r*i%3)%2===0;case e.Patterns.PATTERN111:return(r*i%3+(r+i)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}e.applyMask=function(r,i){const s=i.size;for(let a=0;a<s;a++)for(let l=0;l<s;l++)i.isReserved(l,a)||i.xor(l,a,n(r,l,a))},e.getBestMask=function(r,i){const s=Object.keys(e.Patterns).length;let a=0,l=1/0;for(let c=0;c<s;c++){i(c),e.applyMask(c,r);const f=e.getPenaltyN1(r)+e.getPenaltyN2(r)+e.getPenaltyN3(r)+e.getPenaltyN4(r);e.applyMask(c,r),f<l&&(l=f,a=c)}return a}})(Bt);var W={};const L=Y,J=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],j=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];W.getBlocksCount=function(t,n){switch(n){case L.L:return J[(t-1)*4+0];case L.M:return J[(t-1)*4+1];case L.Q:return J[(t-1)*4+2];case L.H:return J[(t-1)*4+3];default:return}};W.getTotalCodewordsCount=function(t,n){switch(n){case L.L:return j[(t-1)*4+0];case L.M:return j[(t-1)*4+1];case L.Q:return j[(t-1)*4+2];case L.H:return j[(t-1)*4+3];default:return}};var St={},X={};const V=new Uint8Array(512),G=new Uint8Array(256);(function(){let t=1;for(let n=0;n<255;n++)V[n]=t,G[t]=n,t<<=1,t&256&&(t^=285);for(let n=255;n<512;n++)V[n]=V[n-255]})();X.log=function(t){if(t<1)throw new Error("log("+t+")");return G[t]};X.exp=function(t){return V[t]};X.mul=function(t,n){return t===0||n===0?0:V[G[t]+G[n]]};(function(e){const t=X;e.mul=function(o,r){const i=new Uint8Array(o.length+r.length-1);for(let s=0;s<o.length;s++)for(let a=0;a<r.length;a++)i[s+a]^=t.mul(o[s],r[a]);return i},e.mod=function(o,r){let i=new Uint8Array(o);for(;i.length-r.length>=0;){const s=i[0];for(let l=0;l<r.length;l++)i[l]^=t.mul(r[l],s);let a=0;for(;a<i.length&&i[a]===0;)a++;i=i.slice(a)}return i},e.generateECPolynomial=function(o){let r=new Uint8Array([1]);for(let i=0;i<o;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})(St);const At=St;function at(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}at.prototype.initialize=function(t){this.degree=t,this.genPoly=At.generateECPolynomial(this.degree)};at.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(t.length+this.degree);n.set(t);const o=At.mod(n,this.genPoly),r=this.degree-o.length;if(r>0){const i=new Uint8Array(this.degree);return i.set(o,r),i}return o};var Ht=at,It={},U={},ut={};ut.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var P={};const Tt="[0-9]+",Kt="[A-Z $%*+\\-./:]+";let H="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";H=H.replace(/u/g,"\\u");const Qt="(?:(?![A-Z0-9 $%*+\\-./:]|"+H+`)(?:.|[\r
|
|
2
|
-
]))+`;P.KANJI=new RegExp(H,"g");P.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");P.BYTE=new RegExp(Qt,"g");P.NUMERIC=new RegExp(Tt,"g");P.ALPHANUMERIC=new RegExp(Kt,"g");const Jt=new RegExp("^"+H+"$"),jt=new RegExp("^"+Tt+"$"),Gt=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");P.testKanji=function(t){return Jt.test(t)};P.testNumeric=function(t){return jt.test(t)};P.testAlphanumeric=function(t){return Gt.test(t)};(function(e){const t=ut,n=P;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,s){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?i.ccBits[0]:s<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return n.testNumeric(i)?e.NUMERIC:n.testAlphanumeric(i)?e.ALPHANUMERIC:n.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function o(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+r)}}e.from=function(i,s){if(e.isValid(i))return i;try{return o(i)}catch(a){return s}}})(U);(function(e){const t=M,n=W,o=Y,r=U,i=ut,s=7973,a=t.getBCHDigit(s);function l(g,h,w){for(let y=1;y<=40;y++)if(h<=e.getCapacity(y,w,g))return y}function c(g,h){return r.getCharCountIndicator(g,h)+4}function f(g,h){let w=0;return g.forEach(function(y){const E=c(y.mode,h);w+=E+y.getBitsLength()}),w}function B(g,h){for(let w=1;w<=40;w++)if(f(g,w)<=e.getCapacity(w,h,r.MIXED))return w}e.from=function(h,w){return i.isValid(h)?parseInt(h,10):w},e.getCapacity=function(h,w,y){if(!i.isValid(h))throw new Error("Invalid QR Code version");typeof y=="undefined"&&(y=r.BYTE);const E=t.getSymbolTotalCodewords(h),d=n.getTotalCodewordsCount(h,w),m=(E-d)*8;if(y===r.MIXED)return m;const C=m-c(y,h);switch(y){case r.NUMERIC:return Math.floor(C/10*3);case r.ALPHANUMERIC:return Math.floor(C/11*2);case r.KANJI:return Math.floor(C/13);case r.BYTE:default:return Math.floor(C/8)}},e.getBestVersionForData=function(h,w){let y;const E=o.from(w,o.M);if(Array.isArray(h)){if(h.length>1)return B(h,E);if(h.length===0)return 1;y=h[0]}else y=h;return l(y.mode,y.getLength(),E)},e.getEncodedBits=function(h){if(!i.isValid(h)||h<7)throw new Error("Invalid QR Code version");let w=h<<12;for(;t.getBCHDigit(w)-a>=0;)w^=s<<t.getBCHDigit(w)-a;return h<<12|w}})(It);var Nt={};const rt=M,Mt=1335,qt=21522,wt=rt.getBCHDigit(Mt);Nt.getEncodedBits=function(t,n){const o=t.bit<<3|n;let r=o<<10;for(;rt.getBCHDigit(r)-wt>=0;)r^=Mt<<rt.getBCHDigit(r)-wt;return(o<<10|r)^qt};var Rt={};const Yt=U;function k(e){this.mode=Yt.NUMERIC,this.data=e.toString()}k.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};k.prototype.getLength=function(){return this.data.length};k.prototype.getBitsLength=function(){return k.getBitsLength(this.data.length)};k.prototype.write=function(t){let n,o,r;for(n=0;n+3<=this.data.length;n+=3)o=this.data.substr(n,3),r=parseInt(o,10),t.put(r,10);const i=this.data.length-n;i>0&&(o=this.data.substr(n),r=parseInt(o,10),t.put(r,i*3+1))};var Wt=k;const Xt=U,x=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function F(e){this.mode=Xt.ALPHANUMERIC,this.data=e}F.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};F.prototype.getLength=function(){return this.data.length};F.prototype.getBitsLength=function(){return F.getBitsLength(this.data.length)};F.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let o=x.indexOf(this.data[n])*45;o+=x.indexOf(this.data[n+1]),t.put(o,11)}this.data.length%2&&t.put(x.indexOf(this.data[n]),6)};var Zt=F;const xt=U;function z(e){this.mode=xt.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}z.getBitsLength=function(t){return t*8};z.prototype.getLength=function(){return this.data.length};z.prototype.getBitsLength=function(){return z.getBitsLength(this.data.length)};z.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};var $t=z;const te=U,ee=M;function v(e){this.mode=te.KANJI,this.data=e}v.getBitsLength=function(t){return t*13};v.prototype.getLength=function(){return this.data.length};v.prototype.getBitsLength=function(){return v.getBitsLength(this.data.length)};v.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=ee.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
|
|
3
|
-
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var ne=v,_t={exports:{}};(function(e){var t={single_source_shortest_paths:function(n,o,r){var i={},s={};s[o]=0;var a=t.PriorityQueue.make();a.push(o,0);for(var l,c,f,B,g,h,w,y,E;!a.empty();){l=a.pop(),c=l.value,B=l.cost,g=n[c]||{};for(f in g)g.hasOwnProperty(f)&&(h=g[f],w=B+h,y=s[f],E=typeof s[f]=="undefined",(E||y>w)&&(s[f]=w,a.push(f,w),i[f]=c))}if(typeof r!="undefined"&&typeof s[r]=="undefined"){var d=["Could not find a path from ",o," to ",r,"."].join("");throw new Error(d)}return i},extract_shortest_path_from_predecessor_list:function(n,o){for(var r=[],i=o;i;)r.push(i),n[i],i=n[i];return r.reverse(),r},find_path:function(n,o,r){var i=t.single_source_shortest_paths(n,o,r);return t.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(n){var o=t.PriorityQueue,r={},i;n=n||{};for(i in o)o.hasOwnProperty(i)&&(r[i]=o[i]);return r.queue=[],r.sorter=n.sorter||o.default_sorter,r},default_sorter:function(n,o){return n.cost-o.cost},push:function(n,o){var r={value:n,cost:o};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(_t);var re=_t.exports;(function(e){const t=U,n=Wt,o=Zt,r=$t,i=ne,s=P,a=M,l=re;function c(d){return unescape(encodeURIComponent(d)).length}function f(d,m,C){const p=[];let S;for(;(S=d.exec(C))!==null;)p.push({data:S[0],index:S.index,mode:m,length:S[0].length});return p}function B(d){const m=f(s.NUMERIC,t.NUMERIC,d),C=f(s.ALPHANUMERIC,t.ALPHANUMERIC,d);let p,S;return a.isKanjiModeEnabled()?(p=f(s.BYTE,t.BYTE,d),S=f(s.KANJI,t.KANJI,d)):(p=f(s.BYTE_KANJI,t.BYTE,d),S=[]),m.concat(C,p,S).sort(function(I,N){return I.index-N.index}).map(function(I){return{data:I.data,mode:I.mode,length:I.length}})}function g(d,m){switch(m){case t.NUMERIC:return n.getBitsLength(d);case t.ALPHANUMERIC:return o.getBitsLength(d);case t.KANJI:return i.getBitsLength(d);case t.BYTE:return r.getBitsLength(d)}}function h(d){return d.reduce(function(m,C){const p=m.length-1>=0?m[m.length-1]:null;return p&&p.mode===C.mode?(m[m.length-1].data+=C.data,m):(m.push(C),m)},[])}function w(d){const m=[];for(let C=0;C<d.length;C++){const p=d[C];switch(p.mode){case t.NUMERIC:m.push([p,{data:p.data,mode:t.ALPHANUMERIC,length:p.length},{data:p.data,mode:t.BYTE,length:p.length}]);break;case t.ALPHANUMERIC:m.push([p,{data:p.data,mode:t.BYTE,length:p.length}]);break;case t.KANJI:m.push([p,{data:p.data,mode:t.BYTE,length:c(p.data)}]);break;case t.BYTE:m.push([{data:p.data,mode:t.BYTE,length:c(p.data)}])}}return m}function y(d,m){const C={},p={start:{}};let S=["start"];for(let A=0;A<d.length;A++){const I=d[A],N=[];for(let b=0;b<I.length;b++){const T=I[b],_=""+A+b;N.push(_),C[_]={node:T,lastCount:0},p[_]={};for(let D=0;D<S.length;D++){const R=S[D];C[R]&&C[R].node.mode===T.mode?(p[R][_]=g(C[R].lastCount+T.length,T.mode)-g(C[R].lastCount,T.mode),C[R].lastCount+=T.length):(C[R]&&(C[R].lastCount=T.length),p[R][_]=g(T.length,T.mode)+4+t.getCharCountIndicator(T.mode,m))}}S=N}for(let A=0;A<S.length;A++)p[S[A]].end=0;return{map:p,table:C}}function E(d,m){let C;const p=t.getBestModeForData(d);if(C=t.from(m,p),C!==t.BYTE&&C.bit<p.bit)throw new Error('"'+d+'" cannot be encoded with mode '+t.toString(C)+`.
|
|
4
|
-
Suggested mode is: `+t.toString(p));switch(C===t.KANJI&&!a.isKanjiModeEnabled()&&(C=t.BYTE),C){case t.NUMERIC:return new n(d);case t.ALPHANUMERIC:return new o(d);case t.KANJI:return new i(d);case t.BYTE:return new r(d)}}e.fromArray=function(m){return m.reduce(function(C,p){return typeof p=="string"?C.push(E(p,null)):p.data&&C.push(E(p.data,p.mode)),C},[])},e.fromString=function(m,C){const p=B(m,a.isKanjiModeEnabled()),S=w(p),A=y(S,C),I=l.find_path(A.map,"start","end"),N=[];for(let b=1;b<I.length-1;b++)N.push(A.table[I[b]].node);return e.fromArray(h(N))},e.rawSplit=function(m){return e.fromArray(B(m,a.isKanjiModeEnabled()))}})(Rt);const Z=M,$=Y,oe=vt,ie=Ot,se=Et,le=bt,ot=Bt,it=W,ae=Ht,q=It,ue=Nt,ce=U,tt=Rt;function fe(e,t){const n=e.size,o=le.getPositions(t);for(let r=0;r<o.length;r++){const i=o[r][0],s=o[r][1];for(let a=-1;a<=7;a++)if(!(i+a<=-1||n<=i+a))for(let l=-1;l<=7;l++)s+l<=-1||n<=s+l||(a>=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?e.set(i+a,s+l,!0,!0):e.set(i+a,s+l,!1,!0))}}function de(e){const t=e.size;for(let n=8;n<t-8;n++){const o=n%2===0;e.set(n,6,o,!0),e.set(6,n,o,!0)}}function ge(e,t){const n=se.getPositions(t);for(let o=0;o<n.length;o++){const r=n[o][0],i=n[o][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?e.set(r+s,i+a,!0,!0):e.set(r+s,i+a,!1,!0)}}function he(e,t){const n=e.size,o=q.getEncodedBits(t);let r,i,s;for(let a=0;a<18;a++)r=Math.floor(a/3),i=a%3+n-8-3,s=(o>>a&1)===1,e.set(r,i,s,!0),e.set(i,r,s,!0)}function et(e,t,n){const o=e.size,r=ue.getEncodedBits(t,n);let i,s;for(i=0;i<15;i++)s=(r>>i&1)===1,i<6?e.set(i,8,s,!0):i<8?e.set(i+1,8,s,!0):e.set(o-15+i,8,s,!0),i<8?e.set(8,o-i-1,s,!0):i<9?e.set(8,15-i-1+1,s,!0):e.set(8,15-i-1,s,!0);e.set(o-8,8,1,!0)}function me(e,t){const n=e.size;let o=-1,r=n-1,i=7,s=0;for(let a=n-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!e.isReserved(r,a-l)){let c=!1;s<t.length&&(c=(t[s]>>>i&1)===1),e.set(r,a-l,c),i--,i===-1&&(s++,i=7)}if(r+=o,r<0||n<=r){r-=o,o=-o;break}}}function we(e,t,n){const o=new oe;n.forEach(function(l){o.put(l.mode.bit,4),o.put(l.getLength(),ce.getCharCountIndicator(l.mode,e)),l.write(o)});const r=Z.getSymbolTotalCodewords(e),i=it.getTotalCodewordsCount(e,t),s=(r-i)*8;for(o.getLengthInBits()+4<=s&&o.put(0,4);o.getLengthInBits()%8!==0;)o.putBit(0);const a=(s-o.getLengthInBits())/8;for(let l=0;l<a;l++)o.put(l%2?17:236,8);return ye(o,e,t)}function ye(e,t,n){const o=Z.getSymbolTotalCodewords(t),r=it.getTotalCodewordsCount(t,n),i=o-r,s=it.getBlocksCount(t,n),a=o%s,l=s-a,c=Math.floor(o/s),f=Math.floor(i/s),B=f+1,g=c-f,h=new ae(g);let w=0;const y=new Array(s),E=new Array(s);let d=0;const m=new Uint8Array(e.buffer);for(let I=0;I<s;I++){const N=I<l?f:B;y[I]=m.slice(w,w+N),E[I]=h.encode(y[I]),w+=N,d=Math.max(d,N)}const C=new Uint8Array(o);let p=0,S,A;for(S=0;S<d;S++)for(A=0;A<s;A++)S<y[A].length&&(C[p++]=y[A][S]);for(S=0;S<g;S++)for(A=0;A<s;A++)C[p++]=E[A][S];return C}function pe(e,t,n,o){let r;if(Array.isArray(e))r=tt.fromArray(e);else if(typeof e=="string"){let c=t;if(!c){const f=tt.rawSplit(e);c=q.getBestVersionForData(f,n)}r=tt.fromString(e,c||40)}else throw new Error("Invalid data");const i=q.getBestVersionForData(r,n);if(!i)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=i;else if(t<i)throw new Error(`
|
|
5
|
-
The chosen QR Code version cannot contain this amount of data.
|
|
6
|
-
Minimum version required to store current data is: `+i+`.
|
|
7
|
-
`);const s=we(t,n,r),a=Z.getSymbolSize(t),l=new ie(a);return fe(l,t),de(l),ge(l,t),et(l,n,0),t>=7&&he(l,t),me(l,s),isNaN(o)&&(o=ot.getBestMask(l,et.bind(null,l,n))),ot.applyMask(o,l),et(l,n,o),{modules:l,version:t,errorCorrectionLevel:n,maskPattern:o,segments:r}}pt.create=function(t,n){if(typeof t=="undefined"||t==="")throw new Error("No input text");let o=$.M,r,i;return typeof n!="undefined"&&(o=$.from(n.errorCorrectionLevel,$.M),r=q.from(n.version),i=ot.from(n.maskPattern),n.toSJISFunc&&Z.setToSJISFunction(n.toSJISFunc)),pe(t,r,o,i)};var Pt={},ct={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let o=n.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+n);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(i){return[i,i]}))),o.length===6&&o.push("F","F");const r=parseInt(o.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+o.slice(0,6).join("")}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const r=typeof o.margin=="undefined"||o.margin===null||o.margin<0?4:o.margin,i=o.width&&o.width>=21?o.width:void 0,s=o.scale||4;return{width:i,scale:i?4:s,margin:r,color:{dark:t(o.color.dark||"#000000ff"),light:t(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(o,r){return r.width&&r.width>=o+r.margin*2?r.width/(o+r.margin*2):r.scale},e.getImageWidth=function(o,r){const i=e.getScale(o,r);return Math.floor((o+r.margin*2)*i)},e.qrToImageData=function(o,r,i){const s=r.modules.size,a=r.modules.data,l=e.getScale(s,i),c=Math.floor((s+i.margin*2)*l),f=i.margin*l,B=[i.color.light,i.color.dark];for(let g=0;g<c;g++)for(let h=0;h<c;h++){let w=(g*c+h)*4,y=i.color.light;if(g>=f&&h>=f&&g<c-f&&h<c-f){const E=Math.floor((g-f)/l),d=Math.floor((h-f)/l);y=B[a[E*s+d]?1:0]}o[w++]=y.r,o[w++]=y.g,o[w++]=y.b,o[w]=y.a}}})(ct);(function(e){const t=ct;function n(r,i,s){r.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=s,i.width=s,i.style.height=s+"px",i.style.width=s+"px"}function o(){try{return document.createElement("canvas")}catch(r){throw new Error("You need to specify a canvas element")}}e.render=function(i,s,a){let l=a,c=s;typeof l=="undefined"&&(!s||!s.getContext)&&(l=s,s=void 0),s||(c=o()),l=t.getOptions(l);const f=t.getImageWidth(i.modules.size,l),B=c.getContext("2d"),g=B.createImageData(f,f);return t.qrToImageData(g.data,i,l),n(B,c,f),B.putImageData(g,0,0),c},e.renderToDataURL=function(i,s,a){let l=a;typeof l=="undefined"&&(!s||!s.getContext)&&(l=s,s=void 0),l||(l={});const c=e.render(i,s,l),f=l.type||"image/png",B=l.rendererOpts||{};return c.toDataURL(f,B.quality)}})(Pt);var Lt={};const Ce=ct;function yt(e,t){const n=e.a/255,o=t+'="'+e.hex+'"';return n<1?o+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':o}function nt(e,t,n){let o=e+t;return typeof n!="undefined"&&(o+=" "+n),o}function Ee(e,t,n){let o="",r=0,i=!1,s=0;for(let a=0;a<e.length;a++){const l=Math.floor(a%t),c=Math.floor(a/t);!l&&!i&&(i=!0),e[a]?(s++,a>0&&l>0&&e[a-1]||(o+=i?nt("M",l+n,.5+c+n):nt("m",r,0),r=0,i=!1),l+1<t&&e[a+1]||(o+=nt("h",s),s=0)):r++}return o}Lt.render=function(t,n,o){const r=Ce.getOptions(n),i=t.modules.size,s=t.modules.data,a=i+r.margin*2,l=r.color.light.a?"<path "+yt(r.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",c="<path "+yt(r.color.dark,"stroke")+' d="'+Ee(s,i,r.margin)+'"/>',f='viewBox="0 0 '+a+" "+a+'"',g='<svg xmlns="http://www.w3.org/2000/svg" '+(r.width?'width="'+r.width+'" height="'+r.width+'" ':"")+f+' shape-rendering="crispEdges">'+l+c+`</svg>
|
|
8
|
-
`;return typeof o=="function"&&o(null,g),g};const be=Ft,st=pt,Ut=Pt,Be=Lt;function ft(e,t,n,o,r){const i=[].slice.call(arguments,1),s=i.length,a=typeof i[s-1]=="function";if(!a&&!be())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(r=n,n=t,t=o=void 0):s===3&&(t.getContext&&typeof r=="undefined"?(r=o,o=void 0):(r=o,o=n,n=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(n=t,t=o=void 0):s===2&&!t.getContext&&(o=n,n=t,t=void 0),new Promise(function(l,c){try{const f=st.create(n,o);l(e(f,t,o))}catch(f){c(f)}})}try{const l=st.create(n,o);r(null,e(l,t,o))}catch(l){r(l)}}K.create=st.create;K.toCanvas=ft.bind(null,Ut.render);K.toDataURL=ft.bind(null,Ut.renderToDataURL);K.toString=ft.bind(null,function(e,t,n){return Be.render(e,n)});function Se(e){u.append_styles(e,"svelte-ty0b2n",'*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit}.LoadingSpinner{display:block;width:80px;height:80px;margin:0 auto 0 0}.LoadingSpinner:after{content:" ";display:block;width:64px;height:64px;margin:8px;border-radius:50%;border:6px solid var(--emw--casino-color-primary, var(--emw--color-primary, #22b04e));border-color:var(--emw--casino-color-primary, var(--emw--color-primary, #22b04e)) transparent var(--emw--casino-color-primary, var(--emw--color-primary, #22b04e)) transparent;animation:LoadingSpinner 1.2s linear infinite}@keyframes LoadingSpinner{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}')}function Ae(e){let t,n,o;return{c(){t=u.element("div"),n=u.element("img"),u.attr(n,"class","qr-image"),u.src_url_equal(n.src,o=e[3])||u.attr(n,"src",o),u.attr(n,"alt","qr-session-login"),u.attr(t,"class","qr-section")},m(r,i){u.insert(r,t,i),u.append(t,n)},p(r,i){i&8&&!u.src_url_equal(n.src,o=r[3])&&u.attr(n,"src",o)},d(r){r&&u.detach(t)}}}function Ie(e){let t;return{c(){t=u.element("div"),u.attr(t,"class","LoadingSpinner")},m(n,o){u.insert(n,t,o)},p:u.noop,d(n){n&&u.detach(t)}}}function Te(e){let t,n=e[5](e[4])+"",o;return{c(){t=u.element("p"),o=u.text(n),u.attr(t,"class","generate-qr-error-message")},m(r,i){u.insert(r,t,i),u.append(t,o)},p(r,i){i&48&&n!==(n=r[5](r[4])+"")&&u.set_data(o,n)},d(r){r&&u.detach(t)}}}function Ne(e){let t,n,o,r=e[5]("titleQRSessionGenerator")+"",i,s,a,l=(e[1]>0?`${e[1]}s`:e[5]("generateQRButton"))+"",c,f,B,g,h;function w(d,m){if(d[4])return Te;if(d[2])return Ie;if(d[3])return Ae}let y=w(e),E=y&&y(e);return{c(){t=u.element("div"),n=u.element("div"),o=u.element("p"),i=u.text(r),s=u.space(),a=u.element("button"),c=u.text(l),B=u.space(),E&&E.c(),u.attr(a,"class","generate-qr-btn"),a.disabled=f=e[2]||e[1]>0,u.attr(n,"class","qr-session-generator")},m(d,m){u.insert(d,t,m),u.append(t,n),u.append(n,o),u.append(o,i),u.append(n,s),u.append(n,a),u.append(a,c),u.append(n,B),E&&E.m(n,null),e[14](t),g||(h=u.listen(a,"click",e[6]),g=!0)},p(d,[m]){m&32&&r!==(r=d[5]("titleQRSessionGenerator")+"")&&u.set_data(i,r),m&34&&l!==(l=(d[1]>0?`${d[1]}s`:d[5]("generateQRButton"))+"")&&u.set_data(c,l),m&6&&f!==(f=d[2]||d[1]>0)&&(a.disabled=f),y===(y=w(d))&&E?E.p(d,m):(E&&E.d(1),E=y&&y(d),E&&(E.c(),E.m(n,null)))},i:u.noop,o:u.noop,d(d){d&&u.detach(t),E&&E.d(),e[14](null),g=!1,h()}}}const Me=60;function Re(e,t,n){let o;u.component_subscribe(e,u.$format,b=>n(5,o=b));let{clientstyling:r=""}=t,{clientstylingurl:i=""}=t,{mbsource:s}=t,{lang:a="en"}=t,{endpoint:l=""}=t,{sessionid:c}=t,{translationurl:f}=t;const B={"gm.norway.unauthorized":"unauthorizedError"};let g,h,w=0,y=!1,E=null,d=null,m=null;u.onMount(()=>()=>{});const C=()=>{fetch(f).then(T=>T.json()).then(T=>{Object.keys(T).forEach(_=>{gt(_,T[_])})}).catch(T=>{console.error(T)})};Object.keys(ht).forEach(b=>{gt(b,ht[b])});const p=()=>{kt(a)},S=()=>dt(this,null,function*(){var R;if(y||w>0)return;n(2,y=!0),n(4,m=null),n(3,d=null),n(1,w=Me),A();const b=new URL(`${l}/api/pam/v1/qr/authenticate`),T=new Headers;T.append("X-SessionID",c);const _={method:"POST",headers:T};n(4,m=null);const D=yield fetch(b.href,_);try{if(D.ok){const O=yield D.json();n(3,d=yield K.toDataURL(JSON.stringify(O)))}else{const O=yield D.json();n(4,m=(R=B[O.Code])!=null?R:"unexpectedError"),I()}}catch(O){console.error(O),n(4,m="failedToFetch"),I()}finally{n(2,y=!1)}});function A(){E!==null&&clearInterval(E),E=setInterval(()=>{w>1?n(1,w-=1):(n(1,w=0),n(2,y=!1),n(3,d=null),I())},1e3)}function I(){E!==null&&(clearInterval(E),E=null),n(1,w=0)}u.onDestroy(()=>{E!==null&&clearInterval(E)});function N(b){u.binding_callbacks[b?"unshift":"push"](()=>{g=b,n(0,g)})}return e.$$set=b=>{"clientstyling"in b&&n(7,r=b.clientstyling),"clientstylingurl"in b&&n(8,i=b.clientstylingurl),"mbsource"in b&&n(9,s=b.mbsource),"lang"in b&&n(10,a=b.lang),"endpoint"in b&&n(11,l=b.endpoint),"sessionid"in b&&n(12,c=b.sessionid),"translationurl"in b&&n(13,f=b.translationurl)},e.$$.update=()=>{e.$$.dirty&129&&r&&g&&u.setClientStyling(g,r),e.$$.dirty&257&&i&&g&&u.setClientStylingURL(g,i),e.$$.dirty&513&&s&&g&&u.setStreamStyling(g,`${s}.Style`,h),e.$$.dirty&1024&&a&&p(),e.$$.dirty&8192&&f&&C()},[g,w,y,d,m,o,S,r,i,s,a,l,c,f,N]}class Dt extends u.SvelteComponent{constructor(t){super(),u.init(this,t,Re,Ne,u.safe_not_equal,{clientstyling:7,clientstylingurl:8,mbsource:9,lang:10,endpoint:11,sessionid:12,translationurl:13},Se)}get clientstyling(){return this.$$.ctx[7]}set clientstyling(t){this.$$set({clientstyling:t}),u.flush()}get clientstylingurl(){return this.$$.ctx[8]}set clientstylingurl(t){this.$$set({clientstylingurl:t}),u.flush()}get mbsource(){return this.$$.ctx[9]}set mbsource(t){this.$$set({mbsource:t}),u.flush()}get lang(){return this.$$.ctx[10]}set lang(t){this.$$set({lang:t}),u.flush()}get endpoint(){return this.$$.ctx[11]}set endpoint(t){this.$$set({endpoint:t}),u.flush()}get sessionid(){return this.$$.ctx[12]}set sessionid(t){this.$$set({sessionid:t}),u.flush()}get translationurl(){return this.$$.ctx[13]}set translationurl(t){this.$$set({translationurl:t}),u.flush()}}u.create_custom_element(Dt,{clientstyling:{},clientstylingurl:{},mbsource:{},lang:{},endpoint:{},sessionid:{},translationurl:{}},[],[],!0);exports.default=Dt;
|