gestalt-mobile 0.16.1 → 0.16.2
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.
|
@@ -22,4 +22,4 @@ Minimum version required to store current data is: `+c+`.
|
|
|
22
22
|
prompt before it expires.</p>`),Zd=q(`<p class="warning svelte-1c5qcm6"><strong class="svelte-1c5qcm6">Trust-on-first-use:</strong> anyone who can reach an empty relay instance could claim
|
|
23
23
|
first-device access. Enroll this device before exposing the instance, and confirm you are at the
|
|
24
24
|
canonical address before continuing.</p>`),Qd=q(`<p class="error svelte-1c5qcm6">Passkeys require a secure browser on this device.</p>`),$d=q(`<p class="feedback svelte-1c5qcm6"> </p>`),ef=q(`<img alt="QR code for the first-device setup link" class="svelte-1c5qcm6"/>`),tf=q(`<div class="handoff svelte-1c5qcm6"><!> <div class="svelte-1c5qcm6"><h2 class="svelte-1c5qcm6">Continue on your phone</h2> <p class="svelte-1c5qcm6">Scanning opens this same setup page. You will still choose a nickname and explicitly
|
|
25
|
-
authorize that device.</p> <a class="svelte-1c5qcm6"> </a> <button type="button" class="copy svelte-1c5qcm6">Copy setup link</button></div></div>`),nf=q(`<main class="enrollment svelte-1c5qcm6" aria-live="polite"><section class="card svelte-1c5qcm6" aria-labelledby="enrollment-title"><p class="brand svelte-1c5qcm6">Gestalt / Dyne</p> <h1 id="enrollment-title" class="svelte-1c5qcm6"> </h1> <!> <label for="device-nickname" class="svelte-1c5qcm6">Device nickname</label> <input id="device-nickname" name="device-nickname" autocomplete="nickname" required="" enterkeyhint="done" class="svelte-1c5qcm6"/> <button class="authorize svelte-1c5qcm6" type="button"> </button> <!> <!> <!></section></main>`);function rf(e,t){Xe(t,!0);let n=I(``),r=I(null),i=I(!1),a=I(null),o=!0,s=!0,c=P(()=>Bu(t.canonicalOrigin)),l=null;function u(){return window.isSecureContext&&window.PublicKeyCredential!==void 0}function d(){l&&clearInterval(l),l=null}function f(e){if(o=!1,d(),e===`authenticated`){t.onAuthenticated();return}t.onLocked(`Another device has already enrolled this relay. Sign in with that device’s passkey.`)}async function p(){if(document.visibilityState===`visible`)try{let e=await t.client.status();if(e.status!==`bootstrap`){if(!s)return;f(e.status)}}catch{}}Mi(()=>{t.enrollmentTicket||Vu(t.canonicalOrigin).then(e=>{s&&L(a,e,!0)}).catch(()=>{s&&L(r,`Setup QR unavailable. Use the setup link below.`)})
|
|
25
|
+
authorize that device.</p> <a class="svelte-1c5qcm6"> </a> <button type="button" class="copy svelte-1c5qcm6">Copy setup link</button></div></div>`),nf=q(`<main class="enrollment svelte-1c5qcm6" aria-live="polite"><section class="card svelte-1c5qcm6" aria-labelledby="enrollment-title"><p class="brand svelte-1c5qcm6">Gestalt / Dyne</p> <h1 id="enrollment-title" class="svelte-1c5qcm6"> </h1> <!> <label for="device-nickname" class="svelte-1c5qcm6">Device nickname</label> <input id="device-nickname" name="device-nickname" autocomplete="nickname" required="" enterkeyhint="done" class="svelte-1c5qcm6"/> <button class="authorize svelte-1c5qcm6" type="button"> </button> <!> <!> <!></section></main>`);function rf(e,t){Xe(t,!0);let n=I(``),r=I(null),i=I(!1),a=I(null),o=!0,s=!0,c=P(()=>Bu(t.canonicalOrigin)),l=null;function u(){return window.isSecureContext&&window.PublicKeyCredential!==void 0}function d(){l&&clearInterval(l),l=null}function f(e){if(o=!1,d(),e===`authenticated`){t.onAuthenticated();return}t.onLocked(`Another device has already enrolled this relay. Sign in with that device’s passkey.`)}async function p(){if(document.visibilityState===`visible`)try{let e=await t.client.status();if(e.status!==`bootstrap`){if(!s)return;f(e.status)}}catch{}}Mi(()=>{t.enrollmentTicket||Vu(t.canonicalOrigin).then(e=>{s&&L(a,e,!0)}).catch(()=>{s&&L(r,`Setup QR unavailable. Use the setup link below.`)});let e=window.matchMedia?.(`(min-width: 768px)`).matches??!1;!t.enrollmentTicket&&e&&(l=setInterval(()=>void p(),15e3))}),Ni(()=>{s=!1,o=!1,d()});async function m(){if(!navigator.clipboard?.writeText){L(r,`Copy is unavailable here. Select and copy the visible setup link.`);return}try{await navigator.clipboard.writeText(G(c)),L(r,`Setup link copied.`)}catch{L(r,`Copy is unavailable here. Select and copy the visible setup link.`)}}async function h(){let e=G(n).trim();if(!e){L(r,`Enter a device nickname before authorizing it.`);return}if(!u()){L(r,`Passkeys require a secure browser on this device.`);return}if(!(G(i)||!o)){L(i,!0),L(r,null);try{let{options:n}=await t.client.registrationOptions(t.enrollmentTicket);if(!s||!o)return;let r=await Bd({optionsJSON:n});if(!s||!o||(await t.client.verifyRegistration(r,e),!s||!o))return;d(),t.onAuthenticated()}catch(e){if(e instanceof Error&&[`AUTH_REQUEST_FAILED_409`,`BOOTSTRAP_ALREADY_CLAIMED`].includes(e.message)){d(),t.onLocked(`Another device completed setup first. Sign in with that device’s passkey.`);return}L(r,qd(e),!0)}finally{L(i,!1)}}}var g=nf(),_=z(g),v=V(z(_),2),y=z(v,!0);N(v);var b=V(v,2),x=e=>{J(e,Xd())},S=e=>{J(e,Zd())};X(b,e=>{t.enrollmentTicket?e(x):e(S,-1)});var C=V(b,4);xi(C);var w=V(C,2),T=z(w,!0);N(w);var E=V(w,2),D=e=>{J(e,Qd())},O=P(()=>!u());X(E,e=>{G(O)&&e(D)});var k=V(E,2),ee=e=>{var t=$d(),n=z(t,!0);N(t),H(()=>Y(n,G(r))),J(e,t)};X(k,e=>{G(r)&&e(ee)});var te=V(k,2),ne=e=>{var t=tf(),n=z(t),r=e=>{var t=ef();H(()=>Q(t,`src`,G(a))),J(e,t)};X(n,e=>{G(a)&&e(r)});var i=V(n,2),o=V(z(i),4),s=z(o,!0);N(o);var l=V(o,2);N(i),N(t),H(()=>{Q(o,`href`,G(c)),Y(s,G(c))}),K(`click`,l,()=>void m()),J(e,t)};X(te,e=>{t.enrollmentTicket||e(ne)}),N(_),N(g),H(e=>{Y(y,t.enrollmentTicket?`Authorize this device`:`Authorize the first device`),w.disabled=e,Y(T,G(i)?`Authorizing device…`:`Authorize this device`)},[()=>G(i)||!u()]),Di(C,()=>G(n),e=>L(n,e)),K(`click`,w,()=>void h()),J(e,g),Ze()}jr([`click`]);var af=q(`<p class="error svelte-1byekj9">Passkeys require this relay to be opened over a secure connection.</p>`),of=q(`<p class="error svelte-1byekj9">This browser does not support passkeys. Use an authorized browser or device.</p>`),sf=q(`<p class="svelte-1byekj9"> </p> <button class="sign-in svelte-1byekj9" type="button"> </button>`,1),cf=q(`<main class="login svelte-1byekj9" aria-live="polite"><section class="card svelte-1byekj9" aria-labelledby="login-title"><p class="brand svelte-1byekj9">Gestalt / Dyne</p> <h1 id="login-title" class="svelte-1byekj9">Unlock relay</h1> <!></section></main>`);function lf(e,t){Xe(t,!0);let n=I(``),r=I(!1),i=I(void 0);function a(){return window.isSecureContext&&window.PublicKeyCredential!==void 0}function o(e){return e instanceof Error&&[`NotAllowedError`,`AbortError`,`SecurityError`].includes(e.name)?qd(e):`We could not complete sign-in. Please try again.`}Mi(()=>{L(n,t.message??`Use a passkey from an authorized device to unlock this relay.`,!0),G(i)?.focus()});async function s(){if(!(G(r)||!a())){L(r,!0),L(n,``);try{let{options:e}=await t.client.loginOptions(),n=await Gd({optionsJSON:e});await t.client.verifyLogin(n),t.onAuthenticated()}catch(e){L(n,o(e),!0)}finally{L(r,!1)}}}var c=cf(),l=z(c),u=V(z(l),4),d=e=>{J(e,af())},f=e=>{J(e,of())},p=e=>{var t=sf(),a=B(t),o=z(a,!0);N(a);var c=V(a,2),l=z(c,!0);N(c),ji(c,e=>L(i,e),()=>G(i)),H(()=>{Y(o,G(n)),c.disabled=G(r),Y(l,G(r)?`Waiting for passkey…`:`Sign in with a passkey`)}),K(`click`,c,()=>void s()),J(e,t)};X(u,e=>{window.isSecureContext?window.PublicKeyCredential===void 0?e(f,1):e(p,-1):e(d)}),N(l),N(c),J(e,c),Ze()}jr([`click`]);var uf=q(`<p>Checking this device…</p>`),df=q(`<h1 class="svelte-y74n0s">Passkey support is required</h1> <p> </p>`,1),ff=q(`<h1 class="svelte-y74n0s">Unable to check this device</h1> <p> </p> <button type="button" class="svelte-y74n0s">Try again</button>`,1),pf=q(`<main class="auth-gate svelte-y74n0s" aria-live="polite"><!></main>`);function mf(e,t){Xe(t,!0);let n=$(t,`initialTheme`,3,`dyne-org`),r=I(void 0),i=P(()=>G(r)??t.enrollmentTicket),a=I(R({kind:`checking`})),o=!1,s=Dd(),c=Yd(s,e=>L(a,e,!0)),l=Od(()=>c.locked(`Your session ended. Sign in with your passkey to continue.`));Mi(()=>{c.check(G(i))});function u(e){L(r,e,!0),L(a,{kind:`enrollment`,publicOrigin:G(a).kind===`authenticated`?``:`http://localhost`},!0)}async function d(){if(!(o||G(a).kind!==`authenticated`)){o=!0,c.locked(`Relay locked. Sign in with your passkey to continue.`);try{await s.logout()}catch{c.locked(`Relay locked locally. Recheck your connection before signing in again.`)}finally{o=!1}}}var f=zr(),p=B(f),m=e=>{xd(e,{get authorizedFetch(){return l},get theme(){return n()},get passkeyAuthEnabled(){return G(a).passkeyAuthEnabled},onlock:()=>void d(),oncreatepasskey:u})},h=e=>{rf(e,{get client(){return s},get canonicalOrigin(){return G(a).publicOrigin},get enrollmentTicket(){return G(i)},onAuthenticated:()=>c.authenticated(),onLocked:e=>c.locked(e)})},g=e=>{lf(e,{get client(){return s},get message(){return G(a).message},onAuthenticated:()=>c.authenticated()})},_=e=>{var t=pf(),n=z(t),r=e=>{J(e,uf())},i=e=>{var t=df(),n=V(B(t),2),r=z(n,!0);N(n),H(()=>Y(r,G(a).message)),J(e,t)},o=e=>{var t=ff(),n=V(B(t),2),r=z(n,!0);N(n);var i=V(n,2);H(()=>Y(r,G(a).message)),K(`click`,i,()=>void c.retry()),J(e,t)};X(n,e=>{G(a).kind===`checking`?e(r):G(a).kind===`unsupported`?e(i,1):G(a).kind===`error`&&e(o,2)}),N(t),J(e,t)};X(p,e=>{G(a).kind===`authenticated`?e(m):G(a).kind===`bootstrap`||G(a).kind===`enrollment`?e(h,1):G(a).kind===`locked`?e(g,2):e(_,-1)}),J(e,f),Ze()}jr([`click`]);function hf(e,t){let n=e.hash;if(!n.startsWith(`#enroll=`))return;let r=/^#enroll=([^&]+)$/.exec(n);if(t.replaceState(t.state,``,`${e.pathname}${e.search}`),!(!r||!r[1]))try{return decodeURIComponent(r[1])||void 0}catch{return}}function gf(e,t,n,r=Br,i={}){return r(mf,{target:e,props:{enrollmentTicket:hf(t,n),initialTheme:Gi(i)}})}function _f(){return{readyState:document.readyState,addLoadListener:e=>window.addEventListener(`load`,e,{once:!0}),serviceWorker:navigator.serviceWorker}}function vf(e=_f()){if(!e.serviceWorker)return;let t=()=>{e.serviceWorker?.register(`/service-worker.js`,{scope:`/`}).catch(()=>void 0)};if(e.readyState===`complete`){t();return}e.addLoadListener(t)}var yf=document.getElementById(`app`);if(!yf)throw Error(`Missing application mount target`);gf(yf,window.location,window.history),vf();
|
package/dist/client/index.html
CHANGED
|
@@ -16,7 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
16
16
|
<link rel="icon" href="/icons/gestalt-mobile-192.png" />
|
|
17
17
|
<link rel="apple-touch-icon" href="/icons/gestalt-mobile-180.png" />
|
|
18
18
|
<title>Gestalt Mobile</title>
|
|
19
|
-
<script type="module" crossorigin src="/assets/index-
|
|
19
|
+
<script type="module" crossorigin src="/assets/index-DT1VwqSF.js"></script>
|
|
20
20
|
<link rel="stylesheet" crossorigin href="/assets/index-BotpWcLh.css">
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|