@stakekit/widget 0.0.293 → 0.0.294
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/dist/bundle/{DateTime-BBRIKkPv.js → DateTime-CMMZj2i-.js} +54 -54
- package/dist/bundle/{assets-vw12jo1v.js → assets-Bc9gJ-IT.js} +6 -6
- package/dist/bundle/{cardano-connector-DCWdS4Lt.js → cardano-connector-4FH7sm5s.js} +2 -2
- package/dist/bundle/{configured-chains-Bc6_pgMo.js → configured-chains-DF5IpaPp.js} +1 -1
- package/dist/bundle/{cosmos-connector-meta-Br67nymZ.js → cosmos-connector-meta-BKRBGzAs.js} +1 -1
- package/dist/bundle/index.bundle.js +13834 -13695
- package/dist/bundle/{ledger-connector-wZ-AWITi.js → ledger-connector-Em3Ex6Ns.js} +5 -5
- package/dist/bundle/{network-D8-Flo2u.js → network-D2ajkWp0.js} +1 -1
- package/dist/bundle/{reward-rate-chart-B41r4AU4.js → reward-rate-chart-6q6gJawR.js} +4 -4
- package/dist/bundle/{solana-connector-CXe_nU4I.js → solana-connector-DHrdMGZC.js} +3 -3
- package/dist/bundle/{stellar-connector-Cdl9Hnba.js → stellar-connector-DkR_jg41.js} +2 -2
- package/dist/bundle/{styles.css-BJ7-ORZP.js → styles.css-DQG3ba8V.js} +6 -6
- package/dist/bundle/{substrate-connector-DFeFqV_q.js → substrate-connector-CzewVoQ6.js} +1 -1
- package/dist/bundle/{ton-connector-CWmOukzn.js → ton-connector-CcahoFeW.js} +3 -3
- package/dist/bundle/{transaction-BwhgjU0e.js → transaction-BGiGADTK.js} +1 -1
- package/dist/bundle/{transaction-CUoDE6CU.js → transaction-BvpQWKqm.js} +1 -1
- package/dist/bundle/{transaction-B8S7Vgaq.js → transaction-CD_QhA6u.js} +2 -2
- package/dist/bundle/{transaction-DxrR2BHC.js → transaction-CiEShf7a.js} +1 -1
- package/dist/bundle/{tron-connector--M_0_Iy7.js → tron-connector-Dy_36o_J.js} +3 -3
- package/dist/bundle/{utils-CoW929-6.js → utils-BMTuLksW.js} +1 -1
- package/dist/bundle/{wallet-manager-C3rmOq7t.js → wallet-manager-BLaLHs2U.js} +11 -11
- package/dist/package/{DateTime-DJZXpaqx.js → DateTime-CGVpQQm9.js} +24 -2
- package/dist/package/{assets-BuIo5TOF.js → assets-CEn8BPdT.js} +1 -1
- package/dist/package/{cardano-connector-DIZuipB7.js → cardano-connector-BDWTBXaS.js} +2 -2
- package/dist/package/{configured-chains-B6PD9hvx.js → configured-chains-CRuy8tse.js} +1 -1
- package/dist/package/{cosmos-connector-meta-CgvZWkLV.js → cosmos-connector-meta-B-ke1Dvw.js} +1 -1
- package/dist/package/index.package.js +1682 -1449
- package/dist/package/{ledger-connector-B3kEcKjM.js → ledger-connector-BQDRUjOJ.js} +5 -5
- package/dist/package/{network-B4Qs3uRl.js → network-K03Uj00V.js} +1 -1
- package/dist/package/{reward-rate-chart-B42ZCby7.js → reward-rate-chart-DBx39GdL.js} +2 -2
- package/dist/package/{solana-connector-VG2pC1EJ.js → solana-connector-fL70NOkD.js} +3 -3
- package/dist/package/{stellar-connector-DO9tJUOg.js → stellar-connector-C_33sqO5.js} +2 -2
- package/dist/package/{styles.css-DwJjrmLr.js → styles.css-BOghDWGq.js} +1 -1
- package/dist/package/{substrate-connector-P80MVt5T.js → substrate-connector-Cr7LEt2o.js} +1 -1
- package/dist/package/{ton-connector-3rqiqNZO.js → ton-connector-81-rUhzX.js} +3 -3
- package/dist/package/{transaction-DTbU7sxm.js → transaction-BHIZ9rKF.js} +1 -1
- package/dist/package/{transaction-CuMGfUeE.js → transaction-C5e_gCK6.js} +1 -1
- package/dist/package/{transaction-V39s0qKU.js → transaction-DMMfLvk1.js} +2 -2
- package/dist/package/{transaction-Do_oUKxl.js → transaction-DgdU5pHH.js} +1 -1
- package/dist/package/{tron-connector-CKUZFHDh.js → tron-connector-Cuez3U16.js} +3 -3
- package/dist/package/{wallet-manager-CioQJQ5H.js → wallet-manager-DWFwmdLb.js} +2 -2
- package/dist/website/assets/AlertController-Dd3t1FDe.js +1 -0
- package/dist/website/assets/{CaipNetworkUtil-CIgzbD6k.js → CaipNetworkUtil-CyIDQhS0.js} +1 -1
- package/dist/website/assets/DateTime-ByC3zr_K.js +1 -0
- package/dist/website/assets/{HelpersUtil-BokHy7la.js → HelpersUtil-Bpil3MMz.js} +1 -1
- package/dist/website/assets/ModalController-BhWRBcfd.js +5 -0
- package/dist/website/assets/{albedo.module-Dn9vkw3f.js → albedo.module-DkOe0Unb.js} +1 -1
- package/dist/website/assets/assets-DXO6qW6R.js +2 -0
- package/dist/website/assets/{axios-Dl6BaS8Y.js → axios-rFNl7rAx.js} +2 -2
- package/dist/website/assets/{base-signer-b1ff2VPI-DF_m1Hx-.js → base-signer-b1ff2VPI-DEykpag5.js} +1 -1
- package/dist/website/assets/{basic-Bt_YnOIC.js → basic-By5_muQ4.js} +1 -1
- package/dist/website/assets/bignumber-FohbSRh0.js +1 -0
- package/dist/website/assets/blakejs-x6iaQxOd.js +3 -0
- package/dist/website/assets/bn-Ck4DeaX2.js +1 -0
- package/dist/website/assets/{browser-ponyfill-_v4sZCld.js → browser-ponyfill-lHyeX8iJ.js} +1 -1
- package/dist/website/assets/{bs58-CiFyCgrv.js → bs58-gzsgdke5.js} +1 -1
- package/dist/website/assets/{build-DM4Sawu1.js → build-ClRxYQRR.js} +1 -1
- package/dist/website/assets/{build-Butjcagw.js → build-TBrHU398.js} +1 -1
- package/dist/website/assets/{build-B5AnTSOq.js → build-Tl3I8dhV.js} +1 -1
- package/dist/website/assets/{cardano-connector-BC5bF4Y2.js → cardano-connector-8El4Ztf_.js} +9 -9
- package/dist/website/assets/{configured-chains-Bp7rWkOZ.js → configured-chains-DQ_M8-li.js} +1 -1
- package/dist/website/assets/core-BiDQVY37.js +2 -0
- package/dist/website/assets/{cosmos-connector-meta-CZFaunIB.js → cosmos-connector-meta-DRTieEt0.js} +1 -1
- package/dist/website/assets/dist-BVuLBvyS.js +7 -0
- package/dist/website/assets/{dist-BKdXTi2f.js → dist-Bo7ZdXT8.js} +3 -3
- package/dist/website/assets/{dist-7PipG_eL.js → dist-DlLKQSrv.js} +3 -3
- package/dist/website/assets/dist-ZKTSEBXW.js +1 -0
- package/dist/website/assets/{elliptic-j9CClrcl.js → elliptic-BdE4gFqn.js} +2 -2
- package/dist/website/assets/{esm-DVfwo40P.js → esm-BjyHrLEJ.js} +1 -1
- package/dist/website/assets/events-CMzhc0tf.js +1 -0
- package/dist/website/assets/{extrinsic-encoding-B3zynq2U.js → extrinsic-encoding-BIj1XBpl.js} +1 -1
- package/dist/website/assets/{features-LE43LGiF.js → features-Cy1CFK9a.js} +1 -1
- package/dist/website/assets/{fhevm-relayer-DXLb4mIw-bVmGMiQn.js → fhevm-relayer-DXLb4mIw-Bbrz0cha.js} +5 -3
- package/dist/website/assets/freighter.module-DsmrpiWT.js +1 -0
- package/dist/website/assets/index-7hHJ2eI5.js +558 -0
- package/dist/website/assets/index-zFAIWvcU.css +1 -0
- package/dist/website/assets/{index.es-D6B6PG3M.js → index.es-BGzDKZr_.js} +1 -1
- package/dist/website/assets/index.es-BHs2-Pa6.js +1 -0
- package/dist/website/assets/{index.es-wqX1ruQA.js → index.es-Bpga9r91.js} +5 -5
- package/dist/website/assets/{kms_lib-mPebVu09.js → kms_lib-BgnOy0xU.js} +1 -1
- package/dist/website/assets/{kms_lib-Bh_Z1nH6.js → kms_lib-w0jRi8cP.js} +1 -1
- package/dist/website/assets/{ledger-connector-BOOoTKx_.js → ledger-connector-CNNjVgC1.js} +3 -3
- package/dist/website/assets/{lib-es-5LFNYQ9J.js → lib-es-DmH9FYVZ.js} +1 -1
- package/dist/website/assets/lobstr.module-BUAItZUt.js +1 -0
- package/dist/website/assets/{nacl-fast-BI97gFtf.js → nacl-fast-B5R4wpqG.js} +1 -1
- package/dist/website/assets/{nacl-util-DCWJejqG.js → nacl-util-6167mj42.js} +1 -1
- package/dist/website/assets/{network-CEcIzsgc.js → network-BVzpe0Ii.js} +1 -1
- package/dist/website/assets/{polkadot-ledger-transaction-DaDP252u.js → polkadot-ledger-transaction-Dp6EFfyV.js} +1 -1
- package/dist/website/assets/registry-BgQw-qJW.js +1 -0
- package/dist/website/assets/{reward-rate-chart-COP_M115.js → reward-rate-chart-CO_yI4og.js} +4 -4
- package/dist/website/assets/{safe-buffer-Dz6e-rwu.js → safe-buffer-BUgQmBOp.js} +1 -1
- package/dist/website/assets/{safe-connector-DG2cXEO5.js → safe-connector-BObu9WgG.js} +2 -2
- package/dist/website/assets/{solana-connector-DSpWnxwA.js → solana-connector-CVuV_EKp.js} +1 -1
- package/dist/website/assets/{src-Zq1Jw-Sn.js → src-DbdC_Alu.js} +1 -1
- package/dist/website/assets/{src-hSPfFTzN.js → src-Dl7INWvU.js} +1 -1
- package/dist/website/assets/state-D5Nw1L4F.js +1 -0
- package/dist/website/assets/{stellar-connector-BAbbdkSK.js → stellar-connector-Ba7Jcrbg.js} +1 -1
- package/dist/website/assets/styles.css-NtRiu07M.js +1 -0
- package/dist/website/assets/substrate-connector-hQ3vc47X.js +2 -0
- package/dist/website/assets/tfhe-BACovsAk.js +1 -0
- package/dist/website/assets/{tfhe-DuWT_ao1.js → tfhe-BSAXrnM6.js} +1 -1
- package/dist/website/assets/ton-connector-CU1xiP2u.js +2264 -0
- package/dist/website/assets/tracking-variants-CtfEiKNR.js +93 -0
- package/dist/website/assets/{transaction-BH4ssPh3.js → transaction-B5hUD0AE.js} +1 -1
- package/dist/website/assets/{transaction-BVuftLt1.js → transaction-BWEzzOww.js} +1 -1
- package/dist/website/assets/transaction-BmFUkzQv.js +2 -0
- package/dist/website/assets/{transaction-1KdJeqcp.js → transaction-C_iyacpP.js} +1 -1
- package/dist/website/assets/{tron-connector-CJURHEQe.js → tron-connector-gXtlAAuG.js} +7 -7
- package/dist/website/assets/{tx-Bkou_ALe.js → tx-Cosvp39i.js} +1 -1
- package/dist/website/assets/{utils-CH0e59XB.js → utils-meUBO1X1.js} +1 -1
- package/dist/website/assets/{viem-BQ_7aeKB.js → viem-8-EtcU49.js} +1 -1
- package/dist/website/assets/{w3m-modal-BLY--NNS.js → w3m-modal-HS9RLkN8.js} +2 -2
- package/dist/website/assets/wallet-manager-BQrZx180.js +5 -0
- package/dist/website/assets/{web-4qAQ-Ymk.js → web-azgm2Psf.js} +1 -1
- package/dist/website/assets/{wui-list-item-1gzb5UQJ.js → wui-list-item-CfZ1WQql.js} +1 -1
- package/dist/website/assets/{xbull.module-B4N1LGQD.js → xbull.module-DQx6rh7x.js} +1 -1
- package/dist/website/index.html +19 -19
- package/package.json +2 -2
- package/dist/website/assets/AlertController-CH5fpr36.js +0 -1
- package/dist/website/assets/DateTime-DR7XeJxF.js +0 -1
- package/dist/website/assets/ModalController-CWwEAkfw.js +0 -5
- package/dist/website/assets/assets-Dk5ppLtc.js +0 -2
- package/dist/website/assets/bignumber-CziKLYjt.js +0 -1
- package/dist/website/assets/blakejs-Dx-Zt5zT.js +0 -3
- package/dist/website/assets/bn-CJG5j3KW.js +0 -1
- package/dist/website/assets/core-uatW2d6Y.js +0 -2
- package/dist/website/assets/dist-CELdgNh9.js +0 -1
- package/dist/website/assets/dist-omv2KNC4.js +0 -5
- package/dist/website/assets/events-D2w4OsQJ.js +0 -1
- package/dist/website/assets/freighter.module-CaBNS6Y-.js +0 -1
- package/dist/website/assets/index-CRRnuuvK.js +0 -540
- package/dist/website/assets/index-mVJBJZFp.css +0 -1
- package/dist/website/assets/index.es-DCi2xZ1b.js +0 -1
- package/dist/website/assets/lobstr.module-GQjJAf8P.js +0 -1
- package/dist/website/assets/registry-DVfYVrCY.js +0 -1
- package/dist/website/assets/state-B8Vu3fYx.js +0 -1
- package/dist/website/assets/styles.css-BK5OO2Hh.js +0 -1
- package/dist/website/assets/substrate-connector-CwnGlD2K.js +0 -2
- package/dist/website/assets/tfhe-PDJAG8Bv.js +0 -1
- package/dist/website/assets/ton-connector-DMNOeieX.js +0 -2264
- package/dist/website/assets/tracking-variants-CuRpr0B_.js +0 -85
- package/dist/website/assets/transaction-CbxrIerN.js +0 -2
- package/dist/website/assets/wallet-manager-D8tOJ1jy.js +0 -5
- package/dist/website/mockServiceWorker.js +0 -460
|
@@ -1,2264 +0,0 @@
|
|
|
1
|
-
import{s as e,t}from"./rolldown-runtime-BcKkbAw3.js";import{n,t as r}from"./dist-Cuadm9-o.js";import{bi as i,sr as a,wr as o}from"./Cause-1VWVIQY3.js";import{A as s,K as c,Q as l,rt as u,t as d,v as f}from"./assets-Dk5ppLtc.js";import{n as p,q as m,s as h,t as g}from"./wagmi-connect-result-ChkXAqK2.js";import{Gt as _,K as v,Wt as y,nt as b}from"./Effect-Cu_VlOsF.js";import{n as x}from"./Clock-CBDokwR8.js";import{a as S}from"./configured-chains-Bp7rWkOZ.js";import{i as C,r as ee}from"./transaction-BVuftLt1.js";import{t as te}from"./nacl-fast-BI97gFtf.js";import{t as ne}from"./ton-connector-meta-Bv9rRiPf.js";import{t as re}from"./nacl-util-DCWJejqG.js";import{t as ie}from"./wagmi-connector-events-uWDzb_Wq.js";import{t as ae}from"./cjs-TfqE20ol.js";var oe=C();r();var se=e(re(),1),ce=e(te(),1),le;(function(e){e[e.UNKNOWN_ERROR=0]=`UNKNOWN_ERROR`,e[e.BAD_REQUEST_ERROR=1]=`BAD_REQUEST_ERROR`,e[e.MANIFEST_NOT_FOUND_ERROR=2]=`MANIFEST_NOT_FOUND_ERROR`,e[e.MANIFEST_CONTENT_ERROR=3]=`MANIFEST_CONTENT_ERROR`,e[e.UNKNOWN_APP_ERROR=100]=`UNKNOWN_APP_ERROR`,e[e.USER_REJECTS_ERROR=300]=`USER_REJECTS_ERROR`,e[e.METHOD_NOT_SUPPORTED=400]=`METHOD_NOT_SUPPORTED`})(le||={});var ue;(function(e){e[e.UNKNOWN_ERROR=0]=`UNKNOWN_ERROR`,e[e.METHOD_NOT_SUPPORTED=400]=`METHOD_NOT_SUPPORTED`})(ue||={});var de;(function(e){e[e.UNKNOWN_ERROR=0]=`UNKNOWN_ERROR`,e[e.BAD_REQUEST_ERROR=1]=`BAD_REQUEST_ERROR`,e[e.UNKNOWN_APP_ERROR=100]=`UNKNOWN_APP_ERROR`,e[e.USER_REJECTS_ERROR=300]=`USER_REJECTS_ERROR`,e[e.METHOD_NOT_SUPPORTED=400]=`METHOD_NOT_SUPPORTED`})(de||={});var fe;(function(e){e[e.UNKNOWN_ERROR=0]=`UNKNOWN_ERROR`,e[e.BAD_REQUEST_ERROR=1]=`BAD_REQUEST_ERROR`,e[e.UNKNOWN_APP_ERROR=100]=`UNKNOWN_APP_ERROR`,e[e.USER_REJECTS_ERROR=300]=`USER_REJECTS_ERROR`,e[e.METHOD_NOT_SUPPORTED=400]=`METHOD_NOT_SUPPORTED`})(fe||={});var pe;(function(e){e[e.UNKNOWN_ERROR=0]=`UNKNOWN_ERROR`,e[e.BAD_REQUEST_ERROR=1]=`BAD_REQUEST_ERROR`,e[e.UNKNOWN_APP_ERROR=100]=`UNKNOWN_APP_ERROR`,e[e.METHOD_NOT_SUPPORTED=400]=`METHOD_NOT_SUPPORTED`})(pe||={});var me;(function(e){e[e.UNKNOWN_ERROR=0]=`UNKNOWN_ERROR`,e[e.BAD_REQUEST_ERROR=1]=`BAD_REQUEST_ERROR`,e[e.UNKNOWN_APP_ERROR=100]=`UNKNOWN_APP_ERROR`,e[e.USER_REJECTS_ERROR=300]=`USER_REJECTS_ERROR`,e[e.METHOD_NOT_SUPPORTED=400]=`METHOD_NOT_SUPPORTED`})(me||={});var he;(function(e){e.MAINNET=`-239`,e.TESTNET=`-3`})(he||={});function ge(e,t){let n=se.default.encodeBase64(e);return t?encodeURIComponent(n):n}function _e(e,t){return t&&(e=decodeURIComponent(e)),se.default.decodeBase64(e)}function ve(e,t=!1){let n;return e instanceof Uint8Array?n=e:(typeof e!=`string`&&(e=JSON.stringify(e)),n=se.default.decodeUTF8(e)),ge(n,t)}function ye(e,t=!1){let n=_e(e,t);return{toString(){return se.default.encodeUTF8(n)},toObject(){try{return JSON.parse(se.default.encodeUTF8(n))}catch{return null}},toUint8Array(){return n}}}var be={encode:ve,decode:ye};function xe(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function Se(e,t){if(t>=e.length)throw Error(`Index is out of buffer`);return[e.slice(0,t),e.slice(t)]}function Ce(e){let t=``;return e.forEach(e=>{t+=(`0`+(e&255).toString(16)).slice(-2)}),t}function we(e){if(e.length%2!=0)throw Error(`Cannot convert ${e} to bytesArray`);let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n/2]=parseInt(e.slice(n,n+2),16);return t}var Te=class{constructor(e){this.nonceLength=24,this.keyPair=e?this.createKeypairFromString(e):this.createKeypair(),this.sessionId=Ce(this.keyPair.publicKey)}createKeypair(){return ce.default.box.keyPair()}createKeypairFromString(e){return{publicKey:we(e.publicKey),secretKey:we(e.secretKey)}}createNonce(){return ce.default.randomBytes(this.nonceLength)}encrypt(e,t){let n=new TextEncoder().encode(e),r=this.createNonce();return xe(r,ce.default.box(n,r,t,this.keyPair.secretKey))}decrypt(e,t){let[n,r]=Se(e,this.nonceLength),i=ce.default.box.open(r,n,t,this.keyPair.secretKey);if(!i)throw Error(`Decryption error: \n message: ${e.toString()} \n sender pubkey: ${t.toString()} \n keypair pubkey: ${this.keyPair.publicKey.toString()} \n keypair secretkey: ${this.keyPair.secretKey.toString()}`);return new TextDecoder().decode(i)}stringifyKeypair(){return{publicKey:Ce(this.keyPair.publicKey),secretKey:Ce(this.keyPair.secretKey)}}};r();function Ee(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function w(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var T=class e extends Error{get info(){return``}constructor(t,n){super(t,n),Object.setPrototypeOf(this,new.target.prototype);let r=De(new.target);Object.defineProperty(this,"name",{value:r,writable:!0,configurable:!0,enumerable:!1}),n?.walletError&&Object.defineProperty(this,"walletError",{value:n.walletError,writable:!1,configurable:!0,enumerable:!1}),this.message=`${e.prefix} ${r}${this.info?`: `+this.info:``}${t?`
|
|
2
|
-
`+t:``}`}};T.prefix=`[TON_CONNECT_SDK_ERROR]`,T.errorName=`TonConnectError`;function De(e){return Object.prototype.hasOwnProperty.call(e,`errorName`)?e.errorName:e.name}var Oe=class extends T{get info(){return`Passed DappMetadata is in incorrect format.`}};Oe.errorName=`DappMetadataError`;var ke=class extends T{get info(){return"Passed `tonconnect-manifest.json` contains errors. Check format of your manifest. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}};ke.errorName=`ManifestContentErrorError`;var Ae=class extends T{get info(){return"Manifest not found. Make sure you added `tonconnect-manifest.json` to the root of your app or passed correct manifestUrl. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest"}};Ae.errorName=`ManifestNotFoundError`;var je=class extends T{get info(){return`Wallet connection called but wallet already connected. To avoid the error, disconnect the wallet before doing a new connection.`}};je.errorName=`WalletAlreadyConnectedError`;var Me=class extends T{get info(){return`Send transaction or other protocol methods called while wallet is not connected.`}};Me.errorName=`WalletNotConnectedError`;var Ne=class extends T{get info(){return`There is an attempt to connect to the injected wallet while it is not exists in the webpage.`}};Ne.errorName=`WalletNotInjectedError`;var Pe=class extends T{get info(){return`Wallet doesn't support requested feature method.`}constructor(e,t){super(e,t)}};Pe.errorName=`WalletNotSupportFeatureError`;var Fe=class extends T{get info(){return`Missing required features. You need to update your wallet.`}constructor(e,t){super(e,t)}};Fe.errorName=`WalletMissingRequiredFeaturesError`;var Ie=class extends T{constructor(e,t){super(e,t)}};Ie.errorName=`WalletWrongNetworkError`;var Le=class extends T{get info(){return`Request to the wallet failed without a TON Connect response.`}};Le.errorName=`WalletTransportError`;function Re(e){return`jsBridgeKey`in e}function ze(e){return`type`in e&&e.type===`wallet-connect`}function Be(e,t){return Array.isArray(e)?{kind:`http-any-wallet`}:Re(e)?{kind:t(e.jsBridgeKey)?`js-embedded`:`js-injected`,jsBridgeKey:e.jsBridgeKey}:ze(e)?{kind:`wallet-connect`}:{kind:`http-specific-wallet`,bridgeUrl:e.bridgeUrl}}function Ve(e){return Ue(e)&&e.injected}function He(e){return Ve(e)&&e.embedded}function Ue(e){return`jsBridgeKey`in e}function We(e){return`bridgeUrl`in e}function Ge(e){return`items`in e&&Array.isArray(e.items)}function Ke(e){return`messages`in e&&Array.isArray(e.messages)}var qe=class extends T{get info(){return`User rejects the action in the wallet.`}};qe.errorName=`UserRejectsError`;var Je=class extends T{get info(){return`Request to the wallet contains errors.`}};Je.errorName=`BadRequestError`;var Ye=class extends T{get info(){return`Wallet does not support the requested method.`}};Ye.errorName=`MethodNotSupportedError`;var Xe=class extends T{get info(){return`App tries to send rpc request to the injected wallet while not connected.`}};Xe.errorName=`UnknownAppError`;var Ze=class extends T{};Ze.errorName=`UnknownError`;var Qe=new WeakSet,$e=new WeakMap;function et(e){Qe.add(e)}function tt(e){return Qe.has(e)}function nt(e,t){$e.set(e,t)}function rt(e){return $e.get(e)}var it={[de.UNKNOWN_ERROR]:Ze,[de.BAD_REQUEST_ERROR]:Je,[de.UNKNOWN_APP_ERROR]:Xe,[de.USER_REJECTS_ERROR]:qe,[de.METHOD_NOT_SUPPORTED]:Ye},at={[le.UNKNOWN_ERROR]:Ze,[le.BAD_REQUEST_ERROR]:Je,[le.MANIFEST_NOT_FOUND_ERROR]:Ae,[le.MANIFEST_CONTENT_ERROR]:ke,[le.UNKNOWN_APP_ERROR]:Xe,[le.USER_REJECTS_ERROR]:qe,[le.METHOD_NOT_SUPPORTED]:Ye};function ot(e){return new Set(Object.keys(e).map(Number))}var st=ot(it),ct=ot(at);function lt(e,t,n={}){let r=rt(e);if(r)return r;let i={code:e.code,message:e.message??``};return e.data!==void 0&&(i.data=e.data),n.responseId!==void 0&&(i.responseId=n.responseId),tt(e)&&(i.normalized=!0),new(t[e.code]??Ze)(e.message,{walletError:i})}var ut=new class{parseError(e){return lt(e,at)}},dt=class{isError(e){return`error`in e}};function ft(e){let t=e.id;return t==null?void 0:String(t)}var pt=new class extends dt{convertToRpcRequest(e){return{method:`sendTransaction`,params:[JSON.stringify(e)]}}parseAndThrowError(e){throw lt(e.error,it,{responseId:ft(e)})}convertFromRpcResponse(e){return{boc:e.result}}},mt=new class extends dt{convertToRpcRequest(e){return{method:`signData`,params:[JSON.stringify(e)]}}parseAndThrowError(e){throw lt(e.error,it,{responseId:ft(e)})}convertFromRpcResponse(e){return e.result}},ht=new class extends dt{convertToRpcRequest(e){return{method:`signMessage`,params:[JSON.stringify(e)]}}parseAndThrowError(e){throw lt(e.error,it,{responseId:ft(e)})}convertFromRpcResponse(e){return{internalBoc:e.result.internalBoc}}},gt=class{constructor(e,t){this.storage=e,this.storeKey=`ton-connect-storage_http-bridge-gateway::`+t}storeLastEventId(e){return w(this,void 0,void 0,function*(){return this.storage.setItem(this.storeKey,e)})}removeLastEventId(){return w(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getLastEventId(){return w(this,void 0,void 0,function*(){return(yield this.storage.getItem(this.storeKey))||null})}};function _t(e){return e.slice(-1)===`/`?e.slice(0,-1):e}function vt(e,t){return _t(e)+`/`+t}function yt(e){if(!e)return!1;let t=new URL(e);return t.protocol===`tg:`||t.hostname===`t.me`}function bt(e){return e?e.includes(`ton_addr`)||e.includes(`ton--5Faddr`):!1}function xt(e){return e.replaceAll(`.`,`%2E`).replaceAll(`-`,`%2D`).replaceAll(`_`,`%5F`).replaceAll(`&`,`-`).replaceAll(`=`,`__`).replaceAll(`%`,`--`)}function St(e){return e.replaceAll(`--`,`%`).replaceAll(`__`,`=`).replaceAll(`-`,`&`).replaceAll(`%5F`,`_`).replaceAll(`%2D`,`-`).replaceAll(`%2E`,`.`)}var Ct=class extends T{get info(){return"Storage was not specified in the `DappMetadata` and default `localStorage` was not detected in the environment."}};Ct.errorName=`LocalstorageNotFoundError`;var wt=class extends T{get info(){return`An error occurred while fetching the wallets list.`}};wt.errorName=`FetchWalletsError`;var Tt=class extends T{get info(){return`Passed address is in incorrect format.`}};Tt.errorName=`WrongAddressError`;var Et=class extends T{get info(){return`Passed hex is in incorrect format.`}};Et.errorName=`ParseHexError`;function Dt(e,t){return w(this,void 0,void 0,function*(){return new Promise((t,n)=>{var r;let i=setTimeout(()=>t(),e);(r=void 0)==null||r.addEventListener(`abort`,()=>{clearTimeout(i),n(new T(`Delay aborted`))})})})}function Ot(e){let t=new AbortController;return e?.aborted?t.abort():e?.addEventListener(`abort`,()=>t.abort(),{once:!0}),t}function kt(e,t){return w(this,void 0,void 0,function*(){let n=t?.attempts??10,r=t?.delayMs??200,i=Ot(t?.signal);if(typeof e!=`function`)throw new T(`Expected a function, got ${typeof e}`);let a=0,o;for(;a<n;){if(i.signal.aborted)throw new T(`Aborted after attempts ${a}`);try{return yield e({signal:i.signal})}catch(e){o=e,a++,a<n&&(yield Dt(r))}}throw o})}function At(...e){}function jt(e,t){let n=null,r=null,i=null,a=null,o=null,s=(s,...c)=>w(this,void 0,void 0,function*(){if(a=s??null,o?.abort(),o=Ot(s),o.signal.aborted)throw new T(`Resource creation was aborted`);r=c??null;let l=e(o.signal,...c);i=l;let u=yield l;if(i!==l&&u!==n)throw yield t(u),new T(`Resource creation was aborted by a new resource creation`);return n=u,n});return{create:s,current:()=>n??null,dispose:()=>w(this,void 0,void 0,function*(){try{let e=n;n=null;let r=i;i=null;try{o?.abort()}catch{}yield Promise.allSettled([e?t(e):Promise.resolve(),r?t(yield r):Promise.resolve()])}catch{}}),recreate:e=>w(this,void 0,void 0,function*(){let t=n,o=i,c=r,l=a;if(yield Dt(e),t===n&&o===i&&c===r&&l===a)return yield s(a,...c??[]);throw new T(`Resource recreation was aborted by a new resource creation`)})}}function Mt(e,t){let n=t?.timeout,r=Ot(t?.signal);return new Promise((t,i)=>w(this,void 0,void 0,function*(){if(r.signal.aborted){i(new T(`Operation aborted`));return}let a;n!==void 0&&(a=setTimeout(()=>{r.abort(),i(new T(`Timeout after ${n}ms`))},n)),r.signal.addEventListener(`abort`,()=>{clearTimeout(a),i(new T(`Operation aborted`))},{once:!0}),yield e((...e)=>{clearTimeout(a),t(...e)},()=>{clearTimeout(a),i()},{timeout:n,abort:r.signal})}))}var Nt=class{get isReady(){return this.eventSource.current()?.readyState===EventSource.OPEN}get isClosed(){return this.eventSource.current()?.readyState!==EventSource.OPEN}get isConnecting(){return this.eventSource.current()?.readyState===EventSource.CONNECTING}constructor(e,t,n,r,i,a){this.bridgeUrl=t,this.sessionId=n,this.listener=r,this.errorsListener=i,this.ssePath=`events`,this.postPath=`message`,this.heartbeatMessage=`heartbeat`,this.defaultTtl=300,this.defaultReconnectDelay=2e3,this.defaultResendDelay=5e3,this.eventSource=jt((e,t,n)=>w(this,void 0,void 0,function*(){return yield Pt({bridgeUrl:this.bridgeUrl,ssePath:this.ssePath,sessionId:this.sessionId,bridgeGatewayStorage:this.bridgeGatewayStorage,errorHandler:this.errorsHandler.bind(this),messageHandler:this.messagesHandler.bind(this),signal:e,openingDeadlineMS:t,traceId:n})}),e=>w(this,void 0,void 0,function*(){e.close()})),this.bridgeGatewayStorage=new gt(e,t),this.analytics=a?.scoped({bridge_url:t,client_id:n})}registerSession(e){return w(this,void 0,void 0,function*(){var t,n,r;try{(t=this.analytics)==null||t.emitBridgeClientConnectStarted({trace_id:e?.traceId});let r=Date.now();yield this.eventSource.create(e?.signal,e?.openingDeadlineMS,e?.traceId);let i=Date.now()-r;(n=this.analytics)==null||n.emitBridgeClientConnectEstablished({bridge_connect_duration:i,trace_id:e?.traceId})}catch(t){throw(r=this.analytics)==null||r.emitBridgeClientConnectError({trace_id:e?.traceId,error_message:String(t)}),t}})}send(e,t,n,r){return w(this,void 0,void 0,function*(){let i={};typeof r==`number`?i.ttl=r:(i.ttl=r?.ttl,i.signal=r?.signal,i.attempts=r?.attempts,i.traceId=r?.traceId);let a=new URL(vt(this.bridgeUrl,this.postPath));a.searchParams.append(`client_id`,this.sessionId),a.searchParams.append(`to`,t),a.searchParams.append(`ttl`,(i?.ttl||this.defaultTtl).toString()),a.searchParams.append(`topic`,n),i?.traceId&&a.searchParams.append(`trace_id`,i.traceId);let o=be.encode(e);yield kt(e=>w(this,void 0,void 0,function*(){let t=yield this.post(a,o,e.signal);if(!t.ok)throw new T(`Bridge send failed, status ${t.status}`)}),{attempts:i?.attempts??2**53-1,delayMs:this.defaultResendDelay,signal:i?.signal})})}pause(){this.eventSource.dispose().catch(e=>(`${e}`,void 0))}unPause(){return w(this,void 0,void 0,function*(){yield this.eventSource.recreate(0)})}close(){return w(this,void 0,void 0,function*(){yield this.eventSource.dispose().catch(e=>(`${e}`,void 0))})}setListener(e){this.listener=e}setErrorsListener(e){this.errorsListener=e}post(e,t,n){return w(this,void 0,void 0,function*(){let r=yield fetch(e,{method:`post`,body:t,signal:n});if(!r.ok)throw new T(`Bridge send failed, status ${r.status}`);return r})}errorsHandler(e,t){return w(this,void 0,void 0,function*(){if(this.isConnecting)throw e.close(),new T(`Bridge error, failed to connect`);if(this.isReady){try{this.errorsListener(t)}catch{}return}if(this.isClosed)return e.close(),`${this.defaultReconnectDelay}`,yield this.eventSource.recreate(this.defaultReconnectDelay);throw new T(`Bridge error, unknown state`)})}messagesHandler(e){return w(this,void 0,void 0,function*(){if(e.data===this.heartbeatMessage||(yield this.bridgeGatewayStorage.storeLastEventId(e.lastEventId),this.isClosed))return;let t;try{let n=JSON.parse(e.data);t={message:n.message,from:n.from,traceId:n.trace_id}}catch{throw new T(`Bridge message parse failed, message ${e.data}`)}this.listener(t)})}};function Pt(e){return w(this,void 0,void 0,function*(){return yield Mt((t,n,r)=>w(this,void 0,void 0,function*(){var i;let a=Ot(r.signal).signal;if(a.aborted){n(new T(`Bridge connection aborted`));return}let o=new URL(vt(e.bridgeUrl,e.ssePath));o.searchParams.append(`client_id`,e.sessionId);let s=yield e.bridgeGatewayStorage.getLastEventId();if(s&&o.searchParams.append(`last_event_id`,s),e.traceId&&o.searchParams.append(`trace_id`,e.traceId),a.aborted){n(new T(`Bridge connection aborted`));return}let c=new EventSource(o.toString());c.onerror=r=>w(this,void 0,void 0,function*(){if(a.aborted){c.close(),n(new T(`Bridge connection aborted`));return}try{let n=yield e.errorHandler(c,r);n!==c&&c.close(),n&&n!==c&&t(n)}catch(e){c.close(),n(e)}}),c.onopen=()=>{if(a.aborted){c.close(),n(new T(`Bridge connection aborted`));return}t(c)},c.onmessage=t=>{if(a.aborted){c.close(),n(new T(`Bridge connection aborted`));return}e.messageHandler(t)},(i=e.signal)==null||i.addEventListener(`abort`,()=>{c.close(),n(new T(`Bridge connection aborted`))})}),{timeout:e.openingDeadlineMS,signal:e.signal})})}var Ft=3e5;function It(e){return!(`connectEvent`in e)}function Lt(e){return!(`connectEvent`in e)}function Rt(e){return Date.now()-(e.createdAt??0)>Ft}var zt,Bt=new Uint8Array(16);function Vt(){if(!zt){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);zt=crypto.getRandomValues.bind(crypto)}return zt(Bt)}var Ht=[];for(let e=0;e<256;++e)Ht.push((e+256).toString(16).slice(1));function Ut(e,t=0){return(Ht[e[t+0]]+Ht[e[t+1]]+Ht[e[t+2]]+Ht[e[t+3]]+`-`+Ht[e[t+4]]+Ht[e[t+5]]+`-`+Ht[e[t+6]]+Ht[e[t+7]]+`-`+Ht[e[t+8]]+Ht[e[t+9]]+`-`+Ht[e[t+10]]+Ht[e[t+11]]+Ht[e[t+12]]+Ht[e[t+13]]+Ht[e[t+14]]+Ht[e[t+15]]).toLowerCase()}var Wt={};function E(e,t,n){let r;if(e)r=Kt(e.random??e.rng?.call(e)??Vt(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=Vt();Gt(Wt,e,i),r=Kt(i,Wt.msecs,Wt.seq,t,n)}return t??Ut(r)}function Gt(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=n[6]<<23|n[7]<<16|n[8]<<8|n[9],e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function Kt(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=e[6]*127<<24|e[7]<<16|e[8]<<8|e[9],r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function qt(e,t){return w(this,void 0,void 0,function*(){if(t<=0)return[];if(t>e.length)throw RangeError(`count cannot be greater than the number of promises`);let n=Array(e.length),r=0;return new Promise(i=>{e.forEach((e,a)=>{Promise.resolve(e).then(e=>({status:`fulfilled`,value:e})).catch(e=>({status:`rejected`,reason:e})).then(e=>{n[a]=e,r++,r===t&&i(n)})})})})}var Jt=2;function Yt(e){if(typeof e!=`string`)return;let t=e.length+(4-e.length%4)%4;return e.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(t,`=`)}function Xt(e){return e.replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}function Zt(e,t,n){return yt(e)?$t(e,t,n):Qt(e,t,n)}function Qt(e,t,n){let r=new URL(e);return r.searchParams.append(`v`,Jt.toString()),r.searchParams.append(`id`,n.sessionId),r.searchParams.append(`trace_id`,n.traceId),r.searchParams.append(`r`,JSON.stringify(t)),n.embeddedRequest&&r.searchParams.append(`e`,Xt(be.encode(JSON.stringify(n.embeddedRequest),!1))),r.toString()}function $t(e,t,n){let r=Qt(`about:blank`,t,n).split(`?`)[1],i=`tonconnect-`+xt(r),a=en(e),o=new URL(a);return o.searchParams.append(`startapp`,i),o.toString()}function en(e){let t=new URL(e);return t.searchParams.has(`attach`)&&(t.searchParams.delete(`attach`),t.pathname+=`/start`),t.toString()}var tn=class e{static fromStorage(t,n){return w(this,void 0,void 0,function*(){let r=yield t.getHttpConnection();return It(r)?new e(t,r.connectionSource,n):new e(t,{bridgeUrl:r.session.bridgeUrl},n)})}constructor(e,t,n){this.connectionStorage=e,this.walletConnectionSource=t,this.analyticsManager=n,this.type=`http`,this.standardUniversalLink=`tc://`,this.pendingRequests=new Map,this.session=null,this.gateway=null,this.pendingGateways=[],this.listeners=[],this.defaultOpeningDeadlineMS=12e3,this.defaultRetryTimeoutMS=2e3,this.maxUrlLength=1024,this.optionalOpenGateways=3,this.analytics=this.analyticsManager?.scoped()}connect(e,t){var n,r;let i=t?.traceId??E(),a=Ot(t?.signal);(n=this.abortController)==null||n.abort(),this.abortController=a,this.closeGateways();let o=new Te;this.session={sessionCrypto:o,bridgeUrl:`bridgeUrl`in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:``},this.connectionStorage.storeConnection({type:`http`,connectionSource:this.walletConnectionSource,sessionCrypto:o}).then(()=>w(this,void 0,void 0,function*(){a.signal.aborted||(yield kt(e=>this.openGateways(o,{openingDeadlineMS:t?.openingDeadlineMS??this.defaultOpeningDeadlineMS,signal:e?.signal,traceId:i}),{attempts:2**53-1,delayMs:this.defaultRetryTimeoutMS,signal:a.signal}))}));let s=`universalLink`in this.walletConnectionSource&&this.walletConnectionSource.universalLink?this.walletConnectionSource.universalLink:this.standardUniversalLink,c=(t?.embeddedRequest)?.peek(),l=Zt(s,e,{traceId:i,sessionId:this.session.sessionCrypto.sessionId,embeddedRequest:c});return l.length<=this.maxUrlLength?((r=t?.embeddedRequest)==null||r.consume(),l):Zt(s,e,{traceId:i,sessionId:this.session.sessionCrypto.sessionId})}restoreConnection(e){return w(this,void 0,void 0,function*(){var t;let n=e?.traceId??E(),r=Ot(e?.signal);if((t=this.abortController)==null||t.abort(),this.abortController=r,r.signal.aborted)return;this.closeGateways();let i=yield this.connectionStorage.getHttpConnection();if(!i||r.signal.aborted)return;let a=e?.openingDeadlineMS??this.defaultOpeningDeadlineMS;if(It(i))return this.session={sessionCrypto:i.sessionCrypto,bridgeUrl:`bridgeUrl`in this.walletConnectionSource?this.walletConnectionSource.bridgeUrl:``},yield this.openGateways(i.sessionCrypto,{openingDeadlineMS:a,signal:r?.signal,traceId:e?.traceId});if(Array.isArray(this.walletConnectionSource))throw new T(`Internal error. Connection source is array while WalletConnectionSourceHTTP was expected.`);if(this.session=i.session,this.gateway&&(yield this.gateway.close()),this.gateway=new Nt(this.connectionStorage.storage,this.walletConnectionSource.bridgeUrl,i.session.sessionCrypto.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this),this.analyticsManager),!r.signal.aborted){this.listeners.forEach(e=>e(Object.assign(Object.assign({},i.connectEvent),{traceId:n,restored:!0})));try{yield kt(e=>this.gateway.registerSession({openingDeadlineMS:a,signal:e.signal,traceId:n}),{attempts:2**53-1,delayMs:this.defaultRetryTimeoutMS,signal:r.signal})}catch{yield this.disconnect({signal:r.signal,traceId:n});return}}})}sendRequest(e,t){let n={};return typeof t==`function`?n.onRequestSent=t:(n.onRequestSent=t?.onRequestSent,n.signal=t?.signal,n.attempts=t?.attempts,n.traceId=t?.traceId),n.traceId??=E(),new Promise((t,r)=>w(this,void 0,void 0,function*(){var i,a;if(!this.gateway||!this.session||!(`walletPublicKey`in this.session))throw new T(`Trying to send bridge request without session`);let o=(yield this.connectionStorage.getNextRpcRequestId()).toString();yield this.connectionStorage.increaseNextRpcRequestId(),Object.assign(Object.assign({},e),{id:o});let s=this.session.sessionCrypto.encrypt(JSON.stringify(Object.assign(Object.assign({},e),{id:o})),we(this.session.walletPublicKey));try{(i=this.analytics)==null||i.emitBridgeClientMessageSent({bridge_url:this.gateway.bridgeUrl,client_id:this.session.sessionCrypto.sessionId,wallet_id:this.session.walletPublicKey,message_id:o,request_type:e.method,trace_id:n.traceId}),yield this.gateway.send(s,this.session.walletPublicKey,e.method,{attempts:n?.attempts,signal:n?.signal,traceId:n.traceId}),(a=n?.onRequestSent)==null||a.call(n),this.pendingRequests.set(o.toString(),t)}catch(e){r(e)}}))}closeConnection(){this.closeGateways(),this.listeners=[],this.session=null,this.gateway=null}disconnect(e){return w(this,void 0,void 0,function*(){let t=e?.traceId??E();return new Promise(n=>w(this,void 0,void 0,function*(){let r=!1,i=null,a=()=>{r||(r=!0,this.removeBridgeAndSession().then(n))};try{this.closeGateways();let n=Ot(e?.signal);i=setTimeout(()=>{n.abort()},this.defaultOpeningDeadlineMS),yield this.sendRequest({method:`disconnect`,params:[]},{onRequestSent:a,signal:n.signal,attempts:1,traceId:t})}catch{r||this.removeBridgeAndSession().then(n)}finally{i&&clearTimeout(i),a()}}))})}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter(t=>t!==e)}pause(){var e;(e=this.gateway)==null||e.pause(),this.pendingGateways.forEach(e=>e.pause())}unPause(){return w(this,void 0,void 0,function*(){let e=this.pendingGateways.map(e=>e.unPause());this.gateway&&e.push(this.gateway.unPause()),yield Promise.all(e)})}pendingGatewaysListener(e,t,n){return w(this,void 0,void 0,function*(){if(!this.pendingGateways.includes(e)){yield e.close();return}return this.closeGateways({except:e}),this.gateway&&(yield this.gateway.close()),this.session.bridgeUrl=t,this.gateway=e,this.gateway.setErrorsListener(this.gatewayErrorsListener.bind(this)),this.gateway.setListener(this.gatewayListener.bind(this)),this.gatewayListener(n)})}gatewayListener(e){return w(this,void 0,void 0,function*(){var t,n;let r=e.traceId??E(),i;try{i=JSON.parse(this.session.sessionCrypto.decrypt(be.decode(e.message).toUint8Array(),we(e.from)))}catch(n){throw(t=this.analytics)==null||t.emitBridgeClientMessageDecodeError({bridge_url:this.session.bridgeUrl,client_id:this.session.sessionCrypto.sessionId,wallet_id:e.from,error_message:String(n),trace_id:e?.traceId}),n}let a=`event`in i?i.event:``;if((n=this.analytics)==null||n.emitBridgeClientMessageReceived({bridge_url:this.session.bridgeUrl,client_id:this.session.sessionCrypto.sessionId,wallet_id:e.from,message_id:String(i.id),request_type:a,trace_id:e?.traceId}),!(`event`in i)){let e=i.id.toString(),t=this.pendingRequests.get(e);if(!t){`${e}`;return}t(Object.assign(Object.assign({},i),{traceId:r})),this.pendingRequests.delete(e);return}if(i.id!==void 0){let e=yield this.connectionStorage.getLastWalletEventId();if(e!==void 0&&i.id<=e){`${i.id}${e}`;return}i.event!==`connect`&&(yield this.connectionStorage.storeLastWalletEventId(i.id))}let o=this.listeners;i.event===`connect`&&(yield this.updateSession(i,e.from)),i.event===`disconnect`&&(yield this.removeBridgeAndSession()),o.forEach(e=>e(Object.assign(Object.assign({},i),{traceId:r})))})}gatewayErrorsListener(e){return w(this,void 0,void 0,function*(){throw new T(`Bridge error ${JSON.stringify(e)}`)})}updateSession(e,t){return w(this,void 0,void 0,function*(){this.session=Object.assign(Object.assign({},this.session),{walletPublicKey:t});let n=e.payload.items.find(e=>e.name===`ton_addr`),r=Object.assign(Object.assign({},e),{payload:Object.assign(Object.assign({},e.payload),{items:[n]})});yield this.connectionStorage.storeConnection({type:`http`,session:this.session,lastWalletEventId:e.id,connectEvent:r,nextRpcRequestId:0})})}removeBridgeAndSession(){return w(this,void 0,void 0,function*(){this.closeConnection(),yield this.connectionStorage.removeConnection()})}openGateways(e,t){return w(this,void 0,void 0,function*(){let n=t?.traceId??E();if(Array.isArray(this.walletConnectionSource)){this.pendingGateways.map(e=>e.close().catch()),this.pendingGateways=this.walletConnectionSource.map(t=>{let n=new Nt(this.connectionStorage.storage,t.bridgeUrl,e.sessionId,()=>{},()=>{},this.analyticsManager);return n.setListener(e=>this.pendingGatewaysListener(n,t.bridgeUrl,e)),n});let r=Math.max(this.pendingGateways.length-this.optionalOpenGateways,1);yield qt(this.pendingGateways.map(e=>kt(r=>this.pendingGateways.some(t=>t===e)?e.registerSession({openingDeadlineMS:t?.openingDeadlineMS??this.defaultOpeningDeadlineMS,signal:r.signal,traceId:n}):e.close(),{attempts:2**53-1,delayMs:this.defaultRetryTimeoutMS,signal:t?.signal})),r);return}return this.gateway&&(yield this.gateway.close()),this.gateway=new Nt(this.connectionStorage.storage,this.walletConnectionSource.bridgeUrl,e.sessionId,this.gatewayListener.bind(this),this.gatewayErrorsListener.bind(this),this.analyticsManager),yield this.gateway.registerSession({openingDeadlineMS:t?.openingDeadlineMS,signal:t?.signal,traceId:n})})}closeGateways(e){var t;(t=this.gateway)==null||t.close(),this.pendingGateways.filter(t=>t!==e?.except).forEach(e=>e.close()),this.pendingGateways=[]}};function nn(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e,n=t.code;if(typeof n!=`number`||!Number.isSafeInteger(n))return;let r={code:n,message:typeof t.message==`string`?t.message:``};return`data`in t&&(r.data=t.data),r}var rn=/^(0|[1-9][0-9]{0,2})$/;function an(e){return Object.prototype.toString.call(e)}function on(e,t){return e&&t.has(e.code)?e:void 0}function sn(e,t){try{let n=an(e);if(n===`[object DOMException]`)return;if(typeof e==`number`)return Number.isSafeInteger(e)?on({code:e,message:``},t):void 0;if(n===`[object Object]`){let n=e;return on(nn(an(n.error)===`[object Object]`?n.error:n),t)}if(typeof e==`object`&&e){let n=e.message;return typeof n==`string`&&rn.test(n)?on({code:Number(n),message:n},t):void 0}return}catch{return}}function cn(e,t){return ln(e,[t])}function ln(e,t){return!e||typeof e!=`object`?!1:t.every(t=>t in e)}function un(e){try{return!cn(e,`tonconnect`)||!cn(e.tonconnect,`walletInfo`)?!1:ln(e.tonconnect.walletInfo,[`name`,`app_name`,`image`,`about_url`,`platforms`])}catch{return!1}}var dn=class e{static getInstance(){return e.instance||=new e,e.instance}constructor(){this.storage={}}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){return this.storage[e]??null}key(e){let t=Object.keys(this.storage);return e<0||e>=t.length?null:t[e]??null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}};function fn(){if(typeof window<`u`)return window}function pn(){if(typeof document<`u`)return document}function mn(){let e=fn()?.location.origin;return e?e+`/tonconnect-manifest.json`:``}function hn(){let e=fn()?.location?.origin,t=fn()?.location?.pathname;return e&&t?e+t:``}function gn(){if(_n())return localStorage;if(vn())throw new T("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return dn.getInstance()}function _n(){try{return typeof localStorage<`u`}catch{return!1}}function vn(){return n!==void 0&&n.versions!=null&&n.versions.node!=null}function yn(){try{return typeof window<`u`&&window.location?window.location.hostname:null}catch{return null}}function bn(){let e=fn();if(!e)return[];try{return Object.entries(e)}catch{return[]}}var xn=17,Sn=81,Cn=128;function wn(e,t=!1){let{wc:n,hex:r}=kn(e),i=Sn;t&&(i|=Cn);let a=new Int8Array(34);a[0]=i,a[1]=n,a.set(r,2);let o=new Uint8Array(36);return o.set(a),o.set(An(a),34),be.encode(o).replace(/\+/g,`-`).replace(/\//g,`_`)}function Tn(e){try{return On(e),!0}catch{return!1}}function En(e){try{return kn(e),!0}catch{return!1}}function Dn({wc:e,hex:t}){return`${e}:${t}`}function On(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n;try{n=be.decode(t).toUint8Array()}catch{throw new Tt(`Invalid base64 encoding in address: ${e}`)}if(n.length!==36)throw new Tt(`Invalid address length: ${e}`);let r=n.slice(0,34),i=n.slice(34,36),a=An(r);if(!i.every((e,t)=>e===a[t]))throw new Tt(`Invalid checksum in address: ${e}`);let o=r[0],s=!1,c=!1;if(o&Cn&&(s=!0,o^=Cn),o!==xn&&o!==Sn)throw new Tt(`Unknown address tag: ${o}`);c=o===xn;let l=null;l=r[1]===255?-1:r[1];let u=r.slice(2);if(l!==0&&l!==-1)throw new Tt(`Invalid workchain: ${l}`);return{wc:l,hex:Array.from(u).map(e=>e.toString(16).padStart(2,`0`)).join(``),testOnly:s,isBounceable:c}}function kn(e){if(!e.includes(`:`))throw new Tt(`Wrong address ${e}. Address must include ":".`);let t=e.split(`:`);if(t.length!==2)throw new Tt(`Wrong address ${e}. Address must include ":" only once.`);let n=parseInt(t[0]);if(n!==0&&n!==-1)throw new Tt(`Wrong address ${e}. WC must be eq 0 or -1, but ${n} received.`);let r=t[1];if(r?.length!==64)throw new Tt(`Wrong address ${e}. Hex part must be 64bytes length, but ${r?.length} received.`);return{wc:n,hex:Mn(r)}}function An(e){let t=0,n=new Uint8Array(e.length+2);n.set(e);for(let e of n){let n=128;for(;n>0;)t<<=1,e&n&&(t+=1),n>>=1,t>65535&&(t&=65535,t^=4129)}return new Uint8Array([Math.floor(t/256),t%256])}var jn={};for(let e=0;e<=255;e++){let t=e.toString(16);t.length<2&&(t=`0`+t),jn[t]=e}function Mn(e){e=e.toLowerCase();let t=e.length;if(t%2!=0)throw new Et(`Hex string must have length a multiple of 2: `+e);let n=t/2,r=new Uint8Array(n);for(let t=0;t<n;t++){let n=t*2,i=e.substring(n,n+2);if(!jn.hasOwnProperty(i))throw new Et(`Invalid hex character: `+i);r[t]=jn[i]}return r}var Nn=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Pn=/^[A-Za-z0-9\-_]+$/,Fn=`te6cc`,In=/^-?\d+$/,Ln=/^\d+$/,Rn=128,zn=128,Bn=222;function Vn(e){return typeof e==`number`&&!isNaN(e)}function D(e){return typeof e==`string`&&e.length>0}function Hn(e){return D(e)&&(En(e)||Tn(e))}function Un(e){return D(e)&&/^-?\d+$/.test(e)}function Wn(e){return typeof e==`string`&&(Nn.test(e)||Pn.test(e))&&e.startsWith(Fn)}function Gn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Kn(e){return Array.isArray(e)}function qn(e,t){return Object.keys(e).some(e=>!t.includes(e))}function Jn(e){return Yn(e)}function Yn(e){if(!Gn(e))return`Request must be an object`;if(qn(e,[`validUntil`,`network`,`from`,`messages`,`items`]))return`Request contains extra properties`;if(e.validUntil){if(!Vn(e.validUntil))return`Incorrect 'validUntil'`;Math.floor(Date.now()/1e3)+300,e.validUntil}if(e.network!==void 0&&!Un(e.network))return`Invalid 'network' format`;if(e.from!==void 0&&!Hn(e.from))return`Invalid 'from' address format`;let t=Kn(e.messages),n=Kn(e.items);if(t&&n)return`Request must contain either 'messages' or 'items', not both`;if(!t&&!n)return`Request must contain 'messages' or 'items'`;if(t){if(e.messages.length===0)return`'messages' must not be empty`;for(let t=0;t<e.messages.length;t++){let n=e.messages[t],r=Xn(n,t);if(r)return r}}if(n){let t=Zn(e.items);if(t)return t}return null}function Xn(e,t){if(!Gn(e))return`Message at index ${t} must be an object`;if(qn(e,[`address`,`amount`,`stateInit`,`payload`,`extraCurrency`]))return`Message at index ${t} contains extra properties`;if(!D(e.address))return`'address' is required in message at index ${t}`;if(!Tn(e.address))return`Wrong 'address' format in message at index ${t}`;if(!D(e.amount))return`'amount' is required in message at index ${t}`;if(!/^[0-9]+$/.test(e.amount))return`Incorrect 'amount' in message at index ${t}`;if(e.stateInit!==void 0&&(!D(e.stateInit)||!Wn(e.stateInit)))return`Invalid 'stateInit' in message at index ${t}`;if(e.payload!==void 0&&(!D(e.payload)||!Wn(e.payload)))return`Invalid 'payload' in message at index ${t}`;if(e.extraCurrency!==void 0){if(!Gn(e.extraCurrency))return`Invalid 'extraCurrency' in message at index ${t}`;for(let[n,r]of Object.entries(e.extraCurrency))if(!In.test(n)||typeof r!=`string`||!Ln.test(r))return`Invalid 'extraCurrency' format in message at index ${t}`}return null}function Zn(e){if(e.length===0)return`'items' must not be empty`;for(let t=0;t<e.length;t++){let n=e[t],r=Qn(n,t);if(r)return r}return null}function Qn(e,t){if(!Gn(e))return`Item at index ${t} must be an object`;if(!D(e.type))return`'type' is required in item at index ${t}`;switch(e.type){case`ton`:return $n(e,t);case`jetton`:return er(e,t);case`nft`:return tr(e,t);default:return`Unknown item type '${e.type}' at index ${t}`}}function $n(e,t){if(qn(e,[`type`,`address`,`amount`,`payload`,`stateInit`,`extraCurrency`]))return`Ton item at index ${t} contains extra properties`;if(!D(e.address))return`'address' is required in ton item at index ${t}`;if(!Tn(e.address))return`Wrong 'address' format in ton item at index ${t}`;if(!D(e.amount))return`'amount' is required in ton item at index ${t}`;if(!/^[0-9]+$/.test(e.amount))return`Incorrect 'amount' in ton item at index ${t}`;if(e.payload!==void 0&&(!D(e.payload)||!Wn(e.payload)))return`Invalid 'payload' in ton item at index ${t}`;if(e.stateInit!==void 0&&(!D(e.stateInit)||!Wn(e.stateInit)))return`Invalid 'stateInit' in ton item at index ${t}`;if(e.extraCurrency!==void 0){if(!Gn(e.extraCurrency))return`Invalid 'extraCurrency' in ton item at index ${t}`;for(let[n,r]of Object.entries(e.extraCurrency))if(!In.test(n)||typeof r!=`string`||!Ln.test(r))return`Invalid 'extraCurrency' format in ton item at index ${t}`}return null}function er(e,t){return qn(e,[`type`,`master`,`destination`,`amount`,`attachAmount`,`responseDestination`,`customPayload`,`forwardAmount`,`forwardPayload`,`queryId`])?`Jetton item at index ${t} contains extra properties`:D(e.master)?Hn(e.master)?D(e.destination)?Hn(e.destination)?D(e.amount)?/^[0-9]+$/.test(e.amount)?e.attachAmount!==void 0&&(!D(e.attachAmount)||!/^[0-9]+$/.test(e.attachAmount))?`Invalid 'attachAmount' in jetton item at index ${t}`:e.responseDestination!==void 0&&!Hn(e.responseDestination)?`Wrong 'responseDestination' address format in jetton item at index ${t}`:e.customPayload!==void 0&&(!D(e.customPayload)||!Wn(e.customPayload))?`Invalid 'customPayload' in jetton item at index ${t}`:e.forwardAmount!==void 0&&(!D(e.forwardAmount)||!/^[0-9]+$/.test(e.forwardAmount))?`Invalid 'forwardAmount' in jetton item at index ${t}`:e.forwardPayload!==void 0&&(!D(e.forwardPayload)||!Wn(e.forwardPayload))?`Invalid 'forwardPayload' in jetton item at index ${t}`:e.queryId!==void 0&&(!D(e.queryId)||!/^[0-9]+$/.test(e.queryId))?`Invalid 'queryId' in jetton item at index ${t}`:null:`Incorrect 'amount' in jetton item at index ${t}`:`'amount' is required in jetton item at index ${t}`:`Wrong 'destination' address format in jetton item at index ${t}`:`'destination' is required in jetton item at index ${t}`:`Wrong 'master' address format in jetton item at index ${t}`:`'master' is required in jetton item at index ${t}`}function tr(e,t){return qn(e,[`type`,`nftAddress`,`newOwner`,`attachAmount`,`responseDestination`,`customPayload`,`forwardAmount`,`forwardPayload`,`queryId`])?`NFT item at index ${t} contains extra properties`:D(e.nftAddress)?Hn(e.nftAddress)?D(e.newOwner)?Hn(e.newOwner)?e.attachAmount!==void 0&&(!D(e.attachAmount)||!/^[0-9]+$/.test(e.attachAmount))?`Invalid 'attachAmount' in nft item at index ${t}`:e.responseDestination!==void 0&&!Hn(e.responseDestination)?`Wrong 'responseDestination' address format in nft item at index ${t}`:e.customPayload!==void 0&&(!D(e.customPayload)||!Wn(e.customPayload))?`Invalid 'customPayload' in nft item at index ${t}`:e.forwardAmount!==void 0&&(!D(e.forwardAmount)||!/^[0-9]+$/.test(e.forwardAmount))?`Invalid 'forwardAmount' in nft item at index ${t}`:e.forwardPayload!==void 0&&(!D(e.forwardPayload)||!Wn(e.forwardPayload))?`Invalid 'forwardPayload' in nft item at index ${t}`:e.queryId!==void 0&&(!D(e.queryId)||!/^[0-9]+$/.test(e.queryId))?`Invalid 'queryId' in nft item at index ${t}`:null:`Wrong 'newOwner' address format in nft item at index ${t}`:`'newOwner' is required in nft item at index ${t}`:`Wrong 'nftAddress' address format in nft item at index ${t}`:`'nftAddress' is required in nft item at index ${t}`}function nr(e){if(!Gn(e))return`Request must be an object`;if(qn(e,[`tonProof`]))return`Request contains extra properties`;if(e.tonProof!==void 0){if(typeof e.tonProof!=`string`)return`Invalid 'tonProof'`;let t=e.tonProof;if(t.length===0)return`Empty 'tonProof' payload`;let n=yn();if(!n)return null;let r=new TextEncoder().encode(n).length;if(r>Rn)return`Current domain exceeds 128 bytes limit`;let i=new TextEncoder().encode(t).length;if(i>zn)return`'tonProof' payload exceeds 128 bytes limit`;if(r+i>Bn)return`'tonProof' domain + payload exceeds 222 bytes limit`}return null}function rr(e){if(!Gn(e))return`Embedded request must be an object`;if(qn(e,[`method`,`request`]))return`Embedded request contains extra properties`;if(!D(e.method))return`Embedded request: 'method' is required`;if(!(`request`in e))return`Embedded request: 'request' is required`;let t=t=>t===null?null:`Embedded ${e.method}: ${t}`;switch(e.method){case`sendTransaction`:return t(Yn(e.request));case`signData`:return t(ir(e.request));case`signMessage`:return t(Jn(e.request))}return`Invalid 'method' value: ${e.method}`}function ir(e){if(!Gn(e))return`Payload must be an object`;if(!D(e.type))return`'type' is required`;switch(e.type){case`text`:return ar(e);case`binary`:return or(e);case`cell`:return sr(e);default:return`Invalid 'type' value`}}function ar(e){return qn(e,[`type`,`text`,`network`,`from`])?`Text payload contains extra properties`:D(e.text)?e.network!==void 0&&!Un(e.network)?`Invalid 'network' format`:e.from!==void 0&&!Hn(e.from)?`Invalid 'from'`:null:`'text' is required`}function or(e){return qn(e,[`type`,`bytes`,`network`,`from`])?`Binary payload contains extra properties`:D(e.bytes)?e.network!==void 0&&!Un(e.network)?`Invalid 'network' format`:e.from!==void 0&&!Hn(e.from)?`Invalid 'from'`:null:`'bytes' is required`}function sr(e){return qn(e,[`type`,`schema`,`cell`,`network`,`from`])?`Cell payload contains extra properties`:D(e.schema)?D(e.cell)?Wn(e.cell)?e.network!==void 0&&!Un(e.network)?`Invalid 'network' format`:e.from!==void 0&&!Hn(e.from)?`Invalid 'from'`:null:`Invalid 'cell' format (must be valid base64)`:`'cell' is required`:`'schema' is required`}function cr(e){if(!Gn(e))return`ton_proof item must be an object`;if(qn(e,[`error`,`proof`,`name`]))return`ton_proof item contains extra properties`;let t=Object.prototype.hasOwnProperty.call(e,`proof`),n=Object.prototype.hasOwnProperty.call(e,`error`);if(!t&&!n)return`'ton_proof' item must contain either 'proof' or 'error'`;if(t&&n)return`'ton_proof' item must contain either 'proof' or 'error', not both`;if(t){let t=e.proof;if(!Gn(t))return`Invalid 'proof' object`;if(qn(t,[`timestamp`,`domain`,`payload`,`signature`]))return`ton_proof item contains extra properties`;if(!Vn(t.timestamp))return`Invalid 'proof.timestamp'`;let n=t.domain;if(!Gn(n))return`Invalid 'proof.domain'`;if(!Vn(n.lengthBytes))return`Invalid 'proof.domain.lengthBytes'`;if(!D(n.value))return`Invalid 'proof.domain.value'`;try{if((typeof TextEncoder<`u`?new TextEncoder().encode(n.value).length:n.value.length)!==n.lengthBytes)return`'proof.domain.lengthBytes' does not match 'proof.domain.value'`}catch{}if(!D(t.payload))return`Invalid 'proof.payload'`;if(!D(t.signature)||!Nn.test(t.signature))return`Invalid 'proof.signature' format`}if(n){let t=e.error;if(!Gn(t))return`Invalid 'error' object`;if(qn(t,[`code`,`message`]))return`ton_proof error contains extra properties`;if(!Vn(t.code))return`Invalid 'error.code'`;if(!D(t.message))return`Invalid 'error.message'`}return null}function lr(e){return Hn(e.address)?Un(e.network)?null:`Invalid 'ton_addr.network'`:`Invalid 'ton_addr.address'`}function ur(e){return Gn(e)?Kn(e.features)?null:`Invalid 'device.features'`:`Invalid 'device'`}function dr(e){if(!Gn(e))return`connect payload must be an object`;if(!Kn(e.items))return`Invalid 'items'`;for(let t of e.items){if(!Gn(t)||!D(t.name))return`Every connect item must be an object with a name`;if(t.name===`ton_addr`){let e=lr(t);if(e)return e}}return ur(e.device)}function fr(e){return typeof e==`object`&&!!e}function pr(e){try{if(!fr(e))return;if(`error`in e){let t=nn(e.error);return t?Object.assign(Object.assign({},e),{error:t}):void 0}if(!(`result`in e))return;let t=e.result;return t==null?void 0:Object.assign(Object.assign({},e),{result:t})}catch{return}}function mr(e){try{if(!fr(e))return;if(e.event===`connect`){let t=e.payload;return dr(t)===null?Object.assign(Object.assign({},e),{payload:t}):void 0}if(e.event===`connect_error`){let t=nn(e.payload);return t?Object.assign(Object.assign({},e),{payload:t}):void 0}return}catch{return}}var hr=class e{static fromStorage(t,n){return w(this,void 0,void 0,function*(){let r=yield t.getInjectedConnection();return new e(t,r.jsBridgeKey,n)})}static isWalletInjected(t){return e.isWindowContainsWallet(this.window,t)}static isInsideWalletBrowser(t){return e.isWindowContainsWallet(this.window,t)?this.window[t].tonconnect.isWalletBrowser:!1}static getCurrentlyInjectedWallets(){return this.window?bn().filter(([e,t])=>un(t)).map(([e,t])=>({name:t.tonconnect.walletInfo.name,appName:t.tonconnect.walletInfo.app_name,aboutUrl:t.tonconnect.walletInfo.about_url,imageUrl:t.tonconnect.walletInfo.image,tondns:t.tonconnect.walletInfo.tondns,jsBridgeKey:e,injected:!0,embedded:t.tonconnect.isWalletBrowser,platforms:t.tonconnect.walletInfo.platforms,features:t.tonconnect.walletInfo.features})):[]}static isWindowContainsWallet(e,t){return!!e&&t in e&&typeof e[t]==`object`&&`tonconnect`in e[t]}constructor(t,n,r){this.connectionStorage=t,this.injectedWalletKey=n,this.type=`injected`,this.unsubscribeCallback=null,this.listenSubscriptions=!1,this.listeners=[];let i=e.window;if(!e.isWindowContainsWallet(i,n))throw new Ne;this.injectedWallet=i[n].tonconnect,r&&(this.analytics=r.scoped({bridge_key:n,wallet_app_name:this.injectedWallet.deviceInfo.appName,wallet_app_version:this.injectedWallet.deviceInfo.appVersion}))}connect(e,t){this._connect(Jt,e,t).catch(e=>void 0)}restoreConnection(e){return w(this,void 0,void 0,function*(){var t,n,r;let i=e?.traceId??E();try{(t=this.analytics)==null||t.emitJsBridgeCall({js_bridge_method:`restoreConnection`,trace_id:i});let e=yield this.injectedWallet.restoreConnection();(n=this.analytics)==null||n.emitJsBridgeResponse({js_bridge_method:`restoreConnection`,trace_id:i});let r=mr(e);r?.event===`connect`?(this.makeSubscriptions({traceId:i}),this.listeners.forEach(e=>e(Object.assign(Object.assign({},r),{traceId:i,restored:!0})))):yield this.connectionStorage.removeConnection()}catch(e){(r=this.analytics)==null||r.emitJsBridgeError({js_bridge_method:`restoreConnection`,error_message:gr(e),trace_id:i}),yield this.connectionStorage.removeConnection()}})}closeConnection(){if(this.listenSubscriptions)try{this.disconnectWallet()}catch{}this.closeAllListeners()}disconnectWallet(){Promise.resolve(this.injectedWallet.disconnect()).catch(At)}disconnect(e){return w(this,void 0,void 0,function*(){let t=e?.traceId??E();return new Promise((e,n)=>{let r=!1,i=()=>{if(!r){r=!0;try{this.closeAllListeners()}catch{}this.connectionStorage.removeConnection().then(e,n)}};try{this.disconnectWallet(),i()}catch{this.sendRequest({method:`disconnect`,params:[]},{onRequestSent:i,traceId:t}).catch(At).then(i)}})})}closeAllListeners(){var e;this.listenSubscriptions=!1,this.listeners=[],(e=this.unsubscribeCallback)==null||e.call(this)}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter(t=>t!==e)}sendRequest(e,t){return w(this,void 0,void 0,function*(){var n,r;let i={};typeof t==`function`?(i.onRequestSent=t,i.traceId=E()):(i.onRequestSent=t?.onRequestSent,i.signal=t?.signal,i.attempts=t?.attempts,i.traceId=t?.traceId??E());let a,o;try{a=(yield this.connectionStorage.getNextRpcRequestId()).toString(),yield this.connectionStorage.increaseNextRpcRequestId(),Object.assign(Object.assign({},e),{id:a}),(n=this.analytics)==null||n.emitJsBridgeCall({js_bridge_method:`send`}),o=Promise.resolve(this.injectedWallet.send(Object.assign(Object.assign({},e),{id:a})))}catch(e){throw new Le(`Could not send the request to the injected wallet`,{cause:e})}let s=o.then(e=>{var t,n;let r=pr(e);if(!r)throw(t=this.analytics)==null||t.emitJsBridgeError({js_bridge_method:`send`,error_message:gr(e)}),new Le(`Injected wallet answered without a TON Connect response`,{cause:e});return(n=this.analytics)==null||n.emitJsBridgeResponse({js_bridge_method:`send`}),r},e=>{var t;(t=this.analytics)==null||t.emitJsBridgeError({js_bridge_method:`send`,error_message:gr(e)});let n=sn(e,st);if(!n)throw new Le(`Injected wallet rejected the request without a TON Connect error response`,{cause:e});return et(n),{id:a,error:n}});try{(r=i.onRequestSent)==null||r.call(i)}catch(e){throw s.catch(e=>void 0),e}return s})}_connect(e,t,n){return w(this,void 0,void 0,function*(){var r,i,a,o;let s=n?.traceId??E(),c;try{`${e}`,(r=this.analytics)==null||r.emitJsBridgeCall({js_bridge_method:`connect`,trace_id:s}),c=yield this.injectedWallet.connect(e,t)}catch(e){(i=this.analytics)==null||i.emitJsBridgeError({js_bridge_method:`connect`,error_message:gr(e),trace_id:s});let t=sn(e,ct);t?(et(t),this.emitConnectError(t,s)):this.emitConnectFailure(e,new Le(`Injected wallet rejected the connection without a TON Connect event`,{cause:e}),s);return}let l=mr(c);if(!l){(a=this.analytics)==null||a.emitJsBridgeError({js_bridge_method:`connect`,error_message:gr(c),trace_id:s}),this.emitConnectFailure(c,new Le(`Injected wallet answered the connection without a TON Connect event`,{cause:c}),s);return}try{(o=this.analytics)==null||o.emitJsBridgeResponse({js_bridge_method:`connect`}),l.event===`connect`&&(yield this.updateSession(),this.makeSubscriptions({traceId:s})),this.listeners.forEach(e=>e(Object.assign(Object.assign({},l),{traceId:s})))}catch(e){this.emitConnectFailure(e,new T(`Injected connection could not be completed`,{cause:e}),s)}})}emitWalletEvent(e,t){if(e.event!==`connect`&&e.event!==`connect_error`){this.listeners.forEach(n=>n(Object.assign(Object.assign({},e),{traceId:t})));return}let n=mr(e);if(!n){this.emitConnectFailure(e,new Le(`Injected wallet sent a malformed TON Connect event`,{cause:e}),t);return}try{this.listeners.forEach(e=>e(Object.assign(Object.assign({},n),{traceId:t})))}catch(e){this.emitConnectFailure(e,new T(`Injected connection could not be completed`,{cause:e}),t)}}emitConnectFailure(e,t,n){let r={code:0,message:gr(e)};nt(r,t),this.emitConnectError(r,n)}emitConnectError(e,t){let n={event:`connect_error`,payload:e};this.listeners.forEach(e=>e(Object.assign(Object.assign({},n),{traceId:t})))}makeSubscriptions(e){var t,n,r;this.listenSubscriptions=!0,(t=this.analytics)==null||t.emitJsBridgeCall({js_bridge_method:`listen`,trace_id:e.traceId});try{this.unsubscribeCallback=this.injectedWallet.listen(e=>{try{this.onWalletEvent(e)}catch{}}),(n=this.analytics)==null||n.emitJsBridgeResponse({js_bridge_method:`listen`,trace_id:e.traceId})}catch(t){throw(r=this.analytics)==null||r.emitJsBridgeError({js_bridge_method:`listen`,error_message:gr(t),trace_id:e.traceId}),t}}onWalletEvent(e){if(typeof e!=`object`||!e)return;let t=e.traceId??E();if(this.listenSubscriptions)try{this.emitWalletEvent(e,t)}catch{}e.event===`disconnect`&&this.disconnect({traceId:t}).catch(e=>void 0)}updateSession(){return this.connectionStorage.storeConnection({type:`injected`,jsBridgeKey:this.injectedWalletKey,nextRpcRequestId:0})}};hr.window=fn();function gr(e){try{return String(e)}catch{try{return Object.prototype.toString.call(e)}catch{return`[unreadable value]`}}}var _r=class{constructor(e,t){this.storage=e,this.walletsListManager=t,this.storeKey=`ton-connect-storage_bridge-connection`}storeConnection(e){return w(this,void 0,void 0,function*(){if(e.type===`injected`||e.type===`wallet-connect`)return this.storage.setItem(this.storeKey,JSON.stringify(e));if(!It(e)){let t={sessionKeyPair:e.session.sessionCrypto.stringifyKeypair(),walletPublicKey:e.session.walletPublicKey,bridgeUrl:e.session.bridgeUrl},n={type:`http`,connectEvent:e.connectEvent,session:t,lastWalletEventId:e.lastWalletEventId,nextRpcRequestId:e.nextRpcRequestId};return this.storage.setItem(this.storeKey,JSON.stringify(n))}let t={type:`http`,connectionSource:e.connectionSource,sessionCrypto:e.sessionCrypto.stringifyKeypair(),createdAt:Date.now()};return this.storage.setItem(this.storeKey,JSON.stringify(t))})}removeConnection(){return w(this,void 0,void 0,function*(){return this.storage.removeItem(this.storeKey)})}getConnection(){return w(this,void 0,void 0,function*(){try{let e=yield this.storage.getItem(this.storeKey);if(!e)return null;let t=JSON.parse(e);if(t.type===`injected`||t.type===`wallet-connect`)return t;if(!Lt(t)){let e=new Te(t.session.sessionKeyPair);return yield this.actualizeBridgeConnection({type:`http`,connectEvent:t.connectEvent,lastWalletEventId:t.lastWalletEventId,nextRpcRequestId:t.nextRpcRequestId,session:{sessionCrypto:e,bridgeUrl:t.session.bridgeUrl,walletPublicKey:t.session.walletPublicKey}})}return Rt(t)?(yield this.removeConnection(),null):{type:`http`,sessionCrypto:new Te(t.sessionCrypto),connectionSource:t.connectionSource}}catch{return null}})}getHttpConnection(){return w(this,void 0,void 0,function*(){let e=yield this.getConnection();if(!e)throw new T(`Trying to read HTTP connection source while nothing is stored`);if(e.type!==`http`)throw new T(`Trying to read HTTP connection source while ${e.type} connection is stored`);return e})}getHttpPendingConnection(){return w(this,void 0,void 0,function*(){let e=yield this.getConnection();if(!e)throw new T(`Trying to read HTTP connection source while nothing is stored`);if(e.type!==`http`)throw new T(`Trying to read HTTP connection source while ${e.type} connection is stored`);if(!It(e))throw new T(`Trying to read HTTP-pending connection while http connection is stored`);return e})}getInjectedConnection(){return w(this,void 0,void 0,function*(){let e=yield this.getConnection();if(!e)throw new T(`Trying to read Injected bridge connection source while nothing is stored`);if(e?.type!==`injected`)throw new T(`Trying to read Injected bridge connection source while ${e.type} connection is stored`);return e})}getWalletConnectConnection(){return w(this,void 0,void 0,function*(){let e=yield this.getConnection();if(!e)throw new T(`Trying to read wallet connect bridge connection source while nothing is stored`);if(e?.type!==`wallet-connect`)throw new T(`Trying to read wallet connect bridge connection source while ${e.type} connection is stored`);return e})}storedConnectionType(){return w(this,void 0,void 0,function*(){let e=yield this.storage.getItem(this.storeKey);return e?JSON.parse(e).type:null})}storeLastWalletEventId(e){return w(this,void 0,void 0,function*(){let t=yield this.getConnection();if(t&&t.type===`http`&&!It(t))return t.lastWalletEventId=e,this.storeConnection(t)})}getLastWalletEventId(){return w(this,void 0,void 0,function*(){let e=yield this.getConnection();if(e&&`lastWalletEventId`in e)return e.lastWalletEventId})}increaseNextRpcRequestId(){return w(this,void 0,void 0,function*(){let e=yield this.getConnection();if(e&&`nextRpcRequestId`in e)return e.nextRpcRequestId=(e.nextRpcRequestId||0)+1,this.storeConnection(e)})}getNextRpcRequestId(){return w(this,void 0,void 0,function*(){let e=yield this.getConnection();return e&&`nextRpcRequestId`in e&&e.nextRpcRequestId||0})}actualizeBridgeConnection(e){return w(this,void 0,void 0,function*(){try{let t=e.connectEvent.payload.device.appName,n=yield this.walletsListManager.getRemoteWallet(t);if(n.bridgeUrl===e.session.bridgeUrl)return e;let r=Object.assign(Object.assign({},e),{session:Object.assign(Object.assign({},e.session),{bridgeUrl:n.bridgeUrl})});return yield this.storeConnection(r),r}catch{return e}})}},vr=class{constructor(){this.localStorage=gn()}getItem(e){return w(this,void 0,void 0,function*(){return this.localStorage.getItem(e)})}removeItem(e){return w(this,void 0,void 0,function*(){this.localStorage.removeItem(e)})}setItem(e,t){return w(this,void 0,void 0,function*(){this.localStorage.setItem(e,t)})}},yr=[{app_name:`telegram`,name:`Telegram`,image:`https://telegram.org/img/t_logo_2x.png`,about_url:`https://telegram.org`,universal_url:`https://t.me/sendgrams`,deepLink:`tg://sendgrams`,bridge:[{type:`js`,key:`telegram`},{type:`sse`,url:`https://tonbridge.telegram.org`}],platforms:[`ios`,`android`,`chrome`,`firefox`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!1},{name:`SignData`,types:[`text`,`binary`,`cell`]}]},{app_name:`gramwallet`,name:`Gram Wallet`,image:`https://config.ton.org/assets/gramwallet.png`,about_url:`https://gramwallet.io`,universal_url:`https://connect.gramwallet.io`,deepLink:`gramwallet-tc://`,bridge:[{type:`js`,key:`gramwallet`},{type:`sse`,url:`https://tonconnectbridge.mytonwallet.org/bridge/`}],platforms:[`ios`,`android`],ui:{isButtonTransparent:!0},features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!1},{name:`SignData`,types:[`text`,`binary`,`cell`]}]},{app_name:`telegram-wallet`,name:`Walt (ex. Wallet)`,image:`https://config.ton.org/assets/telegram_wallet.png`,about_url:`https://walt.io/`,universal_url:`https://t.me/walt?attach=wallet`,bridge:[{type:`sse`,url:`https://walletbot.me/tonconnect-bridge/bridge`}],platforms:[`ios`,`android`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!0},{name:`SignData`,types:[`text`,`binary`,`cell`]}]},{app_name:`tonkeeper`,name:`Keeper`,image:`https://tonkeeper.com/assets/tonconnect-icon.png`,tondns:`tonkeeper.ton`,about_url:`https://tonkeeper.com`,universal_url:`https://app.tonkeeper.com/ton-connect`,deepLink:`tonkeeper-tc://`,bridge:[{type:`sse`,url:`https://bridge.tonapi.io/bridge`},{type:`js`,key:`tonkeeper`}],platforms:[`ios`,`android`,`chrome`,`firefox`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!0},{name:`SignData`,types:[`text`,`binary`,`cell`]}]},{app_name:`mytonwallet`,name:`My Wallet`,image:`https://config.ton.org/assets/mytonwallet.png`,about_url:`https://mywallet.io/?utm_source=tc`,universal_url:`https://connect.mytonwallet.org`,deepLink:`mytonwallet-tc://`,bridge:[{type:`js`,key:`mytonwallet`},{type:`sse`,url:`https://tonconnectbridge.mytonwallet.org/bridge/`}],platforms:[`chrome`,`windows`,`macos`,`linux`,`ios`,`android`,`firefox`],features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!1},{name:`SignData`,types:[`text`,`binary`,`cell`]}]},{app_name:`tonhub`,name:`Tonhub`,image:`https://tonhub.com/tonconnect_logo.png`,about_url:`https://tonhub.com`,universal_url:`https://tonhub.com/ton-connect`,bridge:[{type:`js`,key:`tonhub`},{type:`sse`,url:`https://connect.tonhubapi.com/tonconnect`}],platforms:[`ios`,`android`],features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!0},{name:`SignData`,types:[`text`,`binary`,`cell`]}]},{app_name:`bitgetTonWallet`,name:`Bitget Wallet`,image:`https://raw.githubusercontent.com/bitgetwallet/download/refs/heads/main/logo/png/bitget_wallet_logo_288_mini.png`,about_url:`https://web3.bitget.com`,deepLink:`bitkeep://`,bridge:[{type:`js`,key:`bitgetTonWallet`},{type:`sse`,url:`https://ton-connect-bridge.bgwapi.io/bridge`}],platforms:[`ios`,`android`,`chrome`],universal_url:`https://bkcode.vip/ton-connect`,features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`okxMiniWallet`,name:`OKX Mini Wallet`,image:`https://static.okx.com/cdn/assets/imgs/2411/8BE1A4A434D8F58A.png`,about_url:`https://www.okx.com/web3`,universal_url:`https://t.me/OKX_WALLET_BOT?attach=wallet`,bridge:[{type:`sse`,url:`https://www.okx.com/tonbridge/discover/rpc/bridge`}],platforms:[`ios`,`android`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`binanceWeb3TonWallet`,name:`Binance Wallet`,image:`https://public.bnbstatic.com/static/binance-w3w/ton-provider/binancew3w.png`,about_url:`https://www.binance.com/en/web3wallet`,deepLink:`bnc://app.binance.com/cedefi/ton-connect`,bridge:[{type:`js`,key:`binancew3w`},{type:`sse`,url:`https://wallet.binance.com/tonbridge/bridge`}],platforms:[`ios`,`android`,`macos`,`windows`,`linux`],universal_url:`https://app.binance.com/cedefi/ton-connect`,features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`fintopio-tg`,name:`Fintopio`,image:`https://raw.githubusercontent.com/fintopio/ton-pub/refs/heads/main/logos/tonconnect-icon.png`,about_url:`https://fintopio.com`,universal_url:`https://t.me/fintopio?attach=wallet`,bridge:[{type:`sse`,url:`https://wallet-bridge.fintopio.com/bridge`}],platforms:[`ios`,`android`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`okxTonWallet`,name:`OKX Wallet`,image:`https://static.okx.com/cdn/assets/imgs/247/58E63FEA47A2B7D7.png`,about_url:`https://www.okx.com/web3`,universal_url:`https://www.okx.com/download?appendQuery=true&deeplink=okx://web3/wallet/tonconnect`,bridge:[{type:`js`,key:`okxTonWallet`},{type:`sse`,url:`https://www.okx.com/tonbridge/discover/rpc/bridge`}],platforms:[`chrome`,`safari`,`firefox`,`ios`,`android`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`hot`,name:`HOT`,image:`https://raw.githubusercontent.com/hot-dao/media/main/logo.png`,about_url:`https://hot-labs.org/`,universal_url:`https://t.me/herewalletbot?attach=wallet`,bridge:[{type:`sse`,url:`https://sse-bridge.hot-labs.org`},{type:`js`,key:`hotWallet`}],platforms:[`ios`,`android`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`bybitTonWallet`,name:`Bybit Wallet`,image:`https://raw.githubusercontent.com/bybit-web3/bybit-web3.github.io/main/docs/images/bybit-logo.png`,about_url:`https://www.bybit.com/web3`,universal_url:`https://app.bybit.com/ton-connect`,deepLink:`bybitapp://`,bridge:[{type:`js`,key:`bybitTonWallet`},{type:`sse`,url:`https://api-node.bybit.com/spot/api/web3/bridge/ton/bridge`}],platforms:[`ios`,`android`,`chrome`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`dewallet`,name:`DeWallet`,image:`https://raw.githubusercontent.com/delab-team/manifests-images/main/WalletAvatar.png`,about_url:`https://delabwallet.com`,universal_url:`https://t.me/dewallet?attach=wallet`,bridge:[{type:`sse`,url:`https://bridge.dewallet.pro/bridge`}],platforms:[`ios`,`android`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`safepalwallet`,name:`SafePal`,image:`https://s.pvcliping.com/web/public_image/SafePal_x288.png`,tondns:``,about_url:`https://www.safepal.com`,universal_url:`https://link.safepal.io/ton-connect`,deepLink:`safepal-tc://`,bridge:[{type:`sse`,url:`https://ton-bridge.safepal.com/tonbridge/v1/bridge`},{type:`js`,key:`safepalwallet`}],platforms:[`ios`,`android`,`chrome`,`firefox`],features:[{name:`SendTransaction`,maxMessages:1,extraCurrencySupported:!1}]},{app_name:`GateWallet`,name:`GateWallet`,image:`https://img.gatedataimg.com/prd-ordinal-imgs/036f07bb8730716e/gateio-0925.png`,about_url:`https://www.gate.io/`,bridge:[{type:`js`,key:`gatetonwallet`},{type:`sse`,url:`https://dapp.gateio.services/tonbridge_api/bridge/v1`}],platforms:[`ios`,`android`],universal_url:`https://gate.onelink.me/Hls0/web3?gate_web3_wallet_universal_type=ton_connect`,features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`openmask`,name:`OpenMask`,image:`https://raw.githubusercontent.com/OpenProduct/openmask-extension/main/public/openmask-logo-288.png`,about_url:`https://www.openmask.app/`,bridge:[{type:`js`,key:`openmask`}],platforms:[`chrome`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`BitgetWeb3`,name:`BitgetWeb3`,image:`https://img.bitgetimg.com/image/third/1731638059795.png`,about_url:`https://www.bitget.com`,universal_url:`https://t.me/BitgetOfficialBot?attach=wallet`,bridge:[{type:`sse`,url:`https://ton-connect-bridge.bgwapi.io/bridge`}],platforms:[`ios`,`android`,`windows`,`macos`,`linux`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`xtonwallet`,name:`XTONWallet`,image:`https://xtonwallet.com/assets/img/icon-256-back.png`,about_url:`https://xtonwallet.com`,bridge:[{type:`js`,key:`xtonwallet`}],platforms:[`chrome`,`firefox`],features:[{name:`SendTransaction`,maxMessages:1,extraCurrencySupported:!1}]},{app_name:`tonwallet`,name:`TON Wallet`,image:`https://wallet.ton.org/assets/ui/qr-logo.png`,about_url:`https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd`,bridge:[{type:`js`,key:`tonwallet`}],platforms:[`chrome`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`bitgetWalletLite`,name:`Bitget Wallet Lite`,image:`https://raw.githubusercontent.com/bitgetwallet/download/refs/heads/main/logo/png/bitget_wallet_lite_logo_288.png`,about_url:`https://web3.bitget.com`,universal_url:`https://t.me/BitgetWallet_TGBot?attach=wallet`,bridge:[{type:`sse`,url:`https://ton-connect-bridge.bgwapi.io/bridge`}],platforms:[`ios`,`android`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!1}]},{app_name:`tomoWallet`,name:`Tomo Wallet`,image:`https://pub.tomo.inc/logo.png`,about_url:`https://www.tomo.inc/`,universal_url:`https://t.me/tomowalletbot?attach=wallet`,bridge:[{type:`sse`,url:`https://go-bridge.tomo.inc/bridge`}],platforms:[`ios`,`android`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`miraiapp-tg`,name:`Mirai Mini App`,image:`https://cdn.mirailabs.co/miraihub/miraiapp-tg-icon-288.png`,about_url:`https://mirai.app`,universal_url:`https://t.me/MiraiAppBot?attach=wallet`,bridge:[{type:`sse`,url:`https://bridge.mirai.app`}],platforms:[`ios`,`android`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!1},{name:`SignData`,types:[`text`,`binary`,`cell`]}]},{app_name:`Architec.ton`,name:`Architec.ton`,image:`https://raw.githubusercontent.com/Architec-Ton/wallet-tma/refs/heads/dev/public/images/arcwallet_logo.png`,about_url:`https://architecton.tech`,universal_url:`https://t.me/architec_ton_bot?attach=wallet`,bridge:[{type:`sse`,url:`https://tc.architecton.su/bridge`}],platforms:[`ios`,`android`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!1}]},{app_name:`tokenpocket`,name:`TokenPocket`,image:`https://hk.tpstatic.net/logo/tokenpocket.png`,about_url:`https://www.tokenpocket.pro`,universal_url:`https://tp-lab.tptool.pro/ton-connect/`,bridge:[{type:`js`,key:`tokenpocket`},{type:`sse`,url:`https://ton-connect.mytokenpocket.vip/bridge`}],platforms:[`ios`,`android`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`uxuyWallet`,name:`UXUY Wallet`,image:`https://chain-cdn.uxuy.com/logo/square_288.png`,about_url:`https://docs.uxuy.com`,universal_url:`https://t.me/UXUYbot?attach=wallet`,bridge:[{type:`sse`,url:`https://bridge.uxuy.me/bridge`}],platforms:[`ios`,`android`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`tonkeeper-pro`,name:`Tonkeeper Pro`,image:`https://tonkeeper.com/assets/tonconnect-icon-pro.png`,tondns:`tonkeeper.ton`,about_url:`https://tonkeeper.com/pro`,universal_url:`https://app.tonkeeper.com/pro/ton-connect`,deepLink:`tonkeeper-pro-tc://`,bridge:[{type:`sse`,url:`https://bridge.tonapi.io/bridge`}],platforms:[`ios`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!0},{name:`SignData`,types:[`text`,`binary`,`cell`]}]},{app_name:`nicegramWallet`,name:`Nicegram Wallet`,image:`https://static.nicegram.app/icon.png`,about_url:`https://nicegram.app`,universal_url:`https://nicegram.app/tc`,deepLink:`nicegram-tc://`,bridge:[{type:`sse`,url:`https://tc.nicegram.app/bridge`},{type:`js`,key:`nicegramWallet`}],platforms:[`ios`,`android`],features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!1}]},{app_name:`echoooTonWallet`,name:`EchoooWallet`,image:`https://cdn.echooo.xyz/front-end/source/images/logo/echooo-ton.png`,about_url:`https://www.echooo.xyz`,universal_url:`https://www.echooo.xyz/ton-connect`,deepLink:`echooo://`,bridge:[{type:`js`,key:`echoooTonWallet`},{type:`sse`,url:`https://ton-connect-bridge.echooo.link/bridge`}],platforms:[`ios`,`android`],features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!1}]},{app_name:`blitzwallet`,name:`BLITZ wallet`,image:`https://blitzwallet.cfd/wallet/public/logo.png`,about_url:`https://blitzwallet.cfd`,universal_url:`https://t.me/blitz_wallet_bot?attach=wallet`,bridge:[{type:`sse`,url:`https://blitzwallet.cfd/bridge/`}],platforms:[`ios`,`android`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]},{app_name:`koloWeb3Wallet`,name:`Kolo`,image:`https://raw.githubusercontent.com/onidev1/tc-assets/refs/heads/main/kolo_logo_288.png`,about_url:`https://kolo.xyz`,universal_url:`https://t.me/kolo?attach=wallet`,bridge:[{type:`sse`,url:`https://web3-bridge.kolo.in/bridge`}],platforms:[`ios`,`android`,`macos`,`windows`,`linux`],features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!1}]},{app_name:`imToken`,name:`imToken`,image:`https://aws-v2-cdn.token.im/orbit/token-v2/icons/logo-ton-connect.png`,about_url:`https://token.im`,universal_url:`https://connect.token.im/link/ton-connect`,deepLink:`imtokenv2://link/ton-connect`,bridge:[{type:`sse`,url:`https://connect.token.im/tonbridge`},{type:`js`,key:`imToken`}],platforms:[`ios`,`android`],features:[{name:`SendTransaction`,maxMessages:255,extraCurrencySupported:!1}]},{app_name:`cactuslink`,name:`Cactus Link`,image:`https://downloads.mycactus.com/288_cactus_link.png`,about_url:`https://www.mycactus.com/defi-connector`,bridge:[{type:`js`,key:`cactuslink_ton`}],platforms:[`chrome`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1},{name:`SignData`,types:[`text`,`binary`]}]},{app_name:`onekey`,name:`OneKey`,image:`https://uni.onekey-asset.com/static/logo/onekey-x288.png`,about_url:`https://onekey.so`,bridge:[{type:`js`,key:`onekeyTonWallet`}],platforms:[`chrome`],features:[{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}]}],br=!1;function xr(){return br}var Sr=class{constructor(e){this.walletsListDTOCache=null,this.walletsListDTOCacheCreationTimestamp=null,this.walletsListSource=xr()?`https://raw.githubusercontent.com/ton-connect/wallets-list-staging/refs/heads/main/wallets-v2.json`:e?.walletsListSource??`https://config.ton.org/wallets-v2.json`,this.cacheTTLMs=e?.cacheTTLMs,this.onDownloadDurationMeasured=e?.onDownloadDurationMeasured}getWallets(){return w(this,void 0,void 0,function*(){let[e,t]=yield Promise.all([this.fetchWalletsListDTO(),this.getCurrentlyInjectedWallets()]);return this.mergeWalletsLists(this.walletConfigDTOListToWalletConfigList(e),t)})}getEmbeddedWallet(){return w(this,void 0,void 0,function*(){let e=(yield this.getWallets()).filter(He);return e.length===1?e[0]:null})}fetchWalletsListDTO(){return w(this,void 0,void 0,function*(){return this.cacheTTLMs&&this.walletsListDTOCacheCreationTimestamp&&Date.now()>this.walletsListDTOCacheCreationTimestamp+this.cacheTTLMs&&(this.walletsListDTOCache=null),this.walletsListDTOCache||(this.walletsListDTOCache=this.fetchWalletsListFromSource(),this.walletsListDTOCache.then(()=>{this.walletsListDTOCacheCreationTimestamp=Date.now()}).catch(()=>{this.walletsListDTOCache=null,this.walletsListDTOCacheCreationTimestamp=null})),this.walletsListDTOCache})}getRemoteWallet(e){return w(this,void 0,void 0,function*(){let t=(yield this.getWallets()).find(t=>t.appName===e);if(!t)throw new T(`Wallet info not found for appName: "${e}"`);if(!We(t))throw new T(`Wallet "${e}" is not remote`);return t})}fetchWalletsListFromSource(){return w(this,void 0,void 0,function*(){var e,t;let n=[],r=performance.now();try{if(n=yield(yield fetch(this.walletsListSource)).json(),!Array.isArray(n))throw new wt(`Wrong wallets list format, wallets list must be an array.`);let t=n.filter(e=>!this.isCorrectWalletConfigDTO(e));t.length&&(`${t.map(e=>e?.name||`unknown`).join(`, `)}`,n=n.filter(e=>this.isCorrectWalletConfigDTO(e)));let i=performance.now(),a=Math.round(i-r);(e=this.onDownloadDurationMeasured)==null||e.call(this,a)}catch{n=yr,(t=this.onDownloadDurationMeasured)==null||t.call(this,void 0)}return n})}getCurrentlyInjectedWallets(){if(!xr())return[];try{return hr.getCurrentlyInjectedWallets()}catch{return[]}}walletConfigDTOListToWalletConfigList(e){return e.map(e=>{let t={name:e.name,appName:e.app_name,imageUrl:e.image,aboutUrl:e.about_url,tondns:e.tondns,platforms:e.platforms,features:e.features,ui:e.ui&&typeof e.ui==`object`?{isButtonTransparent:e.ui.isButtonTransparent===!0}:void 0};return e.bridge.forEach(n=>{if(n.type===`sse`&&(t.bridgeUrl=n.url,t.universalLink=e.universal_url,t.deepLink=e.deepLink),n.type===`js`){let e=n.key;t.jsBridgeKey=e,t.injected=hr.isWalletInjected(e),t.embedded=hr.isInsideWalletBrowser(e)}}),t})}mergeWalletsLists(e,t){return[...new Set(e.concat(t).map(e=>e.name)).values()].map(n=>{let r=e.find(e=>e.name===n),i=t.find(e=>e.name===n);return Object.assign(Object.assign({},r&&Object.assign({},r)),i&&Object.assign({},i))})}isCorrectWalletConfigDTO(e){if(!e||typeof e!=`object`)return!1;let t=`name`in e,n=`app_name`in e,r=`image`in e,i=`about_url`in e,a=`platforms`in e;if(!t||!r||!i||!a||!n||!e.platforms||!Array.isArray(e.platforms)||!e.platforms.length||!(`bridge`in e)||!Array.isArray(e.bridge)||!e.bridge.length)return!1;let o=e.bridge;if(o.some(e=>!e||typeof e!=`object`||!(`type`in e)))return!1;let s=o.find(e=>e.type===`sse`);if(s&&(!(typeof s==`object`&&`url`in s)||!s.url||!e.universal_url))return!1;let c=o.find(e=>e.type===`js`);return!(c&&(typeof c!=`object`||!(`key`in c)||!c.key))}};function Cr(e,t){let n=e.includes(`SendTransaction`),r=Dr(e,`SendTransaction`),i={minMessages:t.requiredMessagesNumber,extraCurrencyRequired:t.requireExtraCurrencies,itemTypes:t.requiredItemTypes};if(!n&&!r)throw new Pe(`Wallet doesn't support SendTransaction feature.`,{cause:{requiredFeature:{featureName:`SendTransaction`,value:i}}});if(t.requireExtraCurrencies&&(!r||!r.extraCurrencySupported))throw new Pe(`Wallet is not able to handle such SendTransaction request. Extra currencies support is required.`,{cause:{requiredFeature:{featureName:`SendTransaction`,value:i}}});if(t.requiredItemTypes?.length){if(!r?.itemTypes)throw new Pe(`Wallet doesn't support structured items in SendTransaction.`,{cause:{requiredFeature:{featureName:`SendTransaction`,value:i}}});let e=t.requiredItemTypes.filter(e=>!r.itemTypes.includes(e));if(e.length)throw new Pe(`Wallet doesn't support item types: ${e.join(`, `)} in SendTransaction.`,{cause:{requiredFeature:{featureName:`SendTransaction`,value:i}}})}if(r&&r.maxMessages!==void 0){if(r.maxMessages<t.requiredMessagesNumber)throw new Pe(`Wallet is not able to handle such SendTransaction request. Max support messages number is ${r.maxMessages}, but ${t.requiredMessagesNumber} is required.`,{cause:{requiredFeature:{featureName:`SendTransaction`,value:i}}});return}}function wr(e,t){let n=e.find(e=>e&&typeof e==`object`&&e.name===`SignData`);if(!n)throw new Pe(`Wallet doesn't support SignData feature.`,{cause:{requiredFeature:{featureName:`SignData`,value:{types:t.requiredTypes}}}});let r=t.requiredTypes.filter(e=>!n.types.includes(e));if(r.length)throw new Pe(`Wallet doesn't support required SignData types: ${r.join(`, `)}.`,{cause:{requiredFeature:{featureName:`SignData`,value:{types:r}}}})}function Tr(e,t){let n=Dr(e,`SignMessage`),r={minMessages:t.requiredMessagesNumber,extraCurrencyRequired:t.requireExtraCurrencies,itemTypes:t.requiredItemTypes};if(!n)throw new Pe(`Wallet doesn't support SignMessage feature.`,{cause:{requiredFeature:{featureName:`SignMessage`,value:r}}});if(t.requireExtraCurrencies&&!n.extraCurrencySupported)throw new Pe(`Wallet is not able to handle such SignMessage request. Extra currencies support is required.`,{cause:{requiredFeature:{featureName:`SignMessage`,value:r}}});if(t.requiredItemTypes?.length){if(!n.itemTypes)throw new Pe(`Wallet doesn't support structured items in SignMessage.`,{cause:{requiredFeature:{featureName:`SignMessage`,value:r}}});let e=t.requiredItemTypes.filter(e=>!n.itemTypes.includes(e));if(e.length)throw new Pe(`Wallet doesn't support item types: ${e.join(`, `)} in SignMessage.`,{cause:{requiredFeature:{featureName:`SignMessage`,value:r}}})}if(n.maxMessages!==void 0){if(n.maxMessages<t.requiredMessagesNumber)throw new Pe(`Wallet is not able to handle such SignMessage request. Max support messages number is ${n.maxMessages}, but ${t.requiredMessagesNumber} is required.`,{cause:{requiredFeature:{featureName:`SignMessage`,value:r}}});return}}function Er(e,t){if(typeof t!=`object`)return!0;let{sendTransaction:n,signData:r,signMessage:i,embeddedRequest:a}=t;if(n){let t=Dr(e,`SendTransaction`);if(!t||!Or(t,n))return!1}if(r){let t=Dr(e,`SignData`);if(!t||!Ar(t,r))return!1}if(i){let t=Dr(e,`SignMessage`);if(!t||!kr(t,i))return!1}return!(a&&!Dr(e,`EmbeddedRequest`))}function Dr(e,t){return e.find(e=>e&&typeof e==`object`&&e.name===t)}function Or(e,t){let n=t.minMessages===void 0||t.minMessages<=e.maxMessages,r=!t.extraCurrencyRequired||e.extraCurrencySupported,i=!t.itemTypes?.length||e.itemTypes&&t.itemTypes.every(t=>e.itemTypes.includes(t));return!!(n&&r&&i)}function kr(e,t){let n=t.minMessages===void 0||t.minMessages<=e.maxMessages,r=!t.extraCurrencyRequired||e.extraCurrencySupported,i=!t.itemTypes?.length||e.itemTypes&&t.itemTypes.every(t=>e.itemTypes.includes(t));return!!(n&&r&&i)}function Ar(e,t){return t.types.every(t=>e.types.includes(t))}function jr(){return{type:`request-version`}}function Mr(e){return{type:`response-version`,version:e}}function Nr(e){return{ton_connect_sdk_lib:e.ton_connect_sdk_lib,ton_connect_ui_lib:e.ton_connect_ui_lib}}function Pr(e,t,n){let r=t?.connectItems?.tonProof&&`proof`in t.connectItems.tonProof?`ton_proof`:`ton_addr`;return{wallet_address:t?.account?.address??null,wallet_state_init:t?.account.walletStateInit??null,wallet_type:t?.device.appName??null,wallet_version:t?.device.appVersion??null,auth_type:r,custom_data:Object.assign({client_id:n?.clientId??null,wallet_id:n?.walletId??null,chain_id:t?.account?.chain??null,provider:t?.provider??null},Nr(e))}}function Fr(e,t){return{type:`connection-started`,custom_data:Nr(e),trace_id:t??null}}function Ir(e,t,n){return{type:`connection-initiated`,connection_source_kind:t.kind,bridge_key:t.jsBridgeKey,bridge_url:t.bridgeUrl,custom_data:Nr(e),trace_id:n??null}}function Lr(e,t,n){return{type:`connection-link-generated`,connection_source_kind:t.kind,bridge_key:t.jsBridgeKey,bridge_url:t.bridgeUrl,custom_data:Nr(e),trace_id:n??null}}function Rr(e,t,n,r,i){return Object.assign({type:`connection-completed`,is_success:!0,is_restore:!!i,trace_id:r??null},Pr(e,t,n))}function zr(e,t,n,r,i){return{type:`connection-error`,is_success:!1,error_message:t,error_code:n??null,trace_id:i??null,custom_data:Object.assign({client_id:r?.clientId??null,wallet_id:r?.walletId??null},Nr(e))}}function Br(e,t){return{type:`connection-restoring-started`,custom_data:Nr(e),trace_id:t??null}}function Vr(e,t,n,r){return Object.assign({type:`connection-restoring-completed`,is_success:!0,trace_id:r??null},Pr(e,t,n))}function Hr(e,t,n){return{type:`connection-restoring-error`,is_success:!1,error_message:t,trace_id:n??null,custom_data:Nr(e)}}function Ur(e,t){return{valid_until:String(t.validUntil)??null,from:t.from??e?.account?.address??null,messages:Ke(t)?t.messages.map(e=>({address:e.address??null,amount:e.amount??null})):[]}}function Wr(e,t){return{valid_until:String(t.validUntil)??null,from:t.from??e?.account?.address??null,messages:Ke(t)?t.messages.map(e=>({address:e.address??null,amount:e.amount??null,payload:e.payload??null,state_init:e.stateInit??null})):[]}}function Gr(e,t,n,r,i){return Object.assign(Object.assign({type:`transaction-sent-for-signature`,trace_id:i??null},Pr(e,t,r)),Ur(t,n))}function Kr(e,t,n,r,i,a){return Object.assign(Object.assign({type:`transaction-signed`,is_success:!0,signed_transaction:r.boc,trace_id:a??null},Pr(e,t,i)),Ur(t,n))}function qr(e,t,n,r,i,a,o){return Object.assign(Object.assign({type:`transaction-signing-failed`,is_success:!1,error_message:r,error_code:i??null,trace_id:o??null},Pr(e,t,a)),Wr(t,n))}function Jr(e,t,n,r,i){return Object.assign({type:`sign-data-request-initiated`,data:n,trace_id:i??null},Pr(e,t,r))}function Yr(e,t,n,r,i,a){return Object.assign({type:`sign-data-request-completed`,is_success:!0,data:n,signed_data:r,trace_id:a??null},Pr(e,t,i))}function Xr(e,t,n,r,i,a,o){return Object.assign({type:`sign-data-request-failed`,is_success:!1,data:n,error_message:r,error_code:i??null,trace_id:o??null},Pr(e,t,a))}function Zr(e,t,n,r,i){return Object.assign({type:`disconnection`,scope:n,trace_id:i??null},Pr(e,t,r))}function Qr(e,t,n,r){return{type:`wallet-modal-opened`,visible_wallets:t,client_id:n??null,custom_data:e,trace_id:r??null}}function $r(e,t,n,r,i,a,o,s){let c=a;return!c&&i&&(c=yt(i)?`tg_link`:`external_link`),{type:`selected-wallet`,wallets_menu:r,visible_wallets:t,client_id:o??null,custom_data:e,trace_id:s??null,wallet_redirect_method:c,wallet_redirect_link:i||void 0,wallet_type:n?.appName??null}}function ei(e,t,n,r,i){return{type:`wallet-preselected`,wallet_app_name:t,surface:n,selection_source:r,custom_data:Nr(e),trace_id:i}}function ti(e,t,n,r,i,a){return{type:`wallet-selected`,wallet_app_name:t,surface:n,selection_source:r,connection_mode:a,custom_data:Nr(e),trace_id:i}}var ni=class{get version(){return Nr({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}constructor(e){this.eventPrefix=`ton-connect-`,this.tonConnectUiVersion=null,this.eventDispatcher=e?.eventDispatcher,this.tonConnectSdkVersion=e.tonConnectSdkVersion,this.init().catch()}init(){return w(this,void 0,void 0,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectUiVersion=yield this.requestTonConnectUiVersion()}catch{}})}setRequestVersionHandler(){return w(this,void 0,void 0,function*(){yield this.eventDispatcher.addEventListener(`ton-connect-request-version`,()=>w(this,void 0,void 0,function*(){yield this.eventDispatcher.dispatchEvent(`ton-connect-response-version`,Mr(this.tonConnectSdkVersion))}))})}requestTonConnectUiVersion(){return w(this,void 0,void 0,function*(){return new Promise((e,t)=>w(this,void 0,void 0,function*(){try{yield this.eventDispatcher.addEventListener(`ton-connect-ui-response-version`,t=>{e(t.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent(`ton-connect-ui-request-version`,jr())}catch(e){t(e)}}))})}dispatchUserActionEvent(e){try{this.eventDispatcher.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch{}}trackConnectionStarted(...e){try{let t=Fr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionInitiated(...e){try{let t=Ir(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionLinkGenerated(...e){try{let t=Lr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionCompleted(...e){try{let t=Rr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionError(...e){try{let t=zr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionRestoringStarted(...e){try{let t=Br(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionRestoringCompleted(...e){try{let t=Vr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionRestoringError(...e){try{let t=Hr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackDisconnection(...e){try{let t=Zr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackTransactionSentForSignature(...e){try{let t=Gr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackTransactionSigned(...e){try{let t=Kr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackTransactionSigningFailed(...e){try{let t=qr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackDataSentForSignature(...e){try{let t=Jr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackDataSigned(...e){try{let t=Yr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackDataSigningFailed(...e){try{let t=Xr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}},ri=`5.0.0`;function ii(e){switch(e.type){case`ton`:{let{extraCurrency:t}=e,n=Ee(e,[`extraCurrency`]);return Object.assign(Object.assign({},n),{payload:Yt(e.payload),stateInit:Yt(e.stateInit),extra_currency:t})}case`jetton`:return Object.assign(Object.assign({},e),{customPayload:Yt(e.customPayload),forwardPayload:Yt(e.forwardPayload)});case`nft`:return Object.assign(Object.assign({},e),{customPayload:Yt(e.customPayload),forwardPayload:Yt(e.forwardPayload)})}}function ai(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function oi(){let e={};try{let t=performance.getEntriesByType(`navigation`);if(t.length>0){let n=t[0];n.responseStart&&n.requestStart&&(e.conn_ttfb=Math.round(n.responseStart-n.requestStart))}}catch{}return e}function si(){let e={};try{let t=navigator,n=t.connection||t.mozConnection||t.webkitConnection;n&&(n.rtt!==void 0&&(e.conn_rtt=n.rtt),n.effectiveType?e.conn_network_type=n.effectiveType:n.type&&(e.conn_network_type=n.type))}catch{}return e}var ci=class e{constructor(e={}){var t;this.events=[],this.timeoutId=null,this.isProcessing=!1,this.backoff=1,this.shouldSend=!0,this.batchTimeoutMs=e.batchTimeoutMs??2e3,this.currentBatchTimeoutMs=this.batchTimeoutMs,this.maxBatchSize=e.maxBatchSize??100,this.analyticsUrl=e.analyticsUrl??`https://analytics.ton.org/events`,this.mode=e.mode??`telemetry`,this.baseEvent=Object.assign({subsystem:`dapp-sdk`,version:ri,client_environment:((t=e.environment)?.getClientEnvironment)?.call(t)},oi()),this.addWindowFocusAndBlurSubscriptions()}scoped(e){return new Proxy(this,{get(t,n){let r=n.toString();if(r.startsWith(`emit`)){let n=ai(r.replace(`emit`,``));return function(r){let i=Object.fromEntries(Object.entries(e??{}).map(([e,t])=>[e,typeof t==`function`?t():t]));return t.emit(Object.assign(Object.assign({event_name:n},i),r))}}return t[n]}})}emit(e){if(this.mode===`off`)return;let t=e.trace_id??E(),n=si(),r=Object.assign(Object.assign(Object.assign(Object.assign({},this.baseEvent),n),e),{event_id:E(),client_timestamp:Math.floor(Date.now()/1e3),trace_id:t}),i=this.mode===`telemetry`?this.filterFullModeFields(r):r;if(this.events.push(i),this.events.length>=this.maxBatchSize){this.flush();return}this.startTimeout()}startTimeout(){this.timeoutId||this.isProcessing||(this.timeoutId=setTimeout(()=>{this.flush()},this.currentBatchTimeoutMs))}flush(){return w(this,void 0,void 0,function*(){if(this.isProcessing||this.events.length===0||!this.shouldSend)return;this.clearTimeout(),this.isProcessing=!0;let e=this.extractEventsToSend();try{yield this.processEventsBatch(e)}catch{this.restoreEvents(e)}finally{this.isProcessing=!1,this.scheduleNextFlushIfNeeded()}})}clearTimeout(){this.timeoutId&&=(clearTimeout(this.timeoutId),null)}extractEventsToSend(){let e=this.events.slice(0,this.maxBatchSize);return this.events=this.events.slice(this.maxBatchSize),e}processEventsBatch(e){return w(this,void 0,void 0,function*(){e.length;try{let t=yield this.sendEvents(e);this.handleResponse(t)}catch(e){this.handleUnknownError(e)}})}handleResponse(e){let{status:t,statusText:n}=e;this.isTooManyRequests(t)?this.handleTooManyRequests(t,n):this.isClientError(t)?this.handleClientError(t,n):this.isServerError(t)&&this.handleUnknownError({status:t,statusText:n})}restoreEvents(e){this.events.unshift(...e)}scheduleNextFlushIfNeeded(){this.events.length>0&&this.startTimeout()}sendEvents(e){return w(this,void 0,void 0,function*(){return yield fetch(this.analyticsUrl,{method:`POST`,headers:{"Content-Type":`application/json`,"X-Client-Timestamp":Math.floor(Date.now()/1e3).toString()},body:JSON.stringify(e)})})}isClientError(t){return t>=e.HTTP_STATUS.CLIENT_ERROR_START&&t<e.HTTP_STATUS.SERVER_ERROR_START}isServerError(t){return t>=e.HTTP_STATUS.SERVER_ERROR_START}isTooManyRequests(t){return t===e.HTTP_STATUS.TOO_MANY_REQUESTS}handleClientError(e,t){new T(`Analytics API error: ${e} ${t}`)}handleUnknownError(t){if(this.backoff<e.MAX_BACKOFF_ATTEMPTS)throw this.backoff++,this.currentBatchTimeoutMs*=e.BACKOFF_MULTIPLIER,new T(`Unknown analytics API error: ${t}`);this.currentBatchTimeoutMs=this.batchTimeoutMs,this.backoff=1}handleTooManyRequests(e,t){throw new T(`Analytics API error: ${e} ${t}`)}addWindowFocusAndBlurSubscriptions(){let e=pn();if(e)try{e.addEventListener(`visibilitychange`,()=>{e.hidden?(this.clearTimeout(),this.shouldSend=!1):(this.shouldSend=!0,this.scheduleNextFlushIfNeeded())})}catch{}}getMode(){return this.mode}getPendingEventsCount(){return this.events.length}filterFullModeFields(t){let n=Object.assign({},t);for(let t of e.FULL_MODE_FIELDS)delete n[t];let r=`event_name`in t?String(t.event_name):``;return!(`error_code`in t||`error_message`in t||r.includes(`error`)||r===`connection-error`||r===`transaction-signing-failed`||r===`sign-data-request-failed`)&&`wallet_address`in n&&delete n.wallet_address,n}setWalletListDownloadDuration(e){this.baseEvent=Object.assign(Object.assign({},this.baseEvent),{wallet_list_download_duration:e})}};ci.HTTP_STATUS={TOO_MANY_REQUESTS:429,CLIENT_ERROR_START:400,SERVER_ERROR_START:500},ci.MAX_BACKOFF_ATTEMPTS=5,ci.BACKOFF_MULTIPLIER=2,ci.FULL_MODE_FIELDS=[`user_id`,`tg_id`,`locale`,`tma_is_premium`];var li=class{constructor(){this.window=fn()}dispatchEvent(e,t){return w(this,void 0,void 0,function*(){var n;let r=new CustomEvent(e,{detail:t});(n=this.window)==null||n.dispatchEvent(r)})}addEventListener(e,t,n){return w(this,void 0,void 0,function*(){var r;return(r=this.window)==null||r.addEventListener(e,t,n),()=>this.window?.removeEventListener(e,t)})}};function ui(e){return{"@tonconnect/sdk":e.ton_connect_sdk_lib||``,"@tonconnect/ui":e.ton_connect_ui_lib||``}}function di(e){return{versions:ui(e.custom_data),network_id:e.custom_data.chain_id??``,client_id:e.custom_data.client_id??``,wallet_id:e.custom_data.wallet_id??``,wallet_address:e.wallet_address??``,wallet_app_name:e.wallet_type??``,wallet_app_version:e.wallet_version??``,wallet_state_init:e.wallet_state_init??``,trace_id:e.trace_id??void 0}}function fi(e,t){e.addEventListener(`ton-connect-ui-wallet-modal-opened`,e=>{let{detail:n}=e;t.emitConnectionStarted({client_id:n.client_id||``,versions:ui(n.custom_data),main_screen:n.visible_wallets,trace_id:n.trace_id??void 0})}),e.addEventListener(`ton-connect-ui-selected-wallet`,e=>{let{detail:n}=e;t.emitConnectionSelectedWallet({client_id:n.client_id||``,versions:ui(n.custom_data),main_screen:n.visible_wallets,wallets_menu:n.wallets_menu,trace_id:n.trace_id??void 0,wallet_app_name:n.wallet_type??``,wallet_redirect_method:n.wallet_redirect_method,wallet_redirect_link:n.wallet_redirect_link})}),e.addEventListener(`ton-connect-ui-wallet-preselected`,e=>{let{detail:n}=e;t.emitWalletPreselected({versions:ui(n.custom_data),wallet_app_name:n.wallet_app_name,surface:n.surface,selection_source:n.selection_source,trace_id:n.trace_id})}),e.addEventListener(`ton-connect-ui-wallet-selected`,e=>{let{detail:n}=e;t.emitWalletSelected({versions:ui(n.custom_data),wallet_app_name:n.wallet_app_name,surface:n.surface,selection_source:n.selection_source,connection_mode:n.connection_mode,trace_id:n.trace_id})});let n=e=>{let{detail:n}=e;t.emitConnectionInitiated({versions:ui(n.custom_data),connection_source_kind:n.connection_source_kind,bridge_key:n.bridge_key,bridge_url:n.bridge_url,trace_id:n.trace_id??void 0})};e.addEventListener(`ton-connect-connection-initiated`,n),e.addEventListener(`ton-connect-ui-connection-initiated`,n),e.addEventListener(`ton-connect-connection-link-generated`,e=>{let{detail:n}=e;t.emitConnectionLinkGenerated({versions:ui(n.custom_data),connection_source_kind:n.connection_source_kind,bridge_key:n.bridge_key,bridge_url:n.bridge_url,trace_id:n.trace_id??void 0})}),e.addEventListener(`ton-connect-connection-completed`,e=>{let{detail:n}=e;t.emitConnectionCompleted(Object.assign(Object.assign({},di(n)),{is_restore:n.is_restore}))}),e.addEventListener(`ton-connect-connection-error`,e=>{let{detail:n}=e;t.emitConnectionError({client_id:n.custom_data.client_id||``,wallet_id:n.custom_data.wallet_id||``,error_code:n.error_code??0,error_message:n.error_message,trace_id:n.trace_id??void 0})}),e.addEventListener(`ton-connect-disconnection`,e=>{let{detail:n}=e;t.emitDisconnection(di(n))}),e.addEventListener(`ton-connect-transaction-sent-for-signature`,e=>{let{detail:n}=e;t.emitTransactionSent(di(n))}),e.addEventListener(`ton-connect-transaction-signed`,e=>{let{detail:n}=e;t.emitTransactionSigned(Object.assign(Object.assign({},di(n)),{signed_boc:e.detail.signed_transaction}))}),e.addEventListener(`ton-connect-transaction-signing-failed`,e=>{let{detail:n}=e;t.emitTransactionSigningFailed(Object.assign(Object.assign({},di(n)),{valid_until:Number(n.valid_until),messages:n.messages.map(e=>({address:e.address??``,amount:e.amount??``,payload:e.payload??``,state_init:e.state_init??``})),error_message:n.error_message,error_code:n.error_code??0}))}),e.addEventListener(`ton-connect-sign-data-request-initiated`,e=>{let{detail:n}=e;t?.emitSignDataRequestInitiated(di(n))}),e.addEventListener(`ton-connect-sign-data-request-completed`,e=>{let{detail:n}=e;t?.emitSignDataRequestCompleted(di(n))}),e.addEventListener(`ton-connect-sign-data-request-failed`,e=>{let{detail:n}=e,r=``,i;n.data.type===`text`&&(r=n.data.text),n.data.type===`cell`&&(r=n.data.cell,i=n.data.schema),n.data.type===`binary`&&(r=n.data.bytes),t?.emitSignDataRequestFailed(Object.assign(Object.assign({},di(n)),{sign_data_type:n.data.type,sign_data_value:r,sign_data_schema:i,error_code:n.error_code??0,error_message:n.error_message}))})}var pi=`ton-connect-session_storage_launchParams`;function mi(e){try{return e=e.replace(/\+/g,`%20`),decodeURIComponent(e)}catch{return e}}function hi(e){let t={};if(!e.length)return t;let n=e.split(`&`);for(let e of n){let n=e.split(`=`),r=mi(n[0]);t[r]=n[1]==null?null:mi(n[1])}return t}function gi(e){e=e.replace(/^#/,``);let t={};if(!e.length)return t;if(e.indexOf(`=`)<0&&e.indexOf(`?`)<0)return t._path=mi(e),t;let n=e.indexOf(`?`);n>=0&&(t._path=mi(e.substring(0,n)),e=e.substring(n+1));for(let[n,r]of Object.entries(hi(e)))r!=null&&(t[n]=r);return t}function _i(e){var t;try{return JSON.parse(((t=fn()?.sessionStorage)?.getItem)?.call(t,e))}catch{}return null}function vi(e,t){for(let[n,r]of Object.entries(t))r!=null&&e[n]===void 0&&(e[n]=r)}function yi(){var e;let t;try{t=((e=fn()?.sessionStorage)?.getItem)?.call(e,`tapps/launchParams`)}catch{}if(!t)return{};try{let e=JSON.parse(t);if(typeof e!=`string`)return{};t=e}catch{}return hi(t)}function bi(){try{return gi((fn()?.location?.hash)?.toString()??``)}catch{return{}}}function xi(){var e;let t=bi();vi(t,yi()),vi(t,_i(`__telegram__initParams`)??{}),vi(t,_i(pi)??{});try{Object.keys(t).length>0&&((e=fn()?.sessionStorage)==null||e.setItem(pi,JSON.stringify(t)))}catch{}return t}function Si(e){try{let t=e.tgWebAppData;if(!t)return;let n=hi(t).user;if(!n)return;let r=JSON.parse(n);return typeof r.id==`number`?{id:r.id,isPremium:r.is_premium===!0}:void 0}catch{return}}var Ci;function wi(){if(Ci)return Ci;let e=xi(),t=fn(),n=`unknown`;e.tgWebAppPlatform&&(n=e.tgWebAppPlatform),n===`unknown`&&(n=t?.Telegram?.WebApp?.platform??`unknown`);let r=`6.0`;return e.tgWebAppVersion&&(r=e.tgWebAppVersion),Ci={platform:n,webAppVersion:r,telegramUser:Si(e)},Ci}function Ti(){return wi().platform}function Ei(...e){return e.includes(wi().platform)}function Di(){return wi().platform!==`unknown`||!!fn()?.TelegramWebviewProxy}function Oi(){return(Di()||!!fn()?.TelegramWebview)&&wi().platform===`unknown`}function ki(){return wi().webAppVersion}function Ai(){return wi().telegramUser}var ji=class{getClientEnvironment(){return Di()?`miniapp`:`web`}getBrowser(){return``}getLocale(){return``}getPlatform(){return``}getTelegramUser(){return Ai()}},Mi={};function Ni(){return Mi.UniversalConnectorCls!==void 0&&Mi.walletConnectOptions!==void 0}function Pi(){if(Mi.UniversalConnectorCls===void 0)throw new T(`Wallet Connect is not initialized.`);return Mi.UniversalConnectorCls}function Fi(){if(Mi.walletConnectOptions===void 0)throw new T(`Wallet Connect is not initialized.`);return Mi.walletConnectOptions}var Ii=`0`,Li=0,Ri=class e{constructor(e){this.connectionStorage=e,this.type=`injected`,this.listeners=[],this.connector=void 0;let{projectId:t,metadata:n}=Fi();this.config={networks:[{namespace:`ton`,chains:[{id:-239,chainNamespace:`ton`,caipNetworkId:`ton:-239`,name:`TON`,nativeCurrency:{name:`TON`,symbol:`TON`,decimals:9},rpcUrls:{default:{http:[]}}},{id:-3,chainNamespace:`ton`,caipNetworkId:`ton:-3`,name:`TON`,nativeCurrency:{name:`TON`,symbol:`TON`,decimals:9},rpcUrls:{default:{http:[]}}}],methods:[`ton_sendMessage`,`ton_signData`],events:[]}],projectId:t,metadata:n}}static fromStorage(t){return w(this,void 0,void 0,function*(){return new e(t)})}initialize(){return w(this,void 0,void 0,function*(){return this.connector||=yield Pi().init(this.config),this.connector})}connect(e,t){var n;let r=t?.traceId??E(),i=Ot(t?.signal);(n=this.abortController)==null||n.abort(),this.abortController=i,this._connect(e,{traceId:r,signal:i.signal,abortController:i}).catch(e=>void 0)}_connect(e,t){return w(this,void 0,void 0,function*(){let n=yield this.initialize();if(t.signal?.aborted){this.clearAbortController(t.abortController);return}let r=e.items.find(e=>e.name===`ton_proof`),i=r?[{domain:new URL(this.config.metadata.url).hostname,chains:[`ton:-239`],nonce:``,uri:`ton_proof`,ttl:0,statement:r.payload}]:void 0;try{yield n.connect({authentication:i})}catch{if(t.signal?.aborted){this.clearAbortController(t.abortController);return}let e={id:Li,event:`connect_error`,traceId:t.traceId,payload:{code:le.USER_REJECTS_ERROR,message:`User declined the connection`}};this.emit(e),this.clearAbortController(t.abortController);return}try{yield this.onConnect(n,Object.assign(Object.assign({},t),{includeTonProof:!0}))}catch{yield this.disconnect({traceId:t.traceId,signal:t.signal})}finally{this.clearAbortController(t.abortController)}})}restoreConnection(e){return w(this,void 0,void 0,function*(){var t;let n=e?.traceId??E(),r=Ot(e?.signal);if((t=this.abortController)==null||t.abort(),this.abortController=r,!r.signal.aborted)try{if(!(yield this.connectionStorage.getWalletConnectConnection())||r.signal.aborted)return;let e=yield this.initialize();if(r.signal.aborted)return;yield this.onConnect(e,{includeTonProof:!1,restored:!0,traceId:n,signal:r.signal})}catch{yield this.disconnect({traceId:n,signal:r.signal})}finally{this.clearAbortController(r)}})}closeConnection(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0,this.disconnect()}disconnect(e){return w(this,void 0,void 0,function*(){var t;let n=Ot(e?.signal);if((t=this.abortController)==null||t.abort(),this.abortController=n,!n.signal.aborted)try{if(yield this.connectionStorage.removeConnection(),n.signal.aborted)return;yield this.connector?.disconnect()}catch{}finally{this.clearAbortController(n)}})}sendRequest(e,t){return w(this,void 0,void 0,function*(){var n,r;if(!this.connector)throw new T(`Wallet Connect not initialized`);let i={};typeof t==`function`?i.onRequestSent=t:(i.onRequestSent=t?.onRequestSent,i.signal=t?.signal,i.attempts=t?.attempts,i.traceId=t?.traceId),i.traceId??=E();try{if(i.signal?.aborted)throw new T(`WalletConnect request aborted`);if(Object.assign(Object.assign({},e),{id:Ii}),e.method===`sendTransaction`){let t=JSON.parse(e.params[0]),{network:r}=t,a=Ee(t,[`network`]),o=this.connector.request({method:`ton_sendMessage`,params:a},`ton:${r}`);return(n=i?.onRequestSent)==null||n.call(i),{result:yield o,id:Ii,traceId:i.traceId}}if(e.method===`signData`){let t=JSON.parse(e.params[0]),{network:n}=t,a=Ee(t,[`network`]),o=this.connector.request({method:`ton_signData`,params:a},`ton:${n}`);return(r=i?.onRequestSent)==null||r.call(i),{result:yield o,traceId:i.traceId,id:Ii}}if(e.method===`disconnect`)return{id:Ii,traceId:i.traceId}}catch(e){return e.stack,yield this.handleWalletConnectError(e,{traceId:i.traceId})}return{id:Ii,error:{code:pe.UNKNOWN_ERROR,message:`Not implemented.`},traceId:i.traceId}})}handleWalletConnectError(e,t){return w(this,void 0,void 0,function*(){if(typeof e==`object`&&e){let n=String(`message`in e?e.message:`msg`in e?e.msg:e);return n.toLowerCase().includes(`reject`)?{id:Ii,traceId:t.traceId,error:{code:de.USER_REJECTS_ERROR,message:n}}:n.toLowerCase().includes(`tonvalidationerror`)?{id:Ii,traceId:t.traceId,error:{code:de.BAD_REQUEST_ERROR,message:n}}:{id:Ii,traceId:t.traceId,error:{code:de.UNKNOWN_ERROR,message:n}}}return{id:Ii,traceId:t.traceId,error:{code:de.UNKNOWN_ERROR,message:String(e)}}})}listen(e){return this.listeners.push(e),()=>this.listeners=this.listeners.filter(t=>t!==e)}buildTonProof(e){let t=e.provider.session.authentication?.[0],n=t?.p?.iat,r=t?.p?.statement;if(!n||!r)return;let i=t.p.domain;return{name:`ton_proof`,proof:{timestamp:Math.floor(new Date(n).getTime()/1e3),domain:{lengthBytes:i.length,value:i},payload:r,signature:t.s.s}}}onConnect(e,t){return w(this,void 0,void 0,function*(){if(t.signal?.aborted)return;let n=e.provider.session,r=n.namespaces.ton;if(!r?.accounts?.[0]){yield this.disconnectWithError({traceId:t.traceId,code:le.BAD_REQUEST_ERROR,message:`Connection error. No TON accounts connected.`});return}let[,i,a]=r.accounts[0].split(`:`,3),o=n.sessionProperties?.ton_getPublicKey;if(!o){yield this.disconnectWithError({traceId:t.traceId,code:le.BAD_REQUEST_ERROR,message:`Connection error. No sessionProperties.ton_getPublicKey provided.`});return}let s=n.sessionProperties?.ton_getStateInit;if(!s){yield this.disconnectWithError({traceId:t.traceId,code:le.BAD_REQUEST_ERROR,message:`Connection error. No sessionProperties.ton_getStateInit provided.`});return}e.provider.once(`session_delete`,()=>w(this,void 0,void 0,function*(){try{yield this.connectionStorage.removeConnection();let e={event:`disconnect`,traceId:E(),payload:{}};this.emit(e)}catch{}}));let c=t?.includeTonProof?this.buildTonProof(e):void 0,l=Tn(a)?Dn(On(a)):a,u=this.buildFeatureList(r.methods),d={items:[{name:`ton_addr`,address:l,network:i,publicKey:o,walletStateInit:s},...c?[c]:[]],device:{appName:`wallet_connect`,appVersion:``,maxProtocolVersion:2,features:u,platform:`browser`}};this.emit({event:`connect`,payload:d,traceId:t.traceId,restored:t.restored}),yield this.storeConnection()})}buildFeatureList(e){let t=[];return e.includes(`ton_sendMessage`)&&t.push(`SendTransaction`,{name:`SendTransaction`,maxMessages:4,extraCurrencySupported:!1}),e.includes(`ton_signData`)&&t.push({name:`SignData`,types:[`text`,`binary`,`cell`]}),t}disconnectWithError(e){return w(this,void 0,void 0,function*(){yield this.disconnect();let t={code:e.code,message:e.message};this.emit({event:`connect_error`,traceId:e.traceId,payload:t})})}clearAbortController(e){this.abortController===e&&(this.abortController=void 0)}emit(e,t){(t??this.listeners).forEach(t=>t(e))}storeConnection(){return this.connectionStorage.storeConnection({type:`wallet-connect`})}};function zi(e){switch(e.method){case`sendTransaction`:{let t=e.request;return Object.assign(Object.assign(Object.assign(Object.assign({m:`st`},t.from?{f:t.from}:{}),t.network?{n:t.network}:{}),{vu:t.validUntil}),Bi(t))}case`signMessage`:{let t=e.request;return Object.assign(Object.assign(Object.assign(Object.assign({m:`sm`},t.from?{f:t.from}:{}),t.network?{n:t.network}:{}),{vu:t.validUntil}),Bi(t))}case`signData`:{let t=e.request,n=Object.assign(Object.assign({m:`sd`},t.from?{f:t.from}:{}),t.network?{n:t.network}:{});switch(t.type){case`text`:return Object.assign(Object.assign({},n),{t:`text`,tx:t.text});case`binary`:return Object.assign(Object.assign({},n),{t:`binary`,b:t.bytes});case`cell`:return Object.assign(Object.assign({},n),{t:`cell`,s:t.schema,c:t.cell})}}}}function Bi(e){return Ge(e)?{i:e.items.map(e=>Vi(e))}:{ms:e.messages.map(e=>{let t={a:e.address,am:e.amount};return e.payload&&(t.p=Yt(e.payload)),e.stateInit&&(t.si=Yt(e.stateInit)),e.extraCurrency&&(t.ec=e.extraCurrency),t})}}function Vi(e){switch(e.type){case`ton`:return Object.assign(Object.assign(Object.assign({t:`ton`,a:e.address,am:e.amount},e.payload?{p:Yt(e.payload)}:{}),e.stateInit?{si:Yt(e.stateInit)}:{}),e.extraCurrency?{ec:e.extraCurrency}:{});case`jetton`:return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({t:`jetton`,ma:e.master,d:e.destination,am:e.amount},e.attachAmount?{aa:e.attachAmount}:{}),e.responseDestination?{rd:e.responseDestination}:{}),e.customPayload?{cp:Yt(e.customPayload)}:{}),e.forwardAmount?{fa:e.forwardAmount}:{}),e.forwardPayload?{fp:Yt(e.forwardPayload)}:{}),e.queryId?{qi:e.queryId}:{});case`nft`:return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({t:`nft`,na:e.nftAddress,no:e.newOwner},e.attachAmount?{aa:e.attachAmount}:{}),e.responseDestination?{rd:e.responseDestination}:{}),e.customPayload?{cp:Yt(e.customPayload)}:{}),e.forwardAmount?{fa:e.forwardAmount}:{}),e.forwardPayload?{fp:Yt(e.forwardPayload)}:{}),e.queryId?{qi:e.queryId}:{})}}var Hi=new class{constructor(){this.convertToWireEmbeddedRequest=zi}isError(e){return`error`in e}convertFromRpcResponse(e,t){if(this.isError(t))return{ok:!1,error:t.error};switch(e){case`sendTransaction`:return{ok:!0,result:{boc:t.result}};case`signMessage`:return{ok:!0,result:{internalBoc:t.result.internalBoc}};case`signData`:return{ok:!0,result:t.result};default:throw Error(`Unexpected embedded request method: ${e}`)}}},Ui=class{constructor(e){if(this.__isConsumable=!0,e&&typeof e==`object`&&e.__isConsumable)return e;this.value=e}peek(){return this.value}consume(){this.value;let e=this.value;return this.value=void 0,e}get consumed(){return this.value===void 0}},Wi=class{static getWallets(){return this.walletsList.getWallets()}get connected(){return this._wallet!==null}get account(){return this._wallet?.account||null}get wallet(){return this._wallet}set wallet(e){this._wallet=e,this.statusChangeSubscriptions.forEach(e=>e(this._wallet))}constructor(e){this._wallet=null,this.provider=null,this.statusChangeSubscriptions=[],this.statusChangeErrorSubscriptions=[];let t=e?.manifestUrl||mn();this.dappSettings={manifestUrl:t,storage:e?.storage||new vr},this.walletsRequiredFeatures=e?.walletsRequiredFeatures,this.environment=e?.environment??new ji,this.walletsList=new Sr({walletsListSource:e?.walletsListSource,cacheTTLMs:e?.walletsListCacheTTLMs,onDownloadDurationMeasured:e=>{var t;(t=this.analytics)==null||t.setWalletListDownloadDuration(e)}});let n=e?.eventDispatcher??new li;if(this.tracker=new ni({eventDispatcher:n,tonConnectSdkVersion:ri}),this.environment=e?.environment??new ji,this.initAnalytics(t,n,e),!this.dappSettings.manifestUrl)throw new Oe(`Dapp tonconnect-manifest.json must be specified if window.location.origin is undefined. See more https://github.com/ton-connect/docs/blob/main/requests-responses.md#app-manifest`);this.bridgeConnectionStorage=new _r(this.dappSettings.storage,this.walletsList),e?.disableAutoPauseConnection||this.addWindowFocusAndBlurSubscriptions()}getWallets(){return this.walletsList.getWallets()}onStatusChange(e,t){return this.statusChangeSubscriptions.push(e),t&&this.statusChangeErrorSubscriptions.push(t),()=>{this.statusChangeSubscriptions=this.statusChangeSubscriptions.filter(t=>t!==e),t&&(this.statusChangeErrorSubscriptions=this.statusChangeErrorSubscriptions.filter(e=>e!==t))}}connect(e,t,n){var r,i;let a=Object.assign({},n);typeof t==`object`&&t&&(`tonProof`in t?a.request=t:Object.assign(a,t));let o=new Ui(a.embeddedRequest);if(a.request){let e=nr(a.request);if(e&&!xr())throw new T(`ConnectAdditionalRequest validation failed: `+e)}if(o.peek()){let e=rr(o.peek());if(e&&!xr())throw new T(`EmbeddedRequest validation failed: `+e)}if(this.connected)throw new je;let s=Ot(a?.signal);if((r=this.abortController)==null||r.abort(),this.abortController=s,s.signal.aborted)throw new T(`Connection was aborted`);(i=this.provider)==null||i.closeConnection(),this.provider=this.createProvider(e),s.signal.addEventListener(`abort`,()=>{var e;(e=this.provider)==null||e.closeConnection(),this.provider=null});let c=a?.traceId??E();this.tracker.trackConnectionStarted(c);let l=Be(e,e=>hr.isInsideWalletBrowser(e));a?.linkDisplayOnly?this.tracker.trackConnectionLinkGenerated(l,c):this.tracker.trackConnectionInitiated(l,c);let u=o.peek(),d=u?new Ui(Hi.convertToWireEmbeddedRequest(u)):void 0,f=this.provider.connect(this.createConnectRequest(a?.request),{openingDeadlineMS:a?.openingDeadlineMS,signal:s.signal,traceId:c,embeddedRequest:d});return d?.consumed&&(this.pendingEmbeddedRequestMethod=o.consume()?.method),f}restoreConnection(e){return w(this,void 0,void 0,function*(){var t,n;let r=e?.traceId??E();this.tracker.trackConnectionRestoringStarted(r);let i=Ot(e?.signal);if((t=this.abortController)==null||t.abort(),this.abortController=i,i.signal.aborted){this.tracker.trackConnectionRestoringError(`Connection restoring was aborted`,r);return}let[a,o]=yield Promise.all([this.bridgeConnectionStorage.storedConnectionType(),this.walletsList.getEmbeddedWallet()]);if(i.signal.aborted){this.tracker.trackConnectionRestoringError(`Connection restoring was aborted`,r);return}let s=null;try{switch(a){case`http`:s=yield tn.fromStorage(this.bridgeConnectionStorage,this.analytics);break;case`injected`:s=yield hr.fromStorage(this.bridgeConnectionStorage,this.analytics);break;case`wallet-connect`:s=yield Ri.fromStorage(this.bridgeConnectionStorage);break;default:if(o)s=this.createProvider(o);else return}}catch{this.tracker.trackConnectionRestoringError(`Provider is not restored`,r),yield this.bridgeConnectionStorage.removeConnection(),s?.closeConnection(),s=null;return}if(i.signal.aborted){s?.closeConnection(),this.tracker.trackConnectionRestoringError(`Connection restoring was aborted`,r);return}if(!s){this.tracker.trackConnectionRestoringError(`Provider is not restored`,r);return}(n=this.provider)==null||n.closeConnection(),this.provider=s,s.listen(this.walletEventsListener.bind(this));let c=()=>{this.tracker.trackConnectionRestoringError(`Connection restoring was aborted`,r),s?.closeConnection(),s=null};i.signal.addEventListener(`abort`,c);let l=kt(t=>w(this,void 0,void 0,function*(){if(yield s?.restoreConnection({openingDeadlineMS:e?.openingDeadlineMS,signal:t.signal,traceId:r}),i.signal.removeEventListener(`abort`,c),this.connected){let e=this.getSessionInfo();this.tracker.trackConnectionRestoringCompleted(this.wallet,e,r)}else this.tracker.trackConnectionRestoringError(`Connection restoring failed`,r)}),{attempts:2**53-1,delayMs:2e3,signal:e?.signal}),u=new Promise(e=>setTimeout(()=>e(),12e3));return Promise.race([l,u])})}sendTransaction(e,t){return w(this,void 0,void 0,function*(){let n={};typeof t==`function`?n.onRequestSent=t:(n.onRequestSent=t?.onRequestSent,n.signal=t?.signal,n.traceId=t?.traceId);let r=Yn(e);if(r&&!xr())throw new T(`SendTransactionRequest validation failed: `+r);let i=Ot(n?.signal);if(i.signal.aborted)throw new T(`Transaction sending was aborted`);this.checkConnection();let{requiredMessagesNumber:a,requireExtraCurrencies:o,requiredItemTypes:s}=this.extractRequiredFeatures(e);Cr(this.wallet.device.features,{requiredMessagesNumber:a,requireExtraCurrencies:o,requiredItemTypes:s});let c=this.getSessionInfo(),l=n?.traceId??E();this.tracker.trackTransactionSentForSignature(this.wallet,e,c,l);let u=e.from||this.account.address,d=e.network||this.account.chain;if(this.wallet?.account.chain&&d!==this.wallet.account.chain&&!xr())throw new Ie(`Wallet connected to a wrong network`,{cause:{expectedChainId:this.wallet?.account.chain,actualChainId:d}});let f=Ge(e)?this.buildItemsRpcPayload(e,u,d):this.buildMessagesRpcPayload(e,u,d),p=yield this.sendRequestTrackingTransport(pt.convertToRpcRequest(f),{onRequestSent:n.onRequestSent,signal:i.signal,traceId:l},t=>this.tracker.trackTransactionSigningFailed(this.wallet,e,t,de.UNKNOWN_ERROR,c,l));if(pt.isError(p))return this.tracker.trackTransactionSigningFailed(this.wallet,e,p.error.message,p.error.code,c,l),pt.parseAndThrowError(p);let m=pt.convertFromRpcResponse(p);return this.tracker.trackTransactionSigned(this.wallet,e,m,c,l),Object.assign(Object.assign({},m),{traceId:p.traceId})})}sendRequestTrackingTransport(e,t,n){return w(this,void 0,void 0,function*(){let r=!1,i=t.onRequestSent&&(()=>{try{t.onRequestSent()}catch(e){throw r=!0,e}});try{return yield this.provider.sendRequest(e,Object.assign(Object.assign({},t),{onRequestSent:i}))}catch(e){throw e instanceof Le&&!r&&n(e.message),e}})}extractRequiredFeatures(e){let t=Ge(e);return{requiredMessagesNumber:t?e.items.length:e.messages.length,requireExtraCurrencies:t?e.items?.filter(e=>e.type===`ton`).some(e=>e.extraCurrency&&Object.keys(e.extraCurrency).length>0):e.messages.some(e=>e.extraCurrency&&Object.keys(e.extraCurrency).length>0),requiredItemTypes:t?[...new Set(e.items.map(e=>e.type))]:void 0}}signData(e,t){return w(this,void 0,void 0,function*(){let n=Ot(t?.signal);if(n.signal.aborted)throw new T(`data sending was aborted`);let r=ir(e);if(r&&!xr())throw new T(`SignDataPayload validation failed: `+r);this.checkConnection(),wr(this.wallet.device.features,{requiredTypes:[e.type]});let i=this.getSessionInfo(),a=t?.traceId??E();this.tracker.trackDataSentForSignature(this.wallet,e,i,a);let o=e.from||this.account.address,s=e.network||this.account.chain;if(this.wallet?.account.chain&&s!==this.wallet.account.chain&&!xr())throw new Ie(`Wallet connected to a wrong network`,{cause:{expectedChainId:this.wallet?.account.chain,actualChainId:s}});let c=yield this.sendRequestTrackingTransport(mt.convertToRpcRequest(Object.assign(Object.assign(Object.assign({},e),e.type===`cell`?{cell:Yt(e.cell)}:{}),{from:o,network:s})),{onRequestSent:t?.onRequestSent,signal:n.signal,traceId:a},t=>this.tracker.trackDataSigningFailed(this.wallet,e,t,fe.UNKNOWN_ERROR,i,a));if(mt.isError(c))return this.tracker.trackDataSigningFailed(this.wallet,e,c.error.message,c.error.code,i,a),mt.parseAndThrowError(c);let l=mt.convertFromRpcResponse(c);return this.tracker.trackDataSigned(this.wallet,e,l,i,a),Object.assign(Object.assign({},l),{traceId:a})})}signMessage(e,t){return w(this,void 0,void 0,function*(){let n=Ot(t?.signal);if(n.signal.aborted)throw new T(`Message signing was aborted`);let r=Jn(e);if(r&&!xr())throw new T(`SignMessageRequest validation failed: `+r);this.checkConnection();let{requiredMessagesNumber:i,requireExtraCurrencies:a,requiredItemTypes:o}=this.extractRequiredFeatures(e);Tr(this.wallet.device.features,{requiredMessagesNumber:i,requireExtraCurrencies:a,requiredItemTypes:o});let s=t?.traceId??E(),c=e.from||this.account.address,l=e.network||this.account.chain;if(this.wallet?.account.chain&&l!==this.wallet.account.chain&&!xr())throw new Ie(`Wallet connected to a wrong network`,{cause:{expectedChainId:this.wallet?.account.chain,actualChainId:l}});let u=Ge(e)?this.buildItemsRpcPayload(e,c,l):this.buildMessagesRpcPayload(e,c,l),d=yield this.provider.sendRequest(ht.convertToRpcRequest(u),{onRequestSent:t?.onRequestSent,signal:n.signal,traceId:s});if(ht.isError(d))return ht.parseAndThrowError(d);let f=ht.convertFromRpcResponse(d);return Object.assign(Object.assign({},f),{traceId:d.traceId})})}setConnectionNetwork(e){if(this.connected)throw new T(`Cannot change network while wallet is connected`);this.desiredChainId=e}disconnect(e){return w(this,void 0,void 0,function*(){if(!this.connected)throw new Me;let t=Ot(e?.signal),n=this.abortController;if(this.abortController=t,t.signal.aborted)throw new T(`Disconnect was aborted`);let r=e?.traceId??E();this.onWalletDisconnected(`dapp`,{traceId:r}),yield this.provider?.disconnect({signal:t.signal,traceId:r}),n?.abort()})}getSessionId(){return w(this,void 0,void 0,function*(){if(!this.provider)return null;try{let e=yield this.bridgeConnectionStorage.getConnection();return!e||e.type!==`http`?null:`sessionCrypto`in e?e.sessionCrypto.sessionId:e.session.sessionCrypto.sessionId}catch{return null}})}getSessionInfo(){if(this.provider?.type!==`http`||!(`session`in this.provider))return null;try{let e=this.provider.session;if(!e)return null;let t=e.sessionCrypto.sessionId,n=null;return`walletPublicKey`in e&&(n=e.walletPublicKey),{clientId:t,walletId:n}}catch{return null}}buildMessagesRpcPayload(e,t,n){return{from:t,network:n,valid_until:e.validUntil,messages:e.messages.map(e=>{var{extraCurrency:t,payload:n,stateInit:r}=e,i=Ee(e,[`extraCurrency`,`payload`,`stateInit`]);return Object.assign(Object.assign({},i),{payload:Yt(n),stateInit:Yt(r),extra_currency:t})})}}buildItemsRpcPayload(e,t,n){return{from:t,network:n,valid_until:e.validUntil,items:e.items.map(e=>ii(e))}}pauseConnection(){this.provider?.type===`http`&&this.provider.pause()}unPauseConnection(){return this.provider?.type===`http`?this.provider.unPause():Promise.resolve()}addWindowFocusAndBlurSubscriptions(){let e=pn();if(e)try{e.addEventListener(`visibilitychange`,()=>{e.hidden?this.pauseConnection():this.unPauseConnection().catch(()=>{})})}catch{}}initAnalytics(e,t,n){let r=n?.analytics,i=r?.mode??`telemetry`;if(i===`off`)return;let a=new ci({environment:this.environment,analyticsUrl:r?.url,mode:i});this.analytics=a;let o=this.environment.getTelegramUser(),s={browser:this.environment.getBrowser(),platform:this.environment.getPlatform(),manifest_json_url:e,origin_url:hn,locale:this.environment.getLocale()};o&&(s.tg_id=o.id,s.tma_is_premium=o.isPremium),fi(t,a.scoped(s))}createProvider(e){let t;return t=!Array.isArray(e)&&Re(e)?new hr(this.bridgeConnectionStorage,e.jsBridgeKey,this.analytics):!Array.isArray(e)&&ze(e)?new Ri(this.bridgeConnectionStorage):new tn(this.bridgeConnectionStorage,e,this.analytics),t.listen(this.walletEventsListener.bind(this)),t}walletEventsListener(e){switch(e.event){case`connect`:this.onWalletConnected(e.payload,{traceId:e.traceId,response:e.response,restored:e.restored});break;case`connect_error`:this.tracker.trackConnectionError(e.payload.message,e.payload.code,this.getSessionInfo(),e.traceId);let t=ut.parseError(e.payload);this.onWalletConnectError(t);break;case`disconnect`:this.onWalletDisconnected(`wallet`,{traceId:e.traceId})}}onWalletConnected(e,t){var n,r;let i=this.pendingEmbeddedRequestMethod;this.pendingEmbeddedRequestMethod=void 0;let a=e.items.find(e=>e.name===`ton_addr`),o=e.items.find(e=>e.name===`ton_proof`);if(!a)throw new T(`ton_addr connection item was not found`);if(!Er(e.device.features,this.walletsRequiredFeatures)){(n=this.provider)==null||n.disconnect().catch(e=>void 0),this.onWalletConnectError(new Fe(`Wallet does not support required features`,{cause:{connectEvent:e}}));return}let s={device:e.device,provider:this.provider.type,account:{address:a.address,chain:a.network,walletStateInit:a.walletStateInit,publicKey:a.publicKey}};if(this.desiredChainId&&s.account.chain!==this.desiredChainId){let e=this.desiredChainId,t=s.account.chain;(r=this.provider)==null||r.disconnect().catch(e=>void 0),this.onWalletConnectError(new Ie(`Wallet connected to a wrong network`,{cause:{expectedChainId:e,actualChainId:t}}));return}if(o){let e=cr(o),t;if(e)t={name:`ton_proof`,error:{code:ue.UNKNOWN_ERROR,message:e}};else try{if(`proof`in o)t={name:`ton_proof`,proof:{timestamp:o.proof.timestamp,domain:{lengthBytes:o.proof.domain.lengthBytes,value:o.proof.domain.value},payload:o.proof.payload,signature:o.proof.signature}};else if(`error`in o)t={name:`ton_proof`,error:{code:o.error.code,message:o.error.message}};else throw new T(`Invalid data format`)}catch{t={name:`ton_proof`,error:{code:ue.UNKNOWN_ERROR,message:`Invalid data format`}}}s.connectItems={tonProof:t}}t.response&&i&&(s.embeddedResponse=Hi.convertFromRpcResponse(i,t.response)),this.wallet=s;let c=this.getSessionInfo();this.tracker.trackConnectionCompleted(s,c,t?.traceId,t?.restored)}onWalletConnectError(e){if(this.statusChangeErrorSubscriptions.forEach(t=>t(e)),e instanceof Ae||e instanceof ke)throw e}onWalletDisconnected(e,t){let n=this.getSessionInfo();this.tracker.trackDisconnection(this.wallet,e,n,t?.traceId),this.wallet=null}checkConnection(){if(!this.connected)throw new Me}createConnectRequest(e){let t=[Object.assign({name:`ton_addr`},this.desiredChainId?{network:this.desiredChainId}:{})];return e?.tonProof&&t.push({name:`ton_proof`,payload:e.tonProof}),{manifestUrl:this.dappSettings.manifestUrl,items:t}}};Wi.walletsList=new Sr,Wi.isWalletInjected=e=>hr.isWalletInjected(e),Wi.isInsideWalletBrowser=e=>hr.isInsideWalletBrowser(e);var Gi=t(((e,t)=>{(function(n,r){var i=`1.0.41`,a=``,o=`function`,s=`undefined`,c=`object`,l=`string`,u=`major`,d=`model`,f=`name`,p=`type`,m=`vendor`,h=`version`,g=`architecture`,_=`console`,v=`mobile`,y=`tablet`,b=`smarttv`,x=`wearable`,S=`embedded`,C=`Amazon`,ee=`Apple`,te=`ASUS`,ne=`BlackBerry`,re=`Browser`,ie=`Chrome`,ae=`Edge`,oe=`Firefox`,se=`Google`,ce=`Honor`,le=`Huawei`,ue=`Lenovo`,de=`LG`,fe=`Microsoft`,pe=`Motorola`,me=`Nvidia`,he=`OnePlus`,ge=`Opera`,_e=`OPPO`,ve=`Samsung`,ye=`Sharp`,be=`Sony`,xe=`Xiaomi`,Se=`Zebra`,Ce=`Facebook`,we=`Chromium OS`,Te=`Mac OS`,Ee=` Browser`,w=function(e,t){var n={};for(var r in e)n[r]=t[r]&&t[r].length%2==0?t[r].concat(e[r]):e[r];return n},T=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},De=function(e,t){return typeof e==l&&Oe(t).indexOf(Oe(e))!==-1},Oe=function(e){return e.toLowerCase()},ke=function(e){return typeof e==l?e.replace(/[^\d\.]/g,a).split(`.`)[0]:r},Ae=function(e,t){if(typeof e==l)return e=e.replace(/^\s\s*/,a),typeof t===s?e:e.substring(0,500)},je=function(e,t){for(var n=0,i,a,s,l,u,d;n<t.length&&!u;){var f=t[n],p=t[n+1];for(i=a=0;i<f.length&&!u&&f[i];)if(u=f[i++].exec(e),u)for(s=0;s<p.length;s++)d=u[++a],l=p[s],typeof l==c&&l.length>0?l.length===2?typeof l[1]==o?this[l[0]]=l[1].call(this,d):this[l[0]]=l[1]:l.length===3?typeof l[1]===o&&!(l[1].exec&&l[1].test)?this[l[0]]=d?l[1].call(this,d,l[2]):r:this[l[0]]=d?d.replace(l[1],l[2]):r:l.length===4&&(this[l[0]]=d?l[3].call(this,d.replace(l[1],l[2])):r):this[l]=d||r;n+=2}},Me=function(e,t){for(var n in t)if(typeof t[n]==c&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(De(t[n][i],e))return n===`?`?r:n}else if(De(t[n],e))return n===`?`?r:n;return t.hasOwnProperty(`*`)?t[`*`]:e},Ne={"1.0":`/8`,"1.2":`/1`,"1.3":`/3`,"2.0":`/412`,"2.0.2":`/416`,"2.0.3":`/417`,"2.0.4":`/419`,"?":`/`},Pe={ME:`4.90`,"NT 3.11":`NT3.51`,"NT 4.0":`NT4.0`,2e3:`NT 5.0`,XP:[`NT 5.1`,`NT 5.2`],Vista:`NT 6.0`,7:`NT 6.1`,8:`NT 6.2`,"8.1":`NT 6.3`,10:[`NT 6.4`,`NT 10.0`],RT:`ARM`},Fe={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[f,`Chrome`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[f,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,h],[/opios[\/ ]+([\w\.]+)/i],[h,[f,ge+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[h,[f,ge+` GX`]],[/\bopr\/([\w\.]+)/i],[h,[f,ge]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[h,[f,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[h,[f,`Maxthon`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[f,h],[/quark(?:pc)?\/([-\w\.]+)/i],[h,[f,`Quark`]],[/\bddg\/([\w\.]+)/i],[h,[f,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[f,`UC`+re]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[h,[f,`WeChat`]],[/konqueror\/([\w\.]+)/i],[h,[f,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[f,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[h,[f,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[h,[f,`Smart Lenovo `+re]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,`$1 Secure `+re],h],[/\bfocus\/([\w\.]+)/i],[h,[f,oe+` Focus`]],[/\bopt\/([\w\.]+)/i],[h,[f,ge+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[h,[f,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[h,[f,`Dolphin`]],[/coast\/([\w\.]+)/i],[h,[f,ge+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[h,[f,`MIUI`+Ee]],[/fxios\/([\w\.-]+)/i],[h,[f,oe]],[/\bqihoobrowser\/?([\w\.]*)/i],[h,[f,`360`]],[/\b(qq)\/([\w\.]+)/i],[[f,/(.+)/,`$1Browser`],h],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[f,/(.+)/,`$1`+Ee],h],[/samsungbrowser\/([\w\.]+)/i],[h,[f,ve+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[h,[f,`Sogou Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[f,`Sogou Mobile`],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[f,h],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[f],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[h,f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,Ce],h],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[f,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[f,`GSA`]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[h,[f,`TikTok`]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[f,ie+` Headless`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,ie+` WebView`],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[f,`Android `+re]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,h],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[h,[f,`Mobile Safari`]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[h,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[h,Me,Ne]],[/(webkit|khtml)\/([\w\.]+)/i],[f,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,`Netscape`],h],[/(wolvic|librewolf)\/([\w\.]+)/i],[f,h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[f,oe+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[f,[h,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[f,[h,/master.|lts./,``]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[g,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[g,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[g,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[g,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[g,`arm`]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[g,/ower/,a,Oe]],[/ sun4\w[;\)]/i],[[g,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[g,Oe]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[d,[m,ve],[p,y]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[d,[m,ve],[p,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[d,[m,ee],[p,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[d,[m,ee],[p,y]],[/(macintosh);/i],[d,[m,ee]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[d,[m,ye],[p,v]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[d,[m,ce],[p,y]],[/honor([-\w ]+)[;\)]/i],[d,[m,ce],[p,v]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[d,[m,le],[p,y]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[d,[m,le],[p,v]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[d,/_/g,` `],[m,xe],[p,y]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[d,/_/g,` `],[m,xe],[p,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[d,[m,_e],[p,v]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[d,[m,Me,{OnePlus:[`304`,`403`,`203`],"*":_e}],[p,y]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[d,[m,`Vivo`],[p,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[d,[m,`Realme`],[p,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[d,[m,pe],[p,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[d,[m,pe],[p,y]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[d,[m,de],[p,y]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[d,[m,de],[p,v]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[d,[m,ue],[p,y]],[/(nokia) (t[12][01])/i],[m,d,[p,y]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[d,/_/g,` `],[p,v],[m,`Nokia`]],[/(pixel (c|tablet))\b/i],[d,[m,se],[p,y]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[d,[m,se],[p,v]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[d,[m,be],[p,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[d,`Xperia Tablet`],[m,be],[p,y]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[d,[m,he],[p,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[d,[m,C],[p,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[d,/(.+)/g,`Fire Phone $1`],[m,C],[p,v]],[/(playbook);[-\w\),; ]+(rim)/i],[d,m,[p,y]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[d,[m,ne],[p,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[d,[m,te],[p,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[d,[m,te],[p,v]],[/(nexus 9)/i],[d,[m,`HTC`],[p,y]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[m,[d,/_/g,` `],[p,v]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[d,[m,`TCL`],[p,y]],[/(itel) ((\w+))/i],[[m,Oe],d,[p,Me,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[d,[m,`Acer`],[p,y]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[d,[m,`Meizu`],[p,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[d,[m,`Ulefone`],[p,v]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[d,[m,`Energizer`],[p,v]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[d,[m,`Cat`],[p,v]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[d,[m,`Smartfren`],[p,v]],[/droid.+; (a(?:015|06[35]|142p?))/i],[d,[m,`Nothing`],[p,v]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[d,[m,`Archos`],[p,y]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[d,[m,`Archos`],[p,v]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[m,d,[p,y]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[m,d,[p,v]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[m,d,[p,y]],[/(surface duo)/i],[d,[m,fe],[p,y]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[d,[m,`Fairphone`],[p,v]],[/(u304aa)/i],[d,[m,`AT&T`],[p,v]],[/\bsie-(\w*)/i],[d,[m,`Siemens`],[p,v]],[/\b(rct\w+) b/i],[d,[m,`RCA`],[p,y]],[/\b(venue[\d ]{2,7}) b/i],[d,[m,`Dell`],[p,y]],[/\b(q(?:mv|ta)\w+) b/i],[d,[m,`Verizon`],[p,y]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[d,[m,`Barnes & Noble`],[p,y]],[/\b(tm\d{3}\w+) b/i],[d,[m,`NuVision`],[p,y]],[/\b(k88) b/i],[d,[m,`ZTE`],[p,y]],[/\b(nx\d{3}j) b/i],[d,[m,`ZTE`],[p,v]],[/\b(gen\d{3}) b.+49h/i],[d,[m,`Swiss`],[p,v]],[/\b(zur\d{3}) b/i],[d,[m,`Swiss`],[p,y]],[/\b((zeki)?tb.*\b) b/i],[d,[m,`Zeki`],[p,y]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[m,`Dragon Touch`],d,[p,y]],[/\b(ns-?\w{0,9}) b/i],[d,[m,`Insignia`],[p,y]],[/\b((nxa|next)-?\w{0,9}) b/i],[d,[m,`NextBook`],[p,y]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[m,`Voice`],d,[p,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[m,`LvTel`],d,[p,v]],[/\b(ph-1) /i],[d,[m,`Essential`],[p,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[d,[m,`Envizen`],[p,y]],[/\b(trio[-\w\. ]+) b/i],[d,[m,`MachSpeed`],[p,y]],[/\btu_(1491) b/i],[d,[m,`Rotor`],[p,y]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[d,[m,me],[p,y]],[/(sprint) (\w+)/i],[m,d,[p,v]],[/(kin\.[onetw]{3})/i],[[d,/\./g,` `],[m,fe],[p,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[d,[m,Se],[p,y]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[d,[m,Se],[p,v]],[/smart-tv.+(samsung)/i],[m,[p,b]],[/hbbtv.+maple;(\d+)/i],[[d,/^/,`SmartTV`],[m,ve],[p,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[m,de],[p,b]],[/(apple) ?tv/i],[m,[d,ee+` TV`],[p,b]],[/crkey/i],[[d,ie+`cast`],[m,se],[p,b]],[/droid.+aft(\w+)( bui|\))/i],[d,[m,C],[p,b]],[/(shield \w+ tv)/i],[d,[m,me],[p,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[d,[m,ye],[p,b]],[/(bravia[\w ]+)( bui|\))/i],[d,[m,be],[p,b]],[/(mi(tv|box)-?\w+) bui/i],[d,[m,xe],[p,b]],[/Hbbtv.*(technisat) (.*);/i],[m,d,[p,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[m,Ae],[d,Ae],[p,b]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[d,[p,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[m,d,[p,_]],[/droid.+; (shield)( bui|\))/i],[d,[m,me],[p,_]],[/(playstation \w+)/i],[d,[m,be],[p,_]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[d,[m,fe],[p,_]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[d,[m,ve],[p,x]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[m,d,[p,x]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[d,[m,_e],[p,x]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[d,[m,ee],[p,x]],[/(opwwe\d{3})/i],[d,[m,he],[p,x]],[/(moto 360)/i],[d,[m,pe],[p,x]],[/(smartwatch 3)/i],[d,[m,be],[p,x]],[/(g watch r)/i],[d,[m,de],[p,x]],[/droid.+; (wt63?0{2,3})\)/i],[d,[m,Se],[p,x]],[/droid.+; (glass) \d/i],[d,[m,se],[p,x]],[/(pico) (4|neo3(?: link|pro)?)/i],[m,d,[p,x]],[/; (quest( \d| pro)?)/i],[d,[m,Ce],[p,x]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[m,[p,S]],[/(aeobc)\b/i],[d,[m,C],[p,S]],[/(homepod).+mac os/i],[d,[m,ee],[p,S]],[/windows iot/i],[[p,S]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[d,[p,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[d,[p,y]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,y]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,v]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[d,[m,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[f,ae+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[f,h],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[f,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,h],[/ladybird\//i],[[f,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,h],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[f,[h,Me,Pe]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[h,Me,Pe],[f,`Windows`]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,`.`],[f,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,Te],[h,/_/g,`.`]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[h,f],[/(ubuntu) ([\w\.]+) like android/i],[[f,/(.+)/,`$1 Touch`],h],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[f,h],[/\(bb(10);/i],[h,[f,ne]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[h,[f,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[f,oe+` OS`]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[f,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[h,[f,`watchOS`]],[/crkey\/([\d\.]+)/i],[h,[f,ie+`cast`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,we],h],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,h],[/(sunos) ?([\w\.\d]*)/i],[[f,`Solaris`],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,h]]},Ie=function(e,t){if(typeof e==c&&(t=e,e=r),!(this instanceof Ie))return new Ie(e,t).getResult();var i=typeof n!==s&&n.navigator?n.navigator:r,_=e||(i&&i.userAgent?i.userAgent:a),b=i&&i.userAgentData?i.userAgentData:r,x=t?w(Fe,t):Fe,S=i&&i.userAgent==_;return this.getBrowser=function(){var e={};return e[f]=r,e[h]=r,je.call(e,_,x.browser),e[u]=ke(e[h]),S&&i&&i.brave&&typeof i.brave.isBrave==o&&(e[f]=`Brave`),e},this.getCPU=function(){var e={};return e[g]=r,je.call(e,_,x.cpu),e},this.getDevice=function(){var e={};return e[m]=r,e[d]=r,e[p]=r,je.call(e,_,x.device),S&&!e[p]&&b&&b.mobile&&(e[p]=v),S&&e[d]==`Macintosh`&&i&&typeof i.standalone!==s&&i.maxTouchPoints&&i.maxTouchPoints>2&&(e[d]=`iPad`,e[p]=y),e},this.getEngine=function(){var e={};return e[f]=r,e[h]=r,je.call(e,_,x.engine),e},this.getOS=function(){var e={};return e[f]=r,e[h]=r,je.call(e,_,x.os),S&&!e[f]&&b&&b.platform&&b.platform!=`Unknown`&&(e[f]=b.platform.replace(/chrome os/i,we).replace(/macos/i,Te)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return _},this.setUA=function(e){return _=typeof e==l&&e.length>500?Ae(e,500):e,this},this.setUA(_),this};Ie.VERSION=i,Ie.BROWSER=T([f,h,u]),Ie.CPU=T([g]),Ie.DEVICE=T([d,m,p,_,v,b,y,x,S]),Ie.ENGINE=Ie.OS=T([f,h]),typeof e===s?typeof define===o&&define.amd?define(function(){return Ie}):typeof n!==s&&(n.UAParser=Ie):(typeof t!==s&&t.exports&&(e=t.exports=Ie),e.UAParser=Ie);var Le=typeof n!==s&&(n.jQuery||n.Zepto);if(Le&&!Le.ua){var Re=new Ie;Le.ua=Re.getResult(),Le.ua.get=function(){return Re.getUA()},Le.ua.set=function(e){Re.setUA(e);var t=Re.getResult();for(var n in t)Le.ua[n]=t[n]}}})(typeof window==`object`?window:e)})),Ki=t(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}));r();var qi=e(Gi(),1),Ji=e(ae(),1),Yi=e(Ki(),1),Xi=Object.defineProperty,Zi=Object.defineProperties,Qi=Object.getOwnPropertyDescriptors,$i=Object.getOwnPropertySymbols,ea=Object.prototype.hasOwnProperty,ta=Object.prototype.propertyIsEnumerable,na=Math.pow,ra=(e,t,n)=>t in e?Xi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,O=(e,t)=>{for(var n in t||={})ea.call(t,n)&&ra(e,n,t[n]);if($i)for(var n of $i(t))ta.call(t,n)&&ra(e,n,t[n]);return e},k=(e,t)=>Zi(e,Qi(t)),ia=(e,t)=>{var n={};for(var r in e)ea.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$i)for(var r of $i(e))t.indexOf(r)<0&&ta.call(e,r)&&(n[r]=e[r]);return n},A=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),aa=(e,t)=>e===t,oa=Symbol(`solid-proxy`),sa=typeof Proxy==`function`,ca=Symbol(`solid-track`),la={equals:aa},ua=Wa,da=1,fa=2,pa={owned:null,cleanups:null,context:null,owner:null},ma={},j=null,M=null,ha=null,ga=null,_a=0;function va(e,t){let n=M,r=j,i=e.length===0,a=t===void 0?r:t,o=i?pa:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>L(()=>Ja(o)));j=o,M=null;try{return Ha(s,!0)}finally{M=n,j=r}}function N(e,t){t=t?Object.assign({},la,t):la;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[Ia.bind(n),e=>(typeof e==`function`&&(e=e(n.value)),La(n,e))]}function ya(e,t,n){Ra(Ba(e,t,!0,da))}function P(e,t,n){Ra(Ba(e,t,!1,da))}function F(e,t,n){ua=Ga;let r=Ba(e,t,!1,da);(!n||!n.render)&&(r.user=!0),ga?ga.push(r):Ra(r)}function I(e,t,n){n=n?Object.assign({},la,n):la;let r=Ba(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Ra(r),Ia.bind(r)}function ba(e){return e&&typeof e==`object`&&`then`in e}function xa(e,t,n){let r,i,a;r=!0,i=e,a={};let o=null,s=ma,c=!1,l=`initialValue`in a,u=typeof r==`function`&&I(r),d=new Set,[f,p]=(a.storage||N)(a.initialValue),[m,h]=N(void 0),[g,_]=N(void 0,{equals:!1}),[v,y]=N(l?`ready`:`unresolved`);function b(e,t,n,r){return o===e&&(o=null,r!==void 0&&(l=!0),(e===s||t===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(r,{value:t})),s=ma,x(t,n)),t}function x(e,t){Ha(()=>{t===void 0&&p(()=>e),y(t===void 0?l?`ready`:`unresolved`:`errored`),h(t);for(let e of d.keys())e.decrement();d.clear()},!1)}function S(){let e=f(),t=m();if(t!==void 0&&!o)throw t;return M&&M.user,e}function C(e=!0){if(e!==!1&&c)return;c=!1;let t=u?u():r;if(t==null||t===!1){b(o,L(f));return}let n,a=s===ma?L(()=>{try{return i(t,{value:f(),refetching:e})}catch(e){n=e}}):s;if(n!==void 0){b(o,void 0,Ya(n),t);return}return ba(a)?(o=a,`v`in a?(a.s===1?b(o,a.v,void 0,t):b(o,void 0,Ya(a.v),t),a):(c=!0,queueMicrotask(()=>c=!1),Ha(()=>{y(l?`refreshing`:`pending`),_()},!1),a.then(e=>b(a,e,void 0,t),e=>b(a,void 0,Ya(e),t)))):(b(o,a,void 0,t),a)}Object.defineProperties(S,{state:{get:()=>v()},error:{get:()=>m()},loading:{get(){let e=v();return e===`pending`||e===`refreshing`}},latest:{get(){if(!l)return S();let e=m();if(e&&!o)throw e;return f()}}});let ee=j;return u?ya(()=>(ee=j,C(!1))):C(!1),[S,{refetch:e=>Oa(ee,()=>C(e)),mutate:p}]}function Sa(e){return Ha(e,!1)}function L(e){if(M===null)return e();let t=M;M=null;try{return e()}finally{M=t}}function Ca(e,t,n){let r=Array.isArray(e),i;return n=>{let a;if(r){a=Array(e.length);for(let t=0;t<e.length;t++)a[t]=e[t]()}else a=e();let o=L(()=>t(a,i,n));return i=a,o}}function wa(e){F(()=>L(e))}function Ta(e){return j===null||(j.cleanups===null?j.cleanups=[e]:j.cleanups.push(e)),e}function Ea(){return M}function Da(){return j}function Oa(e,t){let n=j,r=M;j=e,M=null;try{return Ha(t,!0)}catch(e){Xa(e)}finally{j=n,M=r}}function ka(e){let t=M,n=j;return Promise.resolve().then(()=>{M=t,j=n,Ha(e,!1),M=j=null})}var[Aa,ja]=N(!1);function Ma(){return[Aa,ka]}function Na(e,t){let n=Symbol(`context`);return{id:n,Provider:Qa(n),defaultValue:e}}function Pa(e){let t;return j&&j.context&&(t=j.context[e.id])!==void 0?t:e.defaultValue}function Fa(e){let t=I(e),n=I(()=>Za(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}function Ia(){if(this.sources&&this.state){if(this.state===da)Ra(this);else{let e=ha;ha=null,Ha(()=>Ka(this),!1),ha=e}}if(M){let e=this.observers?this.observers.length:0;M.sources?(M.sources.push(this),M.sourceSlots.push(e)):(M.sources=[this],M.sourceSlots=[e]),this.observers?(this.observers.push(M),this.observerSlots.push(M.sources.length-1)):(this.observers=[M],this.observerSlots=[M.sources.length-1])}return this.value}function La(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Ha(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t];n.state||(n.pure?ha.push(n):ga.push(n),n.observers&&qa(n)),n.state=da}if(ha.length>1e6)throw ha=[],Error()},!1)),t}function Ra(e){if(!e.fn)return;Ja(e);let t=_a;za(e,e.value,t)}function za(e,t,n){let r,i=j,a=M;M=j=e;try{r=e.fn(t)}catch(t){return e.pure&&(e.state=da,e.owned&&e.owned.forEach(Ja),e.owned=null),e.updatedAt=n+1,Xa(t)}finally{M=a,j=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?La(e,r):e.value=r,e.updatedAt=n)}function Ba(e,t,n,r=da,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:j,context:j?j.context:null,pure:n};return j===null||j!==pa&&(j.owned?j.owned.push(a):j.owned=[a]),a}function Va(e){if(e.state===0)return;if(e.state===fa)return Ka(e);if(e.suspense&&L(e.suspense.inFallback))return e.suspense.effects.push(e);let t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<_a);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===da)Ra(e);else if(e.state===fa){let n=ha;ha=null,Ha(()=>Ka(e,t[0]),!1),ha=n}}function Ha(e,t){if(ha)return e();let n=!1;t||(ha=[]),ga?n=!0:ga=[],_a++;try{let t=e();return Ua(n),t}catch(e){n||(ga=null),ha=null,Xa(e)}}function Ua(e){if(ha&&=(Wa(ha),null),e)return;let t=ga;ga=null,t.length&&Ha(()=>ua(t),!1)}function Wa(e){for(let t=0;t<e.length;t++)Va(e[t])}function Ga(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:Va(r)}for(t=0;t<n;t++)Va(e[t])}function Ka(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){let r=e.sources[n];if(r.sources){let e=r.state;e===da?r!==t&&(!r.updatedAt||r.updatedAt<_a)&&Va(r):e===fa&&Ka(r,t)}}}function qa(e){for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t];n.state||(n.state=fa,n.pure?ha.push(n):ga.push(n),n.observers&&qa(n))}}function Ja(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Ja(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Ja(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function Ya(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function Xa(e,t=j){throw Ya(e)}function Za(e){if(typeof e==`function`&&!e.length)return Za(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=Za(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function Qa(e,t){return function(t){let n;return P(()=>n=L(()=>(j.context=k(O({},j.context),{[e]:t.value}),Fa(()=>t.children))),void 0),n}}var $a=Symbol(`fallback`);function eo(e){for(let t=0;t<e.length;t++)e[t]()}function to(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return Ta(()=>eo(a)),()=>{let c=e()||[],l=c.length,u,d;return c[ca],L(()=>{let e,t,p,m,h,g,_,v,y;if(l===0)o!==0&&(eo(a),a=[],r=[],i=[],o=0,s&&=[]),n.fallback&&(r=[$a],i[0]=va(e=>(a[0]=e,n.fallback())),o=1);else if(o===0){for(i=Array(l),d=0;d<l;d++)r[d]=c[d],i[d]=va(f);o=l}else{for(p=Array(l),m=Array(l),s&&(h=Array(l)),g=0,_=Math.min(o,l);g<_&&r[g]===c[g];g++);for(_=o-1,v=l-1;_>=g&&v>=g&&r[_]===c[v];_--,v--)p[v]=i[_],m[v]=a[_],s&&(h[v]=s[_]);for(e=new Map,t=Array(v+1),d=v;d>=g;d--)y=c[d],u=e.get(y),t[d]=u===void 0?-1:u,e.set(y,d);for(u=g;u<=_;u++)y=r[u],d=e.get(y),d!==void 0&&d!==-1?(p[d]=i[u],m[d]=a[u],s&&(h[d]=s[u]),d=t[d],e.set(y,d)):a[u]();for(d=g;d<l;d++)d in p?(i[d]=p[d],a[d]=m[d],s&&(s[d]=h[d],s[d](d))):i[d]=va(f);i=i.slice(0,o=l),r=c.slice(0)}return i});function f(e){if(a[d]=e,s){let[e,n]=N(d);return s[d]=n,t(c[d],e)}return t(c[d])}}}function R(e,t){return L(()=>e(t||{}))}function no(){return!0}var ro={get(e,t,n){return t===oa?n:e.get(t)},has(e,t){return t===oa||e.has(t)},set:no,deleteProperty:no,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:no,deleteProperty:no}},ownKeys(e){return e.keys()}};function io(e){return(e=typeof e==`function`?e():e)?e:{}}function ao(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function oo(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&oa in r,e[n]=typeof r==`function`?(t=!0,I(r)):r}if(sa&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=io(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in io(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(io(e[n])));return[...new Set(t)]}},ro);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:ao.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let i={},a=Object.keys(r);for(let e=a.length-1;e>=0;e--){let t=a[e],n=r[t];n&&n.get?Object.defineProperty(i,t,n):i[t]=n?n.value:void 0}return i}function so(e,...t){if(sa&&oa in e){let n=new Set(t.length>1?t.flat():t[0]),r=t.map(t=>new Proxy({get(n){return t.includes(n)?e[n]:void 0},has(n){return t.includes(n)&&n in e},keys(){return t.filter(t=>t in e)}},ro));return r.push(new Proxy({get(t){return n.has(t)?void 0:e[t]},has(t){return!n.has(t)&&t in e},keys(){return Object.keys(e).filter(e=>!n.has(e))}},ro)),r}let n={},r=t.map(()=>({}));for(let i of Object.getOwnPropertyNames(e)){let a=Object.getOwnPropertyDescriptor(e,i),o=!a.get&&!a.set&&a.enumerable&&a.writable&&a.configurable,s=!1,c=0;for(let e of t)e.includes(i)&&(s=!0,o?r[c][i]=a.value:Object.defineProperty(r[c],i,a)),++c;s||(o?n[i]=a.value:Object.defineProperty(n,i,a))}return[...r,n]}var co=e=>`Stale read from <${e}>.`;function lo(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return I(to(()=>e.each,e.children,t||void 0))}function z(e){let t=e.keyed,n=I(()=>e.when,void 0,void 0),r=t?n:I(n,void 0,{equals:(e,t)=>!e==!t});return I(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?L(()=>a(t?i:()=>{if(!L(r))throw co(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function uo(e){let t=Fa(()=>e.children),n=I(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=I(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:I(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return I(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?L(()=>o(a.keyed?i():()=>{if(L(n)()?.[0]!==r)throw co(`Match`);return i()})):o},void 0,void 0)}function B(e){return e}var fo=new Set(`className.value.readOnly.noValidate.formNoValidate.isMap.noModule.playsInline.allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected`.split(`.`)),po=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),mo=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),ho=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1}});function go(e,t){let n=ho[e];return typeof n==`object`?n[t]?n.$:void 0:n}var _o=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),vo=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.svg.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),yo={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},V=e=>I(()=>e());function bo(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var xo=`_$DX_DELEGATE`;function So(e,t,n,r={}){let i;return va(r=>{i=r,t===document?e():Mo(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function H(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>L(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function Co(e,t=window.document){let n=t[xo]||(t[xo]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Lo))}}function U(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function wo(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function To(e,t,n){n?e.setAttribute(t,``):e.removeAttribute(t)}function Eo(e,t){t==null?e.removeAttribute(`class`):e.className=t}function Do(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function Oo(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];r&&r!==`undefined`&&!t[r]&&(Fo(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];i&&i!==`undefined`&&n[i]!==o&&o&&(Fo(e,i,!0),n[i]=o)}return n}function ko(e,t,n){if(!t)return n?U(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function Ao(e,t={},n,r){let i={};return P(()=>i.children=Ro(e,t.children,i.children)),P(()=>typeof t.ref==`function`&&jo(t.ref,e)),P(()=>No(e,t,n,!0,i,!0)),i}function jo(e,t,n){return L(()=>e(t,n))}function Mo(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return Ro(e,t,r,n);P(r=>Ro(e,t(),r,n),r)}function No(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=Io(e,r,null,i[r],n,a,t)}for(let r in t){if(r===`children`)continue;let o=t[r];i[r]=Io(e,r,o,i[r],n,a,t)}}function Po(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function Fo(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function Io(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return ko(e,n,r);if(t===`classList`)return Oo(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=_o.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(Do(e,i,n,a),a&&Co([i]))}else if(t.slice(0,5)===`attr:`)U(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)To(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=po.has(t))||!i&&((u=go(t,e.tagName))||(c=fo.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o))d&&(t=t.slice(5),c=!0),t===`class`||t===`className`?Eo(e,n):s&&!c&&!l?e[Po(t)]=n:e[u||t]=n;else{let r=i&&t.indexOf(`:`)>-1&&yo[t.split(`:`)[0]];r?wo(e,r,t,n):U(e,mo[t]||t,n)}return n}function Lo(e){let t=e.target,n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),o=()=>{let r=t[n];if(r&&!t.disabled){let i=t[`${n}Data`];if(i===void 0?r.call(t,e):r.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),e.composedPath){let n=e.composedPath();a(n[0]);for(let e=0;e<n.length-2&&(t=n[e],o());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function Ro(e,t,n,r,i){for(;typeof n==`function`;)n=n();if(t===n)return n;let a=typeof t,o=r!==void 0;if(e=o&&n[0]&&n[0].parentNode||e,a===`string`||a===`number`){if(a===`number`&&(t=t.toString(),t===n))return n;if(o){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Vo(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||a===`boolean`)n=Vo(e,n,r);else if(a===`function`)return P(()=>{let i=t();for(;typeof i==`function`;)i=i();n=Ro(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let a=[],s=n&&Array.isArray(n);if(zo(a,t,n,i))return P(()=>n=Ro(e,a,n,r,!0)),()=>n;if(a.length===0){if(n=Vo(e,n,r),o)return n}else s?n.length===0?Bo(e,a,r):bo(e,n,a):(n&&Vo(e),Bo(e,a));n=a}else if(t.nodeType){if(Array.isArray(n)){if(o)return n=Vo(e,n,r,t);Vo(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function zo(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=zo(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=zo(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function Bo(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Vo(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}var Ho=`http://www.w3.org/2000/svg`;function Uo(e,t=!1){return t?document.createElementNS(Ho,e):document.createElement(e)}function Wo(e){let{useShadow:t}=e,n=document.createTextNode(``),r=()=>e.mount||document.body,i=Da(),a;return F(()=>{a||=Oa(i,()=>I(()=>e.children));let o=r();if(o instanceof HTMLHeadElement){let[e,t]=N(!1);va(t=>Mo(o,()=>e()?t():a(),null)),Ta(()=>t(!0))}else{let r=Uo(e.isSVG?`g`:`div`,e.isSVG),i=t&&r.attachShadow?r.attachShadow({mode:`open`}):r;Object.defineProperty(r,"_$host",{get(){return n.parentNode},configurable:!0}),Mo(i,a),o.appendChild(r),e.ref&&e.ref(r),Ta(()=>o.removeChild(r))}},void 0,{render:!0}),n}function Go(e,t){let n=I(e);return I(()=>{let e=n();switch(typeof e){case`function`:return L(()=>e(t));case`string`:let n=vo.has(e),r=Uo(e,n);return Ao(r,t,n),r}})}function Ko(e){let[,t]=so(e,[`component`]);return Go(()=>e.component,t)}var W=(e=>(e.DARK=`DARK`,e.LIGHT=`LIGHT`,e))(W||{}),qo={data:``},Jo=e=>typeof window==`object`?((e?e.querySelector(`#_goober`):window._goober)||Object.assign((e||document.head).appendChild(document.createElement(`style`)),{innerHTML:` `,id:`_goober`})).firstChild:e||qo,Yo=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Xo=/\/\*[^]*?\*\/| +/g,Zo=/\n+/g,Qo=(e,t)=>{let n=``,r=``,i=``;for(let a in e){let o=e[a];a[0]==`@`?a[1]==`i`?n=a+` `+o+`;`:r+=a[1]==`f`?Qo(o,a):a+`{`+Qo(o,a[1]==`k`?``:t)+`}`:typeof o==`object`?r+=Qo(o,t?t.replace(/([^,])+/g,e=>a.replace(/(^:.*)|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+` `+t:t)):a):o!=null&&(a=/^--/.test(a)?a:a.replace(/[A-Z]/g,`-$&`).toLowerCase(),i+=Qo.p?Qo.p(a,o):a+`:`+o+`;`)}return n+(t&&i?t+`{`+i+`}`:i)+r},$o={},es=e=>{if(typeof e==`object`){let t=``;for(let n in e)t+=n+es(e[n]);return t}return e},ts=(e,t,n,r,i)=>{let a=es(e),o=$o[a]||($o[a]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return`go`+n})(a));if(!$o[o]){let t=a===e?(e=>{let t,n,r=[{}];for(;t=Yo.exec(e.replace(Xo,``));)t[4]?r.shift():t[3]?(n=t[3].replace(Zo,` `).trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(Zo,` `).trim();return r[0]})(e):e;$o[o]=Qo(i?{[`@keyframes `+o]:t}:t,n?``:`.`+o)}let s=n&&$o.g?$o.g:null;return n&&($o.g=$o[o]),((e,t,n,r)=>{r?t.data=t.data.replace(r,e):t.data.indexOf(e)===-1&&(t.data=n?e+t.data:t.data+e)})($o[o],t,r,s),o},ns=(e,t,n)=>e.reduce((e,r,i)=>{let a=t[i];if(a&&a.call){let e=a(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;a=t?`.`+t:e&&typeof e==`object`?e.props?``:Qo(e,``):!1===e?``:e}return e+r+(a??``)},``);function rs(e){let t=this||{},n=e.call?e(t.p):e;return ts(n.unshift?n.raw?ns(n,[].slice.call(arguments,1),t.p):n.reduce((e,n)=>Object.assign(e,n&&n.call?n(t.p):n),{}):n,Jo(t.target),t.g,t.o,t.k)}rs.bind({g:1});var is=rs.bind({k:1}),as=Na();function os(e){return R(as.Provider,{value:e.theme,get children(){return e.children}})}function G(){return Pa(as)}function ss(e){let t=this||{};return(...n)=>{let r=r=>{let i=oo(r,{theme:Pa(as)}),[a,o]=so(oo(i,{get class(){let e=i.class,r=`class`in i&&/^go[0-9]+/.test(e);return[e,rs.apply({target:t.target,o:r,p:i,g:t.g},n)].filter(Boolean).join(` `)}}),[`as`,`theme`]),s=o,c=a.as||e,l;return typeof c==`function`?l=c(s):t.g==1?(l=document.createElement(c),Ao(l,s)):l=Ko(oo({component:c},s)),l};return r.class=e=>L(()=>rs.apply({target:t.target,p:e,g:t.g},n)),r}}var K=new Proxy(ss,{get(e,t){return e(t)}});function cs(){let e=ss.call({g:1},`div`).apply(null,arguments);return function(t){return e(t),null}}var ls=`tc-root`,us=`tc-disable-scroll`,ds=`tc-using-mouse`,fs=()=>(document.body.addEventListener(`mousedown`,()=>document.body.classList.add(ds)),document.body.addEventListener(`keydown`,e=>{e.key===`Tab`&&document.body.classList.remove(ds)}),R(cs`
|
|
3
|
-
${ls} * {
|
|
4
|
-
margin: 0;
|
|
5
|
-
padding: 0;
|
|
6
|
-
box-sizing: border-box;
|
|
7
|
-
|
|
8
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, Tahoma, Verdana, sans-serif;
|
|
9
|
-
-webkit-font-smoothing: antialiased;
|
|
10
|
-
-moz-osx-font-smoothing: grayscale;
|
|
11
|
-
-webkit-tap-highlight-color: transparent;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
${ls} img {
|
|
15
|
-
-webkit-user-select: none;
|
|
16
|
-
-webkit-touch-callout: none;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
${ls} *:focus {
|
|
20
|
-
outline: #08f auto 2px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
${ls} li {
|
|
24
|
-
list-style: none;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
${ls} button {
|
|
28
|
-
outline: none;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
body.${us} {
|
|
32
|
-
position: fixed;
|
|
33
|
-
overflow-y: scroll;
|
|
34
|
-
right: 0;
|
|
35
|
-
left: 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
body.${ds} ${ls} *:focus {
|
|
39
|
-
outline: none;
|
|
40
|
-
}
|
|
41
|
-
`,{}));function ps(e){e[0]===`#`&&(e=e.slice(1));let t=parseInt(e,16);return[t>>16&255,t>>8&255,t&255].join(`,`)}function ms(e,t){return e[0]===`#`&&(e=ps(e)),`rgba(${e}, ${t})`}function hs(e){return e.toString()+`px`}var gs=class e{constructor(){this.storage={}}static getInstance(){return e.instance||=new e,e.instance}get length(){return Object.keys(this.storage).length}clear(){this.storage={}}getItem(e){return this.storage[e]??null}key(e){let t=Object.keys(this.storage);return e<0||e>=t.length?null:t[e]??null}removeItem(e){delete this.storage[e]}setItem(e,t){this.storage[e]=t}},_s=class extends T{constructor(...e){super(...e)}};_s.errorName=`TonConnectUIError`;var vs=_s;function ys(){return Di()?ki():null}function bs(){Cs(`web_app_expand`,{})}function xs(e,t){e.length>Rs&&(e=js(e));let n=new URL(e);if(n.protocol!==`http:`&&n.protocol!==`https:`){if(t)return t();throw new vs(`Url protocol is not supported: ${n}`)}if(n.hostname!==`t.me`){if(t)return t();throw new vs(`Url host is not supported: ${n}`)}let r=n.pathname+n.search;Ss()||Ts(`6.1`)?(Fc({link:r,type:`tg_link`}),Cs(`web_app_open_tg_link`,{path_full:r})):J(`https://t.me`+r)}function Ss(){try{let e=Xs();return e?e.parent!=null&&e!==e.parent:!1}catch{return!1}}function Cs(e,t){try{let n=Xs();if(!n)throw new vs(`Can't post event to parent window: window is not defined`);if(n.TelegramWebviewProxy!==void 0)n.TelegramWebviewProxy.postEvent(e,JSON.stringify(t));else if(n.external&&`notify`in n.external)n.external.notify(JSON.stringify({eventType:e,eventData:t}));else if(Ss()){let r=JSON.stringify({eventType:e,eventData:t});n.parent.postMessage(r,`*`)}else throw new vs(`Can't post event to TMA`)}catch(e){`${e}`}}function ws(e,t){typeof e!=`string`&&(e=``);let n=e.replace(/^\s+|\s+$/g,``).split(`.`),r=t.replace(/^\s+|\s+$/g,``).split(`.`),i,a,o,s;for(i=Math.max(n.length,r.length),a=0;a<i;a++)if(o=parseInt(n[a])||0,s=parseInt(r[a])||0,o!==s)return o>s?1:-1;return 0}function Ts(e){return ws(ki(),e)>=0}function q(e,t){let n;n=typeof t==`string`?t:Di()?t.twaReturnUrl||t.returnStrategy:`none`;let r=ks(e,`ret`,n);if(!yt(e))return r;let i=r.slice(r.lastIndexOf(`&`)+1);return r.slice(0,r.lastIndexOf(`&`))+`-`+xt(i)}function Es(e,t){t=O({},t);let n=Ps(e),r=new URL(n);if(r.searchParams.has(`startapp`)||r.searchParams.append(`startapp`,`tonconnect`),Oi())t.returnStrategy=`back`,J(q(r.toString(),t.returnStrategy));else if(Di())Ei(`ios`,`android`,`macos`,`tdesktop`,`web`)?(t.returnStrategy=`back`,xs(q(r.toString(),t.returnStrategy))):Ei(`weba`)?xs(q(r.toString(),t)):J(q(r.toString(),t));else if(nc(`ios`)){t.returnStrategy===`back`&&(Y(`safari`)?t.returnStrategy=`back`:Y(`chrome`)?t.returnStrategy=`googlechrome://`:Y(`firefox`)?t.returnStrategy=`firefox://`:Y(`opera`)?t.returnStrategy=`opera-http://`:t.returnStrategy=location.href);let e=Y(`chrome`),n=Y(`firefox`);if((e||n)&&!t.forceRedirect){let e=q(r.toString(),t.returnStrategy);Bs(Ls(e),()=>J(e))}else J(q(r.toString(),t.returnStrategy))}else if(nc(`android`)){t.returnStrategy=`back`;let e=Y(`chrome`),n=Y(`firefox`);if((e||n)&&!t.forceRedirect){let e=q(r.toString(),t.returnStrategy);Bs(Ls(e),()=>J(e))}else J(q(r.toString(),t.returnStrategy))}else if(nc(`ipad`)){t.returnStrategy===`back`&&(Y(`safari`)?t.returnStrategy=`back`:Y(`chrome`)?t.returnStrategy=`googlechrome://`:Y(`firefox`)?t.returnStrategy=`firefox://`:Y(`opera`)?t.returnStrategy=`opera-http://`:t.returnStrategy=location.href);let e=Y(`chrome`),n=Y(`firefox`),i=(e||n)&&!t.forceRedirect,a=q(r.toString(),t.returnStrategy);i?Bs(Ls(a),()=>J(a)):J(a)}else if(nc(`macos`,`windows`,`linux`)){t.returnStrategy=`back`,t.twaReturnUrl=void 0;let e=q(r.toString(),t.returnStrategy);t.forceRedirect?J(e):Bs(Ls(e),()=>J(e))}else J(q(r.toString(),t))}function Ds(e,t,n,r){if(n=O({},n),Oi())nc(`ios`,`android`)?(n.returnStrategy===`back`&&(n.returnStrategy=`tg://resolve`),r(`universal-link`),zs(q(e,n.returnStrategy),`_self`)):(r(`universal-link`),J(q(e,n.returnStrategy)));else if(Di()){if(Ei(`ios`,`android`)){n.returnStrategy===`back`&&(n.returnStrategy=`tg://resolve`),r(`universal-link`);let t=q(e,n.returnStrategy);xs(t,()=>{r(`universal-link`),J(t)})}else if(Ei(`macos`,`tdesktop`)){n.returnStrategy===`back`&&(n.returnStrategy=`tg://resolve`);let i=q(e,n.returnStrategy);t&&!n.forceRedirect?(r(`custom-deeplink`),Bs(rc(i,t),()=>{r(`universal-link`),J(i)})):(r(`universal-link`),J(i))}else if(Ei(`weba`)){n.returnStrategy===`back`&&(Y(`safari`)?n.returnStrategy=location.href:Y(`chrome`)?n.returnStrategy=`googlechrome://`:Y(`firefox`)?n.returnStrategy=`firefox://`:Y(`opera`)?n.returnStrategy=`opera-http://`:n.returnStrategy=location.href);let i=q(e,n.returnStrategy);t&&!n.forceRedirect?(r(`custom-deeplink`),Bs(rc(i,t),()=>{r(`universal-link`),J(i)})):(r(`universal-link`),J(i))}else if(Ei(`web`)){n.returnStrategy===`back`&&(Y(`safari`)?n.returnStrategy=location.href:Y(`chrome`)?n.returnStrategy=`googlechrome://`:Y(`firefox`)?n.returnStrategy=`firefox://`:Y(`opera`)?n.returnStrategy=`opera-http://`:n.returnStrategy=location.href);let i=q(e,n.returnStrategy);t&&!n.forceRedirect?(r(`custom-deeplink`),Bs(rc(i,t),()=>{r(`universal-link`),J(i)})):(r(`universal-link`),J(i))}else r(`universal-link`),J(q(e,n.returnStrategy))}else if(nc(`ios`))n.returnStrategy===`back`&&(Y(`safari`)?n.returnStrategy=`none`:Y(`chrome`)?n.returnStrategy=`googlechrome://`:Y(`firefox`)?n.returnStrategy=`firefox://`:Y(`opera`)?n.returnStrategy=`opera-http://`:n.returnStrategy=location.href),Y(`chrome`)?(r(`universal-link`),zs(q(e,n.returnStrategy),`_self`)):(r(`universal-link`),J(q(e,n.returnStrategy)));else if(nc(`android`))n.returnStrategy===`back`&&(Y(`chrome`)?n.returnStrategy=`googlechrome://`:Y(`firefox`)?n.returnStrategy=`firefox://`:Y(`opera`)?n.returnStrategy=`opera-http://`:n.returnStrategy=location.href),r(`universal-link`),J(q(e,n.returnStrategy));else if(nc(`ipad`))n.returnStrategy===`back`&&(Y(`safari`)?n.returnStrategy=`none`:Y(`chrome`)?n.returnStrategy=`googlechrome://`:Y(`firefox`)?n.returnStrategy=`firefox://`:Y(`opera`)?n.returnStrategy=`opera-http://`:n.returnStrategy=location.href),Y(`chrome`)?(r(`universal-link`),zs(q(e,n.returnStrategy),`_self`)):(r(`universal-link`),J(q(e,n.returnStrategy)));else if(nc(`macos`,`windows`,`linux`)){n.returnStrategy===`back`&&(Y(`safari`)?n.returnStrategy=`none`:Y(`chrome`)?n.returnStrategy=`googlechrome://`:Y(`firefox`)?n.returnStrategy=`firefox://`:Y(`opera`)?n.returnStrategy=`opera-http://`:n.returnStrategy=`none`);let i=q(e,n.returnStrategy);t&&!n.forceRedirect?(r(`custom-deeplink`),Bs(rc(i,t),()=>{r(`universal-link`),J(i)})):(r(`universal-link`),J(i))}else r(`universal-link`),J(q(e,n.returnStrategy))}function Os(e,t){if(!yt(e))return As(e,{id:t.sessionId,trace_id:t.traceId});let n=Ps(e),r=new URL(n),i=Fs(St(r.searchParams.get(`startapp`)??``)),a=t.sessionId??i.get(`id`),o=t.traceId,s=[`tonconnect`,`v`,`id`,`trace_id`],c=Array.from(i.entries()).filter(([e])=>!s.includes(e)),l=Is(k(O({tonconnect:``,v:`2`,id:a},Object.fromEntries(c)),{trace_id:o})).replace(`=&`,`&`);return r.searchParams.set(`startapp`,xt(l)),r.toString()}function ks(e,t,n){let r=new URL(e);return r.searchParams.append(t,n),r.toString()}function As(e,t){let n=new URL(e);for(let[e,r]of Object.entries(t))r!=null&&n.searchParams.set(e,r);return n.toString()}function js(e){return Ms(e,[`e`])}function Ms(e,t){if(!yt(e))return Ns(e,t);let n=Ps(e),r=new URL(n),i=Fs(St(r.searchParams.get(`startapp`)??``));for(let e of t)i.delete(e);let a=i.toString().replace(`=&`,`&`);return r.searchParams.set(`startapp`,xt(a)),r.toString()}function Ns(e,t){let n=new URL(e);for(let e of t)n.searchParams.delete(e);return n.toString()}function Ps(e){let t=new URL(e);return t.searchParams.has(`attach`)&&(t.searchParams.delete(`attach`),t.pathname+=`/start`),t.toString()}function Fs(e=``){let t=new URL(`https://example.com`);return t.search=e,t.searchParams}function Is(e){let t=Fs();for(let[n,r]of Object.entries(e))r!=null&&t.append(n,r);return t.toString()}function Ls(e){let t=new URL(e),[,n,r]=t.pathname.split(`/`),i=t.searchParams.get(`startapp`);return`tg://resolve?domain=${n}${r?`&appname=${r}`:``}&startapp=${i}`}var Rs=1024;function zs(e,t=`_self`){e.length>Rs&&(e=js(e)),Fc({link:e}),window.open(e,t,`noopener noreferrer`)}function J(e){zs(e,`_blank`)}function Bs(e,t){let n=()=>{Y(`safari`)||nc(`android`)&&Y(`firefox`)||nc(`windows`)||t()},r=setTimeout(()=>n(),200);window.addEventListener(`blur`,()=>clearTimeout(r),{once:!0}),zs(e,`_self`)}function Vs(){return window.matchMedia&&window.matchMedia(`(prefers-color-scheme: light)`).matches?W.LIGHT:W.DARK}function Hs(e){let t=t=>e(t.matches?W.DARK:W.LIGHT);return window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,t),()=>window.matchMedia(`(prefers-color-scheme: dark)`).removeEventListener(`change`,t)}function Us(){document.documentElement.scrollHeight!==document.documentElement.clientHeight&&(document.body.style.top=hs(-document.documentElement.scrollTop),document.body.classList.add(us))}function Ws(){document.body.classList.contains(us)&&(document.body.classList.remove(us),document.documentElement.scrollTo({top:-parseFloat(getComputedStyle(document.body).top)}),document.body.style.top=`auto`)}function Gs(){document.body.hasAttribute(`ontouchstart`)||document.body.setAttribute(`ontouchstart`,``)}function Ks(){customElements.get(`tc-root`)||customElements.define(ls,class extends HTMLElement{})}function qs(e){return A(this,null,function*(){yield new Promise(e=>requestAnimationFrame(e)),e()})}function Js(e){return A(this,null,function*(){return yield new Promise(e=>requestAnimationFrame(e)),e()})}function Ys(e){document.readyState===`complete`?e.forEach(e=>{let t=new window.Image;t.src=e}):window.addEventListener(`load`,()=>qs(()=>Ys(e)),{once:!0})}function Xs(){if(typeof window<`u`)return window}function Zs(){if(Qs())return localStorage;if($s())throw new vs("`localStorage` is unavailable, but it is required for TonConnect. For more details, see https://github.com/ton-connect/sdk/tree/main/packages/sdk#init-connector");return gs.getInstance()}function Qs(){try{return typeof localStorage<`u`}catch{return!1}}function $s(){return n!==void 0&&n.versions!=null&&n.versions.node!=null}function ec(){let e=!1;return(function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.slice(0,4)))&&(e=!0)})(navigator.userAgent||navigator.vendor||window.opera),e}function tc(){let e=new qi.default().getResult(),t=e.os.name?.toLowerCase(),n=e.device.model?.toLowerCase(),r;switch(!0){case n===`ipad`:r=`ipad`;break;case t===`ios`:r=`ios`;break;case t===`android`:r=`android`;break;case t===`mac os`:r=`macos`;break;case t===`linux`:r=`linux`;break;case t?.includes(`windows`):r=`windows`}let i=e.browser.name?.toLowerCase(),a;switch(!0){case i===`chrome`:a=`chrome`;break;case i===`firefox`:a=`firefox`;break;case i?.includes(`safari`):a=`safari`;break;case i?.includes(`opera`):a=`opera`}return{os:r,browser:a}}function nc(...e){return e.includes(tc().os)}function Y(...e){return e.includes(tc().browser)}function rc(e,t){return t+new URL(e).search}var ic=class{constructor(){this.storageKey=`ton-connect-ui_wallet-info`,this.localStorage=Zs()}setWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getWalletInfo(){let e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeWalletInfo(){this.localStorage.removeItem(this.storageKey)}},ac=class{constructor(){this.storageKey=`ton-connect-ui_preferred-wallet`,this.localStorage=Zs()}setPreferredWalletAppName(e){this.localStorage.setItem(this.storageKey,e)}getPreferredWalletAppName(){return this.localStorage.getItem(this.storageKey)||void 0}},oc=class{constructor(){this.storageKey=`ton-connect-ui_last-selected-wallet-info`,this.localStorage=Zs()}setLastSelectedWalletInfo(e){this.localStorage.setItem(this.storageKey,JSON.stringify(e))}getLastSelectedWalletInfo(){let e=this.localStorage.getItem(this.storageKey);return e?JSON.parse(e):null}removeLastSelectedWalletInfo(){this.localStorage.removeItem(this.storageKey)}},sc=`sendTransaction`,cc=`signData`,lc=`signMessage`,uc={[sc]:`confirm-transaction`,[cc]:`confirm-sign-data`,[lc]:`confirm-sign-message`},dc={[sc]:`transaction-sent`,[cc]:`data-signed`,[lc]:`message-signed`},fc={[sc]:`transaction-canceled`,[cc]:`sign-data-canceled`,[lc]:`sign-message-canceled`},pc=new Set(Object.values(uc)),mc=new Set(Object.values(dc)),hc=new Set(Object.values(fc));function gc(e){return pc.has(e.name)}function _c(e){return mc.has(e.name)}function vc(e){return hc.has(e.name)}var[yc,bc]=N({status:`closed`,closeReason:null}),xc=I(()=>yc().status===`opened`),[Sc,Cc]=N({status:`closed`,closeReason:null}),wc=I(()=>Sc().status===`opened`),Tc=I(()=>{let e=Sc();return e.status===`opened`?e.walletInfo:null}),Ec=typeof window<`u`?new oc:void 0,[Dc,Oc]=N(Ec?.getLastSelectedWalletInfo()||null),kc=e=>{Ec||=new oc,e?Ec.setLastSelectedWalletInfo(e):Ec.removeLastSelectedWalletInfo(),Oc(e)},[Ac,jc]=N(null),[Mc,Nc]=N({walletsMenu:`explicit_wallet`,wallets:[]}),[Pc,Fc]=N({link:``}),Ic={en:Lc({common:{close:`Close`,openWallet:`Open wallet`,copyLink:`Copy Link`,linkCopied:`Link Copied`,copied:`Copied`,yourWallet:`Your Wallet`,retry:`Retry`,get:`GET`,mobile:`Mobile`,browserExtension:`Browser Extension`,desktop:`Desktop`,connectTelegram:`Connect Telegram`},button:{connectWallet:`Connect Wallet`,dropdown:{copy:`Copy address`,copied:`Address copied!`,disconnect:`Disconnect`}},notifications:{confirmTransaction:{header:`Open {{ name }} to\xA0confirm the\xA0transaction.`},confirmSignData:{header:`Open {{ name }} to\xA0confirm the\xA0data signing.`},confirmSignMessage:{header:`Open {{ name }} to\xA0confirm the\xA0message signing.`},transactionSent:{header:`Transaction sent`,text:`Your transaction\xA0will be\xA0processed in\xA0a\xA0few seconds.`},transactionCanceled:{header:`Transaction canceled`,text:`There will be no changes to\xA0your account.`},dataSigned:{header:`Data signed`},signDataCanceled:{header:`Sign data canceled`},messageSigned:{header:`Message signed`},signMessageCanceled:{header:`Sign message canceled`}},walletItem:{recent:`Recent`,installed:`Installed`,new:`New`},walletModal:{loading:`Loading wallets`,wallets:`Wallets`,mobileUniversalModal:{connectYourWallet:`Connect your TON\xA0wallet`,useTelegramWallet:`Use your Telegram wallet`,chooseOtherApplication:`Or choose another app:`,chooseApplication:`Choose an app:`,openLink:`Open Link`,scan:`Scan with your mobile\xA0wallet`},desktopUniversalModal:{connectYourWallet:`Connect your TON wallet`,scan:`Scan with your mobile wallet`,availableWallets:`Available wallets`},mobileConnectionModal:{showQR:`Show QR Code`,scanQR:`Scan the\xA0QR code below with your phone’s\xA0or\xA0{{ name }}’s camera`,missingFeatures:`Please update {{ name }}, your version does not support required features for this dApp`,wrongNetwork:`Connected wallet is on a different network. Please switch network in {{ name }} and try again`,notSupportedWallet:`{{ name }} doesn’t support the requested action. Please connect another wallet that supports it`,continueIn:`Continue in {{ name }}…`,updateWallet:`Update {{ name }}`,chooseAnotherWallet:`Choose Another Wallet`,connectionDeclined:`Connection declined`},desktopConnectionModal:{scanQR:`Scan the\xA0QR code below with your phone’s\xA0or\xA0{{ name }}’s camera`,continueInExtension:`Continue in\xA0{{ name }} browser extension…`,dontHaveExtension:`Seems you don't have installed {{ name }}\xA0browser\xA0extension`,missingFeatures:`Please update {{ name }}, your version does not support required features for this dApp`,wrongNetwork:`Connected wallet is on a different network. Please switch network in {{ name }} and try again`,notSupportedWallet:`{{ name }} doesn’t support the requested action. Please connect another wallet that supports it`,getWallet:`Get {{ name }}`,updateWallet:`Update {{ name }}`,chooseAnotherWallet:`Choose Another Wallet`,continueOnDesktop:`Continue in\xA0{{ name }} on desktop…`,connectionDeclined:`Connection declined`},infoModal:{whatIsAWallet:`What is a wallet`,secureDigitalAssets:`Secure digital assets storage`,walletProtects:`A wallet protects and manages your digital assets\xA0including TON, tokens and collectables.`,controlIdentity:`Control your Web3 identity`,manageIdentity:`Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in\xA0the\xA0blockchain ecosystem.`,effortlessCryptoTransactions:`Effortless crypto transactions`,easilySend:`Easily send, receive, monitor your cryptocurrencies.\xA0Streamline your operations with\xA0decentralized applications.`,getAWallet:`Get a Wallet`},restoreModal:{title:`Restore`,step1:{title:`Find your current recovery phrase`,text:`Open your wallet settings and locate the\xA0recovery\xA0phrase`},step2:{title:`Copy your recovery phrase`,text:`Write it down or copy it to a safe place`},step3:{title:`Restore in a supported wallet`,text:`Enter the recovery phrase to access your wallet`}},allWallets:{walletsBelowNotSupported:`The wallets below don’t support all features of\xA0the connected service. You can use your recovery phrase in one of the supported wallets above.`,walletNotSupportService:`{{ name }} doesn’t support connected service`},featureNotSupported:{wallet:{title:`{{ name }} doesn’t support the requested\xA0action`,description:`Install a supported wallet from the list below, restore it with your recovery phrase, then connect it and try again.`,info:`Learn how to restore your wallet`},version:{description:`Your current version of {{ name }} or wallet contract type doesn't support the required features. Please update it to continue.`,updateButton:`Update {{ name }}`,aboutW5:`About W5`},disconnect:{title:`Confirm Disconnect`,description:`You will be disconnected from your current wallet and redirected to connect {{ name }}.`,button:`Disconnect`}}},actionModal:{confirmTransaction:{header:`Confirm the\xA0transaction in\xA0{{ name }}`,text:`It will only take a\xA0moment.`},signData:{header:`Sign the\xA0data in\xA0{{ name }}`,text:`It will only take a\xA0moment.`},transactionSent:`$notifications.transactionSent`,transactionCanceled:`$notifications.transactionCanceled`,signMessage:{header:`Sign the\xA0message in\xA0{{ name }}`,text:`It will only take a\xA0moment.`},dataSigned:`$notifications.dataSigned`,signDataCanceled:`$notifications.signDataCanceled`,messageSigned:`$notifications.messageSigned`,signMessageCanceled:`$notifications.signMessageCanceled`}}),ru:Lc({common:{close:`Закрыть`,openWallet:`Открыть кошелёк`,copyLink:`Скопировать`,linkCopied:`Ссылка скопирована`,copied:`Скопировано`,yourWallet:`Ваш кошелёк`,retry:`Повторить`,get:`Скачать`,mobile:`Мобильный`,browserExtension:`Расширение`,desktop:`Десктоп`,connectTelegram:`Подключить Telegram`},button:{connectWallet:`Подключить кошелёк`,dropdown:{copy:`Скопировать адрес`,copied:`Адрес скопирован!`,disconnect:`Отключить кошелёк`}},notifications:{confirmTransaction:{header:`Откройте {{ name }}, чтобы\xA0подтвердить транзакцию.`},confirmSignData:{header:`Откройте {{ name }}, чтобы\xA0подтвердить подпись данных.`},confirmSignMessage:{header:`Откройте {{ name }}, чтобы\xA0подтвердить подпись сообщения.`},transactionSent:{header:`Транзакция отправлена`,text:`Ваша транзакция\xA0будет обработана через\xA0несколько секунд.`},transactionCanceled:{header:`Транзакция отменена`,text:`Состояние вашего счёта не\xA0изменится.`},dataSigned:{header:`Данные подписаны`},signDataCanceled:{header:`Подпись данных отменена`},messageSigned:{header:`Сообщение подписано`},signMessageCanceled:{header:`Подпись сообщения отменена`}},walletItem:{recent:`Недавний`,installed:`Установлен`,new:`Новый`},walletModal:{loading:`Кошельки загружаются`,wallets:`Кошельки`,mobileUniversalModal:{connectYourWallet:`Подключите TON-кошелёк`,useTelegramWallet:`Используйте свой Telegram-кошелёк`,chooseOtherApplication:`Или\xA0выберите другое приложение:`,chooseApplication:`Выберите приложение:`,openLink:`Открыть`,scan:`Отсканируйте камерой вашего\xA0телефона`},desktopUniversalModal:{connectYourWallet:`Подключите TON-кошелёк`,scan:`Отсканируйте QR-код камерой вашего\xA0телефона`,availableWallets:`Доступные кошельки`},mobileConnectionModal:{showQR:`Показать QR-код`,scanQR:`Отсканируйте QR-код ниже камерой в\xA0приложении {{ name }}, или\xA0камерой телефона`,missingFeatures:`Обновите {{ name }}, ваша версия не поддерживает необходимые функции для этого dApp`,wrongNetwork:`Подключённый кошелёк находится в другой сети. Пожалуйста, переключите сеть в {{ name }} и попробуйте снова`,notSupportedWallet:`{{ name }} не поддерживает запрошенное действие. Пожалуйста, подключите другой кошелёк, который поддерживает это`,continueIn:`Продолжите в {{ name }}…`,updateWallet:`Обновить {{ name }}`,chooseAnotherWallet:`Выбрать другой кошелёк`,connectionDeclined:`Подключение отклонено`},desktopConnectionModal:{scanQR:`Отсканируйте QR-код ниже камерой в\xA0приложении {{ name }}, или\xA0камерой телефона`,continueInExtension:`Откройте браузерное расширение {{ name }}`,dontHaveExtension:`Похоже, у вас не\xA0установлено браузерное\xA0расширение\xA0{{ name }}`,missingFeatures:`Обновите {{ name }}, ваша версия не поддерживает необходимые функции для этого dApp`,wrongNetwork:`Подключённый кошелёк находится в другой сети. Пожалуйста, переключите сеть в {{ name }} и попробуйте снова`,notSupportedWallet:`{{ name }} не поддерживает запрошенное действие. Пожалуйста, подключите другой кошелёк, который поддерживает это`,getWallet:`Скачать {{ name }}`,updateWallet:`Обновить {{ name }}`,chooseAnotherWallet:`Выбрать другой кошелёк`,continueOnDesktop:`Откройте {{ name }} на\xA0компьютере…`,connectionDeclined:`Подключение отклонено`},infoModal:{whatIsAWallet:`Что такое кошелёк?`,secureDigitalAssets:`Надежное хранилище цифровых активов`,walletProtects:`Кошелёк защищает ваши цифровые активы, включая TON, токены и\xA0предметы коллекционирования, и\xA0управляет ими.`,controlIdentity:`Контроль своей личности Web3`,manageIdentity:`Управляйте своей цифровой идентификацией и\xA0с\xA0легкостью получайте доступ к\xA0децентрализованным приложениям. Сохраняйте контроль над\xA0своими данными и\xA0безопасно участвуйте в\xA0экосистеме\xA0блокчейна.`,effortlessCryptoTransactions:`Простые криптотранзакции`,easilySend:`Легко отправляйте, получайте и\xA0отслеживайте свои криптовалюты. Оптимизируйте свои операции с\xA0помощью децентрализованных приложений.`,getAWallet:`Скачать кошелёк`},restoreModal:{title:`Восстановление`,step1:{title:`Найдите вашу текущую фразу восстановления`,text:`Откройте настройки кошелька и найдите фразу\xA0восстановления`},step2:{title:`Скопируйте вашу фразу восстановления`,text:`Запишите её или сохраните в безопасном месте`},step3:{title:`Восстановите в поддерживаемом кошельке`,text:`Введите фразу восстановления для доступа\xA0к\xA0вашему\xA0кошельку`}},allWallets:{walletsBelowNotSupported:`Кошельки ниже не поддерживают все функции подключённого сервиса. Вы можете использовать свою фразу восстановления в одном из поддерживаемых выше кошельков.`,walletNotSupportService:`{{ name }} не поддерживает подключённый сервис`},featureNotSupported:{wallet:{title:`{{ name }} не поддерживает запрошенное\xA0действие`,description:`Установите поддерживаемый кошелёк из списка ниже, восстановите его с помощью фразы восстановления, затем подключитесь и попробуйте снова.`,info:`Узнать, как восстановить кошелёк`},version:{description:`Текущая версия {{ name }} или тип контракта кошелька не поддерживает необходимые функции. Обновите кошелёк, чтобы продолжить.`,updateButton:`Обновить {{ name }}`,aboutW5:`Про W5`},disconnect:{title:`Подтвердите отключение`,description:`Вы будете отключены от текущего кошелька и перенаправлены на подключение {{ name }}.`,button:`Отключиться`}}},actionModal:{confirmTransaction:{header:`Подтвердите действие в\xA0{{ name }}`,text:`Это займет пару секунд.`},signData:{header:`Подпишите данные в\xA0{{ name }}`,text:`Это займет пару секунд.`},transactionSent:`$notifications.transactionSent`,transactionCanceled:`$notifications.transactionCanceled`,signMessage:{header:`Подпишите сообщение в\xA0{{ name }}`,text:`Это займет пару секунд.`},dataSigned:`$notifications.dataSigned`,signDataCanceled:`$notifications.signDataCanceled`,messageSigned:`$notifications.messageSigned`,signMessageCanceled:`$notifications.signMessageCanceled`}})};function Lc(e){let t=n=>{Object.entries(n).forEach(([r,i])=>{if(typeof i==`object`&&i)return t(i);if(typeof i==`string`){if(i[0]===`$`){let t=i.slice(1).split(`.`),a=e;t.forEach(e=>{if(e in a)a=a[e];else throw Error(`Cannot parse translations: there is no property ${e} in translation`)}),n[r]=a}i.slice(0,2)===`\\$`&&(n[r]=i.slice(1))}})};return t(e),e}var Rc=Na(),zc=Symbol(`store-raw`),Bc=Symbol(`store-node`),Vc=Symbol(`store-has`),Hc=Symbol(`store-self`);function Uc(e){let t=e[oa];if(!t&&(Object.defineProperty(e,oa,{value:t=new Proxy(e,Zc)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;i<a;i++){let a=n[i];r[a].get&&Object.defineProperty(e,a,{enumerable:r[a].enumerable,get:r[a].get.bind(t)})}}return t}function Wc(e){let t;return typeof e==`object`&&!!e&&(e[oa]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Gc(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[zc])return n;if(!Wc(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,a=e.length;n<a;n++)i=e[n],(r=Gc(i,t))!==i&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let s=0,c=n.length;s<c;s++)a=n[s],!o[a].get&&(i=e[a],(r=Gc(i,t))!==i&&(e[a]=r))}return e}function Kc(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function qc(e,t,n){if(e[t])return e[t];let[r,i]=N(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function Jc(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===oa||t===Bc?n:(delete n.value,delete n.writable,n.get=()=>e[oa][t],n)}function Yc(e){Ea()&&qc(Kc(e,Bc),Hc)()}function Xc(e){return Yc(e),Reflect.ownKeys(e)}var Zc={get(e,t,n){if(t===zc)return e;if(t===oa)return n;if(t===ca)return Yc(e),n;let r=Kc(e,Bc),i=r[t],a=i?i():e[t];if(t===Bc||t===Vc||t===`__proto__`)return a;if(!i){let n=Object.getOwnPropertyDescriptor(e,t);Ea()&&(typeof a!=`function`||e.hasOwnProperty(t))&&!(n&&n.get)&&(a=qc(r,t,a)())}return Wc(a)?Uc(a):a},has(e,t){return t===zc||t===oa||t===ca||t===Bc||t===Vc||t===`__proto__`||(Ea()&&qc(Kc(e,Vc),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Xc,getOwnPropertyDescriptor:Jc};function Qc(e,t,n,r=!1){if(!r&&e[t]===n)return;let i=e[t],a=e.length;n===void 0?(delete e[t],e[Vc]&&e[Vc][t]&&i!==void 0&&e[Vc][t].$()):(e[t]=n,e[Vc]&&e[Vc][t]&&i===void 0&&e[Vc][t].$());let o=Kc(e,Bc),s;if((s=qc(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let t=e.length;t<a;t++)(s=o[t])&&s.$();(s=qc(o,`length`,a))&&s.$(e.length)}(s=o[Hc])&&s.$()}function $c(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];Qc(e,i,t[i])}}function el(e,t){if(typeof t==`function`&&(t=t(e)),t=Gc(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&Qc(e,n,r)}Qc(e,`length`,r)}else $c(e,t)}function tl(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();let a=typeof r,o=Array.isArray(e);if(Array.isArray(r)){for(let i=0;i<r.length;i++)tl(e,[r[i]].concat(t),n);return}if(o&&a===`function`){for(let i=0;i<e.length;i++)r(e[i],i)&&tl(e,[i].concat(t),n);return}if(o&&a===`object`){let{from:i=0,to:a=e.length-1,by:o=1}=r;for(let r=i;r<=a;r+=o)tl(e,[r].concat(t),n);return}if(t.length>1){tl(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a==`function`&&(a=a(i,n),a===i)||(r!==void 0||a!=null)&&(a=Gc(a),r===void 0||Wc(i)&&Wc(a)&&!Array.isArray(a)?$c(i,a):Qc(e,r,a))}function nl(...[e,t]){let n=Gc(e||{}),r=Array.isArray(n),i=Uc(n);function a(...e){Sa(()=>{r&&e.length===1?el(n,e[0]):tl(n,e)})}return[i,a]}var rl={constant:{black:`#000000`,white:`#FFFFFF`},connectButton:{background:`#0098EA`,foreground:`#FFFFFF`},accent:`#0098EA`,telegramButton:`#0098EA`,icon:{primary:`#0F0F0F`,secondary:`#7A8999`,tertiary:`#C1CAD2`,success:`#29CC6A`,error:`#F5A73B`},background:{primary:`#FFFFFF`,secondary:`#F1F3F5`,segment:`#FFFFFF`,tint:`#F1F3F5`,qr:`#F1F3F5`},text:{primary:`#0F0F0F`,secondary:`#6A7785`}},il={constant:{black:`#000000`,white:`#FFFFFF`},connectButton:{background:`#0098EA`,foreground:`#FFFFFF`},accent:`#E5E5EA`,telegramButton:`#0E9AF5`,icon:{primary:`#E5E5EA`,secondary:`#909099`,tertiary:`#434347`,success:`#29CC6A`,error:`#F5A73B`},background:{primary:`#121214`,secondary:`#18181A`,segment:`#262629`,tint:`#222224`,qr:`#FFFFFF`},text:{primary:`#E5E5EA`,secondary:`#7D7D85`}};function al(e){return Object.prototype.toString.call(e)===`[object Object]`}function ol(e){var t,n;return al(e)!==!1&&(t=e.constructor,t===void 0||(n=t.prototype,al(n)!==!1&&n.hasOwnProperty(`isPrototypeOf`)!==!1))}function sl(e,t){return e?(0,Ji.default)(t,e,{arrayMerge:(e,t,n)=>t,isMergeableObject:ol}):t}var[cl,ll]=nl({theme:W.LIGHT,colors:rl,borderRadius:`m`}),ul={[W.LIGHT]:rl,[W.DARK]:il},dl={[W.LIGHT]:void 0,[W.DARK]:void 0};function fl(e,t){t&&(dl[W.DARK]=sl(t[W.DARK],dl[W.DARK]),dl[W.LIGHT]=sl(t[W.LIGHT],dl[W.LIGHT])),ll({theme:e,colors:sl(dl[e],ul[e])})}function pl(e){ll({borderRadius:e})}function ml(e){dl[W.DARK]=sl(e[W.DARK],dl[W.DARK]),dl[W.LIGHT]=sl(e[W.LIGHT],dl[W.LIGHT]),ll(e=>({colors:sl(dl[e.theme],ul[e.theme])}))}var hl=K.div`
|
|
42
|
-
background-color: ${e=>e.theme.colors.background.secondary};
|
|
43
|
-
`,gl=e=>{let t,[n,r]=N(null);return F(()=>{let t=new window.Image;return t.src=e.src,t.alt=e.alt||``,t.setAttribute(`draggable`,`false`),e.class&&t.classList.add(e.class),t.complete?r(t):(t.addEventListener(`load`,()=>r(t)),()=>t.removeEventListener(`load`,()=>r(t)))}),[R(z,{get when(){return n()},get children(){return n()}}),R(z,{get when(){return!n()},get children(){return R(hl,{get class(){return e.class},ref(e){var n=t;typeof n==`function`?n(e):t=e}})}})]},_l={mobile:440,tablet:1020};function vl(e){let t=Xs();if(!t)return e===`desktop`;if(Ei(`weba`))return!0;let n=t.innerWidth;switch(e){case`desktop`:return n>_l.tablet;case`tablet`:return n>_l.mobile;default:case`mobile`:return n<=_l.mobile||nc(`ios`,`android`,`ipad`)}}function yl(e){switch(e){case`mobile`:return`@media (max-width: ${_l.mobile}px)`;case`tablet`:return`@media (max-width: ${_l.tablet}px) (min-width: ${_l.mobile}px)`;default:case`desktop`:return`@media (min-width: ${_l.tablet}px)`}}var bl=`@media (hover: none)`,xl=`@media not all and (hover: none)`,Sl={m:`100vh`,s:`8px`,none:`0`},Cl={s:.02,m:.04},wl=K.button`
|
|
44
|
-
display: ${e=>e.leftIcon||e.rightIcon?`flex`:`inline-block`};
|
|
45
|
-
gap: ${e=>e.leftIcon||e.rightIcon?`6px`:`unset`};
|
|
46
|
-
align-items: ${e=>e.leftIcon||e.rightIcon?`center`:`unset`};
|
|
47
|
-
justify-content: ${e=>e.leftIcon||e.rightIcon?`space-between`:`unset`};
|
|
48
|
-
background-color: ${e=>e.appearance===`flat`?`transparent`:e.appearance===`secondary`?e.theme.colors.background.tint:ms(e.theme.colors.accent,.12)};
|
|
49
|
-
color: ${e=>e.appearance===`secondary`?e.theme.colors.text.primary:e.theme.colors.accent};
|
|
50
|
-
|
|
51
|
-
padding: ${e=>e.appearance===`flat`?`0`:`9px 16px`};
|
|
52
|
-
padding-left: ${e=>e.leftIcon&&e.appearance!==`flat`?`12px`:`16px`};
|
|
53
|
-
padding-right: ${e=>e.rightIcon&&e.appearance!==`flat`?`12px`:`16px`};
|
|
54
|
-
border: none;
|
|
55
|
-
border-radius: ${e=>Sl[e.theme.borderRadius]};
|
|
56
|
-
cursor: ${e=>e.disabled?`not-allowed`:`pointer`};
|
|
57
|
-
|
|
58
|
-
font-size: 14px;
|
|
59
|
-
font-weight: 510;
|
|
60
|
-
line-height: 18px;
|
|
61
|
-
|
|
62
|
-
transition: transform 0.125s ease-in-out;
|
|
63
|
-
|
|
64
|
-
${xl} {
|
|
65
|
-
&:hover {
|
|
66
|
-
transform: ${e=>e.disabled?`unset`:`scale(${1+Cl[e.scale]})`};
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&:active {
|
|
71
|
-
transform: ${e=>e.disabled?`unset`:`scale(${1-Cl[e.scale]})`};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
${bl} {
|
|
75
|
-
&:active {
|
|
76
|
-
transform: ${e=>e.disabled?`unset`:`scale(${1-Cl[e.scale]*2})`};
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
`;function Tl(e){let[t]=so(e,L(()=>Object.keys(e).filter(e=>e.startsWith(`data-`))));return t}var X=e=>R(wl,oo({type:`button`,get appearance(){return e.appearance||`primary`},get class(){return e.class},onClick:t=>e.onClick?.call(e,t),onMouseEnter:t=>e.onMouseEnter?.call(e,t),onMouseLeave:t=>e.onMouseLeave?.call(e,t),ref(t){var n=e.ref;typeof n==`function`?n(t):e.ref=t},get disabled(){return e.disabled},get scale(){return e.scale||`m`},get leftIcon(){return!!e.leftIcon},get rightIcon(){return!!e.rightIcon},"data-tc-button":`true`},Tl(e),{get children(){return[V(()=>e.leftIcon),V(()=>e.children),V(()=>e.rightIcon)]}})),El={m:`100vh`,s:`100vh`,none:`0`},Dl=K.button`
|
|
80
|
-
display: flex;
|
|
81
|
-
align-items: center;
|
|
82
|
-
justify-content: center;
|
|
83
|
-
width: 100%;
|
|
84
|
-
height: 52px;
|
|
85
|
-
border-radius: ${e=>El[e.theme.borderRadius]};
|
|
86
|
-
padding: 0 16px;
|
|
87
|
-
border: none;
|
|
88
|
-
cursor: pointer;
|
|
89
|
-
|
|
90
|
-
transition: transform 0.125s ease-in-out;
|
|
91
|
-
|
|
92
|
-
${xl} {
|
|
93
|
-
&:hover {
|
|
94
|
-
transform: scale(1.02);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
&:active {
|
|
99
|
-
transform: scale(0.98);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
${bl} {
|
|
103
|
-
&:active {
|
|
104
|
-
transform: scale(0.96);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
`,Ol=K.span`
|
|
108
|
-
display: inline-flex;
|
|
109
|
-
align-items: center;
|
|
110
|
-
justify-content: center;
|
|
111
|
-
gap: 8px;
|
|
112
|
-
|
|
113
|
-
font-weight: 500;
|
|
114
|
-
font-size: 16px;
|
|
115
|
-
line-height: 20px;
|
|
116
|
-
`,kl=rs`
|
|
117
|
-
position: relative;
|
|
118
|
-
overflow: hidden;
|
|
119
|
-
|
|
120
|
-
&::before {
|
|
121
|
-
content: '';
|
|
122
|
-
|
|
123
|
-
position: absolute;
|
|
124
|
-
top: 0;
|
|
125
|
-
left: 0;
|
|
126
|
-
|
|
127
|
-
width: 100%;
|
|
128
|
-
height: 100%;
|
|
129
|
-
|
|
130
|
-
pointer-events: none;
|
|
131
|
-
|
|
132
|
-
opacity: var(--tc-shine-opacity, 1);
|
|
133
|
-
background: linear-gradient(
|
|
134
|
-
to right,
|
|
135
|
-
transparent 0%,
|
|
136
|
-
rgba(232, 232, 232, 0.3) 50%,
|
|
137
|
-
transparent 100%
|
|
138
|
-
);
|
|
139
|
-
|
|
140
|
-
animation: ${is`
|
|
141
|
-
0% {
|
|
142
|
-
transform: translateX(-100%);
|
|
143
|
-
}
|
|
144
|
-
37.5%,
|
|
145
|
-
100% {
|
|
146
|
-
transform: translateX(100%);
|
|
147
|
-
}
|
|
148
|
-
`} 2s ease-out infinite;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
@media (prefers-reduced-motion: reduce) {
|
|
152
|
-
&::before {
|
|
153
|
-
display: none;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
`,Al=e=>R(Dl,{type:`button`,get class(){return(0,Yi.default)(e.class,e.shiny&&kl)},get style(){return{"--tc-shine-opacity":e.shineOpacity?.toString()}},onClick:()=>e.onClick(),"data-tc-button":`true`,get children(){return R(Ol,{get children(){return[V(()=>e.icon),V(()=>e.children)]}})}}),jl=K(Al)`
|
|
157
|
-
background-color: ${e=>e.theme.colors.telegramButton};
|
|
158
|
-
color: ${e=>e.theme.colors.constant.white};
|
|
159
|
-
`,Ml=`data:image/webp;base64,UklGRrwhAABXRUJQVlA4WAoAAAAQAAAA/wEA/wEAQUxQSDMEAAABJyAQSOFmFxERg8TItt22+YBQAAMKYCoApFFAev13pQS8e67zj+i/JLeNBEly9IDwZG/2NbN3ax9Q7E/1P9X/VP9T/U/1P9X/VP9Txc7h+OnctpnT8fNB/rPX14/bKxLNjzNsXpFyzg1mLksknZHydYvEw7jNEqnn3pj/iXi4/4m4w+UZAnNm+6CQmBb0x++HLqHyonuT7/dcQmgaqN8p5cGmyIZQSsGkGEiKQaR55gjzhODAZFBMi/Nu7/UQkkPTJStMl6woXXQalC5aUbr5GrJD0s3XOcJ8XcN8vUSYr7NyOozufeEQYb5OEebrop0HQzdfB/W8IXTxCtDlh6CbX5gjzNdVP6F/5zJfZ4J08h1gQX1XhCq+q/m6MOQh3SFGu0MsSO9qvq4UCeVDp/k6c6QX7hgLuruarxNJOtlDJ0gV7SjTiB46URZEu/kaMKPZzdc5wnxdaTIq3rnM14knnWD3vnAIoNHbFWhBblfzdSVKqO2KVOV2tb7pwpSH1K5Qo7Ur1ILUrubrSpVRacV8nbjSCe2KtSDTwUZnV7AFmV3N1xUtKivm68CWTmRXtCrR4Uajwy1I7Gq+rnhRWDFfB750AruarwE4+bv5hZkwffpdARey72q+Dozpku9qvgbk5F4xvzBQ5i31qQPyjalj/o2r/QTm/LnKQpnRfvrE5w77uXCeu92/sfmJ/d5hcN/LAbNnrpA9dYXs5mvzk/v3rhe+tKVkx/6/uzlwavry1ZciAN4uCsApwYqo6cPn28/Ac3cqgKkDlD8B/++A0ixYzxwJLWOtKy0jrYuBpBpAysGj3sA9ce33+tkr5kBz4ZQERklg1ARKy7evVjVlAblxyQKiLhgKg6EyEEoDoTYIioOgOgDKA6A+8gIgLwHiIiAuA9JCIC0FwmIgLAeygiArCaKiICoLksIgKQ2C4iAoD3ICIScRYiIhJhNSQiElFUJiISQXMoIhIxkioiEiGxLCISEdAuIhIB/pBSS9hKBo53mEhjFlTv18ASSppSSxmOSVc55AOngqeSyoGZI+WcxKSmFJqXceBTeXfBcu3lnSCUw6iUkmMslkJpXQpJKaRGKTWK9fwPQFPIc0X7eQk0R0csg+z4S6vX+PBT9Dgq9b+NldA+yudx7FQi6JTtzc169dNcGuumBHbbCjPthNI+ymE3bSCkn0+gVMX8zksMvXLW7YWb/Xr7EYyrD5fdsRu2j7E1pPKcumRy5TbKorNtQWG+qLzTTGDjo+fffFWg4bXbi8sbGOT99jsZdhgwuXPzbS9ie0DlOWbx65LPJNPfItTfItXfINbbKJjk/ffTGaw5cvXE75to5P32Mxm+FLFy63fFnbn9D6TVk+PXIZ5lMd84mWcW8p8xe1fPpuXKc835+4fc/6we+s/6ot1l+ve1vsT/U/1f9U/1P9T/U/1f/8FZwCAFZQOCBiHQAA8MYAnQEqAAIAAj5RKJFGo6akIyEUKTDQCgllbvGAPiNiu/AKAjwB+GekV/hnBwf7l+AF6xND9663MFXp/yT/LD5rrT/lv77+q/7X70O9/tHzy/Lf4D/a/3/94f8x24fME/g38+/039p7BXmI/qn+b9Yb0s/1j1AP5L/iv/f/0e1B9Aj92vVs/5n/l/5HwU/tn+0P/V+Qf+Y/1f/wfn/8gHoAf8/1AP3/9rfkz+EvVCd1W7OtsTJnlZrLp4jvT6gvlo+sP9mf//7gH6vB6aVcdY1XHWNVx1jVcdY1XHWNVx1jVcdY1XHWNVx1jVcdY1XHWNVx1jVcdY1XHWNVx1jVcdY1XHWNVx1jVcdY1XHWNVx1jVcdY1XHWNVx1jVcdY1XHWNVx1jVcdY1XHWNVx1jVcdY1XHWNVx1jVcdY1XHWNVx1jVcdY1VitiATdoKY6BNU9knx8jRt6QZ4p2sPz0FE3yy+XQsGNGL4boiYzyrW+Ez2sV713lF/Id59iHeaIvZOkTFEU2ZzLa/kuOcajrnH6+ayLS/AQvfgeX36bElxp3eC+MvqIjl1qsz063zacJ14OE7LOu/QrWXwKA7bxElNKuOnBbv5zEw2smzphkPnzGkRgZbnf0IMf0kgBKX8ofFDmjnCMQFYoGjKDwd8kIU6mHQUQhkpAwqFM3bqD76hh8coiWrKLJTSrjrGoUYzjiwll/aZNiMugJCY9r8ZLxduFuMRNpcn3UHqZqKAx2KEkp2d/JyG4nJigKewmlMt3tVYCp0bn3RcWQ9R9qoqEqaHrQEQ7z7EOjzrbgxI4XhJTq833fh4pzCC89xBqADP9g4wmhdbtSa8ZBB9fsh7hv0saWK4Ttn7H0aBxpU3fs58RCWdYO23HRwzsWzBQR5EgodGBK+yzkLkXd0W4Q48WT+LQK6T2FX1gI51YX88i7Hu//eU+tT5HEs2h8Qs/YSR54QtzlnjmStfWlDwhEbRXvhY1czoXzyAiHefYZS8FXiaht2rpcueiLjH8EEc7ulqk5gm7qIS4d6K7Pvq+5PawVmHAOaGEfGQ+fZC7OJkz368rZ+VEvVBf4MRlKjbOLZ7tLeiv04aBBU52t4e7GM/j4CNxf0XjWh3Vn8Ei997c5FvxJYQbFxozUSTqCJoJQmSEYFfkVxRnjfaolDOUr27kBfq/9M7ANqqsVdFaj8njQOKn2rjrGLpKvxTupJF8qQyWoVsdqy9RFHg2sJHO8YXWIUPU5O/pQyEU8jwBQ8rmfPfckAgPb2oFp3fOkFKAyvUO0DhENJll9T+p2mq/AAG/Id59bQsLWGbNdoGWOaX5+8joWcP2RICZAlXxpC/RsdNEjgm8OtcvdHPE3heV2w1D413u2q+dth8Gy+GXap6t46SPAYkWy0vvuFzQLat2NVx1jGwYWPEzmlLBGe+X9tMYF+MGRz5lNEYnVZ9i5Zf1rk7JiOn8YhWMFtyA0257h3CPLzO+JQGvewA6W5WzqCj1TCqqMIDSPSfXAB8zmiROt2NVx1jUVEYPo94bD2f8vFYzLxeSnSu9q9wD59d3i4G3zgkU2OP87V/GRDBsbdcGqru6eW9f+iD0P2OHUjg2KpQE+cs4Cj+fmpBt5xElNKuOsaq4O5PeqjH9i5k4c692pV8Ku9SBM1kOgW5dW/uZYX5By7KKbYKFB+0kADLkQ/wmQ6p4N6EeP4C1ChUDsj/XsQ7z7EO8+xCfZMwF7HF2XarLe3JULaEJElgWmSa8rUpl//5ra4Omj+/iEkCl5fIitx5pc2zjB9Q1WWQPLUfS+c06MXpQoI8iSmlXHWNRNn8Xi2IJCPffe0E+OPAqcRhvwqsa3QkuNdLKWl87neVdXrZwyGANXLXTRf9gWuzuRJTSrjrGq46xqKh4x2fud0tm4xvc3g9mMTxL09Cdkh4YfYM7/mPNexDvPsQ7z7EO8+w0sePJhMiiGhYE2olPH3RIe8fUKzWGVjnD3Y1XHWNVx1jVcdYI+iKui+iGnVmaZ7Qsy+xquOsarjrGq46xquNyAIh3n2Id59iHefYh3n2Id59iHefYh3n2Id59iHefYh3n2Id59iHefYh3n2Id59iHefYh3n2Id59iHefYh3n2Id59iHefYh3n2Id59iHefYh3nvgAD+/eUwAAAAAAAAAAAAAAAKr8MkvYAYuDvieBd/T8pZ9Ial4+3AYQ4qG4EMlmDAA9qy6r+3ujvX/v3Rum4DtvkJ9jQb053XBs4+k1KOHUmbPdGPv9retVLMnvRjGPgAMGYbC7mBeij0JItR84fyjOikf3zMMUNibZxt2SPpxVTEB5sn5TIzkx2RUz0qIXJXVXt0PEZ/n8QCbf632ByItsZczG1mHuiTaIvqetTY0HsGDQOnCzcsbObB+VIf5IPqE/Nd/3XsLou3PsvMytDXsUSgubfu/QW8SGfreCdyMlKkOT19M8rTAxYDHbEsH63mJVbIjf4/nLrepRbt/HqFwFaPQTyT81gKjPQC3cjGWt8iJ8bzNW8QHbjnNveYRZbdNQLbG9BUJiy3VYaKZ6rMRDg2HxBr+4cP4GqlpSfz1Y/TsVL1e6v368S/AKAs6y0Hy/jTXRtq29xYz0FFZtpBwVwDXwXYjj++1Ga7X2yN/JRTcFijbompxW7hYuijIa3EpNWuL0tIl2QTbKMmKxYD5CTVDuCV0MKo5TejeT7yJg8+zQmS78Ufn8oybUA3wqxT0lPGxRJLtahhfM5te9mxHUTSzC3xZWKtSTm9vzcFUUGQUFsiOOd1WSJqNYePvjlACi5apw9/kFoVV7P3gav0kORLpC87BTID7TucaJEuWC6daVZPDXzryLoX7ruqHQ9IwmDe+vP6S+k105UD+JlP/VBdsL+gCBd/Pt+VwF0AJyMde3UWucwGwSjC64S8dTN1rXl3urgHPB3f2iwhlpP1iUlTgHyLFhsx5nU2saAMvgkWALfnqz+v1USrKO5quguO7wK8LTKBXM+mjzy/ZAuaV1afi2WX2PUFxAOj60oUEZLA4vEOjb5qRJ1/hPXqWJklxi97oLrdpcH1v4uwD5AB+Gdv1hIP8D3lh8lzwbiTnpzd9ntIed3KyT9Qr8DvoQBziFVpy9T+hMNCJ3Z+Uj0UACPKTzGH7L3pkVHfWFVBu++WBUv7feeMcJ0ecOjMu7D8BFmH9HHw1apBdvFq4I/esmtDSDAbIkiztOHKKCsQ8xob8E79Vz1WCDshpzL3FKCLNzIcjYzkSx+GruV5kCDMCrw2a4w854hCHBZ+jThQPZUqm2EOuZc91GmO5VHicfLFUjLi28nA0z/qFqVLI9Q3VBnSQvUuuFFIFrR/NHRjxA52FZ+mroe/uipk4yOqdNp1y6mv5pEHu9m7HlV4Bmuqrd8wHSlVy/Tw2OjxF3+34qF3ittnNvBfFKpM8tqHX2o8BWnXOjpYYn7BRZg5nBxvlJe+NkWvqOC3ZelgLLJrJMFMRflSQvl7qSj1sneMszAcrBjGNodB5ZYqDVJquXC9YiBfiVQmhO477GGN3NHAehXZ0XFANi/o1XLs4JGLuO8Rj7PTzJXjlE5pen9fZXquJqdW82J0mOpEzpfa4XnOnNMXtjdAnFvJkyRf8LSgiwRYFJyt9ZLoDGspVoHUF0j/toz3PdQpwzm+KBosQm9w1Q37HdLNddy4zZhWvMPjgWWcKMezMCX8WcQsk7qaurErXg6dVImwcewjej+DOTSqLICTrnkOmvgIHt2Wk2YPInxtapBDNXg+B+LTXs35XtauRtnnUoM+IvII/VrMXHGvHqm1b+KHLzBhfqS085wYTNv/WNuN0MFEyN3Pn0yv+XRqayEqe5cB2ok6/agYOYoyCi31cPj8X07LQRcXzlWdR0gGNwcY/NT6OesClWOALzgMqjemmodysQnYmE/upoxo1+92gJpEcHMbKIKuQgW7uo54vZlFn+U48CTjttTjO76dV0SUurxW23GzHMxwxAozSBziHwfHiD+BW0E9yaNvcQHeOdR2UfX3Nyv4hOwiBXqLGEfL8ld+LLsxE4udRoJWozjMbnKlJouCpYkGZZO8kB88hSXmRbt4oDJ5dFzfXXviGe0PZ2Ru3R4Py6yIjv4p01ibpiwvJlYvjhv1awHSb7qgPlMNOVbARTmtCuLmkR5J/QY2uockX6D8FQ8VH/rn61Avbzo5tzI8UrfooU7cT2ZEuOEn88xg9a36y0JssF/EhgxyPjwnFfpwT7vx5NqgxeU9ZjcqemQAO1Xxf2mhGuZzLo4emQcN1B7HFxP/2krLUNlwn1A0WV6X8lXYL9w9xWMjUWRnBtVptwIFURaiIiPoljGgIzGwVlORo/htWRdqL5EUsBJg/OEgojjcQOT9iXWZNPspdSEyuLnZkIapMJaRC+plVJuKLcxld8CO1u79wpLZTHUuSloygwaAs5KhxkQFocSAfWZrC3GpE9GguNx4xCp8d3MpmbuZMiI0B5Ce4PHqFYpOL2CgugS986z45MiEKaorQgWA87ru4WIunZ9WmIlzdbie79OX4pMq+cMt0J0gsSLeomWsj/eE/9aCt1+3cILLaBAuL43qGXdlr4LLLYlrOUCxLwjU45G58c4A60CQG0gtgBWCXk2prWkzxlmadJEygvXpr5U/uOcVkXNUmpLkO2XcACxWfTupL3nwXaeNLmyxKCLaO8YBKt54httnvQazbbvIDmi5ev/XKnsAPq0pyqa4YA9sQH4bclE5r2ia8hWxgCVHWvaF64LqQf/fkSpdxbHG+Qr3lH8v0HBldIeqd//BVL9YeNmolyimwGdfUG576KD80aFJb+LICfxBKdJq1neHSEj41KUE/tT43yFfKclpjhGZj4NNm8Rttyk8EmKpxzhpRRNF1Pigius1NvaOD5SlwIpHB0vrxYAqKoGCxn2OCrcF6cCGi4eEq4Sr5NSQSINdp6WUqKzzUUquEPR5enZUjQR9Qc+IJec5JzCILTBH6g5jql22ZxsioU6on+Pb7d9VfFDTzm2y+8twZ67UNHG+TrlnhOC2wT0n+Jq+cSlR4uSCsTeJxa6yzEQ7+Wt5ibU8cAGfNR6CxOEbzSQUQ+YuGEtRZ8XUtJxLDzw4+8HIev2eYHn2GGPOKdlVZNYBRUKO2vtquhrNJBOr4AL/PXD2vgvi9ocvridNS+yi+7kVTYoW+tnyE9L8TtrFR+FSPLey90NygpGv+r+RCDQtA64f7eV1LN8ih6XSqxywaRcTIidtAz5VhBxRca3tl/etZr/Pk4knbr1lXbyOFlIuWlnx1WiC53xo0vy22ZdPpduIBexcUIZLKVTetT8ZVw7v7fIsVXR3S9XqB+ZmBDjr/g1e2sh85pDKo+5PyFo9aAt/HOv5Tycc1V/HXPwv9GRi25jHlW5dxbyT/Lo46xz6m3b0JtENsuqU7H67umh26dv+aaDf5ByURMniOWPAdGDfbt+iDAwCLFcLUXcDoYn8SuNpriFGVqQrqcUcXOaZ0sJNCA00xcffWhIhNU9wXmO8d6rog1X6CQvqrXC1eWU0ti4p7rlPGnIguZ3pSAtn5o3LSV3oyd5ELsT2pOsE5F9rbrdtSlaqz+coUBWOiJfLKx+44pzgguPPwlqi8Ei3dDYL9JOccCNra6aYxfUQKIIAag6RmjUR0m5uZhVMoW7Badd/zm3/Tw1RZF2U6QSeSb6ZmsC1Jq1qKKJM5KR7qBnAB/BOhqf3UWxzGNl083dvTEWei3ttFN7Uiy8ywGj544+is0p+MSHRbR5JK1BrDOKDNnONHO/MLC2kM7UmGbPIW1IJ4oHgawNPbR/6be2inRAoPgKgQ2F6E6z4RahoK1iLqtXJuEI8/pVw6GXTG9TBZ8Yimry+3/IiWyOBe4mBIGUxI5F976KaV8KVvZKqnfLZN2x3GHgBrxWSW7o/u1pqJFcDUIysaA68XTZ44/yP7rXj9TZylWJfxTzai4bj4dUL74KZ/23EaXpZoaRaC6FEMA3pOkhLDr8/G5M7F3hXOJaO/YMDBal2zXZDbUD9zMKKmbck54nG4MkScQIGk0Ss0PO6WRijDbAqXMmt8M0xF5XfwRWsqz1A/OgGbgwCA90dsq0SBd/hJcfaqmut0Emwe+lOkrieShk3i9eQbNfvUuIF/uI9DIY+or14oMXYpImBvehusBuX3m1fKGfBbRghhDHsCsgaKS01TD3eWaaLhf4lMOeT8hjHzDfUUk+J+tmHs6HZHiOmDp7Pb+Vt5ocgl7icMvlJMjenxIuXvkfwNIsmR/9lAXSMA3VHj4oD3UkI82Wb9iSGqjC13e8qMwsfT/Zy5Tby04aH7njvb/8S3N8m4fR74kH/sIdXidblQxUdzRaPS7z8jba6OZB7eypryyqK/0sy4syCYpLA8YF150AIOOP60TmaPn8+UnrwmYhXxGb1rslJ1TwvSYGtHG5AVP39IFUIu3kzuiHJhSdXhkfh/03pfKGxaws4IgOzZjivc2zV3mUexFfmG5cuHCqUzfOs6m5dbqHgxicQ1GLSaVQMfduIL4JjIrzHe8Es1UMSIoMyAjYbN24RRgTdWcOSy96C77Ijsj4he8+I2X5J17I4Pm/aYoOA3Now7Wm4z6uovMj6izn8sek2EVrMDEchBMiaDmt3SU8+IIf7e1bNH9xOm7P0Oj+F3TIfFbUW9H2MD1WTlWsZ5NP1HPcyFmXbIJJUPdOxS8rg4P7zTGGNHFofKsOMNDtaXbERqVIRqNoEfhuys1VA8kSxTm1JnMB0nxBloCy2hSb9qfGSpMv5F0eYO0tJHA5/Ik0LuFrtsKebPzdBBdiKNS9/XRVuaor/SnLLVeXOw3Kn3l2m5/Rlq0UP+/Obcqy6qaGImQ7pwtjNA2HCfjkKz3lsAO08KrGPQZbot4cj3R8pmc9qlMyhkKZYFrkQnHz70fewYYVJxBVHOt9a8t9efHBmfjvuUjcqPkx6QdrcRpCPHx1Sfn8+jC++PR5pitO7tg8259vz2WARhfcUha/+AM0sxhVR0CMfaWJ7eWx9XP/ItSG4GRO8qqh115PLcpzmle2r20dRr9NzQwHMDyHhy8kjc9Ve45Sd+ue94FDwpFJEPlJmQl7IR48G8TNbS6mYSW0LGCA8QphAe0Kxbdfh9PgkLsU6dMyqxSNhnbyF7YbW//6Tr0nusXqCWk3PjguVUTHsHCkv7IPdhgxDoQKkzrHFmcuUsObtiQ9G+9SPv2J9MUDWTQj+DkxhuIL3NofAXDicBRCJ3+7rxmu1IFVYZIZDeThvNldUODZui4O+3zKeOIug9Dl78sG0qyijTNa5fRNB/Lawpoa+J+NY6GWPj/U7mfKjtZsJBhMeM8OOQ/4d9TPlr+dVDJALqbxYSqe0YIdaiYNWJ9KUP8QfJhcnbvZcUqx0KQD5s1eXQISWKDMp81XwVlVh6fFD2/VYgbYPhvY6uyb49nORi/Lo58YHJFO02IjusvvIS79U7G4tO6yXONbXIMu2U3OczZ3JkoDl433p56uXb0a8DGibMKEurAicB7oTtZY0ESJ46p60f61tyd5pGm0byA/IPspEfQAdcnhpJ405ncHv9fSmsO95U9rRWq9Z1YA7dtcuOAxQp6j9CPWkWmKM1bDyCcYEADKkvlUX0mdu6ml/XJh+9/AZiCUDACU1FTN+C75lrMQVZhnpc/JNfd4UwvL4WcemqJMatNtBKYwR2nSRS+bvE+FcAmfwKvbECnv46UWplOvM8n28pP9+jfYa/mcUbKsHXRCgz5NZWY9RX4wGpHWadyt55o2OR0x7GK9wH18/MVUNNXuDcvjyaMNxS0la9t+y2MmsciPowoMlBzaCNKEwolTcUz3oCfcLJQAB4WpPLQpSKgoeOng2R5kdI/8p8J3i702XP7WUclp9ikj2ZyOb3y1zdOZDlaj2tbXltKR5OSjlxNFMZWPf2QOmmCoeVZrf+L54r43/A/2NjCHtoS77AJYaQif9syXuANuOAABP1RTunfe+Icnlnl4iLoqhdMaftUytAGZoK9d6Y/wAakRtFCqGquYfi4EsQt0Oyy6LRynv8RVqoNXoZVaH3S6WTm+j7Lcmyhd64txGgq7xLQyGHGeowP/REQmInXPlj2XGKViNAPp8NKp3nOEh59SgICE4jXe2dLaiA5z7qGHU5M7ECKqxay2KWOKndzd+YxtUBOjpdv8wDCVULBgQDv/p5mKaBsYow5HbDOnG9eLE6cpOFtL7f5isFcmH0cFZ0o6eRAHuZsgi5wHxNAKW8S6NK/ZksOueExhDu3MQHgMBWHGLWgBYoSPW0yjAcOxnR2ozsJQ3gs9j8/M79U5JwqO0MsJ2bUItGhI9ZvMXPQbmx3ShAPt2W1Qj1RLK/q4Q7mulN8/zRxNeo0J4olOAtYUzTJkRbnhYl/7JCVpVlmk8a2SqywNNuWuvKrAgP7I3PCpVMsO8mIatdNFerDqa8Qk1/i1o1b6FJE/1NnggHDLafULpR8ZTykT5fe4ZTBcpx8qzW8uv8k+B+QBRpKEBhBHJ5j4nBGwQSNP8odcpf5snroipAAAET/hAiNtbvHVut3D9w9WBV5zA8awX1EXpeVwBsyCh1+P+CeOh5MmeAW9WelJ/uNWX4IXvdLRBCDk2Z+nYuAt8ILrE2B/KrRTdK9XTdYlmDCFttXDrNF+9We/t3cC6UW8202Cx//uaMu+VCXb5aZWfQET8ObzFi8b9y6BjZrLmT+qvyt7E/h6usS325WLFNrKriWqYE/xBjL70a/kb7zwi3fe7PGMqOBr3U6E7IncJnyISxXwFNKV+oKF7efhPMZW2OIN9zRSlDpHZpIXOTk7ZlEDQp7EDoMQtJmjIdBIxnIXDx4hZ15oSe1T55CBBTi/eioT9+VbZIu+4gIafqcsZ6fYWoWoLSiVzCx77vf7KYxDEx1NSvAYGJ0r+TTBqfaB9olXQQFl3KdwHE0HP5v7ZXa9lqBK4/HWW8bKWF55ZemU5/yw5RcDmRoLxqg/8horcha36srYPebxmvuS/FDIpT6AABD/JyD4nTHbtb13/ZFd5jAkIObHRdBgOh6oYJoIgndWObLmn+AIa2eqrvj5jPIWsc2XJXn4ZsGnHZX87Q9dBo5/8PzVJSepLyehmqASdDx8BT7iLIbkSsDLQTtJ+IQcLzKUCs3+rsecAATAZEQRbSFwu/dZWc0yR6WSUHkFK7wLv8SPjxchUTgIBJ8tIfnKeW5DTqTJDHxRk5MfjTyNa6+NSGnOoTM2X03ZHtkoKX99MfoJuVh4deIx/qcpFvYP2gKXdbqvJGLYGWD/YP7h17qTAw3YhaKFWowyeeYdcAjSxNN3hiekdBUFYUPi4GvSqnzfr33Xx+5iqkgHdo0x8zvZdtrAk4UOkxcMiaHSZA37f1Em3Fny60Me5yhekjhkOIubzU//wId76xyyZugAAKhOBTshfPjZfILTbwyuw+nF5cx9EKaY7vFcz2WVzUIVuxD1AMAAS9TORpgbGicjOWs3M50uFoPTLcr/5bwLwh9i51FuwkS0NZpbrFFV1WVXU+iwHlCey/+r06eZ/8zvfD4c4rSbWge75IQMyPeL6yo8dOJjQVgDMy8y6DeHF3SqSqpgitfdpRnlF4rSc7cnwaydcfo8Fb2WVpVGPXMp2LDMK4SJsVbfML8DxCOM/4YW5nZhonQ60IQtoy200465LTPmNDf98rIi3sDAvo6CsQpr3Dkhezulf+NW/jJ9mNXJ3DQfz4V16x7N6FwD6tBAiCDrwABuuBT9gMkRjEwYSfS/nnsEOqXRXEMI/nOMoPmzvHdwnM/5iUB7FCptv7QW+z+bgXNil+wuTnjaDLEt7cUzWB9tR6oayfPifkEzouK05zCrH83etOnnTHXJaVKnk9ngrwCw8WU584OErXDrViMo7apZsXIO6DqKZuvwhSFWzPU+MAAAACz74MBiyi63fCz/uyXXDSBTRWD5asA0LH7w3Tb6f5eM5u+hNjhU8uxwHfmD+Wx5OyLjx3V8Xp2INh2zj/dln8hqyUEZXcPASulxbYwEqIV0Q06QRHtn780HTpyTf+rdrBFAAAAAAAAAAAAAAAAAAAA==`,Nl=1e3,Pl=2e3,Fl=50,Il=1e3,Ll=!1,Rl=new Set;function zl(){return Ll}function Bl(e){return Rl.add(e),()=>{Rl.delete(e)}}function Vl(e){Ll||(`${e}`,Ll=!0,Rl.forEach(e=>e()))}function Hl(){let e,t=0,n=[];function r(){e=void 0,n=[]}function i(r){if(e===void 0||r-e>Il){e=r,t=r+Nl,n=[];return}let i=r-e;if(e=r,r<t||(n.push(i),r-t<Pl))return;let a=Ul(n);n=[],t=r,a>Fl&&Vl(`median frame interval ${Math.round(a)} ms`)}return{track:i,reset:r}}function Ul(e){let t=[...e].sort((e,t)=>e-t);return t[Math.floor(t.length/2)]}function Wl(e,t,n){return Math.min(n,Math.max(t,e))}function Gl(e,t,n){return e+(t-e)*n}var Kl=`https://s.ton-connect.io/diamond/v1/`,ql=`#version 300 es
|
|
160
|
-
precision highp float;
|
|
161
|
-
precision highp int;
|
|
162
|
-
#define saturate(x) clamp(x,0.0,1.0)
|
|
163
|
-
struct Vertex { vec4 position; vec4 normal; vec4 surface; };
|
|
164
|
-
struct Uniforms {
|
|
165
|
-
mat4 model;
|
|
166
|
-
mat4 projection;
|
|
167
|
-
mat4 inverseModel;
|
|
168
|
-
vec4 parameters; // time, refraction, brightness, sparkles
|
|
169
|
-
vec4 viewport; // width, height, optical plane count, unused
|
|
170
|
-
vec4 sparkleShape; // main layer scale, contour morph, core scale, star glow scale
|
|
171
|
-
vec4 sparkleHalo; // circular glow scale, main face rotation, horizontal correction, visibility
|
|
172
|
-
vec4 crownGradient;
|
|
173
|
-
vec4 pavilionGradient;
|
|
174
|
-
vec4 lightSweep; // diagonal position, environment phase, transmission, reserved
|
|
175
|
-
vec4 facetProjection; // reference pitch cosine/sine, source units, projected top
|
|
176
|
-
vec4 crownSweep;
|
|
177
|
-
vec4 rightCrownSweep;
|
|
178
|
-
vec4 leftCrownSweep;
|
|
179
|
-
vec4 pavilionSweep;
|
|
180
|
-
vec4 rightPavilionSweep;
|
|
181
|
-
vec4 leftPavilionSweep;
|
|
182
|
-
vec4 appearance; // palette identifier, reserved
|
|
183
|
-
vec4 referenceCrownFlash;
|
|
184
|
-
vec4 referencePavilionFlash;
|
|
185
|
-
};
|
|
186
|
-
struct Raster {
|
|
187
|
-
vec4 position ;
|
|
188
|
-
vec3 localPosition;
|
|
189
|
-
vec3 normal;
|
|
190
|
-
vec3 worldPosition;
|
|
191
|
-
vec3 facetWeights; // table, crown, pavilion; interpolated across rounded edges
|
|
192
|
-
};
|
|
193
|
-
struct SparkleVertex { vec4 contours; vec4 material; };
|
|
194
|
-
struct SparkleRaster {
|
|
195
|
-
vec4 position ;
|
|
196
|
-
vec2 sourcePoint;
|
|
197
|
-
float strength ;
|
|
198
|
-
uint layer ;
|
|
199
|
-
};
|
|
200
|
-
struct SparkleAnchor { vec4 position; vec4 normal; };
|
|
201
|
-
uniform Uniforms u;
|
|
202
|
-
// Read the optical hull directly from uniforms. Passing this array by value
|
|
203
|
-
// makes mobile drivers materialize private copies for each ray query.
|
|
204
|
-
uniform vec4 planes[17];
|
|
205
|
-
uniform SparkleAnchor anchors[8];
|
|
206
|
-
in vec3 v_localPosition;
|
|
207
|
-
in vec3 v_normal;
|
|
208
|
-
in vec3 v_worldPosition;
|
|
209
|
-
in vec3 v_facetWeights;
|
|
210
|
-
vec3 referenceCrown(vec2 p, vec4 gradient) {
|
|
211
|
-
const float stops[7] =float[7](0.0, 0.162, 0.324, 0.501, 0.667, 0.833, 1.0);
|
|
212
|
-
const vec3 colors[7] =vec3[7](vec3(0.145,0.792,1.0), vec3(0.373,0.875,1.0),
|
|
213
|
-
vec3(0.6,0.957,1.0), vec3(0.3,0.798,1.0), vec3(0.0,0.639,1.0),
|
|
214
|
-
vec3(0.0,0.545,1.0), vec3(0.0,0.451,1.0));
|
|
215
|
-
vec2 start = gradient.xy, direction = gradient.zw - start;
|
|
216
|
-
float t = saturate(dot(p-start, direction) / dot(direction,direction));
|
|
217
|
-
for (uint i = 1u; i < 7u; ++i) {
|
|
218
|
-
if (t <= stops[i]) { return mix(colors[i-1u], colors[i], (t-stops[i-1u])/(stops[i]-stops[i-1u])); }
|
|
219
|
-
}
|
|
220
|
-
return colors[6];
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
vec3 lateralDepth(vec3 color, vec3 normal, float y, vec3 facetWeights,
|
|
224
|
-
float opticalLuminance) {
|
|
225
|
-
float horizontalNormal = length(normal.xz);
|
|
226
|
-
float side = smoothstep(0.22, 0.80, abs(normal.x) / max(horizontalNormal, 0.001));
|
|
227
|
-
float shoulder = smoothstep(0.06, 0.57, y);
|
|
228
|
-
float lower = smoothstep(0.12, 0.90, -y);
|
|
229
|
-
float reflectedLight = smoothstep(0.28, 0.78, color.g);
|
|
230
|
-
// A restrained blue-violet shadow keeps the sides distinct without
|
|
231
|
-
// swallowing their cyan gradients and moving reflections.
|
|
232
|
-
vec3 deepBlue = mix(vec3(0.017, 0.035, 0.90),
|
|
233
|
-
vec3(0.006, 0.11, 1.0), reflectedLight);
|
|
234
|
-
vec3 sideColor = mix(deepBlue, vec3(0.22, 0.86, 1.0), shoulder * 0.69);
|
|
235
|
-
sideColor = mix(sideColor, vec3(0.018, 0.39, 1.0), lower * 0.52);
|
|
236
|
-
float reflectionDetail = 0.105 + opticalLuminance * 0.14
|
|
237
|
-
+ smoothstep(0.70, 0.95, color.g) * 0.26;
|
|
238
|
-
sideColor = mix(sideColor, color, reflectionDetail);
|
|
239
|
-
float weight = side * 0.96 * (1.0 - facetWeights.x);
|
|
240
|
-
return mix(color, sideColor, weight);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
vec3 facetBarycentric(vec2 p, vec2 a, vec2 b, vec2 c) {
|
|
244
|
-
vec2 v = b-a, w = c-a, q = p-a;
|
|
245
|
-
float determinant = v.x*w.y - v.y*w.x;
|
|
246
|
-
float y = (q.x*w.y - q.y*w.x) / determinant;
|
|
247
|
-
float z = (v.x*q.y - v.y*q.x) / determinant;
|
|
248
|
-
return vec3(1.0-y-z, y, z);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
float facetCoverage(vec3 barycentric) {
|
|
252
|
-
float edge = min(barycentric.x, min(barycentric.y, barycentric.z));
|
|
253
|
-
float aa = max(fwidth(edge), 0.004);
|
|
254
|
-
return smoothstep(-aa, aa, edge);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
vec2 sourceFacetPoint(vec3 localPosition, vec2 outward, Uniforms u) {
|
|
258
|
-
float across = dot(localPosition.xz, vec2(outward.y,-outward.x));
|
|
259
|
-
float depth = dot(localPosition.xz,outward);
|
|
260
|
-
float c = u.facetProjection.x, s = u.facetProjection.y;
|
|
261
|
-
float y = c*localPosition.y-s*depth;
|
|
262
|
-
float z = s*localPosition.y+c*depth;
|
|
263
|
-
float w = u.projection[2].w*z+u.projection[3].w;
|
|
264
|
-
return vec2(257.6+across/w*u.facetProjection.z,
|
|
265
|
-
103.8+(u.facetProjection.w-y/w)*u.facetProjection.z);
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
vec3 illustratedFacets(vec3 color, Raster inputData, Uniforms u) {
|
|
269
|
-
vec3 localNormal = normalize((u.inverseModel * vec4(normalize(inputData.normal), 0.0)).xyz);
|
|
270
|
-
// Fixed material coordinates on each broad face. The same reference camera
|
|
271
|
-
// maps the authored facets and the sparkle anchors onto the current cut.
|
|
272
|
-
vec2 outward = abs(localNormal.x) > abs(localNormal.z)
|
|
273
|
-
? vec2(sign(localNormal.x),0.0) : vec2(0.0,sign(localNormal.z));
|
|
274
|
-
vec3 tangent = vec3(outward.y,0.0,-outward.x);
|
|
275
|
-
vec2 p = sourceFacetPoint(inputData.localPosition,outward,u);
|
|
276
|
-
// Fade the drawing before the diagonal facets, where the next face's
|
|
277
|
-
// coordinate system takes over. No duplicated motifs along rounded edges.
|
|
278
|
-
vec2 normalXZ = abs(localNormal.xz);
|
|
279
|
-
float broad = 1.0-smoothstep(0.20,0.65,min(normalXZ.x,normalXZ.y)/max(max(normalXZ.x,normalXZ.y),0.0001));
|
|
280
|
-
vec3 worldTangent = (u.model * vec4(tangent, 0.0)).xyz;
|
|
281
|
-
vec3 n = normalize(inputData.normal);
|
|
282
|
-
vec3 light = normalize(vec3(0.6*sin(u.lightSweep.y), 0.5, 1.0));
|
|
283
|
-
float leftLight = pow(saturate(dot(normalize(n - worldTangent*0.38), light)), 5.0);
|
|
284
|
-
float rightLight = pow(saturate(dot(normalize(n + worldTangent*0.38), light)), 5.0);
|
|
285
|
-
if (inputData.facetWeights.y > 0.0) {
|
|
286
|
-
// Both crown triangles meet at the same upper junction.
|
|
287
|
-
const vec2 crownJunction = vec2(258.8,128.9);
|
|
288
|
-
// Authored lower corners now share the same projection as the mesh.
|
|
289
|
-
const vec2 crownBaseLeft = vec2(108.8,240.8);
|
|
290
|
-
const vec2 crownBaseRight = vec2(406.8,240.8);
|
|
291
|
-
vec3 left = facetBarycentric(p, vec2(142.1,106.3), crownJunction, crownBaseLeft);
|
|
292
|
-
float leftStrength = facetCoverage(left) * (0.18 + 0.40*leftLight) * saturate(1.0-left.y);
|
|
293
|
-
color = mix(color, vec3(0.79,0.988,1.0), leftStrength * inputData.facetWeights.y * broad);
|
|
294
|
-
vec3 right = facetBarycentric(p, crownBaseRight, crownJunction, vec2(378.5,108.2));
|
|
295
|
-
// The source is light at the left junction and dark at the right edge.
|
|
296
|
-
// Use horizontal facet coordinates so the gradient turns with the gem.
|
|
297
|
-
float gradient = smoothstep(crownJunction.x,crownBaseRight.x,p.x);
|
|
298
|
-
vec3 tint = mix(vec3(0.28,0.83,1.0),vec3(0.025,0.43,1.0),gradient);
|
|
299
|
-
tint = mix(tint,vec3(0.57,0.95,1.0),rightLight*0.24);
|
|
300
|
-
color = mix(color, tint, facetCoverage(right) * 0.90 * inputData.facetWeights.y * broad);
|
|
301
|
-
}
|
|
302
|
-
if (inputData.facetWeights.z > 0.0) {
|
|
303
|
-
// A translucent kite belongs to each broad pavilion face. Material-space
|
|
304
|
-
// edges stay attached to the surface throughout a complete rotation.
|
|
305
|
-
vec2 kite = vec2(dot(inputData.localPosition,tangent),inputData.localPosition.y);
|
|
306
|
-
const float halfWidth = 0.245, top = -0.61, shoulder = -0.70, bottom = -1.075;
|
|
307
|
-
const float upperHeight = top-shoulder, lowerHeight = shoulder-bottom;
|
|
308
|
-
float upperEdge = ((top-kite.y)*halfWidth-abs(kite.x)*upperHeight)
|
|
309
|
-
/ length(vec2(halfWidth,upperHeight));
|
|
310
|
-
float lowerEdge = ((kite.y-bottom)*halfWidth-abs(kite.x)*lowerHeight)
|
|
311
|
-
/ length(vec2(halfWidth,lowerHeight));
|
|
312
|
-
float edge = min(upperEdge,lowerEdge);
|
|
313
|
-
float aa = max(fwidth(edge),0.0015);
|
|
314
|
-
float coverage = smoothstep(-aa,aa,edge);
|
|
315
|
-
float illumination = saturate(dot(n,normalize(vec3(-0.65,0.5,1.0))));
|
|
316
|
-
vec3 tint = mix(vec3(0.48,0.96,1.0),vec3(0.70,1.0,1.0),illumination);
|
|
317
|
-
float across = saturate(0.5+kite.x/(2.0*halfWidth));
|
|
318
|
-
tint *= mix(vec3(1.0),vec3(0.88,0.97,1.0),across);
|
|
319
|
-
color = mix(color,tint,coverage*0.28*inputData.facetWeights.z*broad);
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
return color;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
vec3 studio(vec3 d, float phase) {
|
|
326
|
-
float angle = 0.85 * sin(phase);
|
|
327
|
-
d.xz = vec2(cos(angle)*d.x - sin(angle)*d.z, sin(angle)*d.x + cos(angle)*d.z);
|
|
328
|
-
float up = smoothstep(-0.65, 0.85, d.y);
|
|
329
|
-
vec3 c = mix(vec3(0.002, 0.075, 0.88), vec3(0.19, 0.78, 1.0), up);
|
|
330
|
-
float key = pow(saturate(dot(d, normalize(vec3(-0.6, 0.8, 0.7)))), 10.0);
|
|
331
|
-
float stripPosition = 0.12 + 0.48 * sin(phase);
|
|
332
|
-
float strip = exp(-pow((d.x + d.y * 0.42 - stripPosition) * 9.0, 2.0));
|
|
333
|
-
float side = pow(saturate(dot(d, normalize(vec3(0.8, 0.2, -0.5)))), 18.0);
|
|
334
|
-
c = mix(c, vec3(0.68, 0.98, 1.0), key * 0.94);
|
|
335
|
-
c = mix(c, vec3(0.80, 0.99, 1.0), strip * 0.64);
|
|
336
|
-
c += side * vec3(0.1, 0.3, 0.38);
|
|
337
|
-
return c;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
vec2 facetEdgeRoll(vec2 p, vec2 a, vec2 b) {
|
|
341
|
-
vec2 segment = b-a;
|
|
342
|
-
float edgeLength = length(segment);
|
|
343
|
-
vec2 along = segment/edgeLength;
|
|
344
|
-
vec2 across = vec2(-along.y,along.x);
|
|
345
|
-
float distance = dot(p-a,across);
|
|
346
|
-
float progress = dot(p-a,along);
|
|
347
|
-
float width = max(1.6,fwidth(distance));
|
|
348
|
-
float q = distance/width;
|
|
349
|
-
float ends = smoothstep(0.0,5.0,progress)*(1.0-smoothstep(edgeLength-5.0,edgeLength,progress));
|
|
350
|
-
return across*(q*exp(-q*q)*0.22*ends);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
vec3 polishedNormal(Raster inputData, vec3 localNormal, Uniforms u) {
|
|
354
|
-
// Only the two surface crown diagonals get this tiny optical fillet.
|
|
355
|
-
// The actual outline and the internal optical hull stay unchanged.
|
|
356
|
-
if (inputData.facetWeights.y <= 0.0) { return normalize(inputData.normal); }
|
|
357
|
-
vec2 outward = abs(localNormal.x) > abs(localNormal.z)
|
|
358
|
-
? vec2(sign(localNormal.x),0.0) : vec2(0.0,sign(localNormal.z));
|
|
359
|
-
vec2 normalXZ = abs(localNormal.xz);
|
|
360
|
-
float broad = 1.0-smoothstep(0.20,0.65,min(normalXZ.x,normalXZ.y)/max(max(normalXZ.x,normalXZ.y),0.0001));
|
|
361
|
-
vec2 p = sourceFacetPoint(inputData.localPosition,outward,u);
|
|
362
|
-
vec2 roll = facetEdgeRoll(p,vec2(258.8,128.9),vec2(108.8,240.8))
|
|
363
|
-
+ facetEdgeRoll(p,vec2(258.8,128.9),vec2(406.8,240.8));
|
|
364
|
-
vec3 across = vec3(outward.y,0.0,-outward.x);
|
|
365
|
-
vec3 up = normalize(cross(localNormal,across));
|
|
366
|
-
vec3 normal = normalize(localNormal-(across*roll.x-up*roll.y)*broad*inputData.facetWeights.y);
|
|
367
|
-
return normalize((u.model*vec4(normal,0.0)).xyz);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
float studioPanel(vec3 reflected, vec3 direction, vec2 size) {
|
|
371
|
-
float alignment = dot(reflected,direction);
|
|
372
|
-
vec3 horizontal = normalize(cross(vec3(0.0,1.0,0.0),direction));
|
|
373
|
-
vec3 vertical = cross(direction,horizontal);
|
|
374
|
-
vec2 point = vec2(dot(reflected,horizontal),dot(reflected,vertical))/max(alignment,0.15);
|
|
375
|
-
// Filter the narrow reflection at small sizes and grazing angles.
|
|
376
|
-
vec2 dx = dFdx(point), dy = dFdy(point);
|
|
377
|
-
vec2 variance = size*size+dx*dx+dy*dy;
|
|
378
|
-
float energy = size.x*size.y/sqrt(variance.x*variance.y);
|
|
379
|
-
return exp(-dot(point*point,1.0/variance))*energy*smoothstep(0.15,0.40,alignment);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
vec3 surfaceFinish(vec3 color, vec3 normal, vec3 view, Uniforms u) {
|
|
383
|
-
vec3 reflected = reflect(-view,normal);
|
|
384
|
-
float phase = u.lightSweep.y;
|
|
385
|
-
float key = studioPanel(reflected,normalize(vec3(-0.36+0.14*sin(phase),0.90,0.72)),vec2(0.16,0.48));
|
|
386
|
-
float rim = studioPanel(reflected,normalize(vec3(0.72,-0.52+0.10*cos(phase),0.18)),vec2(0.10,0.60));
|
|
387
|
-
float fresnel = pow(1.0-saturate(dot(normal,view)),4.0);
|
|
388
|
-
float strength = key*(0.35+0.35*fresnel)+rim*(0.16+0.30*fresnel);
|
|
389
|
-
return mix(color,vec3(0.87,0.99,1.0),strength);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
// The optical hull always has 17 planes. Constant indices avoid the expensive
|
|
393
|
-
// dynamically indexed uniform loop on mobile GPUs, without changing ray math.
|
|
394
|
-
|
|
395
|
-
void exitPlane(vec4 plane, vec3 origin, vec3 ray, inout float nearest,
|
|
396
|
-
inout float second, inout vec3 normal, inout vec3 secondNormal) {
|
|
397
|
-
float denominator = dot(plane.xyz, ray);
|
|
398
|
-
if (denominator > 0.0001) {
|
|
399
|
-
float t = -(dot(plane.xyz, origin) + plane.w) / denominator;
|
|
400
|
-
if (t > 0.001 && t < nearest) {
|
|
401
|
-
second = nearest; secondNormal = normal;
|
|
402
|
-
nearest = t; normal = plane.xyz;
|
|
403
|
-
} else if (t > 0.001 && t < second) {
|
|
404
|
-
second = t; secondNormal = plane.xyz;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
float nearestExit(vec3 origin, vec3 ray, inout vec3 normal) {
|
|
410
|
-
float nearest = 1e5;
|
|
411
|
-
float second = 1e5;
|
|
412
|
-
vec3 secondNormal = normal;
|
|
413
|
-
#define TEST_EXIT(I) exitPlane(planes[I], origin, ray, nearest, second, normal, secondNormal);
|
|
414
|
-
TEST_EXIT(0u) TEST_EXIT(1u) TEST_EXIT(2u) TEST_EXIT(3u) TEST_EXIT(4u) TEST_EXIT(5u)
|
|
415
|
-
TEST_EXIT(6u) TEST_EXIT(7u) TEST_EXIT(8u) TEST_EXIT(9u) TEST_EXIT(10u) TEST_EXIT(11u)
|
|
416
|
-
TEST_EXIT(12u) TEST_EXIT(13u) TEST_EXIT(14u) TEST_EXIT(15u) TEST_EXIT(16u)
|
|
417
|
-
#undef TEST_EXIT
|
|
418
|
-
if (second < 1e5) {
|
|
419
|
-
// The optical hull inherits a tiny edge fillet. This also filters its
|
|
420
|
-
// reflected boundaries when they become thinner than a screen pixel.
|
|
421
|
-
float width = max(0.008,min(0.035,fwidth(second-nearest)));
|
|
422
|
-
float blend = 0.5*(1.0-smoothstep(0.0,width,second-nearest));
|
|
423
|
-
normal = normalize(mix(normal,secondNormal,blend));
|
|
424
|
-
}
|
|
425
|
-
return nearest;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
vec4 oppositeFacets(vec3 p, vec3 ray, Uniforms u) {
|
|
429
|
-
vec3 origin = p + ray*0.004;
|
|
430
|
-
vec3 normal = vec3(0.0,1.0,0.0);
|
|
431
|
-
float distance = nearestExit(origin,ray,normal);
|
|
432
|
-
if (distance > 100.0 || normal.y > 0.95) { return vec4(0.0); }
|
|
433
|
-
vec3 hit = origin + ray*distance;
|
|
434
|
-
vec3 worldNormal = (u.model*vec4(normal,0.0)).xyz;
|
|
435
|
-
vec3 tangent = normalize(vec3(normal.z+0.00001,0.0,-normal.x));
|
|
436
|
-
float across = dot(hit,tangent);
|
|
437
|
-
vec2 authored = vec2(across*225.8, (normal.y > 0.0 ? 0.3065-hit.y : -0.54-hit.y)*239.0);
|
|
438
|
-
vec3 color;
|
|
439
|
-
if (normal.y > 0.0) {
|
|
440
|
-
color = referenceCrown(authored,u.crownGradient);
|
|
441
|
-
float response = pow(saturate(dot(worldNormal, normalize(vec3(0.7*sin(u.lightSweep.y),0.55,-1.0)))),4.0);
|
|
442
|
-
color = mix(color*vec3(0.45,0.70,0.98), vec3(0.60,0.94,1.0), response*0.55);
|
|
443
|
-
} else {
|
|
444
|
-
// The pavilion is one connected eight-facet hull. Looking through its
|
|
445
|
-
// front reveals the actual opposite facet, without view-switched motifs.
|
|
446
|
-
vec3 reflected = normalize((u.model*vec4(reflect(ray,normal),0.0)).xyz);
|
|
447
|
-
vec3 environment = studio(reflected,u.lightSweep.y);
|
|
448
|
-
float response = pow(saturate(dot(worldNormal,normalize(vec3(-0.4,-0.55,-1.0)))),2.0);
|
|
449
|
-
color = mix(vec3(0.012,0.38,1.0),vec3(0.27,0.94,1.0),response*0.65+environment.g*0.35);
|
|
450
|
-
color = mix(color,environment,0.28);
|
|
451
|
-
float panel = studioPanel(reflected,normalize(vec3(-0.36,0.90,0.72)),vec2(0.20,0.52));
|
|
452
|
-
color = mix(color,vec3(0.72,0.98,1.0),panel*0.48);
|
|
453
|
-
}
|
|
454
|
-
float coverage = smoothstep(0.03,0.35,distance) * exp(-distance*0.16);
|
|
455
|
-
return vec4(color,coverage);
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
float sourceBand(vec2 p, vec4 gradient) {
|
|
459
|
-
vec2 direction = gradient.zw-gradient.xy;
|
|
460
|
-
float t = dot(p-gradient.xy,direction)/dot(direction,direction);
|
|
461
|
-
return saturate(1.0-abs(t-0.49)/0.49);
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
float facetSweep(Raster inputData, vec3 localNormal, Uniforms u) {
|
|
465
|
-
vec3 tangent = normalize(vec3(localNormal.z+0.00001,0.0,-localNormal.x));
|
|
466
|
-
float across = dot(inputData.localPosition,tangent)*225.8;
|
|
467
|
-
float side = smoothstep(0.20,0.50,abs(normalize(inputData.normal).x));
|
|
468
|
-
bool right = inputData.normal.x > 0.0;
|
|
469
|
-
vec4 crown = mix(u.crownSweep, right ? u.rightCrownSweep : u.leftCrownSweep, side);
|
|
470
|
-
vec4 pavilion = mix(u.pavilionSweep, right ? u.rightPavilionSweep : u.leftPavilionSweep, side);
|
|
471
|
-
return sourceBand(vec2(across,(0.3065-inputData.localPosition.y)*239.0),crown)*inputData.facetWeights.y
|
|
472
|
-
+ sourceBand(vec2(across,(-0.54-inputData.localPosition.y)*235.0),pavilion)*inputData.facetWeights.z;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
vec3 internalEnvironment(vec3 position, vec3 direction, float pavilion, Uniforms u) {
|
|
476
|
-
vec3 worldPosition = (u.model*vec4(position,1.0)).xyz;
|
|
477
|
-
vec3 worldDirection = normalize((u.model*vec4(direction,0.0)).xyz);
|
|
478
|
-
// A finite studio gives each reflected facet a spatial gradient, rather
|
|
479
|
-
// than a flat swatch. The lights and the optical hull share one 3D space.
|
|
480
|
-
float along = dot(worldPosition,worldDirection);
|
|
481
|
-
float distance = -along+sqrt(max(0.0,along*along+3.2*3.2-dot(worldPosition,worldPosition)));
|
|
482
|
-
vec3 sampleValue = normalize(worldPosition+worldDirection*distance);
|
|
483
|
-
if (pavilion <= 0.0) { return studio(sampleValue,u.lightSweep.y); }
|
|
484
|
-
// Keep a uniform blue surround below the crown. A bright upper hemisphere
|
|
485
|
-
// reflected inputData the pavilion reads as a filled tip with a horizontal meniscus.
|
|
486
|
-
// Narrow studio panels retain moving reflections without filling whole facets.
|
|
487
|
-
float phase = u.lightSweep.y;
|
|
488
|
-
float key = studioPanel(sampleValue,normalize(vec3(-0.12+0.035*sin(phase),-0.60,0.79)),vec2(0.055,0.52));
|
|
489
|
-
float rim = studioPanel(sampleValue,normalize(vec3(0.12,0.75+0.035*cos(phase),-0.65)),vec2(0.055,0.50));
|
|
490
|
-
vec3 lower = mix(vec3(0.015,0.41,1.0),vec3(0.58,0.94,1.0),key*0.95);
|
|
491
|
-
lower = mix(lower,vec3(0.24,0.78,1.0),rim*0.82);
|
|
492
|
-
return pavilion < 1.0 ? mix(studio(sampleValue,u.lightSweep.y),lower,pavilion) : lower;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
float reflectionTriangle(vec3 origin, vec3 ray, vec3 a, vec3 b, vec3 c,
|
|
496
|
-
out vec3 coordinates) {
|
|
497
|
-
vec3 ab = b-a, ac = c-a, crossRay = cross(ray,ac);
|
|
498
|
-
float determinant = dot(ab,crossRay);
|
|
499
|
-
if (abs(determinant) < 0.00001) { return 1e5; }
|
|
500
|
-
vec3 offset = origin-a;
|
|
501
|
-
float u = dot(offset,crossRay)/determinant;
|
|
502
|
-
vec3 q = cross(offset,ab);
|
|
503
|
-
float v = dot(ray,q)/determinant;
|
|
504
|
-
float t = dot(ac,q)/determinant;
|
|
505
|
-
coordinates = vec3(1.0-u-v,u,v);
|
|
506
|
-
return min(min(coordinates.x,coordinates.y),coordinates.z) >= 0.0 && t > 0.001 ? t : 1e5;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
vec3 pavilionReflections(vec3 color, vec3 origin, vec3 ray, Uniforms u) {
|
|
510
|
-
if (u.parameters.y <= 0.0) { return color; }
|
|
511
|
-
const vec2 ring[8] =vec2[8](vec2(0.0,1.0),vec2(0.70710678,0.70710678),
|
|
512
|
-
vec2(1.0,0.0),vec2(0.70710678,-0.70710678),vec2(0.0,-1.0),
|
|
513
|
-
vec2(-0.70710678,-0.70710678),vec2(-1.0,0.0),vec2(-0.70710678,0.70710678));
|
|
514
|
-
// One convex fan of reflected facets, shared by every camera orientation.
|
|
515
|
-
// Clip the whole volume so adjoining facets never acquire dark seams.
|
|
516
|
-
const vec3 top = vec3(0.0,-0.28,0.0), tip = vec3(0.0,-1.06,0.0);
|
|
517
|
-
float entry = 0.0, exit = 1e5;
|
|
518
|
-
vec3 entryNormal = vec3(0.0,1.0,0.0);
|
|
519
|
-
vec3 worldRay = normalize((u.model*vec4(ray,0.0)).xyz);
|
|
520
|
-
vec3 illumination = normalize(vec3(-0.55,0.65,1.0));
|
|
521
|
-
vec3 sideColor = vec3(0.0);
|
|
522
|
-
float sideWeight = 0.0;
|
|
523
|
-
vec3 veilColor = vec3(0.0);
|
|
524
|
-
float veilWeight = 0.0;
|
|
525
|
-
for (uint i = 0u; i < 8u; ++i) {
|
|
526
|
-
vec2 current = ring[i], next = ring[(i+1u)%8u];
|
|
527
|
-
vec3 a = vec3(current.x*0.28,-0.68,current.y*0.28);
|
|
528
|
-
vec3 b = vec3(next.x*0.28,-0.68,next.y*0.28);
|
|
529
|
-
for (uint part = 0u; part < 2u; ++part) {
|
|
530
|
-
vec3 peak = part == 0u ? top : tip;
|
|
531
|
-
vec3 n = normalize(cross(a-peak,b-peak));
|
|
532
|
-
if (dot(n,(a+b+peak)/3.0-vec3(0.0,-0.68,0.0)) < 0.0) { n = -n; }
|
|
533
|
-
float denominator = dot(n,ray);
|
|
534
|
-
float side = dot(n,origin-peak);
|
|
535
|
-
if (abs(denominator) < 0.00001) {
|
|
536
|
-
if (side > 0.0) { exit = -1.0; }
|
|
537
|
-
} else {
|
|
538
|
-
float t = -side/denominator;
|
|
539
|
-
if (denominator < 0.0 && t > entry) { entry = t; entryNormal = n; }
|
|
540
|
-
if (denominator > 0.0) { exit = min(exit,t); }
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
vec3 radial = vec3(current.x,0.0,current.y);
|
|
544
|
-
vec3 tangent = vec3(current.y,0.0,-current.x);
|
|
545
|
-
// Broad, low-contrast echoes of the crown stretch through the volume
|
|
546
|
-
// towards the same lower junction. Adjacent planes meet without dark gaps.
|
|
547
|
-
// Continue the same planes above the girdle so their top fade stays
|
|
548
|
-
// hidden behind the crown, including the deeper, opposite reflections.
|
|
549
|
-
const float upperY = 0.20;
|
|
550
|
-
const float extension = (upperY+0.12)/0.65;
|
|
551
|
-
const float upperRadius = 0.64+(0.64-0.19)*extension;
|
|
552
|
-
const float upperWidth = 0.265097+(0.265097-0.078701)*extension;
|
|
553
|
-
vec3 upperLeft = radial*upperRadius - tangent*upperWidth + vec3(0.0,upperY,0.0);
|
|
554
|
-
vec3 upperRight = radial*upperRadius + tangent*upperWidth + vec3(0.0,upperY,0.0);
|
|
555
|
-
vec3 lowerLeft = radial*0.19 - tangent*0.078701 + vec3(0.0,-0.77,0.0);
|
|
556
|
-
vec3 lowerRight = radial*0.19 + tangent*0.078701 + vec3(0.0,-0.77,0.0);
|
|
557
|
-
vec3 ribbonCoordinates;
|
|
558
|
-
float ribbon = reflectionTriangle(origin,ray,upperLeft,upperRight,lowerLeft,ribbonCoordinates);
|
|
559
|
-
if (ribbon > 100.0) {
|
|
560
|
-
ribbon = reflectionTriangle(origin,ray,upperRight,lowerRight,lowerLeft,ribbonCoordinates);
|
|
561
|
-
}
|
|
562
|
-
if (ribbon < 100.0) {
|
|
563
|
-
vec3 hit = origin+ray*ribbon;
|
|
564
|
-
float depth = (-0.12-hit.y)/0.65;
|
|
565
|
-
float across = dot(hit,tangent);
|
|
566
|
-
float right = mix(0.265097,0.078701,depth), left = -right;
|
|
567
|
-
vec3 worldRadial = normalize((u.model*vec4(radial,0.0)).xyz);
|
|
568
|
-
float facing = saturate(-dot(worldRadial,worldRay));
|
|
569
|
-
float fade = smoothstep(0.0,0.065,upperY-hit.y)*(1.0-smoothstep(0.70,1.0,depth));
|
|
570
|
-
float opacity = fade*(0.16+0.84*facing);
|
|
571
|
-
float light = saturate(0.5+0.5*dot(worldRadial,illumination));
|
|
572
|
-
// Broad reflected facets fill the middle with restrained diagonal
|
|
573
|
-
// changes inputData tone, expressed inputData the fixed plane's own coordinates.
|
|
574
|
-
float acrossPlane = saturate((across-left)/(right-left));
|
|
575
|
-
float diagonal = smoothstep(-0.045,0.045,acrossPlane-0.35-depth*0.55);
|
|
576
|
-
float middle = smoothstep(0.12,0.24,depth)*(1.0-smoothstep(0.50,0.64,depth));
|
|
577
|
-
vec3 tint = mix(vec3(0.015,0.56,1.0),vec3(0.33,0.97,1.0),light);
|
|
578
|
-
tint = mix(tint,vec3(0.42,0.97,1.0),middle*(0.32-0.20*diagonal));
|
|
579
|
-
tint = mix(tint,vec3(0.015,0.46,1.0),diagonal*0.24);
|
|
580
|
-
veilColor += tint*opacity;
|
|
581
|
-
veilWeight += opacity;
|
|
582
|
-
}
|
|
583
|
-
vec3 aSide = radial*0.72 + tangent*0.055 + vec3(0.0,-0.30,0.0);
|
|
584
|
-
vec3 bSide = radial*0.49 - tangent*0.105 + vec3(0.0,-0.60,0.0);
|
|
585
|
-
vec3 cSide = radial*0.15 + tangent*0.020 + vec3(0.0,-0.93,0.0);
|
|
586
|
-
vec3 coordinates;
|
|
587
|
-
float t = reflectionTriangle(origin,ray,aSide,bSide,cSide,coordinates);
|
|
588
|
-
if (t < 100.0) {
|
|
589
|
-
vec3 worldRadial = normalize((u.model*vec4(radial,0.0)).xyz);
|
|
590
|
-
// Long glints read at the sides; a front-facing sector must not
|
|
591
|
-
// become an opaque needle inputData the middle of the stone.
|
|
592
|
-
float sideFacing = 1.0-abs(dot(worldRadial,worldRay));
|
|
593
|
-
float edge = min(coordinates.y,coordinates.z);
|
|
594
|
-
float opacity = smoothstep(0.20,0.75,sideFacing)
|
|
595
|
-
* smoothstep(0.0,0.085,edge) * smoothstep(0.0,0.035,coordinates.x);
|
|
596
|
-
float light = 0.5+0.5*dot(worldRadial,illumination);
|
|
597
|
-
vec3 tint = mix(vec3(0.16,0.80,1.0),vec3(0.85,1.0,1.0),light);
|
|
598
|
-
sideColor += tint*opacity;
|
|
599
|
-
sideWeight += opacity;
|
|
600
|
-
}
|
|
601
|
-
}
|
|
602
|
-
float strength = saturate(u.parameters.y/0.72);
|
|
603
|
-
if (veilWeight > 0.0) {
|
|
604
|
-
color = mix(color,veilColor/veilWeight,(1.0-exp(-veilWeight*0.46))*strength);
|
|
605
|
-
}
|
|
606
|
-
if (sideWeight > 0.0) {
|
|
607
|
-
color = mix(color,sideColor/sideWeight,(1.0-exp(-sideWeight*1.4))*strength);
|
|
608
|
-
}
|
|
609
|
-
{
|
|
610
|
-
// studioPanel uses screen derivatives. Evaluate it on both sides of the
|
|
611
|
-
// hull boundary; divergent execution produces dotted edges on Adreno.
|
|
612
|
-
vec3 hit = origin+ray*entry;
|
|
613
|
-
vec3 worldNormal = normalize((u.model*vec4(entryNormal,0.0)).xyz);
|
|
614
|
-
float light = saturate(dot(worldNormal,normalize(vec3(-0.65,0.15,1.0))));
|
|
615
|
-
float gleam = studioPanel(reflect(worldRay,worldNormal),
|
|
616
|
-
normalize(vec3(-0.35+0.15*sin(u.lightSweep.y),0.60,0.75)),vec2(0.25,0.65));
|
|
617
|
-
vec3 tint = mix(vec3(0.025,0.54,1.0),vec3(0.40,0.92,1.0),light);
|
|
618
|
-
tint = mix(tint,vec3(0.72,0.99,1.0),gleam*0.16);
|
|
619
|
-
float thickness = smoothstep(0.0,0.18,exit-entry);
|
|
620
|
-
float fade = smoothstep(-1.07,-0.93,hit.y);
|
|
621
|
-
color = mix(color,tint,0.28*thickness*fade*strength*(entry < exit ? 1.0 : 0.0));
|
|
622
|
-
}
|
|
623
|
-
return color;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
vec3 interior(vec3 p, vec3 direction, float pavilion, Uniforms u) {
|
|
627
|
-
vec3 accumulated = vec3(0.0);
|
|
628
|
-
float weight = 0.60;
|
|
629
|
-
vec3 origin = p + direction * 0.004;
|
|
630
|
-
for (uint bounce = 0u; bounce < 2u; ++bounce) {
|
|
631
|
-
vec3 n = vec3(0.0, 1.0, 0.0);
|
|
632
|
-
float distance = nearestExit(origin, direction, n);
|
|
633
|
-
if (distance > 100.0) { break; }
|
|
634
|
-
vec3 hit = origin + direction * distance;
|
|
635
|
-
vec3 outgoing = refract(direction, -n, 1.62);
|
|
636
|
-
vec3 reflection = reflect(direction, n);
|
|
637
|
-
vec3 color = internalEnvironment(hit,reflection,pavilion,u);
|
|
638
|
-
if (dot(outgoing,outgoing) > 0.01) {
|
|
639
|
-
// Fresnel approaches total internal reflection continuously; a hard
|
|
640
|
-
// switch between the two rays made whole patches change abruptly.
|
|
641
|
-
float incident = saturate(dot(direction,n));
|
|
642
|
-
float transmitted = saturate(dot(outgoing,n));
|
|
643
|
-
float rs = (1.62*incident-transmitted)/(1.62*incident+transmitted);
|
|
644
|
-
float rp = (incident-1.62*transmitted)/(incident+1.62*transmitted);
|
|
645
|
-
float reflectance = 0.5*(rs*rs+rp*rp);
|
|
646
|
-
color = mix(internalEnvironment(hit,outgoing,pavilion,u),color,reflectance);
|
|
647
|
-
}
|
|
648
|
-
color *= exp(-vec3(0.30, 0.07, 0.006) * distance);
|
|
649
|
-
accumulated += weight * color;
|
|
650
|
-
weight *= 0.52;
|
|
651
|
-
direction = reflection;
|
|
652
|
-
origin = hit + direction * 0.004;
|
|
653
|
-
}
|
|
654
|
-
return accumulated;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
vec3 materialPalette(vec3 color, vec3 facetWeights, uint appearance) {
|
|
658
|
-
switch (appearance) {
|
|
659
|
-
case 1u: {
|
|
660
|
-
// Keep the authored icy blue inputData the middle values: interpolating
|
|
661
|
-
// directly to white desaturates the crown into a cold grey.
|
|
662
|
-
float tone = smoothstep(0.0,0.92,saturate(dot(color.rg,vec2(0.22,0.78))));
|
|
663
|
-
vec3 shadow = mix(vec3(0.63,0.77,0.95),vec3(0.733,0.859,1.0),facetWeights.y*0.25);
|
|
664
|
-
const vec3 ice = vec3(207.0,241.0,253.0) / 255.0; // #cff1fd
|
|
665
|
-
vec3 upper = mix(shadow,ice,smoothstep(0.0,0.62,tone));
|
|
666
|
-
upper = mix(upper,vec3(1.0),smoothstep(0.58,1.0,tone)*0.92);
|
|
667
|
-
// Lift the pavilion while retaining a distinct shadow range below
|
|
668
|
-
// the white crown, with a little more blue inputData its lighter facets.
|
|
669
|
-
vec3 lower = mix(vec3(0.59,0.71,0.865),vec3(0.96,0.985,1.0),pow(tone,1.10));
|
|
670
|
-
return mix(upper,lower,facetWeights.z);
|
|
671
|
-
}
|
|
672
|
-
case 2u: {
|
|
673
|
-
float tone = smoothstep(0.035,0.90,saturate(dot(color.rg,vec2(0.20,0.80))));
|
|
674
|
-
vec3 cool = mix(vec3(0.025,0.29,0.83),vec3(0.38,0.78,1.0),smoothstep(0.0,0.65,tone));
|
|
675
|
-
vec3 upper = mix(cool,vec3(0.94,0.99,1.0),smoothstep(0.45,1.0,tone));
|
|
676
|
-
vec3 lower = mix(vec3(0.025,0.34,0.92),vec3(0.90,0.99,1.0),pow(tone,2.35));
|
|
677
|
-
return mix(upper,lower,facetWeights.z);
|
|
678
|
-
}
|
|
679
|
-
default: return color;
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
void glowPlane(vec4 plane, vec3 position, vec3 ray, vec3 localNormal,
|
|
684
|
-
inout float planeAlignment, inout float thickness) {
|
|
685
|
-
planeAlignment = max(planeAlignment,dot(plane.xyz,localNormal));
|
|
686
|
-
float denominator = dot(plane.xyz,ray);
|
|
687
|
-
if (denominator > 0.0001) {
|
|
688
|
-
float exit = -(dot(plane.xyz,position)+plane.w) / denominator;
|
|
689
|
-
thickness = min(thickness,max(0.0,exit));
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
|
|
693
|
-
vec3 coolInnerGlow(vec3 color, vec3 position, vec3 ray, vec3 normal, vec3 localNormal, vec3 view,
|
|
694
|
-
Uniforms u) {
|
|
695
|
-
// Thin parts transmit a white light band into the stone. The optical chord
|
|
696
|
-
// follows the 3D cut under every rotation, without expanding the silhouette.
|
|
697
|
-
float thickness = 1e5;
|
|
698
|
-
float planeAlignment = 0.0;
|
|
699
|
-
#define TEST_GLOW(I) glowPlane(planes[I], position, ray, localNormal, planeAlignment, thickness);
|
|
700
|
-
TEST_GLOW(0u) TEST_GLOW(1u) TEST_GLOW(2u) TEST_GLOW(3u) TEST_GLOW(4u) TEST_GLOW(5u)
|
|
701
|
-
TEST_GLOW(6u) TEST_GLOW(7u) TEST_GLOW(8u) TEST_GLOW(9u) TEST_GLOW(10u) TEST_GLOW(11u)
|
|
702
|
-
TEST_GLOW(12u) TEST_GLOW(13u) TEST_GLOW(14u) TEST_GLOW(15u) TEST_GLOW(16u)
|
|
703
|
-
#undef TEST_GLOW
|
|
704
|
-
// Scale the penetration with the taper: the tip gets a narrow rim,
|
|
705
|
-
// rather than filling with a solid white pool as its whole depth shrinks.
|
|
706
|
-
float crossSection = clamp((position.y+1.09)/0.98,0.07,1.0);
|
|
707
|
-
float inner = 1.0-smoothstep(0.01,0.80*crossSection,thickness);
|
|
708
|
-
float grazing = 1.0-saturate(dot(normal,view));
|
|
709
|
-
float roundedEdge = smoothstep(0.0015,0.028,1.0-planeAlignment);
|
|
710
|
-
float bevel = pow(grazing,3.0);
|
|
711
|
-
float glow = saturate(inner*0.85 + bevel*0.85 + roundedEdge*smoothstep(0.18,0.80,grazing));
|
|
712
|
-
return mix(color,vec3(0.96,1.0,1.0),glow);
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
vec4 diamondSurface(Raster inputData, Uniforms u) {
|
|
716
|
-
vec3 n = normalize(inputData.normal);
|
|
717
|
-
float cameraDistance = -u.projection[3].w / u.projection[2].w;
|
|
718
|
-
vec3 view = normalize(vec3(0.0, 0.0, cameraDistance) - inputData.worldPosition);
|
|
719
|
-
vec3 localView = (u.inverseModel * vec4(-view, 0.0)).xyz;
|
|
720
|
-
vec3 localNormal = normalize((u.inverseModel * vec4(n, 0.0)).xyz);
|
|
721
|
-
vec3 transmitted = refract(localView, localNormal, 1.0 / 1.62);
|
|
722
|
-
// Zero internal bounces on every device; retain the existing material mapping.
|
|
723
|
-
vec3 optical = vec3(0.0);
|
|
724
|
-
vec3 reflection = studio(reflect(-view, n), u.lightSweep.y);
|
|
725
|
-
float fresnel = 0.08 + 0.46 * pow(1.0 - saturate(dot(n, view)), 4.0);
|
|
726
|
-
|
|
727
|
-
float height = saturate((inputData.localPosition.y + 1.05) / 1.65);
|
|
728
|
-
float key = saturate(dot(n, normalize(vec3(-0.65, 0.85, 1.0))));
|
|
729
|
-
float left = saturate(0.52 - inputData.worldPosition.x * 0.43);
|
|
730
|
-
vec3 blue = vec3(0.008, 0.22, 1.0);
|
|
731
|
-
vec3 cyan = vec3(0.29, 0.87, 1.0);
|
|
732
|
-
vec3 body = mix(blue, cyan, saturate(key * 0.60 + left * 0.38));
|
|
733
|
-
float verticalBand = mix(0.5 + 0.5 * sin(height * 18.0 + n.x * 3.0),1.0,inputData.facetWeights.z);
|
|
734
|
-
body *= mix(vec3(0.24, 0.48, 0.96), vec3(1.0), verticalBand * 0.5 + 0.5);
|
|
735
|
-
float opticalLuminance = smoothstep(0.25, 0.85, optical.g);
|
|
736
|
-
// Give the pavilion a cyan body tone without changing reflection contrast
|
|
737
|
-
// or the subdued lower motif. Crown and table keep their existing palette.
|
|
738
|
-
vec3 opticalShadow = mix(vec3(0.005,0.13,1.0),vec3(0.015,0.36,1.0),inputData.facetWeights.z);
|
|
739
|
-
vec3 opticalLight = mix(vec3(0.58,0.97,1.0),vec3(0.45,0.99,1.0),inputData.facetWeights.z);
|
|
740
|
-
optical = mix(opticalShadow,opticalLight,opticalLuminance);
|
|
741
|
-
float opticalWeight = u.parameters.y * mix(0.90, 0.08, inputData.facetWeights.y);
|
|
742
|
-
vec3 color = mix(body, optical, opticalWeight);
|
|
743
|
-
color = mix(color, reflection, fresnel);
|
|
744
|
-
|
|
745
|
-
float crownGlow = smoothstep(0.10, 0.60, inputData.localPosition.y) * left;
|
|
746
|
-
color = mix(color, vec3(0.70, 0.99, 1.0), crownGlow * 0.58);
|
|
747
|
-
float crownLight = pow(saturate(dot(n, normalize(vec3(-0.38, 0.55, 1.0)))), 9.0);
|
|
748
|
-
crownLight *= smoothstep(-0.03, 0.28, inputData.localPosition.y);
|
|
749
|
-
color = mix(color, vec3(0.65, 0.98, 1.0), crownLight * 0.35);
|
|
750
|
-
vec3 facetBase = color;
|
|
751
|
-
if (inputData.facetWeights.y > 0.0) {
|
|
752
|
-
float softbox = exp(-pow((inputData.worldPosition.x + 0.42) * 1.6, 2.0)
|
|
753
|
-
-pow((inputData.worldPosition.y - 0.32) * 2.2, 2.0));
|
|
754
|
-
color = mix(color, vec3(0.71, 0.99, 1.0), softbox * crownLight * 0.36);
|
|
755
|
-
float shadow = pow(saturate(1.0 - key), 1.4);
|
|
756
|
-
color = mix(color, vec3(0.015, 0.08, 1.0), shadow * 0.7);
|
|
757
|
-
vec3 tangent = normalize(vec3(localNormal.z, 0.0, -localNormal.x));
|
|
758
|
-
vec2 authoredPosition = vec2(dot(inputData.localPosition, tangent) * 225.8 + n.x * 65.0,
|
|
759
|
-
(0.3065 - inputData.localPosition.y) * 244.0);
|
|
760
|
-
color = mix(referenceCrown(authoredPosition, u.crownGradient), color, 0.28);
|
|
761
|
-
color = mix(facetBase, color, inputData.facetWeights.y);
|
|
762
|
-
}
|
|
763
|
-
if (inputData.facetWeights.z > 0.0) {
|
|
764
|
-
color = mix(color,mix(vec3(0.008,0.32,1.0),optical,0.86),inputData.facetWeights.z*u.parameters.y);
|
|
765
|
-
}
|
|
766
|
-
float facetFlash = smoothstep(0.20, 0.78, opticalLuminance);
|
|
767
|
-
float flashWeight = mix(0.24,0.08,inputData.facetWeights.y);
|
|
768
|
-
color *= mix(vec3(1.0),mix(vec3(0.76, 0.82, 0.99), vec3(1.0), facetFlash),flashWeight);
|
|
769
|
-
color = mix(color, vec3(0.66, 0.98, 1.0), pow(facetFlash, 2.0) * 0.24 * flashWeight);
|
|
770
|
-
color = lateralDepth(color, n, inputData.localPosition.y, inputData.facetWeights, opticalLuminance);
|
|
771
|
-
color = mix(color,optical,inputData.facetWeights.z*u.parameters.y*0.48);
|
|
772
|
-
color = mix(color,body,inputData.facetWeights.z*pow(saturate(n.z),2.0)*0.32);
|
|
773
|
-
vec3 rearRay = normalize(mix(localView,transmitted,mix(0.68,0.18,inputData.facetWeights.y)));
|
|
774
|
-
// Disable the opposite-face ray independently of the lower-facet reflections.
|
|
775
|
-
vec4 rear = vec4(0.0);
|
|
776
|
-
float transmission = mix(0.34,0.12+u.lightSweep.z*0.65,inputData.facetWeights.y) * u.parameters.y;
|
|
777
|
-
float facing = smoothstep(0.12,0.65,n.z);
|
|
778
|
-
color = mix(color,rear.rgb,rear.a*transmission*facing*mix(1.0,0.12,inputData.facetWeights.y));
|
|
779
|
-
if (inputData.facetWeights.z > 0.0) {
|
|
780
|
-
vec3 detailRay = normalize(mix(localView,transmitted,0.16));
|
|
781
|
-
color = mix(color,pavilionReflections(color,inputData.localPosition,detailRay,u),inputData.facetWeights.z);
|
|
782
|
-
}
|
|
783
|
-
float tipGlow = pow(saturate((-inputData.localPosition.y - 0.55) / 0.50), 2.0);
|
|
784
|
-
color = mix(color, vec3(0.57, 0.96, 1.0), tipGlow * 0.20);
|
|
785
|
-
// A shallow, translucent image of the table, like Layer 36.0 inputData Lottie.
|
|
786
|
-
// Its optical footprint is smaller than the rounded outer shoulder.
|
|
787
|
-
vec3 tableRay = localView;
|
|
788
|
-
tableRay.y *= 0.72;
|
|
789
|
-
if (tableRay.y > 0.001) {
|
|
790
|
-
float tableHeight = -planes[0].w / planes[0].y;
|
|
791
|
-
float distance = (tableHeight-inputData.localPosition.y)/tableRay.y;
|
|
792
|
-
vec2 hit = (inputData.localPosition + tableRay*distance).xz;
|
|
793
|
-
const float extent = 0.632;
|
|
794
|
-
const float corner = 0.285;
|
|
795
|
-
vec2 q = abs(hit);
|
|
796
|
-
float edge = max(max(q.x,q.y)-extent, (q.x+q.y-extent-corner)*0.70710678);
|
|
797
|
-
float aa = max(fwidth(edge),0.001);
|
|
798
|
-
float coverage = 1.0-smoothstep(-aa,aa,edge);
|
|
799
|
-
vec2 direction = tableRay.xz / max(length(tableRay.xz),0.0001);
|
|
800
|
-
float depth = saturate(0.5+dot(hit,direction)/(2.0*extent));
|
|
801
|
-
// Source opacity: 80.0% group opacity times a 49...65% fill gradient.
|
|
802
|
-
float opacity = mix(0.39,0.52,depth);
|
|
803
|
-
color = mix(color,vec3(0.765,0.988,1.0),coverage*opacity
|
|
804
|
-
*saturate(u.parameters.y/0.72)*inputData.facetWeights.y);
|
|
805
|
-
}
|
|
806
|
-
color = illustratedFacets(color, inputData, u);
|
|
807
|
-
color = mix(color, vec3(0.63, 0.96, 1.0), 0.58 * inputData.facetWeights.x);
|
|
808
|
-
float sweep = facetSweep(inputData,localNormal,u);
|
|
809
|
-
float sweepCore = smoothstep(0.35,1.0,sweep);
|
|
810
|
-
color = mix(color,vec3(0.592,0.953,1.0),sweep*0.20+sweepCore*sweepCore*0.62);
|
|
811
|
-
color = surfaceFinish(color,polishedNormal(inputData,localNormal,u),view,u);
|
|
812
|
-
color = materialPalette(color,inputData.facetWeights,uint(u.appearance.x));
|
|
813
|
-
if (uint(u.appearance.x) == 2u) {
|
|
814
|
-
color = coolInnerGlow(color,inputData.localPosition,localView,n,localNormal,view,u);
|
|
815
|
-
}
|
|
816
|
-
if (uint(u.appearance.x) == 1u) {
|
|
817
|
-
// Source facet flashes stay on the physical front/side planes, including
|
|
818
|
-
// their rounded transitions. They never become screen-space overlays.
|
|
819
|
-
vec2 direction = normalize(localNormal.xz + vec2(0.0,0.00001));
|
|
820
|
-
float side = smoothstep(0.18,0.65,abs(direction.x));
|
|
821
|
-
float front = smoothstep(0.02,0.32,direction.y);
|
|
822
|
-
vec3 regions = vec3(1.0-side, side*step(0.0,direction.x), side*(1.0-step(0.0,direction.x))) * front;
|
|
823
|
-
float alpha = dot(regions,u.referenceCrownFlash.xyz)*inputData.facetWeights.y
|
|
824
|
-
+ dot(regions,u.referencePavilionFlash.xyz)*inputData.facetWeights.z;
|
|
825
|
-
float referenceFacing = smoothstep(0.0,0.2,(u.model * vec4(0.0,0.0,1.0,0.0)).z);
|
|
826
|
-
color = mix(color,vec3(1.0),alpha*referenceFacing);
|
|
827
|
-
}
|
|
828
|
-
float whiten = u.appearance.y;
|
|
829
|
-
if (whiten > 0.0) {
|
|
830
|
-
float w = pow(whiten, 0.7);
|
|
831
|
-
float luma = dot(color, vec3(0.2126, 0.7152, 0.0722));
|
|
832
|
-
float lift = smoothstep(0.32, 0.62, luma);
|
|
833
|
-
vec3 glass = mix(vec3(0.07, 0.33, 0.95), vec3(1.0), lift);
|
|
834
|
-
float rim = pow(1.0 - saturate(abs(n.z)), 2.2);
|
|
835
|
-
glass = mix(glass, vec3(1.0), rim * 0.8);
|
|
836
|
-
float seam = saturate(length(fwidth(n)) * 5.5);
|
|
837
|
-
glass = mix(glass, vec3(1.0), seam * 0.85);
|
|
838
|
-
glass = max(glass, vec3(smoothstep(0.62, 0.95, luma)));
|
|
839
|
-
color = mix(color, glass, w);
|
|
840
|
-
float alpha = mix(1.0, mix(0.34, 0.94, max(lift, max(rim, seam))), w);
|
|
841
|
-
return vec4(saturate(color * u.parameters.z) * alpha, alpha);
|
|
842
|
-
}
|
|
843
|
-
return vec4(saturate(color * u.parameters.z), 1.0);
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
out vec4 fragColor;
|
|
847
|
-
|
|
848
|
-
void main(){
|
|
849
|
-
Raster inputData;
|
|
850
|
-
inputData.localPosition=v_localPosition;
|
|
851
|
-
inputData.normal=v_normal;
|
|
852
|
-
inputData.worldPosition=v_worldPosition;
|
|
853
|
-
inputData.facetWeights=v_facetWeights;
|
|
854
|
-
|
|
855
|
-
fragColor = diamondSurface(inputData, u);
|
|
856
|
-
|
|
857
|
-
}
|
|
858
|
-
`,Jl=`#version 300 es
|
|
859
|
-
precision highp float;
|
|
860
|
-
precision highp int;
|
|
861
|
-
#define saturate(x) clamp(x,0.0,1.0)
|
|
862
|
-
struct Vertex { vec4 position; vec4 normal; vec4 surface; };
|
|
863
|
-
struct Uniforms {
|
|
864
|
-
mat4 model;
|
|
865
|
-
mat4 projection;
|
|
866
|
-
mat4 inverseModel;
|
|
867
|
-
vec4 parameters; // time, refraction, brightness, sparkles
|
|
868
|
-
vec4 viewport; // width, height, optical plane count, unused
|
|
869
|
-
vec4 sparkleShape; // main layer scale, contour morph, core scale, star glow scale
|
|
870
|
-
vec4 sparkleHalo; // circular glow scale, main face rotation, horizontal correction, visibility
|
|
871
|
-
vec4 crownGradient;
|
|
872
|
-
vec4 pavilionGradient;
|
|
873
|
-
vec4 lightSweep; // diagonal position, environment phase, transmission, reserved
|
|
874
|
-
vec4 facetProjection; // reference pitch cosine/sine, source units, projected top
|
|
875
|
-
vec4 crownSweep;
|
|
876
|
-
vec4 rightCrownSweep;
|
|
877
|
-
vec4 leftCrownSweep;
|
|
878
|
-
vec4 pavilionSweep;
|
|
879
|
-
vec4 rightPavilionSweep;
|
|
880
|
-
vec4 leftPavilionSweep;
|
|
881
|
-
vec4 appearance; // palette identifier, reserved
|
|
882
|
-
vec4 referenceCrownFlash;
|
|
883
|
-
vec4 referencePavilionFlash;
|
|
884
|
-
};
|
|
885
|
-
struct Raster {
|
|
886
|
-
vec4 position ;
|
|
887
|
-
vec3 localPosition;
|
|
888
|
-
vec3 normal;
|
|
889
|
-
vec3 worldPosition;
|
|
890
|
-
vec3 facetWeights; // table, crown, pavilion; interpolated across rounded edges
|
|
891
|
-
};
|
|
892
|
-
struct SparkleVertex { vec4 contours; vec4 material; };
|
|
893
|
-
struct SparkleRaster {
|
|
894
|
-
vec4 position ;
|
|
895
|
-
vec2 sourcePoint;
|
|
896
|
-
float strength ;
|
|
897
|
-
uint layer ;
|
|
898
|
-
};
|
|
899
|
-
struct SparkleAnchor { vec4 position; vec4 normal; };
|
|
900
|
-
uniform Uniforms u;
|
|
901
|
-
uniform vec4 planes[17];
|
|
902
|
-
uniform SparkleAnchor anchors[8];
|
|
903
|
-
out vec3 v_localPosition;
|
|
904
|
-
out vec3 v_normal;
|
|
905
|
-
out vec3 v_worldPosition;
|
|
906
|
-
out vec3 v_facetWeights;
|
|
907
|
-
layout(location=0) in vec4 a_position; layout(location=1) in vec4 a_normal; layout(location=2) in vec4 a_surface;
|
|
908
|
-
|
|
909
|
-
void main(){
|
|
910
|
-
|
|
911
|
-
Vertex v = Vertex(a_position,a_normal,a_surface);
|
|
912
|
-
vec4 world = u.model * v.position;
|
|
913
|
-
Raster result;
|
|
914
|
-
result.position = u.projection * world;
|
|
915
|
-
result.localPosition = v.position.xyz;
|
|
916
|
-
result.normal = normalize((u.model * v.normal).xyz);
|
|
917
|
-
result.worldPosition = world.xyz;
|
|
918
|
-
result.facetWeights = v.surface.z == 3.0 ? vec3(v.surface.xy, 1.0-v.surface.x-v.surface.y)
|
|
919
|
-
: vec3(v.surface.z == 0.0, v.surface.z == 1.0, v.surface.z == 2.0);
|
|
920
|
-
gl_Position=result.position; gl_Position.z=gl_Position.z*2.0-gl_Position.w;
|
|
921
|
-
v_localPosition=result.localPosition;
|
|
922
|
-
v_normal=result.normal;
|
|
923
|
-
v_worldPosition=result.worldPosition;
|
|
924
|
-
v_facetWeights=result.facetWeights;
|
|
925
|
-
|
|
926
|
-
}
|
|
927
|
-
`,Yl=`#version 300 es
|
|
928
|
-
precision highp float;
|
|
929
|
-
precision highp int;
|
|
930
|
-
#define saturate(x) clamp(x,0.0,1.0)
|
|
931
|
-
struct Vertex { vec4 position; vec4 normal; vec4 surface; };
|
|
932
|
-
struct Uniforms {
|
|
933
|
-
mat4 model;
|
|
934
|
-
mat4 projection;
|
|
935
|
-
mat4 inverseModel;
|
|
936
|
-
vec4 parameters; // time, refraction, brightness, sparkles
|
|
937
|
-
vec4 viewport; // width, height, optical plane count, unused
|
|
938
|
-
vec4 sparkleShape; // main layer scale, contour morph, core scale, star glow scale
|
|
939
|
-
vec4 sparkleHalo; // circular glow scale, main face rotation, horizontal correction, visibility
|
|
940
|
-
vec4 crownGradient;
|
|
941
|
-
vec4 pavilionGradient;
|
|
942
|
-
vec4 lightSweep; // diagonal position, environment phase, transmission, reserved
|
|
943
|
-
vec4 facetProjection; // reference pitch cosine/sine, source units, projected top
|
|
944
|
-
vec4 crownSweep;
|
|
945
|
-
vec4 rightCrownSweep;
|
|
946
|
-
vec4 leftCrownSweep;
|
|
947
|
-
vec4 pavilionSweep;
|
|
948
|
-
vec4 rightPavilionSweep;
|
|
949
|
-
vec4 leftPavilionSweep;
|
|
950
|
-
vec4 appearance; // palette identifier, reserved
|
|
951
|
-
vec4 referenceCrownFlash;
|
|
952
|
-
vec4 referencePavilionFlash;
|
|
953
|
-
};
|
|
954
|
-
struct Raster {
|
|
955
|
-
vec4 position ;
|
|
956
|
-
vec3 localPosition;
|
|
957
|
-
vec3 normal;
|
|
958
|
-
vec3 worldPosition;
|
|
959
|
-
vec3 facetWeights; // table, crown, pavilion; interpolated across rounded edges
|
|
960
|
-
};
|
|
961
|
-
struct SparkleVertex { vec4 contours; vec4 material; };
|
|
962
|
-
struct SparkleRaster {
|
|
963
|
-
vec4 position ;
|
|
964
|
-
vec2 sourcePoint;
|
|
965
|
-
float strength ;
|
|
966
|
-
uint layer ;
|
|
967
|
-
};
|
|
968
|
-
struct SparkleAnchor { vec4 position; vec4 normal; };
|
|
969
|
-
uniform Uniforms u;
|
|
970
|
-
uniform vec4 planes[17];
|
|
971
|
-
uniform SparkleAnchor anchors[8];
|
|
972
|
-
in vec2 v_sourcePoint;
|
|
973
|
-
flat in float v_strength;
|
|
974
|
-
flat in uint v_layer;
|
|
975
|
-
float radialOpacity(float radius, float first, float middle) {
|
|
976
|
-
if (radius <= first) { return 1.0; }
|
|
977
|
-
if (radius <= middle) { return mix(1.0, 0.5, (radius-first)/(middle-first)); }
|
|
978
|
-
return 0.5 * saturate((1.0-radius)/(1.0-middle));
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
out vec4 fragColor;
|
|
982
|
-
|
|
983
|
-
void main(){
|
|
984
|
-
SparkleRaster inputData;
|
|
985
|
-
inputData.sourcePoint=v_sourcePoint;
|
|
986
|
-
inputData.strength=v_strength;
|
|
987
|
-
inputData.layer=v_layer;
|
|
988
|
-
|
|
989
|
-
float alpha = 1.0;
|
|
990
|
-
vec3 color = vec3(1.0);
|
|
991
|
-
if (inputData.layer == 0u) {
|
|
992
|
-
float r = length(inputData.sourcePoint - vec2(-0.5, 0.2)) / 108.5;
|
|
993
|
-
alpha = radialOpacity(r, 0.312, 0.624) * 0.60;
|
|
994
|
-
} else if (inputData.layer == 1u) {
|
|
995
|
-
float r = length(inputData.sourcePoint - vec2(-0.5, 0.9)) / 113.1;
|
|
996
|
-
alpha = radialOpacity(r, 0.297, 0.503) * 0.60;
|
|
997
|
-
color = vec3(0.82, 1.0, 0.902);
|
|
998
|
-
} else if (inputData.layer == 2u) {
|
|
999
|
-
alpha = 0.96;
|
|
1000
|
-
} else if (inputData.layer == 3u) {
|
|
1001
|
-
float r = saturate(length(inputData.sourcePoint) / length(vec2(176.0, -170.0)));
|
|
1002
|
-
alpha = 1.0 - r;
|
|
1003
|
-
color = mix(vec3(0.694, 0.969, 1.0), vec3(0.663, 0.957, 1.0), r);
|
|
1004
|
-
} else if (inputData.layer == 5u) {
|
|
1005
|
-
alpha = radialOpacity(length(inputData.sourcePoint) / length(vec2(228.9, 3.9)), 0.237, 0.623);
|
|
1006
|
-
}
|
|
1007
|
-
if (uint(u.appearance.x) == 1u) {
|
|
1008
|
-
color = inputData.layer == 0u ? vec3(0.635,0.749,1.0) : vec3(1.0);
|
|
1009
|
-
// The white source retains only the circular halo, without the extra
|
|
1010
|
-
// star-shaped glow used by the blue material.
|
|
1011
|
-
if (inputData.layer == 1u) { alpha = 0.0; }
|
|
1012
|
-
} else if (uint(u.appearance.x) == 2u) {
|
|
1013
|
-
color = inputData.layer == 1u ? vec3(0.82,0.96,1.0) : vec3(1.0);
|
|
1014
|
-
}
|
|
1015
|
-
alpha *= inputData.strength;
|
|
1016
|
-
fragColor = vec4(color * alpha, alpha);
|
|
1017
|
-
|
|
1018
|
-
}
|
|
1019
|
-
`,Xl=`#version 300 es
|
|
1020
|
-
precision highp float;
|
|
1021
|
-
precision highp int;
|
|
1022
|
-
#define saturate(x) clamp(x,0.0,1.0)
|
|
1023
|
-
struct Vertex { vec4 position; vec4 normal; vec4 surface; };
|
|
1024
|
-
struct Uniforms {
|
|
1025
|
-
mat4 model;
|
|
1026
|
-
mat4 projection;
|
|
1027
|
-
mat4 inverseModel;
|
|
1028
|
-
vec4 parameters; // time, refraction, brightness, sparkles
|
|
1029
|
-
vec4 viewport; // width, height, optical plane count, unused
|
|
1030
|
-
vec4 sparkleShape; // main layer scale, contour morph, core scale, star glow scale
|
|
1031
|
-
vec4 sparkleHalo; // circular glow scale, main face rotation, horizontal correction, visibility
|
|
1032
|
-
vec4 crownGradient;
|
|
1033
|
-
vec4 pavilionGradient;
|
|
1034
|
-
vec4 lightSweep; // diagonal position, environment phase, transmission, reserved
|
|
1035
|
-
vec4 facetProjection; // reference pitch cosine/sine, source units, projected top
|
|
1036
|
-
vec4 crownSweep;
|
|
1037
|
-
vec4 rightCrownSweep;
|
|
1038
|
-
vec4 leftCrownSweep;
|
|
1039
|
-
vec4 pavilionSweep;
|
|
1040
|
-
vec4 rightPavilionSweep;
|
|
1041
|
-
vec4 leftPavilionSweep;
|
|
1042
|
-
vec4 appearance; // palette identifier, reserved
|
|
1043
|
-
vec4 referenceCrownFlash;
|
|
1044
|
-
vec4 referencePavilionFlash;
|
|
1045
|
-
};
|
|
1046
|
-
struct Raster {
|
|
1047
|
-
vec4 position ;
|
|
1048
|
-
vec3 localPosition;
|
|
1049
|
-
vec3 normal;
|
|
1050
|
-
vec3 worldPosition;
|
|
1051
|
-
vec3 facetWeights; // table, crown, pavilion; interpolated across rounded edges
|
|
1052
|
-
};
|
|
1053
|
-
struct SparkleVertex { vec4 contours; vec4 material; };
|
|
1054
|
-
struct SparkleRaster {
|
|
1055
|
-
vec4 position ;
|
|
1056
|
-
vec2 sourcePoint;
|
|
1057
|
-
float strength ;
|
|
1058
|
-
uint layer ;
|
|
1059
|
-
};
|
|
1060
|
-
struct SparkleAnchor { vec4 position; vec4 normal; };
|
|
1061
|
-
uniform Uniforms u;
|
|
1062
|
-
uniform vec4 planes[17];
|
|
1063
|
-
uniform SparkleAnchor anchors[8];
|
|
1064
|
-
out vec2 v_sourcePoint;
|
|
1065
|
-
flat out float v_strength;
|
|
1066
|
-
flat out uint v_layer;
|
|
1067
|
-
layout(location=0) in vec4 a_contours; layout(location=1) in vec4 a_material; uniform uint baseInstance;
|
|
1068
|
-
|
|
1069
|
-
void main(){
|
|
1070
|
-
|
|
1071
|
-
SparkleVertex v = SparkleVertex(a_contours,a_material);
|
|
1072
|
-
uint instance=uint(gl_InstanceID)+baseInstance;
|
|
1073
|
-
uint layer = uint(v.material.x);
|
|
1074
|
-
const float authoringToWorld = 2.0 / 447.9;
|
|
1075
|
-
vec3 local = anchors[instance].position.xyz;
|
|
1076
|
-
vec3 normal = anchors[instance].normal.xyz;
|
|
1077
|
-
if (instance == 0u) {
|
|
1078
|
-
float c = cos(u.sparkleHalo.y), s = sin(u.sparkleHalo.y);
|
|
1079
|
-
local.xz = vec2(c*local.x + s*local.z, -s*local.x + c*local.z);
|
|
1080
|
-
normal.xz = vec2(c*normal.x + s*normal.z, -s*normal.x + c*normal.z);
|
|
1081
|
-
}
|
|
1082
|
-
if (instance != 0u) { local += normal * 0.008; }
|
|
1083
|
-
vec3 worldNormal = (u.model * vec4(normal, 0.0)).xyz;
|
|
1084
|
-
float pulse = pow(max(0.0, sin(u.parameters.x * 2.1 + float(instance) * 2.37 + 1.5)), 16.0);
|
|
1085
|
-
float front = instance == 0u ? u.sparkleHalo.w : smoothstep(0.15, 0.55, worldNormal.z);
|
|
1086
|
-
float strength = front * u.parameters.w;
|
|
1087
|
-
vec4 center = u.projection * u.model * vec4(local, 1.0);
|
|
1088
|
-
if (u.viewport.w > 0.0) {
|
|
1089
|
-
center = vec4(0.0, 0.0, 0.5, 1.0);
|
|
1090
|
-
strength = instance == 0u ? u.parameters.w : 0.0;
|
|
1091
|
-
}
|
|
1092
|
-
float morph = instance == 0u ? u.sparkleShape.y : 0.0;
|
|
1093
|
-
vec2 sourcePoint = mix(v.contours.xy, v.contours.zw, morph);
|
|
1094
|
-
float groupScale = 1.0;
|
|
1095
|
-
vec2 offset = vec2(0.0);
|
|
1096
|
-
if (layer == 0u) { groupScale = u.sparkleHalo.x; offset.y = 5.9; }
|
|
1097
|
-
if (layer == 1u) { groupScale = u.sparkleShape.w; offset.y = -0.8; }
|
|
1098
|
-
if (layer == 2u) { groupScale = u.sparkleShape.z; offset.y = -0.9; }
|
|
1099
|
-
if (layer == 3u) { groupScale = 0.309; offset = vec2(0.6, -0.4); }
|
|
1100
|
-
float mainEnvelope = u.viewport.w > 0.0 ? 1.0 : u.sparkleHalo.w;
|
|
1101
|
-
float scale = instance == 0u ? u.sparkleShape.x * mainEnvelope : (0.632 / 0.75) * pulse;
|
|
1102
|
-
vec2 point = (sourcePoint * groupScale + offset) * authoringToWorld * scale;
|
|
1103
|
-
SparkleRaster result;
|
|
1104
|
-
// Correct the anchor with the gem, but keep the authored flare proportions.
|
|
1105
|
-
result.position = center + center.w * vec4(point.x * u.projection[0][0] / u.sparkleHalo.z,
|
|
1106
|
-
-point.y * u.projection[1][1], 0.0, 0.0);
|
|
1107
|
-
result.sourcePoint = sourcePoint;
|
|
1108
|
-
result.strength = strength;
|
|
1109
|
-
result.layer = layer;
|
|
1110
|
-
gl_Position=result.position; gl_Position.z=gl_Position.z*2.0-gl_Position.w;
|
|
1111
|
-
v_sourcePoint=result.sourcePoint;
|
|
1112
|
-
v_strength=result.strength;
|
|
1113
|
-
v_layer=result.layer;
|
|
1114
|
-
|
|
1115
|
-
}
|
|
1116
|
-
`,Zl=4,Ql=4,$l=16,eu=3,tu=2,nu=0,ru=42,iu=240,au=1440,ou=36,su=40,cu=[`crownGradient`,`pavilionGradient`,`lightSweep`,`crownSweep`,`rightCrownSweep`,`leftCrownSweep`,`pavilionSweep`,`rightPavilionSweep`,`leftPavilionSweep`],lu=[`model`,`inverseModel`,`projection`],uu=[`parameters`,`viewport`,`sparkleShape`,`sparkleHalo`,`facetProjection`,`appearance`,...cu],du=17,fu=.72,pu=1.52,mu=.9975,hu=6,gu=.5,_u=.12,vu=3,yu=90,bu=360/Math.PI,xu=.035,Su=Math.sin(.25),Cu=Math.sin(.96),wu=Math.PI/2,Tu=4,Eu=8,Du=7,Ou=Math.PI/15,ku=2/15*Math.PI,Au=.06,ju=.34,Mu=.001,Nu=.596,Pu=1/60,Fu=.1,Iu=10.54,Lu;function Ru(e,t){return t===void 0?Pu:Math.min(Fu,(e-t)/1e3)}function zu(e){return A(this,null,function*(){let t=Wu(e,Jl,ql),n=Wu(e,Xl,Yl),[r]=yield Promise.all([Bu(),Ku(e,[t,n])]);return Hu(e,r,{diamondProgram:qu(e,t),sparkleProgram:qu(e,n),diamond:Ju(e,r.vertices,eu),mainSparkle:Ju(e,r.mainSparkle,tu),smallSparkles:Ju(e,r.smallSparkles,tu)})})}function Bu(){return Lu||(Lu=Vu(),Lu.catch(()=>{Lu=void 0})),Lu}function Vu(){return A(this,null,function*(){let[e,t,n,r,i,a,o,s,c]=yield Promise.all([Uu(`vertices`),Uu(`main`),Uu(`small`),Uu(`frames`),Uu(`planes`),Uu(`anchors`),Uu(`widths`),Uu(`facetProjection`),Uu(`camera`)]);if(r.length!==1441*ru||i.length!==68||a.length!==64||o.length!==91||s.length!==Zl||c.length!==vu)throw Error(`Unexpected diamond model data`);return{vertices:e,mainSparkle:t,smallSparkles:n,frames:r,planes:i,anchors:a,widths:o,facetProjection:s,camera:c}})}function Hu(e,t,n){let{frames:r,planes:i,anchors:a,widths:o,facetProjection:s,camera:c}=t,{diamondProgram:l,sparkleProgram:u,diamond:d,mainSparkle:f,smallSparkles:p}=n,m=c[0],h=new Float32Array(ru),g=new Float32Array($l),_=new Float32Array($l),v=Yu(1,c,o[0]),y=v[0];e.depthFunc(e.LEQUAL),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.enable(e.SCISSOR_TEST),[l,u].forEach(C);function b(t,n,r,i,a,s){x(r);let c=Math.cos(s),h=s+m;S(h,a);let g=Xu(a,h,o);v[0]=y*g;let _=0,b=-1;for(let e=0;e<Tu;e++){let t=e*2*Math.PI/Tu,n=c*Math.cos(a+t);n>b&&(b=n,_=t)}let{lastYaw:C,lastTilt:te}=t,ne=C===void 0||te===void 0||i<=0?Nu:Math.hypot(Math.atan2(Math.sin(a-C),Math.cos(a-C)),h-te)/i;t.lastYaw=a,t.lastTilt=h;let re=Wl(1-Math.acos(Wl(b,-1,1))/Ou,0,1),ie=Qu(Wl((ku/Math.max(ne,Mu)-Au)/ju,0,1))*Qu(re),{x:ae,y:oe,size:se}=n;e.viewport(ae,oe,se,se),e.scissor(ae,oe,se,se),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),ee(l,se,r,_,g,ie),e.disable(e.BLEND),e.enable(e.DEPTH_TEST),e.enable(e.CULL_FACE),e.bindVertexArray(d.vao),e.drawArrays(e.TRIANGLES,0,d.vertexCount),ee(u,se,r,_,g,ie),e.enable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.bindVertexArray(f.vao),e.uniform1ui(u.uniforms.baseInstance,0),e.drawArraysInstanced(e.TRIANGLES,0,f.vertexCount,1),e.bindVertexArray(p.vao),e.uniform1ui(u.uniforms.baseInstance,1),e.drawArraysInstanced(e.TRIANGLES,0,p.vertexCount,Du)}function x(e){let t=e*iu%au,n=Math.floor(t),i=t-n,a=n*ru;for(let e=0;e<ru;e++)h[e]=Gl(r[a+e],r[a+ru+e],i)}function S(e,t){let n=Math.sin(e),r=Math.cos(e),i=Math.sin(t),a=Math.cos(t);g.set([a,n*i,-r*i,0,0,r,n,0,i,-n*a,r*a,0,0,0,0,1]),_.set([a,0,i,0,n*i,r,-n*a,0,-r*i,n,r*a,0,0,0,0,1])}function C({program:t,uniforms:n}){e.useProgram(t),e.uniform4f(n.appearance,nu,0,0,0),e.uniform4fv(n.planes,i),e.uniform4fv(n.facetProjection,s);for(let t=0;t<Eu;t++)e.uniform4fv(n[`anchors[${t}].position`],a,t*2*Zl,Zl),e.uniform4fv(n[`anchors[${t}].normal`],a,(t*2+1)*Zl,Zl)}function ee({program:t,uniforms:n},r,i,a,o,s){e.useProgram(t),e.uniform4f(n.viewport,r,r,du,0),e.uniformMatrix4fv(n.model,!1,g),e.uniformMatrix4fv(n.inverseModel,!1,_),e.uniformMatrix4fv(n.projection,!1,v),e.uniform4f(n.parameters,i,fu,1,1),e.uniform4fv(n.sparkleShape,h,ou,Zl),e.uniform4f(n.sparkleHalo,h[su],a,o,s),cu.forEach((t,r)=>{e.uniform4fv(n[t],h,r*Zl,Zl)})}return{draw:b}}function Uu(e){return A(this,null,function*(){let t=`${Kl}${e}.bin`,n=yield fetch(t);if(!n.ok)throw Error(`Cannot load ${t}`);return new Float32Array(yield n.arrayBuffer())})}function Wu(e,t,n){let r=e.createProgram();return e.attachShader(r,Gu(e,e.VERTEX_SHADER,t)),e.attachShader(r,Gu(e,e.FRAGMENT_SHADER,n)),e.linkProgram(r),r}function Gu(e,t,n){let r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}function Ku(e,t){return A(this,null,function*(){let n=e.getExtension(`KHR_parallel_shader_compile`);if(n)for(;!t.every(t=>e.getProgramParameter(t,n.COMPLETION_STATUS_KHR));)yield new Promise(e=>requestAnimationFrame(e))})}function qu(e,t){if(!e.getProgramParameter(t,e.LINK_STATUS))throw Error(e.getProgramInfoLog(t)||`Cannot link diamond shaders`);let n={planes:e.getUniformLocation(t,`planes[0]`),baseInstance:e.getUniformLocation(t,`baseInstance`)};[...lu,...uu].forEach(r=>{n[r]=e.getUniformLocation(t,`u.${r}`)});for(let r=0;r<Eu;r++)[`position`,`normal`].forEach(i=>{let a=`anchors[${r}].${i}`;n[a]=e.getUniformLocation(t,a)});return{program:t,uniforms:n}}function Ju(e,t,n){let r=e.createVertexArray();e.bindVertexArray(r),e.bindBuffer(e.ARRAY_BUFFER,e.createBuffer()),e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW);let i=n*Zl*Ql;for(let t=0;t<n;t++)e.enableVertexAttribArray(t),e.vertexAttribPointer(t,Zl,e.FLOAT,!1,i,t*Zl*Ql);return{vao:r,vertexCount:t.length/(n*Zl)}}function Yu(e,t,n){let r=t[1],i=t[2],a=Math.max(1,1/e)*pu*(n/mu),o=1/i,s=-o/r,c=_u/a;return new Float32Array([1/(e*a),0,0,0,0,1/a,0,0,0,c*s,-o/hu,s,0,c*o,gu*o,o])}function Xu(e,t,n){let r=Math.abs(e-Math.round(e/wu)*wu),i=Math.min(yu,r*bu),a=Math.min(89,Math.floor(i)),o=Zu(n,a,i-a),s=(1-xu*na(Math.sin(2*r),2))*n[0];return 1+(1-Qu(Wl((Math.abs(Math.sin(t))-Su)/(Cu-Su),0,1)))*(s/o-1)}function Zu(e,t,n){let r=e[t],i=e[t+1],a=t===0?0:(i-e[t-1])/2,o=t+2>=e.length?0:(e[t+2]-r)/2;return((((r-i)*2+a+o)*n+((i-r)*3-a*2-o))*n+a)*n+r}function Qu(e){return e*e*(3-2*e)}var $u=K.div`
|
|
1117
|
-
position: relative;
|
|
1118
|
-
flex-shrink: 0;
|
|
1119
|
-
`,ed=K.img`
|
|
1120
|
-
display: block;
|
|
1121
|
-
width: 100%;
|
|
1122
|
-
height: 100%;
|
|
1123
|
-
`,td=K.img`
|
|
1124
|
-
pointer-events: none;
|
|
1125
|
-
|
|
1126
|
-
position: absolute;
|
|
1127
|
-
top: 0;
|
|
1128
|
-
left: 0;
|
|
1129
|
-
|
|
1130
|
-
width: 100%;
|
|
1131
|
-
height: 100%;
|
|
1132
|
-
`,nd=K.div`
|
|
1133
|
-
width: 100%;
|
|
1134
|
-
height: 100%;
|
|
1135
|
-
`,rd=rs`
|
|
1136
|
-
touch-action: none;
|
|
1137
|
-
cursor: pointer;
|
|
1138
|
-
-webkit-user-select: none;
|
|
1139
|
-
user-select: none;
|
|
1140
|
-
-webkit-touch-callout: none;
|
|
1141
|
-
|
|
1142
|
-
display: block;
|
|
1143
|
-
|
|
1144
|
-
transition: transform 0.2s ease-out;
|
|
1145
|
-
`,id=.2,ad=9.5,od=.6,sd=.22,cd=360,ld=cd/Iu,ud=.12,dd=.65,fd=Ed(ud*dd/.53*Math.log(dd/ud)),pd=2,md=10,hd=40,gd=30,_d=8,vd=200,yd=.75,bd=.25,xd=.1,Sd;function Cd(e,t,n){if(zl()){n.onError();return}if(Sd??=Td(),!Sd){n.onError();return}Sd.attach(e,t,n)}function wd(){return!!Sd?.hasDrawn()}function Td(){let e=document.createElement(`canvas`),t=e.getContext(`webgl2`,{failIfMajorPerformanceCaveat:!0});if(!t){Vl(`no GPU for WebGL 2`);return}e.className=rd;let n=window.devicePixelRatio||1,r=Hl(),i={},a,o,s=1,c,l,u=0,d=!1,f=0,p=0,m,h,g=!1,_=!1,v=0,y=0,b=0,x=0,S=0,C=1,ee;function te(t){if(!e.isConnected){c=void 0;return}if(c=requestAnimationFrame(te),r.track(t),l!==void 0&&t-l<ad)return;let s=Ru(t,l);l=t,u+=s,ne(s);let m=Math.round(S*n*C);e.width!==m&&(e.width=m,e.height=m),a.draw(i,{x:0,y:0,size:e.width},u,s,jd(f),jd(p)),d||(d=!0,h=u+id,o?.onFirstFrame())}function ne(e){var t;if(!m){g||(f=(f+ld*re()*e)%cd);return}let n=m,r=Math.max(0,u-n.startTime)/n.duration;n.onUpdate(Math.min(r,1)),r>=1&&(m=void 0,(t=n.onEnd)==null||t.call(n))}function re(){return h===void 0||u<h?0:1+21*Ed(u-h)/fd}function ie(){let e=f,t=p;m={startTime:u,duration:od,onUpdate:n=>{let r=1-Ad(n);f=e*r,p=t*r}}}function ae(t,n){if(Math.abs(f)>md)return;let r=Math.max(1,e.clientWidth/2),i=f,a=p,o=(r-t)*Od()/r,s=(r-n)*Od()/r;m={startTime:u,duration:sd,onUpdate:e=>{let t=kd(e);f=Gl(i,o,t),p=Gl(a,s,t)},onEnd:ie}}function oe(t){t.button===0&&(g=!0,_=!1,m=void 0,v=b=t.clientX,y=x=t.clientY,e.setPointerCapture(t.pointerId))}function se(e){if(g){if(!e.buttons){ce(e);return}if(!_){if(Math.hypot(e.clientX-v,e.clientY-y)<=_d)return;_=!0}f+=(e.clientX-b)*yd,p+=(e.clientY-x)*(e.pointerType===`touch`?xd:bd),b=e.clientX,x=e.clientY}}function ce(e){g&&(g=!1,ie(),!_&&e.type===`pointerup`&&ae(e.offsetX,e.offsetY))}function le(){clearTimeout(ee),C=s,e.style.transform=`scale(${s})`}function ue(){e.style.transform=``,ee=setTimeout(()=>{C=1},vd)}function de(){a&&e.isConnected&&!document.hidden?fe():pe()}function fe(){c===void 0&&(l=void 0,r.reset(),c=requestAnimationFrame(te))}function pe(){c!==void 0&&(cancelAnimationFrame(c),c=void 0)}function me(){var n;Sd=void 0,pe(),he(),document.removeEventListener(`visibilitychange`,de),e.removeEventListener(`webglcontextlost`,me),e.remove(),(n=t.getExtension(`WEBGL_lose_context`))==null||n.loseContext(),o?.onError()}let he=Bl(me);return document.addEventListener(`visibilitychange`,de),e.addEventListener(`webglcontextlost`,me),e.addEventListener(`pointerdown`,oe),e.addEventListener(`pointermove`,se),e.addEventListener(`pointerup`,ce),e.addEventListener(`pointercancel`,ce),e.addEventListener(`touchstart`,Dd,{passive:!1}),e.addEventListener(`pointerenter`,le),e.addEventListener(`pointerleave`,ue),zu(t).then(e=>{a=e,de()}).catch(me),{hasDrawn:()=>d,attach(t,{size:n,hoverScale:r},i){o=i,s=r,h=d?u:void 0,clearTimeout(ee),e.style.transform=``,C=1,S=n,e.style.width=`${n}px`,e.style.height=`${n}px`,t.appendChild(e),de()}}}function Ed(e){return Math.exp(-e/dd)-Math.exp(-e/ud)}function Dd(e){e.preventDefault()}function Od(){return Math.random()*gd+hd}function kd(e){return 1+na(e-1,5)}function Ad(e){let t=e-1;return t*t*(3*t+pd)+1}function jd(e){return e*Math.PI/180}var Md=1.7,Nd=e=>{let[t,n]=N(Pd()),[r,i]=N(wd()?`gone`:`shown`),a;return wa(()=>{if(!t()||!a)return;let r,o={size:e.size,hoverScale:e.hoverScale??Md};Cd(a,o,{onFirstFrame:()=>{i(`fading`),r=setTimeout(()=>i(`gone`),id*1e3)},onError:()=>n(!1)}),Ta(()=>clearTimeout(r))}),R($u,{get class(){return e.class},get style(){return{width:`${e.size}px`,height:`${e.size}px`}},get children(){return R(z,{get when(){return t()},get fallback(){return R(ed,{src:Ml,alt:``,draggable:!1})},get children(){return[R(nd,{ref(e){var t=a;typeof t==`function`?t(e):a=e}}),R(z,{get when(){return r()!==`gone`},get children(){return R(td,{src:Ml,alt:``,draggable:!1,get style(){return{opacity:r()===`fading`?0:1,transition:`opacity ${id}s linear`}}})}})]}})}})};function Pd(){let e=Xs(),t=!!(e?.matchMedia)?.call(e,`(prefers-reduced-motion: reduce)`).matches;return!zl()&&!t}var Fd=()=>{},Id=(e,t)=>t();function Ld(e,t){let n=L(e),r=n?[n]:[],{onEnter:i=Id,onExit:a=Id}=t,[o,s]=N(t.appear?[]:r),[c]=Ma(),l,u=!1;function d(e,t){if(!e)return t&&t();u=!0,a(e,()=>{Sa(()=>{u=!1,s(t=>t.filter(t=>t!==e)),t&&t()})})}function f(e){let t=l;if(!t)return e&&e();l=void 0,s(e=>[t,...e]),i(t,e??Fd)}let p=t.mode===`out-in`?(e=>u||d(e,f)):t.mode===`in-out`?(e=>f(()=>d(e))):(e=>{d(e),f()});return ya(t=>{let n=e();return L(c)?(c(),t):(n!==t&&(l=n,Sa(()=>L(()=>p(t)))),n)},t.appear?void 0:n),o}function Rd(e,t){let n=L(e),{onChange:r}=t,i=new Set(t.appear?void 0:n),a=new WeakSet,[o,s]=N([],{equals:!1}),[c]=Ma(),l=e=>{s(t=>(t.push.apply(t,e),t));for(let t of e)a.delete(t)},u=(e,t,n)=>e.splice(n,0,t);return I(t=>{let n=o(),s=e();if(s[ca],L(c))return c(),t;if(n.length){let e=t.filter(e=>!n.includes(e));return n.length=0,r({list:e,added:[],removed:[],unchanged:e,finishRemoved:l}),e}return L(()=>{let e=new Set(s),n=s.slice(),o=[],c=[],d=[];for(let e of s)(i.has(e)?d:o).push(e);let f=!o.length;for(let r=0;r<t.length;r++){let i=t[r];e.has(i)||(a.has(i)||(c.push(i),a.add(i)),u(n,i,r)),f&&i!==n[r]&&(f=!1)}return!c.length&&f?t:(r({list:n,added:o,removed:c,unchanged:d,finishRemoved:l}),i=e,n)})},t.appear?[]:n.slice())}var zd=e=>e instanceof Element;function Bd(e,t){if(t(e))return e;if(typeof e==`function`&&!e.length)return Bd(e(),t);if(Array.isArray(e)){let n=[];for(let r of e){let e=Bd(r,t);e&&(Array.isArray(e)?n.push.apply(n,e):n.push(e))}return n.length?n:null}return null}function Vd(e,t=zd,n=zd){let r=I(e),i=I(()=>Bd(r(),t));return i.toArray=()=>{let e=i();return Array.isArray(e)?e:e?[e]:[]},i}function Hd(e,t){if(t(e))return e;if(typeof e==`function`&&!e.length)return Hd(e(),t);if(Array.isArray(e))for(let n of e){let e=Hd(n,t);if(e)return e}return null}function Ud(e,t=zd,n=zd){let r=I(e);return I(()=>Hd(r(),t))}function Wd(e){return I(()=>{let t=e.name||`s`;return{enterActive:(e.enterActiveClass||t+`-enter-active`).split(` `),enter:(e.enterClass||t+`-enter`).split(` `),enterTo:(e.enterToClass||t+`-enter-to`).split(` `),exitActive:(e.exitActiveClass||t+`-exit-active`).split(` `),exit:(e.exitClass||t+`-exit`).split(` `),exitTo:(e.exitToClass||t+`-exit-to`).split(` `),move:(e.moveClass||t+`-move`).split(` `)}})}function Gd(e){requestAnimationFrame(()=>requestAnimationFrame(e))}function Kd(e,t,n,r){let{onBeforeEnter:i,onEnter:a,onAfterEnter:o}=t;i?.(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask(()=>{if(!n.parentNode)return r?.();a?.(n,()=>s())}),Gd(()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!a||a.length<2)&&(n.addEventListener(`transitionend`,s),n.addEventListener(`animationend`,s))});function s(t){(!t||t.target===n)&&(r?.(),n.removeEventListener(`transitionend`,s),n.removeEventListener(`animationend`,s),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),o?.(n))}}function qd(e,t,n,r){let{onBeforeExit:i,onExit:a,onAfterExit:o}=t;if(!n.parentNode)return r?.();i?.(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),a?.(n,()=>s()),Gd(()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!a||a.length<2)&&(n.addEventListener(`transitionend`,s),n.addEventListener(`animationend`,s))});function s(t){(!t||t.target===n)&&(r?.(),n.removeEventListener(`transitionend`,s),n.removeEventListener(`animationend`,s),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),o?.(n))}}var Jd={inout:`in-out`,outin:`out-in`},Yd=e=>{let t=Wd(e);return Ld(Ud(()=>e.children),{mode:Jd[e.mode],appear:e.appear,onEnter(n,r){Kd(t(),e,n,r)},onExit(n,r){qd(t(),e,n,r)}})},Xd=e=>{let t=Wd(e);return Rd(Vd(()=>e.children).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:i,list:a}){let o=t();for(let t of n)Kd(o,e,t);let s=[];for(let e of a)e.isConnected&&(e instanceof HTMLElement||e instanceof SVGElement)&&s.push({el:e,rect:e.getBoundingClientRect()});queueMicrotask(()=>{let e=[];for(let{el:t,rect:n}of s)if(t.isConnected){let r=t.getBoundingClientRect(),i=n.left-r.left,a=n.top-r.top;(i||a)&&(t.style.transform=`translate(${i}px, ${a}px)`,t.style.transitionDuration=`0s`,e.push(t))}document.body.offsetHeight;for(let t of e){let e=function(n){(n.target===t||/transform$/.test(n.propertyName))&&(t.removeEventListener(`transitionend`,e),t.classList.remove(...o.move))};t.classList.add(...o.move),t.style.transform=t.style.transitionDuration=``,t.addEventListener(`transitionend`,e)}});for(let t of r)qd(o,e,t,()=>i([t]))}})};function Zd(e,t){let n=n=>!e.contains(n.target)&&t()?.();document.body.addEventListener(`click`,n),Ta(()=>document.body.removeEventListener(`click`,n))}function Qd(e,t){let n=e=>{var n,r;e.key===`Escape`&&((n=document.activeElement)==null||n.blur(),(r=t())==null||r())};document.body.addEventListener(`keydown`,n),Ta(()=>document.body.removeEventListener(`keydown`,n))}function $d(e,t){let{isEnabled:n,onClose:r}=t();if(!n||tc().os!==`android`)return;window.history.pushState(tf,``);let i=e=>{e.preventDefault(),r()};window.addEventListener(`popstate`,i,{once:!0}),Ta(()=>{window.removeEventListener(`popstate`,i),qs(()=>{window.history.state?.[ef]===!0&&window.history.back()})})}var ef=`androidBackHandler`,tf={[ef]:!0},nf=H(`<svg><path fill-rule=evenodd clip-rule=evenodd d="M10.2122 14.3407C10.5384 14.0854 10.5959 13.614 10.3406 13.2878L6.20237 8.00003L10.3406 2.71227C10.5959 2.38607 10.5384 1.91469 10.2122 1.6594C9.88604 1.40412 9.41465 1.46161 9.15937 1.7878L4.65937 7.5378C4.44688 7.80932 4.44688 8.19074 4.65937 8.46226L9.15937 14.2123C9.41465 14.5385 9.88604 14.5959 10.2122 14.3407Z"></svg>`,!1,!0,!1),rf={left:0,top:90,right:180,bottom:270},af=e=>{let t=G(),n=()=>e.fill||t.colors.icon.secondary,r=()=>e.direction||`left`;return R(K(`svg`)`
|
|
1146
|
-
transform: rotate(${e=>rf[e.svgDirection]}deg);
|
|
1147
|
-
transition: transform 0.1s ease-in-out;
|
|
1148
|
-
`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,get svgDirection(){return r()},get children(){var e=nf();return P(()=>U(e,`fill`,n())),e}})},of=H(`<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M2.71966 2.71968C3.01255 2.42678 3.48743 2.42677 3.78032 2.71966L8.00002 6.93925L12.2197 2.71967C12.5126 2.42677 12.9874 2.42678 13.2803 2.71967C13.5732 3.01257 13.5732 3.48744 13.2803 3.78033L9.06068 7.99991L13.2803 12.2197C13.5732 12.5126 13.5732 12.9874 13.2803 13.2803C12.9874 13.5732 12.5126 13.5732 12.2197 13.2803L8.00002 9.06057L3.78033 13.2803C3.48744 13.5732 3.01257 13.5732 2.71967 13.2803C2.42678 12.9874 2.42677 12.5126 2.71967 12.2197L6.93936 7.99991L2.71968 3.78034C2.42678 3.48745 2.42677 3.01257 2.71966 2.71968Z">`),sf=e=>{let t=G(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{var e=of(),t=e.firstChild;return P(()=>U(t,`fill`,n())),e})()},cf=K.button`
|
|
1149
|
-
padding: 0;
|
|
1150
|
-
display: flex;
|
|
1151
|
-
justify-content: center;
|
|
1152
|
-
align-items: center;
|
|
1153
|
-
width: 32px;
|
|
1154
|
-
height: 32px;
|
|
1155
|
-
border-radius: 50%;
|
|
1156
|
-
background-color: ${e=>e.theme.colors.background.tint};
|
|
1157
|
-
border: none;
|
|
1158
|
-
cursor: pointer;
|
|
1159
|
-
|
|
1160
|
-
transition: transform 0.125s ease-in-out;
|
|
1161
|
-
|
|
1162
|
-
${xl} {
|
|
1163
|
-
&:hover {
|
|
1164
|
-
transform: scale(1.04);
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
&:active {
|
|
1169
|
-
transform: scale(0.96);
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
${bl} {
|
|
1173
|
-
&:active {
|
|
1174
|
-
transform: scale(0.92);
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
`,lf=e=>{let t=Tl(e),n=()=>e.icon||`close`;return R(cf,oo({get class(){return e.class},onClick:()=>e.onClick(),"data-tc-icon-button":`true`},t,{get children(){return[R(z,{get when(){return!!e.children},get children(){return e.children}}),R(z,{get when(){return!e.children},get children(){return R(uo,{get children(){return[R(B,{get when(){return n()===`close`},get children(){return R(sf,{get fill(){return e.fill}})}}),R(B,{get when(){return n()===`arrow`},get children(){return R(af,{get fill(){return e.fill}})}}),R(B,{get when(){return n()===`question`},get children(){return R(pm,{get fill(){return e.fill}})}}),R(B,{get when(){return typeof n()!=`string`},get children(){return n()}})]}})}})]}}))},uf={m:`24px`,s:`16px`,none:`0`},df=K.div`
|
|
1178
|
-
display: flex;
|
|
1179
|
-
position: fixed;
|
|
1180
|
-
z-index: 1000;
|
|
1181
|
-
left: 0;
|
|
1182
|
-
top: 0;
|
|
1183
|
-
width: 100%;
|
|
1184
|
-
height: 100%;
|
|
1185
|
-
background-color: rgba(0, 0, 0, 0.4);
|
|
1186
|
-
padding: 20px 0;
|
|
1187
|
-
overflow-y: auto;
|
|
1188
|
-
|
|
1189
|
-
${yl(`mobile`)} {
|
|
1190
|
-
padding-bottom: 0;
|
|
1191
|
-
}
|
|
1192
|
-
`,ff=rs`
|
|
1193
|
-
box-shadow:
|
|
1194
|
-
0 4px 16px rgba(0, 0, 0, 0.08),
|
|
1195
|
-
0 16px 64px rgba(0, 0, 0, 0.16);
|
|
1196
|
-
width: fit-content;
|
|
1197
|
-
margin: auto;
|
|
1198
|
-
|
|
1199
|
-
${yl(`mobile`)} {
|
|
1200
|
-
width: 100%;
|
|
1201
|
-
height: fit-content;
|
|
1202
|
-
margin: auto 0 0 0;
|
|
1203
|
-
}
|
|
1204
|
-
`,pf=K.div`
|
|
1205
|
-
position: relative;
|
|
1206
|
-
min-height: 100px;
|
|
1207
|
-
width: 416px;
|
|
1208
|
-
padding: 44px 56px 24px;
|
|
1209
|
-
|
|
1210
|
-
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.04);
|
|
1211
|
-
|
|
1212
|
-
background-color: ${e=>e.theme.colors.background.primary};
|
|
1213
|
-
border-radius: ${e=>uf[e.theme.borderRadius]};
|
|
1214
|
-
|
|
1215
|
-
${yl(`mobile`)} {
|
|
1216
|
-
width: 100%;
|
|
1217
|
-
border-radius: ${e=>uf[e.theme.borderRadius]}
|
|
1218
|
-
${e=>uf[e.theme.borderRadius]} 0 0;
|
|
1219
|
-
}
|
|
1220
|
-
`,mf=K(lf)`
|
|
1221
|
-
position: absolute;
|
|
1222
|
-
right: 16px;
|
|
1223
|
-
top: 16px;
|
|
1224
|
-
`,hf=K.div`
|
|
1225
|
-
display: flex;
|
|
1226
|
-
justify-content: space-between;
|
|
1227
|
-
align-items: center;
|
|
1228
|
-
padding: 16px 16px 16px 18px;
|
|
1229
|
-
border-radius: 0 0 ${e=>uf[e.theme.borderRadius]}
|
|
1230
|
-
${e=>uf[e.theme.borderRadius]};
|
|
1231
|
-
`,gf=K(lf)`
|
|
1232
|
-
background-color: ${e=>ms(e.theme.colors.icon.secondary,.12)};
|
|
1233
|
-
`,_f=class{constructor(){this.currentTime=0}},vf=class e{constructor(){this.currentTime=0,this.playbackRate=1,this.startTime=null,this.timeline=new _f,this.finished=Promise.resolve(this),this.effect=null,this.id=``,this.pending=!1,this.playState=`finished`,this.replaceState=`active`,this.ready=Promise.resolve(this),this.oncancel=null,this.onfinish=null,this.onremove=null}static create(){return e._instance||=new e,e._instance}cancel(){}finish(){}pause(){}play(){}reverse(){}addEventListener(e,t,n){}dispatchEvent(e){return!1}removeEventListener(e,t,n){}updatePlaybackRate(e){}commitStyles(){}persist(){}};vf._instance=null;var yf=vf;function bf(e,t,n){return`animate`in e?e.animate(t,n):yf.create()}var xf=H(`<div>`),Sf=Zd,Cf=Qd,wf=$d,Tf=e=>{let t=G(),n=Tl(e);return F(()=>{e.opened?Us():Ws()}),R(Yd,{onBeforeEnter:e=>{let t=vl(`mobile`)?200:100;bf(e,[{opacity:0},{opacity:1}],{duration:t,easing:`ease-out`}),vl(`mobile`)&&bf(e.firstElementChild,[{transform:`translateY(390px)`},{transform:`translateY(0)`}],{duration:t,easing:`ease-out`})},onExit:(e,t)=>{let n=vl(`mobile`)?200:100,r=bf(e,[{opacity:1},{opacity:0}],{duration:n});if(vl(`mobile`)){let i=bf(e.firstElementChild,[{transform:`translateY(0)`},{transform:`translateY(390px)`}],{duration:n});Promise.all([r.finished,i.finished]).then(t)}else r.finished.then(t)},get children(){return R(z,{get when(){return e.opened},get children(){return R(df,oo({"data-tc-modal":`true`},n,{get children(){var n=xf();return jo(wf,n,()=>({isEnabled:e.enableAndroidBackHandler,onClose:()=>e.onClose()})),jo(Cf,n,()=>()=>e.onClose()),jo(Sf,n,()=>()=>e.onClose()),Mo(n,R(pf,{get class(){return e.class},get children(){return[R(mf,{icon:`close`,onClick:()=>e.onClose()}),V(()=>e.children)]}}),null),Mo(n,R(z,{get when(){return e.onClickQuestion&&e.showFooter},get children(){return R(hf,{get children(){return[R(dm,{}),R(gf,{get onClick(){return e.onClickQuestion},icon:`question`})]}})}}),null),P(()=>Eo(n,(0,Yi.default)(ff,rs`
|
|
1234
|
-
border-radius: ${uf[t.borderRadius]};
|
|
1235
|
-
background-color: ${t.colors.background.tint};
|
|
1236
|
-
|
|
1237
|
-
${yl(`mobile`)} {
|
|
1238
|
-
border-radius: ${uf[t.borderRadius]}
|
|
1239
|
-
${uf[t.borderRadius]} 0 0;
|
|
1240
|
-
}
|
|
1241
|
-
`))),n}}))}})}})},Ef={m:`22px`,s:`12px`,none:`0`},Df={m:`18px`,s:`8px`,none:`0`},Of=K.div`
|
|
1242
|
-
display: grid;
|
|
1243
|
-
grid-template: 1fr / 1fr 1fr;
|
|
1244
|
-
width: fit-content;
|
|
1245
|
-
justify-items: center;
|
|
1246
|
-
gap: 4px;
|
|
1247
|
-
|
|
1248
|
-
position: relative;
|
|
1249
|
-
padding: 4px;
|
|
1250
|
-
border-radius: ${e=>Ef[e.theme.borderRadius]};
|
|
1251
|
-
|
|
1252
|
-
background-color: ${e=>e.theme.colors.background.secondary};
|
|
1253
|
-
`,kf=K.div`
|
|
1254
|
-
position: absolute;
|
|
1255
|
-
top: 4px;
|
|
1256
|
-
left: 4px;
|
|
1257
|
-
|
|
1258
|
-
height: calc(100% - 8px);
|
|
1259
|
-
width: calc(50% - 4px);
|
|
1260
|
-
|
|
1261
|
-
border-radius: ${e=>Df[e.theme.borderRadius]};
|
|
1262
|
-
background-color: ${e=>e.theme.colors.background.segment};
|
|
1263
|
-
|
|
1264
|
-
transform: ${e=>e.right?`translateX(100%)`:`translateX(0)`};
|
|
1265
|
-
|
|
1266
|
-
transition: transform 0.13s ease-in-out;
|
|
1267
|
-
`,Af=K.input`
|
|
1268
|
-
display: none;
|
|
1269
|
-
`,jf=K.label`
|
|
1270
|
-
padding: 9px 12px;
|
|
1271
|
-
z-index: 1;
|
|
1272
|
-
|
|
1273
|
-
cursor: ${e=>e.isActive?`default`:`pointer`};
|
|
1274
|
-
|
|
1275
|
-
transition: transform 0.13s ease-in-out;
|
|
1276
|
-
|
|
1277
|
-
&:hover {
|
|
1278
|
-
transform: ${e=>e.isActive?`none`:`scale(1.025)`};
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
> * {
|
|
1282
|
-
${e=>e.isActive?``:`color: ${e.theme.colors.text.secondary};`}
|
|
1283
|
-
}
|
|
1284
|
-
`,Mf=e=>{let t=`tabBar`+Math.floor(Math.random()*1e4);return R(Of,{get class(){return e.class},"data-tc-tab-bar":`true`,get children(){return[R(kf,{get right(){return e.selectedTabIndex===1}}),R(jf,{get isActive(){return e.selectedTabIndex===0},get children(){return[R(Af,{type:`radio`,name:t,get checked(){return e.selectedTabIndex===0},onInput:()=>e.onSelectedTabIndexChange?.call(e,0)}),V(()=>e.tab1)]}}),R(jf,{get isActive(){return e.selectedTabIndex===1},get children(){return[R(Af,{type:`radio`,get checked(){return e.selectedTabIndex===1},name:t,onInput:()=>e.onSelectedTabIndexChange?.call(e,1)}),V(()=>e.tab2)]}})]}})},Nf={m:`16px`,s:`12px`,none:`0`},Pf={m:`12px`,s:`8px`,none:`0`},Ff=256,If=60,Lf=48,Rf=24,zf=K.div`
|
|
1285
|
-
width: 52px;
|
|
1286
|
-
height: 52px;
|
|
1287
|
-
background: transparent;
|
|
1288
|
-
position: absolute;
|
|
1289
|
-
right: 0;
|
|
1290
|
-
bottom: 0;
|
|
1291
|
-
|
|
1292
|
-
display: flex;
|
|
1293
|
-
align-items: center;
|
|
1294
|
-
justify-content: center;
|
|
1295
|
-
transition: transform 0.125s ease-in-out;
|
|
1296
|
-
`,Bf=K.button`
|
|
1297
|
-
display: flex;
|
|
1298
|
-
align-items: center;
|
|
1299
|
-
justify-content: center;
|
|
1300
|
-
position: relative;
|
|
1301
|
-
background-color: ${e=>e.theme.colors.background.qr};
|
|
1302
|
-
border-radius: ${e=>Nf[e.theme.borderRadius]};
|
|
1303
|
-
padding: ${hs(Rf)} 0;
|
|
1304
|
-
height: ${hs(304)};
|
|
1305
|
-
width: 100%;
|
|
1306
|
-
|
|
1307
|
-
overflow: hidden;
|
|
1308
|
-
cursor: pointer;
|
|
1309
|
-
border: none;
|
|
1310
|
-
|
|
1311
|
-
${xl} {
|
|
1312
|
-
&:hover {
|
|
1313
|
-
${zf.class} {
|
|
1314
|
-
transform: scale(1.04);
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
&:active {
|
|
1320
|
-
${zf.class} {
|
|
1321
|
-
transform: scale(0.96);
|
|
1322
|
-
}
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
${bl} {
|
|
1326
|
-
&:active {
|
|
1327
|
-
${zf.class} {
|
|
1328
|
-
transform: scale(0.92);
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
}
|
|
1332
|
-
`,Vf=K.div`
|
|
1333
|
-
position: relative;
|
|
1334
|
-
display: flex;
|
|
1335
|
-
justify-content: center;
|
|
1336
|
-
align-items: center;
|
|
1337
|
-
margin: 0 auto;
|
|
1338
|
-
|
|
1339
|
-
> div:first-child {
|
|
1340
|
-
display: flex;
|
|
1341
|
-
align-items: center;
|
|
1342
|
-
justify-content: center;
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
rect {
|
|
1346
|
-
fill: transparent;
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
path {
|
|
1350
|
-
fill: ${e=>e.theme.colors.constant.black};
|
|
1351
|
-
}
|
|
1352
|
-
`,Hf=K.div`
|
|
1353
|
-
position: absolute;
|
|
1354
|
-
width: ${hs(If)};
|
|
1355
|
-
height: ${hs(If)};
|
|
1356
|
-
|
|
1357
|
-
display: flex;
|
|
1358
|
-
align-items: center;
|
|
1359
|
-
justify-content: center;
|
|
1360
|
-
`,Uf=K.div`
|
|
1361
|
-
display: flex;
|
|
1362
|
-
`,Wf=K(gl)`
|
|
1363
|
-
width: ${e=>hs(e.size)};
|
|
1364
|
-
height: ${e=>hs(e.size)};
|
|
1365
|
-
border-radius: ${e=>Pf[e.theme.borderRadius]};
|
|
1366
|
-
background-color: ${e=>e.theme.colors.background.qr};
|
|
1367
|
-
`,Gf=K.div`
|
|
1368
|
-
position: absolute;
|
|
1369
|
-
bottom: 14px;
|
|
1370
|
-
left: 50%;
|
|
1371
|
-
transform: translate(-50%, 0);
|
|
1372
|
-
|
|
1373
|
-
display: flex;
|
|
1374
|
-
gap: 6px;
|
|
1375
|
-
align-items: center;
|
|
1376
|
-
border-radius: 18px;
|
|
1377
|
-
min-width: 126px;
|
|
1378
|
-
padding: 9px 16px 9px 10px;
|
|
1379
|
-
|
|
1380
|
-
filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08));
|
|
1381
|
-
background-color: ${e=>e.theme.colors.background.segment};
|
|
1382
|
-
`;function Kf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var qf={exports:{}},Jf;function Yf(){return Jf?qf.exports:(Jf=1,(function(e,t){var n=function(){var e=function(e,t){var r=e,a=n[t],p=null,m=0,h=null,g=[],v={},y=function(e,t){m=r*4+17,p=function(e){for(var t=Array(e),n=0;n<e;n+=1){t[n]=Array(e);for(var r=0;r<e;r+=1)t[n][r]=null}return t}(m),b(0,0),b(m-7,0),b(0,m-7),C(),S(),te(e,t),r>=7&&ee(e),h??=ie(r,a,g),ne(h,t)},b=function(e,t){for(var n=-1;n<=7;n+=1)if(!(e+n<=-1||m<=e+n))for(var r=-1;r<=7;r+=1)t+r<=-1||m<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?p[e+n][t+r]=!0:p[e+n][t+r]=!1)},x=function(){for(var e=0,t=0,n=0;n<8;n+=1){y(!0,n);var r=i.getLostPoint(v);(n==0||e>r)&&(e=r,t=n)}return t},S=function(){for(var e=8;e<m-8;e+=1)p[e][6]??(p[e][6]=e%2==0);for(var t=8;t<m-8;t+=1)p[6][t]??(p[6][t]=t%2==0)},C=function(){for(var e=i.getPatternPosition(r),t=0;t<e.length;t+=1)for(var n=0;n<e.length;n+=1){var a=e[t],o=e[n];if(p[a][o]==null)for(var s=-2;s<=2;s+=1)for(var c=-2;c<=2;c+=1)s==-2||s==2||c==-2||c==2||s==0&&c==0?p[a+s][o+c]=!0:p[a+s][o+c]=!1}},ee=function(e){for(var t=i.getBCHTypeNumber(r),n=0;n<18;n+=1){var a=!e&&(t>>n&1)==1;p[Math.floor(n/3)][n%3+m-8-3]=a}for(var n=0;n<18;n+=1){var a=!e&&(t>>n&1)==1;p[n%3+m-8-3][Math.floor(n/3)]=a}},te=function(e,t){for(var n=a<<3|t,r=i.getBCHTypeInfo(n),o=0;o<15;o+=1){var s=!e&&(r>>o&1)==1;o<6?p[o][8]=s:o<8?p[o+1][8]=s:p[m-15+o][8]=s}for(var o=0;o<15;o+=1){var s=!e&&(r>>o&1)==1;o<8?p[8][m-o-1]=s:o<9?p[8][15-o-1+1]=s:p[8][15-o-1]=s}p[m-8][8]=!e},ne=function(e,t){for(var n=-1,r=m-1,a=7,o=0,s=i.getMaskFunction(t),c=m-1;c>0;c-=2)for(c==6&&--c;;){for(var l=0;l<2;l+=1)if(p[r][c-l]==null){var u=!1;o<e.length&&(u=(e[o]>>>a&1)==1),s(r,c-l)&&(u=!u),p[r][c-l]=u,--a,a==-1&&(o+=1,a=7)}if(r+=n,r<0||m<=r){r-=n,n=-n;break}}},re=function(e,t){for(var n=0,r=0,a=0,s=Array(t.length),c=Array(t.length),l=0;l<t.length;l+=1){var u=t[l].dataCount,d=t[l].totalCount-u;r=Math.max(r,u),a=Math.max(a,d),s[l]=Array(u);for(var f=0;f<s[l].length;f+=1)s[l][f]=255&e.getBuffer()[f+n];n+=u;var p=i.getErrorCorrectPolynomial(d),m=o(s[l],p.getLength()-1).mod(p);c[l]=Array(p.getLength()-1);for(var f=0;f<c[l].length;f+=1){var h=f+m.getLength()-c[l].length;c[l][f]=h>=0?m.getAt(h):0}}for(var g=0,f=0;f<t.length;f+=1)g+=t[f].totalCount;for(var _=Array(g),v=0,f=0;f<r;f+=1)for(var l=0;l<t.length;l+=1)f<s[l].length&&(_[v]=s[l][f],v+=1);for(var f=0;f<a;f+=1)for(var l=0;l<t.length;l+=1)f<c[l].length&&(_[v]=c[l][f],v+=1);return _},ie=function(e,t,n){for(var r=s.getRSBlocks(e,t),a=c(),o=0;o<n.length;o+=1){var l=n[o];a.put(l.getMode(),4),a.put(l.getLength(),i.getLengthInBits(l.getMode(),e)),l.write(a)}for(var u=0,o=0;o<r.length;o+=1)u+=r[o].dataCount;if(a.getLengthInBits()>u*8)throw`code length overflow. (`+a.getLengthInBits()+`>`+u*8+`)`;for(a.getLengthInBits()+4<=u*8&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(!1);for(;!(a.getLengthInBits()>=u*8||(a.put(236,8),a.getLengthInBits()>=u*8));)a.put(17,8);return re(a,r)};v.addData=function(e,t){t||=`Byte`;var n=null;switch(t){case`Numeric`:n=l(e);break;case`Alphanumeric`:n=u(e);break;case`Byte`:n=d(e);break;case`Kanji`:n=f(e);break;default:throw`mode:`+t}g.push(n),h=null},v.isDark=function(e,t){if(e<0||m<=e||t<0||m<=t)throw e+`,`+t;return p[e][t]},v.getModuleCount=function(){return m},v.make=function(){if(r<1){for(var e=1;e<40;e++){for(var t=s.getRSBlocks(e,a),n=c(),o=0;o<g.length;o++){var l=g[o];n.put(l.getMode(),4),n.put(l.getLength(),i.getLengthInBits(l.getMode(),e)),l.write(n)}for(var u=0,o=0;o<t.length;o++)u+=t[o].dataCount;if(n.getLengthInBits()<=u*8)break}r=e}y(!1,x())},v.createTableTag=function(e,t){e||=2,t=t===void 0?e*4:t;var n=``;n+=`<table style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: `+t+`px;`,n+=`">`,n+=`<tbody>`;for(var r=0;r<v.getModuleCount();r+=1){n+=`<tr>`;for(var i=0;i<v.getModuleCount();i+=1)n+=`<td style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: 0px;`,n+=` width: `+e+`px;`,n+=` height: `+e+`px;`,n+=` background-color: `,n+=v.isDark(r,i)?`#000000`:`#ffffff`,n+=`;`,n+=`"/>`;n+=`</tr>`}return n+=`</tbody>`,n+=`</table>`,n},v.createSvgTag=function(e,t,n,r){var i={};typeof arguments[0]==`object`&&(i=arguments[0],e=i.cellSize,t=i.margin,n=i.alt,r=i.title),e||=2,t=t===void 0?e*4:t,n=typeof n==`string`?{text:n}:n||{},n.text=n.text||null,n.id=n.text?n.id||`qrcode-description`:null,r=typeof r==`string`?{text:r}:r||{},r.text=r.text||null,r.id=r.text?r.id||`qrcode-title`:null;var a=v.getModuleCount()*e+t*2,o,s,c,l,u=``,d=`l`+e+`,0 0,`+e+` -`+e+`,0 0,-`+e+`z `;for(u+=`<svg version="1.1" xmlns="http://www.w3.org/2000/svg"`,u+=i.scalable?``:` width="`+a+`px" height="`+a+`px"`,u+=` viewBox="0 0 `+a+` `+a+`" `,u+=` preserveAspectRatio="xMinYMin meet"`,u+=r.text||n.text?` role="img" aria-labelledby="`+ae([r.id,n.id].join(` `).trim())+`"`:``,u+=`>`,u+=r.text?`<title id="`+ae(r.id)+`">`+ae(r.text)+`</title>`:``,u+=n.text?`<description id="`+ae(n.id)+`">`+ae(n.text)+`</description>`:``,u+=`<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>`,u+=`<path d="`,c=0;c<v.getModuleCount();c+=1)for(l=c*e+t,o=0;o<v.getModuleCount();o+=1)v.isDark(c,o)&&(s=o*e+t,u+=`M`+s+`,`+l+d);return u+=`" stroke="transparent" fill="black"/>`,u+=`</svg>`,u},v.createDataURL=function(e,t){e||=2,t=t===void 0?e*4:t;var n=v.getModuleCount()*e+t*2,r=t,i=n-t;return _(n,n,function(t,n){if(r<=t&&t<i&&r<=n&&n<i){var a=Math.floor((t-r)/e),o=Math.floor((n-r)/e);return+!v.isDark(o,a)}return 1})},v.createImgTag=function(e,t,n){e||=2,t=t===void 0?e*4:t;var r=v.getModuleCount()*e+t*2,i=``;return i+=`<img`,i+=` src="`,i+=v.createDataURL(e,t),i+=`"`,i+=` width="`,i+=r,i+=`"`,i+=` height="`,i+=r,i+=`"`,n&&(i+=` alt="`,i+=ae(n),i+=`"`),i+=`/>`,i};var ae=function(e){for(var t=``,n=0;n<e.length;n+=1){var r=e.charAt(n);switch(r){case`<`:t+=`<`;break;case`>`:t+=`>`;break;case`&`:t+=`&`;break;case`"`:t+=`"`;break;default:t+=r}}return t},oe=function(e){var t=1;e=e===void 0?t*2:e;var n=v.getModuleCount()*t+e*2,r=e,i=n-e,a,o,s,c,l,u={"██":`█`,"█ ":`▀`," █":`▄`," ":` `},d={"██":`▀`,"█ ":`▀`," █":` `," ":` `},f=``;for(a=0;a<n;a+=2){for(s=Math.floor((a-r)/t),c=Math.floor((a+1-r)/t),o=0;o<n;o+=1)l=`█`,r<=o&&o<i&&r<=a&&a<i&&v.isDark(s,Math.floor((o-r)/t))&&(l=` `),r<=o&&o<i&&r<=a+1&&a+1<i&&v.isDark(c,Math.floor((o-r)/t))?l+=` `:l+=`█`,f+=e<1&&a+1>=i?d[l]:u[l];f+=`
|
|
1383
|
-
`}return n%2&&e>0?f.substring(0,f.length-n-1)+Array(n+1).join(`▀`):f.substring(0,f.length-1)};return v.createASCII=function(e,t){if(e||=1,e<2)return oe(t);--e,t=t===void 0?e*2:t;var n=v.getModuleCount()*e+t*2,r=t,i=n-t,a,o,s,c,l=Array(e+1).join(`██`),u=Array(e+1).join(` `),d=``,f=``;for(a=0;a<n;a+=1){for(s=Math.floor((a-r)/e),f=``,o=0;o<n;o+=1)c=1,r<=o&&o<i&&r<=a&&a<i&&v.isDark(s,Math.floor((o-r)/e))&&(c=0),f+=c?l:u;for(s=0;s<e;s+=1)d+=f+`
|
|
1384
|
-
`}return d.substring(0,d.length-1)},v.renderTo2dContext=function(e,t){t||=2;for(var n=v.getModuleCount(),r=0;r<n;r++)for(var i=0;i<n;i++)e.fillStyle=v.isDark(r,i)?`black`:`white`,e.fillRect(r*t,i*t,t,t)},v};e.stringToBytesFuncs={default:function(e){for(var t=[],n=0;n<e.length;n+=1){var r=e.charCodeAt(n);t.push(r&255)}return t}},e.stringToBytes=e.stringToBytesFuncs.default,e.createStringToBytes=function(e,t){var n=function(){for(var n=h(e),r=function(){var e=n.read();if(e==-1)throw`eof`;return e},i=0,a={};;){var o=n.read();if(o==-1)break;var s=r(),c=r(),l=r(),u=String.fromCharCode(o<<8|s);a[u]=c<<8|l,i+=1}if(i!=t)throw i+` != `+t;return a}(),r=63;return function(e){for(var t=[],i=0;i<e.length;i+=1){var a=e.charCodeAt(i);if(a<128)t.push(a);else{var o=n[e.charAt(i)];typeof o==`number`?(o&255)==o?t.push(o):(t.push(o>>>8),t.push(o&255)):t.push(r)}}return t}};var t={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},i=function(){var e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,i=7973,s=21522,c={},l=function(e){for(var t=0;e!=0;)t+=1,e>>>=1;return t};return c.getBCHTypeInfo=function(e){for(var t=e<<10;l(t)-l(n)>=0;)t^=n<<l(t)-l(n);return(e<<10|t)^s},c.getBCHTypeNumber=function(e){for(var t=e<<12;l(t)-l(i)>=0;)t^=i<<l(t)-l(i);return e<<12|t},c.getPatternPosition=function(t){return e[t-1]},c.getMaskFunction=function(e){switch(e){case r.PATTERN000:return function(e,t){return(e+t)%2==0};case r.PATTERN001:return function(e,t){return e%2==0};case r.PATTERN010:return function(e,t){return t%3==0};case r.PATTERN011:return function(e,t){return(e+t)%3==0};case r.PATTERN100:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case r.PATTERN101:return function(e,t){return e*t%2+e*t%3==0};case r.PATTERN110:return function(e,t){return(e*t%2+e*t%3)%2==0};case r.PATTERN111:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw`bad maskPattern:`+e}},c.getErrorCorrectPolynomial=function(e){for(var t=o([1],0),n=0;n<e;n+=1)t=t.multiply(o([1,a.gexp(n)],0));return t},c.getLengthInBits=function(e,n){if(1<=n&&n<10)switch(e){case t.MODE_NUMBER:return 10;case t.MODE_ALPHA_NUM:return 9;case t.MODE_8BIT_BYTE:return 8;case t.MODE_KANJI:return 8;default:throw`mode:`+e}else if(n<27)switch(e){case t.MODE_NUMBER:return 12;case t.MODE_ALPHA_NUM:return 11;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 10;default:throw`mode:`+e}else if(n<41)switch(e){case t.MODE_NUMBER:return 14;case t.MODE_ALPHA_NUM:return 13;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 12;default:throw`mode:`+e}else throw`type:`+n},c.getLostPoint=function(e){for(var t=e.getModuleCount(),n=0,r=0;r<t;r+=1)for(var i=0;i<t;i+=1){for(var a=0,o=e.isDark(r,i),s=-1;s<=1;s+=1)if(!(r+s<0||t<=r+s))for(var c=-1;c<=1;c+=1)i+c<0||t<=i+c||(s!=0||c!=0)&&o==e.isDark(r+s,i+c)&&(a+=1);a>5&&(n+=3+a-5)}for(var r=0;r<t-1;r+=1)for(var i=0;i<t-1;i+=1){var l=0;e.isDark(r,i)&&(l+=1),e.isDark(r+1,i)&&(l+=1),e.isDark(r,i+1)&&(l+=1),e.isDark(r+1,i+1)&&(l+=1),(l==0||l==4)&&(n+=3)}for(var r=0;r<t;r+=1)for(var i=0;i<t-6;i+=1)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(var i=0;i<t;i+=1)for(var r=0;r<t-6;r+=1)e.isDark(r,i)&&!e.isDark(r+1,i)&&e.isDark(r+2,i)&&e.isDark(r+3,i)&&e.isDark(r+4,i)&&!e.isDark(r+5,i)&&e.isDark(r+6,i)&&(n+=40);for(var u=0,i=0;i<t;i+=1)for(var r=0;r<t;r+=1)e.isDark(r,i)&&(u+=1);var d=Math.abs(100*u/t/t-50)/5;return n+=d*10,n},c}(),a=function(){for(var e=Array(256),t=Array(256),n=0;n<8;n+=1)e[n]=1<<n;for(var n=8;n<256;n+=1)e[n]=e[n-4]^e[n-5]^e[n-6]^e[n-8];for(var n=0;n<255;n+=1)t[e[n]]=n;var r={};return r.glog=function(e){if(e<1)throw`glog(`+e+`)`;return t[e]},r.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]},r}();function o(e,t){if(e.length===void 0)throw e.length+`/`+t;var n=function(){for(var n=0;n<e.length&&e[n]==0;)n+=1;for(var r=Array(e.length-n+t),i=0;i<e.length-n;i+=1)r[i]=e[i+n];return r}(),r={};return r.getAt=function(e){return n[e]},r.getLength=function(){return n.length},r.multiply=function(e){for(var t=Array(r.getLength()+e.getLength()-1),n=0;n<r.getLength();n+=1)for(var i=0;i<e.getLength();i+=1)t[n+i]^=a.gexp(a.glog(r.getAt(n))+a.glog(e.getAt(i)));return o(t,0)},r.mod=function(e){if(r.getLength()-e.getLength()<0)return r;for(var t=a.glog(r.getAt(0))-a.glog(e.getAt(0)),n=Array(r.getLength()),i=0;i<r.getLength();i+=1)n[i]=r.getAt(i);for(var i=0;i<e.getLength();i+=1)n[i]^=a.gexp(a.glog(e.getAt(i))+t);return o(n,0).mod(e)},r}var s=function(){var e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){var n={};return n.totalCount=e,n.dataCount=t,n},r={},i=function(t,r){switch(r){case n.L:return e[(t-1)*4+0];case n.M:return e[(t-1)*4+1];case n.Q:return e[(t-1)*4+2];case n.H:return e[(t-1)*4+3];default:return}};return r.getRSBlocks=function(e,n){var r=i(e,n);if(r===void 0)throw`bad rs block @ typeNumber:`+e+`/errorCorrectionLevel:`+n;for(var a=r.length/3,o=[],s=0;s<a;s+=1)for(var c=r[s*3+0],l=r[s*3+1],u=r[s*3+2],d=0;d<c;d+=1)o.push(t(l,u));return o},r}(),c=function(){var e=[],t=0,n={};return n.getBuffer=function(){return e},n.getAt=function(t){return(e[Math.floor(t/8)]>>>7-t%8&1)==1},n.put=function(e,t){for(var r=0;r<t;r+=1)n.putBit((e>>>t-r-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(n){var r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1},n},l=function(e){var n=t.MODE_NUMBER,r=e,i={};i.getMode=function(){return n},i.getLength=function(e){return r.length},i.write=function(e){for(var t=r,n=0;n+2<t.length;)e.put(a(t.substring(n,n+3)),10),n+=3;n<t.length&&(t.length-n==1?e.put(a(t.substring(n,n+1)),4):t.length-n==2&&e.put(a(t.substring(n,n+2)),7))};var a=function(e){for(var t=0,n=0;n<e.length;n+=1)t=t*10+o(e.charAt(n));return t},o=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;throw`illegal char :`+e};return i},u=function(e){var n=t.MODE_ALPHA_NUM,r=e,i={};i.getMode=function(){return n},i.getLength=function(e){return r.length},i.write=function(e){for(var t=r,n=0;n+1<t.length;)e.put(a(t.charAt(n))*45+a(t.charAt(n+1)),11),n+=2;n<t.length&&e.put(a(t.charAt(n)),6)};var a=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;if(`A`<=e&&e<=`Z`)return e.charCodeAt(0)-65+10;switch(e){case` `:return 36;case`$`:return 37;case`%`:return 38;case`*`:return 39;case`+`:return 40;case`-`:return 41;case`.`:return 42;case`/`:return 43;case`:`:return 44;default:throw`illegal char :`+e}};return i},d=function(n){var r=t.MODE_8BIT_BYTE,i=e.stringToBytes(n),a={};return a.getMode=function(){return r},a.getLength=function(e){return i.length},a.write=function(e){for(var t=0;t<i.length;t+=1)e.put(i[t],8)},a},f=function(n){var r=t.MODE_KANJI,i=e.stringToBytesFuncs.SJIS;if(!i)throw`sjis not supported.`;(function(e,t){var n=i(e);if(n.length!=2||(n[0]<<8|n[1])!=t)throw`sjis not supported.`})(`友`,38726);var a=i(n),o={};return o.getMode=function(){return r},o.getLength=function(e){return~~(a.length/2)},o.write=function(e){for(var t=a,n=0;n+1<t.length;){var r=(255&t[n])<<8|255&t[n+1];if(33088<=r&&r<=40956)r-=33088;else if(57408<=r&&r<=60351)r-=49472;else throw`illegal char at `+(n+1)+`/`+r;r=(r>>>8&255)*192+(r&255),e.put(r,13),n+=2}if(n<t.length)throw`illegal char at `+(n+1)},o},p=function(){var e=[],t={};return t.writeByte=function(t){e.push(t&255)},t.writeShort=function(e){t.writeByte(e),t.writeByte(e>>>8)},t.writeBytes=function(e,n,r){n||=0,r||=e.length;for(var i=0;i<r;i+=1)t.writeByte(e[i+n])},t.writeString=function(e){for(var n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},t.toByteArray=function(){return e},t.toString=function(){var t=``;t+=`[`;for(var n=0;n<e.length;n+=1)n>0&&(t+=`,`),t+=e[n];return t+=`]`,t},t},m=function(){var e=0,t=0,n=0,r=``,i={},a=function(e){r+=String.fromCharCode(o(e&63))},o=function(e){if(!(e<0)){if(e<26)return 65+e;if(e<52)return 97+(e-26);if(e<62)return 48+(e-52);if(e==62)return 43;if(e==63)return 47}throw`n:`+e};return i.writeByte=function(r){for(e=e<<8|r&255,t+=8,n+=1;t>=6;)a(e>>>t-6),t-=6},i.flush=function(){if(t>0&&(a(e<<6-t),e=0,t=0),n%3!=0)for(var i=3-n%3,o=0;o<i;o+=1)r+=`=`},i.toString=function(){return r},i},h=function(e){var t=e,n=0,r=0,i=0,a={};a.read=function(){for(;i<8;){if(n>=t.length){if(i==0)return-1;throw`unexpected end of file./`+i}var e=t.charAt(n);if(n+=1,e==`=`)return i=0,-1;e.match(/^\s$/)||(r=r<<6|o(e.charCodeAt(0)),i+=6)}var a=r>>>i-8&255;return i-=8,a};var o=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(e==43)return 62;if(e==47)return 63;throw`c:`+e};return a},g=function(e,t){var n=e,r=t,i=Array(e*t),a={};a.setPixel=function(e,t,r){i[t*n+e]=r},a.write=function(e){e.writeString(`GIF87a`),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(`,`),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);var t=2,i=s(t);e.writeByte(t);for(var a=0;i.length-a>255;)e.writeByte(255),e.writeBytes(i,a,255),a+=255;e.writeByte(i.length-a),e.writeBytes(i,a,i.length-a),e.writeByte(0),e.writeString(`;`)};var o=function(e){var t=e,n=0,r=0,i={};return i.write=function(e,i){if(e>>>i)throw`length over`;for(;n+i>=8;)t.writeByte(255&(e<<n|r)),i-=8-n,e>>>=8-n,r=0,n=0;r=e<<n|r,n+=i},i.flush=function(){n>0&&t.writeByte(r)},i},s=function(e){for(var t=1<<e,n=(1<<e)+1,r=e+1,a=c(),s=0;s<t;s+=1)a.add(String.fromCharCode(s));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(n));var l=p(),u=o(l);u.write(t,r);var d=0,f=String.fromCharCode(i[d]);for(d+=1;d<i.length;){var m=String.fromCharCode(i[d]);d+=1,a.contains(f+m)?f+=m:(u.write(a.indexOf(f),r),a.size()<4095&&(a.size()==1<<r&&(r+=1),a.add(f+m)),f=m)}return u.write(a.indexOf(f),r),u.write(n,r),u.flush(),l.toByteArray()},c=function(){var e={},t=0,n={};return n.add=function(r){if(n.contains(r))throw`dup key:`+r;e[r]=t,t+=1},n.size=function(){return t},n.indexOf=function(t){return e[t]},n.contains=function(t){return e[t]!==void 0},n};return a},_=function(e,t,n){for(var r=g(e,t),i=0;i<t;i+=1)for(var a=0;a<e;a+=1)r.setPixel(a,i,n(a,i));var o=p();r.write(o);for(var s=m(),c=o.toByteArray(),l=0;l<c.length;l+=1)s.writeByte(c[l]);return s.flush(),`data:image/gif;base64,`+s};return e}();(function(){n.stringToBytesFuncs[`UTF-8`]=function(e){function t(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t.push(r):r<2048?t.push(192|r>>6,128|r&63):r<55296||r>=57344?t.push(224|r>>12,128|r>>6&63,128|r&63):(n++,r=65536+((r&1023)<<10|e.charCodeAt(n)&1023),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|r&63))}return t}return t(e)}})(),(function(t){e.exports=t()})(function(){return n})})(qf),qf.exports)}var Xf=Kf(Yf());function Zf(e){return A(this,null,function*(){try{if(!(navigator!=null&&navigator.clipboard))throw new vs(`Clipboard API not available`);return yield navigator.clipboard.writeText(e)}catch{}Qf(e)})}function Qf(e){let t=document.createElement(`textarea`);t.value=e,t.style.top=`0`,t.style.left=`0`,t.style.position=`fixed`,document.body.appendChild(t),t.focus(),t.select();try{document.execCommand(`copy`)}finally{document.body.removeChild(t)}}var $f=7,ep=.5,tp=2.4,np=1.4,rp=1.1,ip=.72,ap=4;function op(e,t,n){let r=e.getModuleCount(),i=r*t,a=(e,t)=>e<$f&&(t<$f||t>=r-$f)||e>=r-$f&&t<$f,o=(e,t)=>{if(!n)return!1;let r=n.size/2,i=n.start+r;return na(Math.abs((t+.5-i)/r),ap)+na(Math.abs((e+.5-i)/r),ap)<=1},s=(t,n)=>t>=0&&n>=0&&t<r&&n<r&&!a(t,n)&&!o(t,n)&&e.isDark(t,n),c=(e,t,n,r)=>!s(e+n,t)&&!s(e,t+r)?ep:0,l=[];for(let e=0;e<r;e++)for(let t=0;t<r;t++){if(a(e,t))continue;if(s(e,t)){let n=t;for(;s(e,n+1);)n++;l.push(up(t,e,n-t+1,1,{topLeft:c(e,t,-1,-1),topRight:c(e,n,-1,1),bottomRight:c(e,n,1,1),bottomLeft:c(e,t,1,-1)})),t=n;continue}let n=s(e-1,t),r=s(e+1,t),i=s(e,t-1),o=s(e,t+1);n&&i&&s(e-1,t-1)&&l.push(sp(t,e,1,1)),n&&o&&s(e-1,t+1)&&l.push(sp(t+1,e,-1,1)),r&&o&&s(e+1,t+1)&&l.push(sp(t+1,e+1,-1,-1)),r&&i&&s(e+1,t-1)&&l.push(sp(t,e+1,1,-1))}let u=r-$f;return[[0,0],[u,0],[0,u]].forEach(([e,t])=>l.push(cp(e,t))),`<svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${i}" viewBox="0 0 ${r} ${r}"><path d="${l.join(``)}"/></svg>`}function sp(e,t,n,r){let i=ep,a=i-i*ip;return`M${fp(e)} ${fp(t)}L${fp(e+n*i)} ${fp(t)}C${fp(e+n*a)} ${fp(t)} ${fp(e)} ${fp(t+r*a)} ${fp(e)} ${fp(t+r*i)}Z`}function cp(e,t){return lp(e,t,$f,tp)+lp(e+1,t+1,5,np,!0)+lp(e+2,t+2,3,rp)}function lp(e,t,n,r,i=!1){return up(e,t,n,n,{topLeft:r,topRight:r,bottomRight:r,bottomLeft:r},i)}function up(e,t,n,r,i,a=!1){let o=e+n,s=t+r,c=[[o,t,1,0,i.topRight],[o,s,0,1,i.bottomRight],[e,s,-1,0,i.bottomLeft],[e,t,0,-1,i.topLeft]],l=a?dp(c):c,u=``;return l.forEach(([e,t,n,r,i],o)=>{let s=a?r:-r,c=a?-n:n,l=e-n*i,d=t-r*i,f=e+s*i,p=t+c*i;if(u+=`${o===0?`M`:`L`}${fp(l)} ${fp(d)}`,i>0){let e=i*ip;u+=`C${fp(l+n*e)} ${fp(d+r*e)} ${fp(f-s*e)} ${fp(p-c*e)} ${fp(f)} ${fp(p)}`}}),`${u}Z`}function dp(e){return[...e].reverse().map(([e,t,n,r,i])=>{let a=-r,o=n;return[e,t,-a,-o,i]})}function fp(e){return String(Math.round(e*1e3)/1e3)}var pp=H(`<div>`),mp=e=>{let t,n,r,[i,a]=N(!1),o=Fa(()=>e.logo),[s,c]=N(Lf);F(()=>{let i=Xf(0,`L`);i.addData(e.sourceUrl),i.make();let a=i.getModuleCount()*4,o=Math.round(Ff/a*1e5)/1e5,s;if(r){let e=Math.ceil(If/(o*4))*4,t=Math.ceil((a-e)/8)*4;r.style.top=hs(t),r.style.left=hs(t),r.style.height=hs(e),r.style.width=hs(e),s={start:t/4,size:e/4},c(Math.round(Lf/o))}t.innerHTML=op(i,4,s),n.style.transform=`scale(${o})`});let l=null;return R(Bf,{get class(){return e.class},onClick:()=>{a(!0),Zf(e.sourceUrl),l!=null&&clearTimeout(l),l=setTimeout(()=>a(!1),1500)},get children(){return[R(Vf,{ref(e){var t=n;typeof t==`function`?t(e):n=e},get children(){return[(()=>{var e=pp(),n=t;return typeof n==`function`?jo(n,e):t=e,e})(),R(z,{get when(){return e.imageUrl||o()},get children(){return R(Hf,{ref(e){var t=r;typeof t==`function`?t(e):r=e},get children(){return R(z,{get when(){return o()},get fallback(){return R(Wf,{get src(){return e.imageUrl},alt:``,get size(){return s()}})},get children(){return R(Uf,{onClick:e=>e.stopPropagation(),get children(){return o()}})}})}})}})]}}),R(Yd,{onBeforeEnter:e=>{bf(e,[{opacity:0,transform:`translate(-50%, 44px)`},{opacity:1,transform:`translate(-50%, 0)`}],{duration:150,easing:`ease-out`})},onExit:(e,t)=>{bf(e,[{opacity:1,transform:`translate(-50%, 0)`},{opacity:0,transform:`translate(-50%, 44px)`}],{duration:150,easing:`ease-out`}).finished.then(()=>{t()})},get children(){return R(z,{get when(){return i()&&!e.disableCopy},get children(){return R(Gf,{get children(){return[R(tm,{size:`xs`}),R(xp,{translationKey:`common.linkCopied`,children:`Link Copied`})]}})}})}}),R(z,{get when(){return!e.disableCopy},get children(){return R(zf,{get children(){return R(Fm,{})}})}})]}})},hp=(e,t,n)=>{let r=t.trim().split(`.`).reduce((e,t)=>e?e[t]:void 0,e);return r===void 0?n:r},gp=(e,t,n=/{{(.*?)}}/g)=>e.replace(n,(e,n)=>hp(t,n,``)),_p=(e={},t=navigator.language in e?navigator.language:Object.keys(e)[0])=>{let[n,r]=N(t),[i,a]=nl(e);return[(e,t,r)=>{let a=hp(i[n()],e,r||``);return typeof a==`function`?a(t):typeof a==`string`?gp(a,t||{}):a},{add(e,t){a(e,e=>Object.assign(e||{},t))},locale:e=>e?r(e):n(),dict:e=>hp(i,e)}]},vp=Na({}),yp=()=>Pa(vp),bp=K.div`
|
|
1385
|
-
font-style: normal;
|
|
1386
|
-
font-weight: ${e=>e.fontWeight};
|
|
1387
|
-
font-size: ${e=>e.fontSize};
|
|
1388
|
-
line-height: ${e=>e.lineHeight};
|
|
1389
|
-
|
|
1390
|
-
color: ${e=>e.color};
|
|
1391
|
-
`,xp=e=>{let t=G(),[n]=yp(),r,i=()=>e.color||t.colors.text.primary,a=oo({fontSize:`14px`,fontWeight:`510`,lineHeight:`130%`},e);return F(()=>{r&&a.cursor!==`unset`&&getComputedStyle(r).cursor!==`pointer`&&(r.style.cursor=`default`)}),R(bp,{get fontSize(){return a.fontSize},get fontWeight(){return a.fontWeight},get lineHeight(){return a.lineHeight},get color(){return i()},get class(){return a.class},ref(e){var t=r;typeof t==`function`?t(e):r=e},"data-tc-text":`true`,get children(){return V(()=>!!a.translationKey)()?n(a.translationKey,a.translationValues,a.children?.toString()):a.children}})},Sp=K.div`
|
|
1392
|
-
position: relative;
|
|
1393
|
-
|
|
1394
|
-
&::after {
|
|
1395
|
-
content: '';
|
|
1396
|
-
display: block;
|
|
1397
|
-
position: absolute;
|
|
1398
|
-
top: 0;
|
|
1399
|
-
bottom: 0;
|
|
1400
|
-
left: 0;
|
|
1401
|
-
right: 0;
|
|
1402
|
-
border: 0.5px solid rgba(0, 0, 0, 0.08);
|
|
1403
|
-
border-radius: inherit;
|
|
1404
|
-
}
|
|
1405
|
-
`,Cp=K(gl)`
|
|
1406
|
-
width: 100%;
|
|
1407
|
-
height: 100%;
|
|
1408
|
-
border-radius: inherit;
|
|
1409
|
-
`,wp=e=>R(Sp,{get class(){return e.class},get children(){return[R(Cp,{get src(){return e.src}}),V(()=>e.badge)]}}),Tp={m:`16px`,s:`12px`,none:`0`},Ep={m:`6px`,s:`6px`,none:`0`},Dp=K.ul`
|
|
1410
|
-
display: flex;
|
|
1411
|
-
gap: 0;
|
|
1412
|
-
width: 100%;
|
|
1413
|
-
overflow-x: auto;
|
|
1414
|
-
padding: 8px 12px 16px 12px;
|
|
1415
|
-
margin: 0;
|
|
1416
|
-
list-style: none;
|
|
1417
|
-
flex-wrap: nowrap;
|
|
1418
|
-
|
|
1419
|
-
&&::-webkit-scrollbar {
|
|
1420
|
-
display: none;
|
|
1421
|
-
}
|
|
1422
|
-
-ms-overflow-style: none;
|
|
1423
|
-
scrollbar-width: none;
|
|
1424
|
-
|
|
1425
|
-
> li {
|
|
1426
|
-
display: flex;
|
|
1427
|
-
flex: 1;
|
|
1428
|
-
min-width: 78px;
|
|
1429
|
-
height: fit-content;
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
> li > button {
|
|
1433
|
-
width: 100%;
|
|
1434
|
-
}
|
|
1435
|
-
`,Op=K.button`
|
|
1436
|
-
position: relative;
|
|
1437
|
-
cursor: pointer;
|
|
1438
|
-
border: none;
|
|
1439
|
-
background-color: unset;
|
|
1440
|
-
padding: 8px 4px;
|
|
1441
|
-
min-width: 78px;
|
|
1442
|
-
display: flex;
|
|
1443
|
-
flex-direction: column;
|
|
1444
|
-
align-items: center;
|
|
1445
|
-
|
|
1446
|
-
transition: transform 0.125s ease-in-out;
|
|
1447
|
-
|
|
1448
|
-
${xl} {
|
|
1449
|
-
&:hover {
|
|
1450
|
-
transform: scale(1.04);
|
|
1451
|
-
}
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
&:active {
|
|
1455
|
-
transform: scale(0.96);
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
|
-
${bl} {
|
|
1459
|
-
&:active {
|
|
1460
|
-
transform: scale(0.92);
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1463
|
-
`,kp=K(wp)`
|
|
1464
|
-
width: 60px;
|
|
1465
|
-
height: 60px;
|
|
1466
|
-
border-radius: ${e=>Tp[e.theme.borderRadius]};
|
|
1467
|
-
margin-bottom: 8px;
|
|
1468
|
-
position: relative;
|
|
1469
|
-
`,Ap=K(gl)`
|
|
1470
|
-
position: absolute;
|
|
1471
|
-
right: -6px;
|
|
1472
|
-
bottom: -6px;
|
|
1473
|
-
width: 24px;
|
|
1474
|
-
height: 24px;
|
|
1475
|
-
border-radius: ${e=>Ep[e.theme.borderRadius]};
|
|
1476
|
-
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
|
|
1477
|
-
`,jp=K(xp)`
|
|
1478
|
-
max-width: 90px;
|
|
1479
|
-
font-weight: 510;
|
|
1480
|
-
white-space: nowrap;
|
|
1481
|
-
text-overflow: ellipsis;
|
|
1482
|
-
overflow: hidden;
|
|
1483
|
-
|
|
1484
|
-
${yl(`mobile`)} {
|
|
1485
|
-
max-width: 80px;
|
|
1486
|
-
}
|
|
1487
|
-
`,Mp=K(xp)`
|
|
1488
|
-
font-weight: ${e=>e.colorPrimary?`510`:`400`};
|
|
1489
|
-
max-width: 90px;
|
|
1490
|
-
white-space: nowrap;
|
|
1491
|
-
text-overflow: ellipsis;
|
|
1492
|
-
overflow: hidden;
|
|
1493
|
-
color: ${e=>e.colorPrimary?e.theme.colors.text.primary:e.theme.colors.text.secondary};
|
|
1494
|
-
|
|
1495
|
-
${yl(`mobile`)} {
|
|
1496
|
-
max-width: 80px;
|
|
1497
|
-
}
|
|
1498
|
-
`;function Np(e){return[...new Set(e)]}function Pp(e,t,n){return t.map(t=>{let r=n.find(n=>n[e]===t[e]);return n=n.filter(n=>n[e]!==t[e]),r===void 0?t:r}).concat(n)}function Fp(e){return`jsBridgeKey`in e?k(O({},e),{injected:Wi.isWalletInjected(e.jsBridgeKey),embedded:Wi.isInsideWalletBrowser(e.jsBridgeKey)}):e}function Ip(e,t){return t&&t.includeWallets?.length&&(e=Pp(`name`,e,t.includeWallets.map(Fp))),e}function Lp(e){return e.platforms.some(e=>[`macos`,`linux`,`windows`].includes(e))}function Rp(e){return e.platforms.some(e=>[`ios`,`android`].includes(e))}function zp(e){return e.platforms.some(e=>[`chrome`,`firefox`,`safari`].includes(e))}function Bp(e,t){return t?e.name.toLowerCase()===t.toLowerCase()||e.appName.toLowerCase()===t.toLowerCase():!1}function Vp(e){let t=/^(.+?)\s*\(([^()]+)\)$/.exec(e);return!t?.[1]||!t[2]?{name:e}:{name:t[1],note:t[2]}}var Hp=H(`<div>`),Up=e=>{let t=null,n=()=>{let e=t?.querySelector(`div`);if(e&&e.scrollWidth>e.clientWidth){let t=0,n=.05;for(;e.scrollWidth>e.clientWidth&&t>=-.4;)t-=n,e.style.letterSpacing=`${t}px`;t!==0&&(t-=n,e.style.letterSpacing=`${t}px`)}},r=()=>Vp(e.name),i=()=>e.secondLine??r().note,a=()=>e.secondLine!==void 0&&(e.secondLineColorPrimary??!0);return wa(()=>n()),F(()=>{n()}),R(Op,{get class(){return e.class},onClick:()=>e.onClick(),"data-tc-wallet-item":`true`,get children(){return[V(()=>V(()=>typeof e.icon==`string`)()?R(kp,{get src(){return e.icon},get badge(){return V(()=>!!e.badgeUrl)()&&R(Ap,{get src(){return e.badgeUrl}})}}):e.icon),(()=>{var e=Hp();return jo(e=>t=e,e),Mo(e,R(jp,{get children(){return r().name}})),e})(),V(()=>V(()=>!!i())()&&R(Mp,{get colorPrimary(){return a()},get children(){return i()}}))]}})},Wp=K.h1`
|
|
1499
|
-
font-style: normal;
|
|
1500
|
-
font-weight: 590;
|
|
1501
|
-
font-size: 20px;
|
|
1502
|
-
line-height: 28px;
|
|
1503
|
-
|
|
1504
|
-
text-align: center;
|
|
1505
|
-
|
|
1506
|
-
color: ${e=>e.theme.colors.text.primary};
|
|
1507
|
-
|
|
1508
|
-
margin-top: 0;
|
|
1509
|
-
margin-bottom: 0;
|
|
1510
|
-
|
|
1511
|
-
cursor: default;
|
|
1512
|
-
`,Gp=e=>{let[t]=yp();return R(Wp,{get class(){return e.class},"data-tc-h1":`true`,get children(){return V(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,e.children?.toString()):e.children}})},Kp=K.h2`
|
|
1513
|
-
font-style: normal;
|
|
1514
|
-
font-weight: 400;
|
|
1515
|
-
font-size: 16px;
|
|
1516
|
-
line-height: 22px;
|
|
1517
|
-
|
|
1518
|
-
text-align: center;
|
|
1519
|
-
|
|
1520
|
-
color: ${e=>e.theme.colors.text.secondary};
|
|
1521
|
-
|
|
1522
|
-
margin-top: 0;
|
|
1523
|
-
margin-bottom: 32px;
|
|
1524
|
-
|
|
1525
|
-
cursor: default;
|
|
1526
|
-
`,qp=e=>{let[t]=yp();return R(Kp,{get class(){return e.class},"data-tc-h2":`true`,get children(){return V(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,e.children?.toString()):e.children}})},Jp=K.h3`
|
|
1527
|
-
font-style: normal;
|
|
1528
|
-
font-weight: 510;
|
|
1529
|
-
font-size: 16px;
|
|
1530
|
-
line-height: 20px;
|
|
1531
|
-
|
|
1532
|
-
color: ${e=>e.theme.colors.text.primary};
|
|
1533
|
-
|
|
1534
|
-
margin-top: 0;
|
|
1535
|
-
margin-bottom: 0;
|
|
1536
|
-
|
|
1537
|
-
cursor: default;
|
|
1538
|
-
`,Yp=e=>{let[t]=yp();return R(Jp,{"data-tc-h3":`true`,get class(){return e.class},get children(){return V(()=>!!e.translationKey)()?t(e.translationKey,e.translationValues,e.children?.toString()):e.children}})},Xp=H(`<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd clip-rule=evenodd d="M14.1839 17.7069C13.6405 18.6507 13.3688 19.1226 13.0591 19.348C12.4278 19.8074 11.5723 19.8074 10.941 19.348C10.6312 19.1226 10.3595 18.6507 9.81613 17.7069L5.52066 10.2464C4.76864 8.94024 4.39263 8.28717 4.33762 7.75894C4.2255 6.68236 4.81894 5.65591 5.80788 5.21589C6.29309 5 7.04667 5 8.55383 5H15.4462C16.9534 5 17.7069 5 18.1922 5.21589C19.1811 5.65591 19.7745 6.68236 19.6624 7.75894C19.6074 8.28717 19.2314 8.94024 18.4794 10.2464L14.1839 17.7069ZM11.1 16.3412L6.56139 8.48002C6.31995 8.06185 6.19924 7.85276 6.18146 7.68365C6.14523 7.33896 6.33507 7.01015 6.65169 6.86919C6.80703 6.80002 7.04847 6.80002 7.53133 6.80002H7.53134L11.1 6.80002V16.3412ZM12.9 16.3412L17.4387 8.48002C17.6801 8.06185 17.8008 7.85276 17.8186 7.68365C17.8548 7.33896 17.665 7.01015 17.3484 6.86919C17.193 6.80002 16.9516 6.80002 16.4687 6.80002L12.9 6.80002V16.3412Z">`),Zp=e=>{let t=G(),n=()=>e.fill||t.colors.icon.primary;return(()=>{var e=Xp(),t=e.firstChild;return P(()=>U(t,`fill`,n())),e})()},Qp=H(`<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><g clip-path=url(#clip0_3783_2045)><circle cx=8 cy=8.00098 r=8></circle><path d="M4.75 8.50098L7 10.751L11.75 6.00098"stroke-width=1.5 stroke-linecap=round stroke-linejoin=round></path></g><defs><clipPath id=clip0_3783_2045><rect width=16 height=16 fill=white transform="translate(0 0.000976562)">`),$p=H(`<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><circle cx=12 cy=12 r=11></circle><path d="M17.1364 9.6364C17.4879 9.28493 17.4879 8.71508 17.1364 8.36361C16.7849 8.01214 16.2151 8.01214 15.8636 8.36361L10 14.2272L8.1364 12.3636C7.78493 12.0121 7.21508 12.0121 6.86361 12.3636C6.51214 12.7151 6.51214 13.2849 6.86361 13.6364L9.36361 16.1364C9.71508 16.4879 10.2849 16.4879 10.6364 16.1364L17.1364 9.6364Z">`),em=H(`<svg width=72 height=72 viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><circle cx=36 cy=36 r=33></circle><path d="M50.9142 28.4142C51.6953 27.6332 51.6953 26.3668 50.9142 25.5858C50.1332 24.8047 48.8668 24.8047 48.0858 25.5858L30 43.6716L23.9142 37.5858C23.1332 36.8047 21.8668 36.8047 21.0858 37.5858C20.3047 38.3668 20.3047 39.6332 21.0858 40.4142L28.5858 47.9142C29.3668 48.6953 30.6332 48.6953 31.4142 47.9142L50.9142 28.4142Z">`),tm=e=>{let t=G(),n=()=>e.size||`s`,r=()=>e.fill||t.colors.icon.success;return V(()=>V(()=>n()===`xs`)()?(()=>{var n=Qp(),i=n.firstChild.firstChild,a=i.nextSibling;return P(o=>{var s=e.class,c=r(),l=t.colors.constant.white;return s!==o.e&&U(n,`class`,o.e=s),c!==o.t&&U(i,`fill`,o.t=c),l!==o.a&&U(a,`stroke`,o.a=l),o},{e:void 0,t:void 0,a:void 0}),n})():V(()=>n()===`s`)()?(()=>{var n=$p(),i=n.firstChild,a=i.nextSibling;return P(o=>{var s=e.class,c=r(),l=t.colors.constant.white;return s!==o.e&&U(n,`class`,o.e=s),c!==o.t&&U(i,`fill`,o.t=c),l!==o.a&&U(a,`fill`,o.a=l),o},{e:void 0,t:void 0,a:void 0}),n})():(()=>{var n=em(),i=n.firstChild,a=i.nextSibling;return P(o=>{var s=e.class,c=r(),l=t.colors.constant.white;return s!==o.e&&U(n,`class`,o.e=s),c!==o.t&&U(i,`fill`,o.t=c),l!==o.a&&U(a,`fill`,o.a=l),o},{e:void 0,t:void 0,a:void 0}),n})())},nm=H(`<svg width=72 height=72 viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><circle cx=36 cy=36 r=33></circle><path d="M24.0858 26.9142C23.3047 26.1332 23.3047 24.8668 24.0858 24.0858C24.8668 23.3047 26.1332 23.3047 26.9142 24.0858L36 33.1716L45.0858 24.0858C45.8668 23.3047 47.1332 23.3047 47.9142 24.0858C48.6953 24.8668 48.6953 26.1332 47.9142 26.9142L38.8284 36L47.9142 45.0858C48.6953 45.8668 48.6953 47.1332 47.9142 47.9142C47.1332 48.6953 45.8668 48.6953 45.0858 47.9142L36 38.8284L26.9142 47.9142C26.1332 48.6953 24.8668 48.6953 24.0858 47.9142C23.3047 47.1332 23.3047 45.8668 24.0858 45.0858L33.1716 36L24.0858 26.9142Z">`),rm=H(`<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><circle cx=24 cy=24.001 r=22></circle><path d="M24 24.001L31.5 16.501M24 24.001L16.5 16.501M24 24.001L16.5 31.501M24 24.001L31.5 31.501"stroke-width=3 stroke-linecap=round stroke-linejoin=round>`),im=H(`<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><circle cx=12 cy=12 r=11></circle><path d="M7.86361 9.1364C7.51214 8.78493 7.51214 8.21508 7.86361 7.86361C8.21508 7.51214 8.78493 7.51214 9.1364 7.86361L12 10.7272L14.8636 7.86361C15.2151 7.51214 15.7849 7.51214 16.1364 7.86361C16.4879 8.21508 16.4879 8.78493 16.1364 9.1364L13.2728 12L16.1364 14.8636C16.4879 15.2151 16.4879 15.7849 16.1364 16.1364C15.7849 16.4879 15.2151 16.4879 14.8636 16.1364L12 13.2728L9.1364 16.1364C8.78493 16.4879 8.21508 16.4879 7.86361 16.1364C7.51214 15.7849 7.51214 15.2151 7.86361 14.8636L10.7272 12L7.86361 9.1364Z">`),am=e=>{let t=G(),n=()=>e.size||`m`,r=()=>e.fill||t.colors.icon.error;return V(()=>V(()=>n()===`m`)()?(()=>{var n=nm(),i=n.firstChild,a=i.nextSibling;return P(o=>{var s=e.class,c=r(),l=t.colors.constant.white;return s!==o.e&&U(n,`class`,o.e=s),c!==o.t&&U(i,`fill`,o.t=c),l!==o.a&&U(a,`fill`,o.a=l),o},{e:void 0,t:void 0,a:void 0}),n})():V(()=>n()===`s`)()?(()=>{var n=rm(),i=n.firstChild,a=i.nextSibling;return P(o=>{var s=e.class,c=r(),l=t.colors.constant.white;return s!==o.e&&U(n,`class`,o.e=s),c!==o.t&&U(i,`fill`,o.t=c),l!==o.a&&U(a,`stroke`,o.a=l),o},{e:void 0,t:void 0,a:void 0}),n})():(()=>{var n=im(),i=n.firstChild,a=i.nextSibling;return P(o=>{var s=e.class,c=r(),l=t.colors.constant.white;return s!==o.e&&U(n,`class`,o.e=s),c!==o.t&&U(i,`fill`,o.t=c),l!==o.a&&U(a,`fill`,o.a=l),o},{e:void 0,t:void 0,a:void 0}),n})())},om=H(`<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15.55 5.85123C18.9459 7.81184 20.1094 12.1541 18.1488 15.55C16.1882 18.9459 11.8459 20.1094 8.44998 18.1488C8.01952 17.9003 7.46909 18.0478 7.22056 18.4782C6.97203 18.9087 7.11952 19.4591 7.54998 19.7076C11.8068 22.1653 17.2499 20.7068 19.7076 16.45C22.1653 12.1932 20.7068 6.75005 16.45 4.29239C12.1932 1.83472 6.75003 3.29321 4.29236 7.55001C4.04383 7.98047 4.19132 8.53091 4.62178 8.77943C5.05224 9.02796 5.60268 8.88048 5.8512 8.45001C7.81181 5.05413 12.1541 3.89062 15.55 5.85123Z">`),sm=H(`<svg xmlns=http://www.w3.org/2000/svg width=44 height=44 viewBox="0 0 44 44"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M22 2.99951C11.5066 2.99951 3 11.5061 3 21.9995C3 32.4929 11.5066 40.9995 22 40.9995C22.8284 40.9995 23.5 41.6711 23.5 42.4995C23.5 43.3279 22.8284 43.9995 22 43.9995C9.84974 43.9995 0 34.1498 0 21.9995C0 9.84925 9.84974 -0.000488281 22 -0.000488281C34.1503 -0.000488281 44 9.84925 44 21.9995C44 22.8279 43.3284 23.4995 42.5 23.4995C41.6716 23.4995 41 22.8279 41 21.9995C41 11.5061 32.4934 2.99951 22 2.99951Z">`),cm=H(`<svg width=72 height=72 viewBox="0 0 72 72"fill=none xmlns=http://www.w3.org/2000/svg><path d="M24 56.7846C35.479 63.412 50.1572 59.479 56.7846 47.9999C63.412 36.5209 59.479 21.8427 48 15.2153C36.521 8.58791 21.8428 12.5209 15.2154 23.9999"stroke-width=4 stroke-linecap=round stroke-linejoin=round>`),lm=e=>{let t=G(),n=()=>e.size||`xs`,r=()=>e.fill||t.colors.icon.tertiary,i=rs`
|
|
1539
|
-
animation: ${is`
|
|
1540
|
-
0% {
|
|
1541
|
-
transform: rotate(0deg);
|
|
1542
|
-
}
|
|
1543
|
-
100% {
|
|
1544
|
-
transform: rotate(360deg);
|
|
1545
|
-
}
|
|
1546
|
-
`} 1s linear infinite;
|
|
1547
|
-
`;return V(()=>V(()=>n()===`xs`)()?(()=>{var t=om(),n=t.firstChild;return P(a=>{var o=(0,Yi.default)(i,e.class),s=r();return o!==a.e&&U(t,`class`,a.e=o),s!==a.t&&U(n,`fill`,a.t=s),a},{e:void 0,t:void 0}),t})():V(()=>n()===`s`)()?(()=>{var t=sm(),n=t.firstChild;return P(a=>{var o=(0,Yi.default)(i,e.class),s=r();return o!==a.e&&U(t,`class`,a.e=o),s!==a.t&&U(n,`fill`,a.t=s),a},{e:void 0,t:void 0}),t})():(()=>{var t=cm(),n=t.firstChild;return P(a=>{var o=(0,Yi.default)(i,e.class),s=r();return o!==a.e&&U(t,`class`,a.e=o),s!==a.t&&U(n,`stroke`,a.t=s),a},{e:void 0,t:void 0}),t})())},um=H(`<svg width=158 height=28 viewBox="0 0 158 28"fill=none xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd clip-rule=evenodd d="M28 14.001C28 21.733 21.732 28.001 14 28.001C6.26801 28.001 0 21.733 0 14.001C0 6.26899 6.26801 0.000976562 14 0.000976562C21.732 0.000976562 28 6.26899 28 14.001ZM9.21931 8.00098H18.7801H18.7813C20.538 8.00098 21.6522 9.89966 20.7691 11.4302L14.8672 21.6576C14.4822 22.3254 13.5172 22.3254 13.1322 21.6576L7.23158 11.4302C6.34721 9.89726 7.4614 8.00098 9.21931 8.00098ZM13.1262 18.5882V9.74806H9.21811C8.78976 9.74806 8.53708 10.2029 8.74163 10.5578L11.8423 16.1035L13.1262 18.5882ZM16.1559 16.1047L19.2554 10.5566C19.4599 10.2017 19.2073 9.74685 18.7789 9.74685H14.8709V18.5906L16.1559 16.1047Z"fill=#0098EA></path><path d="M18.7802 8.00098H9.21936C7.46145 8.00098 6.34727 9.89726 7.23164 11.4302L13.1322 21.6576C13.5173 22.3254 14.4823 22.3254 14.8673 21.6576L20.7691 11.4302C21.6523 9.89966 20.5381 8.00098 18.7814 8.00098H18.7802ZM13.1274 18.5906L11.8424 16.1035L8.74168 10.5578C8.53714 10.2029 8.78981 9.74806 9.21816 9.74806H13.1262V18.5918L13.1274 18.5906ZM19.2555 10.5566L16.156 16.1047L14.8709 18.5906V9.74685H18.779C19.2073 9.74685 19.46 10.2017 19.2555 10.5566Z"fill=white></path><path fill-rule=evenodd clip-rule=evenodd d="M51.7483 22.1967C55.7182 22.1967 58.9609 18.954 58.9609 14.9841C58.9609 11.0142 55.7182 7.77148 51.7483 7.77148C47.7588 7.77148 44.5357 11.0142 44.5357 14.9841C44.5357 18.954 47.7588 22.1967 51.7483 22.1967ZM51.7483 19.1702C49.4686 19.1702 47.6802 17.2442 47.6802 14.9841C47.6802 12.724 49.4686 10.798 51.7483 10.798C54.0084 10.798 55.7968 12.724 55.7968 14.9841C55.7968 17.2442 54.0084 19.1702 51.7483 19.1702ZM37.0698 21.9609H40.2142V10.9946H44.2843V8.00732H33V10.9946H37.0698V21.9609ZM69.9379 8.00732H73.0823V21.9609H70.3899L63.59 13.3333V21.9609H60.4652V8.00732H63.1576L69.9379 16.6153V8.00732ZM79.2259 14.9887C79.2259 10.9202 82.351 7.77539 86.4982 7.77539C89.8592 7.77539 92.5519 9.95709 93.2202 12.6891H90.7437C90.154 11.0971 88.4637 9.9964 86.4982 9.9964C83.5893 9.9964 81.5452 12.1781 81.5452 14.9887C81.5452 17.7994 83.5893 19.9811 86.4982 19.9811C88.4637 19.9811 90.154 18.8804 90.7437 17.2884H93.2202C92.5519 20.0204 89.8592 22.2021 86.4982 22.2021C82.351 22.2021 79.2259 19.0573 79.2259 14.9887ZM104.584 17.0525C104.584 19.9025 102.343 22.1628 99.4342 22.1628C96.5253 22.1628 94.2846 19.9025 94.2846 17.0525C94.2846 14.2025 96.5253 11.9422 99.4342 11.9422C102.343 11.9422 104.584 14.2025 104.584 17.0525ZM96.4663 17.0525C96.4663 18.8018 97.6849 20.158 99.4342 20.158C101.164 20.158 102.382 18.8018 102.382 17.0525C102.382 15.3032 101.164 13.947 99.4342 13.947C97.6849 13.947 96.4663 15.3032 96.4663 17.0525ZM108.626 12.1388H106.463V21.9662H108.626V17.1311C108.626 15.0281 109.726 13.9077 111.161 13.9077C112.419 13.9077 113.205 14.8512 113.205 16.4039V21.9662H115.367V16.0501C115.367 13.5539 113.893 11.9422 111.613 11.9422C110.335 11.9422 109.215 12.4926 108.626 13.4753V12.1388ZM117.839 12.1388H120.001V13.4753C120.59 12.4926 121.711 11.9422 122.988 11.9422C125.268 11.9422 126.742 13.5539 126.742 16.0501V21.9662H124.58V16.4039C124.58 14.8512 123.794 13.9077 122.536 13.9077C121.101 13.9077 120.001 15.0281 120.001 17.1311V21.9662H117.839V12.1388ZM133.558 22.1628C136.054 22.1628 137.823 20.728 138.373 18.8804H136.113C135.661 19.8238 134.717 20.2563 133.636 20.2563C131.887 20.2563 130.747 19.077 130.668 17.5832H138.491C138.688 14.2419 136.585 11.9422 133.577 11.9422C130.551 11.9422 128.526 14.1436 128.526 17.0525C128.526 20.0007 130.629 22.1628 133.558 22.1628ZM130.747 16.0501C131.042 14.5367 132.162 13.7505 133.518 13.7505C134.717 13.7505 135.838 14.4581 136.172 16.0501H130.747ZM149.851 18.3694C149.32 20.5511 147.453 22.1628 144.859 22.1628C141.871 22.1628 139.709 19.8828 139.709 17.0525C139.709 14.2222 141.871 11.9422 144.859 11.9422C147.453 11.9422 149.32 13.5539 149.851 15.7356H147.571C147.178 14.6743 146.215 13.9077 144.859 13.9077C143.109 13.9077 141.91 15.2246 141.91 17.0525C141.91 18.8804 143.109 20.1973 144.859 20.1973C146.215 20.1973 147.178 19.4307 147.571 18.3694H149.851ZM155.75 22.0645C156.418 22.0645 156.929 21.9859 157.362 21.8483V19.9221C157.047 20.0401 156.615 20.1187 156.202 20.1187C155.082 20.1187 154.551 19.6666 154.551 18.448V14.065H157.362V12.1388H154.551V9.40675H152.389V12.1388H150.345V14.065H152.389V18.8018C152.389 21.0228 153.863 22.0645 155.75 22.0645Z">`),dm=()=>{let e=G(),t=()=>e.theme===W.DARK?e.colors.constant.white:e.colors.constant.black;return(()=>{var e=um(),n=e.firstChild.nextSibling.nextSibling;return P(()=>U(n,`fill`,t())),e})()},fm=H(`<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M5.56608 4.42584C5.82527 3.32158 6.8176 2.5 8.00001 2.5C9.38072 2.5 10.5 3.61929 10.5 5C10.5 5.63026 10.3391 6.0386 10.1264 6.34455C9.90018 6.66993 9.58561 6.92478 9.18864 7.20877C9.12579 7.25372 9.05873 7.30025 8.9887 7.34883C8.27392 7.84472 7.25001 8.55507 7.25001 10V10.25C7.25001 10.6642 7.5858 11 8.00001 11C8.41422 11 8.75001 10.6642 8.75001 10.25V10C8.75001 9.36502 9.10777 9.1096 9.94554 8.51149L10.0614 8.42873C10.4769 8.13147 10.9748 7.75194 11.358 7.20076C11.7547 6.63015 12 5.91973 12 5C12 2.79086 10.2091 1 8.00001 1C6.10564 1 4.5205 2.31615 4.10577 4.08308C4.01112 4.48634 4.26129 4.88997 4.66454 4.98462C5.0678 5.07927 5.47143 4.8291 5.56608 4.42584ZM8.00001 15C8.60752 15 9.10001 14.5075 9.10001 13.9C9.10001 13.2925 8.60752 12.8 8.00001 12.8C7.39249 12.8 6.90001 13.2925 6.90001 13.9C6.90001 14.5075 7.39249 15 8.00001 15Z">`),pm=e=>{let t=G(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{var e=fm(),t=e.firstChild;return P(()=>U(t,`fill`,n())),e})()},mm=H(`<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M9.98156 8.75C9.84854 11.4328 9.01206 13.5 8 13.5C6.98794 13.5 6.15146 11.4328 6.01844 8.75H9.98156ZM11.4832 8.75C11.4217 10.1155 11.1929 11.3869 10.8239 12.4017C10.7734 12.5405 10.7188 12.6789 10.6595 12.8154C12.1454 11.993 13.2103 10.5029 13.4493 8.75H11.4832ZM13.4493 7.25H11.4832C11.4217 5.88453 11.1929 4.61314 10.8239 3.5983C10.7734 3.4595 10.7188 3.32111 10.6595 3.18459C12.1454 4.00697 13.2103 5.49709 13.4493 7.25ZM9.98156 7.25H6.01844C6.15144 4.56764 6.98769 2.50062 7.99955 2.5H8C9.01206 2.5 9.84854 4.56724 9.98156 7.25ZM4.51678 7.25C4.57826 5.88453 4.80706 4.61314 5.1761 3.5983C5.22657 3.4595 5.28124 3.32111 5.3405 3.18459C3.85463 4.00697 2.78972 5.49709 2.55071 7.25H4.51678ZM2.55071 8.75C2.78972 10.5029 3.85463 11.993 5.3405 12.8154C5.28124 12.6789 5.22657 12.5405 5.1761 12.4017C4.80706 11.3869 4.57826 10.1155 4.51678 8.75H2.55071ZM15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8Z">`),hm=e=>{let t=G(),n=()=>e.fill||t.colors.icon.primary;return(()=>{var e=mm(),t=e.firstChild;return P(()=>U(t,`fill`,n())),e})()},gm=H(`<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M2.5 4.8C2.5 3.11984 2.5 2.27976 2.82698 1.63803C3.1146 1.07354 3.57354 0.614601 4.13803 0.32698C4.77976 0 5.61984 0 7.3 0H8.7C10.3802 0 11.2202 0 11.862 0.32698C12.4265 0.614601 12.8854 1.07354 13.173 1.63803C13.5 2.27976 13.5 3.11984 13.5 4.8V11.2C13.5 12.8802 13.5 13.7202 13.173 14.362C12.8854 14.9265 12.4265 15.3854 11.862 15.673C11.2202 16 10.3802 16 8.7 16H7.3C5.61984 16 4.77976 16 4.13803 15.673C3.57354 15.3854 3.1146 14.9265 2.82698 14.362C2.5 13.7202 2.5 12.8802 2.5 11.2V4.8ZM4 3.9C4 3.05992 4 2.63988 4.16349 2.31901C4.3073 2.03677 4.53677 1.8073 4.81901 1.66349C5.13988 1.5 5.55992 1.5 6.4 1.5H9.6C10.4401 1.5 10.8601 1.5 11.181 1.66349C11.4632 1.8073 11.6927 2.03677 11.8365 2.31901C12 2.63988 12 3.05992 12 3.9V12.1C12 12.9401 12 13.3601 11.8365 13.681C11.6927 13.9632 11.4632 14.1927 11.181 14.3365C10.8601 14.5 10.4401 14.5 9.6 14.5H6.4C5.55992 14.5 5.13988 14.5 4.81901 14.3365C4.53677 14.1927 4.3073 13.9632 4.16349 13.681C4 13.3601 4 12.9401 4 12.1V3.9ZM7 2.5C6.58579 2.5 6.25 2.83579 6.25 3.25C6.25 3.66421 6.58579 4 7 4H9C9.41421 4 9.75 3.66421 9.75 3.25C9.75 2.83579 9.41421 2.5 9 2.5H7Z">`),_m=e=>{let t=G(),n=()=>e.fill||t.colors.icon.primary;return(()=>{var e=gm(),t=e.firstChild;return P(()=>U(t,`fill`,n())),e})()},vm=H(`<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M1.5 6.8C1.5 5.11984 1.5 4.27976 1.82698 3.63803C2.1146 3.07354 2.57354 2.6146 3.13803 2.32698C3.77976 2 4.61984 2 6.3 2H9.7C11.3802 2 12.2202 2 12.862 2.32698C13.4265 2.6146 13.8854 3.07354 14.173 3.63803C14.5 4.27976 14.5 5.11984 14.5 6.8V11.5H15.25C15.6642 11.5 16 11.8358 16 12.25C16 12.6642 15.6642 13 15.25 13H0.75C0.335786 13 0 12.6642 0 12.25C0 11.8358 0.335786 11.5 0.75 11.5H1.5V6.8ZM3 11.5H13V5.9C13 5.05992 13 4.63988 12.8365 4.31901C12.6927 4.03677 12.4632 3.8073 12.181 3.66349C11.8601 3.5 11.4401 3.5 10.6 3.5H5.4C4.55992 3.5 4.13988 3.5 3.81901 3.66349C3.53677 3.8073 3.3073 4.03677 3.16349 4.31901C3 4.63988 3 5.05992 3 5.9V11.5Z">`),ym=e=>{let t=G(),n=()=>e.fill||t.colors.icon.primary;return(()=>{var e=vm(),t=e.firstChild;return P(()=>U(t,`fill`,n())),e})()},bm=H(`<svg xmlns=http://www.w3.org/2000/svg width=17 height=16 viewBox="0 0 17 16"fill=none><g clip-path=url(#clip0_3676_1603)><path fill-rule=evenodd clip-rule=evenodd d="M15.5 1.25049C15.5 0.836275 15.1642 0.500488 14.75 0.500488C14.3358 0.500488 14 0.836275 14 1.25049V3.67012C12.7187 2.04487 10.7318 1.00049 8.5 1.00049C4.63401 1.00049 1.5 4.1345 1.5 8.00049C1.5 11.8665 4.63401 15.0005 8.5 15.0005C11.6844 15.0005 14.3703 12.8748 15.2199 9.96661C15.3361 9.56902 15.1079 9.15254 14.7103 9.03638C14.3127 8.92023 13.8962 9.14838 13.7801 9.54597C13.1123 11.8319 11 13.5005 8.5 13.5005C5.46243 13.5005 3 11.0381 3 8.00049C3 4.96292 5.46243 2.50049 8.5 2.50049C10.321 2.50049 11.9363 3.3855 12.9377 4.75049H10.5C10.0858 4.75049 9.75 5.08627 9.75 5.50049C9.75 5.9147 10.0858 6.25049 10.5 6.25049H14.75C15.1642 6.25049 15.5 5.9147 15.5 5.50049V1.25049Z"></path></g><defs><clipPath id=clip0_3676_1603><rect width=16 height=16 fill=white transform="translate(0.5 0.000488281)">`),xm=e=>{let t=G(),n=()=>e.fill||t.colors.accent;return(()=>{var e=bm(),t=e.firstChild.firstChild;return P(()=>U(t,`fill`,n())),e})()},Sm=H(`<svg xmlns=http://www.w3.org/2000/svg width=16 height=16 viewBox="0 0 16 16"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M13 4.06119V6.75053C13 7.16474 13.3358 7.50053 13.75 7.50053C14.1642 7.50053 14.5 7.16474 14.5 6.75053V2.75053L14.5 2.72807C14.5001 2.63191 14.5003 2.49627 14.4842 2.37627C14.4638 2.22503 14.4063 1.99261 14.2071 1.79342C14.0079 1.59423 13.7755 1.5367 13.6243 1.51637C13.5043 1.50023 13.3686 1.50039 13.2725 1.50051L13.25 1.50053H9.25C8.83579 1.50053 8.5 1.83631 8.5 2.25053C8.5 2.66474 8.83579 3.00053 9.25 3.00053H11.9393L7.21967 7.7202C6.92678 8.01309 6.92678 8.48796 7.21967 8.78086C7.51256 9.07375 7.98744 9.07375 8.28033 8.78086L13 4.06119ZM5.85 1.50053H5.81903H5.81899C5.21528 1.50052 4.71702 1.50051 4.31113 1.53367C3.88956 1.56812 3.50203 1.64204 3.13803 1.82751C2.57354 2.11513 2.1146 2.57407 1.82698 3.13856C1.64151 3.50256 1.56759 3.89009 1.53315 4.31166C1.49998 4.71755 1.49999 5.21581 1.5 5.81953V5.81955V5.85053V10.1505V10.1815V10.1815C1.49999 10.7852 1.49998 11.2835 1.53315 11.6894C1.56759 12.111 1.64151 12.4985 1.82698 12.8625C2.1146 13.427 2.57354 13.8859 3.13803 14.1735C3.50203 14.359 3.88956 14.4329 4.31113 14.4674C4.71702 14.5005 5.21527 14.5005 5.81897 14.5005H5.81901H5.85H10.15H10.181H10.181C10.7847 14.5005 11.283 14.5005 11.6889 14.4674C12.1104 14.4329 12.498 14.359 12.862 14.1735C13.4265 13.8859 13.8854 13.427 14.173 12.8625C14.3585 12.4985 14.4324 12.111 14.4669 11.6894C14.5 11.2835 14.5 10.7853 14.5 10.1816V10.1815V10.1505V9.75053C14.5 9.33631 14.1642 9.00053 13.75 9.00053C13.3358 9.00053 13 9.33631 13 9.75053V10.1505C13 10.793 12.9994 11.2297 12.9718 11.5672C12.945 11.8961 12.8963 12.0642 12.8365 12.1815C12.6927 12.4638 12.4632 12.6932 12.181 12.837C12.0637 12.8968 11.8955 12.9455 11.5667 12.9724C11.2292 12.9999 10.7924 13.0005 10.15 13.0005H5.85C5.20757 13.0005 4.77085 12.9999 4.43328 12.9724C4.10447 12.9455 3.93632 12.8968 3.81902 12.837C3.53677 12.6932 3.3073 12.4638 3.16349 12.1815C3.10372 12.0642 3.05503 11.8961 3.02816 11.5672C3.00058 11.2297 3 10.793 3 10.1505V5.85053C3 5.20809 3.00058 4.77137 3.02816 4.43381C3.05503 4.10499 3.10372 3.93684 3.16349 3.81954C3.3073 3.5373 3.53677 3.30783 3.81902 3.16402C3.93632 3.10425 4.10447 3.05556 4.43328 3.02869C4.77085 3.00111 5.20757 3.00053 5.85 3.00053H6.25C6.66422 3.00053 7 2.66474 7 2.25053C7 1.83631 6.66422 1.50053 6.25 1.50053H5.85Z">`),Cm=e=>{let t=G(),n=()=>e.fill||t.colors.accent;return(()=>{var e=Sm(),t=e.firstChild;return P(()=>U(t,`fill`,n())),e})()},wm=H(`<svg xmlns=http://www.w3.org/2000/svg width=17 height=16 viewBox="0 0 17 16"fill=none><g clip-path=url(#clip0_3676_1274)><path fill-rule=evenodd clip-rule=evenodd d="M1.82698 2.63901C1.5 3.28074 1.5 4.12082 1.5 5.80098V8.80098V9.00098V10.201C1.5 11.8811 1.5 12.7212 1.82698 13.3629C2.1146 13.9274 2.57354 14.3864 3.13803 14.674C3.77976 15.001 4.61984 15.001 6.3 15.001H11.7C13.3802 15.001 14.2202 15.001 14.862 14.674C15.4265 14.3864 15.8854 13.9274 16.173 13.3629C16.5 12.7212 16.5 11.8811 16.5 10.201V8.80098C16.5 7.12082 16.5 6.28074 16.173 5.63901C15.8854 5.07452 15.4265 4.61558 14.862 4.32796C14.743 4.26733 14.6172 4.21795 14.4805 4.17772C14.4501 3.49449 14.3722 3.02994 14.173 2.63901C13.8854 2.07452 13.4265 1.61558 12.862 1.32796C12.2202 1.00098 11.3802 1.00098 9.7 1.00098H6.3C4.61984 1.00098 3.77976 1.00098 3.13803 1.32796C2.57354 1.61558 2.1146 2.07452 1.82698 2.63901ZM12.9861 4.00942C12.9684 3.7108 12.9281 3.49982 12.8365 3.31999C12.6927 3.03775 12.4632 2.80828 12.181 2.66447C11.8601 2.50098 11.4401 2.50098 10.6 2.50098H5.4C4.55992 2.50098 4.13988 2.50098 3.81901 2.66447C3.53677 2.80828 3.3073 3.03775 3.16349 3.31999C3.03615 3.56991 3.00799 3.88 3.00177 4.40188C3.04646 4.37612 3.09189 4.35146 3.13803 4.32796C3.77976 4.00098 4.61984 4.00098 6.3 4.00098H11.7C12.1966 4.00098 12.6197 4.00098 12.9861 4.00942ZM3 7.90098V8.10098C3 8.47468 3 8.76527 3.01439 9.00098H3V11.101C3 11.9411 3 12.3611 3.16349 12.682C3.3073 12.9642 3.53677 13.1937 3.81901 13.3375C4.13988 13.501 4.55992 13.501 5.4 13.501H12.6C13.4401 13.501 13.8601 13.501 14.181 13.3375C14.4632 13.1937 14.6927 12.9642 14.8365 12.682C15 12.3611 15 11.9411 15 11.101V7.90098C15 7.0609 15 6.64086 14.8365 6.31999C14.6927 6.03775 14.4632 5.80828 14.181 5.66447C13.8601 5.50098 13.4401 5.50098 12.6 5.50098H5.4C4.55992 5.50098 4.13988 5.50098 3.81901 5.66447C3.53677 5.80828 3.3073 6.03775 3.16349 6.31999C3 6.64086 3 7.0609 3 7.90098ZM10.5 9.75098C10.5 9.33676 10.8358 9.00098 11.25 9.00098H12.75C13.1642 9.00098 13.5 9.33676 13.5 9.75098C13.5 10.1652 13.1642 10.501 12.75 10.501H11.25C10.8358 10.501 10.5 10.1652 10.5 9.75098Z"></path></g><defs><clipPath id=clip0_3676_1274><rect width=16 height=16 fill=white transform="translate(0.5 0.000976562)">`),Tm=e=>{let t=G(),n=()=>e.fill||t.colors.accent;return(()=>{var e=wm(),t=e.firstChild.firstChild;return P(()=>U(t,`fill`,n())),e})()},Em=H(`<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M39.6319 16.8719C38.3212 16.2041 36.7002 16.0478 34 16.0112V11C34 5.47715 29.5228 1 24 1C18.4772 1 14 5.47715 14 11V16.0112C11.2998 16.0478 9.6788 16.2041 8.36808 16.8719C6.86278 17.6389 5.63893 18.8628 4.87195 20.3681C4 22.0794 4 24.3196 4 28.8V32.2C4 36.6804 4 38.9206 4.87195 40.6319C5.63893 42.1372 6.86278 43.3611 8.36808 44.1281C10.0794 45 12.3196 45 16.8 45H31.2C35.6804 45 37.9206 45 39.6319 44.1281C41.1372 43.3611 42.3611 42.1372 43.1281 40.6319C44 38.9206 44 36.6804 44 32.2V28.8C44 24.3196 44 22.0794 43.1281 20.3681C42.3611 18.8628 41.1372 17.6389 39.6319 16.8719ZM31 11V16H17V11C17 7.13401 20.134 4 24 4C27.866 4 31 7.13401 31 11ZM7.54497 21.73C7 22.7996 7 24.1997 7 27V34C7 36.8003 7 38.2004 7.54497 39.27C8.02433 40.2108 8.78924 40.9757 9.73005 41.455C10.7996 42 12.1997 42 15 42H33C35.8003 42 37.2004 42 38.27 41.455C39.2108 40.9757 39.9757 40.2108 40.455 39.27C41 38.2004 41 36.8003 41 34V27C41 24.1997 41 22.7996 40.455 21.73C39.9757 20.7892 39.2108 20.0243 38.27 19.545C37.2004 19 35.8003 19 33 19H15C12.1997 19 10.7996 19 9.73005 19.545C8.78924 20.0243 8.02433 20.7892 7.54497 21.73ZM24 24C23.1716 24 22.5 24.6716 22.5 25.5V29.5C22.5 30.3284 23.1716 31 24 31C24.8284 31 25.5 30.3284 25.5 29.5V25.5C25.5 24.6716 24.8284 24 24 24Z">`),Dm=e=>{let t=G(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{var t=Em(),r=t.firstChild;return P(i=>{var a=e.class,o=n();return a!==i.e&&U(t,`class`,i.e=a),o!==i.t&&U(r,`fill`,i.t=o),i},{e:void 0,t:void 0}),t})()},Om=H(`<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M37.485 37.3849C40.894 33.9506 43 29.2212 43 24C43 13.5066 34.4934 5 24 5C13.5066 5 5 13.5066 5 24C5 29.2213 7.1061 33.9507 10.5151 37.385C13.3583 32.9438 18.3354 30 24.0001 30C29.6647 30 34.6418 32.9437 37.485 37.3849ZM35.1809 39.3635C32.9143 35.5532 28.7554 33 24.0001 33C19.2448 33 15.0858 35.5533 12.8193 39.3636C15.9564 41.6506 19.8206 43 24 43C28.1795 43 32.0437 41.6505 35.1809 39.3635ZM24 46C36.1503 46 46 36.1503 46 24C46 11.8497 36.1503 2 24 2C11.8497 2 2 11.8497 2 24C2 36.1503 11.8497 46 24 46ZM24 24C26.7614 24 29 21.7614 29 19C29 16.2386 26.7614 14 24 14C21.2386 14 19 16.2386 19 19C19 21.7614 21.2386 24 24 24ZM24 27C28.4183 27 32 23.4183 32 19C32 14.5817 28.4183 11 24 11C19.5817 11 16 14.5817 16 19C16 23.4183 19.5817 27 24 27Z">`),km=e=>{let t=G(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{var t=Om(),r=t.firstChild;return P(i=>{var a=e.class,o=n();return a!==i.e&&U(t,`class`,i.e=a),o!==i.t&&U(r,`fill`,i.t=o),i},{e:void 0,t:void 0}),t})()},Am=H(`<svg xmlns=http://www.w3.org/2000/svg width=48 height=48 viewBox="0 0 48 48"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M34.5607 4.43934C33.9749 3.85355 33.0251 3.85355 32.4393 4.43934C31.8536 5.02513 31.8536 5.97487 32.4393 6.56066L37.8787 12H10.5C9.67157 12 9 12.6716 9 13.5C9 14.3284 9.67157 15 10.5 15H37.8787L32.4393 20.4393C31.8536 21.0251 31.8536 21.9749 32.4393 22.5607C33.0251 23.1464 33.9749 23.1464 34.5607 22.5607L42.5607 14.5607C43.1464 13.9749 43.1464 13.0251 42.5607 12.4393L34.5607 4.43934ZM13.4393 25.4393C14.0251 24.8536 14.9749 24.8536 15.5607 25.4393C16.1464 26.0251 16.1464 26.9749 15.5607 27.5607L10.1213 33H37.5C38.3284 33 39 33.6716 39 34.5C39 35.3284 38.3284 36 37.5 36H10.1213L15.5607 41.4393C16.1464 42.0251 16.1464 42.9749 15.5607 43.5607C14.9749 44.1464 14.0251 44.1464 13.4393 43.5607L5.43934 35.5607C4.85355 34.9749 4.85355 34.0251 5.43934 33.4393L13.4393 25.4393Z">`),jm=e=>{let t=G(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{var t=Am(),r=t.firstChild;return P(i=>{var a=e.class,o=n();return a!==i.e&&U(t,`class`,i.e=a),o!==i.t&&U(r,`fill`,i.t=o),i},{e:void 0,t:void 0}),t})()},Mm=H(`<svg xmlns=http://www.w3.org/2000/svg width=19 height=15 viewBox="0 0 19 15"fill=none><path d="M1.2441 6.45738C6.10346 4.34072 9.34298 2.94515 10.9628 2.27094C15.5929 0.345681 16.5539 0.011308 17.1815 0.000110129C17.3195 -0.00223361 17.6268 0.0318806 17.8273 0.19412C17.9939 0.330838 18.0409 0.515733 18.0643 0.64542C18.0851 0.775107 18.1138 1.07068 18.0904 1.30141C17.8404 3.93682 16.7544 10.3321 16.2024 13.2839C15.9706 14.5329 15.5096 14.9517 15.0643 14.9926C14.0956 15.0816 13.3612 14.353 12.4237 13.7386C10.9575 12.7769 10.1295 12.1785 8.70498 11.2402C7.05915 10.1558 8.12683 9.55972 9.06432 8.58576C9.30911 8.33082 13.5747 4.45192 13.6554 4.1001C13.6658 4.05609 13.6763 3.89203 13.5773 3.80557C13.481 3.71885 13.3377 3.74854 13.2335 3.77197C13.0851 3.80531 10.7439 5.35426 6.2023 8.41858C5.53824 8.87535 4.93669 9.098 4.39503 9.08628C3.80128 9.07352 2.65553 8.74982 1.80397 8.47326C0.762309 8.13394 -0.0684571 7.95452 0.00445919 7.37821C0.0409174 7.07822 0.455044 6.77118 1.2441 6.45738Z">`),Nm=e=>{let t=G(),n=()=>e.fill||t.colors.constant.white;return(()=>{var t=Mm(),r=t.firstChild;return P(i=>{var a=e.class,o=n();return a!==i.e&&U(t,`class`,i.e=a),o!==i.t&&U(r,`fill`,i.t=o),i},{e:void 0,t:void 0}),t})()},Pm=H(`<svg xmlns=http://www.w3.org/2000/svg width=28 height=28 viewBox="0 0 28 28"><path fill-rule=evenodd clip-rule=evenodd d="M10.0001 10.0001C10.0016 8.02333 10.0267 6.98719 10.436 6.18404C10.8195 5.43139 11.4314 4.81947 12.184 4.43597C13.0397 4 14.1598 4 16.4 4H17.6C19.8402 4 20.9603 4 21.816 4.43597C22.5686 4.81947 23.1805 5.43139 23.564 6.18404C24 7.03969 24 8.15979 24 10.4V11.6C24 13.8402 24 14.9603 23.564 15.816C23.1805 16.5686 22.5686 17.1805 21.816 17.564C21.0128 17.9733 19.9767 17.9984 17.9999 17.9999C17.9984 19.9767 17.9733 21.0128 17.564 21.816C17.1805 22.5686 16.5686 23.1805 15.816 23.564C14.9603 24 13.8402 24 11.6 24H10.4C8.15979 24 7.03969 24 6.18404 23.564C5.43139 23.1805 4.81947 22.5686 4.43597 21.816C4 20.9603 4 19.8402 4 17.6V16.4C4 14.1598 4 13.0397 4.43597 12.184C4.81947 11.4314 5.43139 10.8195 6.18404 10.436C6.98719 10.0267 8.02333 10.0016 10.0001 10.0001ZM10 11.5H9.5C8.09987 11.5 7.3998 11.5 6.86502 11.7725C6.39462 12.0122 6.01217 12.3946 5.77248 12.865C5.5 13.3998 5.5 14.0999 5.5 15.5V18.5C5.5 19.9001 5.5 20.6002 5.77248 21.135C6.01217 21.6054 6.39462 21.9878 6.86502 22.2275C7.3998 22.5 8.09987 22.5 9.5 22.5H12.5C13.9001 22.5 14.6002 22.5 15.135 22.2275C15.6054 21.9878 15.9878 21.6054 16.2275 21.135C16.5 20.6002 16.5 19.9001 16.5 18.5V18H16.4C14.1598 18 13.0397 18 12.184 17.564C11.4314 17.1805 10.8195 16.5686 10.436 15.816C10 14.9603 10 13.8402 10 11.6V11.5ZM11.5 9.5C11.5 8.09987 11.5 7.3998 11.7725 6.86502C12.0122 6.39462 12.3946 6.01217 12.865 5.77248C13.3998 5.5 14.0999 5.5 15.5 5.5H18.5C19.9001 5.5 20.6002 5.5 21.135 5.77248C21.6054 6.01217 21.9878 6.39462 22.2275 6.86502C22.5 7.3998 22.5 8.09987 22.5 9.5V12.5C22.5 13.9001 22.5 14.6002 22.2275 15.135C21.9878 15.6054 21.6054 15.9878 21.135 16.2275C20.6002 16.5 19.9001 16.5 18.5 16.5H15.5C14.0999 16.5 13.3998 16.5 12.865 16.2275C12.3946 15.9878 12.0122 15.6054 11.7725 15.135C11.5 14.6002 11.5 13.9001 11.5 12.5V9.5Z">`),Fm=e=>{let t=G(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{var e=Pm(),t=e.firstChild;return P(r=>{var i=n(),a=n();return i!==r.e&&U(e,`fill`,r.e=i),a!==r.t&&U(t,`fill`,r.t=a),r},{e:void 0,t:void 0}),e})()},Im=H(`<svg xmlns=http://www.w3.org/2000/svg width=16 height=17 viewBox="0 0 16 17"fill=none><path fill-rule=evenodd clip-rule=evenodd d="M1 4.12695C1 3.07754 1 2.55284 1.19202 2.14684C1.38986 1.72856 1.7266 1.39181 2.14489 1.19397C2.55088 1.00195 3.07559 1.00195 4.125 1.00195C5.17441 1.00195 5.69912 1.00195 6.10511 1.19397C6.5234 1.39181 6.86014 1.72856 7.05798 2.14684C7.25 2.55284 7.25 3.07754 7.25 4.12695C7.25 5.17636 7.25 5.70107 7.05798 6.10706C6.86014 6.52535 6.5234 6.8621 6.10511 7.05993C5.69912 7.25195 5.17441 7.25195 4.125 7.25195C3.07559 7.25195 2.55088 7.25195 2.14489 7.05993C1.7266 6.8621 1.38986 6.52535 1.19202 6.10706C1 5.70107 1 5.17636 1 4.12695ZM2.5 3.30195C2.5 3.02193 2.5 2.88191 2.5545 2.77496C2.60243 2.68088 2.67892 2.60439 2.773 2.55645C2.87996 2.50195 3.01997 2.50195 3.3 2.50195H4.95C5.23003 2.50195 5.37004 2.50195 5.477 2.55645C5.57108 2.60439 5.64757 2.68088 5.6955 2.77496C5.75 2.88191 5.75 3.02193 5.75 3.30195V4.95195C5.75 5.23198 5.75 5.37199 5.6955 5.47895C5.64757 5.57303 5.57108 5.64952 5.477 5.69746C5.37004 5.75195 5.23003 5.75195 4.95 5.75195H3.3C3.01997 5.75195 2.87996 5.75195 2.773 5.69746C2.67892 5.64952 2.60243 5.57303 2.5545 5.47895C2.5 5.37199 2.5 5.23198 2.5 4.95195V3.30195ZM1 11.877C1 10.8275 1 10.3028 1.19202 9.89684C1.38986 9.47856 1.7266 9.14181 2.14489 8.94397C2.55088 8.75195 3.07559 8.75195 4.125 8.75195C5.17441 8.75195 5.69912 8.75195 6.10511 8.94397C6.5234 9.14181 6.86014 9.47856 7.05798 9.89684C7.25 10.3028 7.25 10.8275 7.25 11.877C7.25 12.9264 7.25 13.4511 7.05798 13.8571C6.86014 14.2753 6.5234 14.6121 6.10511 14.8099C5.69912 15.002 5.17441 15.002 4.125 15.002C3.07559 15.002 2.55088 15.002 2.14489 14.8099C1.7266 14.6121 1.38986 14.2753 1.19202 13.8571C1 13.4511 1 12.9264 1 11.877ZM2.5 11.052C2.5 10.7719 2.5 10.6319 2.5545 10.525C2.60243 10.4309 2.67892 10.3544 2.773 10.3064C2.87996 10.252 3.01997 10.252 3.3 10.252H4.95C5.23003 10.252 5.37004 10.252 5.477 10.3064C5.57108 10.3544 5.64757 10.4309 5.6955 10.525C5.75 10.6319 5.75 10.7719 5.75 11.052V12.702C5.75 12.982 5.75 13.122 5.6955 13.2289C5.64757 13.323 5.57108 13.3995 5.477 13.4475C5.37004 13.502 5.23003 13.502 4.95 13.502H3.3C3.01997 13.502 2.87996 13.502 2.773 13.4475C2.67892 13.3995 2.60243 13.323 2.5545 13.2289C2.5 13.122 2.5 12.982 2.5 12.702V11.052ZM8.94202 2.14684C8.75 2.55284 8.75 3.07754 8.75 4.12695C8.75 5.17636 8.75 5.70107 8.94202 6.10706C9.13986 6.52535 9.4766 6.8621 9.89489 7.05993C10.3009 7.25195 10.8256 7.25195 11.875 7.25195C12.9244 7.25195 13.4491 7.25195 13.8551 7.05993C14.2734 6.8621 14.6101 6.52535 14.808 6.10706C15 5.70107 15 5.17636 15 4.12695C15 3.07754 15 2.55284 14.808 2.14684C14.6101 1.72856 14.2734 1.39181 13.8551 1.19397C13.4491 1.00195 12.9244 1.00195 11.875 1.00195C10.8256 1.00195 10.3009 1.00195 9.89489 1.19397C9.4766 1.39181 9.13986 1.72856 8.94202 2.14684ZM10.3045 2.77496C10.25 2.88191 10.25 3.02193 10.25 3.30195V4.95195C10.25 5.23198 10.25 5.37199 10.3045 5.47895C10.3524 5.57303 10.4289 5.64952 10.523 5.69746C10.63 5.75195 10.77 5.75195 11.05 5.75195H12.7C12.98 5.75195 13.12 5.75195 13.227 5.69746C13.3211 5.64952 13.3976 5.57303 13.4455 5.47895C13.5 5.37199 13.5 5.23198 13.5 4.95195V3.30195C13.5 3.02193 13.5 2.88191 13.4455 2.77496C13.3976 2.68088 13.3211 2.60439 13.227 2.55645C13.12 2.50195 12.98 2.50195 12.7 2.50195H11.05C10.77 2.50195 10.63 2.50195 10.523 2.55645C10.4289 2.60439 10.3524 2.68088 10.3045 2.77496ZM8.80727 9.13518C8.75 9.26242 8.75 9.4256 8.75 9.75195C8.75 10.0783 8.75 10.2415 8.80727 10.3687C8.87245 10.5136 8.9884 10.6295 9.13323 10.6947C9.26047 10.752 9.42365 10.752 9.75 10.752C10.0764 10.752 10.2395 10.752 10.3668 10.6947C10.5116 10.6295 10.6276 10.5136 10.6927 10.3687C10.75 10.2415 10.75 10.0783 10.75 9.75195C10.75 9.4256 10.75 9.26242 10.6927 9.13518C10.6276 8.99035 10.5116 8.8744 10.3668 8.80922C10.2395 8.75195 10.0764 8.75195 9.75 8.75195C9.42365 8.75195 9.26047 8.75195 9.13323 8.80922C8.9884 8.8744 8.87245 8.99035 8.80727 9.13518ZM10.87 11.8771C10.87 11.546 10.87 11.3805 10.9289 11.2517C10.9938 11.1098 11.1077 10.9959 11.2497 10.931C11.3784 10.8721 11.5439 10.8721 11.875 10.8721C12.2061 10.8721 12.3716 10.8721 12.5003 10.931C12.6423 10.9959 12.7562 11.1098 12.8211 11.2517C12.88 11.3805 12.88 11.546 12.88 11.8771C12.88 12.2081 12.88 12.3737 12.8211 12.5024C12.7562 12.6444 12.6423 12.7583 12.5003 12.8232C12.3716 12.8821 12.2061 12.8821 11.875 12.8821C11.5439 12.8821 11.3784 12.8821 11.2497 12.8232C11.1077 12.7583 10.9938 12.6444 10.9289 12.5024C10.87 12.3737 10.87 12.2081 10.87 11.8771ZM8.80727 13.3852C8.75 13.5124 8.75 13.6756 8.75 14.002C8.75 14.3283 8.75 14.4915 8.80727 14.6187C8.87245 14.7636 8.9884 14.8795 9.13323 14.9447C9.26047 15.002 9.42365 15.002 9.75 15.002C10.0764 15.002 10.2395 15.002 10.3668 14.9447C10.5116 14.8795 10.6276 14.7636 10.6927 14.6187C10.75 14.4915 10.75 14.3283 10.75 14.002C10.75 13.6756 10.75 13.5124 10.6927 13.3852C10.6276 13.2404 10.5116 13.1244 10.3668 13.0592C10.2395 13.002 10.0764 13.002 9.75 13.002C9.42365 13.002 9.26047 13.002 9.13323 13.0592C8.9884 13.1244 8.87245 13.2404 8.80727 13.3852ZM13 9.75195C13 9.4256 13 9.26242 13.0573 9.13518C13.1224 8.99035 13.2384 8.8744 13.3832 8.80922C13.5105 8.75195 13.6736 8.75195 14 8.75195C14.3264 8.75195 14.4895 8.75195 14.6168 8.80922C14.7616 8.8744 14.8776 8.99035 14.9427 9.13518C15 9.26242 15 9.4256 15 9.75195C15 10.0783 15 10.2415 14.9427 10.3687C14.8776 10.5136 14.7616 10.6295 14.6168 10.6947C14.4895 10.752 14.3264 10.752 14 10.752C13.6736 10.752 13.5105 10.752 13.3832 10.6947C13.2384 10.6295 13.1224 10.5136 13.0573 10.3687C13 10.2415 13 10.0783 13 9.75195ZM13.0573 13.3852C13 13.5124 13 13.6756 13 14.002C13 14.3283 13 14.4915 13.0573 14.6187C13.1224 14.7636 13.2384 14.8795 13.3832 14.9447C13.5105 15.002 13.6736 15.002 14 15.002C14.3264 15.002 14.4895 15.002 14.6168 14.9447C14.7616 14.8795 14.8776 14.7636 14.9427 14.6187C15 14.4915 15 14.3283 15 14.002C15 13.6756 15 13.5124 14.9427 13.3852C14.8776 13.2404 14.7616 13.1244 14.6168 13.0592C14.4895 13.002 14.3264 13.002 14 13.002C13.6736 13.002 13.5105 13.002 13.3832 13.0592C13.2384 13.1244 13.1224 13.2404 13.0573 13.3852Z">`),Lm=e=>{let t=G(),n=()=>e.fill||t.colors.icon.secondary;return(()=>{var e=Im(),t=e.firstChild;return P(()=>U(t,`fill`,n())),e})()},Rm={m:`16px`,s:`12px`,none:`0`},zm={m:`6px`,s:`6px`,none:`0`},Bm=K.div`
|
|
1548
|
-
width: 60px;
|
|
1549
|
-
height: 60px;
|
|
1550
|
-
padding: 8px;
|
|
1551
|
-
margin-bottom: 8px;
|
|
1552
|
-
border-radius: ${e=>Rm[e.theme.borderRadius]};
|
|
1553
|
-
background-color: ${e=>e.theme.colors.background.tint};
|
|
1554
|
-
display: grid;
|
|
1555
|
-
grid-template: 1fr 1fr / 1fr 1fr;
|
|
1556
|
-
gap: 4px;
|
|
1557
|
-
`,Vm=K(wp)`
|
|
1558
|
-
width: 20px;
|
|
1559
|
-
height: 20px;
|
|
1560
|
-
border-radius: ${e=>zm[e.theme.borderRadius]};
|
|
1561
|
-
`,Hm=e=>R(Up,{get name(){return e.labelLine1},get secondLine(){return e.labelLine2},get icon(){return R(Bm,{get children(){return R(lo,{each:[0,1,2,3],children:t=>R(Vm,{get src(){return e.images[t]}})})}})},onClick:()=>e.onClick()}),Um=`telegram`,Wm=`gramwallet`,Gm=`telegram-wallet`;function Km(e){return!(`type`in e)||e.type!==`wallet-connect`}var qm=e=>{let[t]=yp(),n=()=>{if(`isPreferred`in e.wallet&&e.wallet.isPreferred)return t(`walletItem.recent`,{},`Recent`);if(e.wallet.appName===Wm)return t(`walletItem.new`,{},`New`);if(Km(e.wallet)&&Ve(e.wallet))return t(`walletItem.installed`,{},`Installed`)};return R(Up,{get icon(){return e.wallet.imageUrl},get name(){return e.wallet.name},get secondLine(){return n()},secondLineColorPrimary:!1,onClick:()=>e.onClick(),get class(){return e.class}})},Jm=K.div`
|
|
1562
|
-
width: 100%;
|
|
1563
|
-
overflow-y: auto;
|
|
1564
|
-
max-height: ${e=>e.maxHeight};
|
|
1565
|
-
|
|
1566
|
-
scrollbar-width: none;
|
|
1567
|
-
&&::-webkit-scrollbar {
|
|
1568
|
-
display: none;
|
|
1569
|
-
}
|
|
1570
|
-
|
|
1571
|
-
&&::-webkit-scrollbar-track {
|
|
1572
|
-
background: transparent;
|
|
1573
|
-
}
|
|
1574
|
-
|
|
1575
|
-
&&::-webkit-scrollbar-thumb {
|
|
1576
|
-
display: none;
|
|
1577
|
-
}
|
|
1578
|
-
`,Ym=K.div`
|
|
1579
|
-
height: 1px;
|
|
1580
|
-
margin: 0 -24px;
|
|
1581
|
-
width: calc(100% + 48px);
|
|
1582
|
-
opacity: 0.08;
|
|
1583
|
-
background: ${e=>e.isShown?e.theme.colors.icon.secondary:`transparent`};
|
|
1584
|
-
transition: background 0.15s ease-in-out;
|
|
1585
|
-
|
|
1586
|
-
${yl(`mobile`)} {
|
|
1587
|
-
width: 100%;
|
|
1588
|
-
margin: 0;
|
|
1589
|
-
}
|
|
1590
|
-
`,[Xm,Zm]=N(Xs()?.innerHeight||0);Xs()&&window.addEventListener(`resize`,()=>Zm(window.innerHeight));var[Qm,$m]=N(vl(`mobile`)),eh=()=>$m(vl(`mobile`));Xs()&&(window.addEventListener(`resize`,()=>eh()),window.addEventListener(`load`,()=>eh(),{once:!0}));var th=e=>{let[t,n]=N(!1),r=e=>{n(e.target.scrollTop>0)},i=()=>Qm()?150:200,a=()=>e.maxHeight===void 0?`${Xm()-i()}px`:`${e.maxHeight}px`;return[R(Ym,{get isShown(){return t()}}),R(Jm,{get maxHeight(){return a()},onScroll:r,get class(){return e.class},get children(){return e.children}})]},nh=K.a`
|
|
1591
|
-
display: block;
|
|
1592
|
-
text-decoration: unset;
|
|
1593
|
-
`,rh=e=>R(nh,oo({get href(){return e.href},get target(){return e.blank?`_blank`:`_self`},get class(){return e.class}},()=>e.blank?{rel:`noreferrer noopener`}:{},{get children(){return e.children}})),ih=Na(),ah=H(`<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path fill-rule=evenodd clip-rule=evenodd d="M7.76228 2.09998H10.2378C11.0458 2.09997 11.7067 2.09996 12.2438 2.14384C12.7997 2.18926 13.3017 2.28614 13.7706 2.52505C14.5045 2.89896 15.1011 3.49558 15.475 4.22941C15.7139 4.6983 15.8108 5.20038 15.8562 5.75629C15.9001 6.29337 15.9001 6.95422 15.9001 7.76227V8.1H16.2377C17.0457 8.09999 17.7066 8.09998 18.2437 8.14386C18.7996 8.18928 19.3017 8.28616 19.7705 8.52507C20.5044 8.89898 21.101 9.4956 21.4749 10.2294C21.7138 10.6983 21.8107 11.2004 21.8561 11.7563C21.9 12.2934 21.9 12.9542 21.9 13.7623V16.2377C21.9 17.0458 21.9 17.7066 21.8561 18.2437C21.8107 18.7996 21.7138 19.3017 21.4749 19.7706C21.101 20.5044 20.5044 21.101 19.7705 21.4749C19.3017 21.7138 18.7996 21.8107 18.2437 21.8561C17.7066 21.9 17.0458 21.9 16.2378 21.9H13.7623C12.9543 21.9 12.2934 21.9 11.7563 21.8561C11.2004 21.8107 10.6983 21.7138 10.2294 21.4749C9.49561 21.101 8.89898 20.5044 8.52508 19.7706C8.28616 19.3017 8.18928 18.7996 8.14386 18.2437C8.09998 17.7066 8.09999 17.0458 8.1 16.2377V15.9H7.76227C6.95426 15.9 6.29335 15.9 5.75629 15.8561C5.20038 15.8107 4.6983 15.7138 4.22941 15.4749C3.49558 15.101 2.89896 14.5044 2.52505 13.7705C2.28614 13.3017 2.18926 12.7996 2.14384 12.2437C2.09996 11.7066 2.09997 11.0458 2.09998 10.2377V7.76228C2.09997 6.95424 2.09996 6.29336 2.14384 5.75629C2.18926 5.20038 2.28614 4.6983 2.52505 4.22941C2.89896 3.49558 3.49558 2.89896 4.22941 2.52505C4.6983 2.28614 5.20038 2.18926 5.75629 2.14384C6.29336 2.09996 6.95425 2.09997 7.76228 2.09998ZM8.1 14.1V13.7623C8.09999 12.9542 8.09998 12.2934 8.14386 11.7563C8.18928 11.2004 8.28616 10.6983 8.52508 10.2294C8.89898 9.4956 9.49561 8.89898 10.2294 8.52507C10.6983 8.28616 11.2004 8.18928 11.7563 8.14386C12.2934 8.09998 12.9542 8.09999 13.7623 8.1H14.1001V7.79998C14.1001 6.94505 14.0994 6.35798 14.0622 5.90287C14.0259 5.45827 13.9593 5.21944 13.8712 5.0466C13.6699 4.65146 13.3486 4.3302 12.9535 4.12886C12.7806 4.04079 12.5418 3.97419 12.0972 3.93786C11.6421 3.90068 11.055 3.89998 10.2001 3.89998H7.79998C6.94505 3.89998 6.35798 3.90068 5.90287 3.93786C5.45827 3.97419 5.21944 4.04079 5.0466 4.12886C4.65146 4.3302 4.3302 4.65146 4.12886 5.0466C4.04079 5.21944 3.97419 5.45827 3.93786 5.90287C3.90068 6.35798 3.89998 6.94505 3.89998 7.79998V10.2C3.89998 11.0549 3.90068 11.642 3.93786 12.0971C3.97419 12.5417 4.04079 12.7805 4.12886 12.9534C4.3302 13.3485 4.65146 13.6698 5.0466 13.8711C5.21944 13.9592 5.45827 14.0258 5.90287 14.0621C6.35798 14.0993 6.94505 14.1 7.79998 14.1H8.1ZM11.0466 10.1289C11.2195 10.0408 11.4583 9.97421 11.9029 9.93788C12.358 9.9007 12.9451 9.9 13.8 9.9H16.2C17.0549 9.9 17.642 9.9007 18.0971 9.93788C18.5417 9.97421 18.7805 10.0408 18.9534 10.1289C19.3485 10.3302 19.6698 10.6515 19.8711 11.0466C19.9592 11.2195 20.0258 11.4583 20.0621 11.9029C20.0993 12.358 20.1 12.9451 20.1 13.8V16.2C20.1 17.0549 20.0993 17.642 20.0621 18.0971C20.0258 18.5417 19.9592 18.7805 19.8711 18.9534C19.6698 19.3485 19.3485 19.6698 18.9534 19.8711C18.7805 19.9592 18.5417 20.0258 18.0971 20.0621C17.642 20.0993 17.0549 20.1 16.2 20.1H13.8C12.9451 20.1 12.358 20.0993 11.9029 20.0621C11.4583 20.0258 11.2195 19.9592 11.0466 19.8711C10.6515 19.6698 10.3302 19.3485 10.1289 18.9534C10.0408 18.7805 9.97421 18.5417 9.93788 18.0971C9.9007 17.642 9.9 17.0549 9.9 16.2V13.8C9.9 12.9451 9.9007 12.358 9.93788 11.9029C9.97421 11.4583 10.0408 11.2195 10.1289 11.0466C10.3302 10.6515 10.6515 10.3302 11.0466 10.1289Z">`),oh=e=>{let t=G(),n=()=>e.fill||t.colors.icon.primary;return(()=>{var t=ah(),r=t.firstChild;return P(i=>{var a=e.class,o=n();return a!==i.e&&U(t,`class`,i.e=a),o!==i.t&&U(r,`fill`,i.t=o),i},{e:void 0,t:void 0}),t})()},sh=H(`<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8.7624 3.10001C7.95435 3.1 7.29349 3.09999 6.75642 3.14387C6.2005 3.18929 5.69842 3.28617 5.22954 3.52508C4.4957 3.89899 3.89908 4.49561 3.52517 5.22944C3.28626 5.69833 3.18938 6.20041 3.14396 6.75632C3.10008 7.2934 3.10009 7.95424 3.1001 8.76229V15.2377C3.10009 16.0458 3.10008 16.7066 3.14396 17.2437C3.18938 17.7996 3.28626 18.3017 3.52517 18.7706C3.89908 19.5044 4.4957 20.101 5.22954 20.4749C5.69842 20.7138 6.2005 20.8107 6.75642 20.8561C7.29349 20.9 7.95434 20.9 8.76239 20.9H12.0001C12.4972 20.9 12.9001 20.4971 12.9001 20C12.9001 19.503 12.4972 19.1 12.0001 19.1H8.8001C7.94517 19.1 7.3581 19.0993 6.90299 19.0621C6.45839 19.0258 6.21956 18.9592 6.04672 18.8711C5.65158 18.6698 5.33032 18.3485 5.12898 17.9534C5.04092 17.7805 4.97431 17.5417 4.93798 17.0971C4.9008 16.642 4.9001 16.0549 4.9001 15.2V8.80001C4.9001 7.94508 4.9008 7.35801 4.93798 6.9029C4.97431 6.4583 5.04092 6.21947 5.12898 6.04663C5.33032 5.65149 5.65158 5.33023 6.04672 5.12889C6.21956 5.04082 6.45839 4.97422 6.90299 4.93789C7.3581 4.90071 7.94517 4.90001 8.8001 4.90001H12.0001C12.4972 4.90001 12.9001 4.49706 12.9001 4.00001C12.9001 3.50295 12.4972 3.10001 12.0001 3.10001H8.7624Z"></path><path d="M17.6364 7.3636C17.2849 7.01212 16.7151 7.01212 16.3636 7.3636C16.0121 7.71507 16.0121 8.28492 16.3636 8.63639L18.8272 11.1H9.00001C8.50295 11.1 8.10001 11.5029 8.10001 12C8.10001 12.497 8.50295 12.9 9.00001 12.9H18.8272L16.3636 15.3636C16.0121 15.7151 16.0121 16.2849 16.3636 16.6364C16.7151 16.9879 17.2849 16.9879 17.6364 16.6364L21.6364 12.6364C21.9879 12.2849 21.9879 11.7151 21.6364 11.3636L17.6364 7.3636Z">`),ch=e=>{let t=G(),n=()=>e.fill||t.colors.icon.primary;return(()=>{var e=sh(),t=e.firstChild,r=t.nextSibling;return P(e=>{var i=n(),a=n();return i!==e.e&&U(t,`fill`,e.e=i),a!==e.t&&U(r,`fill`,e.t=a),e},{e:void 0,t:void 0}),e})()},lh={m:`8px`,s:`4px`,none:`0`},uh={m:`16px`,s:`8px`,none:`0`},dh=K.div`
|
|
1594
|
-
width: 256px;
|
|
1595
|
-
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
|
|
1596
|
-
border-radius: ${e=>uh[e.theme.borderRadius]};
|
|
1597
|
-
|
|
1598
|
-
background-color: ${e=>e.theme.colors.background.primary}
|
|
1599
|
-
|
|
1600
|
-
color: ${e=>e.theme.colors.text.primary}
|
|
1601
|
-
`,fh=K.ul`
|
|
1602
|
-
background-color: ${e=>e.theme.colors.background.primary};
|
|
1603
|
-
padding: 8px;
|
|
1604
|
-
`,ph=K.button`
|
|
1605
|
-
display: flex;
|
|
1606
|
-
align-items: center;
|
|
1607
|
-
gap: 8px;
|
|
1608
|
-
height: 40px;
|
|
1609
|
-
padding-left: 8px;
|
|
1610
|
-
width: 100%;
|
|
1611
|
-
|
|
1612
|
-
background-color: ${e=>e.theme.colors.background.primary};
|
|
1613
|
-
border: none;
|
|
1614
|
-
border-radius: ${e=>lh[e.theme.borderRadius]};
|
|
1615
|
-
cursor: pointer;
|
|
1616
|
-
|
|
1617
|
-
transition:
|
|
1618
|
-
background-color,
|
|
1619
|
-
transform 0.1s ease-in-out;
|
|
1620
|
-
|
|
1621
|
-
&:hover {
|
|
1622
|
-
background-color: ${e=>e.theme.colors.background.secondary};
|
|
1623
|
-
}
|
|
1624
|
-
|
|
1625
|
-
&:active {
|
|
1626
|
-
transform: scale(0.96);
|
|
1627
|
-
}
|
|
1628
|
-
`,mh=H(`<li>`),hh=e=>R(xp,{get translationKey(){return e.translationKey},fontSize:`15px`,fontWeight:`590`,get children(){return e.children}}),gh=e=>{let t=Pa(ih),[n,r]=N(!1),i=()=>A(null,null,function*(){yield Zf(wn(t.account.address,t.account.chain===he.TESTNET)),r(!0),setTimeout(()=>r(!1),1e3)}),a=()=>{t.disconnect().catch(e=>void 0),e.onClose()};return R(dh,{ref(t){var n=e.ref;typeof n==`function`?n(t):e.ref=t},get class(){return e.class},"data-tc-dropdown":`true`,get children(){return R(fh,{get children(){return[(()=>{var e=mh();return Mo(e,R(ph,{onClick:()=>i(),get children(){return[R(oh,{}),R(z,{get when(){return!n()},get children(){return R(hh,{translationKey:`button.dropdown.copy`,children:`Copy address`})}}),R(z,{get when(){return n()},get children(){return R(hh,{translationKey:`button.dropdown.copied`,children:`Address copied!`})}})]}})),e})(),(()=>{var e=mh();return Mo(e,R(ph,{onClick:()=>a(),get children(){return[R(ch,{}),R(hh,{translationKey:`button.dropdown.disconnect`,children:`Disconnect`})]}})),e})()]}})}})},_h={m:`16px`,s:`8px`,none:`0`},vh=K.div`
|
|
1629
|
-
width: 256px;
|
|
1630
|
-
padding: 12px 16px;
|
|
1631
|
-
display: flex;
|
|
1632
|
-
gap: 9px;
|
|
1633
|
-
|
|
1634
|
-
background-color: ${e=>e.theme.colors.background.primary};
|
|
1635
|
-
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
|
|
1636
|
-
border-radius: ${e=>_h[e.theme.borderRadius]};
|
|
1637
|
-
`,yh=K.div`
|
|
1638
|
-
width: 192px;
|
|
1639
|
-
|
|
1640
|
-
> h3 {
|
|
1641
|
-
font-size: 15px;
|
|
1642
|
-
}
|
|
1643
|
-
`,bh=K(xp)`
|
|
1644
|
-
margin-top: 4px;
|
|
1645
|
-
color: ${e=>e.theme.colors.text.secondary};
|
|
1646
|
-
`,xh=e=>R(vh,oo({get class(){return e.class},"data-tc-notification":`true`},Tl(e),{get children(){return[R(yh,{get children(){return[R(Yp,{get translationKey(){return e.header.translationKey},get translationValues(){return e.header.translationValues},get children(){return e.children}}),R(z,{get when(){return e.text},get children(){return R(bh,{get translationKey(){return e.text.translationKey},get translationValues(){return e.text.translationValues}})}})]}}),V(()=>e.icon)]}})),Sh=K(lm)`
|
|
1647
|
-
align-self: center;
|
|
1648
|
-
`,Ch=e=>{let t=Pa(ih),[n]=yp(),r=()=>t.wallet&&`name`in t.wallet?t.wallet.name:n(`common.yourWallet`,{},`Your wallet`);return R(xh,{get header(){return{translationKey:`notifications.confirmTransaction.header`,translationValues:{name:r()}}},get class(){return e.class},get icon(){return R(Sh,{})},"data-tc-notification-confirm-transaction":`true`,children:`Confirm transaction in your wallet`})},wh=e=>{let t=Pa(ih),[n]=yp(),r=()=>t.wallet&&`name`in t.wallet?t.wallet.name:n(`common.yourWallet`,{},`Your wallet`);return R(xh,{get header(){return{translationKey:`notifications.confirmSignData.header`,translationValues:{name:r()}}},get class(){return e.class},get icon(){return R(Sh,{})},"data-tc-notification-confirm-sign-data":`true`,children:`Confirm data signing in your wallet`})},Th=e=>{let t=Pa(ih),[n]=yp(),r=()=>t.wallet&&`name`in t.wallet?t.wallet.name:n(`common.yourWallet`,{},`Your wallet`);return R(xh,{get header(){return{translationKey:`notifications.confirmSignMessage.header`,translationValues:{name:r()}}},get class(){return e.class},get icon(){return R(Sh,{})},"data-tc-notification-confirm-sign-message":`true`,children:`Confirm message signing in your wallet`})},Eh=K(am)`
|
|
1649
|
-
margin-top: 2px;
|
|
1650
|
-
`,Dh=e=>R(xh,{header:{translationKey:`notifications.transactionCanceled.header`},text:{translationKey:`notifications.transactionCanceled.text`},get icon(){return R(Eh,{size:`xs`})},get class(){return e.class},"data-tc-notification-tx-cancelled":`true`,children:`Transaction cancelled`}),Oh=K(tm)`
|
|
1651
|
-
margin-top: 2px;
|
|
1652
|
-
`,kh=e=>R(xh,{header:{translationKey:`notifications.transactionSent.header`},text:{translationKey:`notifications.transactionSent.text`},get icon(){return R(Oh,{})},get class(){return e.class},"data-tc-notification-tx-sent":`true`,children:`Transaction sent`}),Ah=rs`
|
|
1653
|
-
transform: translateY(-8px);
|
|
1654
|
-
margin-bottom: 12px;
|
|
1655
|
-
`,jh={timeout:4500},[Mh,Nh]=N(null);function Ph(e){let{timeout:t}=O(O({},jh),e),[n,r]=N([]),[i,a]=N([]);return F(Ca(Ac,e=>{if(!e||!e.showNotification){r(e=>e.filter(e=>!gc(e.action)));return}if(Mh()===e||Mh()?.name===e.name&&gc(e))return;Nh(e),r(e=>e.filter(e=>!gc(e.action)));let n={action:e};r(e=>[...e,n]);let i=setTimeout(()=>{r(e=>e.filter(e=>e!==n)),a(e=>e.filter(e=>e!==i))},t);a(e=>[...e,i])})),Ta(()=>{i().forEach(e=>clearTimeout(e))}),n}var Fh=K(am)`
|
|
1656
|
-
margin-top: 2px;
|
|
1657
|
-
`,Ih=e=>R(xh,{header:{translationKey:`notifications.signDataCanceled.header`},get icon(){return R(Fh,{size:`xs`})},get class(){return e.class},"data-tc-notification-sign-data-cancelled":`true`,children:`Sign data canceled`}),Lh=e=>R(xh,{header:{translationKey:`notifications.dataSigned.header`},get icon(){return R(Oh,{})},get class(){return e.class},"data-tc-notification-data-signed":`true`,children:`Data signed`}),Rh=e=>R(xh,{header:{translationKey:`notifications.messageSigned.header`},get icon(){return R(Oh,{})},get class(){return e.class},"data-tc-notification-message-signed":`true`,children:`Message signed`}),zh=K(am)`
|
|
1658
|
-
margin-top: 2px;
|
|
1659
|
-
`,Bh=e=>R(xh,{header:{translationKey:`notifications.signMessageCanceled.header`},get icon(){return R(zh,{size:`xs`})},get class(){return e.class},"data-tc-notification-sign-message-cancelled":`true`,children:`Sign message canceled`}),Vh=H(`<div data-tc-list-notifications=true>`),Hh=e=>{let t=Ph();return(()=>{var n=Vh();return Mo(n,R(Xd,{onBeforeEnter:e=>{bf(e,[{opacity:0,transform:`translateY(0)`},{opacity:1,transform:`translateY(-8px)`}],{duration:200})},onExit:(e,t)=>{bf(e,[{opacity:1,transform:`translateY(-8px)`},{opacity:0,transform:`translateY(-30px)`}],{duration:200}).finished.then(t)},get children(){return R(lo,{get each(){return t()},children:({action:e})=>R(uo,{get children(){return[R(B,{get when(){return e.name===dc.sendTransaction},get children(){return R(kh,{class:Ah})}}),R(B,{get when(){return e.name===fc.sendTransaction},get children(){return R(Dh,{class:Ah})}}),R(B,{get when(){return e.name===dc.signData},get children(){return R(Lh,{class:Ah})}}),R(B,{get when(){return e.name===dc.signMessage},get children(){return R(Rh,{class:Ah})}}),R(B,{get when(){return e.name===fc.signData},get children(){return R(Ih,{class:Ah})}}),R(B,{get when(){return e.name===fc.signMessage},get children(){return R(Bh,{class:Ah})}}),R(B,{get when(){return e.name===uc.sendTransaction},get children(){return R(Ch,{class:Ah})}}),R(B,{get when(){return e.name===uc.signData},get children(){return R(wh,{class:Ah})}}),R(B,{get when(){return e.name===uc.signMessage},get children(){return R(Th,{class:Ah})}})]}})})}})),P(()=>Eo(n,e.class)),n})()},Uh=K(X)`
|
|
1660
|
-
background-color: ${e=>e.theme.colors.connectButton.background};
|
|
1661
|
-
color: ${e=>e.theme.colors.connectButton.foreground};
|
|
1662
|
-
box-shadow: ${e=>`0 4px 24px ${ms(e.theme.colors.constant.black,.16)}`};
|
|
1663
|
-
padding: 8px 16px 8px 12px;
|
|
1664
|
-
|
|
1665
|
-
display: flex;
|
|
1666
|
-
align-items: center;
|
|
1667
|
-
gap: 4px;
|
|
1668
|
-
height: 40px;
|
|
1669
|
-
`,Wh=K(Uh)`
|
|
1670
|
-
padding: 12px 16px;
|
|
1671
|
-
min-width: 148px;
|
|
1672
|
-
justify-content: center;
|
|
1673
|
-
background-color: ${e=>e.theme.colors.background.primary};
|
|
1674
|
-
`,Gh=K(X)`
|
|
1675
|
-
min-width: 148px;
|
|
1676
|
-
height: 40px;
|
|
1677
|
-
|
|
1678
|
-
background-color: ${e=>e.theme.colors.background.primary};
|
|
1679
|
-
color: ${e=>e.theme.colors.connectButton.foreground};
|
|
1680
|
-
box-shadow: ${e=>`0 4px 24px ${ms(e.theme.colors.constant.black,.16)}`};
|
|
1681
|
-
|
|
1682
|
-
display: flex;
|
|
1683
|
-
align-items: center;
|
|
1684
|
-
justify-content: center;
|
|
1685
|
-
`,Kh=K(lm)`
|
|
1686
|
-
height: 18px;
|
|
1687
|
-
width: 18px;
|
|
1688
|
-
`,qh=K.div`
|
|
1689
|
-
width: fit-content;
|
|
1690
|
-
display: flex;
|
|
1691
|
-
flex-direction: column;
|
|
1692
|
-
align-items: flex-end;
|
|
1693
|
-
`,Jh=K(gh)`
|
|
1694
|
-
box-sizing: border-box;
|
|
1695
|
-
overflow: hidden;
|
|
1696
|
-
margin-top: 12px;
|
|
1697
|
-
`,Yh=K(Hh)`
|
|
1698
|
-
> div:first-child {
|
|
1699
|
-
margin-top: 20px;
|
|
1700
|
-
}
|
|
1701
|
-
`,Xh=Math.min,Zh=Math.max,Qh=Math.round,$h=Math.floor,eg=e=>({x:e,y:e}),tg={left:`right`,right:`left`,bottom:`top`,top:`bottom`},ng={start:`end`,end:`start`};function rg(e,t,n){return Zh(e,Xh(t,n))}function ig(e,t){return typeof e==`function`?e(t):e}function ag(e){return e.split(`-`)[0]}function og(e){return e.split(`-`)[1]}function sg(e){return e===`x`?`y`:`x`}function cg(e){return e===`y`?`height`:`width`}var lg=new Set([`top`,`bottom`]);function ug(e){return lg.has(ag(e))?`y`:`x`}function dg(e){return sg(ug(e))}function fg(e,t,n){n===void 0&&(n=!1);let r=og(e),i=dg(e),a=cg(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=xg(o)),[o,xg(o)]}function pg(e){let t=xg(e);return[mg(e),t,mg(t)]}function mg(e){return e.replace(/start|end/g,e=>ng[e])}var hg=[`left`,`right`],gg=[`right`,`left`],_g=[`top`,`bottom`],vg=[`bottom`,`top`];function yg(e,t,n){switch(e){case`top`:case`bottom`:return n?t?gg:hg:t?hg:gg;case`left`:case`right`:return t?_g:vg;default:return[]}}function bg(e,t,n,r){let i=og(e),a=yg(ag(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(mg)))),a}function xg(e){return e.replace(/left|right|bottom|top/g,e=>tg[e])}function Sg(e){return O({top:0,right:0,bottom:0,left:0},e)}function Cg(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Sg(e)}function wg(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Tg(e,t,n){let{reference:r,floating:i}=e,a=ug(t),o=dg(t),s=cg(o),c=ag(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(og(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}var Eg=(e,t,n)=>A(null,null,function*(){let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=yield o.isRTL==null?void 0:o.isRTL(t),l=yield o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Tg(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=yield h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p=k(O({},p),{[a]:O(O({},p[a]),v)}),y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?yield o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=Tg(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}});function Dg(e,t){return A(this,null,function*(){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ig(t,e),p=Cg(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=wg(yield i.getClippingRect({element:(yield i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||(yield i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=yield i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating),v=(yield i.isElement==null?void 0:i.isElement(_))&&(yield i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=wg(i.convertOffsetParentRelativeRectToViewportRelativeRect?yield i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}})}var Og=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,fn(t){return A(this,null,function*(){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,l=ig(e,t),{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p=`bestFit`,fallbackAxisSideDirection:m=`none`,flipAlignment:h=!0}=l,g=ia(l,[`mainAxis`,`crossAxis`,`fallbackPlacements`,`fallbackStrategy`,`fallbackAxisSideDirection`,`flipAlignment`]);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let _=ag(r),v=ug(o),y=ag(o)===o,b=yield s.isRTL==null?void 0:s.isRTL(c.floating),x=f||(y||!h?[xg(o)]:pg(o)),S=m!==`none`;!f&&S&&x.push(...bg(o,h,m,b));let C=[o,...x],ee=yield Dg(t,g),te=[],ne=i.flip?.overflows||[];if(u&&te.push(ee[_]),d){let e=fg(r,a,b);te.push(ee[e[0]],ee[e[1]])}if(ne=[...ne,{placement:r,overflows:te}],!te.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=C[e];if(t&&(d!==`alignment`||v===ug(t)||ne.every(e=>ug(e.placement)!==v||e.overflows[0]>0)))return{data:{index:e,overflows:ne},reset:{placement:t}};let n=ne.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(p){case`bestFit`:{let e=ne.filter(e=>{if(S){let t=ug(e.placement);return t===v||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}})}}},kg=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,fn(t){return A(this,null,function*(){let{x:n,y:r,placement:i}=t,a=ig(e,t),{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=a,l=ia(a,[`mainAxis`,`crossAxis`,`limiter`]),u={x:n,y:r},d=yield Dg(t,l),f=ug(ag(i)),p=sg(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=rg(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=rg(n,h,r)}let g=c.fn(k(O({},t),{[p]:m,[f]:h}));return k(O({},g),{data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}})})}}};function Ag(){return typeof window<`u`}function jg(e){return Pg(e)?(e.nodeName||``).toLowerCase():`#document`}function Mg(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ng(e){return((Pg(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Pg(e){return Ag()?e instanceof Node||e instanceof Mg(e).Node:!1}function Fg(e){return Ag()?e instanceof Element||e instanceof Mg(e).Element:!1}function Ig(e){return Ag()?e instanceof HTMLElement||e instanceof Mg(e).HTMLElement:!1}function Lg(e){return!Ag()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Mg(e).ShadowRoot}var Rg=new Set([`inline`,`contents`]);function zg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Qg(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Rg.has(i)}var Bg=new Set([`table`,`td`,`th`]);function Vg(e){return Bg.has(jg(e))}var Hg=[`:popover-open`,`:modal`];function Ug(e){return Hg.some(t=>{try{return e.matches(t)}catch{return!1}})}var Wg=[`transform`,`translate`,`scale`,`rotate`,`perspective`],Gg=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],Kg=[`paint`,`layout`,`strict`,`content`];function qg(e){let t=Yg(),n=Fg(e)?Qg(e):e;return Wg.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||Gg.some(e=>(n.willChange||``).includes(e))||Kg.some(e=>(n.contain||``).includes(e))}function Jg(e){let t=e_(e);for(;Ig(t)&&!Zg(t);){if(qg(t))return t;if(Ug(t))return null;t=e_(t)}return null}function Yg(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}var Xg=new Set([`html`,`body`,`#document`]);function Zg(e){return Xg.has(jg(e))}function Qg(e){return Mg(e).getComputedStyle(e)}function $g(e){return Fg(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function e_(e){if(jg(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Lg(e)&&e.host||Ng(e);return Lg(t)?t.host:t}function t_(e){let t=e_(e);return Zg(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ig(t)&&zg(t)?t:t_(t)}function n_(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=t_(e),i=r===e.ownerDocument?.body,a=Mg(r);if(i){let e=r_(a);return t.concat(a,a.visualViewport||[],zg(r)?r:[],e&&n?n_(e):[])}return t.concat(r,n_(r,[],n))}function r_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function i_(e){let t=Qg(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ig(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Qh(n)!==a||Qh(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function a_(e){return Fg(e)?e:e.contextElement}function o_(e){let t=a_(e);if(!Ig(t))return eg(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=i_(t),o=(a?Qh(n.width):n.width)/r,s=(a?Qh(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var s_=eg(0);function c_(e){let t=Mg(e);return!Yg()||!t.visualViewport?s_:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function l_(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Mg(e)?!1:t}function u_(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=a_(e),o=eg(1);t&&(r?Fg(r)&&(o=o_(r)):o=o_(e));let s=l_(a,n,r)?c_(a):eg(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Mg(a),t=r&&Fg(r)?Mg(r):r,n=e,i=r_(n);for(;i&&r&&t!==n;){let e=o_(i),t=i.getBoundingClientRect(),r=Qg(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Mg(i),i=r_(n)}}return wg({width:u,height:d,x:c,y:l})}function d_(e,t){let n=$g(e).scrollLeft;return t?t.left+n:u_(Ng(e)).left+n}function f_(e,t,n){n===void 0&&(n=!1);let r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:d_(e,r)),y:r.top+t.scrollTop}}function p_(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ng(r),s=t?Ug(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=eg(1),u=eg(0),d=Ig(r);if((d||!d&&!a)&&((jg(r)!==`body`||zg(o))&&(c=$g(r)),Ig(r))){let e=u_(r);l=o_(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?f_(o,c,!0):eg(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function m_(e){return Array.from(e.getClientRects())}function h_(e){let t=Ng(e),n=$g(e),r=e.ownerDocument.body,i=Zh(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Zh(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+d_(e),s=-n.scrollTop;return Qg(r).direction===`rtl`&&(o+=Zh(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function g_(e,t){let n=Mg(e),r=Ng(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Yg();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s,y:c}}var __=new Set([`absolute`,`fixed`]);function v_(e,t){let n=u_(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ig(e)?o_(e):eg(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function y_(e,t,n){let r;if(t===`viewport`)r=g_(e,n);else if(t===`document`)r=h_(Ng(e));else if(Fg(t))r=v_(t,n);else{let n=c_(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wg(r)}function b_(e,t){let n=e_(e);return n===t||!Fg(n)||Zg(n)?!1:Qg(n).position===`fixed`||b_(n,t)}function x_(e,t){let n=t.get(e);if(n)return n;let r=n_(e,[],!1).filter(e=>Fg(e)&&jg(e)!==`body`),i=null,a=Qg(e).position===`fixed`,o=a?e_(e):e;for(;Fg(o)&&!Zg(o);){let t=Qg(o),n=qg(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&__.has(i.position)||zg(o)&&!n&&b_(e,o))?r=r.filter(e=>e!==o):i=t,o=e_(o)}return t.set(e,r),r}function S_(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ug(t)?[]:x_(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=y_(t,n,i);return e.top=Zh(r.top,e.top),e.right=Xh(r.right,e.right),e.bottom=Xh(r.bottom,e.bottom),e.left=Zh(r.left,e.left),e},y_(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function C_(e){let{width:t,height:n}=i_(e);return{width:t,height:n}}function w_(e,t,n){let r=Ig(t),i=Ng(t),a=n===`fixed`,o=u_(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=eg(0);function l(){c.x=d_(i)}if(r||!r&&!a){if((jg(t)!==`body`||zg(i))&&(s=$g(t)),r){let e=u_(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=i&&!r&&!a?f_(i,s):eg(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function T_(e){return Qg(e).position===`static`}function E_(e,t){if(!Ig(e)||Qg(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ng(e)===n&&(n=n.ownerDocument.body),n}function D_(e,t){let n=Mg(e);if(Ug(e))return n;if(!Ig(e)){let t=e_(e);for(;t&&!Zg(t);){if(Fg(t)&&!T_(t))return t;t=e_(t)}return n}let r=E_(e,t);for(;r&&Vg(r)&&T_(r);)r=E_(r,t);return r&&Zg(r)&&T_(r)&&!qg(r)?n:r||Jg(e)||n}var O_=function(e){return A(this,null,function*(){let t=this.getOffsetParent||D_,n=this.getDimensions,r=yield n(e.floating);return{reference:w_(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function k_(e){return Qg(e).direction===`rtl`}var A_={convertOffsetParentRelativeRectToViewportRelativeRect:p_,getDocumentElement:Ng,getClippingRect:S_,getOffsetParent:D_,getElementRects:O_,getClientRects:m_,getDimensions:C_,getScale:o_,isElement:Fg,isRTL:k_};function j_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function M_(e,t){let n=null,r,i=Ng(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=$h(d),h=$h(i.clientWidth-(u+f)),g=$h(i.clientHeight-(d+p)),_=$h(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Zh(0,Xh(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!j_(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,k(O({},v),{root:i.ownerDocument}))}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function N_(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=a_(e),u=i||a?[...l?n_(l):[],...n_(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?M_(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?u_(e):null;c&&g();function g(){let t=u_(e);h&&!j_(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var P_=kg,F_=Og,I_=(e,t,n)=>{let r=new Map,i=O({platform:A_},n),a=k(O({},i.platform),{_c:r});return Eg(e,t,k(O({},i),{platform:a}))};function L_(e,t,n){let r=()=>n?.placement??`bottom`,i=()=>n?.strategy??`absolute`,[a,o]=N({x:null,y:null,placement:r(),strategy:i(),middlewareData:{}}),[s,c]=N();F(()=>{let e=s();if(e)throw e.value});let l=I(()=>(e(),t(),{}));function u(){let a=e(),s=t();if(a&&s){let e=l();I_(a,s,{middleware:n?.middleware,placement:r(),strategy:i()}).then(t=>{e===l()&&o(t)},e=>{c(e)})}}return F(()=>{let a=e(),o=t();if(r(),i(),a&&o){if(n!=null&&n.whileElementsMounted){let e=n.whileElementsMounted(a,o,u);e&&Ta(e)}else u()}}),{get x(){return a().x},get y(){return a().y},get placement(){return a().placement},get strategy(){return a().strategy},get middlewareData(){return a().middlewareData},update:u}}var R_=H(`<tc-root data-tc-dropdown-container=true>`,!0,!1,!1),z_=()=>{let e=G(),t=Pa(Rc),n=Pa(ih),[r,i]=N(!1),[a,o]=N(t.account),[s,c]=N(!t.account),l,[u,d]=N(),[f,p]=N(),m=L_(f,u,{whileElementsMounted:N_,placement:`bottom-end`,middleware:[F_(),P_()]}),h=()=>{let e=a();if(e){let t=wn(e.address,e.chain===he.TESTNET);return t.slice(0,4)+`…`+t.slice(-4)}return``};n.connectionRestored.then(()=>c(!1));let g=t.onStatusChange(e=>{if(!e){i(!1),o(null),c(!1);return}o(e.account),c(!1)}),_=e=>{if(!a()||!r())return;let t=f().contains(e.target),n=l.contains(e.target);!t&&!n&&i(!1)};return wa(()=>{document.body.addEventListener(`click`,_)}),Ta(()=>{document.body.removeEventListener(`click`,_),g()}),R(Ko,{component:ls,get children(){return[R(z,{get when(){return s()},get children(){return R(Gh,{disabled:!0,"data-tc-connect-button-loading":`true`,get children(){return R(Kh,{})}})}}),R(z,{get when(){return!s()},get children(){return[R(z,{get when(){return!a()},get children(){return R(Uh,{onClick:()=>n.openModal(),"data-tc-connect-button":`true`,scale:`s`,get children(){return[R(Zp,{get fill(){return e.colors.connectButton.foreground}}),R(xp,{translationKey:`button.connectWallet`,fontSize:`15px`,lineHeight:`18px`,fontWeight:`590`,get color(){return e.colors.connectButton.foreground},children:`Connect wallet`})]}})}}),R(z,{get when(){return a()},get children(){return R(qh,{get children(){return[R(Wh,{onClick:()=>i(e=>!e),ref:p,"data-tc-dropdown-button":`true`,scale:`s`,get children(){return[R(xp,{fontSize:`15px`,fontWeight:`590`,lineHeight:`18px`,get children(){return h()}}),R(af,{direction:`bottom`})]}}),R(Wo,{get children(){var e=R_();return jo(d,e),e.style.setProperty(`z-index`,`999`),e._$owner=Da(),Mo(e,R(Yd,{onBeforeEnter:e=>{bf(e,[{opacity:0,transform:`translateY(-8px)`},{opacity:1,transform:`translateY(0)`}],{duration:150})},onExit:(e,t)=>{bf(e,[{opacity:1,transform:`translateY(0)`},{opacity:0,transform:`translateY(-8px)`}],{duration:150}).finished.then(t)},get children(){return R(z,{get when(){return r()},get children(){return R(Jh,{get hidden(){return!r()},onClose:()=>i(!1),ref(e){var t=l;typeof t==`function`?t(e):l=e}})}})}}),null),Mo(e,R(Yh,{}),null),P(t=>{var n=m.strategy,r=`${m.y??0}px`,i=`${m.x??0}px`;return n!==t.e&&((t.e=n)==null?e.style.removeProperty(`position`):e.style.setProperty(`position`,n)),r!==t.t&&((t.t=r)==null?e.style.removeProperty(`top`):e.style.setProperty(`top`,r)),i!==t.a&&((t.a=i)==null?e.style.removeProperty(`left`):e.style.setProperty(`left`,i)),t},{e:void 0,t:void 0,a:void 0}),e}})]}})}})]}})]}})},B_=K(Tf)`
|
|
1702
|
-
padding-left: 24px;
|
|
1703
|
-
padding-right: 24px;
|
|
1704
|
-
padding-top: 18px;
|
|
1705
|
-
padding-bottom: 0;
|
|
1706
|
-
|
|
1707
|
-
${yl(`mobile`)} {
|
|
1708
|
-
padding-left: 0;
|
|
1709
|
-
padding-right: 0;
|
|
1710
|
-
}
|
|
1711
|
-
`,V_=K(Gp)`
|
|
1712
|
-
margin-top: 12px;
|
|
1713
|
-
|
|
1714
|
-
${yl(`mobile`)} {
|
|
1715
|
-
padding: 0 10px;
|
|
1716
|
-
}
|
|
1717
|
-
`,H_=K.div`
|
|
1718
|
-
margin: 30px 0;
|
|
1719
|
-
width: 100%;
|
|
1720
|
-
display: flex;
|
|
1721
|
-
justify-content: center;
|
|
1722
|
-
|
|
1723
|
-
${yl(`mobile`)} {
|
|
1724
|
-
height: 160px;
|
|
1725
|
-
align-items: center;
|
|
1726
|
-
}
|
|
1727
|
-
`;K(xp)`
|
|
1728
|
-
min-width: 84px;
|
|
1729
|
-
text-align: center;
|
|
1730
|
-
font-weight: 590;
|
|
1731
|
-
`,K(Mf)`
|
|
1732
|
-
margin: 0 auto 22px;
|
|
1733
|
-
`;var[Z,U_]=nl({buttonRootId:null,language:`en`,returnStrategy:`back`,twaReturnUrl:void 0,walletsListConfiguration:{},enableAndroidBackHandler:!0});function W_(e,t){let{isMobile:n,walletAppName:r,surface:i,selectionSource:a,traceId:o}=t;n?e.trackWalletSelected(r,i,a,o):e.trackWalletPreselected(r,i,a,o)}var G_=K.div`
|
|
1734
|
-
display: flex;
|
|
1735
|
-
flex-direction: column;
|
|
1736
|
-
align-items: center;
|
|
1737
|
-
`,K_=K(Gp)`
|
|
1738
|
-
margin-bottom: 18px;
|
|
1739
|
-
`;K.div`
|
|
1740
|
-
height: 1px;
|
|
1741
|
-
margin: 0 -24px;
|
|
1742
|
-
width: calc(100% + 48px);
|
|
1743
|
-
opacity: 0.12;
|
|
1744
|
-
background: ${e=>e.isShown?e.theme.colors.icon.secondary:`transparent`};
|
|
1745
|
-
transition: background 0.15s ease-in-out;
|
|
1746
|
-
|
|
1747
|
-
${yl(`mobile`)} {
|
|
1748
|
-
width: 100%;
|
|
1749
|
-
}
|
|
1750
|
-
`;var q_=K.ul`
|
|
1751
|
-
display: grid;
|
|
1752
|
-
grid-template-columns: repeat(auto-fit, 92px);
|
|
1753
|
-
grid-template-rows: auto;
|
|
1754
|
-
align-content: flex-start;
|
|
1755
|
-
row-gap: 8px;
|
|
1756
|
-
justify-content: center;
|
|
1757
|
-
width: 100%;
|
|
1758
|
-
padding: 0 0 16px;
|
|
1759
|
-
align-self: flex-start;
|
|
1760
|
-
max-width: 400px;
|
|
1761
|
-
margin: 0 auto;
|
|
1762
|
-
list-style: none;
|
|
1763
|
-
|
|
1764
|
-
> li {
|
|
1765
|
-
display: block;
|
|
1766
|
-
height: fit-content;
|
|
1767
|
-
}
|
|
1768
|
-
|
|
1769
|
-
> li > button {
|
|
1770
|
-
width: 100%;
|
|
1771
|
-
}
|
|
1772
|
-
|
|
1773
|
-
${yl(`mobile`)} {
|
|
1774
|
-
display: grid;
|
|
1775
|
-
grid-template-columns: repeat(4, 1fr);
|
|
1776
|
-
gap: 0;
|
|
1777
|
-
padding: 8px 12px 16px;
|
|
1778
|
-
max-width: none;
|
|
1779
|
-
|
|
1780
|
-
> li {
|
|
1781
|
-
min-width: 78px;
|
|
1782
|
-
display: flex;
|
|
1783
|
-
}
|
|
1784
|
-
|
|
1785
|
-
> li > * {
|
|
1786
|
-
width: 100%;
|
|
1787
|
-
}
|
|
1788
|
-
}
|
|
1789
|
-
`;K(X)`
|
|
1790
|
-
display: block;
|
|
1791
|
-
margin: 0 auto 1px;
|
|
1792
|
-
font-size: 15px;
|
|
1793
|
-
`;var J_=K(lf)`
|
|
1794
|
-
position: absolute;
|
|
1795
|
-
top: 16px;
|
|
1796
|
-
left: 16px;
|
|
1797
|
-
`,Y_=K(qm)`
|
|
1798
|
-
opacity: ${e=>e.withOpacity?`0.4`:`1`};
|
|
1799
|
-
`,X_=K.div`
|
|
1800
|
-
display: grid;
|
|
1801
|
-
grid-template-columns: auto 28px;
|
|
1802
|
-
gap: 16px;
|
|
1803
|
-
padding: 16px;
|
|
1804
|
-
margin-bottom: 16px;
|
|
1805
|
-
border-radius: 16px;
|
|
1806
|
-
color: ${e=>e.theme.colors.text.secondary};
|
|
1807
|
-
background: ${e=>e.theme.colors.background.tint};
|
|
1808
|
-
|
|
1809
|
-
${yl(`mobile`)} {
|
|
1810
|
-
margin-left: 16px;
|
|
1811
|
-
margin-right: 16px;
|
|
1812
|
-
}
|
|
1813
|
-
`,Z_=K(qp)`
|
|
1814
|
-
color: ${e=>e.theme.colors.text.secondary};
|
|
1815
|
-
text-align: left;
|
|
1816
|
-
margin: 0;
|
|
1817
|
-
`,Q_=K.div`
|
|
1818
|
-
position: absolute;
|
|
1819
|
-
bottom: 14px;
|
|
1820
|
-
left: 50%;
|
|
1821
|
-
transform: translate(-50%, 0);
|
|
1822
|
-
|
|
1823
|
-
text-wrap: nowrap;
|
|
1824
|
-
display: flex;
|
|
1825
|
-
gap: 6px;
|
|
1826
|
-
align-items: center;
|
|
1827
|
-
border-radius: 18px;
|
|
1828
|
-
min-width: 126px;
|
|
1829
|
-
padding: 9px 16px 9px 10px;
|
|
1830
|
-
|
|
1831
|
-
filter: drop-shadow(0px 2px 8px rgba(0, 0, 0, 0.08));
|
|
1832
|
-
background-color: ${e=>e.theme.colors.background.segment};
|
|
1833
|
-
`,$_=H(`<svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><g clip-path=url(#clip0_5122_10355)><circle cx=8 cy=8 r=8></circle><circle cx=8 cy=11 r=1></circle><path d="M7.04994 4.99875C7.02277 4.45542 7.45598 4 8 4C8.54402 4 8.97723 4.45541 8.95006 4.99875L8.78745 8.25094C8.76647 8.67055 8.42014 9 8 9C7.57986 9 7.23353 8.67055 7.21255 8.25094L7.04994 4.99875Z"></path></g><defs><clipPath id=clip0_5122_10355><rect width=16 height=16>`),ev=H(`<svg xmlns=http://www.w3.org/2000/svg width=28 height=28 viewBox="0 0 28 28"fill=none><circle cx=14 cy=14 r=12></circle><circle cx=14 cy=18.9 r=1.4></circle><path d="M12.6658 8.89845C12.63 8.13698 13.2377 7.5 14 7.5C14.7623 7.5 15.37 8.13698 15.3342 8.89845L15.047 15.0013C15.0207 15.5604 14.5597 16.0002 14 16.0002C13.4403 16.0002 12.9793 15.5604 12.953 15.0013L12.6658 8.89845Z">`),tv=e=>{let t=G(),n=()=>e.size,r=()=>e.fill||t.colors.icon.error;return V(()=>V(()=>n()===`16`)()?(()=>{var e=$_(),n=e.firstChild,i=n.firstChild,a=i.nextSibling,o=a.nextSibling,s=n.nextSibling.firstChild.firstChild;return P(e=>{var n=r(),c=t.colors.constant.white,l=t.colors.constant.white,u=t.colors.constant.white;return n!==e.e&&U(i,`fill`,e.e=n),c!==e.t&&U(a,`fill`,e.t=c),l!==e.a&&U(o,`fill`,e.a=l),u!==e.o&&U(s,`fill`,e.o=u),e},{e:void 0,t:void 0,a:void 0,o:void 0}),e})():V(()=>n()===`28`)()?(()=>{var n=ev(),i=n.firstChild,a=i.nextSibling,o=a.nextSibling;return P(s=>{var c=e.class,l=r(),u=t.colors.constant.white,d=t.colors.constant.white;return c!==s.e&&U(n,`class`,s.e=c),l!==s.t&&U(i,`fill`,s.t=l),u!==s.a&&U(a,`fill`,s.a=u),d!==s.o&&U(o,`fill`,s.o=d),s},{e:void 0,t:void 0,a:void 0,o:void 0}),n})():null)},nv=`wallet_connect`,rv=`WalletConnect`,iv=`https://reown.com/`,av={WALLET_CONNECT:`https://raw.githubusercontent.com/ton-connect/sdk/main/assets/walletconnect-icon-288.png`},ov=H(`<li>`),sv=e=>{let t=()=>Qm()?void 0:510,n=Z.connector,r=Z.connectRequestParameters,i=()=>{e.traceId&&Z.tracker.trackWalletSelected(nv,`all-wallets-list`,`manual`,e.traceId),n.connect({type:`wallet-connect`},r?.state===`ready`?r.value:void 0,{traceId:e.traceId})},[a,o]=N(null),s=null,c=e=>{o(e),s!=null&&clearTimeout(s),s=setTimeout(()=>o(null),1500)},l=t=>{if(!t.isSupportRequiredFeatures&&e.featureCheckMode===`strict`){c(t);return}e.onSelect(t)},u=()=>Qm()?e.walletsList.filter(Rp):e.walletsList,d=()=>u().filter(e=>e.isSupportRequiredFeatures);Nc({walletsMenu:`other_wallets`,wallets:d()});let f=()=>u().filter(e=>!e.isSupportRequiredFeatures);return R(G_,{"data-tc-wallets-modal-list":`true`,get children(){return[R(J_,{icon:`arrow`,onClick:()=>e.onBack()}),R(K_,{translationKey:`walletModal.wallets`,children:`Wallets`}),R(th,{get maxHeight(){return t()},get children(){return[R(q_,{get children(){return[R(lo,{get each(){return d()},children:t=>(()=>{var n=ov();return Mo(n,R(Y_,{wallet:t,onClick:()=>e.onSelect(t)})),n})()}),R(z,{get when(){return V(()=>!Di())()&&Ni()},get children(){return R(Y_,{get wallet(){return{type:`wallet-connect`,name:rv,appName:nv,imageUrl:av.WALLET_CONNECT}},onClick:i})}})]}}),R(z,{get when(){return f().length>0&&e.featureCheckMode!==`hide`},get children(){return[R(X_,{get children(){return[R(Z_,{translationKey:`walletModal.allWallets.walletsBelowNotSupported`,children:`The wallets below don’t support all features of the connected service. You can use your recovery phrase in one of the supported wallets above.`}),R(tv,{size:`28`})]}}),R(q_,{get children(){return R(lo,{get each(){return f()},children:t=>(()=>{var n=ov();return Mo(n,R(Y_,{wallet:t,onClick:()=>l(t),get withOpacity(){return e.featureCheckMode===`strict`}})),n})()})}}),R(Yd,{onBeforeEnter:e=>{bf(e,[{opacity:0,transform:`translate(-50%, 44px)`},{opacity:1,transform:`translate(-50%, 0)`}],{duration:150,easing:`ease-out`})},onExit:(e,t)=>{bf(e,[{opacity:1,transform:`translate(-50%, 0)`},{opacity:0,transform:`translate(-50%, 44px)`}],{duration:150,easing:`ease-out`}).finished.then(()=>{t()})},get children(){return R(z,{get when(){return a()},get children(){return R(Q_,{get children(){return[R(am,{size:`xs`}),R(xp,{translationKey:`walletModal.allWallets.walletNotSupportService`,get translationValues(){return{name:a().name}},get children(){return[V(()=>a().name),` doesn’t support connected service`]}})]}})}})}})]}})]}})]}})},cv=K.div`
|
|
1834
|
-
display: flex;
|
|
1835
|
-
flex-direction: column;
|
|
1836
|
-
`,lv=K.div`
|
|
1837
|
-
flex: 1;
|
|
1838
|
-
margin-top: ${e=>e.qr?`0`:`18px`};
|
|
1839
|
-
display: flex;
|
|
1840
|
-
flex-direction: column;
|
|
1841
|
-
align-items: center;
|
|
1842
|
-
justify-content: center;
|
|
1843
|
-
min-height: 232px;
|
|
1844
|
-
`,uv=K(mp)`
|
|
1845
|
-
margin-bottom: 24px;
|
|
1846
|
-
`,dv=K(Gp)`
|
|
1847
|
-
max-width: 288px;
|
|
1848
|
-
margin: 0 auto 2px;
|
|
1849
|
-
`,fv=K(qp)`
|
|
1850
|
-
max-width: 288px;
|
|
1851
|
-
text-align: center;
|
|
1852
|
-
margin: 0 auto 20px;
|
|
1853
|
-
`,pv=K(lf)`
|
|
1854
|
-
position: absolute;
|
|
1855
|
-
top: 16px;
|
|
1856
|
-
left: 16px;
|
|
1857
|
-
`,mv=K.div`
|
|
1858
|
-
display: flex;
|
|
1859
|
-
justify-content: center;
|
|
1860
|
-
gap: 8px;
|
|
1861
|
-
padding-bottom: 16px;
|
|
1862
|
-
`,hv=K(mv)`
|
|
1863
|
-
padding-bottom: 0;
|
|
1864
|
-
`,gv=K(X)`
|
|
1865
|
-
margin-bottom: 24px;
|
|
1866
|
-
`,_v=K(lm)`
|
|
1867
|
-
margin-bottom: 18px;
|
|
1868
|
-
margin-top: 2px;
|
|
1869
|
-
`,vv=K(am)`
|
|
1870
|
-
margin-bottom: 16px;
|
|
1871
|
-
`,yv=K(qp)`
|
|
1872
|
-
color: ${e=>e.theme.colors.text.secondary};
|
|
1873
|
-
text-align: center;
|
|
1874
|
-
margin-bottom: 20px;
|
|
1875
|
-
`,Q=e=>{let[t]=yp();return V(()=>t(e.translationKey,e.translationValues,e.children?.toString()))},bv=e=>{let[t,n]=N(`mobile`),[r,i]=N(null);F(()=>{i(e.defaultError??null)});let[a,o]=N(),[s,c]=N(!0),l=Pa(Rc);Ta(l.onStatusChange(()=>{},t=>{if(t instanceof Fe){i(`missing-features`);return}if(t instanceof Ie){i(`wrong-network`);return}e.wallet.appName!==Gm&&i(`connection-declined`)}));let u=()=>{try{let t=l.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest,{traceId:e.walletsModalState?.traceId,linkDisplayOnly:!0});o(t)}catch{}},d=()=>{Z.tracker.trackConnectionInitiated({kind:`http-specific-wallet`,bridgeUrl:e.wallet.bridgeUrl},e.walletsModalState?.traceId)};F(()=>{L(t)!==`extension`&&(Rp(e.wallet)||Lp(e.wallet))&&u()});let f=()=>{i(null),t()===`extension`&&u(),n(`mobile`),kc(k(O({},e.wallet),{openMethod:`qrcode`}))},p=()=>{if(i(null),t()===`extension`&&u(),n(`desktop`),yt(a()))m();else{let t=!s();c(!1),d(),Ds(a(),e.wallet.deepLink,{returnStrategy:Z.returnStrategy,forceRedirect:t},t=>{kc(k(O({},e.wallet),{openMethod:t}))})}},m=()=>{let t=!s();c(!1),kc(k(O({},e.wallet),{openMethod:`universal-link`})),d(),Es(a(),{returnStrategy:Z.returnStrategy,twaReturnUrl:Z.twaReturnUrl,forceRedirect:t})},h=(t,n)=>{let r=e.walletsModalState?.traceId;r&&Z.tracker.trackWalletSelected(e.wallet.appName,`connection-modal`,n,r,t)},g=()=>{i(null),n(`extension`),Ve(e.wallet)&&(kc(e.wallet),l.connect({jsBridgeKey:e.wallet.jsBridgeKey},e.additionalRequest,{traceId:e.walletsModalState?.traceId}))};return Rp(e.wallet)?f():zp(e.wallet)?(Ve(e.wallet)&&h(`extension`,e.selectionSource),g()):(h(`desktop`,e.selectionSource),p()),R(cv,{"data-tc-wallets-modal-connection-desktop":`true`,get children(){return[R(z,{get when(){return!e.backDisabled},get children(){return R(pv,{icon:`arrow`,onClick:()=>e.onBackClick()})}}),R(dv,{get children(){return e.wallet.name}}),R(z,{get when(){return V(()=>t()===`mobile`)()&&!r()},get children(){return R(fv,{translationKey:`walletModal.desktopConnectionModal.scanQR`,get translationValues(){return{name:e.wallet.name}},get children(){return[`Scan the QR code below with your phone’s or `,V(()=>e.wallet.name),`’s camera`]}})}}),R(lv,{get qr(){return t()===`mobile`},get children(){return R(uo,{get children(){return[R(B,{get when(){return r()},get children(){return[R(vv,{size:`s`}),R(uo,{get children(){return[R(B,{get when(){return r()===`missing-features`},get children(){return R(yv,{translationKey:`walletModal.desktopConnectionModal.missingFeatures`,get translationValues(){return{name:e.wallet.name}},children:`Please update Wallet, your version does not support required features for this dApp`})}}),R(B,{get when(){return r()===`connection-declined`},get children(){return R(yv,{translationKey:`walletModal.desktopConnectionModal.connectionDeclined`,children:`Connection declined`})}}),R(B,{get when(){return r()===`not-supported`},get children(){return R(yv,{translationKey:`walletModal.desktopConnectionModal.notSupportedWallet`,get translationValues(){return{name:e.wallet.name}},get children(){return[V(()=>e.wallet.name),` doesn’t support the requested action. Please connect another wallet that supports it.`]}})}}),R(B,{get when(){return r()===`wrong-network`},get children(){return R(yv,{translationKey:`walletModal.desktopConnectionModal.wrongNetwork`,get translationValues(){return{name:e.wallet.name}},get children(){return[`Connected wallet is on a different network. Please switch network in `,V(()=>e.wallet.name),` and try again.`]}})}})]}}),R(mv,{get children(){return[R(z,{get when(){return r()!==`not-supported`},get children(){return R(X,{get leftIcon(){return R(xm,{})},get onClick(){return t()===`extension`?g:p},get children(){return R(Q,{translationKey:`common.retry`,children:`Retry`})}})}}),R(z,{get when(){return r()===`missing-features`},get children(){return R(rh,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return R(X,{get leftIcon(){return R(Cm,{})},get children(){return R(Q,{translationKey:`walletModal.desktopConnectionModal.updateWallet`,get translationValues(){return{name:e.wallet.name}},get children(){return[`Update `,V(()=>e.wallet.name)]}})}})}})}}),R(z,{get when(){return r()===`not-supported`},get children(){return R(X,{onClick:()=>e.onBackClick(),get children(){return R(Q,{translationKey:`walletModal.desktopConnectionModal.chooseAnotherWallet`,children:`Choose Another Wallet`})}})}})]}})]}}),R(B,{get when(){return t()===`mobile`},get children(){return R(uv,{disableCopy:!1,get sourceUrl(){return q(a(),`none`)},get imageUrl(){return e.wallet.imageUrl}})}}),R(B,{get when(){return t()===`extension`},get children(){return[R(z,{get when(){return Ve(e.wallet)},get children(){return[R(_v,{size:`s`}),R(yv,{translationKey:`walletModal.desktopConnectionModal.continueInExtension`,get translationValues(){return{name:e.wallet.name}},get children(){return[`Continue in `,V(()=>e.wallet.name),` browser extension…`]}}),R(mv,{get children(){return R(X,{get leftIcon(){return R(xm,{})},onClick:g,get children(){return R(Q,{translationKey:`common.retry`,children:`Retry`})}})}})]}}),R(z,{get when(){return!Ve(e.wallet)},get children(){return[R(yv,{translationKey:`walletModal.desktopConnectionModal.dontHaveExtension`,get translationValues(){return{name:e.wallet.name}},get children(){return[`Seems you don't have installed `,V(()=>e.wallet.name),` browser extension`]}}),R(mv,{get children(){return R(rh,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return R(X,{get rightIcon(){return R(Cm,{})},onClick:g,get children(){return R(Q,{translationKey:`walletModal.desktopConnectionModal.getWallet`,get translationValues(){return{name:e.wallet.name}},get children(){return[`Get `,V(()=>e.wallet.name)]}})}})}})}})]}})]}}),R(B,{get when(){return t()===`desktop`},get children(){return[R(lm,{size:`m`}),R(yv,{translationKey:`walletModal.desktopConnectionModal.continueOnDesktop`,get translationValues(){return{name:e.wallet.name}},get children(){return[`Continue in `,V(()=>e.wallet.name),` on desktop…`]}}),R(mv,{get children(){return[R(X,{get leftIcon(){return R(xm,{})},onClick:p,get children(){return R(Q,{translationKey:`common.retry`,children:`Retry`})}}),R(rh,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return R(X,{get rightIcon(){return R(Cm,{})},get children(){return R(Q,{translationKey:`walletModal.desktopConnectionModal.getWallet`,get translationValues(){return{name:e.wallet.name}},get children(){return[`Get `,V(()=>e.wallet.name)]}})}})}})]}})]}})]}})}}),R(hv,{get children(){return[R(z,{get when(){return V(()=>t()!==`mobile`)()&&Rp(e.wallet)},get children(){return R(gv,{appearance:`secondary`,get leftIcon(){return R(_m,{})},onClick:()=>{h(`mobile`,`manual`),f()},get children(){return R(Q,{translationKey:`common.mobile`,children:`Mobile`})}})}}),R(z,{get when(){return V(()=>t()!==`extension`)()&&zp(e.wallet)},get children(){return R(gv,{appearance:`secondary`,get leftIcon(){return R(hm,{})},onClick:()=>{h(`extension`,`manual`),g()},get children(){return R(Q,{translationKey:`common.browserExtension`,children:`Browser Extension`})}})}}),R(z,{get when(){return V(()=>t()!==`desktop`)()&&Lp(e.wallet)},get children(){return R(gv,{appearance:`secondary`,get leftIcon(){return R(ym,{})},onClick:()=>{h(`desktop`,`manual`),p()},get children(){return R(Q,{translationKey:`common.desktop`,children:`Desktop`})}})}})]}})]}})},xv=K.div``,Sv=K(lf)`
|
|
1876
|
-
position: absolute;
|
|
1877
|
-
top: 16px;
|
|
1878
|
-
left: 16px;
|
|
1879
|
-
`,Cv=K(Gp)`
|
|
1880
|
-
margin-bottom: 18px;
|
|
1881
|
-
`,wv=K.div`
|
|
1882
|
-
padding: 16px 0;
|
|
1883
|
-
display: flex;
|
|
1884
|
-
flex-direction: column;
|
|
1885
|
-
align-items: center;
|
|
1886
|
-
`,Tv=rs`
|
|
1887
|
-
margin-bottom: 12px;
|
|
1888
|
-
`,Ev=K(Yp)`
|
|
1889
|
-
text-align: center;
|
|
1890
|
-
margin-bottom: 4px;
|
|
1891
|
-
`,Dv=K(xp)`
|
|
1892
|
-
text-align: center;
|
|
1893
|
-
max-width: 352px;
|
|
1894
|
-
color: ${e=>e.theme.colors.text.secondary};
|
|
1895
|
-
`,Ov=K.div`
|
|
1896
|
-
padding: 16px 24px 24px;
|
|
1897
|
-
display: flex;
|
|
1898
|
-
align-items: center;
|
|
1899
|
-
justify-content: center;
|
|
1900
|
-
gap: 8px;
|
|
1901
|
-
`,kv={GET_A_WALLET:`https://ton.org/wallets?filters[wallet_features][slug][$in]=dapp-auth&pagination[limit]=-1`},Av=e=>R(xv,{"data-tc-wallets-modal-info":`true`,get children(){return[R(Sv,{icon:`arrow`,onClick:()=>e.onBackClick()}),R(Cv,{translationKey:`walletModal.infoModal.whatIsAWallet`,children:`What is a wallet`}),R(th,{get children(){return[R(wv,{get children(){return[R(Dm,{class:Tv}),R(Ev,{translationKey:`walletModal.infoModal.secureDigitalAssets`,children:`Secure digital assets storage`}),R(Dv,{translationKey:`walletModal.infoModal.walletProtects`,children:`A wallet protects and manages your digital assets including TON, tokens and collectables.`})]}}),R(wv,{get children(){return[R(km,{class:Tv}),R(Ev,{translationKey:`walletModal.infoModal.controlIdentity`,children:`Control your Web3 identity`}),R(Dv,{translationKey:`walletModal.infoModal.manageIdentity`,children:`Manage your digital identity and access decentralized applications with ease. Maintain control over your data and engage securely in the blockchain ecosystem.`})]}}),R(wv,{get children(){return[R(jm,{class:Tv}),R(Ev,{translationKey:`walletModal.infoModal.effortlessCryptoTransactions`,children:`Effortless crypto transactions`}),R(Dv,{translationKey:`walletModal.infoModal.easilySend`,children:`Easily send, receive, monitor your cryptocurrencies. Streamline your operations with decentralized applications.`})]}}),R(Ov,{get children(){return R(rh,{get href(){return kv.GET_A_WALLET},blank:!0,get children(){return R(X,{get rightIcon(){return R(Tm,{})},get children(){return R(Q,{translationKey:`walletModal.infoModal.getAWallet`,children:`Get a Wallet`})}})}})}})]}})]}}),jv=K.div``,Mv=K.div`
|
|
1902
|
-
flex: 1;
|
|
1903
|
-
margin-top: 18px;
|
|
1904
|
-
display: flex;
|
|
1905
|
-
flex-direction: column;
|
|
1906
|
-
align-items: center;
|
|
1907
|
-
justify-content: center;
|
|
1908
|
-
min-height: 232px;
|
|
1909
|
-
`,Nv=K(Gp)`
|
|
1910
|
-
max-width: 262px;
|
|
1911
|
-
margin: 0 auto 8px;
|
|
1912
|
-
`,Pv=K(lf)`
|
|
1913
|
-
position: absolute;
|
|
1914
|
-
top: 16px;
|
|
1915
|
-
left: 16px;
|
|
1916
|
-
`,Fv=K.div`
|
|
1917
|
-
padding: 16px;
|
|
1918
|
-
display: flex;
|
|
1919
|
-
align-items: center;
|
|
1920
|
-
gap: 12px;
|
|
1921
|
-
border-top: 0.5px solid ${e=>ms(e.theme.colors.icon.secondary,.2)};
|
|
1922
|
-
`,Iv=K(gl)`
|
|
1923
|
-
width: 36px;
|
|
1924
|
-
height: 36px;
|
|
1925
|
-
border-radius: 10px;
|
|
1926
|
-
`,Lv=K(rh)`
|
|
1927
|
-
margin-left: auto;
|
|
1928
|
-
`,Rv=K(lm)`
|
|
1929
|
-
margin-bottom: 18px;
|
|
1930
|
-
margin-top: 2px;
|
|
1931
|
-
`,zv=K(am)`
|
|
1932
|
-
margin-bottom: 16px;
|
|
1933
|
-
`,Bv=K(qp)`
|
|
1934
|
-
color: ${e=>e.theme.colors.text.secondary};
|
|
1935
|
-
text-align: center;
|
|
1936
|
-
margin-bottom: 20px;
|
|
1937
|
-
`,Vv=K.div`
|
|
1938
|
-
display: flex;
|
|
1939
|
-
justify-content: center;
|
|
1940
|
-
gap: 8px;
|
|
1941
|
-
padding-bottom: 16px;
|
|
1942
|
-
`,Hv={m:`16px`,s:`8px`,none:`0`},Uv=K(Gp)`
|
|
1943
|
-
margin-bottom: 2px;
|
|
1944
|
-
padding: 0 52px;
|
|
1945
|
-
`,Wv=K(qp)`
|
|
1946
|
-
margin-bottom: 20px;
|
|
1947
|
-
padding: 0 64px;
|
|
1948
|
-
`,Gv=K.div`
|
|
1949
|
-
padding: 0 24px 16px;
|
|
1950
|
-
`,Kv=K.div`
|
|
1951
|
-
display: flex;
|
|
1952
|
-
flex-direction: row;
|
|
1953
|
-
gap: 16px;
|
|
1954
|
-
padding: 0 24px 24px;
|
|
1955
|
-
margin-top: 0;
|
|
1956
|
-
`,qv=K(X)`
|
|
1957
|
-
width: 100%;
|
|
1958
|
-
height: 56px;
|
|
1959
|
-
border-radius: ${e=>Hv[e.theme.borderRadius]};
|
|
1960
|
-
background-color: ${e=>ms(e.theme.colors.accent,.12)};
|
|
1961
|
-
color: ${e=>e.theme.colors.accent};
|
|
1962
|
-
font-size: 16px;
|
|
1963
|
-
line-height: 20px;
|
|
1964
|
-
font-weight: 500;
|
|
1965
|
-
padding: 17px 20px 19px 20px;
|
|
1966
|
-
`,Jv=e=>[R(Uv,{get children(){return e.walletInfo.name}}),R(Wv,{translationKey:`walletModal.mobileConnectionModal.scanQR`,get translationValues(){return{name:e.walletInfo.name}},get children(){return[`Scan the QR code below with your phone’s or `,V(()=>e.walletInfo.name),`’s camera`]}}),R(Gv,{get children(){return R(mp,{get imageUrl(){return e.walletInfo.imageUrl},get sourceUrl(){return q(e.universalLink,`none`)},disableCopy:!0})}}),R(Kv,{get children(){return[R(qv,{appearance:`secondary`,onClick:()=>e.onOpenLink?.call(e),get children(){return R(Q,{translationKey:`walletModal.mobileUniversalModal.openLink`,children:`Open Link`})}}),R(qv,{appearance:`secondary`,onClick:()=>e.onCopy?.call(e),get children(){return R(Q,{get translationKey(){return e.isCopiedShown===void 0?`common.copyLink`:`common.copied`},get children(){return e.isCopiedShown===void 0?`Copy Link`:`Copied`}})}})]}})],Yv=e=>{let t=G(),[n,r]=N(!0),[i,a]=N(!1),[o,s]=N(null);F(()=>{s(e.defaultError??null)});let c=Pa(Rc),l=c.onStatusChange(()=>{},e=>{if(e instanceof Fe){s(`missing-features`);return}if(e instanceof Ie){s(`wrong-network`);return}s(null)}),[u,d]=N(null),f=t=>{let n=u(),r=!n;if(!n){let t=Er(e.wallet.features??[],{embeddedRequest:{}})&&e.walletsModalState&&`embeddedRequest`in e.walletsModalState?e.walletsModalState.embeddedRequest:void 0;n=c.connect({universalLink:e.wallet.universalLink,bridgeUrl:e.wallet.bridgeUrl},e.additionalRequest,{traceId:e.walletsModalState?.traceId,embeddedRequest:t??void 0})}let i=js(n),a=t?i:n,o=t?n:i;return(o!==a||r)&&d(a),o},p=t=>{kc(k(O({},e.wallet),{openMethod:`universal-link`})),Es(t,{returnStrategy:Z.returnStrategy,twaReturnUrl:Z.twaReturnUrl,forceRedirect:!0})},m=()=>{let t=f(!0);if(yt(t))return p(t);s(null);let i=!n();r(!1),Ds(t,e.wallet.deepLink,{returnStrategy:Z.returnStrategy,forceRedirect:i},t=>{kc(k(O({},e.wallet),{openMethod:t}))})},[h,g]=N(void 0),_=()=>A(null,null,function*(){h()!==void 0&&clearTimeout(h()),yield Zf(f(!1));let e=setTimeout(()=>g(void 0),1500);g(e)}),v=()=>{s(null),a(!0),kc(k(O({},e.wallet),{openMethod:`qrcode`}))},y=()=>{a(!1),kc(k(O({},e.wallet),{openMethod:`universal-link`}))},b=()=>{i()?y():e.onBackClick()};return Ta(l),m(),R(jv,{"data-tc-wallets-modal-connection-mobile":`true`,get children(){return[R(z,{get when(){return!e.backDisabled||i()},get children(){return R(Pv,{icon:`arrow`,onClick:b})}}),R(z,{get when(){return i()},get children(){return R(Jv,{get universalLink(){return f(!1)},get walletInfo(){return e.wallet},onOpenLink:m,onCopy:_,get isCopiedShown(){return h()}})}}),R(z,{get when(){return!i()},get children(){return[R(Nv,{get children(){return e.wallet.name}}),R(Mv,{get children(){return[R(z,{get when(){return o()},get children(){return[R(zv,{size:`s`}),R(uo,{get children(){return[R(B,{get when(){return o()===`missing-features`},get children(){return R(Bv,{translationKey:`walletModal.mobileConnectionModal.missingFeatures`,get translationValues(){return{name:e.wallet.name}},children:`Please update Wallet, your version does not support required features for this dApp`})}}),R(B,{get when(){return o()===`connection-declined`},get children(){return R(Bv,{translationKey:`walletModal.mobileConnectionModal.connectionDeclined`,children:`Connection declined`})}}),R(B,{get when(){return o()===`wrong-network`},get children(){return R(Bv,{translationKey:`walletModal.mobileConnectionModal.wrongNetwork`,get translationValues(){return{name:e.wallet.name}},get children(){return[`Connected wallet is on a different network. Please switch network in `,V(()=>e.wallet.name),` and try again.`]}})}}),R(B,{get when(){return o()===`not-supported`},get children(){return R(Bv,{translationKey:`walletModal.mobileConnectionModal.notSupportedWallet`,get translationValues(){return{name:e.wallet.name}},get children(){return[V(()=>e.wallet.name),` doesn't support the requested action. Please connect another wallet that supports it.`]}})}})]}}),R(Vv,{get children(){return R(uo,{get children(){return[R(B,{get when(){return o()===`missing-features`},get children(){return[R(X,{get leftIcon(){return R(xm,{})},onClick:m,get children(){return R(Q,{translationKey:`common.retry`,children:`Retry`})}}),R(rh,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return R(X,{get leftIcon(){return R(Cm,{})},get children(){return R(Q,{translationKey:`walletModal.mobileConnectionModal.updateWallet`,get translationValues(){return{name:e.wallet.name}},get children(){return[`Update `,V(()=>e.wallet.name)]}})}})}})]}}),R(B,{get when(){return o()===`not-supported`},get children(){return R(X,{onClick:()=>e.onBackClick(),get children(){return R(Q,{translationKey:`walletModal.mobileConnectionModal.chooseAnotherWallet`,children:`Choose Another Wallet`})}})}}),R(B,{get when(){return o()===`wrong-network`},get children(){return R(X,{get leftIcon(){return R(xm,{})},onClick:m,get children(){return R(Q,{translationKey:`common.retry`,children:`Retry`})}})}}),R(B,{get when(){return o()===`connection-declined`},get children(){return[R(X,{get leftIcon(){return R(xm,{})},onClick:m,get children(){return R(Q,{translationKey:`common.retry`,children:`Retry`})}}),R(X,{get leftIcon(){return R(Lm,{get fill(){return t.colors.accent}})},onClick:v,get children(){return R(Q,{translationKey:`walletModal.mobileConnectionModal.showQR`,children:`Show QR Code`})}})]}})]}})}})]}}),R(z,{get when(){return!o()},get children(){return[R(Rv,{size:`s`}),R(Bv,{translationKey:`walletModal.mobileConnectionModal.continueIn`,get translationValues(){return{name:e.wallet.name}},get children(){return[`Continue in `,V(()=>e.wallet.name),`…`]}}),R(Vv,{get children(){return[R(X,{get leftIcon(){return R(xm,{})},onClick:m,get children(){return R(Q,{translationKey:`common.retry`,children:`Retry`})}}),R(X,{get leftIcon(){return R(Lm,{get fill(){return t.colors.accent}})},onClick:v,get children(){return R(Q,{translationKey:`walletModal.mobileConnectionModal.showQR`,children:`Show QR Code`})}})]}})]}})]}}),R(Fv,{get children(){return[R(Iv,{get src(){return e.wallet.imageUrl}}),R(Yp,{get children(){return e.wallet.name}}),R(Lv,{get href(){return e.wallet.aboutUrl},blank:!0,get children(){return R(X,{get children(){return R(Q,{translationKey:`common.get`,children:`GET`})}})}})]}})]}})]}})},Xv=`
|
|
1967
|
-
margin-left: 28px;
|
|
1968
|
-
margin-right: 28px;
|
|
1969
|
-
width: calc(100% - 56px);
|
|
1970
|
-
|
|
1971
|
-
@media (max-width: 375px) {
|
|
1972
|
-
margin-left: 16px;
|
|
1973
|
-
margin-right: 16px;
|
|
1974
|
-
width: calc(100% - 32px);
|
|
1975
|
-
}
|
|
1976
|
-
`,Zv={m:`6px`,s:`6px`,none:`0`};K.li`
|
|
1977
|
-
width: 82px;
|
|
1978
|
-
min-width: 82px;
|
|
1979
|
-
height: 124px;
|
|
1980
|
-
display: flex;
|
|
1981
|
-
flex-direction: column;
|
|
1982
|
-
align-items: center;
|
|
1983
|
-
padding: 8px 4px;
|
|
1984
|
-
|
|
1985
|
-
text-align: center;
|
|
1986
|
-
cursor: pointer;
|
|
1987
|
-
|
|
1988
|
-
transition: transform 0.1s ease-in-out;
|
|
1989
|
-
|
|
1990
|
-
${xl} {
|
|
1991
|
-
&:hover {
|
|
1992
|
-
transform: scale(1.04);
|
|
1993
|
-
}
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
&:active {
|
|
1997
|
-
transform: scale(0.96);
|
|
1998
|
-
}
|
|
1999
|
-
|
|
2000
|
-
${bl} {
|
|
2001
|
-
&:active {
|
|
2002
|
-
transform: scale(0.92);
|
|
2003
|
-
}
|
|
2004
|
-
}
|
|
2005
|
-
`;var Qv=K(Gp)`
|
|
2006
|
-
margin-top: 38px;
|
|
2007
|
-
margin-bottom: 4px;
|
|
2008
|
-
padding: 0 24px;
|
|
2009
|
-
`,$v=K(Nd)`
|
|
2010
|
-
margin: 0 auto 4px;
|
|
2011
|
-
`,ey=K(Gp)`
|
|
2012
|
-
margin-top: 0;
|
|
2013
|
-
margin-bottom: 20px;
|
|
2014
|
-
padding: 0 24px;
|
|
2015
|
-
`,ty=K(qp)`
|
|
2016
|
-
margin: ${e=>e.margin??`0 0 28px 0`};
|
|
2017
|
-
padding: ${e=>e.padding??`0 24px`};
|
|
2018
|
-
min-height: ${e=>e.padding??`44px`};
|
|
2019
|
-
max-width: ${e=>e.maxWidth}px;
|
|
2020
|
-
margin-left: ${e=>e.maxWidth?`auto`:`0px`};
|
|
2021
|
-
margin-right: ${e=>e.maxWidth?`auto`:`0px`};
|
|
2022
|
-
`;K(X)`
|
|
2023
|
-
display: block;
|
|
2024
|
-
margin: 0 auto;
|
|
2025
|
-
`;var ny=K(jl)`
|
|
2026
|
-
${Xv}
|
|
2027
|
-
margin-bottom: 12px;
|
|
2028
|
-
`,ry=K(Al)`
|
|
2029
|
-
${Xv}
|
|
2030
|
-
margin-bottom: 24px;
|
|
2031
|
-
background-color: ${e=>e.transparent?`transparent`:e.theme.colors.background.tint};
|
|
2032
|
-
color: ${e=>e.theme.colors.text.primary};
|
|
2033
|
-
`,iy=K(gl)`
|
|
2034
|
-
width: 24px;
|
|
2035
|
-
height: 24px;
|
|
2036
|
-
border-radius: ${e=>Zv[e.theme.borderRadius]};
|
|
2037
|
-
`,ay=K(lf)`
|
|
2038
|
-
position: absolute;
|
|
2039
|
-
top: 16px;
|
|
2040
|
-
left: 16px;
|
|
2041
|
-
`,oy={m:`16px`,s:`8px`,none:`0`},sy=K(Gp)`
|
|
2042
|
-
margin-bottom: 2px;
|
|
2043
|
-
padding: 0 52px;
|
|
2044
|
-
`,cy=K(qp)`
|
|
2045
|
-
margin-bottom: 20px;
|
|
2046
|
-
padding: 0 64px;
|
|
2047
|
-
`,ly=K.div`
|
|
2048
|
-
padding: 0 24px 16px;
|
|
2049
|
-
`,uy=K.div`
|
|
2050
|
-
display: flex;
|
|
2051
|
-
flex-direction: row;
|
|
2052
|
-
gap: 16px;
|
|
2053
|
-
padding: 0 24px 24px;
|
|
2054
|
-
margin-top: 0;
|
|
2055
|
-
`,dy=K(X)`
|
|
2056
|
-
width: 100%;
|
|
2057
|
-
height: 56px;
|
|
2058
|
-
border-radius: ${e=>oy[e.theme.borderRadius]};
|
|
2059
|
-
background-color: ${e=>ms(e.theme.colors.accent,.12)};
|
|
2060
|
-
color: ${e=>e.theme.colors.accent};
|
|
2061
|
-
font-size: 16px;
|
|
2062
|
-
line-height: 20px;
|
|
2063
|
-
font-weight: 500;
|
|
2064
|
-
padding: 17px 20px 19px 20px;
|
|
2065
|
-
`,fy=75,py=2.75,my=()=>R(Nd,{size:fy,hoverScale:py}),hy=e=>[R(sy,{translationKey:`walletModal.mobileUniversalModal.connectYourWallet`,children:`Connect your TON wallet`}),R(cy,{translationKey:`walletModal.mobileUniversalModal.scan`,children:`Scan with your mobile wallet`}),R(ly,{get children(){return R(mp,{get logo(){return R(my,{})},get sourceUrl(){return q(e.universalLink,`none`)},disableCopy:!0})}}),R(uy,{get children(){return[R(dy,{appearance:`secondary`,onClick:()=>e.onOpenLink(),get children(){return R(Q,{translationKey:`walletModal.mobileUniversalModal.openLink`,children:`Open Link`})}}),R(dy,{appearance:`secondary`,onClick:()=>e.onCopy(),get children(){return R(Q,{get translationKey(){return e.isCopiedShown===void 0?`common.copyLink`:`common.copied`},get children(){return e.isCopiedShown===void 0?`Copy Link`:`Copied`}})}})]}})];function gy(e){let t=new Set(e.filter(We).map(e=>e.bridgeUrl));return Array.from(t).map(e=>({bridgeUrl:e}))}function _y(e,t){let n=new Set(e?.map(e=>e.bridgeUrl)),r=new Set(t?.map(e=>e.bridgeUrl));return n.size===r.size&&[...n].every(e=>r.has(e))}var vy=H(`<li>`),yy=H(`<div data-tc-wallets-modal-universal-mobile=true>`),by=120,xy=.085,Sy=e=>{let[t,n]=N(!1),[r,i]=N(!0),[a,o]=N(null),s=Z.connector,c=[Um,Wm],l=()=>e.walletsList.filter(e=>Rp(e)&&!c.includes(e.appName)),u=()=>l().length>7,d=t=>e.walletsList.find(e=>e.appName===t&&Rp(e)&&e.isSupportRequiredFeatures)??null,f=I(()=>d(Um),null),p=I(()=>d(Wm),null),m=()=>!!f()||!!p(),h=I(()=>gy(e.walletsList),null,{equals:_y}),g=t=>{let n=a(),r=!n;if(!n){let t=`embeddedRequest`in e.walletModalState?e.walletModalState.embeddedRequest:void 0;n=s.connect(h(),e.additionalRequest,{traceId:e.walletModalState.traceId,embeddedRequest:t??void 0,linkDisplayOnly:!0})}let i=js(n),c=t.useEmbeddedRequest?i:n,l=t.useEmbeddedRequest?n:i;return(l!==c||r)&&o(c),l};kc({openMethod:`universal-link`});let[_,v]=N(void 0),y=()=>A(null,null,function*(){_()!==void 0&&clearTimeout(_()),yield Zf(g({useEmbeddedRequest:!1}));let e=setTimeout(()=>v(void 0),1500);v(e)}),b=()=>{Z.tracker.trackConnectionInitiated({kind:`http-any-wallet`},e.walletModalState.traceId);let t=!r();i(!1),Ds(g({useEmbeddedRequest:!0}),void 0,{returnStrategy:Z.returnStrategy,forceRedirect:t},e=>{kc({openMethod:e})})},x=()=>{n(!0),kc({openMethod:`qrcode`})},S=()=>{n(!1),kc({openMethod:`universal-link`})},C=I(()=>l().filter(e=>e.isSupportRequiredFeatures),null),ee=I(()=>C().slice(0,3),null);Nc({walletsMenu:`main_screen`,wallets:[f(),p(),...ee()].filter(e=>!!e)});let te=I(()=>l().filter(e=>!ee().find(t=>t.appName===e.appName)).slice(0,4),null);return(()=>{var n=yy();return Mo(n,R(z,{get when(){return t()},get children(){return[R(ay,{icon:`arrow`,onClick:S}),R(hy,{get universalLink(){return g({useEmbeddedRequest:!1})},get isCopiedShown(){return _()},onOpenLink:b,onCopy:y})]}}),null),Mo(n,R(z,{get when(){return!t()},get children(){return[R(ay,{get icon(){return R(Lm,{})},onClick:x}),R(z,{get when(){return f()},get fallback(){return R(Qv,{translationKey:`walletModal.mobileUniversalModal.connectYourWallet`,children:`Connect your TON wallet`})},get children(){return[R($v,{size:by}),R(ey,{translationKey:`walletModal.mobileUniversalModal.useTelegramWallet`,children:`Use your Telegram wallet`}),R(ny,{shiny:!0,get icon(){return R(Nm,{})},onClick:()=>e.onSelect(f()),get children(){return R(Q,{translationKey:`common.connectTelegram`,children:`Connect Telegram`})}})]}}),R(z,{get when(){return p()},get children(){return R(ry,{get transparent(){return p().ui?.isButtonTransparent},get shiny(){return!p().ui?.isButtonTransparent},shineOpacity:xy,get icon(){return R(iy,{get src(){return p().imageUrl}})},onClick:()=>e.onSelect(p()),get children(){return p().name}})}}),R(ty,{get translationKey(){return m()?`walletModal.mobileUniversalModal.chooseOtherApplication`:`walletModal.mobileUniversalModal.chooseApplication`},maxWidth:342,padding:`0 24px 8px 24px`,margin:`0`,get children(){return m()?`Or choose another app:`:`Choose an app:`}}),R(Dp,{get children(){return[R(lo,{get each(){return V(()=>!!u())()?ee():C()},children:t=>(()=>{var n=vy();return Mo(n,R(Up,{get icon(){return t.imageUrl},get name(){return t.name},onClick:()=>e.onSelect(t)})),n})()}),R(z,{get when(){return u()},get children(){var t=vy();return Mo(t,R(Hm,{labelLine1:`View all`,labelLine2:`wallets`,get images(){return te().map(e=>e.imageUrl)},onClick:()=>e.onSelectAllWallets()})),t}})]}})]}}),null),n})()},Cy={m:`16px`,s:`8px`,none:`0`},wy={m:`8px`,s:`4px`,none:`0`},Ty=K.div`
|
|
2066
|
-
display: flex;
|
|
2067
|
-
flex-direction: column;
|
|
2068
|
-
align-items: center;
|
|
2069
|
-
padding-bottom: 16px;
|
|
2070
|
-
`,Ey=K(qp)`
|
|
2071
|
-
max-width: 320px;
|
|
2072
|
-
margin-top: 2px;
|
|
2073
|
-
margin-bottom: 20px;
|
|
2074
|
-
`,Dy=K(qp)`
|
|
2075
|
-
margin-bottom: 16px;
|
|
2076
|
-
`,Oy=K(mp)`
|
|
2077
|
-
margin-bottom: 24px;
|
|
2078
|
-
`,ky=K.ul`
|
|
2079
|
-
display: flex;
|
|
2080
|
-
`;K.div`
|
|
2081
|
-
display: flex;
|
|
2082
|
-
gap: 16px;
|
|
2083
|
-
width: 100%;
|
|
2084
|
-
`,K(X)`
|
|
2085
|
-
position: relative;
|
|
2086
|
-
font-size: 16px;
|
|
2087
|
-
line-height: 20px;
|
|
2088
|
-
width: 100%;
|
|
2089
|
-
padding: 0 16px;
|
|
2090
|
-
height: 56px;
|
|
2091
|
-
border-radius: ${e=>Cy[e.theme.borderRadius]};
|
|
2092
|
-
|
|
2093
|
-
&:hover {
|
|
2094
|
-
${e=>e.disableEventsAnimation?`transform: unset;`:``}
|
|
2095
|
-
}
|
|
2096
|
-
|
|
2097
|
-
&:active {
|
|
2098
|
-
${e=>e.disableEventsAnimation?`transform: unset;`:``}
|
|
2099
|
-
}
|
|
2100
|
-
`,K.ul`
|
|
2101
|
-
position: absolute;
|
|
2102
|
-
bottom: 100%;
|
|
2103
|
-
left: 0;
|
|
2104
|
-
margin: 0;
|
|
2105
|
-
padding: 8px;
|
|
2106
|
-
width: 188px;
|
|
2107
|
-
transform: translateY(-16px);
|
|
2108
|
-
|
|
2109
|
-
background-color: ${e=>e.theme.colors.background.primary};
|
|
2110
|
-
border-radius: ${e=>Cy[e.theme.borderRadius]};
|
|
2111
|
-
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
|
|
2112
|
-
`,K.li`
|
|
2113
|
-
padding: 8px;
|
|
2114
|
-
|
|
2115
|
-
display: flex;
|
|
2116
|
-
align-items: center;
|
|
2117
|
-
gap: 8px;
|
|
2118
|
-
|
|
2119
|
-
cursor: pointer;
|
|
2120
|
-
border-radius: ${e=>wy[e.theme.borderRadius]};
|
|
2121
|
-
|
|
2122
|
-
transition:
|
|
2123
|
-
background-color,
|
|
2124
|
-
transform 0.1s ease-in-out;
|
|
2125
|
-
|
|
2126
|
-
&:hover {
|
|
2127
|
-
background-color: ${e=>e.theme.colors.background.secondary};
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
&:active {
|
|
2131
|
-
transform: scale(0.96);
|
|
2132
|
-
}
|
|
2133
|
-
`,K(gl)`
|
|
2134
|
-
width: 24px;
|
|
2135
|
-
height: 24px;
|
|
2136
|
-
|
|
2137
|
-
border-radius: 6px;
|
|
2138
|
-
`,K.div`
|
|
2139
|
-
margin-top: 23px;
|
|
2140
|
-
margin-bottom: 1px;
|
|
2141
|
-
width: 100%;
|
|
2142
|
-
display: flex;
|
|
2143
|
-
justify-content: center;
|
|
2144
|
-
align-items: center;
|
|
2145
|
-
`,K(xp)`
|
|
2146
|
-
color: ${e=>e.theme.colors.text.secondary};
|
|
2147
|
-
font-size: 16px;
|
|
2148
|
-
`;var Ay=H(`<li>`),jy=e=>{let[t,n]=N(!1),r=Z.connector,i=I(()=>gy(e.walletsList),null,{equals:_y});kc({openMethod:`qrcode`});let a=I(()=>r.connect(i(),e.additionalRequest,{traceId:e.walletModalState.traceId,linkDisplayOnly:!0})),o=I(()=>e.walletsList.filter(e=>e.isSupportRequiredFeatures),null),s=I(()=>o().slice(0,3),null);Nc({walletsMenu:`main_screen`,wallets:s()});let c=I(()=>e.walletsList.filter(e=>!s().find(t=>t.appName===e.appName)).slice(0,4),null);return R(Ty,{onClick:()=>n(!1),"data-tc-wallets-modal-universal-desktop":`true`,get children(){return[R(Gp,{translationKey:`walletModal.desktopUniversalModal.connectYourWallet`,children:`Connect your wallet`}),R(Ey,{translationKey:`walletModal.desktopUniversalModal.scan`,children:`Scan with your mobile wallet`}),R(Oy,{get sourceUrl(){return q(a(),`none`)},get disableCopy(){return t()},get logo(){return R(my,{})}}),R(Dy,{translationKey:`walletModal.desktopUniversalModal.availableWallets`,children:`Available wallets`}),R(ky,{get children(){return[R(lo,{get each(){return s()},children:t=>(()=>{var n=Ay();return Mo(n,R(qm,{wallet:t,onClick:()=>e.onSelect(t)})),n})()}),R(Hm,{labelLine1:`View all`,labelLine2:`wallets`,get images(){return c().map(e=>e.imageUrl)},onClick:()=>e.onSelectAllWallets()})]}})]}})},My={m:`16px`,s:`8px`,none:`0`},Ny=K(Gp)`
|
|
2149
|
-
max-width: 288px;
|
|
2150
|
-
margin: 0 auto 38px;
|
|
2151
|
-
`,Py=K.div`
|
|
2152
|
-
display: flex;
|
|
2153
|
-
flex-direction: column;
|
|
2154
|
-
align-items: center;
|
|
2155
|
-
`,Fy=K(lf)`
|
|
2156
|
-
position: absolute;
|
|
2157
|
-
top: 16px;
|
|
2158
|
-
left: 16px;
|
|
2159
|
-
`,Iy=K(Gp)`
|
|
2160
|
-
text-align: center;
|
|
2161
|
-
font-size: 20px;
|
|
2162
|
-
line-height: 28px;
|
|
2163
|
-
`,Ly=K(xp)`
|
|
2164
|
-
margin-top: 12px;
|
|
2165
|
-
margin-bottom: 24px;
|
|
2166
|
-
text-align: center;
|
|
2167
|
-
max-width: 360px;
|
|
2168
|
-
font-weight: 400;
|
|
2169
|
-
color: ${e=>e.theme.colors.text.secondary};
|
|
2170
|
-
`;K.button`
|
|
2171
|
-
background: transparent;
|
|
2172
|
-
border: none;
|
|
2173
|
-
padding: 0;
|
|
2174
|
-
margin: 0;
|
|
2175
|
-
color: ${e=>e.theme.colors.accent};
|
|
2176
|
-
text-decoration: underline;
|
|
2177
|
-
cursor: pointer;
|
|
2178
|
-
font: inherit;
|
|
2179
|
-
`;var Ry=K.div`
|
|
2180
|
-
margin-bottom: 46px;
|
|
2181
|
-
`,zy=K(am)`
|
|
2182
|
-
margin-bottom: 16px;
|
|
2183
|
-
`;K.ul`
|
|
2184
|
-
display: flex;
|
|
2185
|
-
gap: 8px;
|
|
2186
|
-
margin-bottom: 24px;
|
|
2187
|
-
list-style: none;
|
|
2188
|
-
padding: 0;
|
|
2189
|
-
`;var By=K(X)`
|
|
2190
|
-
max-width: 320px;
|
|
2191
|
-
width: 100%;
|
|
2192
|
-
height: 48px;
|
|
2193
|
-
font-size: 16px;
|
|
2194
|
-
line-height: 20px;
|
|
2195
|
-
border-radius: ${e=>My[e.theme.borderRadius]};
|
|
2196
|
-
margin-bottom: 28px;
|
|
2197
|
-
`,Vy=K(qp)`
|
|
2198
|
-
color: ${e=>e.theme.colors.text.secondary};
|
|
2199
|
-
text-align: center;
|
|
2200
|
-
margin-bottom: 20px;
|
|
2201
|
-
`,Hy=K.div`
|
|
2202
|
-
display: flex;
|
|
2203
|
-
justify-content: center;
|
|
2204
|
-
gap: 8px;
|
|
2205
|
-
padding-bottom: 31px;
|
|
2206
|
-
`,Uy=K.div`
|
|
2207
|
-
margin: 0 8px 16px 8px;
|
|
2208
|
-
`,Wy=K(lf)`
|
|
2209
|
-
position: absolute;
|
|
2210
|
-
top: 16px;
|
|
2211
|
-
left: 16px;
|
|
2212
|
-
`,Gy=K(Gp)`
|
|
2213
|
-
margin-bottom: 18px;
|
|
2214
|
-
text-align: center;
|
|
2215
|
-
`,Ky=K.div`
|
|
2216
|
-
padding: 16px 0;
|
|
2217
|
-
display: flex;
|
|
2218
|
-
flex-direction: column;
|
|
2219
|
-
align-items: center;
|
|
2220
|
-
`;K.div`
|
|
2221
|
-
margin-bottom: 12px;
|
|
2222
|
-
`;var qy=K(Yp)`
|
|
2223
|
-
text-align: center;
|
|
2224
|
-
margin-bottom: 4px;
|
|
2225
|
-
`,Jy=K(xp)`
|
|
2226
|
-
text-align: center;
|
|
2227
|
-
max-width: 352px;
|
|
2228
|
-
color: ${e=>e.theme.colors.text.secondary};
|
|
2229
|
-
`,Yy=K.div`
|
|
2230
|
-
width: 44px;
|
|
2231
|
-
height: 44px;
|
|
2232
|
-
border-radius: 20px;
|
|
2233
|
-
background-color: ${e=>e.theme?.colors.icon.secondary};
|
|
2234
|
-
display: flex;
|
|
2235
|
-
align-items: center;
|
|
2236
|
-
justify-content: center;
|
|
2237
|
-
margin-bottom: 12px;
|
|
2238
|
-
font-weight: 700;
|
|
2239
|
-
font-size: 22px;
|
|
2240
|
-
color: ${e=>e.theme?.colors.text.primary};
|
|
2241
|
-
`,Xy=e=>R(Uy,{"data-tc-wallets-modal-restore":`true`,get children(){return[R(Wy,{icon:`arrow`,get onClick(){return e.onBackClick}}),R(Gy,{translationKey:`walletModal.restoreInfoModal.title`,children:`Restore`}),R(th,{get children(){return[R(Ky,{get children(){return[R(Yy,{children:`1`}),R(qy,{translationKey:`walletModal.restoreModal.step1.title`,children:`Find your current recovery phrase`}),R(Jy,{translationKey:`walletModal.restoreModal.step1.text`,children:`Open your wallet settings and locate the\xA0recovery\xA0phrase`})]}}),R(Ky,{get children(){return[R(Yy,{children:`2`}),R(qy,{translationKey:`walletModal.restoreModal.step2.title`,children:`Copy your recovery phrase`}),R(Jy,{translationKey:`walletModal.restoreModal.step2.text`,children:`Write it down or copy it to a safe place`})]}}),R(Ky,{get children(){return[R(Yy,{children:`3`}),R(qy,{translationKey:`walletModal.restoreModal.step3.title`,children:`Restore in a supported wallet from\xA0the\xA0list\xA0below`}),R(Jy,{translationKey:`walletModal.restoreModal.step3.text`,children:`Enter the recovery phrase to access your wallet`})]}})]}})]}}),Zy=e=>{let[t,n]=N(null),[r,i]=N(!1),a=I(()=>e.walletsList.find(t=>Bp(t,e.currentWallet.device.appName))),o=I(()=>a()?.name??e.currentWallet.device.appName),s=I(()=>{let t=a();if(!t?.features)return!1;let n=e.walletsModalState.requiredFeature,r=n?{[n.featureName]:n.value}:{},i=Er(t.features,r),o=Er(e.currentWallet.device.features,r);return i&&!o}),c=()=>A(null,null,function*(){yield e.onDisconnect(),e.onSelect(t())});return R(Py,{get children(){return R(uo,{get children(){return[R(B,{get when(){return r()},get children(){return R(Xy,{onBackClick:()=>i(!1)})}}),R(B,{get when(){return t()},get children(){return[R(Ry,{}),R(Py,{get children(){return[R(Fy,{icon:`arrow`,onClick:()=>n(null)}),R(Iy,{translationKey:`walletModal.featureNotSupported.disconnect.title`,children:`Confirm Disconnect`}),R(Ly,{translationKey:`walletModal.featureNotSupported.disconnect.description`,get translationValues(){return{name:t().name}},get children(){return[`You will be disconnected from your current wallet and redirected to connect `,V(()=>t()?.name),`.`]}}),R(By,{onClick:()=>c(),get children(){return R(Q,{translationKey:`walletModal.featureNotSupported.disconnect.button`,children:`Disconnect`})}})]}})]}}),R(B,{get when(){return s()},get children(){return[R(Ny,{get children(){return o()}}),R(zy,{size:`s`}),R(Vy,{translationKey:`walletModal.featureNotSupported.version.description`,get translationValues(){return{name:o()}},get children(){return[`Your current version of `,V(()=>o()),` or wallet contract type doesn't support the required features. Please update it to continue.`]}}),R(Hy,{get children(){return[R(rh,{get href(){return a().aboutUrl},blank:!0,get children(){return R(X,{get leftIcon(){return R(Cm,{})},get children(){return R(Q,{translationKey:`walletModal.featureNotSupported.version.updateButton`,get translationValues(){return{name:o()}},get children(){return[`Update `,V(()=>o())]}})}})}}),R(rh,{href:`https://tonkeeper.helpscoutdocs.com/article/102-w5`,blank:!0,get children(){return R(X,{get leftIcon(){return R(Cm,{})},get children(){return R(Q,{translationKey:`walletModal.featureNotSupported.version.aboutW5`,children:`About W5`})}})}})]}})]}}),R(B,{when:!0,get children(){return[R(Ry,{}),R(zy,{size:`s`}),R(Iy,{translationKey:`walletModal.featureNotSupported.wallet.title`,get translationValues(){return{name:o()}},get children(){return[V(()=>o()),` doesn’t support the requested\xA0action`]}}),R(Ry,{})]}})]}})}})},Qy=()=>{let{locale:e}=yp()[1];F(()=>e(Z.language)),F(()=>{xc()?(eh(),i()):(o(null),u(`universal`),f(!1))});let t=Pa(Rc),n=Pa(ih),[r,{refetch:i}]=xa(()=>n.getWallets()),[a,o]=N(null),[s,c]=N(null),[l,u]=N(`universal`),[d,f]=N(!1),p=I(()=>{let e=yc();return`type`in e&&e.type===`wallet-not-support-feature`}),m=I(()=>{if(r.state!==`ready`)return null;let e=Ip(r(),Z.walletsListConfiguration),t=e.filter(Ve),i=e.filter(e=>!Ve(e));e=(t||[]).concat(i);let a=Z.preferredWalletAppName,o=e.find(e=>Bp(e,a)),s=e.filter(e=>Bp(e,a)).length>=2;a&&o&&!s&&(e=[k(O({},o),{isPreferred:!0})].concat(e.filter(e=>!Bp(e,a))));let c=n?.walletsRequiredFeatures??n?.walletsPreferredFeatures;return e.map(e=>k(O({},e),{isSupportRequiredFeatures:!c||Er(e.features??[],c)}))}),h=()=>Z.connectRequestParameters?.state===`loading`,g=I(()=>{if(!h())return Z.connectRequestParameters?.value}),_=e=>{n.closeModal(e)},v=t.onStatusChange(e=>{e&&_(`wallet-selected`)},e=>{if(e instanceof Fe){let t=e.cause.connectEvent.device.appName,n=m()?.find(e=>Bp(e,t));if(!n)throw new T(`Wallet not found`);let r=n.isSupportRequiredFeatures?`missing-features`:`not-supported`;c(r),o(n)}}),y=()=>{u(`all-wallets`)},b=()=>{u(`universal`)},x=(e,t)=>{let n=yc().traceId;n&&W_(Z.tracker,{isMobile:Qm(),walletAppName:e.appName,surface:t,selectionSource:`manual`,traceId:n}),o(e)},S=e=>{o(e),$.openWalletsModal()},C=()=>{o(null),c(null)};return Ta(()=>{o(null),c(null),f(!1)}),Ta(v),R(B_,{get opened(){return xc()},get enableAndroidBackHandler(){return Z.enableAndroidBackHandler},onClose:()=>_(`action-cancelled`),onClickQuestion:()=>f(e=>!e),get showFooter(){return!p()},"data-tc-wallets-modal-container":`true`,get children(){return[R(z,{get when(){return d()},get children(){return R(Av,{onBackClick:()=>f(!1)})}}),R(z,{get when(){return!d()},get children(){return[R(z,{get when(){return h()||!m()},get children(){return[R(V_,{translationKey:`walletModal.loading`,children:`Wallets list is loading`}),R(H_,{get children(){return R(lm,{size:`m`})}})]}}),R(z,{get when(){return V(()=>!h())()&&m()},get children(){return R(uo,{get children(){return[R(B,{get when(){return p()},get children(){return R(Zy,{get walletsList(){return m()},get currentWallet(){return n?.wallet},onSelect:S,onSelectAllWallets:y,onDisconnect:()=>t.disconnect().catch(e=>void 0),get walletsModalState(){return yc()},onClose:()=>_(`action-cancelled`)})}}),R(B,{get when(){return a()},get children(){return R(Ko,{get component(){return Qm()?Yv:bv},get walletsModalState(){return yc()},get wallet(){return a()},get additionalRequest(){return g()},selectionSource:`manual`,onBackClick:C,get defaultError(){return s()}})}}),R(B,{get when(){return l()===`universal`},get children(){return R(Ko,{get component(){return Qm()?Sy:jy},onSelect:e=>x(e,`universal-modal`),get walletModalState(){return yc()},get walletsList(){return m()},get additionalRequest(){return g()},onSelectAllWallets:y})}}),R(B,{get when(){return l()===`all-wallets`},get children(){return R(sv,{get walletsList(){return m()},get featureCheckMode(){return n?.walletsRequiredFeatures?`strict`:`soft`},onBack:b,get traceId(){return yc().traceId},onSelect:e=>x(e,`all-wallets-list`)})}})]}})}})]}})]}})},$y=K.div`
|
|
2242
|
-
display: flex;
|
|
2243
|
-
flex-direction: column;
|
|
2244
|
-
align-items: center;
|
|
2245
|
-
padding-bottom: 8px;
|
|
2246
|
-
`,eb=K(Gp)`
|
|
2247
|
-
margin-top: 16px;
|
|
2248
|
-
`,tb=K(xp)`
|
|
2249
|
-
font-weight: 510;
|
|
2250
|
-
font-size: 16px;
|
|
2251
|
-
line-height: 20px;
|
|
2252
|
-
text-align: center;
|
|
2253
|
-
max-width: 250px;
|
|
2254
|
-
|
|
2255
|
-
color: ${e=>e.theme.colors.text.secondary};
|
|
2256
|
-
`,nb=K(X)`
|
|
2257
|
-
min-width: 112px;
|
|
2258
|
-
margin-top: 32px;
|
|
2259
|
-
`,rb=K(lm)`
|
|
2260
|
-
height: 16px;
|
|
2261
|
-
width: 16px;
|
|
2262
|
-
`,ib=K(X)`
|
|
2263
|
-
margin-top: 32px;
|
|
2264
|
-
`,ab=e=>{let t=Tl(e),n=Pa(ih),[r,i]=N(!0),[a,o]=N(!1),[s,c]=N(!1);F(()=>{let e=Ac();o(!!e&&(`executed`in e&&!!e.executed||_c(e))),c(!!e&&vc(e))});let l;n?.wallet&&`universalLink`in n.wallet&&(n.wallet.openMethod===`universal-link`||yt(n.wallet.universalLink)&&Di())&&(l=n.wallet.universalLink);let u;n?.wallet&&`deepLink`in n.wallet&&(n.wallet.openMethod===`custom-deeplink`||yt(n.wallet.deepLink)&&Di())&&(u=n.wallet.deepLink);let d=()=>{let e=Ac(),t=`returnStrategy`in e&&e.returnStrategy||Z.returnStrategy,n=!r();i(!1);let a=Os(l,{sessionId:e.sessionId,traceId:e.traceId});yt(l)?Es(a,{returnStrategy:t,twaReturnUrl:`twaReturnUrl`in e&&e.twaReturnUrl||Z.twaReturnUrl,forceRedirect:n}):Ds(a,u,{returnStrategy:t,forceRedirect:n},()=>{})};return R($y,oo(t,{get children(){return[V(()=>e.icon),R(eb,{get translationKey(){return e.headerTranslationKey},get translationValues(){return e.headerTranslationValues}}),R(tb,{get translationKey(){return e.textTranslationKey},get translationValues(){return e.textTranslationValues}}),R(z,{get when(){return!a()&&!s()&&(e.showButton===`open-wallet`&&l||e.showButton!==`open-wallet`)},get children(){return R(nb,{disabled:!0,"data-tc-connect-button-loading":`true`,get children(){return R(rb,{})}})}}),R(z,{get when(){return a()},get children(){return[R(z,{get when(){return e.showButton!==`open-wallet`},get children(){return R(ib,{onClick:()=>e.onClose(),get children(){return R(Q,{translationKey:`common.close`,children:`Close`})}})}}),R(z,{get when(){return e.showButton===`open-wallet`&&l},get children(){return R(ib,{onClick:d,get children(){return R(Q,{translationKey:`common.openWallet`,children:`Open wallet`})}})}})]}})]}}))},ob=e=>{let t=Pa(ih),[n]=yp(),r=()=>t.wallet&&`name`in t.wallet?t.wallet.name:n(`common.yourWallet`,{},`Your wallet`);return R(ab,{headerTranslationKey:`actionModal.confirmTransaction.header`,get headerTranslationValues(){return{name:r()}},textTranslationKey:`actionModal.confirmTransaction.text`,get icon(){return R(lm,{size:`m`})},onClose:()=>e.onClose(),showButton:`open-wallet`,"data-tc-confirm-modal":`true`})},sb=e=>R(ab,{headerTranslationKey:`actionModal.transactionCanceled.header`,textTranslationKey:`actionModal.transactionCanceled.text`,get icon(){return R(am,{size:`m`})},onClose:()=>e.onClose(),"data-tc-transaction-canceled-modal":`true`}),cb=e=>R(ab,{headerTranslationKey:`actionModal.transactionSent.header`,textTranslationKey:`actionModal.transactionSent.text`,get icon(){return R(tm,{size:`m`})},showButton:`open-wallet`,onClose:()=>e.onClose(),"data-tc-transaction-sent-modal":`true`}),lb=e=>{let t=Pa(ih),[n]=yp(),r=()=>t.wallet&&`name`in t.wallet?t.wallet.name:n(`common.yourWallet`,{},`Your wallet`);return R(ab,{headerTranslationKey:`actionModal.signData.header`,get headerTranslationValues(){return{name:r()}},textTranslationKey:`actionModal.signData.text`,get icon(){return R(lm,{size:`m`})},onClose:()=>e.onClose(),showButton:`open-wallet`,"data-tc-sign-data-confirm-modal":`true`})},ub=e=>R(ab,{headerTranslationKey:`actionModal.signDataCanceled.header`,get icon(){return R(am,{size:`m`})},onClose:()=>e.onClose(),"data-tc-sign-data-canceled-modal":`true`}),db=e=>R(ab,{headerTranslationKey:`actionModal.dataSigned.header`,get icon(){return R(tm,{size:`m`})},onClose:()=>e.onClose(),"data-tc-data-signed-modal":`true`}),fb=e=>{let t=Pa(ih),[n]=yp(),r=()=>t.wallet&&`name`in t.wallet?t.wallet.name:n(`common.yourWallet`,{},`Your wallet`);return R(ab,{headerTranslationKey:`actionModal.signMessage.header`,get headerTranslationValues(){return{name:r()}},textTranslationKey:`actionModal.signMessage.text`,get icon(){return R(lm,{size:`m`})},onClose:()=>e.onClose(),showButton:`open-wallet`,"data-tc-sign-message-confirm-modal":`true`})},pb=e=>R(ab,{headerTranslationKey:`actionModal.messageSigned.header`,get icon(){return R(tm,{size:`m`})},onClose:()=>e.onClose(),"data-tc-message-signed-modal":`true`}),mb=e=>R(ab,{headerTranslationKey:`actionModal.signMessageCanceled.header`,get icon(){return R(am,{size:`m`})},onClose:()=>e.onClose(),"data-tc-sign-message-canceled-modal":`true`}),hb=()=>R(Tf,{get opened(){return V(()=>Ac()!==null)()&&Ac()?.openModal===!0},get enableAndroidBackHandler(){return Z.enableAndroidBackHandler},onClose:()=>jc(null),showFooter:!1,"data-tc-actions-modal-container":`true`,get children(){return R(uo,{get children(){return[R(B,{get when(){return Ac().name===dc.sendTransaction},get children(){return R(cb,{onClose:()=>jc(null)})}}),R(B,{get when(){return Ac().name===fc.sendTransaction},get children(){return R(sb,{onClose:()=>jc(null)})}}),R(B,{get when(){return Ac().name===uc.sendTransaction},get children(){return R(ob,{onClose:()=>jc(null)})}}),R(B,{get when(){return Ac().name===dc.signData},get children(){return R(db,{onClose:()=>jc(null)})}}),R(B,{get when(){return Ac().name===fc.signData},get children(){return R(ub,{onClose:()=>jc(null)})}}),R(B,{get when(){return Ac().name===uc.signData},get children(){return R(lb,{onClose:()=>jc(null)})}}),R(B,{get when(){return Ac().name===dc.signMessage},get children(){return R(pb,{onClose:()=>jc(null)})}}),R(B,{get when(){return Ac().name===fc.signMessage},get children(){return R(mb,{onClose:()=>jc(null)})}}),R(B,{get when(){return Ac().name===uc.signMessage},get children(){return R(fb,{onClose:()=>jc(null)})}})]}})}}),gb=()=>{let{locale:e}=yp()[1];F(()=>e(Z.language)),F(()=>{wc()&&eh()});let t=Pa(Rc),n=Pa(ih),[r,i]=N(!1),a=()=>Z.connectRequestParameters?.state===`loading`,o=I(()=>{if(!a())return Z.connectRequestParameters?.value}),s=I(()=>({status:`opened`,closeReason:null,traceId:Sc().traceId})),c=e=>{n.closeSingleWalletModal(e)};return Ta(t.onStatusChange(e=>{e&&c(`wallet-selected`)})),Ta(()=>{i(!1)}),R(B_,{get opened(){return wc()},get enableAndroidBackHandler(){return Z.enableAndroidBackHandler},onClose:()=>c(`action-cancelled`),onClickQuestion:()=>i(e=>!e),showFooter:!0,"data-tc-wallets-modal-container":`true`,get children(){return[R(z,{get when(){return r()},get children(){return R(Av,{onBackClick:()=>i(!1)})}}),R(z,{get when(){return!r()},get children(){return[R(z,{get when(){return a()},get children(){return[R(V_,{translationKey:`walletModal.loading`,children:`Wallets list is loading`}),R(H_,{get children(){return R(lm,{size:`m`})}})]}}),R(z,{get when(){return!a()},get children(){return R(Ko,{get component(){return Qm()?Yv:bv},get wallet(){return Tc()},get walletsModalState(){return s()},get additionalRequest(){return o()},selectionSource:`auto-dapp-directed`,onBackClick:()=>{},backDisabled:!0})}})]}})]}})},_b=e=>{let t=_p(Ic,Z.language);return Ks(),Gs(),R(vp.Provider,{value:t,get children(){return R(ih.Provider,{get value(){return e.tonConnectUI},get children(){return R(Rc.Provider,{get value(){return Z.connector},get children(){return[R(fs,{}),R(os,{theme:cl,get children(){return[R(z,{get when(){return Z.buttonRootId},get children(){return R(Wo,{get mount(){return document.getElementById(Z.buttonRootId)},get children(){return R(z_,{})}})}}),R(Ko,{component:ls,get children(){return[R(Qy,{}),R(gb,{}),R(hb,{})]}})]}})]}})}})}})},$={openWalletsModal:e=>void setTimeout(()=>bc(t=>({status:`opened`,traceId:e?.traceId??t?.traceId,closeReason:null,embeddedRequest:e?.embeddedRequest}))),closeWalletsModal:e=>void setTimeout(()=>bc({status:`closed`,closeReason:e})),openSingleWalletModal:(e,t)=>{setTimeout(()=>Cc({status:`opened`,traceId:t?.traceId,closeReason:null,walletInfo:e}))},closeSingleWalletModal:e=>void setTimeout(()=>Cc({status:`closed`,closeReason:e})),openWalletNotSupportFeatureModal:(e,t)=>void setTimeout(()=>bc({status:`opened`,traceId:t.traceId,closeReason:null,type:`wallet-not-support-feature`,requiredFeature:e.requiredFeature})),setAction:e=>void setTimeout(()=>jc(e)),clearAction:()=>void setTimeout(()=>jc(null)),getSelectedWalletInfo:()=>Dc(),getLastVisibleWallets:()=>Mc(),removeSelectedWalletInfo:()=>kc(null),renderApp:(e,t)=>So(()=>R(_b,{tonConnectUI:t}),document.getElementById(e))},vb=class{constructor(e){this.consumers=[],this.state=yc(),this.connector=e.connector,this.tracker=e.tracker,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,F(()=>{let e=yc();this.state=e,this.consumers.forEach(t=>t(e))}),F(Ca(Dc,(e,t)=>A(this,null,function*(){try{let{wallets:n,walletsMenu:r}=$.getLastVisibleWallets();if(e&&`appName`in e){if(t&&`appName`in t&&t.appName===e.appName)return;let i=yield this.connector.getSessionId();this.tracker.trackSelectedWallet(n.map(e=>e.name),e,r,``,void 0,i,this.state.traceId)}}catch{}}))),F(Ca(Pc,e=>A(this,null,function*(){try{let{wallets:t,walletsMenu:n}=$.getLastVisibleWallets();if(bt(e.link)){let r=Dc(),i=yield this.connector.getSessionId();this.tracker.trackSelectedWallet(t.map(e=>e.name),r&&`appName`in r?r:null,n,e.link,e.type,i,this.state.traceId)}}catch{}})))}open(e){return A(this,null,function*(){let t=e?.traceId??E();this.tracker.trackConnectionStarted(t);let n=(yield this.connector.getWallets()).find(He);return n?this.connectEmbeddedWallet(n,{traceId:t}):this.openWalletsModal({traceId:t,embeddedRequest:e?.embeddedRequest})})}close(e=`action-cancelled`){e===`action-cancelled`&&this.tracker.trackConnectionError(`Connection was cancelled`),$.closeWalletsModal(e)}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter(t=>t!==e)}}connectEmbeddedWallet(e,t){let n=n=>{this.tracker.trackWalletSelected(e.appName,`embedded`,`auto-embedded`,t.traceId),kc(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},n,{traceId:t.traceId})},r=Z.connectRequestParameters;r?.state===`loading`?this.setConnectRequestParametersCallback(n):n(r?.value)}openWalletsModal(e){return A(this,null,function*(){return Di()&&bs(),$.openWalletsModal({traceId:e.traceId,embeddedRequest:e.embeddedRequest}),new Promise(e=>{let t=this.onStateChange(n=>{let{status:r}=n;r===`opened`&&(t(),e())})})})}},yb=class{constructor(e){this.consumers=[],this.connector=e.connector,F(()=>{let e=Ac();this.consumers.forEach(t=>t(e))})}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter(t=>t!==e)}}},bb=class{constructor(e){this.consumers=[],this.state=Sc(),this.connector=e.connector,this.tracker=e.tracker,this.setConnectRequestParametersCallback=e.setConnectRequestParametersCallback,F(()=>{let e=Sc();this.state=e,this.consumers.forEach(t=>t(e))})}open(e){return A(this,null,function*(){let t=E();this.tracker.trackConnectionStarted(t);let n=Ip(yield this.connector.getWallets(),Z.walletsListConfiguration),r=n.find(He);if(r)return this.connectEmbeddedWallet(r,{traceId:t});let i=n.filter(We).find(t=>Bp(t,e));if(i)return eh(),W_(this.tracker,{isMobile:Qm(),walletAppName:i.appName,surface:`single-wallet-modal`,selectionSource:`auto-dapp-directed`,traceId:t}),this.openSingleWalletModal(i,{traceId:t});let a=`Trying to open modal window with unknown wallet "${e}".`;throw this.tracker.trackConnectionError(a),new vs(a)})}close(e=`action-cancelled`){e===`action-cancelled`&&this.tracker.trackConnectionError(`Connection was cancelled`),$.closeSingleWalletModal(`action-cancelled`)}onStateChange(e){return this.consumers.push(e),()=>{this.consumers=this.consumers.filter(t=>t!==e)}}connectEmbeddedWallet(e,t){let n=n=>{this.tracker.trackWalletSelected(e.appName,`embedded`,`auto-embedded`,t.traceId),kc(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},n,{traceId:t.traceId})},r=Z.connectRequestParameters;r?.state===`loading`?this.setConnectRequestParametersCallback(n):n(r?.value)}openSingleWalletModal(e,t){return A(this,null,function*(){return Di()&&bs(),$.openSingleWalletModal(e,{traceId:t?.traceId}),new Promise(e=>{let t=this.onStateChange(n=>{let{status:r}=n;r===`opened`&&(t(),e())})})})}},xb=class{constructor(e){this.eventPrefix=`ton-connect-ui-`,this.tonConnectSdkVersion=null,this.eventDispatcher=e?.eventDispatcher,this.tonConnectUiVersion=e.tonConnectUiVersion,this.init().catch()}get version(){return Nr({ton_connect_sdk_lib:this.tonConnectSdkVersion,ton_connect_ui_lib:this.tonConnectUiVersion})}init(){return A(this,null,function*(){try{yield this.setRequestVersionHandler(),this.tonConnectSdkVersion=yield this.requestTonConnectSdkVersion()}catch{}})}setRequestVersionHandler(){return A(this,null,function*(){yield this.eventDispatcher.addEventListener(`ton-connect-ui-request-version`,()=>A(this,null,function*(){let e=Mr(this.tonConnectUiVersion);try{let t=tc();e=k(O({},e),{tma:Di(),tmaPlatform:Ti(),tmaVersion:ys(),telegramBrowser:Oi(),os:t.os,browser:t.browser,rawBrowser:new qi.default().getBrowser().name??null,mobile:ec()})}catch{}yield this.eventDispatcher.dispatchEvent(`ton-connect-ui-response-version`,e)}))})}requestTonConnectSdkVersion(){return A(this,null,function*(){return new Promise((e,t)=>A(this,null,function*(){try{yield this.eventDispatcher.addEventListener(`ton-connect-response-version`,t=>{e(t.detail.version)},{once:!0}),yield this.eventDispatcher.dispatchEvent(`ton-connect-request-version`,jr())}catch(e){t(e)}}))})}dispatchUserActionEvent(e){var t;try{(t=this.eventDispatcher)==null||t.dispatchEvent(`${this.eventPrefix}${e.type}`,e).catch()}catch{}}trackWalletModalOpened(...e){try{let t=Qr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackSelectedWallet(...e){try{let t=$r(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackWalletPreselected(...e){try{let t=ei(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackWalletSelected(...e){try{let t=ti(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionInitiated(...e){try{let t=Ir(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionStarted(...e){try{let t=Fr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionCompleted(...e){try{let t=Rr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionError(...e){try{let t=zr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionRestoringStarted(...e){try{let t=Br(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionRestoringCompleted(...e){try{let t=Vr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackConnectionRestoringError(...e){try{let t=Hr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackDisconnection(...e){try{let t=Zr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackTransactionSentForSignature(...e){try{let t=Gr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackTransactionSigned(...e){try{let t=Kr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackTransactionSigningFailed(...e){try{let t=qr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackDataSentForSignature(...e){try{let t=Jr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackDataSigned(...e){try{let t=Yr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}trackDataSigningFailed(...e){try{let t=Xr(this.version,...e);this.dispatchUserActionEvent(t)}catch{}}},Sb=`5.0.1`,Cb=class{constructor(){this.userAgent=tc()}getLocale(){return navigator.languages?.[0]||navigator.language||``}getBrowser(){return this.userAgent.browser??``}getPlatform(){return this.userAgent.os??``}getTelegramUser(){return Ai()}getClientEnvironment(){return Di()?`miniapp`:`web`}},wb=class{constructor(e){this.walletInfoStorage=new ic,this.preferredWalletStorage=new ac,this.walletInfo=null,this.systemThemeChangeUnsubscribe=null,this.connectionRestored=Promise.resolve(!1);let t=e?.eventDispatcher??new li;if(e&&`connector`in e&&e.connector)this.connector=e.connector;else if(e&&`manifestUrl`in e&&e.manifestUrl)this.connector=new Wi({manifestUrl:e.manifestUrl,eventDispatcher:t,walletsRequiredFeatures:e.walletsRequiredFeatures,environment:new Cb,analytics:e.analytics});else throw new vs("You have to specify a `manifestUrl` or a `connector` in the options.");this.tracker=new xb({eventDispatcher:t,tonConnectUiVersion:Sb}),this.modalManager=new vb({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.modal=this.modalManager,this.singleWalletModal=new bb({connector:this.connector,tracker:this.tracker,setConnectRequestParametersCallback:e=>{this.connectRequestParametersCallback=e}}),this.transactionModal=new yb({connector:this.connector}),this._walletsRequiredFeatures=e.walletsRequiredFeatures,this._walletsPreferredFeatures=e.walletsPreferredFeatures,this.walletsList=this.getWallets(),this.walletsList.then(e=>Ys(Np(e.map(e=>e.imageUrl))));let n=this.normalizeWidgetRoot(e?.widgetRootId);this.subscribeToWalletChange(),e?.restoreConnection!==!1&&(this.connectionRestored=Js(()=>A(this,null,function*(){return this.tracker.trackConnectionRestoringStarted(),yield this.connector.restoreConnection(),this.connector.connected?this.tracker.trackConnectionRestoringCompleted(this.wallet):(this.tracker.trackConnectionRestoringError(`Connection was not restored`),this.walletInfoStorage.removeWalletInfo()),this.connector.connected}))),this.uiOptions=sl(e,{uiPreferences:{theme:`SYSTEM`}});let r=this.preferredWalletStorage.getPreferredWalletAppName();U_({connector:this.connector,tracker:this.tracker,preferredWalletAppName:r}),$.renderApp(n,this)}static getWallets(){return Wi.getWallets()}get walletsRequiredFeatures(){return this._walletsRequiredFeatures}get walletsPreferredFeatures(){return this._walletsPreferredFeatures}get connected(){return this.connector.connected}get account(){return this.connector.account}get wallet(){return this.connector.wallet?O(O({},this.connector.wallet),this.walletInfo):null}set uiOptions(e){var t;this.checkButtonRootExist(e.buttonRootId),this.actionsConfiguration=e.actionsConfiguration,`walletsRequiredFeatures`in e&&(this._walletsRequiredFeatures=e.walletsRequiredFeatures),`walletsPreferredFeatures`in e&&(this._walletsPreferredFeatures=e.walletsPreferredFeatures),e.uiPreferences?.theme?e.uiPreferences?.theme===`SYSTEM`?(fl(Vs(),e.uiPreferences.colorsSet),this.systemThemeChangeUnsubscribe||=Hs(fl)):((t=this.systemThemeChangeUnsubscribe)==null||t.call(this),fl(e.uiPreferences.theme,e.uiPreferences.colorsSet)):e.uiPreferences?.colorsSet&&ml(e.uiPreferences.colorsSet),e.uiPreferences?.borderRadius&&pl(e.uiPreferences.borderRadius),U_(t=>{let n=sl(O(O(O(O({},e.language&&{language:e.language}),!!e.actionsConfiguration?.returnStrategy&&{returnStrategy:e.actionsConfiguration.returnStrategy}),!!e.actionsConfiguration?.twaReturnUrl&&{twaReturnUrl:e.actionsConfiguration.twaReturnUrl}),!!e.walletsListConfiguration&&{walletsListConfiguration:e.walletsListConfiguration}),Gc(t));return e.buttonRootId!==void 0&&(n.buttonRootId=e.buttonRootId),e.enableAndroidBackHandler!==void 0&&(n.enableAndroidBackHandler=e.enableAndroidBackHandler),n})}setConnectRequestParameters(e){var t;U_({connectRequestParameters:e}),(e?.state===`ready`||!e)&&((t=this.connectRequestParametersCallback)==null||t.call(this,e?.value))}setConnectionNetwork(e){this.connector.setConnectionNetwork(e)}getWallets(){return A(this,null,function*(){return this.connector.getWallets()})}onStatusChange(e,t){return this.connector.onStatusChange(t=>A(this,null,function*(){if(t){let n=yield this.getSelectedWalletInfo(t);e(O(O({},t),n||this.walletInfoStorage.getWalletInfo()))}else e(t)}),t)}openModal(e){return A(this,null,function*(){let t=e?.traceId??E();yield this.modal.open({traceId:t});let n=yield this.getSessionId(),r=$.getLastVisibleWallets();this.tracker.trackWalletModalOpened(r.wallets.map(e=>e.name),n,t)})}closeModal(e){this.modal.close(e)}onModalStateChange(e){return this.modal.onStateChange(e)}get modalState(){return this.modal.state}openSingleWalletModal(e){return A(this,null,function*(){return this.singleWalletModal.open(e)})}closeSingleWalletModal(e){this.singleWalletModal.close(e)}onSingleWalletModalStateChange(e){return this.singleWalletModal.onStateChange(e)}get singleWalletModalState(){return this.singleWalletModal.state}connectWallet(e){return A(this,null,function*(){let t=e?.traceId??E(),n=(yield this.getWallets()).find(He);return n?yield this.connectEmbeddedWallet(n,{traceId:t}):yield this.connectExternalWallet({traceId:t})})}disconnect(e){let t=e?.traceId??E();return this.tracker.trackDisconnection(this.wallet,`dapp`),$.clearAction(),$.removeSelectedWalletInfo(),this.walletInfoStorage.removeWalletInfo(),this.connector.disconnect({traceId:t})}sendTransaction(e,t){return A(this,null,function*(){let n=t?.traceId??E();this.tracker.trackTransactionSentForSignature(this.wallet,e);let r={onAbort:()=>(this.tracker.trackTransactionSigningFailed(this.wallet,e,`Transaction was cancelled`),new vs(`Transaction was not sent`)),sendRequestBuilder:t=>()=>A(this,null,function*(){let n=yield this.connector.sendTransaction(e,t);return this.tracker.trackTransactionSigned(this.wallet,e,n),n})},i=`sendTransaction`,a=Tb(t);if(!this.connected&&a)return this.initiateEmbeddedRequestFlow({method:`sendTransaction`,request:e},i,k(O({},t),{traceId:n}));if(!this.connected)throw this.tracker.trackTransactionSigningFailed(this.wallet,e,`Wallet was not connected`),new vs(`Connect wallet to send a transaction.`);let o=yield this.initiateBridgeFlow(r,i,k(O({},t),{traceId:n}));return a?{hasResponse:!0,response:o,traceId:n}:o})}signData(e,t){return A(this,null,function*(){let n=t?.traceId??E();this.tracker.trackDataSentForSignature(this.wallet,e);let r={onAbort:()=>(this.tracker.trackDataSigningFailed(this.wallet,e,`SignData was cancelled`),new vs(`SignData was not sent`)),sendRequestBuilder:t=>()=>A(this,null,function*(){let n=yield this.connector.signData(e,t);return this.tracker.trackDataSigned(this.wallet,e,n),n})},i=`signData`,a=Tb(t);if(!this.connected&&a)return this.initiateEmbeddedRequestFlow({method:`signData`,request:e},i,k(O({},t),{traceId:n}));if(!this.connected)throw this.tracker.trackDataSigningFailed(this.wallet,e,`Wallet was not connected`),new vs(`Connect wallet to sign data.`);let o=yield this.initiateBridgeFlow(r,i,k(O({},t),{traceId:n}));return a?{hasResponse:!0,response:o,traceId:n}:o})}signMessage(e,t){return A(this,null,function*(){let n=t?.traceId??E(),r={onAbort:()=>new vs(`SignMessage was not sent`),sendRequestBuilder:t=>()=>A(this,null,function*(){return yield this.connector.signMessage(e,t)})},i=`signMessage`,a=Tb(t);if(!this.connected&&a)return this.initiateEmbeddedRequestFlow({method:`signMessage`,request:e},i,k(O({},t),{traceId:n}));if(!this.connected)throw new vs(`Connect wallet to sign a message.`);let o=yield this.initiateBridgeFlow(r,i,k(O({},t),{traceId:n}));return a?{hasResponse:!0,response:o,traceId:n}:o})}getSessionId(){return A(this,null,function*(){try{let e=this.connector.dappSettings?.storage;if(e){let t=yield e.getItem(`ton-connect-storage_bridge-connection`);if(t){let e=JSON.parse(t);if(e.type===`http`&&e.sessionCrypto)return new Te(e.sessionCrypto).sessionId;if(e.type===`http`&&e.session?.sessionKeyPair)return new Te(e.session.sessionKeyPair).sessionId}}}catch{}return null})}redirectAfterRequestSent({returnStrategy:e,twaReturnUrl:t,forceRedirect:n,sessionId:r,traceId:i}){if(this.walletInfo&&`universalLink`in this.walletInfo&&(this.walletInfo.openMethod===`universal-link`||this.walletInfo.openMethod===`custom-deeplink`)){let a=Os(this.walletInfo.universalLink,{sessionId:r,traceId:i});yt(this.walletInfo.universalLink)?Es(a,{returnStrategy:e,twaReturnUrl:t||Z.twaReturnUrl,forceRedirect:n||!1}):Ds(a,this.walletInfo.deepLink,{returnStrategy:e,forceRedirect:n||!1},()=>{})}}connectEmbeddedWallet(e,t){return A(this,null,function*(){let n=n=>{this.tracker.trackWalletSelected(e.appName,`embedded`,`auto-embedded`,t.traceId),kc(e),this.connector.connect({jsBridgeKey:e.jsBridgeKey},n,{traceId:t.traceId})},r=Z.connectRequestParameters;return r?.state===`loading`?this.connectRequestParametersCallback=n:n(r?.value),yield this.waitForWalletConnection({ignoreErrors:!1,traceId:t.traceId})})}connectExternalWallet(e){return A(this,null,function*(){let t=new AbortController;$.openWalletsModal({traceId:e.traceId});let n=this.onModalStateChange(e=>{let{status:r,closeReason:i}=e;r!==`opened`&&(n(),i===`action-cancelled`&&t.abort())});return yield this.waitForWalletConnection({ignoreErrors:!0,signal:t.signal,traceId:e.traceId})})}waitForWalletConnection(e){return A(this,null,function*(){return new Promise((t,n)=>{this.tracker.trackConnectionStarted(e.traceId);let{ignoreErrors:r=!1,signal:i=null}=e;if(i&&i.aborted)return this.tracker.trackConnectionError(`Connection was cancelled`),n(new vs(`Wallet was not connected`));let a=i=>A(this,null,function*(){if(i)this.tracker.trackConnectionCompleted(i,null,e.traceId),s(),t(i);else{if(this.tracker.trackConnectionError(`Connection was cancelled`),r)return;s(),n(new vs(`Wallet was not connected`))}}),o=e=>{this.tracker.trackConnectionError(e.message),!r&&(s(),n(e))},s=this.onStatusChange(e=>a(e),e=>o(e));i&&i.addEventListener(`abort`,()=>{s(),n(new vs(`Wallet was not connected`))},{once:!0})})})}initiateEmbeddedRequestFlow(e,t,n){return A(this,null,function*(){let r=new Ui(e),i=new AbortController;yield this.modalManager.open({traceId:n.traceId,embeddedRequest:r});let a=this.onModalStateChange(e=>{e.status!==`opened`&&(a(),e.closeReason===`action-cancelled`&&i.abort())}),o=(yield this.waitForWalletConnection({ignoreErrors:!0,signal:i.signal,traceId:n.traceId})).embeddedResponse;if(o){let{notifications:e,modals:r}=this.getModalsAndNotificationsConfiguration(n);if(!o.ok)throw $.setAction({name:fc[t],showNotification:e.includes(`error`),openModal:r.includes(`error`),traceId:n.traceId}),new vs(o.error.message||`Wallet rejected the embedded request`);return $.setAction({name:dc[t],showNotification:e.includes(`success`),openModal:r.includes(`success`),traceId:n.traceId}),{hasResponse:!0,response:o.result,traceId:n.traceId}}return{hasResponse:!1,connectResult:{dispatched:r.consumed},traceId:n.traceId}})}initiateBridgeFlow(e,t,n){return A(this,null,function*(){Di()&&bs();let{notifications:r,modals:i,returnStrategy:a,twaReturnUrl:o}=this.getModalsAndNotificationsConfiguration(n),s=yield this.getSessionId();$.setAction({name:uc[t],showNotification:r.includes(`before`),openModal:i.includes(`before`),executed:!1,sessionId:s||void 0,traceId:n.traceId,returnStrategy:a,twaReturnUrl:o});let c=new AbortController,l=()=>{var e;if(c.signal.aborted)return;$.setAction({name:uc[t],showNotification:r.includes(`before`),openModal:i.includes(`before`),executed:!0,sessionId:s||void 0,traceId:n.traceId,returnStrategy:a,twaReturnUrl:o}),this.redirectAfterRequestSent({returnStrategy:a,twaReturnUrl:o,sessionId:s||void 0,traceId:n.traceId});let l=!0;(e=n?.onRequestSent)==null||e.call(n,()=>A(this,null,function*(){if(c.signal.aborted)return;let e=!l;l=!1,yield this.redirectAfterRequestSent({returnStrategy:a,twaReturnUrl:o,forceRedirect:e,sessionId:s||void 0,traceId:n.traceId})}))},u=this.onTransactionModalStateChange(e=>{e?.openModal||(u(),e||c.abort())});try{let a=yield this.runConnectorRequestWithAbortHandling(c.signal,e.onAbort,e.sendRequestBuilder({onRequestSent:l,signal:c.signal,traceId:n.traceId}));return $.setAction({name:dc[t],showNotification:r.includes(`success`),openModal:i.includes(`success`),traceId:n.traceId}),a}catch(e){throw e instanceof Pe?($.clearAction(),$.openWalletNotSupportFeatureModal(e.cause,{traceId:n.traceId}),e):($.setAction({name:fc[t],showNotification:r.includes(`error`),openModal:i.includes(`error`),traceId:n.traceId}),e instanceof T?e:new vs(`Unhandled error:`+e))}finally{u()}})}runConnectorRequestWithAbortHandling(e,t,n){return A(this,null,function*(){return new Promise((r,i)=>{if(e.aborted)return i(t());let a=()=>{i(t())};e.addEventListener(`abort`,a,{once:!0}),n().then(t=>{e.removeEventListener(`abort`,a),r(t)}).catch(t=>{e.removeEventListener(`abort`,a),i(t)})})})}onTransactionModalStateChange(e){return this.transactionModal.onStateChange(e)}subscribeToWalletChange(){this.connector.onStatusChange(e=>A(this,null,function*(){e?(yield this.updateWalletInfo(e),this.setPreferredWalletAppName(this.walletInfo?.appName||e.device.appName)):this.walletInfoStorage.removeWalletInfo()}))}setPreferredWalletAppName(e){this.preferredWalletStorage.setPreferredWalletAppName(e),U_({preferredWalletAppName:e})}getSelectedWalletInfo(e){return A(this,null,function*(){let t=$.getSelectedWalletInfo();if(!t)return null;if(!(`name`in t)){if(e.device.appName===nv)return{type:`wallet-connect`,name:rv,appName:nv,imageUrl:av.WALLET_CONNECT,aboutUrl:iv,features:e.device.features,platforms:[]};let n=Ip(yield this.walletsList,Z.walletsListConfiguration).find(t=>Bp(t,e.device.appName));if(!n)throw new vs(`Cannot find WalletInfo for the '${e.device.appName}' wallet`);return O(O({},n),t)}return t})}updateWalletInfo(e){return A(this,null,function*(){let t=yield this.getSelectedWalletInfo(e);if(t){this.walletInfo=t,this.walletInfoStorage.setWalletInfo(t);return}let n=this.walletInfoStorage.getWalletInfo();if(n){this.walletInfo=n;return}this.walletInfo=(yield this.walletsList).find(t=>Bp(t,e.device.appName))||null})}normalizeWidgetRoot(e){if(!e||!document.getElementById(e)){e=`tc-widget-root`;let t=document.createElement(`div`);t.id=e,document.body.appendChild(t)}return e}checkButtonRootExist(e){if(e!=null&&!document.getElementById(e))throw new vs(`${e} element not found in the document.`)}getModalsAndNotificationsConfiguration(e){let t=[`before`,`success`,`error`],n=t;this.actionsConfiguration?.notifications&&this.actionsConfiguration?.notifications!==`all`&&(n=this.actionsConfiguration.notifications),e?.notifications&&(n=e.notifications===`all`?t:e.notifications);let r=[`before`];this.actionsConfiguration?.modals&&(r=this.actionsConfiguration.modals===`all`?t:this.actionsConfiguration.modals),e?.modals&&(r=e.modals===`all`?t:e.modals);let i=e?.returnStrategy||this.actionsConfiguration?.returnStrategy||`back`,a=e?.twaReturnUrl||this.actionsConfiguration?.twaReturnUrl,o=e?.skipRedirectToWallet||this.actionsConfiguration?.skipRedirectToWallet||`ios`;return Di()&&(o=`never`),{notifications:n,modals:r,returnStrategy:i,twaReturnUrl:a,skipRedirectToWallet:o}}};function Tb(e){return typeof e==`object`&&!!e&&`enableEmbeddedRequest`in e&&e.enableEmbeddedRequest===!0}var Eb=s({status:f([`opened`,`closed`])}),Db=l(Eb),Ob=(e,{runWalletEffect:t,tonConnectManifestUrl:n,walletModal:r})=>p(s=>{let l=new wb({manifestUrl:n??`https://dapp.stakek.it/tonconnect-manifest.json`}),d=null,f=null,p=!1,C=!1,te=()=>p?(p=!1,t(r.presentationOpen.set(!1))):Promise.resolve();return l.onStatusChange(e=>{f=e,e&&d?.resolve(e)}),l.onModalStateChange(e=>{let n=i(Db(e))?.status;n===`opened`&&(p=!0,t(r.presentationOpen.set(!0))),n===`closed`&&(d?.reject(),C||te())}),{...e,id:`tonconnect`,name:`TonConnect`,type:ne.type,signTransaction:e=>v(function*(){if(!f)return yield*new h({message:`No wallet connected`,operation:`ton-send-transaction`});let{message:t}=yield*c(u(ee))(e).pipe(b(e=>new h({cause:e,message:e.message,operation:`ton-decode-transaction`}))),n=yield*_({try:()=>(0,oe.loadMessageRelaxed)(oe.Cell.fromBase64(t).beginParse()),catch:e=>new h({cause:e,message:String(e),operation:`ton-decode-message`})}),r=n.info,i=yield*x,s=yield*y({try:()=>l.sendTransaction({messages:[{address:r.dest.toString(),amount:r.value.coins.toString(),payload:n.body.toBoc().toString(`base64`)}],validUntil:i+o(a(1))}),catch:e=>new h({cause:e,message:e instanceof Error?e.message:String(e),operation:`ton-send-transaction`})});return oe.Cell.fromBase64(s.boc).hash().toString(`hex`)}),connect:async e=>{s.emitter.emit(`message`,{type:`connecting`}),s.storage?.removeItem(`ton.disconnected`);let t=wn((f??await(async()=>{C=!0;try{return await l.openModal(),await new Promise((e,t)=>{d={resolve:e,reject:t}})}finally{d=null,C=!1,await te()}})()).account.address);return g(e?.withCapabilities,[t],S.id)},disconnect:async()=>{s.storage?.setItem(`ton.disconnected`,!0),await l.disconnect(),f=null},getAccounts:async()=>{if(await l.connectionRestored,!f)throw Error(`No wallet connected`);return[wn(f.account.address)]},switchChain:async()=>S,getChainId:async()=>S.id,isAuthorized:async()=>(await l.connectionRestored,!await s.storage?.getItem(`ton.disconnected`)&&!!f),...ie(s.emitter),getProvider:async()=>({}),$filteredChains:m([S])}}),kb=e=>({groupName:`Ton`,wallets:[()=>({id:`tonconnect`,name:`TonConnect`,iconUrl:d(`ton`),iconBackground:`transparent`,availability:{_tag:`Remote`},chainGroup:{id:`ton`,title:`Ton`,iconUrl:d(`ton`)},createConnector:t=>Ob(t,e)})]});export{kb as getTonConnectors};
|