@arcblock/did-connect-service 4.1.53 → 4.1.55

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.
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED by build-login.mjs — do not edit
2
- export default "\"use strict\";var __LoginBundle=(()=>{var ae=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Ne=Object.prototype.hasOwnProperty;var Pe=(t,e)=>{for(var r in e)ae(t,r,{get:e[r],enumerable:!0})},Oe=(t,e,r,o)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let i of Re(e))!Ne.call(t,i)&&i!==r&&ae(t,i,{get:()=>e[i],enumerable:!(o=Le(e,i))||o.enumerable});return t};var Me=t=>Oe(ae({},\"__esModule\",{value:!0}),t);var ht={};Pe(ht,{FetchHttpAdapter:()=>X,LoginDialog:()=>Se,LoginPage:()=>pe,runPasskeyAuth:()=>ie});var H={CREATED:\"created\",SCANNED:\"scanned\",SUCCEED:\"succeed\",ERROR:\"error\",TIMEOUT:\"timeout\",BUSY:\"busy\",FORBIDDEN:\"forbidden\"};var U={API_PREFIX:\"/api/did\",SERVICE_PREFIX:\"/.well-known/service\",ACTION:\"login\",TOKEN_TIMEOUT:3e5,CHECK_INTERVAL:2e3,TOKEN_KEY:\"_t_\",TOKEN_DELIVERY:\"cookie\",CREATE_THROTTLE:500,AUTO_CHECK_INTERVAL:6e4};var re=\"did:abt:\";function me(t){if(!t||typeof t!=\"string\")return!1;let e=t.replace(re,\"\");return/^(0x)?[0-9a-f]{40}$/i.test(e)}function ye(t,e=8,r=6){return!t||typeof t!=\"string\"?\"\":t.length<=e+r+3?t:`${t.slice(0,e)}...${t.slice(-r)}`}function ue(t,e={}){if(!t||typeof t!=\"string\")return{prefix:\"DID: ABT:\",chainLabel:\"ABT\",address:\"\",compact:\"\",copyText:\"\"};let{startChars:r=8,endChars:o=6}=e,i=me(t),a=t.replace(re,\"\"),s=i?\"ETH\":\"ABT\",n=e.includePrefix??!i;return{prefix:`DID: ${s}:`,chainLabel:s,address:a,compact:ye(a,r,o),copyText:n?`${re}${a}`:a}}var M={TOKEN_EXPIRED:\"TOKEN_EXPIRED\",TOKEN_NOT_FOUND:\"TOKEN_NOT_FOUND\",TOKEN_TIMEOUT:\"TOKEN_TIMEOUT\",ALREADY_EXIST:\"ALREADY_EXIST\",ALREADY_BIND:\"ALREADY_BIND\",NETWORK_ERROR:\"NETWORK_ERROR\",INVALID_RESPONSE:\"INVALID_RESPONSE\",UNAUTHORIZED:\"UNAUTHORIZED\",FORBIDDEN:\"FORBIDDEN\"},O=class extends Error{code;constructor(e,r){super(r),this.name=\"ConnectError\",this.code=e}};var X=class{_defaultHeaders;_onRequest;constructor(e){this._defaultHeaders=e?.headers??{},this._onRequest=e?.onRequest}async get(e,r){this._validateUrl(e);let o=r?.params?this._serializeParams(r.params):\"\",i=o?`${e}${e.includes(\"?\")?\"&\":\"?\"}${o}`:e,s={method:\"GET\",headers:{...this._defaultHeaders,...r?.headers},signal:r?.signal};return this._onRequest&&(s=this._onRequest(i,s)),this._execute(i,s)}async post(e,r,o){this._validateUrl(e);let i=o?.params?this._serializeParams(o.params):\"\",a=i?`${e}${e.includes(\"?\")?\"&\":\"?\"}${i}`:e,n={method:\"POST\",headers:{\"Content-Type\":\"application/json\",...this._defaultHeaders,...o?.headers},body:r!==void 0?JSON.stringify(r):void 0,signal:o?.signal};return this._onRequest&&(n=this._onRequest(a,n)),this._execute(a,n)}_validateUrl(e){if(!e?.trim())throw new O(M.NETWORK_ERROR,\"Request URL must not be empty\");if(e.trim().toLowerCase().startsWith(\"javascript:\"))throw new O(M.NETWORK_ERROR,\"Invalid URL protocol\")}async _execute(e,r){let o;try{o=await globalThis.fetch(e,r)}catch(s){throw s?.name===\"AbortError\"?s:new O(M.NETWORK_ERROR,`Network request failed: ${s?.message??\"Unknown error\"}`)}if(!o.ok){let s=\"\",n=\"\";try{let p=await o.text();try{let f=JSON.parse(p);f.error&&(s=f.error),f.code&&(n=f.code)}catch{s=p}}catch{}let u=n===\"FORBIDDEN\"?M.FORBIDDEN:M.NETWORK_ERROR;throw new O(u,s||`HTTP ${o.status} ${o.statusText||\"Error\"}`)}if(o.status===204)return null;let i=await o.text();if(!i.trim())return null;let a=o.headers.get(\"content-type\")??\"\";if(!a.includes(\"application/json\")&&!a.includes(\"+json\"))throw new O(M.INVALID_RESPONSE,`Expected JSON response but received: ${a||\"unknown content type\"}`);try{return JSON.parse(i)}catch{throw new O(M.INVALID_RESPONSE,\"Failed to parse JSON response\")}}_serializeParams(e){let r=[];for(let o of Object.keys(e)){let i=e[o];if(i!=null)if(Array.isArray(i))for(let a of i)a!=null&&r.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(a))}`);else typeof i==\"boolean\"?r.push(`${encodeURIComponent(o)}=${i?\"true\":\"false\"}`):r.push(`${encodeURIComponent(o)}=${encodeURIComponent(String(i))}`)}return r.join(\"&\")}};var be=[\"en\",\"zh\",\"zh-TW\",\"ja\"],vt=new Set(be);function Z(t){let e=t.apiPrefix??U.API_PREFIX,r=t.action??U.ACTION,o=e.replace(/\\/+$/,\"\"),i=r.replace(/^\\/+/,\"\");return`${o}/${i}`}function xe(){return{token:null,url:null,status:null,error:null,appInfo:null,memberAppInfo:null,loading:!1}}var ee=class{_state;_config;_http;_pollTimer=null;_checkCount=0;_maxCheckCount;_realtimeUnsub=null;_realtime;_storage;_lastCreateTime=0;_listeners=new Map;_destroyed=!1;constructor(e,r,o){this._config=this._fillDefaults(e),this._http=r,this._realtime=o?.realtime,this._storage=o?.storage,this._state=xe(),this._config.checkInterval<=0?this._maxCheckCount=1/0:this._maxCheckCount=Math.ceil(this._config.tokenTimeout/this._config.checkInterval)}get state(){return Object.freeze({...this._state})}async create(e){if(Date.now()-this._lastCreateTime<U.CREATE_THROTTLE)return this.state;(this._pollTimer!==null||this._realtimeUnsub!==null)&&this.stopPolling(),this._state.loading=!0,this._emit(\"statusChange\",this.state);let r=`${Z(this._config)}/token`,o={};e?(e.locale!=null&&(o.locale=e.locale),e.provider!=null?o.provider=e.provider:o.provider=\"wallet\",e.encKey!=null&&(o.__encKey=e.encKey),e.autoConnect!=null&&(o.autoConnect=e.autoConnect),e.visitorId!=null&&(o.visitorId=e.visitorId),e.sourceToken!=null&&(o.sourceToken=e.sourceToken),e.forceConnected!=null&&(o.forceConnected=e.forceConnected),e.connectUrl!=null&&(o.connectUrl=e.connectUrl),e.extraParams&&Object.assign(o,e.extraParams)):o.provider=\"wallet\";try{let i=await this._http.get(r,{params:o});return this._state.token=i.token??null,this._state.url=i.url??null,this._state.status=H.CREATED,this._state.appInfo=i.appInfo??null,this._state.memberAppInfo=i.memberAppInfo??null,this._state.loading=!1,this._state.error=null,this._state.successResult=void 0,this._state.connectedDid=void 0,this._state.mfaCode=void 0,this._state.saveConnect=void 0,this._lastCreateTime=Date.now(),this._emit(\"statusChange\",this.state),this.state}catch(i){throw this._state.loading=!1,this._state.error=i?.message??\"Failed to create token\",this._state.status=H.ERROR,this._emit(\"statusChange\",this.state),this._emit(\"error\",new O(M.NETWORK_ERROR,this._state.error)),i}}async checkStatus(){if(!this._state.token)throw new O(M.TOKEN_NOT_FOUND,\"No token available. Call create() first.\");let e=`${Z(this._config)}/status`,r={[U.TOKEN_KEY]:this._state.token};this._config.appPid;try{let o=await this._http.get(e,{params:r}),i=o.status;return i&&(this._state.status=i),o.error!==void 0&&(this._state.error=o.error),o.connectedDid!==void 0&&(this._state.connectedDid=o.connectedDid),o.mfaCode!==void 0&&(this._state.mfaCode=o.mfaCode),o.saveConnect!==void 0&&(this._state.saveConnect=o.saveConnect),i===H.FORBIDDEN?(this._state.status=H.ERROR,this._state.error=o.error||\"Access forbidden\",this._emit(\"error\",new O(M.UNAUTHORIZED,this._state.error)),this.stopPolling()):i===H.SUCCEED?(this._config.tokenDelivery===\"response\"&&(this._state.successResult=o),this._emit(\"succeed\",this.state),this.stopPolling()):i===H.ERROR?(this._emit(\"error\",new O(M.INVALID_RESPONSE,this._state.error||\"Unknown error\")),this.stopPolling()):i===H.TIMEOUT&&(this._emit(\"timeout\",this.state),this.stopPolling()),this._emit(\"statusChange\",this.state),this.state}catch(o){throw o}}async cancel(){if(!this._state.token)return;let e=`${Z(this._config)}/timeout`,r={[U.TOKEN_KEY]:this._state.token};try{await this._http.get(e,{params:r})}catch{}this.stopPolling()}startPolling(){if(this._state.token){if(this._checkCount=0,this._realtime)try{let e=`relay:${this._config.appPid}:${this._state.token}`;this._realtimeUnsub=this._realtime.subscribe(e,r=>{this._handleRealtimeMessage(r)});return}catch{this._realtimeUnsub=null}this._config.checkInterval>0&&(this._pollTimer=setInterval(()=>{this._pollOnce()},this._config.checkInterval))}}stopPolling(){this._pollTimer!==null&&(clearInterval(this._pollTimer),this._pollTimer=null),this._realtimeUnsub&&(this._realtimeUnsub(),this._realtimeUnsub=null)}reset(){this.stopPolling(),this._state=xe(),this._checkCount=0}destroy(){this._destroyed||(this.stopPolling(),this._state.token=null,this._state.successResult=void 0,this._listeners.clear(),this._destroyed=!0)}on(e,r){let o=this._listeners.get(e);return o||(o=new Set,this._listeners.set(e,o)),o.add(r),this}off(e,r){let o=this._listeners.get(e);return o&&(o.delete(r),o.size===0&&this._listeners.delete(e)),this}_emit(e,...r){let o=this._listeners.get(e);if(!(!o||o.size===0))for(let i of[...o])try{i(...r)}catch{}}_pollOnce(){if(this._checkCount++,this._checkCount>=this._maxCheckCount){this._handleTimeout();return}this.checkStatus().catch(()=>{})}_handleTimeout(){this.stopPolling(),this._state.status=H.TIMEOUT,this._emit(\"timeout\",this.state),this._emit(\"statusChange\",this.state)}_handleRealtimeMessage(e){if(!e||typeof e!=\"object\")return;let r=e.status;r&&(this._state.status=r,e.error!==void 0&&(this._state.error=e.error),e.connectedDid!==void 0&&(this._state.connectedDid=e.connectedDid),e.mfaCode!==void 0&&(this._state.mfaCode=e.mfaCode),e.saveConnect!==void 0&&(this._state.saveConnect=e.saveConnect),r===H.FORBIDDEN?(this._state.status=H.ERROR,this._state.error=e.error||\"Access forbidden\",this._emit(\"error\",new O(M.UNAUTHORIZED,this._state.error)),this.stopPolling()):r===H.SUCCEED?(this._config.tokenDelivery===\"response\"&&(this._state.successResult=e),this._emit(\"succeed\",this.state),this.stopPolling()):r===H.ERROR?(this._emit(\"error\",new O(M.INVALID_RESPONSE,this._state.error||\"Unknown error\")),this.stopPolling()):r===H.TIMEOUT&&(this._emit(\"timeout\",this.state),this.stopPolling()),this._emit(\"statusChange\",this.state))}_fillDefaults(e){return{appPid:e.appPid,appName:e.appName,appDescription:e.appDescription??\"\",appIcon:e.appIcon??\"\",appUrl:e.appUrl??\"\",apiPrefix:e.apiPrefix??U.API_PREFIX,action:e.action??U.ACTION,servicePrefix:e.servicePrefix??U.SERVICE_PREFIX,tokenTimeout:e.tokenTimeout??U.TOKEN_TIMEOUT,checkInterval:e.checkInterval??U.CHECK_INTERVAL,tokenDelivery:e.tokenDelivery??U.TOKEN_DELIVERY}}};var B={bg:{root:\"#0a0a0b\",surface:\"#141416\",card:\"#1c1c20\",elevated:\"#232328\",hover:\"#2b2b34\",active:\"#33333e\",input:\"rgba(255,255,255,0.06)\"},border:{default:\"rgba(255,255,255,0.10)\",subtle:\"rgba(255,255,255,0.06)\",strong:\"rgba(255,255,255,0.15)\",focus:\"rgba(255,255,255,0.25)\"},text:{primary:\"#f5f5f7\",secondary:\"#9394a1\",tertiary:\"#767684\",placeholder:\"#5e5f6e\",white:\"#ffffff\"},color:{blue:\"#6c47ff\",blueHover:\"#5f15fe\",blueLight:\"rgba(108,71,255,0.15)\",blueMuted:\"#9280ff\",red:\"#e02e2e\",redLight:\"rgba(224,46,46,0.15)\",redText:\"#f98a8a\",green:\"#15892b\",greenLight:\"rgba(21,137,43,0.15)\",greenText:\"#49dc6e\",yellow:\"#fd7224\",yellowLight:\"rgba(253,114,36,0.15)\",yellowText:\"#fd9357\",info:\"#236dd7\",infoLight:\"rgba(35,109,215,0.15)\",infoText:\"#73acfa\"},radius:{xs:\"4px\",sm:\"6px\",md:\"8px\",lg:\"12px\",full:\"9999px\"},shadow:{sm:\"0 1px 3px rgba(0,0,0,0.3), 0 1px 2px -1px rgba(0,0,0,0.2)\",md:\"0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3)\",lg:\"0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.4)\",focus:\"0 0 0 1px rgba(255,255,255,0.12), 0 0 0 3px rgba(108,71,255,0.3)\"},font:{family:\"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif\",mono:\"'JetBrains Mono', 'SF Mono', monospace\",sizeBase:\"14px\",lineHeight:\"1.43\"}},$={bg:{root:\"#f8f9fa\",surface:\"#ffffff\",card:\"#ffffff\",elevated:\"#f0f1f3\",hover:\"#e9eaec\",active:\"#dddee1\",input:\"rgba(0,0,0,0.04)\"},border:{default:\"rgba(0,0,0,0.10)\",subtle:\"rgba(0,0,0,0.06)\",strong:\"rgba(0,0,0,0.15)\",focus:\"rgba(0,0,0,0.25)\"},text:{primary:\"#1a1a1a\",secondary:\"#6b7280\",tertiary:\"#9ca3af\",placeholder:\"#c0c5ce\",white:\"#1a1a1a\"},shadow:{sm:\"0 1px 3px rgba(0,0,0,0.08), 0 1px 2px -1px rgba(0,0,0,0.06)\",md:\"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.06)\",lg:\"0 10px 15px -3px rgba(0,0,0,0.12), 0 4px 6px -4px rgba(0,0,0,0.08)\",focus:\"0 0 0 1px rgba(0,0,0,0.08), 0 0 0 3px rgba(108,71,255,0.2)\"}},Fe=`\n :root, :host {\n /* Backgrounds \\u2014 layered depth */\n --bg-root: ${B.bg.root};\n --bg-surface: ${B.bg.surface};\n --bg-card: ${B.bg.card};\n --bg-elevated: ${B.bg.elevated};\n --bg-hover: ${B.bg.hover};\n --bg-active: ${B.bg.active};\n --bg-input: ${B.bg.input};\n\n /* Borders \\u2014 semi-transparent for adaptability */\n --border: ${B.border.default};\n --border-subtle:${B.border.subtle};\n --border-strong:${B.border.strong};\n --border-focus: ${B.border.focus};\n\n /* Text hierarchy */\n --text: ${B.text.primary};\n --text-secondary:${B.text.secondary};\n --text-tertiary:${B.text.tertiary};\n --text-placeholder:${B.text.placeholder};\n --text-white: ${B.text.white};\n\n /* Accents */\n --blue: ${B.color.blue};\n --blue-hover: ${B.color.blueHover};\n --blue-light: ${B.color.blueLight};\n --blue-muted: ${B.color.blueMuted};\n --red: ${B.color.red};\n --red-light: ${B.color.redLight};\n --red-text: ${B.color.redText};\n --green: ${B.color.green};\n --green-light: ${B.color.greenLight};\n --green-text: ${B.color.greenText};\n --yellow: ${B.color.yellow};\n --yellow-light: ${B.color.yellowLight};\n --yellow-text: ${B.color.yellowText};\n --info: ${B.color.info};\n --info-light: ${B.color.infoLight};\n --info-text: ${B.color.infoText};\n\n /* Radii */\n --radius-xs: ${B.radius.xs};\n --radius-sm: ${B.radius.sm};\n --radius: ${B.radius.md};\n --radius-lg: ${B.radius.lg};\n --radius-full: ${B.radius.full};\n\n /* Shadows */\n --shadow-sm: ${B.shadow.sm};\n --shadow-md: ${B.shadow.md};\n --shadow-lg: ${B.shadow.lg};\n --shadow-focus: ${B.shadow.focus};\n }\n`,Te=`\n [data-theme=\"light\"], :host([data-theme=\"light\"]) {\n --bg-root: ${$.bg.root};\n --bg-surface: ${$.bg.surface};\n --bg-card: ${$.bg.card};\n --bg-elevated: ${$.bg.elevated};\n --bg-hover: ${$.bg.hover};\n --bg-active: ${$.bg.active};\n --bg-input: ${$.bg.input};\n\n --border: ${$.border.default};\n --border-subtle:${$.border.subtle};\n --border-strong:${$.border.strong};\n --border-focus: ${$.border.focus};\n\n --text: ${$.text.primary};\n --text-secondary:${$.text.secondary};\n --text-tertiary:${$.text.tertiary};\n --text-placeholder:${$.text.placeholder};\n --text-white: ${$.text.white};\n\n --shadow-sm: ${$.shadow.sm};\n --shadow-md: ${$.shadow.md};\n --shadow-lg: ${$.shadow.lg};\n --shadow-focus: ${$.shadow.focus};\n }\n`,$e=`\n *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }\n html, :host { color-scheme: dark; }\n html[data-theme=\"light\"], :host([data-theme=\"light\"]) { color-scheme: light; }\n body {\n font-family: ${B.font.family};\n background: var(--bg-root);\n color: var(--text);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: ${B.font.sizeBase};\n line-height: ${B.font.lineHeight};\n }\n a { color: var(--blue-muted); text-decoration: none; }\n a:hover { text-decoration: underline; }\n .hidden { display: none; }\n`,Ue=typeof HTMLElement<\"u\"?HTMLElement:class{},we='<svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\"/><path d=\"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1\"/></svg>',We='<svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"20 6 9 17 4 12\"/></svg>',He=`\n:host {\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n overflow: hidden;\n font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', 'Consolas', monospace;\n line-height: 1.5;\n}\n:host([block]) { display: flex; }\n.prefix {\n flex-shrink: 0;\n opacity: 0.6;\n margin-right: 4px;\n white-space: nowrap;\n}\n.address {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: var(--did-text-color, currentColor);\n}\n.address-compact {\n white-space: nowrap;\n color: var(--did-text-color, currentColor);\n cursor: default;\n}\n.clickable { cursor: pointer; }\n.clickable:hover { opacity: 0.8; }\n.copy-btn {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1em;\n height: 1em;\n margin-left: 6px;\n padding: 0;\n border: none;\n background: none;\n color: inherit;\n opacity: 0.5;\n cursor: pointer;\n transition: opacity 0.15s;\n}\n.copy-btn:hover { opacity: 1; }\n.copy-btn.copied { opacity: 1; color: var(--did-copy-success-color, #22c55e); }\n`,Ke=class extends Ue{static observedAttributes=[\"did\",\"compact\",\"copyable\",\"start-chars\",\"end-chars\",\"show-prefix\",\"no-tooltip\",\"no-copy\",\"block\",\"size\"];shadow;copyTimer=null;constructor(){super(),this.shadow=this.attachShadow({mode:\"open\"})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}disconnectedCallback(){this.copyTimer&&clearTimeout(this.copyTimer)}get parts(){let t=Number(this.getAttribute(\"start-chars\")),e=Number(this.getAttribute(\"end-chars\"));return ue(this.getAttribute(\"did\")||\"\",{startChars:t>0?t:void 0,endChars:e>0?e:void 0})}render(){if(!(this.getAttribute(\"did\")||\"\")){this.shadow.innerHTML=\"\";return}let e=this.parts,r=this.hasAttribute(\"compact\"),o=!this.hasAttribute(\"no-copy\")&&this.getAttribute(\"copyable\")!==\"false\",i=this.hasAttribute(\"show-prefix\"),a=this.hasAttribute(\"no-tooltip\"),s=Number(this.getAttribute(\"size\"))||0,n=s>=12?`${s}px`:\"inherit\",u=r?e.compact:e.address,p=!a&&r?` title=\"${e.address}\"`:\"\",f=i?`<span class=\"prefix\">${e.prefix} </span>`:\"\",l=r?\"address-compact\":\"address\",d=o?\" clickable\":\"\",E=o?`<button class=\"copy-btn\" aria-label=\"Copy DID\">${we}</button>`:\"\";if(this.shadow.innerHTML=`\n <style>${He}:host { font-size: ${n}; }</style>\n ${f}<span class=\"${l}${d}\"${p}>${u}</span>${E}\n `,o){let A=this.shadow.querySelector(`.${l}`);A&&A.addEventListener(\"click\",x=>{x.stopPropagation(),this.copyToClipboard(e.copyText)});let _=this.shadow.querySelector(\".copy-btn\");_&&_.addEventListener(\"click\",x=>{x.stopPropagation(),this.copyToClipboard(e.copyText)})}}copyToClipboard(t){navigator.clipboard?.writeText?navigator.clipboard.writeText(t).catch(()=>this.fallbackCopy(t)):this.fallbackCopy(t),this.showCopied()}fallbackCopy(t){try{let e=document.createElement(\"input\");e.value=t,document.body.appendChild(e),e.select(),document.execCommand?.(\"copy\"),e.remove()}catch{}}showCopied(){let t=this.shadow.querySelector(\".copy-btn\");t&&(t.classList.add(\"copied\"),t.innerHTML=We,this.copyTimer&&clearTimeout(this.copyTimer),this.copyTimer=setTimeout(()=>{t.classList.remove(\"copied\"),t.innerHTML=we},1500))}};typeof customElements<\"u\"&&!customElements.get(\"did-address\")&&customElements.define(\"did-address\",Ke);var le={en:{emailExplanation:\"We will send you a verification code. No password needed.\",otherMethods:\"Other ways to sign in\",passkeyCreateAccount:\"Create an account with Passkey\",lastUsed:\"Last used: {method}\",passkeyExplanation:\"Create a new account using your fingerprint, face, or device unlock. Your device will ask you to save a Passkey. Already have an account? Go back to sign in.\",continueWith:\"Continue with {provider}\",oauthWaiting:\"Continue in the {provider} window\",oauthIncomplete:\"Sign-in is not complete. Reopen the window or choose another method.\",oauthReopen:\"Reopen window\",oauthFullPage:\"Continue on this page\",emailEdit:\"Change email\",emailCooldown:\"Resend in {seconds}s\",walletRetry:\"Wallet did not open? Try again or scan the QR code.\",tryAgain:\"Try again\",signIn:\"Sign in or create an account\",signInTo:\"Sign in or join {appName}\",passkeyButton:\"Continue with Passkey\",passkeySignIn:\"Sign in with Passkey\",passkeyCreate:\"Create Passkey\",passkeyFirstTime:\"First time? Create an account\",passkeyBackToSignIn:\"Back to sign in\",passkeyWaiting:\"Waiting for passkey\\u2026\",passkeyCreating:\"Creating your passkey\\u2026\",passkeyNoLocal:\"Passkey verification was not completed. Retry, use another device, or choose another method.\",passkeyUseAnotherDevice:\"Use another device\",passkeyCreateInstead:\"First time? Create an account\",didWalletButton:\"Continue with DID Wallet\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"Scan with your DID Wallet\",waitingWallet:\"Requesting connection\",walletContinue:\"Please continue in DID Wallet\",noPasskey:\"No existing passkey found. Enter a name and create one.\",success:\"Success!\",timeout:\"Session timed out. Try again.\",refreshQR:\"Refresh\",namePlaceholder:\"Your name (optional)\",or:\"or\",emailPlaceholder:\"Email address\",emailButton:\"Email\",passkeyUnsupported:\"Your browser does not support Passkey authentication.\",connecting:\"Connecting...\",verifying:\"Verifying...\",openInWallet:\"Open in DID Wallet\",authFailed:\"Authentication failed\",registrationFailed:\"Registration failed\",passkeySetupFailed:\"Passkey setup failed\",accessDenied:\"Access denied: your account is not permitted to log in to this site.\",regClosed:\"Registration requires an invitation.\",federatedBy:\"Authentication provided by {masterName}\",securedBy:\"Secured by DID Connect\",privacy:\"Privacy\",terms:\"Terms\",back:\"Back\",cancel:\"Cancel\",scanTitle:\"Scan with DID Wallet\",emailTitle:\"Continue with Email\",emailSubmit:\"Send Code\",emailSending:\"Sending code...\",emailSent:\"We sent an 8-digit code to {email}\",emailCodePlaceholder:\"8-digit code\",emailVerify:\"Verify\",emailResend:\"Resend code\",emailInvalid:\"Please enter a valid email address.\",emailCodeInvalid:\"Please enter the 8-digit code.\"},zh:{emailExplanation:\"\\u6211\\u4EEC\\u4F1A\\u53D1\\u9001\\u9A8C\\u8BC1\\u7801\\uFF0C\\u65E0\\u9700\\u5BC6\\u7801\\u3002\",otherMethods:\"\\u5176\\u4ED6\\u767B\\u5F55\\u65B9\\u5F0F\",passkeyCreateAccount:\"\\u4F7F\\u7528 Passkey \\u521B\\u5EFA\\u8D26\\u6237\",lastUsed:\"\\u4E0A\\u6B21\\u4F7F\\u7528\\uFF1A{method}\",passkeyExplanation:\"\\u4F7F\\u7528\\u6307\\u7EB9\\u3001\\u9762\\u5BB9\\u6216\\u8BBE\\u5907\\u89E3\\u9501\\u65B9\\u5F0F\\u521B\\u5EFA\\u65B0\\u8D26\\u6237\\uFF0C\\u65E0\\u9700\\u5BC6\\u7801\\u3002\\u8BBE\\u5907\\u4F1A\\u63D0\\u793A\\u4FDD\\u5B58 Passkey\\u3002\\u5DF2\\u6709\\u8D26\\u6237\\uFF1F\\u8BF7\\u8FD4\\u56DE\\u767B\\u5F55\\u3002\",continueWith:\"\\u4F7F\\u7528 {provider} \\u7EE7\\u7EED\",oauthWaiting:\"\\u8BF7\\u5728 {provider} \\u7A97\\u53E3\\u4E2D\\u7EE7\\u7EED\",oauthIncomplete:\"\\u767B\\u5F55\\u5C1A\\u672A\\u5B8C\\u6210\\u3002\\u60A8\\u53EF\\u4EE5\\u91CD\\u65B0\\u6253\\u5F00\\u7A97\\u53E3\\u6216\\u9009\\u62E9\\u5176\\u4ED6\\u65B9\\u5F0F\\u3002\",oauthReopen:\"\\u91CD\\u65B0\\u6253\\u5F00\\u7A97\\u53E3\",oauthFullPage:\"\\u5728\\u5F53\\u524D\\u9875\\u9762\\u7EE7\\u7EED\",emailEdit:\"\\u4FEE\\u6539\\u90AE\\u7BB1\",emailCooldown:\"{seconds} \\u79D2\\u540E\\u91CD\\u53D1\",walletRetry:\"\\u94B1\\u5305\\u672A\\u6253\\u5F00\\uFF1F\\u8BF7\\u91CD\\u8BD5\\u6216\\u626B\\u63CF\\u4E8C\\u7EF4\\u7801\\u3002\",tryAgain:\"\\u91CD\\u8BD5\",signIn:\"\\u767B\\u5F55\\u6216\\u521B\\u5EFA\\u8D26\\u6237\",signInTo:\"\\u767B\\u5F55\\u6216\\u52A0\\u5165 {appName}\",passkeyButton:\"\\u4F7F\\u7528 Passkey \\u7EE7\\u7EED\",passkeySignIn:\"\\u4F7F\\u7528 Passkey \\u767B\\u5F55\",passkeyCreate:\"\\u521B\\u5EFA Passkey\",passkeyFirstTime:\"\\u9996\\u6B21\\u4F7F\\u7528\\uFF1F\\u521B\\u5EFA\\u8D26\\u6237\",passkeyBackToSignIn:\"\\u8FD4\\u56DE\\u767B\\u5F55\",passkeyWaiting:\"\\u6B63\\u5728\\u7B49\\u5F85 Passkey\\u2026\",passkeyCreating:\"\\u6B63\\u5728\\u521B\\u5EFA Passkey\\u2026\",passkeyNoLocal:\"\\u8FD9\\u6B21\\u672A\\u5B8C\\u6210 Passkey \\u9A8C\\u8BC1\\u3002\\u8BF7\\u91CD\\u8BD5\\u3001\\u4F7F\\u7528\\u5176\\u4ED6\\u8BBE\\u5907\\uFF0C\\u6216\\u9009\\u62E9\\u5176\\u4ED6\\u767B\\u5F55\\u65B9\\u5F0F\\u3002\",passkeyUseAnotherDevice:\"\\u7528\\u5176\\u4ED6\\u8BBE\\u5907\\u767B\\u5F55\",passkeyCreateInstead:\"\\u9996\\u6B21\\u4F7F\\u7528\\uFF1F\\u521B\\u5EFA\\u8D26\\u6237\",didWalletButton:\"\\u4F7F\\u7528 DID Wallet \\u7EE7\\u7EED\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"\\u8BF7\\u4F7F\\u7528 DID Wallet \\u626B\\u7801\",waitingWallet:\"\\u6B63\\u5728\\u8BF7\\u6C42\\u8FDE\\u63A5\",walletContinue:\"\\u8BF7\\u5728 DID Wallet \\u4E2D\\u7EE7\\u7EED\\u5B8C\\u6210\\u60A8\\u7684\\u64CD\\u4F5C\",noPasskey:\"\\u672A\\u627E\\u5230\\u5DF2\\u6709 Passkey\\u3002\\u8F93\\u5165\\u540D\\u79F0\\u5E76\\u521B\\u5EFA\\u4E00\\u4E2A\\u3002\",success:\"\\u6210\\u529F\",timeout:\"\\u4F1A\\u8BDD\\u8D85\\u65F6\\uFF0C\\u8BF7\\u91CD\\u8BD5\\u3002\",refreshQR:\"\\u5237\\u65B0\",namePlaceholder:\"\\u60A8\\u7684\\u540D\\u5B57\\uFF08\\u53EF\\u9009\\uFF09\",or:\"\\u6216\",emailPlaceholder:\"\\u90AE\\u7BB1\\u5730\\u5740\",emailButton:\"\\u90AE\\u7BB1\",passkeyUnsupported:\"\\u60A8\\u7684\\u6D4F\\u89C8\\u5668\\u4E0D\\u652F\\u6301 Passkey \\u8BA4\\u8BC1\\u3002\",connecting:\"\\u8FDE\\u63A5\\u4E2D...\",verifying:\"\\u9A8C\\u8BC1\\u4E2D...\",openInWallet:\"\\u5728 DID Wallet \\u4E2D\\u6253\\u5F00\",authFailed:\"\\u8BA4\\u8BC1\\u5931\\u8D25\",registrationFailed:\"\\u6CE8\\u518C\\u5931\\u8D25\",passkeySetupFailed:\"Passkey \\u8BBE\\u7F6E\\u5931\\u8D25\",accessDenied:\"\\u8BBF\\u95EE\\u88AB\\u62D2\\u7EDD\\uFF1A\\u60A8\\u7684\\u8D26\\u6237\\u65E0\\u6743\\u767B\\u5F55\\u6B64\\u7AD9\\u70B9\\u3002\",regClosed:\"\\u6CE8\\u518C\\u9700\\u8981\\u9080\\u8BF7\\u3002\",federatedBy:\"\\u8BA4\\u8BC1\\u670D\\u52A1\\u7531 {masterName} \\u63D0\\u4F9B\",securedBy:\"\\u7531 DID Connect \\u63D0\\u4F9B\\u5B89\\u5168\\u4FDD\\u969C\",privacy:\"\\u9690\\u79C1\",terms:\"\\u6761\\u6B3E\",back:\"\\u8FD4\\u56DE\",cancel:\"\\u53D6\\u6D88\",scanTitle:\"\\u4F7F\\u7528 DID Wallet \\u626B\\u7801\",emailTitle:\"\\u4F7F\\u7528\\u90AE\\u7BB1\\u7EE7\\u7EED\",emailSubmit:\"\\u53D1\\u9001\\u9A8C\\u8BC1\\u7801\",emailSending:\"\\u6B63\\u5728\\u53D1\\u9001\\u9A8C\\u8BC1\\u7801...\",emailSent:\"\\u9A8C\\u8BC1\\u7801\\u5DF2\\u53D1\\u9001\\u81F3 {email}\",emailCodePlaceholder:\"8 \\u4F4D\\u9A8C\\u8BC1\\u7801\",emailVerify:\"\\u9A8C\\u8BC1\",emailResend:\"\\u91CD\\u65B0\\u53D1\\u9001\",emailInvalid:\"\\u8BF7\\u8F93\\u5165\\u6709\\u6548\\u7684\\u90AE\\u7BB1\\u5730\\u5740\\u3002\",emailCodeInvalid:\"\\u8BF7\\u8F93\\u5165 8 \\u4F4D\\u9A8C\\u8BC1\\u7801\\u3002\"},\"zh-TW\":{emailExplanation:\"\\u6211\\u5011\\u6703\\u50B3\\u9001\\u9A57\\u8B49\\u78BC\\uFF0C\\u7121\\u9700\\u5BC6\\u78BC\\u3002\",otherMethods:\"\\u5176\\u4ED6\\u767B\\u5165\\u65B9\\u5F0F\",passkeyCreateAccount:\"\\u4F7F\\u7528 Passkey \\u5EFA\\u7ACB\\u5E33\\u6236\",lastUsed:\"\\u4E0A\\u6B21\\u4F7F\\u7528\\uFF1A{method}\",passkeyExplanation:\"\\u4F7F\\u7528\\u6307\\u7D0B\\u3001\\u9762\\u5BB9\\u6216\\u88DD\\u7F6E\\u89E3\\u9396\\u65B9\\u5F0F\\u5EFA\\u7ACB\\u65B0\\u5E33\\u6236\\uFF0C\\u7121\\u9700\\u5BC6\\u78BC\\u3002\\u88DD\\u7F6E\\u6703\\u63D0\\u793A\\u5132\\u5B58 Passkey\\u3002\\u5DF2\\u6709\\u5E33\\u6236\\uFF1F\\u8ACB\\u8FD4\\u56DE\\u767B\\u5165\\u3002\",continueWith:\"\\u4F7F\\u7528 {provider} \\u7E7C\\u7E8C\",oauthWaiting:\"\\u8ACB\\u5728 {provider} \\u8996\\u7A97\\u4E2D\\u7E7C\\u7E8C\",oauthIncomplete:\"\\u767B\\u5165\\u5C1A\\u672A\\u5B8C\\u6210\\u3002\\u60A8\\u53EF\\u4EE5\\u91CD\\u65B0\\u958B\\u555F\\u8996\\u7A97\\u6216\\u9078\\u64C7\\u5176\\u4ED6\\u65B9\\u5F0F\\u3002\",oauthReopen:\"\\u91CD\\u65B0\\u958B\\u555F\\u8996\\u7A97\",oauthFullPage:\"\\u5728\\u76EE\\u524D\\u9801\\u9762\\u7E7C\\u7E8C\",emailEdit:\"\\u4FEE\\u6539\\u96FB\\u5B50\\u90F5\\u4EF6\",emailCooldown:\"{seconds} \\u79D2\\u5F8C\\u91CD\\u65B0\\u50B3\\u9001\",walletRetry:\"\\u9322\\u5305\\u672A\\u958B\\u555F\\uFF1F\\u8ACB\\u91CD\\u8A66\\u6216\\u6383\\u78BC\\u3002\",tryAgain:\"\\u91CD\\u8A66\",signIn:\"\\u767B\\u5165\\u6216\\u5EFA\\u7ACB\\u5E33\\u6236\",signInTo:\"\\u767B\\u5165\\u6216\\u52A0\\u5165 {appName}\",passkeyButton:\"\\u4F7F\\u7528 Passkey \\u7E7C\\u7E8C\",passkeySignIn:\"\\u4F7F\\u7528 Passkey \\u767B\\u5165\",passkeyCreate:\"\\u5EFA\\u7ACB Passkey\",passkeyFirstTime:\"\\u7B2C\\u4E00\\u6B21\\u4F7F\\u7528\\uFF1F\\u5EFA\\u7ACB\\u5E33\\u6236\",passkeyBackToSignIn:\"\\u8FD4\\u56DE\\u767B\\u5165\",passkeyWaiting:\"\\u6B63\\u5728\\u7B49\\u5F85 Passkey\\u2026\",passkeyCreating:\"\\u6B63\\u5728\\u5EFA\\u7ACB Passkey\\u2026\",passkeyNoLocal:\"\\u9019\\u6B21\\u672A\\u5B8C\\u6210 Passkey \\u9A57\\u8B49\\u3002\\u8ACB\\u91CD\\u8A66\\u3001\\u4F7F\\u7528\\u5176\\u4ED6\\u88DD\\u7F6E\\uFF0C\\u6216\\u9078\\u64C7\\u5176\\u4ED6\\u767B\\u5165\\u65B9\\u5F0F\\u3002\",passkeyUseAnotherDevice:\"\\u7528\\u5176\\u4ED6\\u88DD\\u7F6E\\u767B\\u5165\",passkeyCreateInstead:\"\\u7B2C\\u4E00\\u6B21\\u4F7F\\u7528\\uFF1F\\u5EFA\\u7ACB\\u5E33\\u6236\",didWalletButton:\"\\u4F7F\\u7528 DID Wallet \\u7E7C\\u7E8C\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"\\u8ACB\\u4F7F\\u7528 DID Wallet \\u6383\\u78BC\",waitingWallet:\"\\u6B63\\u5728\\u8981\\u6C42\\u9023\\u7DDA\",walletContinue:\"\\u8ACB\\u5728 DID Wallet \\u4E2D\\u7E7C\\u7E8C\\u5B8C\\u6210\\u60A8\\u7684\\u64CD\\u4F5C\",noPasskey:\"\\u672A\\u627E\\u5230\\u5DF2\\u6709 Passkey\\u3002\\u8F38\\u5165\\u540D\\u7A31\\u4E26\\u5EFA\\u7ACB\\u4E00\\u500B\\u3002\",success:\"\\u6210\\u529F\",timeout:\"\\u5DE5\\u4F5C\\u968E\\u6BB5\\u903E\\u6642\\uFF0C\\u8ACB\\u91CD\\u8A66\\u3002\",refreshQR:\"\\u91CD\\u65B0\\u6574\\u7406\",namePlaceholder:\"\\u60A8\\u7684\\u540D\\u5B57\\uFF08\\u9078\\u586B\\uFF09\",or:\"\\u6216\",emailPlaceholder:\"\\u96FB\\u5B50\\u90F5\\u4EF6\\u5730\\u5740\",emailButton:\"\\u96FB\\u5B50\\u90F5\\u4EF6\",passkeyUnsupported:\"\\u60A8\\u7684\\u700F\\u89BD\\u5668\\u4E0D\\u652F\\u63F4 Passkey \\u8A8D\\u8B49\\u3002\",connecting:\"\\u9023\\u7DDA\\u4E2D...\",verifying:\"\\u9A57\\u8B49\\u4E2D...\",openInWallet:\"\\u5728 DID Wallet \\u4E2D\\u958B\\u555F\",authFailed:\"\\u8A8D\\u8B49\\u5931\\u6557\",registrationFailed:\"\\u8A3B\\u518A\\u5931\\u6557\",passkeySetupFailed:\"Passkey \\u8A2D\\u5B9A\\u5931\\u6557\",accessDenied:\"\\u5B58\\u53D6\\u88AB\\u62D2\\u7D55\\uFF1A\\u60A8\\u7684\\u5E33\\u865F\\u7121\\u6B0A\\u767B\\u5165\\u6B64\\u7DB2\\u7AD9\\u3002\",regClosed:\"\\u8A3B\\u518A\\u9700\\u8981\\u9080\\u8ACB\\u3002\",federatedBy:\"\\u8A8D\\u8B49\\u670D\\u52D9\\u7531 {masterName} \\u63D0\\u4F9B\",securedBy:\"\\u7531 DID Connect \\u63D0\\u4F9B\\u5B89\\u5168\\u4FDD\\u969C\",privacy:\"\\u96B1\\u79C1\",terms:\"\\u689D\\u6B3E\",back:\"\\u8FD4\\u56DE\",cancel:\"\\u53D6\\u6D88\",scanTitle:\"\\u4F7F\\u7528 DID Wallet \\u6383\\u78BC\",emailTitle:\"\\u4F7F\\u7528\\u96FB\\u5B50\\u90F5\\u4EF6\\u7E7C\\u7E8C\",emailSubmit:\"\\u50B3\\u9001\\u9A57\\u8B49\\u78BC\",emailSending:\"\\u6B63\\u5728\\u50B3\\u9001\\u9A57\\u8B49\\u78BC...\",emailSent:\"\\u9A57\\u8B49\\u78BC\\u5DF2\\u50B3\\u9001\\u81F3 {email}\",emailCodePlaceholder:\"8 \\u4F4D\\u6578\\u9A57\\u8B49\\u78BC\",emailVerify:\"\\u9A57\\u8B49\",emailResend:\"\\u91CD\\u65B0\\u50B3\\u9001\",emailInvalid:\"\\u8ACB\\u8F38\\u5165\\u6709\\u6548\\u7684\\u96FB\\u5B50\\u90F5\\u4EF6\\u5730\\u5740\\u3002\",emailCodeInvalid:\"\\u8ACB\\u8F38\\u5165 8 \\u4F4D\\u6578\\u9A57\\u8B49\\u78BC\\u3002\"},ja:{emailExplanation:\"\\u78BA\\u8A8D\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\\u3057\\u307E\\u3059\\u3002\\u30D1\\u30B9\\u30EF\\u30FC\\u30C9\\u306F\\u4E0D\\u8981\\u3067\\u3059\\u3002\",otherMethods:\"\\u4ED6\\u306E\\u30ED\\u30B0\\u30A4\\u30F3\\u65B9\\u6CD5\",passkeyCreateAccount:\"Passkey \\u3067\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u4F5C\\u6210\",lastUsed:\"\\u524D\\u56DE\\u306E\\u65B9\\u6CD5\\uFF1A{method}\",passkeyExplanation:\"\\u6307\\u7D0B\\u3001\\u9854\\u8A8D\\u8A3C\\u3001\\u307E\\u305F\\u306F\\u30C7\\u30D0\\u30A4\\u30B9\\u306E\\u30ED\\u30C3\\u30AF\\u89E3\\u9664\\u3067\\u65B0\\u3057\\u3044\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u4F5C\\u6210\\u3057\\u307E\\u3059\\u3002\\u30D1\\u30B9\\u30EF\\u30FC\\u30C9\\u306F\\u4E0D\\u8981\\u3067\\u3059\\u3002\\u30C7\\u30D0\\u30A4\\u30B9\\u304C Passkey \\u306E\\u4FDD\\u5B58\\u3092\\u6C42\\u3081\\u307E\\u3059\\u3002\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u304A\\u6301\\u3061\\u3067\\u3059\\u304B\\uFF1F\\u30ED\\u30B0\\u30A4\\u30F3\\u306B\\u623B\\u3063\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",continueWith:\"{provider} \\u3067\\u7D9A\\u3051\\u308B\",oauthWaiting:\"{provider} \\u306E\\u30A6\\u30A3\\u30F3\\u30C9\\u30A6\\u3067\\u7D9A\\u3051\\u3066\\u304F\\u3060\\u3055\\u3044\",oauthIncomplete:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u306F\\u307E\\u3060\\u5B8C\\u4E86\\u3057\\u3066\\u3044\\u307E\\u305B\\u3093\\u3002\\u30A6\\u30A3\\u30F3\\u30C9\\u30A6\\u3092\\u958B\\u304D\\u76F4\\u3059\\u304B\\u3001\\u5225\\u306E\\u65B9\\u6CD5\\u3092\\u9078\\u3093\\u3067\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthReopen:\"\\u30A6\\u30A3\\u30F3\\u30C9\\u30A6\\u3092\\u958B\\u304D\\u76F4\\u3059\",oauthFullPage:\"\\u3053\\u306E\\u30DA\\u30FC\\u30B8\\u3067\\u7D9A\\u3051\\u308B\",emailEdit:\"\\u30E1\\u30FC\\u30EB\\u30A2\\u30C9\\u30EC\\u30B9\\u3092\\u5909\\u66F4\",emailCooldown:\"{seconds} \\u79D2\\u5F8C\\u306B\\u518D\\u9001\\u4FE1\",walletRetry:\"\\u30A6\\u30A9\\u30EC\\u30C3\\u30C8\\u304C\\u958B\\u304B\\u306A\\u3044\\u5834\\u5408\\u306F\\u3001\\u518D\\u8A66\\u884C\\u3059\\u308B\\u304B QR \\u30B3\\u30FC\\u30C9\\u3092\\u30B9\\u30AD\\u30E3\\u30F3\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",tryAgain:\"\\u518D\\u8A66\\u884C\",signIn:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u307E\\u305F\\u306F\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u4F5C\\u6210\",signInTo:\"{appName} \\u306B\\u30ED\\u30B0\\u30A4\\u30F3\\u307E\\u305F\\u306F\\u53C2\\u52A0\",passkeyButton:\"Passkey \\u3067\\u7D9A\\u3051\\u308B\",passkeySignIn:\"Passkey \\u3067\\u30ED\\u30B0\\u30A4\\u30F3\",passkeyCreate:\"Passkey \\u3092\\u4F5C\\u6210\",passkeyFirstTime:\"\\u521D\\u3081\\u3066\\u3067\\u3059\\u304B\\uFF1F\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u4F5C\\u6210\",passkeyBackToSignIn:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u306B\\u623B\\u308B\",passkeyWaiting:\"Passkey \\u3092\\u5F85\\u3063\\u3066\\u3044\\u307E\\u3059\\u2026\",passkeyCreating:\"Passkey \\u3092\\u4F5C\\u6210\\u3057\\u3066\\u3044\\u307E\\u3059\\u2026\",passkeyNoLocal:\"\\u4ECA\\u56DE\\u306F Passkey \\u306E\\u78BA\\u8A8D\\u304C\\u5B8C\\u4E86\\u3057\\u307E\\u305B\\u3093\\u3067\\u3057\\u305F\\u3002\\u518D\\u8A66\\u884C\\u3059\\u308B\\u304B\\u3001\\u5225\\u306E\\u30C7\\u30D0\\u30A4\\u30B9\\u3092\\u4F7F\\u3046\\u304B\\u3001\\u5225\\u306E\\u65B9\\u6CD5\\u3092\\u9078\\u3093\\u3067\\u304F\\u3060\\u3055\\u3044\\u3002\",passkeyUseAnotherDevice:\"\\u5225\\u306E\\u30C7\\u30D0\\u30A4\\u30B9\\u3092\\u4F7F\\u7528\",passkeyCreateInstead:\"\\u521D\\u3081\\u3066\\u3067\\u3059\\u304B\\uFF1F\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u4F5C\\u6210\",didWalletButton:\"DID Wallet \\u3067\\u7D9A\\u3051\\u308B\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"DID Wallet \\u3067\\u30B9\\u30AD\\u30E3\\u30F3\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\",waitingWallet:\"\\u63A5\\u7D9A\\u3092\\u8981\\u6C42\\u3057\\u3066\\u3044\\u307E\\u3059\",walletContinue:\"DID Wallet \\u3067\\u64CD\\u4F5C\\u3092\\u7D9A\\u3051\\u3066\\u304F\\u3060\\u3055\\u3044\",noPasskey:\"\\u65E2\\u5B58\\u306E Passkey \\u304C\\u898B\\u3064\\u304B\\u308A\\u307E\\u305B\\u3093\\u3002\\u540D\\u524D\\u3092\\u5165\\u529B\\u3057\\u3066\\u4F5C\\u6210\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",success:\"\\u6210\\u529F\\u3057\\u307E\\u3057\\u305F\",timeout:\"\\u30BB\\u30C3\\u30B7\\u30E7\\u30F3\\u304C\\u30BF\\u30A4\\u30E0\\u30A2\\u30A6\\u30C8\\u3057\\u307E\\u3057\\u305F\\u3002\\u3082\\u3046\\u4E00\\u5EA6\\u304A\\u8A66\\u3057\\u304F\\u3060\\u3055\\u3044\\u3002\",refreshQR:\"\\u66F4\\u65B0\",namePlaceholder:\"\\u304A\\u540D\\u524D\\uFF08\\u4EFB\\u610F\\uFF09\",or:\"\\u307E\\u305F\\u306F\",emailPlaceholder:\"\\u30E1\\u30FC\\u30EB\\u30A2\\u30C9\\u30EC\\u30B9\",emailButton:\"\\u30E1\\u30FC\\u30EB\",passkeyUnsupported:\"\\u304A\\u4F7F\\u3044\\u306E\\u30D6\\u30E9\\u30A6\\u30B6\\u30FC\\u306F Passkey \\u8A8D\\u8A3C\\u3092\\u30B5\\u30DD\\u30FC\\u30C8\\u3057\\u3066\\u3044\\u307E\\u305B\\u3093\\u3002\",connecting:\"\\u63A5\\u7D9A\\u3057\\u3066\\u3044\\u307E\\u3059...\",verifying:\"\\u78BA\\u8A8D\\u3057\\u3066\\u3044\\u307E\\u3059...\",openInWallet:\"DID Wallet \\u3067\\u958B\\u304F\",authFailed:\"\\u8A8D\\u8A3C\\u306B\\u5931\\u6557\\u3057\\u307E\\u3057\\u305F\",registrationFailed:\"\\u767B\\u9332\\u306B\\u5931\\u6557\\u3057\\u307E\\u3057\\u305F\",passkeySetupFailed:\"Passkey \\u306E\\u8A2D\\u5B9A\\u306B\\u5931\\u6557\\u3057\\u307E\\u3057\\u305F\",accessDenied:\"\\u30A2\\u30AF\\u30BB\\u30B9\\u304C\\u62D2\\u5426\\u3055\\u308C\\u307E\\u3057\\u305F\\uFF1A\\u3053\\u306E\\u30B5\\u30A4\\u30C8\\u306B\\u30ED\\u30B0\\u30A4\\u30F3\\u3059\\u308B\\u6A29\\u9650\\u304C\\u3042\\u308A\\u307E\\u305B\\u3093\\u3002\",regClosed:\"\\u767B\\u9332\\u306B\\u306F\\u62DB\\u5F85\\u304C\\u5FC5\\u8981\\u3067\\u3059\\u3002\",federatedBy:\"\\u8A8D\\u8A3C\\u30B5\\u30FC\\u30D3\\u30B9\\u306F {masterName} \\u304C\\u63D0\\u4F9B\\u3057\\u3066\\u3044\\u307E\\u3059\",securedBy:\"DID Connect \\u306B\\u3088\\u308A\\u4FDD\\u8B77\\u3055\\u308C\\u3066\\u3044\\u307E\\u3059\",privacy:\"\\u30D7\\u30E9\\u30A4\\u30D0\\u30B7\\u30FC\",terms:\"\\u5229\\u7528\\u898F\\u7D04\",back:\"\\u623B\\u308B\",cancel:\"\\u30AD\\u30E3\\u30F3\\u30BB\\u30EB\",scanTitle:\"DID Wallet \\u3067\\u30B9\\u30AD\\u30E3\\u30F3\",emailTitle:\"\\u30E1\\u30FC\\u30EB\\u3067\\u7D9A\\u3051\\u308B\",emailSubmit:\"\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\",emailSending:\"\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\\u3057\\u3066\\u3044\\u307E\\u3059...\",emailSent:\"{email} \\u306B 8 \\u6841\\u306E\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\\u3057\\u307E\\u3057\\u305F\",emailCodePlaceholder:\"8 \\u6841\\u306E\\u30B3\\u30FC\\u30C9\",emailVerify:\"\\u78BA\\u8A8D\",emailResend:\"\\u30B3\\u30FC\\u30C9\\u3092\\u518D\\u9001\\u4FE1\",emailInvalid:\"\\u6709\\u52B9\\u306A\\u30E1\\u30FC\\u30EB\\u30A2\\u30C9\\u30EC\\u30B9\\u3092\\u5165\\u529B\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",emailCodeInvalid:\"8 \\u6841\\u306E\\u30B3\\u30FC\\u30C9\\u3092\\u5165\\u529B\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\"}},ce=[{code:\"en\",label:\"English\"},{code:\"zh\",label:\"\\u4E2D\\u6587\"}];function b(t,e,r){let o=e&&le[e]?e:\"en\",i=le[o][t]??le.en[t]??t;if(r)for(let[a,s]of Object.entries(r))i=i.replace(new RegExp(`\\\\{${a}\\\\}`,\"g\"),s);return i}var de='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M3 20v-2.8q0-.85.438-1.562T4.6 14.55q1.55-.775 3.15-1.162T11 13q.5 0 1 .038t1 .112q-.1 1.45.525 2.738T15.35 18v2zm16 3l-1.5-1.5v-4.65q-1.1-.325-1.8-1.237T15 13.5q0-1.45 1.025-2.475T18.5 10t2.475 1.025T22 13.5q0 1.125-.638 2t-1.612 1.25L21 18l-1.5 1.5L21 21zm-8-11q-1.65 0-2.825-1.175T7 8t1.175-2.825T11 4t2.825 1.175T15 8t-1.175 2.825T11 12m7.5 2q.425 0 .713-.288T19.5 13t-.288-.712T18.5 12t-.712.288T17.5 13t.288.713t.712.287\"/></svg>',Ce='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"3\" fill=\"#4598FA\"/><rect x=\"3\" y=\"6\" width=\"18\" height=\"12\" rx=\"2\" fill=\"white\" opacity=\"0.9\"/><rect x=\"0\" y=\"14\" width=\"24\" height=\"10\" rx=\"0\" fill=\"url(#dw_g)\"/><path d=\"M5.5 9.5h4.5c.3 0 .5.2.5.5v2.5c0 .3-.2.5-.5.5H5.5c-.3 0-.5-.2-.5-.5V10c0-.3.2-.5.5-.5z\" fill=\"#4598FA\"/><defs><linearGradient id=\"dw_g\" x1=\"12\" y1=\"14\" x2=\"12\" y2=\"24\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#77B2F6\"/><stop offset=\"1\" stop-color=\"#4598FA\"/></linearGradient></defs></svg>',ze='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M22 7.535V17a3 3 0 0 1-2.824 2.995L19 20H5a3 3 0 0 1-2.995-2.824L2 17V7.535l9.445 6.297l.116.066a1 1 0 0 0 .878 0l.116-.066z\"/><path fill=\"currentColor\" d=\"M19 4c1.08 0 2.027.57 2.555 1.427L12 11.797l-9.555-6.37a2.999 2.999 0 0 1 2.354-1.42L5 4z\"/></svg>',Ve='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M12 1L3 5v6c0 5.55 3.84 10.74 9 12c5.16-1.26 9-6.45 9-12V5zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11z\"/></svg>',ve='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M20 11H7.83l5.59-5.59L12 4l-8 8l8 8l1.41-1.41L7.83 13H20z\"/></svg>',qe={google:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 262\"><path fill=\"#4285F4\" d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622l38.755 30.023l2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"/><path fill=\"#34A853\" d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055c-34.523 0-63.824-22.773-74.269-54.25l-1.531.13l-40.298 31.187l-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"/><path fill=\"#FBBC05\" d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82c0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602z\"/><path fill=\"#EB4335\" d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0C79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"/></svg>',github:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 250\" fill=\"currentColor\"><path d=\"M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46c6.397 1.185 8.746-2.777 8.746-6.158c0-3.052-.12-13.135-.174-23.83c-35.61 7.742-43.124-15.103-43.124-15.103c-5.823-14.795-14.213-18.73-14.213-18.73c-11.613-7.944.876-7.78.876-7.78c12.853.902 19.621 13.19 19.621 13.19c11.417 19.568 29.945 13.911 37.249 10.64c1.149-8.272 4.466-13.92 8.127-17.116c-28.431-3.236-58.318-14.212-58.318-63.258c0-13.975 5-25.394 13.188-34.358c-1.329-3.224-5.71-16.242 1.24-33.874c0 0 10.749-3.44 35.21 13.121c10.21-2.836 21.16-4.258 32.038-4.307c10.878.049 21.837 1.47 32.066 4.307c24.431-16.56 35.165-13.12 35.165-13.12c6.967 17.63 2.584 30.65 1.255 33.873c8.207 8.964 13.173 20.383 13.173 34.358c0 49.163-29.944 59.988-58.447 63.157c4.591 3.972 8.682 11.762 8.682 23.704c0 17.126-.148 30.91-.148 35.126c0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002C256 57.307 198.691 0 128.001 0\"/></svg>',apple:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 315\" fill=\"currentColor\"><path d=\"M213.803 167.03c.442 47.58 41.74 63.413 42.197 63.615c-.35 1.116-6.599 22.563-21.757 44.716c-13.104 19.153-26.705 38.235-48.13 38.63c-21.05.388-27.82-12.483-51.888-12.483c-24.061 0-31.582 12.088-51.51 12.871c-20.68.783-36.428-20.71-49.64-39.793c-27-39.033-47.633-110.3-19.928-158.406c13.763-23.89 38.36-39.017 65.056-39.405c20.307-.388 39.475 13.675 51.889 13.675c12.406 0 35.699-16.895 60.186-14.414c10.25.427 39.026 4.14 57.503 31.186c-1.49.923-34.335 20.044-33.978 59.808M174.24 50.199c10.98-13.29 18.369-31.79 16.353-50.199c-15.826.636-34.962 10.546-46.314 23.828c-10.173 11.763-19.082 30.589-16.678 48.633c17.64 1.365 35.66-8.964 46.639-22.262\"/></svg>',twitter:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M149.079 108.399L242.33 0h-22.098l-80.97 94.12L74.59 0H0l97.796 142.328L0 256h22.1l85.507-99.395L175.905 256h74.59L149.073 108.399zM118.81 143.58l-9.909-14.172l-78.84-112.773h33.943l63.625 91.011l9.909 14.173l82.705 118.3H186.3l-67.49-96.533z\"/></svg>',auth0:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 256\"><path fill=\"#EB5424\" d=\"M203.97 200.38L167.47 88l-39.5 112.38h75.98zm0-144.76L167.47 168l75.97-26.16l19.76-60.82c6.64-20.4-1.94-42.72-21.18-52.76l-38.06 27.36zM52.03 55.62L88.54 168l39.5-112.38H52.02zM52.03 200.38L88.54 88L12.56 114.16l-5.92 18.2c-6.64 20.4 1.94 42.72 21.18 52.76l24.2-17.38l.01.01v-.01l-.01.01.01-.37z\"/></svg>',facebook:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 256\"><path fill=\"#1877F2\" d=\"M256 128C256 57.308 198.692 0 128 0S0 57.308 0 128c0 63.888 46.808 116.843 108 126.445V165H75.5v-37H108V99.8c0-32.08 19.11-49.8 48.348-49.8C170.352 50 185 52.5 185 52.5V84h-16.14C152.959 84 148 93.867 148 103.99V128h35.5l-5.675 37H148v89.445c61.192-9.602 108-62.556 108-126.445\"/></svg>'},ke='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93c0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41c0 2.08-.8 3.97-2.1 5.39\"/></svg>';function je(t){return qe[t.toLowerCase()]??\"\"}var J=function(t,e){let i=t,a=ne[e],s=null,n=0,u=null,p=[],f={},l=function(c,m){n=i*4+17,s=(function(h){let y=new Array(h);for(let g=0;g<h;g+=1){y[g]=new Array(h);for(let w=0;w<h;w+=1)y[g][w]=null}return y})(n),d(0,0),d(n-7,0),d(0,n-7),_(),A(),v(c,m),i>=7&&x(c),u==null&&(u=N(i,a,p)),D(u,m)},d=function(c,m){for(let h=-1;h<=7;h+=1)if(!(c+h<=-1||n<=c+h))for(let y=-1;y<=7;y+=1)m+y<=-1||n<=m+y||(0<=h&&h<=6&&(y==0||y==6)||0<=y&&y<=6&&(h==0||h==6)||2<=h&&h<=4&&2<=y&&y<=4?s[c+h][m+y]=!0:s[c+h][m+y]=!1)},E=function(){let c=0,m=0;for(let h=0;h<8;h+=1){l(!0,h);let y=j.getLostPoint(f);(h==0||c>y)&&(c=y,m=h)}return m},A=function(){for(let c=8;c<n-8;c+=1)s[c][6]==null&&(s[c][6]=c%2==0);for(let c=8;c<n-8;c+=1)s[6][c]==null&&(s[6][c]=c%2==0)},_=function(){let c=j.getPatternPosition(i);for(let m=0;m<c.length;m+=1)for(let h=0;h<c.length;h+=1){let y=c[m],g=c[h];if(s[y][g]==null)for(let w=-2;w<=2;w+=1)for(let C=-2;C<=2;C+=1)w==-2||w==2||C==-2||C==2||w==0&&C==0?s[y+w][g+C]=!0:s[y+w][g+C]=!1}},x=function(c){let m=j.getBCHTypeNumber(i);for(let h=0;h<18;h+=1){let y=!c&&(m>>h&1)==1;s[Math.floor(h/3)][h%3+n-8-3]=y}for(let h=0;h<18;h+=1){let y=!c&&(m>>h&1)==1;s[h%3+n-8-3][Math.floor(h/3)]=y}},v=function(c,m){let h=a<<3|m,y=j.getBCHTypeInfo(h);for(let g=0;g<15;g+=1){let w=!c&&(y>>g&1)==1;g<6?s[g][8]=w:g<8?s[g+1][8]=w:s[n-15+g][8]=w}for(let g=0;g<15;g+=1){let w=!c&&(y>>g&1)==1;g<8?s[8][n-g-1]=w:g<9?s[8][15-g-1+1]=w:s[8][15-g-1]=w}s[n-8][8]=!c},D=function(c,m){let h=-1,y=n-1,g=7,w=0,C=j.getMaskFunction(m);for(let F=n-1;F>0;F-=2)for(F==6&&(F-=1);;){for(let L=0;L<2;L+=1)if(s[y][F-L]==null){let P=!1;w<c.length&&(P=(c[w]>>>g&1)==1),C(y,F-L)&&(P=!P),s[y][F-L]=P,g-=1,g==-1&&(w+=1,g=7)}if(y+=h,y<0||n<=y){y-=h,h=-h;break}}},T=function(c,m){let h=0,y=0,g=0,w=new Array(m.length),C=new Array(m.length);for(let k=0;k<m.length;k+=1){let R=m[k].dataCount,z=m[k].totalCount-R;y=Math.max(y,R),g=Math.max(g,z),w[k]=new Array(R);for(let V=0;V<w[k].length;V+=1)w[k][V]=255&c.getBuffer()[V+h];h+=R;let se=j.getErrorCorrectPolynomial(z),fe=oe(w[k],se.getLength()-1).mod(se);C[k]=new Array(se.getLength()-1);for(let V=0;V<C[k].length;V+=1){let ge=V+fe.getLength()-C[k].length;C[k][V]=ge>=0?fe.getAt(ge):0}}let F=0;for(let k=0;k<m.length;k+=1)F+=m[k].totalCount;let L=new Array(F),P=0;for(let k=0;k<y;k+=1)for(let R=0;R<m.length;R+=1)k<w[R].length&&(L[P]=w[R][k],P+=1);for(let k=0;k<g;k+=1)for(let R=0;R<m.length;R+=1)k<C[R].length&&(L[P]=C[R][k],P+=1);return L},N=function(c,m,h){let y=Ae.getRSBlocks(c,m),g=_e();for(let C=0;C<h.length;C+=1){let F=h[C];g.put(F.getMode(),4),g.put(F.getLength(),j.getLengthInBits(F.getMode(),c)),F.write(g)}let w=0;for(let C=0;C<y.length;C+=1)w+=y[C].dataCount;if(g.getLengthInBits()>w*8)throw\"code length overflow. (\"+g.getLengthInBits()+\">\"+w*8+\")\";for(g.getLengthInBits()+4<=w*8&&g.put(0,4);g.getLengthInBits()%8!=0;)g.putBit(!1);for(;!(g.getLengthInBits()>=w*8||(g.put(236,8),g.getLengthInBits()>=w*8));)g.put(17,8);return T(g,y)};f.addData=function(c,m){m=m||\"Byte\";let h=null;switch(m){case\"Numeric\":h=Ye(c);break;case\"Alphanumeric\":h=Qe(c);break;case\"Byte\":h=Ge(c);break;case\"Kanji\":h=Je(c);break;default:throw\"mode:\"+m}p.push(h),u=null},f.isDark=function(c,m){if(c<0||n<=c||m<0||n<=m)throw c+\",\"+m;return s[c][m]},f.getModuleCount=function(){return n},f.make=function(){if(i<1){let c=1;for(;c<40;c++){let m=Ae.getRSBlocks(c,a),h=_e();for(let g=0;g<p.length;g++){let w=p[g];h.put(w.getMode(),4),h.put(w.getLength(),j.getLengthInBits(w.getMode(),c)),w.write(h)}let y=0;for(let g=0;g<m.length;g++)y+=m[g].dataCount;if(h.getLengthInBits()<=y*8)break}i=c}l(!1,E())},f.createTableTag=function(c,m){c=c||2,m=typeof m>\"u\"?c*4:m;let h=\"\";h+='<table style=\"',h+=\" border-width: 0px; border-style: none;\",h+=\" border-collapse: collapse;\",h+=\" padding: 0px; margin: \"+m+\"px;\",h+='\">',h+=\"<tbody>\";for(let y=0;y<f.getModuleCount();y+=1){h+=\"<tr>\";for(let g=0;g<f.getModuleCount();g+=1)h+='<td style=\"',h+=\" border-width: 0px; border-style: none;\",h+=\" border-collapse: collapse;\",h+=\" padding: 0px; margin: 0px;\",h+=\" width: \"+c+\"px;\",h+=\" height: \"+c+\"px;\",h+=\" background-color: \",h+=f.isDark(y,g)?\"#000000\":\"#ffffff\",h+=\";\",h+='\"/>';h+=\"</tr>\"}return h+=\"</tbody>\",h+=\"</table>\",h},f.createSvgTag=function(c,m,h,y){let g={};typeof arguments[0]==\"object\"&&(g=arguments[0],c=g.cellSize,m=g.margin,h=g.alt,y=g.title),c=c||2,m=typeof m>\"u\"?c*4:m,h=typeof h==\"string\"?{text:h}:h||{},h.text=h.text||null,h.id=h.text?h.id||\"qrcode-description\":null,y=typeof y==\"string\"?{text:y}:y||{},y.text=y.text||null,y.id=y.text?y.id||\"qrcode-title\":null;let w=f.getModuleCount()*c+m*2,C,F,L,P,k=\"\",R;for(R=\"l\"+c+\",0 0,\"+c+\" -\"+c+\",0 0,-\"+c+\"z \",k+='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"',k+=g.scalable?\"\":' width=\"'+w+'px\" height=\"'+w+'px\"',k+=' viewBox=\"0 0 '+w+\" \"+w+'\" ',k+=' preserveAspectRatio=\"xMinYMin meet\"',k+=y.text||h.text?' role=\"img\" aria-labelledby=\"'+I([y.id,h.id].join(\" \").trim())+'\"':\"\",k+=\">\",k+=y.text?'<title id=\"'+I(y.id)+'\">'+I(y.text)+\"</title>\":\"\",k+=h.text?'<description id=\"'+I(h.id)+'\">'+I(h.text)+\"</description>\":\"\",k+='<rect width=\"100%\" height=\"100%\" fill=\"white\" cx=\"0\" cy=\"0\"/>',k+='<path d=\"',L=0;L<f.getModuleCount();L+=1)for(P=L*c+m,C=0;C<f.getModuleCount();C+=1)f.isDark(L,C)&&(F=C*c+m,k+=\"M\"+F+\",\"+P+R);return k+='\" stroke=\"transparent\" fill=\"black\"/>',k+=\"</svg>\",k},f.createDataURL=function(c,m){c=c||2,m=typeof m>\"u\"?c*4:m;let h=f.getModuleCount()*c+m*2,y=m,g=h-m;return tt(h,h,function(w,C){if(y<=w&&w<g&&y<=C&&C<g){let F=Math.floor((w-y)/c),L=Math.floor((C-y)/c);return f.isDark(L,F)?0:1}else return 1})},f.createImgTag=function(c,m,h){c=c||2,m=typeof m>\"u\"?c*4:m;let y=f.getModuleCount()*c+m*2,g=\"\";return g+=\"<img\",g+=' src=\"',g+=f.createDataURL(c,m),g+='\"',g+=' width=\"',g+=y,g+='\"',g+=' height=\"',g+=y,g+='\"',h&&(g+=' alt=\"',g+=I(h),g+='\"'),g+=\"/>\",g};let I=function(c){let m=\"\";for(let h=0;h<c.length;h+=1){let y=c.charAt(h);switch(y){case\"<\":m+=\"&lt;\";break;case\">\":m+=\"&gt;\";break;case\"&\":m+=\"&amp;\";break;case'\"':m+=\"&quot;\";break;default:m+=y;break}}return m},S=function(c){c=typeof c>\"u\"?2:c;let h=f.getModuleCount()*1+c*2,y=c,g=h-c,w,C,F,L,P,k={\"\\u2588\\u2588\":\"\\u2588\",\"\\u2588 \":\"\\u2580\",\" \\u2588\":\"\\u2584\",\" \":\" \"},R={\"\\u2588\\u2588\":\"\\u2580\",\"\\u2588 \":\"\\u2580\",\" \\u2588\":\" \",\" \":\" \"},z=\"\";for(w=0;w<h;w+=2){for(F=Math.floor((w-y)/1),L=Math.floor((w+1-y)/1),C=0;C<h;C+=1)P=\"\\u2588\",y<=C&&C<g&&y<=w&&w<g&&f.isDark(F,Math.floor((C-y)/1))&&(P=\" \"),y<=C&&C<g&&y<=w+1&&w+1<g&&f.isDark(L,Math.floor((C-y)/1))?P+=\" \":P+=\"\\u2588\",z+=c<1&&w+1>=g?R[P]:k[P];z+=`\n`}return h%2&&c>0?z.substring(0,z.length-h-1)+Array(h+1).join(\"\\u2580\"):z.substring(0,z.length-1)};return f.createASCII=function(c,m){if(c=c||1,c<2)return S(m);c-=1,m=typeof m>\"u\"?c*2:m;let h=f.getModuleCount()*c+m*2,y=m,g=h-m,w,C,F,L,P=Array(c+1).join(\"\\u2588\\u2588\"),k=Array(c+1).join(\" \"),R=\"\",z=\"\";for(w=0;w<h;w+=1){for(F=Math.floor((w-y)/c),z=\"\",C=0;C<h;C+=1)L=1,y<=C&&C<g&&y<=w&&w<g&&f.isDark(F,Math.floor((C-y)/c))&&(L=0),z+=L?P:k;for(F=0;F<c;F+=1)R+=z+`\n`}return R.substring(0,R.length-1)},f.renderTo2dContext=function(c,m){m=m||2;let h=f.getModuleCount();for(let y=0;y<h;y++)for(let g=0;g<h;g++)c.fillStyle=f.isDark(y,g)?\"black\":\"white\",c.fillRect(g*m,y*m,m,m)},f};J.stringToBytes=function(t){let e=[];for(let r=0;r<t.length;r+=1){let o=t.charCodeAt(r);e.push(o&255)}return e};J.createStringToBytes=function(t,e){let r=(function(){let i=Ze(t),a=function(){let u=i.read();if(u==-1)throw\"eof\";return u},s=0,n={};for(;;){let u=i.read();if(u==-1)break;let p=a(),f=a(),l=a(),d=String.fromCharCode(u<<8|p),E=f<<8|l;n[d]=E,s+=1}if(s!=e)throw s+\" != \"+e;return n})(),o=63;return function(i){let a=[];for(let s=0;s<i.length;s+=1){let n=i.charCodeAt(s);if(n<128)a.push(n);else{let u=r[i.charAt(s)];typeof u==\"number\"?(u&255)==u?a.push(u):(a.push(u>>>8),a.push(u&255)):a.push(o)}}return a}};var W={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},ne={L:1,M:0,Q:3,H:2},q={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},j=(function(){let t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],e=1335,r=7973,o=21522,i={},a=function(s){let n=0;for(;s!=0;)n+=1,s>>>=1;return n};return i.getBCHTypeInfo=function(s){let n=s<<10;for(;a(n)-a(e)>=0;)n^=e<<a(n)-a(e);return(s<<10|n)^o},i.getBCHTypeNumber=function(s){let n=s<<12;for(;a(n)-a(r)>=0;)n^=r<<a(n)-a(r);return s<<12|n},i.getPatternPosition=function(s){return t[s-1]},i.getMaskFunction=function(s){switch(s){case q.PATTERN000:return function(n,u){return(n+u)%2==0};case q.PATTERN001:return function(n,u){return n%2==0};case q.PATTERN010:return function(n,u){return u%3==0};case q.PATTERN011:return function(n,u){return(n+u)%3==0};case q.PATTERN100:return function(n,u){return(Math.floor(n/2)+Math.floor(u/3))%2==0};case q.PATTERN101:return function(n,u){return n*u%2+n*u%3==0};case q.PATTERN110:return function(n,u){return(n*u%2+n*u%3)%2==0};case q.PATTERN111:return function(n,u){return(n*u%3+(n+u)%2)%2==0};default:throw\"bad maskPattern:\"+s}},i.getErrorCorrectPolynomial=function(s){let n=oe([1],0);for(let u=0;u<s;u+=1)n=n.multiply(oe([1,Y.gexp(u)],0));return n},i.getLengthInBits=function(s,n){if(1<=n&&n<10)switch(s){case W.MODE_NUMBER:return 10;case W.MODE_ALPHA_NUM:return 9;case W.MODE_8BIT_BYTE:return 8;case W.MODE_KANJI:return 8;default:throw\"mode:\"+s}else if(n<27)switch(s){case W.MODE_NUMBER:return 12;case W.MODE_ALPHA_NUM:return 11;case W.MODE_8BIT_BYTE:return 16;case W.MODE_KANJI:return 10;default:throw\"mode:\"+s}else if(n<41)switch(s){case W.MODE_NUMBER:return 14;case W.MODE_ALPHA_NUM:return 13;case W.MODE_8BIT_BYTE:return 16;case W.MODE_KANJI:return 12;default:throw\"mode:\"+s}else throw\"type:\"+n},i.getLostPoint=function(s){let n=s.getModuleCount(),u=0;for(let l=0;l<n;l+=1)for(let d=0;d<n;d+=1){let E=0,A=s.isDark(l,d);for(let _=-1;_<=1;_+=1)if(!(l+_<0||n<=l+_))for(let x=-1;x<=1;x+=1)d+x<0||n<=d+x||_==0&&x==0||A==s.isDark(l+_,d+x)&&(E+=1);E>5&&(u+=3+E-5)}for(let l=0;l<n-1;l+=1)for(let d=0;d<n-1;d+=1){let E=0;s.isDark(l,d)&&(E+=1),s.isDark(l+1,d)&&(E+=1),s.isDark(l,d+1)&&(E+=1),s.isDark(l+1,d+1)&&(E+=1),(E==0||E==4)&&(u+=3)}for(let l=0;l<n;l+=1)for(let d=0;d<n-6;d+=1)s.isDark(l,d)&&!s.isDark(l,d+1)&&s.isDark(l,d+2)&&s.isDark(l,d+3)&&s.isDark(l,d+4)&&!s.isDark(l,d+5)&&s.isDark(l,d+6)&&(u+=40);for(let l=0;l<n;l+=1)for(let d=0;d<n-6;d+=1)s.isDark(d,l)&&!s.isDark(d+1,l)&&s.isDark(d+2,l)&&s.isDark(d+3,l)&&s.isDark(d+4,l)&&!s.isDark(d+5,l)&&s.isDark(d+6,l)&&(u+=40);let p=0;for(let l=0;l<n;l+=1)for(let d=0;d<n;d+=1)s.isDark(d,l)&&(p+=1);let f=Math.abs(100*p/n/n-50)/5;return u+=f*10,u},i})(),Y=(function(){let t=new Array(256),e=new Array(256);for(let o=0;o<8;o+=1)t[o]=1<<o;for(let o=8;o<256;o+=1)t[o]=t[o-4]^t[o-5]^t[o-6]^t[o-8];for(let o=0;o<255;o+=1)e[t[o]]=o;let r={};return r.glog=function(o){if(o<1)throw\"glog(\"+o+\")\";return e[o]},r.gexp=function(o){for(;o<0;)o+=255;for(;o>=256;)o-=255;return t[o]},r})(),oe=function(t,e){if(typeof t.length>\"u\")throw t.length+\"/\"+e;let r=(function(){let i=0;for(;i<t.length&&t[i]==0;)i+=1;let a=new Array(t.length-i+e);for(let s=0;s<t.length-i;s+=1)a[s]=t[s+i];return a})(),o={};return o.getAt=function(i){return r[i]},o.getLength=function(){return r.length},o.multiply=function(i){let a=new Array(o.getLength()+i.getLength()-1);for(let s=0;s<o.getLength();s+=1)for(let n=0;n<i.getLength();n+=1)a[s+n]^=Y.gexp(Y.glog(o.getAt(s))+Y.glog(i.getAt(n)));return oe(a,0)},o.mod=function(i){if(o.getLength()-i.getLength()<0)return o;let a=Y.glog(o.getAt(0))-Y.glog(i.getAt(0)),s=new Array(o.getLength());for(let n=0;n<o.getLength();n+=1)s[n]=o.getAt(n);for(let n=0;n<i.getLength();n+=1)s[n]^=Y.gexp(Y.glog(i.getAt(n))+a);return oe(s,0).mod(i)},o},Ae=(function(){let t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e=function(i,a){let s={};return s.totalCount=i,s.dataCount=a,s},r={},o=function(i,a){switch(a){case ne.L:return t[(i-1)*4+0];case ne.M:return t[(i-1)*4+1];case ne.Q:return t[(i-1)*4+2];case ne.H:return t[(i-1)*4+3];default:return}};return r.getRSBlocks=function(i,a){let s=o(i,a);if(typeof s>\"u\")throw\"bad rs block @ typeNumber:\"+i+\"/errorCorrectionLevel:\"+a;let n=s.length/3,u=[];for(let p=0;p<n;p+=1){let f=s[p*3+0],l=s[p*3+1],d=s[p*3+2];for(let E=0;E<f;E+=1)u.push(e(l,d))}return u},r})(),_e=function(){let t=[],e=0,r={};return r.getBuffer=function(){return t},r.getAt=function(o){let i=Math.floor(o/8);return(t[i]>>>7-o%8&1)==1},r.put=function(o,i){for(let a=0;a<i;a+=1)r.putBit((o>>>i-a-1&1)==1)},r.getLengthInBits=function(){return e},r.putBit=function(o){let i=Math.floor(e/8);t.length<=i&&t.push(0),o&&(t[i]|=128>>>e%8),e+=1},r},Ye=function(t){let e=W.MODE_NUMBER,r=t,o={};o.getMode=function(){return e},o.getLength=function(s){return r.length},o.write=function(s){let n=r,u=0;for(;u+2<n.length;)s.put(i(n.substring(u,u+3)),10),u+=3;u<n.length&&(n.length-u==1?s.put(i(n.substring(u,u+1)),4):n.length-u==2&&s.put(i(n.substring(u,u+2)),7))};let i=function(s){let n=0;for(let u=0;u<s.length;u+=1)n=n*10+a(s.charAt(u));return n},a=function(s){if(\"0\"<=s&&s<=\"9\")return s.charCodeAt(0)-48;throw\"illegal char :\"+s};return o},Qe=function(t){let e=W.MODE_ALPHA_NUM,r=t,o={};o.getMode=function(){return e},o.getLength=function(a){return r.length},o.write=function(a){let s=r,n=0;for(;n+1<s.length;)a.put(i(s.charAt(n))*45+i(s.charAt(n+1)),11),n+=2;n<s.length&&a.put(i(s.charAt(n)),6)};let i=function(a){if(\"0\"<=a&&a<=\"9\")return a.charCodeAt(0)-48;if(\"A\"<=a&&a<=\"Z\")return a.charCodeAt(0)-65+10;switch(a){case\" \":return 36;case\"$\":return 37;case\"%\":return 38;case\"*\":return 39;case\"+\":return 40;case\"-\":return 41;case\".\":return 42;case\"/\":return 43;case\":\":return 44;default:throw\"illegal char :\"+a}};return o},Ge=function(t){let e=W.MODE_8BIT_BYTE,r=t,o=J.stringToBytes(t),i={};return i.getMode=function(){return e},i.getLength=function(a){return o.length},i.write=function(a){for(let s=0;s<o.length;s+=1)a.put(o[s],8)},i},Je=function(t){let e=W.MODE_KANJI,r=t,o=J.stringToBytes;(function(s,n){let u=o(s);if(u.length!=2||(u[0]<<8|u[1])!=n)throw\"sjis not supported.\"})(\"\\u53CB\",38726);let i=o(t),a={};return a.getMode=function(){return e},a.getLength=function(s){return~~(i.length/2)},a.write=function(s){let n=i,u=0;for(;u+1<n.length;){let p=(255&n[u])<<8|255&n[u+1];if(33088<=p&&p<=40956)p-=33088;else if(57408<=p&&p<=60351)p-=49472;else throw\"illegal char at \"+(u+1)+\"/\"+p;p=(p>>>8&255)*192+(p&255),s.put(p,13),u+=2}if(u<n.length)throw\"illegal char at \"+(u+1)},a},Ie=function(){let t=[],e={};return e.writeByte=function(r){t.push(r&255)},e.writeShort=function(r){e.writeByte(r),e.writeByte(r>>>8)},e.writeBytes=function(r,o,i){o=o||0,i=i||r.length;for(let a=0;a<i;a+=1)e.writeByte(r[a+o])},e.writeString=function(r){for(let o=0;o<r.length;o+=1)e.writeByte(r.charCodeAt(o))},e.toByteArray=function(){return t},e.toString=function(){let r=\"\";r+=\"[\";for(let o=0;o<t.length;o+=1)o>0&&(r+=\",\"),r+=t[o];return r+=\"]\",r},e},Xe=function(){let t=0,e=0,r=0,o=\"\",i={},a=function(n){o+=String.fromCharCode(s(n&63))},s=function(n){if(n<0)throw\"n:\"+n;if(n<26)return 65+n;if(n<52)return 97+(n-26);if(n<62)return 48+(n-52);if(n==62)return 43;if(n==63)return 47;throw\"n:\"+n};return i.writeByte=function(n){for(t=t<<8|n&255,e+=8,r+=1;e>=6;)a(t>>>e-6),e-=6},i.flush=function(){if(e>0&&(a(t<<6-e),t=0,e=0),r%3!=0){let n=3-r%3;for(let u=0;u<n;u+=1)o+=\"=\"}},i.toString=function(){return o},i},Ze=function(t){let e=t,r=0,o=0,i=0,a={};a.read=function(){for(;i<8;){if(r>=e.length){if(i==0)return-1;throw\"unexpected end of file./\"+i}let u=e.charAt(r);if(r+=1,u==\"=\")return i=0,-1;if(u.match(/^\\s$/))continue;o=o<<6|s(u.charCodeAt(0)),i+=6}let n=o>>>i-8&255;return i-=8,n};let s=function(n){if(65<=n&&n<=90)return n-65;if(97<=n&&n<=122)return n-97+26;if(48<=n&&n<=57)return n-48+52;if(n==43)return 62;if(n==47)return 63;throw\"c:\"+n};return a},et=function(t,e){let r=t,o=e,i=new Array(t*e),a={};a.setPixel=function(p,f,l){i[f*r+p]=l},a.write=function(p){p.writeString(\"GIF87a\"),p.writeShort(r),p.writeShort(o),p.writeByte(128),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(0),p.writeByte(255),p.writeByte(255),p.writeByte(255),p.writeString(\",\"),p.writeShort(0),p.writeShort(0),p.writeShort(r),p.writeShort(o),p.writeByte(0);let f=2,l=n(f);p.writeByte(f);let d=0;for(;l.length-d>255;)p.writeByte(255),p.writeBytes(l,d,255),d+=255;p.writeByte(l.length-d),p.writeBytes(l,d,l.length-d),p.writeByte(0),p.writeString(\";\")};let s=function(p){let f=p,l=0,d=0,E={};return E.write=function(A,_){if(A>>>_)throw\"length over\";for(;l+_>=8;)f.writeByte(255&(A<<l|d)),_-=8-l,A>>>=8-l,d=0,l=0;d=A<<l|d,l=l+_},E.flush=function(){l>0&&f.writeByte(d)},E},n=function(p){let f=1<<p,l=(1<<p)+1,d=p+1,E=u();for(let D=0;D<f;D+=1)E.add(String.fromCharCode(D));E.add(String.fromCharCode(f)),E.add(String.fromCharCode(l));let A=Ie(),_=s(A);_.write(f,d);let x=0,v=String.fromCharCode(i[x]);for(x+=1;x<i.length;){let D=String.fromCharCode(i[x]);x+=1,E.contains(v+D)?v=v+D:(_.write(E.indexOf(v),d),E.size()<4095&&(E.size()==1<<d&&(d+=1),E.add(v+D)),v=D)}return _.write(E.indexOf(v),d),_.write(l,d),_.flush(),A.toByteArray()},u=function(){let p={},f=0,l={};return l.add=function(d){if(l.contains(d))throw\"dup key:\"+d;p[d]=f,f+=1},l.size=function(){return f},l.indexOf=function(d){return p[d]},l.contains=function(d){return typeof p[d]<\"u\"},l};return a},tt=function(t,e,r){let o=et(t,e);for(let n=0;n<e;n+=1)for(let u=0;u<t;u+=1)o.setPixel(u,n,r(u,n));let i=Ie();o.write(i);let a=Xe(),s=i.toByteArray();for(let n=0;n<s.length;n+=1)a.writeByte(s[n]);return a.flush(),\"data:image/gif;base64,\"+a},nt=J,vn=J.stringToBytes,ot=\"#e8e8e8\",rt=\"#ffffff\";function it(t){let e=t.getRootNode(),r=e instanceof ShadowRoot?e.host:document.documentElement;return(r instanceof Element?r.getAttribute(\"data-theme\"):null)===\"light\"?rt:ot}function Be(t,e,r=200){he(t),t.dataset.qrUrl=e;let o=document.createElement(\"canvas\"),i=o.getContext?.(\"2d\")??null;if(!i){let l=document.createElement(\"a\");l.href=e,l.textContent=\"Open in DID Wallet\",l.target=\"_blank\",l.rel=\"noopener\",t.appendChild(l);return}let a=nt(0,\"M\");a.addData(e),a.make();let s=a.getModuleCount(),n=Math.floor(r/s),u=n*s;o.width=u,o.height=u,o.style.display=\"block\",o.style.width=`${r}px`,o.style.height=`${r}px`,o.style.imageRendering=\"pixelated\";let p=it(t);i.fillStyle=p,i.fillRect(0,0,u,u),i.fillStyle=\"#000000\";for(let l=0;l<s;l++)for(let d=0;d<s;d++)a.isDark(l,d)&&i.fillRect(d*n,l*n,n,n);let f=document.createElement(\"div\");f.className=\"qr-plate\",f.style.display=\"inline-block\",f.style.padding=\"10px\",f.style.backgroundColor=p,f.style.borderRadius=\"8px\",f.style.lineHeight=\"0\",f.appendChild(o),t.appendChild(f)}function he(t){t.innerHTML=\"\",delete t.dataset.qrUrl}var st=`\n${Fe}\n${Te}\n${$e}\n\n/* Layout */\nbody {\n min-height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n background-image: radial-gradient(ellipse at 50% 0%, rgba(108,71,255,0.08) 0%, transparent 60%);\n}\n/* The body rule does not apply inside a shadow tree. The host page must\n give the LoginPage container a height for this centering to show. */\n:host {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100%;\n}\n\n/* Card \\u2014 fixed width prevents shrinking when views switch */\n.card {\n background: var(--bg-card);\n border: 1px solid var(--border);\n border-radius: var(--radius-lg);\n padding: 48px 40px;\n width: min(400px, calc(100vw - 32px));\n text-align: center;\n box-shadow: var(--shadow-lg), 0 0 80px -20px rgba(108,71,255,0.15);\n}\n\n/* Brand header */\n.brand-header { margin-bottom: 24px; }\n.app-logo {\n width: 48px;\n height: 48px;\n border-radius: var(--radius-sm);\n object-fit: contain;\n margin-bottom: 16px;\n}\nh1 {\n font-size: 24px;\n font-weight: 600;\n margin-bottom: 8px;\n color: var(--text-white);\n letter-spacing: -0.01em;\n line-height: 1.25;\n /* Never let a long \"Sign in to {appName}\" blow past two lines \\u2014 clamp with\n an ellipsis so the card height stays stable. */\n display: -webkit-box;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n}\n.subtitle {\n font-size: 14px;\n color: var(--text-secondary);\n margin-bottom: 0;\n line-height: 1.5;\n}\n.federated-hint {\n font-size: 12px;\n color: var(--text-secondary);\n margin-top: 6px;\n margin-bottom: 0;\n opacity: 0.7;\n}\n\n/* Input */\n.input {\n width: 100%;\n height: 36px;\n padding: 0 12px;\n font-size: 14px;\n color: var(--text);\n background: var(--bg-input);\n border: 1px solid var(--border-strong);\n border-radius: var(--radius-sm);\n outline: none;\n margin-bottom: 16px;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n}\n.input:focus { border-color: var(--blue); box-shadow: var(--shadow-focus); }\n.input::placeholder { color: var(--text-placeholder); }\n\n/* Button */\n.btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n width: 100%;\n height: 36px;\n padding: 0 16px;\n font-size: 14px;\n font-weight: 500;\n color: #fff;\n background: var(--blue);\n border: none;\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;\n line-height: 1;\n}\n.btn:hover { background: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(108,71,255,0.3); }\n.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; transform: none; box-shadow: none; }\n.btn:focus-visible { box-shadow: var(--shadow-focus); }\n.btn svg { width: 18px; height: 18px; flex-shrink: 0; }\n.btn-secondary {\n background: transparent;\n border: 1px solid var(--border-strong);\n color: var(--text);\n}\n.btn-secondary:hover { background: var(--bg-hover); border-color: rgba(255,255,255,0.20); }\n\n/* Status */\n.status {\n margin-top: 16px;\n font-size: 13px;\n min-height: 20px;\n color: var(--text-secondary);\n}\n.status.error { color: var(--red-text); }\n\n/* Name row (passkey registration) */\n.name-row { display: none; }\n.name-row.visible { display: block; }\n\n/* Passkey section + secondary text action (\"First time? Create a passkey\") */\n.passkey-section > .btn + .passkey-alt,\n.passkey-section > .name-row + .btn { margin-top: 10px; }\n.passkey-alt {\n display: block;\n width: 100%;\n margin-top: 10px;\n padding: 4px;\n background: none;\n border: none;\n font-size: 13px;\n color: var(--text-secondary);\n cursor: pointer;\n text-align: center;\n transition: color 0.15s ease;\n}\n.passkey-alt:hover { color: var(--text); text-decoration: underline; }\n.passkey-alt:focus-visible { box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); outline: none; }\n\n/* Divider */\n.divider {\n display: flex;\n align-items: center;\n margin: 20px 0;\n color: var(--text-secondary);\n font-size: 13px;\n}\n.divider::before, .divider::after {\n content: '';\n flex: 1;\n border-bottom: 1px solid var(--border);\n}\n.divider::before { margin-right: 12px; }\n.divider::after { margin-left: 12px; }\n\n/* DID Wallet section (methods view) */\n.did-wallet-section { margin-top: 8px; }\n\n/* QR view */\n.qr-view {\n position: relative;\n margin: 20px auto;\n display: flex;\n justify-content: center;\n min-height: 220px;\n align-items: center;\n}\n.qr-placeholder {\n width: 220px;\n height: 220px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius);\n background: var(--bg-elevated);\n}\n.qr-spinner {\n display: inline-block;\n width: 32px; height: 32px;\n border: 3px solid var(--border-strong);\n border-top-color: var(--blue-muted);\n border-radius: 50%;\n animation: spin 0.6s linear infinite;\n}\n#did-connect-status {\n font-size: 13px;\n color: var(--text-secondary);\n}\n\n/* Connect result state */\n.connect-result {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 120px;\n margin: 32px 0;\n animation: fadeIn 200ms ease-out;\n}\n.result-icon {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 28px;\n font-weight: bold;\n}\n.result-error {\n background: rgba(239, 68, 68, 0.15);\n color: var(--red-text);\n border: 2px solid rgba(239, 68, 68, 0.3);\n}\n.result-loading {\n background: transparent;\n}\n.result-loading .qr-spinner {\n width: 36px;\n height: 36px;\n}\n.result-back-btn {\n margin-top: 16px;\n}\n@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }\n\n/* QR timeout overlay */\n.qr-timeout-overlay {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n background: rgba(0, 0, 0, 0.65);\n border-radius: var(--radius);\n backdrop-filter: blur(2px);\n}\n.qr-timeout-overlay .timeout-text {\n font-size: 13px;\n color: #fff;\n}\n.qr-timeout-overlay .refresh-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 6px 20px;\n font-size: 14px;\n font-weight: 500;\n color: #fff;\n background: var(--blue);\n border: none;\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease;\n}\n.qr-timeout-overlay .refresh-btn:hover {\n background: var(--blue-hover);\n}\n/* Connect status views (scanned / success) */\n.connect-status-icon {\n position: relative;\n width: 72px;\n height: 72px;\n margin: 16px auto;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n@keyframes connectSpin { to { transform: rotate(360deg); } }\n.connect-spinner-ring {\n position: absolute;\n inset: 0;\n width: 72px;\n height: 72px;\n border-radius: 50%;\n border: 3px solid rgba(255,255,255,0.1);\n border-top-color: var(--blue, #6c47ff);\n animation: connectSpin 0.8s linear infinite;\n}\n.connect-status-badge {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n}\n.connect-status-badge svg { width: 36px; height: 36px; }\n.connect-status-icon.connect-success svg { animation: fadeIn 0.3s ease; }\n.connect-subtitle {\n font-size: 13px;\n color: var(--text-secondary, #9394a1);\n text-align: center;\n margin: 4px 0 0;\n}\n.status.success { color: #49dc6e; font-weight: 500; }\n.deep-link-btn {\n margin-top: 12px;\n text-decoration: none;\n}\n\n/* Email section (methods view) */\n.email-section { margin-top: 8px; }\n\n/* Back button \\u2014 same top row as Cancel and the locale/theme tools.\n A float sat inside the 48px content padding, so Back landed below the\n absolute locale pill. */\n.back-btn {\n position: absolute;\n top: 16px;\n left: 40px;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n background: none;\n border: none;\n color: var(--text-secondary);\n font-size: 14px;\n line-height: 1;\n cursor: pointer;\n padding: 0;\n margin: 0;\n}\n.back-btn:hover { color: var(--text); }\n.back-btn svg { width: 18px; height: 18px; }\n/* Escape hatch \\u2014 a quiet \"Cancel\" link, top-left of the card, mirroring the\n locale switcher (top-right). Conventional spot for a standalone auth card.\n Low in the hierarchy (tertiary color, small) so it never competes with the\n auth methods; it's an exit, not an action. */\n.home-link {\n position: absolute;\n top: 16px;\n /* Align the arrow's left edge to the content column (card's 40px padding), so\n Cancel sits on the same left line as the title and buttons \\u2014 no left padding\n of its own, which would push it off that line. */\n left: 40px;\n display: inline-flex;\n align-items: center;\n gap: 3px;\n background: none;\n border: none;\n color: var(--text-tertiary);\n font-size: 13px;\n line-height: 1;\n text-decoration: none;\n cursor: pointer;\n height: 28px;\n padding: 2px 4px 2px 0;\n transition: color 0.15s ease;\n}\n.home-link:hover { color: var(--text-secondary); }\n.home-link svg { width: 16px; height: 16px; }\n\n/* View title */\n.view-title {\n font-size: 20px;\n font-weight: 600;\n color: var(--text-white);\n margin-bottom: 8px;\n padding-top: 8px;\n}\n\n/* OAuth section \\u2014 single provider (legacy) */\n.oauth-section { margin-top: 0; }\n\n/* OAuth grid \\u2014 2+ providers in 2-column layout (legacy) */\n.oauth-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n margin-bottom: 8px;\n}\n.oauth-grid .oauth-btn:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n\n/* Unified secondary methods grid \\u2014 2-column layout */\n.methods-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n}\n/* Odd last child (e.g. DID Wallet when total is odd) spans full width */\n.methods-grid .method-btn:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n\n.method-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n min-height: 36px;\n padding: 6px 16px;\n font-size: 14px;\n font-weight: 500;\n color: var(--text);\n background: var(--bg-elevated);\n border: 1px solid var(--border-strong);\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.2s ease;\n white-space: normal;\n}\n.method-btn:hover { background: var(--bg-hover); border-color: var(--blue-muted); }\n.method-btn:disabled { cursor: default; pointer-events: none; }\n.method-btn svg { width: 18px; height: 18px; flex-shrink: 0; }\n\n.oauth-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n height: 36px;\n padding: 0 16px;\n font-size: 14px;\n font-weight: 500;\n color: var(--text);\n background: var(--bg-card);\n border: 1px solid var(--border);\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease, opacity 0.2s ease, border-color 0.2s ease;\n margin-bottom: 0;\n}\n.oauth-section .oauth-btn { margin-bottom: 8px; }\n.oauth-btn:hover { background: var(--bg-hover); }\n.oauth-btn:disabled { cursor: default; pointer-events: none; }\n.oauth-btn svg { width: 18px; height: 18px; flex-shrink: 0; }\n.oauth-btn-loading {\n opacity: 0.8;\n border-color: var(--blue);\n color: var(--text-secondary);\n}\n@keyframes oauth-spin { to { transform: rotate(360deg); } }\n.oauth-spinner {\n display: inline-block;\n width: 14px; height: 14px;\n border: 2px solid var(--border-strong);\n border-top-color: var(--blue-muted);\n border-radius: 50%;\n animation: oauth-spin 0.6s linear infinite;\n}\n.oauth-check { color: var(--green-text); font-size: 16px; }\n\n/* Browser compatibility warning */\n.compat-warning {\n font-size: 13px;\n color: var(--text-tertiary);\n padding: 12px;\n background: var(--bg-elevated);\n border-radius: var(--radius-sm);\n margin-bottom: 16px;\n}\n\n/* Trust footer */\n.login-footer {\n margin-top: 24px;\n padding-top: 20px;\n border-top: 1px solid var(--border);\n}\n.secured-badge {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n font-size: 12px;\n color: var(--text-tertiary);\n}\n.secured-badge svg { width: 14px; height: 14px; flex-shrink: 0; }\n.footer-links {\n margin-top: 8px;\n font-size: 12px;\n color: var(--text-tertiary);\n}\n.footer-links a {\n color: var(--text-secondary);\n text-decoration: none;\n}\n.footer-links a:hover { text-decoration: underline; }\n\n/* \\u2500\\u2500\\u2500 Animations \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n@keyframes fadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n.card[data-view] { animation: fadeIn 200ms ease-out; }\n\n/* QR code scale-in */\n.qr-view { animation: qrScaleIn 300ms ease-out; }\n@keyframes qrScaleIn {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n}\n\n/* Button loading spinner */\n@keyframes spin { to { transform: rotate(360deg); } }\n.btn-spinner {\n display: inline-block;\n width: 16px; height: 16px;\n border: 2px solid rgba(255,255,255,0.3);\n border-top-color: #fff;\n border-radius: 50%;\n animation: spin 0.6s linear infinite;\n}\n\n/* Success checkmark */\n@keyframes checkDraw {\n from { stroke-dashoffset: 24; }\n to { stroke-dashoffset: 0; }\n}\n.success-check {\n display: inline-block;\n width: 20px; height: 20px;\n vertical-align: middle;\n}\n.success-check path {\n stroke-dasharray: 24;\n stroke-dashoffset: 24;\n animation: checkDraw 400ms ease-out forwards;\n}\n\n/* Light theme background gradient adjustment */\n[data-theme=\"light\"] body {\n background-image: radial-gradient(ellipse at 50% 0%, rgba(108,71,255,0.05) 0%, transparent 60%);\n}\n[data-theme=\"light\"] .card,\n:host([data-theme=\"light\"]) .card {\n box-shadow: var(--shadow-lg), 0 0 80px -20px rgba(108,71,255,0.08);\n}\n[data-theme=\"light\"] .btn:hover,\n:host([data-theme=\"light\"]) .btn:hover {\n box-shadow: 0 2px 8px rgba(108,71,255,0.15);\n}\n\n/* Language sits on the same top row as Back / Cancel. */\n.card-tools {\n position: absolute;\n top: 16px;\n right: 16px;\n z-index: 2;\n display: flex;\n align-items: flex-start;\n}\n.locale-switcher {\n position: relative;\n}\n.locale-btn {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n padding: 4px 10px;\n font-size: 12px;\n color: var(--text-secondary);\n background: var(--bg-elevated);\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-full);\n cursor: pointer;\n transition: color 0.15s, border-color 0.15s;\n}\n.locale-btn:hover {\n color: var(--text);\n border-color: var(--border-strong);\n}\n.locale-btn svg { width: 14px; height: 14px; flex-shrink: 0; }\n.locale-trigger {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n padding: 4px 10px;\n font-size: 12px;\n color: var(--text-secondary);\n background: var(--bg-elevated);\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-full);\n cursor: pointer;\n}\n.locale-trigger:hover {\n color: var(--text);\n border-color: var(--border-strong);\n}\n.locale-trigger svg { width: 14px; height: 14px; flex-shrink: 0; }\n.locale-menu {\n display: none;\n flex-direction: column;\n align-items: stretch;\n gap: 4px;\n margin-top: 4px;\n}\n.locale-switcher.open .locale-menu {\n display: flex;\n}\n.locale-btn[aria-checked=\"true\"] {\n color: var(--text);\n border-color: var(--border-strong);\n}\n.locale-check { font-size: 11px; line-height: 1; }\n.card { position: relative; }\n\n/* Long localized method labels remain readable on narrow screens. */\n.methods-grid { grid-template-columns: 1fr; }\n.method-btn { min-height: 48px; white-space: normal; }\n.passkey-alt { min-height: 44px; font-weight: 600; }\n.oauth-recovery { font-size: 14px; line-height: 1.5; margin: 12px 0; }\n@media (max-width: 480px) { .card { padding: 24px 20px; width: 100%; box-sizing: border-box; } h1 { font-size: 24px; } }\n\n.passkey-create-entry { display: flex; justify-content: center; align-items: center; width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); color: var(--text); padding: 10px 14px; }\n.passkey-create-entry:hover { background: var(--bg-hover); text-decoration: none; }\n.status:empty { min-height: 0; padding: 0; margin: 0; }\n.passkey-section .subtitle { margin: 8px 0 16px; font-size: 14px; line-height: 1.5; }\n@media (max-width: 480px) { .card { padding: 20px 18px; } .brand-header { margin-bottom: 20px; } }\n\n.card-modal .card-tools { left: 20px; right: 80px; top: 12px; }\n.card-modal .locale-switcher { min-width: 0; max-width: 100%; }\n.card-modal .locale-trigger { max-width: 100%; height: 36px; }\n.locale-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.card-modal .locale-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 4; margin-top: 0;\n width: max-content; max-width: min(260px,calc(100vw - 80px)); padding: 6px;\n background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-lg); }\n.card-modal .locale-menu .locale-btn { min-height: 40px; height: auto; text-align: left; border-radius: 6px; }\n.card-modal .locale-menu .locale-btn span { overflow-wrap: anywhere; }\n\n.card { padding: 52px 24px 24px; box-sizing: border-box; }\n.card-modal { width: 100%; }\n.card-modal { padding-top: 68px; border: 0; border-radius: 0; }\n/* The dialog frame owns the shadow in both palettes. */\n.card.card-modal, :host([data-theme=\"light\"]) .card.card-modal { box-shadow: none; }\n/* A translateY entrance expands an auto scroller by 4px until it finishes. */\n.card-modal[data-view] { animation: none; }\n.card-modal .back-btn { position: static; display: flex; width: max-content; max-width: 100%; margin: 0 0 16px; }\n.card-modal h1 { display: block; overflow: visible; -webkit-line-clamp: unset; line-clamp: unset; line-height: 1.4; padding-block: 2px; }\n.card-modal h1[tabindex=\"-1\"]:focus { outline: none; }\n.card-modal h1, .card-modal h2, .card-modal .subtitle, .card-modal .status { overflow-wrap: anywhere; }\n.card-modal .btn { height: auto; min-height: 44px; line-height: 1.4; padding-block: 10px; white-space: normal; }\n.card-modal button, .card-modal a { overflow-wrap: anywhere; }\n.social-first .divider { margin: 14px 0; }\n.social-first .app-logo { width: 32px; height: 32px; margin-bottom: 12px; }\n.social-first .login-footer { margin-top: 16px; padding-top: 12px; }\n.other-methods { margin-top: 8px; color: var(--text-secondary); font-size: 14px; }\n.other-methods summary { min-height: 44px; padding: 12px 0; cursor: pointer; }\n.other-methods summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }\n@media (max-width:480px) { .card { padding: 52px 18px 24px; } }\n@media (max-width:480px) { .card-modal { padding-top: 68px; } .card-modal .card-tools { left: 18px; } }\n@media (prefers-reduced-motion: reduce) { .card[data-view], .qr-view { animation: none; } }\n\n.passkey-creating > .methods-grid, .passkey-creating > .divider, .passkey-creating > .other-methods { display: none; }\n\n.input-label { display: block; text-align: left; margin: 8px 0; color: var(--text); font-size: 14px; font-weight: 500; }\n.input-label[hidden], .email-help[hidden] { display: none; }\n.email-help { text-align: left; font-size: 13px; line-height: 1.5; color: var(--text-secondary); margin: 0 0 12px; }\n`;function Q(t){let e=new Uint8Array(t),r=\"\";for(let o=0;o<e.length;o++)r+=String.fromCharCode(e[o]);return btoa(r).replace(/\\+/g,\"-\").replace(/\\//g,\"_\").replace(/=+$/,\"\")}function te(t){let e=t.replace(/-/g,\"+\").replace(/_/g,\"/\"),r=atob(e),o=new Uint8Array(r.length);for(let i=0;i<r.length;i++)o[i]=r.charCodeAt(i);return o.buffer}function at(t){let e=t.response;return{id:t.id,rawId:Q(t.rawId),type:t.type,response:{attestationObject:Q(e.attestationObject),clientDataJSON:Q(e.clientDataJSON)},clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment}}function ut(t){let e=t.response;return{id:t.id,rawId:Q(t.rawId),type:t.type,response:{authenticatorData:Q(e.authenticatorData),clientDataJSON:Q(e.clientDataJSON),signature:Q(e.signature),userHandle:e.userHandle?Q(e.userHandle):void 0},clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment}}async function ie(t){let e=t.prefix||\"/.well-known/service/api/passkey\",r=t.onStatus||(()=>{}),o=t.authOnly||!1,i=t.registerOnly||!1,a=t.invitationId||void 0,s=t.locale,n=t.texts||{},u=n.waiting||b(\"passkeyWaiting\",s),p=n.creating||b(\"passkeyCreating\",s),f=n.verifying||b(\"verifying\",s);async function l(){let x=await fetch(`${e}/auth`,{method:\"GET\",signal:t.signal});if(!x.ok)throw new Error(b(\"authFailed\",s));return x.json()}async function d(x){let v=[];x&&v.push(`name=${encodeURIComponent(x)}`),a&&v.push(`invitationId=${encodeURIComponent(a)}`);let D=v.length?`?${v.join(\"&\")}`:\"\",T=await fetch(`${e}/register${D}`,{method:\"GET\",signal:t.signal});if(!T.ok)throw new Error(b(\"registrationFailed\",s));return T.json()}function E(x,v){let D=new Error(x);throw v&&(D.code=v),D}async function A(x,v){let D=await fetch(`${e}/auth`,{method:\"POST\",signal:t.signal,headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({challengeId:x,credential:v})});if(!D.ok){let T=await D.json().catch(()=>({}));E(T.error||b(\"authFailed\",s),T.code)}return D.json()}async function _(x,v,D){let T=await fetch(`${e}/register`,{method:\"POST\",signal:t.signal,headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({challengeId:x,credential:v,name:D||void 0})});if(!T.ok){let N=await T.json().catch(()=>({}));E(N.error||b(\"registrationFailed\",s),N.code)}return T.json()}if(!i){r(u,!1);try{let x=await l(),{challengeId:v}=x,D=x.authentication||x,T={signal:t.signal,publicKey:{...D,challenge:te(D.challenge),allowCredentials:(D.allowCredentials||[]).map(I=>({...I,id:te(I.id)}))}},N;try{N=await navigator.credentials.get(T)}catch{if(o)return{success:!1,error:\"no_passkey\"}}if(!N&&o)return{success:!1,error:\"no_passkey\"};if(t.signal?.aborted)return{success:!1,error:\"cancelled\"};if(N){let I=ut(N);return r(f,!1),await A(v,I),{success:!0}}}catch(x){let v=x instanceof Error?x.message:b(\"authFailed\",s),D=x instanceof Error?x.code:void 0;return r(v,!0),{success:!1,error:v,code:D}}}try{let x=await d(t.name||\"\");if(x.registrationAllowed===!1)return r(b(\"regClosed\",s),!0),{success:!1,error:\"registration_closed\"};r(p,!1);let v=x.registration||x,D={signal:t.signal,publicKey:{...v,challenge:te(v.challenge),user:{...v.user,id:te(v.user.id)},excludeCredentials:(v.excludeCredentials||[]).map(I=>({...I,id:te(I.id)}))}},T=await navigator.credentials.create(D);if(!T||t.signal?.aborted)return{success:!1,error:b(\"passkeyNoLocal\",s)};let N=at(T);return r(f,!1),await _(x.challengeId,N,t.name||\"\"),{success:!0}}catch(x){let v=x instanceof Error&&(x.name===\"NotAllowedError\"||x.name===\"AbortError\")?b(\"passkeyNoLocal\",s):x instanceof Error?x.message:b(\"passkeySetupFailed\",s),D=x instanceof Error?x.code:void 0;return r(v,!0),{success:!1,error:v,code:D}}}function G(t,e){let r=t instanceof Error?t.message:\"\",o=t instanceof Error&&\"code\"in t?t.code:\"\";return o===\"FORBIDDEN\"?b(\"accessDenied\",e):r===\"registration_closed\"||o===\"registration_closed\"?b(\"regClosed\",e):r||b(\"authFailed\",e)}var lt=\"https://web.abtwallet.io/\";function De(){return typeof navigator>\"u\"?!1:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function ct(){return typeof window>\"u\"?null:window.ABT_DEV??window.ABT??null}function K(t){return t.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#x27;\")}var pe=class{container;config;http;options;tokenSession=null;styleEl=null;mounted=!1;completed=!1;generation=0;activeMethod;activeProvider;oauthCleanup;emailTimer;emailDraft=\"\";abort;emit(t){try{this.options.onEvent?.({name:t,method:this.activeMethod,mode:this.options.mode??\"page\"})}catch{}}select(t){this.generation++,this.oauthCleanup?.(),this.abort?.abort(),this.abort=new AbortController,this.activeMethod=t,this.activeProvider=void 0,this.emit(\"method_selected\")}currentView=\"methods\";cardEl=null;mediaQuery=null;mediaListener=null;localeOutsideClick=null;shadow=null;isolate;constructor(t,e,r,o){if(this.container=t,this.config=e,this.http=r,this.isolate=o?.isolate===!0,this.options={methods:[\"passkey\",\"did-connect\"],locale:\"en\",...o},!this.options.invitationId&&typeof document<\"u\"){let i=document.cookie.match(/(?:^|;\\s*)pending_invitation=([^;]*)/);if(i)try{this.options.invitationId=decodeURIComponent(i[1])}catch{}}}mount(){if(this.mounted)return;this.mounted=!0,this.completed=!1,this.emit(\"view\"),this.styleEl=document.createElement(\"style\"),this.styleEl.textContent=st,this.mountRoot().appendChild(this.styleEl),this.adoptStoredTheme(),this.applyTheme();let t=this.filterMethods(this.options.methods);this.renderCard(t)}destroy(){if(this.generation++,this.oauthCleanup?.(),this.abort?.abort(),clearInterval(this.emailTimer),this.detachLocaleMenu(),this.tokenSession&&(this.tokenSession.destroy(),this.tokenSession=null),this.detachMedia(),this.isolate){let t=this.shadow??this.container.shadowRoot;t&&(t.innerHTML=\"\"),this.container.removeAttribute(\"data-theme\")}else document.documentElement.removeAttribute(\"data-theme\"),this.container.innerHTML=\"\";this.styleEl=null,this.cardEl=null,this.currentView=\"methods\",this.mounted=!1}setTheme(t){this.options.theme=t,this.applyTheme()}update(t){Object.assign(this.options,t),this.mounted&&(this.destroy(),this.mount())}themeTarget(){return this.isolate?this.container:document.documentElement}mountRoot(){return this.isolate?this.shadow?this.shadow:(this.shadow=this.container.shadowRoot??this.container.attachShadow({mode:\"open\"}),this.shadow):this.container}detachMedia(){this.mediaQuery&&this.mediaListener&&this.mediaQuery.removeEventListener(\"change\",this.mediaListener),this.mediaQuery=null,this.mediaListener=null}adoptStoredTheme(){if(this.options.mode===\"dialog\"||typeof window>\"u\")return;let t=new URLSearchParams(window.location.search).get(\"theme\");if(t===\"light\"||t===\"dark\"||t===\"auto\"){this.options.theme=t;return}try{let e=localStorage.getItem(\"web-mode\");(e===\"light\"||e===\"dark\"||e===\"auto\")&&(this.options.theme=e)}catch{}}applyTheme(){this.detachMedia();let t=this.options.theme??\"dark\",e=this.themeTarget();if(t===\"light\")e.dataset.theme=\"light\";else if(t===\"auto\"&&typeof window.matchMedia==\"function\"){let r=window.matchMedia(\"(prefers-color-scheme: light)\");this.mediaQuery=r;let o=i=>{i?e.dataset.theme=\"light\":e.removeAttribute(\"data-theme\"),this.repaintQRPlate()};o(r.matches),this.mediaListener=i=>o(i.matches),r.addEventListener(\"change\",this.mediaListener);return}else e.removeAttribute(\"data-theme\");this.repaintQRPlate()}repaintQRPlate(){let t=this.mountRoot().querySelector(\"#did-connect-qr\");if(!(t instanceof HTMLElement))return;let e=t.dataset.qrUrl;!e||!t.querySelector(\"canvas\")||t.querySelector(\".qr-timeout-overlay\")||Be(t,e)}filterMethods(t){return t.filter(e=>e===\"passkey\"?typeof window<\"u\"&&window.PublicKeyCredential!==void 0&&typeof window.PublicKeyCredential==\"function\":!0)}renderCard(t){let e=document.createElement(\"div\");e.className=this.options.mode===\"dialog\"?\"card card-modal\":\"card\",this.cardEl=e,this.mountRoot().appendChild(e),this.switchView(\"methods\",t)}renderCardTools(t){let e=document.createElement(\"div\");e.className=\"card-tools\",this.renderLocaleSwitcher(e),t.appendChild(e)}renderLocaleSwitcher(t){let e=this.options.locales;if(e){this.renderLocaleMenu(t,e);return}if(ce.length<2)return;let r=document.createElement(\"div\");r.className=\"locale-switcher\";let o=this.options.locale,i=ce.find(s=>s.code!==o)??ce[0],a=document.createElement(\"button\");a.type=\"button\",a.className=\"locale-btn\",a.innerHTML=`${ke} ${K(i.label)}`,a.title=i.label,a.addEventListener(\"click\",()=>{this.options.onLocaleChange?.(i.code),this.update({locale:i.code})}),r.appendChild(a),t.appendChild(r)}renderLocaleMenu(t,e){if(e.length<2)return;this.detachLocaleMenu();let r=this.options.locale,o=e.find(p=>p.code===r)??e[0],i=document.createElement(\"div\");i.className=\"locale-switcher\";let a=document.createElement(\"button\");a.type=\"button\",a.className=\"locale-trigger\",a.setAttribute(\"aria-haspopup\",\"menu\"),a.setAttribute(\"aria-expanded\",\"false\"),a.innerHTML=`${ke} <span class=\"locale-label\">${K(o.label)}</span>`,a.title=o.label;let s=document.createElement(\"div\");s.className=\"locale-menu\",s.setAttribute(\"role\",\"menu\"),s.hidden=!0;let n=p=>{i.classList.toggle(\"open\",p),s.hidden=!p,a.setAttribute(\"aria-expanded\",p?\"true\":\"false\")};a.addEventListener(\"click\",p=>{p.stopPropagation(),n(s.hidden)});for(let p of e){let f=p.code===o.code,l=document.createElement(\"button\");if(l.type=\"button\",l.className=\"locale-btn\",l.setAttribute(\"role\",\"menuitemradio\"),l.setAttribute(\"aria-checked\",f?\"true\":\"false\"),l.dataset.locale=p.code,l.title=p.label,f){let E=document.createElement(\"span\");E.className=\"locale-check\",E.setAttribute(\"aria-hidden\",\"true\"),E.textContent=\"\\u2713\",l.appendChild(E)}let d=document.createElement(\"span\");d.textContent=p.label,l.appendChild(d),l.addEventListener(\"click\",()=>{this.options.onLocaleChange?.(p.code),this.update({locale:p.code})}),s.appendChild(l)}let u=p=>{let f=p.composedPath();f.includes(i)||this.isolate&&f.includes(this.container)||n(!1)};document.addEventListener(\"click\",u),this.localeOutsideClick=u,i.append(a,s),t.appendChild(i)}detachLocaleMenu(){this.localeOutsideClick&&(document.removeEventListener(\"click\",this.localeOutsideClick),this.localeOutsideClick=null)}switchView(t,e){if(!this.cardEl)return;let r=this.options.locale;switch(this.currentView===\"qr\"&&t!==\"qr\"&&this.tokenSession&&(this.tokenSession.destroy(),this.tokenSession=null),this.generation++,this.oauthCleanup?.(),this.abort?.abort(),clearInterval(this.emailTimer),this.currentView=t,this.cardEl.innerHTML=\"\",this.cardEl.dataset.view=t,this.renderCardTools(this.cardEl),t){case\"methods\":this.renderMethodsView(this.cardEl,r,e??this.filterMethods(this.options.methods));break;case\"qr\":this.renderQRView(this.cardEl,r);break;case\"email\":this.renderEmailView(this.cardEl,r);break}}renderMethodsView(t,e,r){if(this.options.mode!==\"dialog\"&&this.renderHomeLink(t,e),this.renderBrandHeader(t,e),this.options.preferenceKey)try{let n=localStorage.getItem(`did-login-method:${this.options.preferenceKey}`),u={passkey:\"Passkey\",oauth:\"OAuth\",email:b(\"emailButton\",e),\"did-connect\":\"DID Wallet\"},p=n?.startsWith(\"oauth:\")?this.options.oauthProviders?.find(l=>l.enabled&&`oauth:${l.id}`===n):void 0,f=p?.name??(n?u[n]:void 0);if(n&&f&&(r.includes(n)||p&&r.includes(\"oauth\"))){let l=document.createElement(\"p\");l.className=\"subtitle\",l.textContent=b(\"lastUsed\",e,{method:f}),t.appendChild(l)}}catch{}let o=this.options.methods.includes(\"passkey\");if(o&&!r.includes(\"passkey\")){let n=document.createElement(\"div\");n.className=\"compat-warning\",n.textContent=b(\"passkeyUnsupported\",e),t.appendChild(n)}let i=this.options.preferredLayout!==\"passkey-first\"&&r.includes(\"oauth\")&&this.options.oauthProviders?.some(n=>n.enabled&&[\"google\",\"apple\"].includes(n.id));t.classList.toggle(\"social-first\",!!i),i&&(this.renderSecondaryGrid(t,e,[\"oauth\"],\"primary\"),this.renderDivider(t,e));let a=r.includes(\"passkey\");a&&this.renderPasskeySection(t,e);let s=r.filter(n=>n!==\"passkey\");if(a&&s.length>0&&this.renderDivider(t,e),s.length>0)if(i){r.includes(\"email\")&&this.renderSecondaryGrid(t,e,[\"email\"]);let n=document.createElement(\"details\");n.className=\"other-methods\";let u=document.createElement(\"summary\");u.textContent=b(\"otherMethods\",e),n.appendChild(u),this.renderSecondaryGrid(n,e,r.filter(p=>p!==\"email\"),\"secondary\"),n.querySelector(\"button\")&&t.appendChild(n)}else this.renderSecondaryGrid(t,e,r);if(r.length===0&&!o){let n=document.createElement(\"p\");n.className=\"subtitle\",n.textContent=\"No authentication methods available.\",t.appendChild(n)}this.renderTrustFooter(t,e)}renderQRView(t,e){this.renderBackButton(t,e);let r=document.createElement(\"h2\");r.className=\"view-title\",r.textContent=b(\"scanTitle\",e),t.appendChild(r);let o=document.createElement(\"div\");o.id=\"did-connect-qr\",o.className=\"qr-view\",o.innerHTML='<div class=\"qr-placeholder\"><span class=\"qr-spinner\"></span></div>',t.appendChild(o);let i=document.createElement(\"button\");i.className=\"btn btn-secondary deep-link-btn\",i.id=\"did-wallet-open-btn\",i.textContent=b(\"openInWallet\",e),i.disabled=!0,De()?t.insertBefore(i,o):t.appendChild(i);let a=document.createElement(\"div\");a.id=\"did-connect-status\",a.className=\"status\",a.setAttribute(\"role\",\"status\"),t.appendChild(a),this.renderTrustFooter(t,e),this.startDIDConnectInView(a,o,i,e)}renderEmailView(t,e){this.renderBackButton(t,e);let r=document.createElement(\"h2\");r.className=\"view-title\",r.textContent=b(\"emailTitle\",e),t.appendChild(r);let o=document.createElement(\"label\");o.className=\"input-label\",o.htmlFor=\"login-email-address\",o.textContent=b(\"emailPlaceholder\",e),t.appendChild(o);let i=document.createElement(\"p\");i.className=\"email-help\",i.textContent=b(\"emailExplanation\",e),t.appendChild(i);let a=document.createElement(\"input\");a.className=\"input\",a.id=\"login-email-address\",a.type=\"email\",a.required=!0,a.autocomplete=\"email\",a.value=this.emailDraft,a.setAttribute(\"aria-label\",b(\"emailPlaceholder\",e)),a.addEventListener(\"input\",()=>{this.emailDraft=a.value}),a.placeholder=b(\"emailPlaceholder\",e),t.appendChild(a);let s=document.createElement(\"button\");s.className=\"btn\",s.textContent=b(\"emailSubmit\",e),t.appendChild(s);let n=document.createElement(\"div\");n.className=\"status\",n.setAttribute(\"role\",\"status\"),t.appendChild(n);let u=document.createElement(\"div\");u.className=\"email-code-section\",u.style.display=\"none\";let p=document.createElement(\"label\");p.className=\"input-label\",p.htmlFor=\"login-email-code\",p.textContent=b(\"emailCodePlaceholder\",e),u.appendChild(p);let f=document.createElement(\"input\");f.id=\"login-email-code\",f.className=\"input\",f.type=\"text\",f.inputMode=\"numeric\",f.maxLength=8,f.setAttribute(\"aria-label\",b(\"emailCodePlaceholder\",e)),f.autocomplete=\"one-time-code\",f.placeholder=b(\"emailCodePlaceholder\",e),u.appendChild(f);let l=document.createElement(\"button\");l.className=\"btn\",l.textContent=b(\"emailVerify\",e),u.appendChild(l);let d=document.createElement(\"button\");d.className=\"btn btn-secondary\",d.textContent=b(\"emailResend\",e),d.style.marginTop=\"8px\",u.appendChild(d),t.insertBefore(u,n),this.renderTrustFooter(t,e);let E=this.generation,A=()=>this.mounted&&E===this.generation,_=document.createElement(\"button\");_.className=\"passkey-alt\",_.textContent=b(\"emailEdit\",e),u.appendChild(_),_.addEventListener(\"click\",()=>this.switchView(\"email\"));let x=()=>{let S=60;clearInterval(this.emailTimer),d.disabled=!0,d.textContent=b(\"emailCooldown\",e,{seconds:String(S)}),this.emailTimer=setInterval(()=>{S--,d.textContent=S>0?b(\"emailCooldown\",e,{seconds:String(S)}):b(\"emailResend\",e),S<=0&&(clearInterval(this.emailTimer),d.disabled=!1)},1e3)},v=\"\",D,T=this.config.servicePrefix??\"/.well-known/service\",N=async()=>{if(s.disabled)return;let S=a.value.trim();if(!a.checkValidity()){n.textContent=b(\"emailInvalid\",e),n.className=\"status error\";return}s.disabled=!0,n.textContent=b(\"emailSending\",e),n.className=\"status\",n.setAttribute(\"role\",\"status\");try{let c=await this.http.post(`${T}/api/email/sendCode`,{email:S,locale:e});if(!A())return;x(),v=S,D=c?.id,a.style.display=\"none\",o.hidden=!0,i.hidden=!0,s.style.display=\"none\",u.style.display=\"\",r.textContent=b(\"emailVerify\",e),n.textContent=b(\"emailSent\",e,{email:S}),n.className=\"status\",f.focus()}catch(c){if(!A())return;let m=c instanceof Error?c.message:\"Failed to send email\";n.textContent=m,n.className=\"status error\",s.disabled=!1}},I=async()=>{if(l.disabled)return;let S=f.value.trim();if(!/^\\d{8}$/.test(S)){n.textContent=b(\"emailCodeInvalid\",e),n.className=\"status error\";return}l.disabled=!0,n.textContent=b(\"verifying\",e),n.className=\"status\";try{if(await this.http.post(`${T}/api/email/login`,{code:S,id:D}),!A())return;n.textContent=b(\"success\",e),n.className=\"status\",this.handleSuccess()}catch(c){if(!A())return;c instanceof Error&&\"code\"in c&&c.code===\"FORBIDDEN\"?this.showFullError(G(c,e)):(n.textContent=G(c,e),n.className=\"status error\",l.disabled=!1,f.value=\"\",f.focus())}};s.addEventListener(\"click\",N),a.addEventListener(\"keydown\",S=>{S.key===\"Enter\"&&N()}),l.addEventListener(\"click\",I),f.addEventListener(\"keydown\",S=>{S.key===\"Enter\"&&I()}),d.addEventListener(\"click\",async()=>{if(!d.disabled){d.disabled=!0,n.textContent=b(\"emailSending\",e),n.className=\"status\";try{let S=await this.http.post(`${T}/api/email/sendCode`,{email:v,locale:e});if(!A())return;x(),D=S?.id,n.textContent=b(\"emailSent\",e,{email:v}),n.className=\"status\"}catch(S){if(!A())return;d.disabled=!1;let c=S instanceof Error?S.message:\"Failed to resend\";n.textContent=c,n.className=\"status error\"}}})}renderBackButton(t,e){let r=document.createElement(\"button\");r.className=\"back-btn\",r.innerHTML=`${ve} ${K(b(\"back\",e))}`,r.addEventListener(\"click\",()=>this.switchView(\"methods\")),t.appendChild(r)}renderHomeLink(t,e){if(this.options.dismissible===!1)return;let{homeUrl:r,onCancel:o}=this.options;if(!o&&!r)return;let i=`${ve} ${K(b(\"cancel\",e))}`;if(o){let a=document.createElement(\"button\");a.type=\"button\",a.className=\"home-link\",a.innerHTML=i,a.addEventListener(\"click\",()=>{this.emit(\"cancel\"),this.options.onCancel?.()}),t.appendChild(a)}else{let a=document.createElement(\"a\");a.className=\"home-link\",a.href=r,a.innerHTML=i,t.appendChild(a)}}renderBrandHeader(t,e){let r=document.createElement(\"div\");if(r.className=\"brand-header\",this.options.appLogo){let i=document.createElement(\"img\");i.className=\"app-logo\",i.src=K(this.options.appLogo),i.alt=this.options.appName?K(this.options.appName):\"\",i.width=48,i.height=48,r.appendChild(i)}let o=document.createElement(\"h1\");if(this.options.appName?o.textContent=b(\"signInTo\",e,{appName:this.options.appName}):o.textContent=b(\"signIn\",e),this.options.purpose&&(o.textContent=this.options.purpose.title),o.id=\"login-title\",r.appendChild(o),this.options.purpose?.description){let i=document.createElement(\"p\");i.className=\"subtitle\",i.textContent=this.options.purpose.description,r.appendChild(i)}if(this.options.masterAppName){let i=document.createElement(\"p\");i.className=\"federated-hint\",i.textContent=b(\"federatedBy\",e,{masterName:this.options.masterAppName}),r.appendChild(i)}t.appendChild(r)}renderTrustFooter(t,e){let r=document.createElement(\"div\");r.className=\"login-footer\";let o=document.createElement(\"div\");o.className=\"secured-badge\",o.innerHTML=`${Ve} ${K(b(\"securedBy\",e))}`,r.appendChild(o);let{privacyUrl:i,termsUrl:a}=this.options;if(i||a){let s=document.createElement(\"div\");if(s.className=\"footer-links\",i){let n=document.createElement(\"a\");n.href=i,n.target=\"_blank\",n.rel=\"noopener noreferrer\",n.textContent=b(\"privacy\",e),s.appendChild(n)}if(i&&a&&s.appendChild(document.createTextNode(\" \\xB7 \")),a){let n=document.createElement(\"a\");n.href=a,n.target=\"_blank\",n.rel=\"noopener noreferrer\",n.textContent=b(\"terms\",e),s.appendChild(n)}r.appendChild(s)}if(this.currentView!==\"methods\"&&this.options.mode!==\"dialog\"){this.renderHomeLink(r,e);let s=r.querySelector(\".home-link\");s&&(s.style.cssText=\"position:static;display:inline-flex;margin-top:12px\")}t.appendChild(r)}renderDivider(t,e){let r=document.createElement(\"div\");r.className=\"divider\",r.textContent=b(\"or\",e),t.appendChild(r)}renderPasskeySection(t,e){let r=document.createElement(\"div\");r.className=\"passkey-section\",t.appendChild(r);let o=document.createElement(\"div\");o.className=\"status\",o.id=\"passkey-status\",t.appendChild(o);let i=(d,E)=>{o.textContent=d,o.className=`status${E?\" error\":\"\"}`},a=()=>i(\"\",!1),s={waiting:b(\"passkeyWaiting\",e),creating:b(\"passkeyCreating\",e),verifying:b(\"verifying\",e)},n=d=>d.success?(i(b(\"success\",e),!1),this.handleSuccess(),!0):d.code===\"FORBIDDEN\"||d.error===\"registration_closed\"?(this.showFullError(G({message:d.error,code:d.code||d.error},e)),!0):!1,u=()=>{r.innerHTML=\"\",i(b(\"passkeyNoLocal\",e),!1);let d=document.createElement(\"button\");d.className=\"btn\",d.id=\"passkey-btn\",d.innerHTML=`${de} ${K(b(\"passkeyUseAnotherDevice\",e))}`,r.appendChild(d),d.addEventListener(\"click\",()=>f());let E=document.createElement(\"button\");E.type=\"button\",E.className=\"passkey-alt passkey-create-entry\",E.textContent=b(\"passkeyCreateInstead\",e),r.appendChild(E),E.addEventListener(\"click\",()=>p())},p=()=>{this.cardEl?.classList.add(\"passkey-creating\"),this.abort?.abort(),this.generation++,r.innerHTML=\"\",a();let d=this.cardEl?.querySelector(\"h1\");d&&(d.textContent=b(\"passkeyCreateAccount\",e));let E=document.createElement(\"p\");E.className=\"subtitle\",E.textContent=b(\"passkeyExplanation\",e),r.appendChild(E);let A=document.createElement(\"div\");A.className=\"name-row visible\",A.id=\"passkey-name-row\";let _=document.createElement(\"input\");_.className=\"input\",_.id=\"passkey-name-input\",_.type=\"text\",_.setAttribute(\"aria-label\",b(\"namePlaceholder\",e)),_.placeholder=b(\"namePlaceholder\",e),_.autocomplete=\"name\",A.appendChild(_),r.appendChild(A);let x=document.createElement(\"button\");x.className=\"btn\",x.id=\"passkey-btn\",x.innerHTML=`${de} ${K(b(\"passkeyCreate\",e))}`,r.appendChild(x);let v=document.createElement(\"button\");v.type=\"button\",v.className=\"passkey-alt\",v.textContent=b(\"passkeyBackToSignIn\",e),r.appendChild(v);let D=async()=>{if(x.disabled)return;x.disabled=!0,this.select(\"passkey\");let T=this.generation,N=await ie({registerOnly:!0,signal:this.abort?.signal,name:_.value.trim(),onStatus:i,texts:s,locale:e,prefix:this.options.passkeyPrefix,invitationId:this.options.invitationId});!this.mounted||T!==this.generation||this.abort?.signal.aborted||n(N)||(N.error&&i(N.error,!0),x.disabled=!1)};x.addEventListener(\"click\",D),_.addEventListener(\"keydown\",T=>{T.key===\"Enter\"&&D()}),v.addEventListener(\"click\",()=>l()),x.focus()},f=async()=>{let d=r.querySelector(\"#passkey-btn\");if(d?.disabled)return;d&&(d.disabled=!0),this.select(\"passkey\");let E=this.generation,A=await ie({authOnly:!0,signal:this.abort?.signal,onStatus:i,texts:s,locale:e,prefix:this.options.passkeyPrefix,invitationId:this.options.invitationId});if(!(!this.mounted||E!==this.generation||this.abort?.signal.aborted)&&!n(A)){if(A.error&&A.error!==\"no_passkey\"){i(A.error,!0),d&&(d.disabled=!1);return}this.emit(\"incomplete\"),u()}},l=()=>{this.cardEl?.classList.remove(\"passkey-creating\"),this.abort?.abort(),this.generation++;let d=this.cardEl?.querySelector(\"h1\");d&&(d.textContent=this.options.purpose?.title??(this.options.appName?b(\"signInTo\",e,{appName:this.options.appName}):b(\"signIn\",e))),r.innerHTML=\"\",a();let E=document.createElement(\"button\");E.className=this.cardEl?.classList.contains(\"social-first\")?\"btn btn-secondary\":\"btn\",E.id=\"passkey-btn\",E.innerHTML=`${de} ${K(b(\"passkeySignIn\",e))}`,r.appendChild(E),E.addEventListener(\"click\",()=>f());let A=document.createElement(\"button\");A.type=\"button\",A.className=\"passkey-alt passkey-create-entry\",A.textContent=b(\"passkeyFirstTime\",e),r.appendChild(A),A.addEventListener(\"click\",()=>p())};this.options.invitationId?p():l()}startOAuthPopup(t,e){this.oauthCleanup?.();let r=this.generation,o=this.config.servicePrefix??\"/.well-known/service\",i=this.options.masterOAuthOrigin?`${this.options.masterOAuthOrigin}${o}`:o,a=new URL(i,window.location.href).origin,s=`${i}/api/oauth/${encodeURIComponent(t)}/login?returnUrl=${encodeURIComponent(window.location.href)}`,n=500,u=620,p=window.screenX+(window.innerWidth-n)/2,f=window.screenY+(window.innerHeight-u)/2,l=window.open(s,\"oauth-login:popup\",`left=${p},top=${f},width=${n},height=${u},resizable,scrollbars=yes,status=1,popup`);if(!l){this.options.onBeforeRedirect?.(),window.location.href=s;return}let d=e.innerHTML;e.textContent=b(\"oauthWaiting\",this.options.locale,{provider:this.options.oauthProviders?.find(m=>m.id===t)?.name??t}),e.disabled=!0,e.classList.add(\"oauth-btn-loading\");let E=document.createElement(\"div\");E.className=\"oauth-recovery\",E.setAttribute(\"role\",\"status\");let A=document.createElement(\"p\");A.textContent=b(\"oauthIncomplete\",this.options.locale);let _=document.createElement(\"a\");_.href=s,_.textContent=b(\"oauthFullPage\",this.options.locale),_.addEventListener(\"click\",()=>{this.options.onBeforeRedirect?.(),this.oauthCleanup?.()}),E.append(A,_),E.hidden=!0,e.parentElement?.after(E);let x=()=>{E.hidden=!1,this.emit(\"incomplete\"),e.innerHTML=d,e.disabled=!1,e.classList.remove(\"oauth-btn-loading\")},v=!1,D,T=()=>{v||!this.mounted||r!==this.generation||(v=!0,c(),e.textContent=b(\"success\",this.options.locale),this.handleSuccess())},N=async m=>{if(m.origin!==a||m.source!==l||!m.data||m.data.type!==\"authorization_response\"||v||!this.mounted||r!==this.generation)return;I!==void 0&&(clearInterval(I),I=void 0);try{l.close()}catch{}if(m.data.error){x(),c();return}let{code:h,state:y}=m.data.response??m.data;if(!h){x(),c();return}e.textContent=b(\"verifying\",this.options.locale),e.disabled=!0;try{let g={provider:t,code:h,state:y};this.options.invitationId&&(g.invitationId=this.options.invitationId),await this.http.post(`${o}/api/oauth/login`,g),T()}catch(g){if(v||!this.mounted||r!==this.generation)return;let w=g instanceof Error?g.message:\"\",C=g instanceof Error&&\"code\"in g?g.code:\"\";C===\"FORBIDDEN\"||w===\"registration_closed\"||C===\"registration_closed\"?(v=!0,c(),this.showFullError(G(g,this.options.locale))):x()}},I=setInterval(()=>{let m=!1;try{m=l.closed}catch{return}if(!m)return;I!==void 0&&(clearInterval(I),I=void 0),x();let h=()=>{this.http.get(`${o}/api/did/session`).then(y=>{y?.authenticated&&T()}).catch(()=>{})};h(),D=setInterval(h,500)},500),S=setTimeout(()=>{v||(c(),x())},300*1e3),c=()=>{v=!0,e.innerHTML=d,e.disabled=!1,e.classList.remove(\"oauth-btn-loading\"),I!==void 0&&(clearInterval(I),I=void 0),D!==void 0&&(clearInterval(D),D=void 0),clearTimeout(S),window.removeEventListener(\"message\",N)};this.oauthCleanup=()=>{c(),E.remove();try{l.close()}catch{}},window.addEventListener(\"message\",N)}renderSecondaryGrid(t,e,r,o){let i=document.createElement(\"div\");if(i.className=\"methods-grid\",r.includes(\"oauth\")&&this.options.oauthProviders?.length){let a=this.options.oauthProviderOrder??[\"google\",\"apple\",\"github\"],s=p=>a.includes(p)?a.indexOf(p):a.length,n=!!this.options.oauthProviderOrder||this.options.oauthProviders?.some(p=>p.order!==void 0&&p.order!==999),u=(this.options.oauthProviders??[]).filter(p=>p.enabled&&(!o||(n||[\"google\",\"apple\"].includes(p.id))===(o===\"primary\"))).sort((p,f)=>this.options.oauthProviderOrder?s(p.id)-s(f.id):(p.order??999)-(f.order??999)||s(p.id)-s(f.id));for(let p of u){let f=document.createElement(\"button\");f.className=\"method-btn\",f.dataset.provider=p.id;let l=je(p.id);f.innerHTML=`${l} ${K(b(\"continueWith\",e,{provider:p.name}))}`,i.appendChild(f),f.addEventListener(\"click\",()=>{this.select(\"oauth\"),this.activeProvider=p.id,this.startOAuthPopup(p.id,f)})}}if(r.includes(\"email\")){let a=document.createElement(\"button\");a.className=\"method-btn\",a.id=\"email-btn\",a.innerHTML=`${ze} ${K(b(\"emailButton\",e))}`,i.appendChild(a),a.addEventListener(\"click\",()=>{this.select(\"email\"),this.switchView(\"email\")})}if(r.includes(\"did-connect\")){let a=document.createElement(\"button\");a.className=\"method-btn\",a.id=\"did-wallet-btn\";let s=i.children.length>0?b(\"didWalletButtonShort\",e):b(\"didWalletButton\",e);a.innerHTML=`${Ce} ${K(s)}`,i.appendChild(a),a.addEventListener(\"click\",()=>{this.select(\"did-connect\"),this.switchView(\"qr\")})}t.appendChild(i)}async startDIDConnectInView(t,e,r,o){t.textContent=b(\"connecting\",o);let i=this.generation,a=()=>this.mounted&&i===this.generation;try{this.tokenSession?.destroy(),this.tokenSession=new ee(this.config,this.http),this.tokenSession.on(\"succeed\",async()=>{if(a()){this.showConnectResult(e,r,t,b(\"verifying\",o));try{let n=this.config.servicePrefix??\"/.well-known/service\";if(await this.http.post(`${n}/api/did/connect/complete`,{token:this.tokenSession.state.token}),!a())return;this.showConnectSuccess(e,r,t,o),this.handleSuccess()}catch(n){if(!a())return;this.showConnectResult(e,r,t,G(n,o),!0)}}}),this.tokenSession.on(\"timeout\",()=>{t.textContent=b(\"timeout\",o);let n=document.createElement(\"div\");n.className=\"qr-timeout-overlay\",n.innerHTML=`<span class=\"timeout-text\">${K(b(\"timeout\",o))}</span>`;let u=document.createElement(\"button\");u.className=\"refresh-btn\",u.textContent=b(\"refreshQR\",o),u.addEventListener(\"click\",()=>{n.remove(),he(e),e.innerHTML='<div class=\"qr-placeholder\"><span class=\"qr-spinner\"></span></div>',r.disabled=!0,this.startDIDConnectInView(t,e,r,o)}),n.appendChild(u),e.appendChild(n)}),this.tokenSession.on(\"error\",n=>{this.showConnectResult(e,r,t,G(n,o),!0)}),this.tokenSession.on(\"statusChange\",n=>{n.status===\"scanned\"&&this.showConnectScanned(e,r,t,o)});let s=await this.tokenSession.create({locale:o});if(!a())return;s.url&&(Be(e,s.url),r.disabled=!1,r.addEventListener(\"click\",()=>{t.textContent=b(\"walletRetry\",o),this.openInWallet(s.url,o)})),t.textContent=b(\"scanWithWallet\",o),this.tokenSession.startPolling()}catch(s){if(!a())return;t.textContent=G(s,o),he(e)}}showFullError(t){if(!this.cardEl)return;let e=this.options.locale;this.tokenSession&&(this.tokenSession.destroy(),this.tokenSession=null),this.cardEl.innerHTML=\"\",this.cardEl.dataset.view=\"error\",this.renderCardTools(this.cardEl);let r=document.createElement(\"div\");r.className=\"connect-result\",r.innerHTML='<div class=\"result-icon result-error\">\\u2715</div>',this.cardEl.appendChild(r);let o=document.createElement(\"div\");o.className=\"status error\",o.textContent=t,this.cardEl.appendChild(o);let i=document.createElement(\"button\");i.className=\"btn btn-secondary result-back-btn\",i.textContent=b(\"back\",e),i.addEventListener(\"click\",()=>this.switchView(\"methods\")),this.cardEl.appendChild(i),this.renderTrustFooter(this.cardEl,e)}showConnectScanned(t,e,r,o=\"en\"){t.style.display=\"none\",e.style.display=\"none\";let i=t.parentElement?.querySelector(\".connect-result\");i||(i=document.createElement(\"div\"),i.className=\"connect-result\",t.parentElement?.insertBefore(i,r)),i.innerHTML=`<div class=\"connect-status-icon\">\n <div class=\"connect-spinner-ring\"></div>\n <span class=\"connect-status-badge\">${Ce}</span>\n </div>`,r.textContent=b(\"waitingWallet\",o),r.className=\"status\";let a=r.parentElement?.querySelector(\".connect-subtitle\");a||(a=document.createElement(\"p\"),a.className=\"connect-subtitle\",r.parentElement?.insertBefore(a,r.nextSibling)),a.textContent=b(\"walletContinue\",o);let s=r.parentElement?.querySelector(\".result-back-btn\");s||(s=document.createElement(\"button\"),s.className=\"btn btn-secondary result-back-btn\",s.textContent=b(\"back\",o),s.addEventListener(\"click\",()=>this.switchView(\"methods\")),a.parentElement?.insertBefore(s,a.nextSibling))}showConnectSuccess(t,e,r,o=\"en\"){t.style.display=\"none\",e.style.display=\"none\";let i=t.parentElement?.querySelector(\".connect-result\");i||(i=document.createElement(\"div\"),i.className=\"connect-result\",t.parentElement?.insertBefore(i,r)),i.innerHTML=`<div class=\"connect-status-icon connect-success\">\n <svg viewBox=\"0 0 64 64\" width=\"64\" height=\"64\"><circle cx=\"32\" cy=\"32\" r=\"28\" fill=\"none\" stroke=\"#49dc6e\" stroke-width=\"3\"/><polyline points=\"20 33 28 41 44 25\" fill=\"none\" stroke=\"#49dc6e\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>\n </div>`,r.textContent=b(\"success\",o),r.className=\"status success\";let a=r.parentElement?.querySelector(\".connect-subtitle\"),s=r.parentElement?.querySelector(\".result-back-btn\");a?.remove(),s?.remove()}showConnectResult(t,e,r,o,i=!1){let a=this.options.locale;t.style.display=\"none\",e.style.display=\"none\";let s=t.parentElement?.querySelector(\".connect-result\");if(s||(s=document.createElement(\"div\"),s.className=\"connect-result\",t.parentElement?.insertBefore(s,r)),i){s.innerHTML='<div class=\"result-icon result-error\">\\u2715</div>',r.textContent=o,r.className=\"status error\";let n=r.parentElement?.querySelector(\".result-back-btn\");n||(n=document.createElement(\"button\"),n.className=\"btn btn-secondary result-back-btn\",n.textContent=b(\"back\",a),n.addEventListener(\"click\",()=>this.switchView(\"methods\")),r.parentElement?.insertBefore(n,r.nextSibling))}else s.innerHTML='<div class=\"result-icon result-loading\"><span class=\"qr-spinner\"></span></div>',r.textContent=o,r.className=\"status\"}openInWallet(t,e=\"en\"){let r=De(),o=ct();if(r){let i=t.replace(/^https?:\\/\\//,\"abt://\");window.location.href=i}else if(o&&typeof o.open==\"function\"){let i=this.tokenSession?.state;o.open({action:this.config.action??\"login\",locale:e,url:encodeURIComponent(t),appInfo:i?.appInfo??{},memberAppInfo:i?.memberAppInfo??{}})}else{let i=`${lt}?action=requestAuth&url=${encodeURIComponent(t)}`,a=414,s=736,n=window.screenX+window.innerWidth-a,u=window.screenY;window.open(i,\"did-wallet:popup\",`left=${n},top=${u},width=${a},height=${s},resizable,scrollbars=yes,status=1,popup`)}}handleSuccess(){if(!(!this.mounted||this.completed)){if(this.completed=!0,this.emit(\"success\"),this.options.preferenceKey&&this.activeMethod)try{localStorage.setItem(`did-login-method:${this.options.preferenceKey}`,this.activeMethod===\"oauth\"&&this.activeProvider?`oauth:${this.activeProvider}`:this.activeMethod)}catch{}if(this.options.onSuccess){let t=this.generation;Promise.resolve().then(()=>{if(this.mounted&&t===this.generation)return this.options.onSuccess?.()}).catch(()=>{!this.mounted||t!==this.generation||(this.completed=!1,this.showFullError(b(\"authFailed\",this.options.locale)))})}else setTimeout(()=>location.reload(),300)}}},dt=`${Fe}${Te}\n:host { color-scheme: dark; }\n:host([data-theme=\"light\"]) { color-scheme: light; }\ndialog { box-sizing:border-box; position:fixed; inset:0; margin:auto; padding:0;\n width:min(420px,calc(100vw - 32px)); max-width:none; max-height:calc(100dvh - 32px);\n border:1px solid var(--border); border-radius:16px; background:var(--bg-card);\n color:var(--text); color-scheme:inherit; overflow:hidden; box-shadow:var(--shadow-lg); }\ndialog::backdrop { background:rgba(8,10,18,.56); }\n:host(:not([data-theme=\"light\"])) dialog::backdrop { background:rgba(0,0,0,.68); }\n[data-dialog-scroll] { max-height:calc(100dvh - 34px); overflow:auto; overscroll-behavior:contain; }\n.close { position:absolute; top:8px; right:8px; z-index:3; display:grid; place-items:center;\n box-sizing:border-box; width:44px; height:44px; padding:0; border:1px solid transparent;\n border-radius:10px; background:var(--bg-card); color:var(--text-secondary);\n font:400 24px/1 system-ui,sans-serif; cursor:pointer; }\n.close:hover { color:var(--text); background:var(--bg-hover); }\n.close:focus-visible { outline:2px solid var(--blue); outline-offset:-3px; }\n.host-error { padding:16px 20px; font:14px/1.5 system-ui,sans-serif; overflow-wrap:anywhere; }\n.retry { padding:10px 16px; margin:0 20px 20px; color:var(--text); background:var(--bg-elevated);\n border:1px solid var(--border); border-radius:8px; font:inherit; cursor:pointer; }\n`,Se=class{config;http;options;host;dialog;page;previous;themeObserver;systemTheme;syncTheme=()=>this.applyTheme(this.hostTheme());constructor(t,e,r={}){this.config=t,this.http=e,this.options=r}mount(){if(this.dialog)return;let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;this.previous=this.options.returnFocus??(t instanceof HTMLElement?t:void 0);let e=document.createElement(\"div\");e.dataset.didLoginDialogHost=\"\",e.style.cssText=\"position:fixed;width:0;height:0;\",this.host=e;let r=e.attachShadow({mode:\"open\"}),o=document.createElement(\"style\");o.textContent=dt,r.append(o);let i=document.createElement(\"dialog\");this.dialog=i,i.setAttribute(\"aria-label\",this.options.purpose?.title??b(\"signIn\",this.options.locale)),r.append(i);let a=document.createElement(\"button\");a.type=\"button\",a.className=\"close\",a.textContent=\"\\xD7\",a.setAttribute(\"aria-label\",b(\"cancel\",this.options.locale));let s=()=>{if(!(this.options.dismissible===!1||this.dialog!==i)){try{this.options.onEvent?.({name:\"cancel\",mode:\"dialog\"})}catch{}this.destroy(),this.options.onCancel?.()}};a.addEventListener(\"click\",s),this.options.dismissible!==!1&&i.append(a);let n=document.createElement(\"div\");n.dataset.dialogScroll=\"\",i.append(n);let u=document.createElement(\"div\");u.dataset.loginDialogMount=\"\",n.append(u),i.addEventListener(\"cancel\",l=>{l.preventDefault(),s()}),document.body.append(e);let p=this.hostTheme();e.dataset.theme=p,this.page=new pe(u,this.config,this.http,{...this.options,theme:p,isolate:!0,mode:\"dialog\",onCancel:s,onLocaleChange:l=>{this.options.locale=l,a.setAttribute(\"aria-label\",b(\"cancel\",l)),i.setAttribute(\"aria-label\",this.options.purpose?.title??b(\"signIn\",l)),this.options.onLocaleChange?.(l)},onSuccess:async()=>{let l=()=>{if(!i.isConnected||this.dialog!==i)return;for(let A of n.querySelectorAll(\".host-error, .retry\"))A.remove();let d=document.createElement(\"p\");d.className=\"host-error\",d.setAttribute(\"role\",\"alert\"),d.textContent=b(\"authFailed\",this.options.locale);let E=document.createElement(\"button\");E.type=\"button\",E.className=\"retry\",E.textContent=b(\"tryAgain\",this.options.locale),E.onclick=async()=>{E.disabled=!0;try{await this.options.onSuccess?.(),this.dialog===i&&this.destroy()}catch{l()}},n.append(d,E)};try{await this.options.onSuccess?.(),this.dialog===i&&this.destroy()}catch{l()}}}),this.page.mount(),this.themeObserver=new MutationObserver(this.syncTheme);for(let l of[document.documentElement,document.body])this.themeObserver.observe(l,{attributes:!0,attributeFilter:[\"data-theme\",\"data-mode\",\"class\",\"style\"]});typeof window.matchMedia==\"function\"&&(this.systemTheme=window.matchMedia(\"(prefers-color-scheme: dark)\"),this.systemTheme.addEventListener(\"change\",this.syncTheme)),i.showModal();let f=u.shadowRoot?.querySelector(\"h1, h2\");f&&(f.tabIndex=-1,f.focus({preventScroll:!0}))}hostTheme(){for(let t of[document.documentElement,document.body])for(let e of[\"data-mode\",\"data-theme\"]){let r=t.getAttribute(e);if(r===\"light\"||r===\"dark\")return r;if(r===\"system\"||r===\"auto\")return window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"}for(let t of[document.documentElement,document.body]){if(t.classList.contains(\"dark\"))return\"dark\";if(t.classList.contains(\"light\"))return\"light\"}for(let t of[document.body,document.documentElement]){let e=getComputedStyle(t).colorScheme.split(/\\s+/);if(e.includes(\"light\")&&e.includes(\"dark\"))return window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\";if(e.includes(\"light\"))return\"light\";if(e.includes(\"dark\"))return\"dark\"}return this.options.theme===\"light\"||this.options.theme===\"dark\"?this.options.theme:window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"}setTheme(t){this.options.theme=t,this.applyTheme(t)}applyTheme(t){this.host&&(this.host.dataset.theme=t),this.page?.setTheme(t)}destroy(){this.themeObserver?.disconnect(),this.themeObserver=void 0,this.systemTheme?.removeEventListener(\"change\",this.syncTheme),this.systemTheme=void 0,this.page?.destroy(),this.page=void 0,this.dialog?.close(),this.dialog?.remove(),this.dialog=void 0,this.host?.remove(),this.host=void 0,this.previous?.isConnected&&this.previous.focus({preventScroll:!0})}};return Me(ht);})();\n";
2
+ export default "\"use strict\";var __LoginBundle=(()=>{var ce=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Pe=Object.prototype.hasOwnProperty;var Oe=(t,e)=>{for(var r in e)ce(t,r,{get:e[r],enumerable:!0})},Me=(t,e,r,n)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let i of Ne(e))!Pe.call(t,i)&&i!==r&&ce(t,i,{get:()=>e[i],enumerable:!(n=Re(e,i))||n.enumerable});return t};var $e=t=>Me(ce({},\"__esModule\",{value:!0}),t);var pt={};Oe(pt,{FetchHttpAdapter:()=>ee,LoginDialog:()=>Le,LoginPage:()=>me,runPasskeyAuth:()=>le});var K={CREATED:\"created\",SCANNED:\"scanned\",SUCCEED:\"succeed\",ERROR:\"error\",TIMEOUT:\"timeout\",BUSY:\"busy\",FORBIDDEN:\"forbidden\"};var U={API_PREFIX:\"/api/did\",SERVICE_PREFIX:\"/.well-known/service\",ACTION:\"login\",TOKEN_TIMEOUT:3e5,CHECK_INTERVAL:2e3,TOKEN_KEY:\"_t_\",TOKEN_DELIVERY:\"cookie\",CREATE_THROTTLE:500,AUTO_CHECK_INTERVAL:6e4};var ue=\"did:abt:\";function ye(t){if(!t||typeof t!=\"string\")return!1;let e=t.replace(ue,\"\");return/^(0x)?[0-9a-f]{40}$/i.test(e)}function be(t,e=8,r=6){return!t||typeof t!=\"string\"?\"\":t.length<=e+r+3?t:`${t.slice(0,e)}...${t.slice(-r)}`}function de(t,e={}){if(!t||typeof t!=\"string\")return{prefix:\"DID: ABT:\",chainLabel:\"ABT\",address:\"\",compact:\"\",copyText:\"\"};let{startChars:r=8,endChars:n=6}=e,i=ye(t),a=t.replace(ue,\"\"),s=i?\"ETH\":\"ABT\",o=e.includePrefix??!i;return{prefix:`DID: ${s}:`,chainLabel:s,address:a,compact:be(a,r,n),copyText:o?`${ue}${a}`:a}}var M={TOKEN_EXPIRED:\"TOKEN_EXPIRED\",TOKEN_NOT_FOUND:\"TOKEN_NOT_FOUND\",TOKEN_TIMEOUT:\"TOKEN_TIMEOUT\",ALREADY_EXIST:\"ALREADY_EXIST\",ALREADY_BIND:\"ALREADY_BIND\",NETWORK_ERROR:\"NETWORK_ERROR\",INVALID_RESPONSE:\"INVALID_RESPONSE\",UNAUTHORIZED:\"UNAUTHORIZED\",FORBIDDEN:\"FORBIDDEN\"},O=class extends Error{code;constructor(e,r){super(r),this.name=\"ConnectError\",this.code=e}};var ee=class{_defaultHeaders;_onRequest;constructor(e){this._defaultHeaders=e?.headers??{},this._onRequest=e?.onRequest}async get(e,r){this._validateUrl(e);let n=r?.params?this._serializeParams(r.params):\"\",i=n?`${e}${e.includes(\"?\")?\"&\":\"?\"}${n}`:e,s={method:\"GET\",headers:{...this._defaultHeaders,...r?.headers},signal:r?.signal};return this._onRequest&&(s=this._onRequest(i,s)),this._execute(i,s)}async post(e,r,n){this._validateUrl(e);let i=n?.params?this._serializeParams(n.params):\"\",a=i?`${e}${e.includes(\"?\")?\"&\":\"?\"}${i}`:e,o={method:\"POST\",headers:{\"Content-Type\":\"application/json\",...this._defaultHeaders,...n?.headers},body:r!==void 0?JSON.stringify(r):void 0,signal:n?.signal};return this._onRequest&&(o=this._onRequest(a,o)),this._execute(a,o)}_validateUrl(e){if(!e?.trim())throw new O(M.NETWORK_ERROR,\"Request URL must not be empty\");if(e.trim().toLowerCase().startsWith(\"javascript:\"))throw new O(M.NETWORK_ERROR,\"Invalid URL protocol\")}async _execute(e,r){let n;try{n=await globalThis.fetch(e,r)}catch(s){throw s?.name===\"AbortError\"?s:new O(M.NETWORK_ERROR,`Network request failed: ${s?.message??\"Unknown error\"}`)}if(!n.ok){let s=\"\",o=\"\";try{let u=await n.text();try{let f=JSON.parse(u);f.error&&(s=f.error),f.code&&(o=f.code)}catch{s=u}}catch{}let c=o===\"FORBIDDEN\"?M.FORBIDDEN:M.NETWORK_ERROR;throw new O(c,s||`HTTP ${n.status} ${n.statusText||\"Error\"}`)}if(n.status===204)return null;let i=await n.text();if(!i.trim())return null;let a=n.headers.get(\"content-type\")??\"\";if(!a.includes(\"application/json\")&&!a.includes(\"+json\"))throw new O(M.INVALID_RESPONSE,`Expected JSON response but received: ${a||\"unknown content type\"}`);try{return JSON.parse(i)}catch{throw new O(M.INVALID_RESPONSE,\"Failed to parse JSON response\")}}_serializeParams(e){let r=[];for(let n of Object.keys(e)){let i=e[n];if(i!=null)if(Array.isArray(i))for(let a of i)a!=null&&r.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(a))}`);else typeof i==\"boolean\"?r.push(`${encodeURIComponent(n)}=${i?\"true\":\"false\"}`):r.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`)}return r.join(\"&\")}};var Ee=[\"en\",\"zh\",\"zh-TW\",\"ja\"],vt=new Set(Ee);function te(t){let e=t.apiPrefix??U.API_PREFIX,r=t.action??U.ACTION,n=e.replace(/\\/+$/,\"\"),i=r.replace(/^\\/+/,\"\");return`${n}/${i}`}function Ce(){return{token:null,url:null,status:null,error:null,appInfo:null,memberAppInfo:null,loading:!1}}var ne=class{_state;_config;_http;_pollTimer=null;_checkCount=0;_maxCheckCount;_realtimeUnsub=null;_realtime;_storage;_lastCreateTime=0;_listeners=new Map;_destroyed=!1;constructor(e,r,n){this._config=this._fillDefaults(e),this._http=r,this._realtime=n?.realtime,this._storage=n?.storage,this._state=Ce(),this._config.checkInterval<=0?this._maxCheckCount=1/0:this._maxCheckCount=Math.ceil(this._config.tokenTimeout/this._config.checkInterval)}get state(){return Object.freeze({...this._state})}async create(e){if(Date.now()-this._lastCreateTime<U.CREATE_THROTTLE)return this.state;(this._pollTimer!==null||this._realtimeUnsub!==null)&&this.stopPolling(),this._state.loading=!0,this._emit(\"statusChange\",this.state);let r=`${te(this._config)}/token`,n={};e?(e.locale!=null&&(n.locale=e.locale),e.provider!=null?n.provider=e.provider:n.provider=\"wallet\",e.encKey!=null&&(n.__encKey=e.encKey),e.autoConnect!=null&&(n.autoConnect=e.autoConnect),e.visitorId!=null&&(n.visitorId=e.visitorId),e.sourceToken!=null&&(n.sourceToken=e.sourceToken),e.forceConnected!=null&&(n.forceConnected=e.forceConnected),e.connectUrl!=null&&(n.connectUrl=e.connectUrl),e.extraParams&&Object.assign(n,e.extraParams)):n.provider=\"wallet\";try{let i=await this._http.get(r,{params:n});return this._state.token=i.token??null,this._state.url=i.url??null,this._state.status=K.CREATED,this._state.appInfo=i.appInfo??null,this._state.memberAppInfo=i.memberAppInfo??null,this._state.loading=!1,this._state.error=null,this._state.successResult=void 0,this._state.connectedDid=void 0,this._state.mfaCode=void 0,this._state.saveConnect=void 0,this._lastCreateTime=Date.now(),this._emit(\"statusChange\",this.state),this.state}catch(i){throw this._state.loading=!1,this._state.error=i?.message??\"Failed to create token\",this._state.status=K.ERROR,this._emit(\"statusChange\",this.state),this._emit(\"error\",new O(M.NETWORK_ERROR,this._state.error)),i}}async checkStatus(){if(!this._state.token)throw new O(M.TOKEN_NOT_FOUND,\"No token available. Call create() first.\");let e=`${te(this._config)}/status`,r={[U.TOKEN_KEY]:this._state.token};this._config.appPid;try{let n=await this._http.get(e,{params:r}),i=n.status;return i&&(this._state.status=i),n.error!==void 0&&(this._state.error=n.error),n.connectedDid!==void 0&&(this._state.connectedDid=n.connectedDid),n.mfaCode!==void 0&&(this._state.mfaCode=n.mfaCode),n.saveConnect!==void 0&&(this._state.saveConnect=n.saveConnect),i===K.FORBIDDEN?(this._state.status=K.ERROR,this._state.error=n.error||\"Access forbidden\",this._emit(\"error\",new O(M.UNAUTHORIZED,this._state.error)),this.stopPolling()):i===K.SUCCEED?(this._config.tokenDelivery===\"response\"&&(this._state.successResult=n),this._emit(\"succeed\",this.state),this.stopPolling()):i===K.ERROR?(this._emit(\"error\",new O(M.INVALID_RESPONSE,this._state.error||\"Unknown error\")),this.stopPolling()):i===K.TIMEOUT&&(this._emit(\"timeout\",this.state),this.stopPolling()),this._emit(\"statusChange\",this.state),this.state}catch(n){throw n}}async cancel(){if(!this._state.token)return;let e=`${te(this._config)}/timeout`,r={[U.TOKEN_KEY]:this._state.token};try{await this._http.get(e,{params:r})}catch{}this.stopPolling()}startPolling(){if(this._state.token){if(this._checkCount=0,this._realtime)try{let e=`relay:${this._config.appPid}:${this._state.token}`;this._realtimeUnsub=this._realtime.subscribe(e,r=>{this._handleRealtimeMessage(r)});return}catch{this._realtimeUnsub=null}this._config.checkInterval>0&&(this._pollTimer=setInterval(()=>{this._pollOnce()},this._config.checkInterval))}}stopPolling(){this._pollTimer!==null&&(clearInterval(this._pollTimer),this._pollTimer=null),this._realtimeUnsub&&(this._realtimeUnsub(),this._realtimeUnsub=null)}reset(){this.stopPolling(),this._state=Ce(),this._checkCount=0}destroy(){this._destroyed||(this.stopPolling(),this._state.token=null,this._state.successResult=void 0,this._listeners.clear(),this._destroyed=!0)}on(e,r){let n=this._listeners.get(e);return n||(n=new Set,this._listeners.set(e,n)),n.add(r),this}off(e,r){let n=this._listeners.get(e);return n&&(n.delete(r),n.size===0&&this._listeners.delete(e)),this}_emit(e,...r){let n=this._listeners.get(e);if(!(!n||n.size===0))for(let i of[...n])try{i(...r)}catch{}}_pollOnce(){if(this._checkCount++,this._checkCount>=this._maxCheckCount){this._handleTimeout();return}this.checkStatus().catch(()=>{})}_handleTimeout(){this.stopPolling(),this._state.status=K.TIMEOUT,this._emit(\"timeout\",this.state),this._emit(\"statusChange\",this.state)}_handleRealtimeMessage(e){if(!e||typeof e!=\"object\")return;let r=e.status;r&&(this._state.status=r,e.error!==void 0&&(this._state.error=e.error),e.connectedDid!==void 0&&(this._state.connectedDid=e.connectedDid),e.mfaCode!==void 0&&(this._state.mfaCode=e.mfaCode),e.saveConnect!==void 0&&(this._state.saveConnect=e.saveConnect),r===K.FORBIDDEN?(this._state.status=K.ERROR,this._state.error=e.error||\"Access forbidden\",this._emit(\"error\",new O(M.UNAUTHORIZED,this._state.error)),this.stopPolling()):r===K.SUCCEED?(this._config.tokenDelivery===\"response\"&&(this._state.successResult=e),this._emit(\"succeed\",this.state),this.stopPolling()):r===K.ERROR?(this._emit(\"error\",new O(M.INVALID_RESPONSE,this._state.error||\"Unknown error\")),this.stopPolling()):r===K.TIMEOUT&&(this._emit(\"timeout\",this.state),this.stopPolling()),this._emit(\"statusChange\",this.state))}_fillDefaults(e){return{appPid:e.appPid,appName:e.appName,appDescription:e.appDescription??\"\",appIcon:e.appIcon??\"\",appUrl:e.appUrl??\"\",apiPrefix:e.apiPrefix??U.API_PREFIX,action:e.action??U.ACTION,servicePrefix:e.servicePrefix??U.SERVICE_PREFIX,tokenTimeout:e.tokenTimeout??U.TOKEN_TIMEOUT,checkInterval:e.checkInterval??U.CHECK_INTERVAL,tokenDelivery:e.tokenDelivery??U.TOKEN_DELIVERY}}};var _={bg:{root:\"#0a0a0b\",surface:\"#141416\",card:\"#1c1c20\",elevated:\"#232328\",hover:\"#2b2b34\",active:\"#33333e\",input:\"rgba(255,255,255,0.06)\"},border:{default:\"rgba(255,255,255,0.10)\",subtle:\"rgba(255,255,255,0.06)\",strong:\"rgba(255,255,255,0.15)\",focus:\"rgba(255,255,255,0.25)\"},text:{primary:\"#f5f5f7\",secondary:\"#9394a1\",tertiary:\"#767684\",placeholder:\"#5e5f6e\",white:\"#ffffff\"},color:{blue:\"#6c47ff\",blueHover:\"#5f15fe\",blueLight:\"rgba(108,71,255,0.15)\",blueMuted:\"#9280ff\",red:\"#e02e2e\",redLight:\"rgba(224,46,46,0.15)\",redText:\"#f98a8a\",green:\"#15892b\",greenLight:\"rgba(21,137,43,0.15)\",greenText:\"#49dc6e\",yellow:\"#fd7224\",yellowLight:\"rgba(253,114,36,0.15)\",yellowText:\"#fd9357\",info:\"#236dd7\",infoLight:\"rgba(35,109,215,0.15)\",infoText:\"#73acfa\"},radius:{xs:\"4px\",sm:\"6px\",md:\"8px\",lg:\"12px\",full:\"9999px\"},shadow:{sm:\"0 1px 3px rgba(0,0,0,0.3), 0 1px 2px -1px rgba(0,0,0,0.2)\",md:\"0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3)\",lg:\"0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.4)\",focus:\"0 0 0 1px rgba(255,255,255,0.12), 0 0 0 3px rgba(108,71,255,0.3)\"},font:{family:\"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif\",mono:\"'JetBrains Mono', 'SF Mono', monospace\",sizeBase:\"14px\",lineHeight:\"1.43\"}},$={bg:{root:\"#f8f9fa\",surface:\"#ffffff\",card:\"#ffffff\",elevated:\"#f0f1f3\",hover:\"#e9eaec\",active:\"#dddee1\",input:\"rgba(0,0,0,0.04)\"},border:{default:\"rgba(0,0,0,0.10)\",subtle:\"rgba(0,0,0,0.06)\",strong:\"rgba(0,0,0,0.15)\",focus:\"rgba(0,0,0,0.25)\"},text:{primary:\"#1a1a1a\",secondary:\"#6b7280\",tertiary:\"#9ca3af\",placeholder:\"#c0c5ce\",white:\"#1a1a1a\"},shadow:{sm:\"0 1px 3px rgba(0,0,0,0.08), 0 1px 2px -1px rgba(0,0,0,0.06)\",md:\"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.06)\",lg:\"0 10px 15px -3px rgba(0,0,0,0.12), 0 4px 6px -4px rgba(0,0,0,0.08)\",focus:\"0 0 0 1px rgba(0,0,0,0.08), 0 0 0 3px rgba(108,71,255,0.2)\"}},Te=`\n :root, :host {\n /* Backgrounds \\u2014 layered depth */\n --bg-root: ${_.bg.root};\n --bg-surface: ${_.bg.surface};\n --bg-card: ${_.bg.card};\n --bg-elevated: ${_.bg.elevated};\n --bg-hover: ${_.bg.hover};\n --bg-active: ${_.bg.active};\n --bg-input: ${_.bg.input};\n\n /* Borders \\u2014 semi-transparent for adaptability */\n --border: ${_.border.default};\n --border-subtle:${_.border.subtle};\n --border-strong:${_.border.strong};\n --border-focus: ${_.border.focus};\n\n /* Text hierarchy */\n --text: ${_.text.primary};\n --text-secondary:${_.text.secondary};\n --text-tertiary:${_.text.tertiary};\n --text-placeholder:${_.text.placeholder};\n --text-white: ${_.text.white};\n\n /* Accents */\n --blue: ${_.color.blue};\n --blue-hover: ${_.color.blueHover};\n --blue-light: ${_.color.blueLight};\n --blue-muted: ${_.color.blueMuted};\n --red: ${_.color.red};\n --red-light: ${_.color.redLight};\n --red-text: ${_.color.redText};\n --green: ${_.color.green};\n --green-light: ${_.color.greenLight};\n --green-text: ${_.color.greenText};\n --yellow: ${_.color.yellow};\n --yellow-light: ${_.color.yellowLight};\n --yellow-text: ${_.color.yellowText};\n --info: ${_.color.info};\n --info-light: ${_.color.infoLight};\n --info-text: ${_.color.infoText};\n\n /* Radii */\n --radius-xs: ${_.radius.xs};\n --radius-sm: ${_.radius.sm};\n --radius: ${_.radius.md};\n --radius-lg: ${_.radius.lg};\n --radius-full: ${_.radius.full};\n\n /* Shadows */\n --shadow-sm: ${_.shadow.sm};\n --shadow-md: ${_.shadow.md};\n --shadow-lg: ${_.shadow.lg};\n --shadow-focus: ${_.shadow.focus};\n }\n`,Se=`\n [data-theme=\"light\"], :host([data-theme=\"light\"]) {\n --bg-root: ${$.bg.root};\n --bg-surface: ${$.bg.surface};\n --bg-card: ${$.bg.card};\n --bg-elevated: ${$.bg.elevated};\n --bg-hover: ${$.bg.hover};\n --bg-active: ${$.bg.active};\n --bg-input: ${$.bg.input};\n\n --border: ${$.border.default};\n --border-subtle:${$.border.subtle};\n --border-strong:${$.border.strong};\n --border-focus: ${$.border.focus};\n\n --text: ${$.text.primary};\n --text-secondary:${$.text.secondary};\n --text-tertiary:${$.text.tertiary};\n --text-placeholder:${$.text.placeholder};\n --text-white: ${$.text.white};\n\n --shadow-sm: ${$.shadow.sm};\n --shadow-md: ${$.shadow.md};\n --shadow-lg: ${$.shadow.lg};\n --shadow-focus: ${$.shadow.focus};\n }\n`,Ue=`\n *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }\n html, :host { color-scheme: dark; }\n html[data-theme=\"light\"], :host([data-theme=\"light\"]) { color-scheme: light; }\n body {\n font-family: ${_.font.family};\n background: var(--bg-root);\n color: var(--text);\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n font-size: ${_.font.sizeBase};\n line-height: ${_.font.lineHeight};\n }\n a { color: var(--blue-muted); text-decoration: none; }\n a:hover { text-decoration: underline; }\n .hidden { display: none; }\n`,We=typeof HTMLElement<\"u\"?HTMLElement:class{},we='<svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\"/><path d=\"M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1\"/></svg>',He='<svg width=\"1em\" height=\"1em\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><polyline points=\"20 6 9 17 4 12\"/></svg>',Ke=`\n:host {\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n overflow: hidden;\n font-family: 'SF Mono', 'JetBrains Mono', 'Menlo', 'Consolas', monospace;\n line-height: 1.5;\n}\n:host([block]) { display: flex; }\n.prefix {\n flex-shrink: 0;\n opacity: 0.6;\n margin-right: 4px;\n white-space: nowrap;\n}\n.address {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: var(--did-text-color, currentColor);\n}\n.address-compact {\n white-space: nowrap;\n color: var(--did-text-color, currentColor);\n cursor: default;\n}\n.clickable { cursor: pointer; }\n.clickable:hover { opacity: 0.8; }\n.copy-btn {\n flex-shrink: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1em;\n height: 1em;\n margin-left: 6px;\n padding: 0;\n border: none;\n background: none;\n color: inherit;\n opacity: 0.5;\n cursor: pointer;\n transition: opacity 0.15s;\n}\n.copy-btn:hover { opacity: 1; }\n.copy-btn.copied { opacity: 1; color: var(--did-copy-success-color, #22c55e); }\n`,ze=class extends We{static observedAttributes=[\"did\",\"compact\",\"copyable\",\"start-chars\",\"end-chars\",\"show-prefix\",\"no-tooltip\",\"no-copy\",\"block\",\"size\"];shadow;copyTimer=null;constructor(){super(),this.shadow=this.attachShadow({mode:\"open\"})}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}disconnectedCallback(){this.copyTimer&&clearTimeout(this.copyTimer)}get parts(){let t=Number(this.getAttribute(\"start-chars\")),e=Number(this.getAttribute(\"end-chars\"));return de(this.getAttribute(\"did\")||\"\",{startChars:t>0?t:void 0,endChars:e>0?e:void 0})}render(){if(!(this.getAttribute(\"did\")||\"\")){this.shadow.innerHTML=\"\";return}let e=this.parts,r=this.hasAttribute(\"compact\"),n=!this.hasAttribute(\"no-copy\")&&this.getAttribute(\"copyable\")!==\"false\",i=this.hasAttribute(\"show-prefix\"),a=this.hasAttribute(\"no-tooltip\"),s=Number(this.getAttribute(\"size\"))||0,o=s>=12?`${s}px`:\"inherit\",c=r?e.compact:e.address,u=!a&&r?` title=\"${e.address}\"`:\"\",f=i?`<span class=\"prefix\">${e.prefix} </span>`:\"\",p=r?\"address-compact\":\"address\",l=n?\" clickable\":\"\",E=n?`<button class=\"copy-btn\" aria-label=\"Copy DID\">${we}</button>`:\"\";if(this.shadow.innerHTML=`\n <style>${Ke}:host { font-size: ${o}; }</style>\n ${f}<span class=\"${p}${l}\"${u}>${c}</span>${E}\n `,n){let v=this.shadow.querySelector(`.${p}`);v&&v.addEventListener(\"click\",C=>{C.stopPropagation(),this.copyToClipboard(e.copyText)});let D=this.shadow.querySelector(\".copy-btn\");D&&D.addEventListener(\"click\",C=>{C.stopPropagation(),this.copyToClipboard(e.copyText)})}}copyToClipboard(t){navigator.clipboard?.writeText?navigator.clipboard.writeText(t).catch(()=>this.fallbackCopy(t)):this.fallbackCopy(t),this.showCopied()}fallbackCopy(t){try{let e=document.createElement(\"input\");e.value=t,document.body.appendChild(e),e.select(),document.execCommand?.(\"copy\"),e.remove()}catch{}}showCopied(){let t=this.shadow.querySelector(\".copy-btn\");t&&(t.classList.add(\"copied\"),t.innerHTML=He,this.copyTimer&&clearTimeout(this.copyTimer),this.copyTimer=setTimeout(()=>{t.classList.remove(\"copied\"),t.innerHTML=we},1500))}};typeof customElements<\"u\"&&!customElements.get(\"did-address\")&&customElements.define(\"did-address\",ze);var he={en:{emailExplanation:\"We will send you a verification code. No password needed.\",otherMethods:\"Other ways to sign in\",passkeyCreateAccount:\"Create an account with Passkey\",lastUsed:\"Last used\",passkeyExplanation:\"Create a new account using your fingerprint, face, or device unlock. Your device will ask you to save a Passkey. Already have an account? Go back to sign in.\",continueWith:\"Continue with {provider}\",oauthWaiting:\"Continue in the {provider} window\",oauthIncomplete:\"Sign-in is not complete. Reopen the window or choose another method.\",oauthReopen:\"Reopen window\",oauthUnconfirmed:\"We could not confirm sign-in. Reload this page to check your session before trying again.\",oauthCheckSession:\"Reload and check sign-in\",oauthCancelled:\"Stopped waiting for sign-in. If the provider window is still open, close it before retrying.\",oauthDenied:\"Authorization was declined. Try again or choose another sign-in method.\",oauthBlocked:\"Your browser blocked the sign-in window. Reopen it or continue on this page.\",oauthTimedOut:\"Sign-in timed out. Reopen the window to start again.\",oauthFailed:\"We could not complete sign-in. Try again or choose another method.\",oauthFullPage:\"Continue on this page\",emailEdit:\"Change email\",emailCooldown:\"Resend in {seconds}s\",walletRetry:\"Wallet did not open? Try again or scan the QR code.\",tryAgain:\"Try again\",signIn:\"Sign in or create an account\",signInTo:\"Sign in or join {appName}\",passkeyButton:\"Continue with Passkey\",passkeySignIn:\"Sign in with Passkey\",passkeyCreate:\"Create Passkey\",passkeyFirstTime:\"First time? Create an account\",passkeyBackToSignIn:\"Back to sign in\",passkeyWaiting:\"Waiting for passkey\\u2026\",passkeyCreating:\"Creating your passkey\\u2026\",passkeyNoLocal:\"Passkey verification was not completed. Retry, use another device, or choose another method.\",passkeyUseAnotherDevice:\"Use another device\",passkeyCreateInstead:\"First time? Create an account\",didWalletButton:\"Continue with DID Wallet\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"Scan with your DID Wallet\",waitingWallet:\"Requesting connection\",walletContinue:\"Please continue in DID Wallet\",noPasskey:\"No existing passkey found. Enter a name and create one.\",success:\"Success!\",timeout:\"Session timed out. Try again.\",refreshQR:\"Refresh\",namePlaceholder:\"Your name (optional)\",or:\"or\",emailPlaceholder:\"Email address\",emailButton:\"Email\",passkeyUnsupported:\"Your browser does not support Passkey authentication.\",connecting:\"Connecting...\",verifying:\"Verifying...\",openInWallet:\"Open in DID Wallet\",authFailed:\"Authentication failed\",registrationFailed:\"Registration failed\",passkeySetupFailed:\"Passkey setup failed\",accessDenied:\"Access denied: your account is not permitted to log in to this site.\",regClosed:\"Registration requires an invitation.\",federatedBy:\"Authentication provided by {masterName}\",securedBy:\"Secured by DID Connect\",privacy:\"Privacy\",terms:\"Terms\",back:\"Back\",cancel:\"Cancel\",scanTitle:\"Scan with DID Wallet\",emailTitle:\"Continue with Email\",emailSubmit:\"Send Code\",emailSending:\"Sending code...\",emailSent:\"We sent an 8-digit code to {email}\",emailCodePlaceholder:\"8-digit code\",emailVerify:\"Verify\",emailResend:\"Resend code\",emailInvalid:\"Please enter a valid email address.\",emailCodeInvalid:\"Please enter the 8-digit code.\"},zh:{emailExplanation:\"\\u6211\\u4EEC\\u4F1A\\u53D1\\u9001\\u9A8C\\u8BC1\\u7801\\uFF0C\\u65E0\\u9700\\u5BC6\\u7801\\u3002\",otherMethods:\"\\u5176\\u4ED6\\u767B\\u5F55\\u65B9\\u5F0F\",passkeyCreateAccount:\"\\u4F7F\\u7528 Passkey \\u521B\\u5EFA\\u8D26\\u6237\",lastUsed:\"\\u4E0A\\u6B21\\u4F7F\\u7528\",passkeyExplanation:\"\\u4F7F\\u7528\\u6307\\u7EB9\\u3001\\u9762\\u5BB9\\u6216\\u8BBE\\u5907\\u89E3\\u9501\\u65B9\\u5F0F\\u521B\\u5EFA\\u65B0\\u8D26\\u6237\\uFF0C\\u65E0\\u9700\\u5BC6\\u7801\\u3002\\u8BBE\\u5907\\u4F1A\\u63D0\\u793A\\u4FDD\\u5B58 Passkey\\u3002\\u5DF2\\u6709\\u8D26\\u6237\\uFF1F\\u8BF7\\u8FD4\\u56DE\\u767B\\u5F55\\u3002\",continueWith:\"\\u4F7F\\u7528 {provider} \\u7EE7\\u7EED\",oauthWaiting:\"\\u8BF7\\u5728 {provider} \\u7A97\\u53E3\\u4E2D\\u7EE7\\u7EED\",oauthIncomplete:\"\\u767B\\u5F55\\u5C1A\\u672A\\u5B8C\\u6210\\u3002\\u60A8\\u53EF\\u4EE5\\u91CD\\u65B0\\u6253\\u5F00\\u7A97\\u53E3\\u6216\\u9009\\u62E9\\u5176\\u4ED6\\u65B9\\u5F0F\\u3002\",oauthReopen:\"\\u91CD\\u65B0\\u6253\\u5F00\\u7A97\\u53E3\",oauthUnconfirmed:\"\\u6682\\u65F6\\u65E0\\u6CD5\\u786E\\u8BA4\\u767B\\u5F55\\u7ED3\\u679C\\u3002\\u8BF7\\u5148\\u91CD\\u65B0\\u52A0\\u8F7D\\u9875\\u9762\\u68C0\\u67E5\\u767B\\u5F55\\u72B6\\u6001\\uFF0C\\u518D\\u51B3\\u5B9A\\u662F\\u5426\\u91CD\\u8BD5\\u3002\",oauthCheckSession:\"\\u91CD\\u65B0\\u52A0\\u8F7D\\u5E76\\u68C0\\u67E5\\u767B\\u5F55\\u72B6\\u6001\",oauthCancelled:\"\\u5DF2\\u505C\\u6B62\\u7B49\\u5F85\\u767B\\u5F55\\u3002\\u82E5\\u6388\\u6743\\u7A97\\u53E3\\u4ECD\\u7136\\u6253\\u5F00\\uFF0C\\u8BF7\\u5173\\u95ED\\u540E\\u518D\\u91CD\\u8BD5\\u3002\",oauthDenied:\"\\u60A8\\u672A\\u540C\\u610F\\u6388\\u6743\\u3002\\u53EF\\u4EE5\\u91CD\\u8BD5\\u6216\\u9009\\u62E9\\u5176\\u4ED6\\u767B\\u5F55\\u65B9\\u5F0F\\u3002\",oauthBlocked:\"\\u6D4F\\u89C8\\u5668\\u62E6\\u622A\\u4E86\\u767B\\u5F55\\u7A97\\u53E3\\u3002\\u8BF7\\u91CD\\u65B0\\u6253\\u5F00\\uFF0C\\u6216\\u5728\\u5F53\\u524D\\u9875\\u9762\\u7EE7\\u7EED\\u3002\",oauthTimedOut:\"\\u767B\\u5F55\\u7B49\\u5F85\\u5DF2\\u8D85\\u65F6\\u3002\\u8BF7\\u91CD\\u65B0\\u6253\\u5F00\\u7A97\\u53E3\\u518D\\u8BD5\\u3002\",oauthFailed:\"\\u672A\\u80FD\\u5B8C\\u6210\\u767B\\u5F55\\u3002\\u8BF7\\u91CD\\u8BD5\\u6216\\u9009\\u62E9\\u5176\\u4ED6\\u65B9\\u5F0F\\u3002\",oauthFullPage:\"\\u5728\\u5F53\\u524D\\u9875\\u9762\\u7EE7\\u7EED\",emailEdit:\"\\u4FEE\\u6539\\u90AE\\u7BB1\",emailCooldown:\"{seconds} \\u79D2\\u540E\\u91CD\\u53D1\",walletRetry:\"\\u94B1\\u5305\\u672A\\u6253\\u5F00\\uFF1F\\u8BF7\\u91CD\\u8BD5\\u6216\\u626B\\u63CF\\u4E8C\\u7EF4\\u7801\\u3002\",tryAgain:\"\\u91CD\\u8BD5\",signIn:\"\\u767B\\u5F55\\u6216\\u521B\\u5EFA\\u8D26\\u6237\",signInTo:\"\\u767B\\u5F55\\u6216\\u52A0\\u5165 {appName}\",passkeyButton:\"\\u4F7F\\u7528 Passkey \\u7EE7\\u7EED\",passkeySignIn:\"\\u4F7F\\u7528 Passkey \\u767B\\u5F55\",passkeyCreate:\"\\u521B\\u5EFA Passkey\",passkeyFirstTime:\"\\u9996\\u6B21\\u4F7F\\u7528\\uFF1F\\u521B\\u5EFA\\u8D26\\u6237\",passkeyBackToSignIn:\"\\u8FD4\\u56DE\\u767B\\u5F55\",passkeyWaiting:\"\\u6B63\\u5728\\u7B49\\u5F85 Passkey\\u2026\",passkeyCreating:\"\\u6B63\\u5728\\u521B\\u5EFA Passkey\\u2026\",passkeyNoLocal:\"\\u8FD9\\u6B21\\u672A\\u5B8C\\u6210 Passkey \\u9A8C\\u8BC1\\u3002\\u8BF7\\u91CD\\u8BD5\\u3001\\u4F7F\\u7528\\u5176\\u4ED6\\u8BBE\\u5907\\uFF0C\\u6216\\u9009\\u62E9\\u5176\\u4ED6\\u767B\\u5F55\\u65B9\\u5F0F\\u3002\",passkeyUseAnotherDevice:\"\\u7528\\u5176\\u4ED6\\u8BBE\\u5907\\u767B\\u5F55\",passkeyCreateInstead:\"\\u9996\\u6B21\\u4F7F\\u7528\\uFF1F\\u521B\\u5EFA\\u8D26\\u6237\",didWalletButton:\"\\u4F7F\\u7528 DID Wallet \\u7EE7\\u7EED\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"\\u8BF7\\u4F7F\\u7528 DID Wallet \\u626B\\u7801\",waitingWallet:\"\\u6B63\\u5728\\u8BF7\\u6C42\\u8FDE\\u63A5\",walletContinue:\"\\u8BF7\\u5728 DID Wallet \\u4E2D\\u7EE7\\u7EED\\u5B8C\\u6210\\u60A8\\u7684\\u64CD\\u4F5C\",noPasskey:\"\\u672A\\u627E\\u5230\\u5DF2\\u6709 Passkey\\u3002\\u8F93\\u5165\\u540D\\u79F0\\u5E76\\u521B\\u5EFA\\u4E00\\u4E2A\\u3002\",success:\"\\u6210\\u529F\",timeout:\"\\u4F1A\\u8BDD\\u8D85\\u65F6\\uFF0C\\u8BF7\\u91CD\\u8BD5\\u3002\",refreshQR:\"\\u5237\\u65B0\",namePlaceholder:\"\\u60A8\\u7684\\u540D\\u5B57\\uFF08\\u53EF\\u9009\\uFF09\",or:\"\\u6216\",emailPlaceholder:\"\\u90AE\\u7BB1\\u5730\\u5740\",emailButton:\"\\u90AE\\u7BB1\",passkeyUnsupported:\"\\u60A8\\u7684\\u6D4F\\u89C8\\u5668\\u4E0D\\u652F\\u6301 Passkey \\u8BA4\\u8BC1\\u3002\",connecting:\"\\u8FDE\\u63A5\\u4E2D...\",verifying:\"\\u9A8C\\u8BC1\\u4E2D...\",openInWallet:\"\\u5728 DID Wallet \\u4E2D\\u6253\\u5F00\",authFailed:\"\\u8BA4\\u8BC1\\u5931\\u8D25\",registrationFailed:\"\\u6CE8\\u518C\\u5931\\u8D25\",passkeySetupFailed:\"Passkey \\u8BBE\\u7F6E\\u5931\\u8D25\",accessDenied:\"\\u8BBF\\u95EE\\u88AB\\u62D2\\u7EDD\\uFF1A\\u60A8\\u7684\\u8D26\\u6237\\u65E0\\u6743\\u767B\\u5F55\\u6B64\\u7AD9\\u70B9\\u3002\",regClosed:\"\\u6CE8\\u518C\\u9700\\u8981\\u9080\\u8BF7\\u3002\",federatedBy:\"\\u8BA4\\u8BC1\\u670D\\u52A1\\u7531 {masterName} \\u63D0\\u4F9B\",securedBy:\"\\u7531 DID Connect \\u63D0\\u4F9B\\u5B89\\u5168\\u4FDD\\u969C\",privacy:\"\\u9690\\u79C1\",terms:\"\\u6761\\u6B3E\",back:\"\\u8FD4\\u56DE\",cancel:\"\\u53D6\\u6D88\",scanTitle:\"\\u4F7F\\u7528 DID Wallet \\u626B\\u7801\",emailTitle:\"\\u4F7F\\u7528\\u90AE\\u7BB1\\u7EE7\\u7EED\",emailSubmit:\"\\u53D1\\u9001\\u9A8C\\u8BC1\\u7801\",emailSending:\"\\u6B63\\u5728\\u53D1\\u9001\\u9A8C\\u8BC1\\u7801...\",emailSent:\"\\u9A8C\\u8BC1\\u7801\\u5DF2\\u53D1\\u9001\\u81F3 {email}\",emailCodePlaceholder:\"8 \\u4F4D\\u9A8C\\u8BC1\\u7801\",emailVerify:\"\\u9A8C\\u8BC1\",emailResend:\"\\u91CD\\u65B0\\u53D1\\u9001\",emailInvalid:\"\\u8BF7\\u8F93\\u5165\\u6709\\u6548\\u7684\\u90AE\\u7BB1\\u5730\\u5740\\u3002\",emailCodeInvalid:\"\\u8BF7\\u8F93\\u5165 8 \\u4F4D\\u9A8C\\u8BC1\\u7801\\u3002\"},\"zh-TW\":{emailExplanation:\"\\u6211\\u5011\\u6703\\u50B3\\u9001\\u9A57\\u8B49\\u78BC\\uFF0C\\u7121\\u9700\\u5BC6\\u78BC\\u3002\",otherMethods:\"\\u5176\\u4ED6\\u767B\\u5165\\u65B9\\u5F0F\",passkeyCreateAccount:\"\\u4F7F\\u7528 Passkey \\u5EFA\\u7ACB\\u5E33\\u6236\",lastUsed:\"\\u4E0A\\u6B21\\u4F7F\\u7528\",passkeyExplanation:\"\\u4F7F\\u7528\\u6307\\u7D0B\\u3001\\u9762\\u5BB9\\u6216\\u88DD\\u7F6E\\u89E3\\u9396\\u65B9\\u5F0F\\u5EFA\\u7ACB\\u65B0\\u5E33\\u6236\\uFF0C\\u7121\\u9700\\u5BC6\\u78BC\\u3002\\u88DD\\u7F6E\\u6703\\u63D0\\u793A\\u5132\\u5B58 Passkey\\u3002\\u5DF2\\u6709\\u5E33\\u6236\\uFF1F\\u8ACB\\u8FD4\\u56DE\\u767B\\u5165\\u3002\",continueWith:\"\\u4F7F\\u7528 {provider} \\u7E7C\\u7E8C\",oauthWaiting:\"\\u8ACB\\u5728 {provider} \\u8996\\u7A97\\u4E2D\\u7E7C\\u7E8C\",oauthIncomplete:\"\\u767B\\u5165\\u5C1A\\u672A\\u5B8C\\u6210\\u3002\\u60A8\\u53EF\\u4EE5\\u91CD\\u65B0\\u958B\\u555F\\u8996\\u7A97\\u6216\\u9078\\u64C7\\u5176\\u4ED6\\u65B9\\u5F0F\\u3002\",oauthReopen:\"\\u91CD\\u65B0\\u958B\\u555F\\u8996\\u7A97\",oauthUnconfirmed:\"\\u66AB\\u6642\\u7121\\u6CD5\\u78BA\\u8A8D\\u767B\\u5165\\u7D50\\u679C\\u3002\\u8ACB\\u5148\\u91CD\\u65B0\\u8F09\\u5165\\u9801\\u9762\\u6AA2\\u67E5\\u767B\\u5165\\u72C0\\u614B\\uFF0C\\u518D\\u6C7A\\u5B9A\\u662F\\u5426\\u91CD\\u8A66\\u3002\",oauthCheckSession:\"\\u91CD\\u65B0\\u8F09\\u5165\\u4E26\\u6AA2\\u67E5\\u767B\\u5165\\u72C0\\u614B\",oauthCancelled:\"\\u5DF2\\u505C\\u6B62\\u7B49\\u5F85\\u767B\\u5165\\u3002\\u82E5\\u6388\\u6B0A\\u8996\\u7A97\\u4ECD\\u7136\\u958B\\u555F\\uFF0C\\u8ACB\\u95DC\\u9589\\u5F8C\\u518D\\u91CD\\u8A66\\u3002\",oauthDenied:\"\\u60A8\\u672A\\u540C\\u610F\\u6388\\u6B0A\\u3002\\u53EF\\u4EE5\\u91CD\\u8A66\\u6216\\u9078\\u64C7\\u5176\\u4ED6\\u767B\\u5165\\u65B9\\u5F0F\\u3002\",oauthBlocked:\"\\u700F\\u89BD\\u5668\\u5C01\\u9396\\u4E86\\u767B\\u5165\\u8996\\u7A97\\u3002\\u8ACB\\u91CD\\u65B0\\u958B\\u555F\\uFF0C\\u6216\\u5728\\u76EE\\u524D\\u9801\\u9762\\u7E7C\\u7E8C\\u3002\",oauthTimedOut:\"\\u767B\\u5165\\u7B49\\u5F85\\u5DF2\\u903E\\u6642\\u3002\\u8ACB\\u91CD\\u65B0\\u958B\\u555F\\u8996\\u7A97\\u518D\\u8A66\\u3002\",oauthFailed:\"\\u672A\\u80FD\\u5B8C\\u6210\\u767B\\u5165\\u3002\\u8ACB\\u91CD\\u8A66\\u6216\\u9078\\u64C7\\u5176\\u4ED6\\u65B9\\u5F0F\\u3002\",oauthFullPage:\"\\u5728\\u76EE\\u524D\\u9801\\u9762\\u7E7C\\u7E8C\",emailEdit:\"\\u4FEE\\u6539\\u96FB\\u5B50\\u90F5\\u4EF6\",emailCooldown:\"{seconds} \\u79D2\\u5F8C\\u91CD\\u65B0\\u50B3\\u9001\",walletRetry:\"\\u9322\\u5305\\u672A\\u958B\\u555F\\uFF1F\\u8ACB\\u91CD\\u8A66\\u6216\\u6383\\u78BC\\u3002\",tryAgain:\"\\u91CD\\u8A66\",signIn:\"\\u767B\\u5165\\u6216\\u5EFA\\u7ACB\\u5E33\\u6236\",signInTo:\"\\u767B\\u5165\\u6216\\u52A0\\u5165 {appName}\",passkeyButton:\"\\u4F7F\\u7528 Passkey \\u7E7C\\u7E8C\",passkeySignIn:\"\\u4F7F\\u7528 Passkey \\u767B\\u5165\",passkeyCreate:\"\\u5EFA\\u7ACB Passkey\",passkeyFirstTime:\"\\u7B2C\\u4E00\\u6B21\\u4F7F\\u7528\\uFF1F\\u5EFA\\u7ACB\\u5E33\\u6236\",passkeyBackToSignIn:\"\\u8FD4\\u56DE\\u767B\\u5165\",passkeyWaiting:\"\\u6B63\\u5728\\u7B49\\u5F85 Passkey\\u2026\",passkeyCreating:\"\\u6B63\\u5728\\u5EFA\\u7ACB Passkey\\u2026\",passkeyNoLocal:\"\\u9019\\u6B21\\u672A\\u5B8C\\u6210 Passkey \\u9A57\\u8B49\\u3002\\u8ACB\\u91CD\\u8A66\\u3001\\u4F7F\\u7528\\u5176\\u4ED6\\u88DD\\u7F6E\\uFF0C\\u6216\\u9078\\u64C7\\u5176\\u4ED6\\u767B\\u5165\\u65B9\\u5F0F\\u3002\",passkeyUseAnotherDevice:\"\\u7528\\u5176\\u4ED6\\u88DD\\u7F6E\\u767B\\u5165\",passkeyCreateInstead:\"\\u7B2C\\u4E00\\u6B21\\u4F7F\\u7528\\uFF1F\\u5EFA\\u7ACB\\u5E33\\u6236\",didWalletButton:\"\\u4F7F\\u7528 DID Wallet \\u7E7C\\u7E8C\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"\\u8ACB\\u4F7F\\u7528 DID Wallet \\u6383\\u78BC\",waitingWallet:\"\\u6B63\\u5728\\u8981\\u6C42\\u9023\\u7DDA\",walletContinue:\"\\u8ACB\\u5728 DID Wallet \\u4E2D\\u7E7C\\u7E8C\\u5B8C\\u6210\\u60A8\\u7684\\u64CD\\u4F5C\",noPasskey:\"\\u672A\\u627E\\u5230\\u5DF2\\u6709 Passkey\\u3002\\u8F38\\u5165\\u540D\\u7A31\\u4E26\\u5EFA\\u7ACB\\u4E00\\u500B\\u3002\",success:\"\\u6210\\u529F\",timeout:\"\\u5DE5\\u4F5C\\u968E\\u6BB5\\u903E\\u6642\\uFF0C\\u8ACB\\u91CD\\u8A66\\u3002\",refreshQR:\"\\u91CD\\u65B0\\u6574\\u7406\",namePlaceholder:\"\\u60A8\\u7684\\u540D\\u5B57\\uFF08\\u9078\\u586B\\uFF09\",or:\"\\u6216\",emailPlaceholder:\"\\u96FB\\u5B50\\u90F5\\u4EF6\\u5730\\u5740\",emailButton:\"\\u96FB\\u5B50\\u90F5\\u4EF6\",passkeyUnsupported:\"\\u60A8\\u7684\\u700F\\u89BD\\u5668\\u4E0D\\u652F\\u63F4 Passkey \\u8A8D\\u8B49\\u3002\",connecting:\"\\u9023\\u7DDA\\u4E2D...\",verifying:\"\\u9A57\\u8B49\\u4E2D...\",openInWallet:\"\\u5728 DID Wallet \\u4E2D\\u958B\\u555F\",authFailed:\"\\u8A8D\\u8B49\\u5931\\u6557\",registrationFailed:\"\\u8A3B\\u518A\\u5931\\u6557\",passkeySetupFailed:\"Passkey \\u8A2D\\u5B9A\\u5931\\u6557\",accessDenied:\"\\u5B58\\u53D6\\u88AB\\u62D2\\u7D55\\uFF1A\\u60A8\\u7684\\u5E33\\u865F\\u7121\\u6B0A\\u767B\\u5165\\u6B64\\u7DB2\\u7AD9\\u3002\",regClosed:\"\\u8A3B\\u518A\\u9700\\u8981\\u9080\\u8ACB\\u3002\",federatedBy:\"\\u8A8D\\u8B49\\u670D\\u52D9\\u7531 {masterName} \\u63D0\\u4F9B\",securedBy:\"\\u7531 DID Connect \\u63D0\\u4F9B\\u5B89\\u5168\\u4FDD\\u969C\",privacy:\"\\u96B1\\u79C1\",terms:\"\\u689D\\u6B3E\",back:\"\\u8FD4\\u56DE\",cancel:\"\\u53D6\\u6D88\",scanTitle:\"\\u4F7F\\u7528 DID Wallet \\u6383\\u78BC\",emailTitle:\"\\u4F7F\\u7528\\u96FB\\u5B50\\u90F5\\u4EF6\\u7E7C\\u7E8C\",emailSubmit:\"\\u50B3\\u9001\\u9A57\\u8B49\\u78BC\",emailSending:\"\\u6B63\\u5728\\u50B3\\u9001\\u9A57\\u8B49\\u78BC...\",emailSent:\"\\u9A57\\u8B49\\u78BC\\u5DF2\\u50B3\\u9001\\u81F3 {email}\",emailCodePlaceholder:\"8 \\u4F4D\\u6578\\u9A57\\u8B49\\u78BC\",emailVerify:\"\\u9A57\\u8B49\",emailResend:\"\\u91CD\\u65B0\\u50B3\\u9001\",emailInvalid:\"\\u8ACB\\u8F38\\u5165\\u6709\\u6548\\u7684\\u96FB\\u5B50\\u90F5\\u4EF6\\u5730\\u5740\\u3002\",emailCodeInvalid:\"\\u8ACB\\u8F38\\u5165 8 \\u4F4D\\u6578\\u9A57\\u8B49\\u78BC\\u3002\"},ja:{emailExplanation:\"\\u78BA\\u8A8D\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\\u3057\\u307E\\u3059\\u3002\\u30D1\\u30B9\\u30EF\\u30FC\\u30C9\\u306F\\u4E0D\\u8981\\u3067\\u3059\\u3002\",otherMethods:\"\\u4ED6\\u306E\\u30ED\\u30B0\\u30A4\\u30F3\\u65B9\\u6CD5\",passkeyCreateAccount:\"Passkey \\u3067\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u4F5C\\u6210\",lastUsed:\"\\u524D\\u56DE\\u4F7F\\u7528\",passkeyExplanation:\"\\u6307\\u7D0B\\u3001\\u9854\\u8A8D\\u8A3C\\u3001\\u307E\\u305F\\u306F\\u30C7\\u30D0\\u30A4\\u30B9\\u306E\\u30ED\\u30C3\\u30AF\\u89E3\\u9664\\u3067\\u65B0\\u3057\\u3044\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u4F5C\\u6210\\u3057\\u307E\\u3059\\u3002\\u30D1\\u30B9\\u30EF\\u30FC\\u30C9\\u306F\\u4E0D\\u8981\\u3067\\u3059\\u3002\\u30C7\\u30D0\\u30A4\\u30B9\\u304C Passkey \\u306E\\u4FDD\\u5B58\\u3092\\u6C42\\u3081\\u307E\\u3059\\u3002\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u304A\\u6301\\u3061\\u3067\\u3059\\u304B\\uFF1F\\u30ED\\u30B0\\u30A4\\u30F3\\u306B\\u623B\\u3063\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",continueWith:\"{provider} \\u3067\\u7D9A\\u3051\\u308B\",oauthWaiting:\"{provider} \\u306E\\u30A6\\u30A3\\u30F3\\u30C9\\u30A6\\u3067\\u7D9A\\u3051\\u3066\\u304F\\u3060\\u3055\\u3044\",oauthIncomplete:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u306F\\u307E\\u3060\\u5B8C\\u4E86\\u3057\\u3066\\u3044\\u307E\\u305B\\u3093\\u3002\\u30A6\\u30A3\\u30F3\\u30C9\\u30A6\\u3092\\u958B\\u304D\\u76F4\\u3059\\u304B\\u3001\\u5225\\u306E\\u65B9\\u6CD5\\u3092\\u9078\\u3093\\u3067\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthReopen:\"\\u30A6\\u30A3\\u30F3\\u30C9\\u30A6\\u3092\\u958B\\u304D\\u76F4\\u3059\",oauthUnconfirmed:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u7D50\\u679C\\u3092\\u78BA\\u8A8D\\u3067\\u304D\\u307E\\u305B\\u3093\\u3067\\u3057\\u305F\\u3002\\u518D\\u8A66\\u884C\\u306E\\u524D\\u306B\\u30DA\\u30FC\\u30B8\\u3092\\u518D\\u8AAD\\u307F\\u8FBC\\u307F\\u3057\\u3066\\u72B6\\u614B\\u3092\\u78BA\\u8A8D\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthCheckSession:\"\\u518D\\u8AAD\\u307F\\u8FBC\\u307F\\u3057\\u3066\\u30ED\\u30B0\\u30A4\\u30F3\\u3092\\u78BA\\u8A8D\",oauthCancelled:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u306E\\u5F85\\u6A5F\\u3092\\u7D42\\u4E86\\u3057\\u307E\\u3057\\u305F\\u3002\\u8A8D\\u8A3C\\u30A6\\u30A3\\u30F3\\u30C9\\u30A6\\u304C\\u958B\\u3044\\u3066\\u3044\\u308B\\u5834\\u5408\\u306F\\u3001\\u9589\\u3058\\u3066\\u304B\\u3089\\u518D\\u8A66\\u884C\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthDenied:\"\\u8A8D\\u8A3C\\u304C\\u8A31\\u53EF\\u3055\\u308C\\u307E\\u305B\\u3093\\u3067\\u3057\\u305F\\u3002\\u518D\\u8A66\\u884C\\u3059\\u308B\\u304B\\u3001\\u5225\\u306E\\u65B9\\u6CD5\\u3092\\u9078\\u3093\\u3067\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthBlocked:\"\\u30D6\\u30E9\\u30A6\\u30B6\\u304C\\u30ED\\u30B0\\u30A4\\u30F3\\u753B\\u9762\\u3092\\u30D6\\u30ED\\u30C3\\u30AF\\u3057\\u307E\\u3057\\u305F\\u3002\\u958B\\u304D\\u76F4\\u3059\\u304B\\u3001\\u3053\\u306E\\u30DA\\u30FC\\u30B8\\u3067\\u7D9A\\u3051\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthTimedOut:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u304C\\u30BF\\u30A4\\u30E0\\u30A2\\u30A6\\u30C8\\u3057\\u307E\\u3057\\u305F\\u3002\\u30A6\\u30A3\\u30F3\\u30C9\\u30A6\\u3092\\u958B\\u304D\\u76F4\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthFailed:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u3092\\u5B8C\\u4E86\\u3067\\u304D\\u307E\\u305B\\u3093\\u3067\\u3057\\u305F\\u3002\\u518D\\u8A66\\u884C\\u3059\\u308B\\u304B\\u3001\\u5225\\u306E\\u65B9\\u6CD5\\u3092\\u9078\\u3093\\u3067\\u304F\\u3060\\u3055\\u3044\\u3002\",oauthFullPage:\"\\u3053\\u306E\\u30DA\\u30FC\\u30B8\\u3067\\u7D9A\\u3051\\u308B\",emailEdit:\"\\u30E1\\u30FC\\u30EB\\u30A2\\u30C9\\u30EC\\u30B9\\u3092\\u5909\\u66F4\",emailCooldown:\"{seconds} \\u79D2\\u5F8C\\u306B\\u518D\\u9001\\u4FE1\",walletRetry:\"\\u30A6\\u30A9\\u30EC\\u30C3\\u30C8\\u304C\\u958B\\u304B\\u306A\\u3044\\u5834\\u5408\\u306F\\u3001\\u518D\\u8A66\\u884C\\u3059\\u308B\\u304B QR \\u30B3\\u30FC\\u30C9\\u3092\\u30B9\\u30AD\\u30E3\\u30F3\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",tryAgain:\"\\u518D\\u8A66\\u884C\",signIn:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u307E\\u305F\\u306F\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u4F5C\\u6210\",signInTo:\"{appName} \\u306B\\u30ED\\u30B0\\u30A4\\u30F3\\u307E\\u305F\\u306F\\u53C2\\u52A0\",passkeyButton:\"Passkey \\u3067\\u7D9A\\u3051\\u308B\",passkeySignIn:\"Passkey \\u3067\\u30ED\\u30B0\\u30A4\\u30F3\",passkeyCreate:\"Passkey \\u3092\\u4F5C\\u6210\",passkeyFirstTime:\"\\u521D\\u3081\\u3066\\u3067\\u3059\\u304B\\uFF1F\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u4F5C\\u6210\",passkeyBackToSignIn:\"\\u30ED\\u30B0\\u30A4\\u30F3\\u306B\\u623B\\u308B\",passkeyWaiting:\"Passkey \\u3092\\u5F85\\u3063\\u3066\\u3044\\u307E\\u3059\\u2026\",passkeyCreating:\"Passkey \\u3092\\u4F5C\\u6210\\u3057\\u3066\\u3044\\u307E\\u3059\\u2026\",passkeyNoLocal:\"\\u4ECA\\u56DE\\u306F Passkey \\u306E\\u78BA\\u8A8D\\u304C\\u5B8C\\u4E86\\u3057\\u307E\\u305B\\u3093\\u3067\\u3057\\u305F\\u3002\\u518D\\u8A66\\u884C\\u3059\\u308B\\u304B\\u3001\\u5225\\u306E\\u30C7\\u30D0\\u30A4\\u30B9\\u3092\\u4F7F\\u3046\\u304B\\u3001\\u5225\\u306E\\u65B9\\u6CD5\\u3092\\u9078\\u3093\\u3067\\u304F\\u3060\\u3055\\u3044\\u3002\",passkeyUseAnotherDevice:\"\\u5225\\u306E\\u30C7\\u30D0\\u30A4\\u30B9\\u3092\\u4F7F\\u7528\",passkeyCreateInstead:\"\\u521D\\u3081\\u3066\\u3067\\u3059\\u304B\\uFF1F\\u30A2\\u30AB\\u30A6\\u30F3\\u30C8\\u3092\\u4F5C\\u6210\",didWalletButton:\"DID Wallet \\u3067\\u7D9A\\u3051\\u308B\",didWalletButtonShort:\"DID Wallet\",scanWithWallet:\"DID Wallet \\u3067\\u30B9\\u30AD\\u30E3\\u30F3\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\",waitingWallet:\"\\u63A5\\u7D9A\\u3092\\u8981\\u6C42\\u3057\\u3066\\u3044\\u307E\\u3059\",walletContinue:\"DID Wallet \\u3067\\u64CD\\u4F5C\\u3092\\u7D9A\\u3051\\u3066\\u304F\\u3060\\u3055\\u3044\",noPasskey:\"\\u65E2\\u5B58\\u306E Passkey \\u304C\\u898B\\u3064\\u304B\\u308A\\u307E\\u305B\\u3093\\u3002\\u540D\\u524D\\u3092\\u5165\\u529B\\u3057\\u3066\\u4F5C\\u6210\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",success:\"\\u6210\\u529F\\u3057\\u307E\\u3057\\u305F\",timeout:\"\\u30BB\\u30C3\\u30B7\\u30E7\\u30F3\\u304C\\u30BF\\u30A4\\u30E0\\u30A2\\u30A6\\u30C8\\u3057\\u307E\\u3057\\u305F\\u3002\\u3082\\u3046\\u4E00\\u5EA6\\u304A\\u8A66\\u3057\\u304F\\u3060\\u3055\\u3044\\u3002\",refreshQR:\"\\u66F4\\u65B0\",namePlaceholder:\"\\u304A\\u540D\\u524D\\uFF08\\u4EFB\\u610F\\uFF09\",or:\"\\u307E\\u305F\\u306F\",emailPlaceholder:\"\\u30E1\\u30FC\\u30EB\\u30A2\\u30C9\\u30EC\\u30B9\",emailButton:\"\\u30E1\\u30FC\\u30EB\",passkeyUnsupported:\"\\u304A\\u4F7F\\u3044\\u306E\\u30D6\\u30E9\\u30A6\\u30B6\\u30FC\\u306F Passkey \\u8A8D\\u8A3C\\u3092\\u30B5\\u30DD\\u30FC\\u30C8\\u3057\\u3066\\u3044\\u307E\\u305B\\u3093\\u3002\",connecting:\"\\u63A5\\u7D9A\\u3057\\u3066\\u3044\\u307E\\u3059...\",verifying:\"\\u78BA\\u8A8D\\u3057\\u3066\\u3044\\u307E\\u3059...\",openInWallet:\"DID Wallet \\u3067\\u958B\\u304F\",authFailed:\"\\u8A8D\\u8A3C\\u306B\\u5931\\u6557\\u3057\\u307E\\u3057\\u305F\",registrationFailed:\"\\u767B\\u9332\\u306B\\u5931\\u6557\\u3057\\u307E\\u3057\\u305F\",passkeySetupFailed:\"Passkey \\u306E\\u8A2D\\u5B9A\\u306B\\u5931\\u6557\\u3057\\u307E\\u3057\\u305F\",accessDenied:\"\\u30A2\\u30AF\\u30BB\\u30B9\\u304C\\u62D2\\u5426\\u3055\\u308C\\u307E\\u3057\\u305F\\uFF1A\\u3053\\u306E\\u30B5\\u30A4\\u30C8\\u306B\\u30ED\\u30B0\\u30A4\\u30F3\\u3059\\u308B\\u6A29\\u9650\\u304C\\u3042\\u308A\\u307E\\u305B\\u3093\\u3002\",regClosed:\"\\u767B\\u9332\\u306B\\u306F\\u62DB\\u5F85\\u304C\\u5FC5\\u8981\\u3067\\u3059\\u3002\",federatedBy:\"\\u8A8D\\u8A3C\\u30B5\\u30FC\\u30D3\\u30B9\\u306F {masterName} \\u304C\\u63D0\\u4F9B\\u3057\\u3066\\u3044\\u307E\\u3059\",securedBy:\"DID Connect \\u306B\\u3088\\u308A\\u4FDD\\u8B77\\u3055\\u308C\\u3066\\u3044\\u307E\\u3059\",privacy:\"\\u30D7\\u30E9\\u30A4\\u30D0\\u30B7\\u30FC\",terms:\"\\u5229\\u7528\\u898F\\u7D04\",back:\"\\u623B\\u308B\",cancel:\"\\u30AD\\u30E3\\u30F3\\u30BB\\u30EB\",scanTitle:\"DID Wallet \\u3067\\u30B9\\u30AD\\u30E3\\u30F3\",emailTitle:\"\\u30E1\\u30FC\\u30EB\\u3067\\u7D9A\\u3051\\u308B\",emailSubmit:\"\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\",emailSending:\"\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\\u3057\\u3066\\u3044\\u307E\\u3059...\",emailSent:\"{email} \\u306B 8 \\u6841\\u306E\\u30B3\\u30FC\\u30C9\\u3092\\u9001\\u4FE1\\u3057\\u307E\\u3057\\u305F\",emailCodePlaceholder:\"8 \\u6841\\u306E\\u30B3\\u30FC\\u30C9\",emailVerify:\"\\u78BA\\u8A8D\",emailResend:\"\\u30B3\\u30FC\\u30C9\\u3092\\u518D\\u9001\\u4FE1\",emailInvalid:\"\\u6709\\u52B9\\u306A\\u30E1\\u30FC\\u30EB\\u30A2\\u30C9\\u30EC\\u30B9\\u3092\\u5165\\u529B\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\",emailCodeInvalid:\"8 \\u6841\\u306E\\u30B3\\u30FC\\u30C9\\u3092\\u5165\\u529B\\u3057\\u3066\\u304F\\u3060\\u3055\\u3044\\u3002\"}},pe=[{code:\"en\",label:\"English\"},{code:\"zh\",label:\"\\u4E2D\\u6587\"}];function b(t,e,r){let n=e&&he[e]?e:\"en\",i=he[n][t]??he.en[t]??t;if(r)for(let[a,s]of Object.entries(r))i=i.replace(new RegExp(`\\\\{${a}\\\\}`,\"g\"),s);return i}var fe='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M3 20v-2.8q0-.85.438-1.562T4.6 14.55q1.55-.775 3.15-1.162T11 13q.5 0 1 .038t1 .112q-.1 1.45.525 2.738T15.35 18v2zm16 3l-1.5-1.5v-4.65q-1.1-.325-1.8-1.237T15 13.5q0-1.45 1.025-2.475T18.5 10t2.475 1.025T22 13.5q0 1.125-.638 2t-1.612 1.25L21 18l-1.5 1.5L21 21zm-8-11q-1.65 0-2.825-1.175T7 8t1.175-2.825T11 4t2.825 1.175T15 8t-1.175 2.825T11 12m7.5 2q.425 0 .713-.288T19.5 13t-.288-.712T18.5 12t-.712.288T17.5 13t.288.713t.712.287\"/></svg>',ve='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"3\" fill=\"#4598FA\"/><rect x=\"3\" y=\"6\" width=\"18\" height=\"12\" rx=\"2\" fill=\"white\" opacity=\"0.9\"/><rect x=\"0\" y=\"14\" width=\"24\" height=\"10\" rx=\"0\" fill=\"url(#dw_g)\"/><path d=\"M5.5 9.5h4.5c.3 0 .5.2.5.5v2.5c0 .3-.2.5-.5.5H5.5c-.3 0-.5-.2-.5-.5V10c0-.3.2-.5.5-.5z\" fill=\"#4598FA\"/><defs><linearGradient id=\"dw_g\" x1=\"12\" y1=\"14\" x2=\"12\" y2=\"24\" gradientUnits=\"userSpaceOnUse\"><stop stop-color=\"#77B2F6\"/><stop offset=\"1\" stop-color=\"#4598FA\"/></linearGradient></defs></svg>',qe='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M22 7.535V17a3 3 0 0 1-2.824 2.995L19 20H5a3 3 0 0 1-2.995-2.824L2 17V7.535l9.445 6.297l.116.066a1 1 0 0 0 .878 0l.116-.066z\"/><path fill=\"currentColor\" d=\"M19 4c1.08 0 2.027.57 2.555 1.427L12 11.797l-9.555-6.37a2.999 2.999 0 0 1 2.354-1.42L5 4z\"/></svg>',Ve='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M12 1L3 5v6c0 5.55 3.84 10.74 9 12c5.16-1.26 9-6.45 9-12V5zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11z\"/></svg>',ke='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M20 11H7.83l5.59-5.59L12 4l-8 8l8 8l1.41-1.41L7.83 13H20z\"/></svg>',je={google:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 262\"><path fill=\"#4285F4\" d=\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622l38.755 30.023l2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\"/><path fill=\"#34A853\" d=\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055c-34.523 0-63.824-22.773-74.269-54.25l-1.531.13l-40.298 31.187l-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\"/><path fill=\"#FBBC05\" d=\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82c0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602z\"/><path fill=\"#EB4335\" d=\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0C79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\"/></svg>',github:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 250\" fill=\"currentColor\"><path d=\"M128.001 0C57.317 0 0 57.307 0 128.001c0 56.554 36.676 104.535 87.535 121.46c6.397 1.185 8.746-2.777 8.746-6.158c0-3.052-.12-13.135-.174-23.83c-35.61 7.742-43.124-15.103-43.124-15.103c-5.823-14.795-14.213-18.73-14.213-18.73c-11.613-7.944.876-7.78.876-7.78c12.853.902 19.621 13.19 19.621 13.19c11.417 19.568 29.945 13.911 37.249 10.64c1.149-8.272 4.466-13.92 8.127-17.116c-28.431-3.236-58.318-14.212-58.318-63.258c0-13.975 5-25.394 13.188-34.358c-1.329-3.224-5.71-16.242 1.24-33.874c0 0 10.749-3.44 35.21 13.121c10.21-2.836 21.16-4.258 32.038-4.307c10.878.049 21.837 1.47 32.066 4.307c24.431-16.56 35.165-13.12 35.165-13.12c6.967 17.63 2.584 30.65 1.255 33.873c8.207 8.964 13.173 20.383 13.173 34.358c0 49.163-29.944 59.988-58.447 63.157c4.591 3.972 8.682 11.762 8.682 23.704c0 17.126-.148 30.91-.148 35.126c0 3.407 2.304 7.398 8.792 6.14C219.37 232.5 256 184.537 256 128.002C256 57.307 198.691 0 128.001 0\"/></svg>',apple:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 315\" fill=\"currentColor\"><path d=\"M213.803 167.03c.442 47.58 41.74 63.413 42.197 63.615c-.35 1.116-6.599 22.563-21.757 44.716c-13.104 19.153-26.705 38.235-48.13 38.63c-21.05.388-27.82-12.483-51.888-12.483c-24.061 0-31.582 12.088-51.51 12.871c-20.68.783-36.428-20.71-49.64-39.793c-27-39.033-47.633-110.3-19.928-158.406c13.763-23.89 38.36-39.017 65.056-39.405c20.307-.388 39.475 13.675 51.889 13.675c12.406 0 35.699-16.895 60.186-14.414c10.25.427 39.026 4.14 57.503 31.186c-1.49.923-34.335 20.044-33.978 59.808M174.24 50.199c10.98-13.29 18.369-31.79 16.353-50.199c-15.826.636-34.962 10.546-46.314 23.828c-10.173 11.763-19.082 30.589-16.678 48.633c17.64 1.365 35.66-8.964 46.639-22.262\"/></svg>',twitter:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 256\" fill=\"currentColor\"><path d=\"M149.079 108.399L242.33 0h-22.098l-80.97 94.12L74.59 0H0l97.796 142.328L0 256h22.1l85.507-99.395L175.905 256h74.59L149.073 108.399zM118.81 143.58l-9.909-14.172l-78.84-112.773h33.943l63.625 91.011l9.909 14.173l82.705 118.3H186.3l-67.49-96.533z\"/></svg>',auth0:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 256\"><path fill=\"#EB5424\" d=\"M203.97 200.38L167.47 88l-39.5 112.38h75.98zm0-144.76L167.47 168l75.97-26.16l19.76-60.82c6.64-20.4-1.94-42.72-21.18-52.76l-38.06 27.36zM52.03 55.62L88.54 168l39.5-112.38H52.02zM52.03 200.38L88.54 88L12.56 114.16l-5.92 18.2c-6.64 20.4 1.94 42.72 21.18 52.76l24.2-17.38l.01.01v-.01l-.01.01.01-.37z\"/></svg>',facebook:'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 256 256\"><path fill=\"#1877F2\" d=\"M256 128C256 57.308 198.692 0 128 0S0 57.308 0 128c0 63.888 46.808 116.843 108 126.445V165H75.5v-37H108V99.8c0-32.08 19.11-49.8 48.348-49.8C170.352 50 185 52.5 185 52.5V84h-16.14C152.959 84 148 93.867 148 103.99V128h35.5l-5.675 37H148v89.445c61.192-9.602 108-62.556 108-126.445\"/></svg>'},Be='<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\"><path fill=\"currentColor\" d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93c0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41c0 2.08-.8 3.97-2.1 5.39\"/></svg>';function Ye(t){return je[t.toLowerCase()]??\"\"}var Z=function(t,e){let i=t,a=re[e],s=null,o=0,c=null,u=[],f={},p=function(d,m){o=i*4+17,s=(function(h){let g=new Array(h);for(let y=0;y<h;y+=1){g[y]=new Array(h);for(let x=0;x<h;x+=1)g[y][x]=null}return g})(o),l(0,0),l(o-7,0),l(0,o-7),D(),v(),F(d,m),i>=7&&C(d),c==null&&(c=W(i,a,u)),B(c,m)},l=function(d,m){for(let h=-1;h<=7;h+=1)if(!(d+h<=-1||o<=d+h))for(let g=-1;g<=7;g+=1)m+g<=-1||o<=m+g||(0<=h&&h<=6&&(g==0||g==6)||0<=g&&g<=6&&(h==0||h==6)||2<=h&&h<=4&&2<=g&&g<=4?s[d+h][m+g]=!0:s[d+h][m+g]=!1)},E=function(){let d=0,m=0;for(let h=0;h<8;h+=1){p(!0,h);let g=Q.getLostPoint(f);(h==0||d>g)&&(d=g,m=h)}return m},v=function(){for(let d=8;d<o-8;d+=1)s[d][6]==null&&(s[d][6]=d%2==0);for(let d=8;d<o-8;d+=1)s[6][d]==null&&(s[6][d]=d%2==0)},D=function(){let d=Q.getPatternPosition(i);for(let m=0;m<d.length;m+=1)for(let h=0;h<d.length;h+=1){let g=d[m],y=d[h];if(s[g][y]==null)for(let x=-2;x<=2;x+=1)for(let w=-2;w<=2;w+=1)x==-2||x==2||w==-2||w==2||x==0&&w==0?s[g+x][y+w]=!0:s[g+x][y+w]=!1}},C=function(d){let m=Q.getBCHTypeNumber(i);for(let h=0;h<18;h+=1){let g=!d&&(m>>h&1)==1;s[Math.floor(h/3)][h%3+o-8-3]=g}for(let h=0;h<18;h+=1){let g=!d&&(m>>h&1)==1;s[h%3+o-8-3][Math.floor(h/3)]=g}},F=function(d,m){let h=a<<3|m,g=Q.getBCHTypeInfo(h);for(let y=0;y<15;y+=1){let x=!d&&(g>>y&1)==1;y<6?s[y][8]=x:y<8?s[y+1][8]=x:s[o-15+y][8]=x}for(let y=0;y<15;y+=1){let x=!d&&(g>>y&1)==1;y<8?s[8][o-y-1]=x:y<9?s[8][15-y-1+1]=x:s[8][15-y-1]=x}s[o-8][8]=!d},B=function(d,m){let h=-1,g=o-1,y=7,x=0,w=Q.getMaskFunction(m);for(let T=o-1;T>0;T-=2)for(T==6&&(T-=1);;){for(let S=0;S<2;S+=1)if(s[g][T-S]==null){let P=!1;x<d.length&&(P=(d[x]>>>y&1)==1),w(g,T-S)&&(P=!P),s[g][T-S]=P,y-=1,y==-1&&(x+=1,y=7)}if(g+=h,g<0||o<=g){g-=h,h=-h;break}}},R=function(d,m){let h=0,g=0,y=0,x=new Array(m.length),w=new Array(m.length);for(let k=0;k<m.length;k+=1){let N=m[k].dataCount,A=m[k].totalCount-N;g=Math.max(g,N),y=Math.max(y,A),x[k]=new Array(N);for(let j=0;j<x[k].length;j+=1)x[k][j]=255&d.getBuffer()[j+h];h+=N;let z=Q.getErrorCorrectPolynomial(A),V=ie(x[k],z.getLength()-1).mod(z);w[k]=new Array(z.getLength()-1);for(let j=0;j<w[k].length;j+=1){let ae=j+V.getLength()-w[k].length;w[k][j]=ae>=0?V.getAt(ae):0}}let T=0;for(let k=0;k<m.length;k+=1)T+=m[k].totalCount;let S=new Array(T),P=0;for(let k=0;k<g;k+=1)for(let N=0;N<m.length;N+=1)k<x[N].length&&(S[P]=x[N][k],P+=1);for(let k=0;k<y;k+=1)for(let N=0;N<m.length;N+=1)k<w[N].length&&(S[P]=w[N][k],P+=1);return S},W=function(d,m,h){let g=Ae.getRSBlocks(d,m),y=De();for(let w=0;w<h.length;w+=1){let T=h[w];y.put(T.getMode(),4),y.put(T.getLength(),Q.getLengthInBits(T.getMode(),d)),T.write(y)}let x=0;for(let w=0;w<g.length;w+=1)x+=g[w].dataCount;if(y.getLengthInBits()>x*8)throw\"code length overflow. (\"+y.getLengthInBits()+\">\"+x*8+\")\";for(y.getLengthInBits()+4<=x*8&&y.put(0,4);y.getLengthInBits()%8!=0;)y.putBit(!1);for(;!(y.getLengthInBits()>=x*8||(y.put(236,8),y.getLengthInBits()>=x*8));)y.put(17,8);return R(y,g)};f.addData=function(d,m){m=m||\"Byte\";let h=null;switch(m){case\"Numeric\":h=Qe(d);break;case\"Alphanumeric\":h=Ge(d);break;case\"Byte\":h=Je(d);break;case\"Kanji\":h=Xe(d);break;default:throw\"mode:\"+m}u.push(h),c=null},f.isDark=function(d,m){if(d<0||o<=d||m<0||o<=m)throw d+\",\"+m;return s[d][m]},f.getModuleCount=function(){return o},f.make=function(){if(i<1){let d=1;for(;d<40;d++){let m=Ae.getRSBlocks(d,a),h=De();for(let y=0;y<u.length;y++){let x=u[y];h.put(x.getMode(),4),h.put(x.getLength(),Q.getLengthInBits(x.getMode(),d)),x.write(h)}let g=0;for(let y=0;y<m.length;y++)g+=m[y].dataCount;if(h.getLengthInBits()<=g*8)break}i=d}p(!1,E())},f.createTableTag=function(d,m){d=d||2,m=typeof m>\"u\"?d*4:m;let h=\"\";h+='<table style=\"',h+=\" border-width: 0px; border-style: none;\",h+=\" border-collapse: collapse;\",h+=\" padding: 0px; margin: \"+m+\"px;\",h+='\">',h+=\"<tbody>\";for(let g=0;g<f.getModuleCount();g+=1){h+=\"<tr>\";for(let y=0;y<f.getModuleCount();y+=1)h+='<td style=\"',h+=\" border-width: 0px; border-style: none;\",h+=\" border-collapse: collapse;\",h+=\" padding: 0px; margin: 0px;\",h+=\" width: \"+d+\"px;\",h+=\" height: \"+d+\"px;\",h+=\" background-color: \",h+=f.isDark(g,y)?\"#000000\":\"#ffffff\",h+=\";\",h+='\"/>';h+=\"</tr>\"}return h+=\"</tbody>\",h+=\"</table>\",h},f.createSvgTag=function(d,m,h,g){let y={};typeof arguments[0]==\"object\"&&(y=arguments[0],d=y.cellSize,m=y.margin,h=y.alt,g=y.title),d=d||2,m=typeof m>\"u\"?d*4:m,h=typeof h==\"string\"?{text:h}:h||{},h.text=h.text||null,h.id=h.text?h.id||\"qrcode-description\":null,g=typeof g==\"string\"?{text:g}:g||{},g.text=g.text||null,g.id=g.text?g.id||\"qrcode-title\":null;let x=f.getModuleCount()*d+m*2,w,T,S,P,k=\"\",N;for(N=\"l\"+d+\",0 0,\"+d+\" -\"+d+\",0 0,-\"+d+\"z \",k+='<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\"',k+=y.scalable?\"\":' width=\"'+x+'px\" height=\"'+x+'px\"',k+=' viewBox=\"0 0 '+x+\" \"+x+'\" ',k+=' preserveAspectRatio=\"xMinYMin meet\"',k+=g.text||h.text?' role=\"img\" aria-labelledby=\"'+L([g.id,h.id].join(\" \").trim())+'\"':\"\",k+=\">\",k+=g.text?'<title id=\"'+L(g.id)+'\">'+L(g.text)+\"</title>\":\"\",k+=h.text?'<description id=\"'+L(h.id)+'\">'+L(h.text)+\"</description>\":\"\",k+='<rect width=\"100%\" height=\"100%\" fill=\"white\" cx=\"0\" cy=\"0\"/>',k+='<path d=\"',S=0;S<f.getModuleCount();S+=1)for(P=S*d+m,w=0;w<f.getModuleCount();w+=1)f.isDark(S,w)&&(T=w*d+m,k+=\"M\"+T+\",\"+P+N);return k+='\" stroke=\"transparent\" fill=\"black\"/>',k+=\"</svg>\",k},f.createDataURL=function(d,m){d=d||2,m=typeof m>\"u\"?d*4:m;let h=f.getModuleCount()*d+m*2,g=m,y=h-m;return nt(h,h,function(x,w){if(g<=x&&x<y&&g<=w&&w<y){let T=Math.floor((x-g)/d),S=Math.floor((w-g)/d);return f.isDark(S,T)?0:1}else return 1})},f.createImgTag=function(d,m,h){d=d||2,m=typeof m>\"u\"?d*4:m;let g=f.getModuleCount()*d+m*2,y=\"\";return y+=\"<img\",y+=' src=\"',y+=f.createDataURL(d,m),y+='\"',y+=' width=\"',y+=g,y+='\"',y+=' height=\"',y+=g,y+='\"',h&&(y+=' alt=\"',y+=L(h),y+='\"'),y+=\"/>\",y};let L=function(d){let m=\"\";for(let h=0;h<d.length;h+=1){let g=d.charAt(h);switch(g){case\"<\":m+=\"&lt;\";break;case\">\":m+=\"&gt;\";break;case\"&\":m+=\"&amp;\";break;case'\"':m+=\"&quot;\";break;default:m+=g;break}}return m},I=function(d){d=typeof d>\"u\"?2:d;let h=f.getModuleCount()*1+d*2,g=d,y=h-d,x,w,T,S,P,k={\"\\u2588\\u2588\":\"\\u2588\",\"\\u2588 \":\"\\u2580\",\" \\u2588\":\"\\u2584\",\" \":\" \"},N={\"\\u2588\\u2588\":\"\\u2580\",\"\\u2588 \":\"\\u2580\",\" \\u2588\":\" \",\" \":\" \"},A=\"\";for(x=0;x<h;x+=2){for(T=Math.floor((x-g)/1),S=Math.floor((x+1-g)/1),w=0;w<h;w+=1)P=\"\\u2588\",g<=w&&w<y&&g<=x&&x<y&&f.isDark(T,Math.floor((w-g)/1))&&(P=\" \"),g<=w&&w<y&&g<=x+1&&x+1<y&&f.isDark(S,Math.floor((w-g)/1))?P+=\" \":P+=\"\\u2588\",A+=d<1&&x+1>=y?N[P]:k[P];A+=`\n`}return h%2&&d>0?A.substring(0,A.length-h-1)+Array(h+1).join(\"\\u2580\"):A.substring(0,A.length-1)};return f.createASCII=function(d,m){if(d=d||1,d<2)return I(m);d-=1,m=typeof m>\"u\"?d*2:m;let h=f.getModuleCount()*d+m*2,g=m,y=h-m,x,w,T,S,P=Array(d+1).join(\"\\u2588\\u2588\"),k=Array(d+1).join(\" \"),N=\"\",A=\"\";for(x=0;x<h;x+=1){for(T=Math.floor((x-g)/d),A=\"\",w=0;w<h;w+=1)S=1,g<=w&&w<y&&g<=x&&x<y&&f.isDark(T,Math.floor((w-g)/d))&&(S=0),A+=S?P:k;for(T=0;T<d;T+=1)N+=A+`\n`}return N.substring(0,N.length-1)},f.renderTo2dContext=function(d,m){m=m||2;let h=f.getModuleCount();for(let g=0;g<h;g++)for(let y=0;y<h;y++)d.fillStyle=f.isDark(g,y)?\"black\":\"white\",d.fillRect(y*m,g*m,m,m)},f};Z.stringToBytes=function(t){let e=[];for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);e.push(n&255)}return e};Z.createStringToBytes=function(t,e){let r=(function(){let i=et(t),a=function(){let c=i.read();if(c==-1)throw\"eof\";return c},s=0,o={};for(;;){let c=i.read();if(c==-1)break;let u=a(),f=a(),p=a(),l=String.fromCharCode(c<<8|u),E=f<<8|p;o[l]=E,s+=1}if(s!=e)throw s+\" != \"+e;return o})(),n=63;return function(i){let a=[];for(let s=0;s<i.length;s+=1){let o=i.charCodeAt(s);if(o<128)a.push(o);else{let c=r[i.charAt(s)];typeof c==\"number\"?(c&255)==c?a.push(c):(a.push(c>>>8),a.push(c&255)):a.push(n)}}return a}};var H={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},re={L:1,M:0,Q:3,H:2},Y={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Q=(function(){let t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],e=1335,r=7973,n=21522,i={},a=function(s){let o=0;for(;s!=0;)o+=1,s>>>=1;return o};return i.getBCHTypeInfo=function(s){let o=s<<10;for(;a(o)-a(e)>=0;)o^=e<<a(o)-a(e);return(s<<10|o)^n},i.getBCHTypeNumber=function(s){let o=s<<12;for(;a(o)-a(r)>=0;)o^=r<<a(o)-a(r);return s<<12|o},i.getPatternPosition=function(s){return t[s-1]},i.getMaskFunction=function(s){switch(s){case Y.PATTERN000:return function(o,c){return(o+c)%2==0};case Y.PATTERN001:return function(o,c){return o%2==0};case Y.PATTERN010:return function(o,c){return c%3==0};case Y.PATTERN011:return function(o,c){return(o+c)%3==0};case Y.PATTERN100:return function(o,c){return(Math.floor(o/2)+Math.floor(c/3))%2==0};case Y.PATTERN101:return function(o,c){return o*c%2+o*c%3==0};case Y.PATTERN110:return function(o,c){return(o*c%2+o*c%3)%2==0};case Y.PATTERN111:return function(o,c){return(o*c%3+(o+c)%2)%2==0};default:throw\"bad maskPattern:\"+s}},i.getErrorCorrectPolynomial=function(s){let o=ie([1],0);for(let c=0;c<s;c+=1)o=o.multiply(ie([1,G.gexp(c)],0));return o},i.getLengthInBits=function(s,o){if(1<=o&&o<10)switch(s){case H.MODE_NUMBER:return 10;case H.MODE_ALPHA_NUM:return 9;case H.MODE_8BIT_BYTE:return 8;case H.MODE_KANJI:return 8;default:throw\"mode:\"+s}else if(o<27)switch(s){case H.MODE_NUMBER:return 12;case H.MODE_ALPHA_NUM:return 11;case H.MODE_8BIT_BYTE:return 16;case H.MODE_KANJI:return 10;default:throw\"mode:\"+s}else if(o<41)switch(s){case H.MODE_NUMBER:return 14;case H.MODE_ALPHA_NUM:return 13;case H.MODE_8BIT_BYTE:return 16;case H.MODE_KANJI:return 12;default:throw\"mode:\"+s}else throw\"type:\"+o},i.getLostPoint=function(s){let o=s.getModuleCount(),c=0;for(let p=0;p<o;p+=1)for(let l=0;l<o;l+=1){let E=0,v=s.isDark(p,l);for(let D=-1;D<=1;D+=1)if(!(p+D<0||o<=p+D))for(let C=-1;C<=1;C+=1)l+C<0||o<=l+C||D==0&&C==0||v==s.isDark(p+D,l+C)&&(E+=1);E>5&&(c+=3+E-5)}for(let p=0;p<o-1;p+=1)for(let l=0;l<o-1;l+=1){let E=0;s.isDark(p,l)&&(E+=1),s.isDark(p+1,l)&&(E+=1),s.isDark(p,l+1)&&(E+=1),s.isDark(p+1,l+1)&&(E+=1),(E==0||E==4)&&(c+=3)}for(let p=0;p<o;p+=1)for(let l=0;l<o-6;l+=1)s.isDark(p,l)&&!s.isDark(p,l+1)&&s.isDark(p,l+2)&&s.isDark(p,l+3)&&s.isDark(p,l+4)&&!s.isDark(p,l+5)&&s.isDark(p,l+6)&&(c+=40);for(let p=0;p<o;p+=1)for(let l=0;l<o-6;l+=1)s.isDark(l,p)&&!s.isDark(l+1,p)&&s.isDark(l+2,p)&&s.isDark(l+3,p)&&s.isDark(l+4,p)&&!s.isDark(l+5,p)&&s.isDark(l+6,p)&&(c+=40);let u=0;for(let p=0;p<o;p+=1)for(let l=0;l<o;l+=1)s.isDark(l,p)&&(u+=1);let f=Math.abs(100*u/o/o-50)/5;return c+=f*10,c},i})(),G=(function(){let t=new Array(256),e=new Array(256);for(let n=0;n<8;n+=1)t[n]=1<<n;for(let n=8;n<256;n+=1)t[n]=t[n-4]^t[n-5]^t[n-6]^t[n-8];for(let n=0;n<255;n+=1)e[t[n]]=n;let r={};return r.glog=function(n){if(n<1)throw\"glog(\"+n+\")\";return e[n]},r.gexp=function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return t[n]},r})(),ie=function(t,e){if(typeof t.length>\"u\")throw t.length+\"/\"+e;let r=(function(){let i=0;for(;i<t.length&&t[i]==0;)i+=1;let a=new Array(t.length-i+e);for(let s=0;s<t.length-i;s+=1)a[s]=t[s+i];return a})(),n={};return n.getAt=function(i){return r[i]},n.getLength=function(){return r.length},n.multiply=function(i){let a=new Array(n.getLength()+i.getLength()-1);for(let s=0;s<n.getLength();s+=1)for(let o=0;o<i.getLength();o+=1)a[s+o]^=G.gexp(G.glog(n.getAt(s))+G.glog(i.getAt(o)));return ie(a,0)},n.mod=function(i){if(n.getLength()-i.getLength()<0)return n;let a=G.glog(n.getAt(0))-G.glog(i.getAt(0)),s=new Array(n.getLength());for(let o=0;o<n.getLength();o+=1)s[o]=n.getAt(o);for(let o=0;o<i.getLength();o+=1)s[o]^=G.gexp(G.glog(i.getAt(o))+a);return ie(s,0).mod(i)},n},Ae=(function(){let t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e=function(i,a){let s={};return s.totalCount=i,s.dataCount=a,s},r={},n=function(i,a){switch(a){case re.L:return t[(i-1)*4+0];case re.M:return t[(i-1)*4+1];case re.Q:return t[(i-1)*4+2];case re.H:return t[(i-1)*4+3];default:return}};return r.getRSBlocks=function(i,a){let s=n(i,a);if(typeof s>\"u\")throw\"bad rs block @ typeNumber:\"+i+\"/errorCorrectionLevel:\"+a;let o=s.length/3,c=[];for(let u=0;u<o;u+=1){let f=s[u*3+0],p=s[u*3+1],l=s[u*3+2];for(let E=0;E<f;E+=1)c.push(e(p,l))}return c},r})(),De=function(){let t=[],e=0,r={};return r.getBuffer=function(){return t},r.getAt=function(n){let i=Math.floor(n/8);return(t[i]>>>7-n%8&1)==1},r.put=function(n,i){for(let a=0;a<i;a+=1)r.putBit((n>>>i-a-1&1)==1)},r.getLengthInBits=function(){return e},r.putBit=function(n){let i=Math.floor(e/8);t.length<=i&&t.push(0),n&&(t[i]|=128>>>e%8),e+=1},r},Qe=function(t){let e=H.MODE_NUMBER,r=t,n={};n.getMode=function(){return e},n.getLength=function(s){return r.length},n.write=function(s){let o=r,c=0;for(;c+2<o.length;)s.put(i(o.substring(c,c+3)),10),c+=3;c<o.length&&(o.length-c==1?s.put(i(o.substring(c,c+1)),4):o.length-c==2&&s.put(i(o.substring(c,c+2)),7))};let i=function(s){let o=0;for(let c=0;c<s.length;c+=1)o=o*10+a(s.charAt(c));return o},a=function(s){if(\"0\"<=s&&s<=\"9\")return s.charCodeAt(0)-48;throw\"illegal char :\"+s};return n},Ge=function(t){let e=H.MODE_ALPHA_NUM,r=t,n={};n.getMode=function(){return e},n.getLength=function(a){return r.length},n.write=function(a){let s=r,o=0;for(;o+1<s.length;)a.put(i(s.charAt(o))*45+i(s.charAt(o+1)),11),o+=2;o<s.length&&a.put(i(s.charAt(o)),6)};let i=function(a){if(\"0\"<=a&&a<=\"9\")return a.charCodeAt(0)-48;if(\"A\"<=a&&a<=\"Z\")return a.charCodeAt(0)-65+10;switch(a){case\" \":return 36;case\"$\":return 37;case\"%\":return 38;case\"*\":return 39;case\"+\":return 40;case\"-\":return 41;case\".\":return 42;case\"/\":return 43;case\":\":return 44;default:throw\"illegal char :\"+a}};return n},Je=function(t){let e=H.MODE_8BIT_BYTE,r=t,n=Z.stringToBytes(t),i={};return i.getMode=function(){return e},i.getLength=function(a){return n.length},i.write=function(a){for(let s=0;s<n.length;s+=1)a.put(n[s],8)},i},Xe=function(t){let e=H.MODE_KANJI,r=t,n=Z.stringToBytes;(function(s,o){let c=n(s);if(c.length!=2||(c[0]<<8|c[1])!=o)throw\"sjis not supported.\"})(\"\\u53CB\",38726);let i=n(t),a={};return a.getMode=function(){return e},a.getLength=function(s){return~~(i.length/2)},a.write=function(s){let o=i,c=0;for(;c+1<o.length;){let u=(255&o[c])<<8|255&o[c+1];if(33088<=u&&u<=40956)u-=33088;else if(57408<=u&&u<=60351)u-=49472;else throw\"illegal char at \"+(c+1)+\"/\"+u;u=(u>>>8&255)*192+(u&255),s.put(u,13),c+=2}if(c<o.length)throw\"illegal char at \"+(c+1)},a},Ie=function(){let t=[],e={};return e.writeByte=function(r){t.push(r&255)},e.writeShort=function(r){e.writeByte(r),e.writeByte(r>>>8)},e.writeBytes=function(r,n,i){n=n||0,i=i||r.length;for(let a=0;a<i;a+=1)e.writeByte(r[a+n])},e.writeString=function(r){for(let n=0;n<r.length;n+=1)e.writeByte(r.charCodeAt(n))},e.toByteArray=function(){return t},e.toString=function(){let r=\"\";r+=\"[\";for(let n=0;n<t.length;n+=1)n>0&&(r+=\",\"),r+=t[n];return r+=\"]\",r},e},Ze=function(){let t=0,e=0,r=0,n=\"\",i={},a=function(o){n+=String.fromCharCode(s(o&63))},s=function(o){if(o<0)throw\"n:\"+o;if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47;throw\"n:\"+o};return i.writeByte=function(o){for(t=t<<8|o&255,e+=8,r+=1;e>=6;)a(t>>>e-6),e-=6},i.flush=function(){if(e>0&&(a(t<<6-e),t=0,e=0),r%3!=0){let o=3-r%3;for(let c=0;c<o;c+=1)n+=\"=\"}},i.toString=function(){return n},i},et=function(t){let e=t,r=0,n=0,i=0,a={};a.read=function(){for(;i<8;){if(r>=e.length){if(i==0)return-1;throw\"unexpected end of file./\"+i}let c=e.charAt(r);if(r+=1,c==\"=\")return i=0,-1;if(c.match(/^\\s$/))continue;n=n<<6|s(c.charCodeAt(0)),i+=6}let o=n>>>i-8&255;return i-=8,o};let s=function(o){if(65<=o&&o<=90)return o-65;if(97<=o&&o<=122)return o-97+26;if(48<=o&&o<=57)return o-48+52;if(o==43)return 62;if(o==47)return 63;throw\"c:\"+o};return a},tt=function(t,e){let r=t,n=e,i=new Array(t*e),a={};a.setPixel=function(u,f,p){i[f*r+u]=p},a.write=function(u){u.writeString(\"GIF87a\"),u.writeShort(r),u.writeShort(n),u.writeByte(128),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(255),u.writeByte(255),u.writeByte(255),u.writeString(\",\"),u.writeShort(0),u.writeShort(0),u.writeShort(r),u.writeShort(n),u.writeByte(0);let f=2,p=o(f);u.writeByte(f);let l=0;for(;p.length-l>255;)u.writeByte(255),u.writeBytes(p,l,255),l+=255;u.writeByte(p.length-l),u.writeBytes(p,l,p.length-l),u.writeByte(0),u.writeString(\";\")};let s=function(u){let f=u,p=0,l=0,E={};return E.write=function(v,D){if(v>>>D)throw\"length over\";for(;p+D>=8;)f.writeByte(255&(v<<p|l)),D-=8-p,v>>>=8-p,l=0,p=0;l=v<<p|l,p=p+D},E.flush=function(){p>0&&f.writeByte(l)},E},o=function(u){let f=1<<u,p=(1<<u)+1,l=u+1,E=c();for(let B=0;B<f;B+=1)E.add(String.fromCharCode(B));E.add(String.fromCharCode(f)),E.add(String.fromCharCode(p));let v=Ie(),D=s(v);D.write(f,l);let C=0,F=String.fromCharCode(i[C]);for(C+=1;C<i.length;){let B=String.fromCharCode(i[C]);C+=1,E.contains(F+B)?F=F+B:(D.write(E.indexOf(F),l),E.size()<4095&&(E.size()==1<<l&&(l+=1),E.add(F+B)),F=B)}return D.write(E.indexOf(F),l),D.write(p,l),D.flush(),v.toByteArray()},c=function(){let u={},f=0,p={};return p.add=function(l){if(p.contains(l))throw\"dup key:\"+l;u[l]=f,f+=1},p.size=function(){return f},p.indexOf=function(l){return u[l]},p.contains=function(l){return typeof u[l]<\"u\"},p};return a},nt=function(t,e,r){let n=tt(t,e);for(let o=0;o<e;o+=1)for(let c=0;c<t;c+=1)n.setPixel(c,o,r(c,o));let i=Ie();n.write(i);let a=Ze(),s=i.toByteArray();for(let o=0;o<s.length;o+=1)a.writeByte(s[o]);return a.flush(),\"data:image/gif;base64,\"+a},ot=Z,vn=Z.stringToBytes,rt=\"#e8e8e8\",it=\"#ffffff\";function st(t){let e=t.getRootNode(),r=e instanceof ShadowRoot?e.host:document.documentElement;return(r instanceof Element?r.getAttribute(\"data-theme\"):null)===\"light\"?it:rt}function Fe(t,e,r=200){ge(t),t.dataset.qrUrl=e;let n=document.createElement(\"canvas\"),i=n.getContext?.(\"2d\")??null;if(!i){let p=document.createElement(\"a\");p.href=e,p.textContent=\"Open in DID Wallet\",p.target=\"_blank\",p.rel=\"noopener\",t.appendChild(p);return}let a=ot(0,\"M\");a.addData(e),a.make();let s=a.getModuleCount(),o=Math.floor(r/s),c=o*s;n.width=c,n.height=c,n.style.display=\"block\",n.style.width=`${r}px`,n.style.height=`${r}px`,n.style.imageRendering=\"pixelated\";let u=st(t);i.fillStyle=u,i.fillRect(0,0,c,c),i.fillStyle=\"#000000\";for(let p=0;p<s;p++)for(let l=0;l<s;l++)a.isDark(p,l)&&i.fillRect(l*o,p*o,o,o);let f=document.createElement(\"div\");f.className=\"qr-plate\",f.style.display=\"inline-block\",f.style.padding=\"10px\",f.style.backgroundColor=u,f.style.borderRadius=\"8px\",f.style.lineHeight=\"0\",f.appendChild(n),t.appendChild(f)}function ge(t){t.innerHTML=\"\",delete t.dataset.qrUrl}var at=`\n${Te}\n${Se}\n${Ue}\n\n/* Layout */\nbody {\n min-height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n background-image: radial-gradient(ellipse at 50% 0%, rgba(108,71,255,0.08) 0%, transparent 60%);\n}\n/* The body rule does not apply inside a shadow tree. The host page must\n give the LoginPage container a height for this centering to show. */\n:host {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100%;\n}\n\n/* Card \\u2014 fixed width prevents shrinking when views switch */\n.card {\n background: var(--bg-card);\n border: 1px solid var(--border);\n border-radius: var(--radius-lg);\n padding: 48px 40px;\n width: min(400px, calc(100vw - 32px));\n text-align: center;\n box-shadow: var(--shadow-lg), 0 0 80px -20px rgba(108,71,255,0.15);\n}\n\n/* Brand header */\n.brand-header { margin-bottom: 24px; }\n.app-logo {\n width: 48px;\n height: 48px;\n border-radius: var(--radius-sm);\n object-fit: contain;\n margin-bottom: 16px;\n}\nh1 {\n font-size: 24px;\n font-weight: 600;\n margin-bottom: 8px;\n color: var(--text-white);\n letter-spacing: -0.01em;\n line-height: 1.25;\n /* Never let a long \"Sign in to {appName}\" blow past two lines \\u2014 clamp with\n an ellipsis so the card height stays stable. */\n display: -webkit-box;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n}\n.subtitle {\n font-size: 14px;\n color: var(--text-secondary);\n margin-bottom: 0;\n line-height: 1.5;\n}\n.federated-hint {\n font-size: 12px;\n color: var(--text-secondary);\n margin-top: 6px;\n margin-bottom: 0;\n opacity: 0.7;\n}\n\n/* Input */\n.input {\n width: 100%;\n height: 36px;\n padding: 0 12px;\n font-size: 14px;\n color: var(--text);\n background: var(--bg-input);\n border: 1px solid var(--border-strong);\n border-radius: var(--radius-sm);\n outline: none;\n margin-bottom: 16px;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n}\n.input:focus { border-color: var(--blue); box-shadow: var(--shadow-focus); }\n.input::placeholder { color: var(--text-placeholder); }\n\n/* Button */\n.btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n width: 100%;\n height: 36px;\n padding: 0 16px;\n font-size: 14px;\n font-weight: 500;\n color: #fff;\n background: var(--blue);\n border: none;\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;\n line-height: 1;\n}\n.btn:hover { background: var(--blue-hover); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(108,71,255,0.3); }\n.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; transform: none; box-shadow: none; }\n.btn:focus-visible { box-shadow: var(--shadow-focus); }\n.btn svg { width: 18px; height: 18px; flex-shrink: 0; }\n.btn-secondary {\n background: transparent;\n border: 1px solid var(--border-strong);\n color: var(--text);\n}\n.btn-secondary:hover { background: var(--bg-hover); border-color: rgba(255,255,255,0.20); }\n\n/* Status */\n.status {\n margin-top: 16px;\n font-size: 13px;\n min-height: 20px;\n color: var(--text-secondary);\n}\n.status.error { color: var(--red-text); }\n\n/* Name row (passkey registration) */\n.name-row { display: none; }\n.name-row.visible { display: block; }\n\n/* Passkey section + secondary text action (\"First time? Create a passkey\") */\n.passkey-section > .btn + .passkey-alt,\n.passkey-section > .name-row + .btn { margin-top: 10px; }\n.passkey-alt {\n display: block;\n width: 100%;\n margin-top: 10px;\n padding: 4px;\n background: none;\n border: none;\n font-size: 13px;\n color: var(--text-secondary);\n cursor: pointer;\n text-align: center;\n transition: color 0.15s ease;\n}\n.passkey-alt:hover { color: var(--text); text-decoration: underline; }\n.passkey-alt:focus-visible { box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); outline: none; }\n\n/* Divider */\n.divider {\n display: flex;\n align-items: center;\n margin: 20px 0;\n color: var(--text-secondary);\n font-size: 13px;\n}\n.divider::before, .divider::after {\n content: '';\n flex: 1;\n border-bottom: 1px solid var(--border);\n}\n.divider::before { margin-right: 12px; }\n.divider::after { margin-left: 12px; }\n\n/* DID Wallet section (methods view) */\n.did-wallet-section { margin-top: 8px; }\n\n/* QR view */\n.qr-view {\n position: relative;\n margin: 20px auto;\n display: flex;\n justify-content: center;\n min-height: 220px;\n align-items: center;\n}\n.qr-placeholder {\n width: 220px;\n height: 220px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius);\n background: var(--bg-elevated);\n}\n.qr-spinner {\n display: inline-block;\n width: 32px; height: 32px;\n border: 3px solid var(--border-strong);\n border-top-color: var(--blue-muted);\n border-radius: 50%;\n animation: spin 0.6s linear infinite;\n}\n#did-connect-status {\n font-size: 13px;\n color: var(--text-secondary);\n}\n\n/* Connect result state */\n.connect-result {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 120px;\n margin: 32px 0;\n animation: fadeIn 200ms ease-out;\n}\n.result-icon {\n width: 64px;\n height: 64px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 28px;\n font-weight: bold;\n}\n.result-error {\n background: rgba(239, 68, 68, 0.15);\n color: var(--red-text);\n border: 2px solid rgba(239, 68, 68, 0.3);\n}\n.result-loading {\n background: transparent;\n}\n.result-loading .qr-spinner {\n width: 36px;\n height: 36px;\n}\n.result-back-btn {\n margin-top: 16px;\n}\n@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }\n\n/* QR timeout overlay. It sits on the code, not across the card. Dark keeps a\n dim scrim so the expired plate stays readable as \"inactive\". */\n.qr-plate { position: relative; }\n.qr-timeout-overlay {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n padding: 16px;\n text-align: center;\n background: rgba(0, 0, 0, 0.65);\n border-radius: inherit;\n backdrop-filter: blur(2px);\n}\n.qr-timeout-overlay .timeout-text {\n font-size: 13px;\n line-height: 1.4;\n color: #fff;\n}\n[data-theme=\"light\"] .qr-timeout-overlay,\n:host([data-theme=\"light\"]) .qr-timeout-overlay {\n background: rgba(255, 255, 255, 0.94);\n border: 1px solid var(--border);\n box-shadow: var(--shadow-sm);\n backdrop-filter: blur(8px);\n}\n[data-theme=\"light\"] .qr-timeout-overlay .timeout-text,\n:host([data-theme=\"light\"]) .qr-timeout-overlay .timeout-text {\n color: var(--text-secondary);\n}\n.qr-timeout-overlay .refresh-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 6px 20px;\n font-size: 14px;\n font-weight: 500;\n color: #fff;\n background: var(--blue);\n border: none;\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease;\n}\n.qr-timeout-overlay .refresh-btn:hover {\n background: var(--blue-hover);\n}\n/* Connect status views (scanned / success) */\n.connect-status-icon {\n position: relative;\n width: 72px;\n height: 72px;\n margin: 16px auto;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n@keyframes connectSpin { to { transform: rotate(360deg); } }\n.connect-spinner-ring {\n position: absolute;\n inset: 0;\n width: 72px;\n height: 72px;\n border-radius: 50%;\n border: 3px solid rgba(255,255,255,0.1);\n border-top-color: var(--blue, #6c47ff);\n animation: connectSpin 0.8s linear infinite;\n}\n.connect-status-badge {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n}\n.connect-status-badge svg { width: 36px; height: 36px; }\n.connect-status-icon.connect-success svg { animation: fadeIn 0.3s ease; }\n.connect-subtitle {\n font-size: 13px;\n color: var(--text-secondary, #9394a1);\n text-align: center;\n margin: 4px 0 0;\n}\n.status.success { color: #49dc6e; font-weight: 500; }\n.deep-link-btn {\n margin-top: 12px;\n text-decoration: none;\n}\n\n/* Email section (methods view) */\n.email-section { margin-top: 8px; }\n\n/* Back button \\u2014 same top row as Cancel and the locale/theme tools.\n A float sat inside the 48px content padding, so Back landed below the\n absolute locale pill. */\n.back-btn {\n position: absolute;\n top: 16px;\n left: 40px;\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n background: none;\n border: none;\n color: var(--text-secondary);\n font-size: 14px;\n line-height: 1;\n cursor: pointer;\n padding: 0;\n margin: 0;\n}\n.back-btn:hover { color: var(--text); }\n.back-btn svg { width: 18px; height: 18px; }\n/* Escape hatch \\u2014 a quiet \"Cancel\" link, top-left of the card, mirroring the\n locale switcher (top-right). Conventional spot for a standalone auth card.\n Low in the hierarchy (tertiary color, small) so it never competes with the\n auth methods; it's an exit, not an action. */\n.home-link {\n position: absolute;\n top: 16px;\n /* Align the arrow's left edge to the content column (card's 40px padding), so\n Cancel sits on the same left line as the title and buttons \\u2014 no left padding\n of its own, which would push it off that line. */\n left: 40px;\n display: inline-flex;\n align-items: center;\n gap: 3px;\n background: none;\n border: none;\n color: var(--text-tertiary);\n font-size: 13px;\n line-height: 1;\n text-decoration: none;\n cursor: pointer;\n height: 28px;\n padding: 2px 4px 2px 0;\n transition: color 0.15s ease;\n}\n.home-link:hover { color: var(--text-secondary); }\n.home-link svg { width: 16px; height: 16px; }\n\n/* View title */\n.view-title {\n font-size: 20px;\n font-weight: 600;\n color: var(--text-white);\n margin-bottom: 8px;\n padding-top: 8px;\n}\n\n/* OAuth section \\u2014 single provider (legacy) */\n.oauth-section { margin-top: 0; }\n\n/* OAuth grid \\u2014 2+ providers in 2-column layout (legacy) */\n.oauth-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n margin-bottom: 8px;\n}\n.oauth-grid .oauth-btn:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n\n/* Unified secondary methods grid \\u2014 2-column layout */\n.methods-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 8px;\n}\n/* Odd last child (e.g. DID Wallet when total is odd) spans full width */\n.methods-grid .method-btn:last-child:nth-child(odd) {\n grid-column: 1 / -1;\n}\n\n.method-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n min-height: 36px;\n padding: 6px 16px;\n font-size: 14px;\n font-weight: 500;\n color: var(--text);\n background: var(--bg-elevated);\n border: 1px solid var(--border-strong);\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.2s ease;\n white-space: normal;\n}\n.method-btn:hover { background: var(--bg-hover); border-color: var(--blue-muted); }\n.method-btn:disabled { cursor: default; pointer-events: none; }\n.method-btn svg { width: 18px; height: 18px; flex-shrink: 0; }\n\n.oauth-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n width: 100%;\n height: 36px;\n padding: 0 16px;\n font-size: 14px;\n font-weight: 500;\n color: var(--text);\n background: var(--bg-card);\n border: 1px solid var(--border);\n border-radius: var(--radius-sm);\n cursor: pointer;\n transition: background-color 0.15s ease, opacity 0.2s ease, border-color 0.2s ease;\n margin-bottom: 0;\n}\n.oauth-section .oauth-btn { margin-bottom: 8px; }\n.oauth-btn:hover { background: var(--bg-hover); }\n.oauth-btn:disabled { cursor: default; pointer-events: none; }\n.oauth-btn svg { width: 18px; height: 18px; flex-shrink: 0; }\n.oauth-btn-loading {\n opacity: 0.8;\n border-color: var(--blue);\n color: var(--text-secondary);\n}\n@keyframes oauth-spin { to { transform: rotate(360deg); } }\n.oauth-spinner {\n display: inline-block;\n width: 14px; height: 14px;\n border: 2px solid var(--border-strong);\n border-top-color: var(--blue-muted);\n border-radius: 50%;\n animation: oauth-spin 0.6s linear infinite;\n}\n.oauth-check { color: var(--green-text); font-size: 16px; }\n\n/* Browser compatibility warning */\n.compat-warning {\n font-size: 13px;\n color: var(--text-tertiary);\n padding: 12px;\n background: var(--bg-elevated);\n border-radius: var(--radius-sm);\n margin-bottom: 16px;\n}\n\n/* Trust footer */\n.login-footer {\n margin-top: 24px;\n padding-top: 20px;\n border-top: 1px solid var(--border);\n}\n.secured-badge {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n font-size: 12px;\n color: var(--text-tertiary);\n}\n.secured-badge svg { width: 14px; height: 14px; flex-shrink: 0; }\n.footer-links {\n margin-top: 8px;\n font-size: 12px;\n color: var(--text-tertiary);\n}\n.footer-links a {\n color: var(--text-secondary);\n text-decoration: none;\n}\n.footer-links a:hover { text-decoration: underline; }\n\n/* \\u2500\\u2500\\u2500 Animations \\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500 */\n@keyframes fadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n.card[data-view] { animation: fadeIn 200ms ease-out; }\n\n/* QR code scale-in */\n.qr-view { animation: qrScaleIn 300ms ease-out; }\n@keyframes qrScaleIn {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n}\n\n/* Button loading spinner */\n@keyframes spin { to { transform: rotate(360deg); } }\n.btn-spinner {\n display: inline-block;\n width: 16px; height: 16px;\n border: 2px solid rgba(255,255,255,0.3);\n border-top-color: #fff;\n border-radius: 50%;\n animation: spin 0.6s linear infinite;\n}\n\n/* Success checkmark */\n@keyframes checkDraw {\n from { stroke-dashoffset: 24; }\n to { stroke-dashoffset: 0; }\n}\n.success-check {\n display: inline-block;\n width: 20px; height: 20px;\n vertical-align: middle;\n}\n.success-check path {\n stroke-dasharray: 24;\n stroke-dashoffset: 24;\n animation: checkDraw 400ms ease-out forwards;\n}\n\n/* Light theme background gradient adjustment */\n[data-theme=\"light\"] body {\n background-image: radial-gradient(ellipse at 50% 0%, rgba(108,71,255,0.05) 0%, transparent 60%);\n}\n[data-theme=\"light\"] .card,\n:host([data-theme=\"light\"]) .card {\n box-shadow: var(--shadow-lg), 0 0 80px -20px rgba(108,71,255,0.08);\n}\n[data-theme=\"light\"] .btn:hover,\n:host([data-theme=\"light\"]) .btn:hover {\n box-shadow: 0 2px 8px rgba(108,71,255,0.15);\n}\n\n/* Language sits on the same top row as Back / Cancel. */\n.card-tools {\n position: absolute;\n top: 16px;\n right: 16px;\n z-index: 2;\n display: flex;\n align-items: flex-start;\n}\n.locale-switcher {\n position: relative;\n}\n.locale-btn {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n padding: 4px 10px;\n font-size: 12px;\n color: var(--text-secondary);\n background: var(--bg-elevated);\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-full);\n cursor: pointer;\n transition: color 0.15s, border-color 0.15s;\n}\n.locale-btn:hover {\n color: var(--text);\n border-color: var(--border-strong);\n}\n.locale-btn svg { width: 14px; height: 14px; flex-shrink: 0; }\n.locale-trigger {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n height: 28px;\n padding: 4px 10px;\n font-size: 12px;\n color: var(--text-secondary);\n background: var(--bg-elevated);\n border: 1px solid var(--border-subtle);\n border-radius: var(--radius-full);\n cursor: pointer;\n}\n.locale-trigger:hover {\n color: var(--text);\n border-color: var(--border-strong);\n}\n.locale-trigger svg { width: 14px; height: 14px; flex-shrink: 0; }\n/* One compact menu surface; rows are choices, not nested pill buttons. */\n.locale-menu {\n display: none; position: absolute; top: calc(100% + 6px); right: 0; z-index: 4;\n min-width: 144px; width: max-content; max-width: min(240px,calc(100vw - 64px));\n padding: 4px; background: var(--bg-card); border: 1px solid var(--border);\n border-radius: 10px; box-shadow: var(--shadow-lg);\n}\n.locale-switcher.open .locale-menu { display: flex; flex-direction: column; }\n.locale-menu .locale-btn {\n width: 100%; min-height: 36px; height: auto; padding: 7px 10px; gap: 8px;\n border: 0; border-radius: 6px; background: transparent; text-align: left;\n font-size: 13px; line-height: 1.4; overflow-wrap: anywhere;\n}\n.locale-menu .locale-btn:hover, .locale-menu .locale-btn:focus-visible { background: var(--bg-hover); color: var(--text); }\n.locale-menu .locale-btn[aria-checked=\"true\"] { color: var(--text); font-weight: 600; }\n.locale-check { width: 14px; flex: 0 0 14px; font-size: 12px; line-height: 1; }\n@media (pointer: coarse) { .locale-menu .locale-btn { min-height: 44px; } }\n.has-last-used { flex-wrap: wrap; }\n.last-used { display: inline-block; font-size: 11px; font-weight: 400; line-height: 1.4;\n padding: 2px 6px; border: 1px solid currentColor; border-radius: 4px; opacity: .72; white-space: nowrap; }\n.card { position: relative; }\n\n/* Long localized method labels remain readable on narrow screens. */\n.methods-grid { grid-template-columns: 1fr; }\n.method-btn { min-height: 48px; white-space: normal; }\n.passkey-alt { min-height: 44px; font-weight: 600; }\n.oauth-recovery { font-size: 14px; line-height: 1.5; margin: 12px 0; padding: 12px;\n border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-secondary); text-align: left; }\n.oauth-recovery p { margin: 0 0 8px; overflow-wrap: anywhere; }\n.oauth-recovery-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }\n.oauth-recovery-actions button, .oauth-recovery-actions a { font: inherit; font-size: 13px; min-height: 44px;\n display: inline-flex; align-items: center; padding: 4px 0; color: var(--text); border: 0; background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }\n.oauth-recovery-actions[hidden], .oauth-recovery-actions [hidden] { display: none; }\n.oauth-recovery-actions :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }\n\n@media (max-width: 480px) { .card { padding: 24px 20px; width: 100%; box-sizing: border-box; } h1 { font-size: 24px; } }\n\n.passkey-create-entry { display: flex; justify-content: center; align-items: center; width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); color: var(--text); padding: 10px 14px; }\n.passkey-create-entry:hover { background: var(--bg-hover); text-decoration: none; }\n.status:empty { min-height: 0; padding: 0; margin: 0; }\n.passkey-section .subtitle { margin: 8px 0 16px; font-size: 14px; line-height: 1.5; }\n@media (max-width: 480px) { .card { padding: 20px 18px; } .brand-header { margin-bottom: 20px; } }\n\n.card-modal .card-tools { left: 20px; right: 80px; top: 12px; }\n.card-modal .locale-switcher { min-width: 0; max-width: 100%; }\n.card-modal .locale-trigger { max-width: 100%; height: 36px; }\n.locale-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.card-modal .locale-menu { left: 0; right: auto; }\n\n.card { padding: 52px 24px 24px; box-sizing: border-box; }\n.card-modal { width: 100%; }\n.card-modal { padding-top: 68px; border: 0; border-radius: 0; }\n/* The dialog frame owns the shadow in both palettes. */\n.card.card-modal, :host([data-theme=\"light\"]) .card.card-modal { box-shadow: none; }\n/* A translateY entrance expands an auto scroller by 4px until it finishes. */\n.card-modal[data-view] { animation: none; }\n/* Sub-step navigation shares the close button's center line in both modes. */\n.back-btn { top: 8px; left: 24px; height: 44px; max-width: calc(100% - 160px); line-height: 1.4; text-align: left; }\n.back-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }\n.card-modal .back-btn { position: absolute; top: 8px; left: 24px; margin: 0; }\n.card-modal:has(.back-btn) .card-tools { left: auto; right: 64px; max-width: calc(100% - 160px); }\n.passkey-creating > .home-link { display: none; }\n@media (max-width:480px) { .back-btn, .card-modal .back-btn { left: 18px; } }\n.card-modal h1 { display: block; overflow: visible; -webkit-line-clamp: unset; line-clamp: unset; line-height: 1.4; padding-block: 2px; }\n.card-modal h1[tabindex=\"-1\"]:focus { outline: none; }\n.card-modal h1, .card-modal h2, .card-modal .subtitle, .card-modal .status { overflow-wrap: anywhere; }\n.card-modal .btn { height: auto; min-height: 44px; line-height: 1.4; padding-block: 10px; white-space: normal; }\n.card-modal button, .card-modal a { overflow-wrap: anywhere; }\n.social-first .divider { margin: 14px 0; }\n.social-first .app-logo { width: 32px; height: 32px; margin-bottom: 12px; }\n.social-first .login-footer { margin-top: 16px; padding-top: 12px; }\n.other-methods { margin-top: 8px; color: var(--text-secondary); font-size: 14px; }\n.other-methods summary { min-height: 44px; padding: 12px 0; cursor: pointer; }\n.other-methods summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }\n@media (max-width:480px) { .card { padding: 52px 18px 24px; } }\n@media (max-width:480px) { .card-modal { padding-top: 68px; } .card-modal .card-tools { left: 18px; } }\n@media (prefers-reduced-motion: reduce) { .card[data-view], .qr-view { animation: none; } }\n\n.passkey-creating > .methods-grid, .passkey-creating > .divider, .passkey-creating > .other-methods { display: none; }\n\n.input-label { display: block; text-align: left; margin: 8px 0; color: var(--text); font-size: 14px; font-weight: 500; }\n.input-label[hidden], .email-help[hidden] { display: none; }\n.email-help { text-align: left; font-size: 13px; line-height: 1.5; color: var(--text-secondary); margin: 0 0 12px; }\n`;function J(t){let e=new Uint8Array(t),r=\"\";for(let n=0;n<e.length;n++)r+=String.fromCharCode(e[n]);return btoa(r).replace(/\\+/g,\"-\").replace(/\\//g,\"_\").replace(/=+$/,\"\")}function oe(t){let e=t.replace(/-/g,\"+\").replace(/_/g,\"/\"),r=atob(e),n=new Uint8Array(r.length);for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);return n.buffer}function ut(t){let e=t.response;return{id:t.id,rawId:J(t.rawId),type:t.type,response:{attestationObject:J(e.attestationObject),clientDataJSON:J(e.clientDataJSON)},clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment}}function lt(t){let e=t.response;return{id:t.id,rawId:J(t.rawId),type:t.type,response:{authenticatorData:J(e.authenticatorData),clientDataJSON:J(e.clientDataJSON),signature:J(e.signature),userHandle:e.userHandle?J(e.userHandle):void 0},clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:t.authenticatorAttachment}}async function le(t){let e=t.prefix||\"/.well-known/service/api/passkey\",r=t.onStatus||(()=>{}),n=t.authOnly||!1,i=t.registerOnly||!1,a=t.invitationId||void 0,s=t.locale,o=t.texts||{},c=o.waiting||b(\"passkeyWaiting\",s),u=o.creating||b(\"passkeyCreating\",s),f=o.verifying||b(\"verifying\",s);async function p(){let C=await fetch(`${e}/auth`,{method:\"GET\",signal:t.signal});if(!C.ok)throw new Error(b(\"authFailed\",s));return C.json()}async function l(C){let F=[];C&&F.push(`name=${encodeURIComponent(C)}`),a&&F.push(`invitationId=${encodeURIComponent(a)}`);let B=F.length?`?${F.join(\"&\")}`:\"\",R=await fetch(`${e}/register${B}`,{method:\"GET\",signal:t.signal});if(!R.ok)throw new Error(b(\"registrationFailed\",s));return R.json()}function E(C,F){let B=new Error(C);throw F&&(B.code=F),B}async function v(C,F){let B=await fetch(`${e}/auth`,{method:\"POST\",signal:t.signal,headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({challengeId:C,credential:F})});if(!B.ok){let R=await B.json().catch(()=>({}));E(R.error||b(\"authFailed\",s),R.code)}return B.json()}async function D(C,F,B){let R=await fetch(`${e}/register`,{method:\"POST\",signal:t.signal,headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({challengeId:C,credential:F,name:B||void 0})});if(!R.ok){let W=await R.json().catch(()=>({}));E(W.error||b(\"registrationFailed\",s),W.code)}return R.json()}if(!i){r(c,!1);try{let C=await p(),{challengeId:F}=C,B=C.authentication||C,R={signal:t.signal,publicKey:{...B,challenge:oe(B.challenge),allowCredentials:(B.allowCredentials||[]).map(L=>({...L,id:oe(L.id)}))}},W;try{W=await navigator.credentials.get(R)}catch{if(n)return{success:!1,error:\"no_passkey\"}}if(!W&&n)return{success:!1,error:\"no_passkey\"};if(t.signal?.aborted)return{success:!1,error:\"cancelled\"};if(W){let L=lt(W);return r(f,!1),await v(F,L),{success:!0}}}catch(C){let F=C instanceof Error?C.message:b(\"authFailed\",s),B=C instanceof Error?C.code:void 0;return r(F,!0),{success:!1,error:F,code:B}}}try{let C=await l(t.name||\"\");if(C.registrationAllowed===!1)return r(b(\"regClosed\",s),!0),{success:!1,error:\"registration_closed\"};r(u,!1);let F=C.registration||C,B={signal:t.signal,publicKey:{...F,challenge:oe(F.challenge),user:{...F.user,id:oe(F.user.id)},excludeCredentials:(F.excludeCredentials||[]).map(L=>({...L,id:oe(L.id)}))}},R=await navigator.credentials.create(B);if(!R||t.signal?.aborted)return{success:!1,error:b(\"passkeyNoLocal\",s)};let W=ut(R);return r(f,!1),await D(C.challengeId,W,t.name||\"\"),{success:!0}}catch(C){let F=C instanceof Error&&(C.name===\"NotAllowedError\"||C.name===\"AbortError\")?b(\"passkeyNoLocal\",s):C instanceof Error?C.message:b(\"passkeySetupFailed\",s),B=C instanceof Error?C.code:void 0;return r(F,!0),{success:!1,error:F,code:B}}}function X(t,e){let r=t instanceof Error?t.message:\"\",n=t instanceof Error&&\"code\"in t?t.code:\"\";return n===\"FORBIDDEN\"?b(\"accessDenied\",e):r===\"registration_closed\"||n===\"registration_closed\"?b(\"regClosed\",e):r||b(\"authFailed\",e)}var ct=\"https://web.abtwallet.io/\";function _e(){return typeof navigator>\"u\"?!1:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function dt(){return typeof window>\"u\"?null:window.ABT_DEV??window.ABT??null}function q(t){return t.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#x27;\")}var me=class{container;config;http;options;tokenSession=null;styleEl=null;mounted=!1;completed=!1;generation=0;activeMethod;activeProvider;oauthCleanup;emailTimer;emailDraft=\"\";abort;emit(t){try{this.options.onEvent?.({name:t,method:this.activeMethod,mode:this.options.mode??\"page\"})}catch{}}select(t){this.generation++,this.oauthCleanup?.(),this.abort?.abort(),this.abort=new AbortController,this.activeMethod=t,this.activeProvider=void 0,this.emit(\"method_selected\")}currentView=\"methods\";cardEl=null;mediaQuery=null;mediaListener=null;localeOutsideClick=null;shadow=null;isolate;constructor(t,e,r,n){if(this.container=t,this.config=e,this.http=r,this.isolate=n?.isolate===!0,this.options={methods:[\"passkey\",\"did-connect\"],locale:\"en\",...n},!this.options.invitationId&&typeof document<\"u\"){let i=document.cookie.match(/(?:^|;\\s*)pending_invitation=([^;]*)/);if(i)try{this.options.invitationId=decodeURIComponent(i[1])}catch{}}}mount(){if(this.mounted)return;this.mounted=!0,this.completed=!1,this.emit(\"view\"),this.styleEl=document.createElement(\"style\"),this.styleEl.textContent=at,this.mountRoot().appendChild(this.styleEl),this.adoptStoredTheme(),this.applyTheme();let t=this.filterMethods(this.options.methods);this.renderCard(t)}destroy(){if(this.generation++,this.oauthCleanup?.(),this.abort?.abort(),clearInterval(this.emailTimer),this.detachLocaleMenu(),this.tokenSession&&(this.tokenSession.destroy(),this.tokenSession=null),this.detachMedia(),this.isolate){let t=this.shadow??this.container.shadowRoot;t&&(t.innerHTML=\"\"),this.container.removeAttribute(\"data-theme\")}else document.documentElement.removeAttribute(\"data-theme\"),this.container.innerHTML=\"\";this.styleEl=null,this.cardEl=null,this.currentView=\"methods\",this.mounted=!1}setTheme(t){this.options.theme=t,this.applyTheme()}update(t){Object.assign(this.options,t),this.mounted&&(this.destroy(),this.mount())}themeTarget(){return this.isolate?this.container:document.documentElement}mountRoot(){return this.isolate?this.shadow?this.shadow:(this.shadow=this.container.shadowRoot??this.container.attachShadow({mode:\"open\"}),this.shadow):this.container}detachMedia(){this.mediaQuery&&this.mediaListener&&this.mediaQuery.removeEventListener(\"change\",this.mediaListener),this.mediaQuery=null,this.mediaListener=null}adoptStoredTheme(){if(this.options.mode===\"dialog\"||typeof window>\"u\")return;let t=new URLSearchParams(window.location.search).get(\"theme\");if(t===\"light\"||t===\"dark\"||t===\"auto\"){this.options.theme=t;return}try{let e=localStorage.getItem(\"web-mode\");(e===\"light\"||e===\"dark\"||e===\"auto\")&&(this.options.theme=e)}catch{}}applyTheme(){this.detachMedia();let t=this.options.theme??\"dark\",e=this.themeTarget();if(t===\"light\")e.dataset.theme=\"light\";else if(t===\"auto\"&&typeof window.matchMedia==\"function\"){let r=window.matchMedia(\"(prefers-color-scheme: light)\");this.mediaQuery=r;let n=i=>{i?e.dataset.theme=\"light\":e.removeAttribute(\"data-theme\"),this.repaintQRPlate()};n(r.matches),this.mediaListener=i=>n(i.matches),r.addEventListener(\"change\",this.mediaListener);return}else e.removeAttribute(\"data-theme\");this.repaintQRPlate()}repaintQRPlate(){let t=this.mountRoot().querySelector(\"#did-connect-qr\");if(!(t instanceof HTMLElement))return;let e=t.dataset.qrUrl;!e||!t.querySelector(\"canvas\")||t.querySelector(\".qr-timeout-overlay\")||Fe(t,e)}filterMethods(t){return t.filter(e=>e===\"passkey\"?typeof window<\"u\"&&window.PublicKeyCredential!==void 0&&typeof window.PublicKeyCredential==\"function\":!0)}renderCard(t){let e=document.createElement(\"div\");e.className=this.options.mode===\"dialog\"?\"card card-modal\":\"card\",this.cardEl=e,this.mountRoot().appendChild(e),this.switchView(\"methods\",t)}renderCardTools(t){if(!(this.options.showLocaleSelector??this.options.mode!==\"dialog\"))return;let e=document.createElement(\"div\");e.className=\"card-tools\",this.renderLocaleSwitcher(e),t.appendChild(e)}renderLocaleSwitcher(t){let e=this.options.locales;if(e){this.renderLocaleMenu(t,e);return}if(pe.length<2)return;let r=document.createElement(\"div\");r.className=\"locale-switcher\";let n=this.options.locale,i=pe.find(s=>s.code!==n)??pe[0],a=document.createElement(\"button\");a.type=\"button\",a.className=\"locale-btn\",a.innerHTML=`${Be} ${q(i.label)}`,a.title=i.label,a.addEventListener(\"click\",()=>{this.options.onLocaleChange?.(i.code),this.update({locale:i.code})}),r.appendChild(a),t.appendChild(r)}renderLocaleMenu(t,e){if(e.length<2)return;this.detachLocaleMenu();let r=this.options.locale,n=e.find(u=>u.code===r)??e[0],i=document.createElement(\"div\");i.className=\"locale-switcher\";let a=document.createElement(\"button\");a.type=\"button\",a.className=\"locale-trigger\",a.setAttribute(\"aria-haspopup\",\"menu\"),a.setAttribute(\"aria-expanded\",\"false\"),a.innerHTML=`${Be} <span class=\"locale-label\">${q(n.label)}</span>`,a.title=n.label;let s=document.createElement(\"div\");s.className=\"locale-menu\",s.setAttribute(\"role\",\"menu\"),s.hidden=!0;let o=u=>{i.classList.toggle(\"open\",u),s.hidden=!u,a.setAttribute(\"aria-expanded\",u?\"true\":\"false\")};a.addEventListener(\"click\",u=>{u.stopPropagation(),o(s.hidden),s.hidden||s.querySelector('[aria-checked=\"true\"]')?.focus()});for(let u of e){let f=u.code===n.code,p=document.createElement(\"button\");p.type=\"button\",p.className=\"locale-btn\",p.setAttribute(\"role\",\"menuitemradio\"),p.setAttribute(\"aria-checked\",f?\"true\":\"false\"),p.dataset.locale=u.code,p.tabIndex=-1,p.title=u.label;{let E=document.createElement(\"span\");E.className=\"locale-check\",E.setAttribute(\"aria-hidden\",\"true\"),E.textContent=f?\"\\u2713\":\"\",p.appendChild(E)}let l=document.createElement(\"span\");l.textContent=u.label,p.appendChild(l),p.addEventListener(\"click\",()=>{this.options.onLocaleChange?.(u.code),this.update({locale:u.code})}),s.appendChild(p)}i.addEventListener(\"keydown\",u=>{let f=[...s.querySelectorAll(\".locale-btn\")],p=this.shadow?.activeElement??document.activeElement,l=f.indexOf(p);if(u.key===\"Escape\")u.preventDefault(),u.stopPropagation(),o(!1),a.focus();else if(u.key===\"Tab\")o(!1);else if([\"ArrowDown\",\"ArrowUp\",\"Home\",\"End\"].includes(u.key)){u.preventDefault(),o(!0);let E=u.key===\"Home\"?0:u.key===\"End\"?f.length-1:l<0?u.key===\"ArrowUp\"?f.length-1:0:(l+(u.key===\"ArrowUp\"?-1:1)+f.length)%f.length;f[E]?.focus()}});let c=u=>{let f=u.composedPath();f.includes(i)||this.isolate&&f.includes(this.container)||o(!1)};document.addEventListener(\"click\",c),this.localeOutsideClick=c,i.append(a,s),t.appendChild(i)}detachLocaleMenu(){this.localeOutsideClick&&(document.removeEventListener(\"click\",this.localeOutsideClick),this.localeOutsideClick=null)}switchView(t,e){if(!this.cardEl)return;let r=this.options.locale;switch(this.currentView===\"qr\"&&t!==\"qr\"&&this.tokenSession&&(this.tokenSession.destroy(),this.tokenSession=null),this.generation++,this.oauthCleanup?.(),this.abort?.abort(),clearInterval(this.emailTimer),this.currentView=t,this.cardEl.innerHTML=\"\",this.cardEl.dataset.view=t,this.renderCardTools(this.cardEl),t){case\"methods\":this.renderMethodsView(this.cardEl,r,e??this.filterMethods(this.options.methods));break;case\"qr\":this.renderQRView(this.cardEl,r);break;case\"email\":this.renderEmailView(this.cardEl,r);break}}markLastUsed(t,e,r){if(this.options.preferenceKey)try{if(localStorage.getItem(`did-login-method:${this.options.preferenceKey}`)!==e)return;let n=document.createElement(\"span\");n.className=\"last-used\",n.textContent=b(\"lastUsed\",r),t.classList.add(\"has-last-used\"),t.appendChild(n)}catch{}}renderMethodsView(t,e,r){this.options.mode!==\"dialog\"&&this.renderHomeLink(t,e),this.renderBrandHeader(t,e);let n=this.options.methods.includes(\"passkey\");if(n&&!r.includes(\"passkey\")){let o=document.createElement(\"div\");o.className=\"compat-warning\",o.textContent=b(\"passkeyUnsupported\",e),t.appendChild(o)}let i=this.options.preferredLayout!==\"passkey-first\"&&r.includes(\"oauth\")&&this.options.oauthProviders?.some(o=>o.enabled&&[\"google\",\"apple\"].includes(o.id));t.classList.toggle(\"social-first\",!!i),i&&(this.renderSecondaryGrid(t,e,[\"oauth\"],\"primary\"),this.renderDivider(t,e));let a=r.includes(\"passkey\");a&&this.renderPasskeySection(t,e);let s=r.filter(o=>o!==\"passkey\");if(a&&s.length>0&&this.renderDivider(t,e),s.length>0)if(i){r.includes(\"email\")&&this.renderSecondaryGrid(t,e,[\"email\"]);let o=document.createElement(\"details\");o.className=\"other-methods\";let c=document.createElement(\"summary\");c.textContent=b(\"otherMethods\",e),o.appendChild(c),this.renderSecondaryGrid(o,e,r.filter(u=>u!==\"email\"),\"secondary\"),o.querySelector(\"button\")&&t.appendChild(o)}else this.renderSecondaryGrid(t,e,r);if(r.length===0&&!n){let o=document.createElement(\"p\");o.className=\"subtitle\",o.textContent=\"No authentication methods available.\",t.appendChild(o)}this.renderTrustFooter(t,e)}renderQRView(t,e){this.renderBackButton(t,e);let r=document.createElement(\"h2\");r.className=\"view-title\",r.textContent=b(\"scanTitle\",e),t.appendChild(r);let n=document.createElement(\"div\");n.id=\"did-connect-qr\",n.className=\"qr-view\",n.innerHTML='<div class=\"qr-placeholder\"><span class=\"qr-spinner\"></span></div>',t.appendChild(n);let i=document.createElement(\"button\");i.className=\"btn btn-secondary deep-link-btn\",i.id=\"did-wallet-open-btn\",i.textContent=b(\"openInWallet\",e),i.disabled=!0,_e()?t.insertBefore(i,n):t.appendChild(i);let a=document.createElement(\"div\");a.id=\"did-connect-status\",a.className=\"status\",a.setAttribute(\"role\",\"status\"),t.appendChild(a),this.renderTrustFooter(t,e),this.startDIDConnectInView(a,n,i,e)}renderEmailView(t,e){this.renderBackButton(t,e);let r=document.createElement(\"h2\");r.className=\"view-title\",r.textContent=b(\"emailTitle\",e),t.appendChild(r);let n=document.createElement(\"label\");n.className=\"input-label\",n.htmlFor=\"login-email-address\",n.textContent=b(\"emailPlaceholder\",e),t.appendChild(n);let i=document.createElement(\"p\");i.className=\"email-help\",i.textContent=b(\"emailExplanation\",e),t.appendChild(i);let a=document.createElement(\"input\");a.className=\"input\",a.id=\"login-email-address\",a.type=\"email\",a.required=!0,a.autocomplete=\"email\",a.value=this.emailDraft,a.setAttribute(\"aria-label\",b(\"emailPlaceholder\",e)),a.addEventListener(\"input\",()=>{this.emailDraft=a.value}),a.placeholder=b(\"emailPlaceholder\",e),t.appendChild(a);let s=document.createElement(\"button\");s.className=\"btn\",s.textContent=b(\"emailSubmit\",e),t.appendChild(s);let o=document.createElement(\"div\");o.className=\"status\",o.setAttribute(\"role\",\"status\"),t.appendChild(o);let c=document.createElement(\"div\");c.className=\"email-code-section\",c.style.display=\"none\";let u=document.createElement(\"label\");u.className=\"input-label\",u.htmlFor=\"login-email-code\",u.textContent=b(\"emailCodePlaceholder\",e),c.appendChild(u);let f=document.createElement(\"input\");f.id=\"login-email-code\",f.className=\"input\",f.type=\"text\",f.inputMode=\"numeric\",f.maxLength=8,f.setAttribute(\"aria-label\",b(\"emailCodePlaceholder\",e)),f.autocomplete=\"one-time-code\",f.placeholder=b(\"emailCodePlaceholder\",e),c.appendChild(f);let p=document.createElement(\"button\");p.className=\"btn\",p.textContent=b(\"emailVerify\",e),c.appendChild(p);let l=document.createElement(\"button\");l.className=\"btn btn-secondary\",l.textContent=b(\"emailResend\",e),l.style.marginTop=\"8px\",c.appendChild(l),t.insertBefore(c,o),this.renderTrustFooter(t,e);let E=this.generation,v=()=>this.mounted&&E===this.generation,D=document.createElement(\"button\");D.className=\"passkey-alt\",D.textContent=b(\"emailEdit\",e),c.appendChild(D),D.addEventListener(\"click\",()=>this.switchView(\"email\"));let C=()=>{let I=60;clearInterval(this.emailTimer),l.disabled=!0,l.textContent=b(\"emailCooldown\",e,{seconds:String(I)}),this.emailTimer=setInterval(()=>{I--,l.textContent=I>0?b(\"emailCooldown\",e,{seconds:String(I)}):b(\"emailResend\",e),I<=0&&(clearInterval(this.emailTimer),l.disabled=!1)},1e3)},F=\"\",B,R=this.config.servicePrefix??\"/.well-known/service\",W=async()=>{if(s.disabled)return;let I=a.value.trim();if(!a.checkValidity()){o.textContent=b(\"emailInvalid\",e),o.className=\"status error\";return}s.disabled=!0,o.textContent=b(\"emailSending\",e),o.className=\"status\",o.setAttribute(\"role\",\"status\");try{let d=await this.http.post(`${R}/api/email/sendCode`,{email:I,locale:e});if(!v())return;C(),F=I,B=d?.id,a.style.display=\"none\",n.hidden=!0,i.hidden=!0,s.style.display=\"none\",c.style.display=\"\",r.textContent=b(\"emailVerify\",e),o.textContent=b(\"emailSent\",e,{email:I}),o.className=\"status\",f.focus()}catch(d){if(!v())return;let m=d instanceof Error?d.message:\"Failed to send email\";o.textContent=m,o.className=\"status error\",s.disabled=!1}},L=async()=>{if(p.disabled)return;let I=f.value.trim();if(!/^\\d{8}$/.test(I)){o.textContent=b(\"emailCodeInvalid\",e),o.className=\"status error\";return}p.disabled=!0,o.textContent=b(\"verifying\",e),o.className=\"status\";try{if(await this.http.post(`${R}/api/email/login`,{code:I,id:B}),!v())return;o.textContent=b(\"success\",e),o.className=\"status\",this.handleSuccess()}catch(d){if(!v())return;d instanceof Error&&\"code\"in d&&d.code===\"FORBIDDEN\"?this.showFullError(X(d,e)):(o.textContent=X(d,e),o.className=\"status error\",p.disabled=!1,f.value=\"\",f.focus())}};s.addEventListener(\"click\",W),a.addEventListener(\"keydown\",I=>{I.key===\"Enter\"&&W()}),p.addEventListener(\"click\",L),f.addEventListener(\"keydown\",I=>{I.key===\"Enter\"&&L()}),l.addEventListener(\"click\",async()=>{if(!l.disabled){l.disabled=!0,o.textContent=b(\"emailSending\",e),o.className=\"status\";try{let I=await this.http.post(`${R}/api/email/sendCode`,{email:F,locale:e});if(!v())return;C(),B=I?.id,o.textContent=b(\"emailSent\",e,{email:F}),o.className=\"status\"}catch(I){if(!v())return;l.disabled=!1;let d=I instanceof Error?I.message:\"Failed to resend\";o.textContent=d,o.className=\"status error\"}}})}renderBackButton(t,e,r=()=>this.switchView(\"methods\")){let n=document.createElement(\"button\");n.type=\"button\",n.className=\"back-btn\",n.innerHTML=`${ke} ${q(b(\"back\",e))}`,n.addEventListener(\"click\",r),t.appendChild(n)}renderHomeLink(t,e){if(this.options.dismissible===!1)return;let{homeUrl:r,onCancel:n}=this.options;if(!n&&!r)return;let i=`${ke} ${q(b(\"cancel\",e))}`;if(n){let a=document.createElement(\"button\");a.type=\"button\",a.className=\"home-link\",a.innerHTML=i,a.addEventListener(\"click\",()=>{this.emit(\"cancel\"),this.options.onCancel?.()}),t.appendChild(a)}else{let a=document.createElement(\"a\");a.className=\"home-link\",a.href=r,a.innerHTML=i,t.appendChild(a)}}renderBrandHeader(t,e){let r=document.createElement(\"div\");if(r.className=\"brand-header\",this.options.appLogo){let i=document.createElement(\"img\");i.className=\"app-logo\",i.src=q(this.options.appLogo),i.alt=this.options.appName?q(this.options.appName):\"\",i.width=48,i.height=48,r.appendChild(i)}let n=document.createElement(\"h1\");if(this.options.appName?n.textContent=b(\"signInTo\",e,{appName:this.options.appName}):n.textContent=b(\"signIn\",e),this.options.purpose&&(n.textContent=this.options.purpose.title),n.id=\"login-title\",r.appendChild(n),this.options.purpose?.description){let i=document.createElement(\"p\");i.className=\"subtitle\",i.textContent=this.options.purpose.description,r.appendChild(i)}if(this.options.masterAppName){let i=document.createElement(\"p\");i.className=\"federated-hint\",i.textContent=b(\"federatedBy\",e,{masterName:this.options.masterAppName}),r.appendChild(i)}t.appendChild(r)}renderTrustFooter(t,e){let r=document.createElement(\"div\");r.className=\"login-footer\";let n=document.createElement(\"div\");n.className=\"secured-badge\",n.innerHTML=`${Ve} ${q(b(\"securedBy\",e))}`,r.appendChild(n);let{privacyUrl:i,termsUrl:a}=this.options;if(i||a){let s=document.createElement(\"div\");if(s.className=\"footer-links\",i){let o=document.createElement(\"a\");o.href=i,o.target=\"_blank\",o.rel=\"noopener noreferrer\",o.textContent=b(\"privacy\",e),s.appendChild(o)}if(i&&a&&s.appendChild(document.createTextNode(\" \\xB7 \")),a){let o=document.createElement(\"a\");o.href=a,o.target=\"_blank\",o.rel=\"noopener noreferrer\",o.textContent=b(\"terms\",e),s.appendChild(o)}r.appendChild(s)}t.appendChild(r)}renderDivider(t,e){let r=document.createElement(\"div\");r.className=\"divider\",r.textContent=b(\"or\",e),t.appendChild(r)}renderPasskeySection(t,e){let r=document.createElement(\"div\");r.className=\"passkey-section\",t.appendChild(r);let n=document.createElement(\"div\");n.className=\"status\",n.id=\"passkey-status\",t.appendChild(n);let i=(l,E)=>{n.textContent=l,n.className=`status${E?\" error\":\"\"}`},a=()=>i(\"\",!1),s={waiting:b(\"passkeyWaiting\",e),creating:b(\"passkeyCreating\",e),verifying:b(\"verifying\",e)},o=l=>l.success?(i(b(\"success\",e),!1),this.handleSuccess(),!0):l.code===\"FORBIDDEN\"||l.error===\"registration_closed\"?(this.showFullError(X({message:l.error,code:l.code||l.error},e)),!0):!1,c=()=>{r.innerHTML=\"\",i(b(\"passkeyNoLocal\",e),!1);let l=document.createElement(\"button\");l.className=\"btn\",l.id=\"passkey-btn\",l.innerHTML=`${fe} ${q(b(\"passkeyUseAnotherDevice\",e))}`,r.appendChild(l),l.addEventListener(\"click\",()=>f());let E=document.createElement(\"button\");E.type=\"button\",E.className=\"passkey-alt passkey-create-entry\",E.textContent=b(\"passkeyCreateInstead\",e),r.appendChild(E),E.addEventListener(\"click\",()=>u())},u=()=>{this.cardEl?.classList.add(\"passkey-creating\"),this.abort?.abort(),this.generation++,r.innerHTML=\"\",a();let l=this.cardEl?.querySelector(\"h1\");l&&(l.textContent=b(\"passkeyCreateAccount\",e));let E=document.createElement(\"p\");E.className=\"subtitle\",E.textContent=b(\"passkeyExplanation\",e),r.appendChild(E);let v=document.createElement(\"div\");v.className=\"name-row visible\",v.id=\"passkey-name-row\";let D=document.createElement(\"input\");D.className=\"input\",D.id=\"passkey-name-input\",D.type=\"text\",D.setAttribute(\"aria-label\",b(\"namePlaceholder\",e)),D.placeholder=b(\"namePlaceholder\",e),D.autocomplete=\"name\",v.appendChild(D),r.appendChild(v);let C=document.createElement(\"button\");C.className=\"btn\",C.id=\"passkey-btn\",C.innerHTML=`${fe} ${q(b(\"passkeyCreate\",e))}`,r.appendChild(C),t.querySelector(\".back-btn\")?.remove(),this.renderBackButton(t,e,()=>p());let F=async()=>{if(C.disabled)return;C.disabled=!0,this.select(\"passkey\");let B=this.generation,R=await le({registerOnly:!0,signal:this.abort?.signal,name:D.value.trim(),onStatus:i,texts:s,locale:e,prefix:this.options.passkeyPrefix,invitationId:this.options.invitationId});!this.mounted||B!==this.generation||this.abort?.signal.aborted||o(R)||(R.error&&i(R.error,!0),C.disabled=!1)};C.addEventListener(\"click\",F),D.addEventListener(\"keydown\",B=>{B.key===\"Enter\"&&F()}),C.focus()},f=async()=>{let l=r.querySelector(\"#passkey-btn\");if(l?.disabled)return;l&&(l.disabled=!0),this.select(\"passkey\");let E=this.generation,v=await le({authOnly:!0,signal:this.abort?.signal,onStatus:i,texts:s,locale:e,prefix:this.options.passkeyPrefix,invitationId:this.options.invitationId});if(!(!this.mounted||E!==this.generation||this.abort?.signal.aborted)&&!o(v)){if(v.error&&v.error!==\"no_passkey\"){i(v.error,!0),l&&(l.disabled=!1);return}this.emit(\"incomplete\"),c()}},p=()=>{this.cardEl?.classList.remove(\"passkey-creating\"),t.querySelector(\".back-btn\")?.remove(),this.abort?.abort(),this.generation++;let l=this.cardEl?.querySelector(\"h1\");l&&(l.textContent=this.options.purpose?.title??(this.options.appName?b(\"signInTo\",e,{appName:this.options.appName}):b(\"signIn\",e))),r.innerHTML=\"\",a();let E=document.createElement(\"button\");E.className=this.cardEl?.classList.contains(\"social-first\")?\"btn btn-secondary\":\"btn\",E.id=\"passkey-btn\",E.innerHTML=`${fe} ${q(b(\"passkeySignIn\",e))}`,this.markLastUsed(E,\"passkey\",e),r.appendChild(E),E.addEventListener(\"click\",()=>f());let v=document.createElement(\"button\");v.type=\"button\",v.className=\"passkey-alt passkey-create-entry\",v.textContent=b(\"passkeyFirstTime\",e),r.appendChild(v),v.addEventListener(\"click\",()=>u())};this.options.invitationId?u():p()}startOAuthPopup(t,e){this.oauthCleanup?.();let r=this.generation,n=this.options.locale,i=this.config.servicePrefix??\"/.well-known/service\",a=this.options.masterOAuthOrigin?`${this.options.masterOAuthOrigin}${i}`:i,s=new URL(a,window.location.href).origin,o=window.location.href;if(this.options.mode!==\"dialog\"&&window.location.pathname===`${i}/login`){let A=new URLSearchParams(window.location.search).get(\"return_to\");try{let z=new URL(A||\"/\",window.location.origin);o=z.origin===window.location.origin&&!/^\\/[/\\\\]/.test(z.pathname)?z.href:`${window.location.origin}/`}catch{o=`${window.location.origin}/`}}let c=`${a}/api/oauth/${encodeURIComponent(t)}/login?returnUrl=${encodeURIComponent(o)}`,u=this.options.oauthProviders?.find(A=>A.id===t)?.name??t,f=e.innerHTML,p=null,l=!1,E=!1,v=!1,D,C,F,B=()=>!l&&this.mounted&&r===this.generation,R=[],W=()=>{for(let A of this.cardEl?.querySelectorAll(\".method-btn, .passkey-create-entry, #passkey-btn, .locale-trigger, .locale-btn\")??[])R.push({button:A,disabled:A.disabled}),A.disabled=!0},L=document.createElement(\"div\");L.className=\"oauth-recovery\",L.setAttribute(\"role\",\"status\");let I=document.createElement(\"p\"),d=document.createElement(\"div\");d.className=\"oauth-recovery-actions\";let m=document.createElement(\"button\");m.type=\"button\",m.className=\"oauth-retry\",m.textContent=b(\"oauthReopen\",n),m.hidden=!0,m.onclick=()=>{this.select(\"oauth\"),this.activeProvider=t,this.startOAuthPopup(t,e)};let h=document.createElement(\"a\");h.href=c,h.textContent=b(\"oauthFullPage\",n),h.addEventListener(\"click\",A=>{let z=L.dataset.state===\"oauthUnconfirmed\";if(E&&!l){A.preventDefault();return}z&&A.preventDefault(),this.options.onBeforeRedirect?.(),this.oauthCleanup?.(),z&&window.location.reload()});let g=document.createElement(\"button\");g.type=\"button\",g.className=\"oauth-cancel\",g.textContent=b(\"cancel\",n),d.append(m,h,g),L.append(I,d),e.parentElement?.after(L);let y=()=>{e.innerHTML=f,e.disabled=!1,e.classList.remove(\"oauth-btn-loading\")},x=()=>{try{p?.close()}catch{}},w=()=>{l=!0,clearInterval(D),clearInterval(C),clearTimeout(F),window.removeEventListener(\"message\",k);for(let A of R.splice(0))A.button.disabled=A.disabled;y()},T=A=>{I.textContent=b(A,n,{provider:u}),L.dataset.state=A,d.hidden=!1,m.hidden=!1,g.hidden=!0,y()},S=A=>{B()&&(w(),x(),T(A),this.emit(\"incomplete\"))},P=()=>{B()&&(w(),x(),L.remove(),e.textContent=b(\"success\",n),e.disabled=!0,this.handleSuccess())};g.onclick=()=>{E||(S(\"oauthCancelled\"),e.focus())};let k=async A=>{if(A.origin!==s||A.source!==p||!p||!A.data||A.data.type!==\"authorization_response\"||!B()||E)return;if(clearInterval(D),clearInterval(C),A.data.error){S(A.data.error===\"access_denied\"?\"oauthDenied\":A.data.error===\"cancelled\"?\"oauthCancelled\":\"oauthFailed\");return}let{code:z,state:se}=A.data.response??A.data;if(typeof z!=\"string\"||!z||typeof se!=\"string\"||!se){S(\"oauthFailed\");return}E=!0,W(),d.hidden=!0,x(),I.textContent=b(\"verifying\",n),e.textContent=b(\"verifying\",n),e.disabled=!0;try{let V={provider:t,code:z,state:se};this.options.invitationId&&(V.invitationId=this.options.invitationId),await this.http.post(`${i}/api/oauth/login`,V,{signal:this.abort?.signal}),P()}catch(V){if(!B())return;let j=V instanceof Error&&\"code\"in V?String(V.code):\"\",ae=V instanceof Error?V.message:\"\";j===\"FORBIDDEN\"||j===\"registration_closed\"||ae===\"registration_closed\"?(w(),L.remove(),this.showFullError(X(V,n))):S(\"oauthFailed\")}};this.oauthCleanup=()=>{w(),L.remove(),x()},window.addEventListener(\"message\",k);try{p=window.open(c,\"oauth-login:popup\",`left=${window.screenX+(window.innerWidth-500)/2},top=${window.screenY+(window.innerHeight-620)/2},width=500,height=620,resizable,scrollbars=yes,status=1,popup`)}catch{}if(!p){S(\"oauthBlocked\");return}I.textContent=b(\"oauthWaiting\",n,{provider:u}),e.textContent=b(\"oauthWaiting\",n,{provider:u}),e.disabled=!0,e.classList.add(\"oauth-btn-loading\");let N=async()=>{if(!(!B()||E||v)){v=!0;try{let A=await this.http.get(`${i}/api/did/session`);B()&&!E&&A?.authenticated===!0&&P()}catch{}finally{v=!1}}};D=setInterval(()=>{let A=!1;try{A=!!p?.closed}catch{return}!A||!B()||(clearInterval(D),T(\"oauthIncomplete\"),g.hidden=!1,N(),C=setInterval(()=>{N()},2e3))},500),F=setTimeout(()=>{if(B()){if(!E){S(\"oauthTimedOut\");return}this.abort?.abort(),w(),x(),W(),I.textContent=b(\"oauthUnconfirmed\",n),L.dataset.state=\"oauthUnconfirmed\",d.hidden=!1,m.hidden=!0,g.hidden=!0,h.href=window.location.href,h.textContent=b(\"oauthCheckSession\",n),this.emit(\"incomplete\")}},300*1e3)}renderSecondaryGrid(t,e,r,n){let i=document.createElement(\"div\");if(i.className=\"methods-grid\",r.includes(\"oauth\")&&this.options.oauthProviders?.length){let a=this.options.oauthProviderOrder??[\"google\",\"apple\",\"github\"],s=u=>a.includes(u)?a.indexOf(u):a.length,o=!!this.options.oauthProviderOrder||this.options.oauthProviders?.some(u=>u.order!==void 0&&u.order!==999),c=(this.options.oauthProviders??[]).filter(u=>u.enabled&&(!n||(o||[\"google\",\"apple\"].includes(u.id))===(n===\"primary\"))).sort((u,f)=>this.options.oauthProviderOrder?s(u.id)-s(f.id):(u.order??999)-(f.order??999)||s(u.id)-s(f.id));for(let u of c){let f=document.createElement(\"button\");f.className=\"method-btn\",f.dataset.provider=u.id;let p=Ye(u.id);f.innerHTML=`${p} ${q(b(\"continueWith\",e,{provider:u.name}))}`,this.markLastUsed(f,`oauth:${u.id}`,e),i.appendChild(f),f.addEventListener(\"click\",()=>{this.select(\"oauth\"),this.activeProvider=u.id,this.startOAuthPopup(u.id,f)})}}if(r.includes(\"email\")){let a=document.createElement(\"button\");a.className=\"method-btn\",a.id=\"email-btn\",a.innerHTML=`${qe} ${q(b(\"emailButton\",e))}`,this.markLastUsed(a,\"email\",e),i.appendChild(a),a.addEventListener(\"click\",()=>{this.select(\"email\"),this.switchView(\"email\")})}if(r.includes(\"did-connect\")){let a=document.createElement(\"button\");a.className=\"method-btn\",a.id=\"did-wallet-btn\";let s=i.children.length>0?b(\"didWalletButtonShort\",e):b(\"didWalletButton\",e);a.innerHTML=`${ve} ${q(s)}`,this.markLastUsed(a,\"did-connect\",e),i.appendChild(a),a.addEventListener(\"click\",()=>{this.select(\"did-connect\"),this.switchView(\"qr\")})}t.appendChild(i)}async startDIDConnectInView(t,e,r,n){t.textContent=b(\"connecting\",n);let i=this.generation,a=()=>this.mounted&&i===this.generation;try{this.tokenSession?.destroy(),this.tokenSession=new ne(this.config,this.http),this.tokenSession.on(\"succeed\",async()=>{if(a()){this.showConnectResult(e,r,t,b(\"verifying\",n));try{let o=this.config.servicePrefix??\"/.well-known/service\";if(await this.http.post(`${o}/api/did/connect/complete`,{token:this.tokenSession.state.token}),!a())return;this.showConnectSuccess(e,r,t,n),this.handleSuccess()}catch(o){if(!a())return;this.showConnectResult(e,r,t,X(o,n),!0)}}}),this.tokenSession.on(\"timeout\",()=>{t.textContent=\"\";let o=document.createElement(\"div\");o.className=\"qr-timeout-overlay\",o.innerHTML=`<span class=\"timeout-text\">${q(b(\"timeout\",n))}</span>`;let c=document.createElement(\"button\");c.className=\"refresh-btn\",c.textContent=b(\"refreshQR\",n),c.addEventListener(\"click\",()=>{o.remove(),ge(e),e.innerHTML='<div class=\"qr-placeholder\"><span class=\"qr-spinner\"></span></div>',r.disabled=!0,this.startDIDConnectInView(t,e,r,n)}),o.appendChild(c),(e.querySelector(\".qr-plate\")??e).appendChild(o)}),this.tokenSession.on(\"error\",o=>{this.showConnectResult(e,r,t,X(o,n),!0)}),this.tokenSession.on(\"statusChange\",o=>{o.status===\"scanned\"&&this.showConnectScanned(e,r,t,n)});let s=await this.tokenSession.create({locale:n});if(!a())return;s.url&&(Fe(e,s.url),r.disabled=!1,r.addEventListener(\"click\",()=>{t.textContent=b(\"walletRetry\",n),this.openInWallet(s.url,n)})),t.textContent=b(\"scanWithWallet\",n),this.tokenSession.startPolling()}catch(s){if(!a())return;t.textContent=X(s,n),ge(e)}}showFullError(t){if(!this.cardEl)return;let e=this.options.locale;this.tokenSession&&(this.tokenSession.destroy(),this.tokenSession=null),this.cardEl.innerHTML=\"\",this.cardEl.dataset.view=\"error\",this.renderCardTools(this.cardEl);let r=document.createElement(\"div\");r.className=\"connect-result\",r.innerHTML='<div class=\"result-icon result-error\">\\u2715</div>',this.cardEl.appendChild(r);let n=document.createElement(\"div\");n.className=\"status error\",n.textContent=t,this.cardEl.appendChild(n);let i=document.createElement(\"button\");i.className=\"btn btn-secondary result-back-btn\",i.textContent=b(\"back\",e),i.addEventListener(\"click\",()=>this.switchView(\"methods\")),this.cardEl.appendChild(i),this.renderTrustFooter(this.cardEl,e)}showConnectScanned(t,e,r,n=\"en\"){t.style.display=\"none\",e.style.display=\"none\";let i=t.parentElement?.querySelector(\".connect-result\");i||(i=document.createElement(\"div\"),i.className=\"connect-result\",t.parentElement?.insertBefore(i,r)),i.innerHTML=`<div class=\"connect-status-icon\">\n <div class=\"connect-spinner-ring\"></div>\n <span class=\"connect-status-badge\">${ve}</span>\n </div>`,r.textContent=b(\"waitingWallet\",n),r.className=\"status\";let a=r.parentElement?.querySelector(\".connect-subtitle\");a||(a=document.createElement(\"p\"),a.className=\"connect-subtitle\",r.parentElement?.insertBefore(a,r.nextSibling)),a.textContent=b(\"walletContinue\",n);let s=r.parentElement?.querySelector(\".result-back-btn\");s||(s=document.createElement(\"button\"),s.className=\"btn btn-secondary result-back-btn\",s.textContent=b(\"back\",n),s.addEventListener(\"click\",()=>this.switchView(\"methods\")),a.parentElement?.insertBefore(s,a.nextSibling))}showConnectSuccess(t,e,r,n=\"en\"){t.style.display=\"none\",e.style.display=\"none\";let i=t.parentElement?.querySelector(\".connect-result\");i||(i=document.createElement(\"div\"),i.className=\"connect-result\",t.parentElement?.insertBefore(i,r)),i.innerHTML=`<div class=\"connect-status-icon connect-success\">\n <svg viewBox=\"0 0 64 64\" width=\"64\" height=\"64\"><circle cx=\"32\" cy=\"32\" r=\"28\" fill=\"none\" stroke=\"#49dc6e\" stroke-width=\"3\"/><polyline points=\"20 33 28 41 44 25\" fill=\"none\" stroke=\"#49dc6e\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>\n </div>`,r.textContent=b(\"success\",n),r.className=\"status success\";let a=r.parentElement?.querySelector(\".connect-subtitle\"),s=r.parentElement?.querySelector(\".result-back-btn\");a?.remove(),s?.remove()}showConnectResult(t,e,r,n,i=!1){let a=this.options.locale;t.style.display=\"none\",e.style.display=\"none\";let s=t.parentElement?.querySelector(\".connect-result\");if(s||(s=document.createElement(\"div\"),s.className=\"connect-result\",t.parentElement?.insertBefore(s,r)),i){s.innerHTML='<div class=\"result-icon result-error\">\\u2715</div>',r.textContent=n,r.className=\"status error\";let o=r.parentElement?.querySelector(\".result-back-btn\");o||(o=document.createElement(\"button\"),o.className=\"btn btn-secondary result-back-btn\",o.textContent=b(\"back\",a),o.addEventListener(\"click\",()=>this.switchView(\"methods\")),r.parentElement?.insertBefore(o,r.nextSibling))}else s.innerHTML='<div class=\"result-icon result-loading\"><span class=\"qr-spinner\"></span></div>',r.textContent=n,r.className=\"status\"}openInWallet(t,e=\"en\"){let r=_e(),n=dt();if(r){let i=t.replace(/^https?:\\/\\//,\"abt://\");window.location.href=i}else if(n&&typeof n.open==\"function\"){let i=this.tokenSession?.state;n.open({action:this.config.action??\"login\",locale:e,url:encodeURIComponent(t),appInfo:i?.appInfo??{},memberAppInfo:i?.memberAppInfo??{}})}else{let i=`${ct}?action=requestAuth&url=${encodeURIComponent(t)}`,a=414,s=736,o=window.screenX+window.innerWidth-a,c=window.screenY;window.open(i,\"did-wallet:popup\",`left=${o},top=${c},width=${a},height=${s},resizable,scrollbars=yes,status=1,popup`)}}handleSuccess(){if(!(!this.mounted||this.completed)){if(this.completed=!0,this.emit(\"success\"),this.options.preferenceKey&&this.activeMethod)try{localStorage.setItem(`did-login-method:${this.options.preferenceKey}`,this.activeMethod===\"oauth\"&&this.activeProvider?`oauth:${this.activeProvider}`:this.activeMethod)}catch{}if(this.options.onSuccess){let t=this.generation;Promise.resolve().then(()=>{if(this.mounted&&t===this.generation)return this.options.onSuccess?.()}).catch(()=>{!this.mounted||t!==this.generation||(this.completed=!1,this.showFullError(b(\"authFailed\",this.options.locale)))})}else setTimeout(()=>location.reload(),300)}}},ht=`${Te}${Se}\n:host { color-scheme: dark; }\n:host([data-theme=\"light\"]) { color-scheme: light; }\ndialog { box-sizing:border-box; position:fixed; inset:0; margin:auto; padding:0;\n width:min(420px,calc(100vw - 32px)); max-width:none; max-height:calc(100dvh - 32px);\n border:1px solid var(--border); border-radius:16px; background:var(--bg-card);\n color:var(--text); color-scheme:inherit; overflow:hidden; box-shadow:var(--shadow-lg); }\ndialog::backdrop { background:rgba(8,10,18,.56); }\n:host(:not([data-theme=\"light\"])) dialog::backdrop { background:rgba(0,0,0,.68); }\n[data-dialog-scroll] { max-height:calc(100dvh - 34px); overflow:auto; overscroll-behavior:contain; }\n.close { position:absolute; top:8px; right:8px; z-index:3; display:grid; place-items:center;\n box-sizing:border-box; width:44px; height:44px; padding:0; border:1px solid transparent;\n border-radius:10px; background:var(--bg-card); color:var(--text-secondary);\n font:400 24px/1 system-ui,sans-serif; cursor:pointer; }\n.close:hover { color:var(--text); background:var(--bg-hover); }\n.close:focus-visible { outline:2px solid var(--blue); outline-offset:-3px; }\n.host-error { padding:16px 20px; font:14px/1.5 system-ui,sans-serif; overflow-wrap:anywhere; }\n.retry { padding:10px 16px; margin:0 20px 20px; color:var(--text); background:var(--bg-elevated);\n border:1px solid var(--border); border-radius:8px; font:inherit; cursor:pointer; }\n`,Le=class{config;http;options;host;dialog;page;previous;themeObserver;systemTheme;syncTheme=()=>this.applyTheme(this.hostTheme());constructor(t,e,r={}){this.config=t,this.http=e,this.options=r}mount(){if(this.dialog)return;let t=document.documentElement.lang;t&&(this.options.locale=t);let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;this.previous=this.options.returnFocus??(e instanceof HTMLElement?e:void 0);let r=document.createElement(\"div\");r.dataset.didLoginDialogHost=\"\",r.style.cssText=\"position:fixed;width:0;height:0;\",this.host=r;let n=r.attachShadow({mode:\"open\"}),i=document.createElement(\"style\");i.textContent=ht,n.append(i);let a=document.createElement(\"dialog\");this.dialog=a,a.setAttribute(\"aria-label\",this.options.purpose?.title??b(\"signIn\",this.options.locale)),n.append(a);let s=document.createElement(\"button\");s.type=\"button\",s.className=\"close\",s.textContent=\"\\xD7\",s.setAttribute(\"aria-label\",b(\"cancel\",this.options.locale));let o=()=>{if(!(this.options.dismissible===!1||this.dialog!==a)){try{this.options.onEvent?.({name:\"cancel\",mode:\"dialog\"})}catch{}this.destroy(),this.options.onCancel?.()}};s.addEventListener(\"click\",o),this.options.dismissible!==!1&&a.append(s);let c=document.createElement(\"div\");c.dataset.dialogScroll=\"\",a.append(c);let u=document.createElement(\"div\");u.dataset.loginDialogMount=\"\",c.append(u),a.addEventListener(\"cancel\",l=>{l.preventDefault(),o()}),document.body.append(r);let f=this.hostTheme();r.dataset.theme=f,this.page=new me(u,this.config,this.http,{...this.options,theme:f,isolate:!0,mode:\"dialog\",onCancel:o,onLocaleChange:l=>{this.options.locale=l,s.setAttribute(\"aria-label\",b(\"cancel\",l)),a.setAttribute(\"aria-label\",this.options.purpose?.title??b(\"signIn\",l)),this.options.onLocaleChange?.(l)},onSuccess:async()=>{let l=()=>{if(!a.isConnected||this.dialog!==a)return;for(let D of c.querySelectorAll(\".host-error, .retry\"))D.remove();let E=document.createElement(\"p\");E.className=\"host-error\",E.setAttribute(\"role\",\"alert\"),E.textContent=b(\"authFailed\",this.options.locale);let v=document.createElement(\"button\");v.type=\"button\",v.className=\"retry\",v.textContent=b(\"tryAgain\",this.options.locale),v.onclick=async()=>{v.disabled=!0;try{await this.options.onSuccess?.(),this.dialog===a&&this.destroy()}catch{l()}},c.append(E,v)};try{await this.options.onSuccess?.(),this.dialog===a&&this.destroy()}catch{l()}}}),this.page.mount(),this.themeObserver=new MutationObserver(this.syncTheme);for(let l of[document.documentElement,document.body])this.themeObserver.observe(l,{attributes:!0,attributeFilter:[\"data-theme\",\"data-mode\",\"class\",\"style\"]});typeof window.matchMedia==\"function\"&&(this.systemTheme=window.matchMedia(\"(prefers-color-scheme: dark)\"),this.systemTheme.addEventListener(\"change\",this.syncTheme)),a.showModal();let p=u.shadowRoot?.querySelector(\"h1, h2\");p&&(p.tabIndex=-1,p.focus({preventScroll:!0}))}hostTheme(){for(let t of[document.documentElement,document.body])for(let e of[\"data-mode\",\"data-theme\"]){let r=t.getAttribute(e);if(r===\"light\"||r===\"dark\")return r;if(r===\"system\"||r===\"auto\")return window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"}for(let t of[document.documentElement,document.body]){if(t.classList.contains(\"dark\"))return\"dark\";if(t.classList.contains(\"light\"))return\"light\"}for(let t of[document.body,document.documentElement]){let e=getComputedStyle(t).colorScheme.split(/\\s+/);if(e.includes(\"light\")&&e.includes(\"dark\"))return window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\";if(e.includes(\"light\"))return\"light\";if(e.includes(\"dark\"))return\"dark\"}return this.options.theme===\"light\"||this.options.theme===\"dark\"?this.options.theme:window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches?\"dark\":\"light\"}setTheme(t){this.options.theme=t,this.applyTheme(t)}applyTheme(t){this.host&&(this.host.dataset.theme=t),this.page?.setTheme(t)}destroy(){this.themeObserver?.disconnect(),this.themeObserver=void 0,this.systemTheme?.removeEventListener(\"change\",this.syncTheme),this.systemTheme=void 0,this.page?.destroy(),this.page=void 0,this.dialog?.close(),this.dialog?.remove(),this.dialog=void 0,this.host?.remove(),this.host=void 0,this.previous?.isConnected&&this.previous.focus({preventScroll:!0})}};return $e(pt);})();\n";
3
3
  //# sourceMappingURL=login-bundle-string.js.map