@frak-labs/components 0.0.11 → 0.0.13

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 CHANGED
@@ -7,6 +7,7 @@ They are built as [Web Components](https://developer.mozilla.org/en-US/docs/Web/
7
7
  Checkout our documentation for more information's about the usage:
8
8
  - [Components](https://docs.frak.id/components)
9
9
  - [Share Button usage](https://docs.frak.id/components/share-button)
10
+ - [Wallet Button usage](https://docs.frak.id/components/wallet-button)
10
11
 
11
12
  To have more info about how does it works under the hood, you can check [this](https://docs.frak.id/wallet-sdk/under-the-hood)
12
13
 
@@ -15,7 +16,7 @@ To have more info about how does it works under the hood, you can check [this](h
15
16
  Add the following script tag to your HTML file:
16
17
 
17
18
  ```html
18
- <script src="https://cdn.jsdelivr.net/npm/@frak-labs/components" defer="defer"></script>
19
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@frak-labs/components" defer="defer"></script>
19
20
  ```
20
21
 
21
22
  ## Quick start
@@ -32,7 +33,7 @@ window.FrakSetup = {
32
33
  };
33
34
  ```
34
35
 
35
- ## Sample usage
36
+ ## Sample usage for Share button
36
37
 
37
38
  Sample code to use share button:
38
39
 
@@ -51,3 +52,17 @@ Button with custom class:
51
52
  ```html
52
53
  <frak-button-share classname="button button-primary"></frak-button-share>
53
54
  ```
55
+
56
+ ## Sample usage for Wallet button
57
+
58
+ Sample code to use wallet button:
59
+
60
+ ```html
61
+ <frak-button-wallet></frak-button-wallet>
62
+ ```
63
+
64
+ Button with custom class:
65
+
66
+ ```html
67
+ <frak-button-wallet classname="button button-primary"></frak-button-wallet>
68
+ ```
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 18.d4c5a860.js.LICENSE.txt */
2
+ export const __webpack_ids__=["18"];export const __webpack_modules__={"../../node_modules/@jsonjoy.com/json-pack/lib/JsonPackExtension.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.JsonPackExtension=void 0,t.JsonPackExtension=class{constructor(e,t){this.tag=e,this.val=t}}},"../../node_modules/@jsonjoy.com/json-pack/lib/JsonPackValue.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.JsonPackValue=void 0,t.JsonPackValue=class{constructor(e){this.val=e}}},"../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoder.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborDecoder=void 0;let n=r("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderBase.js"),i=r("../../node_modules/@jsonjoy.com/json-pack/lib/JsonPackValue.js");class s extends n.CborDecoderBase{readAsMap(){let e=this.reader.u8();if(e>>5==5)return this.readMap(31&e);throw 0}readMap(e){let t=this.readMinorLen(e);return t>=0?this.readMapRaw(t):this.readMapIndef()}readMapRaw(e){let t=new Map;for(let r=0;r<e;r++){let e=this.val(),r=this.val();t.set(e,r)}return t}readMapIndef(){let e=new Map;for(;255!==this.reader.peak();){let t=this.val();if(255===this.reader.peak())throw 7;let r=this.val();e.set(t,r)}return this.reader.x++,e}skipN(e){for(let t=0;t<e;t++)this.skipAny()}skipAny(){this.skipAnyRaw(this.reader.u8())}skipAnyRaw(e){let t=31&e;switch(e>>5){case 0:case 1:this.skipUNint(t);break;case 2:this.skipBin(t);break;case 3:this.skipStr(t);break;case 4:this.skipArr(t);break;case 5:this.skipObj(t);break;case 7:this.skipTkn(t);break;case 6:this.skipTag(t)}}skipMinorLen(e){if(e<=23)return e;switch(e){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return -1;default:throw 1}}skipUNint(e){if(!(e<=23))switch(e){case 24:return this.reader.skip(1);case 25:return this.reader.skip(2);case 26:return this.reader.skip(4);case 27:return this.reader.skip(8);default:throw 1}}skipBin(e){let t=this.skipMinorLen(e);if(t>=0)this.reader.skip(t);else{for(;255!==this.reader.peak();)this.skipBinChunk();this.reader.x++}}skipBinChunk(){let e=this.reader.u8(),t=31&e;if(2!=e>>5)throw 2;if(t>27)throw 3;this.skipBin(t)}skipStr(e){let t=this.skipMinorLen(e);if(t>=0)this.reader.skip(t);else{for(;255!==this.reader.peak();)this.skipStrChunk();this.reader.x++}}skipStrChunk(){let e=this.reader.u8(),t=31&e;if(3!=e>>5)throw 4;if(t>27)throw 5;this.skipStr(t)}skipArr(e){let t=this.skipMinorLen(e);if(t>=0)this.skipN(t);else{for(;255!==this.reader.peak();)this.skipAny();this.reader.x++}}skipObj(e){let t=this.readMinorLen(e);if(t>=0)return this.skipN(2*t);for(;255!==this.reader.peak();){if(this.skipAny(),255===this.reader.peak())throw 7;this.skipAny()}this.reader.x++}skipTag(e){if(0>this.skipMinorLen(e))throw 1;this.skipAny()}skipTkn(e){switch(e){case 24:this.reader.skip(1);return;case 25:this.reader.skip(2);return;case 26:this.reader.skip(4);return;case 27:this.reader.skip(8);return}if(!(e<=23))throw 1}validate(e,t=0,r=e.length){if(this.reader.reset(e),this.reader.x=t,this.skipAny(),this.reader.x-t!==r)throw 8}decodeLevel(e){return this.reader.reset(e),this.readLevel()}readLevel(){let e=this.reader.u8(),t=e>>5,r=31&e;switch(t){case 4:return this.readArrLevel(r);case 5:return this.readObjLevel(r);default:return super.readAnyRaw(e)}}readPrimitiveOrVal(){switch(this.reader.peak()>>5){case 4:case 5:return this.readAsValue();default:return this.val()}}readAsValue(){let e=this.reader,t=e.x;this.skipAny();let r=e.x;return new i.JsonPackValue(e.uint8.subarray(t,r))}readObjLevel(e){let t=this.readMinorLen(e);return t>=0?this.readObjRawLevel(t):this.readObjIndefLevel()}readObjRawLevel(e){let t={};for(let r=0;r<e;r++){let e=this.key(),r=this.readPrimitiveOrVal();t[e]=r}return t}readObjIndefLevel(){let e={};for(;255!==this.reader.peak();){let t=this.key();if(255===this.reader.peak())throw 7;let r=this.readPrimitiveOrVal();e[t]=r}return this.reader.x++,e}readArrLevel(e){let t=this.readMinorLen(e);return t>=0?this.readArrRawLevel(t):this.readArrIndefLevel()}readArrRawLevel(e){let t=[];for(let r=0;r<e;r++)t.push(this.readPrimitiveOrVal());return t}readArrIndefLevel(){let e=[];for(;255!==this.reader.peak();)e.push(this.readPrimitiveOrVal());return this.reader.x++,e}readHdr(e){let t=this.reader.u8();if(t>>5!==e)throw 0;let r=31&t;if(r<24)return r;switch(r){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return -1}throw 1}readStrHdr(){return this.readHdr(3)}readObjHdr(){return this.readHdr(5)}readArrHdr(){return this.readHdr(4)}findKey(e){let t=this.readObjHdr();for(let r=0;r<t;r++){if(this.key()===e)return this;this.skipAny()}throw 9}findIndex(e){if(e>=this.readArrHdr())throw 10;for(let t=0;t<e;t++)this.skipAny();return this}find(e){for(let t=0;t<e.length;t++){let r=e[t];"string"==typeof r?this.findKey(r):this.findIndex(r)}return this}}t.CborDecoder=s},"../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderBase.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborDecoderBase=void 0;let n=r("../../node_modules/tslib/tslib.es6.mjs"),i=r("../../node_modules/@jsonjoy.com/util/lib/buffers/f16.js"),s=r("../../node_modules/@jsonjoy.com/json-pack/lib/JsonPackExtension.js"),o=r("../../node_modules/@jsonjoy.com/json-pack/lib/JsonPackValue.js"),u=r("../../node_modules/@jsonjoy.com/util/lib/buffers/Reader.js"),a=n.__importDefault(r("../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/sharedCachedUtf8Decoder.js"));t.CborDecoderBase=class{constructor(e=new u.Reader,t=a.default){this.reader=e,this.keyDecoder=t}read(e){return this.reader.reset(e),this.val()}decode(e){return this.reader.reset(e),this.val()}val(){let e=this.reader.u8(),t=e>>5,r=31&e;return t<4?t<2?0===t?this.readUint(r):this.readNint(r):2===t?this.readBin(r):this.readStr(r):t<6?4===t?this.readArr(r):this.readObj(r):6===t?this.readTag(r):this.readTkn(r)}readAnyRaw(e){let t=e>>5,r=31&e;return t<4?t<2?0===t?this.readUint(r):this.readNint(r):2===t?this.readBin(r):this.readStr(r):t<6?4===t?this.readArr(r):this.readObj(r):6===t?this.readTag(r):this.readTkn(r)}readMinorLen(e){if(e<24)return e;switch(e){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return -1;default:throw 1}}readUint(e){if(e<25)return 24===e?this.reader.u8():e;if(e<27)return 25===e?this.reader.u16():this.reader.u32();{let e=this.reader.u64();return e>0x1fffffffffffff?e:Number(e)}}readNint(e){if(e<25)return 24===e?-this.reader.u8()-1:-e-1;if(e<27)return 25===e?-this.reader.u16()-1:-this.reader.u32()-1;{let e=this.reader.u64();return e>0x1ffffffffffffe?-e-BigInt(1):-Number(e)-1}}readBin(e){let t=this.reader;if(e<=23)return t.buf(e);switch(e){case 24:return t.buf(t.u8());case 25:return t.buf(t.u16());case 26:return t.buf(t.u32());case 27:return t.buf(Number(t.u64()));case 31:{let e=0,t=[];for(;255!==this.reader.peak();){let r=this.readBinChunk();e+=r.length,t.push(r)}this.reader.x++;let r=new Uint8Array(e),n=0,i=t.length;for(let e=0;e<i;e++){let i=t[e];r.set(i,n),n+=i.length}return r}default:throw 1}}readBinChunk(){let e=this.reader.u8(),t=31&e;if(2!=e>>5)throw 2;if(t>27)throw 3;return this.readBin(t)}readAsStr(){let e=this.reader.u8();if(3!=e>>5)throw 11;return this.readStr(31&e)}readStr(e){let t=this.reader;if(e<=23)return t.utf8(e);switch(e){case 24:return t.utf8(t.u8());case 25:return t.utf8(t.u16());case 26:return t.utf8(t.u32());case 27:return t.utf8(Number(t.u64()));case 31:{let e="";for(;255!==t.peak();)e+=this.readStrChunk();return this.reader.x++,e}default:throw 1}}readStrLen(e){if(e<=23)return e;switch(e){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());default:throw 1}}readStrChunk(){let e=this.reader.u8(),t=31&e;if(3!=e>>5)throw 4;if(t>27)throw 5;return this.readStr(t)}readArr(e){let t=this.readMinorLen(e);return t>=0?this.readArrRaw(t):this.readArrIndef()}readArrRaw(e){let t=[];for(let r=0;r<e;r++)t.push(this.val());return t}readArrIndef(){let e=[];for(;255!==this.reader.peak();)e.push(this.val());return this.reader.x++,e}readObj(e){if(e<28){let t=e;switch(e){case 24:t=this.reader.u8();break;case 25:t=this.reader.u16();break;case 26:t=this.reader.u32();break;case 27:t=Number(this.reader.u64())}let r={};for(let e=0;e<t;e++){let e=this.key();if("__proto__"===e)throw 6;let t=this.val();r[e]=t}return r}if(31===e)return this.readObjIndef();throw 1}readObjRaw(e){let t={};for(let r=0;r<e;r++){let e=this.key(),r=this.val();t[e]=r}return t}readObjIndef(){let e={};for(;255!==this.reader.peak();){let t=this.key();if(255===this.reader.peak())throw 7;let r=this.val();e[t]=r}return this.reader.x++,e}key(){let e=this.reader.u8();if(3!=e>>5)return String(this.readAnyRaw(e));let t=this.readStrLen(31&e);if(t>31)return this.reader.utf8(t);let r=this.keyDecoder.decode(this.reader.uint8,this.reader.x,t);return this.reader.skip(t),r}readTag(e){if(e<=23)return this.readTagRaw(e);switch(e){case 24:return this.readTagRaw(this.reader.u8());case 25:return this.readTagRaw(this.reader.u16());case 26:return this.readTagRaw(this.reader.u32());case 27:return this.readTagRaw(Number(this.reader.u64()));default:throw 1}}readTagRaw(e){return new s.JsonPackExtension(e,this.val())}readTkn(e){switch(e){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;case 24:return new o.JsonPackValue(this.reader.u8());case 25:return this.f16();case 26:return this.reader.f32();case 27:return this.reader.f64()}if(e<=23)return new o.JsonPackValue(e);throw 1}f16(){return(0,i.decodeF16)(this.reader.u16())}}},"../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderDag.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborDecoderDag=void 0;let n=r("../../node_modules/@jsonjoy.com/json-pack/lib/JsonPackExtension.js"),i=r("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoder.js");class s extends i.CborDecoder{readTagRaw(e){let t=this.val();return 42===e?new n.JsonPackExtension(e,t):t}}t.CborDecoderDag=s},"../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoder.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborEncoder=void 0;let n=r("../../node_modules/@jsonjoy.com/util/lib/buffers/isFloat32.js"),i=r("../../node_modules/@jsonjoy.com/json-pack/lib/JsonPackExtension.js"),s=r("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderFast.js"),o=r("../../node_modules/@jsonjoy.com/json-pack/lib/JsonPackValue.js");class u extends s.CborEncoderFast{writeUnknown(e){this.writeNull()}writeAny(e){switch(typeof e){case"number":return this.writeNumber(e);case"string":return this.writeStr(e);case"boolean":return this.writer.u8(244+ +e);case"object":if(!e)return this.writer.u8(246);switch(e.constructor){case Object:return this.writeObj(e);case Array:return this.writeArr(e);case Uint8Array:return this.writeBin(e);case Map:return this.writeMap(e);case i.JsonPackExtension:return this.writeTag(e.tag,e.val);case o.JsonPackValue:let t=e.val;return this.writer.buf(t,t.length);default:if(e instanceof Uint8Array)return this.writeBin(e);if(Array.isArray(e))return this.writeArr(e);if(e instanceof Map)return this.writeMap(e);return this.writeUnknown(e)}case"undefined":return this.writeUndef();case"bigint":return this.writeBigInt(e);default:return this.writeUnknown(e)}}writeFloat(e){(0,n.isFloat32)(e)?this.writer.u8f32(250,e):this.writer.u8f64(251,e)}writeMap(e){this.writeMapHdr(e.size),e.forEach((e,t)=>{this.writeAny(t),this.writeAny(e)})}writeUndef(){this.writer.u8(247)}}t.CborEncoder=u},"../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderDag.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborEncoderDag=void 0;let n=r("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderStable.js");class i extends n.CborEncoderStable{writeUndef(){this.writeNull()}writeFloat(e){if(e!=e||!Number.isFinite(e))return this.writeNull();this.writer.u8f64(251,e)}writeTag(e,t){42===e&&this.writeTagHdr(e),this.writeAny(t)}}t.CborEncoderDag=i},"../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderFast.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborEncoderFast=void 0;let n=r("../../node_modules/@jsonjoy.com/util/lib/buffers/Writer.js"),i=Number.isSafeInteger;t.CborEncoderFast=class{constructor(e=new n.Writer){this.writer=e}encode(e){return this.writeAny(e),this.writer.flush()}encodeToSlice(e){return this.writeAny(e),this.writer.flushSlice()}writeAny(e){switch(typeof e){case"number":return this.writeNumber(e);case"string":return this.writeStr(e);case"boolean":return this.writer.u8(244+ +e);case"object":if(!e)return this.writer.u8(246);if(e.constructor===Array)return this.writeArr(e);return this.writeObj(e)}}writeCbor(){this.writer.u8u16(217,55799)}writeEnd(){this.writer.u8(255)}writeNull(){this.writer.u8(246)}writeBoolean(e){e?this.writer.u8(245):this.writer.u8(244)}writeNumber(e){i(e)?this.writeInteger(e):"bigint"==typeof e?this.writeBigInt(e):this.writeFloat(e)}writeBigInt(e){e>=0?this.writeBigUint(e):this.writeBigSint(e)}writeBigUint(e){if(e<=Number.MAX_SAFE_INTEGER)return this.writeUInteger(Number(e));this.writer.u8u64(27,e)}writeBigSint(e){if(e>=Number.MIN_SAFE_INTEGER)return this.encodeNint(Number(e));let t=-BigInt(1)-e;this.writer.u8u64(59,t)}writeInteger(e){e>=0?this.writeUInteger(e):this.encodeNint(e)}writeUInteger(e){let t=this.writer;t.ensureCapacity(9);let r=t.uint8,n=t.x;e<=23?r[n++]=0+e:e<=255?(r[n++]=24,r[n++]=e):e<=65535?(r[n++]=25,t.view.setUint16(n,e),n+=2):e<=0xffffffff?(r[n++]=26,t.view.setUint32(n,e),n+=4):(r[n++]=27,t.view.setBigUint64(n,BigInt(e)),n+=8),t.x=n}encodeNumber(e){this.writeNumber(e)}encodeInteger(e){this.writeInteger(e)}encodeUint(e){this.writeUInteger(e)}encodeNint(e){let t=-1-e,r=this.writer;r.ensureCapacity(9);let n=r.uint8,i=r.x;t<24?n[i++]=32+t:t<=255?(n[i++]=56,n[i++]=t):t<=65535?(n[i++]=57,r.view.setUint16(i,t),i+=2):t<=0xffffffff?(n[i++]=58,r.view.setUint32(i,t),i+=4):(n[i++]=59,r.view.setBigUint64(i,BigInt(t)),i+=8),r.x=i}writeFloat(e){this.writer.u8f64(251,e)}writeBin(e){let t=e.length;this.writeBinHdr(t),this.writer.buf(e,t)}writeBinHdr(e){let t=this.writer;e<=23?t.u8(64+e):e<=255?t.u16(22528+e):e<=65535?t.u8u16(89,e):e<=0xffffffff?t.u8u32(90,e):t.u8u64(91,e)}writeStr(e){let t=this.writer,r=4*e.length;t.ensureCapacity(5+r);let n=t.uint8,i=t.x;r<=23?t.x++:r<=255?(n[t.x++]=120,i=t.x,t.x++):r<=65535?(n[t.x++]=121,i=t.x,t.x+=2):(n[t.x++]=122,i=t.x,t.x+=4);let s=t.utf8(e);r<=23?n[i]=96+s:r<=255?n[i]=s:r<=65535?t.view.setUint16(i,s):t.view.setUint32(i,s)}writeStrHdr(e){let t=this.writer;e<=23?t.u8(96+e):e<=255?t.u16(30720+e):e<=65535?t.u8u16(121,e):t.u8u32(122,e)}writeAsciiStr(e){this.writeStrHdr(e.length),this.writer.ascii(e)}writeArr(e){let t=e.length;this.writeArrHdr(t);for(let r=0;r<t;r++)this.writeAny(e[r])}writeArrHdr(e){let t=this.writer;e<=23?t.u8(128+e):e<=255?t.u16(38912+e):e<=65535?t.u8u16(153,e):e<=0xffffffff?t.u8u32(154,e):t.u8u64(155,e)}writeObj(e){let t=Object.keys(e),r=t.length;this.writeObjHdr(r);for(let n=0;n<r;n++){let r=t[n];this.writeStr(r),this.writeAny(e[r])}}writeObjHdr(e){let t=this.writer;e<=23?t.u8(160+e):e<=255?t.u16(47104+e):e<=65535?t.u8u16(185,e):e<=0xffffffff?t.u8u32(186,e):t.u8u64(187,e)}writeMapHdr(e){this.writeObjHdr(e)}writeStartMap(){this.writer.u8(191)}writeTag(e,t){this.writeTagHdr(e),this.writeAny(t)}writeTagHdr(e){let t=this.writer;e<=23?t.u8(192+e):e<=255?t.u16(55296+e):e<=65535?t.u8u16(217,e):e<=0xffffffff?t.u8u32(218,e):t.u8u64(219,e)}writeTkn(e){let t=this.writer;e<=23?t.u8(224+e):e<=255&&t.u16(63488+e)}writeStartStr(){this.writer.u8(127)}writeStrChunk(e){throw Error("Not implemented")}writeEndStr(){throw Error("Not implemented")}writeStartBin(){this.writer.u8(95)}writeBinChunk(e){throw Error("Not implemented")}writeEndBin(){throw Error("Not implemented")}writeStartArr(){this.writer.u8(159)}writeArrChunk(e){throw Error("Not implemented")}writeEndArr(){this.writer.u8(255)}writeStartObj(){this.writer.u8(191)}writeObjChunk(e,t){throw Error("Not implemented")}writeEndObj(){this.writer.u8(255)}}},"../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderStable.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CborEncoderStable=void 0;let n=r("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoder.js"),i=r("../../node_modules/@jsonjoy.com/util/lib/sort/insertion2.js"),s=r("../../node_modules/@jsonjoy.com/util/lib/objKeyCmp.js"),o=e=>e<=23?1:e<=255?2:e<=65535?3:5;class u extends n.CborEncoder{writeObj(e){let t=Object.keys(e);(0,i.sort)(t,s.objKeyCmp);let r=t.length;this.writeObjHdr(r);for(let n=0;n<r;n++){let r=t[n];this.writeStr(r),this.writeAny(e[r])}}writeStr(e){let t=this.writer,r=e.length,n=4*r;t.ensureCapacity(5+n);let i=o(r),s=t.x,u=s+i;t.x=u;let a=t.utf8(e),l=t.uint8,c=o(a);switch(c!==i&&l.copyWithin(u+(c-i),u,u+a),c){case 1:l[s]=96+a;break;case 2:l[s]=120,l[s+1]=a;break;case 3:l[s]=121,t.view.setUint16(s+1,a);break;case 5:l[s]=122,t.view.setUint32(s+1,a)}t.x=s+c+a}writeUndef(){this.writeNull()}}t.CborEncoderStable=u},"../../node_modules/@jsonjoy.com/json-pack/lib/cbor/index.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});let n=r("../../node_modules/tslib/tslib.es6.mjs");n.__exportStar(r("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/types.js"),t),n.__exportStar(r("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderFast.js"),t),n.__exportStar(r("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoder.js"),t),n.__exportStar(r("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderStable.js"),t),n.__exportStar(r("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborEncoderDag.js"),t),n.__exportStar(r("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderBase.js"),t),n.__exportStar(r("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoder.js"),t),n.__exportStar(r("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/CborDecoderDag.js"),t)},"../../node_modules/@jsonjoy.com/json-pack/lib/cbor/types.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},"../../node_modules/@jsonjoy.com/util/lib/buffers/Reader.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.Reader=void 0;let n=r("../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/index.js");t.Reader=class{constructor(){this.uint8=new Uint8Array([]),this.view=new DataView(this.uint8.buffer),this.x=0}reset(e){this.x=0,this.uint8=e,this.view=new DataView(e.buffer,e.byteOffset,e.length)}peak(){return this.view.getUint8(this.x)}skip(e){this.x+=e}buf(e){let t=this.x+e,r=this.uint8.subarray(this.x,t);return this.x=t,r}u8(){return this.uint8[this.x++]}i8(){return this.view.getInt8(this.x++)}u16(){let e=this.x,t=(this.uint8[e++]<<8)+this.uint8[e++];return this.x=e,t}i16(){let e=this.view.getInt16(this.x);return this.x+=2,e}u32(){let e=this.view.getUint32(this.x);return this.x+=4,e}i32(){let e=this.view.getInt32(this.x);return this.x+=4,e}u64(){let e=this.view.getBigUint64(this.x);return this.x+=8,e}i64(){let e=this.view.getBigInt64(this.x);return this.x+=8,e}f32(){let e=this.x;return this.x+=4,this.view.getFloat32(e)}f64(){let e=this.x;return this.x+=8,this.view.getFloat64(e)}utf8(e){let t=this.x;return this.x+=e,(0,n.decodeUtf8)(this.uint8,t,e)}ascii(e){let t=this.uint8,r="",n=this.x+e;for(let e=this.x;e<n;e++)r+=String.fromCharCode(t[e]);return this.x=n,r}}},"../../node_modules/@jsonjoy.com/util/lib/buffers/Slice.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Slice=void 0,t.Slice=class{constructor(e,t,r,n){this.uint8=e,this.view=t,this.start=r,this.end=n}subarray(){return this.uint8.subarray(this.start,this.end)}}},"../../node_modules/@jsonjoy.com/util/lib/buffers/Writer.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.Writer=void 0;let n=r("../../node_modules/@jsonjoy.com/util/lib/buffers/Slice.js"),i=new DataView(new Uint8Array([]).buffer),s="function"==typeof Buffer,o=s?Buffer.prototype.utf8Write:null,u=s?Buffer.from:null,a="undefined"!=typeof TextEncoder?new TextEncoder:null;t.Writer=class{constructor(e=65536){this.allocSize=e,this.view=i,this.x0=0,this.x=0,this.uint8=new Uint8Array(e),this.size=e,this.view=new DataView(this.uint8.buffer)}grow(e){let t=this.x0,r=this.x,n=this.uint8,i=new Uint8Array(e),s=new DataView(i.buffer),o=n.subarray(t,r);i.set(o,0),this.x=r-t,this.x0=0,this.uint8=i,this.size=e,this.view=s}ensureCapacity(e){let t=this.size,r=t-this.x;if(r<e){let n=t-this.x0+(e-r);this.grow(n<=this.allocSize?this.allocSize:2*n)}}move(e){this.ensureCapacity(e),this.x+=e}reset(){this.x0=this.x}newBuffer(e){let t=this.uint8=new Uint8Array(e);this.size=e,this.view=new DataView(t.buffer),this.x=this.x0=0}flush(){let e=this.uint8.subarray(this.x0,this.x);return this.x0=this.x,e}flushSlice(){let e=new n.Slice(this.uint8,this.view,this.x0,this.x);return this.x0=this.x,e}u8(e){this.ensureCapacity(1),this.uint8[this.x++]=e}u16(e){this.ensureCapacity(2),this.view.setUint16(this.x,e),this.x+=2}u32(e){this.ensureCapacity(4),this.view.setUint32(this.x,e),this.x+=4}i32(e){this.ensureCapacity(4),this.view.setInt32(this.x,e),this.x+=4}u64(e){this.ensureCapacity(8),this.view.setBigUint64(this.x,BigInt(e)),this.x+=8}f64(e){this.ensureCapacity(8),this.view.setFloat64(this.x,e),this.x+=8}u8u16(e,t){this.ensureCapacity(3);let r=this.x;this.uint8[r++]=e,this.uint8[r++]=t>>>8,this.uint8[r++]=255&t,this.x=r}u8u32(e,t){this.ensureCapacity(5);let r=this.x;this.uint8[r++]=e,this.view.setUint32(r,t),this.x=r+4}u8u64(e,t){this.ensureCapacity(9);let r=this.x;this.uint8[r++]=e,this.view.setBigUint64(r,BigInt(t)),this.x=r+8}u8f32(e,t){this.ensureCapacity(5);let r=this.x;this.uint8[r++]=e,this.view.setFloat32(r,t),this.x=r+4}u8f64(e,t){this.ensureCapacity(9);let r=this.x;this.uint8[r++]=e,this.view.setFloat64(r,t),this.x=r+8}buf(e,t){this.ensureCapacity(t);let r=this.x;this.uint8.set(e,r),this.x=r+t}utf8(e){let t=4*e.length;if(t<168)return this.utf8Native(e);if(o){let r=o.call(this.uint8,e,this.x,t);return this.x+=r,r}if(u){let r=this.uint8,n=r.byteOffset+this.x,i=u(r.buffer).subarray(n,n+t).write(e,0,t,"utf8");return this.x+=i,i}if(t>1024&&a){let r=a.encodeInto(e,this.uint8.subarray(this.x,this.x+t)).written;return this.x+=r,r}return this.utf8Native(e)}utf8Native(e){let t=e.length,r=this.uint8,n=this.x,i=0;for(;i<t;){let s=e.charCodeAt(i++);if((0xffffff80&s)==0){r[n++]=s;continue}if((0xfffff800&s)==0)r[n++]=s>>6&31|192;else{if(s>=55296&&s<=56319&&i<t){let t=e.charCodeAt(i);(64512&t)==56320&&(i++,s=((1023&s)<<10)+(1023&t)+65536)}(0xffff0000&s)==0?r[n++]=s>>12&15|224:(r[n++]=s>>18&7|240,r[n++]=s>>12&63|128),r[n++]=s>>6&63|128}r[n++]=63&s|128}let s=n-this.x;return this.x=n,s}ascii(e){let t=e.length;this.ensureCapacity(t);let r=this.uint8,n=this.x,i=0;for(;i<t;)r[n++]=e.charCodeAt(i++);this.x=n}}},"../../node_modules/@jsonjoy.com/util/lib/buffers/f16.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeF16=void 0;let r=Math.pow;t.decodeF16=e=>{let t=(31744&e)>>10,n=1023&e;return(e>>15?-1:1)*(t?31===t?n?NaN:1/0:r(2,t-15)*(1+n/1024):n/1024*6103515625e-14)}},"../../node_modules/@jsonjoy.com/util/lib/buffers/isFloat32.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isFloat32=void 0;let r=new DataView(new ArrayBuffer(4));t.isFloat32=e=>(r.setFloat32(0,e),e===r.getFloat32(0))},"../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/CachedUtf8Decoder.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.CachedUtf8Decoder=void 0;let n=r("../../node_modules/tslib/tslib.es6.mjs").__importDefault(r("../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/v10.js")),i=1+Math.round(0xfffffffe*Math.random());class s{constructor(e,t){this.bytes=e,this.value=t}}t.CachedUtf8Decoder=class{constructor(){this.caches=[];for(let e=0;e<31;e++)this.caches.push([])}get(e,t,r){let n=this.caches[r-1],i=n.length;e:for(let s=0;s<i;s++){let i=n[s],o=i.bytes;for(let n=0;n<r;n++)if(o[n]!==e[t+n])continue e;return i.value}return null}store(e,t){let r=this.caches[e.length-1],n=new s(e,t);if(r.length>=16)r[i^=i<<13,i^=i>>>17,((i^=i<<5)>>>0)%16+0]=n;else r.push(n)}decode(e,t,r){if(!r)return"";let i=this.get(e,t,r);if(null!==i)return i;let s=(0,n.default)(e,t,r),o=Uint8Array.prototype.slice.call(e,t,t+r);return this.store(o,s),s}}},"../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeAscii.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeAsciiMax15=t.decodeAscii=void 0;let r=String.fromCharCode;t.decodeAscii=(e,t,n)=>{let i=[];for(let r=0;r<n;r++){let r=e[t++];if(128&r)return;i.push(r)}return r.apply(String,i)},t.decodeAsciiMax15=(e,t,n)=>{if(n<4){if(n<2){if(0===n)return"";{let n=e[t++];if((128&n)>1){t-=1;return}return r(n)}}{let i=e[t++],s=e[t++];if((128&i)>0||(128&s)>0){t-=2;return}if(n<3)return r(i,s);let o=e[t++];if((128&o)>0){t-=3;return}return r(i,s,o)}}{let i=e[t++],s=e[t++],o=e[t++],u=e[t++];if((128&i)>0||(128&s)>0||(128&o)>0||(128&u)>0){t-=4;return}if(n<6){if(4===n)return r(i,s,o,u);{let n=e[t++];if((128&n)>0){t-=5;return}return r(i,s,o,u,n)}}if(n<8){let a=e[t++],l=e[t++];if((128&a)>0||(128&l)>0){t-=6;return}if(n<7)return r(i,s,o,u,a,l);let c=e[t++];if((128&c)>0){t-=7;return}return r(i,s,o,u,a,l,c)}{let a=e[t++],l=e[t++],c=e[t++],f=e[t++];if((128&a)>0||(128&l)>0||(128&c)>0||(128&f)>0){t-=8;return}if(n<10){if(8===n)return r(i,s,o,u,a,l,c,f);{let n=e[t++];if((128&n)>0){t-=9;return}return r(i,s,o,u,a,l,c,f,n)}}if(n<12){let h=e[t++],d=e[t++];if((128&h)>0||(128&d)>0){t-=10;return}if(n<11)return r(i,s,o,u,a,l,c,f,h,d);let _=e[t++];if((128&_)>0){t-=11;return}return r(i,s,o,u,a,l,c,f,h,d,_)}{let h=e[t++],d=e[t++],_=e[t++],p=e[t++];if((128&h)>0||(128&d)>0||(128&_)>0||(128&p)>0){t-=12;return}if(n<14){if(12===n)return r(i,s,o,u,a,l,c,f,h,d,_,p);{let n=e[t++];if((128&n)>0){t-=13;return}return r(i,s,o,u,a,l,c,f,h,d,_,p,n)}}{let b=e[t++],m=e[t++];if((128&b)>0||(128&m)>0){t-=14;return}if(n<15)return r(i,s,o,u,a,l,c,f,h,d,_,p,b,m);let y=e[t++];if((128&y)>0){t-=15;return}return r(i,s,o,u,a,l,c,f,h,d,_,p,b,m,y)}}}}}},"../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/index.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeUtf8=void 0;let n=r("../../node_modules/tslib/tslib.es6.mjs").__importDefault(r("../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/v16.js"));t.decodeUtf8=n.default},"../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/v10.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0});let r=String.fromCharCode;t.default=(e,t,n)=>{let i=t,s=i+n,o="";for(;i<s;){let t=e[i++];if((128&t)==0){o+=r(t);continue}let n=63&e[i++];if((224&t)==192){o+=r((31&t)<<6|n);continue}let s=63&e[i++];if((240&t)==224){o+=r((31&t)<<12|n<<6|s);continue}if((248&t)==240){let u=(7&t)<<18|n<<12|s<<6|63&e[i++];u>65535?o+=r((u-=65536)>>>10&1023|55296,u=56320|1023&u):o+=r(u)}else o+=r(t)}return o}},"../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/v16.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});let n=r("../../node_modules/tslib/tslib.es6.mjs"),i=r("../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeAscii.js"),s=n.__importDefault(r("../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/v18.js")),o="undefined"!=typeof Buffer,u=o?Buffer.prototype.utf8Slice:null,a=o?Buffer.from:null,l=(e,t,r)=>(0,i.decodeAsciiMax15)(e,t,r)??(0,s.default)(e,t,r),c=(e,t,r)=>(0,i.decodeAscii)(e,t,r)??(0,s.default)(e,t,r),f=u?(e,t,r)=>u.call(e,t,t+r):a?(e,t,r)=>a(e).subarray(t,t+r).toString("utf8"):s.default;t.default=(e,t,r)=>r<16?l(e,t,r):r<32?c(e,t,r):f(e,t,r)},"../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/decodeUtf8/v18.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0});let r=String.fromCharCode;t.default=(e,t,n)=>{let i=t,s=i+n,o=[];for(;i<s;){let t=e[i++];if((128&t)!=0){let r=63&e[i++];if((224&t)==192)t=(31&t)<<6|r;else{let n=63&e[i++];if((240&t)==224)t=(31&t)<<12|r<<6|n;else if((248&t)==240){let s=(7&t)<<18|r<<12|n<<6|63&e[i++];if(s>65535){let e=(s-=65536)>>>10&1023|55296;t=56320|1023&s,o.push(e)}else t=s}}}o.push(t)}return r.apply(String,o)}},"../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/sharedCachedUtf8Decoder.js":function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});let n=r("../../node_modules/@jsonjoy.com/util/lib/buffers/utf8/CachedUtf8Decoder.js");t.default=new n.CachedUtf8Decoder},"../../node_modules/@jsonjoy.com/util/lib/objKeyCmp.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.objKeyCmp=void 0,t.objKeyCmp=(e,t)=>{let r=e.length,n=t.length;return r===n?e>t?1:-1:r-n}},"../../node_modules/@jsonjoy.com/util/lib/sort/insertion2.js":function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.sort=void 0,t.sort=(e,t)=>{let r=e.length;for(let n=1;n<r;n++){let r=e[n],i=n;for(;0!==i&&t(e[i-1],r)>0;)e[i]=e[i-1],i--;e[i]=r}return e}},"../../node_modules/preact-custom-element/dist/preact-custom-element.esm.js":function(e,t,r){r.d(t,{Z:()=>h});var n=r("../../node_modules/preact/dist/preact.module.js");function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var s=["context","children"];function o(e){this.getChildContext=function(){return e.context};var t=e.children,r=function(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n<s.length;n++)t.indexOf(r=s[n])>=0||(i[r]=e[r]);return i}(e,s);return(0,n.Tm)(t,r)}function u(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=(0,n.h)(o,i({},this._props,{context:e.detail.context}),function e(t,r){if(3===t.nodeType)return t.data;if(1!==t.nodeType)return null;var i=[],s={},o=0,u=t.attributes,l=t.childNodes;for(o=u.length;o--;)"slot"!==u[o].name&&(s[u[o].name]=u[o].value,s[a(u[o].name)]=u[o].value);for(o=l.length;o--;){var c=e(l[o],null),h=l[o].slot;h?s[h]=(0,n.h)(f,{name:h},c):i[o]=c}var d=r?(0,n.h)(f,null,i):i;return(0,n.h)(r||t.nodeName.toLowerCase(),s,d)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?n.ZB:n.sY)(this._vdom,this._root)}function a(e){return e.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():""})}function l(e,t,r){if(this._vdom){var i={};i[e]=r=null==r?void 0:r,i[a(e)]=r,this._vdom=(0,n.Tm)(this._vdom,i),(0,n.sY)(this._vdom,this._root)}}function c(){(0,n.sY)(this._vdom=null,this._root)}function f(e,t){var r=this;return(0,n.h)("slot",i({},e,{ref:function(e){e?(r.ref=e,r._listener||(r._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",r._listener))):r.ref.removeEventListener("_preact",r._listener)}}))}function h(e,t,r,n){function i(){var t=Reflect.construct(HTMLElement,[],i);return t._vdomComponent=e,t._root=n&&n.shadow?t.attachShadow({mode:n.mode||"open"}):t,t}return(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=u,i.prototype.attributeChangedCallback=l,i.prototype.disconnectedCallback=c,r=r||e.observedAttributes||Object.keys(e.propTypes||{}),i.observedAttributes=r,r.forEach(function(e){Object.defineProperty(i.prototype,e,{get:function(){return this._vdom.props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());var r=typeof t;null!=t&&"string"!==r&&"boolean"!==r&&"number"!==r||this.setAttribute(e,t)}})}),customElements.define(t||e.tagName||e.displayName||e.name,i)}},"../../node_modules/preact/dist/preact.module.js":function(e,t,r){r.d(t,{HY:()=>g,Tm:()=>D,YM:()=>i,ZB:()=>T,az:()=>w,bR:()=>function e(t,r){return r=r||[],null==t||"boolean"==typeof t||(m(t)?t.some(function(t){e(t,r)}):r.push(t)),r},h:()=>w,sY:()=>N,wA:()=>x});var n,i,s,o,u,a,l,c,f,h,d,_={},p=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,m=Array.isArray;function y(e,t){for(var r in t)e[r]=t[r];return e}function v(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(e,t,r){var i,s,o,u={};for(o in t)"key"==o?i=t[o]:"ref"==o?s=t[o]:u[o]=t[o];if(arguments.length>2&&(u.children=arguments.length>3?n.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===u[o]&&(u[o]=e.defaultProps[o]);return j(e,u,i,s,null)}function j(e,t,r,n,o){var u={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++s:o,__i:-1,__u:0};return null==o&&null!=i.vnode&&i.vnode(u),u}function g(e){return e.children}function x(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?k(e):null}function A(e){(!e.__d&&(e.__d=!0)&&o.push(e)&&!O.__r++||u!==i.debounceRendering)&&((u=i.debounceRendering)||a)(O)}function O(){for(var e,t,r,n,s,u,a=1;o.length;)o.length>a&&o.sort(l),e=o.shift(),a=o.length,e.__d&&(t=void 0,n=(r=e.__v).__e,s=[],u=[],e.__P&&((t=y({},r)).__v=r.__v+1,i.vnode&&i.vnode(t),U(e.__P,t,r,e.__n,e.__P.namespaceURI,32&r.__u?[n]:null,s,null==n?k(r):n,!!(32&r.__u),u),t.__v=r.__v,t.__.__k[t.__i]=t,M(s,t,u),t.__e!=n&&function e(t){var r,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,r=0;r<t.__k.length;r++)if(null!=(n=t.__k[r])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return e(t)}}(t)));O.__r=0}function C(e,t,r,n,s,o,u,a,l,c,f){var h,d,b,y,w,x,A=n&&n.__k||p,O=t.length;for(l=function(e,t,r,n,s){var o,u,a,l,c,f=r.length,h=f,d=0;for(e.__k=Array(s),o=0;o<s;o++)null!=(u=t[o])&&"boolean"!=typeof u&&"function"!=typeof u?(l=o+d,(u=e.__k[o]="string"==typeof u||"number"==typeof u||"bigint"==typeof u||u.constructor==String?j(null,u,null,null,null):m(u)?j(g,{children:u},null,null,null):void 0===u.constructor&&u.__b>0?j(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):u).__=e,u.__b=e.__b+1,a=null,-1!==(c=u.__i=function(e,t,r,n){var i,s,o=e.key,u=e.type,a=t[r];if(null===a&&null==e.key||a&&o==a.key&&u===a.type&&0==(2&a.__u))return r;if(n>+(null!=a&&0==(2&a.__u)))for(i=r-1,s=r+1;i>=0||s<t.length;){if(i>=0){if((a=t[i])&&0==(2&a.__u)&&o==a.key&&u===a.type)return i;i--}if(s<t.length){if((a=t[s])&&0==(2&a.__u)&&o==a.key&&u===a.type)return s;s++}}return -1}(u,r,l,h))&&(h--,(a=r[c])&&(a.__u|=2)),null==a||null===a.__v?(-1==c&&(s>f?d--:s<f&&d++),"function"!=typeof u.type&&(u.__u|=4)):c!=l&&(c==l-1?d--:c==l+1?d++:(c>l?d--:d++,u.__u|=4))):e.__k[o]=null;if(h)for(o=0;o<f;o++)null!=(a=r[o])&&0==(2&a.__u)&&(a.__e==n&&(n=k(a)),function e(t,r,n){var s,o;if(i.unmount&&i.unmount(t),(s=t.ref)&&(s.current&&s.current!==t.__e||I(s,null,r)),null!=(s=t.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(e){i.__e(e,r)}s.base=s.__P=null}if(s=t.__k)for(o=0;o<s.length;o++)s[o]&&e(s[o],r,n||"function"!=typeof t.type);n||v(t.__e),t.__c=t.__=t.__e=void 0}(a,a));return n}(r,t,A,l,O),h=0;h<O;h++)null!=(b=r.__k[h])&&(d=-1===b.__i?_:A[b.__i]||_,b.__i=h,x=U(e,b,d,s,o,u,a,l,c,f),y=b.__e,b.ref&&d.ref!=b.ref&&(d.ref&&I(d.ref,null,b),f.push(b.ref,b.__c||y,b)),null==w&&null!=y&&(w=y),4&b.__u||d.__k===b.__k?l=function e(t,r,n){var i,s;if("function"==typeof t.type){for(i=t.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=t,r=e(i[s],r,n));return r}t.__e!=r&&(r&&t.type&&!n.contains(r)&&(r=k(t)),n.insertBefore(t.__e,r||null),r=t.__e);do r=r&&r.nextSibling;while(null!=r&&8==r.nodeType);return r}(b,l,e):"function"==typeof b.type&&void 0!==x?l=x:y&&(l=y.nextSibling),b.__u&=-7);return r.__e=w,l}function S(e,t,r){"-"==t[0]?e.setProperty(t,null==r?"":r):e[t]=null==r?"":"number"!=typeof r||b.test(t)?r:r+"px"}function E(e,t,r,n,i){var s;t:if("style"==t){if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||S(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||S(e.style,t,r[t])}}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(c,"$1")),t=t.toLowerCase()in e||"onFocusOut"==t||"onFocusIn"==t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=r,r?n?r.t=n.t:(r.t=f,e.addEventListener(t,s?d:h,s)):e.removeEventListener(t,s?d:h,s);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==r?"":r;break t}catch(e){}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function P(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.u)t.u=f++;else if(t.u<r.t)return;return r(i.event?i.event(t):t)}}}function U(e,t,r,s,o,u,a,l,c,f){var h,d,p,b,w,j,A,O,S,P,U,M,I,N,T,D,H,L=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(c=!!(32&r.__u),u=[l=t.__e=r.__e]),(h=i.__b)&&h(t);t:if("function"==typeof L)try{if(O=t.props,S="prototype"in L&&L.prototype.render,P=(h=L.contextType)&&s[h.__c],U=h?P?P.props.value:h.__:s,r.__c?A=(d=t.__c=r.__c).__=d.__E:(S?t.__c=d=new L(O,U):(t.__c=d=new x(O,U),d.constructor=L,d.render=B),P&&P.sub(d),d.props=O,d.state||(d.state={}),d.context=U,d.__n=s,p=d.__d=!0,d.__h=[],d._sb=[]),S&&null==d.__s&&(d.__s=d.state),S&&null!=L.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=y({},d.__s)),y(d.__s,L.getDerivedStateFromProps(O,d.__s))),b=d.props,w=d.state,d.__v=t,p)S&&null==L.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),S&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(S&&null==L.getDerivedStateFromProps&&O!==b&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(O,U),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(O,d.__s,U)||t.__v==r.__v)){for(t.__v!=r.__v&&(d.props=O,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(e){e&&(e.__=t)}),M=0;M<d._sb.length;M++)d.__h.push(d._sb[M]);d._sb=[],d.__h.length&&a.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(O,d.__s,U),S&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(b,w,j)})}if(d.context=U,d.props=O,d.__P=e,d.__e=!1,I=i.__r,N=0,S){for(d.state=d.__s,d.__d=!1,I&&I(t),h=d.render(d.props,d.state,d.context),T=0;T<d._sb.length;T++)d.__h.push(d._sb[T]);d._sb=[]}else do d.__d=!1,I&&I(t),h=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++N<25);d.state=d.__s,null!=d.getChildContext&&(s=y(y({},s),d.getChildContext())),S&&!p&&null!=d.getSnapshotBeforeUpdate&&(j=d.getSnapshotBeforeUpdate(b,w)),D=h,null!=h&&h.type===g&&null==h.key&&(D=function e(t){return"object"!=typeof t||null==t?t:m(t)?t.map(e):y({},t)}(h.props.children)),l=C(e,m(D)?D:[D],t,r,s,o,u,a,l,c,f),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),A&&(d.__E=d.__=null)}catch(e){if(t.__v=null,c||null!=u){if(e.then){for(t.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;u[u.indexOf(l)]=null,t.__e=l}else for(H=u.length;H--;)v(u[H])}else t.__e=r.__e,t.__k=r.__k;i.__e(e,t,r)}else null==u&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):l=t.__e=function(e,t,r,s,o,u,a,l,c){var f,h,d,p,b,y,w,j=r.props,g=t.props,x=t.type;if("svg"==x?o="http://www.w3.org/2000/svg":"math"==x?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=u){for(f=0;f<u.length;f++)if((b=u[f])&&"setAttribute"in b==!!x&&(x?b.localName==x:3==b.nodeType)){e=b,u[f]=null;break}}if(null==e){if(null==x)return document.createTextNode(g);e=document.createElementNS(o,x,g.is&&g),l&&(i.__m&&i.__m(t,u),l=!1),u=null}if(null===x)j===g||l&&e.data===g||(e.data=g);else{if(u=u&&n.call(e.childNodes),j=r.props||_,!l&&null!=u)for(j={},f=0;f<e.attributes.length;f++)j[(b=e.attributes[f]).name]=b.value;for(f in j)if(b=j[f],"children"==f);else if("dangerouslySetInnerHTML"==f)d=b;else if(!(f in g)){if("value"==f&&"defaultValue"in g||"checked"==f&&"defaultChecked"in g)continue;E(e,f,null,b,o)}for(f in g)b=g[f],"children"==f?p=b:"dangerouslySetInnerHTML"==f?h=b:"value"==f?y=b:"checked"==f?w=b:l&&"function"!=typeof b||j[f]===b||E(e,f,b,j[f],o);if(h)l||d&&(h.__html===d.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(d&&(e.innerHTML=""),C("template"===t.type?e.content:e,m(p)?p:[p],t,r,s,"foreignObject"==x?"http://www.w3.org/1999/xhtml":o,u,a,u?u[0]:r.__k&&k(r,0),l,c),null!=u)for(f=u.length;f--;)v(u[f]);l||(f="value","progress"==x&&null==y?e.removeAttribute("value"):void 0===y||y===e[f]&&("progress"!=x||y)&&("option"!=x||y===j[f])||E(e,f,y,j[f],o),f="checked",void 0!==w&&w!==e[f]&&E(e,f,w,j[f],o))}return e}(r.__e,t,r,s,o,u,a,c,f);return(h=i.diffed)&&h(t),128&t.__u?void 0:l}function M(e,t,r){for(var n=0;n<r.length;n++)I(r[n],r[++n],r[++n]);i.__c&&i.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){i.__e(e,t.__v)}})}function I(e,t,r){try{if("function"==typeof e){var n="function"==typeof e.__u;n&&e.__u(),n&&null==t||(e.__u=e(t))}else e.current=t}catch(e){i.__e(e,r)}}function B(e,t,r){return this.constructor(e,r)}function N(e,t,r){var s,o,u,a;t==document&&(t=document.documentElement),i.__&&i.__(e,t),o=(s="function"==typeof r)?null:r&&r.__k||t.__k,u=[],a=[],U(t,e=(!s&&r||t).__k=w(g,null,[e]),o||_,_,t.namespaceURI,!s&&r?[r]:o?null:t.firstChild?n.call(t.childNodes):null,u,!s&&r?r:o?o.__e:t.firstChild,s,a),M(u,e,a)}function T(e,t){N(e,t,T)}function D(e,t,r){var i,s,o,u,a=y({},e.props);for(o in e.type&&e.type.defaultProps&&(u=e.type.defaultProps),t)"key"==o?i=t[o]:"ref"==o?s=t[o]:a[o]=void 0===t[o]&&void 0!==u?u[o]:t[o];return arguments.length>2&&(a.children=arguments.length>3?n.call(arguments,2):r),j(e.type,a,i||e.key,s||e.ref,null)}n=p.slice,i={__e:function(e,t,r,n){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&null!=s.getDerivedStateFromError&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},s=0,x.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=y({},this.state),"function"==typeof e&&(e=e(y({},r),this.props)),e&&y(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),A(this))},x.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),A(this))},x.prototype.render=g,o=[],a="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,c=/(PointerCapture)$|Capture$/i,f=0,h=P(!1),d=P(!0)},"../../node_modules/preact/hooks/dist/hooks.module.js":function(e,t,r){r.d(t,{I4:()=>j,Ye:()=>w,d4:()=>v,eJ:()=>y});var n,i,s,o,u=r("../../node_modules/preact/dist/preact.module.js"),a=0,l=[],c=u.YM,f=c.__b,h=c.__r,d=c.diffed,_=c.__c,p=c.unmount,b=c.__;function m(e,t){c.__h&&c.__h(i,e,a||t),a=0;var r=i.__H||(i.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function y(e){return a=1,function(e,t,r){var s=m(n++,2);if(s.t=e,!s.__c&&(s.__=[C(void 0,t),function(e){var t=s.__N?s.__N[0]:s.__[0],r=s.t(t,e);t!==r&&(s.__N=[r,s.__[1]],s.__c.setState({}))}],s.__c=i,!i.__f)){var o=function(e,t,r){if(!s.__c.__H)return!0;var n=s.__c.__H.__.filter(function(e){return!!e.__c});if(n.every(function(e){return!e.__N}))return!u||u.call(this,e,t,r);var i=s.__c.props!==e;return n.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}}),u&&u.call(this,e,t,r)||i};i.__f=!0;var u=i.shouldComponentUpdate,a=i.componentWillUpdate;i.componentWillUpdate=function(e,t,r){if(this.__e){var n=u;u=void 0,o(e,t,r),u=n}a&&a.call(this,e,t,r)},i.shouldComponentUpdate=o}return s.__N||s.__}(C,e)}function v(e,t){var r=m(n++,3);!c.__s&&O(r.__H,t)&&(r.__=e,r.u=t,i.__H.__h.push(r))}function w(e,t){var r=m(n++,7);return O(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function j(e,t){return a=8,w(function(){return e},t)}function g(){for(var e;e=l.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(k),e.__H.__h.forEach(A),e.__H.__h=[]}catch(t){e.__H.__h=[],c.__e(t,e.__v)}}c.__b=function(e){i=null,f&&f(e)},c.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),b&&b(e,t)},c.__r=function(e){h&&h(e),n=0;var t=(i=e.__c).__H;t&&(s===i?(t.__h=[],i.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(k),t.__h.forEach(A),t.__h=[],n=0)),s=i},c.diffed=function(e){d&&d(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&o===c.requestAnimationFrame||((o=c.requestAnimationFrame)||function(e){var t,r=function(){clearTimeout(n),x&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);x&&(t=requestAnimationFrame(r))})(g)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),s=i=null},c.__c=function(e,t){t.some(function(e){try{e.__h.forEach(k),e.__h=e.__h.filter(function(e){return!e.__||A(e)})}catch(r){t.some(function(e){e.__h&&(e.__h=[])}),t=[],c.__e(r,e.__v)}}),_&&_(e,t)},c.unmount=function(e){p&&p(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(e){try{k(e)}catch(e){t=e}}),r.__H=void 0,t&&c.__e(t,r.__v))};var x="function"==typeof requestAnimationFrame;function k(e){var t=i,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),i=t}function A(e){var t=i;e.__c=e.__(),i=t}function O(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function C(e,t){return"function"==typeof t?t(e):t}},"../../node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js":function(e,t,r){r.d(t,{BX:()=>s,HY:()=>n.HY,tZ:()=>s});var n=r("../../node_modules/preact/dist/preact.module.js"),i=0;function s(e,t,r,s,o,u){t||(t={});var a,l,c=t;if("ref"in c)for(l in c={},t)"ref"==l?a=t[l]:c[l]=t[l];var f={type:e,props:c,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--i,__i:-1,__u:0,__source:o,__self:u};if("function"==typeof e&&(a=e.defaultProps))for(l in a)void 0===c[l]&&(c[l]=a[l]);return n.YM.vnode&&n.YM.vnode(f),f}},"../../node_modules/@noble/hashes/esm/_assert.js":function(e,t,r){function n(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function i(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function s(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function o(e,t){i(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}r.d(t,{$h:()=>s,eB:()=>o,gk:()=>i,k8:()=>n})},"../../node_modules/@noble/hashes/esm/utils.js":function(e,t,r){r.d(t,{GL:()=>s,Jq:()=>i,O0:()=>l,hE:()=>f,iA:()=>u,kb:()=>c,l1:()=>a,np:()=>o});var n=r("../../node_modules/@noble/hashes/esm/_assert.js");function i(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function s(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function o(e,t){return e<<32-t|e>>>t}let u=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0];function a(e){for(let r=0;r<e.length;r++){var t;e[r]=(t=e[r])<<24&0xff000000|t<<8&0xff0000|t>>>8&65280|t>>>24&255}}function l(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}(e)),(0,n.gk)(e),e}class c{clone(){return this._cloneInto()}}function f(e){let t=t=>e().update(l(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}},"../../node_modules/class-variance-authority/dist/index.mjs":function(e,t,r){r.d(t,{cx:()=>n});let n=function(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=function e(t){var r,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t){if(Array.isArray(t)){var s=t.length;for(r=0;r<s;r++)t[r]&&(n=e(t[r]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n)}return i}(e))&&(n&&(n+=" "),n+=t);return n}},"../../node_modules/tslib/tslib.es6.mjs":function(e,t,r){r.r(t),r.d(t,{__addDisposableResource:()=>N,__assign:()=>s,__asyncDelegator:()=>A,__asyncGenerator:()=>k,__asyncValues:()=>O,__await:()=>x,__awaiter:()=>_,__classPrivateFieldGet:()=>M,__classPrivateFieldIn:()=>B,__classPrivateFieldSet:()=>I,__createBinding:()=>b,__decorate:()=>u,__disposeResources:()=>D,__esDecorate:()=>l,__exportStar:()=>m,__extends:()=>i,__generator:()=>p,__importDefault:()=>U,__importStar:()=>P,__makeTemplateObject:()=>C,__metadata:()=>d,__param:()=>a,__propKey:()=>f,__read:()=>v,__rest:()=>o,__rewriteRelativeImportExtension:()=>H,__runInitializers:()=>c,__setFunctionName:()=>h,__spread:()=>w,__spreadArray:()=>g,__spreadArrays:()=>j,__values:()=>y,default:()=>L});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function u(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var u=e.length-1;u>=0;u--)(i=e[u])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function a(e,t){return function(r,n){t(r,n,e)}}function l(e,t,r,n,i,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw TypeError("Function expected");return e}for(var u,a=n.kind,l="getter"===a?"get":"setter"===a?"set":"value",c=!t&&e?n.static?e:e.prototype:null,f=t||(c?Object.getOwnPropertyDescriptor(c,n.name):{}),h=!1,d=r.length-1;d>=0;d--){var _={};for(var p in n)_[p]="access"===p?{}:n[p];for(var p in n.access)_.access[p]=n.access[p];_.addInitializer=function(e){if(h)throw TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var b=(0,r[d])("accessor"===a?{get:f.get,set:f.set}:f[l],_);if("accessor"===a){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw TypeError("Object expected");(u=o(b.get))&&(f.get=u),(u=o(b.set))&&(f.set=u),(u=o(b.init))&&i.unshift(u)}else(u=o(b))&&("field"===a?i.unshift(u):f[l]=u)}c&&Object.defineProperty(c,n.name,f),h=!0}function c(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function f(e){return"symbol"==typeof e?e:"".concat(e)}function h(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function d(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function _(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{a(n.next(e))}catch(e){s(e)}}function u(e){try{a(n.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,u)}a((n=n.apply(e,t||[])).next())})}function p(e,t){var r,n,i,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(a){return function(u){if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,n=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){s=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){s.label=u[1];break}if(6===u[0]&&s.label<i[1]){s.label=i[1],i=u;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(u);break}i[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(e,s)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}var b=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function m(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||b(t,e,r)}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function j(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var s=arguments[t],o=0,u=s.length;o<u;o++,i++)n[i]=s[o];return n}function g(e,t,r){if(r||2==arguments.length)for(var n,i=0,s=t.length;i<s;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function x(e){return this instanceof x?(this.v=e,this):new x(e)}function k(e,t,r){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),s=[];return n=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(e){return function(t){return Promise.resolve(t).then(e,l)}}),n[Symbol.asyncIterator]=function(){return this},n;function o(e,t){i[e]&&(n[e]=function(t){return new Promise(function(r,n){s.push([e,t,r,n])>1||u(e,t)})},t&&(n[e]=t(n[e])))}function u(e,t){try{var r;(r=i[e](t)).value instanceof x?Promise.resolve(r.value.v).then(a,l):c(s[0][2],r)}catch(e){c(s[0][3],e)}}function a(e){u("next",e)}function l(e){u("throw",e)}function c(e,t){e(t),s.shift(),s.length&&u(s[0][0],s[0][1])}}function A(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:x(e[n](t)),done:!1}:i?i(t):t}:i}}function O(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=y(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,i,(t=e[r](t)).done,t.value)})}}}function C(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var S=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},E=function(e){return(E=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)};function P(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=E(e),n=0;n<r.length;n++)"default"!==r[n]&&b(t,e,r[n]);return S(t,e),t}function U(e){return e&&e.__esModule?e:{default:e}}function M(e,t,r,n){if("a"===r&&!n)throw TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function I(e,t,r,n,i){if("m"===n)throw TypeError("Private method is not writable");if("a"===n&&!i)throw TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}function B(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function N(e,t,r){if(null!=t){var n,i;if("object"!=typeof t&&"function"!=typeof t)throw TypeError("Object expected.");if(r){if(!Symbol.asyncDispose)throw TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(i=n)}if("function"!=typeof n)throw TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var T="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function D(e){function t(t){e.error=e.hasError?new T(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}var r,n=0;return function i(){for(;r=e.stack.pop();)try{if(!r.async&&1===n)return n=0,e.stack.push(r),Promise.resolve().then(i);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(s).then(i,function(e){return t(e),i()})}else n|=1}catch(e){t(e)}if(1===n)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}()}function H(e,t){return"string"==typeof e&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(e,r,n,i,s){return r?t?".jsx":".js":!n||i&&s?n+i+"."+s.toLowerCase()+"js":e}):e}let L={__extends:i,__assign:s,__rest:o,__decorate:u,__param:a,__esDecorate:l,__runInitializers:c,__propKey:f,__setFunctionName:h,__metadata:d,__awaiter:_,__generator:p,__createBinding:b,__exportStar:m,__values:y,__read:v,__spread:w,__spreadArrays:j,__spreadArray:g,__await:x,__asyncGenerator:k,__asyncDelegator:A,__asyncValues:O,__makeTemplateObject:C,__importStar:P,__importDefault:U,__classPrivateFieldGet:M,__classPrivateFieldSet:I,__classPrivateFieldIn:B,__addDisposableResource:N,__disposeResources:D,__rewriteRelativeImportExtension:H}},"../../node_modules/viem/_esm/errors/base.js":function(e,t,r){r.d(t,{G:()=>s});let n="2.23.14",i={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${n}`};class s extends Error{constructor(e,t={}){let r=t.cause instanceof s?t.cause.details:t.cause?.message?t.cause.message:t.details,o=t.cause instanceof s&&t.cause.docsPath||t.docsPath,u=i.getDocsUrl?.({...t,docsPath:o});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...u?[`Docs: ${u}`]:[],...r?[`Details: ${r}`]:[],...i.version?[`Version: ${i.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=o,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=n}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t&&void 0!==t.cause?e(t.cause,r):r?null:t}(this,e)}}},"../../node_modules/viem/_esm/errors/encoding.js":function(e,t,r){r.d(t,{J5:()=>i,M6:()=>s});var n=r("../../node_modules/viem/_esm/errors/base.js");class i extends n.G{constructor({max:e,min:t,signed:r,size:n,value:i}){super(`Number "${i}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}n.G,n.G,n.G;class s extends n.G{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}},"../../node_modules/viem/_esm/utils/address/isAddressEqual.js":function(e,t,r){r.d(t,{E:()=>h});var n=r("../../node_modules/viem/_esm/errors/base.js");class i extends n.G{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class s extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}var o=r("../../node_modules/viem/_esm/utils/encoding/toBytes.js"),u=r("../../node_modules/viem/_esm/utils/hash/keccak256.js");let a=new s(8192),l=/^0x[a-fA-F0-9]{40}$/,c=new s(8192);function f(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(c.has(n))return c.get(n);let i=!!l.test(e)&&(e.toLowerCase()===e||!r||function(e,t){if(a.has(`${e}.undefined`))return a.get(`${e}.${void 0}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=(0,u.w)((0,o.qX)(r),"bytes"),i=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&i[e]&&(i[e]=i[e].toUpperCase()),(15&n[e>>1])>=8&&i[e+1]&&(i[e+1]=i[e+1].toUpperCase());let s=`0x${i.join("")}`;return a.set(`${e}.${t}`,s),s}(e)===e);return c.set(n,i),i}function h(e,t){if(!f(e,{strict:!1}))throw new i({address:e});if(!f(t,{strict:!1}))throw new i({address:t});return e.toLowerCase()===t.toLowerCase()}},"../../node_modules/viem/_esm/utils/data/concat.js":function(e,t,r){r.d(t,{SM:()=>n});function n(e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}},"../../node_modules/viem/_esm/utils/data/isHex.js":function(e,t,r){r.d(t,{v:()=>n});function n(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}},"../../node_modules/viem/_esm/utils/data/pad.js":function(e,t,r){r.d(t,{vk:()=>s});var n=r("../../node_modules/viem/_esm/errors/base.js");n.G;class i extends n.G{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function s(e,{dir:t,size:r=32}={}){return"string"==typeof e?function(e,{dir:t,size:r=32}={}){if(null===r)return e;let n=e.replace("0x","");if(n.length>2*r)throw new i({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n["right"===t?"padEnd":"padStart"](2*r,"0")}`}(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new i({size:e.length,targetSize:r,type:"bytes"});let n=new Uint8Array(r);for(let i=0;i<r;i++){let s="right"===t;n[s?i:r-i-1]=e[s?i:e.length-i-1]}return n}(e,{dir:t,size:r})}n.G},"../../node_modules/viem/_esm/utils/encoding/fromHex.js":function(e,t,r){r.d(t,{Yf:()=>o});var n=r("../../node_modules/viem/_esm/errors/encoding.js"),i=r("../../node_modules/viem/_esm/utils/data/isHex.js");function s(e){return(0,i.v)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function o(e,{size:t}){if(s(e)>t)throw new n.M6({givenSize:s(e),maxSize:t})}},"../../node_modules/viem/_esm/utils/encoding/toBytes.js":function(e,t,r){r.d(t,{O0:()=>l,nr:()=>h,qX:()=>d});var n=r("../../node_modules/viem/_esm/errors/base.js"),i=r("../../node_modules/viem/_esm/utils/data/isHex.js"),s=r("../../node_modules/viem/_esm/utils/data/pad.js"),o=r("../../node_modules/viem/_esm/utils/encoding/fromHex.js"),u=r("../../node_modules/viem/_esm/utils/encoding/toHex.js");let a=new TextEncoder;function l(e,t={}){var r,n;return"number"==typeof e||"bigint"==typeof e?(r=e,n=t,h((0,u.eC)(r,n))):"boolean"==typeof e?function(e,t={}){let r=new Uint8Array(1);return(r[0]=Number(e),"number"==typeof t.size)?((0,o.Yf)(r,{size:t.size}),(0,s.vk)(r,{size:t.size})):r}(e,t):(0,i.v)(e)?h(e,t):d(e,t)}let c={zero:48,nine:57,A:65,F:70,a:97,f:102};function f(e){return e>=c.zero&&e<=c.nine?e-c.zero:e>=c.A&&e<=c.F?e-(c.A-10):e>=c.a&&e<=c.f?e-(c.a-10):void 0}function h(e,t={}){let r=e;t.size&&((0,o.Yf)(r,{size:t.size}),r=(0,s.vk)(r,{dir:"right",size:t.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);let u=i.length/2,a=new Uint8Array(u);for(let e=0,t=0;e<u;e++){let r=f(i.charCodeAt(t++)),s=f(i.charCodeAt(t++));if(void 0===r||void 0===s)throw new n.G(`Invalid byte sequence ("${i[t-2]}${i[t-1]}" in "${i}").`);a[e]=16*r+s}return a}function d(e,t={}){let r=a.encode(e);return"number"==typeof t.size?((0,o.Yf)(r,{size:t.size}),(0,s.vk)(r,{dir:"right",size:t.size})):r}},"../../node_modules/viem/_esm/utils/encoding/toHex.js":function(e,t,r){r.d(t,{NC:()=>u,ci:()=>a,eC:()=>l});var n=r("../../node_modules/viem/_esm/errors/encoding.js"),i=r("../../node_modules/viem/_esm/utils/data/pad.js"),s=r("../../node_modules/viem/_esm/utils/encoding/fromHex.js");let o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function u(e,t={}){return"number"==typeof e||"bigint"==typeof e?l(e,t):"string"==typeof e?function(e,t={}){return a(c.encode(e),t)}(e,t):"boolean"==typeof e?function(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?((0,s.Yf)(r,{size:t.size}),(0,i.vk)(r,{size:t.size})):r}(e,t):a(e,t)}function a(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=o[e[t]];let n=`0x${r}`;return"number"==typeof t.size?((0,s.Yf)(n,{size:t.size}),(0,i.vk)(n,{dir:"right",size:t.size})):n}function l(e,t={}){let r;let{signed:s,size:o}=t,u=BigInt(e);o?r=s?(1n<<8n*BigInt(o)-1n)-1n:2n**(8n*BigInt(o))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let a="bigint"==typeof r&&s?-r-1n:0;if(r&&u>r||u<a){let t="bigint"==typeof e?"n":"";throw new n.J5({max:r?`${r}${t}`:void 0,min:`${a}${t}`,signed:s,size:o,value:`${e}${t}`})}let c=`0x${(s&&u<0?(1n<<BigInt(8*o))+BigInt(u):u).toString(16)}`;return o?(0,i.vk)(c,{size:o}):c}let c=new TextEncoder},"../../node_modules/viem/_esm/utils/hash/keccak256.js":function(e,t,r){r.d(t,{w:()=>E});var n=r("../../node_modules/@noble/hashes/esm/_assert.js");let i=BigInt(0x100000000-1),s=BigInt(32),o=(e,t,r)=>e<<r|t>>>32-r,u=(e,t,r)=>t<<r|e>>>32-r,a=(e,t,r)=>t<<r-32|e>>>64-r,l=(e,t,r)=>e<<r-32|t>>>64-r;var c=r("../../node_modules/@noble/hashes/esm/utils.js");let f=[],h=[],d=[],_=BigInt(0),p=BigInt(1),b=BigInt(2),m=BigInt(7),y=BigInt(256),v=BigInt(113);for(let e=0,t=p,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],f.push(2*(5*n+r)),h.push((e+1)*(e+2)/2%64);let i=_;for(let e=0;e<7;e++)(t=(t<<p^(t>>m)*v)%y)&b&&(i^=p<<(p<<BigInt(e))-p);d.push(i)}let[w,j]=function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){let{h:u,l:a}=function(e,t=!1){return t?{h:Number(e&i),l:Number(e>>s&i)}:{h:0|Number(e>>s&i),l:0|Number(e&i)}}(e[o],t);[r[o],n[o]]=[u,a]}return[r,n]}(d,!0),g=(e,t,r)=>r>32?a(e,t,r):o(e,t,r),x=(e,t,r)=>r>32?l(e,t,r):u(e,t,r);class k extends c.kb{constructor(e,t,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,n.k8)(r),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,c.Jq)(this.state)}keccak(){c.iA||(0,c.l1)(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,s=r[i],o=r[i+1],u=g(s,o,1)^r[n],a=x(s,o,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=u,e[t+r+1]^=a}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=h[r],s=g(t,i,n),o=x(t,i,n),u=f[r];t=e[u],i=e[u+1],e[u]=s,e[u+1]=o}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=w[n],e[1]^=j[n]}r.fill(0)}(this.state32,this.rounds),c.iA||(0,c.l1)(this.state32),this.posOut=0,this.pos=0}update(e){(0,n.$h)(this);let{blockLen:t,state:r}=this,i=(e=(0,c.O0)(e)).length;for(let n=0;n<i;){let s=Math.min(t-this.pos,i-n);for(let t=0;t<s;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,n.$h)(this,!1),(0,n.gk)(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,n.k8)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,n.eB)(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||(e=new k(t,r,n,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}let A=(0,c.hE)(()=>new k(136,1,32));var O=r("../../node_modules/viem/_esm/utils/data/isHex.js"),C=r("../../node_modules/viem/_esm/utils/encoding/toBytes.js"),S=r("../../node_modules/viem/_esm/utils/encoding/toHex.js");function E(e,t){let r=A((0,O.v)(e,{strict:!1})?(0,C.O0)(e):e);return"bytes"===(t||"hex")?r:(0,S.NC)(r)}},"../../node_modules/viem/_esm/utils/hash/sha256.js":function(e,t,r){r.d(t,{J:()=>_});var n=r("../../node_modules/@noble/hashes/esm/_assert.js"),i=r("../../node_modules/@noble/hashes/esm/utils.js");class s extends i.kb{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.GL)(this.buffer)}update(e){(0,n.$h)(this);let{view:t,buffer:r,blockLen:s}=this,o=(e=(0,i.O0)(e)).length;for(let n=0;n<o;){let u=Math.min(s-this.pos,o-n);if(u===s){let t=(0,i.GL)(e);for(;s<=o-n;n+=s)this.process(t,n);continue}r.set(e.subarray(n,n+u),this.pos),this.pos+=u,n+=u,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.$h)(this),(0,n.eB)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:o}=this,{pos:u}=this;t[u++]=128,this.buffer.subarray(u).fill(0),this.padOffset>s-u&&(this.process(r,0),u=0);for(let e=u;e<s;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),s=BigInt(0xffffffff),o=Number(r>>i&s),u=Number(r&s),a=4*!!n,l=4*!n;e.setUint32(t+a,o,n),e.setUint32(t+l,u,n)}(r,s-8,BigInt(8*this.length),o),this.process(r,0);let a=(0,i.GL)(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=l/4,f=this.get();if(c>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)a.setUint32(4*e,f[e],o)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:o}=this;return e.length=n,e.pos=o,e.finished=i,e.destroyed=s,n%t&&e.buffer.set(r),e}}let o=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),u=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),a=new Uint32Array(64);class l extends s{constructor(){super(64,32,8,!1),this.A=0|u[0],this.B=0|u[1],this.C=0|u[2],this.D=0|u[3],this.E=0|u[4],this.F=0|u[5],this.G=0|u[6],this.H=0|u[7]}get(){let{A:e,B:t,C:r,D:n,E:i,F:s,G:o,H:u}=this;return[e,t,r,n,i,s,o,u]}set(e,t,r,n,i,s,o,u){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|s,this.G=0|o,this.H=0|u}process(e,t){for(let r=0;r<16;r++,t+=4)a[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=a[e-15],r=a[e-2],n=(0,i.np)(t,7)^(0,i.np)(t,18)^t>>>3,s=(0,i.np)(r,17)^(0,i.np)(r,19)^r>>>10;a[e]=s+a[e-7]+n+a[e-16]|0}let{A:r,B:n,C:s,D:u,E:l,F:c,G:f,H:h}=this;for(let e=0;e<64;e++){var d,_,p,b;let t=h+((0,i.np)(l,6)^(0,i.np)(l,11)^(0,i.np)(l,25))+((d=l)&c^~d&f)+o[e]+a[e]|0,m=((0,i.np)(r,2)^(0,i.np)(r,13)^(0,i.np)(r,22))+((_=r)&(p=n)^_&(b=s)^p&b)|0;h=f,f=c,c=l,l=u+t|0,u=s,s=n,n=r,r=t+m|0}r=r+this.A|0,n=n+this.B|0,s=s+this.C|0,u=u+this.D|0,l=l+this.E|0,c=c+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(r,n,s,u,l,c,f,h)}roundClean(){a.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}let c=(0,i.hE)(()=>new l);var f=r("../../node_modules/viem/_esm/utils/data/isHex.js"),h=r("../../node_modules/viem/_esm/utils/encoding/toBytes.js"),d=r("../../node_modules/viem/_esm/utils/encoding/toHex.js");function _(e,t){let r=c((0,f.v)(e,{strict:!1})?(0,h.O0)(e):e);return"bytes"===(t||"hex")?r:(0,d.NC)(r)}}};
@@ -0,0 +1 @@
1
+ /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
@@ -0,0 +1,13 @@
1
+ export const __webpack_ids__=["321"];export const __webpack_modules__={"./src/components/ButtonWallet/utils.ts":function(e,t,n){n.d(t,{G:()=>o});var r=n("../core/dist/actions.js");function o(){if(!window.FrakSetup?.client){console.error("Frak client not found");return}"vibrate"in navigator?navigator.vibrate(10):console.log("Vibration not supported"),(0,r.Hq)(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}},"./src/hooks/useClientReady.ts":function(e,t,n){n.d(t,{t:()=>a});var r=n("./src/utils/clientReady.ts"),o=n("../../node_modules/preact/hooks/dist/hooks.module.js");function a(){let[e,t]=(0,o.eJ)(!0),n=(0,o.I4)(()=>{t(!1)},[]);return(0,o.d4)(()=>((0,r.D)("add",n),()=>(0,r.D)("remove",n)),[n]),{isClientReady:!e}}},"./src/hooks/useReward.ts":function(e,t,n){n.d(t,{w:()=>s});var r=n("../core/dist/index.js"),o=n("../core/dist/actions.js");async function a({targetInteraction:e}){let t=window.FrakSetup?.client;if(!t){console.warn("Frak client not ready yet");return}let{maxReferrer:n,rewards:a}=await (0,o.pO)(t);if(!n)return;let i=(0,r.Up)(t.config.metadata?.currency),s=Math.ceil(n[i]);if(e){let t=a.filter(t=>t.interactionTypeKey===e).map(e=>e.referrer[i]).reduce((e,t)=>t>e?t:e,0);t>0&&(s=Math.ceil(t))}return(0,r.dN)(s,t.config.metadata?.currency)}var i=n("../../node_modules/preact/hooks/dist/hooks.module.js");function s(e,t){let[n,r]=(0,i.eJ)(void 0);return(0,i.d4)(()=>{e&&a({targetInteraction:t}).then(e=>{e&&r(e)})},[e,t]),{reward:n}}},"./src/utils/clientReady.ts":function(e,t,n){n.d(t,{D:()=>a,f:()=>o});let r="frakClientReady";function o(){let e=new CustomEvent(r);window.dispatchEvent(e)}function a(e,t){if(window.FrakSetup?.client&&"add"===e){t();return}("add"===e?window.addEventListener:window.removeEventListener)(r,t,!1)}},"./src/utils/registerWebComponent.ts":function(e,t,n){n.d(t,{A:()=>c});var r=n("../../node_modules/preact-custom-element/dist/preact-custom-element.esm.js"),o=n("../core/dist/index.js"),a=n("./src/components/ButtonWallet/utils.ts"),i=n("./src/utils/clientReady.ts"),s=n("./src/utils/setup.ts");async function l(){if(!(window.frakSetupInProgress?(console.log("[Frak SDK] Initialization already in progress"),!1):window.FrakSetup?.client?(console.log("[Frak SDK] Client already initialized"),!1):!!window.FrakSetup?.config||(console.error("[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set."),!1)))return;if(console.log("[Frak SDK] Starting initialization"),window.frakSetupInProgress=!0,!window.FrakSetup.config){console.error("[Frak SDK] Configuration not found"),window.frakSetupInProgress=!1;return}let e=await (0,o.lD)({config:window.FrakSetup.config});if(!e){console.error("[Frak SDK] Failed to create client"),window.frakSetupInProgress=!1;return}window.FrakSetup.client=e,console.log("[Frak SDK] Client initialized successfully"),(0,i.f)(),(0,s.N3)(e),(0,s.zK)(e),window.frakSetupInProgress=!1,function(){let e=new URLSearchParams(window.location.search).get("frakAction");e&&"share"===e&&(console.log("[Frak SDK] Auto open query param found"),(0,a.G)())}()}function c(e,t,n=[],o={shadow:!1}){if("undefined"!=typeof window){var a;a=async function(){await l()},"complete"===document.readyState||"interactive"===document.readyState?setTimeout(a,1):document.addEventListener?document.addEventListener("DOMContentLoaded",a):document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&a()}),customElements.get(t)||(0,r.Z)(e,t,n,o)}}},"./src/utils/setup.ts":function(e,t,n){n.d(t,{Gt:()=>i,N3:()=>o,zK:()=>a});var r=n("../core/dist/actions.js");function o(e){window.modalBuilderSteps=(0,r.jy)(e,window.FrakSetup?.modalConfig??{})}async function a(e){if(!window.modalBuilderSteps){console.error("modalBuilderSteps not found");return}console.log("referral",await (0,r.KS)(e,{modalConfig:window.modalBuilderSteps.reward().params}))}function i(){if(!window.modalBuilderSteps)throw Error("modalBuilderSteps not found");return window.modalBuilderSteps}},"../core/dist/actions.js":function(e,t,n){n.d(t,{Hq:()=>u,KS:()=>E,jy:()=>w,pO:()=>f});var r=n("../../node_modules/viem/_esm/utils/hash/keccak256.js"),o=n("../../node_modules/viem/_esm/utils/encoding/toHex.js"),a=n("../../node_modules/viem/_esm/utils/encoding/toBytes.js"),i=n("../../node_modules/viem/_esm/utils/data/concat.js"),s=n("../../node_modules/viem/_esm/utils/data/pad.js"),l=n("../../node_modules/viem/_esm/utils/address/isAddressEqual.js");async function c(e,{productId:t,interaction:n,validation:a}){let i=t??function({domain:e}){let t=e??window.location.host;return(0,r.w)((0,o.NC)(t))}(e.config);return await e.request({method:"frak_sendInteraction",params:[i,n,a]})}async function d(e,{steps:t,metadata:n}){return await e.request({method:"frak_displayModal",params:[t,n,e.config.metadata]})}async function u(e,t){await e.request({method:"frak_displayEmbededWallet",params:[t,e.config.metadata]})}async function f(e){return await e.request({method:"frak_getProductInformation"})}function w(e,{metadata:t,login:n,openSession:r}){return function e(t,n){async function r(e){return e&&(n.metadata=e(n.metadata??{})),await d(t,n)}return{params:n,sendTx:function(r){return e(t,{...n,steps:{...n.steps,sendTransaction:r}})},reward:function(r){return e(t,{...n,steps:{...n.steps,final:{...r,action:{key:"reward"}}}})},sharing:function(r,o){return e(t,{...n,steps:{...n.steps,final:{...o,action:{key:"sharing",options:r}}}})},display:r}}(e,{steps:{login:n??{},openSession:r??{}},metadata:t})}let m="fCtx";function p({url:e}){if(!e)return null;let t=new URL(e).searchParams.get(m);return t?function(e){if(e&&0!==e.length)try{let t;let n=(t=e.length%4,Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(0===t?0:4-t),"=")),e=>e.charCodeAt(0)));return{r:(0,o.ci)(n,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}(t):null}let g={parse:p,replaceUrl:function({url:e,context:t}){let n,r;if(!window.location?.href||"undefined"==typeof window){console.error("No window found, can't update context");return}let o=e??window.location.href;(n=null!==t?function({url:e,context:t}){if(!e)return null;let n=p({url:e}),r=n?{...n,...t}:t;if(!r.r)return null;let o=function(e){if(e?.r)try{var t;return t=(0,a.nr)(e.r),btoa(Array.from(t,e=>String.fromCharCode(e)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}(r);if(!o)return null;let i=new URL(e);return i.searchParams.set(m,o),i.toString()}({url:o,context:t}):((r=new URL(o)).searchParams.delete(m),r.toString()))&&window.history.replaceState(null,"",n.toString())}},h={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31};Object.entries(h).reduce((e,[t,n])=>(e[t]=BigInt(1)<<BigInt(n),e),{});let y={createLink:()=>({handlerTypeDenominator:(0,o.NC)(h.referral),interactionData:"0xb2c0f17c"}),referred({referrer:e}){let t=(0,i.SM)(["0x010cc3b9",(0,s.vk)(e,{size:32})]);return{handlerTypeDenominator:(0,o.NC)(h.referral),interactionData:t}}};class v extends Error{code;data;constructor(e,t,n){super(t),this.code=e,this.data=n}}let S={walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006};async function k(e,{walletStatus:t,frakContext:n,modalConfig:r,productId:o,options:a}){let i=!1;async function s(){if(!i)return i=!0,C(e,{modalConfig:r,walletStatus:t})}async function l(t){let n=y.referred({referrer:t});await c(e,{productId:o,interaction:n})}try{let{status:e,currentWallet:r}=await b({initialWalletStatus:t,getFreshWalletStatus:s,pushReferralInteraction:l,frakContext:n});return g.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:r}:null}),e}catch(e){return console.log("Error processing referral",{error:e}),g.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:t?.wallet}:null}),function(e){if(e instanceof v)switch(e.code){case S.walletNotConnected:return"no-wallet";case S.serverErrorForInteractionDelegation:return"no-session"}return"error"}(e)}}async function b({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:n,frakContext:r}){let o=e?.wallet;return r?.r?(o||(o=await t()),o&&(0,l.E)(r.r,o))?{status:"self-referral",currentWallet:o}:(e?.interactionSession||(o=await t()),await n(r.r),{status:"success",currentWallet:o}):{status:"no-referrer",currentWallet:o}}async function C(e,{modalConfig:t,walletStatus:n}){if(!n?.interactionSession){if(!t)return;let n=await d(e,t);return n?.login?.wallet??void 0}return n.wallet??void 0}async function E(e,{productId:t,modalConfig:n,options:r}={}){var o;let a=g.parse({url:window.location.href}),i=await e.request({method:"frak_listenToWalletStatus"}).then(e=>{var t;return t=e.interactionToken,"undefined"!=typeof window&&(t?window.sessionStorage.setItem("frak-wallet-interaction-token",t):window.sessionStorage.removeItem("frak.interaction-token")),e});try{return await k(e,{walletStatus:i,frakContext:a,modalConfig:n,productId:t,options:r})}catch(e){console.warn("Error processing referral",{error:e})}}},"../core/dist/index.js":function(e,t,n){n.d(t,{Up:()=>b,dN:()=>C,lD:()=>k,oC:()=>l,ss:()=>s,u:()=>a});var r=n("../../node_modules/@jsonjoy.com/json-pack/lib/cbor/index.js"),o=n("../../node_modules/viem/_esm/utils/hash/sha256.js");class a extends Error{code;data;constructor(e,t,n){super(t),this.code=e,this.data=n}}class i extends a{constructor(e){super(s.internalError,e)}}let s={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:-32e3,clientNotConnected:-32001,configError:-32002,corruptedResponse:-32003,clientAborted:-32004,walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006};class l{config;iframe;isSetupDone=!1;lastResponse=null;lastRequest=null;constructor(e,t){this.config=e,this.iframe=t,this.lastRequest=null,this.lastResponse=null}setLastResponse(e){this.lastResponse={event:e.data,origin:e.origin,timestamp:Date.now()}}setLastRequest(e,t){this.lastRequest={event:e,target:t,timestamp:Date.now()}}updateSetupStatus(e){this.isSetupDone=e}base64Encode(e){try{return btoa(JSON.stringify(e))}catch(e){return console.warn("Failed to encode debug data",e),btoa("Failed to encode data")}}getIframeStatus(){return this.iframe?{loading:this.iframe.hasAttribute("loading"),url:this.iframe.src,readyState:this.iframe.contentDocument?.readyState?+("complete"===this.iframe.contentDocument.readyState):-1,contentWindow:!!this.iframe.contentWindow,isConnected:this.iframe.isConnected}:null}getNavigatorInfo(){return navigator?{userAgent:navigator.userAgent,language:navigator.language,onLine:navigator.onLine,screenWidth:window.screen.width,screenHeight:window.screen.height,pixelRatio:window.devicePixelRatio}:null}gatherDebugInfo(e){let t=this.getIframeStatus(),n=this.getNavigatorInfo(),r="Unknown";return e instanceof a?r=`FrakRpcError: ${e.code} '${e.message}'`:e instanceof Error?r=e.message:"string"==typeof e&&(r=e),{timestamp:new Date().toISOString(),encodedUrl:btoa(window.location.href),encodedConfig:this.config?this.base64Encode(this.config):"no-config",navigatorInfo:n?this.base64Encode(n):"no-navigator",iframeStatus:t?this.base64Encode(t):"not-iframe",lastRequest:this.lastRequest?this.base64Encode(this.lastRequest):"No Frak request logged",lastResponse:this.lastResponse?this.base64Encode(this.lastResponse):"No Frak response logged",clientStatus:this.isSetupDone?"setup":"not-setup",error:r}}static empty(){return new l}formatDebugInfo(e){let t=this.gatherDebugInfo(e);return`
2
+ Debug Information:
3
+ -----------------
4
+ Timestamp: ${t.timestamp}
5
+ URL: ${t.encodedUrl}
6
+ Config: ${t.encodedConfig}
7
+ Navigator Info: ${t.navigatorInfo}
8
+ IFrame Status: ${t.iframeStatus}
9
+ Last Request: ${t.lastRequest}
10
+ Last Response: ${t.lastResponse}
11
+ Client Status: ${t.clientStatus}
12
+ Error: ${t.error}
13
+ `.trim()}}class c{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve=e=>{this._resolve?.(e)};reject=e=>{this._reject?.(e)}}let d=new r.CborEncoder;function u(e){let t={...e,validationHash:f(e)};return d.encode(t)}function f(e){return(0,o.J)(d.encode(e))}let w=new r.CborDecoder;function m(e){if(!e.length)throw new a(s.corruptedResponse,"Missing compressed data");let t=function(e){try{return w.decode(e)}catch(t){return console.error("Invalid compressed data",{e:t,data:e}),null}}(e);if(!t)throw new a(s.corruptedResponse,"Invalid compressed data");if(!t?.validationHash)throw new a(s.corruptedResponse,"Missing validation hash");let{validationHash:n,...r}=t;if(f(r)!==t.validationHash)throw new a(s.corruptedResponse,"Invalid data validation hash");return t}let p="nexus-wallet-backup",g=2000001;function h({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}async function y({config:e,messageHandler:t,lifecycleManager:n}){async function r(){let n=e.customizations?.css;n&&t.sendEvent({clientLifecycle:"modal-css",data:{cssLink:n}})}async function o(){let n=e.customizations?.i18n;n&&t.sendEvent({clientLifecycle:"modal-i18n",data:{i18n:n}})}async function a(){if("undefined"==typeof window)return;let e=window.localStorage.getItem(p);e&&t.sendEvent({clientLifecycle:"restore-backup",data:{backup:e}})}await n.isConnected,await Promise.all([r(),o(),a()])}let v={eur:"fr-FR",usd:"en-US",gbp:"en-GB"};function S(e){return e&&e in v?e:"eur"}async function k({config:e}){let t;let n=(t=S(e.metadata?.currency),{...e,metadata:{...e.metadata,currency:t}}),r=await function({walletBaseUrl:e,config:t}){let n=document.querySelector("#frak-wallet");n&&n.remove();let r=document.createElement("iframe");return r.id="frak-wallet",r.name="frak-wallet",r.allow="publickey-credentials-get *; clipboard-write; web-share *",r.style.zIndex=g.toString(),h({iframe:r,isVisible:!1}),document.body.appendChild(r),new Promise(n=>{r?.addEventListener("load",()=>n(r)),r.src=`${t?.walletUrl??e??"https://wallet.frak.id"}/listener`})}({config:n});if(!r){console.error("Failed to create iframe");return}let o=function({config:e,iframe:t}){let n;let r=(n=new Map,{createChannel:e=>{let t=Math.random().toString(36).substring(7);return n.set(t,e),t},getRpcResolver:e=>n.get(e),removeChannel:e=>n.delete(e),destroy:()=>n.clear()}),o=function({iframe:e}){let t=new c;return{handleEvent:async n=>{switch(n.iframeLifecycle){case"connected":t.resolve(!0);break;case"do-backup":n.data.backup?localStorage.setItem(p,n.data.backup):localStorage.removeItem(p);break;case"remove-backup":localStorage.removeItem(p);break;case"show":case"hide":h({iframe:e,isVisible:"show"===n.iframeLifecycle});break;case"handshake":e.contentWindow?.postMessage({clientLifecycle:"handshake-response",data:{token:n.data.token,currentUrl:window.location.href}},"*")}},isConnected:t.promise}}({iframe:t}),d=new l(e,t),f=function({frakWalletUrl:e,iframe:t,channelManager:n,iframeLifecycleManager:r,debugInfo:o}){if("undefined"==typeof window)throw new a(s.configError,"iframe client should be used in the browser");if(!t.contentWindow)throw new a(s.configError,"The iframe does not have a product window");let i=t.contentWindow;async function l(t){if(!t.origin)return;try{if(new URL(t.origin).origin.toLowerCase()!==new URL(e).origin.toLowerCase())return}catch(e){console.log("Unable to check frak msg origin",e);return}if("object"!=typeof t.data)return;if(o.setLastResponse(t),"iframeLifecycle"in t.data){await r.handleEvent(t.data);return}if("clientLifecycle"in t.data){console.error("Client lifecycle event received on the client side, dismissing it");return}let a=t.data.id,i=n.getRpcResolver(a);i&&i(t.data)}return window.addEventListener("message",l),{sendEvent:function(t){i.postMessage(t,{targetOrigin:e}),o.setLastRequest(t,e)},cleanup:function(){window.removeEventListener("message",l)}}}({frakWalletUrl:e?.walletUrl??"https://wallet.frak.id",iframe:t,channelManager:r,iframeLifecycleManager:o,debugInfo:d}),w=async e=>{if(!await o.isConnected)throw new a(s.clientNotConnected,"The iframe provider isn't connected yet");let t=new c,n=r.createChannel(e=>{let o=m(e.data);o.error?t.reject(new a(o.error.code,o.error.message,o.error?.data)):t.resolve(o.result),r.removeChannel(n)}),i=u(e);return f.sendEvent({id:n,topic:e.method,data:i}),t.promise},g=async(e,t)=>{if(!await o.isConnected)throw new a(s.clientNotConnected,"The iframe provider isn't connected yet");let n=r.createChannel(e=>{let n=m(e.data);if(n.result)t(n.result);else throw new i("No valid result in the response")}),l=u(e);f.sendEvent({id:n,topic:e.method,data:l})},v=function(e,t){let n,r;let o=()=>e.sendEvent({clientLifecycle:"heartbeat"});function a(){n&&clearInterval(n),r&&clearTimeout(r)}return async function(){o(),n=setInterval(o,100),r=setTimeout(()=>{a(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,a()}(),a}(f,o),S=async()=>{v(),r.destroy(),f.cleanup(),t.remove()},k=y({config:e,messageHandler:f,lifecycleManager:o}).then(()=>d.updateSetupStatus(!0));return{config:e,debugInfo:d,waitForConnection:o.isConnected,waitForSetup:k,request:w,listenerRequest:g,destroy:S}}({config:n,iframe:r});if(await o.waitForSetup,!await o.waitForConnection){console.error("Failed to connect to client");return}return o}function b(e){return e?`${e}Amount`:"eurAmount"}function C(e,t){let n=t?v[t]??v.eur:v.eur,r=S(t);return e.toLocaleString(n,{style:"currency",currency:r,minimumFractionDigits:0,maximumFractionDigits:2})}Object.entries({dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31}).reduce((e,[t,n])=>(e[t]=BigInt(1)<<BigInt(n),e),{})}};
@@ -0,0 +1 @@
1
+ export const __webpack_ids__=["766"];export const __webpack_modules__={"./src/components/ButtonShare/index.ts":function(e,t,o){o.r(t),o.d(t,{ButtonShare:()=>S});var n=o("./src/utils/registerWebComponent.ts"),r=o("../../node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js"),a=o("../../node_modules/class-variance-authority/dist/index.mjs");let i="spinner__leaf-xtOJmT",s=({ref:e,className:t,...o})=>(0,r.BX)("span",{...o,ref:e,className:(0,a.cx)("spinner-KHk8mw"),children:[(0,r.tZ)("span",{className:i}),(0,r.tZ)("span",{className:i}),(0,r.tZ)("span",{className:i}),(0,r.tZ)("span",{className:i}),(0,r.tZ)("span",{className:i}),(0,r.tZ)("span",{className:i}),(0,r.tZ)("span",{className:i}),(0,r.tZ)("span",{className:i})]});s.displayName="Spinner";var l=o("./src/hooks/useClientReady.ts"),c=o("./src/hooks/useReward.ts"),d=o("../core/dist/actions.js"),p=o("../../node_modules/preact/hooks/dist/hooks.module.js");let u={marginTop:"16px",padding:"16px",backgroundColor:"#FEE2E2",border:"1px solid #FCA5A5",borderRadius:"4px",color:"#991B1B"},m={display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},f={margin:0,fontSize:"16px",fontWeight:500},h={fontSize:"14px",lineHeight:"1.5",margin:"0 0 12px 0"},x={color:"#991B1B",textDecoration:"underline",textUnderlineOffset:"2px"},b={display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"10px",padding:"8px 12px",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"4px",color:"black",fontSize:"14px",fontWeight:500};function y({debugInfo:e}){let[t,o]=(0,p.eJ)(!1);return(0,r.BX)("div",{children:[(0,r.tZ)("button",{type:"button",style:b,onClick:()=>o(!t),children:"Ouvrir les informations"}),t&&(0,r.tZ)("textarea",{style:{display:"block",width:"100%",height:"200px",fontSize:"12px"},children:e})]})}function g({debugInfo:e}){let{copied:t,copy:o}=function(e={}){let{successDuration:t=2e3}=e,[o,n]=(0,p.eJ)(!1);return{copy:(0,p.I4)(async e=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e),n(!0);else{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),n(!0)}catch(e){return console.error("Failed to copy text:",e),!1}finally{t.remove()}}return setTimeout(()=>{n(!1)},t),!0}catch(e){return console.error("Failed to copy text:",e),!1}},[t]),copied:o}}();return(0,r.BX)("div",{style:u,children:[(0,r.tZ)("div",{style:m,children:(0,r.tZ)("h3",{style:f,children:"Oups ! Nous avons rencontr\xe9 un petit probl\xe8me"})}),(0,r.BX)("p",{style:h,children:["Impossible d'ouvrir le menu de partage pour le moment. Si le probl\xe8me persiste, copiez les informations ci-dessous et collez-les dans votre mail \xe0"," ",(0,r.tZ)("a",{href:"mailto:help@frak-labs.com?subject=Debug",style:x,children:"help@frak-labs.com"})," ",(0,r.tZ)("br",{}),"Merci pour votre retour, nous traitons votre demande dans les plus brefs d\xe9lais."]}),(0,r.tZ)("button",{type:"button",onClick:()=>o(e??""),style:b,children:t?"Informations copi\xe9es !":"Copier les informations de d\xe9bogage"}),(0,r.tZ)(y,{debugInfo:e})]})}var w=o("./src/utils/setup.ts"),k=o("../core/dist/index.js");async function v(){if(!window.FrakSetup?.client)throw Error("Frak client not found");await (0,d.Hq)(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function S({text:e="Share and earn!",classname:t="",useReward:o,noRewardText:n,targetInteraction:i,showWallet:d}){let u=(0,p.Ye)(()=>void 0!==o,[o]),m=(0,p.Ye)(()=>void 0!==d,[d]),{isClientReady:f}=(0,l.t)(),{reward:h}=(0,c.w)(u&&f,i),{handleShare:x,isError:b,debugInfo:y}=function(e){let[t,o]=(0,p.eJ)(void 0),[n,r]=(0,p.eJ)(!1);return{handleShare:(0,p.I4)(async()=>{if(!window.FrakSetup?.client){console.error("Frak client not found"),o(k.oC.empty().formatDebugInfo("Frak client not found")),r(!0);return}let t=(0,w.Gt)();if(!t)throw Error("modalBuilderSteps not found");try{await t.sharing(window.FrakSetup?.modalShareConfig??{}).display(t=>({...t,targetInteraction:e}))}catch(e){if(e instanceof k.u&&e.code===k.ss.clientAborted){console.debug("User aborted the modal");return}o(window.FrakSetup.client.debugInfo.formatDebugInfo(e)),r(!0),console.error("Error while opening the modal",e)}},[e]),isError:n,debugInfo:t}}(i),S=(0,p.Ye)(()=>u?h?e.includes("{REWARD}")?e.replace("{REWARD}",h):`${e} ${h}`:n??e.replace("{REWARD}",""):e,[u,e,n,h]),Z=(0,p.I4)(async()=>await (m?v():x()),[m,x]);return(0,r.BX)(r.HY,{children:[(0,r.BX)("button",{type:"button",className:(0,a.cx)("buttonShare-F23Y9m",t,"override"),onClick:Z,children:[!f&&(0,r.tZ)(s,{})," ",S]}),b&&(0,r.tZ)(g,{debugInfo:y})]})}(0,n.A)(S,"frak-button-share",["text"],{shadow:!1})}};
@@ -0,0 +1 @@
1
+ export const __webpack_ids__=["438"];export const __webpack_modules__={"./src/components/ButtonWallet/index.ts":function(e,t,n){n.r(t),n.d(t,{ButtonWallet:()=>N});var o=n("./src/utils/registerWebComponent.ts"),r=n("../../node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js"),_=n("./src/hooks/useClientReady.ts"),l=n("./src/hooks/useReward.ts"),i=n("../../node_modules/class-variance-authority/dist/index.mjs"),a=n("../../node_modules/preact/hooks/dist/hooks.module.js");let u={button:"button-aPZnsb",button__left:"button__left-fQJUnK",button__right:"button__right-TkFFFK",reward:"reward-w5dm3K"};var s=n("../../node_modules/preact/dist/preact.module.js");function c(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function f(e,t){this.props=e,this.context=t}(f.prototype=new s.wA).isPureReactComponent=!0,f.prototype.shouldComponentUpdate=function(e,t){return c(this.props,e)||c(this.state,t)};var p=s.YM.__b;s.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),p&&p(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var d=s.YM.__e;s.YM.__e=function(e,t,n,o){if(e.then){for(var r,_=t;_=_.__;)if((r=_.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}d(e,t,n,o)};var v=s.YM.unmount;function h(){this.__u=0,this.o=null,this.__b=null}function m(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function b(){this.i=null,this.l=null}s.YM.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),v&&v(e)},(h.prototype=new s.wA).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=m(o.__v),_=!1,l=function(){_||(_=!0,n.__R=null,r?r(i):i())};n.__R=l;var i=function(){if(!--o.__u){if(o.state.__a){var e,t=o.state.__a;o.__v.__k[0]=function e(t,n,o){return t&&o&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)}),t.__c&&t.__c.__P===n&&(t.__e&&o.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=o)),t}(t,t.__c.__P,t.__c.__O)}for(o.setState({__a:o.__b=null});e=o.o.pop();)e.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(l,l)},h.prototype.componentWillUnmount=function(){this.o=[]},h.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,o){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=function(e,t){for(var n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===o&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)})),t}(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&(0,s.az)(s.HY,null,e.fallback);return r&&(r.__u&=-33),[(0,s.az)(s.HY,null,t.__a?null:e.children),r]};var y=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(b.prototype=new s.wA).__a=function(e){var t=this,n=m(t.__v),o=t.l.get(e);return o[0]++,function(r){var _=function(){t.props.revealOrder?(o.push(r),y(t,e,o)):r()};n?n(_):_()}},b.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,s.bR)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},b.prototype.componentDidUpdate=b.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){y(e,n,t)})};var w="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,k=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,g=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,M=/[A-Z0-9]/g,x="undefined"!=typeof document;s.wA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(s.wA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Y=s.YM.event;function P(){}function R(){return this.cancelBubble}function S(){return this.defaultPrevented}s.YM.event=function(e){return Y&&(e=Y(e)),e.persist=P,e.isPropagationStopped=R,e.isDefaultPrevented=S,e.nativeEvent=e};var C={enumerable:!1,configurable:!0,get:function(){return this.class}},O=s.YM.vnode;s.YM.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},r=-1===n.indexOf("-");for(var _ in t){var l=t[_];if(!("value"===_&&"defaultValue"in t&&null==l||x&&"children"===_&&"noscript"===n||"class"===_||"className"===_)){var i,a=_.toLowerCase();"defaultValue"===_&&"value"in t&&null==t.value?_="value":"download"===_&&!0===l?l="":"translate"===a&&"no"===l?l=!1:"o"===a[0]&&"n"===a[1]?"ondoubleclick"===a?_="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||(i=t.type,("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(i))?"onfocus"===a?_="onfocusin":"onblur"===a?_="onfocusout":g.test(_)&&(_=a):a=_="oninput":r&&k.test(_)?_=_.replace(M,"-$&").toLowerCase():null===l&&(l=void 0),"oninput"===a&&o[_=a]&&(_="oninputCapture"),o[_]=l}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,s.bR)(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==n&&null!=o.defaultValue&&(o.value=(0,s.bR)(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value})),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",C)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=w,O&&O(e)};var A=s.YM.__r;s.YM.__r=function(e){A&&A(e),e.__c};var j=s.YM.diffed;s.YM.diffed=function(e){j&&j(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};let W=e=>(0,r.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 28 28",...e,children:(0,r.tZ)("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M23.143 14v11.428H4.857V14M14 25.428V8.286m0 0H8.857a2.857 2.857 0 0 1 0-5.715c4 0 5.143 5.715 5.143 5.715m0 0h5.143a2.857 2.857 0 1 0 0-5.715c-4 0-5.143 5.715-5.143 5.715m-11.429 0h22.857V14H2.571z"})});var H=n("./src/components/ButtonWallet/utils.ts");function N({classname:e="",useReward:t,targetInteraction:n}){let o=(0,a.Ye)(()=>void 0!==t,[t]),{isClientReady:s}=(0,_.t)(),{reward:c}=(0,l.w)(o&&s,n),[f,p]=(0,a.eJ)("right");return(0,a.d4)(()=>{p(window.FrakSetup?.modalWalletConfig?.metadata?.position??"right")},[]),(0,r.BX)("button",{type:"button",class:(0,i.cx)(u.button,"left"===f?u.button__left:u.button__right,e,"override"),disabled:!s,onClick:H.G,children:[(0,r.tZ)(W,{}),c&&(0,r.tZ)("span",{className:u.reward,children:c})]})}(0,o.A)(N,"frak-button-wallet",[],{shadow:!1})}};
@@ -0,0 +1 @@
1
+ .button-aPZnsb{all:unset;z-index:2000000;cursor:pointer;text-align:center;background-color:#3e557e;border-radius:50%;justify-content:center;align-items:center;width:45px;height:45px;font-size:24px;display:flex;position:fixed;bottom:20px}.button__left-fQJUnK{left:20px}.button__right-TkFFFK{right:20px}.reward-w5dm3K{color:#fff;white-space:nowrap;background:#ff3f3f;border-radius:5px;padding:2px 3px;font-size:9px;font-weight:600;line-height:9px;position:absolute;top:-4px;right:27px}
package/cdn/loader.js CHANGED
@@ -1 +1 @@
1
- var e,t,r={},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e].call(i.exports,i,i.exports,o),i.exports}o.m=r,o.d=function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=function(e){return Promise.all(Object.keys(o.f).reduce(function(t,r){return o.f[r](e,t),t},[]))},o.u=function(e){return""+(({438:"button-wallet",766:"button-share"})[e]||e)+".js"},o.miniCssF=function(e){return""+({438:"button-wallet",766:"button-share"})[e]+".css"},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{if("undefined"!=typeof document){var e=function(e,t,r,n,i){var a=document.createElement("link");return a.rel="stylesheet",a.type="text/css",o.nc&&(a.nonce=o.nc),a.onerror=a.onload=function(r){if(a.onerror=a.onload=null,"load"===r.type)n();else{var o=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.href||t,s=Error("Loading CSS chunk "+e+" failed.\\n("+u+")");s.code="CSS_CHUNK_LOAD_FAILED",s.type=o,s.request=u,a.parentNode&&a.parentNode.removeChild(a),i(s)}},a.href=t,r?r.parentNode.insertBefore(a,r.nextSibling):document.head.appendChild(a),a},t=function(e,t){for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var o=r[n],i=o.getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(i===e||i===t))return o}for(var a=document.getElementsByTagName("style"),n=0;n<a.length;n++){var o=a[n],i=o.getAttribute("data-href");if(i===e||i===t)return o}},r={276:0};o.f.miniCss=function(n,i){if(r[n])i.push(r[n]);else if(0!==r[n]&&({438:1,766:1})[n])i.push(r[n]=new Promise(function(r,i){var a=o.miniCssF(n),u=o.p+a;if(t(a,u))return r();e(n,u,null,r,i)}).then(function(){r[n]=0},function(e){throw delete r[n],e}))}}})(),e={276:0},t=function(t){var r,n,i=t.ids,a=t.modules,u=t.runtime,s=0;for(r in a)o.o(a,r)&&(o.m[r]=a[r]);for(u&&u(o);s<i.length;s++)n=i[s],o.o(e,n)&&e[n]&&e[n][0](),e[i[s]]=0},o.f.j=function(r,n){var i=o.o(e,r)?e[r]:void 0;if(0!==i){if(i)n.push(i[1]);else{var a=import("./"+o.u(r)).then(t,function(t){throw 0!==e[r]&&(e[r]=void 0),t}),a=Promise.race([a,new Promise(function(t){i=e[r]=[t]})]);n.push(i[1]=a)}}};const i={"button-share":()=>Promise.all([o.e("413"),o.e("364"),o.e("766")]).then(o.bind(o,"./src/components/ButtonShare/index.ts")),"button-wallet":()=>Promise.all([o.e("413"),o.e("364"),o.e("438")]).then(o.bind(o,"./src/components/ButtonWallet/index.ts"))},a=new MutationObserver(e=>{for(let{addedNodes:t}of e)for(let e of Array.from(t))e.nodeType===Node.ELEMENT_NODE&&u(e)});async function u(e){let t=e instanceof Element?e.tagName.toLowerCase():"",r=t?.startsWith("frak-"),n=Array.from(e.querySelectorAll(":not(:defined)")).map(e=>e.tagName.toLowerCase()).filter(e=>e.startsWith("frak-"));r&&!customElements.get(t)&&n.push(t);let o=[...new Set(n)];await Promise.allSettled(o.map(e=>s(e)))}async function s(e){if(customElements.get(e))return Promise.resolve();try{let t=e.replace(/^frak-/i,"");if(!(t in i))throw Error(`Component ${e} is not supported.`);await i[t]()}catch(e){console.error(e)}}u(document.body),a.observe(document.documentElement,{subtree:!0,childList:!0});
1
+ var e,t,r={},o={};function n(e){var t=o[e];if(void 0!==t)return t.exports;var a=o[e]={exports:{}};return r[e](a,a.exports,n),a.exports}n.m=r,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((t,r)=>(n.f[r](e,t),t),[])),n.u=e=>""+(({438:"button-wallet",766:"button-share"})[e]||e)+"."+({18:"d4c5a860",321:"81d2f76e",438:"0eda9064",766:"a805bee0"})[e]+".js",n.miniCssF=e=>""+({438:"button-wallet",766:"button-share"})[e]+"."+({438:"390d543a",766:"823884d0"})[e]+".css",n.h=()=>"176ce519aa4a9850",(()=>{n.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})()})(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;if("string"==typeof import.meta.url&&(e=import.meta.url),!e)throw Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{if("undefined"!=typeof document){var e=function(e,t,r,o,a){var i=document.createElement("link");return i.rel="stylesheet",i.type="text/css",n.nc&&(i.nonce=n.nc),i.onerror=i.onload=function(r){if(i.onerror=i.onload=null,"load"===r.type)o();else{var n=r&&("load"===r.type?"missing":r.type),s=r&&r.target&&r.target.href||t,l=Error("Loading CSS chunk "+e+" failed.\\n("+s+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=n,l.request=s,i.parentNode&&i.parentNode.removeChild(i),a(l)}},i.href=t,r?r.parentNode.insertBefore(i,r.nextSibling):document.head.appendChild(i),i},t=function(e,t){for(var r=document.getElementsByTagName("link"),o=0;o<r.length;o++){var n=r[o],a=n.getAttribute("data-href")||n.getAttribute("href");if("stylesheet"===n.rel&&(a===e||a===t))return n}for(var i=document.getElementsByTagName("style"),o=0;o<i.length;o++){var n=i[o],a=n.getAttribute("data-href");if(a===e||a===t)return n}},r={276:0};n.f.miniCss=function(o,a){if(r[o])a.push(r[o]);else if(0!==r[o]&&({438:1,766:1})[o])a.push(r[o]=new Promise(function(r,a){var i=n.miniCssF(o),s=n.p+i;if(t(i,s))return r();e(o,s,null,r,a)}).then(function(){r[o]=0},function(e){throw delete r[o],e}))}}})(),e={276:0},t=t=>{var r,o,a=t.__webpack_ids__,i=t.__webpack_modules__,s=t.__webpack_runtime__,l=0;for(r in i)n.o(i,r)&&(n.m[r]=i[r]);for(s&&s(n);l<a.length;l++)o=a[l],n.o(e,o)&&e[o]&&e[o][0](),e[a[l]]=0},n.f.j=function(r,o){var a=n.o(e,r)?e[r]:void 0;if(0!==a){if(a)o.push(a[1]);else{var i=import("./"+n.u(r)).then(t,t=>{throw 0!==e[r]&&(e[r]=void 0),t}),i=Promise.race([i,new Promise(t=>{a=e[r]=[t]})]);o.push(a[1]=i)}}};const a={"button-share":()=>Promise.all([n.e("18"),n.e("321"),n.e("766")]).then(n.bind(n,"./src/components/ButtonShare/index.ts")),"button-wallet":()=>Promise.all([n.e("18"),n.e("321"),n.e("438")]).then(n.bind(n,"./src/components/ButtonWallet/index.ts"))},i=new MutationObserver(e=>{for(let{addedNodes:t}of e)for(let e of Array.from(t))e.nodeType===Node.ELEMENT_NODE&&s(e)});async function s(e){let t=e instanceof Element?e.tagName.toLowerCase():"",r=t?.startsWith("frak-"),o=Array.from(e.querySelectorAll(":not(:defined)")).map(e=>e.tagName.toLowerCase()).filter(e=>e.startsWith("frak-"));r&&!customElements.get(t)&&o.push(t);let n=[...new Set(o)];await Promise.allSettled(n.map(e=>l(e)))}async function l(e){if(customElements.get(e))return Promise.resolve();try{let t=e.replace(/^frak-/i,"");if(!(t in a))throw Error(`Component ${e} is not supported.`);await a[t]()}catch(e){console.error(e)}}s(document.body),i.observe(document.documentElement,{subtree:!0,childList:!0});
@@ -1 +1 @@
1
- import*as e from"preact-custom-element";import*as t from"@frak-labs/core-sdk";import*as n from"@frak-labs/core-sdk/actions";import*as r from"preact/jsx-runtime";import*as o from"preact/hooks";let a="frakClientReady";function i(e,t){if(window.FrakSetup?.client&&"add"===e){t();return}("add"===e?window.addEventListener:window.removeEventListener)(a,t,!1)}async function s(e){if(!window.modalBuilderSteps){console.error("modalBuilderSteps not found");return}console.log("referral",await (0,n.referralInteraction)(e,{modalConfig:window.modalBuilderSteps.reward().params}))}async function l(){if(!(window.frakSetupInProgress?(console.log("[Frak SDK] Initialization already in progress"),!1):window.FrakSetup?.client?(console.log("[Frak SDK] Client already initialized"),!1):!!window.FrakSetup?.config||(console.error("[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set."),!1)))return;console.log("[Frak SDK] Starting initialization"),window.frakSetupInProgress=!0;let e=await (0,t.setupClient)({config:{...window.FrakSetup.config,metadata:{name:"Frak SDK"}}});if(!e){console.error("[Frak SDK] Failed to create client"),window.frakSetupInProgress=!1;return}window.FrakSetup.client=e,console.log("[Frak SDK] Client initialized successfully"),function(){let e=new CustomEvent(a);window.dispatchEvent(e)}(),window.modalBuilderSteps=(0,n.modalBuilder)(e,window.FrakSetup?.modalConfig??{}),s(e),window.frakSetupInProgress=!1}let d=function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=function e(t){var n,r,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t){if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(r=e(t[n]))&&(o&&(o+=" "),o+=r)}else for(r in t)t[r]&&(o&&(o+=" "),o+=r)}return o}(e))&&(r&&(r+=" "),r+=t);return r},c="spinner__leaf-xtOJmT",u=({ref:e,className:t,...n})=>(0,r.jsxs)("span",{...n,ref:e,className:d("spinner-KHk8mw"),children:[(0,r.jsx)("span",{className:c}),(0,r.jsx)("span",{className:c}),(0,r.jsx)("span",{className:c}),(0,r.jsx)("span",{className:c}),(0,r.jsx)("span",{className:c}),(0,r.jsx)("span",{className:c}),(0,r.jsx)("span",{className:c}),(0,r.jsx)("span",{className:c})]});async function p(e){let t=window.FrakSetup?.client;if(!t){console.warn("Frak client not ready yet");return}let r=await (0,n.getProductInformation)(t);if(!r?.estimatedEurReward)return;let o=r.estimatedEurReward;if(e){let t=r.rewards.filter(t=>t.interactionTypeKey===e).map(e=>e.referrer.eurAmount).reduce((e,t)=>t>e?t:e,0);t>0&&(o=Math.ceil(t).toString())}return o}u.displayName="Spinner";let f={marginTop:"16px",padding:"16px",backgroundColor:"#FEE2E2",border:"1px solid #FCA5A5",borderRadius:"4px",color:"#991B1B"},m={display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},w={margin:0,fontSize:"16px",fontWeight:500},g={fontSize:"14px",lineHeight:"1.5",margin:"0 0 12px 0"},x={color:"#991B1B",textDecoration:"underline",textUnderlineOffset:"2px"},y={display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"10px",padding:"8px 12px",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"4px",color:"black",fontSize:"14px",fontWeight:500};function S({debugInfo:e}){let[t,n]=(0,o.useState)(!1);return(0,r.jsxs)("div",{children:[(0,r.jsx)("button",{type:"button",style:y,onClick:()=>n(!t),children:"Ouvrir les informations"}),t&&(0,r.jsx)("textarea",{style:{display:"block",width:"100%",height:"200px",fontSize:"12px"},children:e})]})}function h({debugInfo:e}){let{copied:t,copy:n}=function(e={}){let{successDuration:t=2e3}=e,[n,r]=(0,o.useState)(!1);return{copy:(0,o.useCallback)(async e=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e),r(!0);else{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),r(!0)}catch(e){return console.error("Failed to copy text:",e),!1}finally{t.remove()}}return setTimeout(()=>{r(!1)},t),!0}catch(e){return console.error("Failed to copy text:",e),!1}},[t]),copied:n}}();return(0,r.jsxs)("div",{style:f,children:[(0,r.jsx)("div",{style:m,children:(0,r.jsx)("h3",{style:w,children:"Oups ! Nous avons rencontr\xe9 un petit probl\xe8me"})}),(0,r.jsxs)("p",{style:g,children:["Impossible d'ouvrir le menu de partage pour le moment. Si le probl\xe8me persiste, copiez les informations ci-dessous et collez-les dans votre mail \xe0"," ",(0,r.jsx)("a",{href:"mailto:help@frak-labs.com?subject=Debug",style:x,children:"help@frak-labs.com"})," ",(0,r.jsx)("br",{}),"Merci pour votre retour, nous traitons votre demande dans les plus brefs d\xe9lais."]}),(0,r.jsx)("button",{type:"button",onClick:()=>n(e??""),style:y,children:t?"Informations copi\xe9es !":"Copier les informations de d\xe9bogage"}),(0,r.jsx)(S,{debugInfo:e})]})}async function k(){if(!window.FrakSetup?.client)throw Error("Frak client not found");await (0,n.displayEmbededWallet)(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function b({text:e="Share and earn!",classname:n="",useReward:a,noRewardText:s,targetInteraction:l,showWallet:c}){let f=(0,o.useMemo)(()=>void 0!==a,[a]),m=(0,o.useMemo)(()=>void 0!==c,[c]),{isClientReady:w}=function(){let[e,t]=(0,o.useState)(!0),n=(0,o.useCallback)(()=>{t(!1)},[]);return(0,o.useEffect)(()=>(i("add",n),()=>i("remove",n)),[n]),{isClientReady:!e}}(),{reward:g}=function(e,t){let[n,r]=(0,o.useState)(void 0);return(0,o.useEffect)(()=>{e&&p(t).then(e=>{e&&r(`${e}€`)})},[e,t]),{reward:n}}(f&&w,l),{handleShare:x,isError:y,debugInfo:S}=function(e){let[n,r]=(0,o.useState)(void 0),[a,i]=(0,o.useState)(!1);return{handleShare:(0,o.useCallback)(async()=>{if(!window.FrakSetup?.client){console.error("Frak client not found"),r(t.DebugInfoGatherer.empty().formatDebugInfo("Frak client not found")),i(!0);return}let n=function(){if(!window.modalBuilderSteps)throw Error("modalBuilderSteps not found");return window.modalBuilderSteps}();if(!n)throw Error("modalBuilderSteps not found");try{await n.sharing(window.FrakSetup?.modalShareConfig??{}).display(t=>({...t,targetInteraction:e}))}catch(e){if(e instanceof t.FrakRpcError&&e.code===t.RpcErrorCodes.clientAborted){console.debug("User aborted the modal");return}r(window.FrakSetup.client.debugInfo.formatDebugInfo(e)),i(!0),console.error("Error while opening the modal",e)}},[e]),isError:a,debugInfo:n}}(l),b=(0,o.useMemo)(()=>f?g?e.includes("{REWARD}")?e.replace("{REWARD}",g):`${e} ${g}`:s??e.replace("{REWARD}",""):e,[f,e,s,g]),F=(0,o.useCallback)(async()=>await (m?k():x()),[m,x]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{type:"button",className:d("buttonShare-F23Y9m",n),onClick:F,children:[!w&&(0,r.jsx)(u,{})," ",b]}),y&&(0,r.jsx)(h,{debugInfo:S})]})}!function(t,n,r=[],o={shadow:!1}){if("undefined"!=typeof window){var a;a=async function(){await l()},"complete"===document.readyState||"interactive"===document.readyState?setTimeout(a,1):document.addEventListener?document.addEventListener("DOMContentLoaded",a):document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&a()}),customElements.get(n)||(0,e.default)(t,n,r,o)}}(b,"frak-button-share",["text"],{shadow:!1});export{b as ButtonShare};
1
+ import*as e from"preact-custom-element";import*as t from"@frak-labs/core-sdk";import*as n from"@frak-labs/core-sdk/actions";import*as o from"preact/jsx-runtime";import*as r from"class-variance-authority";import*as a from"preact/hooks";let i="frakClientReady";function s(e,t){if(window.FrakSetup?.client&&"add"===e){t();return}("add"===e?window.addEventListener:window.removeEventListener)(i,t,!1)}async function l(e){if(!window.modalBuilderSteps){console.error("modalBuilderSteps not found");return}console.log("referral",await (0,n.referralInteraction)(e,{modalConfig:window.modalBuilderSteps.reward().params}))}async function d(){if(!(window.frakSetupInProgress?(console.log("[Frak SDK] Initialization already in progress"),!1):window.FrakSetup?.client?(console.log("[Frak SDK] Client already initialized"),!1):!!window.FrakSetup?.config||(console.error("[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set."),!1)))return;if(console.log("[Frak SDK] Starting initialization"),window.frakSetupInProgress=!0,!window.FrakSetup.config){console.error("[Frak SDK] Configuration not found"),window.frakSetupInProgress=!1;return}let e=await (0,t.setupClient)({config:window.FrakSetup.config});if(!e){console.error("[Frak SDK] Failed to create client"),window.frakSetupInProgress=!1;return}window.FrakSetup.client=e,console.log("[Frak SDK] Client initialized successfully"),function(){let e=new CustomEvent(i);window.dispatchEvent(e)}(),window.modalBuilderSteps=(0,n.modalBuilder)(e,window.FrakSetup?.modalConfig??{}),l(e),window.frakSetupInProgress=!1,function(){let e=new URLSearchParams(window.location.search).get("frakAction");e&&"share"===e&&(console.log("[Frak SDK] Auto open query param found"),function(){if(!window.FrakSetup?.client){console.error("Frak client not found");return}"vibrate"in navigator?navigator.vibrate(10):console.log("Vibration not supported"),(0,n.displayEmbededWallet)(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}())}()}let c="spinner__leaf-xtOJmT",u=({ref:e,className:t,...n})=>(0,o.jsxs)("span",{...n,ref:e,className:(0,r.cx)("spinner-KHk8mw"),children:[(0,o.jsx)("span",{className:c}),(0,o.jsx)("span",{className:c}),(0,o.jsx)("span",{className:c}),(0,o.jsx)("span",{className:c}),(0,o.jsx)("span",{className:c}),(0,o.jsx)("span",{className:c}),(0,o.jsx)("span",{className:c}),(0,o.jsx)("span",{className:c})]});async function p({targetInteraction:e}){let o=window.FrakSetup?.client;if(!o){console.warn("Frak client not ready yet");return}let{maxReferrer:r,rewards:a}=await (0,n.getProductInformation)(o);if(!r)return;let i=(0,t.getCurrencyAmountKey)(o.config.metadata?.currency),s=Math.ceil(r[i]);if(e){let t=a.filter(t=>t.interactionTypeKey===e).map(e=>e.referrer[i]).reduce((e,t)=>t>e?t:e,0);t>0&&(s=Math.ceil(t))}return(0,t.formatAmount)(s,o.config.metadata?.currency)}u.displayName="Spinner";let f={marginTop:"16px",padding:"16px",backgroundColor:"#FEE2E2",border:"1px solid #FCA5A5",borderRadius:"4px",color:"#991B1B"},m={display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},w={margin:0,fontSize:"16px",fontWeight:500},g={fontSize:"14px",lineHeight:"1.5",margin:"0 0 12px 0"},S={color:"#991B1B",textDecoration:"underline",textUnderlineOffset:"2px"},x={display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"10px",padding:"8px 12px",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"4px",color:"black",fontSize:"14px",fontWeight:500};function k({debugInfo:e}){let[t,n]=(0,a.useState)(!1);return(0,o.jsxs)("div",{children:[(0,o.jsx)("button",{type:"button",style:x,onClick:()=>n(!t),children:"Ouvrir les informations"}),t&&(0,o.jsx)("textarea",{style:{display:"block",width:"100%",height:"200px",fontSize:"12px"},children:e})]})}function y({debugInfo:e}){let{copied:t,copy:n}=function(e={}){let{successDuration:t=2e3}=e,[n,o]=(0,a.useState)(!1);return{copy:(0,a.useCallback)(async e=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e),o(!0);else{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),o(!0)}catch(e){return console.error("Failed to copy text:",e),!1}finally{t.remove()}}return setTimeout(()=>{o(!1)},t),!0}catch(e){return console.error("Failed to copy text:",e),!1}},[t]),copied:n}}();return(0,o.jsxs)("div",{style:f,children:[(0,o.jsx)("div",{style:m,children:(0,o.jsx)("h3",{style:w,children:"Oups ! Nous avons rencontr\xe9 un petit probl\xe8me"})}),(0,o.jsxs)("p",{style:g,children:["Impossible d'ouvrir le menu de partage pour le moment. Si le probl\xe8me persiste, copiez les informations ci-dessous et collez-les dans votre mail \xe0"," ",(0,o.jsx)("a",{href:"mailto:help@frak-labs.com?subject=Debug",style:S,children:"help@frak-labs.com"})," ",(0,o.jsx)("br",{}),"Merci pour votre retour, nous traitons votre demande dans les plus brefs d\xe9lais."]}),(0,o.jsx)("button",{type:"button",onClick:()=>n(e??""),style:x,children:t?"Informations copi\xe9es !":"Copier les informations de d\xe9bogage"}),(0,o.jsx)(k,{debugInfo:e})]})}async function h(){if(!window.FrakSetup?.client)throw Error("Frak client not found");await (0,n.displayEmbededWallet)(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function b({text:e="Share and earn!",classname:n="",useReward:i,noRewardText:l,targetInteraction:d,showWallet:c}){let f=(0,a.useMemo)(()=>void 0!==i,[i]),m=(0,a.useMemo)(()=>void 0!==c,[c]),{isClientReady:w}=function(){let[e,t]=(0,a.useState)(!0),n=(0,a.useCallback)(()=>{t(!1)},[]);return(0,a.useEffect)(()=>(s("add",n),()=>s("remove",n)),[n]),{isClientReady:!e}}(),{reward:g}=function(e,t){let[n,o]=(0,a.useState)(void 0);return(0,a.useEffect)(()=>{e&&p({targetInteraction:t}).then(e=>{e&&o(e)})},[e,t]),{reward:n}}(f&&w,d),{handleShare:S,isError:x,debugInfo:k}=function(e){let[n,o]=(0,a.useState)(void 0),[r,i]=(0,a.useState)(!1);return{handleShare:(0,a.useCallback)(async()=>{if(!window.FrakSetup?.client){console.error("Frak client not found"),o(t.DebugInfoGatherer.empty().formatDebugInfo("Frak client not found")),i(!0);return}let n=function(){if(!window.modalBuilderSteps)throw Error("modalBuilderSteps not found");return window.modalBuilderSteps}();if(!n)throw Error("modalBuilderSteps not found");try{await n.sharing(window.FrakSetup?.modalShareConfig??{}).display(t=>({...t,targetInteraction:e}))}catch(e){if(e instanceof t.FrakRpcError&&e.code===t.RpcErrorCodes.clientAborted){console.debug("User aborted the modal");return}o(window.FrakSetup.client.debugInfo.formatDebugInfo(e)),i(!0),console.error("Error while opening the modal",e)}},[e]),isError:r,debugInfo:n}}(d),b=(0,a.useMemo)(()=>f?g?e.includes("{REWARD}")?e.replace("{REWARD}",g):`${e} ${g}`:l??e.replace("{REWARD}",""):e,[f,e,l,g]),F=(0,a.useCallback)(async()=>await (m?h():S()),[m,S]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("button",{type:"button",className:(0,r.cx)("buttonShare-F23Y9m",n,"override"),onClick:F,children:[!w&&(0,o.jsx)(u,{})," ",b]}),x&&(0,o.jsx)(y,{debugInfo:k})]})}!function(t,n,o=[],r={shadow:!1}){if("undefined"!=typeof window){var a;a=async function(){await d()},"complete"===document.readyState||"interactive"===document.readyState?setTimeout(a,1):document.addEventListener?document.addEventListener("DOMContentLoaded",a):document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&a()}),customElements.get(n)||(0,e.default)(t,n,o,r)}}(b,"frak-button-share",["text"],{shadow:!1});export{b as ButtonShare};
@@ -1 +1 @@
1
- frak-button-wallet{z-index:2000000;position:fixed;bottom:20px}frak-button-wallet.left{left:20px}frak-button-wallet.right{right:20px}frak-button-wallet button,frak-button-wallet [type=button]{all:unset;cursor:pointer;text-align:center;background-color:#3e557e;border-radius:50%;justify-content:center;align-items:center;width:45px;height:45px;display:flex;position:relative}frak-button-wallet span{color:#fff;white-space:nowrap;background:#ff3f3f;border-radius:5px;padding:2px 3px;font-size:9px;font-weight:600;line-height:9px;position:absolute;top:-4px;right:27px}
1
+ .button-aPZnsb{all:unset;z-index:2000000;cursor:pointer;text-align:center;background-color:#3e557e;border-radius:50%;justify-content:center;align-items:center;width:45px;height:45px;font-size:24px;display:flex;position:fixed;bottom:20px}.button__left-fQJUnK{left:20px}.button__right-TkFFFK{right:20px}.reward-w5dm3K{color:#fff;white-space:nowrap;background:#ff3f3f;border-radius:5px;padding:2px 3px;font-size:9px;font-weight:600;line-height:9px;position:absolute;top:-4px;right:27px}
@@ -1 +1 @@
1
- import*as e from"preact-custom-element";import*as t from"@frak-labs/core-sdk";import*as n from"@frak-labs/core-sdk/actions";import*as o from"preact/jsx-runtime";import*as r from"preact/hooks";import*as i from"preact";let a="frakClientReady";function l(e,t){if(window.FrakSetup?.client&&"add"===e){t();return}("add"===e?window.addEventListener:window.removeEventListener)(a,t,!1)}async function u(e){if(!window.modalBuilderSteps){console.error("modalBuilderSteps not found");return}console.log("referral",await (0,n.referralInteraction)(e,{modalConfig:window.modalBuilderSteps.reward().params}))}async function s(){if(!(window.frakSetupInProgress?(console.log("[Frak SDK] Initialization already in progress"),!1):window.FrakSetup?.client?(console.log("[Frak SDK] Client already initialized"),!1):!!window.FrakSetup?.config||(console.error("[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set."),!1)))return;console.log("[Frak SDK] Starting initialization"),window.frakSetupInProgress=!0;let e=await (0,t.setupClient)({config:{...window.FrakSetup.config,metadata:{name:"Frak SDK"}}});if(!e){console.error("[Frak SDK] Failed to create client"),window.frakSetupInProgress=!1;return}window.FrakSetup.client=e,console.log("[Frak SDK] Client initialized successfully"),function(){let e=new CustomEvent(a);window.dispatchEvent(e)}(),window.modalBuilderSteps=(0,n.modalBuilder)(e,window.FrakSetup?.modalConfig??{}),u(e),window.frakSetupInProgress=!1}async function c(e){let t=window.FrakSetup?.client;if(!t){console.warn("Frak client not ready yet");return}let o=await (0,n.getProductInformation)(t);if(!o?.estimatedEurReward)return;let r=o.estimatedEurReward;if(e){let t=o.rewards.filter(t=>t.interactionTypeKey===e).map(e=>e.referrer.eurAmount).reduce((e,t)=>t>e?t:e,0);t>0&&(r=Math.ceil(t).toString())}return r}function _(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function f(e,t){this.props=e,this.context=t}(f.prototype=new i.Component).isPureReactComponent=!0,f.prototype.shouldComponentUpdate=function(e,t){return _(this.props,e)||_(this.state,t)};var p=i.options.__b;i.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),p&&p(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var d=i.options.__e;i.options.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}d(e,t,n,o)};var m=i.options.unmount;function v(){this.__u=0,this.o=null,this.__b=null}function h(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function w(){this.i=null,this.l=null}i.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),m&&m(e)},(v.prototype=new i.Component).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=h(o.__v),i=!1,a=function(){i||(i=!0,n.__R=null,r?r(l):l())};n.__R=a;var l=function(){if(!--o.__u){if(o.state.__a){var e,t=o.state.__a;o.__v.__k[0]=function e(t,n,o){return t&&o&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)}),t.__c&&t.__c.__P===n&&(t.__e&&o.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=o)),t}(t,t.__c.__P,t.__c.__O)}for(o.setState({__a:o.__b=null});e=o.o.pop();)e.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},v.prototype.componentWillUnmount=function(){this.o=[]},v.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,o){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=function(e,t){for(var n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===o&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)})),t}(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&(0,i.createElement)(i.Fragment,null,e.fallback);return r&&(r.__u&=-33),[(0,i.createElement)(i.Fragment,null,t.__a?null:e.children),r]};var y=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(w.prototype=new i.Component).__a=function(e){var t=this,n=h(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),y(t,e,o)):r()};n?n(i):i()}},w.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,i.toChildArray)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},w.prototype.componentDidUpdate=w.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){y(e,n,t)})};var k="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,g=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,S=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,b=/[A-Z0-9]/g,C="undefined"!=typeof document;i.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(i.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var E=i.options.event;function F(){}function P(){return this.cancelBubble}function x(){return this.defaultPrevented}i.options.event=function(e){return E&&(e=E(e)),e.persist=F,e.isPropagationStopped=P,e.isDefaultPrevented=x,e.nativeEvent=e};var O={enumerable:!1,configurable:!0,get:function(){return this.class}},R=i.options.vnode;i.options.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},r=-1===n.indexOf("-");for(var a in t){var l=t[a];if(!("value"===a&&"defaultValue"in t&&null==l||C&&"children"===a&&"noscript"===n||"class"===a||"className"===a)){var u,s=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===l?l="":"translate"===s&&"no"===l?l=!1:"o"===s[0]&&"n"===s[1]?"ondoubleclick"===s?a="ondblclick":"onchange"!==s||"input"!==n&&"textarea"!==n||(u=t.type,("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(u))?"onfocus"===s?a="onfocusin":"onblur"===s?a="onfocusout":S.test(a)&&(a=s):s=a="oninput":r&&g.test(a)?a=a.replace(b,"-$&").toLowerCase():null===l&&(l=void 0),"oninput"===s&&o[a=s]&&(a="oninputCapture"),o[a]=l}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,i.toChildArray)(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==n&&null!=o.defaultValue&&(o.value=(0,i.toChildArray)(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value})),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",O)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=k,R&&R(e)};var D=i.options.__r;i.options.__r=function(e){D&&D(e),e.__c};var L=i.options.diffed;i.options.diffed=function(e){L&&L(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};let j=e=>(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 28 28",...e,children:(0,o.jsx)("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M23.143 14v11.428H4.857V14M14 25.428V8.286m0 0H8.857a2.857 2.857 0 0 1 0-5.715c4 0 5.143 5.715 5.143 5.715m0 0h5.143a2.857 2.857 0 1 0 0-5.715c-4 0-5.143 5.715-5.143 5.715m-11.429 0h22.857V14H2.571z"})});function A(){if(!window.FrakSetup?.client){console.error("Frak client not found");return}"vibrate"in navigator?navigator.vibrate(10):console.log("Vibration not supported"),(0,n.displayEmbededWallet)(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function B({classname:e="",useReward:t,targetInteraction:n}){let i=(0,r.useMemo)(()=>void 0!==t,[t]),a=(0,r.useRef)(null),{isClientReady:u}=function(){let[e,t]=(0,r.useState)(!0),n=(0,r.useCallback)(()=>{t(!1)},[]);return(0,r.useEffect)(()=>(l("add",n),()=>l("remove",n)),[n]),{isClientReady:!e}}(),{reward:s}=function(e,t){let[n,o]=(0,r.useState)(void 0);return(0,r.useEffect)(()=>{e&&c(t).then(e=>{e&&o(`${e}€`)})},[e,t]),{reward:n}}(i&&u,n);return(0,r.useEffect)(()=>{let e=window.FrakSetup?.modalWalletConfig?.metadata?.position;a.current?.parentElement?.classList.add(e??"right")},[]),(0,o.jsxs)("button",{ref:a,type:"button",class:e,disabled:!u,onClick:A,children:[(0,o.jsx)(j,{}),s&&(0,o.jsx)("span",{children:s})]})}!function(t,n,o=[],r={shadow:!1}){if("undefined"!=typeof window){var i;i=async function(){await s()},"complete"===document.readyState||"interactive"===document.readyState?setTimeout(i,1):document.addEventListener?document.addEventListener("DOMContentLoaded",i):document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&i()}),customElements.get(n)||(0,e.default)(t,n,o,r)}}(B,"frak-button-wallet",[],{shadow:!1});export{B as ButtonWallet};
1
+ import*as e from"preact-custom-element";import*as t from"@frak-labs/core-sdk";import*as n from"@frak-labs/core-sdk/actions";import*as o from"preact/jsx-runtime";import*as r from"preact/hooks";import*as i from"class-variance-authority";import*as a from"preact";function l(){if(!window.FrakSetup?.client){console.error("Frak client not found");return}"vibrate"in navigator?navigator.vibrate(10):console.log("Vibration not supported"),(0,n.displayEmbededWallet)(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}let u="frakClientReady";function c(e,t){if(window.FrakSetup?.client&&"add"===e){t();return}("add"===e?window.addEventListener:window.removeEventListener)(u,t,!1)}async function s(e){if(!window.modalBuilderSteps){console.error("modalBuilderSteps not found");return}console.log("referral",await (0,n.referralInteraction)(e,{modalConfig:window.modalBuilderSteps.reward().params}))}async function _(){if(!(window.frakSetupInProgress?(console.log("[Frak SDK] Initialization already in progress"),!1):window.FrakSetup?.client?(console.log("[Frak SDK] Client already initialized"),!1):!!window.FrakSetup?.config||(console.error("[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set."),!1)))return;if(console.log("[Frak SDK] Starting initialization"),window.frakSetupInProgress=!0,!window.FrakSetup.config){console.error("[Frak SDK] Configuration not found"),window.frakSetupInProgress=!1;return}let e=await (0,t.setupClient)({config:window.FrakSetup.config});if(!e){console.error("[Frak SDK] Failed to create client"),window.frakSetupInProgress=!1;return}window.FrakSetup.client=e,console.log("[Frak SDK] Client initialized successfully"),function(){let e=new CustomEvent(u);window.dispatchEvent(e)}(),window.modalBuilderSteps=(0,n.modalBuilder)(e,window.FrakSetup?.modalConfig??{}),s(e),window.frakSetupInProgress=!1,function(){let e=new URLSearchParams(window.location.search).get("frakAction");e&&"share"===e&&(console.log("[Frak SDK] Auto open query param found"),l())}()}async function f({targetInteraction:e}){let o=window.FrakSetup?.client;if(!o){console.warn("Frak client not ready yet");return}let{maxReferrer:r,rewards:i}=await (0,n.getProductInformation)(o);if(!r)return;let a=(0,t.getCurrencyAmountKey)(o.config.metadata?.currency),l=Math.ceil(r[a]);if(e){let t=i.filter(t=>t.interactionTypeKey===e).map(e=>e.referrer[a]).reduce((e,t)=>t>e?t:e,0);t>0&&(l=Math.ceil(t))}return(0,t.formatAmount)(l,o.config.metadata?.currency)}let p={button:"button-aPZnsb",button__left:"button__left-fQJUnK",button__right:"button__right-TkFFFK",reward:"reward-w5dm3K"};function d(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function m(e,t){this.props=e,this.context=t}(m.prototype=new a.Component).isPureReactComponent=!0,m.prototype.shouldComponentUpdate=function(e,t){return d(this.props,e)||d(this.state,t)};var v=a.options.__b;a.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),v&&v(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var h=a.options.__e;a.options.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}h(e,t,n,o)};var w=a.options.unmount;function y(){this.__u=0,this.o=null,this.__b=null}function g(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function k(){this.i=null,this.l=null}a.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),w&&w(e)},(y.prototype=new a.Component).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=g(o.__v),i=!1,a=function(){i||(i=!0,n.__R=null,r?r(l):l())};n.__R=a;var l=function(){if(!--o.__u){if(o.state.__a){var e,t=o.state.__a;o.__v.__k[0]=function e(t,n,o){return t&&o&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)}),t.__c&&t.__c.__P===n&&(t.__e&&o.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=o)),t}(t,t.__c.__P,t.__c.__O)}for(o.setState({__a:o.__b=null});e=o.o.pop();)e.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(a,a)},y.prototype.componentWillUnmount=function(){this.o=[]},y.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,o){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=function(e,t){for(var n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===o&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)})),t}(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&(0,a.createElement)(a.Fragment,null,e.fallback);return r&&(r.__u&=-33),[(0,a.createElement)(a.Fragment,null,t.__a?null:e.children),r]};var b=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(k.prototype=new a.Component).__a=function(e){var t=this,n=g(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),b(t,e,o)):r()};n?n(i):i()}},k.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,a.toChildArray)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},k.prototype.componentDidUpdate=k.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){b(e,n,t)})};var S="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,C=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,F=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,P=/[A-Z0-9]/g,E="undefined"!=typeof document;a.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(a.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var x=a.options.event;function O(){}function A(){return this.cancelBubble}function K(){return this.defaultPrevented}a.options.event=function(e){return x&&(e=x(e)),e.persist=O,e.isPropagationStopped=A,e.isDefaultPrevented=K,e.nativeEvent=e};var D={enumerable:!1,configurable:!0,get:function(){return this.class}},R=a.options.vnode;a.options.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},r=-1===n.indexOf("-");for(var i in t){var l=t[i];if(!("value"===i&&"defaultValue"in t&&null==l||E&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var u,c=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===l?l="":"translate"===c&&"no"===l?l=!1:"o"===c[0]&&"n"===c[1]?"ondoubleclick"===c?i="ondblclick":"onchange"!==c||"input"!==n&&"textarea"!==n||(u=t.type,("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(u))?"onfocus"===c?i="onfocusin":"onblur"===c?i="onfocusout":F.test(i)&&(i=c):c=i="oninput":r&&C.test(i)?i=i.replace(P,"-$&").toLowerCase():null===l&&(l=void 0),"oninput"===c&&o[i=c]&&(i="oninputCapture"),o[i]=l}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,a.toChildArray)(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==n&&null!=o.defaultValue&&(o.value=(0,a.toChildArray)(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value})),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",D)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=S,R&&R(e)};var L=a.options.__r;a.options.__r=function(e){L&&L(e),e.__c};var j=a.options.diffed;a.options.diffed=function(e){j&&j(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};let U=e=>(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 28 28",...e,children:(0,o.jsx)("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M23.143 14v11.428H4.857V14M14 25.428V8.286m0 0H8.857a2.857 2.857 0 0 1 0-5.715c4 0 5.143 5.715 5.143 5.715m0 0h5.143a2.857 2.857 0 1 0 0-5.715c-4 0-5.143 5.715-5.143 5.715m-11.429 0h22.857V14H2.571z"})});function B({classname:e="",useReward:t,targetInteraction:n}){let a=(0,r.useMemo)(()=>void 0!==t,[t]),{isClientReady:u}=function(){let[e,t]=(0,r.useState)(!0),n=(0,r.useCallback)(()=>{t(!1)},[]);return(0,r.useEffect)(()=>(c("add",n),()=>c("remove",n)),[n]),{isClientReady:!e}}(),{reward:s}=function(e,t){let[n,o]=(0,r.useState)(void 0);return(0,r.useEffect)(()=>{e&&f({targetInteraction:t}).then(e=>{e&&o(e)})},[e,t]),{reward:n}}(a&&u,n),[_,d]=(0,r.useState)("right");return(0,r.useEffect)(()=>{d(window.FrakSetup?.modalWalletConfig?.metadata?.position??"right")},[]),(0,o.jsxs)("button",{type:"button",class:(0,i.cx)(p.button,"left"===_?p.button__left:p.button__right,e,"override"),disabled:!u,onClick:l,children:[(0,o.jsx)(U,{}),s&&(0,o.jsx)("span",{className:p.reward,children:s})]})}!function(t,n,o=[],r={shadow:!1}){if("undefined"!=typeof window){var i;i=async function(){await _()},"complete"===document.readyState||"interactive"===document.readyState?setTimeout(i,1):document.addEventListener?document.addEventListener("DOMContentLoaded",i):document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&i()}),customElements.get(n)||(0,e.default)(t,n,o,r)}}(B,"frak-button-wallet",[],{shadow:!1});export{B as ButtonWallet};
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "https://twitter.com/QNivelais"
12
12
  }
