@lobu/runtime-server 20.1.0 → 20.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component.json +1 -1
- package/dist/connectors/chat-user-identity.ts +41 -0
- package/dist/connectors/google-identity.ts +11 -0
- package/dist/connectors/slack-identity.ts +19 -0
- package/dist/db/migrations/20260915030000_owner_dm_delivery_request_platform.sql +51 -0
- package/dist/dependencies.bun.lock +28 -30
- package/dist/owletto/dist/assets/{_-DdvHIadV.js → _-Ds4DyQjj.js} +2 -2
- package/dist/owletto/dist/assets/_-VmyR6aN_.js +1 -0
- package/dist/owletto/dist/assets/{_agentId-DbTBU4KZ.js → _agentId-BAVnp0c7.js} +1 -1
- package/dist/owletto/dist/assets/_agentId-Df-3rGi5.js +1 -0
- package/dist/owletto/dist/assets/{_automationId-C7dZzg6X.js → _automationId-D696vOjd.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey._connectionId-NQf43Ew3.js → _connectorKey._connectionId-BAJGfcy7.js} +1 -1
- package/dist/owletto/dist/assets/{_connectorKey.index-D-0ZNsgM.js → _connectorKey.index-BBF8vGJS.js} +1 -1
- package/dist/owletto/dist/assets/{_conversationId-F5YmyLV9.js → _conversationId-Ci4rgrHm.js} +1 -1
- package/dist/owletto/dist/assets/{_deploymentId-3LTMi0ZT.js → _deploymentId-Iy-D5PDq.js} +1 -1
- package/dist/owletto/dist/assets/_name-CeGwb0oK.js +1 -0
- package/dist/owletto/dist/assets/{_owner-DglbbDEx.js → _owner-CFR1G8OX.js} +1 -1
- package/dist/owletto/dist/assets/_skillKey-DuLcQWBu.js +1 -0
- package/dist/owletto/dist/assets/{_slug-CnQDfsCE.js → _slug-CDSO20ac.js} +1 -1
- package/dist/owletto/dist/assets/{accept-invitation-Dgoyublh.js → accept-invitation-Db5jklHT.js} +1 -1
- package/dist/owletto/dist/assets/{activity-route-view-BNzKO6aD.js → activity-route-view-DVW3DoB7.js} +1 -1
- package/dist/owletto/dist/assets/{agent-card-controls-VJgcB5-0.js → agent-card-controls-CZO6GI0s.js} +1 -1
- package/dist/owletto/dist/assets/{agent-client-setup-list-C5KRNRw3.js → agent-client-setup-list-_chLOorY.js} +1 -1
- package/dist/owletto/dist/assets/{agent-connect-pages-BFSb6vmW.js → agent-connect-pages-DWBgSIYT.js} +1 -1
- package/dist/owletto/dist/assets/{agent-editor-form-CajEehVn.js → agent-editor-form-BTNlg0kQ.js} +1 -1
- package/dist/owletto/dist/assets/{agent-guardrails-route-CZ_rXj-3.js → agent-guardrails-route-B5uoMC6o.js} +1 -1
- package/dist/owletto/dist/assets/{agent-loading-shells-Dczhk067.js → agent-loading-shells-CLoLeFcB.js} +1 -1
- package/dist/owletto/dist/assets/{agent-permissions-matrix-DIVHvpZG.js → agent-permissions-matrix-TP00-MYL.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skill-context-CxglCznW.js → agent-skill-context-D4a2QCoZ.js} +1 -1
- package/dist/owletto/dist/assets/{agent-skills-route-CatU8soC.js → agent-skills-route-KVDDTbJB.js} +1 -1
- package/dist/owletto/dist/assets/{agent-subpage-shell-DVSUdIBn.js → agent-subpage-shell-DuVYZvBE.js} +1 -1
- package/dist/owletto/dist/assets/{agent-thread-DnLUOzXk.js → agent-thread-CzCJU3-R.js} +1 -1
- package/dist/owletto/dist/assets/agents-DFs57C3c.js +1 -0
- package/dist/owletto/dist/assets/{agents-workbench-BOKifKIO.js → agents-workbench-C2bUlJP2.js} +1 -1
- package/dist/owletto/dist/assets/{app._appId-BXmITXO7.js → app._appId-D0_LQTJU.js} +1 -1
- package/dist/owletto/dist/assets/{automation-detail-content-wJC9hhmA.js → automation-detail-content-DWkdhnv2.js} +1 -1
- package/dist/owletto/dist/assets/automations-DFs57C3c.js +1 -0
- package/dist/owletto/dist/assets/{calendar-taCoBmAh.js → calendar-C0XpOHd8.js} +1 -1
- package/dist/owletto/dist/assets/{callback-CJxC8u_x.js → callback-CO_K9eR-.js} +1 -1
- package/dist/owletto/dist/assets/{card-kpw3EaKC.js → card-DeFQuU_J.js} +1 -1
- package/dist/owletto/dist/assets/{claim-DLHRN0bA.js → claim-CUpWOSie.js} +1 -1
- package/dist/owletto/dist/assets/{clients-R4JsT_Fz.js → clients-DhYr4lyL.js} +1 -1
- package/dist/owletto/dist/assets/{code-editor-D3X0yQdI.js → code-editor-BqGUZFt6.js} +1 -1
- package/dist/owletto/dist/assets/connect-Dtb-E5An.js +1 -0
- package/dist/owletto/dist/assets/connect._clientId-DWtceAAw.js +1 -0
- package/dist/owletto/dist/assets/{connected._clientId-ByH4etku.js → connected._clientId-CMe-wTuV.js} +1 -1
- package/dist/owletto/dist/assets/{connection-DdBkXNbX.js → connection-BgAlYjeV.js} +1 -1
- package/dist/owletto/dist/assets/{connection-feed-detail-DF93zx0A.js → connection-feed-detail-B3ePAinf.js} +1 -1
- package/dist/owletto/dist/assets/{connector-provenance-N3sc0nbo.js → connector-provenance-DgsDg0Z9.js} +1 -1
- package/dist/owletto/dist/assets/{connectors-Ckn_aoNE.js → connectors-CqPQPo9U.js} +1 -1
- package/dist/owletto/dist/assets/{consent-Bi6KCVtT.js → consent-bswcIzsf.js} +1 -1
- package/dist/owletto/dist/assets/{core.esm-CFYXLQXH.js → core.esm-DsLgjoel.js} +1 -1
- package/dist/owletto/dist/assets/create-CcXUdke7.js +1 -0
- package/dist/owletto/dist/assets/create-Cp6hMoeU.js +1 -0
- package/dist/owletto/dist/assets/{create-BiHpu2f4.js → create-Dwo04oWV.js} +1 -1
- package/dist/owletto/dist/assets/{create-automation-form-Cv2RHsQ6.js → create-automation-form-CJ4meayB.js} +1 -1
- package/dist/owletto/dist/assets/{create._connectorKey-Qynix_hA.js → create._connectorKey-CCBb2pil.js} +1 -1
- package/dist/owletto/dist/assets/{cronstrue-D7xlYtGk.js → cronstrue-ChFyC9ps.js} +1 -1
- package/dist/owletto/dist/assets/deployments-CjfFxyDA.js +1 -0
- package/dist/owletto/dist/assets/{deployments-body-BPCALbQe.js → deployments-body-Cg0KiWGr.js} +1 -1
- package/dist/owletto/dist/assets/device-DpY67Jaj.js +1 -0
- package/dist/owletto/dist/assets/{device-pin-tombstone-DrTJYNKG.js → device-pin-tombstone-1ikyqSdb.js} +1 -1
- package/dist/owletto/dist/assets/{device-rows-fVm-zAiU.js → device-rows-Cp3yMcuV.js} +1 -1
- package/dist/owletto/dist/assets/{device._deviceId-CIe7taim.js → device._deviceId-DTYKGBY8.js} +1 -1
- package/dist/owletto/dist/assets/{entity-options-DOGD_EyZ.js → entity-options-1EaSGMX4.js} +1 -1
- package/dist/owletto/dist/assets/{entity-page-C8oDszRY.js → entity-page-DJmM70dv.js} +1 -1
- package/dist/owletto/dist/assets/{entity-type-page-BfxIgJLq.js → entity-type-page-C3mT7tXn.js} +1 -1
- package/dist/owletto/dist/assets/{events-feed-B9OqmSBy.js → events-feed-iliGfjit.js} +1 -1
- package/dist/owletto/dist/assets/{full-page-spinner-DTSqneUO.js → full-page-spinner-BN2G_YiM.js} +1 -1
- package/dist/owletto/dist/assets/guardrails-CLlnRRy9.js +1 -0
- package/dist/owletto/dist/assets/identity-MSLryUi8.js +1 -0
- package/dist/owletto/dist/assets/index-3o4Eepb4.js +1 -0
- package/dist/owletto/dist/assets/{index-Bfux0kHb.js → index-BUr8321-.js} +3 -3
- package/dist/owletto/dist/assets/{index-CK2-iHcz.js → index-Bulu5ldM.js} +1 -1
- package/dist/owletto/dist/assets/{index-DcWyuLQS.js → index-BvbfITqH.js} +1 -1
- package/dist/owletto/dist/assets/{index-Bq4m-sK0.js → index-C-u4yR8Z.js} +1 -1
- package/dist/owletto/dist/assets/{index-DkKALC2l.js → index-C2oCgDX7.js} +1 -1
- package/dist/owletto/dist/assets/{index-jGZeANLE.js → index-C6VAJ8Ku.js} +1 -1
- package/dist/owletto/dist/assets/index-Clw9ZBj-.js +1 -0
- package/dist/owletto/dist/assets/index-D2oL4Ydo.js +1 -0
- package/dist/owletto/dist/assets/index-D7wulT4y.js +1 -0
- package/dist/owletto/dist/assets/{index-COgBJ_ab.js → index-DOLFe19K.js} +1 -1
- package/dist/owletto/dist/assets/index-DTSA0Xh1.js +1 -0
- package/dist/owletto/dist/assets/index-DxXXVPU0.js +1 -0
- package/dist/owletto/dist/assets/{index-CMOHHdFH.js → index-hSE2E46p.js} +1 -1
- package/dist/owletto/dist/assets/index-nzvsA3hT.js +1 -0
- package/dist/owletto/dist/assets/{index-DYe_DVHa.js → index-vdqhlocx.js} +1 -1
- package/dist/owletto/dist/assets/{json-diff-CANZD4MQ.js → json-diff-DnsW7Pin.js} +1 -1
- package/dist/owletto/dist/assets/{list-skeleton-DZTUxpBx.js → list-skeleton-CHzLN7GK.js} +1 -1
- package/dist/owletto/dist/assets/{login-D53geSP7.js → login-CCKNM0gV.js} +1 -1
- package/dist/owletto/dist/assets/{logout-DKQS25qd.js → logout-B-N2aodZ.js} +1 -1
- package/dist/owletto/dist/assets/{member-scope-gate-C4QyRm2Q.js → member-scope-gate-B560Wg-t.js} +1 -1
- package/dist/owletto/dist/assets/{memory-browse-page-DOpV3vht.js → memory-browse-page-DMDqKJn7.js} +1 -1
- package/dist/owletto/dist/assets/{model-selector-CvU3VP90.js → model-selector-DfbmHjLu.js} +1 -1
- package/dist/owletto/dist/assets/models-M51OGDRE.js +1 -0
- package/dist/owletto/dist/assets/{new-B8_sRMYD.js → new-BVQS9H-Y.js} +1 -1
- package/dist/owletto/dist/assets/{new-DIjOVXrQ.js → new-Df_dY6Z5.js} +1 -1
- package/dist/owletto/dist/assets/{new-Df1q7GEj.js → new-DxDVE9nL.js} +1 -1
- package/dist/owletto/dist/assets/{oauth-workspace-access-DWfiekRz.js → oauth-workspace-access-D9GmiMfK.js} +1 -1
- package/dist/owletto/dist/assets/{organization-DHEC7kDq.js → organization-uSDYkJpX.js} +1 -1
- package/dist/owletto/dist/assets/{permissions-i7iwnE1a.js → permissions-Fe0DP6b8.js} +1 -1
- package/dist/owletto/dist/assets/{proposal-review-shell-C_LcyUEF.js → proposal-review-shell-D9HwnDda.js} +1 -1
- package/dist/owletto/dist/assets/{recent-By19_Buq.js → recent-C03LhMD7.js} +1 -1
- package/dist/owletto/dist/assets/{renderer-B1UThnk2.js → renderer-CHNejd95.js} +1 -1
- package/dist/owletto/dist/assets/{reset-password-Dsz5-Xeo.js → reset-password-CuISnlG_.js} +1 -1
- package/dist/owletto/dist/assets/{runs-BQ11PAQT.js → runs-BnYdToDc.js} +1 -1
- package/dist/owletto/dist/assets/{runs-panel-wkV1aGD9.js → runs-panel-DsdESupx.js} +1 -1
- package/dist/owletto/dist/assets/{runs-table-DzSWYkaf.js → runs-table-B7jKuILd.js} +1 -1
- package/dist/owletto/dist/assets/{schema-value-normalization--DhnhJNf.js → schema-value-normalization-B--OWDL8.js} +1 -1
- package/dist/owletto/dist/assets/settings-Bg9yCCoN.js +1 -0
- package/dist/owletto/dist/assets/{settings-Bu239SXe.js → settings-wGNHtsDP.js} +1 -1
- package/dist/owletto/dist/assets/skills-CN5Ube7A.js +1 -0
- package/dist/owletto/dist/assets/{switch-CCKllS7w.js → switch-Dzse_XFM.js} +1 -1
- package/dist/owletto/dist/assets/{use-mention-search-CldNZTiT.js → use-mention-search-uyW1Uwf6.js} +1 -1
- package/dist/owletto/dist/index.html +1 -1
- package/dist/server-main.bundle.mjs +9903 -9541
- package/npm-shrinkwrap.json +116 -140
- package/package.json +1 -1
- package/vendor/connector-sdk/package.json +1 -1
- package/vendor/core/dist/credentials.d.ts +16 -1
- package/vendor/core/dist/credentials.js +10 -1
- package/vendor/core/package.json +1 -1
- package/dist/owletto/dist/assets/_-CfcfHJO8.js +0 -1
- package/dist/owletto/dist/assets/_agentId-BTmFhpb6.js +0 -1
- package/dist/owletto/dist/assets/_name-BKeZbc-h.js +0 -1
- package/dist/owletto/dist/assets/_skillKey-DhiGYYFq.js +0 -1
- package/dist/owletto/dist/assets/agents-OLmcj-qM.js +0 -1
- package/dist/owletto/dist/assets/automations-OLmcj-qM.js +0 -1
- package/dist/owletto/dist/assets/connect-1ysEq9l0.js +0 -1
- package/dist/owletto/dist/assets/connect._clientId-BbMPs6l3.js +0 -1
- package/dist/owletto/dist/assets/create-C37QtjbJ.js +0 -1
- package/dist/owletto/dist/assets/create-kAQa5_Q7.js +0 -1
- package/dist/owletto/dist/assets/deployments-C5kSeowq.js +0 -1
- package/dist/owletto/dist/assets/device-DToHXxDM.js +0 -1
- package/dist/owletto/dist/assets/guardrails-9Mr6avxk.js +0 -1
- package/dist/owletto/dist/assets/identity-DMfCjdBz.js +0 -1
- package/dist/owletto/dist/assets/index-CkwwaMrx.js +0 -1
- package/dist/owletto/dist/assets/index-D0lZrXrY.js +0 -1
- package/dist/owletto/dist/assets/index-DZadnZpq.js +0 -1
- package/dist/owletto/dist/assets/index-DlqjyZKQ.js +0 -1
- package/dist/owletto/dist/assets/index-Dv0huHrO.js +0 -1
- package/dist/owletto/dist/assets/index-DxIDxgPJ.js +0 -1
- package/dist/owletto/dist/assets/index-bKUccXCc.js +0 -1
- package/dist/owletto/dist/assets/models-ooBIWFuB.js +0 -1
- package/dist/owletto/dist/assets/settings-FxbIvOhH.js +0 -1
- package/dist/owletto/dist/assets/skills-MBZ5ilDK.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a2 as ye,Y as je,aq as we,a7 as ve,r as i,ar as ne,j as e,s as h,as as ke,at as z,au as Ne,av as Se,aw as Ce,an as Ee,ag as Le,ao as Ue,ax as se}from"./index-Bfux0kHb.js";import{s as Fe}from"./index-CMOHHdFH.js";import{C as Pe,c as Me}from"./card-kpw3EaKC.js";function A(m){if(!m||typeof m!="object")return null;const u=m.error;if(typeof u=="string")return u;if(u&&typeof u=="object"){const s=u.message;if(typeof s=="string"&&s.length>0)return s}const x=m.message;return typeof x=="string"&&x.length>0?x:null}async function re(m,u){if(typeof window>"u")return;const x=window.PasswordCredential;if(!(!x||!navigator.credentials?.store))try{const s=new x({id:m,password:u});await navigator.credentials.store(s)}catch{}}function S(m){return m?m.toLowerCase().replaceAll("_"," ").trim().includes("account not linked")?"This social account matches an existing Lobu user. Sign in with a magic link to verify ownership, then continue.":m:null}function Re(){const m=ye(),{session:u,isReady:x}=je(),{data:s,isLoading:E,error:R}=we(),o=ve({from:"/auth/login"}),q=o.invitationOrg,[b,y]=i.useState("social"),[c,L]=i.useState(o.intent??"sign-in"),[$,ie]=i.useState(""),[a,B]=i.useState(()=>o.loginHint??""),[w,ae]=i.useState(""),[v,oe]=i.useState(""),[U,D]=i.useState(""),[le,H]=i.useState(!1),[l,d]=i.useState(null),[F,r]=i.useState(null),[ce,_]=i.useState(!1),[de,V]=i.useState(!1),[J,ue]=i.useState(!1),G=i.useRef(!1),C=o.callbackUrl,Y=o.mode==="extension",O=o.error==="account_not_linked",K=S(o.errorDescription||o.error),P=Object.values(s?.social??{}).some(Boolean),k=!!s?.magicLink,M=!!s?.phone,p=!!s?.emailPassword,Q=!!s?.passkey,f=!!s?.singleUserMode,X=!!s?.hasUser,T=f,j=i.useMemo(()=>{const t=[];return p&&t.push("email-password"),P&&t.push("social"),k&&t.push("magic-link"),M&&t.push("whatsapp"),t},[p,k,P,M]),me=i.useMemo(()=>p?j.filter(t=>t!=="magic-link"&&t!=="social"):j,[j,p]),W=R instanceof Error?R.message:R?"Unable to load sign-in options.":null;i.useEffect(()=>{if(u){const t=ne(C);C?window.location.href=t:m({to:"/"})}},[u,m,C]),i.useEffect(()=>{!s||j.length===0||j.includes(b)||y(j[0])},[s,b,j]),i.useEffect(()=>{!k||!O||(y("magic-link"),o.loginHint&&!a&&B(o.loginHint))},[k,O,o.loginHint,a]),i.useEffect(()=>{o.intent&&L(o.intent)},[o.intent]),i.useEffect(()=>{if(!f||!s)return;const t=X?"sign-in":"sign-up";c!==t&&L(t)},[f,X,s,c]);const N=()=>C?ne(C):"/",Z=async t=>{d(t),r(null);try{const n=await z.social({provider:t,callbackURL:N(),newUserCallbackURL:C?N():`/?onboard_provider=${encodeURIComponent(t)}`}),g=A(n);if(g){const I=S(g);I?.toLowerCase().includes("magic link")&&y("magic-link"),r(I)}}catch(n){r(S(n instanceof Error?n.message:`Failed to sign in with ${t}`))}finally{d(null)}};i.useEffect(()=>{if(G.current||!x||u||E||!s||o.error)return;const t=o.provider;t&&Object.hasOwn(s.social??{},t)&&s.social?.[t]&&(G.current=!0,Z(t))},[s,E,u,x,o.provider,o.error]);const ee=async()=>{if(a){d("magic-link"),r(null);try{return await z.magicLink({email:a,callbackURL:N()}),_(!0),!0}catch(t){return r(t instanceof Error?t.message:"Failed to send magic link"),!1}finally{d(null)}}},ge=async t=>{t.preventDefault(),await ee()},pe=async t=>{if(t.preventDefault(),!(!a||!w)){d("email-password"),r(null);try{if(c==="sign-up"){const n=await Se.email({email:a,password:w,name:$||a.split("@")[0]||"User",callbackURL:N()}),g=A(n);if(g){r(S(g));return}if(await re(a,w),f&&Q)try{await Ce.passkey.addPasskey({name:$||`${navigator.platform||"This device"}`})}catch{}}else{const n=await z.email({email:a,password:w,callbackURL:N()}),g=A(n);if(g){r(S(g));return}if(!n?.data){r("Invalid email or password");return}await re(a,w)}}catch(n){const g=n instanceof Error?n.message:typeof n=="string"?n:A(n);r(g||"Authentication failed")}finally{d(null)}}},te=async()=>{r(null),ue(!0),d("local");try{const t=await Ne();if(!t.ok){const n=await t.json().catch(()=>null);r(n?.error_description??"Could not sign in to your local install.");return}window.location.href=N()}catch(t){r(t instanceof Error?t.message:"Could not sign in to your local install.")}finally{d(null)}};i.useEffect(()=>{T&&s&&!u&&!J&&te()},[T,s,u,J]);const fe=async()=>{if(!a){r("Enter your email address first to reset your password.");return}d("reset-password-request"),r(null);try{const t=`${window.location.origin}/auth/reset-password`,n=await Ee(`${Le}/api/auth/request-password-reset`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:a,redirectTo:t})});if(!n.ok)throw await Ue(n);V(!0)}catch(t){r(t instanceof Error?t.message:"Failed to send password reset email")}finally{d(null)}},he=async t=>{if(t.preventDefault(),!!v){d("phone"),r(null);try{await se.sendOtp({phoneNumber:v}),H(!0)}catch(n){r(n instanceof Error?n.message:"Failed to send verification code")}finally{d(null)}}},xe=async t=>{if(t.preventDefault(),!(!v||!U)){d("verify"),r(null);try{await se.verify({phoneNumber:v,code:U})}catch(n){r(n instanceof Error?n.message:"Invalid verification code"),d(null)}}};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsx("h1",{className:"text-2xl font-bold",children:q?`Sign in to join ${q}`:f&&c==="sign-up"?"Set up your local install":f?"Welcome back":c==="sign-up"?"Create your account":"Sign in"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:q?"Sign in with the email your invitation was sent to.":f&&c==="sign-up"?"This account stays on this machine. Email is just an identifier — pick anything you’ll remember.":f?"Sign in to your local install.":Y?"Sign in to connect the browser extension":c==="sign-up"?"Choose a sign-up method":"Choose your preferred sign-in method"}),f&&e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 px-3 py-1.5 bg-muted text-muted-foreground rounded-full text-xs",children:[e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"Local install · nothing sent to lobu.ai"]}),Y&&e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 px-3 py-1.5 bg-primary/10 text-primary rounded-full text-sm",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),"Browser Extension"]})]}),e.jsx(Pe,{children:e.jsx(Me,{children:T?e.jsx("div",{className:"space-y-4",children:F?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:F}),e.jsx("button",{type:"button",disabled:l!==null,onClick:te,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:"Try again"})]}):e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(h,{size:"lg"}),e.jsx("span",{children:"Signing you into your local install…"})]})}):e.jsxs(e.Fragment,{children:[E&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(h,{size:"lg"}),e.jsx("span",{children:"Loading sign-in options…"})]}),!E&&W&&e.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load sign-in options. ",W]}),!E&&!W&&j.length===0&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"No sign-in methods are configured. Contact support for access."}),p&&e.jsxs("div",{className:"mb-4 flex rounded-lg border p-1",children:[e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${c==="sign-in"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>L("sign-in"),children:"Sign In"}),e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${c==="sign-up"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>L("sign-up"),children:"Sign Up"})]}),me.length>1&&e.jsxs("div",{className:"mb-6 flex rounded-lg border p-1",children:[p&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="email-password"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>y("email-password"),children:"Email + Password"}),P&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="social"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>y("social"),children:"Social"}),!p&&k&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="magic-link"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>y("magic-link"),children:"Magic Link"}),M&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="whatsapp"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>y("whatsapp"),children:"WhatsApp"})]}),O&&e.jsx("div",{className:"mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900",children:"We found an existing account for this identity. To protect the account, verify with a magic link before linking social sign-in."}),K&&e.jsx("div",{className:"mb-4 p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:K}),F&&e.jsx("div",{className:"mb-4 p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:F}),(p||b==="social")&&P&&e.jsxs("div",{className:"space-y-3",children:[Object.entries(s?.social??{}).filter(([,t])=>t).map(([t])=>{const n=Fe.find(be=>be.provider===t),g=n?.icon,I=n?.name??t.charAt(0).toUpperCase()+t.slice(1);return e.jsxs("button",{type:"button",onClick:()=>Z(t),disabled:l!==null,className:"w-full flex items-center justify-center gap-3 h-10 px-4 border border-input rounded-lg bg-background hover:bg-accent hover:text-accent-foreground transition-colors disabled:opacity-50",children:[l===t?e.jsx(h,{size:"lg"}):g?e.jsx(g,{className:"w-4 h-4"}):e.jsx(ke,{className:"w-4 h-4"}),"Continue with ",I]},t)}),p&&e.jsxs("div",{className:"relative my-2",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"or"})})]})]}),p&&e.jsxs("form",{onSubmit:pe,className:"space-y-4",children:[c==="sign-up"&&e.jsxs("div",{children:[e.jsx("label",{htmlFor:"full-name",className:"block text-sm font-medium",children:"Full name"}),e.jsx("input",{id:"full-name",type:"text",value:$,onChange:t=>ie(t.target.value),placeholder:"Jane Doe",className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email-password-email",className:"block text-sm font-medium",children:"Email address"}),e.jsx("input",{id:"email-password-email",type:"email",value:a,onChange:t=>{B(t.target.value),V(!1)},placeholder:"you@example.com",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email-password-password",className:"block text-sm font-medium",children:"Password"}),e.jsx("input",{id:"email-password-password",type:"password",value:w,onChange:t=>ae(t.target.value),placeholder:"Enter a password",required:!0,minLength:8,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l!==null||!a||!w,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="email-password"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:c==="sign-up"?"Creating account...":"Signing in..."})]}):c==="sign-up"?f?"Create local account":"Create Account":"Sign In"}),c==="sign-in"&&Q&&e.jsx("button",{type:"button",disabled:l!==null,onClick:async()=>{r(null),d("passkey");try{const t=await z.passkey();if(t?.error){const n=t.error.message??"Passkey sign-in failed.";r(S(n)??n);return}window.location.href=N()}catch(t){const n=t instanceof Error?t.message:String(t);r(S(n)??n)}finally{d(null)}},className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:l==="passkey"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Waiting for passkey…"})]}):"Sign in with passkey"}),c==="sign-in"&&k&&e.jsx("button",{type:"button",disabled:l!==null||!a,onClick:async()=>{await ee()&&y("magic-link")},className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:l==="magic-link"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending magic link..."})]}):"Send me a magic link instead"}),c==="sign-in"&&e.jsx("button",{type:"button",disabled:l!==null||!a,onClick:fe,className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:l==="reset-password-request"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending reset email..."})]}):"Forgot password?"}),c==="sign-in"&&de&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"If this email exists, we sent a password reset link."})]}),b==="magic-link"&&k&&(ce?e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mb-4 flex justify-center",children:e.jsx("svg",{className:"h-12 w-12 text-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),e.jsx("h2",{className:"text-lg font-medium",children:"Check your email"}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["We sent a magic link to ",e.jsx("strong",{children:a}),".",e.jsx("br",{}),"Click the link in the email to sign in."]}),e.jsx("button",{type:"button",className:"mt-4 text-sm text-primary hover:underline",onClick:()=>_(!1),children:"Use a different email"})]}):e.jsxs("form",{onSubmit:ge,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium",children:"Email address"}),e.jsx("input",{id:"email",type:"email",value:a,onChange:t=>B(t.target.value),placeholder:"you@example.com",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l!==null||!a,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="magic-link"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending..."})]}):"Send Magic Link"})]})),b==="whatsapp"&&M&&(le?e.jsxs("form",{onSubmit:xe,className:"space-y-4",children:[e.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:["Enter the 6-digit code sent to ",e.jsx("strong",{children:v})]}),e.jsx("div",{children:e.jsx("input",{type:"text",value:U,onChange:t=>D(t.target.value),placeholder:"000000",maxLength:6,pattern:"[0-9]{6}",required:!0,className:"block h-12 w-full rounded-md border border-input bg-background px-3 py-2 text-center text-xl tracking-widest placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})}),e.jsx("button",{type:"submit",disabled:l!==null||U.length!==6,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="verify"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Verifying..."})]}):"Verify & Sign In"}),e.jsx("button",{type:"button",className:"w-full text-sm text-primary hover:underline",onClick:()=>{H(!1),D("")},children:"Use a different number"})]}):e.jsxs("form",{onSubmit:he,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"phone",className:"block text-sm font-medium",children:"WhatsApp Number"}),e.jsx("input",{id:"phone",type:"tel",value:v,onChange:t=>oe(t.target.value),placeholder:"+1234567890",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Include country code (e.g., +1 for US)"})]}),e.jsx("button",{type:"submit",disabled:l!==null||!v,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="phone"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending..."})]}):"Send Code via WhatsApp"})]}))]})})})]})})}export{Re as component};
|
|
1
|
+
import{a2 as ye,Y as je,aq as we,a7 as ve,r as i,ar as ne,j as e,s as h,as as ke,at as z,au as Ne,av as Se,aw as Ce,an as Ee,ag as Le,ao as Ue,ax as se}from"./index-BUr8321-.js";import{s as Fe}from"./index-hSE2E46p.js";import{C as Pe,c as Me}from"./card-DeFQuU_J.js";function A(m){if(!m||typeof m!="object")return null;const u=m.error;if(typeof u=="string")return u;if(u&&typeof u=="object"){const s=u.message;if(typeof s=="string"&&s.length>0)return s}const x=m.message;return typeof x=="string"&&x.length>0?x:null}async function re(m,u){if(typeof window>"u")return;const x=window.PasswordCredential;if(!(!x||!navigator.credentials?.store))try{const s=new x({id:m,password:u});await navigator.credentials.store(s)}catch{}}function S(m){return m?m.toLowerCase().replaceAll("_"," ").trim().includes("account not linked")?"This social account matches an existing Lobu user. Sign in with a magic link to verify ownership, then continue.":m:null}function Re(){const m=ye(),{session:u,isReady:x}=je(),{data:s,isLoading:E,error:R}=we(),o=ve({from:"/auth/login"}),q=o.invitationOrg,[b,y]=i.useState("social"),[c,L]=i.useState(o.intent??"sign-in"),[$,ie]=i.useState(""),[a,B]=i.useState(()=>o.loginHint??""),[w,ae]=i.useState(""),[v,oe]=i.useState(""),[U,D]=i.useState(""),[le,H]=i.useState(!1),[l,d]=i.useState(null),[F,r]=i.useState(null),[ce,_]=i.useState(!1),[de,V]=i.useState(!1),[J,ue]=i.useState(!1),G=i.useRef(!1),C=o.callbackUrl,Y=o.mode==="extension",O=o.error==="account_not_linked",K=S(o.errorDescription||o.error),P=Object.values(s?.social??{}).some(Boolean),k=!!s?.magicLink,M=!!s?.phone,p=!!s?.emailPassword,Q=!!s?.passkey,f=!!s?.singleUserMode,X=!!s?.hasUser,T=f,j=i.useMemo(()=>{const t=[];return p&&t.push("email-password"),P&&t.push("social"),k&&t.push("magic-link"),M&&t.push("whatsapp"),t},[p,k,P,M]),me=i.useMemo(()=>p?j.filter(t=>t!=="magic-link"&&t!=="social"):j,[j,p]),W=R instanceof Error?R.message:R?"Unable to load sign-in options.":null;i.useEffect(()=>{if(u){const t=ne(C);C?window.location.href=t:m({to:"/"})}},[u,m,C]),i.useEffect(()=>{!s||j.length===0||j.includes(b)||y(j[0])},[s,b,j]),i.useEffect(()=>{!k||!O||(y("magic-link"),o.loginHint&&!a&&B(o.loginHint))},[k,O,o.loginHint,a]),i.useEffect(()=>{o.intent&&L(o.intent)},[o.intent]),i.useEffect(()=>{if(!f||!s)return;const t=X?"sign-in":"sign-up";c!==t&&L(t)},[f,X,s,c]);const N=()=>C?ne(C):"/",Z=async t=>{d(t),r(null);try{const n=await z.social({provider:t,callbackURL:N(),newUserCallbackURL:C?N():`/?onboard_provider=${encodeURIComponent(t)}`}),g=A(n);if(g){const I=S(g);I?.toLowerCase().includes("magic link")&&y("magic-link"),r(I)}}catch(n){r(S(n instanceof Error?n.message:`Failed to sign in with ${t}`))}finally{d(null)}};i.useEffect(()=>{if(G.current||!x||u||E||!s||o.error)return;const t=o.provider;t&&Object.hasOwn(s.social??{},t)&&s.social?.[t]&&(G.current=!0,Z(t))},[s,E,u,x,o.provider,o.error]);const ee=async()=>{if(a){d("magic-link"),r(null);try{return await z.magicLink({email:a,callbackURL:N()}),_(!0),!0}catch(t){return r(t instanceof Error?t.message:"Failed to send magic link"),!1}finally{d(null)}}},ge=async t=>{t.preventDefault(),await ee()},pe=async t=>{if(t.preventDefault(),!(!a||!w)){d("email-password"),r(null);try{if(c==="sign-up"){const n=await Se.email({email:a,password:w,name:$||a.split("@")[0]||"User",callbackURL:N()}),g=A(n);if(g){r(S(g));return}if(await re(a,w),f&&Q)try{await Ce.passkey.addPasskey({name:$||`${navigator.platform||"This device"}`})}catch{}}else{const n=await z.email({email:a,password:w,callbackURL:N()}),g=A(n);if(g){r(S(g));return}if(!n?.data){r("Invalid email or password");return}await re(a,w)}}catch(n){const g=n instanceof Error?n.message:typeof n=="string"?n:A(n);r(g||"Authentication failed")}finally{d(null)}}},te=async()=>{r(null),ue(!0),d("local");try{const t=await Ne();if(!t.ok){const n=await t.json().catch(()=>null);r(n?.error_description??"Could not sign in to your local install.");return}window.location.href=N()}catch(t){r(t instanceof Error?t.message:"Could not sign in to your local install.")}finally{d(null)}};i.useEffect(()=>{T&&s&&!u&&!J&&te()},[T,s,u,J]);const fe=async()=>{if(!a){r("Enter your email address first to reset your password.");return}d("reset-password-request"),r(null);try{const t=`${window.location.origin}/auth/reset-password`,n=await Ee(`${Le}/api/auth/request-password-reset`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:a,redirectTo:t})});if(!n.ok)throw await Ue(n);V(!0)}catch(t){r(t instanceof Error?t.message:"Failed to send password reset email")}finally{d(null)}},he=async t=>{if(t.preventDefault(),!!v){d("phone"),r(null);try{await se.sendOtp({phoneNumber:v}),H(!0)}catch(n){r(n instanceof Error?n.message:"Failed to send verification code")}finally{d(null)}}},xe=async t=>{if(t.preventDefault(),!(!v||!U)){d("verify"),r(null);try{await se.verify({phoneNumber:v,code:U})}catch(n){r(n instanceof Error?n.message:"Invalid verification code"),d(null)}}};return e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsxs("div",{className:"w-full max-w-md p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("img",{src:"/lobu-logo.svg",alt:"Lobu",className:"mx-auto mb-6 h-8 w-auto"}),e.jsx("h1",{className:"text-2xl font-bold",children:q?`Sign in to join ${q}`:f&&c==="sign-up"?"Set up your local install":f?"Welcome back":c==="sign-up"?"Create your account":"Sign in"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:q?"Sign in with the email your invitation was sent to.":f&&c==="sign-up"?"This account stays on this machine. Email is just an identifier — pick anything you’ll remember.":f?"Sign in to your local install.":Y?"Sign in to connect the browser extension":c==="sign-up"?"Choose a sign-up method":"Choose your preferred sign-in method"}),f&&e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 px-3 py-1.5 bg-muted text-muted-foreground rounded-full text-xs",children:[e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"Local install · nothing sent to lobu.ai"]}),Y&&e.jsxs("div",{className:"mt-3 inline-flex items-center gap-2 px-3 py-1.5 bg-primary/10 text-primary rounded-full text-sm",children:[e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),"Browser Extension"]})]}),e.jsx(Pe,{children:e.jsx(Me,{children:T?e.jsx("div",{className:"space-y-4",children:F?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:F}),e.jsx("button",{type:"button",disabled:l!==null,onClick:te,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:"Try again"})]}):e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(h,{size:"lg"}),e.jsx("span",{children:"Signing you into your local install…"})]})}):e.jsxs(e.Fragment,{children:[E&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[e.jsx(h,{size:"lg"}),e.jsx("span",{children:"Loading sign-in options…"})]}),!E&&W&&e.jsxs("div",{className:"text-sm text-destructive",children:["Failed to load sign-in options. ",W]}),!E&&!W&&j.length===0&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"No sign-in methods are configured. Contact support for access."}),p&&e.jsxs("div",{className:"mb-4 flex rounded-lg border p-1",children:[e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${c==="sign-in"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>L("sign-in"),children:"Sign In"}),e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${c==="sign-up"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>L("sign-up"),children:"Sign Up"})]}),me.length>1&&e.jsxs("div",{className:"mb-6 flex rounded-lg border p-1",children:[p&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="email-password"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>y("email-password"),children:"Email + Password"}),P&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="social"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>y("social"),children:"Social"}),!p&&k&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="magic-link"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>y("magic-link"),children:"Magic Link"}),M&&e.jsx("button",{type:"button",className:`flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors ${b==="whatsapp"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"}`,onClick:()=>y("whatsapp"),children:"WhatsApp"})]}),O&&e.jsx("div",{className:"mb-4 rounded-lg border border-amber-300 bg-amber-50 p-3 text-sm text-amber-900",children:"We found an existing account for this identity. To protect the account, verify with a magic link before linking social sign-in."}),K&&e.jsx("div",{className:"mb-4 p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:K}),F&&e.jsx("div",{className:"mb-4 p-3 text-sm text-destructive bg-destructive/10 rounded-lg",children:F}),(p||b==="social")&&P&&e.jsxs("div",{className:"space-y-3",children:[Object.entries(s?.social??{}).filter(([,t])=>t).map(([t])=>{const n=Fe.find(be=>be.provider===t),g=n?.icon,I=n?.name??t.charAt(0).toUpperCase()+t.slice(1);return e.jsxs("button",{type:"button",onClick:()=>Z(t),disabled:l!==null,className:"w-full flex items-center justify-center gap-3 h-10 px-4 border border-input rounded-lg bg-background hover:bg-accent hover:text-accent-foreground transition-colors disabled:opacity-50",children:[l===t?e.jsx(h,{size:"lg"}):g?e.jsx(g,{className:"w-4 h-4"}):e.jsx(ke,{className:"w-4 h-4"}),"Continue with ",I]},t)}),p&&e.jsxs("div",{className:"relative my-2",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("span",{className:"w-full border-t"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"or"})})]})]}),p&&e.jsxs("form",{onSubmit:pe,className:"space-y-4",children:[c==="sign-up"&&e.jsxs("div",{children:[e.jsx("label",{htmlFor:"full-name",className:"block text-sm font-medium",children:"Full name"}),e.jsx("input",{id:"full-name",type:"text",value:$,onChange:t=>ie(t.target.value),placeholder:"Jane Doe",className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email-password-email",className:"block text-sm font-medium",children:"Email address"}),e.jsx("input",{id:"email-password-email",type:"email",value:a,onChange:t=>{B(t.target.value),V(!1)},placeholder:"you@example.com",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email-password-password",className:"block text-sm font-medium",children:"Password"}),e.jsx("input",{id:"email-password-password",type:"password",value:w,onChange:t=>ae(t.target.value),placeholder:"Enter a password",required:!0,minLength:8,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l!==null||!a||!w,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="email-password"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:c==="sign-up"?"Creating account...":"Signing in..."})]}):c==="sign-up"?f?"Create local account":"Create Account":"Sign In"}),c==="sign-in"&&Q&&e.jsx("button",{type:"button",disabled:l!==null,onClick:async()=>{r(null),d("passkey");try{const t=await z.passkey();if(t?.error){const n=t.error.message??"Passkey sign-in failed.";r(S(n)??n);return}window.location.href=N()}catch(t){const n=t instanceof Error?t.message:String(t);r(S(n)??n)}finally{d(null)}},className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:l==="passkey"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Waiting for passkey…"})]}):"Sign in with passkey"}),c==="sign-in"&&k&&e.jsx("button",{type:"button",disabled:l!==null||!a,onClick:async()=>{await ee()&&y("magic-link")},className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:l==="magic-link"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending magic link..."})]}):"Send me a magic link instead"}),c==="sign-in"&&e.jsx("button",{type:"button",disabled:l!==null||!a,onClick:fe,className:"flex h-10 w-full items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50",children:l==="reset-password-request"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending reset email..."})]}):"Forgot password?"}),c==="sign-in"&&de&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"If this email exists, we sent a password reset link."})]}),b==="magic-link"&&k&&(ce?e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mb-4 flex justify-center",children:e.jsx("svg",{className:"h-12 w-12 text-primary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),e.jsx("h2",{className:"text-lg font-medium",children:"Check your email"}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["We sent a magic link to ",e.jsx("strong",{children:a}),".",e.jsx("br",{}),"Click the link in the email to sign in."]}),e.jsx("button",{type:"button",className:"mt-4 text-sm text-primary hover:underline",onClick:()=>_(!1),children:"Use a different email"})]}):e.jsxs("form",{onSubmit:ge,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"email",className:"block text-sm font-medium",children:"Email address"}),e.jsx("input",{id:"email",type:"email",value:a,onChange:t=>B(t.target.value),placeholder:"you@example.com",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})]}),e.jsx("button",{type:"submit",disabled:l!==null||!a,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="magic-link"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending..."})]}):"Send Magic Link"})]})),b==="whatsapp"&&M&&(le?e.jsxs("form",{onSubmit:xe,className:"space-y-4",children:[e.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:["Enter the 6-digit code sent to ",e.jsx("strong",{children:v})]}),e.jsx("div",{children:e.jsx("input",{type:"text",value:U,onChange:t=>D(t.target.value),placeholder:"000000",maxLength:6,pattern:"[0-9]{6}",required:!0,className:"block h-12 w-full rounded-md border border-input bg-background px-3 py-2 text-center text-xl tracking-widest placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"})}),e.jsx("button",{type:"submit",disabled:l!==null||U.length!==6,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="verify"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Verifying..."})]}):"Verify & Sign In"}),e.jsx("button",{type:"button",className:"w-full text-sm text-primary hover:underline",onClick:()=>{H(!1),D("")},children:"Use a different number"})]}):e.jsxs("form",{onSubmit:he,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"phone",className:"block text-sm font-medium",children:"WhatsApp Number"}),e.jsx("input",{id:"phone",type:"tel",value:v,onChange:t=>oe(t.target.value),placeholder:"+1234567890",required:!0,className:"mt-1 block h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Include country code (e.g., +1 for US)"})]}),e.jsx("button",{type:"submit",disabled:l!==null||!v,className:"flex h-10 w-full items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-50",children:l==="phone"?e.jsxs(e.Fragment,{children:[e.jsx(h,{size:"lg"}),e.jsx("span",{className:"ml-2",children:"Sending..."})]}):"Send Code via WhatsApp"})]}))]})})})]})})}export{Re as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,ap as o,j as e}from"./index-
|
|
1
|
+
import{r as n,ap as o,j as e}from"./index-BUr8321-.js";function s(){return n.useEffect(()=>{o().catch(t=>console.error("Sign out failed:",t)).finally(()=>{window.location.href="/"})},[]),e.jsx("div",{className:"min-h-[calc(100vh-3.5rem)] flex items-center justify-center",children:e.jsx("p",{className:"text-muted-foreground",children:"Signing out..."})})}export{s as component};
|
package/dist/owletto/dist/assets/{member-scope-gate-C4QyRm2Q.js → member-scope-gate-B560Wg-t.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,S as o,Y as c,bM as u,bm as b,e2 as d,B as h,L as p,a5 as g}from"./index-
|
|
1
|
+
import{j as e,S as o,Y as c,bM as u,bm as b,e2 as d,B as h,L as p,a5 as g}from"./index-BUr8321-.js";function x({rows:s=5}){return e.jsx("div",{className:"space-y-2",role:"status","aria-label":"Loading members",children:Array.from({length:s}).map((r,t)=>e.jsxs("div",{className:"flex items-center gap-3 rounded-lg px-3 py-2",children:[e.jsx(o,{className:"h-8 w-8 shrink-0 rounded-full"}),e.jsx(o,{className:"h-4 w-40"})]},t))})}function j(s){const r=new URLSearchParams({type:"$member"});return`/${s}/memory?${r.toString()}`}function m({title:s,body:r,ctaLabel:t,showCta:n,callbackUrl:a}){return e.jsx(b,{icon:d,title:s,description:r,children:t&&n?e.jsx(h,{asChild:!0,className:"mt-4",children:e.jsx(p,{to:"/auth/login",search:g({callbackUrl:a,intent:"sign-in"}),children:t})}):null})}function y({ownerSlug:s,children:r}){const{isAuthenticated:t,isReady:n}=c(),{isMember:a,isLoading:l}=u(),i=j(s);return!n||l?e.jsx(x,{}):t?a?e.jsx(e.Fragment,{children:r}):e.jsx(m,{title:"Join to see members",body:"Emails and member details are only visible to members of this workspace. Use the banner above to join.",callbackUrl:i}):e.jsx(m,{title:"Sign in to see members",body:"The members of this workspace are only visible to people who have signed in.",ctaLabel:"Sign in",showCta:!0,callbackUrl:i})}export{y as M};
|