!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".icon[data-v-c3ee10ac]{height:1.25rem;width:1.25rem}._walletItem_1ry92_2{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;gap:1rem;border-radius:calc(.5rem - 2px);border-width:1px}._walletName_1ry92_11{display:flex;align-items:center;gap:1rem}._installLink_1ry92_16{padding-left:.75rem;padding-right:.75rem;border-radius:calc(.5rem - 2px);height:2.25rem;font-weight:500;color:inherit}._installLink_1ry92_16:hover{background-color:#18181b}._connectButton_1ry92_27{padding:.3rem .7rem;height:auto;border-radius:calc(.5rem - 2px);font-size:16px;background-color:#1e37c2;color:#fff;box-shadow:0 2px #00000005;transition:background-color .15s ease}._connectButton_1ry92_27:hover{background-color:#1e37c299}:root{--muted-color: hsl(240 3.8% 46.1%);--foreground: hsl(240 10% 3.9%)}._aptosPrivacyPolicy_r4vx_6{display:flex;align-items:center;flex-direction:column;font-size:.75rem;line-height:1.25rem;color:var(--foreground)}._link_r4vx_14{text-underline-offset:.25rem;text-decoration-line:underline;color:var(--muted-color)}._poweredBy_r4vx_19{display:flex;align-items:center;gap:.375rem;font-size:.75rem;line-height:1.25rem;color:var(--muted-color)}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}}(); !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@aptos-labs/wallet-adapter-core"),require("vue")):"function"==typeof define&&define.amd?define(["exports","@aptos-labs/wallet-adapter-core","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).WalletAdapterVue={},e.walletAdapterCore,e.Vue)}(this,(function(e,t,n){"use strict";const l="AptosWalletName",a={account:null,network:null,connected:!1,wallet:null},o=n.ref(),r=n.ref(a),c=n.ref([]),s=n.ref(!1),i=n.ref(!1);const u=["src","alt"],d=(e,t)=>{const n=e.__vccOpts||e;for(const[l,a]of t)n[l]=a;return n},m=d(n.defineComponent({__name:"WalletIcon",props:{icon:{},name:{}},setup:e=>(e,t)=>e.$slots.icon?n.renderSlot(e.$slots,"icon",{key:0},void 0,!0):e.icon&&e.name?(n.openBlock(),n.createElementBlock("img",{key:1,src:e.icon,alt:e.name,class:"icon"},null,8,u)):n.createCommentVNode("",!0)}),[["__scopeId","data-v-c3ee10ac"]]),p=n.defineComponent({__name:"WalletName",props:{name:{}},setup:e=>(e,t)=>e.$slots.name?n.renderSlot(e.$slots,"name",{key:0}):e.name?(n.openBlock(),n.createElementBlock("div",n.normalizeProps(n.mergeProps({key:1},e.$attrs)),n.toDisplayString(e.name),17)):n.createCommentVNode("",!0)}),y=n.defineComponent({__name:"WalletConnectButton",emits:["connect"],setup:e=>(e,t)=>e.$slots.connectButton?n.renderSlot(e.$slots,"connectButton",n.mergeProps({key:0},n.toHandlers(e.$listeners,!0))):(n.openBlock(),n.createElementBlock("button",n.mergeProps({key:1},e.$attrs,{onClick:t[0]||(t[0]=t=>e.$emit("connect"))}),"Connect",16))}),k=["href"],f=n.defineComponent({__name:"WalletInstallLink",props:{installLink:{}},setup:e=>(e,t)=>e.$slots.installLink?n.renderSlot(e.$slots,"name",{key:0}):e.installLink?(n.openBlock(),n.createElementBlock("a",n.mergeProps({key:1},e.$attrs,{href:e.installLink,target:"_blank",rel:"noopener noreferrer"}),"Install",16,k)):n.createCommentVNode("",!0)}),v=d(n.defineComponent({__name:"WalletItem",props:{wallet:{}},emits:["connect"],setup(e,{emit:l}){const a=e,o=l,{wallet:r}=n.toRefs(a),c=n.computed((()=>r.value.readyState===t.WalletReadyState.Installed||r.value.readyState===t.WalletReadyState.Loadable)),s=n.computed((()=>"deeplinkProvider"in r.value&&r.value.deeplinkProvider)),i=n.computed((()=>Boolean(c.value||t.isRedirectable()&&s.value||t.isInstallRequired(r.value))));return(e,l)=>e.$slots.default?n.renderSlot(e.$slots,"default",{key:0}):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(e.$style.walletItem)},[n.createElementVNode("div",{class:n.normalizeClass(e.$style.walletName)},[i.value?(n.openBlock(),n.createBlock(m,{key:0,icon:n.unref(r).icon,name:n.unref(r).name},null,8,["icon","name"])):n.createCommentVNode("",!0),i.value?(n.openBlock(),n.createBlock(p,{key:1,name:n.unref(r).name},null,8,["name"])):n.createCommentVNode("",!0)],2),n.unref(t.isInstallRequired)(n.unref(r))&&i.value?(n.openBlock(),n.createBlock(f,{key:0,class:n.normalizeClass(e.$style.installLink),installLink:n.unref(r).url},null,8,["class","installLink"])):i.value?(n.openBlock(),n.createBlock(y,{key:1,class:n.normalizeClass(e.$style.connectButton),onConnect:l[0]||(l[0]=e=>o("connect",n.unref(r)))},null,8,["class"])):n.createCommentVNode("",!0)],2))}}),[["__cssModules",{$style:{walletItem:"_walletItem_1ry92_2",walletName:"_walletName_1ry92_11",installLink:"_installLink_1ry92_16",connectButton:"_connectButton_1ry92_27"}}]]);const C=d({},[["render",function(e,t){return e.$slots.default?n.renderSlot(e.$slots,"disclaimer",{key:0}):(n.openBlock(),n.createElementBlock("span",n.normalizeProps(n.mergeProps({key:1},e.$attrs))," By continuing, you agree to Aptos Labs' ",16))}]]),w=["href"],g=n.defineComponent({__name:"Link",props:{href:{}},setup:e=>(e,t)=>e.$slots.default?n.renderSlot(e.$slots,"link",{key:0}):(n.openBlock(),n.createElementBlock("a",n.mergeProps({key:1},e.$attrs,{href:e.href,target:"_blank",rel:"noopener noreferrer"}),"Privacy Policy",16,w))}),h={width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"};const _=d({},[["render",function(e,t){return n.openBlock(),n.createElementBlock("svg",h,t[0]||(t[0]=[n.createStaticVNode('',2)]))}]]),B=n.defineComponent({__name:"PoweredBy",setup:e=>(e,t)=>(n.openBlock(),n.createElementBlock("div",n.normalizeProps(n.guardReactiveProps(e.$attrs)),[t[0]||(t[0]=n.createElementVNode("span",null,"Powered by",-1)),n.createVNode(_),t[1]||(t[1]=n.createElementVNode("span",null,"Aptos Labs",-1))],16))}),P=d(n.defineComponent({__name:"AptosPrivacyPolicy",setup:e=>(e,t)=>e.$slots.disclaimer||e.$slots.link||e.$slots.poweredBy?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.renderSlot(e.$slots,"disclaimer"),n.renderSlot(e.$slots,"link"),n.renderSlot(e.$slots,"poweredBy")],64)):(n.openBlock(),n.createElementBlock("div",n.mergeProps({key:1,class:e.$style.aptosPrivacyPolicy},e.$attrs),[n.createElementVNode("div",null,[n.createVNode(C),n.createVNode(g,{class:n.normalizeClass(e.$style.link),href:"https://aptoslabs.com/privacy"},null,8,["class"]),t[0]||(t[0]=n.createElementVNode("span",null,".",-1))]),n.createVNode(B,{class:n.normalizeClass(e.$style.poweredBy)},null,8,["class"])],16))}),[["__cssModules",{$style:{aptosPrivacyPolicy:"_aptosPrivacyPolicy_r4vx_6",link:"_link_r4vx_14",poweredBy:"_poweredBy_r4vx_19"}}]]);e.AptosPrivacyPolicy=P,e.WalletConnectButton=y,e.WalletIcon=m,e.WalletInstallLink=f,e.WalletItem=v,e.WalletName=p,e.useWallet=function(e){const{plugins:u,optInWallets:d,dappConfig:m,onError:p}=e??{},y=function(e,n,l){return o.value||(o.value=new t.WalletCore(e&&Array.isArray(e)?e:[],n??[],l),Object.assign(c.value,o.value.wallets)),o.value}(u,d,m),k=async e=>{try{i.value=!0,await y.connect(e)}catch(t){return p&&p(t),Promise.reject(t)}finally{i.value=!1}},f={connect:()=>{const e={...r.value,connected:!0,account:y.account||null,network:y.network||null,wallet:y.wallet||null};Object.assign(r.value,e)},disconnect:()=>{if(!r.value.connected)return;const e={...r.value,connected:!1,account:null,network:null,wallet:null};Object.assign(r.value,e)},accountChange:()=>{if(!r.value.connected)return;if(!y.wallet)return;const e={...r.value,account:y.account};Object.assign(r.value,e)},networkChange:()=>{if(!r.value.connected)return;if(!y.wallet)return;const e={...r.value,network:y.network};Object.assign(r.value,e)},readyStateChange:e=>{const t=n.unref(e),l=c.value.find((e=>e.name===t.name));l&&(l.readyState=t.readyState)},standardWalletsAdded:e=>{const t=n.unref(e),l=c.value.find((e=>e.name==t.name));l?Object.assign(l,t):c.value.push(t)}};return n.onBeforeUnmount((()=>{y&&Object.keys(f).forEach((e=>{y.off(e,f[e])})),o.value=void 0,c.value=[],Object.assign(r.value,a)})),n.watch((()=>y),(e=>{e&&Object.keys(f).forEach((e=>{y.on(e,f[e])}))}),{immediate:!0}),n.watch(s,(async e=>{e&&(localStorage.getItem(l)&&!r.value.connected?await k(localStorage.getItem(l)):i.value=!1)}),{immediate:!0}),n.watch((()=>r.value.connected),(e=>{e&&(y.onAccountChange(),y.onNetworkChange())}),{immediate:!0}),{connected:n.computed((()=>r.value.connected)),isLoading:n.computed((()=>i.value)),account:n.computed((()=>r.value.account)),network:n.computed((()=>r.value.network)),wallet:n.computed((()=>r.value.wallet)),wallets:c,autoConnect:s,connect:k,disconnect:async()=>{try{await y.disconnect()}catch(e){return p&&p(e),Promise.reject(e)}},signAndSubmitTransaction:async e=>{try{return await y.signAndSubmitTransaction(e)}catch(t){return p&&p(t),Promise.reject(t)}},signTransaction:async(e,t,n)=>{try{return await y.signTransaction(e,t,n)}catch(l){return p&&p(l),Promise.reject(l)}},submitTransaction:async e=>{try{return await y.submitTransaction(e)}catch(t){return p&&p(t),Promise.reject(t)}},signMessage:async e=>{try{return await y.signMessage(e)}catch(t){return p&&p(t),Promise.reject(t)}},signMessageAndVerify:async e=>{try{return await y.signMessageAndVerify(e)}catch(t){return p&&p(t),Promise.reject(t)}},changeNetwork:async e=>{try{return await y.changeNetwork(e)}catch(t){return p&&p(t),Promise.reject(t)}}}},Object.keys(t).forEach((n=>{"default"===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:()=>t[n]})})),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})})); //# sourceMappingURL=wallet-adapter-vue.umd.cjs.map