13
13
  ],
14
- "version": "0.0.11",
14
+ "version": "0.0.13",
15
15
  "description": "Frak Wallet components, helping any person to interact with the Frak wallet.",
16
16
  "repository": {
17
17
  "url": "https://github.com/frak-id/wallet",
@@ -52,17 +52,17 @@
52
52
  "publish": "echo 'Publishing components...'"
53
53
  },
54
54
  "dependencies": {
55
- "@frak-labs/core-sdk": "0.0.7",
56
- "preact": "^10.25.4",
55
+ "@frak-labs/core-sdk": "0.0.10",
56
+ "class-variance-authority": "^0.7.1",
57
+ "preact": "^10.26.4",
57
58
  "preact-custom-element": "^4.3.0"
58
59
  },
59
60
  "devDependencies": {
60
61
  "@rsbuild/plugin-preact": "^1.3.1",
61
62
  "@rsbuild/plugin-svgr": "^1.0.7",
62
- "@rslib/core": "^0.5.2",
63
+ "@rslib/core": "^0.5.5",
63
64
  "@types/node": "^22",
64
65
  "@types/preact-custom-element": "^4.0.4",
65
- "ts-checker-rspack-plugin": "^1.1.1",
66
66
  "typescript": "^5"
67
67
  },
68
68
  "browserslist": [
package/cdn/364.js DELETED
@@ -1,13 +0,0 @@
1
- export const ids=["364"];export const modules={"./src/hooks/useClientReady.ts":function(e,t,n){n.d(t,{t:()=>o});var r=n("./src/utils/clientReady.ts"),a=n("../../node_modules/preact/hooks/dist/hooks.module.js");function o(){let[e,t]=(0,a.eJ)(!0),n=(0,a.I4)(()=>{t(!1)},[]);return(0,a.d4)(()=>((0,r.D)("add",n),()=>(0,r.D)("remove",n)),[n]),{isClientReady:!e}}},"./src/hooks/useReward.ts":function(e,t,n){n.d(t,{w:()=>i});var r=n("../core/dist/actions.js");async function a(e){let t=window.FrakSetup?.client;if(!t){console.warn("Frak client not ready yet");return}let n=await (0,r.pO)(t);if(!n?.estimatedEurReward)return;let a=n.estimatedEurReward;if(e){let t=n.rewards.filter(t=>t.interactionTypeKey===e).map(e=>e.referrer.eurAmount).reduce((e,t)=>t>e?t:e,0);t>0&&(a=Math.ceil(t).toString())}return a}var o=n("../../node_modules/preact/hooks/dist/hooks.module.js");function i(e,t){let[n,r]=(0,o.eJ)(void 0);return(0,o.d4)(()=>{e&&a(t).then(e=>{e&&r(`${e}€`)})},[e,t]),{reward:n}}},"./src/utils/clientReady.ts":function(e,t,n){n.d(t,{D:()=>o,f:()=>a});let r="frakClientReady";function a(){let e=new CustomEvent(r);window.dispatchEvent(e)}function o(e,t){if(window.FrakSetup?.client&&"add"===e){t();return}("add"===e?window.addEventListener:window.removeEventListener)(r,t,!1)}},"./src/utils/registerWebComponent.ts":function(e,t,n){n.d(t,{A:()=>l});var r=n("../../node_modules/preact-custom-element/dist/preact-custom-element.esm.js"),a=n("../core/dist/index.js"),o=n("./src/utils/clientReady.ts"),i=n("./src/utils/setup.ts");async function s(){if(!(window.frakSetupInProgress?(console.log("[Frak SDK] Initialization already in progress"),!1):window.FrakSetup?.client?(console.log("[Frak SDK] Client already initialized"),!1):!!window.FrakSetup?.config||(console.error("[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set."),!1)))return;console.log("[Frak SDK] Starting initialization"),window.frakSetupInProgress=!0;let e=await (0,a.lD)({config:{...window.FrakSetup.config,metadata:{name:"Frak SDK"}}});if(!e){console.error("[Frak SDK] Failed to create client"),window.frakSetupInProgress=!1;return}window.FrakSetup.client=e,console.log("[Frak SDK] Client initialized successfully"),(0,o.f)(),(0,i.N3)(e),(0,i.zK)(e),window.frakSetupInProgress=!1}function l(e,t,n=[],a={shadow:!1}){if("undefined"!=typeof window){var o;o=async function(){await s()},"complete"===document.readyState||"interactive"===document.readyState?setTimeout(o,1):document.addEventListener?document.addEventListener("DOMContentLoaded",o):document.attachEvent("onreadystatechange",()=>{"complete"===document.readyState&&o()}),customElements.get(t)||(0,r.Z)(e,t,n,a)}}},"./src/utils/setup.ts":function(e,t,n){n.d(t,{Gt:()=>i,N3:()=>a,zK:()=>o});var r=n("../core/dist/actions.js");function a(e){window.modalBuilderSteps=(0,r.jy)(e,window.FrakSetup?.modalConfig??{})}async function o(e){if(!window.modalBuilderSteps){console.error("modalBuilderSteps not found");return}console.log("referral",await (0,r.KS)(e,{modalConfig:window.modalBuilderSteps.reward().params}))}function i(){if(!window.modalBuilderSteps)throw Error("modalBuilderSteps not found");return window.modalBuilderSteps}},"?2fd0":function(){},"?81fa":function(){},"../core/dist/actions.js":function(e,t,n){n.d(t,{Hq:()=>u,KS:()=>E,jy:()=>w,pO:()=>f});var r=n("../../node_modules/viem/_esm/utils/hash/keccak256.js"),a=n("../../node_modules/viem/_esm/utils/encoding/toHex.js"),o=n("../../node_modules/viem/_esm/utils/encoding/toBytes.js"),i=n("../../node_modules/viem/_esm/utils/data/concat.js"),s=n("../../node_modules/viem/_esm/utils/data/pad.js"),l=n("../../node_modules/viem/_esm/utils/address/isAddressEqual.js");async function c(e,{productId:t,interaction:n,validation:o}){let i=t??function({domain:e}){let t=e??window.location.host;return(0,r.w)((0,a.NC)(t))}(e.config);return await e.request({method:"frak_sendInteraction",params:[i,n,o]})}async function d(e,{steps:t,metadata:n}){return await e.request({method:"frak_displayModal",params:[t,e.config.metadata.name,n]})}async function u(e,t){await e.request({method:"frak_displayEmbededWallet",params:[t,e.config.metadata.name]})}async function f(e){return await e.request({method:"frak_getProductInformation"})}function w(e,{metadata:t,login:n,openSession:r}){return function e(t,n){async function r(e){return e&&(n.metadata=e(n.metadata??{})),await d(t,n)}return{params:n,sendTx:function(r){return e(t,{...n,steps:{...n.steps,sendTransaction:r}})},reward:function(r){return e(t,{...n,steps:{...n.steps,final:{...r,action:{key:"reward"}}}})},sharing:function(r,a){return e(t,{...n,steps:{...n.steps,final:{...a,action:{key:"sharing",options:r}}}})},display:r}}(e,{steps:{login:n??{},openSession:r??{}},metadata:t})}let m="fCtx";function p({url:e}){if(!e)return null;let t=new URL(e).searchParams.get(m);return t?function(e){if(e&&0!==e.length)try{let t;let n=(t=e.length%4,Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(0===t?0:4-t),"=")),e=>e.charCodeAt(0)));return{r:(0,a.ci)(n,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}(t):null}let g={parse:p,replaceUrl:function({url:e,context:t}){let n,r;if(!window.location?.href||"undefined"==typeof window){console.error("No window found, can't update context");return}let a=e??window.location.href;(n=null!==t?function({url:e,context:t}){if(!e)return null;let n=p({url:e}),r=n?{...n,...t}:t;if(!r.r)return null;let a=function(e){if(e?.r)try{var t;return t=(0,o.nr)(e.r),btoa(Array.from(t,e=>String.fromCharCode(e)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}(r);if(!a)return null;let i=new URL(e);return i.searchParams.set(m,a),i.toString()}({url:a,context:t}):((r=new URL(a)).searchParams.delete(m),r.toString()))&&window.history.replaceState(null,"",n.toString())}},h={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31};Object.entries(h).reduce((e,[t,n])=>(e[t]=BigInt(1)<<BigInt(n),e),{});let y={createLink:()=>({handlerTypeDenominator:(0,a.NC)(h.referral),interactionData:"0xb2c0f17c"}),referred({referrer:e}){let t=(0,i.SM)(["0x010cc3b9",(0,s.vk)(e,{size:32})]);return{handlerTypeDenominator:(0,a.NC)(h.referral),interactionData:t}}};class v extends Error{code;data;constructor(e,t,n){super(t),this.code=e,this.data=n}}let S={walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006};async function k(e,{walletStatus:t,frakContext:n,modalConfig:r,productId:a,options:o}){let i=!1;async function s(){if(!i)return i=!0,b(e,{modalConfig:r,walletStatus:t})}async function l(t){let n=y.referred({referrer:t});await c(e,{productId:a,interaction:n})}try{let{status:e,currentWallet:r}=await C({initialWalletStatus:t,getFreshWalletStatus:s,pushReferralInteraction:l,frakContext:n});return g.replaceUrl({url:window.location?.href,context:o?.alwaysAppendUrl?{r:r}:null}),e}catch(e){return console.log("Error processing referral",{error:e}),g.replaceUrl({url:window.location?.href,context:o?.alwaysAppendUrl?{r:t?.wallet}:null}),function(e){if(e instanceof v)switch(e.code){case S.walletNotConnected:return"no-wallet";case S.serverErrorForInteractionDelegation:return"no-session"}return"error"}(e)}}async function C({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:n,frakContext:r}){let a=e?.wallet;return r?.r?(a||(a=await t()),a&&(0,l.E)(r.r,a))?{status:"self-referral",currentWallet:a}:(e?.interactionSession||(a=await t()),await n(r.r),{status:"success",currentWallet:a}):{status:"no-referrer",currentWallet:a}}async function b(e,{modalConfig:t,walletStatus:n}){if(!n?.interactionSession){if(!t)return;let n=await d(e,t);return n?.login?.wallet??void 0}return n.wallet??void 0}async function E(e,{productId:t,modalConfig:n,options:r}={}){var a;let o=g.parse({url:window.location.href}),i=await e.request({method:"frak_listenToWalletStatus"}).then(e=>{var t;return t=e.interactionToken,"undefined"!=typeof window&&(t?window.sessionStorage.setItem("frak-wallet-interaction-token",t):window.sessionStorage.removeItem("frak.interaction-token")),e});try{return await k(e,{walletStatus:i,frakContext:o,modalConfig:n,productId:t,options:r})}catch(e){console.warn("Error processing referral",{error:e})}}},"../core/dist/index.js":function(e,t,n){n.d(t,{lD:()=>y,oC:()=>l,ss:()=>s,u:()=>o});var r=n("../../node_modules/async-lz-string/libs/async-lz-string.js"),a=n("../../node_modules/js-sha256/src/sha256.js");class o extends Error{code;data;constructor(e,t,n){super(t),this.code=e,this.data=n}}class i extends o{constructor(e){super(s.internalError,e)}}let s={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:-32e3,clientNotConnected:-32001,configError:-32002,corruptedResponse:-32003,clientAborted:-32004,walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006};class l{config;iframe;isSetupDone=!1;lastResponse=null;lastRequest=null;constructor(e,t){this.config=e,this.iframe=t,this.lastRequest=null,this.lastResponse=null}setLastResponse(e){this.lastResponse={event:e.data,origin:e.origin,timestamp:Date.now()}}setLastRequest(e,t){this.lastRequest={event:e,target:t,timestamp:Date.now()}}updateSetupStatus(e){this.isSetupDone=e}base64Encode(e){try{return btoa(JSON.stringify(e))}catch(e){return console.warn("Failed to encode debug data",e),btoa("Failed to encode data")}}getIframeStatus(){return this.iframe?{loading:this.iframe.hasAttribute("loading"),url:this.iframe.src,readyState:this.iframe.contentDocument?.readyState?+("complete"===this.iframe.contentDocument.readyState):-1,contentWindow:!!this.iframe.contentWindow,isConnected:this.iframe.isConnected}:null}getNavigatorInfo(){return navigator?{userAgent:navigator.userAgent,language:navigator.language,onLine:navigator.onLine,screenWidth:window.screen.width,screenHeight:window.screen.height,pixelRatio:window.devicePixelRatio}:null}gatherDebugInfo(e){let t=this.getIframeStatus(),n=this.getNavigatorInfo(),r="Unknown";return e instanceof o?r=`FrakRpcError: ${e.code} '${e.message}'`:e instanceof Error?r=e.message:"string"==typeof e&&(r=e),{timestamp:new Date().toISOString(),encodedUrl:btoa(window.location.href),encodedConfig:this.config?this.base64Encode(this.config):"no-config",navigatorInfo:n?this.base64Encode(n):"no-navigator",iframeStatus:t?this.base64Encode(t):"not-iframe",lastRequest:this.lastRequest?this.base64Encode(this.lastRequest):"No Frak request logged",lastResponse:this.lastResponse?this.base64Encode(this.lastResponse):"No Frak response logged",clientStatus:this.isSetupDone?"setup":"not-setup",error:r}}static empty(){return new l}formatDebugInfo(e){let t=this.gatherDebugInfo(e);return`
2
- Debug Information:
3
- -----------------
4
- Timestamp: ${t.timestamp}
5
- URL: ${t.encodedUrl}
6
- Config: ${t.encodedConfig}
7
- Navigator Info: ${t.navigatorInfo}
8
- IFrame Status: ${t.iframeStatus}
9
- Last Request: ${t.lastRequest}
10
- Last Response: ${t.lastResponse}
11
- Client Status: ${t.clientStatus}
12
- Error: ${t.error}
13
- `.trim()}}class c{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve=e=>{this._resolve?.(e)};reject=e=>{this._reject?.(e)}}async function d(e){if(!(e?.compressed&&e?.compressedHash))throw new o(s.corruptedResponse,"Missing compressed data");let t=await u(e.compressed);if(!t)throw new o(s.corruptedResponse,"Invalid compressed data");if(!t?.validationHash)throw new o(s.corruptedResponse,"Missing validation hash");if((0,a.sha256)(e.compressed)!==e.compressedHash)throw new o(s.corruptedResponse,"Invalid compressed hash");let{validationHash:n,...r}=t;if((0,a.sha256)(JSON.stringify(r))!==t.validationHash)throw new o(s.corruptedResponse,"Invalid data validation hash");return t}async function u(e){let t=await (0,r.decompressFromBase64)(e);try{return JSON.parse(t)}catch(e){return console.error("Invalid compressed data",{e,decompressed:t}),null}}async function f(e){let t=(0,a.sha256)(JSON.stringify(e)),n={...e,validationHash:t},r=await w(n),o=(0,a.sha256)(r);return{compressed:r,compressedHash:o}}async function w(e){return(0,r.compressToBase64)(JSON.stringify(e))}let m="nexus-wallet-backup",p=2000001;function g({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}async function h({config:e,messageHandler:t,lifecycleManager:n}){await n.isConnected;let r=async()=>{let n=e.metadata.css;n&&t.sendEvent({clientLifecycle:"modal-css",data:{cssLink:n}})},a=async()=>{if("undefined"==typeof window)return;let e=window.localStorage.getItem(m);e&&t.sendEvent({clientLifecycle:"restore-backup",data:{backup:e}})};await Promise.all([r(),a()])}async function y({config:e}){let t=await function({walletBaseUrl:e,config:t}){let n=document.querySelector("#nexus-wallet");n&&n.remove();let r=document.createElement("iframe");return r.id="nexus-wallet",r.name="nexus-wallet",r.allow="publickey-credentials-get *; clipboard-write; web-share *",r.style.zIndex=p.toString(),g({iframe:r,isVisible:!1}),document.body.appendChild(r),new Promise(n=>{r?.addEventListener("load",()=>n(r)),r.src=`${t?.walletUrl??e??"https://wallet.frak.id"}/listener`})}({config:e});if(!t){console.error("Failed to create iframe");return}let n=function({config:e,iframe:t}){let n;let r=(n=new Map,{createChannel:e=>{let t=Math.random().toString(36).substring(7);return n.set(t,e),t},getRpcResolver:e=>n.get(e),removeChannel:e=>n.delete(e),destroy:()=>n.clear()}),a=function({iframe:e}){let t=new c;return{handleEvent:async n=>{switch(n.iframeLifecycle){case"connected":t.resolve(!0);break;case"do-backup":n.data.backup?localStorage.setItem(m,n.data.backup):localStorage.removeItem(m);break;case"remove-backup":localStorage.removeItem(m);break;case"show":case"hide":g({iframe:e,isVisible:"show"===n.iframeLifecycle});break;case"handshake":e.contentWindow?.postMessage({clientLifecycle:"handshake-response",data:{token:n.data.token,currentUrl:window.location.href}},"*")}},isConnected:t.promise}}({iframe:t}),u=new l(e,t),w=function({frakWalletUrl:e,iframe:t,channelManager:n,iframeLifecycleManager:r,debugInfo:a}){if("undefined"==typeof window)throw new o(s.configError,"iframe client should be used in the browser");if(!t.contentWindow)throw new o(s.configError,"The iframe does not have a product window");let i=t.contentWindow;async function l(t){if(!t.origin)return;try{if(new URL(t.origin).origin.toLowerCase()!==new URL(e).origin.toLowerCase())return}catch(e){console.log("Unable to check frak msg origin",e);return}if("object"!=typeof t.data)return;if(a.setLastResponse(t),"iframeLifecycle"in t.data){await r.handleEvent(t.data);return}if("clientLifecycle"in t.data){console.error("Client lifecycle event received on the client side, dismissing it");return}let o=t.data.id,i=n.getRpcResolver(o);i&&await i(t.data)}return window.addEventListener("message",l),{sendEvent:function(t){i.postMessage(t,{targetOrigin:e}),a.setLastRequest(t,e)},cleanup:function(){window.removeEventListener("message",l)}}}({frakWalletUrl:e?.walletUrl??"https://wallet.frak.id",iframe:t,channelManager:r,iframeLifecycleManager:a,debugInfo:u}),p=async e=>{if(!await a.isConnected)throw new o(s.clientNotConnected,"The iframe provider isn't connected yet");let t=new c,n=r.createChannel(async e=>{let a=await d(e.data);a.error?t.reject(new o(a.error.code,a.error.message,a.error?.data)):t.resolve(a.result),r.removeChannel(n)}),i=await f(e);return w.sendEvent({id:n,topic:e.method,data:i}),t.promise},y=async(e,t)=>{if(!await a.isConnected)throw new o(s.clientNotConnected,"The iframe provider isn't connected yet");let n=r.createChannel(async e=>{let n=await d(e.data);if(n.result)t(n.result);else throw new i("No valid result in the response")}),l=await f(e);w.sendEvent({id:n,topic:e.method,data:l})},v=function(e,t){let n,r;let a=()=>e.sendEvent({clientLifecycle:"heartbeat"});function o(){n&&clearInterval(n),r&&clearTimeout(r)}return async function(){a(),n=setInterval(a,100),r=setTimeout(()=>{o(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,o()}(),o}(w,a),S=async()=>{v(),r.destroy(),w.cleanup(),t.remove()},k=h({config:e,messageHandler:w,lifecycleManager:a}).then(()=>u.updateSetupStatus(!0));return{config:e,debugInfo:u,waitForConnection:a.isConnected,waitForSetup:k,request:p,listenerRequest:y,destroy:S}}({config:e,iframe:t});if(await n.waitForSetup,!await n.waitForConnection){console.error("Failed to connect to client");return}return n}Object.entries({dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31}).reduce((e,[t,n])=>(e[t]=BigInt(1)<<BigInt(n),e),{})}};
package/cdn/413.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 413.js.LICENSE.txt */
2
- export const ids=["413"];export const modules={"../../node_modules/async-lz-string/libs/async-lz-string.js":function(e){var t;t=()=>{var e,t;return e={48:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.decompressFromUTF16=t.compressToUTF16=t.decompressFromBase64=t.compressToBase64=void 0;var o=n(304),s=n(134),a=new o.CompressorImpl,u=new s.DecompressorImpl,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c={};t.compressToBase64=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return null===e?[2,""]:[4,a.compress(e,6,function(e){return l.charAt(e)})];case 1:switch((t=n.sent()).length%4){default:case 0:return[2,t];case 1:return[2,t+"==="];case 2:return[2,t+"=="];case 3:return[2,t+"="]}return[2]}})})},t.decompressFromBase64=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return null===e?[2,""]:""===e?[2,null]:[4,u.decompress(e.length,32,function(t){return function(e,t){if(!c[e]){c[e]={};for(var n=0;n<e.length;n++)c[e][e.charAt(n)]=n}return c[e][t]}(l,e.charAt(t))})];case 1:return[2,t.sent()]}})})},t.compressToUTF16=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return null===e?[2,""]:[4,a.compress(e,15,function(e){return String.fromCharCode(e+32)})];case 1:return[2,t.sent()+" "]}})})},t.decompressFromUTF16=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return null===e?[2,""]:""===e?[2,null]:[4,u.decompress(e.length,16384,function(t){return e.charCodeAt(t)-32})];case 1:return[2,t.sent()]}})})}},304:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompressorImpl=void 0;var o=n(658),s=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],a=function(){function e(){}return e.writeValueToData=function(e,t,n,r,i){if(n%4!=0||e.dataPosition+n>r-1)for(var o=0;o<n;o++)e.dataVal=e.dataVal<<1|1&t,e.dataPosition==r-1?(e.dataPosition=0,e.data.push(i(e.dataVal)),e.dataVal=0):e.dataPosition++,t>>=1;else e.dataVal<<=n,e.dataVal|=function(e,t){for(var n=0,r=0;r<t;++r)n<<=4,n|=s[15&e],e>>=4;return n}(t,n/4),e.dataPosition+=n},e.writeWToDataVal=function(t,n,r){t.dictionaryToCreate.has(t.w)?(256>t.w.charCodeAt(0)?(e.writeValueToData(t,0,t.numBits,n,r),e.writeValueToData(t,t.w.charCodeAt(0),8,n,r)):(e.writeValueToData(t,1,t.numBits,n,r),e.writeValueToData(t,t.w.charCodeAt(0),16,n,r)),t.enlargeIn--,0==t.enlargeIn&&(t.enlargeIn=Math.pow(2,t.numBits),t.numBits++),t.dictionaryToCreate.delete(t.w)):e.writeValueToData(t,t.dictionary.get(t.w),t.numBits,n,r),t.enlargeIn--,0==t.enlargeIn&&(t.enlargeIn=Math.pow(2,t.numBits),t.numBits++)},e.loopIteration=function(e,t,n,r,i){var o=e.charAt(t);i.dictionary.has(o)||(i.dictionary.set(o,i.dictSize++),i.dictionaryToCreate.set(o,!0));var s=i.w+o;i.dictionary.has(s)?i.w=s:(this.writeWToDataVal(i,n,r),i.dictionary.set(s,i.dictSize++),i.w=String(o))},e.prototype.compress=function(t,n,s){var a=this;return new Promise(function(u){return r(a,void 0,void 0,function(){var r,a;return i(this,function(i){switch(i.label){case 0:if(null==t)return u(""),[2];r={data:[],dataPosition:0,dataVal:0,dictionary:new Map,dictionaryToCreate:new Map,dictSize:3,enlargeIn:2,numBits:2,w:""},a=0,i.label=1;case 1:return a<t.length?(e.loopIteration(t,a,n,s,r),a%1e4!=0?[3,3]:[4,(0,o.wait)()]):[3,4];case 2:i.sent(),i.label=3;case 3:return a+=1,[3,1];case 4:return""!==r.w&&e.writeWToDataVal(r,n,s),e.writeValueToData(r,2,r.numBits,n,s),r.dataVal<<=n-r.dataPosition,r.data.push(s(r.dataVal)),u(r.data.join("")),[2]}})})})},e}();t.CompressorImpl=a},134:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.DecompressorImpl=void 0;var o=n(658),s=function(){function e(){}return e.prototype.decompress=function(e,t,n){var s=this;return new Promise(function(a){return r(s,void 0,void 0,function(){var r,s,u;return i(this,function(i){switch(i.label){case 0:for(r={bits:0,c:null,dataIndex:1,dataPosition:t,dataVal:n(0),dictionary:new Map,dictSize:4,enlargeIn:4,entry:"",maxPower:4,numBits:3,power:1,resb:null,result:[],w:null},s=0;s<3;s+=1)r.dictionary.set(s,s);for(;r.power!=r.maxPower;)r.resb=r.dataVal&r.dataPosition,r.dataPosition>>=1,0==r.dataPosition&&(r.dataPosition=t,r.dataVal=n(r.dataIndex++)),r.bits|=+(r.resb>0)*r.power,r.power<<=1;switch(r.bits){case 0:for(r.bits=0,r.maxPower=256,r.power=1;r.power!=r.maxPower;)r.resb=r.dataVal&r.dataPosition,r.dataPosition>>=1,0==r.dataPosition&&(r.dataPosition=t,r.dataVal=n(r.dataIndex++)),r.bits|=+(r.resb>0)*r.power,r.power<<=1;r.c=String.fromCharCode(r.bits);break;case 1:for(r.bits=0,r.maxPower=65536,r.power=1;r.power!==r.maxPower;)r.resb=r.dataVal&r.dataPosition,r.dataPosition>>=1,0===r.dataPosition&&(r.dataPosition=t,r.dataVal=n(r.dataIndex++)),r.bits|=+(r.resb>0)*r.power,r.power<<=1;r.c=String.fromCharCode(r.bits);break;case 2:return a(""),[2]}r.dictionary[3]=r.c,r.w=r.c,r.result.push(r.c),u=1,i.label=1;case 1:return u%2e4!=0?[3,3]:[4,(0,o.wait)()];case 2:i.sent(),i.label=3;case 3:if(r.dataIndex>e)return a(""),[2];for(r.bits=0,r.maxPower=Math.pow(2,r.numBits),r.power=1;r.power!=r.maxPower;)r.resb=r.dataVal&r.dataPosition,r.dataPosition>>=1,0==r.dataPosition&&(r.dataPosition=t,r.dataVal=n(r.dataIndex++)),r.bits|=+(r.resb>0)*r.power,r.power<<=1;switch(r.c=r.bits){case 0:for(r.bits=0,r.maxPower=256,r.power=1;r.power!==r.maxPower;)r.resb=r.dataVal&r.dataPosition,r.dataPosition>>=1,0==r.dataPosition&&(r.dataPosition=t,r.dataVal=n(r.dataIndex++)),r.bits|=+(r.resb>0)*r.power,r.power<<=1;r.dictionary[r.dictSize++]=String.fromCharCode(r.bits),r.c=r.dictSize-1,r.enlargeIn--;break;case 1:for(r.bits=0,r.maxPower=65536,r.power=1;r.power!==r.maxPower;)r.resb=r.dataVal&r.dataPosition,r.dataPosition>>=1,0==r.dataPosition&&(r.dataPosition=t,r.dataVal=n(r.dataIndex++)),r.bits|=+(r.resb>0)*r.power,r.power<<=1;r.dictionary[r.dictSize++]=String.fromCharCode(r.bits),r.c=r.dictSize-1,r.enlargeIn--;break;case 2:return a(r.result.join("")),[2]}if(0==r.enlargeIn&&(r.enlargeIn=Math.pow(2,r.numBits),r.numBits++),r.dictionary[r.c])r.entry=r.dictionary[r.c];else{if(r.c!==r.dictSize)return a(null),[2];r.entry=r.w+r.w.charAt(0)}return r.result.push(r.entry),r.dictionary[r.dictSize++]=r.w+r.entry.charAt(0),r.enlargeIn--,r.w=r.entry,0==r.enlargeIn&&(r.enlargeIn=Math.pow(2,r.numBits),r.numBits++),u++,[3,1];case 4:return[2]}})})})},e}();t.DecompressorImpl=s},658:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.wait=void 0,t.wait=function(){return n(this,void 0,void 0,function(){return r(this,function(e){return[2,new Promise(function(e){setTimeout(e,0)})]})})}}},t={},function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}(48)},e.exports=t()},"../../node_modules/js-sha256/src/sha256.js":function(e,t,n){!function(){"use strict";var t="input is invalid type",r="object"==typeof window,i=r?window:{};i.JS_SHA256_NO_WINDOW&&(r=!1);var o=!r&&"object"==typeof self,s=!i.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;s?i=n.g:o&&(i=self);var a=!i.JS_SHA256_NO_COMMON_JS&&e.exports,u="function"==typeof define&&define.amd,l=!i.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),f=[-0x80000000,8388608,32768,128],_=[24,16,8,0],h=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],d=["hex","array","digest","arrayBuffer"],p=[];(i.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),l&&(i.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var m=function(e,t){return function(n){return new g(t,!0).update(n)[e]()}},v=function(e){var t=m("hex",e);s&&(t=y(t,e)),t.create=function(){return new g(e)},t.update=function(e){return t.create().update(e)};for(var n=0;n<d.length;++n){var r=d[n];t[r]=m(r,e)}return t},y=function(e,r){var o,s=n("?81fa"),a=n("?2fd0").Buffer,u=r?"sha224":"sha256";return o=a.from&&!i.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(n){if("string"==typeof n)return s.createHash(u).update(n,"utf8").digest("hex");if(null==n)throw Error(t);return n.constructor===ArrayBuffer&&(n=new Uint8Array(n)),Array.isArray(n)||ArrayBuffer.isView(n)||n.constructor===a?s.createHash(u).update(o(n)).digest("hex"):e(n)}},b=function(e,t){return function(n,r){return new x(n,t,!0).update(r)[e]()}},w=function(e){var t=b("hex",e);t.create=function(t){return new x(t,e)},t.update=function(e,n){return t.create(e).update(n)};for(var n=0;n<d.length;++n){var r=d[n];t[r]=b(r,e)}return t};function g(e,t){t?(p[0]=p[16]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=0,this.blocks=p):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=0xc1059ed8,this.h1=0x367cd507,this.h2=0x3070dd17,this.h3=0xf70e5939,this.h4=0xffc00b31,this.h5=0x68581511,this.h6=0x64f98fa7,this.h7=0xbefa4fa4):(this.h0=0x6a09e667,this.h1=0xbb67ae85,this.h2=0x3c6ef372,this.h3=0xa54ff53a,this.h4=0x510e527f,this.h5=0x9b05688c,this.h6=0x1f83d9ab,this.h7=0x5be0cd19),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function x(e,n,r){var i,o=typeof e;if("string"===o){var s,a=[],u=e.length,c=0;for(i=0;i<u;++i)(s=e.charCodeAt(i))<128?a[c++]=s:(s<2048?a[c++]=192|s>>>6:(s<55296||s>=57344?a[c++]=224|s>>>12:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++i)),a[c++]=240|s>>>18,a[c++]=128|s>>>12&63),a[c++]=128|s>>>6&63),a[c++]=128|63&s);e=a}else if("object"===o){if(null===e)throw Error(t);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);e.length>64&&(e=new g(n,!0).update(e).array());var f=[],_=[];for(i=0;i<64;++i){var h=e[i]||0;f[i]=92^h,_[i]=54^h}g.call(this,n,r),this.update(_),this.oKeyPad=f,this.inner=!0,this.sharedMemory=r}g.prototype.update=function(e){if(!this.finalized){var n,r=typeof e;if("string"!==r){if("object"===r){if(null===e)throw Error(t);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);n=!0}for(var i,o,s=0,a=e.length,u=this.blocks;s<a;){if(this.hashed&&(this.hashed=!1,u[0]=this.block,this.block=u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0),n)for(o=this.start;s<a&&o<64;++s)u[o>>>2]|=e[s]<<_[3&o++];else for(o=this.start;s<a&&o<64;++s)(i=e.charCodeAt(s))<128?u[o>>>2]|=i<<_[3&o++]:(i<2048?u[o>>>2]|=(192|i>>>6)<<_[3&o++]:(i<55296||i>=57344?u[o>>>2]|=(224|i>>>12)<<_[3&o++]:(i=65536+((1023&i)<<10|1023&e.charCodeAt(++s)),u[o>>>2]|=(240|i>>>18)<<_[3&o++],u[o>>>2]|=(128|i>>>12&63)<<_[3&o++]),u[o>>>2]|=(128|i>>>6&63)<<_[3&o++]),u[o>>>2]|=(128|63&i)<<_[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=u[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>0xffffffff&&(this.hBytes+=this.bytes/0x100000000<<0,this.bytes=this.bytes%0x100000000),this}},g.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=f[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},g.prototype.hash=function(){var e,t,n,r,i,o,s,a,u,l,c,f=this.h0,_=this.h1,d=this.h2,p=this.h3,m=this.h4,v=this.h5,y=this.h6,b=this.h7,w=this.blocks;for(e=16;e<64;++e)t=((i=w[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,n=((i=w[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,w[e]=w[e-16]+t+w[e-7]+n<<0;for(e=0,c=_&d;e<64;e+=4)this.first?(this.is224?(a=300032,b=(i=w[0]-0x543c9a5b)-0x8f1a6c7<<0,p=i+0x170e9b5<<0):(a=0x2a01a605,b=(i=w[0]-0xc881298)-0x5ab00ac6<<0,p=i+0x8909ae5<<0),this.first=!1):(t=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),n=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),r=(a=f&_)^f&d^c,i=b+n+(m&v^~m&y)+h[e]+w[e],o=t+r,b=p+i<<0,p=i+o<<0),t=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),n=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7),r=(u=p&f)^p&_^a,i=y+n+(b&m^~b&v)+h[e+1]+w[e+1],o=t+r,y=d+i<<0,t=((d=i+o<<0)>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),n=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),r=(l=d&p)^d&f^u,i=v+n+(y&b^~y&m)+h[e+2]+w[e+2],o=t+r,v=_+i<<0,t=((_=i+o<<0)>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10),n=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),r=(c=_&d)^_&p^l,i=m+n+(v&y^~v&b)+h[e+3]+w[e+3],o=t+r,m=f+i<<0,f=i+o<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+f<<0,this.h1=this.h1+_<<0,this.h2=this.h2+d<<0,this.h3=this.h3+p<<0,this.h4=this.h4+m<<0,this.h5=this.h5+v<<0,this.h6=this.h6+y<<0,this.h7=this.h7+b<<0},g.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,u=c[e>>>28&15]+c[e>>>24&15]+c[e>>>20&15]+c[e>>>16&15]+c[e>>>12&15]+c[e>>>8&15]+c[e>>>4&15]+c[15&e]+c[t>>>28&15]+c[t>>>24&15]+c[t>>>20&15]+c[t>>>16&15]+c[t>>>12&15]+c[t>>>8&15]+c[t>>>4&15]+c[15&t]+c[n>>>28&15]+c[n>>>24&15]+c[n>>>20&15]+c[n>>>16&15]+c[n>>>12&15]+c[n>>>8&15]+c[n>>>4&15]+c[15&n]+c[r>>>28&15]+c[r>>>24&15]+c[r>>>20&15]+c[r>>>16&15]+c[r>>>12&15]+c[r>>>8&15]+c[r>>>4&15]+c[15&r]+c[i>>>28&15]+c[i>>>24&15]+c[i>>>20&15]+c[i>>>16&15]+c[i>>>12&15]+c[i>>>8&15]+c[i>>>4&15]+c[15&i]+c[o>>>28&15]+c[o>>>24&15]+c[o>>>20&15]+c[o>>>16&15]+c[o>>>12&15]+c[o>>>8&15]+c[o>>>4&15]+c[15&o]+c[s>>>28&15]+c[s>>>24&15]+c[s>>>20&15]+c[s>>>16&15]+c[s>>>12&15]+c[s>>>8&15]+c[s>>>4&15]+c[15&s];return this.is224||(u+=c[a>>>28&15]+c[a>>>24&15]+c[a>>>20&15]+c[a>>>16&15]+c[a>>>12&15]+c[a>>>8&15]+c[a>>>4&15]+c[15&a]),u},g.prototype.toString=g.prototype.hex,g.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,u=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r,i>>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s>>>24&255,s>>>16&255,s>>>8&255,255&s];return this.is224||u.push(a>>>24&255,a>>>16&255,a>>>8&255,255&a),u},g.prototype.array=g.prototype.digest,g.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},x.prototype=new g,x.prototype.finalize=function(){if(g.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();g.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),g.prototype.finalize.call(this)}};var k=v();k.sha256=k,k.sha224=v(!0),k.sha256.hmac=w(),k.sha224.hmac=w(!0),a?e.exports=k:(i.sha256=k.sha256,i.sha224=k.sha224,u&&define(function(){return k}))}()},"../../node_modules/preact-custom-element/dist/preact-custom-element.esm.js":function(e,t,n){n.d(t,{Z:()=>_});var r=n("../../node_modules/preact/dist/preact.module.js");function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var o=["context","children"];function s(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}(e,o);return(0,r.Tm)(t,n)}function a(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=(0,r.h)(s,i({},this._props,{context:e.detail.context}),function e(t,n){if(3===t.nodeType)return t.data;if(1!==t.nodeType)return null;var i=[],o={},s=0,a=t.attributes,l=t.childNodes;for(s=a.length;s--;)"slot"!==a[s].name&&(o[a[s].name]=a[s].value,o[u(a[s].name)]=a[s].value);for(s=l.length;s--;){var c=e(l[s],null),_=l[s].slot;_?o[_]=(0,r.h)(f,{name:_},c):i[s]=c}var h=n?(0,r.h)(f,null,i):i;return(0,r.h)(n||t.nodeName.toLowerCase(),o,h)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?r.ZB:r.sY)(this._vdom,this._root)}function u(e){return e.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():""})}function l(e,t,n){if(this._vdom){var i={};i[e]=n=null==n?void 0:n,i[u(e)]=n,this._vdom=(0,r.Tm)(this._vdom,i),(0,r.sY)(this._vdom,this._root)}}function c(){(0,r.sY)(this._vdom=null,this._root)}function f(e,t){var n=this;return(0,r.h)("slot",i({},e,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function _(e,t,n,r){function i(){var t=Reflect.construct(HTMLElement,[],i);return t._vdomComponent=e,t._root=r&&r.shadow?t.attachShadow({mode:r.mode||"open"}):t,t}return(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=a,i.prototype.attributeChangedCallback=l,i.prototype.disconnectedCallback=c,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),i.observedAttributes=n,n.forEach(function(e){Object.defineProperty(i.prototype,e,{get:function(){return this._vdom.props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());var n=typeof t;null!=t&&"string"!==n&&"boolean"!==n&&"number"!==n||this.setAttribute(e,t)}})}),customElements.define(t||e.tagName||e.displayName||e.name,i)}},"../../node_modules/preact/dist/preact.module.js":function(e,t,n){n.d(t,{HY:()=>x,Tm:()=>H,YM:()=>i,ZB:()=>$,az:()=>w,bR:()=>function e(t,n){return n=n||[],null==t||"boolean"==typeof t||(v(t)?t.some(function(t){e(t,n)}):n.push(t)),n},h:()=>w,sY:()=>T,wA:()=>k});var r,i,o,s,a,u,l,c,f,_,h,d={},p=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(e,t,n){var i,o,s,a={};for(s in t)"key"==s?i=t[s]:"ref"==s?o=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return g(e,a,i,o,null)}function g(e,t,n,r,s){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++o:s,__i:-1,__u:0};return null==s&&null!=i.vnode&&i.vnode(a),a}function x(e){return e.children}function k(e,t){this.props=e,this.context=t}function A(e,t){if(null==t)return e.__?A(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?A(e):null}function P(e){(!e.__d&&(e.__d=!0)&&s.push(e)&&!S.__r++||a!==i.debounceRendering)&&((a=i.debounceRendering)||u)(S)}function S(){for(var e,t,n,r,o,a,u=1;s.length;)s.length>u&&s.sort(l),e=s.shift(),u=s.length,e.__d&&(t=void 0,r=(n=e.__v).__e,o=[],a=[],e.__P&&((t=y({},n)).__v=n.__v+1,i.vnode&&i.vnode(t),B(e.__P,t,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,o,null==r?A(n):r,!!(32&n.__u),a),t.__v=n.__v,t.__.__k[t.__i]=t,E(o,t,a),t.__e!=r&&function e(t){var n,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,n=0;n<t.__k.length;n++)if(null!=(r=t.__k[n])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return e(t)}}(t)));S.__r=0}function C(e,t,n,r,o,s,a,u,l,c,f){var _,h,m,y,w,k,P=r&&r.__k||p,S=t.length;for(l=function(e,t,n,r,o){var s,a,u,l,c,f=n.length,_=f,h=0;for(e.__k=Array(o),s=0;s<o;s++)null!=(a=t[s])&&"boolean"!=typeof a&&"function"!=typeof a?(l=s+h,(a=e.__k[s]="string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?g(null,a,null,null,null):v(a)?g(x,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?g(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,u=null,-1!==(c=a.__i=function(e,t,n,r){var i,o,s=e.key,a=e.type,u=t[n];if(null===u&&null==e.key||u&&s==u.key&&a===u.type&&0==(2&u.__u))return n;if(r>+(null!=u&&0==(2&u.__u)))for(i=n-1,o=n+1;i>=0||o<t.length;){if(i>=0){if((u=t[i])&&0==(2&u.__u)&&s==u.key&&a===u.type)return i;i--}if(o<t.length){if((u=t[o])&&0==(2&u.__u)&&s==u.key&&a===u.type)return o;o++}}return -1}(a,n,l,_))&&(_--,(u=n[c])&&(u.__u|=2)),null==u||null===u.__v?(-1==c&&(o>f?h--:o<f&&h++),"function"!=typeof a.type&&(a.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,a.__u|=4))):e.__k[s]=null;if(_)for(s=0;s<f;s++)null!=(u=n[s])&&0==(2&u.__u)&&(u.__e==r&&(r=A(u)),function e(t,n,r){var o,s;if(i.unmount&&i.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||U(o,null,n)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){i.__e(e,n)}o.base=o.__P=null}if(o=t.__k)for(s=0;s<o.length;s++)o[s]&&e(o[s],n,r||"function"!=typeof t.type);r||b(t.__e),t.__c=t.__=t.__e=void 0}(u,u));return r}(n,t,P,l,S),_=0;_<S;_++)null!=(m=n.__k[_])&&(h=-1===m.__i?d:P[m.__i]||d,m.__i=_,k=B(e,m,h,o,s,a,u,l,c,f),y=m.__e,m.ref&&h.ref!=m.ref&&(h.ref&&U(h.ref,null,m),f.push(m.ref,m.__c||y,m)),null==w&&null!=y&&(w=y),4&m.__u||h.__k===m.__k?l=function e(t,n,r){var i,o;if("function"==typeof t.type){for(i=t.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=t,n=e(i[o],n,r));return n}t.__e!=n&&(n&&t.type&&!r.contains(n)&&(n=A(t)),r.insertBefore(t.__e,n||null),n=t.__e);do n=n&&n.nextSibling;while(null!=n&&8==n.nodeType);return n}(m,l,e):"function"==typeof m.type&&void 0!==k?l=k:y&&(l=y.nextSibling),m.__u&=-7);return n.__e=w,l}function I(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||m.test(t)?n:n+"px"}function j(e,t,n,r,i){var o;e:if("style"==t){if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||I(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||I(e.style,t,n[t])}}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(c,"$1")),t=t.toLowerCase()in e||"onFocusOut"==t||"onFocusIn"==t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=f,e.addEventListener(t,o?h:_,o)):e.removeEventListener(t,o?h:_,o);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function z(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=f++;else if(t.t<n.u)return;return n(i.event?i.event(t):t)}}}function B(e,t,n,o,s,a,u,l,c,f){var _,h,p,m,w,g,P,S,I,z,B,E,U,T,$,H,M,N,V=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),a=[l=t.__e=n.__e]),(_=i.__b)&&_(t);e:if("function"==typeof V)try{if(S=t.props,I="prototype"in V&&V.prototype.render,z=(_=V.contextType)&&o[_.__c],B=_?z?z.props.value:_.__:o,n.__c?P=(h=t.__c=n.__c).__=h.__E:(I?t.__c=h=new V(S,B):(t.__c=h=new k(S,B),h.constructor=V,h.render=O),z&&z.sub(h),h.props=S,h.state||(h.state={}),h.context=B,h.__n=o,p=h.__d=!0,h.__h=[],h._sb=[]),I&&null==h.__s&&(h.__s=h.state),I&&null!=V.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=y({},h.__s)),y(h.__s,V.getDerivedStateFromProps(S,h.__s))),m=h.props,w=h.state,h.__v=t,p)I&&null==V.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),I&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(I&&null==V.getDerivedStateFromProps&&S!==m&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(S,B),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(S,h.__s,B)||t.__v==n.__v)){for(t.__v!=n.__v&&(h.props=S,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),E=0;E<h._sb.length;E++)h.__h.push(h._sb[E]);h._sb=[],h.__h.length&&u.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(S,h.__s,B),I&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(m,w,g)})}if(h.context=B,h.props=S,h.__P=e,h.__e=!1,U=i.__r,T=0,I){for(h.state=h.__s,h.__d=!1,U&&U(t),_=h.render(h.props,h.state,h.context),$=0;$<h._sb.length;$++)h.__h.push(h._sb[$]);h._sb=[]}else do h.__d=!1,U&&U(t),_=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++T<25);h.state=h.__s,null!=h.getChildContext&&(o=y(y({},o),h.getChildContext())),I&&!p&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(m,w)),M=(H=null!=_&&_.type===x&&null==_.key)?_.props.children:_,H&&(_.props.children=null),l=C(e,v(M)?M:[M],t,n,o,s,a,u,l,c,f),h.base=t.__e,t.__u&=-161,h.__h.length&&u.push(h),P&&(h.__E=h.__=null)}catch(e){if(t.__v=null,c||null!=a){if(e.then){for(t.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,t.__e=l}else for(N=a.length;N--;)b(a[N])}else t.__e=n.__e,t.__k=n.__k;i.__e(e,t,n)}else null==a&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=function(e,t,n,o,s,a,u,l,c){var f,_,h,p,m,y,w,g=n.props,x=t.props,k=t.type;if("svg"==k?s="http://www.w3.org/2000/svg":"math"==k?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=a){for(f=0;f<a.length;f++)if((m=a[f])&&"setAttribute"in m==!!k&&(k?m.localName==k:3==m.nodeType)){e=m,a[f]=null;break}}if(null==e){if(null==k)return document.createTextNode(x);e=document.createElementNS(s,k,x.is&&x),l&&(i.__m&&i.__m(t,a),l=!1),a=null}if(null===k)g===x||l&&e.data===x||(e.data=x);else{if(a=a&&r.call(e.childNodes),g=n.props||d,!l&&null!=a)for(g={},f=0;f<e.attributes.length;f++)g[(m=e.attributes[f]).name]=m.value;for(f in g)if(m=g[f],"children"==f);else if("dangerouslySetInnerHTML"==f)h=m;else if(!(f in x)){if("value"==f&&"defaultValue"in x||"checked"==f&&"defaultChecked"in x)continue;j(e,f,null,m,s)}for(f in x)m=x[f],"children"==f?p=m:"dangerouslySetInnerHTML"==f?_=m:"value"==f?y=m:"checked"==f?w=m:l&&"function"!=typeof m||g[f]===m||j(e,f,m,g[f],s);if(_)l||h&&(_.__html===h.__html||_.__html===e.innerHTML)||(e.innerHTML=_.__html),t.__k=[];else if(h&&(e.innerHTML=""),C("template"===t.type?e.content:e,v(p)?p:[p],t,n,o,"foreignObject"==k?"http://www.w3.org/1999/xhtml":s,a,u,a?a[0]:n.__k&&A(n,0),l,c),null!=a)for(f=a.length;f--;)b(a[f]);l||(f="value","progress"==k&&null==y?e.removeAttribute("value"):void 0===y||y===e[f]&&("progress"!=k||y)&&("option"!=k||y===g[f])||j(e,f,y,g[f],s),f="checked",void 0!==w&&w!==e[f]&&j(e,f,w,g[f],s))}return e}(n.__e,t,n,o,s,a,u,c,f);return(_=i.diffed)&&_(t),128&t.__u?void 0:l}function E(e,t,n){for(var r=0;r<n.length;r++)U(n[r],n[++r],n[++r]);i.__c&&i.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){i.__e(e,t.__v)}})}function U(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){i.__e(e,n)}}function O(e,t,n){return this.constructor(e,n)}function T(e,t,n){var o,s,a,u;t==document&&(t=document.documentElement),i.__&&i.__(e,t),s=(o="function"==typeof n)?null:n&&n.__k||t.__k,a=[],u=[],B(t,e=(!o&&n||t).__k=w(x,null,[e]),s||d,d,t.namespaceURI,!o&&n?[n]:s?null:t.firstChild?r.call(t.childNodes):null,a,!o&&n?n:s?s.__e:t.firstChild,o,u),E(a,e,u)}function $(e,t){T(e,t,$)}function H(e,t,n){var i,o,s,a,u=y({},e.props);for(s in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==s?i=t[s]:"ref"==s?o=t[s]:u[s]=void 0===t[s]&&void 0!==a?a[s]:t[s];return arguments.length>2&&(u.children=arguments.length>3?r.call(arguments,2):n),g(e.type,u,i||e.key,o||e.ref,null)}r=p.slice,i={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},o=0,k.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=y({},this.state),"function"==typeof e&&(e=e(y({},n),this.props)),e&&y(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),P(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),P(this))},k.prototype.render=x,s=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},S.__r=0,c=/(PointerCapture)$|Capture$/i,f=0,_=z(!1),h=z(!0)},"../../node_modules/preact/hooks/dist/hooks.module.js":function(e,t,n){n.d(t,{I4:()=>x,Ye:()=>g,d4:()=>b,eJ:()=>y,sO:()=>w});var r,i,o,s,a=n("../../node_modules/preact/dist/preact.module.js"),u=0,l=[],c=a.YM,f=c.__b,_=c.__r,h=c.diffed,d=c.__c,p=c.unmount,m=c.__;function v(e,t){c.__h&&c.__h(i,e,u||t),u=0;var n=i.__H||(i.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function y(e){return u=1,function(e,t,n){var o=v(r++,2);if(o.t=e,!o.__c&&(o.__=[I(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=i,!i.__f)){var s=function(e,t,n){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter(function(e){return!!e.__c});if(r.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var i=o.__c.props!==e;return r.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}}),a&&a.call(this,e,t,n)||i};i.__f=!0;var a=i.shouldComponentUpdate,u=i.componentWillUpdate;i.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,s(e,t,n),a=r}u&&u.call(this,e,t,n)},i.shouldComponentUpdate=s}return o.__N||o.__}(I,e)}function b(e,t){var n=v(r++,3);!c.__s&&C(n.__H,t)&&(n.__=e,n.u=t,i.__H.__h.push(n))}function w(e){return u=5,g(function(){return{current:e}},[])}function g(e,t){var n=v(r++,7);return C(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function x(e,t){return u=8,g(function(){return e},t)}function k(){for(var e;e=l.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(P),e.__H.__h.forEach(S),e.__H.__h=[]}catch(t){e.__H.__h=[],c.__e(t,e.__v)}}c.__b=function(e){i=null,f&&f(e)},c.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),m&&m(e,t)},c.__r=function(e){_&&_(e),r=0;var t=(i=e.__c).__H;t&&(o===i?(t.__h=[],i.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(P),t.__h.forEach(S),t.__h=[],r=0)),o=i},c.diffed=function(e){h&&h(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&s===c.requestAnimationFrame||((s=c.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),A&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);A&&(t=requestAnimationFrame(n))})(k)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),o=i=null},c.__c=function(e,t){t.some(function(e){try{e.__h.forEach(P),e.__h=e.__h.filter(function(e){return!e.__||S(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],c.__e(n,e.__v)}}),d&&d(e,t)},c.unmount=function(e){p&&p(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{P(e)}catch(e){t=e}}),n.__H=void 0,t&&c.__e(t,n.__v))};var A="function"==typeof requestAnimationFrame;function P(e){var t=i,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),i=t}function S(e){var t=i;e.__c=e.__(),i=t}function C(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function I(e,t){return"function"==typeof t?t(e):t}},"../../node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js":function(e,t,n){n.d(t,{BX:()=>o,HY:()=>r.HY,tZ:()=>o});var r=n("../../node_modules/preact/dist/preact.module.js"),i=0;function o(e,t,n,o,s,a){t||(t={});var u,l,c=t;if("ref"in c)for(l in c={},t)"ref"==l?u=t[l]:c[l]=t[l];var f={type:e,props:c,key:n,ref:u,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--i,__i:-1,__u:0,__source:s,__self:a};if("function"==typeof e&&(u=e.defaultProps))for(l in u)void 0===c[l]&&(c[l]=u[l]);return r.YM.vnode&&r.YM.vnode(f),f}},"../../node_modules/viem/_esm/errors/base.js":function(e,t,n){n.d(t,{G:()=>o});let r="2.22.23",i={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${r}`};class o extends Error{constructor(e,t={}){let n=t.cause instanceof o?t.cause.details:t.cause?.message?t.cause.message:t.details,s=t.cause instanceof o&&t.cause.docsPath||t.docsPath,a=i.getDocsUrl?.({...t,docsPath:s});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...i.version?[`Version: ${i.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=s,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=r}walk(e){return function e(t,n){return n?.(t)?t:t&&"object"==typeof t&&"cause"in t&&void 0!==t.cause?e(t.cause,n):n?null:t}(this,e)}}},"../../node_modules/viem/_esm/errors/encoding.js":function(e,t,n){n.d(t,{J5:()=>i,M6:()=>o});var r=n("../../node_modules/viem/_esm/errors/base.js");class i extends r.G{constructor({max:e,min:t,signed:n,size:r,value:i}){super(`Number "${i}" is not in safe ${r?`${8*r}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}r.G,r.G,r.G;class o extends r.G{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}},"../../node_modules/viem/_esm/utils/address/isAddressEqual.js":function(e,t,n){n.d(t,{E:()=>_});var r=n("../../node_modules/viem/_esm/errors/base.js");class i extends r.G{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class o extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}var s=n("../../node_modules/viem/_esm/utils/encoding/toBytes.js"),a=n("../../node_modules/viem/_esm/utils/hash/keccak256.js");let u=new o(8192),l=/^0x[a-fA-F0-9]{40}$/,c=new o(8192);function f(e,t){let{strict:n=!0}=t??{},r=`${e}.${n}`;if(c.has(r))return c.get(r);let i=!!l.test(e)&&(e.toLowerCase()===e||!n||function(e,t){if(u.has(`${e}.undefined`))return u.get(`${e}.${void 0}`);let n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),r=(0,a.w)((0,s.qX)(n),"bytes"),i=(t?n.substring(`${t}0x`.length):n).split("");for(let e=0;e<40;e+=2)r[e>>1]>>4>=8&&i[e]&&(i[e]=i[e].toUpperCase()),(15&r[e>>1])>=8&&i[e+1]&&(i[e+1]=i[e+1].toUpperCase());let o=`0x${i.join("")}`;return u.set(`${e}.${t}`,o),o}(e)===e);return c.set(r,i),i}function _(e,t){if(!f(e,{strict:!1}))throw new i({address:e});if(!f(t,{strict:!1}))throw new i({address:t});return e.toLowerCase()===t.toLowerCase()}},"../../node_modules/viem/_esm/utils/data/concat.js":function(e,t,n){n.d(t,{SM:()=>r});function r(e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}},"../../node_modules/viem/_esm/utils/data/isHex.js":function(e,t,n){n.d(t,{v:()=>r});function r(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}},"../../node_modules/viem/_esm/utils/data/pad.js":function(e,t,n){n.d(t,{vk:()=>o});var r=n("../../node_modules/viem/_esm/errors/base.js");r.G;class i extends r.G{constructor({size:e,targetSize:t,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function o(e,{dir:t,size:n=32}={}){return"string"==typeof e?function(e,{dir:t,size:n=32}={}){if(null===n)return e;let r=e.replace("0x","");if(r.length>2*n)throw new i({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r["right"===t?"padEnd":"padStart"](2*n,"0")}`}(e,{dir:t,size:n}):function(e,{dir:t,size:n=32}={}){if(null===n)return e;if(e.length>n)throw new i({size:e.length,targetSize:n,type:"bytes"});let r=new Uint8Array(n);for(let i=0;i<n;i++){let o="right"===t;r[o?i:n-i-1]=e[o?i:e.length-i-1]}return r}(e,{dir:t,size:n})}r.G},"../../node_modules/viem/_esm/utils/encoding/fromHex.js":function(e,t,n){n.d(t,{Yf:()=>s});var r=n("../../node_modules/viem/_esm/errors/encoding.js"),i=n("../../node_modules/viem/_esm/utils/data/isHex.js");function o(e){return(0,i.v)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function s(e,{size:t}){if(o(e)>t)throw new r.M6({givenSize:o(e),maxSize:t})}},"../../node_modules/viem/_esm/utils/encoding/toBytes.js":function(e,t,n){n.d(t,{O0:()=>l,nr:()=>_,qX:()=>h});var r=n("../../node_modules/viem/_esm/errors/base.js"),i=n("../../node_modules/viem/_esm/utils/data/isHex.js"),o=n("../../node_modules/viem/_esm/utils/data/pad.js"),s=n("../../node_modules/viem/_esm/utils/encoding/fromHex.js"),a=n("../../node_modules/viem/_esm/utils/encoding/toHex.js");let u=new TextEncoder;function l(e,t={}){var n,r;return"number"==typeof e||"bigint"==typeof e?(n=e,r=t,_((0,a.eC)(n,r))):"boolean"==typeof e?function(e,t={}){let n=new Uint8Array(1);return(n[0]=Number(e),"number"==typeof t.size)?((0,s.Yf)(n,{size:t.size}),(0,o.vk)(n,{size:t.size})):n}(e,t):(0,i.v)(e)?_(e,t):h(e,t)}let c={zero:48,nine:57,A:65,F:70,a:97,f:102};function f(e){return e>=c.zero&&e<=c.nine?e-c.zero:e>=c.A&&e<=c.F?e-(c.A-10):e>=c.a&&e<=c.f?e-(c.a-10):void 0}function _(e,t={}){let n=e;t.size&&((0,s.Yf)(n,{size:t.size}),n=(0,o.vk)(n,{dir:"right",size:t.size}));let i=n.slice(2);i.length%2&&(i=`0${i}`);let a=i.length/2,u=new Uint8Array(a);for(let e=0,t=0;e<a;e++){let n=f(i.charCodeAt(t++)),o=f(i.charCodeAt(t++));if(void 0===n||void 0===o)throw new r.G(`Invalid byte sequence ("${i[t-2]}${i[t-1]}" in "${i}").`);u[e]=16*n+o}return u}function h(e,t={}){let n=u.encode(e);return"number"==typeof t.size?((0,s.Yf)(n,{size:t.size}),(0,o.vk)(n,{dir:"right",size:t.size})):n}},"../../node_modules/viem/_esm/utils/encoding/toHex.js":function(e,t,n){n.d(t,{NC:()=>a,ci:()=>u,eC:()=>l});var r=n("../../node_modules/viem/_esm/errors/encoding.js"),i=n("../../node_modules/viem/_esm/utils/data/pad.js"),o=n("../../node_modules/viem/_esm/utils/encoding/fromHex.js");let s=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e,t={}){return"number"==typeof e||"bigint"==typeof e?l(e,t):"string"==typeof e?function(e,t={}){return u(c.encode(e),t)}(e,t):"boolean"==typeof e?function(e,t={}){let n=`0x${Number(e)}`;return"number"==typeof t.size?((0,o.Yf)(n,{size:t.size}),(0,i.vk)(n,{size:t.size})):n}(e,t):u(e,t)}function u(e,t={}){let n="";for(let t=0;t<e.length;t++)n+=s[e[t]];let r=`0x${n}`;return"number"==typeof t.size?((0,o.Yf)(r,{size:t.size}),(0,i.vk)(r,{dir:"right",size:t.size})):r}function l(e,t={}){let n;let{signed:o,size:s}=t,a=BigInt(e);s?n=o?(1n<<8n*BigInt(s)-1n)-1n:2n**(8n*BigInt(s))-1n:"number"==typeof e&&(n=BigInt(Number.MAX_SAFE_INTEGER));let u="bigint"==typeof n&&o?-n-1n:0;if(n&&a>n||a<u){let t="bigint"==typeof e?"n":"";throw new r.J5({max:n?`${n}${t}`:void 0,min:`${u}${t}`,signed:o,size:s,value:`${e}${t}`})}let c=`0x${(o&&a<0?(1n<<BigInt(8*s))+BigInt(a):a).toString(16)}`;return s?(0,i.vk)(c,{size:s}):c}let c=new TextEncoder},"../../node_modules/viem/_esm/utils/hash/keccak256.js":function(e,t,n){function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function i(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function o(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}n.d(t,{w:()=>O});let s=BigInt(0x100000000-1),a=BigInt(32),u=(e,t,n)=>e<<n|t>>>32-n,l=(e,t,n)=>t<<n|e>>>32-n,c=(e,t,n)=>t<<n-32|e>>>64-n,f=(e,t,n)=>e<<n-32|t>>>64-n,_=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0];function h(e){for(let n=0;n<e.length;n++){var t;e[n]=(t=e[n])<<24&0xff000000|t<<8&0xff0000|t>>>8&65280|t>>>24&255}}function d(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}(e)),i(e),e}class p{clone(){return this._cloneInto()}}let m=[],v=[],y=[],b=BigInt(0),w=BigInt(1),g=BigInt(2),x=BigInt(7),k=BigInt(256),A=BigInt(113);for(let e=0,t=w,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],m.push(2*(5*r+n)),v.push((e+1)*(e+2)/2%64);let i=b;for(let e=0;e<7;e++)(t=(t<<w^(t>>x)*A)%k)&g&&(i^=w<<(w<<BigInt(e))-w);y.push(i)}let[P,S]=function(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:u}=function(e,t=!1){return t?{h:Number(e&s),l:Number(e>>a&s)}:{h:0|Number(e>>a&s),l:0|Number(e&s)}}(e[i],t);[n[i],r[i]]=[o,u]}return[n,r]}(y,!0),C=(e,t,n)=>n>32?c(e,t,n):u(e,t,n),I=(e,t,n)=>n>32?f(e,t,n):l(e,t,n);class j extends p{constructor(e,t,n,i=!1,o=24){var s;if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,r(n),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=new Uint32Array((s=this.state).buffer,s.byteOffset,Math.floor(s.byteLength/4))}keccak(){_||h(this.state32),function(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let r=(t+8)%10,i=(t+2)%10,o=n[i],s=n[i+1],a=C(o,s,1)^n[r],u=I(o,s,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=a,e[t+n+1]^=u}let t=e[2],i=e[3];for(let n=0;n<24;n++){let r=v[n],o=C(t,i,r),s=I(t,i,r),a=m[n];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=P[r],e[1]^=S[r]}n.fill(0)}(this.state32,this.rounds),_||h(this.state32),this.posOut=0,this.pos=0}update(e){o(this);let{blockLen:t,state:n}=this,r=(e=d(e)).length;for(let i=0;i<r;){let o=Math.min(t-this.pos,r-i);for(let t=0;t<o;t++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,(128&t)!=0&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){o(this,!1),i(e),this.finish();let t=this.state,{blockLen:n}=this;for(let r=0,i=e.length;r<i;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,i-r);e.set(t.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return r(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(!function(e,t){i(e);let n=t.outputLen;if(e.length<n)throw Error("digestInto() expects output buffer of length at least "+n)}(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:r,rounds:i,enableXOF:o}=this;return e||(e=new j(t,n,r,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=r,e.enableXOF=o,e.destroyed=this.destroyed,e}}let z=function(e){let t=t=>e().update(d(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}(()=>new j(136,1,32));var B=n("../../node_modules/viem/_esm/utils/data/isHex.js"),E=n("../../node_modules/viem/_esm/utils/encoding/toBytes.js"),U=n("../../node_modules/viem/_esm/utils/encoding/toHex.js");function O(e,t){let n=z((0,B.v)(e,{strict:!1})?(0,E.O0)(e):e);return"bytes"===(t||"hex")?n:(0,U.NC)(n)}}};
@@ -1,10 +0,0 @@
1
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
2
-
3
- /**
4
- * [js-sha256]{@link https://github.com/emn178/js-sha256}
5
- *
6
- * @version 0.11.0
7
- * @author Chen, Yi-Cyuan [emn178@gmail.com]
8
- * @copyright Chen, Yi-Cyuan 2014-2024
9
- * @license MIT
10
- */
@@ -1 +0,0 @@
1
- export const ids=["766"];export const modules={"./src/components/ButtonShare/index.ts":function(e,t,o){o.r(t),o.d(t,{ButtonShare:()=>S});var n=o("./src/utils/registerWebComponent.ts"),r=o("../../node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js");let i=function(){for(var e,t,o=0,n="",r=arguments.length;o<r;o++)(e=arguments[o])&&(t=function e(t){var o,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t){if(Array.isArray(t)){var i=t.length;for(o=0;o<i;o++)t[o]&&(n=e(t[o]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n)}return r}(e))&&(n&&(n+=" "),n+=t);return n},a="spinner__leaf-xtOJmT",s=({ref:e,className:t,...o})=>(0,r.BX)("span",{...o,ref:e,className:i("spinner-KHk8mw"),children:[(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a}),(0,r.tZ)("span",{className:a})]});s.displayName="Spinner";var l=o("./src/hooks/useClientReady.ts"),c=o("./src/hooks/useReward.ts"),d=o("../core/dist/actions.js"),p=o("../../node_modules/preact/hooks/dist/hooks.module.js");let u={marginTop:"16px",padding:"16px",backgroundColor:"#FEE2E2",border:"1px solid #FCA5A5",borderRadius:"4px",color:"#991B1B"},m={display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},f={margin:0,fontSize:"16px",fontWeight:500},h={fontSize:"14px",lineHeight:"1.5",margin:"0 0 12px 0"},b={color:"#991B1B",textDecoration:"underline",textUnderlineOffset:"2px"},x={display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"10px",padding:"8px 12px",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"4px",color:"black",fontSize:"14px",fontWeight:500};function y({debugInfo:e}){let[t,o]=(0,p.eJ)(!1);return(0,r.BX)("div",{children:[(0,r.tZ)("button",{type:"button",style:x,onClick:()=>o(!t),children:"Ouvrir les informations"}),t&&(0,r.tZ)("textarea",{style:{display:"block",width:"100%",height:"200px",fontSize:"12px"},children:e})]})}function g({debugInfo:e}){let{copied:t,copy:o}=function(e={}){let{successDuration:t=2e3}=e,[o,n]=(0,p.eJ)(!1);return{copy:(0,p.I4)(async e=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e),n(!0);else{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),n(!0)}catch(e){return console.error("Failed to copy text:",e),!1}finally{t.remove()}}return setTimeout(()=>{n(!1)},t),!0}catch(e){return console.error("Failed to copy text:",e),!1}},[t]),copied:o}}();return(0,r.BX)("div",{style:u,children:[(0,r.tZ)("div",{style:m,children:(0,r.tZ)("h3",{style:f,children:"Oups ! Nous avons rencontr\xe9 un petit probl\xe8me"})}),(0,r.BX)("p",{style:h,children:["Impossible d'ouvrir le menu de partage pour le moment. Si le probl\xe8me persiste, copiez les informations ci-dessous et collez-les dans votre mail \xe0"," ",(0,r.tZ)("a",{href:"mailto:help@frak-labs.com?subject=Debug",style:b,children:"help@frak-labs.com"})," ",(0,r.tZ)("br",{}),"Merci pour votre retour, nous traitons votre demande dans les plus brefs d\xe9lais."]}),(0,r.tZ)("button",{type:"button",onClick:()=>o(e??""),style:x,children:t?"Informations copi\xe9es !":"Copier les informations de d\xe9bogage"}),(0,r.tZ)(y,{debugInfo:e})]})}var w=o("./src/utils/setup.ts"),k=o("../core/dist/index.js");async function v(){if(!window.FrakSetup?.client)throw Error("Frak client not found");await (0,d.Hq)(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function S({text:e="Share and earn!",classname:t="",useReward:o,noRewardText:n,targetInteraction:a,showWallet:d}){let u=(0,p.Ye)(()=>void 0!==o,[o]),m=(0,p.Ye)(()=>void 0!==d,[d]),{isClientReady:f}=(0,l.t)(),{reward:h}=(0,c.w)(u&&f,a),{handleShare:b,isError:x,debugInfo:y}=function(e){let[t,o]=(0,p.eJ)(void 0),[n,r]=(0,p.eJ)(!1);return{handleShare:(0,p.I4)(async()=>{if(!window.FrakSetup?.client){console.error("Frak client not found"),o(k.oC.empty().formatDebugInfo("Frak client not found")),r(!0);return}let t=(0,w.Gt)();if(!t)throw Error("modalBuilderSteps not found");try{await t.sharing(window.FrakSetup?.modalShareConfig??{}).display(t=>({...t,targetInteraction:e}))}catch(e){if(e instanceof k.u&&e.code===k.ss.clientAborted){console.debug("User aborted the modal");return}o(window.FrakSetup.client.debugInfo.formatDebugInfo(e)),r(!0),console.error("Error while opening the modal",e)}},[e]),isError:n,debugInfo:t}}(a),S=(0,p.Ye)(()=>u?h?e.includes("{REWARD}")?e.replace("{REWARD}",h):`${e} ${h}`:n??e.replace("{REWARD}",""):e,[u,e,n,h]),Z=(0,p.I4)(async()=>await (m?v():b()),[m,b]);return(0,r.BX)(r.HY,{children:[(0,r.BX)("button",{type:"button",className:i("buttonShare-F23Y9m",t),onClick:Z,children:[!f&&(0,r.tZ)(s,{})," ",S]}),x&&(0,r.tZ)(g,{debugInfo:y})]})}(0,n.A)(S,"frak-button-share",["text"],{shadow:!1})}};
@@ -1 +0,0 @@
1
- frak-button-wallet{z-index:2000000;position:fixed;bottom:20px}frak-button-wallet.left{left:20px}frak-button-wallet.right{right:20px}frak-button-wallet button,frak-button-wallet [type=button]{all:unset;cursor:pointer;text-align:center;background-color:#3e557e;border-radius:50%;justify-content:center;align-items:center;width:45px;height:45px;display:flex;position:relative}frak-button-wallet span{color:#fff;white-space:nowrap;background:#ff3f3f;border-radius:5px;padding:2px 3px;font-size:9px;font-weight:600;line-height:9px;position:absolute;top:-4px;right:27px}
@@ -1 +0,0 @@
1
- export const ids=["438"];export const modules={"./src/components/ButtonWallet/index.ts":function(e,t,n){n.r(t),n.d(t,{ButtonWallet:()=>W});var o=n("./src/utils/registerWebComponent.ts"),r=n("../../node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js"),i=n("./src/hooks/useClientReady.ts"),l=n("./src/hooks/useReward.ts"),a=n("../../node_modules/preact/hooks/dist/hooks.module.js"),_=n("../../node_modules/preact/dist/preact.module.js");function u(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function c(e,t){this.props=e,this.context=t}(c.prototype=new _.wA).isPureReactComponent=!0,c.prototype.shouldComponentUpdate=function(e,t){return u(this.props,e)||u(this.state,t)};var s=_.YM.__b;_.YM.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),s&&s(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var p=_.YM.__e;_.YM.__e=function(e,t,n,o){if(e.then){for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t)}p(e,t,n,o)};var f=_.YM.unmount;function d(){this.__u=0,this.o=null,this.__b=null}function v(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function h(){this.i=null,this.l=null}_.YM.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),f&&f(e)},(d.prototype=new _.wA).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=v(o.__v),i=!1,l=function(){i||(i=!0,n.__R=null,r?r(a):a())};n.__R=l;var a=function(){if(!--o.__u){if(o.state.__a){var e,t=o.state.__a;o.__v.__k[0]=function e(t,n,o){return t&&o&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)}),t.__c&&t.__c.__P===n&&(t.__e&&o.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=o)),t}(t,t.__c.__P,t.__c.__O)}for(o.setState({__a:o.__b=null});e=o.o.pop();)e.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(l,l)},d.prototype.componentWillUnmount=function(){this.o=[]},d.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,o){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=function(e,t){for(var n in t)e[n]=t[n];return e}({},t)).__c&&(t.__c.__P===o&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,n,o)})),t}(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&(0,_.az)(_.HY,null,e.fallback);return r&&(r.__u&=-33),[(0,_.az)(_.HY,null,t.__a?null:e.children),r]};var m=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(h.prototype=new _.wA).__a=function(e){var t=this,n=v(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),m(t,e,o)):r()};n?n(i):i()}},h.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,_.bR)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},h.prototype.componentDidUpdate=h.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){m(e,n,t)})};var b="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,y=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,w=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,k=/[A-Z0-9]/g,g="undefined"!=typeof document;_.wA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(_.wA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var M=_.YM.event;function S(){}function Y(){return this.cancelBubble}function x(){return this.defaultPrevented}_.YM.event=function(e){return M&&(e=M(e)),e.persist=S,e.isPropagationStopped=Y,e.isDefaultPrevented=x,e.nativeEvent=e};var P={enumerable:!1,configurable:!0,get:function(){return this.class}},R=_.YM.vnode;_.YM.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},r=-1===n.indexOf("-");for(var i in t){var l=t[i];if(!("value"===i&&"defaultValue"in t&&null==l||g&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var a,u=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===l?l="":"translate"===u&&"no"===l?l=!1:"o"===u[0]&&"n"===u[1]?"ondoubleclick"===u?i="ondblclick":"onchange"!==u||"input"!==n&&"textarea"!==n||(a=t.type,("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(a))?"onfocus"===u?i="onfocusin":"onblur"===u?i="onfocusout":w.test(i)&&(i=u):u=i="oninput":r&&y.test(i)?i=i.replace(k,"-$&").toLowerCase():null===l&&(l=void 0),"oninput"===u&&o[i=u]&&(i="oninputCapture"),o[i]=l}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,_.bR)(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==n&&null!=o.defaultValue&&(o.value=(0,_.bR)(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value})),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",P)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=b,R&&R(e)};var C=_.YM.__r;_.YM.__r=function(e){C&&C(e),e.__c};var O=_.YM.diffed;_.YM.diffed=function(e){O&&O(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};let A=e=>(0,r.tZ)("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 28 28",...e,children:(0,r.tZ)("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M23.143 14v11.428H4.857V14M14 25.428V8.286m0 0H8.857a2.857 2.857 0 0 1 0-5.715c4 0 5.143 5.715 5.143 5.715m0 0h5.143a2.857 2.857 0 1 0 0-5.715c-4 0-5.143 5.715-5.143 5.715m-11.429 0h22.857V14H2.571z"})});var j=n("../core/dist/actions.js");function H(){if(!window.FrakSetup?.client){console.error("Frak client not found");return}"vibrate"in navigator?navigator.vibrate(10):console.log("Vibration not supported"),(0,j.Hq)(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function W({classname:e="",useReward:t,targetInteraction:n}){let o=(0,a.Ye)(()=>void 0!==t,[t]),_=(0,a.sO)(null),{isClientReady:u}=(0,i.t)(),{reward:c}=(0,l.w)(o&&u,n);return(0,a.d4)(()=>{let e=window.FrakSetup?.modalWalletConfig?.metadata?.position;_.current?.parentElement?.classList.add(e??"right")},[]),(0,r.BX)("button",{ref:_,type:"button",class:e,disabled:!u,onClick:H,children:[(0,r.tZ)(A,{}),c&&(0,r.tZ)("span",{children:c})]})}(0,o.A)(W,"frak-button-wallet",[],{shadow:!1})}};