@dodoex/wallet-web3 0.6.3 → 0.6.5
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/PhArrowCircleDown-4a08ae8e.js +14 -0
- package/dist/PhArrowClockwise-401ea1c0.js +14 -0
- package/dist/PhArrowDown-789ae7d2.js +14 -0
- package/dist/PhArrowLeft-2e6d4940.js +14 -0
- package/dist/PhArrowRight-2928b0dc.js +14 -0
- package/dist/PhArrowSquareOut-17d61d08.js +14 -0
- package/dist/PhArrowUp-1cfcf9df.js +14 -0
- package/dist/PhArrowUpRight-552c41cb.js +14 -0
- package/dist/PhArrowsClockwise-92a70162.js +14 -0
- package/dist/PhArrowsDownUp-ce27c8a7.js +14 -0
- package/dist/PhArrowsLeftRight-ed549dc7.js +14 -0
- package/dist/PhBank-92a1a1df.js +14 -0
- package/dist/PhBrowser-495dc3ce.js +14 -0
- package/dist/PhCaretDown-610f20fc.js +14 -0
- package/dist/PhCaretLeft-2a86ee53.js +14 -0
- package/dist/PhCaretRight-f3057f58.js +14 -0
- package/dist/PhCaretUp-7b74b8cb.js +14 -0
- package/dist/PhCheck-c514f32c.js +14 -0
- package/dist/PhCircleHalf-3bfd24c9.js +14 -0
- package/dist/PhClock-29284ead.js +14 -0
- package/dist/PhCompass-101d3241.js +14 -0
- package/dist/PhCopy-d92dcd27.js +14 -0
- package/dist/PhCreditCard-d8d77fc2.js +14 -0
- package/dist/PhCurrencyDollar-6553df79.js +14 -0
- package/dist/PhDesktop-91653c8e.js +14 -0
- package/dist/PhDeviceMobile-0f3d8fa2.js +14 -0
- package/dist/PhDotsThree-67debca2.js +14 -0
- package/dist/PhEnvelope-f83faab2.js +14 -0
- package/dist/PhFunnelSimple-5058af43.js +14 -0
- package/dist/PhGlobe-c4653621.js +14 -0
- package/dist/PhIdentificationCard-848bf9a1.js +14 -0
- package/dist/PhImage-de71fc6b.js +14 -0
- package/dist/PhInfo-9614a766.js +14 -0
- package/dist/PhLightbulb-7d582ae7.js +14 -0
- package/dist/PhMagnifyingGlass-c926bd63.js +14 -0
- package/dist/PhPaperPlaneRight-76b25832.js +14 -0
- package/dist/PhPlus-767ddc55.js +14 -0
- package/dist/PhPower-95f188dd.js +14 -0
- package/dist/PhPuzzlePiece-f016afe5.js +14 -0
- package/dist/PhQrCode-e9b7ab93.js +14 -0
- package/dist/PhQuestion-ea0e639d.js +14 -0
- package/dist/PhQuestionMark-13d6338e.js +14 -0
- package/dist/PhSealCheck-45bb7b9c.js +14 -0
- package/dist/PhSignOut-6b91c59c.js +14 -0
- package/dist/PhSpinner-eb9b7ac1.js +14 -0
- package/dist/PhTrash-758cc3b3.js +14 -0
- package/dist/PhUser-0834861d.js +14 -0
- package/dist/PhVault-e4d6f9af.js +14 -0
- package/dist/PhWallet-5e257abe.js +14 -0
- package/dist/PhWarning-6af3740e.js +14 -0
- package/dist/PhWarningCircle-a78fd8e8.js +14 -0
- package/dist/PhX-60c46532.js +14 -0
- package/dist/{__tslib-2b1b6d17.js → __tslib-6d6a586c.js} +1 -1
- package/dist/{alchemy-provider-5870b6fa-b23243a1.js → alchemy-provider-5870b6fa-a9fe5aa5.js} +1 -1
- package/dist/{alchemy-websocket-provider-213da986-559da73b.js → alchemy-websocket-provider-213da986-16164c2e.js} +1 -1
- package/dist/basic-77fe1b96.js +1320 -0
- package/dist/{blocto-8e69bccf.js → blocto-ab8ba330.js} +1 -1
- package/dist/{ccip-99b4ad16.js → ccip-e246f9cf.js} +1 -1
- package/dist/cjs/PhArrowCircleDown-df23d036.cjs +14 -0
- package/dist/cjs/PhArrowClockwise-440d23dc.cjs +14 -0
- package/dist/cjs/PhArrowDown-252590ed.cjs +14 -0
- package/dist/cjs/PhArrowLeft-d480faa4.cjs +14 -0
- package/dist/cjs/PhArrowRight-969dbdd8.cjs +14 -0
- package/dist/cjs/PhArrowSquareOut-eabfdecb.cjs +14 -0
- package/dist/cjs/PhArrowUp-66bd5f15.cjs +14 -0
- package/dist/cjs/PhArrowUpRight-6df3b31b.cjs +14 -0
- package/dist/cjs/PhArrowsClockwise-3a9d2dc6.cjs +14 -0
- package/dist/cjs/PhArrowsDownUp-47a7788f.cjs +14 -0
- package/dist/cjs/PhArrowsLeftRight-f90368dd.cjs +14 -0
- package/dist/cjs/PhBank-670a2708.cjs +14 -0
- package/dist/cjs/PhBrowser-b9c35fd1.cjs +14 -0
- package/dist/cjs/PhCaretDown-11a46455.cjs +14 -0
- package/dist/cjs/PhCaretLeft-04f11ca7.cjs +14 -0
- package/dist/cjs/PhCaretRight-391111c1.cjs +14 -0
- package/dist/cjs/PhCaretUp-b17dccf6.cjs +14 -0
- package/dist/cjs/PhCheck-08bf36b0.cjs +14 -0
- package/dist/cjs/PhCircleHalf-0a9eac35.cjs +14 -0
- package/dist/cjs/PhClock-cf1cc2cb.cjs +14 -0
- package/dist/cjs/PhCompass-e9671b30.cjs +14 -0
- package/dist/cjs/PhCopy-9132cbc5.cjs +14 -0
- package/dist/cjs/PhCreditCard-853e1556.cjs +14 -0
- package/dist/cjs/PhCurrencyDollar-34eea829.cjs +14 -0
- package/dist/cjs/PhDesktop-c02b883b.cjs +14 -0
- package/dist/cjs/PhDeviceMobile-93c2088c.cjs +14 -0
- package/dist/cjs/PhDotsThree-69beaba7.cjs +14 -0
- package/dist/cjs/PhEnvelope-86ee730e.cjs +14 -0
- package/dist/cjs/PhFunnelSimple-056c2f76.cjs +14 -0
- package/dist/cjs/PhGlobe-64c4ee8e.cjs +14 -0
- package/dist/cjs/PhIdentificationCard-ec7a98e0.cjs +14 -0
- package/dist/cjs/PhImage-07904cbb.cjs +14 -0
- package/dist/cjs/PhInfo-34eeeace.cjs +14 -0
- package/dist/cjs/PhLightbulb-39ebe854.cjs +14 -0
- package/dist/cjs/PhMagnifyingGlass-2fbe4400.cjs +14 -0
- package/dist/cjs/PhPaperPlaneRight-e06c210f.cjs +14 -0
- package/dist/cjs/PhPlus-03a04ed3.cjs +14 -0
- package/dist/cjs/PhPower-4cc2ecb8.cjs +14 -0
- package/dist/cjs/PhPuzzlePiece-035d561e.cjs +14 -0
- package/dist/cjs/PhQrCode-37e23b36.cjs +14 -0
- package/dist/cjs/PhQuestion-bfba435e.cjs +14 -0
- package/dist/cjs/PhQuestionMark-8ef38ecf.cjs +14 -0
- package/dist/cjs/PhSealCheck-5458de15.cjs +14 -0
- package/dist/cjs/PhSignOut-2d177ea1.cjs +14 -0
- package/dist/cjs/PhSpinner-e7c590df.cjs +14 -0
- package/dist/cjs/PhTrash-1920f5dc.cjs +14 -0
- package/dist/cjs/PhUser-84a1a685.cjs +14 -0
- package/dist/cjs/PhVault-1493c03f.cjs +14 -0
- package/dist/cjs/PhWallet-f0502f03.cjs +14 -0
- package/dist/cjs/PhWarning-1bf637ba.cjs +14 -0
- package/dist/cjs/PhWarningCircle-b1747661.cjs +14 -0
- package/dist/cjs/PhX-f864d86c.cjs +14 -0
- package/dist/cjs/{__tslib-91c50e46.cjs → __tslib-a9f27ba6.cjs} +1 -1
- package/dist/cjs/{alchemy-provider-5870b6fa-a824dbf0.cjs → alchemy-provider-5870b6fa-bb1c607e.cjs} +1 -1
- package/dist/cjs/{alchemy-websocket-provider-213da986-f96378c8.cjs → alchemy-websocket-provider-213da986-521569b5.cjs} +1 -1
- package/dist/cjs/basic-b777d2b1.cjs +1320 -0
- package/dist/cjs/{blocto-255deb25.cjs → blocto-09e0d574.cjs} +1 -1
- package/dist/cjs/{ccip-58f4c3ce.cjs → ccip-6ebee1cf.cjs} +1 -1
- package/dist/cjs/core-78a709db.cjs +210 -0
- package/dist/cjs/{draggabilly-b00ba129.cjs → draggabilly-76af6217.cjs} +1 -1
- package/dist/cjs/features-fa5c5622.cjs +1 -0
- package/dist/cjs/id-c0538166.cjs +1 -0
- package/dist/cjs/{index-4cb4044e.cjs → index-07e81389.cjs} +1 -1
- package/dist/cjs/{index-28fe8dc2.cjs → index-093cef5a.cjs} +2 -2
- package/dist/cjs/{index-0f3e4a4a.cjs → index-208df3f3.cjs} +1 -1
- package/dist/cjs/{index-9cbeb66d.cjs → index-253e7cce.cjs} +1 -1
- package/dist/cjs/index-2e8e7a50.cjs +4 -0
- package/dist/cjs/index-395b933d.cjs +2 -0
- package/dist/cjs/{index-b0eb86b6.cjs → index-54d7fc75.cjs} +1 -1
- package/dist/cjs/{index-5d1879f6.cjs → index-5d28acf4.cjs} +3 -3
- package/dist/cjs/{index-02043814.cjs → index-5dac528b.cjs} +4 -4
- package/dist/cjs/index-702e8f89.cjs +15 -0
- package/dist/cjs/{index-7d213984.cjs → index-823e17e6.cjs} +1 -1
- package/dist/cjs/{index-2c339ec0.cjs → index-916994aa.cjs} +1 -1
- package/dist/cjs/{index-96c22872.cjs → index-a2b665f4.cjs} +1 -1
- package/dist/cjs/{index-110f55af.cjs → index-b099293c.cjs} +1 -1
- package/dist/cjs/index-d72ddbc1.cjs +17 -0
- package/dist/cjs/index-ef4ef0cc.cjs +1449 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{interface-a67cd05c.cjs → interface-4947cfa6.cjs} +1 -1
- package/dist/cjs/lib-typedarrays-a9baf142.cjs +1 -0
- package/dist/cjs/native-55bb141d.cjs +1 -0
- package/dist/cjs/{portis-ec737dc5.cjs → portis-08d9d731.cjs} +1 -1
- package/dist/cjs/property-29e6f732.cjs +29 -0
- package/dist/cjs/providers/connector/safeGnosis/query.d.ts +2 -1
- package/dist/cjs/providers/connector/types.d.ts +1 -1
- package/dist/cjs/providers/wallets/index.d.ts +1 -0
- package/dist/cjs/rainbow-6e84bcfa.cjs +1 -0
- package/dist/cjs/sha224-b46bc3e6.cjs +1 -0
- package/dist/cjs/sha256-ccd47519.cjs +1 -0
- package/dist/cjs/{typed-data-65a82f1e.cjs → typed-data-5176b792.cjs} +1 -1
- package/dist/cjs/uAuth-b29d2670.cjs +1 -0
- package/dist/cjs/w3m-modal-70bcf6d8.cjs +2380 -0
- package/dist/cjs/walletConnect-20d477a9.cjs +1 -0
- package/dist/cjs/{walletLink-095edc5f.cjs → walletLink-08b8da20.cjs} +2 -2
- package/dist/core-4d7ad6f2.js +210 -0
- package/dist/{draggabilly-919fe798.js → draggabilly-daf3b444.js} +1 -1
- package/dist/features-d8d1c9ce.js +1 -0
- package/dist/id-d4d22b29.js +1 -0
- package/dist/{index-de7476e4.js → index-09298bd0.js} +7 -7
- package/dist/{index-085a063c.js → index-244a8189.js} +1 -1
- package/dist/{index-23ae718c.js → index-2ad0fb2a.js} +1 -1
- package/dist/index-35d87b79.js +17 -0
- package/dist/{index-bbaf7a43.js → index-587ff998.js} +1 -1
- package/dist/{index-601a6250.js → index-750a7dfe.js} +1 -1
- package/dist/{index-cc764016.js → index-8bd12de1.js} +1 -1
- package/dist/{index-6382b40b.js → index-938686fb.js} +1 -1
- package/dist/{index-3cf73206.js → index-9d7fee1e.js} +2 -2
- package/dist/{index-fd3058aa.js → index-aa744ca0.js} +1 -1
- package/dist/{index-7fabb817.js → index-b7d25e8a.js} +3 -3
- package/dist/index-bb1a0019.js +15 -0
- package/dist/index-c5ca8a4e.js +4 -0
- package/dist/{index-f5d95949.js → index-cddbc8e8.js} +1 -1
- package/dist/index-f095c09e.js +2 -0
- package/dist/index-ffdf981b.js +1449 -0
- package/dist/index.js +1 -1
- package/dist/{interface-82bdcddb.js → interface-0c535796.js} +1 -1
- package/dist/lib-typedarrays-979d2723.js +1 -0
- package/dist/native-029c50f7.js +1 -0
- package/dist/{portis-0a2bd95e.js → portis-9602ac9f.js} +1 -1
- package/dist/property-8eb37909.js +35 -0
- package/dist/providers/connector/safeGnosis/query.d.ts +2 -1
- package/dist/providers/connector/types.d.ts +1 -1
- package/dist/providers/wallets/index.d.ts +1 -0
- package/dist/rainbow-ccab7a95.js +1 -0
- package/dist/sha224-fe98e1bf.js +1 -0
- package/dist/sha256-5a24dfd5.js +1 -0
- package/dist/{typed-data-83d7ae9a.js → typed-data-3a3d44dc.js} +1 -1
- package/dist/uAuth-27f5728d.js +1 -0
- package/dist/w3m-modal-49add722.js +2380 -0
- package/dist/walletConnect-a541881e.js +1 -0
- package/dist/{walletLink-1b3cb067.js → walletLink-67264328.js} +2 -2
- package/package.json +5 -5
- package/dist/_commonjs-dynamic-modules-7cfc9805.js +0 -1
- package/dist/cjs/_commonjs-dynamic-modules-f09a98c7.cjs +0 -1
- package/dist/cjs/id-0c26cee0.cjs +0 -1
- package/dist/cjs/index-21f86827.cjs +0 -17
- package/dist/cjs/index-35edc6a0.cjs +0 -60
- package/dist/cjs/index-568647cf.cjs +0 -15
- package/dist/cjs/index-9f2a69d5.cjs +0 -1
- package/dist/cjs/index.es-2a36620f.cjs +0 -9
- package/dist/cjs/lib-typedarrays-f921c603.cjs +0 -1
- package/dist/cjs/rainbow-322fb6a9.cjs +0 -1
- package/dist/cjs/sha224-f0657d8a.cjs +0 -1
- package/dist/cjs/sha256-a0c6063a.cjs +0 -1
- package/dist/cjs/uAuth-d389b45d.cjs +0 -1
- package/dist/cjs/walletConnect-3c32ceb8.cjs +0 -1
- package/dist/id-bc1ef47c.js +0 -1
- package/dist/index-24d19ee3.js +0 -15
- package/dist/index-65d96278.js +0 -60
- package/dist/index-e4c02dc7.js +0 -17
- package/dist/index-f08d6a6b.js +0 -1
- package/dist/index.es-474ba2f2.js +0 -9
- package/dist/lib-typedarrays-becaa8ad.js +0 -1
- package/dist/rainbow-aa24fa3b.js +0 -1
- package/dist/sha224-e9d5a920.js +0 -1
- package/dist/sha256-65d6895c.js +0 -1
- package/dist/uAuth-8aef513a.js +0 -1
- package/dist/walletConnect-f12ca9e1.js +0 -1
|
@@ -0,0 +1,1320 @@
|
|
|
1
|
+
"use strict";var e=require("./core-78a709db.cjs"),t=require("./index-ef4ef0cc.cjs");require("events"),require("./index-2e8e7a50.cjs"),require("./__tslib-a9f27ba6.cjs"),require("./index-5dac528b.cjs"),require("@ethersproject/providers"),require("zustand"),require("@ethersproject/bytes"),require("@ethersproject/properties"),require("@ethersproject/address"),require("@ethersproject/abstract-signer"),require("buffer"),require("@ethersproject/abstract-provider"),require("@ethersproject/contracts"),require("@ethersproject/constants"),require("@ethersproject/transactions");var o=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let n=class extends e.i{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=e.ConnectorController.state.connectors,this.count=e.ApiController.state.count,this.filteredCount=e.ApiController.state.filteredWallets.length,this.isFetchingRecommendedWallets=e.ApiController.state.isFetchingRecommendedWallets,this.unsubscribe.push(e.ConnectorController.subscribeKey("connectors",(e=>this.connectors=e)),e.ApiController.subscribeKey("count",(e=>this.count=e)),e.ApiController.subscribeKey("filteredWallets",(e=>this.filteredCount=e.length)),e.ApiController.subscribeKey("isFetchingRecommendedWallets",(e=>this.isFetchingRecommendedWallets=e)))}disconnectedCallback(){this.unsubscribe.forEach((e=>e()))}render(){const o=this.connectors.find((e=>"walletConnect"===e.id)),{allWallets:n}=e.OptionsController.state;if(!o||"HIDE"===n)return null;if("ONLY_MOBILE"===n&&!e.CoreHelperUtil.isMobile())return null;const r=e.ApiController.state.featured.length,i=this.count+r,s=i<10?i:10*Math.floor(i/10),a=this.filteredCount>0?this.filteredCount:s;let l=`${a}`;this.filteredCount>0?l=`${this.filteredCount}`:a<i&&(l=`${a}+`);const c=e.ConnectionController.hasAnyConnection(e.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT);return e.b`
|
|
2
|
+
<wui-list-wallet
|
|
3
|
+
name="Search Wallet"
|
|
4
|
+
walletIcon="search"
|
|
5
|
+
showAllWallets
|
|
6
|
+
@click=${this.onAllWallets.bind(this)}
|
|
7
|
+
tagLabel=${l}
|
|
8
|
+
tagVariant="info"
|
|
9
|
+
data-testid="all-wallets"
|
|
10
|
+
tabIdx=${t.o(this.tabIdx)}
|
|
11
|
+
.loading=${this.isFetchingRecommendedWallets}
|
|
12
|
+
?disabled=${c}
|
|
13
|
+
size="sm"
|
|
14
|
+
></wui-list-wallet>
|
|
15
|
+
`}onAllWallets(){e.EventsController.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),e.RouterController.push("AllWallets",{redirectView:e.RouterController.state.data?.redirectView})}};o([t.n()],n.prototype,"tabIdx",void 0),o([t.r()],n.prototype,"connectors",void 0),o([t.r()],n.prototype,"count",void 0),o([t.r()],n.prototype,"filteredCount",void 0),o([t.r()],n.prototype,"isFetchingRecommendedWallets",void 0),n=o([t.customElement("w3m-all-wallets-widget")],n);var r=e.css`
|
|
16
|
+
:host {
|
|
17
|
+
margin-top: ${({spacing:e})=>e[1]};
|
|
18
|
+
}
|
|
19
|
+
wui-separator {
|
|
20
|
+
margin: ${({spacing:e})=>e[3]} calc(${({spacing:e})=>e[3]} * -1)
|
|
21
|
+
${({spacing:e})=>e[2]} calc(${({spacing:e})=>e[3]} * -1);
|
|
22
|
+
width: calc(100% + ${({spacing:e})=>e[3]} * 2);
|
|
23
|
+
}
|
|
24
|
+
`,i=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let s=class extends e.i{constructor(){super(),this.unsubscribe=[],this.explorerWallets=e.ApiController.state.explorerWallets,this.connections=e.ConnectionController.state.connections,this.connectorImages=e.AssetController.state.connectorImages,this.loadingTelegram=!1,this.unsubscribe.push(e.ConnectionController.subscribeKey("connections",(e=>this.connections=e)),e.AssetController.subscribeKey("connectorImages",(e=>this.connectorImages=e)),e.ApiController.subscribeKey("explorerFilteredWallets",(t=>{this.explorerWallets=t?.length?t:e.ApiController.state.explorerWallets})),e.ApiController.subscribeKey("explorerWallets",(e=>{this.explorerWallets?.length||(this.explorerWallets=e)}))),e.CoreHelperUtil.isTelegram()&&e.CoreHelperUtil.isIos()&&(this.loadingTelegram=!e.ConnectionController.state.wcUri,this.unsubscribe.push(e.ConnectionController.subscribeKey("wcUri",(e=>this.loadingTelegram=!e))))}disconnectedCallback(){this.unsubscribe.forEach((e=>e()))}render(){return e.b`
|
|
25
|
+
<wui-flex flexDirection="column" gap="2"> ${this.connectorListTemplate()} </wui-flex>
|
|
26
|
+
`}connectorListTemplate(){return e.ConnectorUtil.connectorList().map(((e,t)=>"connector"===e.kind?this.renderConnector(e,t):this.renderWallet(e,t)))}getConnectorNamespaces(e){return"walletConnect"===e.subtype?[]:"multiChain"===e.subtype?e.connector.connectors?.map((e=>e.chain))||[]:[e.connector.chain]}renderConnector(o,n){const r=o.connector,i=e.AssetUtil.getConnectorImage(r)||this.connectorImages[r?.imageId??""],s=(this.connections.get(r.chain)??[]).some((t=>e.HelpersUtil.isLowerCaseMatch(t.connectorId,r.id)));let a,l;"walletConnect"===o.subtype?(a="qr code",l="accent"):"injected"===o.subtype||"announced"===o.subtype?(a=s?"connected":"installed",l=s?"info":"success"):(a=void 0,l=void 0);const c=e.ConnectionController.hasAnyConnection(e.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT),d=("walletConnect"===o.subtype||"external"===o.subtype)&&c;return e.b`
|
|
27
|
+
<w3m-list-wallet
|
|
28
|
+
displayIndex=${n}
|
|
29
|
+
imageSrc=${t.o(i)}
|
|
30
|
+
.installed=${!0}
|
|
31
|
+
name=${r.name??"Unknown"}
|
|
32
|
+
.tagVariant=${l}
|
|
33
|
+
tagLabel=${t.o(a)}
|
|
34
|
+
data-testid=${`wallet-selector-${r.id.toLowerCase()}`}
|
|
35
|
+
size="sm"
|
|
36
|
+
@click=${()=>this.onClickConnector(o)}
|
|
37
|
+
tabIdx=${t.o(this.tabIdx)}
|
|
38
|
+
?disabled=${d}
|
|
39
|
+
rdnsId=${t.o(r.explorerWallet?.rdns||void 0)}
|
|
40
|
+
walletRank=${t.o(r.explorerWallet?.order)}
|
|
41
|
+
.namespaces=${this.getConnectorNamespaces(o)}
|
|
42
|
+
>
|
|
43
|
+
</w3m-list-wallet>
|
|
44
|
+
`}onClickConnector(t){const o=e.RouterController.state.data?.redirectView;return"walletConnect"===t.subtype?(e.ConnectorController.setActiveConnector(t.connector),void(e.CoreHelperUtil.isMobile()?e.RouterController.push("AllWallets"):e.RouterController.push("ConnectingWalletConnect",{redirectView:o}))):"multiChain"===t.subtype?(e.ConnectorController.setActiveConnector(t.connector),void e.RouterController.push("ConnectingMultiChain",{redirectView:o})):"injected"===t.subtype?(e.ConnectorController.setActiveConnector(t.connector),void e.RouterController.push("ConnectingExternal",{connector:t.connector,redirectView:o,wallet:t.connector.explorerWallet})):"announced"===t.subtype?"walletConnect"===t.connector.id?void(e.CoreHelperUtil.isMobile()?e.RouterController.push("AllWallets"):e.RouterController.push("ConnectingWalletConnect",{redirectView:o})):void e.RouterController.push("ConnectingExternal",{connector:t.connector,redirectView:o,wallet:t.connector.explorerWallet}):void e.RouterController.push("ConnectingExternal",{connector:t.connector,redirectView:o})}renderWallet(o,n){const r=o.wallet,i=e.AssetUtil.getWalletImage(r),s=e.ConnectionController.hasAnyConnection(e.ConstantsUtil.CONNECTOR_ID.WALLET_CONNECT),a=this.loadingTelegram,l="recent"===o.subtype?"recent":void 0,c="recent"===o.subtype?"info":void 0;return e.b`
|
|
45
|
+
<w3m-list-wallet
|
|
46
|
+
displayIndex=${n}
|
|
47
|
+
imageSrc=${t.o(i)}
|
|
48
|
+
name=${r.name??"Unknown"}
|
|
49
|
+
@click=${()=>this.onClickWallet(o)}
|
|
50
|
+
size="sm"
|
|
51
|
+
data-testid=${`wallet-selector-${r.id}`}
|
|
52
|
+
tabIdx=${t.o(this.tabIdx)}
|
|
53
|
+
?loading=${a}
|
|
54
|
+
?disabled=${s}
|
|
55
|
+
rdnsId=${t.o(r.rdns||void 0)}
|
|
56
|
+
walletRank=${t.o(r.order)}
|
|
57
|
+
tagLabel=${t.o(l)}
|
|
58
|
+
.tagVariant=${c}
|
|
59
|
+
>
|
|
60
|
+
</w3m-list-wallet>
|
|
61
|
+
`}onClickWallet(t){const o=e.RouterController.state.data?.redirectView,n=e.ChainController.state.activeChain;if("featured"===t.subtype)return void e.ConnectorController.selectWalletConnector(t.wallet);if("recent"===t.subtype){if(this.loadingTelegram)return;return void e.ConnectorController.selectWalletConnector(t.wallet)}if("custom"===t.subtype){if(this.loadingTelegram)return;return void e.RouterController.push("ConnectingWalletConnect",{wallet:t.wallet,redirectView:o})}if(this.loadingTelegram)return;const r=n?e.ConnectorController.getConnector({id:t.wallet.id,namespace:n}):void 0;r?e.RouterController.push("ConnectingExternal",{connector:r,redirectView:o}):e.RouterController.push("ConnectingWalletConnect",{wallet:t.wallet,redirectView:o})}};s.styles=r,i([t.n({type:Number})],s.prototype,"tabIdx",void 0),i([t.r()],s.prototype,"explorerWallets",void 0),i([t.r()],s.prototype,"connections",void 0),i([t.r()],s.prototype,"connectorImages",void 0),i([t.r()],s.prototype,"loadingTelegram",void 0),s=i([t.customElement("w3m-connector-list")],s);var a=e.css`
|
|
62
|
+
:host {
|
|
63
|
+
flex: 1;
|
|
64
|
+
height: 100%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
button {
|
|
68
|
+
width: 100%;
|
|
69
|
+
height: 100%;
|
|
70
|
+
display: inline-flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]};
|
|
73
|
+
column-gap: ${({spacing:e})=>e[1]};
|
|
74
|
+
color: ${({tokens:e})=>e.theme.textSecondary};
|
|
75
|
+
border-radius: ${({borderRadius:e})=>e[20]};
|
|
76
|
+
background-color: transparent;
|
|
77
|
+
transition: background-color ${({durations:e})=>e.lg}
|
|
78
|
+
${({easings:e})=>e["ease-out-power-2"]};
|
|
79
|
+
will-change: background-color;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* -- Hover & Active states ----------------------------------------------------------- */
|
|
83
|
+
button[data-active='true'] {
|
|
84
|
+
color: ${({tokens:e})=>e.theme.textPrimary};
|
|
85
|
+
background-color: ${({tokens:e})=>e.theme.foregroundTertiary};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
button:hover:enabled:not([data-active='true']),
|
|
89
|
+
button:active:enabled:not([data-active='true']) {
|
|
90
|
+
wui-text,
|
|
91
|
+
wui-icon {
|
|
92
|
+
color: ${({tokens:e})=>e.theme.textPrimary};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`,l=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};const c={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},d={lg:"md",md:"sm",sm:"sm"};let u=class extends e.i{constructor(){super(...arguments),this.icon="mobile",this.size="md",this.label="",this.active=!1}render(){return e.b`
|
|
96
|
+
<button data-active=${this.active}>
|
|
97
|
+
${this.icon?e.b`<wui-icon size=${d[this.size]} name=${this.icon}></wui-icon>`:""}
|
|
98
|
+
<wui-text variant=${c[this.size]}> ${this.label} </wui-text>
|
|
99
|
+
</button>
|
|
100
|
+
`}};u.styles=[e.resetStyles,e.elementStyles,a],l([t.n()],u.prototype,"icon",void 0),l([t.n()],u.prototype,"size",void 0),l([t.n()],u.prototype,"label",void 0),l([t.n({type:Boolean})],u.prototype,"active",void 0),u=l([t.customElement("wui-tab-item")],u);var h=e.css`
|
|
101
|
+
:host {
|
|
102
|
+
display: inline-flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
|
|
105
|
+
border-radius: ${({borderRadius:e})=>e[32]};
|
|
106
|
+
padding: ${({spacing:e})=>e["01"]};
|
|
107
|
+
box-sizing: border-box;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
:host([data-size='sm']) {
|
|
111
|
+
height: 26px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:host([data-size='md']) {
|
|
115
|
+
height: 36px;
|
|
116
|
+
}
|
|
117
|
+
`,p=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let g=class extends e.i{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.size="md",this.activeTab=0}render(){return this.dataset.size=this.size,this.tabs.map(((t,o)=>{const n=o===this.activeTab;return e.b`
|
|
118
|
+
<wui-tab-item
|
|
119
|
+
@click=${()=>this.onTabClick(o)}
|
|
120
|
+
icon=${t.icon}
|
|
121
|
+
size=${this.size}
|
|
122
|
+
label=${t.label}
|
|
123
|
+
?active=${n}
|
|
124
|
+
data-active=${n}
|
|
125
|
+
data-testid="tab-${t.label?.toLowerCase()}"
|
|
126
|
+
></wui-tab-item>
|
|
127
|
+
`}))}onTabClick(e){this.activeTab=e,this.onTabChange(e)}};g.styles=[e.resetStyles,e.elementStyles,h],p([t.n({type:Array})],g.prototype,"tabs",void 0),p([t.n()],g.prototype,"onTabChange",void 0),p([t.n()],g.prototype,"size",void 0),p([t.r()],g.prototype,"activeTab",void 0),g=p([t.customElement("wui-tabs")],g);var f=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let w=class extends e.i{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach((e=>e()))}render(){const t=this.generateTabs();return e.b`
|
|
128
|
+
<wui-flex justifyContent="center" .padding=${["0","0","4","0"]}>
|
|
129
|
+
<wui-tabs .tabs=${t} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs>
|
|
130
|
+
</wui-flex>
|
|
131
|
+
`}generateTabs(){const e=this.platforms.map((e=>"browser"===e?{label:"Browser",icon:"extension",platform:"browser"}:"mobile"===e?{label:"Mobile",icon:"mobile",platform:"mobile"}:"qrcode"===e?{label:"Mobile",icon:"mobile",platform:"qrcode"}:"web"===e?{label:"Webapp",icon:"browser",platform:"web"}:"desktop"===e?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"}));return this.platformTabs=e.map((({platform:e})=>e)),e}onTabChange(e){const t=this.platformTabs[e];t&&this.onSelectPlatfrom?.(t)}};f([t.n({type:Array})],w.prototype,"platforms",void 0),f([t.n()],w.prototype,"onSelectPlatfrom",void 0),w=f([t.customElement("w3m-connecting-header")],w);var m=e.css`
|
|
132
|
+
:host {
|
|
133
|
+
display: block;
|
|
134
|
+
width: 100px;
|
|
135
|
+
height: 100px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
svg {
|
|
139
|
+
width: 100px;
|
|
140
|
+
height: 100px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
rect {
|
|
144
|
+
fill: none;
|
|
145
|
+
stroke: ${e=>e.colors.accent100};
|
|
146
|
+
stroke-width: 3px;
|
|
147
|
+
stroke-linecap: round;
|
|
148
|
+
animation: dash 1s linear infinite;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@keyframes dash {
|
|
152
|
+
to {
|
|
153
|
+
stroke-dashoffset: 0px;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
`,b=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let y=class extends e.i{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){const t=this.radius>50?50:this.radius,o=36-t,n=116+o,r=245+o,i=360+1.75*o;return e.b`
|
|
157
|
+
<svg viewBox="0 0 110 110" width="110" height="110">
|
|
158
|
+
<rect
|
|
159
|
+
x="2"
|
|
160
|
+
y="2"
|
|
161
|
+
width="106"
|
|
162
|
+
height="106"
|
|
163
|
+
rx=${t}
|
|
164
|
+
stroke-dasharray="${n} ${r}"
|
|
165
|
+
stroke-dashoffset=${i}
|
|
166
|
+
/>
|
|
167
|
+
</svg>
|
|
168
|
+
`}};y.styles=[e.resetStyles,m],b([t.n({type:Number})],y.prototype,"radius",void 0),y=b([t.customElement("wui-loading-thumbnail")],y);var v=e.css`
|
|
169
|
+
wui-flex {
|
|
170
|
+
width: 100%;
|
|
171
|
+
height: 52px;
|
|
172
|
+
box-sizing: border-box;
|
|
173
|
+
background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
174
|
+
border-radius: ${({borderRadius:e})=>e[5]};
|
|
175
|
+
padding-left: ${({spacing:e})=>e[3]};
|
|
176
|
+
padding-right: ${({spacing:e})=>e[3]};
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
justify-content: space-between;
|
|
180
|
+
gap: ${({spacing:e})=>e[6]};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
wui-text {
|
|
184
|
+
color: ${({tokens:e})=>e.theme.textSecondary};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
wui-icon {
|
|
188
|
+
width: 12px;
|
|
189
|
+
height: 12px;
|
|
190
|
+
}
|
|
191
|
+
`,C=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let x=class extends e.i{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return e.b`
|
|
192
|
+
<wui-flex justifyContent="space-between" alignItems="center">
|
|
193
|
+
<wui-text variant="lg-regular" color="inherit">${this.label}</wui-text>
|
|
194
|
+
<wui-button variant="accent-secondary" size="sm">
|
|
195
|
+
${this.buttonLabel}
|
|
196
|
+
<wui-icon name="chevronRight" color="inherit" size="inherit" slot="iconRight"></wui-icon>
|
|
197
|
+
</wui-button>
|
|
198
|
+
</wui-flex>
|
|
199
|
+
`}};x.styles=[e.resetStyles,e.elementStyles,v],C([t.n({type:Boolean})],x.prototype,"disabled",void 0),C([t.n()],x.prototype,"label",void 0),C([t.n()],x.prototype,"buttonLabel",void 0),x=C([t.customElement("wui-cta-button")],x);var $=e.css`
|
|
200
|
+
:host {
|
|
201
|
+
display: block;
|
|
202
|
+
padding: 0 ${({spacing:e})=>e[5]} ${({spacing:e})=>e[5]};
|
|
203
|
+
}
|
|
204
|
+
`,k=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let E=class extends e.i{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:o,app_store:n,play_store:r,chrome_store:i,homepage:s}=this.wallet,a=e.CoreHelperUtil.isMobile(),l=e.CoreHelperUtil.isIos(),c=e.CoreHelperUtil.isAndroid(),d=[n,r,s,i].filter(Boolean).length>1,u=t.UiHelperUtil.getTruncateString({string:o,charsStart:12,charsEnd:0,truncate:"end"});return d&&!a?e.b`
|
|
205
|
+
<wui-cta-button
|
|
206
|
+
label=${`Don't have ${u}?`}
|
|
207
|
+
buttonLabel="Get"
|
|
208
|
+
@click=${()=>e.RouterController.push("Downloads",{wallet:this.wallet})}
|
|
209
|
+
></wui-cta-button>
|
|
210
|
+
`:!d&&s?e.b`
|
|
211
|
+
<wui-cta-button
|
|
212
|
+
label=${`Don't have ${u}?`}
|
|
213
|
+
buttonLabel="Get"
|
|
214
|
+
@click=${this.onHomePage.bind(this)}
|
|
215
|
+
></wui-cta-button>
|
|
216
|
+
`:n&&l?e.b`
|
|
217
|
+
<wui-cta-button
|
|
218
|
+
label=${`Don't have ${u}?`}
|
|
219
|
+
buttonLabel="Get"
|
|
220
|
+
@click=${this.onAppStore.bind(this)}
|
|
221
|
+
></wui-cta-button>
|
|
222
|
+
`:r&&c?e.b`
|
|
223
|
+
<wui-cta-button
|
|
224
|
+
label=${`Don't have ${u}?`}
|
|
225
|
+
buttonLabel="Get"
|
|
226
|
+
@click=${this.onPlayStore.bind(this)}
|
|
227
|
+
></wui-cta-button>
|
|
228
|
+
`:(this.style.display="none",null)}onAppStore(){this.wallet?.app_store&&e.CoreHelperUtil.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&e.CoreHelperUtil.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&e.CoreHelperUtil.openHref(this.wallet.homepage,"_blank")}};E.styles=[$],k([t.n({type:Object})],E.prototype,"wallet",void 0),E=k([t.customElement("w3m-mobile-download-links")],E);var R=e.css`
|
|
229
|
+
@keyframes shake {
|
|
230
|
+
0% {
|
|
231
|
+
transform: translateX(0);
|
|
232
|
+
}
|
|
233
|
+
25% {
|
|
234
|
+
transform: translateX(3px);
|
|
235
|
+
}
|
|
236
|
+
50% {
|
|
237
|
+
transform: translateX(-3px);
|
|
238
|
+
}
|
|
239
|
+
75% {
|
|
240
|
+
transform: translateX(3px);
|
|
241
|
+
}
|
|
242
|
+
100% {
|
|
243
|
+
transform: translateX(0);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
wui-flex:first-child:not(:only-child) {
|
|
248
|
+
position: relative;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
wui-wallet-image {
|
|
252
|
+
width: 56px;
|
|
253
|
+
height: 56px;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
wui-loading-thumbnail {
|
|
257
|
+
position: absolute;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
wui-icon-box {
|
|
261
|
+
position: absolute;
|
|
262
|
+
right: calc(${({spacing:e})=>e[1]} * -1);
|
|
263
|
+
bottom: calc(${({spacing:e})=>e[1]} * -1);
|
|
264
|
+
opacity: 0;
|
|
265
|
+
transform: scale(0.5);
|
|
266
|
+
transition-property: opacity, transform;
|
|
267
|
+
transition-duration: ${({durations:e})=>e.lg};
|
|
268
|
+
transition-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
|
|
269
|
+
will-change: opacity, transform;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
wui-text[align='center'] {
|
|
273
|
+
width: 100%;
|
|
274
|
+
padding: 0px ${({spacing:e})=>e[4]};
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
[data-error='true'] wui-icon-box {
|
|
278
|
+
opacity: 1;
|
|
279
|
+
transform: scale(1);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
[data-error='true'] > wui-flex:first-child {
|
|
283
|
+
animation: shake 250ms ${({easings:e})=>e["ease-out-power-2"]} both;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
[data-retry='false'] wui-link {
|
|
287
|
+
display: none;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
[data-retry='true'] wui-link {
|
|
291
|
+
display: block;
|
|
292
|
+
opacity: 1;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
w3m-mobile-download-links {
|
|
296
|
+
padding: 0px;
|
|
297
|
+
width: 100%;
|
|
298
|
+
}
|
|
299
|
+
`,A=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};class S extends e.i{constructor(){super(),this.wallet=e.RouterController.state.data?.wallet,this.connector=e.RouterController.state.data?.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=e.AssetUtil.getConnectorImage(this.connector)??e.AssetUtil.getWalletImage(this.wallet),this.name=this.wallet?.name??this.connector?.name??"Wallet",this.isRetrying=!1,this.uri=e.ConnectionController.state.wcUri,this.error=e.ConnectionController.state.wcError,this.ready=!1,this.showRetry=!1,this.label=void 0,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.isLoading=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(e.ConnectionController.subscribeKey("wcUri",(e=>{this.uri=e,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,this.onConnect?.())})),e.ConnectionController.subscribeKey("wcError",(e=>this.error=e))),(e.CoreHelperUtil.isTelegram()||e.CoreHelperUtil.isSafari())&&e.CoreHelperUtil.isIos()&&e.ConnectionController.state.wcUri&&this.onConnect?.()}firstUpdated(){this.onAutoConnect?.(),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach((e=>e())),e.ConnectionController.setWcError(!1),clearTimeout(this.timeout)}render(){this.onRender?.(),this.onShowRetry();const o=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let n="";return this.label?n=this.label:(n=`Continue in ${this.name}`,this.error&&(n="Connection declined")),e.b`
|
|
300
|
+
<wui-flex
|
|
301
|
+
data-error=${t.o(this.error)}
|
|
302
|
+
data-retry=${this.showRetry}
|
|
303
|
+
flexDirection="column"
|
|
304
|
+
alignItems="center"
|
|
305
|
+
.padding=${["10","5","5","5"]}
|
|
306
|
+
gap="6"
|
|
307
|
+
>
|
|
308
|
+
<wui-flex gap="2" justifyContent="center" alignItems="center">
|
|
309
|
+
<wui-wallet-image size="lg" imageSrc=${t.o(this.imageSrc)}></wui-wallet-image>
|
|
310
|
+
|
|
311
|
+
${this.error?null:this.loaderTemplate()}
|
|
312
|
+
|
|
313
|
+
<wui-icon-box
|
|
314
|
+
color="error"
|
|
315
|
+
icon="close"
|
|
316
|
+
size="sm"
|
|
317
|
+
border
|
|
318
|
+
borderColor="wui-color-bg-125"
|
|
319
|
+
></wui-icon-box>
|
|
320
|
+
</wui-flex>
|
|
321
|
+
|
|
322
|
+
<wui-flex flexDirection="column" alignItems="center" gap="6"> <wui-flex
|
|
323
|
+
flexDirection="column"
|
|
324
|
+
alignItems="center"
|
|
325
|
+
gap="2"
|
|
326
|
+
.padding=${["2","0","0","0"]}
|
|
327
|
+
>
|
|
328
|
+
<wui-text align="center" variant="lg-medium" color=${this.error?"error":"primary"}>
|
|
329
|
+
${n}
|
|
330
|
+
</wui-text>
|
|
331
|
+
<wui-text align="center" variant="lg-regular" color="secondary">${o}</wui-text>
|
|
332
|
+
</wui-flex>
|
|
333
|
+
|
|
334
|
+
${this.secondaryBtnLabel?e.b`
|
|
335
|
+
<wui-button
|
|
336
|
+
variant="neutral-secondary"
|
|
337
|
+
size="md"
|
|
338
|
+
?disabled=${this.isRetrying||this.isLoading}
|
|
339
|
+
@click=${this.onTryAgain.bind(this)}
|
|
340
|
+
data-testid="w3m-connecting-widget-secondary-button"
|
|
341
|
+
>
|
|
342
|
+
<wui-icon
|
|
343
|
+
color="inherit"
|
|
344
|
+
slot="iconLeft"
|
|
345
|
+
name=${this.secondaryBtnIcon}
|
|
346
|
+
></wui-icon>
|
|
347
|
+
${this.secondaryBtnLabel}
|
|
348
|
+
</wui-button>
|
|
349
|
+
`:null}
|
|
350
|
+
</wui-flex>
|
|
351
|
+
|
|
352
|
+
${this.isWalletConnect?e.b`
|
|
353
|
+
<wui-flex .padding=${["0","5","5","5"]} justifyContent="center">
|
|
354
|
+
<wui-link
|
|
355
|
+
@click=${this.onCopyUri}
|
|
356
|
+
variant="secondary"
|
|
357
|
+
icon="copy"
|
|
358
|
+
data-testid="wui-link-copy"
|
|
359
|
+
>
|
|
360
|
+
Copy link
|
|
361
|
+
</wui-link>
|
|
362
|
+
</wui-flex>
|
|
363
|
+
`:null}
|
|
364
|
+
|
|
365
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links></wui-flex>
|
|
366
|
+
</wui-flex>
|
|
367
|
+
`}onShowRetry(){if(this.error&&!this.showRetry){this.showRetry=!0;const e=this.shadowRoot?.querySelector("wui-button");e?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){e.ConnectionController.setWcError(!1),this.onRetry?(this.isRetrying=!0,this.onRetry?.()):this.onConnect?.()}loaderTemplate(){const t=e.ThemeController.state.themeVariables["--w3m-border-radius-master"],o=t?parseInt(t.replace("px",""),10):4;return e.b`<wui-loading-thumbnail radius=${9*o}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(e.CoreHelperUtil.copyToClopboard(this.uri),e.SnackController.showSuccess("Link copied"))}catch{e.SnackController.showError("Failed to copy")}}}S.styles=R,A([t.r()],S.prototype,"isRetrying",void 0),A([t.r()],S.prototype,"uri",void 0),A([t.r()],S.prototype,"error",void 0),A([t.r()],S.prototype,"ready",void 0),A([t.r()],S.prototype,"showRetry",void 0),A([t.r()],S.prototype,"label",void 0),A([t.r()],S.prototype,"secondaryBtnLabel",void 0),A([t.r()],S.prototype,"secondaryLabel",void 0),A([t.r()],S.prototype,"isLoading",void 0),A([t.n({type:Boolean})],S.prototype,"isMobile",void 0),A([t.n()],S.prototype,"onRetry",void 0);var T=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let I=class extends S{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),e.EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:e.RouterController.state.view}})}async onConnectProxy(){try{this.error=!1;const{connectors:t}=e.ConnectorController.state,o=t.find((e=>"ANNOUNCED"===e.type&&e.info?.rdns===this.wallet?.rdns||"INJECTED"===e.type||e.name===this.wallet?.name));if(!o)throw new Error("w3m-connecting-wc-browser: No connector found");await e.ConnectionController.connectExternal(o,o.chain),e.ModalController.close()}catch(t){t instanceof e.AppKitError&&t.originalName===e.ErrorUtil.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?e.EventsController.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:t.message}}):e.EventsController.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:t?.message??"Unknown"}}),this.error=!0}}};I=T([t.customElement("w3m-connecting-wc-browser")],I);var P=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let L=class extends S{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),e.EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:e.RouterController.state.view}})}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onConnectProxy(){if(this.wallet?.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:t,name:o}=this.wallet,{redirect:n,href:r}=e.CoreHelperUtil.formatNativeUrl(t,this.uri);e.ConnectionController.setWcLinking({name:o,href:r}),e.ConnectionController.setRecentWallet(this.wallet),e.CoreHelperUtil.openHref(n,"_blank")}catch{this.error=!0}}};L=P([t.customElement("w3m-connecting-wc-desktop")],L);var O=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let U=class extends S{constructor(){if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=e.OptionsController.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{e.ConnectionControllerUtil.onConnectMobile(this.wallet)},!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=e.ConstantsUtil$1.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(e.ConnectionController.subscribeKey("wcUri",(()=>{this.onHandleURI()}))),e.EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:e.RouterController.state.view}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onTryAgain(){e.ConnectionController.setWcError(!1),this.onConnect?.()}};O([t.r()],U.prototype,"redirectDeeplink",void 0),O([t.r()],U.prototype,"redirectUniversalLink",void 0),O([t.r()],U.prototype,"target",void 0),O([t.r()],U.prototype,"preferUniversalLinks",void 0),O([t.r()],U.prototype,"isLoading",void 0),U=O([t.customElement("w3m-connecting-wc-mobile")],U);var B={},j={},W={};let N;const _=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];W.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},W.getSymbolTotalCodewords=function(e){return _[e]},W.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},W.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');N=e},W.isKanjiModeEnabled=function(){return void 0!==N},W.toSJIS=function(e){return N(e)};var M={};function z(){this.buffer=[],this.length=0}!function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2},e.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},e.from=function(t,o){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(e){return o}}}(M),z.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let o=0;o<t;o++)this.putBit(1==(e>>>t-o-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var D=z;function H(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}H.prototype.set=function(e,t,o,n){const r=e*this.size+t;this.data[r]=o,n&&(this.reservedBit[r]=!0)},H.prototype.get=function(e,t){return this.data[e*this.size+t]},H.prototype.xor=function(e,t,o){this.data[e*this.size+t]^=o},H.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var q=H,V={};!function(e){const t=W.getSymbolSize;e.getRowColCoords=function(e){if(1===e)return[];const o=Math.floor(e/7)+2,n=t(e),r=145===n?26:2*Math.ceil((n-13)/(2*o-2)),i=[n-7];for(let e=1;e<o-1;e++)i[e]=i[e-1]-r;return i.push(6),i.reverse()},e.getPositions=function(t){const o=[],n=e.getRowColCoords(t),r=n.length;for(let e=0;e<r;e++)for(let t=0;t<r;t++)0===e&&0===t||0===e&&t===r-1||e===r-1&&0===t||o.push([n[e],n[t]]);return o}}(V);var F={};const K=W.getSymbolSize;F.getPositions=function(e){const t=K(e);return[[0,0],[t-7,0],[0,t-7]]};var Y={};!function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t=3,o=3,n=40,r=10;function i(t,o,n){switch(t){case e.Patterns.PATTERN000:return(o+n)%2==0;case e.Patterns.PATTERN001:return o%2==0;case e.Patterns.PATTERN010:return n%3==0;case e.Patterns.PATTERN011:return(o+n)%3==0;case e.Patterns.PATTERN100:return(Math.floor(o/2)+Math.floor(n/3))%2==0;case e.Patterns.PATTERN101:return o*n%2+o*n%3==0;case e.Patterns.PATTERN110:return(o*n%2+o*n%3)%2==0;case e.Patterns.PATTERN111:return(o*n%3+(o+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}e.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){const o=e.size;let n=0,r=0,i=0,s=null,a=null;for(let l=0;l<o;l++){r=i=0,s=a=null;for(let c=0;c<o;c++){let o=e.get(l,c);o===s?r++:(r>=5&&(n+=t+(r-5)),s=o,r=1),o=e.get(c,l),o===a?i++:(i>=5&&(n+=t+(i-5)),a=o,i=1)}r>=5&&(n+=t+(r-5)),i>=5&&(n+=t+(i-5))}return n},e.getPenaltyN2=function(e){const t=e.size;let n=0;for(let o=0;o<t-1;o++)for(let r=0;r<t-1;r++){const t=e.get(o,r)+e.get(o,r+1)+e.get(o+1,r)+e.get(o+1,r+1);4!==t&&0!==t||n++}return n*o},e.getPenaltyN3=function(e){const t=e.size;let o=0,r=0,i=0;for(let n=0;n<t;n++){r=i=0;for(let s=0;s<t;s++)r=r<<1&2047|e.get(n,s),s>=10&&(1488===r||93===r)&&o++,i=i<<1&2047|e.get(s,n),s>=10&&(1488===i||93===i)&&o++}return o*n},e.getPenaltyN4=function(e){let t=0;const o=e.data.length;for(let n=0;n<o;n++)t+=e.data[n];return Math.abs(Math.ceil(100*t/o/5)-10)*r},e.applyMask=function(e,t){const o=t.size;for(let n=0;n<o;n++)for(let r=0;r<o;r++)t.isReserved(r,n)||t.xor(r,n,i(e,r,n))},e.getBestMask=function(t,o){const n=Object.keys(e.Patterns).length;let r=0,i=1/0;for(let s=0;s<n;s++){o(s),e.applyMask(s,t);const n=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(s,t),n<i&&(i=n,r=s)}return r}}(Y);var J={};const Q=M,G=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],X=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];J.getBlocksCount=function(e,t){switch(t){case Q.L:return G[4*(e-1)+0];case Q.M:return G[4*(e-1)+1];case Q.Q:return G[4*(e-1)+2];case Q.H:return G[4*(e-1)+3];default:return}},J.getTotalCodewordsCount=function(e,t){switch(t){case Q.L:return X[4*(e-1)+0];case Q.M:return X[4*(e-1)+1];case Q.Q:return X[4*(e-1)+2];case Q.H:return X[4*(e-1)+3];default:return}};var Z={},ee={};const te=new Uint8Array(512),oe=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)te[t]=e,oe[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)te[e]=te[e-255]}(),ee.log=function(e){if(e<1)throw new Error("log("+e+")");return oe[e]},ee.exp=function(e){return te[e]},ee.mul=function(e,t){return 0===e||0===t?0:te[oe[e]+oe[t]]},function(e){const t=ee;e.mul=function(e,o){const n=new Uint8Array(e.length+o.length-1);for(let r=0;r<e.length;r++)for(let i=0;i<o.length;i++)n[r+i]^=t.mul(e[r],o[i]);return n},e.mod=function(e,o){let n=new Uint8Array(e);for(;n.length-o.length>=0;){const e=n[0];for(let r=0;r<o.length;r++)n[r]^=t.mul(o[r],e);let r=0;for(;r<n.length&&0===n[r];)r++;n=n.slice(r)}return n},e.generateECPolynomial=function(o){let n=new Uint8Array([1]);for(let r=0;r<o;r++)n=e.mul(n,new Uint8Array([1,t.exp(r)]));return n}}(Z);const ne=Z;function re(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}re.prototype.initialize=function(e){this.degree=e,this.genPoly=ne.generateECPolynomial(this.degree)},re.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const o=ne.mod(t,this.genPoly),n=this.degree-o.length;if(n>0){const e=new Uint8Array(this.degree);return e.set(o,n),e}return o};var ie=re,se={},ae={},le={isValid:function(e){return!isNaN(e)&&e>=1&&e<=40}},ce={};const de="[0-9]+";let ue="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ue=ue.replace(/u/g,"\\u");const he="(?:(?![A-Z0-9 $%*+\\-./:]|"+ue+")(?:.|[\r\n]))+";ce.KANJI=new RegExp(ue,"g"),ce.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ce.BYTE=new RegExp(he,"g"),ce.NUMERIC=new RegExp(de,"g"),ce.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const pe=new RegExp("^"+ue+"$"),ge=new RegExp("^"+de+"$"),fe=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");ce.testKanji=function(e){return pe.test(e)},ce.testNumeric=function(e){return ge.test(e)},ce.testAlphanumeric=function(e){return fe.test(e)},function(e){const t=le,o=ce;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,o){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!t.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?e.ccBits[0]:o<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return o.testNumeric(t)?e.NUMERIC:o.testAlphanumeric(t)?e.ALPHANUMERIC:o.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},e.isValid=function(e){return e&&e.bit&&e.ccBits},e.from=function(t,o){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(e){return o}}}(ae),function(e){const t=W,o=J,n=M,r=ae,i=le,s=t.getBCHDigit(7973);function a(e,t){return r.getCharCountIndicator(e,t)+4}function l(e,t){let o=0;return e.forEach((function(e){const n=a(e.mode,t);o+=n+e.getBitsLength()})),o}e.from=function(e,t){return i.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,n,s){if(!i.isValid(e))throw new Error("Invalid QR Code version");void 0===s&&(s=r.BYTE);const l=8*(t.getSymbolTotalCodewords(e)-o.getTotalCodewordsCount(e,n));if(s===r.MIXED)return l;const c=l-a(s,e);switch(s){case r.NUMERIC:return Math.floor(c/10*3);case r.ALPHANUMERIC:return Math.floor(c/11*2);case r.KANJI:return Math.floor(c/13);case r.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(t,o){let i;const s=n.from(o,n.M);if(Array.isArray(t)){if(t.length>1)return function(t,o){for(let n=1;n<=40;n++)if(l(t,n)<=e.getCapacity(n,o,r.MIXED))return n}(t,s);if(0===t.length)return 1;i=t[0]}else i=t;return function(t,o,n){for(let r=1;r<=40;r++)if(o<=e.getCapacity(r,n,t))return r}(i.mode,i.getLength(),s)},e.getEncodedBits=function(e){if(!i.isValid(e)||e<7)throw new Error("Invalid QR Code version");let o=e<<12;for(;t.getBCHDigit(o)-s>=0;)o^=7973<<t.getBCHDigit(o)-s;return e<<12|o}}(se);var we={};const me=W,be=me.getBCHDigit(1335);we.getEncodedBits=function(e,t){const o=e.bit<<3|t;let n=o<<10;for(;me.getBCHDigit(n)-be>=0;)n^=1335<<me.getBCHDigit(n)-be;return 21522^(o<<10|n)};var ye={};const ve=ae;function Ce(e){this.mode=ve.NUMERIC,this.data=e.toString()}Ce.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Ce.prototype.getLength=function(){return this.data.length},Ce.prototype.getBitsLength=function(){return Ce.getBitsLength(this.data.length)},Ce.prototype.write=function(e){let t,o,n;for(t=0;t+3<=this.data.length;t+=3)o=this.data.substr(t,3),n=parseInt(o,10),e.put(n,10);const r=this.data.length-t;r>0&&(o=this.data.substr(t),n=parseInt(o,10),e.put(n,3*r+1))};var xe=Ce;const $e=ae,ke=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Ee(e){this.mode=$e.ALPHANUMERIC,this.data=e}Ee.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},Ee.prototype.getLength=function(){return this.data.length},Ee.prototype.getBitsLength=function(){return Ee.getBitsLength(this.data.length)},Ee.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let o=45*ke.indexOf(this.data[t]);o+=ke.indexOf(this.data[t+1]),e.put(o,11)}this.data.length%2&&e.put(ke.indexOf(this.data[t]),6)};var Re=Ee;const Ae=function(e){for(var t=[],o=e.length,n=0;n<o;n++){var r=e.charCodeAt(n);if(r>=55296&&r<=56319&&o>n+1){var i=e.charCodeAt(n+1);i>=56320&&i<=57343&&(r=1024*(r-55296)+i-56320+65536,n+=1)}r<128?t.push(r):r<2048?(t.push(r>>6|192),t.push(63&r|128)):r<55296||r>=57344&&r<65536?(t.push(r>>12|224),t.push(r>>6&63|128),t.push(63&r|128)):r>=65536&&r<=1114111?(t.push(r>>18|240),t.push(r>>12&63|128),t.push(r>>6&63|128),t.push(63&r|128)):t.push(239,191,189)}return new Uint8Array(t).buffer},Se=ae;function Te(e){this.mode=Se.BYTE,"string"==typeof e&&(e=Ae(e)),this.data=new Uint8Array(e)}Te.getBitsLength=function(e){return 8*e},Te.prototype.getLength=function(){return this.data.length},Te.prototype.getBitsLength=function(){return Te.getBitsLength(this.data.length)},Te.prototype.write=function(e){for(let t=0,o=this.data.length;t<o;t++)e.put(this.data[t],8)};var Ie=Te;const Pe=ae,Le=W;function Oe(e){this.mode=Pe.KANJI,this.data=e}Oe.getBitsLength=function(e){return 13*e},Oe.prototype.getLength=function(){return this.data.length},Oe.prototype.getBitsLength=function(){return Oe.getBitsLength(this.data.length)},Oe.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let o=Le.toSJIS(this.data[t]);if(o>=33088&&o<=40956)o-=33088;else{if(!(o>=57408&&o<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");o-=49472}o=192*(o>>>8&255)+(255&o),e.put(o,13)}};var Ue=Oe,Be={exports:{}};!function(e){var t={single_source_shortest_paths:function(e,o,n){var r={},i={};i[o]=0;var s,a,l,c,d,u,h,p=t.PriorityQueue.make();for(p.push(o,0);!p.empty();)for(l in a=(s=p.pop()).value,c=s.cost,d=e[a]||{})d.hasOwnProperty(l)&&(u=c+d[l],h=i[l],(void 0===i[l]||h>u)&&(i[l]=u,p.push(l,u),r[l]=a));if(void 0!==n&&void 0===i[n]){var g=["Could not find a path from ",o," to ",n,"."].join("");throw new Error(g)}return r},extract_shortest_path_from_predecessor_list:function(e,t){for(var o=[],n=t;n;)o.push(n),e[n],n=e[n];return o.reverse(),o},find_path:function(e,o,n){var r=t.single_source_shortest_paths(e,o,n);return t.extract_shortest_path_from_predecessor_list(r,n)},PriorityQueue:{make:function(e){var o,n=t.PriorityQueue,r={};for(o in e=e||{},n)n.hasOwnProperty(o)&&(r[o]=n[o]);return r.queue=[],r.sorter=e.sorter||n.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var o={value:e,cost:t};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t}(Be),function(e){const t=ae,o=xe,n=Re,r=Ie,i=Ue,s=ce,a=W,l=Be.exports;function c(e){return unescape(encodeURIComponent(e)).length}function d(e,t,o){const n=[];let r;for(;null!==(r=e.exec(o));)n.push({data:r[0],index:r.index,mode:t,length:r[0].length});return n}function u(e){const o=d(s.NUMERIC,t.NUMERIC,e),n=d(s.ALPHANUMERIC,t.ALPHANUMERIC,e);let r,i;a.isKanjiModeEnabled()?(r=d(s.BYTE,t.BYTE,e),i=d(s.KANJI,t.KANJI,e)):(r=d(s.BYTE_KANJI,t.BYTE,e),i=[]);return o.concat(n,r,i).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function h(e,s){switch(s){case t.NUMERIC:return o.getBitsLength(e);case t.ALPHANUMERIC:return n.getBitsLength(e);case t.KANJI:return i.getBitsLength(e);case t.BYTE:return r.getBitsLength(e)}}function p(e,s){let l;const c=t.getBestModeForData(e);if(l=t.from(s,c),l!==t.BYTE&&l.bit<c.bit)throw new Error('"'+e+'" cannot be encoded with mode '+t.toString(l)+".\n Suggested mode is: "+t.toString(c));switch(l!==t.KANJI||a.isKanjiModeEnabled()||(l=t.BYTE),l){case t.NUMERIC:return new o(e);case t.ALPHANUMERIC:return new n(e);case t.KANJI:return new i(e);case t.BYTE:return new r(e)}}e.fromArray=function(e){return e.reduce((function(e,t){return"string"==typeof t?e.push(p(t,null)):t.data&&e.push(p(t.data,t.mode)),e}),[])},e.fromString=function(o,n){const r=function(e){const o=[];for(let n=0;n<e.length;n++){const r=e[n];switch(r.mode){case t.NUMERIC:o.push([r,{data:r.data,mode:t.ALPHANUMERIC,length:r.length},{data:r.data,mode:t.BYTE,length:r.length}]);break;case t.ALPHANUMERIC:o.push([r,{data:r.data,mode:t.BYTE,length:r.length}]);break;case t.KANJI:o.push([r,{data:r.data,mode:t.BYTE,length:c(r.data)}]);break;case t.BYTE:o.push([{data:r.data,mode:t.BYTE,length:c(r.data)}])}}return o}(u(o,a.isKanjiModeEnabled())),i=function(e,o){const n={},r={start:{}};let i=["start"];for(let s=0;s<e.length;s++){const a=e[s],l=[];for(let e=0;e<a.length;e++){const c=a[e],d=""+s+e;l.push(d),n[d]={node:c,lastCount:0},r[d]={};for(let e=0;e<i.length;e++){const s=i[e];n[s]&&n[s].node.mode===c.mode?(r[s][d]=h(n[s].lastCount+c.length,c.mode)-h(n[s].lastCount,c.mode),n[s].lastCount+=c.length):(n[s]&&(n[s].lastCount=c.length),r[s][d]=h(c.length,c.mode)+4+t.getCharCountIndicator(c.mode,o))}}i=l}for(let e=0;e<i.length;e++)r[i[e]].end=0;return{map:r,table:n}}(r,n),s=l.find_path(i.map,"start","end"),d=[];for(let e=1;e<s.length-1;e++)d.push(i.table[s[e]].node);return e.fromArray(function(e){return e.reduce((function(e,t){const o=e.length-1>=0?e[e.length-1]:null;return o&&o.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(d))},e.rawSplit=function(t){return e.fromArray(u(t,a.isKanjiModeEnabled()))}}(ye);const je=W,We=M,Ne=D,_e=q,Me=V,ze=F,De=Y,He=J,qe=ie,Ve=se,Fe=we,Ke=ae,Ye=ye;function Je(e,t,o){const n=e.size,r=Fe.getEncodedBits(t,o);let i,s;for(i=0;i<15;i++)s=1==(r>>i&1),i<6?e.set(i,8,s,!0):i<8?e.set(i+1,8,s,!0):e.set(n-15+i,8,s,!0),i<8?e.set(8,n-i-1,s,!0):i<9?e.set(8,15-i-1+1,s,!0):e.set(8,15-i-1,s,!0);e.set(n-8,8,1,!0)}function Qe(e,t,o){const n=new Ne;o.forEach((function(t){n.put(t.mode.bit,4),n.put(t.getLength(),Ke.getCharCountIndicator(t.mode,e)),t.write(n)}));const r=8*(je.getSymbolTotalCodewords(e)-He.getTotalCodewordsCount(e,t));for(n.getLengthInBits()+4<=r&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(0);const i=(r-n.getLengthInBits())/8;for(let e=0;e<i;e++)n.put(e%2?17:236,8);return function(e,t,o){const n=je.getSymbolTotalCodewords(t),r=He.getTotalCodewordsCount(t,o),i=n-r,s=He.getBlocksCount(t,o),a=n%s,l=s-a,c=Math.floor(n/s),d=Math.floor(i/s),u=d+1,h=c-d,p=new qe(h);let g=0;const f=new Array(s),w=new Array(s);let m=0;const b=new Uint8Array(e.buffer);for(let e=0;e<s;e++){const t=e<l?d:u;f[e]=b.slice(g,g+t),w[e]=p.encode(f[e]),g+=t,m=Math.max(m,t)}const y=new Uint8Array(n);let v,C,x=0;for(v=0;v<m;v++)for(C=0;C<s;C++)v<f[C].length&&(y[x++]=f[C][v]);for(v=0;v<h;v++)for(C=0;C<s;C++)y[x++]=w[C][v];return y}(n,e,t)}function Ge(e,t,o,n){let r;if(Array.isArray(e))r=Ye.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let n=t;if(!n){const t=Ye.rawSplit(e);n=Ve.getBestVersionForData(t,o)}r=Ye.fromString(e,n||40)}}const i=Ve.getBestVersionForData(r,o);if(!i)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<i)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+i+".\n")}else t=i;const s=Qe(t,o,r),a=je.getSymbolSize(t),l=new _e(a);return function(e,t){const o=e.size,n=ze.getPositions(t);for(let t=0;t<n.length;t++){const r=n[t][0],i=n[t][1];for(let t=-1;t<=7;t++)if(!(r+t<=-1||o<=r+t))for(let n=-1;n<=7;n++)i+n<=-1||o<=i+n||(t>=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0))}}(l,t),function(e){const t=e.size;for(let o=8;o<t-8;o++){const t=o%2==0;e.set(o,6,t,!0),e.set(6,o,t,!0)}}(l),function(e,t){const o=Me.getPositions(t);for(let t=0;t<o.length;t++){const n=o[t][0],r=o[t][1];for(let t=-2;t<=2;t++)for(let o=-2;o<=2;o++)-2===t||2===t||-2===o||2===o||0===t&&0===o?e.set(n+t,r+o,!0,!0):e.set(n+t,r+o,!1,!0)}}(l,t),Je(l,o,0),t>=7&&function(e,t){const o=e.size,n=Ve.getEncodedBits(t);let r,i,s;for(let t=0;t<18;t++)r=Math.floor(t/3),i=t%3+o-8-3,s=1==(n>>t&1),e.set(r,i,s,!0),e.set(i,r,s,!0)}(l,t),function(e,t){const o=e.size;let n=-1,r=o-1,i=7,s=0;for(let a=o-1;a>0;a-=2)for(6===a&&a--;;){for(let o=0;o<2;o++)if(!e.isReserved(r,a-o)){let n=!1;s<t.length&&(n=1==(t[s]>>>i&1)),e.set(r,a-o,n),i--,-1===i&&(s++,i=7)}if(r+=n,r<0||o<=r){r-=n,n=-n;break}}}(l,s),isNaN(n)&&(n=De.getBestMask(l,Je.bind(null,l,o))),De.applyMask(n,l),Je(l,o,n),{modules:l,version:t,errorCorrectionLevel:o,maskPattern:n,segments:r}}j.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let o,n,r=We.M;return void 0!==t&&(r=We.from(t.errorCorrectionLevel,We.M),o=Ve.from(t.version),n=De.from(t.maskPattern),t.toSJISFunc&&je.setToSJISFunction(t.toSJISFunc)),Ge(e,o,r,n)};var Xe={},Ze={};!function(e){function t(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const o=parseInt(t.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:255&o,hex:"#"+t.slice(0,6).join("")}}e.getOptions=function(e){e||(e={}),e.color||(e.color={});const o=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,r=e.scale||4;return{width:n,scale:n?4:r,margin:o,color:{dark:t(e.color.dark||"#000000ff"),light:t(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},e.getImageWidth=function(t,o){const n=e.getScale(t,o);return Math.floor((t+2*o.margin)*n)},e.qrToImageData=function(t,o,n){const r=o.modules.size,i=o.modules.data,s=e.getScale(r,n),a=Math.floor((r+2*n.margin)*s),l=n.margin*s,c=[n.color.light,n.color.dark];for(let e=0;e<a;e++)for(let o=0;o<a;o++){let d=4*(e*a+o),u=n.color.light;if(e>=l&&o>=l&&e<a-l&&o<a-l){u=c[i[Math.floor((e-l)/s)*r+Math.floor((o-l)/s)]?1:0]}t[d++]=u.r,t[d++]=u.g,t[d++]=u.b,t[d]=u.a}}}(Ze),function(e){const t=Ze;e.render=function(e,o,n){let r=n,i=o;void 0!==r||o&&o.getContext||(r=o,o=void 0),o||(i=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),r=t.getOptions(r);const s=t.getImageWidth(e.modules.size,r),a=i.getContext("2d"),l=a.createImageData(s,s);return t.qrToImageData(l.data,e,r),function(e,t,o){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=o,t.width=o,t.style.height=o+"px",t.style.width=o+"px"}(a,i,s),a.putImageData(l,0,0),i},e.renderToDataURL=function(t,o,n){let r=n;void 0!==r||o&&o.getContext||(r=o,o=void 0),r||(r={});const i=e.render(t,o,r),s=r.type||"image/png",a=r.rendererOpts||{};return i.toDataURL(s,a.quality)}}(Xe);var et={};const tt=Ze;function ot(e,t){const o=e.a/255,n=t+'="'+e.hex+'"';return o<1?n+" "+t+'-opacity="'+o.toFixed(2).slice(1)+'"':n}function nt(e,t,o){let n=e+t;return void 0!==o&&(n+=" "+o),n}et.render=function(e,t,o){const n=tt.getOptions(t),r=e.modules.size,i=e.modules.data,s=r+2*n.margin,a=n.color.light.a?"<path "+ot(n.color.light,"fill")+' d="M0 0h'+s+"v"+s+'H0z"/>':"",l="<path "+ot(n.color.dark,"stroke")+' d="'+function(e,t,o){let n="",r=0,i=!1,s=0;for(let a=0;a<e.length;a++){const l=Math.floor(a%t),c=Math.floor(a/t);l||i||(i=!0),e[a]?(s++,a>0&&l>0&&e[a-1]||(n+=i?nt("M",l+o,.5+c+o):nt("m",r,0),r=0,i=!1),l+1<t&&e[a+1]||(n+=nt("h",s),s=0)):r++}return n}(i,r,n.margin)+'"/>',c='viewBox="0 0 '+s+" "+s+'"',d='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+c+' shape-rendering="crispEdges">'+a+l+"</svg>\n";return"function"==typeof o&&o(null,d),d};const rt=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},it=j,st=Xe,at=et;function lt(e,t,o,n,r){const i=[].slice.call(arguments,1),s=i.length,a="function"==typeof i[s-1];if(!a&&!rt())throw new Error("Callback required as last argument");if(!a){if(s<1)throw new Error("Too few arguments provided");return 1===s?(o=t,t=n=void 0):2!==s||t.getContext||(n=o,o=t,t=void 0),new Promise((function(r,i){try{const i=it.create(o,n);r(e(i,t,n))}catch(e){i(e)}}))}if(s<2)throw new Error("Too few arguments provided");2===s?(r=o,o=t,t=n=void 0):3===s&&(t.getContext&&void 0===r?(r=n,n=void 0):(r=n,n=o,o=t,t=void 0));try{const i=it.create(o,n);r(null,e(i,t,n))}catch(e){r(e)}}B.create=it.create,B.toCanvas=lt.bind(null,st.render),B.toDataURL=lt.bind(null,st.renderToDataURL),B.toString=lt.bind(null,(function(e,t,o){return at.render(e,o)}));function ct(e,t,o){if(e===t)return!1;return(e-t<0?t-e:e-t)<=o+.1}const dt={generate({uri:t,size:o,logoSize:n,padding:r=8,dotColor:i="var(--apkt-colors-black)"}){const s=10,a=[],l=function(e,t){const o=Array.prototype.slice.call(B.create(e,{errorCorrectionLevel:t}).modules.data,0),n=Math.sqrt(o.length);return o.reduce(((e,t,o)=>(o%n==0?e.push([t]):e[e.length-1].push(t))&&e),[])}(t,"Q"),c=(o-2*r)/l.length,d=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];d.forEach((({x:t,y:o})=>{const n=(l.length-7)*c*t+r,u=(l.length-7)*c*o+r,h=.45;for(let t=0;t<d.length;t+=1){const o=c*(7-2*t);a.push(e.w`
|
|
368
|
+
<rect
|
|
369
|
+
fill=${2===t?"var(--apkt-colors-black)":"var(--apkt-colors-white)"}
|
|
370
|
+
width=${0===t?o-s:o}
|
|
371
|
+
rx= ${0===t?(o-s)*h:o*h}
|
|
372
|
+
ry= ${0===t?(o-s)*h:o*h}
|
|
373
|
+
stroke=${i}
|
|
374
|
+
stroke-width=${0===t?s:0}
|
|
375
|
+
height=${0===t?o-s:o}
|
|
376
|
+
x= ${0===t?u+c*t+5:u+c*t}
|
|
377
|
+
y= ${0===t?n+c*t+5:n+c*t}
|
|
378
|
+
/>
|
|
379
|
+
`)}}));const u=Math.floor((n+25)/c),h=l.length/2-u/2,p=l.length/2+u/2-1,g=[];l.forEach(((e,t)=>{e.forEach(((e,o)=>{if(l[t][o]&&!(t<7&&o<7||t>l.length-8&&o<7||t<7&&o>l.length-8||t>h&&t<p&&o>h&&o<p)){const e=t*c+c/2+r,n=o*c+c/2+r;g.push([e,n])}}))}));const f={};return g.forEach((([e,t])=>{f[e]?f[e]?.push(t):f[e]=[t]})),Object.entries(f).map((([e,t])=>{const o=t.filter((e=>t.every((t=>!ct(e,t,c)))));return[Number(e),o]})).forEach((([t,o])=>{o.forEach((o=>{a.push(e.w`<circle cx=${t} cy=${o} fill=${i} r=${c/2.5} />`)}))})),Object.entries(f).filter((([e,t])=>t.length>1)).map((([e,t])=>{const o=t.filter((e=>t.some((t=>ct(e,t,c)))));return[Number(e),o]})).map((([e,t])=>{t.sort(((e,t)=>e<t?-1:1));const o=[];for(const e of t){const t=o.find((t=>t.some((t=>ct(e,t,c)))));t?t.push(e):o.push([e])}return[e,o.map((e=>[e[0],e[e.length-1]]))]})).forEach((([t,o])=>{o.forEach((([o,n])=>{a.push(e.w`
|
|
380
|
+
<line
|
|
381
|
+
x1=${t}
|
|
382
|
+
x2=${t}
|
|
383
|
+
y1=${o}
|
|
384
|
+
y2=${n}
|
|
385
|
+
stroke=${i}
|
|
386
|
+
stroke-width=${c/1.25}
|
|
387
|
+
stroke-linecap="round"
|
|
388
|
+
/>
|
|
389
|
+
`)}))})),a}};var ut=e.css`
|
|
390
|
+
:host {
|
|
391
|
+
position: relative;
|
|
392
|
+
user-select: none;
|
|
393
|
+
display: block;
|
|
394
|
+
overflow: hidden;
|
|
395
|
+
aspect-ratio: 1 / 1;
|
|
396
|
+
width: 100%;
|
|
397
|
+
height: 100%;
|
|
398
|
+
background-color: ${({colors:e})=>e.white};
|
|
399
|
+
border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
:host {
|
|
403
|
+
border-radius: ${({borderRadius:e})=>e[4]};
|
|
404
|
+
display: flex;
|
|
405
|
+
align-items: center;
|
|
406
|
+
justify-content: center;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
:host([data-clear='true']) > wui-icon {
|
|
410
|
+
display: none;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
svg:first-child,
|
|
414
|
+
wui-image,
|
|
415
|
+
wui-icon {
|
|
416
|
+
position: absolute;
|
|
417
|
+
top: 50%;
|
|
418
|
+
left: 50%;
|
|
419
|
+
transform: translateY(-50%) translateX(-50%);
|
|
420
|
+
background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
|
|
421
|
+
box-shadow: inset 0 0 0 4px ${({tokens:e})=>e.theme.backgroundPrimary};
|
|
422
|
+
border-radius: ${({borderRadius:e})=>e[6]};
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
wui-image {
|
|
426
|
+
width: 25%;
|
|
427
|
+
height: 25%;
|
|
428
|
+
border-radius: ${({borderRadius:e})=>e[2]};
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
wui-icon {
|
|
432
|
+
width: 100%;
|
|
433
|
+
height: 100%;
|
|
434
|
+
color: #3396ff !important;
|
|
435
|
+
transform: translateY(-50%) translateX(-50%) scale(0.25);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
wui-icon > svg {
|
|
439
|
+
width: inherit;
|
|
440
|
+
height: inherit;
|
|
441
|
+
}
|
|
442
|
+
`,ht=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let pt=class extends e.i{constructor(){super(...arguments),this.uri="",this.size=500,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),e.b`<wui-flex
|
|
443
|
+
alignItems="center"
|
|
444
|
+
justifyContent="center"
|
|
445
|
+
class="wui-qr-code"
|
|
446
|
+
direction="column"
|
|
447
|
+
gap="4"
|
|
448
|
+
width="100%"
|
|
449
|
+
style="height: 100%"
|
|
450
|
+
>
|
|
451
|
+
${this.templateVisual()} ${this.templateSvg()}
|
|
452
|
+
</wui-flex>`}templateSvg(){return e.w`
|
|
453
|
+
<svg viewBox="0 0 ${this.size} ${this.size}" width="100%" height="100%">
|
|
454
|
+
${dt.generate({uri:this.uri,size:this.size,logoSize:this.arenaClear?0:this.size/4})}
|
|
455
|
+
</svg>
|
|
456
|
+
`}templateVisual(){return this.imageSrc?e.b`<wui-image src=${this.imageSrc} alt=${this.alt??"logo"}></wui-image>`:this.farcaster?e.b`<wui-icon
|
|
457
|
+
class="farcaster"
|
|
458
|
+
size="inherit"
|
|
459
|
+
color="inherit"
|
|
460
|
+
name="farcaster"
|
|
461
|
+
></wui-icon>`:e.b`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`}};pt.styles=[e.resetStyles,ut],ht([t.n()],pt.prototype,"uri",void 0),ht([t.n({type:Number})],pt.prototype,"size",void 0),ht([t.n()],pt.prototype,"theme",void 0),ht([t.n()],pt.prototype,"imageSrc",void 0),ht([t.n()],pt.prototype,"alt",void 0),ht([t.n({type:Boolean})],pt.prototype,"arenaClear",void 0),ht([t.n({type:Boolean})],pt.prototype,"farcaster",void 0),pt=ht([t.customElement("wui-qr-code")],pt);var gt=e.css`
|
|
462
|
+
wui-shimmer {
|
|
463
|
+
width: 100%;
|
|
464
|
+
aspect-ratio: 1 / 1;
|
|
465
|
+
border-radius: ${({borderRadius:e})=>e[4]};
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
wui-qr-code {
|
|
469
|
+
opacity: 0;
|
|
470
|
+
animation-duration: ${({durations:e})=>e.xl};
|
|
471
|
+
animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
|
|
472
|
+
animation-name: fade-in;
|
|
473
|
+
animation-fill-mode: forwards;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
@keyframes fade-in {
|
|
477
|
+
from {
|
|
478
|
+
opacity: 0;
|
|
479
|
+
}
|
|
480
|
+
to {
|
|
481
|
+
opacity: 1;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
`,ft=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let wt=class extends S{constructor(){super(),this.basic=!1}firstUpdated(){this.basic||e.EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet?.name??"WalletConnect",platform:"qrcode",displayIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:e.RouterController.state.view}})}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribe?.forEach((e=>e()))}render(){return this.onRenderProxy(),e.b`
|
|
485
|
+
<wui-flex
|
|
486
|
+
flexDirection="column"
|
|
487
|
+
alignItems="center"
|
|
488
|
+
.padding=${["0","5","5","5"]}
|
|
489
|
+
gap="5"
|
|
490
|
+
>
|
|
491
|
+
<wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
|
|
492
|
+
<wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text>
|
|
493
|
+
${this.copyTemplate()}
|
|
494
|
+
</wui-flex>
|
|
495
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
496
|
+
`}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0)}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const o=this.wallet?this.wallet.name:void 0;e.ConnectionController.setWcLinking(void 0),e.ConnectionController.setRecentWallet(this.wallet);const n=e.ThemeController.state.themeVariables["--apkt-qr-color"]??e.ThemeController.state.themeVariables["--w3m-qr-color"];return e.b` <wui-qr-code
|
|
497
|
+
theme=${e.ThemeController.state.themeMode}
|
|
498
|
+
uri=${this.uri}
|
|
499
|
+
imageSrc=${t.o(e.AssetUtil.getWalletImage(this.wallet))}
|
|
500
|
+
color=${t.o(n)}
|
|
501
|
+
alt=${t.o(o)}
|
|
502
|
+
data-testid="wui-qr-code"
|
|
503
|
+
></wui-qr-code>`}copyTemplate(){const t=!this.uri||!this.ready;return e.b`<wui-button
|
|
504
|
+
.disabled=${t}
|
|
505
|
+
@click=${this.onCopyUri}
|
|
506
|
+
variant="neutral-secondary"
|
|
507
|
+
size="sm"
|
|
508
|
+
data-testid="copy-wc2-uri"
|
|
509
|
+
>
|
|
510
|
+
Copy link
|
|
511
|
+
<wui-icon size="sm" color="inherit" name="copy" slot="iconRight"></wui-icon>
|
|
512
|
+
</wui-button>`}};wt.styles=gt,ft([t.n({type:Boolean})],wt.prototype,"basic",void 0),wt=ft([t.customElement("w3m-connecting-wc-qrcode")],wt);var mt=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let bt=class extends e.i{constructor(){if(super(),this.wallet=e.RouterController.state.data?.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");e.EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:e.RouterController.state.view}})}render(){return e.b`
|
|
513
|
+
<wui-flex
|
|
514
|
+
flexDirection="column"
|
|
515
|
+
alignItems="center"
|
|
516
|
+
.padding=${["10","5","5","5"]}
|
|
517
|
+
gap="5"
|
|
518
|
+
>
|
|
519
|
+
<wui-wallet-image
|
|
520
|
+
size="lg"
|
|
521
|
+
imageSrc=${t.o(e.AssetUtil.getWalletImage(this.wallet))}
|
|
522
|
+
></wui-wallet-image>
|
|
523
|
+
|
|
524
|
+
<wui-text variant="md-regular" color="primary">Not Detected</wui-text>
|
|
525
|
+
</wui-flex>
|
|
526
|
+
|
|
527
|
+
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
|
|
528
|
+
`}};bt=mt([t.customElement("w3m-connecting-wc-unsupported")],bt);var yt=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let vt=class extends S{constructor(){if(super(),this.isLoading=!0,!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=e.ConstantsUtil$1.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(e.ConnectionController.subscribeKey("wcUri",(()=>{this.updateLoadingState()}))),e.EventsController.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web",displayIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:e.RouterController.state.view}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){if(this.wallet?.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:t,name:o}=this.wallet,{redirect:n,href:r}=e.CoreHelperUtil.formatUniversalUrl(t,this.uri);e.ConnectionController.setWcLinking({name:o,href:r}),e.ConnectionController.setRecentWallet(this.wallet),e.CoreHelperUtil.openHref(n,"_blank")}catch{this.error=!0}}};yt([t.r()],vt.prototype,"isLoading",void 0),vt=yt([t.customElement("w3m-connecting-wc-web")],vt);var Ct=e.css`
|
|
529
|
+
:host([data-mobile-fullscreen='true']) {
|
|
530
|
+
height: 100%;
|
|
531
|
+
display: flex;
|
|
532
|
+
flex-direction: column;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
:host([data-mobile-fullscreen='true']) wui-ux-by-reown {
|
|
536
|
+
margin-top: auto;
|
|
537
|
+
}
|
|
538
|
+
`,xt=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let $t=class extends e.i{constructor(){super(),this.wallet=e.RouterController.state.data?.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=Boolean(e.OptionsController.state.siwx),this.remoteFeatures=e.OptionsController.state.remoteFeatures,this.displayBranding=!0,this.basic=!1,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(e.OptionsController.subscribeKey("remoteFeatures",(e=>this.remoteFeatures=e)))}disconnectedCallback(){this.unsubscribe.forEach((e=>e()))}render(){return e.OptionsController.state.enableMobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),e.b`
|
|
539
|
+
${this.headerTemplate()}
|
|
540
|
+
<div class="platform-container">${this.platformTemplate()}</div>
|
|
541
|
+
${this.reownBrandingTemplate()}
|
|
542
|
+
`}reownBrandingTemplate(){return this.remoteFeatures?.reownBranding&&this.displayBranding?e.b`<wui-ux-by-reown></wui-ux-by-reown>`:null}async initializeConnection(t=!1){if("browser"!==this.platform&&(!e.OptionsController.state.manualWCControl||t))try{const{wcPairingExpiry:o,status:n}=e.ConnectionController.state,{redirectView:r}=e.RouterController.state.data??{};if(t||e.OptionsController.state.enableEmbedded||e.CoreHelperUtil.isPairingExpired(o)||"connecting"===n){const t=e.ConnectionController.getConnections(e.ChainController.state.activeChain),o=this.remoteFeatures?.multiWallet,n=t.length>0;await e.ConnectionController.connectWalletConnect({cache:"never"}),this.isSiwxEnabled||(n&&o?(e.RouterController.replace("ProfileWallets"),e.SnackController.showSuccess("New Wallet Added")):r?e.RouterController.replace(r):e.ModalController.close())}}catch(t){if(t instanceof Error&&t.message.includes("An error occurred when attempting to switch chain")&&!e.OptionsController.state.enableNetworkSwitch&&e.ChainController.state.activeChain)return e.ChainController.setActiveCaipNetwork(e.CaipNetworksUtil.getUnsupportedNetwork(`${e.ChainController.state.activeChain}:${e.ChainController.state.activeCaipNetwork?.id}`)),void e.ChainController.showUnsupportedChainUI();t instanceof e.AppKitError&&t.originalName===e.ErrorUtil.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?e.EventsController.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:t.message}}):e.EventsController.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:t?.message??"Unknown"}}),e.ConnectionController.setWcError(!0),e.SnackController.showError(t.message??"Connection error"),e.ConnectionController.resetWcConnection(),e.RouterController.goBack()}}determinePlatforms(){if(!this.wallet)return this.platforms.push("qrcode"),void(this.platform="qrcode");if(this.platform)return;const{mobile_link:t,desktop_link:o,webapp_link:n,injected:r,rdns:i}=this.wallet,s=r?.map((({injected_id:e})=>e)).filter(Boolean),a=[...i?[i]:s??[]],l=!e.OptionsController.state.isUniversalProvider&&a.length,c=t,d=n,u=e.ConnectionController.checkInstalled(a),h=l&&u,p=o&&!e.CoreHelperUtil.isMobile();h&&!e.ChainController.state.noAdapters&&this.platforms.push("browser"),c&&this.platforms.push(e.CoreHelperUtil.isMobile()?"mobile":"qrcode"),d&&this.platforms.push("web"),p&&this.platforms.push("desktop");const g=e.MobileWalletUtil.isCustomDeeplinkWallet(this.wallet.id,e.ChainController.state.activeChain);h||!l||e.ChainController.state.noAdapters||g||this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return e.b`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return e.b`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return e.b`
|
|
543
|
+
<w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}>
|
|
544
|
+
</w3m-connecting-wc-desktop>
|
|
545
|
+
`;case"mobile":return e.b`
|
|
546
|
+
<w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}>
|
|
547
|
+
</w3m-connecting-wc-mobile>
|
|
548
|
+
`;case"qrcode":return e.b`<w3m-connecting-wc-qrcode ?basic=${this.basic}></w3m-connecting-wc-qrcode>`;default:return e.b`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?e.b`
|
|
549
|
+
<w3m-connecting-header
|
|
550
|
+
.platforms=${this.platforms}
|
|
551
|
+
.onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
|
|
552
|
+
>
|
|
553
|
+
</w3m-connecting-header>
|
|
554
|
+
`:null}async onSelectPlatform(e){const t=this.shadowRoot?.querySelector("div");t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};$t.styles=Ct,xt([t.r()],$t.prototype,"platform",void 0),xt([t.r()],$t.prototype,"platforms",void 0),xt([t.r()],$t.prototype,"isSiwxEnabled",void 0),xt([t.r()],$t.prototype,"remoteFeatures",void 0),xt([t.n({type:Boolean})],$t.prototype,"displayBranding",void 0),xt([t.n({type:Boolean})],$t.prototype,"basic",void 0),$t=xt([t.customElement("w3m-connecting-wc-view")],$t);var kt=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};exports.W3mConnectingWcBasicView=class extends e.i{constructor(){super(),this.unsubscribe=[],this.isMobile=e.CoreHelperUtil.isMobile(),this.remoteFeatures=e.OptionsController.state.remoteFeatures,this.unsubscribe.push(e.OptionsController.subscribeKey("remoteFeatures",(e=>this.remoteFeatures=e)))}disconnectedCallback(){this.unsubscribe.forEach((e=>e()))}render(){if(this.isMobile){const{featured:t,recommended:o}=e.ApiController.state,{customWallets:n}=e.OptionsController.state,r=e.StorageUtil.getRecentWallets(),i=t.length||o.length||n?.length||r.length;return e.b`<wui-flex flexDirection="column" gap="2" .margin=${["1","3","3","3"]}>
|
|
555
|
+
${i?e.b`<w3m-connector-list></w3m-connector-list>`:null}
|
|
556
|
+
<w3m-all-wallets-widget></w3m-all-wallets-widget>
|
|
557
|
+
</wui-flex>`}return e.b`<wui-flex flexDirection="column" .padding=${["0","0","4","0"]}>
|
|
558
|
+
<w3m-connecting-wc-view ?basic=${!0} .displayBranding=${!1}></w3m-connecting-wc-view>
|
|
559
|
+
<wui-flex flexDirection="column" .padding=${["0","3","0","3"]}>
|
|
560
|
+
<w3m-all-wallets-widget></w3m-all-wallets-widget>
|
|
561
|
+
</wui-flex>
|
|
562
|
+
</wui-flex>
|
|
563
|
+
${this.reownBrandingTemplate()} `}reownBrandingTemplate(){return this.remoteFeatures?.reownBranding?e.b` <wui-flex flexDirection="column" .padding=${["1","0","1","0"]}>
|
|
564
|
+
<wui-ux-by-reown></wui-ux-by-reown>
|
|
565
|
+
</wui-flex>`:null}},kt([t.r()],exports.W3mConnectingWcBasicView.prototype,"isMobile",void 0),kt([t.r()],exports.W3mConnectingWcBasicView.prototype,"remoteFeatures",void 0),exports.W3mConnectingWcBasicView=kt([t.customElement("w3m-connecting-wc-basic-view")],exports.W3mConnectingWcBasicView);
|
|
566
|
+
/**
|
|
567
|
+
* @license
|
|
568
|
+
* Copyright 2020 Google LLC
|
|
569
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
570
|
+
*/
|
|
571
|
+
const Et=(e,t)=>{const o=e._$AN;if(void 0===o)return!1;for(const e of o)e._$AO?.(t,!1),Et(e,t);return!0},Rt=e=>{let t,o;do{if(void 0===(t=e._$AM))break;o=t._$AN,o.delete(e),e=t}while(0===o?.size)},At=e=>{for(let t;t=e._$AM;e=t){let o=t._$AN;if(void 0===o)t._$AN=o=new Set;else if(o.has(e))break;o.add(e),It(t)}};
|
|
572
|
+
/**
|
|
573
|
+
* @license
|
|
574
|
+
* Copyright 2017 Google LLC
|
|
575
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
576
|
+
*/function St(e){void 0!==this._$AN?(Rt(this),this._$AM=e,At(this)):this._$AM=e}function Tt(e,t=!1,o=0){const n=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(t)if(Array.isArray(n))for(let e=o;e<n.length;e++)Et(n[e],!1),Rt(n[e]);else null!=n&&(Et(n,!1),Rt(n));else Et(this,e)}const It=e=>{e.type==t.t.CHILD&&(e._$AP??=Tt,e._$AQ??=St)};class Pt extends t.i{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,o){super._$AT(e,t,o),At(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(Et(this,e),Rt(this))}setValue(e){if((e=>void 0===e.strings)(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}
|
|
577
|
+
/**
|
|
578
|
+
* @license
|
|
579
|
+
* Copyright 2020 Google LLC
|
|
580
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
581
|
+
*/const Lt=()=>new Ot;class Ot{}const Ut=new WeakMap,Bt=t.e(class extends Pt{render(t){return e.A}update(t,[o]){const n=o!==this.G;return n&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=o,this.ht=t.options?.host,this.rt(this.ct=t.element)),e.A}rt(e){if(void 0!==this.G)if(this.isConnected||(e=void 0),"function"==typeof this.G){const t=this.ht??globalThis;let o=Ut.get(t);void 0===o&&(o=new WeakMap,Ut.set(t,o)),void 0!==o.get(this.G)&&this.G.call(this.ht,void 0),o.set(this.G,e),void 0!==e&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return"function"==typeof this.G?Ut.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var jt=e.css`
|
|
582
|
+
:host {
|
|
583
|
+
display: flex;
|
|
584
|
+
align-items: center;
|
|
585
|
+
justify-content: center;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
label {
|
|
589
|
+
position: relative;
|
|
590
|
+
display: inline-block;
|
|
591
|
+
user-select: none;
|
|
592
|
+
transition:
|
|
593
|
+
background-color ${({durations:e})=>e.lg}
|
|
594
|
+
${({easings:e})=>e["ease-out-power-2"]},
|
|
595
|
+
color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
|
|
596
|
+
border ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
|
|
597
|
+
box-shadow ${({durations:e})=>e.lg}
|
|
598
|
+
${({easings:e})=>e["ease-out-power-2"]},
|
|
599
|
+
width ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
|
|
600
|
+
height ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
|
|
601
|
+
transform ${({durations:e})=>e.lg}
|
|
602
|
+
${({easings:e})=>e["ease-out-power-2"]},
|
|
603
|
+
opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
|
|
604
|
+
will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
input {
|
|
608
|
+
width: 0;
|
|
609
|
+
height: 0;
|
|
610
|
+
opacity: 0;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
span {
|
|
614
|
+
position: absolute;
|
|
615
|
+
cursor: pointer;
|
|
616
|
+
top: 0;
|
|
617
|
+
left: 0;
|
|
618
|
+
right: 0;
|
|
619
|
+
bottom: 0;
|
|
620
|
+
background-color: ${({colors:e})=>e.neutrals300};
|
|
621
|
+
border-radius: ${({borderRadius:e})=>e.round};
|
|
622
|
+
border: 1px solid transparent;
|
|
623
|
+
will-change: border;
|
|
624
|
+
transition:
|
|
625
|
+
background-color ${({durations:e})=>e.lg}
|
|
626
|
+
${({easings:e})=>e["ease-out-power-2"]},
|
|
627
|
+
color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
|
|
628
|
+
border ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
|
|
629
|
+
box-shadow ${({durations:e})=>e.lg}
|
|
630
|
+
${({easings:e})=>e["ease-out-power-2"]},
|
|
631
|
+
width ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
|
|
632
|
+
height ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
|
|
633
|
+
transform ${({durations:e})=>e.lg}
|
|
634
|
+
${({easings:e})=>e["ease-out-power-2"]},
|
|
635
|
+
opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
|
|
636
|
+
will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
span:before {
|
|
640
|
+
content: '';
|
|
641
|
+
position: absolute;
|
|
642
|
+
background-color: ${({colors:e})=>e.white};
|
|
643
|
+
border-radius: 50%;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/* -- Sizes --------------------------------------------------------- */
|
|
647
|
+
label[data-size='lg'] {
|
|
648
|
+
width: 48px;
|
|
649
|
+
height: 32px;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
label[data-size='md'] {
|
|
653
|
+
width: 40px;
|
|
654
|
+
height: 28px;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
label[data-size='sm'] {
|
|
658
|
+
width: 32px;
|
|
659
|
+
height: 22px;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
label[data-size='lg'] > span:before {
|
|
663
|
+
height: 24px;
|
|
664
|
+
width: 24px;
|
|
665
|
+
left: 4px;
|
|
666
|
+
top: 3px;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
label[data-size='md'] > span:before {
|
|
670
|
+
height: 20px;
|
|
671
|
+
width: 20px;
|
|
672
|
+
left: 4px;
|
|
673
|
+
top: 3px;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
label[data-size='sm'] > span:before {
|
|
677
|
+
height: 16px;
|
|
678
|
+
width: 16px;
|
|
679
|
+
left: 3px;
|
|
680
|
+
top: 2px;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
/* -- Focus states --------------------------------------------------- */
|
|
684
|
+
input:focus-visible:not(:checked) + span,
|
|
685
|
+
input:focus:not(:checked) + span {
|
|
686
|
+
border: 1px solid ${({tokens:e})=>e.core.iconAccentPrimary};
|
|
687
|
+
background-color: ${({tokens:e})=>e.theme.textTertiary};
|
|
688
|
+
box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
input:focus-visible:checked + span,
|
|
692
|
+
input:focus:checked + span {
|
|
693
|
+
border: 1px solid ${({tokens:e})=>e.core.iconAccentPrimary};
|
|
694
|
+
box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/* -- Checked states --------------------------------------------------- */
|
|
698
|
+
input:checked + span {
|
|
699
|
+
background-color: ${({tokens:e})=>e.core.iconAccentPrimary};
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
label[data-size='lg'] > input:checked + span:before {
|
|
703
|
+
transform: translateX(calc(100% - 9px));
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
label[data-size='md'] > input:checked + span:before {
|
|
707
|
+
transform: translateX(calc(100% - 9px));
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
label[data-size='sm'] > input:checked + span:before {
|
|
711
|
+
transform: translateX(calc(100% - 7px));
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/* -- Hover states ------------------------------------------------------- */
|
|
715
|
+
label:hover > input:not(:checked):not(:disabled) + span {
|
|
716
|
+
background-color: ${({colors:e})=>e.neutrals400};
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
label:hover > input:checked:not(:disabled) + span {
|
|
720
|
+
background-color: ${({colors:e})=>e.accent080};
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
/* -- Disabled state --------------------------------------------------- */
|
|
724
|
+
label:has(input:disabled) {
|
|
725
|
+
pointer-events: none;
|
|
726
|
+
user-select: none;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
input:not(:checked):disabled + span {
|
|
730
|
+
background-color: ${({colors:e})=>e.neutrals700};
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
input:checked:disabled + span {
|
|
734
|
+
background-color: ${({colors:e})=>e.neutrals700};
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
input:not(:checked):disabled + span::before {
|
|
738
|
+
background-color: ${({colors:e})=>e.neutrals400};
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
input:checked:disabled + span::before {
|
|
742
|
+
background-color: ${({tokens:e})=>e.theme.textTertiary};
|
|
743
|
+
}
|
|
744
|
+
`,Wt=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let Nt=class extends e.i{constructor(){super(...arguments),this.inputElementRef=Lt(),this.checked=!1,this.disabled=!1,this.size="md"}render(){return e.b`
|
|
745
|
+
<label data-size=${this.size}>
|
|
746
|
+
<input
|
|
747
|
+
${Bt(this.inputElementRef)}
|
|
748
|
+
type="checkbox"
|
|
749
|
+
?checked=${this.checked}
|
|
750
|
+
?disabled=${this.disabled}
|
|
751
|
+
@change=${this.dispatchChangeEvent.bind(this)}
|
|
752
|
+
/>
|
|
753
|
+
<span></span>
|
|
754
|
+
</label>
|
|
755
|
+
`}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("switchChange",{detail:this.inputElementRef.value?.checked,bubbles:!0,composed:!0}))}};Nt.styles=[e.resetStyles,e.elementStyles,jt],Wt([t.n({type:Boolean})],Nt.prototype,"checked",void 0),Wt([t.n({type:Boolean})],Nt.prototype,"disabled",void 0),Wt([t.n()],Nt.prototype,"size",void 0),Nt=Wt([t.customElement("wui-toggle")],Nt);var _t=e.css`
|
|
756
|
+
:host {
|
|
757
|
+
height: auto;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
:host > wui-flex {
|
|
761
|
+
height: 100%;
|
|
762
|
+
display: flex;
|
|
763
|
+
align-items: center;
|
|
764
|
+
justify-content: center;
|
|
765
|
+
column-gap: ${({spacing:e})=>e[2]};
|
|
766
|
+
padding: ${({spacing:e})=>e[2]} ${({spacing:e})=>e[3]};
|
|
767
|
+
background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
768
|
+
border-radius: ${({borderRadius:e})=>e[4]};
|
|
769
|
+
box-shadow: inset 0 0 0 1px ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
770
|
+
transition: background-color ${({durations:e})=>e.lg}
|
|
771
|
+
${({easings:e})=>e["ease-out-power-2"]};
|
|
772
|
+
will-change: background-color;
|
|
773
|
+
cursor: pointer;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
wui-switch {
|
|
777
|
+
pointer-events: none;
|
|
778
|
+
}
|
|
779
|
+
`,Mt=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let zt=class extends e.i{constructor(){super(...arguments),this.checked=!1}render(){return e.b`
|
|
780
|
+
<wui-flex>
|
|
781
|
+
<wui-icon size="xl" name="walletConnectBrown"></wui-icon>
|
|
782
|
+
<wui-toggle
|
|
783
|
+
?checked=${this.checked}
|
|
784
|
+
size="sm"
|
|
785
|
+
@switchChange=${this.handleToggleChange.bind(this)}
|
|
786
|
+
></wui-toggle>
|
|
787
|
+
</wui-flex>
|
|
788
|
+
`}handleToggleChange(e){e.stopPropagation(),this.checked=e.detail,this.dispatchSwitchEvent()}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("certifiedSwitchChange",{detail:this.checked,bubbles:!0,composed:!0}))}};zt.styles=[e.resetStyles,e.elementStyles,_t],Mt([t.n({type:Boolean})],zt.prototype,"checked",void 0),zt=Mt([t.customElement("wui-certified-switch")],zt);var Dt=e.css`
|
|
789
|
+
:host {
|
|
790
|
+
position: relative;
|
|
791
|
+
width: 100%;
|
|
792
|
+
display: inline-flex;
|
|
793
|
+
flex-direction: column;
|
|
794
|
+
gap: ${({spacing:e})=>e[3]};
|
|
795
|
+
color: ${({tokens:e})=>e.theme.textPrimary};
|
|
796
|
+
caret-color: ${({tokens:e})=>e.core.textAccentPrimary};
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
.wui-input-text-container {
|
|
800
|
+
position: relative;
|
|
801
|
+
display: flex;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
input {
|
|
805
|
+
width: 100%;
|
|
806
|
+
border-radius: ${({borderRadius:e})=>e[4]};
|
|
807
|
+
color: inherit;
|
|
808
|
+
background: transparent;
|
|
809
|
+
border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
|
|
810
|
+
caret-color: ${({tokens:e})=>e.core.textAccentPrimary};
|
|
811
|
+
padding: ${({spacing:e})=>e[3]} ${({spacing:e})=>e[3]}
|
|
812
|
+
${({spacing:e})=>e[3]} ${({spacing:e})=>e[10]};
|
|
813
|
+
font-size: ${({textSize:e})=>e.large};
|
|
814
|
+
line-height: ${({typography:e})=>e["lg-regular"].lineHeight};
|
|
815
|
+
letter-spacing: ${({typography:e})=>e["lg-regular"].letterSpacing};
|
|
816
|
+
font-weight: ${({fontWeight:e})=>e.regular};
|
|
817
|
+
font-family: ${({fontFamily:e})=>e.regular};
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
input[data-size='lg'] {
|
|
821
|
+
padding: ${({spacing:e})=>e[4]} ${({spacing:e})=>e[3]}
|
|
822
|
+
${({spacing:e})=>e[4]} ${({spacing:e})=>e[10]};
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
@media (hover: hover) and (pointer: fine) {
|
|
826
|
+
input:hover:enabled {
|
|
827
|
+
border: 1px solid ${({tokens:e})=>e.theme.borderSecondary};
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
input:disabled {
|
|
832
|
+
cursor: unset;
|
|
833
|
+
border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
input::placeholder {
|
|
837
|
+
color: ${({tokens:e})=>e.theme.textSecondary};
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
input:focus:enabled {
|
|
841
|
+
border: 1px solid ${({tokens:e})=>e.theme.borderSecondary};
|
|
842
|
+
background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
843
|
+
-webkit-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
|
|
844
|
+
-moz-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
|
|
845
|
+
box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
div.wui-input-text-container:has(input:disabled) {
|
|
849
|
+
opacity: 0.5;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
wui-icon.wui-input-text-left-icon {
|
|
853
|
+
position: absolute;
|
|
854
|
+
top: 50%;
|
|
855
|
+
transform: translateY(-50%);
|
|
856
|
+
pointer-events: none;
|
|
857
|
+
left: ${({spacing:e})=>e[4]};
|
|
858
|
+
color: ${({tokens:e})=>e.theme.iconDefault};
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
button.wui-input-text-submit-button {
|
|
862
|
+
position: absolute;
|
|
863
|
+
top: 50%;
|
|
864
|
+
transform: translateY(-50%);
|
|
865
|
+
right: ${({spacing:e})=>e[3]};
|
|
866
|
+
width: 24px;
|
|
867
|
+
height: 24px;
|
|
868
|
+
border: none;
|
|
869
|
+
background: transparent;
|
|
870
|
+
border-radius: ${({borderRadius:e})=>e[2]};
|
|
871
|
+
color: ${({tokens:e})=>e.core.textAccentPrimary};
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
button.wui-input-text-submit-button:disabled {
|
|
875
|
+
opacity: 1;
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
button.wui-input-text-submit-button.loading wui-icon {
|
|
879
|
+
animation: spin 1s linear infinite;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
button.wui-input-text-submit-button:hover {
|
|
883
|
+
background: ${({tokens:e})=>e.core.foregroundAccent010};
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
input:has(+ .wui-input-text-submit-button) {
|
|
887
|
+
padding-right: ${({spacing:e})=>e[12]};
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
input[type='number'] {
|
|
891
|
+
-moz-appearance: textfield;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
input[type='search']::-webkit-search-decoration,
|
|
895
|
+
input[type='search']::-webkit-search-cancel-button,
|
|
896
|
+
input[type='search']::-webkit-search-results-button,
|
|
897
|
+
input[type='search']::-webkit-search-results-decoration {
|
|
898
|
+
-webkit-appearance: none;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
/* -- Keyframes --------------------------------------------------- */
|
|
902
|
+
@keyframes spin {
|
|
903
|
+
from {
|
|
904
|
+
transform: rotate(0deg);
|
|
905
|
+
}
|
|
906
|
+
to {
|
|
907
|
+
transform: rotate(360deg);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
`,Ht=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let qt=class extends e.i{constructor(){super(...arguments),this.inputElementRef=Lt(),this.disabled=!1,this.loading=!1,this.placeholder="",this.type="text",this.value="",this.size="md"}render(){return e.b` <div class="wui-input-text-container">
|
|
911
|
+
${this.templateLeftIcon()}
|
|
912
|
+
<input
|
|
913
|
+
data-size=${this.size}
|
|
914
|
+
${Bt(this.inputElementRef)}
|
|
915
|
+
data-testid="wui-input-text"
|
|
916
|
+
type=${this.type}
|
|
917
|
+
enterkeyhint=${t.o(this.enterKeyHint)}
|
|
918
|
+
?disabled=${this.disabled}
|
|
919
|
+
placeholder=${this.placeholder}
|
|
920
|
+
@input=${this.dispatchInputChangeEvent.bind(this)}
|
|
921
|
+
@keydown=${this.onKeyDown}
|
|
922
|
+
.value=${this.value||""}
|
|
923
|
+
/>
|
|
924
|
+
${this.templateSubmitButton()}
|
|
925
|
+
<slot class="wui-input-text-slot"></slot>
|
|
926
|
+
</div>
|
|
927
|
+
${this.templateError()} ${this.templateWarning()}`}templateLeftIcon(){return this.icon?e.b`<wui-icon
|
|
928
|
+
class="wui-input-text-left-icon"
|
|
929
|
+
size="md"
|
|
930
|
+
data-size=${this.size}
|
|
931
|
+
color="inherit"
|
|
932
|
+
name=${this.icon}
|
|
933
|
+
></wui-icon>`:null}templateSubmitButton(){return this.onSubmit?e.b`<button
|
|
934
|
+
class="wui-input-text-submit-button ${this.loading?"loading":""}"
|
|
935
|
+
@click=${this.onSubmit?.bind(this)}
|
|
936
|
+
?disabled=${this.disabled||this.loading}
|
|
937
|
+
>
|
|
938
|
+
${this.loading?e.b`<wui-icon name="spinner" size="md"></wui-icon>`:e.b`<wui-icon name="chevronRight" size="md"></wui-icon>`}
|
|
939
|
+
</button>`:null}templateError(){return this.errorText?e.b`<wui-text variant="sm-regular" color="error">${this.errorText}</wui-text>`:null}templateWarning(){return this.warningText?e.b`<wui-text variant="sm-regular" color="warning">${this.warningText}</wui-text>`:null}dispatchInputChangeEvent(){this.dispatchEvent(new CustomEvent("inputChange",{detail:this.inputElementRef.value?.value,bubbles:!0,composed:!0}))}};qt.styles=[e.resetStyles,e.elementStyles,Dt],Ht([t.n()],qt.prototype,"icon",void 0),Ht([t.n({type:Boolean})],qt.prototype,"disabled",void 0),Ht([t.n({type:Boolean})],qt.prototype,"loading",void 0),Ht([t.n()],qt.prototype,"placeholder",void 0),Ht([t.n()],qt.prototype,"type",void 0),Ht([t.n()],qt.prototype,"value",void 0),Ht([t.n()],qt.prototype,"errorText",void 0),Ht([t.n()],qt.prototype,"warningText",void 0),Ht([t.n()],qt.prototype,"onSubmit",void 0),Ht([t.n()],qt.prototype,"size",void 0),Ht([t.n({attribute:!1})],qt.prototype,"onKeyDown",void 0),qt=Ht([t.customElement("wui-input-text")],qt);var Vt=e.css`
|
|
940
|
+
:host {
|
|
941
|
+
position: relative;
|
|
942
|
+
display: inline-block;
|
|
943
|
+
width: 100%;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
wui-icon {
|
|
947
|
+
position: absolute;
|
|
948
|
+
top: 50%;
|
|
949
|
+
transform: translateY(-50%);
|
|
950
|
+
right: ${({spacing:e})=>e[3]};
|
|
951
|
+
color: ${({tokens:e})=>e.theme.iconDefault};
|
|
952
|
+
cursor: pointer;
|
|
953
|
+
padding: ${({spacing:e})=>e[2]};
|
|
954
|
+
background-color: transparent;
|
|
955
|
+
border-radius: ${({borderRadius:e})=>e[4]};
|
|
956
|
+
transition: background-color ${({durations:e})=>e.lg}
|
|
957
|
+
${({easings:e})=>e["ease-out-power-2"]};
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
@media (hover: hover) {
|
|
961
|
+
wui-icon:hover {
|
|
962
|
+
background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
`,Ft=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let Kt=class extends e.i{constructor(){super(...arguments),this.inputComponentRef=Lt(),this.inputValue=""}render(){return e.b`
|
|
966
|
+
<wui-input-text
|
|
967
|
+
${Bt(this.inputComponentRef)}
|
|
968
|
+
placeholder="Search wallet"
|
|
969
|
+
icon="search"
|
|
970
|
+
type="search"
|
|
971
|
+
enterKeyHint="search"
|
|
972
|
+
size="sm"
|
|
973
|
+
@inputChange=${this.onInputChange}
|
|
974
|
+
>
|
|
975
|
+
${this.inputValue?e.b`<wui-icon
|
|
976
|
+
@click=${this.clearValue}
|
|
977
|
+
color="inherit"
|
|
978
|
+
size="sm"
|
|
979
|
+
name="close"
|
|
980
|
+
></wui-icon>`:null}
|
|
981
|
+
</wui-input-text>
|
|
982
|
+
`}onInputChange(e){this.inputValue=e.detail||""}clearValue(){const e=this.inputComponentRef.value,t=e?.inputElementRef.value;t&&(t.value="",this.inputValue="",t.focus(),t.dispatchEvent(new Event("input")))}};Kt.styles=[e.resetStyles,Vt],Ft([t.n()],Kt.prototype,"inputValue",void 0),Kt=Ft([t.customElement("wui-search-bar")],Kt);var Yt=e.css`
|
|
983
|
+
:host {
|
|
984
|
+
display: flex;
|
|
985
|
+
flex-direction: column;
|
|
986
|
+
justify-content: center;
|
|
987
|
+
align-items: center;
|
|
988
|
+
height: 104px;
|
|
989
|
+
width: 104px;
|
|
990
|
+
row-gap: ${({spacing:e})=>e[2]};
|
|
991
|
+
background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
992
|
+
border-radius: ${({borderRadius:e})=>e[5]};
|
|
993
|
+
position: relative;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
wui-shimmer[data-type='network'] {
|
|
997
|
+
border: none;
|
|
998
|
+
-webkit-clip-path: var(--apkt-path-network);
|
|
999
|
+
clip-path: var(--apkt-path-network);
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
svg {
|
|
1003
|
+
position: absolute;
|
|
1004
|
+
width: 48px;
|
|
1005
|
+
height: 54px;
|
|
1006
|
+
z-index: 1;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
svg > path {
|
|
1010
|
+
stroke: ${({tokens:e})=>e.theme.foregroundSecondary};
|
|
1011
|
+
stroke-width: 1px;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
@media (max-width: 350px) {
|
|
1015
|
+
:host {
|
|
1016
|
+
width: 100%;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
`,Jt=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let Qt=class extends e.i{constructor(){super(...arguments),this.type="wallet"}render(){return e.b`
|
|
1020
|
+
${this.shimmerTemplate()}
|
|
1021
|
+
<wui-shimmer width="80px" height="20px"></wui-shimmer>
|
|
1022
|
+
`}shimmerTemplate(){return"network"===this.type?e.b` <wui-shimmer data-type=${this.type} width="48px" height="54px"></wui-shimmer>
|
|
1023
|
+
${t.networkSvgMd}`:e.b`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}};Qt.styles=[e.resetStyles,e.elementStyles,Yt],Jt([t.n()],Qt.prototype,"type",void 0),Qt=Jt([t.customElement("wui-card-select-loader")],Qt);var Gt=e.i$1`
|
|
1024
|
+
:host {
|
|
1025
|
+
display: grid;
|
|
1026
|
+
width: inherit;
|
|
1027
|
+
height: inherit;
|
|
1028
|
+
}
|
|
1029
|
+
`,Xt=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let Zt=class extends e.i{render(){return this.style.cssText=`\n grid-template-rows: ${this.gridTemplateRows};\n grid-template-columns: ${this.gridTemplateColumns};\n justify-items: ${this.justifyItems};\n align-items: ${this.alignItems};\n justify-content: ${this.justifyContent};\n align-content: ${this.alignContent};\n column-gap: ${this.columnGap&&`var(--apkt-spacing-${this.columnGap})`};\n row-gap: ${this.rowGap&&`var(--apkt-spacing-${this.rowGap})`};\n gap: ${this.gap&&`var(--apkt-spacing-${this.gap})`};\n padding-top: ${this.padding&&t.UiHelperUtil.getSpacingStyles(this.padding,0)};\n padding-right: ${this.padding&&t.UiHelperUtil.getSpacingStyles(this.padding,1)};\n padding-bottom: ${this.padding&&t.UiHelperUtil.getSpacingStyles(this.padding,2)};\n padding-left: ${this.padding&&t.UiHelperUtil.getSpacingStyles(this.padding,3)};\n margin-top: ${this.margin&&t.UiHelperUtil.getSpacingStyles(this.margin,0)};\n margin-right: ${this.margin&&t.UiHelperUtil.getSpacingStyles(this.margin,1)};\n margin-bottom: ${this.margin&&t.UiHelperUtil.getSpacingStyles(this.margin,2)};\n margin-left: ${this.margin&&t.UiHelperUtil.getSpacingStyles(this.margin,3)};\n `,e.b`<slot></slot>`}};Zt.styles=[e.resetStyles,Gt],Xt([t.n()],Zt.prototype,"gridTemplateRows",void 0),Xt([t.n()],Zt.prototype,"gridTemplateColumns",void 0),Xt([t.n()],Zt.prototype,"justifyItems",void 0),Xt([t.n()],Zt.prototype,"alignItems",void 0),Xt([t.n()],Zt.prototype,"justifyContent",void 0),Xt([t.n()],Zt.prototype,"alignContent",void 0),Xt([t.n()],Zt.prototype,"columnGap",void 0),Xt([t.n()],Zt.prototype,"rowGap",void 0),Xt([t.n()],Zt.prototype,"gap",void 0),Xt([t.n()],Zt.prototype,"padding",void 0),Xt([t.n()],Zt.prototype,"margin",void 0),Zt=Xt([t.customElement("wui-grid")],Zt);var eo=e.css`
|
|
1030
|
+
button {
|
|
1031
|
+
display: flex;
|
|
1032
|
+
flex-direction: column;
|
|
1033
|
+
justify-content: center;
|
|
1034
|
+
align-items: center;
|
|
1035
|
+
cursor: pointer;
|
|
1036
|
+
width: 104px;
|
|
1037
|
+
row-gap: ${({spacing:e})=>e[2]};
|
|
1038
|
+
padding: ${({spacing:e})=>e[3]} ${({spacing:e})=>e[0]};
|
|
1039
|
+
background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
|
|
1040
|
+
border-radius: clamp(0px, ${({borderRadius:e})=>e[4]}, 20px);
|
|
1041
|
+
transition:
|
|
1042
|
+
color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-1"]},
|
|
1043
|
+
background-color ${({durations:e})=>e.lg}
|
|
1044
|
+
${({easings:e})=>e["ease-out-power-1"]},
|
|
1045
|
+
border-radius ${({durations:e})=>e.lg}
|
|
1046
|
+
${({easings:e})=>e["ease-out-power-1"]};
|
|
1047
|
+
will-change: background-color, color, border-radius;
|
|
1048
|
+
outline: none;
|
|
1049
|
+
border: none;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
button > wui-flex > wui-text {
|
|
1053
|
+
color: ${({tokens:e})=>e.theme.textPrimary};
|
|
1054
|
+
max-width: 86px;
|
|
1055
|
+
white-space: nowrap;
|
|
1056
|
+
overflow: hidden;
|
|
1057
|
+
text-overflow: ellipsis;
|
|
1058
|
+
justify-content: center;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
button > wui-flex > wui-text.certified {
|
|
1062
|
+
max-width: 66px;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
@media (hover: hover) and (pointer: fine) {
|
|
1066
|
+
button:hover:enabled {
|
|
1067
|
+
background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
button:disabled > wui-flex > wui-text {
|
|
1072
|
+
color: ${({tokens:e})=>e.core.glass010};
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
[data-selected='true'] {
|
|
1076
|
+
background-color: ${({colors:e})=>e.accent020};
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
@media (hover: hover) and (pointer: fine) {
|
|
1080
|
+
[data-selected='true']:hover:enabled {
|
|
1081
|
+
background-color: ${({colors:e})=>e.accent010};
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
[data-selected='true']:active:enabled {
|
|
1086
|
+
background-color: ${({colors:e})=>e.accent010};
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
@media (max-width: 350px) {
|
|
1090
|
+
button {
|
|
1091
|
+
width: 100%;
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
`,to=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let oo=class extends e.i{constructor(){super(),this.observer=new IntersectionObserver((()=>{})),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.isImpressed=!1,this.explorerId="",this.walletQuery="",this.certified=!1,this.displayIndex=0,this.wallet=void 0,this.observer=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting?(this.visible=!0,this.fetchImageSrc(),this.sendImpressionEvent()):this.visible=!1}))}),{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){const o="certified"===this.wallet?.badge_type;return e.b`
|
|
1095
|
+
<button>
|
|
1096
|
+
${this.imageTemplate()}
|
|
1097
|
+
<wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="1">
|
|
1098
|
+
<wui-text
|
|
1099
|
+
variant="md-regular"
|
|
1100
|
+
color="inherit"
|
|
1101
|
+
class=${t.o(o?"certified":void 0)}
|
|
1102
|
+
>${this.wallet?.name}</wui-text
|
|
1103
|
+
>
|
|
1104
|
+
${o?e.b`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>`:null}
|
|
1105
|
+
</wui-flex>
|
|
1106
|
+
</button>
|
|
1107
|
+
`}imageTemplate(){return!this.visible&&!this.imageSrc||this.imageLoading?this.shimmerTemplate():e.b`
|
|
1108
|
+
<wui-wallet-image
|
|
1109
|
+
size="lg"
|
|
1110
|
+
imageSrc=${t.o(this.imageSrc)}
|
|
1111
|
+
name=${t.o(this.wallet?.name)}
|
|
1112
|
+
.installed=${this.wallet?.installed??!1}
|
|
1113
|
+
badgeSize="sm"
|
|
1114
|
+
>
|
|
1115
|
+
</wui-wallet-image>
|
|
1116
|
+
`}shimmerTemplate(){return e.b`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}async fetchImageSrc(){this.wallet&&(this.imageSrc=e.AssetUtil.getWalletImage(this.wallet),this.imageSrc||(this.imageLoading=!0,this.imageSrc=await e.AssetUtil.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}sendImpressionEvent(){this.wallet&&!this.isImpressed&&(this.isImpressed=!0,e.EventsController.sendWalletImpressionEvent({name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.explorerId,view:e.RouterController.state.view,query:this.walletQuery,certified:this.certified,displayIndex:this.displayIndex}))}};oo.styles=eo,to([t.r()],oo.prototype,"visible",void 0),to([t.r()],oo.prototype,"imageSrc",void 0),to([t.r()],oo.prototype,"imageLoading",void 0),to([t.r()],oo.prototype,"isImpressed",void 0),to([t.n()],oo.prototype,"explorerId",void 0),to([t.n()],oo.prototype,"walletQuery",void 0),to([t.n()],oo.prototype,"certified",void 0),to([t.n()],oo.prototype,"displayIndex",void 0),to([t.n({type:Object})],oo.prototype,"wallet",void 0),oo=to([t.customElement("w3m-all-wallets-list-item")],oo);var no=e.css`
|
|
1117
|
+
wui-grid {
|
|
1118
|
+
max-height: clamp(360px, 400px, 80vh);
|
|
1119
|
+
overflow: scroll;
|
|
1120
|
+
scrollbar-width: none;
|
|
1121
|
+
grid-auto-rows: min-content;
|
|
1122
|
+
grid-template-columns: repeat(auto-fill, 104px);
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
:host([data-mobile-fullscreen='true']) wui-grid {
|
|
1126
|
+
max-height: none;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
@media (max-width: 350px) {
|
|
1130
|
+
wui-grid {
|
|
1131
|
+
grid-template-columns: repeat(2, 1fr);
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
wui-grid[data-scroll='false'] {
|
|
1136
|
+
overflow: hidden;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
wui-grid::-webkit-scrollbar {
|
|
1140
|
+
display: none;
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
w3m-all-wallets-list-item {
|
|
1144
|
+
opacity: 0;
|
|
1145
|
+
animation-duration: ${({durations:e})=>e.xl};
|
|
1146
|
+
animation-timing-function: ${({easings:e})=>e["ease-inout-power-2"]};
|
|
1147
|
+
animation-name: fade-in;
|
|
1148
|
+
animation-fill-mode: forwards;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
@keyframes fade-in {
|
|
1152
|
+
from {
|
|
1153
|
+
opacity: 0;
|
|
1154
|
+
}
|
|
1155
|
+
to {
|
|
1156
|
+
opacity: 1;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
wui-loading-spinner {
|
|
1161
|
+
padding-top: ${({spacing:e})=>e[4]};
|
|
1162
|
+
padding-bottom: ${({spacing:e})=>e[4]};
|
|
1163
|
+
justify-content: center;
|
|
1164
|
+
grid-column: 1 / span 4;
|
|
1165
|
+
}
|
|
1166
|
+
`,ro=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};const io="local-paginator";let so=class extends e.i{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!e.ApiController.state.wallets.length,this.wallets=e.ApiController.state.wallets,this.mobileFullScreen=e.OptionsController.state.enableMobileFullScreen,this.unsubscribe.push(e.ApiController.subscribeKey("wallets",(e=>this.wallets=e)))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach((e=>e())),this.paginationObserver?.disconnect()}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),e.b`
|
|
1167
|
+
<wui-grid
|
|
1168
|
+
data-scroll=${!this.loading}
|
|
1169
|
+
.padding=${["0","3","3","3"]}
|
|
1170
|
+
gap="2"
|
|
1171
|
+
justifyContent="space-between"
|
|
1172
|
+
>
|
|
1173
|
+
${this.loading?this.shimmerTemplate(16):this.walletsTemplate()}
|
|
1174
|
+
${this.paginationLoaderTemplate()}
|
|
1175
|
+
</wui-grid>
|
|
1176
|
+
`}async initialFetch(){this.loading=!0;const t=this.shadowRoot?.querySelector("wui-grid");t&&(await e.ApiController.fetchWalletsByPage({page:1}),await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.loading=!1,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(o,n){return[...Array(o)].map((()=>e.b`
|
|
1177
|
+
<wui-card-select-loader type="wallet" id=${t.o(n)}></wui-card-select-loader>
|
|
1178
|
+
`))}walletsTemplate(){return e.WalletUtil.getWalletConnectWallets(this.wallets).map(((t,o)=>e.b`
|
|
1179
|
+
<w3m-all-wallets-list-item
|
|
1180
|
+
data-testid="wallet-search-item-${t.id}"
|
|
1181
|
+
@click=${()=>this.onConnectWallet(t)}
|
|
1182
|
+
.wallet=${t}
|
|
1183
|
+
explorerId=${t.id}
|
|
1184
|
+
certified=${"certified"===this.badge}
|
|
1185
|
+
displayIndex=${o}
|
|
1186
|
+
></w3m-all-wallets-list-item>
|
|
1187
|
+
`))}paginationLoaderTemplate(){const{wallets:t,recommended:o,featured:n,count:r,mobileFilteredOutWalletsLength:i}=e.ApiController.state,s=window.innerWidth<352?3:4,a=t.length+o.length;let l=Math.ceil(a/s)*s-a+s;return l-=t.length?n.length%s:0,0===r&&n.length>0?null:0===r||[...n,...t,...o].length<r-(i??0)?this.shimmerTemplate(l,io):null}createPaginationObserver(){const t=this.shadowRoot?.querySelector(`#${io}`);t&&(this.paginationObserver=new IntersectionObserver((([t])=>{if(t?.isIntersecting&&!this.loading){const{page:t,count:o,wallets:n}=e.ApiController.state;n.length<o&&e.ApiController.fetchWalletsByPage({page:t+1})}})),this.paginationObserver.observe(t))}onConnectWallet(t){e.ConnectorController.selectWalletConnector(t)}};so.styles=no,ro([t.r()],so.prototype,"loading",void 0),ro([t.r()],so.prototype,"wallets",void 0),ro([t.r()],so.prototype,"badge",void 0),ro([t.r()],so.prototype,"mobileFullScreen",void 0),so=ro([t.customElement("w3m-all-wallets-list")],so);var ao=e.i$1`
|
|
1188
|
+
wui-grid,
|
|
1189
|
+
wui-loading-spinner,
|
|
1190
|
+
wui-flex {
|
|
1191
|
+
height: 360px;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
wui-grid {
|
|
1195
|
+
overflow: scroll;
|
|
1196
|
+
scrollbar-width: none;
|
|
1197
|
+
grid-auto-rows: min-content;
|
|
1198
|
+
grid-template-columns: repeat(auto-fill, 104px);
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
:host([data-mobile-fullscreen='true']) wui-grid {
|
|
1202
|
+
max-height: none;
|
|
1203
|
+
height: auto;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
wui-grid[data-scroll='false'] {
|
|
1207
|
+
overflow: hidden;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
wui-grid::-webkit-scrollbar {
|
|
1211
|
+
display: none;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
wui-loading-spinner {
|
|
1215
|
+
justify-content: center;
|
|
1216
|
+
align-items: center;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
@media (max-width: 350px) {
|
|
1220
|
+
wui-grid {
|
|
1221
|
+
grid-template-columns: repeat(2, 1fr);
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
`,lo=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};let co=class extends e.i{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.mobileFullScreen=e.OptionsController.state.enableMobileFullScreen,this.query=""}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.onSearch(),this.loading?e.b`<wui-loading-spinner color="accent-primary"></wui-loading-spinner>`:this.walletsTemplate()}async onSearch(){this.query.trim()===this.prevQuery.trim()&&this.badge===this.prevBadge||(this.prevQuery=this.query,this.prevBadge=this.badge,this.loading=!0,await e.ApiController.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){const{search:t}=e.ApiController.state,o=e.WalletUtil.markWalletsAsInstalled(t),n=e.WalletUtil.filterWalletsByWcSupport(o);return n.length?e.b`
|
|
1225
|
+
<wui-grid
|
|
1226
|
+
data-testid="wallet-list"
|
|
1227
|
+
.padding=${["0","3","3","3"]}
|
|
1228
|
+
rowGap="4"
|
|
1229
|
+
columngap="2"
|
|
1230
|
+
justifyContent="space-between"
|
|
1231
|
+
>
|
|
1232
|
+
${n.map(((t,o)=>e.b`
|
|
1233
|
+
<w3m-all-wallets-list-item
|
|
1234
|
+
@click=${()=>this.onConnectWallet(t)}
|
|
1235
|
+
.wallet=${t}
|
|
1236
|
+
data-testid="wallet-search-item-${t.id}"
|
|
1237
|
+
explorerId=${t.id}
|
|
1238
|
+
certified=${"certified"===this.badge}
|
|
1239
|
+
walletQuery=${this.query}
|
|
1240
|
+
displayIndex=${o}
|
|
1241
|
+
></w3m-all-wallets-list-item>
|
|
1242
|
+
`))}
|
|
1243
|
+
</wui-grid>
|
|
1244
|
+
`:e.b`
|
|
1245
|
+
<wui-flex
|
|
1246
|
+
data-testid="no-wallet-found"
|
|
1247
|
+
justifyContent="center"
|
|
1248
|
+
alignItems="center"
|
|
1249
|
+
gap="3"
|
|
1250
|
+
flexDirection="column"
|
|
1251
|
+
>
|
|
1252
|
+
<wui-icon-box size="lg" color="default" icon="wallet"></wui-icon-box>
|
|
1253
|
+
<wui-text data-testid="no-wallet-found-text" color="secondary" variant="md-medium">
|
|
1254
|
+
No Wallet found
|
|
1255
|
+
</wui-text>
|
|
1256
|
+
</wui-flex>
|
|
1257
|
+
`}onConnectWallet(t){e.ConnectorController.selectWalletConnector(t)}};co.styles=ao,lo([t.r()],co.prototype,"loading",void 0),lo([t.r()],co.prototype,"mobileFullScreen",void 0),lo([t.n()],co.prototype,"query",void 0),lo([t.n()],co.prototype,"badge",void 0),co=lo([t.customElement("w3m-all-wallets-search")],co);var uo=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};exports.W3mAllWalletsView=class extends e.i{constructor(){super(...arguments),this.search="",this.badge=void 0,this.onDebouncedSearch=e.CoreHelperUtil.debounce((e=>{this.search=e}))}render(){const t=this.search.length>=2;return e.b`
|
|
1258
|
+
<wui-flex .padding=${["1","3","3","3"]} gap="2" alignItems="center">
|
|
1259
|
+
<wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar>
|
|
1260
|
+
<wui-certified-switch
|
|
1261
|
+
?checked=${"certified"===this.badge}
|
|
1262
|
+
@certifiedSwitchChange=${this.onCertifiedSwitchChange.bind(this)}
|
|
1263
|
+
data-testid="wui-certified-switch"
|
|
1264
|
+
></wui-certified-switch>
|
|
1265
|
+
${this.qrButtonTemplate()}
|
|
1266
|
+
</wui-flex>
|
|
1267
|
+
${t||this.badge?e.b`<w3m-all-wallets-search
|
|
1268
|
+
query=${this.search}
|
|
1269
|
+
.badge=${this.badge}
|
|
1270
|
+
></w3m-all-wallets-search>`:e.b`<w3m-all-wallets-list .badge=${this.badge}></w3m-all-wallets-list>`}
|
|
1271
|
+
`}onInputChange(e){this.onDebouncedSearch(e.detail)}onCertifiedSwitchChange(t){t.detail?(this.badge="certified",e.SnackController.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})):this.badge=void 0}qrButtonTemplate(){return e.CoreHelperUtil.isMobile()?e.b`
|
|
1272
|
+
<wui-icon-box
|
|
1273
|
+
size="xl"
|
|
1274
|
+
iconSize="xl"
|
|
1275
|
+
color="accent-primary"
|
|
1276
|
+
icon="qrCode"
|
|
1277
|
+
border
|
|
1278
|
+
borderColor="wui-accent-glass-010"
|
|
1279
|
+
@click=${this.onWalletConnectQr.bind(this)}
|
|
1280
|
+
></wui-icon-box>
|
|
1281
|
+
`:null}onWalletConnectQr(){e.RouterController.push("ConnectingWalletConnect")}},uo([t.r()],exports.W3mAllWalletsView.prototype,"search",void 0),uo([t.r()],exports.W3mAllWalletsView.prototype,"badge",void 0),exports.W3mAllWalletsView=uo([t.customElement("w3m-all-wallets-view")],exports.W3mAllWalletsView);var ho=function(e,t,o,n){var r,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,o,s):r(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};exports.W3mDownloadsView=class extends e.i{constructor(){super(...arguments),this.wallet=e.RouterController.state.data?.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return e.b`
|
|
1282
|
+
<wui-flex gap="2" flexDirection="column" .padding=${["3","3","4","3"]}>
|
|
1283
|
+
${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
|
|
1284
|
+
${this.homepageTemplate()}
|
|
1285
|
+
</wui-flex>
|
|
1286
|
+
`}chromeTemplate(){return this.wallet?.chrome_store?e.b`<wui-list-item
|
|
1287
|
+
variant="icon"
|
|
1288
|
+
icon="chromeStore"
|
|
1289
|
+
iconVariant="square"
|
|
1290
|
+
@click=${this.onChromeStore.bind(this)}
|
|
1291
|
+
chevron
|
|
1292
|
+
>
|
|
1293
|
+
<wui-text variant="md-medium" color="primary">Chrome Extension</wui-text>
|
|
1294
|
+
</wui-list-item>`:null}iosTemplate(){return this.wallet?.app_store?e.b`<wui-list-item
|
|
1295
|
+
variant="icon"
|
|
1296
|
+
icon="appStore"
|
|
1297
|
+
iconVariant="square"
|
|
1298
|
+
@click=${this.onAppStore.bind(this)}
|
|
1299
|
+
chevron
|
|
1300
|
+
>
|
|
1301
|
+
<wui-text variant="md-medium" color="primary">iOS App</wui-text>
|
|
1302
|
+
</wui-list-item>`:null}androidTemplate(){return this.wallet?.play_store?e.b`<wui-list-item
|
|
1303
|
+
variant="icon"
|
|
1304
|
+
icon="playStore"
|
|
1305
|
+
iconVariant="square"
|
|
1306
|
+
@click=${this.onPlayStore.bind(this)}
|
|
1307
|
+
chevron
|
|
1308
|
+
>
|
|
1309
|
+
<wui-text variant="md-medium" color="primary">Android App</wui-text>
|
|
1310
|
+
</wui-list-item>`:null}homepageTemplate(){return this.wallet?.homepage?e.b`
|
|
1311
|
+
<wui-list-item
|
|
1312
|
+
variant="icon"
|
|
1313
|
+
icon="browser"
|
|
1314
|
+
iconVariant="square-blue"
|
|
1315
|
+
@click=${this.onHomePage.bind(this)}
|
|
1316
|
+
chevron
|
|
1317
|
+
>
|
|
1318
|
+
<wui-text variant="md-medium" color="primary">Website</wui-text>
|
|
1319
|
+
</wui-list-item>
|
|
1320
|
+
`:null}openStore(t){t.href&&this.wallet&&(e.EventsController.sendEvent({type:"track",event:"GET_WALLET",properties:{name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.wallet.id,type:t.type}}),e.CoreHelperUtil.openHref(t.href,"_blank"))}onChromeStore(){this.wallet?.chrome_store&&this.openStore({href:this.wallet.chrome_store,type:"chrome_store"})}onAppStore(){this.wallet?.app_store&&this.openStore({href:this.wallet.app_store,type:"app_store"})}onPlayStore(){this.wallet?.play_store&&this.openStore({href:this.wallet.play_store,type:"play_store"})}onHomePage(){this.wallet?.homepage&&this.openStore({href:this.wallet.homepage,type:"homepage"})}},exports.W3mDownloadsView=ho([t.customElement("w3m-downloads-view")],exports.W3mDownloadsView);
|