@trust-proto/auth-react 0.2.0 → 0.4.0
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/README.md +15 -6
- package/build/index.js +1 -1
- package/lib/liberion-auth.js +1 -0
- package/package.json +12 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],e):"object"==typeof exports?exports.LiberionAuth=e(require("react"),require("react-dom")):t.LiberionAuth=e(t.React,t.ReactDOM)}(this,(t,e)=>(()=>{var n={156(e){"use strict";e.exports=t},162(t){t.exports=function(t,e,n,r){var i=n?n.call(r,t,e):void 0;if(void 0!==i)return!!i;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var o=Object.keys(t),s=Object.keys(e);if(o.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(e),c=0;c<o.length;c++){var l=o[c];if(!a(l))return!1;var u=t[l],h=e[l];if(!1===(i=n?n.call(r,u,h,l):void 0)||void 0===i&&u!==h)return!1}return!0}},318(t){"use strict";t.exports=e},357(t,e){"use strict";var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(t,e,r){var i=null;if(void 0!==r&&(i=""+r),void 0!==e.key&&(i=""+e.key),"key"in e)for(var o in r={},e)"key"!==o&&(r[o]=e[o]);else r=e;return e=r.ref,{$$typeof:n,type:t,key:i,ref:void 0!==e?e:null,props:r}}e.Fragment=r,e.jsx=i,e.jsxs=i},400(t){var e;e=()=>(()=>{var t={873:(t,e)=>{var n,r,i=function(){var t=function(t,e){var n=t,r=s[e],i=null,o=0,c=null,m=[],y={},b=function(t,e){i=function(t){for(var e=new Array(t),n=0;n<t;n+=1){e[n]=new Array(t);for(var r=0;r<t;r+=1)e[n][r]=null}return e}(o=4*n+17),w(0,0),w(o-7,0),w(0,o-7),S(),x(),k(t,e),n>=7&&_(t),null==c&&(c=C(n,r,m)),O(c,e)},w=function(t,e){for(var n=-1;n<=7;n+=1)if(!(t+n<=-1||o<=t+n))for(var r=-1;r<=7;r+=1)e+r<=-1||o<=e+r||(i[t+n][e+r]=0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4)},x=function(){for(var t=8;t<o-8;t+=1)null==i[t][6]&&(i[t][6]=t%2==0);for(var e=8;e<o-8;e+=1)null==i[6][e]&&(i[6][e]=e%2==0)},S=function(){for(var t=a.getPatternPosition(n),e=0;e<t.length;e+=1)for(var r=0;r<t.length;r+=1){var o=t[e],s=t[r];if(null==i[o][s])for(var c=-2;c<=2;c+=1)for(var l=-2;l<=2;l+=1)i[o+c][s+l]=-2==c||2==c||-2==l||2==l||0==c&&0==l}},_=function(t){for(var e=a.getBCHTypeNumber(n),r=0;r<18;r+=1){var s=!t&&1==(e>>r&1);i[Math.floor(r/3)][r%3+o-8-3]=s}for(r=0;r<18;r+=1)s=!t&&1==(e>>r&1),i[r%3+o-8-3][Math.floor(r/3)]=s},k=function(t,e){for(var n=r<<3|e,s=a.getBCHTypeInfo(n),c=0;c<15;c+=1){var l=!t&&1==(s>>c&1);c<6?i[c][8]=l:c<8?i[c+1][8]=l:i[o-15+c][8]=l}for(c=0;c<15;c+=1)l=!t&&1==(s>>c&1),c<8?i[8][o-c-1]=l:c<9?i[8][15-c-1+1]=l:i[8][15-c-1]=l;i[o-8][8]=!t},O=function(t,e){for(var n=-1,r=o-1,s=7,c=0,l=a.getMaskFunction(e),u=o-1;u>0;u-=2)for(6==u&&(u-=1);;){for(var h=0;h<2;h+=1)if(null==i[r][u-h]){var d=!1;c<t.length&&(d=1==(t[c]>>>s&1)),l(r,u-h)&&(d=!d),i[r][u-h]=d,-1==(s-=1)&&(c+=1,s=7)}if((r+=n)<0||o<=r){r-=n,n=-n;break}}},C=function(t,e,n){for(var r=u.getRSBlocks(t,e),i=h(),o=0;o<n.length;o+=1){var s=n[o];i.put(s.getMode(),4),i.put(s.getLength(),a.getLengthInBits(s.getMode(),t)),s.write(i)}var c=0;for(o=0;o<r.length;o+=1)c+=r[o].dataCount;if(i.getLengthInBits()>8*c)throw"code length overflow. ("+i.getLengthInBits()+">"+8*c+")";for(i.getLengthInBits()+4<=8*c&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=8*c||(i.put(236,8),i.getLengthInBits()>=8*c));)i.put(17,8);return function(t,e){for(var n=0,r=0,i=0,o=new Array(e.length),s=new Array(e.length),c=0;c<e.length;c+=1){var u=e[c].dataCount,h=e[c].totalCount-u;r=Math.max(r,u),i=Math.max(i,h),o[c]=new Array(u);for(var d=0;d<o[c].length;d+=1)o[c][d]=255&t.getBuffer()[d+n];n+=u;var p=a.getErrorCorrectPolynomial(h),f=l(o[c],p.getLength()-1).mod(p);for(s[c]=new Array(p.getLength()-1),d=0;d<s[c].length;d+=1){var g=d+f.getLength()-s[c].length;s[c][d]=g>=0?f.getAt(g):0}}var m=0;for(d=0;d<e.length;d+=1)m+=e[d].totalCount;var y=new Array(m),v=0;for(d=0;d<r;d+=1)for(c=0;c<e.length;c+=1)d<o[c].length&&(y[v]=o[c][d],v+=1);for(d=0;d<i;d+=1)for(c=0;c<e.length;c+=1)d<s[c].length&&(y[v]=s[c][d],v+=1);return y}(i,r)};y.addData=function(t,e){var n=null;switch(e=e||"Byte"){case"Numeric":n=d(t);break;case"Alphanumeric":n=p(t);break;case"Byte":n=f(t);break;case"Kanji":n=g(t);break;default:throw"mode:"+e}m.push(n),c=null},y.isDark=function(t,e){if(t<0||o<=t||e<0||o<=e)throw t+","+e;return i[t][e]},y.getModuleCount=function(){return o},y.make=function(){if(n<1){for(var t=1;t<40;t++){for(var e=u.getRSBlocks(t,r),i=h(),o=0;o<m.length;o++){var s=m[o];i.put(s.getMode(),4),i.put(s.getLength(),a.getLengthInBits(s.getMode(),t)),s.write(i)}var c=0;for(o=0;o<e.length;o++)c+=e[o].dataCount;if(i.getLengthInBits()<=8*c)break}n=t}b(!1,function(){for(var t=0,e=0,n=0;n<8;n+=1){b(!0,n);var r=a.getLostPoint(y);(0==n||t>r)&&(t=r,e=n)}return e}())},y.createTableTag=function(t,e){t=t||2;var n="";n+='<table style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: "+(e=void 0===e?4*t:e)+"px;",n+='">',n+="<tbody>";for(var r=0;r<y.getModuleCount();r+=1){n+="<tr>";for(var i=0;i<y.getModuleCount();i+=1)n+='<td style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: 0px;",n+=" width: "+t+"px;",n+=" height: "+t+"px;",n+=" background-color: ",n+=y.isDark(r,i)?"#000000":"#ffffff",n+=";",n+='"/>';n+="</tr>"}return(n+="</tbody>")+"</table>"},y.createSvgTag=function(t,e,n,r){var i={};"object"==typeof arguments[0]&&(t=(i=arguments[0]).cellSize,e=i.margin,n=i.alt,r=i.title),t=t||2,e=void 0===e?4*t:e,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-description":null,(r="string"==typeof r?{text:r}:r||{}).text=r.text||null,r.id=r.text?r.id||"qrcode-title":null;var o,s,a,c,l=y.getModuleCount()*t+2*e,u="";for(c="l"+t+",0 0,"+t+" -"+t+",0 0,-"+t+"z ",u+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',u+=i.scalable?"":' width="'+l+'px" height="'+l+'px"',u+=' viewBox="0 0 '+l+" "+l+'" ',u+=' preserveAspectRatio="xMinYMin meet"',u+=r.text||n.text?' role="img" aria-labelledby="'+j([r.id,n.id].join(" ").trim())+'"':"",u+=">",u+=r.text?'<title id="'+j(r.id)+'">'+j(r.text)+"</title>":"",u+=n.text?'<description id="'+j(n.id)+'">'+j(n.text)+"</description>":"",u+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',u+='<path d="',s=0;s<y.getModuleCount();s+=1)for(a=s*t+e,o=0;o<y.getModuleCount();o+=1)y.isDark(s,o)&&(u+="M"+(o*t+e)+","+a+c);return(u+='" stroke="transparent" fill="black"/>')+"</svg>"},y.createDataURL=function(t,e){t=t||2,e=void 0===e?4*t:e;var n=y.getModuleCount()*t+2*e,r=e,i=n-e;return v(n,n,function(e,n){if(r<=e&&e<i&&r<=n&&n<i){var o=Math.floor((e-r)/t),s=Math.floor((n-r)/t);return y.isDark(s,o)?0:1}return 1})},y.createImgTag=function(t,e,n){t=t||2,e=void 0===e?4*t:e;var r=y.getModuleCount()*t+2*e,i="";return i+="<img",i+=' src="',i+=y.createDataURL(t,e),i+='"',i+=' width="',i+=r,i+='"',i+=' height="',i+=r,i+='"',n&&(i+=' alt="',i+=j(n),i+='"'),i+"/>"};var j=function(t){for(var e="",n=0;n<t.length;n+=1){var r=t.charAt(n);switch(r){case"<":e+="<";break;case">":e+=">";break;case"&":e+="&";break;case'"':e+=""";break;default:e+=r}}return e};return y.createASCII=function(t,e){if((t=t||1)<2)return function(t){t=void 0===t?2:t;var e,n,r,i,o,s=1*y.getModuleCount()+2*t,a=t,c=s-t,l={"██":"█","█ ":"▀"," █":"▄"," ":" "},u={"██":"▀","█ ":"▀"," █":" "," ":" "},h="";for(e=0;e<s;e+=2){for(r=Math.floor((e-a)/1),i=Math.floor((e+1-a)/1),n=0;n<s;n+=1)o="█",a<=n&&n<c&&a<=e&&e<c&&y.isDark(r,Math.floor((n-a)/1))&&(o=" "),a<=n&&n<c&&a<=e+1&&e+1<c&&y.isDark(i,Math.floor((n-a)/1))?o+=" ":o+="█",h+=t<1&&e+1>=c?u[o]:l[o];h+="\n"}return s%2&&t>0?h.substring(0,h.length-s-1)+Array(s+1).join("▀"):h.substring(0,h.length-1)}(e);t-=1,e=void 0===e?2*t:e;var n,r,i,o,s=y.getModuleCount()*t+2*e,a=e,c=s-e,l=Array(t+1).join("██"),u=Array(t+1).join(" "),h="",d="";for(n=0;n<s;n+=1){for(i=Math.floor((n-a)/t),d="",r=0;r<s;r+=1)o=1,a<=r&&r<c&&a<=n&&n<c&&y.isDark(i,Math.floor((r-a)/t))&&(o=0),d+=o?l:u;for(i=0;i<t;i+=1)h+=d+"\n"}return h.substring(0,h.length-1)},y.renderTo2dContext=function(t,e){e=e||2;for(var n=y.getModuleCount(),r=0;r<n;r++)for(var i=0;i<n;i++)t.fillStyle=y.isDark(r,i)?"black":"white",t.fillRect(r*e,i*e,e,e)},y};t.stringToBytes=(t.stringToBytesFuncs={default:function(t){for(var e=[],n=0;n<t.length;n+=1){var r=t.charCodeAt(n);e.push(255&r)}return e}}).default,t.createStringToBytes=function(t,e){var n=function(){for(var n=y(t),r=function(){var t=n.read();if(-1==t)throw"eof";return t},i=0,o={};;){var s=n.read();if(-1==s)break;var a=r(),c=r()<<8|r();o[String.fromCharCode(s<<8|a)]=c,i+=1}if(i!=e)throw i+" != "+e;return o}(),r="?".charCodeAt(0);return function(t){for(var e=[],i=0;i<t.length;i+=1){var o=t.charCodeAt(i);if(o<128)e.push(o);else{var s=n[t.charAt(i)];"number"==typeof s?(255&s)==s?e.push(s):(e.push(s>>>8),e.push(255&s)):e.push(r)}}return e}};var e,n,r,i,o,s={L:1,M:0,Q:3,H:2},a=(e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,r=7973,o=function(t){for(var e=0;0!=t;)e+=1,t>>>=1;return e},(i={}).getBCHTypeInfo=function(t){for(var e=t<<10;o(e)-o(n)>=0;)e^=n<<o(e)-o(n);return 21522^(t<<10|e)},i.getBCHTypeNumber=function(t){for(var e=t<<12;o(e)-o(r)>=0;)e^=r<<o(e)-o(r);return t<<12|e},i.getPatternPosition=function(t){return e[t-1]},i.getMaskFunction=function(t){switch(t){case 0:return function(t,e){return(t+e)%2==0};case 1:return function(t,e){return t%2==0};case 2:return function(t,e){return e%3==0};case 3:return function(t,e){return(t+e)%3==0};case 4:return function(t,e){return(Math.floor(t/2)+Math.floor(e/3))%2==0};case 5:return function(t,e){return t*e%2+t*e%3==0};case 6:return function(t,e){return(t*e%2+t*e%3)%2==0};case 7:return function(t,e){return(t*e%3+(t+e)%2)%2==0};default:throw"bad maskPattern:"+t}},i.getErrorCorrectPolynomial=function(t){for(var e=l([1],0),n=0;n<t;n+=1)e=e.multiply(l([1,c.gexp(n)],0));return e},i.getLengthInBits=function(t,e){if(1<=e&&e<10)switch(t){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+t}else if(e<27)switch(t){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+t}else{if(!(e<41))throw"type:"+e;switch(t){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+t}}},i.getLostPoint=function(t){for(var e=t.getModuleCount(),n=0,r=0;r<e;r+=1)for(var i=0;i<e;i+=1){for(var o=0,s=t.isDark(r,i),a=-1;a<=1;a+=1)if(!(r+a<0||e<=r+a))for(var c=-1;c<=1;c+=1)i+c<0||e<=i+c||0==a&&0==c||s==t.isDark(r+a,i+c)&&(o+=1);o>5&&(n+=3+o-5)}for(r=0;r<e-1;r+=1)for(i=0;i<e-1;i+=1){var l=0;t.isDark(r,i)&&(l+=1),t.isDark(r+1,i)&&(l+=1),t.isDark(r,i+1)&&(l+=1),t.isDark(r+1,i+1)&&(l+=1),0!=l&&4!=l||(n+=3)}for(r=0;r<e;r+=1)for(i=0;i<e-6;i+=1)t.isDark(r,i)&&!t.isDark(r,i+1)&&t.isDark(r,i+2)&&t.isDark(r,i+3)&&t.isDark(r,i+4)&&!t.isDark(r,i+5)&&t.isDark(r,i+6)&&(n+=40);for(i=0;i<e;i+=1)for(r=0;r<e-6;r+=1)t.isDark(r,i)&&!t.isDark(r+1,i)&&t.isDark(r+2,i)&&t.isDark(r+3,i)&&t.isDark(r+4,i)&&!t.isDark(r+5,i)&&t.isDark(r+6,i)&&(n+=40);var u=0;for(i=0;i<e;i+=1)for(r=0;r<e;r+=1)t.isDark(r,i)&&(u+=1);return n+Math.abs(100*u/e/e-50)/5*10},i),c=function(){for(var t=new Array(256),e=new Array(256),n=0;n<8;n+=1)t[n]=1<<n;for(n=8;n<256;n+=1)t[n]=t[n-4]^t[n-5]^t[n-6]^t[n-8];for(n=0;n<255;n+=1)e[t[n]]=n;return{glog:function(t){if(t<1)throw"glog("+t+")";return e[t]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return t[e]}}}();function l(t,e){if(void 0===t.length)throw t.length+"/"+e;var n=function(){for(var n=0;n<t.length&&0==t[n];)n+=1;for(var r=new Array(t.length-n+e),i=0;i<t.length-n;i+=1)r[i]=t[i+n];return r}(),r={getAt:function(t){return n[t]},getLength:function(){return n.length},multiply:function(t){for(var e=new Array(r.getLength()+t.getLength()-1),n=0;n<r.getLength();n+=1)for(var i=0;i<t.getLength();i+=1)e[n+i]^=c.gexp(c.glog(r.getAt(n))+c.glog(t.getAt(i)));return l(e,0)},mod:function(t){if(r.getLength()-t.getLength()<0)return r;for(var e=c.glog(r.getAt(0))-c.glog(t.getAt(0)),n=new Array(r.getLength()),i=0;i<r.getLength();i+=1)n[i]=r.getAt(i);for(i=0;i<t.getLength();i+=1)n[i]^=c.gexp(c.glog(t.getAt(i))+e);return l(n,0).mod(t)}};return r}var u=function(){var t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e=function(t,e){var n={};return n.totalCount=t,n.dataCount=e,n},n={getRSBlocks:function(n,r){var i=function(e,n){switch(n){case s.L:return t[4*(e-1)+0];case s.M:return t[4*(e-1)+1];case s.Q:return t[4*(e-1)+2];case s.H:return t[4*(e-1)+3];default:return}}(n,r);if(void 0===i)throw"bad rs block @ typeNumber:"+n+"/errorCorrectionLevel:"+r;for(var o=i.length/3,a=[],c=0;c<o;c+=1)for(var l=i[3*c+0],u=i[3*c+1],h=i[3*c+2],d=0;d<l;d+=1)a.push(e(u,h));return a}};return n}(),h=function(){var t=[],e=0,n={getBuffer:function(){return t},getAt:function(e){var n=Math.floor(e/8);return 1==(t[n]>>>7-e%8&1)},put:function(t,e){for(var r=0;r<e;r+=1)n.putBit(1==(t>>>e-r-1&1))},getLengthInBits:function(){return e},putBit:function(n){var r=Math.floor(e/8);t.length<=r&&t.push(0),n&&(t[r]|=128>>>e%8),e+=1}};return n},d=function(t){var e=t,n={getMode:function(){return 1},getLength:function(t){return e.length},write:function(t){for(var n=e,i=0;i+2<n.length;)t.put(r(n.substring(i,i+3)),10),i+=3;i<n.length&&(n.length-i==1?t.put(r(n.substring(i,i+1)),4):n.length-i==2&&t.put(r(n.substring(i,i+2)),7))}},r=function(t){for(var e=0,n=0;n<t.length;n+=1)e=10*e+i(t.charAt(n));return e},i=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+t};return n},p=function(t){var e=t,n={getMode:function(){return 2},getLength:function(t){return e.length},write:function(t){for(var n=e,i=0;i+1<n.length;)t.put(45*r(n.charAt(i))+r(n.charAt(i+1)),11),i+=2;i<n.length&&t.put(r(n.charAt(i)),6)}},r=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);if("A"<=t&&t<="Z")return t.charCodeAt(0)-"A".charCodeAt(0)+10;switch(t){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+t}};return n},f=function(e){var n=t.stringToBytes(e);return{getMode:function(){return 4},getLength:function(t){return n.length},write:function(t){for(var e=0;e<n.length;e+=1)t.put(n[e],8)}}},g=function(e){var n=t.stringToBytesFuncs.SJIS;if(!n)throw"sjis not supported.";!function(){var t=n("友");if(2!=t.length||38726!=(t[0]<<8|t[1]))throw"sjis not supported."}();var r=n(e),i={getMode:function(){return 8},getLength:function(t){return~~(r.length/2)},write:function(t){for(var e=r,n=0;n+1<e.length;){var i=(255&e[n])<<8|255&e[n+1];if(33088<=i&&i<=40956)i-=33088;else{if(!(57408<=i&&i<=60351))throw"illegal char at "+(n+1)+"/"+i;i-=49472}i=192*(i>>>8&255)+(255&i),t.put(i,13),n+=2}if(n<e.length)throw"illegal char at "+(n+1)}};return i},m=function(){var t=[],e={writeByte:function(e){t.push(255&e)},writeShort:function(t){e.writeByte(t),e.writeByte(t>>>8)},writeBytes:function(t,n,r){n=n||0,r=r||t.length;for(var i=0;i<r;i+=1)e.writeByte(t[i+n])},writeString:function(t){for(var n=0;n<t.length;n+=1)e.writeByte(t.charCodeAt(n))},toByteArray:function(){return t},toString:function(){var e="";e+="[";for(var n=0;n<t.length;n+=1)n>0&&(e+=","),e+=t[n];return e+"]"}};return e},y=function(t){var e=t,n=0,r=0,i=0,o={read:function(){for(;i<8;){if(n>=e.length){if(0==i)return-1;throw"unexpected end of file./"+i}var t=e.charAt(n);if(n+=1,"="==t)return i=0,-1;t.match(/^\s$/)||(r=r<<6|s(t.charCodeAt(0)),i+=6)}var o=r>>>i-8&255;return i-=8,o}},s=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(43==t)return 62;if(47==t)return 63;throw"c:"+t};return o},v=function(t,e,n){for(var r=function(t,e){var n=t,r=e,i=new Array(t*e),o={setPixel:function(t,e,r){i[e*n+t]=r},write:function(t){t.writeString("GIF87a"),t.writeShort(n),t.writeShort(r),t.writeByte(128),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(255),t.writeByte(255),t.writeByte(255),t.writeString(","),t.writeShort(0),t.writeShort(0),t.writeShort(n),t.writeShort(r),t.writeByte(0);var e=s(2);t.writeByte(2);for(var i=0;e.length-i>255;)t.writeByte(255),t.writeBytes(e,i,255),i+=255;t.writeByte(e.length-i),t.writeBytes(e,i,e.length-i),t.writeByte(0),t.writeString(";")}},s=function(t){for(var e=1<<t,n=1+(1<<t),r=t+1,o=a(),s=0;s<e;s+=1)o.add(String.fromCharCode(s));o.add(String.fromCharCode(e)),o.add(String.fromCharCode(n));var c,l,u,h=m(),d=(c=h,l=0,u=0,{write:function(t,e){if(t>>>e!=0)throw"length over";for(;l+e>=8;)c.writeByte(255&(t<<l|u)),e-=8-l,t>>>=8-l,u=0,l=0;u|=t<<l,l+=e},flush:function(){l>0&&c.writeByte(u)}});d.write(e,r);var p=0,f=String.fromCharCode(i[p]);for(p+=1;p<i.length;){var g=String.fromCharCode(i[p]);p+=1,o.contains(f+g)?f+=g:(d.write(o.indexOf(f),r),o.size()<4095&&(o.size()==1<<r&&(r+=1),o.add(f+g)),f=g)}return d.write(o.indexOf(f),r),d.write(n,r),d.flush(),h.toByteArray()},a=function(){var t={},e=0,n={add:function(r){if(n.contains(r))throw"dup key:"+r;t[r]=e,e+=1},size:function(){return e},indexOf:function(e){return t[e]},contains:function(e){return void 0!==t[e]}};return n};return o}(t,e),i=0;i<e;i+=1)for(var o=0;o<t;o+=1)r.setPixel(o,i,n(o,i));var s=m();r.write(s);for(var a=function(){var t=0,e=0,n=0,r="",i={},o=function(t){r+=String.fromCharCode(s(63&t))},s=function(t){if(t<0);else{if(t<26)return 65+t;if(t<52)return t-26+97;if(t<62)return t-52+48;if(62==t)return 43;if(63==t)return 47}throw"n:"+t};return i.writeByte=function(r){for(t=t<<8|255&r,e+=8,n+=1;e>=6;)o(t>>>e-6),e-=6},i.flush=function(){if(e>0&&(o(t<<6-e),t=0,e=0),n%3!=0)for(var i=3-n%3,s=0;s<i;s+=1)r+="="},i.toString=function(){return r},i}(),c=s.toByteArray(),l=0;l<c.length;l+=1)a.writeByte(c[l]);return a.flush(),"data:image/gif;base64,"+a};return t}();i.stringToBytesFuncs["UTF-8"]=function(t){return function(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);r<128?e.push(r):r<2048?e.push(192|r>>6,128|63&r):r<55296||r>=57344?e.push(224|r>>12,128|r>>6&63,128|63&r):(n++,r=65536+((1023&r)<<10|1023&t.charCodeAt(n)),e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return e}(t)},void 0===(r="function"==typeof(n=function(){return i})?n.apply(e,[]):n)||(t.exports=r)}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var r={};return(()=>{"use strict";n.d(r,{default:()=>j});const t=t=>!!t&&"object"==typeof t&&!Array.isArray(t);function e(n,...r){if(!r.length)return n;const i=r.shift();return void 0!==i&&t(n)&&t(i)?(n=Object.assign({},n),Object.keys(i).forEach(r=>{const o=n[r],s=i[r];Array.isArray(o)&&Array.isArray(s)?n[r]=s:t(o)&&t(s)?n[r]=e(Object.assign({},o),s):n[r]=s}),e(n,...r)):n}function i(t,e){const n=document.createElement("a");n.download=e,n.href=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}const o={L:.07,M:.15,Q:.25,H:.3};class s{constructor({svg:t,type:e,window:n}){this._svg=t,this._type=e,this._window=n}draw(t,e,n,r){let i;switch(this._type){case"dots":i=this._drawDot;break;case"classy":i=this._drawClassy;break;case"classy-rounded":i=this._drawClassyRounded;break;case"rounded":i=this._drawRounded;break;case"extra-rounded":i=this._drawExtraRounded;break;default:i=this._drawSquare}i.call(this,{x:t,y:e,size:n,getNeighbor:r})}_rotateFigure({x:t,y:e,size:n,rotation:r=0,draw:i}){var o;const s=t+n/2,a=e+n/2;i(),null===(o=this._element)||void 0===o||o.setAttribute("transform",`rotate(${180*r/Math.PI},${s},${a})`)}_basicDot(t){const{size:e,x:n,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(n+e/2)),this._element.setAttribute("cy",String(r+e/2)),this._element.setAttribute("r",String(e/2))}}))}_basicSquare(t){const{size:e,x:n,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(n)),this._element.setAttribute("y",String(r)),this._element.setAttribute("width",String(e)),this._element.setAttribute("height",String(e))}}))}_basicSideRounded(t){const{size:e,x:n,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${n} ${r}v ${e}h `+e/2+`a ${e/2} ${e/2}, 0, 0, 0, 0 ${-e}`)}}))}_basicCornerRounded(t){const{size:e,x:n,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${n} ${r}v ${e}h ${e}v `+-e/2+`a ${e/2} ${e/2}, 0, 0, 0, ${-e/2} ${-e/2}`)}}))}_basicCornerExtraRounded(t){const{size:e,x:n,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${n} ${r}v ${e}h ${e}a ${e} ${e}, 0, 0, 0, ${-e} ${-e}`)}}))}_basicCornersRounded(t){const{size:e,x:n,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("d",`M ${n} ${r}v `+e/2+`a ${e/2} ${e/2}, 0, 0, 0, ${e/2} ${e/2}h `+e/2+"v "+-e/2+`a ${e/2} ${e/2}, 0, 0, 0, ${-e/2} ${-e/2}`)}}))}_drawDot({x:t,y:e,size:n}){this._basicDot({x:t,y:e,size:n,rotation:0})}_drawSquare({x:t,y:e,size:n}){this._basicSquare({x:t,y:e,size:n,rotation:0})}_drawRounded({x:t,y:e,size:n,getNeighbor:r}){const i=r?+r(-1,0):0,o=r?+r(1,0):0,s=r?+r(0,-1):0,a=r?+r(0,1):0,c=i+o+s+a;if(0!==c)if(c>2||i&&o||s&&a)this._basicSquare({x:t,y:e,size:n,rotation:0});else{if(2===c){let r=0;return i&&s?r=Math.PI/2:s&&o?r=Math.PI:o&&a&&(r=-Math.PI/2),void this._basicCornerRounded({x:t,y:e,size:n,rotation:r})}if(1===c){let r=0;return s?r=Math.PI/2:o?r=Math.PI:a&&(r=-Math.PI/2),void this._basicSideRounded({x:t,y:e,size:n,rotation:r})}}else this._basicDot({x:t,y:e,size:n,rotation:0})}_drawExtraRounded({x:t,y:e,size:n,getNeighbor:r}){const i=r?+r(-1,0):0,o=r?+r(1,0):0,s=r?+r(0,-1):0,a=r?+r(0,1):0,c=i+o+s+a;if(0!==c)if(c>2||i&&o||s&&a)this._basicSquare({x:t,y:e,size:n,rotation:0});else{if(2===c){let r=0;return i&&s?r=Math.PI/2:s&&o?r=Math.PI:o&&a&&(r=-Math.PI/2),void this._basicCornerExtraRounded({x:t,y:e,size:n,rotation:r})}if(1===c){let r=0;return s?r=Math.PI/2:o?r=Math.PI:a&&(r=-Math.PI/2),void this._basicSideRounded({x:t,y:e,size:n,rotation:r})}}else this._basicDot({x:t,y:e,size:n,rotation:0})}_drawClassy({x:t,y:e,size:n,getNeighbor:r}){const i=r?+r(-1,0):0,o=r?+r(1,0):0,s=r?+r(0,-1):0,a=r?+r(0,1):0;0!==i+o+s+a?i||s?o||a?this._basicSquare({x:t,y:e,size:n,rotation:0}):this._basicCornerRounded({x:t,y:e,size:n,rotation:Math.PI/2}):this._basicCornerRounded({x:t,y:e,size:n,rotation:-Math.PI/2}):this._basicCornersRounded({x:t,y:e,size:n,rotation:Math.PI/2})}_drawClassyRounded({x:t,y:e,size:n,getNeighbor:r}){const i=r?+r(-1,0):0,o=r?+r(1,0):0,s=r?+r(0,-1):0,a=r?+r(0,1):0;0!==i+o+s+a?i||s?o||a?this._basicSquare({x:t,y:e,size:n,rotation:0}):this._basicCornerExtraRounded({x:t,y:e,size:n,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:t,y:e,size:n,rotation:-Math.PI/2}):this._basicCornersRounded({x:t,y:e,size:n,rotation:Math.PI/2})}}const a={dot:"dot",square:"square",extraRounded:"extra-rounded"},c=Object.values(a);class l{constructor({svg:t,type:e,window:n}){this._svg=t,this._type=e,this._window=n}draw(t,e,n,r){let i;switch(this._type){case a.square:i=this._drawSquare;break;case a.extraRounded:i=this._drawExtraRounded;break;default:i=this._drawDot}i.call(this,{x:t,y:e,size:n,rotation:r})}_rotateFigure({x:t,y:e,size:n,rotation:r=0,draw:i}){var o;const s=t+n/2,a=e+n/2;i(),null===(o=this._element)||void 0===o||o.setAttribute("transform",`rotate(${180*r/Math.PI},${s},${a})`)}_basicDot(t){const{size:e,x:n,y:r}=t,i=e/7;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${n+e/2} ${r}a ${e/2} ${e/2} 0 1 0 0.1 0zm 0 ${i}a ${e/2-i} ${e/2-i} 0 1 1 -0.1 0Z`)}}))}_basicSquare(t){const{size:e,x:n,y:r}=t,i=e/7;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${n} ${r}v ${e}h ${e}v `+-e+"z"+`M ${n+i} ${r+i}h `+(e-2*i)+"v "+(e-2*i)+"h "+(2*i-e)+"z")}}))}_basicExtraRounded(t){const{size:e,x:n,y:r}=t,i=e/7;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","path"),this._element.setAttribute("clip-rule","evenodd"),this._element.setAttribute("d",`M ${n} ${r+2.5*i}v `+2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*i} ${2.5*i}h `+2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*i} ${2.5*-i}v `+-2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*-i} ${2.5*-i}h `+-2*i+`a ${2.5*i} ${2.5*i}, 0, 0, 0, ${2.5*-i} ${2.5*i}`+`M ${n+2.5*i} ${r+i}h `+2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*i} ${1.5*i}v `+2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*-i} ${1.5*i}h `+-2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*-i} ${1.5*-i}v `+-2*i+`a ${1.5*i} ${1.5*i}, 0, 0, 1, ${1.5*i} ${1.5*-i}`)}}))}_drawDot({x:t,y:e,size:n,rotation:r}){this._basicDot({x:t,y:e,size:n,rotation:r})}_drawSquare({x:t,y:e,size:n,rotation:r}){this._basicSquare({x:t,y:e,size:n,rotation:r})}_drawExtraRounded({x:t,y:e,size:n,rotation:r}){this._basicExtraRounded({x:t,y:e,size:n,rotation:r})}}const u={dot:"dot",square:"square"},h=Object.values(u);class d{constructor({svg:t,type:e,window:n}){this._svg=t,this._type=e,this._window=n}draw(t,e,n,r){let i;i=this._type===u.square?this._drawSquare:this._drawDot,i.call(this,{x:t,y:e,size:n,rotation:r})}_rotateFigure({x:t,y:e,size:n,rotation:r=0,draw:i}){var o;const s=t+n/2,a=e+n/2;i(),null===(o=this._element)||void 0===o||o.setAttribute("transform",`rotate(${180*r/Math.PI},${s},${a})`)}_basicDot(t){const{size:e,x:n,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","circle"),this._element.setAttribute("cx",String(n+e/2)),this._element.setAttribute("cy",String(r+e/2)),this._element.setAttribute("r",String(e/2))}}))}_basicSquare(t){const{size:e,x:n,y:r}=t;this._rotateFigure(Object.assign(Object.assign({},t),{draw:()=>{this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect"),this._element.setAttribute("x",String(n)),this._element.setAttribute("y",String(r)),this._element.setAttribute("width",String(e)),this._element.setAttribute("height",String(e))}}))}_drawDot({x:t,y:e,size:n,rotation:r}){this._basicDot({x:t,y:e,size:n,rotation:r})}_drawSquare({x:t,y:e,size:n,rotation:r}){this._basicSquare({x:t,y:e,size:n,rotation:r})}}const p="circle",f=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],g=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];class m{constructor(t,e){this._roundSize=t=>this._options.dotsOptions.roundSize?Math.floor(t):t,this._window=e,this._element=this._window.document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(t.width)),this._element.setAttribute("height",String(t.height)),this._element.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),t.dotsOptions.roundSize||this._element.setAttribute("shape-rendering","crispEdges"),this._element.setAttribute("viewBox",`0 0 ${t.width} ${t.height}`),this._defs=this._window.document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._imageUri=t.image,this._instanceId=m.instanceCount++,this._options=t}get width(){return this._options.width}get height(){return this._options.height}getElement(){return this._element}async drawQR(t){const e=t.getModuleCount(),n=Math.min(this._options.width,this._options.height)-2*this._options.margin,r=this._options.shape===p?n/Math.sqrt(2):n,i=this._roundSize(r/e);let s={hideXDots:0,hideYDots:0,width:0,height:0};if(this._qr=t,this._options.image){if(await this.loadImage(),!this._image)return;const{imageOptions:t,qrOptions:n}=this._options,r=t.imageSize*o[n.errorCorrectionLevel],a=Math.floor(r*e*e);s=function({originalHeight:t,originalWidth:e,maxHiddenDots:n,maxHiddenAxisDots:r,dotSize:i}){const o={x:0,y:0},s={x:0,y:0};if(t<=0||e<=0||n<=0||i<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};const a=t/e;return o.x=Math.floor(Math.sqrt(n/a)),o.x<=0&&(o.x=1),r&&r<o.x&&(o.x=r),o.x%2==0&&o.x--,s.x=o.x*i,o.y=1+2*Math.ceil((o.x*a-1)/2),s.y=Math.round(s.x*a),(o.y*o.x>n||r&&r<o.y)&&(r&&r<o.y?(o.y=r,o.y%2==0&&o.x--):o.y-=2,s.y=o.y*i,o.x=1+2*Math.ceil((o.y/a-1)/2),s.x=Math.round(s.y/a)),{height:s.y,width:s.x,hideYDots:o.y,hideXDots:o.x}}({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:a,maxHiddenAxisDots:e-14,dotSize:i})}this.drawBackground(),this.drawDots((t,n)=>{var r,i,o,a,c,l;return!(this._options.imageOptions.hideBackgroundDots&&t>=(e-s.hideYDots)/2&&t<(e+s.hideYDots)/2&&n>=(e-s.hideXDots)/2&&n<(e+s.hideXDots)/2||(null===(r=f[t])||void 0===r?void 0:r[n])||(null===(i=f[t-e+7])||void 0===i?void 0:i[n])||(null===(o=f[t])||void 0===o?void 0:o[n-e+7])||(null===(a=g[t])||void 0===a?void 0:a[n])||(null===(c=g[t-e+7])||void 0===c?void 0:c[n])||(null===(l=g[t])||void 0===l?void 0:l[n-e+7]))}),this.drawCorners(),this._options.image&&await this.drawImage({width:s.width,height:s.height,count:e,dotSize:i})}drawBackground(){var t,e,n;const r=this._element,i=this._options;if(r){const r=null===(t=i.backgroundOptions)||void 0===t?void 0:t.gradient,o=null===(e=i.backgroundOptions)||void 0===e?void 0:e.color;let s=i.height,a=i.width;if(r||o){const t=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id",`clip-path-background-color-${this._instanceId}`),this._defs.appendChild(this._backgroundClipPath),(null===(n=i.backgroundOptions)||void 0===n?void 0:n.round)&&(s=a=Math.min(i.width,i.height),t.setAttribute("rx",String(s/2*i.backgroundOptions.round))),t.setAttribute("x",String(this._roundSize((i.width-a)/2))),t.setAttribute("y",String(this._roundSize((i.height-s)/2))),t.setAttribute("width",String(a)),t.setAttribute("height",String(s)),this._backgroundClipPath.appendChild(t),this._createColor({options:r,color:o,additionalRotation:0,x:0,y:0,height:i.height,width:i.width,name:`background-color-${this._instanceId}`})}}}drawDots(t){var e,n;if(!this._qr)throw"QR code is not defined";const r=this._options,i=this._qr.getModuleCount();if(i>r.width||i>r.height)throw"The canvas is too small.";const o=Math.min(r.width,r.height)-2*r.margin,a=r.shape===p?o/Math.sqrt(2):o,c=this._roundSize(a/i),l=this._roundSize((r.width-i*c)/2),u=this._roundSize((r.height-i*c)/2),h=new s({svg:this._element,type:r.dotsOptions.type,window:this._window});this._dotsClipPath=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id",`clip-path-dot-color-${this._instanceId}`),this._defs.appendChild(this._dotsClipPath),this._createColor({options:null===(e=r.dotsOptions)||void 0===e?void 0:e.gradient,color:r.dotsOptions.color,additionalRotation:0,x:0,y:0,height:r.height,width:r.width,name:`dot-color-${this._instanceId}`});for(let s=0;s<i;s++)for(let e=0;e<i;e++)t&&!t(s,e)||(null===(n=this._qr)||void 0===n?void 0:n.isDark(s,e))&&(h.draw(l+e*c,u+s*c,c,(n,r)=>!(e+n<0||s+r<0||e+n>=i||s+r>=i)&&!(t&&!t(s+r,e+n))&&!!this._qr&&this._qr.isDark(s+r,e+n)),h._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(h._element));if(r.shape===p){const t=this._roundSize((o/c-i)/2),e=i+2*t,n=l-t*c,r=u-t*c,s=[],a=this._roundSize(e/2);for(let o=0;o<e;o++){s[o]=[];for(let n=0;n<e;n++)o>=t-1&&o<=e-t&&n>=t-1&&n<=e-t||Math.sqrt((o-a)*(o-a)+(n-a)*(n-a))>a?s[o][n]=0:s[o][n]=this._qr.isDark(n-2*t<0?n:n>=i?n-2*t:n-t,o-2*t<0?o:o>=i?o-2*t:o-t)?1:0}for(let i=0;i<e;i++)for(let t=0;t<e;t++)s[i][t]&&(h.draw(n+t*c,r+i*c,c,(e,n)=>{var r;return!!(null===(r=s[i+n])||void 0===r?void 0:r[t+e])}),h._element&&this._dotsClipPath&&this._dotsClipPath.appendChild(h._element))}}drawCorners(){if(!this._qr)throw"QR code is not defined";const t=this._element,e=this._options;if(!t)throw"Element code is not defined";const n=this._qr.getModuleCount(),r=Math.min(e.width,e.height)-2*e.margin,i=e.shape===p?r/Math.sqrt(2):r,o=this._roundSize(i/n),a=7*o,u=3*o,m=this._roundSize((e.width-n*o)/2),y=this._roundSize((e.height-n*o)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach(([t,r,i])=>{var p,v,b,w,x,S,_,k,O,C,j,A,P,$;const I=m+t*o*(n-7),E=y+r*o*(n-7);let L=this._dotsClipPath,M=this._dotsClipPath;if(((null===(p=e.cornersSquareOptions)||void 0===p?void 0:p.gradient)||(null===(v=e.cornersSquareOptions)||void 0===v?void 0:v.color))&&(L=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),L.setAttribute("id",`clip-path-corners-square-color-${t}-${r}-${this._instanceId}`),this._defs.appendChild(L),this._cornersSquareClipPath=this._cornersDotClipPath=M=L,this._createColor({options:null===(b=e.cornersSquareOptions)||void 0===b?void 0:b.gradient,color:null===(w=e.cornersSquareOptions)||void 0===w?void 0:w.color,additionalRotation:i,x:I,y:E,height:a,width:a,name:`corners-square-color-${t}-${r}-${this._instanceId}`})),(null===(x=e.cornersSquareOptions)||void 0===x?void 0:x.type)&&c.includes(e.cornersSquareOptions.type)){const t=new l({svg:this._element,type:e.cornersSquareOptions.type,window:this._window});t.draw(I,E,a,i),t._element&&L&&L.appendChild(t._element)}else{const t=new s({svg:this._element,type:(null===(S=e.cornersSquareOptions)||void 0===S?void 0:S.type)||e.dotsOptions.type,window:this._window});for(let e=0;e<f.length;e++)for(let n=0;n<f[e].length;n++)(null===(_=f[e])||void 0===_?void 0:_[n])&&(t.draw(I+n*o,E+e*o,o,(t,r)=>{var i;return!!(null===(i=f[e+r])||void 0===i?void 0:i[n+t])}),t._element&&L&&L.appendChild(t._element))}if(((null===(k=e.cornersDotOptions)||void 0===k?void 0:k.gradient)||(null===(O=e.cornersDotOptions)||void 0===O?void 0:O.color))&&(M=this._window.document.createElementNS("http://www.w3.org/2000/svg","clipPath"),M.setAttribute("id",`clip-path-corners-dot-color-${t}-${r}-${this._instanceId}`),this._defs.appendChild(M),this._cornersDotClipPath=M,this._createColor({options:null===(C=e.cornersDotOptions)||void 0===C?void 0:C.gradient,color:null===(j=e.cornersDotOptions)||void 0===j?void 0:j.color,additionalRotation:i,x:I+2*o,y:E+2*o,height:u,width:u,name:`corners-dot-color-${t}-${r}-${this._instanceId}`})),(null===(A=e.cornersDotOptions)||void 0===A?void 0:A.type)&&h.includes(e.cornersDotOptions.type)){const t=new d({svg:this._element,type:e.cornersDotOptions.type,window:this._window});t.draw(I+2*o,E+2*o,u,i),t._element&&M&&M.appendChild(t._element)}else{const t=new s({svg:this._element,type:(null===(P=e.cornersDotOptions)||void 0===P?void 0:P.type)||e.dotsOptions.type,window:this._window});for(let e=0;e<g.length;e++)for(let n=0;n<g[e].length;n++)(null===($=g[e])||void 0===$?void 0:$[n])&&(t.draw(I+n*o,E+e*o,o,(t,r)=>{var i;return!!(null===(i=g[e+r])||void 0===i?void 0:i[n+t])}),t._element&&M&&M.appendChild(t._element))}})}loadImage(){return new Promise((t,e)=>{var n;const r=this._options;if(!r.image)return e("Image is not defined");if(null===(n=r.nodeCanvas)||void 0===n?void 0:n.loadImage)r.nodeCanvas.loadImage(r.image).then(e=>{var n,i;if(this._image=e,this._options.imageOptions.saveAsBlob){const t=null===(n=r.nodeCanvas)||void 0===n?void 0:n.createCanvas(this._image.width,this._image.height);null===(i=null==t?void 0:t.getContext("2d"))||void 0===i||i.drawImage(e,0,0),this._imageUri=null==t?void 0:t.toDataURL()}t()}).catch(e);else{const e=new this._window.Image;"string"==typeof r.imageOptions.crossOrigin&&(e.crossOrigin=r.imageOptions.crossOrigin),this._image=e,e.onload=async()=>{this._options.imageOptions.saveAsBlob&&(this._imageUri=await async function(t,e){return new Promise(n=>{const r=new e.XMLHttpRequest;r.onload=function(){const t=new e.FileReader;t.onloadend=function(){n(t.result)},t.readAsDataURL(r.response)},r.open("GET",t),r.responseType="blob",r.send()})}(r.image||"",this._window)),t()},e.src=r.image}})}async drawImage({width:t,height:e,count:n,dotSize:r}){const i=this._options,o=this._roundSize((i.width-n*r)/2),s=this._roundSize((i.height-n*r)/2),a=o+this._roundSize(i.imageOptions.margin+(n*r-t)/2),c=s+this._roundSize(i.imageOptions.margin+(n*r-e)/2),l=t-2*i.imageOptions.margin,u=e-2*i.imageOptions.margin,h=this._window.document.createElementNS("http://www.w3.org/2000/svg","image");h.setAttribute("href",this._imageUri||""),h.setAttribute("xlink:href",this._imageUri||""),h.setAttribute("x",String(a)),h.setAttribute("y",String(c)),h.setAttribute("width",`${l}px`),h.setAttribute("height",`${u}px`),this._element.appendChild(h)}_createColor({options:t,color:e,additionalRotation:n,x:r,y:i,height:o,width:s,name:a}){const c=s>o?s:o,l=this._window.document.createElementNS("http://www.w3.org/2000/svg","rect");if(l.setAttribute("x",String(r)),l.setAttribute("y",String(i)),l.setAttribute("height",String(o)),l.setAttribute("width",String(s)),l.setAttribute("clip-path",`url('#clip-path-${a}')`),t){let e;if("radial"===t.type)e=this._window.document.createElementNS("http://www.w3.org/2000/svg","radialGradient"),e.setAttribute("id",a),e.setAttribute("gradientUnits","userSpaceOnUse"),e.setAttribute("fx",String(r+s/2)),e.setAttribute("fy",String(i+o/2)),e.setAttribute("cx",String(r+s/2)),e.setAttribute("cy",String(i+o/2)),e.setAttribute("r",String(c/2));else{const c=((t.rotation||0)+n)%(2*Math.PI),l=(c+2*Math.PI)%(2*Math.PI);let u=r+s/2,h=i+o/2,d=r+s/2,p=i+o/2;l>=0&&l<=.25*Math.PI||l>1.75*Math.PI&&l<=2*Math.PI?(u-=s/2,h-=o/2*Math.tan(c),d+=s/2,p+=o/2*Math.tan(c)):l>.25*Math.PI&&l<=.75*Math.PI?(h-=o/2,u-=s/2/Math.tan(c),p+=o/2,d+=s/2/Math.tan(c)):l>.75*Math.PI&&l<=1.25*Math.PI?(u+=s/2,h+=o/2*Math.tan(c),d-=s/2,p-=o/2*Math.tan(c)):l>1.25*Math.PI&&l<=1.75*Math.PI&&(h+=o/2,u+=s/2/Math.tan(c),p-=o/2,d-=s/2/Math.tan(c)),e=this._window.document.createElementNS("http://www.w3.org/2000/svg","linearGradient"),e.setAttribute("id",a),e.setAttribute("gradientUnits","userSpaceOnUse"),e.setAttribute("x1",String(Math.round(u))),e.setAttribute("y1",String(Math.round(h))),e.setAttribute("x2",String(Math.round(d))),e.setAttribute("y2",String(Math.round(p)))}t.colorStops.forEach(({offset:t,color:n})=>{const r=this._window.document.createElementNS("http://www.w3.org/2000/svg","stop");r.setAttribute("offset",100*t+"%"),r.setAttribute("stop-color",n),e.appendChild(r)}),l.setAttribute("fill",`url('#${a}')`),this._defs.appendChild(e)}else e&&l.setAttribute("fill",e);this._element.appendChild(l)}}m.instanceCount=0;const y=m,v="canvas",b={};for(let n=0;n<=40;n++)b[n]=n;const w={type:v,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:b[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{saveAsBlob:!0,hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000",roundSize:!0},backgroundOptions:{round:0,color:"#fff"}};function x(t){const e=Object.assign({},t);if(!e.colorStops||!e.colorStops.length)throw"Field 'colorStops' is required in gradient";return e.rotation?e.rotation=Number(e.rotation):e.rotation=0,e.colorStops=e.colorStops.map(t=>Object.assign(Object.assign({},t),{offset:Number(t.offset)})),e}function S(t){const e=Object.assign({},t);return e.width=Number(e.width),e.height=Number(e.height),e.margin=Number(e.margin),e.imageOptions=Object.assign(Object.assign({},e.imageOptions),{hideBackgroundDots:Boolean(e.imageOptions.hideBackgroundDots),imageSize:Number(e.imageOptions.imageSize),margin:Number(e.imageOptions.margin)}),e.margin>Math.min(e.width,e.height)&&(e.margin=Math.min(e.width,e.height)),e.dotsOptions=Object.assign({},e.dotsOptions),e.dotsOptions.gradient&&(e.dotsOptions.gradient=x(e.dotsOptions.gradient)),e.cornersSquareOptions&&(e.cornersSquareOptions=Object.assign({},e.cornersSquareOptions),e.cornersSquareOptions.gradient&&(e.cornersSquareOptions.gradient=x(e.cornersSquareOptions.gradient))),e.cornersDotOptions&&(e.cornersDotOptions=Object.assign({},e.cornersDotOptions),e.cornersDotOptions.gradient&&(e.cornersDotOptions.gradient=x(e.cornersDotOptions.gradient))),e.backgroundOptions&&(e.backgroundOptions=Object.assign({},e.backgroundOptions),e.backgroundOptions.gradient&&(e.backgroundOptions.gradient=x(e.backgroundOptions.gradient))),e}var _=n(873),k=n.n(_);function O(t){if(!t)throw new Error("Extension must be defined");"."===t[0]&&(t=t.substring(1));const e={bmp:"image/bmp",gif:"image/gif",ico:"image/vnd.microsoft.icon",jpeg:"image/jpeg",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp",pdf:"application/pdf"}[t.toLowerCase()];if(!e)throw new Error(`Extension "${t}" is not supported`);return e}class C{constructor(t){(null==t?void 0:t.jsdom)?this._window=new t.jsdom("",{resources:"usable"}).window:this._window=window,this._options=t?S(e(w,t)):w,this.update()}static _clearContainer(t){t&&(t.innerHTML="")}_setupSvg(){if(!this._qr)return;const t=new y(this._options,this._window);this._svg=t.getElement(),this._svgDrawingPromise=t.drawQR(this._qr).then(()=>{var e;this._svg&&(null===(e=this._extension)||void 0===e||e.call(this,t.getElement(),this._options))})}_setupCanvas(){var t,e;this._qr&&((null===(t=this._options.nodeCanvas)||void 0===t?void 0:t.createCanvas)?(this._nodeCanvas=this._options.nodeCanvas.createCanvas(this._options.width,this._options.height),this._nodeCanvas.width=this._options.width,this._nodeCanvas.height=this._options.height):(this._domCanvas=document.createElement("canvas"),this._domCanvas.width=this._options.width,this._domCanvas.height=this._options.height),this._setupSvg(),this._canvasDrawingPromise=null===(e=this._svgDrawingPromise)||void 0===e?void 0:e.then(()=>{var t;if(!this._svg)return;const e=this._svg,n=(new this._window.XMLSerializer).serializeToString(e),r=btoa(n),i=`data:${O("svg")};base64,${r}`;if(null===(t=this._options.nodeCanvas)||void 0===t?void 0:t.loadImage)return this._options.nodeCanvas.loadImage(i).then(t=>{var e,n;t.width=this._options.width,t.height=this._options.height,null===(n=null===(e=this._nodeCanvas)||void 0===e?void 0:e.getContext("2d"))||void 0===n||n.drawImage(t,0,0)});{const t=new this._window.Image;return new Promise(e=>{t.onload=()=>{var n,r;null===(r=null===(n=this._domCanvas)||void 0===n?void 0:n.getContext("2d"))||void 0===r||r.drawImage(t,0,0),e()},t.src=i})}}))}async _getElement(t="png"){if(!this._qr)throw"QR code is empty";return"svg"===t.toLowerCase()?(this._svg&&this._svgDrawingPromise||this._setupSvg(),await this._svgDrawingPromise,this._svg):((this._domCanvas||this._nodeCanvas)&&this._canvasDrawingPromise||this._setupCanvas(),await this._canvasDrawingPromise,this._domCanvas||this._nodeCanvas)}update(t){C._clearContainer(this._container),this._options=t?S(e(this._options,t)):this._options,this._options.data&&(this._qr=k()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||function(t){switch(!0){case/^[0-9]*$/.test(t):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(t):return"Alphanumeric";default:return"Byte"}}(this._options.data)),this._qr.make(),this._options.type===v?this._setupCanvas():this._setupSvg(),this.append(this._container))}append(t){if(t){if("function"!=typeof t.appendChild)throw"Container should be a single DOM node";this._options.type===v?this._domCanvas&&t.appendChild(this._domCanvas):this._svg&&t.appendChild(this._svg),this._container=t}}applyExtension(t){if(!t)throw"Extension function should be defined.";this._extension=t,this.update()}deleteExtension(){this._extension=void 0,this.update()}async getRawData(t="png"){if(!this._qr)throw"QR code is empty";const e=await this._getElement(t),n=O(t);if(!e)return null;if("svg"===t.toLowerCase()){const t=`<?xml version="1.0" standalone="no"?>\r\n${(new this._window.XMLSerializer).serializeToString(e)}`;return"undefined"==typeof Blob||this._options.jsdom?Buffer.from(t):new Blob([t],{type:n})}return new Promise(t=>{const r=e;if("toBuffer"in r)if("image/png"===n)t(r.toBuffer(n));else if("image/jpeg"===n)t(r.toBuffer(n));else{if("application/pdf"!==n)throw Error("Unsupported extension");t(r.toBuffer(n))}else"toBlob"in r&&r.toBlob(t,n,1)})}async download(t){if(!this._qr)throw"QR code is empty";if("undefined"==typeof Blob)throw"Cannot download in Node.js, call getRawData instead.";let e="png",n="qr";"string"==typeof t?e=t:"object"==typeof t&&null!==t&&(t.name&&(n=t.name),t.extension&&(e=t.extension));const r=await this._getElement(e);if(r)if("svg"===e.toLowerCase()){let t=(new XMLSerializer).serializeToString(r);t='<?xml version="1.0" standalone="no"?>\r\n'+t,i(`data:${O(e)};charset=utf-8,${encodeURIComponent(t)}`,`${n}.svg`)}else i(r.toDataURL(O(e)),`${n}.${e}`)}}const j=C})(),r.default})(),t.exports=e()},525(t,e,n){"use strict";t.exports=n(357)},624(t,e,n){"use strict";t.exports=n(906)},752(t){t.exports={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}},906(t,e,n){"use strict";var r=n(156),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},o=r.useState,s=r.useEffect,a=r.useLayoutEffect,c=r.useDebugValue;function l(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!i(t,n)}catch(r){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=o({inst:{value:n,getSnapshot:e}}),i=r[0].inst,u=r[1];return a(function(){i.value=n,i.getSnapshot=e,l(i)&&u({inst:i})},[t,n,e]),s(function(){return l(i)&&u({inst:i}),t(function(){l(i)&&u({inst:i})})},[t]),c(n),n};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u}},r={};function i(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={exports:{}};return n[t].call(o.exports,o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0;var o={};return(()=>{"use strict";i.r(o),i.d(o,{LiberionAuth:()=>Os});var t=i(156),e=i.n(t),n=i(318),r="close",s="success",a="failed",c=2147483647,l="awaiting",u="success",h="error",d="cancel",p="timeout",f="reconnect_failed",g="light",m="dark",y="auth_init",v="desktop",b="android",w=function(){return!1},x=function(){return!1},S=function(t){if(!t||"string"!=typeof t)return!1;try{var e=new URL(t);return!!["http:","https:"].includes(e.protocol)}catch(no){return null==no||no.message,!1}};const _=new TextEncoder;function k(t,e,n){let r=e;const i=r+n,o=[];let s="";for(;r<i;){const e=t[r++];if(128&e)if(192==(224&e)){const n=63&t[r++];o.push((31&e)<<6|n)}else if(224==(240&e)){const n=63&t[r++],i=63&t[r++];o.push((31&e)<<12|n<<6|i)}else if(240==(248&e)){let n=(7&e)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++];n>65535&&(n-=65536,o.push(n>>>10&1023|55296),n=56320|1023&n),o.push(n)}else o.push(e);else o.push(e);o.length>=4096&&(s+=String.fromCharCode(...o),o.length=0)}return o.length>0&&(s+=String.fromCharCode(...o)),s}const O=new TextDecoder;class C{constructor(t,e){this.type=t,this.data=e}}class j extends Error{constructor(t){super(t);const e=Object.create(j.prototype);Object.setPrototypeOf(this,e),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:j.name})}}const A=4294967295;function P(t,e,n){const r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function $(t,e){return 4294967296*t.getInt32(e)+t.getUint32(e+4)}const I={type:-1,encode:function(t){if(t instanceof Date){return function({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=17179869183){if(0===e&&t<=4294967295){const e=new Uint8Array(4);return new DataView(e.buffer).setUint32(0,t),e}{const n=t/4294967296,r=4294967295&t,i=new Uint8Array(8),o=new DataView(i.buffer);return o.setUint32(0,e<<2|3&n),o.setUint32(4,r),i}}{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,e),P(r,4,t),n}}(function(t){const e=t.getTime(),n=Math.floor(e/1e3),r=1e6*(e-1e3*n),i=Math.floor(r/1e9);return{sec:n+i,nsec:r-1e9*i}}(t))}return null},decode:function(t){const e=function(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const t=e.getUint32(0);return{sec:4294967296*(3&t)+e.getUint32(4),nsec:t>>>2}}case 12:return{sec:$(e,4),nsec:e.getUint32(0)};default:throw new j(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}(t);return new Date(1e3*e.sec+e.nsec/1e6)}};class E{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(I)}register({type:t,encode:e,decode:n}){if(t>=0)this.encoders[t]=e,this.decoders[t]=n;else{const r=-1-t;this.builtInEncoders[r]=e,this.builtInDecoders[r]=n}}tryToEncode(t,e){for(let n=0;n<this.builtInEncoders.length;n++){const r=this.builtInEncoders[n];if(null!=r){const i=r(t,e);if(null!=i)return new C(-1-n,i)}}for(let n=0;n<this.encoders.length;n++){const r=this.encoders[n];if(null!=r){const i=r(t,e);if(null!=i)return new C(n,i)}}return t instanceof C?t:null}decode(t,e,n){const r=e<0?this.builtInDecoders[-1-e]:this.decoders[e];return r?r(t,e,n):new C(e,t)}}function L(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):function(t){return t instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&t instanceof SharedArrayBuffer}(t)?new Uint8Array(t):Uint8Array.from(t)}E.defaultCodec=new E;class M{constructor(t){this.entered=!1,this.extensionCodec=t?.extensionCodec??E.defaultCodec,this.context=t?.context,this.useBigInt64=t?.useBigInt64??!1,this.maxDepth=t?.maxDepth??100,this.initialBufferSize=t?.initialBufferSize??2048,this.sortKeys=t?.sortKeys??!1,this.forceFloat32=t?.forceFloat32??!1,this.ignoreUndefined=t?.ignoreUndefined??!1,this.forceIntegerToFloat=t?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new M({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(t){if(this.entered)return this.clone().encodeSharedRef(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(t){if(this.entered)return this.clone().encode(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(t,e){if(e>this.maxDepth)throw new Error(`Too deep objects in depth ${e}`);null==t?this.encodeNil():"boolean"==typeof t?this.encodeBoolean(t):"number"==typeof t?this.forceIntegerToFloat?this.encodeNumberAsFloat(t):this.encodeNumber(t):"string"==typeof t?this.encodeString(t):this.useBigInt64&&"bigint"==typeof t?this.encodeBigInt64(t):this.encodeObject(t,e)}ensureBufferSizeToWrite(t){const e=this.pos+t;this.view.byteLength<e&&this.resizeBuffer(2*e)}resizeBuffer(t){const e=new ArrayBuffer(t),n=new Uint8Array(e),r=new DataView(e);n.set(this.bytes),this.view=r,this.bytes=n}encodeNil(){this.writeU8(192)}encodeBoolean(t){!1===t?this.writeU8(194):this.writeU8(195)}encodeNumber(t){!this.forceIntegerToFloat&&Number.isSafeInteger(t)?t>=0?t<128?this.writeU8(t):t<256?(this.writeU8(204),this.writeU8(t)):t<65536?(this.writeU8(205),this.writeU16(t)):t<4294967296?(this.writeU8(206),this.writeU32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(207),this.writeU64(t)):t>=-32?this.writeU8(224|t+32):t>=-128?(this.writeU8(208),this.writeI8(t)):t>=-32768?(this.writeU8(209),this.writeI16(t)):t>=-2147483648?(this.writeU8(210),this.writeI32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(211),this.writeI64(t)):this.encodeNumberAsFloat(t)}encodeNumberAsFloat(t){this.forceFloat32?(this.writeU8(202),this.writeF32(t)):(this.writeU8(203),this.writeF64(t))}encodeBigInt64(t){t>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(t)):(this.writeU8(211),this.writeBigInt64(t))}writeStringHeader(t){if(t<32)this.writeU8(160+t);else if(t<256)this.writeU8(217),this.writeU8(t);else if(t<65536)this.writeU8(218),this.writeU16(t);else{if(!(t<4294967296))throw new Error(`Too long string: ${t} bytes in UTF-8`);this.writeU8(219),this.writeU32(t)}}encodeString(t){const e=function(t){const e=t.length;let n=0,r=0;for(;r<e;){let i=t.charCodeAt(r++);if(4294967168&i)if(4294965248&i){if(i>=55296&&i<=56319&&r<e){const e=t.charCodeAt(r);56320==(64512&e)&&(++r,i=((1023&i)<<10)+(1023&e)+65536)}n+=4294901760&i?4:3}else n+=2;else n++}return n}(t);var n,r,i;this.ensureBufferSizeToWrite(5+e),this.writeStringHeader(e),n=t,r=this.bytes,i=this.pos,n.length>50?function(t,e,n){_.encodeInto(t,e.subarray(n))}(n,r,i):function(t,e,n){const r=t.length;let i=n,o=0;for(;o<r;){let n=t.charCodeAt(o++);if(4294967168&n){if(4294965248&n){if(n>=55296&&n<=56319&&o<r){const e=t.charCodeAt(o);56320==(64512&e)&&(++o,n=((1023&n)<<10)+(1023&e)+65536)}4294901760&n?(e[i++]=n>>18&7|240,e[i++]=n>>12&63|128,e[i++]=n>>6&63|128):(e[i++]=n>>12&15|224,e[i++]=n>>6&63|128)}else e[i++]=n>>6&31|192;e[i++]=63&n|128}else e[i++]=n}}(n,r,i),this.pos+=e}encodeObject(t,e){const n=this.extensionCodec.tryToEncode(t,this.context);if(null!=n)this.encodeExtension(n);else if(Array.isArray(t))this.encodeArray(t,e);else if(ArrayBuffer.isView(t))this.encodeBinary(t);else{if("object"!=typeof t)throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(t)}`);this.encodeMap(t,e)}}encodeBinary(t){const e=t.byteLength;if(e<256)this.writeU8(196),this.writeU8(e);else if(e<65536)this.writeU8(197),this.writeU16(e);else{if(!(e<4294967296))throw new Error(`Too large binary: ${e}`);this.writeU8(198),this.writeU32(e)}const n=L(t);this.writeU8a(n)}encodeArray(t,e){const n=t.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else{if(!(n<4294967296))throw new Error(`Too large array: ${n}`);this.writeU8(221),this.writeU32(n)}for(const r of t)this.doEncode(r,e+1)}countWithoutUndefined(t,e){let n=0;for(const r of e)void 0!==t[r]&&n++;return n}encodeMap(t,e){const n=Object.keys(t);this.sortKeys&&n.sort();const r=this.ignoreUndefined?this.countWithoutUndefined(t,n):n.length;if(r<16)this.writeU8(128+r);else if(r<65536)this.writeU8(222),this.writeU16(r);else{if(!(r<4294967296))throw new Error(`Too large map object: ${r}`);this.writeU8(223),this.writeU32(r)}for(const i of n){const n=t[i];this.ignoreUndefined&&void 0===n||(this.encodeString(i),this.doEncode(n,e+1))}}encodeExtension(t){if("function"==typeof t.data){const e=t.data(this.pos+6),n=e.length;if(n>=4294967296)throw new Error(`Too large extension object: ${n}`);return this.writeU8(201),this.writeU32(n),this.writeI8(t.type),void this.writeU8a(e)}const e=t.data.length;if(1===e)this.writeU8(212);else if(2===e)this.writeU8(213);else if(4===e)this.writeU8(214);else if(8===e)this.writeU8(215);else if(16===e)this.writeU8(216);else if(e<256)this.writeU8(199),this.writeU8(e);else if(e<65536)this.writeU8(200),this.writeU16(e);else{if(!(e<4294967296))throw new Error(`Too large extension object: ${e}`);this.writeU8(201),this.writeU32(e)}this.writeI8(t.type),this.writeU8a(t.data)}writeU8(t){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,t),this.pos++}writeU8a(t){const e=t.length;this.ensureBufferSizeToWrite(e),this.bytes.set(t,this.pos),this.pos+=e}writeI8(t){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,t),this.pos++}writeU16(t){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,t),this.pos+=2}writeI16(t){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,t),this.pos+=2}writeU32(t){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,t),this.pos+=4}writeI32(t){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,t),this.pos+=4}writeF32(t){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,t),this.pos+=4}writeF64(t){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,t),this.pos+=8}writeU64(t){this.ensureBufferSizeToWrite(8),function(t,e,n){const r=n/4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}(this.view,this.pos,t),this.pos+=8}writeI64(t){this.ensureBufferSizeToWrite(8),P(this.view,this.pos,t),this.pos+=8}writeBigUint64(t){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,t),this.pos+=8}writeBigInt64(t){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,t),this.pos+=8}}function R(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}const z="array",B="map_key",U="map_value",D=t=>{if("string"==typeof t||"number"==typeof t)return t;throw new j("The type of key must be string or number but "+typeof t)};class N{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(t){const e=this.getUninitializedStateFromPool();e.type=z,e.position=0,e.size=t,e.array=new Array(t)}pushMapState(t){const e=this.getUninitializedStateFromPool();e.type=B,e.readCount=0,e.size=t,e.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const t={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(t)}return this.stack[this.stackHeadPosition]}release(t){if(this.stack[this.stackHeadPosition]!==t)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(t.type===z){const e=t;e.size=0,e.array=void 0,e.position=0,e.type=void 0}if(t.type===B||t.type===U){const e=t;e.size=0,e.map=void 0,e.readCount=0,e.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const T=new DataView(new ArrayBuffer(0)),F=new Uint8Array(T.buffer);try{T.getInt8(0)}catch(yr){if(!(yr instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const q=new RangeError("Insufficient data"),V=new class{constructor(t=16,e=16){this.hit=0,this.miss=0,this.maxKeyLength=t,this.maxLengthPerKey=e,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(t){return t>0&&t<=this.maxKeyLength}find(t,e,n){const r=this.caches[n-1];t:for(const i of r){const r=i.bytes;for(let i=0;i<n;i++)if(r[i]!==t[e+i])continue t;return i.str}return null}store(t,e){const n=this.caches[t.length-1],r={bytes:t,str:e};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=r:n.push(r)}decode(t,e,n){const r=this.find(t,e,n);if(null!=r)return this.hit++,r;this.miss++;const i=k(t,e,n),o=Uint8Array.prototype.slice.call(t,e,e+n);return this.store(o,i),i}};class H{constructor(t){this.totalPos=0,this.pos=0,this.view=T,this.bytes=F,this.headByte=-1,this.stack=new N,this.entered=!1,this.extensionCodec=t?.extensionCodec??E.defaultCodec,this.context=t?.context,this.useBigInt64=t?.useBigInt64??!1,this.rawStrings=t?.rawStrings??!1,this.maxStrLength=t?.maxStrLength??A,this.maxBinLength=t?.maxBinLength??A,this.maxArrayLength=t?.maxArrayLength??A,this.maxMapLength=t?.maxMapLength??A,this.maxExtLength=t?.maxExtLength??A,this.keyDecoder=void 0!==t?.keyDecoder?t.keyDecoder:V,this.mapKeyConverter=t?.mapKeyConverter??D}clone(){return new H({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=-1,this.stack.reset()}setBuffer(t){const e=L(t);this.bytes=e,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.pos=0}appendBuffer(t){if(-1!==this.headByte||this.hasRemaining(1)){const e=this.bytes.subarray(this.pos),n=L(t),r=new Uint8Array(e.length+n.length);r.set(e),r.set(n,e.length),this.setBuffer(r)}else this.setBuffer(t)}hasRemaining(t){return this.view.byteLength-this.pos>=t}createExtraByteError(t){const{view:e,pos:n}=this;return new RangeError(`Extra ${e.byteLength-n} of ${e.byteLength} byte(s) found at buffer[${t}]`)}decode(t){if(this.entered)return this.clone().decode(t);try{this.entered=!0,this.reinitializeState(),this.setBuffer(t);const e=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return e}finally{this.entered=!1}}*decodeMulti(t){if(this.entered){const e=this.clone();return void(yield*e.decodeMulti(t))}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(t);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(t){if(this.entered)return this.clone().decodeAsync(t);try{this.entered=!0;let e,n=!1;for await(const s of t){if(n)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(s);try{e=this.doDecodeSync(),n=!0}catch(yr){if(!(yr instanceof RangeError))throw yr}this.totalPos+=this.pos}if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return e}const{headByte:r,pos:i,totalPos:o}=this;throw new RangeError(`Insufficient data in parsing ${R(r)} at ${o} (${i} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(t){return this.decodeMultiAsync(t,!0)}decodeStream(t){return this.decodeMultiAsync(t,!1)}async*decodeMultiAsync(t,e){if(this.entered){const n=this.clone();return void(yield*n.decodeMultiAsync(t,e))}try{this.entered=!0;let n=e,r=-1;for await(const i of t){if(e&&0===r)throw this.createExtraByteError(this.totalPos);this.appendBuffer(i),n&&(r=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),0!==--r;);}catch(yr){if(!(yr instanceof RangeError))throw yr}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){t:for(;;){const t=this.readHeadByte();let e;if(t>=224)e=t-256;else if(t<192)if(t<128)e=t;else if(t<144){const n=t-128;if(0!==n){this.pushMapState(n),this.complete();continue t}e={}}else if(t<160){const n=t-144;if(0!==n){this.pushArrayState(n),this.complete();continue t}e=[]}else{const n=t-160;e=this.decodeString(n,0)}else if(192===t)e=null;else if(194===t)e=!1;else if(195===t)e=!0;else if(202===t)e=this.readF32();else if(203===t)e=this.readF64();else if(204===t)e=this.readU8();else if(205===t)e=this.readU16();else if(206===t)e=this.readU32();else if(207===t)e=this.useBigInt64?this.readU64AsBigInt():this.readU64();else if(208===t)e=this.readI8();else if(209===t)e=this.readI16();else if(210===t)e=this.readI32();else if(211===t)e=this.useBigInt64?this.readI64AsBigInt():this.readI64();else if(217===t){const t=this.lookU8();e=this.decodeString(t,1)}else if(218===t){const t=this.lookU16();e=this.decodeString(t,2)}else if(219===t){const t=this.lookU32();e=this.decodeString(t,4)}else if(220===t){const t=this.readU16();if(0!==t){this.pushArrayState(t),this.complete();continue t}e=[]}else if(221===t){const t=this.readU32();if(0!==t){this.pushArrayState(t),this.complete();continue t}e=[]}else if(222===t){const t=this.readU16();if(0!==t){this.pushMapState(t),this.complete();continue t}e={}}else if(223===t){const t=this.readU32();if(0!==t){this.pushMapState(t),this.complete();continue t}e={}}else if(196===t){const t=this.lookU8();e=this.decodeBinary(t,1)}else if(197===t){const t=this.lookU16();e=this.decodeBinary(t,2)}else if(198===t){const t=this.lookU32();e=this.decodeBinary(t,4)}else if(212===t)e=this.decodeExtension(1,0);else if(213===t)e=this.decodeExtension(2,0);else if(214===t)e=this.decodeExtension(4,0);else if(215===t)e=this.decodeExtension(8,0);else if(216===t)e=this.decodeExtension(16,0);else if(199===t){const t=this.lookU8();e=this.decodeExtension(t,1)}else if(200===t){const t=this.lookU16();e=this.decodeExtension(t,2)}else{if(201!==t)throw new j(`Unrecognized type byte: ${R(t)}`);{const t=this.lookU32();e=this.decodeExtension(t,4)}}this.complete();const n=this.stack;for(;n.length>0;){const t=n.top();if(t.type===z){if(t.array[t.position]=e,t.position++,t.position!==t.size)continue t;e=t.array,n.release(t)}else{if(t.type===B){if("__proto__"===e)throw new j("The key __proto__ is not allowed");t.key=this.mapKeyConverter(e),t.type=U;continue t}if(t.map[t.key]=e,t.readCount++,t.readCount!==t.size){t.key=null,t.type=B;continue t}e=t.map,n.release(t)}}return e}}readHeadByte(){return-1===this.headByte&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=-1}readArraySize(){const t=this.readHeadByte();switch(t){case 220:return this.readU16();case 221:return this.readU32();default:if(t<160)return t-144;throw new j(`Unrecognized array type byte: ${R(t)}`)}}pushMapState(t){if(t>this.maxMapLength)throw new j(`Max length exceeded: map length (${t}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(t)}pushArrayState(t){if(t>this.maxArrayLength)throw new j(`Max length exceeded: array length (${t}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(t)}decodeString(t,e){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(t,e):this.decodeBinary(t,e)}decodeUtf8String(t,e){if(t>this.maxStrLength)throw new j(`Max length exceeded: UTF-8 byte length (${t}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+e+t)throw q;const n=this.pos+e;let r;return r=this.stateIsMapKey()&&this.keyDecoder?.canBeCached(t)?this.keyDecoder.decode(this.bytes,n,t):function(t,e,n){return n>200?function(t,e,n){const r=t.subarray(e,e+n);return O.decode(r)}(t,e,n):k(t,e,n)}(this.bytes,n,t),this.pos+=e+t,r}stateIsMapKey(){return this.stack.length>0&&this.stack.top().type===B}decodeBinary(t,e){if(t>this.maxBinLength)throw new j(`Max length exceeded: bin length (${t}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(t+e))throw q;const n=this.pos+e,r=this.bytes.subarray(n,n+t);return this.pos+=e+t,r}decodeExtension(t,e){if(t>this.maxExtLength)throw new j(`Max length exceeded: ext length (${t}) > maxExtLength (${this.maxExtLength})`);const n=this.view.getInt8(this.pos+e),r=this.decodeBinary(t,e+1);return this.extensionCodec.decode(r,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const t=this.view.getUint8(this.pos);return this.pos++,t}readI8(){const t=this.view.getInt8(this.pos);return this.pos++,t}readU16(){const t=this.view.getUint16(this.pos);return this.pos+=2,t}readI16(){const t=this.view.getInt16(this.pos);return this.pos+=2,t}readU32(){const t=this.view.getUint32(this.pos);return this.pos+=4,t}readI32(){const t=this.view.getInt32(this.pos);return this.pos+=4,t}readU64(){const t=(e=this.view,n=this.pos,4294967296*e.getUint32(n)+e.getUint32(n+4));var e,n;return this.pos+=8,t}readI64(){const t=$(this.view,this.pos);return this.pos+=8,t}readU64AsBigInt(){const t=this.view.getBigUint64(this.pos);return this.pos+=8,t}readI64AsBigInt(){const t=this.view.getBigInt64(this.pos);return this.pos+=8,t}readF32(){const t=this.view.getFloat32(this.pos);return this.pos+=4,t}readF64(){const t=this.view.getFloat64(this.pos);return this.pos+=8,t}}function K(t){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},K(t)}function W(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,G(r.key),r)}}function G(t){var e=function(t){if("object"!=K(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=K(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==K(e)?e:e+""}var Y=function(){return t=function t(e){var n=e.address,r=e.onClose,i=e.onMessage;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.address=n,this.onClose=r,this.onMessage=i,this.resolver=null,this.rejector=null},e=[{key:"encode",value:function(t){return e=t,new M(void 0).encodeSharedRef(e);var e}},{key:"decode",value:function(t){return e=t,new H(void 0).decode(e);var e}},{key:"open",value:function(){var t=this;return new Promise(function(e,n){t.ws=new WebSocket(t.address),t.ws.binaryType="arraybuffer",t.ws.onopen=function(t){return e(t.target)},t.ws.onclose=function(e){var n;t.rejector&&1e3!==e.code&&t.rejector(new Error("Connection closed")),t.rejector=null,t.resolver=null;try{var r,i=e.reason&&"string"==typeof e.reason?JSON.parse(e.reason):null;i&&"error"===i._&&(null===(r=t.onMessage)||void 0===r||r.call(t,i))}catch(no){}null===(n=t.onClose)||void 0===n||n.call(t,e)},t.ws.onmessage=function(e){var n=t.resolver,r=t.rejector;t.resolver=null,t.rejector=null;try{var i,o,s,a=t.decode(e.data);if("error"===a._)return void(r?r(new Error(null!==(o=a.message)&&void 0!==o?o:"Server error")):null===(s=t.onMessage)||void 0===s||s.call(t,a));n?n(a):null===(i=t.onMessage)||void 0===i||i.call(t,a)}catch(no){null==r||r(new Error("Bad server response"))}},t.ws.onerror=function(){n(new Error("Connection to ".concat(t.address," failed")))}})}},{key:"close",value:function(){this.ws&&(this.ws.readyState!==WebSocket.OPEN&&this.ws.readyState!==WebSocket.CONNECTING||this.ws.close())}},{key:"reconnect",value:function(){return this.open()}},{key:"send",value:function(t){var e=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).timeout,r=void 0===n?15e3:n;return new Promise(function(n,i){if(e.ws.readyState!==WebSocket.OPEN)return i(new Error("Websocket is closed"));var o=setTimeout(function(){e.resolver=null,e.rejector=null,i(new Error("Request timed out"))},r);e.resolver=function(t){clearTimeout(o),e.resolver=null,e.rejector=null,n(t)},e.rejector=function(t){clearTimeout(o),e.resolver=null,e.rejector=null,i(t)};try{e.ws.send(e.encode(t))}catch(no){e.rejector(no)}})}}],e&&W(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),Q="/loading",J="/auth",X=i(525);function Z(t){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(t)}function tt(t,e,n){return(e=function(t){var e=function(t){if("object"!=Z(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Z(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function et(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return nt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var rt=(0,t.createContext)(),it=function(){return(0,t.useContext)(rt)},ot=function(e){var n=e.children,i=et((0,t.useState)({path:Q,params:{}}),2),o=i[0],c=i[1],l=et((0,t.useState)(tt(tt(tt({},r,function(){return!1}),s,function(){return!1}),a,function(){return!1})),2),u=l[0],h=l[1],d=et((0,t.useState)(!1),2),p=d[0],f=d[1],g={screen:o,navigate:(0,t.useCallback)(function(t){var e=t.path,n=t.params;c({path:e,params:n})},[]),callbacks:u,setCallbacks:h,closing:p,setClosing:f};return(0,X.jsx)(rt.Provider,{value:g,children:n})};function st(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var c=r&&r.prototype instanceof a?r:a,l=Object.create(c.prototype);return at(l,"_invoke",function(n,r,i){var o,a,c,l=0,u=i||[],h=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return o=e,a=0,c=t,d.n=n,s}};function p(n,r){for(a=n,c=r,e=0;!h&&l&&!i&&e<u.length;e++){var i,o=u[e],p=d.p,f=o[2];n>3?(i=f===r)&&(c=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=t):o[0]<=p&&((i=n<2&&p<o[1])?(a=0,d.v=r,d.n=o[1]):p<f&&(i=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,d.n=f,a=0))}if(i||n>1)return s;throw h=!0,r}return function(i,u,f){if(l>1)throw TypeError("Generator is already running");for(h&&1===u&&p(u,f),a=u,c=f;(e=a<2?t:c)||!h;){o||(a?a<3?(a>1&&(d.n=-1),p(a,c)):d.n=c:d.v=c);try{if(l=2,o){if(a||(i="next"),e=o[i]){if(!(e=e.call(o,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,a<2&&(a=0)}else 1===a&&(e=o.return)&&e.call(o),a<2&&(c=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=t}else if((e=(h=d.n<0)?c:n.call(r,d))!==s)break}catch(e){o=t,a=1,c=e}finally{l=1}}return{value:e,done:h}}}(n,i,o),!0),l}var s={};function a(){}function c(){}function l(){}e=Object.getPrototypeOf;var u=[][r]?e(e([][r]())):(at(e={},r,function(){return this}),e),h=l.prototype=a.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,at(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return c.prototype=l,at(h,"constructor",l),at(l,"constructor",c),c.displayName="GeneratorFunction",at(l,i,"GeneratorFunction"),at(h),at(h,i,"Generator"),at(h,r,function(){return this}),at(h,"toString",function(){return"[object Generator]"}),(st=function(){return{w:o,m:d}})()}function at(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}at=function(t,e,n,r){function o(e,n){at(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))},at(t,e,n,r)}function ct(t,e,n,r,i,o,s){try{var a=t[o](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,i)}function lt(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function s(t){ct(o,r,i,s,a,"next",t)}function a(t){ct(o,r,i,s,a,"throw",t)}s(void 0)})}}function ut(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ht(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ht(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ht(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var dt=(0,t.createContext)(),pt=function(){return(0,t.useContext)(dt)},ft=function(e){var n=e.children,r=ut((0,t.useState)(""),2),i=r[0],o=r[1],c=ut((0,t.useState)(""),2),g=c[0],m=c[1],v=ut((0,t.useState)("default"),2),b=v[0],x=v[1],S=(0,t.useRef)(null),_=(0,t.useRef)(null),k=(0,t.useRef)(!1),O=it(),C=O.callbacks,j=O.setClosing,A=(0,t.useCallback)(function(){var t=lt(st().m(function t(e){var n,r,i;return st().w(function(t){for(;;)switch(t.p=t.n){case 0:return n=function(t){var e,n,r,i;"activated"===(null==t?void 0:t._)&&x(l),"error"===(null==t?void 0:t._)&&(x(h),null===(e=C[a])||void 0===e||e.call(C)),"Authorization declined"===(null==t?void 0:t.message)&&(x(d),null===(n=C[a])||void 0===n||n.call(C)),"Authorization timeout"===(null==t?void 0:t.message)&&(x(p),j(!0),null===(r=C[a])||void 0===r||r.call(C)),"welcome"===(null==t?void 0:t.message)&&(null===(i=C[s])||void 0===i||i.call(C,{token:t.payload.token}),x(u),j(!0),S.current=null,_.current=null,k.current=!1)},r=new Y({address:e,onClose:function(){var t=lt(st().m(function t(e){var r,i,o;return st().w(function(t){for(;;)switch(t.p=t.n){case 0:if(w(),r=S.current,(i=_.current)&&!k.current){t.n=1;break}return t.a(2);case 1:return k.current=!0,w(),t.p=2,t.n=3,r.reconnect();case 3:return t.n=4,r.send({_:"reconnect",sessionId:i});case 4:o=t.v,w(),k.current=!1,"activated"===o.status&&x(l),n(o),t.n=6;break;case 5:t.p=5,t.v,w(),x(f);case 6:return t.a(2)}},t,null,[[2,5]])}));return function(e){return t.apply(this,arguments)}}(),onMessage:n}),t.p=1,t.n=2,r.open();case 2:return t.n=3,r.send({_:y});case 3:(null==(i=t.v)?void 0:i._)===y&&null!=i&&i.linkWeb&&(m(i.linkWeb),i.sessionId&&(_.current=i.sessionId,w(i.sessionId))),S.current=r,t.n=5;break;case 4:t.p=4,t.v,w(),x(h),j(!0);try{r.close()}catch(o){w()}case 5:return t.a(2)}},t,null,[[1,4]])}));return function(e){return t.apply(this,arguments)}}(),[C,j]);(0,t.useEffect)(function(){return i&&A(i),function(){var t;return null===(t=S.current)||void 0===t?void 0:t.close()}},[i]);var P={setBackendUrl:o,authStatus:b,link:g};return(0,X.jsx)(dt.Provider,{value:P,children:n})},gt=function(){return gt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},gt.apply(this,arguments)};function mt(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var yt=i(162),vt=i.n(yt),bt="-ms-",wt="-moz-",xt="-webkit-",St="comm",_t="rule",kt="decl",Ot="@keyframes",Ct=Math.abs,jt=String.fromCharCode,At=Object.assign;function Pt(t){return t.trim()}function $t(t,e){return(t=e.exec(t))?t[0]:t}function It(t,e,n){return t.replace(e,n)}function Et(t,e,n){return t.indexOf(e,n)}function Lt(t,e){return 0|t.charCodeAt(e)}function Mt(t,e,n){return t.slice(e,n)}function Rt(t){return t.length}function zt(t){return t.length}function Bt(t,e){return e.push(t),t}function Ut(t,e){return t.filter(function(t){return!$t(t,e)})}var Dt=1,Nt=1,Tt=0,Ft=0,qt=0,Vt="";function Ht(t,e,n,r,i,o,s,a){return{value:t,root:e,parent:n,type:r,props:i,children:o,line:Dt,column:Nt,length:s,return:"",siblings:a}}function Kt(t,e){return At(Ht("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function Wt(t){for(;t.root;)t=Kt(t.root,{children:[t]});Bt(t,t.siblings)}function Gt(){return qt=Ft>0?Lt(Vt,--Ft):0,Nt--,10===qt&&(Nt=1,Dt--),qt}function Yt(){return qt=Ft<Tt?Lt(Vt,Ft++):0,Nt++,10===qt&&(Nt=1,Dt++),qt}function Qt(){return Lt(Vt,Ft)}function Jt(){return Ft}function Xt(t,e){return Mt(Vt,t,e)}function Zt(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function te(t){return Pt(Xt(Ft-1,re(91===t?t+2:40===t?t+1:t)))}function ee(t){for(;(qt=Qt())&&qt<33;)Yt();return Zt(t)>2||Zt(qt)>3?"":" "}function ne(t,e){for(;--e&&Yt()&&!(qt<48||qt>102||qt>57&&qt<65||qt>70&&qt<97););return Xt(t,Jt()+(e<6&&32==Qt()&&32==Yt()))}function re(t){for(;Yt();)switch(qt){case t:return Ft;case 34:case 39:34!==t&&39!==t&&re(qt);break;case 40:41===t&&re(t);break;case 92:Yt()}return Ft}function ie(t,e){for(;Yt()&&t+qt!==57&&(t+qt!==84||47!==Qt()););return"/*"+Xt(e,Ft-1)+"*"+jt(47===t?t:Yt())}function oe(t){for(;!Zt(Qt());)Yt();return Xt(t,Ft)}function se(t){return function(t){return Vt="",t}(ae("",null,null,null,[""],t=function(t){return Dt=Nt=1,Tt=Rt(Vt=t),Ft=0,[]}(t),0,[0],t))}function ae(t,e,n,r,i,o,s,a,c){for(var l=0,u=0,h=s,d=0,p=0,f=0,g=1,m=1,y=1,v=0,b="",w=i,x=o,S=r,_=b;m;)switch(f=v,v=Yt()){case 40:if(108!=f&&58==Lt(_,h-1)){-1!=Et(_+=It(te(v),"&","&\f"),"&\f",Ct(l?a[l-1]:0))&&(y=-1);break}case 34:case 39:case 91:_+=te(v);break;case 9:case 10:case 13:case 32:_+=ee(f);break;case 92:_+=ne(Jt()-1,7);continue;case 47:switch(Qt()){case 42:case 47:Bt(le(ie(Yt(),Jt()),e,n,c),c);break;default:_+="/"}break;case 123*g:a[l++]=Rt(_)*y;case 125*g:case 59:case 0:switch(v){case 0:case 125:m=0;case 59+u:-1==y&&(_=It(_,/\f/g,"")),p>0&&Rt(_)-h&&Bt(p>32?ue(_+";",r,n,h-1,c):ue(It(_," ","")+";",r,n,h-2,c),c);break;case 59:_+=";";default:if(Bt(S=ce(_,e,n,l,u,i,a,b,w=[],x=[],h,o),o),123===v)if(0===u)ae(_,e,S,S,w,o,h,a,x);else switch(99===d&&110===Lt(_,3)?100:d){case 100:case 108:case 109:case 115:ae(t,S,S,r&&Bt(ce(t,S,S,0,0,i,a,b,i,w=[],h,x),x),i,x,h,a,r?w:x);break;default:ae(_,S,S,S,[""],x,0,a,x)}}l=u=p=0,g=y=1,b=_="",h=s;break;case 58:h=1+Rt(_),p=f;default:if(g<1)if(123==v)--g;else if(125==v&&0==g++&&125==Gt())continue;switch(_+=jt(v),v*g){case 38:y=u>0?1:(_+="\f",-1);break;case 44:a[l++]=(Rt(_)-1)*y,y=1;break;case 64:45===Qt()&&(_+=te(Yt())),d=Qt(),u=h=Rt(b=_+=oe(Jt())),v++;break;case 45:45===f&&2==Rt(_)&&(g=0)}}return o}function ce(t,e,n,r,i,o,s,a,c,l,u,h){for(var d=i-1,p=0===i?o:[""],f=zt(p),g=0,m=0,y=0;g<r;++g)for(var v=0,b=Mt(t,d+1,d=Ct(m=s[g])),w=t;v<f;++v)(w=Pt(m>0?p[v]+" "+b:It(b,/&\f/g,p[v])))&&(c[y++]=w);return Ht(t,e,n,0===i?_t:a,c,l,u,h)}function le(t,e,n,r){return Ht(t,e,n,St,jt(qt),Mt(t,2,-2),0,r)}function ue(t,e,n,r,i){return Ht(t,e,n,kt,Mt(t,0,r),Mt(t,r+1,-1),r,i)}function he(t,e,n){switch(function(t,e){return 45^Lt(t,0)?(((e<<2^Lt(t,0))<<2^Lt(t,1))<<2^Lt(t,2))<<2^Lt(t,3):0}(t,e)){case 5103:return xt+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return xt+t+t;case 4789:return wt+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return xt+t+wt+t+bt+t+t;case 5936:switch(Lt(t,e+11)){case 114:return xt+t+bt+It(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return xt+t+bt+It(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return xt+t+bt+It(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return xt+t+bt+t+t;case 6165:return xt+t+bt+"flex-"+t+t;case 5187:return xt+t+It(t,/(\w+).+(:[^]+)/,xt+"box-$1$2"+bt+"flex-$1$2")+t;case 5443:return xt+t+bt+"flex-item-"+It(t,/flex-|-self/g,"")+($t(t,/flex-|baseline/)?"":bt+"grid-row-"+It(t,/flex-|-self/g,""))+t;case 4675:return xt+t+bt+"flex-line-pack"+It(t,/align-content|flex-|-self/g,"")+t;case 5548:return xt+t+bt+It(t,"shrink","negative")+t;case 5292:return xt+t+bt+It(t,"basis","preferred-size")+t;case 6060:return xt+"box-"+It(t,"-grow","")+xt+t+bt+It(t,"grow","positive")+t;case 4554:return xt+It(t,/([^-])(transform)/g,"$1"+xt+"$2")+t;case 6187:return It(It(It(t,/(zoom-|grab)/,xt+"$1"),/(image-set)/,xt+"$1"),t,"")+t;case 5495:case 3959:return It(t,/(image-set\([^]*)/,xt+"$1$`$1");case 4968:return It(It(t,/(.+:)(flex-)?(.*)/,xt+"box-pack:$3"+bt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+xt+t+t;case 4200:if(!$t(t,/flex-|baseline/))return bt+"grid-column-align"+Mt(t,e)+t;break;case 2592:case 3360:return bt+It(t,"template-","")+t;case 4384:case 3616:return n&&n.some(function(t,n){return e=n,$t(t.props,/grid-\w+-end/)})?~Et(t+(n=n[e].value),"span",0)?t:bt+It(t,"-start","")+t+bt+"grid-row-span:"+(~Et(n,"span",0)?$t(n,/\d+/):+$t(n,/\d+/)-+$t(t,/\d+/))+";":bt+It(t,"-start","")+t;case 4896:case 4128:return n&&n.some(function(t){return $t(t.props,/grid-\w+-start/)})?t:bt+It(It(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return It(t,/(.+)-inline(.+)/,xt+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Rt(t)-1-e>6)switch(Lt(t,e+1)){case 109:if(45!==Lt(t,e+4))break;case 102:return It(t,/(.+:)(.+)-([^]+)/,"$1"+xt+"$2-$3$1"+wt+(108==Lt(t,e+3)?"$3":"$2-$3"))+t;case 115:return~Et(t,"stretch",0)?he(It(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return It(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(e,n,r,i,o,s,a){return bt+n+":"+r+a+(i?bt+n+"-span:"+(o?s:+s-+r)+a:"")+t});case 4949:if(121===Lt(t,e+6))return It(t,":",":"+xt)+t;break;case 6444:switch(Lt(t,45===Lt(t,14)?18:11)){case 120:return It(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+xt+(45===Lt(t,14)?"inline-":"")+"box$3$1"+xt+"$2$3$1"+bt+"$2box$3")+t;case 100:return It(t,":",":"+bt)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return It(t,"scroll-","scroll-snap-")+t}return t}function de(t,e){for(var n="",r=0;r<t.length;r++)n+=e(t[r],r,t,e)||"";return n}function pe(t,e,n,r){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case kt:return t.return=t.return||t.value;case St:return"";case Ot:return t.return=t.value+"{"+de(t.children,r)+"}";case _t:if(!Rt(t.value=t.props.join(",")))return""}return Rt(n=de(t.children,r))?t.return=t.value+"{"+n+"}":""}function fe(t,e,n,r){if(t.length>-1&&!t.return)switch(t.type){case kt:return void(t.return=he(t.value,t.length,n));case Ot:return de([Kt(t,{value:It(t.value,"@","@"+xt)})],r);case _t:if(t.length)return function(t,e){return t.map(e).join("")}(n=t.props,function(e){switch($t(e,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Wt(Kt(t,{props:[It(e,/:(read-\w+)/,":-moz-$1")]})),Wt(Kt(t,{props:[e]})),At(t,{props:Ut(n,r)});break;case"::placeholder":Wt(Kt(t,{props:[It(e,/:(plac\w+)/,":"+xt+"input-$1")]})),Wt(Kt(t,{props:[It(e,/:(plac\w+)/,":-moz-$1")]})),Wt(Kt(t,{props:[It(e,/:(plac\w+)/,bt+"input-$1")]})),Wt(Kt(t,{props:[e]})),At(t,{props:Ut(n,r)})}return""})}}var ge={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},me="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",ye="active",ve="data-styled-version",be="6.1.19",we="/*!sc*/\n",xe="undefined"!=typeof window&&"undefined"!=typeof document,Se=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY),_e=(new Set,Object.freeze([])),ke=Object.freeze({});var Oe=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Ce=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,je=/(^-|-$)/g;function Ae(t){return t.replace(Ce,"-").replace(je,"")}var Pe=/(a)(d)/gi,$e=function(t){return String.fromCharCode(t+(t>25?39:97))};function Ie(t){var e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=$e(e%52)+n;return($e(e%52)+n).replace(Pe,"$1-$2")}var Ee,Le=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},Me=function(t){return Le(5381,t)};function Re(t){return Ie(Me(t)>>>0)}function ze(t){return"string"==typeof t&&!0}var Be="function"==typeof Symbol&&Symbol.for,Ue=Be?Symbol.for("react.memo"):60115,De=Be?Symbol.for("react.forward_ref"):60112,Ne={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Te={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Fe={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},qe=((Ee={})[De]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Ee[Ue]=Fe,Ee);function Ve(t){return("type"in(e=t)&&e.type.$$typeof)===Ue?Fe:"$$typeof"in t?qe[t.$$typeof]:Ne;var e}var He=Object.defineProperty,Ke=Object.getOwnPropertyNames,We=Object.getOwnPropertySymbols,Ge=Object.getOwnPropertyDescriptor,Ye=Object.getPrototypeOf,Qe=Object.prototype;function Je(t,e,n){if("string"!=typeof e){if(Qe){var r=Ye(e);r&&r!==Qe&&Je(t,r,n)}var i=Ke(e);We&&(i=i.concat(We(e)));for(var o=Ve(t),s=Ve(e),a=0;a<i.length;++a){var c=i[a];if(!(c in Te||n&&n[c]||s&&c in s||o&&c in o)){var l=Ge(e,c);try{He(t,c,l)}catch(t){}}}}return t}function Xe(t){return"function"==typeof t}function Ze(t){return"object"==typeof t&&"styledComponentId"in t}function tn(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function en(t,e){if(0===t.length)return"";for(var n=t[0],r=1;r<t.length;r++)n+=e?e+t[r]:t[r];return n}function nn(t){return null!==t&&"object"==typeof t&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function rn(t,e,n){if(void 0===n&&(n=!1),!n&&!nn(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var r=0;r<e.length;r++)t[r]=rn(t[r],e[r]);else if(nn(e))for(var r in e)t[r]=rn(t[r],e[r]);return t}function on(t,e){Object.defineProperty(t,"toString",{value:e})}function sn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var an=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return t.prototype.indexOfGroup=function(t){for(var e=0,n=0;n<t;n++)e+=this.groupSizes[n];return e},t.prototype.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;t>=i;)if((i<<=1)<0)throw sn(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o<i;o++)this.groupSizes[o]=0}for(var s=this.indexOfGroup(t+1),a=(o=0,e.length);o<a;o++)this.tag.insertRule(s,e[o])&&(this.groupSizes[t]++,s++)},t.prototype.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],n=this.indexOfGroup(t),r=n+e;this.groupSizes[t]=0;for(var i=n;i<r;i++)this.tag.deleteRule(n)}},t.prototype.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var n=this.groupSizes[t],r=this.indexOfGroup(t),i=r+n,o=r;o<i;o++)e+="".concat(this.tag.getRule(o)).concat(we);return e},t}(),cn=new Map,ln=new Map,un=1,hn=function(t){if(cn.has(t))return cn.get(t);for(;ln.has(un);)un++;var e=un++;return cn.set(t,e),ln.set(e,t),e},dn=function(t,e){un=e+1,cn.set(t,e),ln.set(e,t)},pn="style[".concat(me,"][").concat(ve,'="').concat(be,'"]'),fn=new RegExp("^".concat(me,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),gn=function(t,e,n){for(var r,i=n.split(","),o=0,s=i.length;o<s;o++)(r=i[o])&&t.registerName(e,r)},mn=function(t,e){for(var n,r=(null!==(n=e.textContent)&&void 0!==n?n:"").split(we),i=[],o=0,s=r.length;o<s;o++){var a=r[o].trim();if(a){var c=a.match(fn);if(c){var l=0|parseInt(c[1],10),u=c[2];0!==l&&(dn(u,l),gn(t,u,c[3]),t.getTag().insertRules(l,i)),i.length=0}else i.push(a)}}},yn=function(t){for(var e=document.querySelectorAll(pn),n=0,r=e.length;n<r;n++){var i=e[n];i&&i.getAttribute(me)!==ye&&(mn(t,i),i.parentNode&&i.parentNode.removeChild(i))}};function vn(){return i.nc}var bn=function(t){var e=document.head,n=t||e,r=document.createElement("style"),i=function(t){var e=Array.from(t.querySelectorAll("style[".concat(me,"]")));return e[e.length-1]}(n),o=void 0!==i?i.nextSibling:null;r.setAttribute(me,ye),r.setAttribute(ve,be);var s=vn();return s&&r.setAttribute("nonce",s),n.insertBefore(r,o),r},wn=function(){function t(t){this.element=bn(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,n=0,r=e.length;n<r;n++){var i=e[n];if(i.ownerNode===t)return i}throw sn(17)}(this.element),this.length=0}return t.prototype.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch(t){return!1}},t.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},t.prototype.getRule=function(t){var e=this.sheet.cssRules[t];return e&&e.cssText?e.cssText:""},t}(),xn=function(){function t(t){this.element=bn(t),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(t,e){if(t<=this.length&&t>=0){var n=document.createTextNode(e);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},t.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),Sn=function(){function t(t){this.rules=[],this.length=0}return t.prototype.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},t.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},t.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),_n=xe,kn={isServer:!xe,useCSSOMInjection:!Se},On=function(){function t(t,e,n){void 0===t&&(t=ke),void 0===e&&(e={});var r=this;this.options=gt(gt({},kn),t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&xe&&_n&&(_n=!1,yn(this)),on(this,function(){return function(t){for(var e=t.getTag(),n=e.length,r="",i=function(n){var i=function(t){return ln.get(t)}(n);if(void 0===i)return"continue";var o=t.names.get(i),s=e.getGroup(n);if(void 0===o||!o.size||0===s.length)return"continue";var a="".concat(me,".g").concat(n,'[id="').concat(i,'"]'),c="";void 0!==o&&o.forEach(function(t){t.length>0&&(c+="".concat(t,","))}),r+="".concat(s).concat(a,'{content:"').concat(c,'"}').concat(we)},o=0;o<n;o++)i(o);return r}(r)})}return t.registerId=function(t){return hn(t)},t.prototype.rehydrate=function(){!this.server&&xe&&yn(this)},t.prototype.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(gt(gt({},this.options),e),this.gs,n&&this.names||void 0)},t.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(t=function(t){var e=t.useCSSOMInjection,n=t.target;return t.isServer?new Sn(n):e?new wn(n):new xn(n)}(this.options),new an(t)));var t},t.prototype.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},t.prototype.registerName=function(t,e){if(hn(t),this.names.has(t))this.names.get(t).add(e);else{var n=new Set;n.add(e),this.names.set(t,n)}},t.prototype.insertRules=function(t,e,n){this.registerName(t,e),this.getTag().insertRules(hn(t),n)},t.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},t.prototype.clearRules=function(t){this.getTag().clearGroup(hn(t)),this.clearNames(t)},t.prototype.clearTag=function(){this.tag=void 0},t}(),Cn=/&/g,jn=/^\s*\/\/.*$/gm;function An(t,e){return t.map(function(t){return"rule"===t.type&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map(function(t){return"".concat(e," ").concat(t)})),Array.isArray(t.children)&&"@keyframes"!==t.type&&(t.children=An(t.children,e)),t})}function Pn(t){var e,n,r,i=void 0===t?ke:t,o=i.options,s=void 0===o?ke:o,a=i.plugins,c=void 0===a?_e:a,l=function(t,r,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(e):t},u=c.slice();u.push(function(t){t.type===_t&&t.value.includes("&")&&(t.props[0]=t.props[0].replace(Cn,n).replace(r,l))}),s.prefix&&u.push(fe),u.push(pe);var h=function(t,i,o,a){void 0===i&&(i=""),void 0===o&&(o=""),void 0===a&&(a="&"),e=a,n=i,r=new RegExp("\\".concat(n,"\\b"),"g");var c=t.replace(jn,""),l=se(o||i?"".concat(o," ").concat(i," { ").concat(c," }"):c);s.namespace&&(l=An(l,s.namespace));var h,d,p,f=[];return de(l,(h=u.concat((p=function(t){return f.push(t)},function(t){t.root||(t=t.return)&&p(t)})),d=zt(h),function(t,e,n,r){for(var i="",o=0;o<d;o++)i+=h[o](t,e,n,r)||"";return i})),f};return h.hash=c.length?c.reduce(function(t,e){return e.name||sn(15),Le(t,e.name)},5381).toString():"",h}var $n=new On,In=Pn(),En=e().createContext({shouldForwardProp:void 0,styleSheet:$n,stylis:In}),Ln=(En.Consumer,e().createContext(void 0));function Mn(){return(0,t.useContext)(En)}function Rn(n){var r=(0,t.useState)(n.stylisPlugins),i=r[0],o=r[1],s=Mn().styleSheet,a=(0,t.useMemo)(function(){var t=s;return n.sheet?t=n.sheet:n.target&&(t=t.reconstructWithOptions({target:n.target},!1)),n.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t},[n.disableCSSOMInjection,n.sheet,n.target,s]),c=(0,t.useMemo)(function(){return Pn({options:{namespace:n.namespace,prefix:n.enableVendorPrefixes},plugins:i})},[n.enableVendorPrefixes,n.namespace,i]);(0,t.useEffect)(function(){vt()(i,n.stylisPlugins)||o(n.stylisPlugins)},[n.stylisPlugins]);var l=(0,t.useMemo)(function(){return{shouldForwardProp:n.shouldForwardProp,styleSheet:a,stylis:c}},[n.shouldForwardProp,a,c]);return e().createElement(En.Provider,{value:l},e().createElement(Ln.Provider,{value:c},n.children))}var zn=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=In);var r=n.name+e.hash;t.hasNameForId(n.id,r)||t.insertRules(n.id,r,e(n.rules,r,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=e,on(this,function(){throw sn(12,String(n.name))})}return t.prototype.getName=function(t){return void 0===t&&(t=In),this.name+t.hash},t}(),Bn=function(t){return t>="A"&&t<="Z"};function Un(t){for(var e="",n=0;n<t.length;n++){var r=t[n];if(1===n&&"-"===r&&"-"===t[0])return t;Bn(r)?e+="-"+r.toLowerCase():e+=r}return e.startsWith("ms-")?"-"+e:e}var Dn=function(t){return null==t||!1===t||""===t},Nn=function(t){var e,n,r=[];for(var i in t){var o=t[i];t.hasOwnProperty(i)&&!Dn(o)&&(Array.isArray(o)&&o.isCss||Xe(o)?r.push("".concat(Un(i),":"),o,";"):nn(o)?r.push.apply(r,mt(mt(["".concat(i," {")],Nn(o),!1),["}"],!1)):r.push("".concat(Un(i),": ").concat((e=i,null==(n=o)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||e in ge||e.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return r};function Tn(t,e,n,r){return Dn(t)?[]:Ze(t)?[".".concat(t.styledComponentId)]:Xe(t)?!Xe(i=t)||i.prototype&&i.prototype.isReactComponent||!e?[t]:Tn(t(e),e,n,r):t instanceof zn?n?(t.inject(n,r),[t.getName(r)]):[t]:nn(t)?Nn(t):Array.isArray(t)?Array.prototype.concat.apply(_e,t.map(function(t){return Tn(t,e,n,r)})):[t.toString()];var i}function Fn(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(Xe(n)&&!Ze(n))return!1}return!0}var qn=Me(be),Vn=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Fn(t),this.componentId=e,this.baseHash=Le(qn,e),this.baseStyle=n,On.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,e,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(this.componentId,this.staticRulesId))r=tn(r,this.staticRulesId);else{var i=en(Tn(this.rules,t,e,n)),o=Ie(Le(this.baseHash,i)>>>0);if(!e.hasNameForId(this.componentId,o)){var s=n(i,".".concat(o),void 0,this.componentId);e.insertRules(this.componentId,o,s)}r=tn(r,o),this.staticRulesId=o}else{for(var a=Le(this.baseHash,n.hash),c="",l=0;l<this.rules.length;l++){var u=this.rules[l];if("string"==typeof u)c+=u;else if(u){var h=en(Tn(u,t,e,n));a=Le(a,h+l),c+=h}}if(c){var d=Ie(a>>>0);e.hasNameForId(this.componentId,d)||e.insertRules(this.componentId,d,n(c,".".concat(d),void 0,this.componentId)),r=tn(r,d)}}return r},t}(),Hn=e().createContext(void 0);function Kn(n){var r=e().useContext(Hn),i=(0,t.useMemo)(function(){return function(t,e){if(!t)throw sn(14);if(Xe(t))return t(e);if(Array.isArray(t)||"object"!=typeof t)throw sn(8);return e?gt(gt({},e),t):t}(n.theme,r)},[n.theme,r]);return n.children?e().createElement(Hn.Provider,{value:i},n.children):null}Hn.Consumer;var Wn={};function Gn(n,r,i){var o=Ze(n),s=n,a=!ze(n),c=r.attrs,l=void 0===c?_e:c,u=r.componentId,h=void 0===u?function(t,e){var n="string"!=typeof t?"sc":Ae(t);Wn[n]=(Wn[n]||0)+1;var r="".concat(n,"-").concat(Re(be+n+Wn[n]));return e?"".concat(e,"-").concat(r):r}(r.displayName,r.parentComponentId):u,d=r.displayName,p=void 0===d?function(t){return ze(t)?"styled.".concat(t):"Styled(".concat(function(t){return t.displayName||t.name||"Component"}(t),")")}(n):d,f=r.displayName&&r.componentId?"".concat(Ae(r.displayName),"-").concat(r.componentId):r.componentId||h,g=o&&s.attrs?s.attrs.concat(l).filter(Boolean):l,m=r.shouldForwardProp;if(o&&s.shouldForwardProp){var y=s.shouldForwardProp;if(r.shouldForwardProp){var v=r.shouldForwardProp;m=function(t,e){return y(t,e)&&v(t,e)}}else m=y}var b=new Vn(i,f,o?s.componentStyle:void 0);function w(n,r){return function(n,r,i){var o=n.attrs,s=n.componentStyle,a=n.defaultProps,c=n.foldedComponentIds,l=n.styledComponentId,u=n.target,h=e().useContext(Hn),d=Mn(),p=n.shouldForwardProp||d.shouldForwardProp,f=function(t,e,n){return void 0===n&&(n=ke),t.theme!==n.theme&&t.theme||e||n.theme}(r,h,a)||ke,g=function(t,e,n){for(var r,i=gt(gt({},e),{className:void 0,theme:n}),o=0;o<t.length;o+=1){var s=Xe(r=t[o])?r(i):r;for(var a in s)i[a]="className"===a?tn(i[a],s[a]):"style"===a?gt(gt({},i[a]),s[a]):s[a]}return e.className&&(i.className=tn(i.className,e.className)),i}(o,r,f),m=g.as||u,y={};for(var v in g)void 0===g[v]||"$"===v[0]||"as"===v||"theme"===v&&g.theme===f||("forwardedAs"===v?y.as=g.forwardedAs:p&&!p(v,m)||(y[v]=g[v]));var b=function(t,e){var n=Mn();return t.generateAndInjectStyles(e,n.styleSheet,n.stylis)}(s,g),w=tn(c,l);return b&&(w+=" "+b),g.className&&(w+=" "+g.className),y[ze(m)&&!Oe.has(m)?"class":"className"]=w,i&&(y.ref=i),(0,t.createElement)(m,y)}(x,n,r)}w.displayName=p;var x=e().forwardRef(w);return x.attrs=g,x.componentStyle=b,x.displayName=p,x.shouldForwardProp=m,x.foldedComponentIds=o?tn(s.foldedComponentIds,s.styledComponentId):"",x.styledComponentId=f,x.target=o?s.target:n,Object.defineProperty(x,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=o?function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++)rn(t,i[r],!0);return t}({},s.defaultProps,t):t}}),on(x,function(){return".".concat(x.styledComponentId)}),a&&Je(x,n,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),x}function Yn(t,e){for(var n=[t[0]],r=0,i=e.length;r<i;r+=1)n.push(e[r],t[r+1]);return n}new Set;var Qn=function(t){return Object.assign(t,{isCss:!0})};function Jn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Xe(t)||nn(t))return Qn(Tn(Yn(_e,mt([t],e,!0))));var r=t;return 0===e.length&&1===r.length&&"string"==typeof r[0]?Tn(r):Qn(Tn(Yn(r,e)))}function Xn(t,e,n){if(void 0===n&&(n=ke),!e)throw sn(1,e);var r=function(r){for(var i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];return t(e,n,Jn.apply(void 0,mt([r],i,!1)))};return r.attrs=function(r){return Xn(t,e,gt(gt({},n),{attrs:Array.prototype.concat(n.attrs,r).filter(Boolean)}))},r.withConfig=function(r){return Xn(t,e,gt(gt({},n),r))},r}var Zn=function(t){return Xn(Gn,t)},tr=Zn;function er(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=en(Jn.apply(void 0,mt([t],e,!1))),i=Re(r);return new zn(i,r)}Oe.forEach(function(t){tr[t]=Zn(t)}),function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=Fn(t),On.registerId(this.componentId+1)}t.prototype.createStyles=function(t,e,n,r){var i=r(en(Tn(this.rules,e,n,r)),""),o=this.componentId+t;n.insertRules(o,o,i)},t.prototype.removeStyles=function(t,e){e.clearRules(this.componentId+t)},t.prototype.renderStyles=function(t,e,n,r){t>2&&On.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,r)}}(),function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString();if(!e)return"";var n=vn(),r=en([n&&'nonce="'.concat(n,'"'),"".concat(me,'="true"'),"".concat(ve,'="').concat(be,'"')].filter(Boolean)," ");return"<style ".concat(r,">").concat(e,"</style>")},this.getStyleTags=function(){if(t.sealed)throw sn(2);return t._emitSheetCSS()},this.getStyleElement=function(){var n;if(t.sealed)throw sn(2);var r=t.instance.toString();if(!r)return[];var i=((n={})[me]="",n[ve]=be,n.dangerouslySetInnerHTML={__html:r},n),o=vn();return o&&(i.nonce=o),[e().createElement("style",gt({},i,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new On({isServer:!0}),this.sealed=!1}t.prototype.collectStyles=function(t){if(this.sealed)throw sn(2);return e().createElement(Rn,{sheet:this.instance},t)},t.prototype.interleaveWithNodeStream=function(t){throw sn(3)}}(),"__sc-".concat(me,"__");var nr={colors:{primary:"rgba(33, 150, 243, 1)",primaryHover:"rgba(25, 118, 210, 1)",secondary:"rgba(3, 169, 244, 1)",accent:"rgba(255, 64, 129, 1)",background:"rgba(255, 255, 255, 1)",backgroundSecondary:"rgba(245, 245, 245, 1)",surfaceOverlay:"rgba(0, 0, 0, 0.05)",text:"rgba(33, 33, 33, 1)",textSecondary:"rgba(117, 117, 117, 1)",textInverse:"rgba(255, 255, 255, 1)",success:"rgba(76, 175, 80, 1)",error:"rgba(244, 67, 54, 1)",warning:"rgba(255, 152, 0, 1)",border:"rgba(224, 224, 224, 1)",shadow:"rgba(0, 0, 0, 0.1)",shadowMedium:"rgba(0, 0, 0, 0.15)",shadowStrong:"rgba(0, 0, 0, 0.25)",backdrop:"rgba(0, 0, 0, 0.3)"},gradients:{surface:"linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 245, 245, 0.9) 100%)",homePage:"linear-gradient(90deg, rgba(227, 242, 253, 1) 0%, rgba(187, 222, 251, 1) 100%)"},qrCode:{dotsColor:"rgba(33, 150, 243, 1)",cornersColor:"rgba(33, 150, 243, 1)",cornerDotsColor:"rgba(33, 150, 243, 1)",backgroundColor:"rgba(255, 255, 255, 1)"}},rr={colors:{primary:"rgba(33, 150, 243, 1)",primaryHover:"rgba(25, 118, 210, 1)",secondary:"rgba(79, 195, 247, 1)",accent:"rgba(255, 64, 129, 1)",background:"rgba(15, 14, 31, 1)",backgroundSecondary:"rgba(26, 24, 41, 1)",surfaceOverlay:"rgba(255, 255, 255, 0.05)",text:"rgba(255, 255, 255, 1)",textSecondary:"rgba(117, 117, 117, 1)",textInverse:"rgba(33, 33, 33, 1)",success:"rgba(102, 187, 106, 1)",error:"rgba(239, 83, 80, 1)",warning:"rgba(255, 167, 38, 1)",border:"rgba(44, 42, 63, 1)",shadow:"rgba(0, 0, 0, 0.3)",shadowMedium:"rgba(0, 0, 0, 0.4)",shadowStrong:"rgba(0, 0, 0, 0.5)",backdrop:"rgba(16, 54, 84, 0.3)"},gradients:{surface:"linear-gradient(180deg, rgba(8, 19, 28, 0.7) 0%, rgba(8, 19, 28, 0.4) 100%)",homePage:"linear-gradient(90deg, rgba(11, 11, 39, 1) 0%, rgba(30, 27, 126, 1) 100%)"},qrCode:{dotsColor:"rgba(33, 150, 243, 1)",cornersColor:"rgba(33, 150, 243, 1)",cornerDotsColor:"rgba(33, 150, 243, 1)",backgroundColor:"rgba(255, 255, 255, 1)"}};function ir(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var or,sr=(0,t.createContext)(),ar=function(e){var n,r,i=e.children,o=(n=(0,t.useState)(m),r=2,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(n,r)||function(t,e){if(t){if("string"==typeof t)return ir(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ir(t,e):void 0}}(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=o[0],a=o[1],c=s===g?nr:rr,l={theme:c,themeMode:s,setTheme:function(t){t!==g&&t!==m||a(t)},isDark:s===m,isLight:s===g};return(0,X.jsx)(sr.Provider,{value:l,children:(0,X.jsx)(Kn,{theme:c,children:i})})};function cr(t){var e=t.children;return(0,X.jsx)(ar,{children:(0,X.jsx)(ot,{children:(0,X.jsx)(ft,{children:e})})})}function lr(){return lr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},lr.apply(null,arguments)}const ur=function(e){return t.createElement("svg",lr({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e),or||(or=t.createElement("path",{fill:"#0F0F0F",d:"M6.995 7.006a1 1 0 0 0 0 1.415l3.585 3.585-3.585 3.585a1 1 0 1 0 1.414 1.414l3.585-3.585 3.585 3.585a1 1 0 0 0 1.415-1.414l-3.586-3.585 3.586-3.585a1 1 0 0 0-1.415-1.415l-3.585 3.585L8.41 7.007a1 1 0 0 0-1.414 0"})))};var hr,dr,pr,fr,gr,mr,yr,vr,br=tr.button(hr||(yr=["\n all: initial;\n position: absolute;\n top: 12px;\n right: 8px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 24px;\n height: 24px;\n padding: 0;\n\n background: transparent;\n border: none;\n cursor: pointer;\n\n svg {\n width: 24px;\n height: 24px;\n\n path {\n fill: ",";\n }\n\n &:hover path {\n fill: ",";\n }\n }\n"],vr||(vr=yr.slice(0)),hr=Object.freeze(Object.defineProperties(yr,{raw:{value:Object.freeze(vr)}}))),function(t){return t.theme.colors.text},function(t){return t.theme.colors.primary});function wr(){var t=it().callbacks;return(0,X.jsx)(br,{onClick:function(){t[r]()},children:(0,X.jsx)(ur,{})})}function xr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Sr(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var _r,kr,Or,Cr=er(dr||(dr=Sr(["\n 0% { transform: rotateY(0deg); opacity: 1; }\n 100% { transform: rotateY(90deg); opacity: 0; }\n"]))),jr=tr.div(pr||(pr=Sr(["\n all: initial;\n box-sizing: border-box;\n position: fixed;\n top: -10000px;\n left: -10000px;\n right: -10000px;\n bottom: -10000px;\n z-index: ",";\n backdrop-filter: blur(8px);\n"])),function(){return c}),Ar=tr.div(fr||(fr=Sr(["\n all: initial;\n box-sizing: border-box;\n position: fixed;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n\n z-index: ",';\n p,\n span,\n button,\n a,\n h1,\n h2 {\n font-family: "Roboto", Arial, sans-serif;\n }\n a {\n text-decoration: none;\n }\n'])),function(){return c}),Pr=tr.div(gr||(gr=Sr(["\n all: initial;\n box-sizing: border-box;\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 4px;\n width: 375px;\n margin: 0 auto;\n padding: 40px 24px;\n min-height: 500px;\n user-select: none;\n background-color: ",";\n box-shadow: 0 0 0 9999px ",";\n border-radius: 12px;\n\n transform-style: preserve-3d;\n backface-visibility: hidden;\n transform-origin: center;\n\n ","\n\n @media (max-width: 480px) {\n width: 100%;\n height: 100dvh;\n border-radius: 0;\n padding: 24px 16px;\n }\n"])),function(t){return t.theme.colors.background},function(t){return t.theme.colors.backdrop},function(t){return t.$isClosing&&Jn(mr||(mr=Sr(["\n animation: "," 500ms linear;\n "])),Cr)}),$r=function(e){var n=e.children,i=it(),o=i.callbacks,s=i.closing,a=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return xr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xr(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,t.useState)(!1),2),c=a[0],l=a[1];return(0,t.useEffect)(function(){if(s){var t=setTimeout(function(){return l(!0)},4e3);return function(){return clearTimeout(t)}}},[s]),(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(jr,{}),(0,X.jsx)(Ar,{children:(0,X.jsxs)(Pr,{$isClosing:c,onAnimationEnd:function(){c&&o[r]()},children:[(0,X.jsx)(wr,{}),n]})})]})};function Ir(){return Ir=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Ir.apply(null,arguments)}const Er=function(e){return t.createElement("svg",Ir({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 1024 1024"},e),_r||(_r=t.createElement("path",{fill:"#fff",d:"M182 898.827V795.173h15.835v89.433h56.47v14.221zM268.804 898.827V795.173h15.835v103.654zM309.357 898.827V795.173h40.186q7.62 0 13.894 1.319 6.423 1.174 11.055 4.252 4.63 2.933 7.021 8.064 2.54 4.985 2.54 12.608 0 7.477-3.436 13.489-3.436 5.863-10.458 8.796 9.412 2.053 14.192 8.357 4.93 6.304 4.93 16.567 0 8.798-3.286 14.661-3.287 5.865-9.113 9.237t-13.445 4.838q-7.62 1.466-16.284 1.466zm15.836-14.221h22.558a92 92 0 0 0 8.963-.44q4.482-.587 8.217-2.199 3.884-1.613 6.125-4.838 2.39-3.226 2.39-8.65 0-4.545-1.793-7.478-1.792-3.078-4.78-4.838-2.988-1.759-7.022-2.492a43.4 43.4 0 0 0-8.067-.733h-26.591zm0-45.01h20.018q5.08 0 9.262-.88 4.333-.879 7.47-2.932t4.78-5.131q1.793-3.226 1.793-7.771.15-6.01-2.689-8.796-2.69-2.933-7.32-3.812-4.632-1.026-10.159-1.026h-23.155zM408.42 898.827V795.173h72.753v14.221h-56.918v31.082h50.344v14.074h-50.344v30.056h56.918v14.221zM500.184 898.827V795.173h40.634q8.515 0 15.536 1.759 7.022 1.613 12.25 5.425 5.229 3.665 8.067 9.969 2.84 6.305 2.839 15.541 0 8.357-2.988 14.368t-8.216 9.97-11.802 6.011l22.558 40.611h-17.479l-20.915-38.119h-24.649v38.119zm15.835-52.047h21.512q5.379 0 10.009-.733 4.78-.88 8.366-2.932 3.585-2.199 5.528-5.865 2.091-3.811 2.091-9.676.15-6.744-2.689-10.703-2.69-4.104-8.067-5.717-5.378-1.76-12.997-1.76h-23.753zM599.972 898.827V795.173h15.835v103.654zM685.342 900q-16.283 0-27.637-6.744-11.204-6.89-17.03-18.913t-5.827-27.27q0-15.393 5.827-27.416 5.826-12.022 17.179-18.766Q669.209 794 685.492 794q16.432 0 27.637 6.744 11.204 6.744 17.03 18.766 5.826 12.023 5.826 27.417 0 15.248-5.826 27.269-5.826 12.022-17.18 18.913Q701.776 900 685.342 900m.15-14.221q11.95 0 19.57-5.425 7.619-5.425 11.204-14.221 3.585-8.797 3.585-19.06 0-7.77-2.091-14.807-1.942-7.038-6.125-12.462-4.183-5.425-10.756-8.504t-15.387-3.079q-11.803 0-19.57 5.425-7.62 5.425-11.354 14.221-3.735 8.798-3.735 19.206 0 10.263 3.585 19.06 3.735 8.796 11.354 14.221 7.768 5.424 19.72 5.425M754.906 898.827V795.173h18.375l53.033 80.929v-80.929H842v103.654h-17.927l-53.332-80.49v80.49zM300.339 274.015C339.543 196.967 419.631 144.182 512 144.182s172.457 52.785 211.661 129.833c3.1-2.681 6.14-5.421 9.14-8.241a347 347 0 0 0 6.201-5.961C695.578 178.945 610.19 124 512 124s-183.578 54.945-227.002 135.813c2.04 2 4.1 4.001 6.2 5.961a298 298 0 0 0 9.141 8.241M412.93 558.303c0-.16 0-.34-.04-.5-1.4-21.182-6.28-43.845-19.002-62.186-22.002-31.723-68.506-52.005-83.868-58.706-4.68-2.04-19.522-8.581-32.823-23.502-2.04-2.301-5.121-6.101-8.261-11.621-.6-1.081-1.22-2.201-1.82-3.421-5.641 56.406 7.941 83.108 22.782 96.97 23.302 21.782 55.246 16.981 96.77 50.905a185 185 0 0 1 26.502 26.602c.04-5.08-.06-9.921-.26-14.541z"})),kr||(kr=t.createElement("path",{fill:"#fff",d:"M516.701 206.526c-1.581-.1-3.141-.14-4.701-.14s-3.12.04-4.7.14c-36.204 2.28-65.587 31.623-67.907 67.826-2.74 42.365 30.823 77.608 72.607 77.608s75.347-35.243 72.607-77.608c-2.32-36.203-31.703-65.546-67.906-67.826M755.084 401.788c-3.12 5.52-6.201 9.32-8.261 11.621-13.301 14.941-28.143 21.462-32.823 23.502-15.362 6.701-61.866 26.983-83.868 58.706-12.742 18.341-17.622 41.004-19.002 62.186 0 .16 0 .34-.04.5-.2 4.62-.3 9.461-.26 14.541 5.62-6.92 14.361-16.701 26.502-26.602 41.544-33.924 73.468-29.123 96.77-50.905 14.841-13.862 28.423-40.564 22.782-96.97-.58 1.2-1.2 2.34-1.82 3.421z"})),Or||(Or=t.createElement("path",{fill:"#fff",d:"M594.208 604.349c-2.86-26.483-9.281-84.789 18.542-124.313 24.063-34.203 74.887-56.045 91.689-63.266 5.121-2.2 21.342-9.261 35.884-25.342 2.24-2.48 5.6-6.581 9.02-12.521 3.061-5.321 6.161-12.142 8.541-20.642 5.501-19.662 4.521-40.604-2.06-59.926a259 259 0 0 0-7.601-19.582 312 312 0 0 1-15.421 15.461C675.076 348.404 597.429 381.567 512 381.567c-85.428 0-163.076-33.163-220.801-87.349a312 312 0 0 1-15.422-15.461 260 260 0 0 0-7.601 19.582c-6.58 19.322-7.56 40.264-2.06 59.926 2.381 8.5 5.481 15.321 8.541 20.642 3.42 5.94 6.781 10.041 9.021 12.521 14.541 16.081 30.763 23.142 35.884 25.342 16.801 7.221 67.626 29.063 91.688 63.266 27.823 39.524 21.403 97.83 18.542 124.313-.72 6.64-1.66 13.461-2.8 20.422-4.42 27.082-11.961 56.325-23.122 86.668 0 0 23.682 12.681 80.808 12.561 4.38-18.421 8.54-37.503 12.401-57.205 1.84-9.381 3.58-18.662 5.2-27.843 1.2-6.741 2.341-13.441 3.421-20.062q1.92-11.761 3.6-23.282c.24-1.56 1.48-2.34 2.7-2.32 1.22 0 2.461.76 2.701 2.32q1.68 11.521 3.6 23.282c1.08 6.621 2.22 13.321 3.42 20.062 1.62 9.181 3.361 18.462 5.201 27.843A1465 1465 0 0 0 539.323 724c57.126.12 80.808-12.561 80.808-12.561-11.161-30.343-18.702-59.586-23.122-86.668a380 380 0 0 1-2.801-20.422"})))};var Lr,Mr;function Rr(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var zr=tr.div(Lr||(Lr=Rr(["\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n svg {\n width: 300px;\n path {\n fill: ",";\n }\n }\n"])),function(t){return t.theme.colors.primary}),Br=tr.div(Mr||(Mr=Rr(["\n display: inline-block;\n width: 70px;\n height: 70px;\n margin: 0 auto;\n border-radius: 50%;\n\n border-top: 5px solid ",";\n border-right: 5px solid transparent;\n box-sizing: border-box;\n animation: rotation 1s linear infinite;\n\n @keyframes rotation {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])),function(t){return t.theme.colors.primary});function Ur(){return(0,X.jsxs)(zr,{children:[(0,X.jsx)(Er,{}),(0,X.jsx)(Br,{})]})}function Dr(){var e=it().navigate,n=pt(),r=n.link,i=n.authStatus;return(0,t.useEffect)(function(){(r||i===h)&&setTimeout(function(){e({path:J,params:{}})},200)},[r,e,i]),(0,X.jsx)(Ur,{})}const Nr=t=>"string"==typeof t,Tr=()=>{let t,e;const n=new Promise((n,r)=>{t=n,e=r});return n.resolve=t,n.reject=e,n},Fr=t=>null==t?"":""+t,qr=/###/g,Vr=t=>t&&t.indexOf("###")>-1?t.replace(qr,"."):t,Hr=t=>!t||Nr(t),Kr=(t,e,n)=>{const r=Nr(e)?e.split("."):e;let i=0;for(;i<r.length-1;){if(Hr(t))return{};const e=Vr(r[i]);!t[e]&&n&&(t[e]=new n),t=Object.prototype.hasOwnProperty.call(t,e)?t[e]:{},++i}return Hr(t)?{}:{obj:t,k:Vr(r[i])}},Wr=(t,e,n)=>{const{obj:r,k:i}=Kr(t,e,Object);if(void 0!==r||1===e.length)return void(r[i]=n);let o=e[e.length-1],s=e.slice(0,e.length-1),a=Kr(t,s,Object);for(;void 0===a.obj&&s.length;)o=`${s[s.length-1]}.${o}`,s=s.slice(0,s.length-1),a=Kr(t,s,Object),a?.obj&&void 0!==a.obj[`${a.k}.${o}`]&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=n},Gr=(t,e)=>{const{obj:n,k:r}=Kr(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Yr=(t,e,n)=>{for(const r in e)"__proto__"!==r&&"constructor"!==r&&(r in t?Nr(t[r])||t[r]instanceof String||Nr(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):Yr(t[r],e[r],n):t[r]=e[r]);return t},Qr=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Jr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Xr=t=>Nr(t)?t.replace(/[&<>"'\/]/g,t=>Jr[t]):t,Zr=[" ",",","?","!",";"],ti=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const e=this.regExpMap.get(t);if(void 0!==e)return e;const n=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,n),this.regExpQueue.push(t),n}}(20),ei=(t,e,n=".")=>{if(!t)return;if(t[e]){if(!Object.prototype.hasOwnProperty.call(t,e))return;return t[e]}const r=e.split(n);let i=t;for(let o=0;o<r.length;){if(!i||"object"!=typeof i)return;let t,e="";for(let s=o;s<r.length;++s)if(s!==o&&(e+=n),e+=r[s],t=i[e],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&s<r.length-1)continue;o+=s-o+1;break}i=t}return i},ni=t=>t?.replace("_","-"),ri={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){}};class ii{constructor(t,e={}){this.init(t,e)}init(t,e={}){this.prefix=e.prefix||"i18next:",this.logger=t||ri,this.options=e,this.debug=e.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,e,n,r){return r&&!this.debug?null:(Nr(t[0])&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[e](t))}create(t){return new ii(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new ii(this.logger,t)}}var oi=new ii;class si{constructor(){this.observers={}}on(t,e){return t.split(" ").forEach(t=>{this.observers[t]||(this.observers[t]=new Map);const n=this.observers[t].get(e)||0;this.observers[t].set(e,n+1)}),this}off(t,e){this.observers[t]&&(e?this.observers[t].delete(e):delete this.observers[t])}emit(t,...e){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([t,n])=>{for(let r=0;r<n;r++)t(...e)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[t,...e])})}}class ai extends si{constructor(t,e={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,e,n,r={}){const i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,e],n&&(Array.isArray(n)?s.push(...n):Nr(n)&&i?s.push(...n.split(i)):s.push(n)));const a=Gr(this.data,s);return!a&&!e&&!n&&t.indexOf(".")>-1&&(t=s[0],e=s[1],n=s.slice(2).join(".")),!a&&o&&Nr(n)?ei(this.data?.[t]?.[e],n,i):a}addResource(t,e,n,r,i={silent:!1}){const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let s=[t,e];n&&(s=s.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(s=t.split("."),r=e,e=s[1]),this.addNamespaces(e),Wr(this.data,s,r),i.silent||this.emit("added",t,e,n,r)}addResources(t,e,n,r={silent:!1}){for(const i in n)(Nr(n[i])||Array.isArray(n[i]))&&this.addResource(t,e,i,n[i],{silent:!0});r.silent||this.emit("added",t,e,n)}addResourceBundle(t,e,n,r,i,o={silent:!1,skipCopy:!1}){let s=[t,e];t.indexOf(".")>-1&&(s=t.split("."),r=n,n=e,e=s[1]),this.addNamespaces(e);let a=Gr(this.data,s)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Yr(a,n,i):a={...a,...n},Wr(this.data,s,a),o.silent||this.emit("added",t,e,n)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return void 0!==this.getResource(t,e)}getResourceBundle(t,e){return e||(e=this.options.defaultNS),this.getResource(t,e)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find(t=>e[t]&&Object.keys(e[t]).length>0)}toJSON(){return this.data}}var ci={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,i){return t.forEach(t=>{e=this.processors[t]?.process(e,n,r,i)??e}),e}};const li=Symbol("i18next/PATH_KEY");function ui(t,e){const{[li]:n}=t(function(){const t=[],e=Object.create(null);let n;return e.get=(r,i)=>(n?.revoke?.(),i===li?t:(t.push(i),n=Proxy.revocable(r,e),n.proxy)),Proxy.revocable(Object.create(null),e).proxy}());return n.join(e?.keySeparator??".")}const hi={},di=t=>!Nr(t)&&"boolean"!=typeof t&&"number"!=typeof t;class pi extends si{constructor(t,e={}){super(),((t,e,n)=>{["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(t=>{e[t]&&(n[t]=e[t])})})(0,t,this),this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=oi.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,e={interpolation:{}}){const n={...e};if(null==t)return!1;const r=this.resolve(t,n);if(void 0===r?.res)return!1;const i=di(r.res);return!1!==n.returnObjects||!i}extractFromKey(t,e){let n=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator;let i=e.ns||this.options.defaultNS||[];const o=n&&t.indexOf(n)>-1,s=!(this.options.userDefinedKeySeparator||e.keySeparator||this.options.userDefinedNsSeparator||e.nsSeparator||((t,e,n)=>{e=e||"",n=n||"";const r=Zr.filter(t=>e.indexOf(t)<0&&n.indexOf(t)<0);if(0===r.length)return!0;const i=ti.getRegExp(`(${r.map(t=>"?"===t?"\\?":t).join("|")})`);let o=!i.test(t);if(!o){const e=t.indexOf(n);e>0&&!i.test(t.substring(0,e))&&(o=!0)}return o})(t,n,r));if(o&&!s){const e=t.match(this.interpolator.nestingRegexp);if(e&&e.length>0)return{key:t,namespaces:Nr(i)?[i]:i};const o=t.split(n);(n!==r||n===r&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),t=o.join(r)}return{key:t,namespaces:Nr(i)?[i]:i}}translate(t,e,n){let r="object"==typeof e?{...e}:e;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==t)return"";"function"==typeof t&&(t=ui(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]);const i=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:s,namespaces:a}=this.extractFromKey(t[t.length-1],r),c=a[a.length-1];let l=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===l&&(l=":");const u=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===u?.toLowerCase())return h?i?{res:`${c}${l}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:`${c}${l}${s}`:i?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:s;const d=this.resolve(t,r);let p=d?.res;const f=d?.usedKey||s,g=d?.exactUsedKey||s,m=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,v=void 0!==r.count&&!Nr(r.count),b=pi.hasDefaultValue(r),w=v?this.pluralResolver.getSuffix(u,r.count,r):"",x=r.ordinal&&v?this.pluralResolver.getSuffix(u,r.count,{ordinal:!1}):"",S=v&&!r.ordinal&&0===r.count,_=S&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${w}`]||r[`defaultValue${x}`]||r.defaultValue;let k=p;y&&!p&&b&&(k=_);const O=di(k),C=Object.prototype.toString.apply(k);if(!(y&&k&&O&&["[object Number]","[object Function]","[object RegExp]"].indexOf(C)<0)||Nr(m)&&Array.isArray(k))if(y&&Nr(m)&&Array.isArray(p))p=p.join(m),p&&(p=this.extendTranslation(p,t,r,n));else{let e=!1,i=!1;!this.isValidLookup(p)&&b&&(e=!0,p=_),this.isValidLookup(p)||(i=!0,p=s);const a=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:p,h=b&&_!==p&&this.options.updateMissing;if(i||e||h){if(this.logger.log(h?"updateKey":"missingKey",u,c,s,h?_:p),o){const t=this.resolve(s,{...r,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const e=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&e&&e[0])for(let r=0;r<e.length;r++)t.push(e[r]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(r.lng||this.language):t.push(r.lng||this.language);const n=(t,e,n)=>{const i=b&&n!==p?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(t,c,e,i,h,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,c,e,i,h,r),this.emit("missingKey",t,c,e,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?t.forEach(t=>{const e=this.pluralResolver.getSuffixes(t,r);S&&r[`defaultValue${this.options.pluralSeparator}zero`]&&e.indexOf(`${this.options.pluralSeparator}zero`)<0&&e.push(`${this.options.pluralSeparator}zero`),e.forEach(e=>{n([t],s+e,r[`defaultValue${e}`]||_)})}):n(t,s,_))}p=this.extendTranslation(p,t,r,d,n),i&&p===s&&this.options.appendNamespaceToMissingKey&&(p=`${c}${l}${s}`),(i||e)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${l}${s}`:s,e?p:void 0,r))}else{if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,k,{...r,ns:a}):`key '${s} (${this.language})' returned an object instead of string.`;return i?(d.res=t,d.usedParams=this.getUsedParamsDetails(r),d):t}if(o){const t=Array.isArray(k),e=t?[]:{},n=t?g:f;for(const i in k)if(Object.prototype.hasOwnProperty.call(k,i)){const t=`${n}${o}${i}`;e[i]=b&&!p?this.translate(t,{...r,defaultValue:di(_)?_[i]:void 0,joinArrays:!1,ns:a}):this.translate(t,{...r,joinArrays:!1,ns:a}),e[i]===t&&(e[i]=k[i])}p=e}}return i?(d.res=p,d.usedParams=this.getUsedParamsDetails(r),d):p}extendTranslation(t,e,n,r,i){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const o=Nr(t)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(o){const e=t.match(this.interpolator.nestingRegexp);s=e&&e.length}let a=n.replace&&!Nr(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),t=this.interpolator.interpolate(t,a,n.lng||this.language||r.usedLng,n),o){const e=t.match(this.interpolator.nestingRegexp);s<(e&&e.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(t=this.interpolator.nest(t,(...t)=>i?.[0]!==t[0]||n.context?this.translate(...t,e):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${e[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,s=Nr(o)?[o]:o;return null!=t&&s?.length&&!1!==n.applyPostProcessor&&(t=ci.handle(s,t,e,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),t}resolve(t,e={}){let n,r,i,o,s;return Nr(t)&&(t=[t]),t.forEach(t=>{if(this.isValidLookup(n))return;const a=this.extractFromKey(t,e),c=a.key;r=c;let l=a.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const u=void 0!==e.count&&!Nr(e.count),h=u&&!e.ordinal&&0===e.count,d=void 0!==e.context&&(Nr(e.context)||"number"==typeof e.context)&&""!==e.context,p=e.lngs?e.lngs:this.languageUtils.toResolveHierarchy(e.lng||this.language,e.fallbackLng);l.forEach(t=>{this.isValidLookup(n)||(s=t,hi[`${p[0]}-${t}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(s)||(hi[`${p[0]}-${t}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(r=>{if(this.isValidLookup(n))return;o=r;const s=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(s,c,r,t,e);else{let t;u&&(t=this.pluralResolver.getSuffix(r,e.count,e));const n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(e.ordinal&&0===t.indexOf(i)&&s.push(c+t.replace(i,this.options.pluralSeparator)),s.push(c+t),h&&s.push(c+n)),d){const r=`${c}${this.options.contextSeparator||"_"}${e.context}`;s.push(r),u&&(e.ordinal&&0===t.indexOf(i)&&s.push(r+t.replace(i,this.options.pluralSeparator)),s.push(r+t),h&&s.push(r+n))}}let a;for(;a=s.pop();)this.isValidLookup(n)||(i=a,n=this.getResource(r,t,a,e))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:o,usedNS:s}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,e,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,e,n,r):this.resourceStore.getResource(t,e,n,r)}getUsedParamsDetails(t={}){const e=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=t.replace&&!Nr(t.replace);let r=n?t.replace:t;if(n&&void 0!==t.count&&(r.count=t.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const t of e)delete r[t]}return r}static hasDefaultValue(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&"defaultValue"===e.substring(0,12)&&void 0!==t[e])return!0;return!1}}class fi{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=oi.create("languageUtils")}getScriptPartFromCode(t){if(!(t=ni(t))||t.indexOf("-")<0)return null;const e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}getLanguagePartFromCode(t){if(!(t=ni(t))||t.indexOf("-")<0)return t;const e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if(Nr(t)&&t.indexOf("-")>-1){let e;try{e=Intl.getCanonicalLocales(t)[0]}catch(yr){}return e&&this.options.lowerCaseLng&&(e=e.toLowerCase()),e||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let e;return t.forEach(t=>{if(e)return;const n=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(n)||(e=n)}),!e&&this.options.supportedLngs&&t.forEach(t=>{if(e)return;const n=this.getScriptPartFromCode(t);if(this.isSupportedCode(n))return e=n;const r=this.getLanguagePartFromCode(t);if(this.isSupportedCode(r))return e=r;e=this.options.supportedLngs.find(t=>t===r?t:t.indexOf("-")<0&&r.indexOf("-")<0?void 0:t.indexOf("-")>0&&r.indexOf("-")<0&&t.substring(0,t.indexOf("-"))===r||0===t.indexOf(r)&&r.length>1?t:void 0)}),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e}getFallbackCodes(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),Nr(t)&&(t=[t]),Array.isArray(t))return t;if(!e)return t.default||[];let n=t[e];return n||(n=t[this.getScriptPartFromCode(e)]),n||(n=t[this.formatLanguageCode(e)]),n||(n=t[this.getLanguagePartFromCode(e)]),n||(n=t.default),n||[]}toResolveHierarchy(t,e){const n=this.getFallbackCodes((!1===e?[]:e)||this.options.fallbackLng||[],t),r=[],i=t=>{t&&(this.isSupportedCode(t)?r.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return Nr(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(t))):Nr(t)&&i(this.formatLanguageCode(t)),n.forEach(t=>{r.indexOf(t)<0&&i(this.formatLanguageCode(t))}),r}}const gi={zero:0,one:1,two:2,few:3,many:4,other:5},mi={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class yi{constructor(t,e={}){this.languageUtils=t,this.options=e,this.logger=oi.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,e){this.rules[t]=e}clearCache(){this.pluralRulesCache={}}getRule(t,e={}){const n=ni("dev"===t?"en":t),r=e.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(n,{type:r})}catch(s){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),mi;if(!t.match(/-|_/))return mi;const n=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(n,e)}return this.pluralRulesCache[i]=o,o}needsPlural(t,e={}){let n=this.getRule(t,e);return n||(n=this.getRule("dev",e)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,e,n={}){return this.getSuffixes(t,n).map(t=>`${e}${t}`)}getSuffixes(t,e={}){let n=this.getRule(t,e);return n||(n=this.getRule("dev",e)),n?n.resolvedOptions().pluralCategories.sort((t,e)=>gi[t]-gi[e]).map(t=>`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${t}`):[]}getSuffix(t,e,n={}){const r=this.getRule(t,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(e)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",e,n))}}const vi=(t,e,n,r=".",i=!0)=>{let o=((t,e,n)=>{const r=Gr(t,n);return void 0!==r?r:Gr(e,n)})(t,e,n);return!o&&i&&Nr(n)&&(o=ei(t,n,r),void 0===o&&(o=ei(e,n,r))),o},bi=t=>t.replace(/\$/g,"$$$$");class wi{constructor(t={}){this.logger=oi.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:e,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:o,suffix:s,suffixEscaped:a,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:h,nestingPrefixEscaped:d,nestingSuffix:p,nestingSuffixEscaped:f,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:y}=t.interpolation;this.escape=void 0!==e?e:Xr,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=i?Qr(i):o||"{{",this.suffix=s?Qr(s):a||"}}",this.formatSeparator=c||",",this.unescapePrefix=l?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=h?Qr(h):d||Qr("$t("),this.nestingSuffix=p?Qr(p):f||Qr(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,e)=>t?.source===e?(t.lastIndex=0,t):new RegExp(e,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,e,n,r){let i,o,s;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=t=>{if(t.indexOf(this.formatSeparator)<0){const i=vi(e,a,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...e,interpolationkey:t}):i}const i=t.split(this.formatSeparator),o=i.shift().trim(),s=i.join(this.formatSeparator).trim();return this.format(vi(e,a,o,this.options.keySeparator,this.options.ignoreJSONStructure),s,n,{...r,...e,interpolationkey:o})};this.resetRegExp();const l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=void 0!==r?.interpolation?.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>bi(t)},{regex:this.regexp,safeValue:t=>this.escapeValue?bi(this.escape(t)):bi(t)}].forEach(e=>{for(s=0;i=e.regex.exec(t);){const n=i[1].trim();if(o=c(n),void 0===o)if("function"==typeof l){const e=l(t,i,r);o=Nr(e)?e:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))o="";else{if(u){o=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${t}`),o=""}else Nr(o)||this.useRawValueToEscape||(o=Fr(o));const a=e.safeValue(o);if(t=t.replace(i[0],a),u?(e.regex.lastIndex+=o.length,e.regex.lastIndex-=i[0].length):e.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,e,n={}){let r,i,o;const s=(t,e)=>{const n=this.nestingOptionsSeparator;if(t.indexOf(n)<0)return t;const r=t.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;t=r[0],i=this.interpolate(i,o);const s=i.match(/'/g),a=i.match(/"/g);((s?.length??0)%2==0&&!a||a.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),e&&(o={...e,...o})}catch(yr){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,yr),`${t}${n}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,t};for(;r=this.nestingRegexp.exec(t);){let a=[];o={...n},o=o.replace&&!Nr(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const c=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==c&&(a=r[1].slice(c).split(this.formatSeparator).map(t=>t.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=e(s.call(this,r[1].trim(),o),o),i&&r[0]===t&&!Nr(i))return i;Nr(i)||(i=Fr(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),i=""),a.length&&(i=a.reduce((t,e)=>this.format(t,e,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),t=t.replace(r[0],i),this.regexp.lastIndex=0}return t}}const xi=t=>{const e={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const s=r+JSON.stringify(o);let a=e[s];return a||(a=t(ni(r),i),e[s]=a),a(n)}},Si=t=>(e,n,r)=>t(ni(n),r)(e);class _i{constructor(t={}){this.logger=oi.create("formatter"),this.options=t,this.init(t)}init(t,e={interpolation:{}}){this.formatSeparator=e.interpolation.formatSeparator||",";const n=e.cacheInBuiltFormats?xi:Si;this.formats={number:n((t,e)=>{const n=new Intl.NumberFormat(t,{...e});return t=>n.format(t)}),currency:n((t,e)=>{const n=new Intl.NumberFormat(t,{...e,style:"currency"});return t=>n.format(t)}),datetime:n((t,e)=>{const n=new Intl.DateTimeFormat(t,{...e});return t=>n.format(t)}),relativetime:n((t,e)=>{const n=new Intl.RelativeTimeFormat(t,{...e});return t=>n.format(t,e.range||"day")}),list:n((t,e)=>{const n=new Intl.ListFormat(t,{...e});return t=>n.format(t)})}}add(t,e){this.formats[t.toLowerCase().trim()]=e}addCached(t,e){this.formats[t.toLowerCase().trim()]=xi(e)}format(t,e,n,r={}){const i=e.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(t=>t.indexOf(")")>-1)){const t=i.findIndex(t=>t.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,t)].join(this.formatSeparator)}const o=i.reduce((t,e)=>{const{formatName:i,formatOptions:o}=(t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);"currency"===e&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===e&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(t=>{if(t){const[e,...r]=t.split(":"),i=r.join(":").trim().replace(/^'+|'+$/g,""),o=e.trim();n[o]||(n[o]=i),"false"===i&&(n[o]=!1),"true"===i&&(n[o]=!0),isNaN(i)||(n[o]=parseInt(i,10))}})}return{formatName:e,formatOptions:n}})(e);if(this.formats[i]){let e=t;try{const s=r?.formatParams?.[r.interpolationkey]||{},a=s.locale||s.lng||r.locale||r.lng||n;e=this.formats[i](t,a,{...o,...r,...s})}catch(no){this.logger.warn(no)}return e}return this.logger.warn(`there was no format function for ${i}`),t},t);return o}}class ki extends si{constructor(t,e,n,r={}){super(),this.backend=t,this.store=e,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=oi.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(t,e,n,r){const i={},o={},s={},a={};return t.forEach(t=>{let r=!0;e.forEach(e=>{const s=`${t}|${e}`;!n.reload&&this.store.hasResourceBundle(t,e)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===o[s]&&(o[s]=!0):(this.state[s]=1,r=!1,void 0===o[s]&&(o[s]=!0),void 0===i[s]&&(i[s]=!0),void 0===a[e]&&(a[e]=!0)))}),r||(s[t]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}loaded(t,e,n){const r=t.split("|"),i=r[0],o=r[1];e&&this.emit("failedLoading",i,o,e),!e&&n&&this.store.addResourceBundle(i,o,n,void 0,void 0,{skipCopy:!0}),this.state[t]=e?-1:2,e&&n&&(this.state[t]=0);const s={};this.queue.forEach(n=>{((t,e,n)=>{const{obj:r,k:i}=Kr(t,e,Object);r[i]=r[i]||[],r[i].push(n)})(n.loaded,[i],o),((t,e)=>{void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)})(n,t),e&&n.errors.push(e),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(t=>{s[t]||(s[t]={});const e=n.loaded[t];e.length&&e.forEach(e=>{void 0===s[t][e]&&(s[t][e]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(t=>!t.done)}read(t,e,n,r=0,i=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:e,fcName:n,tried:r,wait:i,callback:o});this.readingCalls++;const s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}s&&a&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,t,e,n,r+1,2*i,o)},i):o(s,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(t,e,s);try{const n=a(t,e);n&&"function"==typeof n.then?n.then(t=>s(null,t)).catch(s):s(null,n)}catch(c){s(c)}}prepareLoading(t,e,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();Nr(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Nr(e)&&(e=[e]);const i=this.queueLoad(t,e,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(t=>{this.loadOne(t)})}load(t,e,n){this.prepareLoading(t,e,{},n)}reload(t,e,n){this.prepareLoading(t,e,{reload:!0},n)}loadOne(t,e=""){const n=t.split("|"),r=n[0],i=n[1];this.read(r,i,"read",void 0,void 0,(n,o)=>{n&&this.logger.warn(`${e}loading namespace ${i} for language ${r} failed`,n),!n&&o&&this.logger.log(`${e}loaded namespace ${i} for language ${r}`,o),this.loaded(t,n,o)})}saveMissing(t,e,n,r,i,o={},s=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(e)){if(null!=n&&""!==n){if(this.backend?.create){const c={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(t,e,n,r,c):l(t,e,n,r),i&&"function"==typeof i.then?i.then(t=>s(null,t)).catch(s):s(null,i)}catch(a){s(a)}else l(t,e,n,r,s,c)}t&&t[0]&&this.store.addResource(t[0],e,n,r)}}else this.logger.warn(`did not save key "${n}" as the namespace "${e}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Oi=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if("object"==typeof t[1]&&(e=t[1]),Nr(t[1])&&(e.defaultValue=t[1]),Nr(t[2])&&(e.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const n=t[3]||t[2];Object.keys(n).forEach(t=>{e[t]=n[t]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ci=t=>(Nr(t.ns)&&(t.ns=[t.ns]),Nr(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),Nr(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),"boolean"==typeof t.initImmediate&&(t.initAsync=t.initImmediate),t),ji=()=>{};class Ai extends si{constructor(t={},e){var n;if(super(),this.options=Ci(t),this.services={},this.logger=oi,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{"function"==typeof n[t]&&(n[t]=n[t].bind(n))}),e&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,e),this;setTimeout(()=>{this.init(t,e)},0)}}init(t={},e){this.isInitializing=!0,"function"==typeof t&&(e=t,t={}),null==t.defaultNS&&t.ns&&(Nr(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const n=Oi();this.options={...n,...this.options,...Ci(t)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);const r=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;this.modules.logger?oi.init(r(this.modules.logger),this.options):oi.init(null,this.options),t=this.modules.formatter?this.modules.formatter:_i;const e=new fi(this.options);this.store=new ai(this.options.resources,this.options);const i=this.services;i.logger=oi,i.resourceStore=this.store,i.languageUtils=e,i.pluralResolver=new yi(e,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!t||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(i.formatter=r(t),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new wi(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new ki(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(t,...e)=>{this.emit(t,...e)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new pi(this.services,this.options),this.translator.on("*",(t,...e)=>{this.emit(t,...e)}),this.modules.external.forEach(t=>{t.init&&t.init(this)})}if(this.format=this.options.interpolation.format,e||(e=ji),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=(...e)=>this.store[t](...e)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=(...e)=>(this.store[t](...e),this)});const i=Tr(),o=()=>{const t=(t,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(n),e(t,n)};if(this.languages&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),i}loadResources(t,e=ji){let n=e;const r=Nr(t)?t:this.language;if("function"==typeof t&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===r?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const t=[],e=e=>{e&&"cimode"!==e&&this.services.languageUtils.toResolveHierarchy(e).forEach(e=>{"cimode"!==e&&t.indexOf(e)<0&&t.push(e)})};r?e(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(t=>e(t)),this.options.preload?.forEach?.(t=>e(t)),this.services.backendConnector.load(t,this.options.ns,t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(t)})}else n(null)}reloadResources(t,e,n){const r=Tr();return"function"==typeof t&&(n=t,t=void 0),"function"==typeof e&&(n=e,e=void 0),t||(t=this.languages),e||(e=this.options.ns),n||(n=ji),this.services.backendConnector.reload(t,e,t=>{r.resolve(),n(t)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&ci.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1)){for(let t=0;t<this.languages.length;t++){const e=this.languages[t];if(!(["cimode","dev"].indexOf(e)>-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,e){this.isLanguageChangingTo=t;const n=Tr();this.emit("languageChanging",t);const r=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},i=(i,o)=>{o?this.isLanguageChangingTo===t&&(r(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,n.resolve((...t)=>this.t(...t)),e&&e(i,(...t)=>this.t(...t))},o=e=>{t||e||!this.services.languageDetector||(e=[]);const n=Nr(e)?e:e&&e[0],o=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Nr(e)?[e]:e);o&&(this.language||r(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,t=>{i(t,o)})};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t):o(this.services.languageDetector.detect()),n}getFixedT(t,e,n){const r=(t,e,...i)=>{let o;o="object"!=typeof e?this.options.overloadTranslationOptionHandler([t,e].concat(i)):{...e},o.lng=o.lng||r.lng,o.lngs=o.lngs||r.lngs,o.ns=o.ns||r.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||r.keyPrefix);const s=this.options.keySeparator||".";let a;return o.keyPrefix&&Array.isArray(t)?a=t.map(t=>("function"==typeof t&&(t=ui(t,{...this.options,...e})),`${o.keyPrefix}${s}${t}`)):("function"==typeof t&&(t=ui(t,{...this.options,...e})),a=o.keyPrefix?`${o.keyPrefix}${s}${t}`:t),this.t(a,o)};return Nr(t)?r.lng=t:r.lngs=t,r.ns=e,r.keyPrefix=n,r}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,e={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=e.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const o=(t,e)=>{const n=this.services.backendConnector.state[`${t}|${e}`];return-1===n||0===n||2===n};if(e.precheck){const t=e.precheck(this,o);if(void 0!==t)return t}return!(!this.hasResourceBundle(n,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!o(n,t)||r&&!o(i,t)))}loadNamespaces(t,e){const n=Tr();return this.options.ns?(Nr(t)&&(t=[t]),t.forEach(t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}),this.loadResources(t=>{n.resolve(),e&&e(t)}),n):(e&&e(),Promise.resolve())}loadLanguages(t,e){const n=Tr();Nr(t)&&(t=[t]);const r=this.options.preload||[],i=t.filter(t=>r.indexOf(t)<0&&this.services.languageUtils.isSupportedCode(t));return i.length?(this.options.preload=r.concat(i),this.loadResources(t=>{n.resolve(),e&&e(t)}),n):(e&&e(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const e=new Intl.Locale(t);if(e&&e.getTextInfo){const t=e.getTextInfo();if(t&&t.direction)return t.direction}}catch(yr){}const e=this.services?.languageUtils||new fi(Oi());return t.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(e.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},e){const n=new Ai(t,e);return n.createInstance=Ai.createInstance,n}cloneInstance(t={},e=ji){const n=t.forkResourceStore;n&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},i=new Ai(r);if(void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t)),["store","services","language"].forEach(t=>{i[t]=this[t]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n){const t=Object.keys(this.store.data).reduce((t,e)=>(t[e]={...this.store.data[e]},t[e]=Object.keys(t[e]).reduce((n,r)=>(n[r]={...t[e][r]},n),t[e]),t),{});i.store=new ai(t,r),i.services.resourceStore=i.store}return t.interpolation&&(i.services.interpolator=new wi(r)),i.translator=new pi(i.services,r),i.translator.on("*",(t,...e)=>{i.emit(t,...e)}),i.init(r,e),i.translator.options=r,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Pi=Ai.createInstance();Pi.createInstance,Pi.dir,Pi.init,Pi.loadResources,Pi.reloadResources,Pi.use,Pi.changeLanguage,Pi.getFixedT,Pi.t,Pi.exists,Pi.setDefaultNamespace,Pi.hasLoadedNamespace,Pi.loadNamespaces,Pi.loadLanguages,i(752),Object.create(null);const $i=(t,e,n,r)=>{const i=[n,{code:e,...r||{}}];if(t?.services?.logger?.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);zi(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...i):console},Ii={},Ei=(t,e,n,r)=>{zi(n)&&Ii[n]||(zi(n)&&(Ii[n]=new Date),$i(t,e,n,r))},Li=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},Mi=(t,e,n)=>{t.loadNamespaces(e,Li(t,n))},Ri=(t,e,n,r)=>{if(zi(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Mi(t,n,r);n.forEach(e=>{t.options.ns.indexOf(e)<0&&t.options.ns.push(e)}),t.loadLanguages(e,Li(t,r))},zi=t=>"string"==typeof t,Bi=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ui={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Di=t=>Ui[t];let Ni,Ti={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:t=>t.replace(Bi,Di),transDefaultProps:void 0};const Fi=()=>Ni,qi={type:"3rdParty",init(t){((t={})=>{Ti={...Ti,...t}})(t.options.react),(t=>{Ni=t})(t)}},Vi=(0,t.createContext)();class Hi{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}Error;const Ki={" ":" ","&":"&","<":"<",">":">",""":'"',"'":"'","©":"©","®":"®","™":"™","…":"…","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","•":"•","′":"′","″":"″","‹":"‹","›":"›","§":"§","¶":"¶","·":"·"," ":" "," ":" "," ":" ","€":"€","£":"£","¥":"¥","¢":"¢","¤":"¤","×":"×","÷":"÷","−":"−","±":"±","≠":"≠","≤":"≤","≥":"≥","≈":"≈","≡":"≡","∞":"∞","∫":"∫","∑":"∑","∏":"∏","√":"√","∂":"∂","‰":"‰","°":"°","µ":"µ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","À":"À","Á":"Á","Â":"Â","Ã":"Ã","Ä":"Ä","Å":"Å","Æ":"Æ","Ç":"Ç","È":"È","É":"É","Ê":"Ê","Ë":"Ë","Ì":"Ì","Í":"Í","Î":"Î","Ï":"Ï","Ð":"Ð","Ñ":"Ñ","Ò":"Ò","Ó":"Ó","Ô":"Ô","Õ":"Õ","Ö":"Ö","Ø":"Ø","Ù":"Ù","Ú":"Ú","Û":"Û","Ü":"Ü","Ý":"Ý","Þ":"Þ","ß":"ß","à":"à","á":"á","â":"â","ã":"ã","ä":"ä","å":"å","æ":"æ","ç":"ç","è":"è","é":"é","ê":"ê","ë":"ë","ì":"ì","í":"í","î":"î","ï":"ï","ð":"ð","ñ":"ñ","ò":"ò","ó":"ó","ô":"ô","õ":"õ","ö":"ö","ø":"ø","ù":"ù","ú":"ú","û":"û","ü":"ü","ý":"ý","þ":"þ","ÿ":"ÿ","¡":"¡","¿":"¿","ƒ":"ƒ","ˆ":"ˆ","˜":"˜","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ª":"ª","º":"º","¯":"¯","´":"´","¸":"¸","¹":"¹","²":"²","³":"³","¼":"¼","½":"½","¾":"¾","♠":"♠","♣":"♣","♥":"♥","♦":"♦","◊":"◊","‾":"‾","⁄":"⁄","℘":"℘","ℑ":"ℑ","ℜ":"ℜ","ℵ":"ℵ"};new RegExp(Object.keys(Ki).map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),"g");var Wi=i(624);const Gi={t:(t,e)=>{return zi(e)?e:"object"==typeof(n=e)&&null!==n&&zi(e.defaultValue)?e.defaultValue:Array.isArray(t)?t[t.length-1]:t;var n},ready:!1},Yi=()=>()=>{},Qi=(e,n={})=>{const{i18n:r}=n,{i18n:i,defaultNS:o}=(0,t.useContext)(Vi)||{},s=r||i||Fi();s&&!s.reportNamespaces&&(s.reportNamespaces=new Hi),s||Ei(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const a=(0,t.useMemo)(()=>({...Ti,...s?.options?.react,...n}),[s,n]),{useSuspense:c,keyPrefix:l}=a,u=e||o||s?.options?.defaultNS,h=zi(u)?[u]:u||["translation"],d=(0,t.useMemo)(()=>h,h);s?.reportNamespaces?.addUsedNamespaces?.(d);const p=(0,t.useRef)(0),f=(0,t.useCallback)(t=>{if(!s)return Yi;const{bindI18n:e,bindI18nStore:n}=a,r=()=>{p.current+=1,t()};return e&&s.on(e,r),n&&s.store.on(n,r),()=>{e&&e.split(" ").forEach(t=>s.off(t,r)),n&&n.split(" ").forEach(t=>s.store.off(t,r))}},[s,a]),g=(0,t.useRef)(),m=(0,t.useCallback)(()=>{if(!s)return Gi;const t=!(!s.isInitialized&&!s.initializedStoreOnce)&&d.every(t=>((t,e,n={})=>e.languages&&e.languages.length?e.hasLoadedNamespace(t,{lng:n.lng,precheck:(e,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!r(e.isLanguageChangingTo,t))return!1}}):(Ei(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0))(t,s,a)),e=n.lng||s.language,r=p.current,i=g.current;if(i&&i.ready===t&&i.lng===e&&i.keyPrefix===l&&i.revision===r)return i;const o={t:s.getFixedT(e,"fallback"===a.nsMode?d:d[0],l),ready:t,lng:e,keyPrefix:l,revision:r};return g.current=o,o},[s,d,l,a,n.lng]),[y,v]=(0,t.useState)(0),{t:b,ready:w}=(0,Wi.useSyncExternalStore)(f,m,m);(0,t.useEffect)(()=>{if(s&&!w&&!c){const t=()=>v(t=>t+1);n.lng?Ri(s,n.lng,d,t):Mi(s,d,t)}},[s,n.lng,d,w,c,y]);const x=s||{},S=(0,t.useRef)(null),_=(0,t.useRef)(),k=t=>{const e=Object.getOwnPropertyDescriptors(t);e.__original&&delete e.__original;const n=Object.create(Object.getPrototypeOf(t),e);if(!Object.prototype.hasOwnProperty.call(n,"__original"))try{Object.defineProperty(n,"__original",{value:t,writable:!1,enumerable:!1,configurable:!1})}catch(_e){}return n},O=(0,t.useMemo)(()=>{const t=x,e=t?.language;let n=t;t&&(S.current&&S.current.__original===t?_.current!==e?(n=k(t),S.current=n,_.current=e):n=S.current:(n=k(t),S.current=n,_.current=e));const r=[b,n,w];return r.t=b,r.i18n=n,r.ready=w,r},[b,x,w,x.resolvedLanguage,x.language,x.languages]);if(s&&c&&!w)throw new Promise(t=>{const e=()=>t();n.lng?Ri(s,n.lng,d,e):Mi(s,d,e)});return O};var Ji;function Xi(){return Xi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Xi.apply(null,arguments)}const Zi=function(e){return t.createElement("svg",Xi({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 96 96"},e),Ji||(Ji=t.createElement("path",{stroke:"#5AD608",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M81 27 39 69 18 48"})))};var to;function eo(){return eo=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},eo.apply(null,arguments)}const no=function(e){return t.createElement("svg",eo({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 96 96"},e),to||(to=t.createElement("path",{stroke:"#FF6464",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M75 21 21 75M75 75 21 21"})))};var ro;function io(){return io=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},io.apply(null,arguments)}const oo=function(e){return t.createElement("svg",io({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 25"},e),ro||(ro=t.createElement("path",{fill:"orange",fillRule:"evenodd",d:"M11.719 1.268a2.2 2.2 0 0 0-1.294.635c-.107.106-.243.269-.303.361-.12.19-9.766 17.989-9.91 18.288-.157.328-.196.52-.196.948 0 .303.01.407.052.559a2.27 2.27 0 0 0 1.919 1.673c.288.033 19.738.033 20.026 0a2.24 2.24 0 0 0 1.776-1.29c.098-.209.187-.514.187-.644 0-.044.01-.086.024-.094.013-.008.024-.117.024-.243 0-.146-.009-.222-.024-.213-.014.009-.024-.014-.024-.055 0-.123-.094-.444-.188-.64-.142-.297-9.788-18.098-9.91-18.289a2.4 2.4 0 0 0-1.077-.868 2.5 2.5 0 0 0-1.082-.128m.089 1.51a.9.9 0 0 0-.34.21c-.062.064-1.594 2.868-4.979 9.116a1783 1783 0 0 0-4.933 9.138.764.764 0 0 0 .383.938l.113.052h19.896l.113-.052a.764.764 0 0 0 .383-.938 1793 1793 0 0 0-4.933-9.138c-3.39-6.256-4.916-9.052-4.978-9.116a.7.7 0 0 0-.497-.223 1 1 0 0 0-.228.012m.052 5.238a.74.74 0 0 0-.548.442l-.057.124.007 3.573.006 3.573.055.103c.07.132.214.276.346.346.087.046.14.055.331.055.192 0 .245-.009.331-.055a.94.94 0 0 0 .346-.346l.055-.103.006-3.573.007-3.573-.057-.124a.8.8 0 0 0-.312-.358c-.09-.053-.144-.068-.34-.098a1 1 0 0 0-.176.014m-.208 9.782a1.25 1.25 0 0 0-.67.587c-.204.42-.12.936.21 1.27.236.24.461.336.796.34.277.002.471-.06.678-.217.376-.285.53-.705.428-1.165a1.17 1.17 0 0 0-.638-.77c-.14-.067-.183-.075-.42-.081-.206-.005-.29.003-.384.036M.009 21.488c0 .132.004.183.009.113s.005-.177 0-.24c-.005-.062-.01-.005-.01.127",clipRule:"evenodd"})))};var so;function ao(){return ao=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ao.apply(null,arguments)}const co=function(e){return t.createElement("svg",ao({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e),so||(so=t.createElement("path",{stroke:"orange",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 13V9m9-3-2-2m-9-2h4m-2 19a8 8 0 1 1 0-16 8 8 0 0 1 0 16"})))};var lo,uo,ho,po,fo,go,mo;function yo(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var vo=tr.div(lo||(lo=yo(["\n all: initial;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 264px;\n height: 264px;\n margin: 0 auto;\n"]))),bo=tr.div(uo||(uo=yo(["\n all: initial;\n box-sizing: border-box;\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n\n width: 234px;\n height: 234px;\n\n border-width: 3px;\n border-style: solid;\n border-radius: 50%;\n\n animation: showResultIcon 0.8s linear;\n\n ","\n\n ","\n\n ","\n\n ","\n\n svg {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 96px;\n height: 96px;\n transform: translate(-50%, -50%);\n animation: showIcon 0.8s linear;\n\n @keyframes showIcon {\n 0% {\n width: 0;\n height: 0;\n }\n 100% {\n width: 96px;\n height: 96px;\n }\n }\n }\n\n @keyframes showResultIcon {\n 0% {\n width: 234px;\n height: 234px;\n border-width: 1px;\n }\n 50% {\n width: 264px;\n height: 264px;\n border-width: 9px;\n }\n 100% {\n width: 234px;\n height: 234px;\n border-width: 3px;\n }\n }\n"])),function(t){return t.$status===u&&Jn(ho||(ho=yo(["\n border-color: ",";\n "])),function(t){return t.theme.colors.success})},function(t){return t.$status===h&&Jn(po||(po=yo(["\n border-color: ",";\n "])),function(t){return t.theme.colors.error})},function(t){return t.$status===p&&Jn(fo||(fo=yo(["\n border-color: ",";\n "])),function(t){return t.theme.colors.warning})},function(t){return t.$status===d&&Jn(go||(go=yo(["\n border-color: ",";\n "])),function(t){return t.theme.colors.warning})}),wo=tr.div(mo||(mo=yo(["\n all: initial;\n width: 200px;\n height: 200px;\n\n border-radius: 50%;\n background-color: ",";\n"])),function(t){return t.theme.colors.backgroundSecondary});function xo(t){var e,n=t.status;switch(n){case u:e=(0,X.jsx)(Zi,{});break;case h:e=(0,X.jsx)(no,{});break;case d:e=(0,X.jsx)(oo,{});break;case p:e=(0,X.jsx)(co,{});break;default:e=(0,X.jsx)(no,{})}return(0,X.jsx)(vo,{children:(0,X.jsxs)(bo,{$status:n,children:[(0,X.jsx)(wo,{}),e]})})}var So,_o=i(400),ko=i.n(_o);function Oo(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var c=r&&r.prototype instanceof a?r:a,l=Object.create(c.prototype);return Co(l,"_invoke",function(n,r,i){var o,a,c,l=0,u=i||[],h=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return o=e,a=0,c=t,d.n=n,s}};function p(n,r){for(a=n,c=r,e=0;!h&&l&&!i&&e<u.length;e++){var i,o=u[e],p=d.p,f=o[2];n>3?(i=f===r)&&(c=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=t):o[0]<=p&&((i=n<2&&p<o[1])?(a=0,d.v=r,d.n=o[1]):p<f&&(i=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,d.n=f,a=0))}if(i||n>1)return s;throw h=!0,r}return function(i,u,f){if(l>1)throw TypeError("Generator is already running");for(h&&1===u&&p(u,f),a=u,c=f;(e=a<2?t:c)||!h;){o||(a?a<3?(a>1&&(d.n=-1),p(a,c)):d.n=c:d.v=c);try{if(l=2,o){if(a||(i="next"),e=o[i]){if(!(e=e.call(o,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,a<2&&(a=0)}else 1===a&&(e=o.return)&&e.call(o),a<2&&(c=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=t}else if((e=(h=d.n<0)?c:n.call(r,d))!==s)break}catch(e){o=t,a=1,c=e}finally{l=1}}return{value:e,done:h}}}(n,i,o),!0),l}var s={};function a(){}function c(){}function l(){}e=Object.getPrototypeOf;var u=[][r]?e(e([][r]())):(Co(e={},r,function(){return this}),e),h=l.prototype=a.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,Co(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return c.prototype=l,Co(h,"constructor",l),Co(l,"constructor",c),c.displayName="GeneratorFunction",Co(l,i,"GeneratorFunction"),Co(h),Co(h,i,"Generator"),Co(h,r,function(){return this}),Co(h,"toString",function(){return"[object Generator]"}),(Oo=function(){return{w:o,m:d}})()}function Co(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}Co=function(t,e,n,r){function o(e,n){Co(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))},Co(t,e,n,r)}function jo(t,e,n,r,i,o,s){try{var a=t[o](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,i)}function Ao(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function s(t){jo(o,r,i,s,a,"next",t)}function a(t){jo(o,r,i,s,a,"throw",t)}s(void 0)})}}var Po,$o,Io,Eo,Lo,Mo,Ro,zo=tr.div(So||(So=function(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"]))),Bo=320;function Uo(e){var n=e.link,r=(0,t.useRef)(null),i=(0,t.useRef)(null),o=function(){var e=(0,t.useContext)(Hn);if(!e)throw sn(18);return e}(),s=(0,t.useCallback)(Ao(Oo().m(function t(){return Oo().w(function(t){for(;;)switch(t.p=t.n){case 0:if(t.p=0,!n){t.n=1;break}return t.n=1,navigator.clipboard.writeText(n);case 1:t.n=3;break;case 2:t.p=2,t.v,x();case 3:return t.a(2)}},t,null,[[0,2]])})),[n]);return(0,t.useEffect)(function(){if(n){var t={width:Bo,height:Bo,type:"svg",data:n,dotsOptions:{color:o.qrCode.dotsColor,type:"rounded"},cornersSquareOptions:{color:o.qrCode.cornersColor,type:"extra-rounded"},cornersDotOptions:{color:o.qrCode.cornerDotsColor,type:"dot"},backgroundOptions:{color:o.qrCode.backgroundColor}},e=r.current;return e&&(e.innerHTML="",i.current=new(ko())(t),i.current.append(e),e.style.width="".concat(Bo,"px"),e.style.height="".concat(Bo,"px")),function(){e&&(e.innerHTML="")}}},[n,o]),(0,X.jsx)(zo,{style:{width:"".concat(Bo,"px"),height:"".concat(Bo,"px")},onClick:s,children:(0,X.jsx)("div",{ref:r})})}function Do(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var c=r&&r.prototype instanceof a?r:a,l=Object.create(c.prototype);return No(l,"_invoke",function(n,r,i){var o,a,c,l=0,u=i||[],h=!1,d={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return o=e,a=0,c=t,d.n=n,s}};function p(n,r){for(a=n,c=r,e=0;!h&&l&&!i&&e<u.length;e++){var i,o=u[e],p=d.p,f=o[2];n>3?(i=f===r)&&(c=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=t):o[0]<=p&&((i=n<2&&p<o[1])?(a=0,d.v=r,d.n=o[1]):p<f&&(i=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,d.n=f,a=0))}if(i||n>1)return s;throw h=!0,r}return function(i,u,f){if(l>1)throw TypeError("Generator is already running");for(h&&1===u&&p(u,f),a=u,c=f;(e=a<2?t:c)||!h;){o||(a?a<3?(a>1&&(d.n=-1),p(a,c)):d.n=c:d.v=c);try{if(l=2,o){if(a||(i="next"),e=o[i]){if(!(e=e.call(o,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,a<2&&(a=0)}else 1===a&&(e=o.return)&&e.call(o),a<2&&(c=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=t}else if((e=(h=d.n<0)?c:n.call(r,d))!==s)break}catch(e){o=t,a=1,c=e}finally{l=1}}return{value:e,done:h}}}(n,i,o),!0),l}var s={};function a(){}function c(){}function l(){}e=Object.getPrototypeOf;var u=[][r]?e(e([][r]())):(No(e={},r,function(){return this}),e),h=l.prototype=a.prototype=Object.create(u);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,No(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return c.prototype=l,No(h,"constructor",l),No(l,"constructor",c),c.displayName="GeneratorFunction",No(l,i,"GeneratorFunction"),No(h),No(h,i,"Generator"),No(h,r,function(){return this}),No(h,"toString",function(){return"[object Generator]"}),(Do=function(){return{w:o,m:d}})()}function No(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}No=function(t,e,n,r){function o(e,n){No(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(o("next",0),o("throw",1),o("return",2))},No(t,e,n,r)}function To(t,e,n,r,i,o,s){try{var a=t[o](s),c=a.value}catch(t){return void n(t)}a.done?e(c):Promise.resolve(c).then(r,i)}function Fo(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function s(t){To(o,r,i,s,a,"next",t)}function a(t){To(o,r,i,s,a,"throw",t)}s(void 0)})}}function qo(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Vo(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vo(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ho(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var Ko,Wo,Go,Yo,Qo,Jo,Xo=tr.p(Po||(Po=Ho(["\n all: initial;\n box-sizing: border-box;\n\n text-align: center;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n max-width: 90%;\n margin: 0 auto 16px;\n color: ",";\n opacity: 0.85;\n"])),function(t){return t.theme.colors.textSecondary}),Zo=tr.div($o||($o=Ho(["\n all: initial;\n box-sizing: border-box;\n\n position: relative;\n width: 100%;\n max-width: 320px;\n aspect-ratio: 1 / 1;\n margin: 0 auto;\n overflow: hidden;\n border-radius: 16px;\n box-shadow: 0 6px 30px ",";\n background: ",";\n"])),function(t){return t.theme.colors.shadowStrong},function(t){return t.theme.gradients.surface}),ts=tr.div(Io||(Io=Ho(["\n all: initial;\n box-sizing: border-box;\n\n margin-top: 16px;\n padding: 12px;\n border-radius: 16px;\n background: ",";\n display: flex;\n flex-direction: column;\n gap: 12px;\n backdrop-filter: blur(4px);\n border: 1px solid ",';\n\n * {\n font-family: "Roboto", Arial, sans-serif;\n box-sizing: border-box;\n }\n'])),function(t){return t.theme.colors.surfaceOverlay},function(t){return t.theme.colors.border}),es=tr.div(Eo||(Eo=Ho(["\n all: initial;\n box-sizing: border-box;\n\n display: flex;\n flex-direction: column;\n line-height: 1.4;\n padding: 8px;\n\n strong {\n font-size: 14px;\n font-weight: 600;\n color: ",";\n text-align: center;\n }\n\n span {\n margin-top: 4px;\n font-size: 14px;\n font-weight: 400;\n color: ",";\n text-align: center;\n }\n"])),function(t){return t.theme.colors.text},function(t){return t.theme.colors.textSecondary}),ns=tr.button(Lo||(Lo=Ho(["\n all: initial;\n box-sizing: border-box;\n\n appearance: none;\n cursor: pointer;\n border: 0;\n border-radius: 12px;\n padding: 12px;\n font-size: 14px;\n font-weight: 600;\n line-height: 1.2;\n text-align: center;\n text-decoration: none;\n\n background: ",";\n color: ",";\n box-shadow: 0 4px 12px ",";\n\n white-space: nowrap;\n width: 100%;\n transition: all 0.2s ease;\n\n &:hover {\n background: ",";\n box-shadow: 0 6px 16px ",";\n color: ",";\n }\n\n &:active {\n transform: scale(0.98);\n }\n"])),function(t){return t.theme.colors.primary},function(t){return t.theme.colors.textInverse},function(t){return t.theme.colors.shadow},function(t){return t.theme.colors.primaryHover},function(t){return t.theme.colors.shadowMedium},function(t){return t.theme.colors.textInverse}),rs=tr.button(Mo||(Mo=Ho(["\n all: initial;\n box-sizing: border-box;\n\n appearance: none;\n cursor: pointer;\n border-radius: 12px;\n padding: 12px;\n font-size: 14px;\n font-weight: 500;\n line-height: 1.2;\n text-align: center;\n text-decoration: none;\n border: 1px solid ",";\n\n background-color: ",";\n color: ",";\n box-shadow: 0 2px 8px ",";\n\n white-space: nowrap;\n width: 100%;\n transition: all 0.2s ease;\n\n &:hover {\n background-color: ",";\n box-shadow: 0 4px 12px ",";\n }\n\n &:active {\n transform: scale(0.98);\n }\n"])),function(t){return t.theme.colors.border},function(t){return t.theme.colors.surfaceOverlay},function(t){return t.theme.colors.text},function(t){return t.theme.colors.shadow},function(t){return t.theme.colors.backgroundSecondary},function(t){return t.theme.colors.shadowMedium}),is=tr.a(Ro||(Ro=Ho(["\n all: initial;\n box-sizing: border-box;\n\n color: ",';\n cursor: pointer;\n\n padding: 12px;\n font-family: "Roboto", Arial, sans-serif;\n font-size: 14px;\n font-weight: 500;\n line-height: 1.2;\n text-align: center;\n text-decoration: none;\n transition: opacity 0.2s ease;\n\n &:hover {\n opacity: 0.8;\n }\n\n &:active {\n transform: scale(0.98);\n }\n'])),function(t){return t.theme.colors.primary});function os(){var e=qo((0,t.useState)(function(){return"undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent||"")?b:function(){var t;if("undefined"==typeof navigator)return!1;var e=navigator.userAgent||navigator.vendor||(null===(t=window)||void 0===t?void 0:t.opera)||"",n=/iPhone|iPad|iPod/i.test(e),r=!n&&"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;return n||r}()?"ios":v}),1)[0],n=qo((0,t.useState)(!1),2),r=n[0],i=n[1],o=Qi().t,s=pt().link,a=function(){try{if(s&&S(s)){var t=new URL(s);return"".concat(t.origin,"/install")}}catch(no){}return"/install"}(),c=S(s)?s:"#",l=(0,t.useCallback)(Fo(Do().m(function t(){return Do().w(function(t){for(;;)switch(t.p=t.n){case 0:if(t.p=0,!s){t.n=2;break}return t.n=1,navigator.clipboard.writeText(s);case 1:i(!0);case 2:t.n=4;break;case 3:t.p=3,t.v,x();case 4:return t.a(2)}},t,null,[[0,3]])})),[s]);return function(){switch(e){case v:return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Xo,{children:o("auth.about")}),(0,X.jsx)(Zo,{children:(0,X.jsx)(Uo,{link:s})}),(0,X.jsxs)(ts,{children:[(0,X.jsx)(es,{children:(0,X.jsx)("span",{children:o("auth.scan_qr_desc")})}),(0,X.jsx)(ns,{as:"a",href:a,target:"_blank",rel:"noopener noreferrer",role:"button","aria-label":o("auth.install_app"),children:o("auth.install_app")})]})]});case b:return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Xo,{children:o("auth.about")}),(0,X.jsxs)(ts,{children:[(0,X.jsx)(es,{children:(0,X.jsx)("strong",{children:o("auth.install_required_android")})}),(0,X.jsx)(rs,{as:"a",href:c,target:"_blank",rel:"noopener noreferrer",role:"button","aria-label":o("auth.open_app"),children:o("auth.open_app")})]}),(0,X.jsx)(is,{as:"a",href:a,target:"_blank",rel:"noopener noreferrer",role:"button","aria-label":o("auth.install_app"),children:o("auth.install_app")})]});case"ios":return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Xo,{children:o("auth.about")}),(0,X.jsxs)(ts,{children:[(0,X.jsx)(es,{children:(0,X.jsx)("strong",{children:o("auth.install_required_ios")})}),(0,X.jsx)(rs,{onClick:l,role:"button","aria-label":o(r?"auth.open_app_continue":"auth.continue_auth"),children:o(r?"auth.open_app_continue":"auth.continue_auth")})]}),(0,X.jsx)(is,{as:"a",href:a,target:"_blank",rel:"noopener noreferrer",role:"button","aria-label":o("auth.install_app"),children:o("auth.install_app")})]});default:return null}}()}function ss(t){return ss="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ss(t)}function as(t,e,n){return(e=function(t){var e=function(t){if("object"!=ss(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ss(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ss(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function cs(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var ls=er(Ko||(Ko=cs(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))),us=tr.h1(Wo||(Wo=cs(['\n all: initial;\n box-sizing: border-box;\n margin: 0 0 12px;\n font-family: "Roboto", Arial, sans-serif;\n font-style: normal;\n font-size: 30px;\n font-weight: 700;\n text-align: center;\n color: ',";\n"])),function(t){return t.theme.colors.text}),hs=tr.div(Go||(Go=cs(["\n position: relative;\n width: 100%;\n height: 264px;\n"]))),ds=tr.div(Yo||(Yo=cs(["\n position: absolute;\n left: 50%;\n top: 50%;\n width: 150px;\n height: 150px;\n margin: -75px 0 0 -75px;\n border-radius: 50%;\n border: 3px solid transparent;\n border-top-color: ",";\n animation: ",' 2s linear infinite;\n\n &:before {\n content: "";\n position: absolute;\n top: 5px;\n left: 5px;\n right: 5px;\n bottom: 5px;\n border-radius: 50%;\n border: 3px solid transparent;\n border-top-color: ',";\n animation: ",' 3s linear infinite;\n }\n\n &:after {\n content: "";\n position: absolute;\n top: 15px;\n left: 15px;\n right: 15px;\n bottom: 15px;\n border-radius: 50%;\n border: 3px solid transparent;\n border-top-color: ',";\n animation: "," 1.5s linear infinite;\n }\n"])),function(t){return t.theme.colors.primary},ls,function(t){return t.theme.colors.secondary},ls,function(t){return t.theme.colors.accent},ls),ps=tr.p(Qo||(Qo=cs(['\n all: initial;\n box-sizing: border-box;\n\n font-family: "Roboto", Arial, sans-serif;\n font-weight: 600;\n font-size: 22px;\n line-height: 36px;\n text-align: center;\n color: ',";\n"])),function(t){return t.theme.colors.text}),fs=tr.div(Jo||(Jo=cs(["\n display: grid;\n justify-items: center;\n gap: 8px;\n padding: 12px 0;\n"])));function gs(){var t=Qi().t,e=pt().authStatus,n={title:t("Liberion ID"),inProgress:t("app.auth_in_progress"),success:t("app.auth_success"),error:t("app.auth_failed"),cancelled:t("app.auth_cancelled"),timeout:t("app.auth_timeout"),reconnectFailed:t("app.reconnect_failed")},r=as(as(as(as(as(as({},u,{text:n.success,icon:u}),l,{text:n.inProgress,loader:!0}),h,{text:n.error,icon:h}),d,{text:n.cancelled,icon:d}),p,{text:n.timeout,icon:p}),f,{text:n.reconnectFailed,icon:h})[e];return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(us,{"aria-live":"polite",children:n.title}),r?(0,X.jsxs)(fs,{role:"status","aria-live":"polite",children:[r.loader?(0,X.jsx)(hs,{children:(0,X.jsx)(ds,{})}):r.icon&&(0,X.jsx)(xo,{status:r.icon}),(0,X.jsx)(ps,{children:r.text})]}):(0,X.jsx)(os,{})]})}function ms(t){return ms="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ms(t)}function ys(t,e,n){return(e=function(t){var e=function(t){if("object"!=ms(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ms(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ms(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vs(){var t=it().screen;return(0,X.jsx)(X.Fragment,{children:ys(ys({},Q,(0,X.jsx)(Dr,{})),J,(0,X.jsx)(gs,{}))[t.path]})}function bs(t){return bs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bs(t)}function ws(t,e,n){return(e=function(t){var e=function(t){if("object"!=bs(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=bs(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bs(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xs(e){var n=e.backendUrl,i=e.closeCb,o=e.successCb,c=e.failedCb,l=e.theme,u=void 0===l?m:l,h=it().setCallbacks,d=pt().setBackendUrl,p=function(){var e=(0,t.useContext)(sr);if(!e)throw new Error("useThemeContext must be used within ThemeProvider");return e}().setTheme;return(0,t.useEffect)(function(){h(function(t){return ws(ws(ws({},r,null!=i?i:t[r]),s,null!=o?o:t[s]),a,null!=c?c:t[a])}),d(n),p(u)},[i,o,c,n,u,d,h,p]),(0,X.jsx)($r,{children:(0,X.jsx)(vs,{})})}var Ss,_s={en:{translation:JSON.parse('{"app.auth_success":"Access granted","app.auth_in_progress":"Authorization in progress..","app.auth_failed":"Authorization failed","app.auth_cancelled":"Authorization cancelled","app.auth_timeout":"Authorization expired","app.reconnect_failed":"Connection lost. Please try again.","app.about_auth":"Post-Quantum KYC Authorization","auth.about":"Post-Quantum KYC Authorization","auth.scan_qr_desc":"Scan the QR code with the Liberion App to complete authentication.","auth.install_app":"Install Liberion App","auth.install_required_android":"To continue authentication you must have the Liberion App installed","auth.install_required_ios":"To continue authentication you must have the Liberion App installed","auth.open_app":"Open Liberion App","auth.open_app_continue":"Open Liberion App to continue","auth.continue_auth":"Continue Authentication","home.title":"Recognize the whole world on","home.title_highlight":"one platform","home.copyright":"All rights reserved"}')},ru:{translation:JSON.parse('{"app.auth_success":"Доступ предоставлен","app.auth_in_progress":"Авторизация в процессе..","app.auth_failed":"Авторизация не удалась","app.auth_cancelled":"Авторизация отменена","app.auth_timeout":"Сессия истекла","app.reconnect_failed":"Соединение потеряно. Попробуйте снова.","app.about_auth":"Пост-Квантовая авторизация","auth.about":"Пост-Квантовая авторизация","auth.scan_qr_desc":"Отсканируйте QR-код приложением Liberion для завершения авторизации.","auth.install_app":"Установить приложение Liberion","auth.install_required_android":"Для продолжения авторизации необходимо установить приложение Liberion","auth.install_required_ios":"Для продолжения авторизации необходимо установить приложение Liberion","auth.open_app":"Открыть приложение Liberion","auth.open_app_continue":"Откройте приложение Liberion для продолжения","auth.continue_auth":"Продолжить авторизацию","home.title":"Распознавайте весь мир на","home.title_highlight":"одной платформе","home.copyright":"Все права защищены"}')}};function ks(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Pi.use(qi).init({resources:_s,lng:(Ss=navigator.language||navigator.userLanguage,null!=Ss&&Ss.toLowerCase().startsWith("ru")?"ru":"en"),fallbackLng:"en",interpolation:{escapeValue:!1}});var Os=(0,t.memo)(function(e){var r=e.isOpen,i=void 0!==r&&r,o=e.backendUrl,s=e.successCb,a=e.closeCb,c=e.failedCb,l=e.theme,u=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);c=!0);}catch(t){l=!0,i=t}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ks(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ks(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,t.useState)(!1),2),h=u[0],d=u[1];return(0,t.useEffect)(function(){d(i)},[i]),h?(0,n.createPortal)((0,X.jsx)(cr,{children:(0,X.jsx)(xs,{backendUrl:o,successCb:s,failedCb:c,closeCb:function(){d(!1),a&&a()},theme:l})}),document.body):null})})(),o})());
|