PageSourceSearch

https://permatell.vercel.app/_next/static/chunks/2655-66242dd047222de4.js

js permatell.vercel.app collected 2026-10-03 07:29:06 UTC 89,315 bytes, 62 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2655],{669:(t,e,r)=>{let n=r(46342).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];let e=Math.floor(t/7)+2,r=n(t),o=145===r?26:2*Math.ceil((r-13)/(2*e-2)),i=[r-7];for(let t=1;t<e-1;t++)i[t]=i[t-1]-o;return i.push(6),i.reverse()},e.getPositions=function(t){let r=[],n=e.getRowColCoords(t),o=n.length;for(let t=0;t<o;t++)for(let e=0;e<o;e++)(0!==t||0!==e)&&(0!==t||e!==o-1)&&(t!==o-1||0!==e)&&r.push([n[t],n[e]]);return r}},1902:(t,e,r)=>{"use strict";r.d(e,{A:()=>P});var n=r(81029).Buffer,o=Object.create,i=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,c=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),f=(t,e,r)=>(r=null!=t?o(l(t)):{},((t,e,r,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let o of a(e))u.call(t,o)||o===r||i(t,o,{get:()=>e[o],enumerable:!(n=s(e,o))||n.enumerable});return t})(!e&&t&&t.__esModule?r:i(r,"default",{value:t,enumerable:!0}),t)),h=c((t,e)=>{var r,n,o=e.exports={};function i(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(t){n=s}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}var l,u=[],c=!1,f=-1;function h(){c&&l&&(c=!1,l.length?u=l.concat(u):f=-1,u.length&&d())}function d(){if(!c){var t=a(h);c=!0;for(var e=u.length;e;){for(l=u,u=[];++f<e;)l&&l[f].run();f=-1,e=u.length}l=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function g(){}o.nextTick=function(t){var e=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||c||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(t){return[]},o.binding=function(t){throw Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw Error("process.chdir is not supported")},o.umask=function(){return 0}}),d=c(t=>{f(h()),t.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return(r+n)*3/4-n},t.toByteArray=function(t){var e,r,n=a(t),s=n[0],l=n[1],u=new i((s+l)*3/4-l),c=0,f=l>0?s-4:s;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===l&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,u[c++]=255&e),1===l&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u},t.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],s=0,a=r-o;s<a;s+=16383)i.push(function(t,e,r){for(var o,i=[],s=e;s<r;s+=3)i.push(n[(o=(t[s]<<16&0xff0000)+(t[s+1]<<8&65280)+(255&t[s+2]))>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return i.join("")}(t,s,s+16383>a?a:s+16383));return 1===o?i.push(n[(e=t[r-1])>>2]+n[e<<4&63]+"=="):2===o&&i.push(n[(e=(t[r-2]<<8)+t[r-1])>>10]+n[e>>4&63]+n[e<<2&63]+"="),i.join("")};var e,r,n=[],o=[],i="u">typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(e=0,r=s.length;e<r;++e)n[e]=s[e],o[s.charCodeAt(e)]=e;function a(t){var e=t.length;if(e%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}o[45]=62,o[95]=63}),p=c(t=>{f(h()),t.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,l=(1<<a)-1,u=l>>1,c=-7,f=r?o-1:0,h=r?-1:1,d=t[e+f];for(f+=h,i=d&(1<<-c)-1,d>>=-c,c+=a;c>0;i=256*i+t[e+f],f+=h,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=n;c>0;s=256*s+t[e+f],f+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),i-=u}return(d?-1:1)*s*Math.pow(2,i-n)},t.write=function(t,e,r,n,o,i){var s,a,l,u=8*i-o-1,c=(1<<u)-1,f=c>>1,h=5960464477539062e-23*(23===o),d=n?0:i-1,p=n?1:-1,g=+(e<0||0===e&&1/e<0);for(isNaN(e=Math.abs(e))||e===1/0?(a=+!!isNaN(e),s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?e+=h/l:e+=h*Math.pow(2,1-f),e*l>=2&&(s++,l/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(e*l-1)*Math.pow(2,o),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;t[r+d]=255&a,d+=p,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;t[r+d]=255&s,d+=p,s/=256,u-=8);t[r+d-p]|=128*g}}),g=c(t=>{f(h());var e=d(),r=p(),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(t){if(t>
vendor: 14,875 bytes, line 1
10x7fffffff)throw RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,i.prototype),e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw TypeError('The "string" argument must be of type string. Received type number');return l(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t){var n=t,s=e;if(("string"!=typeof s||""===s)&&(s="utf8"),!i.isEncoding(s))throw TypeError("Unknown encoding: "+s);let r=0|y(n,s),a=o(r),l=a.write(n,s);return l!==r&&(a=a.slice(0,l)),a}if(ArrayBuffer.isView(t)){var a=t;if(V(a,Uint8Array)){let t=new Uint8Array(a);return c(t.buffer,t.byteOffset,t.byteLength)}return u(a)}if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(V(t,ArrayBuffer)||t&&V(t.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(V(t,SharedArrayBuffer)||t&&V(t.buffer,SharedArrayBuffer)))return c(t,e,r);if("number"==typeof t)throw TypeError('The "value" argument must not be of type number. Received type number');let l=t.valueOf&&t.valueOf();if(null!=l&&l!==t)return i.from(l,e,r);let f=function(t){if(i.isBuffer(t)){let e=0|g(t.length),r=o(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||function(t){return t!=t}(t.length)?o(0):u(t):"Buffer"===t.type&&Array.isArray(t.data)?u(t.data):void 0}(t);if(f)return f;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return i.from(t[Symbol.toPrimitive]("string"),e,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function a(t){if("number"!=typeof t)throw TypeError('"size" argument must be of type number');if(t<0)throw RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return a(t),o(t<0?0:0|g(t))}function u(t){let e=t.length<0?0:0|g(t.length),r=o(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function c(t,e,r){let n;if(e<0||t.byteLength<e)throw RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),i.prototype),n}function g(t){if(t>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|t}function y(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||V(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return k(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(o)return n?-1:k(t).length;e=(""+e).toLowerCase(),o=!0}}function m(t,r,n){let o=!1;if((void 0===r||r<0)&&(r=0),r>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=e;n<r;++n)o+=H[t[n]];return o}(this,r,n);case"utf8":case"utf-8":return C(this,r,n);case"ascii":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}(this,r,n);case"latin1":case"binary":return function(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}(this,r,n);case"base64":var i,s,a;return i=this,s=r,a=n,0===s&&a===i.length?e.fromByteArray(i):e.fromByteArray(i.slice(s,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){let n=t.slice(e,r),o="";for(let t=0;t<n.length-1;t+=2)o+=String.fromCharCode(n[t]+256*n[t+1]);return o}(this,r,n);default:if(o)throw TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}function w(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){var s;if(0===t.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(s=r*=1)!=s&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return -1;r=t.length-1}else if(r<0)if(!o)return -1;else r=0;if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:E(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):E(t,[e],r,n,o);throw TypeError("val must be string, number or Buffer")}function E(t,e,r,n,o){let i,s=1,a=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return -1;s=2,a/=2,l/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){let n=-1;for(i=r;i<a;i++)if(u(t,i)===u(e,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===l)return n*s}else -1!==n&&(i-=i-n),n=-1}else for(r+l>a&&(r=a-l),i=r;i>=0;i--){let r=!0;for(let n=0;n<l;n++)if(u(t,i+n)!==u(e,n)){r=!1;break}if(r)return i}return -1}function C(t,e,r){r=Math.min(t.length,r);let n=[],o=e;for(;o<r;){let e=t[o],i=null,s=e>239?4:e>223?3:e>191?2:1;if(o+s<=r){let r,n,a,l;switch(s){case 1:e<128&&(i=e);break;case 2:(192&(r=t[o+1]))==128&&(l=(31&e)<<6|63&r)>127&&(i=l);break;case 3:r=t[o+1],n=t[o+2],(192&r)==128&&(192&n)==128&&(l=(15&e)<<12|(63&r)<<6|63&n)>2047&&(l<55296||l>57343)&&(i=l);break;case 4:r=t[o+1],n=t[o+2],a=t[o+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(l=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&l<1114112&&(i=l)}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=s}var i=n;let s=i.length;if(s<=4096)return String.fromCharCode.apply(String,i);let a="",l=0;for(;l<s;)a+=String.fromCharCode.apply(String,i.slice(l,l+=4096));return a}function A(t,e,r){if(t%1!=0||t<0)throw RangeError("offset is not uint");if(t+e>r)throw RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,o,s){if(!i.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<s)throw RangeError('"value" argument is out of bounds');if(r+n>t.length)throw RangeError("Index out of range")}function I(t,e,r,n,o){N(e,n,o,t,r,7);let i=Number(e&BigInt(0xffffffff));t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i;let s=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function T(t,e,r,n,o){N(e,n,o,t,r,7);let i=Number(e&BigInt(0xffffffff));t[r+7]=i,i>>=8,t[r+6]=i,i>>=8,t[r+5]=i,i>>=8,t[r+4]=i;let s=Number(e>>BigInt(32)&BigInt(0xffffffff));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function M(t,e,r,n,o,i){if(r+n>t.length||r<0)throw RangeError("Index out of range")}function P(t,e,n,o,i){return e*=1,n>>>=0,i||M(t,e,n,4,34028234663852886e22,-34028234663852886e22),r.write(t,e,n,o,23,4),n+4}function x(t,e,n,o,i){return e*=1,n>>>=0,i||M(t,e,n,8,17976931348623157e292,-17976931348623157e292),r.write(t,e,n,o,52,8),n+8}t.Buffer=i,t.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,i.TYPED_ARRAY_SUPPORT=function(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),!i.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),i.poolSize=8192,i.from=function(t,e,r){return s(t,e,r)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array),i.alloc=function(t,e,r){return a(t),t<=0?o(t):void 0!==e?"string"==typeof r?o(t).fill(e,r):o(t).fill(e):o(t)},i.allocUnsafe=function(t){return l(t)},i.allocUnsafeSlow=function(t){return l(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==i.prototype},i.compare=function(t,e){if(V(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),V(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:+(n<r)},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){let r;if(!Array.isArray(t))throw TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;let n=i.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){let e=t[r];if(V(e,Uint8Array))o+e.length>n.length?(i.isBuffer(e)||(e=i.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else if(i.isBuffer(e))e.copy(n,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=e.length}return n},i.byteLength=y,i.prototype._isBuffer=!0,i.prototype.swap16=function(){let t=this.length;if(t%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)w(this,e,e+1);return this},i.prototype.swap32=function(){let t=this.length;if(t%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)w(this,e,e+3),w(this,e+1,e+2);return this},i.prototype.swap64=function(){let t=this.length;if(t%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)w(this,e,e+7),w(this,e+1,e+6),w(this,e+2,e+5),w(this,e+3,e+4);return this},i.prototype.toString=function(){let t=this.length;return 0===t?"":0==arguments.length?C(this,0,t):m.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(t){if(!i.isBuffer(t))throw TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){let e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},n&&(i.prototype[n]=i.prototype.inspect),i.prototype.compare=function(t,e,r,n,o){if(V(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return -1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,o>>>=0,this===t)return 0;let s=o-n,a=r-e,l=Math.min(s,a),u=this.slice(n,o),c=t.slice(e,r);for(let t=0;t<l;++t)if(u[t]!==c[t]){s=u[t],a=c[t];break}return s<a?-1:+(a<s)},i.prototype.includes=function(t,e,r){return -1!==this.indexOf(t,e,r)},i.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},i.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},i.prototype.write=function(t,e,r,n){var o,i,s,a,l,u,c,f;if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else if(isFinite(e))e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let h=this.length-e;if((void 0===r||r>h)&&(r=h),t.length>0&&(r<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let d=!1;for(;;)switch(n){case"hex":return function(t,e,r,n){let o;r=Number(r)||0;let i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;let s=e.length;for(n>s/2&&(n=s/2),o=0;o<n;++o){var a;let n=parseInt(e.substr(2*o,2),16);if((a=n)!=a)break;t[r+o]=n}return o}(this,t,e,r);case"utf8":case"utf-8":return o=e,i=r,F(k(t,this.length-o),this,o,i);case"ascii":case"latin1":case"binary":return s=e,a=r,F(function(t){let e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(t),this,s,a);case"base64":return l=e,u=r,F(D(t),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=e,f=r,F(function(t,e){let r,n,o=[];for(let i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o.push(r%256),o.push(n);return o}(t,this.length-c),this,c,f);default:if(d)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),d=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},i.prototype.slice=function(t,e){let r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);let n=this.subarray(t,e);return Object.setPrototypeOf(n,i.prototype),n},i.prototype.readUintLE=i.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return n},i.prototype.readUintBE=i.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},i.prototype.readUint8=i.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readBigUInt64LE=j(function(t){L(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&O(t,this.length-8);let n=e+256*this[++t]+65536*this[++t]+0x1000000*this[++t],o=this[++t]+256*this[++t]+65536*this[++t]+0x1000000*r;return BigInt(n)+(BigInt(o)<<BigInt(32))}),i.prototype.readBigUInt64BE=j(function(t){L(t>>>=0,"offset");let e=this[t],r=this[t+7];(void 0===e||void 0===r)&&O(t,this.length-8);let n=0x1000000*e+65536*this[++t]+256*this[++t]+this[++t],o=0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);let n=this[t],o=1,i=0;for(;
vendor: 5,796 bytes, line 1
1++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);let n=e,o=1,i=this[t+--n];for(;n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?-((255-this[t]+1)*1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);let r=this[t]|this[t+1]<<8;return 32768&r?0xffff0000|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);let r=this[t+1]|this[t]<<8;return 32768&r?0xffff0000|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readBigInt64LE=j(function(t){L(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&O(t,this.length-8),(BigInt(this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24))<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+0x1000000*this[++t])}),i.prototype.readBigInt64BE=j(function(t){L(t>>>=0,"offset");let e=this[t],r=this[t+7];return(void 0===e||void 0===r)&&O(t,this.length-8),(BigInt((e<<24)+65536*this[++t]+256*this[++t]+this[++t])<<BigInt(32))+BigInt(0x1000000*this[++t]+65536*this[++t]+256*this[++t]+r)}),i.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),r.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),r.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),r.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),r.read(this,t,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;B(this,t,e,r,n,0)}let o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(t,e,r,n){if(t*=1,e>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;B(this,t,e,r,n,0)}let o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},i.prototype.writeUint8=i.prototype.writeUInt8=function(t,e,r){return t*=1,e>>>=0,r||B(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(t,e,r){return t*=1,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(t,e,r){return t*=1,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(t,e,r){return t*=1,e>>>=0,r||B(this,t,e,4,0xffffffff,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(t,e,r){return t*=1,e>>>=0,r||B(this,t,e,4,0xffffffff,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeBigUInt64LE=j(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return I(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=j(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return T(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(t,e,r,n){if(t*=1,e>>>=0,!n){let n=Math.pow(2,8*r-1);B(this,t,e,r,n-1,-n)}let o=0,i=1,s=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/i|0)-s&255;return e+r},i.prototype.writeIntBE=function(t,e,r,n){if(t*=1,e>>>=0,!n){let n=Math.pow(2,8*r-1);B(this,t,e,r,n-1,-n)}let o=r-1,i=1,s=0;for(this[e+o]=255&t;--o>=0&&(i*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/i|0)-s&255;return e+r},i.prototype.writeInt8=function(t,e,r){return t*=1,e>>>=0,r||B(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t*=1,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t*=1,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t*=1,e>>>=0,r||B(this,t,e,4,0x7fffffff,-0x80000000),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,r){return t*=1,e>>>=0,r||B(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeBigInt64LE=j(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return I(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=j(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return T(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return x(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return x(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){if(!i.isBuffer(t))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r||0===t.length||0===this.length)return 0;if(e<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);let o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o}
1,i.prototype.fill=function(t,e,r,n){let o;if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===t.length){let e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw RangeError("Out of range index");if(r<=e)return this;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{let s=i.isBuffer(t)?t:i.from(t,n),a=s.length;if(0===a)throw TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=s[o%a]}return this};var R={};function S(t,e,r){R[t]=class extends r{get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return"".concat(this.name," [").concat(t,"]: ").concat(this.message)}constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name="".concat(this.name," [").concat(t,"]"),this.stack,delete this.name}}}function U(t){let e="",r=t.length,n=+("-"===t[0]);for(;r>=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function N(t,e,r,n,o,i){if(t>r||t<e){let n="bigint"==typeof e?"n":"",o;throw o=i>3?0===e||e===BigInt(0)?">= 0".concat(n," and < 2").concat(n," ** ").concat((i+1)*8).concat(n):">= -(2".concat(n," ** ").concat((i+1)*8-1).concat(n,") and < 2 ** ").concat((i+1)*8-1).concat(n):">= ".concat(e).concat(n," and <= ").concat(r).concat(n),new R.ERR_OUT_OF_RANGE("value",o,t)}L(o,"offset"),(void 0===n[o]||void 0===n[o+i])&&O(o,n.length-(i+1))}function L(t,e){if("number"!=typeof t)throw new R.ERR_INVALID_ARG_TYPE(e,"number",t)}function O(t,e,r){throw Math.floor(t)!==t?(L(t,r),new R.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new R.ERR_BUFFER_OUT_OF_BOUNDS:new R.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(+!!r," and <= ").concat(e),t)}S("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"},RangeError),S("ERR_INVALID_ARG_TYPE",function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(typeof e)},TypeError),S("ERR_OUT_OF_RANGE",function(t,e,r){let n='The value of "'.concat(t,'" is out of range.'),o=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?o=U(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=U(o)),o+="n"),n+=" It must be ".concat(e,". Received ").concat(o)},RangeError);var _=/[^+/0-9A-Za-z-_]/g;function k(t,e){e=e||1/0;let r,n=t.length,o=null,i=[];for(let s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319||s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function D(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(_,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function V(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}var H=function(){let t="0123456789abcdef",e=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function j(t){return typeof BigInt>"u"?z:t}function z(){throw Error("BigInt not supported")}});f(h(),1);var y=f(g(),1);f(h(),1),f(h(),1);var m={profileSrc:"_R2XYWDPUXVvQrQKFaQRvDTDcDwnQNbqlTd_qvCRSpQ",module:"Pq2Zftrqut0hdisH_MC2pDOT6S4eQFoxGsFUzR6r350",scheduler:"_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA",profileRegistry:"SNy4m-DrqxWl01YqGM4sxI8qCni-58re8uuJLvZPypY"},w={goldsky:"https://arweave-search.goldsky.com"},b={keys:{contentType:"Content-Type"}},E={dispatchUploadSize:102400};function C(t,e){for(let r=0;r<t.length;r++)if(t[r]&&t[r].name===e)return t[r].value;return null}async function A(t){try{let e=[{name:"Action",value:t.action}];t.tags&&e.push(...t.tags);let r=t.data,n=await t.ao.message({process:t.processId,signer:t.signer,tags:e,data:r}),{Messages:o}=await t.ao.result({message:n,process:t.processId});if(!o||!o.length)return null;{let e={};return o.forEach(r=>{let o=C(r.Tags,"Action")||t.action,i=null,s=r.Data;if(s)try{i=JSON.parse(s)}catch(t){i=s}let a=C(r.Tags,"Status"),l=C(r.Tags,"Message");e[o]={id:n,status:a,message:l,data:i}}),e}}catch(t){console.error(t)}}function B(t){return Object.fromEntries(Object.entries(t).map(t=>{let[e,r]=t;return[e.charAt(0).toUpperCase()+e.slice(1),r]}))}async function I(t){let e=null,o=null;try{let r;"string"==typeof t.data&&t.data.startsWith("data:")&&(e=n.from(t.data.split(",")[1],"base64"),o=(r=t.data.match(/^data:([a-zA-Z0-9]+\/[a-zA-Z0-9-.+]+);base64,/))?r[1]:null)}catch(t){throw Error(t)}if(e&&o)if(function(t){let e;if(n.isBuffer(t))e=t.length;else if("string"==typeof t)e=n.byteLength(t,"utf-8");else throw Error("Input must be a string or a Buffer");return e}(e)<Number(E.dispatchUploadSize)){let n=await t.arweave.createTransaction({data:e},"use_wallet");return n.addTag(b.keys.contentType,o),t.tags&&t.tags.length>
10&&t.tags.forEach(t=>n.addTag(t.name,t.value)),r.g.window&&r.g.window.arweaveWallet?(await r.g.window.arweaveWallet.dispatch(n)).id:""}else throw Error("Data exceeds max upload limit");throw Error("Error preparing transaction data")}function T(t){return async e=>{var r;if(!e)return"";if(e&&/^[a-z0-9_-]{43}$/i.test(e))return e;if(t.arweave)try{return await I({data:e,arweave:t.arweave})}catch(t){throw Error(null!=(r=t.message)?r:"Error resolving transaction")}throw Error("Must initialize with Arweave in order to upload data")}}async function M(t){let e=[{name:"Action",value:t.action}];t.tags&&e.push(...t.tags);let r=JSON.stringify(t.data||{}),n=await t.ao.dryrun({process:t.processId,tags:e,data:r});if(n.Messages&&n.Messages.length){if(n.Messages[0].Data)return JSON.parse(n.Messages[0].Data);if(n.Messages[0].Tags)return n.Messages[0].Tags.reduce((t,e)=>(t[e.name]=e.value,t),{})}}f(h(),1),f(h(),1),globalThis.Buffer||(globalThis.Buffer=y.Buffer);var P={init:t=>{var e;return{createProfile:function(t){return async e=>{try{if(!t.signer)throw Error("Must initialize with a signer to create profiles");let r=e.profileSrc?e.profileSrc:m.profileSrc,n=await fetch("".concat(t.arweaveUrl,"/").concat(r));if(!n.ok)throw Error("Error fetching the process source code.");let o=await n.text(),i=[{name:"Date-Created",value:new Date().getTime().toString()},{name:"Action",value:"Create-Profile"}],{thumbnail:s,banner:a,...l}=e.data,u={...l,ProfileImage:await t.resolveTransaction(s),CoverImage:await t.resolveTransaction(a)};t.logging&&console.log("Spawning profile process...");let c=await t.ao.spawn({module:e.module?e.module:m.module,scheduler:e.scheduler?e.scheduler:m.scheduler,signer:t.signer,tags:i,data:JSON.stringify(B(u))});t.logging&&console.log("Process Id -",c),t.logging&&console.log("Sending source eval...");let f=await t.ao.message({process:c,signer:t.signer,tags:[{name:"Action",value:"Eval"}],data:o});t.logging&&console.log(f);let h=await t.ao.result({message:f,process:c});return t.logging&&console.log(h),await new Promise(t=>setTimeout(t,1e3)),t.logging&&console.log("Updating profile data..."),await A({processId:c,action:"Update-Profile",tags:null,data:JSON.stringify(B(u)),ao:t.ao,signer:t.signer}),c}catch(t){throw Error(t)}}}({ao:t.ao,signer:t.signer,arweaveUrl:(null==t?void 0:t.arweaveUrl)?t.arweaveUrl:"https://arweave.net",graphqlUrl:(null==t?void 0:t.graphqlUrl)?t.graphqlUrl:w.goldsky,logging:t.logging,resolveTransaction:T({arweave:t.arweave})}),updateProfile:function(t){return async e=>{var r;if(!t.signer)throw Error("Must initialize with a signer to update profiles");t.logging&&console.log("Updating Profile ".concat(e.profileId));let{thumbnail:n,banner:o,...i}=e.data,s={...i,ProfileImage:await t.resolveTransaction(n),CoverImage:await t.resolveTransaction(o)};return null==(r=(await A({processId:e.profileId,action:"Update-Profile",tags:[{name:"ProfileProcess",value:e.profileId}],data:JSON.stringify(B(s)),ao:t.ao,signer:t.signer}))["Profile-Success"])?void 0:r.id}}({ao:t.ao,signer:t.signer,logging:t.logging,resolveTransaction:T({arweave:t.arweave})}),getProfileById:(e={ao:t.ao,registry:t.registry},async t=>{let r={id:t.profileId,walletAddress:null,displayName:null,username:null,description:null,thumbnail:null,banner:null,version:null};try{var n,o;let i=await M({processId:t.profileId,action:"Info",data:null,ao:e.ao});return i?{id:t.profileId,walletAddress:i.Owner||null,displayName:i.Profile.DisplayName||null,username:i.Profile.UserName||null,description:i.Profile.Description||null,thumbnail:i.Profile.ProfileImage||null,banner:i.Profile.CoverImage||null,version:i.Profile.Version||null,assets:null!=(o=null==(n=i.Assets)?void 0:n.map(t=>t.Id))?o:[]}:r}catch(t){throw Error(t)}}),getProfileByWalletAddress:function(t){return async e=>{let r={id:null,walletAddress:e.address,displayName:null,username:null,description:null,thumbnail:null,banner:null,version:null};try{let i=await M({processId:t.registry?t.registry:m.profileRegistry,action:"Get-Profiles-By-Delegate",data:{Address:e.address},ao:t.ao}),s=null;if(i&&i.length>0&&i[0].ProfileId&&(s=i[0].ProfileId),!s)return r;{var n,o;let e=await M({processId:s,action:"Info",data:null,ao:t.ao});return e?{id:s,walletAddress:e.Owner||null,displayName:e.Profile.DisplayName||null,username:e.Profile.UserName||null,description:e.Profile.Description||null,thumbnail:e.Profile.ProfileImage||null,banner:e.Profile.CoverImage||null,version:e.Profile.Version||null,assets:null!=(o=null==(n=e.Assets)?void 0:n.map(t=>t.Id))?o:[]}:r}}catch(t){throw Error(t)}}}({ao:t.ao,registry:t.registry}),getRegistryProfiles:function(t){return async e=>{try{let r=await M({processId:t.registry?t.registry:m.profileRegistry,action:"Get-Metadata-By-ProfileIds",data:{ProfileIds:e.profileIds},ao:t.ao});return r&&r.length?e.profileIds.map(t=>{var e;let n=r.find(e=>e.ProfileId===t);return{id:n?n.ProfileId:t,username:n?n.Username:null,thumbnail:n?n.ProfileImage:null,description:n&&null!=(e=n.Description)?e:null,lastUpdate:Date.now().toString()}}):[]}catch(t){throw Error(t)}}}({ao:t.ao,registry:t.registry})}}}},9099:(t,e,r)=>{"use strict";r.d(e,{_:()=>o});var n=r(64856);function o(t,e){var r=(0,n._)(t,e,"update");if(r.set){if(!r.get)throw TypeError("attempted to read set only private field");return"__destrWrapper"in r||(r.__destrWrapper={set value(v){r.set.call(t,v)},get value(){return r.get.call(t)}}),r.__destrWrapper}if(!r.writable)throw TypeError("attempted to set read only private field");return r}},10429:(t,e)=>{let r=new Uint8Array(512),n=new Uint8Array(256);!function(){let t=1;for(let e=0;e<255;e++)r[e]=t,n[t]=e,256&(t<<=1)&&(t^=285);for(let t=255;t<512;t++)r[t]=r[t-255]}(),e.log=function(t){if(t<1)throw Error("log("+t+")");return n[t]},e.exp=function(t){return r[t]},e.mul=function(t,e){return 0===t||0===e?0:r[n[t]+n[e]]}},14933:(t,e,r)=>{"use strict";function n(t,e){if(e.has(t))throw TypeError("Cannot initialize the same private elements twice on an object")}r.d(e,{_:()=>n})},17622:(t,e,r)=>{"use strict";let n;r.d(e,{B:()=>M,v:()=>i});var o=r(12115);function i(){let t=(0,o.useContext)(T);if(!t)throw Error("useWallet must be used within AoSyncProvider");return t}var s=r(10405),a=r.n(s),l=r(41303);let u={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},c=new Uint8Array(16),f=[];for(let t=0;t<256;++t)f.push((t+256).toString(16).slice(1));let h=function(t,e,r){if(u.randomUUID&&!e&&!t)return u.randomUUID();let o=(t=t||{}
1).random??t.rng?.()??function(){if(!n){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");n=crypto.getRandomValues.bind(crypto)}return n(c)}();if(o.length<16)throw Error("Random bytes length must be >= 16");if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){if((r=r||0)<0||r+16>e.length)throw RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[r+t]=o[t];return e}return function(t,e=0){return(f[t[e+0]]+f[t[e+1]]+f[t[e+2]]+f[t[e+3]]+"-"+f[t[e+4]]+f[t[e+5]]+"-"+f[t[e+6]]+f[t[e+7]]+"-"+f[t[e+8]]+f[t[e+9]]+"-"+f[t[e+10]]+f[t[e+11]]+f[t[e+12]]+f[t[e+13]]+f[t[e+14]]+f[t[e+15]]).toLowerCase()}(o)};var d=r(52769),p=r(81029);let g={modal:{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"999999"},backdrop:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)"},content:{background:"white",borderRadius:"16px",padding:"28px",paddingTop:"47px",textAlign:"center",minWidth:"364px",display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",backgroundRepeat:"no-repeat",zIndex:"10",boxSizing:"border-box",backgroundImage:"url(https://arweave.net/zNeeL2prnXwctfwCo07xyhT8ob-M6F70RgYObK51Y90)"},iconContainer:{width:"50px",height:"50px",borderRadius:"50%",backgroundColor:"#F7FAFD",marginBottom:"12px",display:"flex",justifyContent:"center",alignItems:"center"},title:{color:"#000",fontSize:"18px",fontWeight:"500",marginBottom:"5px",marginTop:"0px",fontFamily:"Sora"},subtitle:{fontSize:"14px",color:"#2B2B2B",marginBottom:"2px"},description:{fontSize:"11px",color:"#2B2B2B",fontFamily:"Sora"},statusMark:{width:"200px",height:"200px",marginBottom:"10px",display:"flex",justifyContent:"center",alignItems:"center",paddingBottom:"30px",boxSizing:"border-box"},modalLink:{color:"#09084B"}};"undefined"!=typeof window&&(null==window?void 0:window.matchMedia)&&(null==window?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches)&&(g.content.backgroundImage="url(https://arweave.net/fqogTk0hEVP6YXgMsfsucioYUfOd4gVHHJvd8pG-Dg4)",g.content.backgroundColor="#0A0B19",g.iconContainer.backgroundColor="#232330",g.title.color="#ffffff",g.description.color="#ffffff",g.subtitle.color="#84858C",g.modalLink.color="#4969FF",g.backdrop.backgroundColor="rgba(0, 0, 0, 0.3)");let y=`
2    @media (max-width: 768px) {
3      #aosync-modal-content {
4        width: 100% !important;
5        min-width: 100% !important;
6        margin: 0 !important;
7        border-radius: 16px 16px 0 0 !important;
8        position: fixed !important;
9        bottom: 0 !important;
10        max-height: 90vh !important;
11        overflow-y: auto !important;
12        background-size: 100% !important;
13      }
14      #aosync-modal {
15        align-items: flex-end !important;
16      }
17    }
18  `,m={qrCode:{success:`<svg width="120" height="120" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
19      <path opacity="0.05" d="M60 120C93.1371 120 120 93.1371 120 60C120 26.8629 93.1371 0 60 0C26.8629 0 0 26.8629 0 60C0 93.1371 26.8629 120 60 120Z" fill="#B5BBF8"/>
20      <path opacity="0.15" d="M60.0001 11.8649C33.4113 11.8649 11.8652 33.4109 11.8652 59.9997C11.8652 86.5885 33.4113 108.135 60.0001 108.135C86.5888 108.135 108.135 86.5885 108.135 59.9997C108.135 33.4109 86.5754 11.8649 60.0001 11.8649Z" fill="#B5BBF8"/>
21      <path d="M60.1162 23.8484C40.0803 23.8484 23.8466 40.0821 23.8466 60.1181C23.8466 80.154 40.0803 96.3877 60.1162 96.3877C80.1522 96.3877 96.3859 80.154 96.3859 60.1181C96.3859 40.0821 80.1387 23.8484 60.1162 23.8484Z" fill="#4969FF"/>
22      <path d="M55.1348 67.5838L73.6683 49.1055C73.9872 48.7871 74.3605 48.6246 74.7882 48.6178C75.2159 48.611 75.5961 48.7736 75.929 49.1055C76.2619 49.4374 76.4284 49.8185 76.4284 50.2488C76.4284 50.6795 76.2619 51.0608 75.929 51.3927L56.4923 70.8047C56.1043 71.1912 55.6518 71.3844 55.1348 71.3844C54.6177 71.3844 54.1652 71.1912 53.7772 70.8047L44.82 61.8741C44.501 61.5557 44.3437 61.1778 44.348 60.7404C44.3519 60.3033 44.5203 59.9188 44.8532 59.5869C45.1861 59.255 45.5684 59.089 46 59.089C46.4319 59.089 46.8144 59.255 47.1473 59.5869
22L55.1348 67.5838Z" fill="#F3F4F5"/>
23      </svg>
24      `,fail:`<svg width="120" height="120" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
25      <path opacity="0.1" d="M60 120C93.1371 120 120 93.1371 120 60C120 26.8629 93.1371 0 60 0C26.8629 0 0 26.8629 0 60C0 93.1371 26.8629 120 60 120Z" fill="#EE5757" fill-opacity="0.5"/>
26      <path opacity="0.3" d="M60.0001 11.8652C33.4113 11.8652 11.8652 33.4113 11.8652 60.0001C11.8652 86.5888 33.4113 108.135 60.0001 108.135C86.5888 108.135 108.135 86.5888 108.135 60.0001C108.135 33.4113 86.5754 11.8652 60.0001 11.8652Z" fill="#EE5757" fill-opacity="0.5"/>
27      <path d="M60.1163 23.8468C40.0804 23.8468 23.8467 40.0805 23.8467 60.1165C23.8467 80.1524 40.0804 96.3861 60.1163 96.3861C80.1523 96.3861 96.386 80.1524 96.386 60.1165C96.386 40.0805 80.1388 23.8468 60.1163 23.8468Z" fill="#EE5757"/>
28      <path d="M60.0002 64.3334C59.3863 64.3334 58.8717 64.1257 58.4564 63.7105C58.0411 63.2952 57.8335 62.7806 57.8335 62.1667V47C57.8335 46.3862 58.0411 45.8716 58.4564 45.4563C58.8717 45.041 59.3863 44.8334 60.0002 44.8334C60.6141 44.8334 61.1286 45.041 61.5439 45.4563C61.9592 45.8716 62.1668 46.3862 62.1668 47V62.1667C62.1668 62.7806 61.9592 63.2952 61.5439 63.7105C61.1286 64.1257 60.6141 64.3334 60.0002 64.3334ZM60.0002 75.1667C59.3863 75.1667 58.8717 74.9591 58.4564 74.5438C58.0411 74.1285 57.8335 73.6139 57.8335 73C57.8335 72.3862 58.0411 71.8716 58.4564 71.4563C58.8717 71.041 59.3863 70.8334 60.0002 70.8334C60.6141 70.8334 61.1286 71.041 61.5439 71.4563C61.9592 71.8716 62.1668 72.3862 62.1668 73C62.1668 73.6139 61.9592 74.1285 61.5439 74.5438C61.1286 74.9591 60.6141 75.1667 60.0002 75.1667Z" fill="white"/>
29      </svg>
30      `,scanner:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
31      <path d="M3.24975 7.01925C3.03708 7.01925 2.859 6.94733 2.7155 6.8035C2.57183 6.65983 2.5 6.48175 2.5 6.26925V3.404C2.5 3.14783 2.58667 2.93317 2.76 2.76C2.93317 2.58667 3.14783 2.5 3.404 2.5H6.26925C6.48175 2.5 6.65983 2.57192 6.8035 2.71575C6.94733 2.85958 7.01925 3.03775 7.01925 3.25025C7.01925 3.46292 6.94733 3.641 6.8035 3.7845C6.65983 3.92817 6.48175 4 6.26925 4H4V6.26925C4 6.48175 3.92808 6.65983 3.78425 6.8035C3.64042 6.94733 3.46225 7.01925 3.24975 7.01925ZM3.404 21.5C3.14783 21.5 2.93317 21.4133 2.76 21.24C2.58667 21.0668 2.5 20.8522 2.5 20.596V17.7308C2.5 17.5182 2.57192 17.3402 2.71575 17.1965C2.85958 17.0527 3.03775 16.9808 3.25025 16.9808C3.46292 16.9808 3.641 17.0527 3.7845 17.1965C3.92817 17.3402 4 17.5182 4 17.7308V20H6.26925C6.48175 20 6.65983 20.0719 6.8035 20.2157C6.94733 20.3596 7.01925 20.5378 7.01925 20.7502C7.01925 20.9629 6.94733 21.141 6.8035 21.2845C6.65983 21.4282 6.48175 21.5 6.26925 21.5H3.404ZM17.7308 21.5C17.5182 21.5 17.3402 21.428
311 17.1965 21.2843C17.0527 21.1404 16.9808 20.9622 16.9808 20.7498C16.9808 20.5371 17.0527 20.359 17.1965 20.2155C17.3402 20.0718 17.5182 20 17.7308 20H20V17.7308C20 17.5182 20.0719 17.3402 20.2157 17.1965C20.3596 17.0527 20.5378 16.9808 20.7502 16.9808C20.9629 16.9808 21.141 17.0527 21.2845 17.1965C21.4282 17.3402 21.5 17.5182 21.5 17.7308V20.596C21.5 20.8522 21.4133 21.0668 21.24 21.24C21.0668 21.4133 20.8522 21.5 20.596 21.5H17.7308ZM20.7498 7.01925C20.5371 7.01925 20.359 6.94733 20.2155 6.8035C20.0718 6.65983 20 6.48175 20 6.26925V4H17.7308C17.5182 4 17.3402 3.92808 17.1965 3.78425C17.0527 3.64042 16.9808 3.46225 16.9808 3.24975C16.9808 3.03708 17.0527 2.859 17.1965 2.7155C17.3402 2.57183 17.5182 2.5 17.7308 2.5H20.596C20.8522 2.5 21.0668 2.58667 21.24 2.76C21.4133 2.93317 21.5 3.14783 21.5 3.404V6.26925C21.5 6.48175 21.4281 6.65983 21.2843 6.8035C21.1404 6.94733 20.9622 7.01925 20.7498 7.01925ZM17.2212 18.577V17.2212H18.577V18.577H17.2212ZM17.2212 15.8652V14.5095H18.577V15.8652H17.2212ZM15.8652 17.2212V15.8652H17.2212V17.2212H15.8652ZM14.5095 18.577V17.2212H15.8652V18.577H14.5095ZM13.1538 17.2212V15.8652H14.5095V17.2212H13.1538ZM15.8652 14.5095V13.1538H17.2212V14.5095H15.8652ZM14.5095 15.8652V14.5095H15.8652V15.8652H14.5095ZM13.1538 14.5095V13.1538H14.5095V14.5095H13.1538ZM14.0555 10.8462C13.7993 10.8462 13.585 10.7596 13.4125 10.5863C13.24 10.4129 13.1538 10.1981 13.1538 9.94175V6.32475C13.1538 6.06858 13.2404 5.85425 13.4137 5.68175C13.5871 5.50925 13.8019 5.423 14.0583 5.423H17.6753C17.9314 5.423 18.1458 5.50967 18.3182 5.683C18.4907 5.85633 18.577 6.07117 18.577 6.3275V9.9445C18.577 10.2007 18.4903 10.415 18.317 10.5875C18.1437 10.76 17.9288 10.8462 17.6725 10.8462H14.0555ZM6.32475 18.577C6.06858 18.577 5.85425 18.4903 5.68175 18.317C5.50925 18.1437 5.423 17.9288 5.423 17.6725V14.0555C5.423 13.7993 5.50967 13.585 5.683 13.4125C5.85633 13.24 6.07117 13.1538 6.3275 13.1538H9.9445C10.2007 13.1538 10.415 13.2404 10.5875 13.4137C10.76 13.5871 10.8463 13.8019 10.8463 14.0582V17.6753C10.8463 17.9314 10.7596 18.1458 10.5863 18.3182C10.4129 18.4907 10.1981 18.577 9.94175 18.577H6.32475ZM6.32475 10.8462C6.06858 10.8462 5.85425 10.7596 5.68175 10.5863C5.50925 10.4129 5.423 10.1981 5.423 9.94175V6.32475C5.423 6.06858 5.50967 5.85425 5.683 5.68175C5.85633 5.50925 6.07117 5.423 6.3275 5.423H9.9445C10.2007 5.423 10.415 5.50967 10.5875 5.683C10.76 5.85633 10.8463 6.07117 10.8463 6.3275V9.9445C10.8463 10.2007 10.7596 10.415 10.5863 10.5875C10.4129 10.76 10.1981 10.8462 9.94175 10.8462H6.32475ZM6.6155 17.3845H9.65375V14.3463H6.6155V17.3845ZM6.6155 9.65375H9.65375V6.6155H6.6155V9.65375ZM14.3462 9.65375H17.3845V6.6155H14.3462V9.65375Z" fill="#4969FF"/>
32      </svg>
33      `},loadingAnimation:"https://arweave.net/j6XByc7Z1bKa3SytVcr-Ifykecvc5EQnXmh-HeXD428"};function w(t){return Object.entries(t).map(([t,e])=>{let r=t.replace(/([A-Z])/g,"-$1").toLowerCase();return`${r}: ${e}`}).join(";")}let b=`
34  .aosync-modal-fade-in {
35    animation: fadeIn 0.1s ease;
36  }
37  .aosync-modal-fade-out {
38    animation: fadeOut 0.2s ease;
39  }
40  @keyframes fadeIn {
41    from { opacity: 0; }
42    to { opacity: 1; }
43  }
44  @keyframes fadeOut {
45    from { opacity: 1; }
46    to { opacity: 0; }
47  }
48`,E=({subTitle:t,description:e,qrCodeData:r,animationData:n,autoClose:o,walletClient:i})=>{if(!document.getElementById("aosync-modal-styles")){let t=document.createElement("style");t.id="aosync-modal-styles",t.textContent=b+y,document.head.appendChild(t)}let s=document.createElement("div");Object.assign(s.style,g.modal),s.className="aosync-modal-fade-in",s.id="aosync-modal-container";let a=document.createElement("div");Object.assign(a.style,g.backdrop),a.onclick=()=>C(s,i);let l=document.createElement("div");if(Object.assign(l.style,g.content),l.style.setProperty("font-family","Sora","important"),l.id="aosync-modal-content",l.innerHTML=`
49     <div style="${w(g.iconContainer)}">
50      ${m.qrCode.scanner}
51     </div>
52     <h3 style="${w(g.title)}">AOSync</h3>
53     <div style="${w(g.subtitle)}">${t}</div>
54     ${r?`<img id="aosync-beacon-connection-qrCode" src="${r}" alt="QR Code" style="width: 200px; height: 200px; margin-bottom: 10px;">`:""}
55     ${n?'<div id="aosync-lottie-animation" style="width: 200px; height: 200px; margin-bottom: 10px;"></div>':""}
56     <div style="${w(g.description)}">
57       <span id="aosync-beacon-modal-description">${e}</span>
58       <a href="https://beaconwallet.app" target="_blank" style="${w(g.modalLink)}; text-decoration: none; display: block; margin-top: 8px;">
59         beaconwallet.app
60       </a>
61     </div>
62  `,s.appendChild(a),s.appendChild(l),document.body.appendChild(s),n){let t=document.getElementById("aosync-lottie-animation");if(t){let e=document.createElement("img");e.src=m.loadingAnimation,e.style.width="100%",t.appendChild(e)}}return o&&setTimeout(()=>{C(s),document.getElementById("aosync-modal-container")&&document.body.removeChild(document.getElementById("aosync-modal-container"))},1e3),s};function C(t,e){e&&e.connectionListener("connection_canceled"),t.className="aosync-modal-fade-out",setTimeout(()=>t.remove(),150)}function A(t){let e=document.getElementById("aosync-beacon-connection-qrCode")||document.getElementById("aosync-lottie-animation");if(!e)return;let r=document.getElementById("aosync-modal-container");if(!r)return;let n=document.createElement("div");Object.assign(n.style,g.statusMark),n.className="aosync-modal-fade-in",n.innerHTML="success"===t?m.qrCode.success:m.qrCode.fail,e.replaceWith(n),setTimeout(()=>C(r),1e3)}if(r(89780),r(43968),r(49693),"undefined"!=typeof window){let t=document.createElement("link");t.rel="preconnect",t.href="https://fonts.googleapis.com",document.head.appendChild(t);let e=document.createElement("link");e.rel="preconnect",e.href="https://fonts.gstatic.com",e.crossOrigin="anonymous",document.head.appendChild(e);let r=document.createElement("link");r.rel="stylesheet",r.href="https://fonts.googleapis.com/css2?family=Sora:[email protected]&display=swap",document.head.appendChild(r)}class B{constructor(t=3e4,e=3e5){this.client=null,this.uid=null,this.qrCode=null,this.modal=null,this.approvalModal=null,this.responseListeners=new Map,this.connectionListener=null,this.reconnectListener=null,this.responseTimeoutMs=t,this.txTimeoutMs=e,this.eventListeners=new Map,this.activeTimeouts=new Set,this.isConnected=!1,this.reconnectionTimeout=null,this.connectOptions=null,this.pendingRequests=[],this.isDarkMode="undefined"!=typeof window&&(null==window?void 0:window.matchMedia)&&(null==window?void 0:window.matchMedia("(prefers-color-scheme: dark)").matches),this.sessionActive="undefined"!=typeof window&&!!sessionStorage.getItem("aosync-topic-id"),"undefined"!=typeof window&&sessionStorage.setItem("aosync-session-active",`${!!sessionStorage.getItem("aosync-topic-id")}`)}createModal(t,e){let r=E({subTitle:"Scan with your beacon wallet",qrCodeData:t,description:"Don't have beacon yet?",walletClient:this});this.modal=r}createApprovalModal(){if(this.approvalModal)return;let t=E({subTitle:"Approval pending ...",description:" ",animationData:!0});this.approvalModal=t}async handleMQTTMessage(t,e,r){var n,o,i;if(t!==`${this.uid}/response`)return;let s=JSON.parse(e.toString());if("connect"===s.action){A("success"),this.modal&&(this.modal=null),await this.handleConnectResponse(r),sessionStorage.setItem("aosync-topic-id",this.uid);return}if("disconnect"===s.action)return void await this.handleDisconnectResponse("Beacon wallet initiated disconnect");(null==r?void 0:r.properties.correlationData.toString())==(null==(n=this.reconnectListener)?void 0:n.corellationId)&&(clearTimeout(this.reconnectionTimeout),this.processPendingRequests(),this.isConnected=!0,this.reconnectListener=null,this.populateWindowObject(),this.emit("connected",{status:"connected successfully"}));let a=null==(i=null==(o=null==r?void 0:r.properties)?void 0:o.correlationData)?void 0:i.toString();if(a&&this.responseListeners.has(a)){let t=this.responseListeners.get(a),e=["sign","dispatch","signDataItem"].includes(t.action);if("signDataItem"===t.action){let e=this.base64UrlDecode(s.data);t.resolve(e)}else t.resolve(s.data);e&&("declined"===s.data?A("fail"):A("success"),this.approvalModal&&(this.approvalModal=null)),this.responseListeners.delete(a)}}base64UrlDecode(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r=atob(e.padEnd(e.length+(4-e.length%4)%4,"=")),n=new Uint8Array(r.length);for(let t=0;t<r.length;t++)n[t]=r.charCodeAt(t);return n}async handleConnectResponse(t){var e,r,n;this.isConnected=!0,this.populateWindowObject(),this.connectionListener&&this.connectionListener("connected");let o=this.uid,i={appInfo:{name:(null==(e=this.connectOptions.appInfo)?void 0:e.name)||"unknown",url:"unknown",logo:(null==(r=this.connectOptions.appInfo)?void 0:r.logo)||"unknown"},permissions:this.connectOptions.permissions,gateway:this.connectOptions.gateway},s=(null==(n=null==t?void 0:t.properties)?void 0:n.correlationData)?{properties:{correlationData:t.properties.correlationData}}:{};
62o&&await this.publishMessage(o,i,s),this.emit("connected",{status:"connected successfully"})}async handleDisconnectResponse(t){this.isConnected=!1,this.approvalModal=null,this.emit("disconnected",{reason:t}),E({subTitle:"Beacon wallet disconnected",description:" ",autoClose:!0}),await this.disconnect()}async publishMessage(t,e,r={}){return new Promise((n,o)=>{var i;null==(i=this.client)||i.publish(t,JSON.stringify(e),r,t=>t?o(t):n())})}createResponsePromise(t,e={}){if(sessionStorage.getItem("aosync-topic-id")&&!this.client)return new Promise((r,n)=>{this.pendingRequests.push({method:t,args:[e],resolve:r,reject:n})});if(!sessionStorage.getItem("aosync-topic-id")&&!this.client){this.isConnected=!1,this.approvalModal=null,this.emit("disconnected",{reson:"AOsync connection not found"}),this.browserWalletBackup&&(window.arweaveWallet=this.browserWalletBackup);return}let r=h(),n=this.uid,o=["sign","dispatch","signDataItem"].includes(t),i=o?this.txTimeoutMs:this.responseTimeoutMs;return new Promise((s,a)=>{if(!this.client)return void a(Error("Not connected to AOSync"));this.responseListeners.set(r,{action:t,resolve:s}),n&&this.publishMessage(n,{action:t,correlationData:r,...e},{properties:{correlationData:p.Buffer.from(r,"utf-8")}}).catch(t=>{this.responseListeners.delete(r),a(t)}),o&&this.createApprovalModal();let l=setTimeout(()=>{this.responseListeners.has(r)&&(this.responseListeners.delete(r),a(Error(`${t} timeout`))),o&&document.getElementById("aosync-modal")&&A("fail"),this.activeTimeouts.delete(l)},i);this.activeTimeouts.add(l)})}clearAllTimeouts(){this.activeTimeouts.forEach(t=>clearTimeout(t)),this.activeTimeouts.clear()}async connect({permissions:t=["ACCESS_ADDRESS","ACCESS_ALL_ADDRESSES","ACCESS_ARWEAVE_CONFIG","ACCESS_PUBLIC_KEY","ACCESS_TOKENS","DECRYPT","DISPATCH","ENCRYPT","SIGNATURE","SIGN_TRANSACTION"],appInfo:e={name:"unknown",logo:"app logo"},gateway:r={host:"arweave.net",port:443,protocol:"https"},brokerUrl:n="wss://aosync-broker-eu.beaconwallet.dev:8081",options:o={protocolVersion:5}}){if(this.isConnected)return;if(this.client){let t=await d.toDataURL("aosync="+this.uid);this.createModal(t),console.warn("Already connected to the broker.");return}this.uid=h(),this.client=l.A.connect(n,o),this.sessionActive=!0,sessionStorage.setItem("aosync-session-active","true");let i=`${this.uid}/response`,s={};s=this.isDarkMode?{color:{dark:"#FFFFFF",light:"#0A0B19"}}
62:{color:{dark:"#0A0B19",light:"#FFFFFF"}};let a=await d.toDataURL("aosync="+this.uid,s);return this.createModal(a),this.connectOptions={permissions:t,appInfo:e,gateway:r},new Promise((t,e)=>{this.connectionListener=r=>{if("connection_canceled"===r){this.client&&this.client.end(!1,()=>{this.client=null}),e(Error("Connection canceled by user"));return}t(r)},this.client.on("connect",async()=>{try{await new Promise((t,e)=>{this.client.subscribe(i,r=>{r?e(r):t()})}),this.client.on("message",this.handleMQTTMessage.bind(this))}catch(t){e(t)}}),this.client.on("error",e)})}async reconnect(t="wss://aosync-broker-eu.beaconwallet.dev:8081",e={protocolVersion:5}){if(null!=this.reconnectListener)return;let r=sessionStorage.getItem("aosync-topic-id");if(null!==r)try{this.uid=r,this.populateWindowObject();let n=`${this.uid}/response`;if(this.client)return new Promise((t,e)=>{try{let r=h();this.reconnectListener={corellationId:r,resolve:t},this.reconnectionTimeout=setTimeout(async()=>{if(!this.isConnected){console.warn("No response received during reconnection attempt"),clearTimeout(this.reconnectionTimeout);try{await this.disconnect()}catch(t){e(t);return}e(Error("Reconnection timeout"))}},3e3),this.publishMessage(this.uid,{action:"getActiveAddress",correlationData:r},{properties:{correlationData:p.Buffer.from(r,"utf-8")}})}catch(t){e(t)}});return this.client=l.A.connect(t,e),new Promise((t,e)=>{this.client.on("connect",async()=>{try{let r=h();this.reconnectListener={corellationId:r,resolve:t},await new Promise((t,e)=>{this.client.subscribe(n,r=>{r?e(r):t()})}),this.reconnectionTimeout=setTimeout(async()=>{console.warn("No response received during reconnection attempt"),clearTimeout(this.reconnectionTimeout);try{await this.disconnect()}catch(t){e(t);return}e(Error("Reconnection timeout"))},3e3),this.publishMessage(this.uid,{action:"getActiveAddress",correlationData:r},{properties:{correlationData:p.Buffer.from(r,"utf-8")}}),this.client.on("message",this.handleMQTTMessage.bind(this))}catch(t){e(t)}}),this.client.on("error",e)})}catch(t){throw this.pendingRequests.forEach(t=>{t.reject(Error("Reconnection failed"))}),this.pendingRequests=[],this.disconnect(),t}}async processPendingRequests(){let t=[...this.pendingRequests];for(let e of(this.pendingRequests=[],t))try{let t=await this[e.method](...e.args);e.resolve(t)}catch(t){e.reject(t)}}async disconnect(){if(this.browserWalletBackup&&(window.arweaveWallet=this.browserWalletBackup),sessionStorage.getItem("aosync-topic-id")&&(sessionStorage.removeItem("aosync-topic-id"),this.sessionActive=!1,sessionStorage.removeItem("aosync-session-active")),this.client)return new Promise((t,e)=>{this.uid&&this.client.publish(this.uid,JSON.stringify({action:"disconnect"}),{},r=>{if(r)return void e(r);this.client.end(!1,()=>{this.client=null,this.responseListeners.forEach(t=>t.resolve(Error("Disconnected before response was received"))),this.handleDisconnectResponse("disconnected from wallet"),this.responseListeners.clear(),this.clearAllTimeouts(),t()}),this.client.on("error",e)})})}async getActiveAddress(){return this.createResponsePromise("getActiveAddress")}async getAllAddresses(){return this.createResponsePromise("getAllAddresses")}async getPermissions(){return this.client?this.createResponsePromise("getPermissions"):[]}async getWalletNames(){return this.createResponsePromise("getWalletNames")}async encrypt(t,e){return this.createResponsePromise("encrypt",{data:t+"",algorithm:e})}async decrypt(t,e){return this.createResponsePromise("decrypt",{data:t+"",algorithm:e})}async getArweaveConfig(){return Promise.resolve({host:"arweave.net",port:443,protocol:"https"})}async signature(t,e){let r=t.toString();return this.createResponsePromise("signature",{data:r})}async getActivePublicKey(){return this.createResponsePromise("getActivePublicKey")}async addToken(t){return this.createResponsePromise("addToken",{data:t})}async sign(t){return this.createResponsePromise("sign",{transaction:t})}async dispatch(t){return this.createResponsePromise("dispatch",{transaction:t})}async signDataItem(t){return this.createResponsePromise("signDataItem",{dataItem:t})}async isAvailable(){return null!==this.client}on(t,e){this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(e)}off(t,e){var r;null==(r=this.eventListeners.get(t))||r.delete(e)}emit(t,e){this.eventListeners.has(t)&&this.eventListeners.get(t).forEach(t=>t(e))}populateWindowObject(){var t;if("undefined"!=typeof window){if((null==(t=null==window?void 0:window.arweaveWallet)?void 0:t.walletName)==="AOSync")return;let e=t=>async(...e)=>{if(!this.isConnected)throw Error("Wallet is not connected. Please call connect() first.");return t.apply(this,e)},r={walletName:"AOSync",connect:async(t,e,r)=>{await this.connect({permissions:t,appInfo:e,gateway:r})},disconnect:this.disconnect.bind(this),getActiveAddress:e(this.getActiveAddress),getAllAddresses:e(this.getAllAddresses),getPermissions:e(this.getPermissions),getWalletNames:e(this.getWalletNames),encrypt:e(this.encrypt),decrypt:e(this.decrypt),getArweaveConfig:e(this.getArweaveConfig),signature:e(this.signature),getActivePublicKey:e(this.getActivePublicKey),addToken:e(this.addToken),sign:e(this.sign),dispatch:e(this.dispatch),signDataItem:e(this.signDataItem)};window.arweaveWallet&&(this.browserWalletBackup=window.arweaveWallet),window.arweaveWallet=r}}}var I=function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function s(t){try{l(n.next(t))}catch(t){i(t)}}function a(t){try{l(n.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):((e=t.value)instanceof r?e:new r(function(t){t(e)})).then(s,a)}l((n=n.apply(t,e||[])).next())})};let T=(0,o.createContext)(void 0);function M({gatewayConfig:t={host:"arweave.net",port:443,protocol:"https"},muUrl:e="https://mu.ao-testnet.xyz",children:r,appInfo:n}){var i;let s=(0,o.useRef)(new B),[l,u]=(0,o.useState)(!!(null==(i=null==s?void 0:s.current)?void 0:i.uid)),[c,f]=(0,o.useState)(()=>
62{if("undefined"!=typeof window){let t=sessionStorage.getItem("aosync-session-active");return!!t&&JSON.parse(t)}return!1});(0,o.useEffect)(()=>{let t=s.current;t.reconnect();let e=()=>u(!1),r=()=>u(!0);return t.on("disconnected",e),t.on("connected",r),()=>{t.off("disconnected",e),t.off("connected",r)}},[]),(0,o.useEffect)(()=>{let t=t=>{"aosync-session-active"===t.key&&t.storageArea===sessionStorage&&f(!!t.newValue&&JSON.parse(t.newValue))};return window.addEventListener("storage",t),()=>{window.removeEventListener("storage",t)}},[]);let h=()=>I(this,void 0,void 0,function*(){try{yield s.current.connect({gateway:t,appInfo:n})}catch(t){throw console.error("Error connecting wallet:",t),t}}),d=()=>I(this,void 0,void 0,function*(){try{yield s.current.disconnect(),u(!1)}catch(t){throw console.error("Error disconnecting wallet:",t),t}}),p=()=>I(this,void 0,void 0,function*(){try{return yield s.current.getActiveAddress()}catch(t){throw console.error("Error getting address:",t),t}}),g=()=>I(this,void 0,void 0,function*(){try{return yield s.current.getAllAddresses()}catch(t){throw console.error("Error getting address:",t),t}}),y=(e,r)=>I(this,void 0,void 0,function*(){try{let n=a().init(t),o=yield n.createTransaction({target:e,quantity:r}),i=yield s.current.sign(o);return yield n.transactions.post(i)}catch(t){throw console.error("Error sending AR:",t),t}}),m=t=>I(this,void 0,void 0,function*(){var r;try{null==(r=null==t?void 0:t.tags)||r.push({name:"SDK",value:"Beacon Wallet"},{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"});let n=yield s.current.signDataItem(t);if(!(yield fetch(e,{method:"POST",headers:{"Content-Type":"application/octet-stream"},body:n})).ok)throw Error("Network response was not ok");return yield function(t){return I(this,void 0,void 0,function*(){let e=t.slice(2,514),r=Array.from(new Uint8Array((yield crypto.subtle.digest("SHA-256",e))));return btoa(String.fromCharCode.apply(null,r)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")})}(n)}catch(t){throw console.error("Error signing AO message:",t),t}}),w=t=>I(this,void 0,void 0,function*(){try{return yield s.current.sign(t)}catch(t){throw console.error("Error signing wallet:",t),t}});return o.createElement(T.Provider,{value:{isConnected:l,isSessionActive:c,connect:h,disconnect:d,getAddress:p,getAllAddresses:g,sendAR:y,signAOMessage:m,sign:w}},r)}},19542:(t,e)=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};let r={N1:3,N2:3,N3:40,N4:10};e.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(t){let e=t.size,n=0,o=0,i=0,s=null,a=null;for(let l=0;l<e;l++){o=i=0,s=a=null;for(let u=0;u<e;u++){let e=t.get(l,u);e===s?o++:(o>=5&&(n+=r.N1+(o-5)),s=e,o=1),(e=t.get(u,l))===a?i++:(i>=5&&(n+=r.N1+(i-5)),a=e,i=1)}o>=5&&(n+=r.N1+(o-5)),i>=5&&(n+=r.N1+(i-5))}return n},e.getPenaltyN2=function(t){let e=t.size,n=0;for(let r=0;r<e-1;r++)for(let o=0;o<e-1;o++){let e=t.get(r,o)+t.get(r,o+1)+t.get(r+1,o)+t.get(r+1,o+1);(4===e||0===e)&&n++}return n*r.N2},e.getPenaltyN3=function(t){let e=t.size,n=0,o=0,i=0;for(let r=0;r<e;r++){o=i=0;for(let s=0;s<e;s++)o=o<<1&2047|t.get(r,s),s>=10&&(1488===o||93===o)&&n++,i=i<<1&2047|t.get(s,r),s>=10&&(1488===i||93===i)&&n++}return n*r.N3},e.getPenaltyN4=function(t){let e=0,n=t.data.length;for(let r=0;r<n;r++)e+=t.data[r];return Math.abs(Math.ceil(100*e/n/5)-10)*r.N4},e.applyMask=function(t,r){let n=r.size;for(let o=0;o<n;o++)for(let i=0;i<n;i++)r.isReserved(i,o)||r.xor(i,o,function(t,r,n){switch(t){case e.Patterns.PATTERN000:return(r+n)%2==0;case e.Patterns.PATTERN001:return r%2==0;case e.Patterns.PATTERN010:return n%3==0;case e.Patterns.PATTERN011:return(r+n)%3==0;case e.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case e.Patterns.PATTERN101:return r*n%2+r*n%3==0;case e.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case e.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw Error("bad maskPattern:"+t)}}(t,i,o))},e.getBestMask=function(t,r){let n=Object.keys(e.Patterns).length,o=0,i=1/0;for(let s=0;s<n;s++){r(s),e.applyMask(s,t);let n=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(s,t),n<i&&(i=n,o=s)}return o}},23308:(t,e,r)=>{let n=r(52686);function o(t,e){let r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function i(t,e,r){let n=t+e;return void 0!==r&&(n+=" "+r),n}e.render=function(t,e,r){let s=n.getOptions(e),a=t.modules.size,l=t.modules.data,u=a+2*s.margin,c=s.color.light.a?"<path "+o(s.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",f="<path "+o(s.color.dark,"stroke")+' d="'+function(t,e,r){let n="",o=0,s=!1,a=0;for(let l=0;l<t.length;l++){let u=Math.floor(l%e),c=Math.floor(l/e);u||s||(s=!0),t[l]?(a++,l>0&&u>0&&t[l-1]||(n+=s?i("M",u+r,.5+c+r):i("m",o,0),o=0,s=!1),u+1<e&&t[l+1]||(n+=i("h",a),a=0)):o++}
62return n}(l,a,s.margin)+'"/>',h='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+('viewBox="0 0 '+u+" ")+u+'" shape-rendering="crispEdges">'+c+f+"</svg>\n";return"function"==typeof r&&r(null,h),h}},24967:(t,e)=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2},e.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},e.from=function(t,r){if(e.isValid(t))return t;try{if("string"!=typeof t)throw Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw Error("Unknown EC Level: "+t)}}catch(t){return r}}},25118:(t,e,r)=>{"use strict";r.d(e,{_:()=>o});var n=r(14933);function o(t,e){(0,n._)(t,e),e.add(t)}},29762:(t,e)=>{e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},30500:(t,e,r)=>{"use strict";r.d(e,{_:()=>s});var n=r(74557),o=r(45080),i=r(32478);function s(t,e,r){return(0,o._)(t,e),(0,i._)(r,"get"),(0,n._)(t,r)}},31937:(t,e,r)=>{let n=r(89158),o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(t){this.mode=n.ALPHANUMERIC,this.data=t}i.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let r=45*o.indexOf(this.data[e]);r+=o.indexOf(this.data[e+1]),t.put(r,11)}this.data.length%2&&t.put(o.indexOf(this.data[e]),6)},t.exports=i},32478:(t,e,r)=>{"use strict";function n(t,e){if(void 0===t)throw TypeError("attempted to "+e+" private static field before its declaration")}r.d(e,{_:()=>n})},33025:(t,e,r)=>{"use strict";r.d(e,{_:()=>i});var n=r(74557),o=r(64856);function i(t,e){var r=(0,o._)(t,e,"get");return(0,n._)(t,r)}},34877:(t,e,r)=>{"use strict";r.d(e,{_:()=>i});var n=r(72705),o=r(64856);function i(t,e,r){var i=(0,o._)(t,e,"set");return(0,n._)(t,i,r),r}},35425:t=>{function e(){this.buffer=[],this.length=0}e.prototype={get:function(t){let e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){let e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},t.exports=e},35630:(t,e,r)=>{let n=r(46342).getSymbolSize;e.getPositions=function(t){let e=n(t);return[[0,0],[e-7,0],[0,e-7]]}},41953:(t,e,r)=>{let n=r(46342),o=n.getBCHDigit(1335);e.getEncodedBits=function(t,e){let r=t.bit<<3|e,i=r<<10;for(;n.getBCHDigit(i)-o>=0;)i^=1335<<n.getBCHDigit(i)-o;return(r<<10|i)^21522}},43968:()=>{},44006:(t,e,r)=>{let n=r(89158);function o(t){this.mode=n.BYTE,"string"==typeof t?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}o.getBitsLength=function(t){return 8*t},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)},t.exports=o},45080:(t,e,r)=>{"use strict";function n(t,e){if(t!==e)throw TypeError("Private static access of wrong provenance")}r.d(e,{_:()=>n})},46342:(t,e)=>{let r,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(t){if(!t)throw Error('"version" cannot be null or undefined');if(t<1||t>40)throw Error('"version" should be in range from 1 to 40');return 4*t+17},e.getSymbolTotalCodewords=function(t){return n[t]},e.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},e.setToSJISFunction=function(t){if("function"!=typeof t)throw Error('"toSJISFunc" is not a valid function.');r=t},e.isKanjiModeEnabled=function(){return void 0!==r},e.toSJIS=function(t){return r(t)}},49693:()=>{},50915:(t,e,r)=>{let n=r(10429);e.mul=function(t,e){let r=new Uint8Array(t.length+e.length-1);for(let o=0;o<t.length;o++)for(let i=0;i<e.length;i++)r[o+i]^=n.mul(t[o],e[i]);return r},e.mod=function(t,e){let r=new Uint8Array(t);for(;r.length-e.length>=0;){let t=r[0];for(let o=0;o<e.length;o++)r[o]^=n.mul(e[o],t);let o=0;for(;o<r.length&&0===r[o];)o++;r=r.slice(o)}return r},e.generateECPolynomial=function(t){let r=new Uint8Array([1]);for(let o=0;o<t;o++)r=e.mul(r,new Uint8Array([1,n.exp(o)]));return r}},52686:(t,e)=>{function r(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");
vendor: 4,970 bytes, line 62
62if(e.length<3||5===e.length||e.length>8)throw Error("Invalid hex color: "+t);(3===e.length||4===e.length)&&(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");let r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+e.slice(0,6).join("")}}e.getOptions=function(t){t||(t={}),t.color||(t.color={});let e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,n=t.width&&t.width>=21?t.width:void 0,o=t.scale||4;return{width:n,scale:n?4:o,margin:e,color:{dark:r(t.color.dark||"#000000ff"),light:r(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},e.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},e.getImageWidth=function(t,r){let n=e.getScale(t,r);return Math.floor((t+2*r.margin)*n)},e.qrToImageData=function(t,r,n){let o=r.modules.size,i=r.modules.data,s=e.getScale(o,n),a=Math.floor((o+2*n.margin)*s),l=n.margin*s,u=[n.color.light,n.color.dark];for(let e=0;e<a;e++)for(let r=0;r<a;r++){let c=(e*a+r)*4,f=n.color.light;e>=l&&r>=l&&e<a-l&&r<a-l&&(f=u[+!!i[Math.floor((e-l)/s)*o+Math.floor((r-l)/s)]]),t[c++]=f.r,t[c++]=f.g,t[c++]=f.b,t[c]=f.a}}},52769:(t,e,r)=>{let n=r(91791),o=r(93711),i=r(85289),s=r(23308);function a(t,e,r,i,s){let a=[].slice.call(arguments,1),l=a.length,u="function"==typeof a[l-1];if(!u&&!n())throw Error("Callback required as last argument");if(u){if(l<2)throw Error("Too few arguments provided");2===l?(s=r,r=e,e=i=void 0):3===l&&(e.getContext&&void 0===s?(s=i,i=void 0):(s=i,i=r,r=e,e=void 0))}else{if(l<1)throw Error("Too few arguments provided");return 1===l?(r=e,e=i=void 0):2!==l||e.getContext||(i=r,r=e,e=void 0),new Promise(function(n,s){try{let s=o.create(r,i);n(t(s,e,i))}catch(t){s(t)}})}try{let n=o.create(r,i);s(null,t(n,e,i))}catch(t){s(t)}}e.create=o.create,e.toCanvas=a.bind(null,i.render),e.toDataURL=a.bind(null,i.renderToDataURL),e.toString=a.bind(null,function(t,e,r){return s.render(t,r)})},53896:(t,e)=>{let r="[0-9]+",n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",o="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";e.KANJI=RegExp(n,"g"),e.BYTE_KANJI=RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),e.BYTE=RegExp(o,"g"),e.NUMERIC=RegExp(r,"g"),e.ALPHANUMERIC=RegExp("[A-Z $%*+\\-./:]+","g");let i=RegExp("^"+n+"$"),s=RegExp("^"+r+"$"),a=RegExp("^[A-Z0-9 $%*+\\-./:]+$");e.testKanji=function(t){return i.test(t)},e.testNumeric=function(t){return s.test(t)},e.testAlphanumeric=function(t){return a.test(t)}},54415:(t,e,r)=>{let n=r(89158);function o(t){this.mode=n.NUMERIC,this.data=t.toString()}o.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){let e,r;for(e=0;e+3<=this.data.length;e+=3)r=parseInt(this.data.substr(e,3),10),t.put(r,10);let n=this.data.length-e;n>0&&(r=parseInt(this.data.substr(e),10),t.put(r,3*n+1))},t.exports=o},62546:t=>{function e(t){if(!t||t<1)throw Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}e.prototype.set=function(t,e,r,n){let o=t*this.size+e;this.data[o]=r,n&&(this.reservedBit[o]=!0)},e.prototype.get=function(t,e){return this.data[t*this.size+e]},e.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},e.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},t.exports=e},64856:(t,e,r)=>{"use strict";function n(t,e,r){if(!e.has(t))throw TypeError("attempted to "+r+" private field on non-instance");return e.get(t)}r.d(e,{_:()=>n})},69435:(t,e,r)=>{let n=r(46342),o=r(81010),i=r(24967),s=r(89158),a=r(29762),l=n.getBCHDigit(7973);function u(t,e){return s.getCharCountIndicator(t,e)+4}e.from=function(t,e){return a.isValid(t)?parseInt(t,10):e},e.getCapacity=function(t,e,r){if(!a.isValid(t))throw Error("Invalid QR Code version");void 0===r&&(r=s.BYTE);let i=(n.getSymbolTotalCodewords(t)-o.getTotalCodewordsCount(t,e))*8;if(r===s.MIXED)return i;let l=i-u(r,t);switch(r){case s.NUMERIC:return Math.floor(l/10*3);case s.ALPHANUMERIC:return Math.floor(l/11*2);case s.KANJI:return Math.floor(l/13);case s.BYTE:default:return Math.floor(l/8)}},e.getBestVersionForData=function(t,r){let n,o=i.from(r,i.M);if(Array.isArray(t)){if(t.length>1){for(let r=1;r<=40;r++)if(function(t,e){let r=0;return t.forEach(function(t){let n=u(t.mode,e);r+=n+t.getBitsLength()}),r}(t,r)<=e.getCapacity(r,o,s.MIXED))return r;return}if(0===t.length)return 1;n=t[0]}else n=t;return function(t,r,n){for(let o=1;o<=40;o++)if(r<=e.getCapacity(o,n,t))return o}(n.mode,n.getLength(),o)},e.getEncodedBits=function(t){if(!a.isValid(t)||t<7)throw Error("Invalid QR Code version");let e=t<<12;
62for(;n.getBCHDigit(e)-l>=0;)e^=7973<<n.getBCHDigit(e)-l;return t<<12|e}},70371:(t,e,r)=>{let n=r(89158),o=r(54415),i=r(31937),s=r(44006),a=r(73987),l=r(53896),u=r(46342),c=r(88072);function f(t){return unescape(encodeURIComponent(t)).length}function h(t,e,r){let n,o=[];for(;null!==(n=t.exec(r));)o.push({data:n[0],index:n.index,mode:e,length:n[0].length});return o}function d(t){let e,r,o=h(l.NUMERIC,n.NUMERIC,t),i=h(l.ALPHANUMERIC,n.ALPHANUMERIC,t);return u.isKanjiModeEnabled()?(e=h(l.BYTE,n.BYTE,t),r=h(l.KANJI,n.KANJI,t)):(e=h(l.BYTE_KANJI,n.BYTE,t),r=[]),o.concat(i,e,r).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function p(t,e){switch(e){case n.NUMERIC:return o.getBitsLength(t);case n.ALPHANUMERIC:return i.getBitsLength(t);case n.KANJI:return a.getBitsLength(t);case n.BYTE:return s.getBitsLength(t)}}function g(t,e){let r,l=n.getBestModeForData(t);if((r=n.from(e,l))!==n.BYTE&&r.bit<l.bit)throw Error('"'+t+'" cannot be encoded with mode '+n.toString(r)+".\n Suggested mode is: "+n.toString(l));switch(r===n.KANJI&&!u.isKanjiModeEnabled()&&(r=n.BYTE),r){case n.NUMERIC:return new o(t);case n.ALPHANUMERIC:return new i(t);case n.KANJI:return new a(t);case n.BYTE:return new s(t)}}e.fromArray=function(t){return t.reduce(function(t,e){return"string"==typeof e?t.push(g(e,null)):e.data&&t.push(g(e.data,e.mode)),t},[])},e.fromString=function(t,r){let o=function(t,e){let r={},o={start:{}},i=["start"];for(let s=0;s<t.length;s++){let a=t[s],l=[];for(let t=0;t<a.length;t++){let u=a[t],c=""+s+t;l.push(c),r[c]={node:u,lastCount:0},o[c]={};for(let t=0;t<i.length;t++){let s=i[t];r[s]&&r[s].node.mode===u.mode?(o[s][c]=p(r[s].lastCount+u.length,u.mode)-p(r[s].lastCount,u.mode),r[s].lastCount+=u.length):(r[s]&&(r[s].lastCount=u.length),o[s][c]=p(u.length,u.mode)+4+n.getCharCountIndicator(u.mode,e))}}i=l}for(let t=0;t<i.length;t++)o[i[t]].end=0;return{map:o,table:r}}(function(t){let e=[];for(let r=0;r<t.length;r++){let o=t[r];switch(o.mode){case n.NUMERIC:e.push([o,{data:o.data,mode:n.ALPHANUMERIC,length:o.length},{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.ALPHANUMERIC:e.push([o,{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.KANJI:e.push([o,{data:o.data,mode:n.BYTE,length:f(o.data)}]);break;case n.BYTE:e.push([{data:o.data,mode:n.BYTE,length:f(o.data)}])}}return e}(d(t,u.isKanjiModeEnabled())),r),i=c.find_path(o.map,"start","end"),s=[];for(let t=1;t<i.length-1;t++)s.push(o.table[i[t]].node);return e.fromArray(s.reduce(function(t,e){let r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===e.mode?t[t.length-1].data+=e.data:t.push(e),t},[]))},e.rawSplit=function(t){return e.fromArray(d(t,u.isKanjiModeEnabled()))}},72705:(t,e,r)=>{"use strict";function n(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw TypeError("attempted to set read only private field");e.value=r}}r.d(e,{_:()=>n})},73987:(t,e,r)=>{let n=r(89158),o=r(46342);function i(t){this.mode=n.KANJI,this.data=t}i.getBitsLength=function(t){return 13*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=o.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r=(r>>>8&255)*192+(255&r),t.put(r,13)}},t.exports=i},74240:(t,e,r)=>{"use strict";function n(t,e,r){if(!e.has(t))throw TypeError("attempted to get private field on non-instance");return r}r.d(e,{_:()=>n})},74557:(t,e,r)=>{"use strict";function n(t,e){return e.get?e.get.call(t):e.value}r.d(e,{_:()=>n})},78504:(t,e,r)=>{"use strict";r.d(e,{_:()=>s});var n=r(72705),o=r(45080),i=r(32478);function s(t,e,r,s){return(0,o._)(t,e),(0,i._)(r,"set"),(0,n._)(t,r,s),s}},81010:(t,e,r)=>{let n=r(24967),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,
62192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(t,e){switch(e){case n.L:return o[(t-1)*4+0];case n.M:return o[(t-1)*4+1];case n.Q:return o[(t-1)*4+2];case n.H:return o[(t-1)*4+3];default:return}},e.getTotalCodewordsCount=function(t,e){switch(e){case n.L:return i[(t-1)*4+0];case n.M:return i[(t-1)*4+1];case n.Q:return i[(t-1)*4+2];case n.H:return i[(t-1)*4+3];default:return}}},85289:(t,e,r)=>{let n=r(52686);e.render=function(t,e,r){var o;let i=r,s=e;void 0!==i||e&&e.getContext||(i=e,e=void 0),e||(s=function(){try{return document.createElement("canvas")}catch(t){throw Error("You need to specify a canvas element")}}()),i=n.getOptions(i);let a=n.getImageWidth(t.modules.size,i),l=s.getContext("2d"),u=l.createImageData(a,a);return n.qrToImageData(u.data,t,i),o=s,l.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=a,o.width=a,o.style.height=a+"px",o.style.width=a+"px",l.putImageData(u,0,0),s},e.renderToDataURL=function(t,r,n){let o=n;void 0!==o||r&&r.getContext||(o=r,r=void 0),o||(o={});let i=e.render(t,r,o),s=o.type||"image/png",a=o.rendererOpts||{};return i.toDataURL(s,a.quality)}},88072:t=>{"use strict";var e={single_source_shortest_paths:function(t,r,n){var o,i,s,a,l,u,c,f={},h={};h[r]=0;var d=e.PriorityQueue.make();for(d.push(r,0);!d.empty();)for(s in i=(o=d.pop()).value,a=o.cost,l=t[i]||{})l.hasOwnProperty(s)&&(u=a+l[s],c=h[s],(void 0===h[s]||c>u)&&(h[s]=u,d.push(s,u),f[s]=i));if(void 0!==n&&void 0===h[n])throw Error("Could not find a path from "+r+" to "+n+".");return f},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e;n;)r.push(n),t[n],n=t[n];return r.reverse(),r},find_path:function(t,r,n){var o=e.single_source_shortest_paths(t,r,n);return e.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(t){var r,n=e.PriorityQueue,o={};for(r in t=t||{},n)n.hasOwnProperty(r)&&(o[r]=n[r]);return o.queue=[],o.sorter=t.sorter||n.default_sorter,o},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){this.queue.push({value:t,cost:e}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=e},89158:(t,e,r)=>{let n=r(29762),o=r(53896);e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(t,e){if(!t.ccBits)throw Error("Invalid mode: "+t);if(!n.isValid(e))throw Error("Invalid version: "+e);return e>=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},e.getBestModeForData=function(t){return o.testNumeric(t)?e.NUMERIC:o.testAlphanumeric(t)?e.ALPHANUMERIC:o.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(t){if(t&&t.id)return t.id;throw Error("Invalid mode")},e.isValid=function(t){return t&&t.bit&&t.ccBits},e.from=function(t,r){if(e.isValid(t))return t;try{if("string"!=typeof t)throw Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw Error("Unknown mode: "+t)}}catch(t){return r}}},89333:(t,e,r)=>{"use strict";r.d(e,{_:()=>o});var n=r(14933);function o(t,e,r){(0,n._)(t,e),e.set(t,r)}},89780:()=>{},91791:t=>{t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},93711:(t,e,r)=>{let n=r(46342),o=r(24967),i=r(35425),s=r(62546),a=r(669),l=r(35630),u=r(19542),c=r(81010),f=r(95230),h=r(69435),d=r(41953),p=r(89158),g=r(70371);function y(t,e,r){let n,o,i=t.size,s=d.getEncodedBits(e,r);for(n=0;n<15;n++)o=(s>>n&1)==1,n<6?t.set(n,8,o,!0):n<8?t.set(n+1,8,o,!0):t.set(i-15+n,8,o,!0),n<8?t.set(8,i-n-1,o,!0):n<9?t.set(8,15-n-1+1,o,!0):t.set(8,15-n-1,o,!0);t.set(i-8,8,1,!0)}e.create=function(t,e){let r,d;if(void 0===t||""===t)throw Error("No input text");let m=o.M;return void 0!==e&&(m=o.from(e.errorCorrectionLevel,o.M),r=h.from(e.version),d=u.from(e.maskPattern),e.toSJISFunc&&n.setToSJISFunction(e.toSJISFunc)),function(t,e,r,o){let d;if(Array.isArray(t))d=g.fromArray(t);else if("string"==typeof t){let n=e;if(!n){let e=g.rawSplit(t);n=h.getBestVersionForData(e,r)}d=g.fromString(t,n||40)}else throw Error("Invalid data");let m=h.getBestVersionForData(d,r);if(!m)throw Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<m)throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+m+".\n")}else e=m;let w=function(t,e,r){let o=new i;r.forEach(function(e){o.put(e.mode.bit,4),o.put(e.getLength(),p.getCharCountIndicator(e.mode,t)),e.write(o)});let s=(n.getSymbolTotalCodewords(t)-c.getTotalCodewordsCount(t,e))*8;for(o.getLengthInBits()+4<=s&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(0);let a=(s-o.getLengthInBits())/8;for(let t=0;t<a;t++)o.put(t%2?17:236,8);return function(t,e,r){let o,i,s=n.getSymbolTotalCodewords(e),a=s-c.getTotalCodewordsCount(e,r),l=c.getBlocksCount(e,r),u=s%l,h=l-u,d=Math.floor(s/l),p=Math.floor(a/l),g=p+1,y=d-p,m=new f(y),w=0,b=Array(l),E=Array(l),C=0,A=new Uint8Array(t.buffer);for(let t=0;t<l;t++){let e=t<h?p:g;b[t]=A.slice(w,w+e),E[t]=m.encode(b[t]),w+=e,C=Math.max(C,e)}let B=new Uint8Array(s),I=0;for(o=0;o<C;o++)for(i=0;i<l;i++)o<b[i].length&&(B[I++]=b[i][o]);for(o=0;o<y;o++)for(i=0;i<l;i++)B[I++]=E[i][o];return B}(o,t,e)}(e,r,d),b=new s(n.getSymbolSize(e));!function(t,e){let r=t.size,n=l.getPositions(e);for(let e=0;e<n.length;e++){let o=n[e][0],i=n[e][1];for(let e=-1;e<=7;e++)if(!(o+e<=-1)&&!(r<=o+e))for(let n=-1;n<=7;n++)i+n<=-1||r<=i+n||(e>=0&&e<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===e||6===e)||e>=2&&e<=4&&n>=2&&n<=4?t.set(o+e,i+n,!0,!0):t.set(o+e,i+n,!1,!0))}}(b,e);let E=b.size;
vendor: 1,379 bytes, line 62
62for(let t=8;t<E-8;t++){let e=t%2==0;b.set(t,6,e,!0),b.set(6,t,e,!0)}return!function(t,e){let r=a.getPositions(e);for(let e=0;e<r.length;e++){let n=r[e][0],o=r[e][1];for(let e=-2;e<=2;e++)for(let r=-2;r<=2;r++)-2===e||2===e||-2===r||2===r||0===e&&0===r?t.set(n+e,o+r,!0,!0):t.set(n+e,o+r,!1,!0)}}(b,e),y(b,r,0),e>=7&&function(t,e){let r,n,o,i=t.size,s=h.getEncodedBits(e);for(let e=0;e<18;e++)r=Math.floor(e/3),n=e%3+i-8-3,o=(s>>e&1)==1,t.set(r,n,o,!0),t.set(n,r,o,!0)}(b,e),!function(t,e){let r=t.size,n=-1,o=r-1,i=7,s=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!t.isReserved(o,a-r)){let n=!1;s<e.length&&(n=(e[s]>>>i&1)==1),t.set(o,a-r,n),-1==--i&&(s++,i=7)}if((o+=n)<0||r<=o){o-=n,n=-n;break}}}(b,w),isNaN(o)&&(o=u.getBestMask(b,y.bind(null,b,r))),u.applyMask(o,b),y(b,r,o),{modules:b,version:e,errorCorrectionLevel:r,maskPattern:o,segments:d}}(t,r,m,d)}},95230:(t,e,r)=>{let n=r(50915);function o(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}o.prototype.initialize=function(t){this.degree=t,this.genPoly=n.generateECPolynomial(this.degree)},o.prototype.encode=function(t){if(!this.genPoly)throw Error("Encoder not initialized");let e=new Uint8Array(t.length+this.degree);e.set(t);let r=n.mod(e,this.genPoly),o=this.degree-r.length;if(o>0){let t=new Uint8Array(this.degree);return t.set(r,o),t}return r},t.exports=o}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.