@qratilabs/qrati-connect 2.24.2 → 2.25.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qratilabs/qrati-connect",
3
- "version": "2.24.2",
3
+ "version": "2.25.0",
4
4
  "description": "Qrati Connect - Preact-based embeddable SDK with React wrapper",
5
5
  "author": "Qrati Labs",
6
6
  "license": "UNLICENSED",
@@ -1,9 +0,0 @@
1
- import{t as a}from"./DrrpB4Om.js";import{D as t,n as s}from"./CaX2xgrP.js";import{i as e,n as r,u as o}from"./ChJXhA9c.js";import{t as i}from"./DF0LxcV7.js";import{t as n}from"./DGbyGc8b.js";import{t as l}from"./DGGc10Cy.js";import{n as m,t as c}from"./BxErY-nv.js";import{t as g}from"./C3dOFk9A.js";import{t as d}from"./CM46vluW.js";import{t as p}from"./DnQ6XaLR.js";var f=()=>{const f=o(),{organization:v,props:h}=s(),u=h?.organizationId,{loading:N,event:j}=d({eventSlug:f.eventSlug});if(N)/* @__PURE__ */return a("div",{children:[
2
- /* @__PURE__ */a(n,{className:"mx-auto mt-4 h-8 w-64"}),
3
- /* @__PURE__ */a(n,{className:"mx-auto mt-6 h-6 w-72"}),
4
- /* @__PURE__ */a(n,{className:"mx-auto mt-6 h-8 w-72"}),
5
- /* @__PURE__ */a("div",{className:"mt-8 grid grid-cols-1 gap-4 sm:grid-cols-3",children:Array.from({length:8}).map((t,s)=>/* @__PURE__ */a(n,{className:"h-72"},s))})]});const w=j?.organizationId?.toString?.()||j?.organizationId,x=u?.toString?.()||u;/* @__PURE__ */
6
- return a("div",j&&w===x?{className:"bg-background relative min-h-screen",children:/* @__PURE__ */a(l,{locale:j?.language??"en",translations:j?.translations,children:[v?.navigationSettings?.enableNavbar&&/* @__PURE__ */a(m,{}),
7
- /* @__PURE__ */a(p,{}),
8
- /* @__PURE__ */a(e,{}),
9
- /* @__PURE__ */a(c,{})]})}:{className:"flex w-full flex-col items-center gap-8",children:[/* @__PURE__ */a(i,{className:"mt-16",title:"Event not found",description:"Please check the provided link",iconSvg:/* @__PURE__ */a("svg",{xmlns:"http://www.w3.org/2000/svg",className:"size-full",viewBox:"0 0 997.86122 450.8081",role:"img"})}),/* @__PURE__ */a(r,{to:t.PUBLIC_EVENTS,state:{internalNavigation:!0},children:/* @__PURE__ */a(g,{children:"All events"})})]})};export{f as default};
@@ -1,7 +0,0 @@
1
- import{t,w as e}from"./DrrpB4Om.js";import{D as n,n as a}from"./CaX2xgrP.js";import{c as r,l as i,t as s}from"./ChJXhA9c.js";import{t as o}from"./CATr-3VW.js";import{t as l}from"./DGbyGc8b.js";import{n as c}from"./DGGc10Cy.js";import{t as m}from"./C3dOFk9A.js";import{t as d}from"./D35mTuTT.js";function h({className:e}){/* @__PURE__ */
2
- return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t("path",{fill:"currentColor",d:"M5 21q-.825 0-1.412-.587T3 19v-3q0-.425.288-.712T4 15t.713.288T5 16v3h14V5H5v3q0 .425-.288.713T4 9t-.712-.288T3 8V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm6.65-8H4q-.425 0-.712-.288T3 12t.288-.712T4 11h7.65L9.8 9.15q-.3-.3-.288-.7t.288-.7q.3-.3.713-.312t.712.287L14.8 11.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-3.575 3.575q-.3.3-.712.288T9.8 16.25q-.275-.3-.288-.7t.288-.7z"})})}var u=()=>{const{t:e}=c(),d=r(),u=i(),{initializing:g,organization:p,loadingUser:v,user:f,signout:N}=a();/* @__PURE__ */
3
- return t("div",g||v?{className:"my-2 flex justify-end",children:/* @__PURE__ */t(l,{className:"h-9 w-64"})}:{className:"mx-auto mb-4",children:[!f&&/* @__PURE__ */t("div",{className:"flex justify-end gap-4",children:/* @__PURE__ */t(s,{to:`${n.LOGIN}?ref=${encodeURIComponent(d.pathname)}`,children:/* @__PURE__ */t(m,{children:e("button.login","Login")})})}),f&&/* @__PURE__ */t("div",{className:"mt-2 flex items-center justify-end gap-4",children:[/* @__PURE__ */t(o,{variant:"h5",children:f.name}),!p?.customAuth&&/* @__PURE__ */t("button",{onClick:async()=>{await N(),u(n.PUBLIC_EVENTS)},children:/* @__PURE__ */t(h,{className:"text-destructive"})})]})]})},g=()=>{const{user:r,organization:l,signout:c}=a(),m=i(),h=l?.integrationSettings?.hideQratiBranding;/* @__PURE__ */
4
- return t("div",{className:"pt-16 sm:pt-24",children:[l&&/* @__PURE__ */t("div",{className:"mx-auto py-2",children:l.customAuth?r&&/* @__PURE__ */t(o,{variant:"h6",align:"center",children:r.name}):/* @__PURE__ */t(e,{children:[!r&&/* @__PURE__ */t(o,{variant:"h6",align:"center",children:[
5
- /* @__PURE__ */t(s,{className:"text-primary hover:underline",to:n.LOGIN,children:"Login"})," ","•"," ",
6
- /* @__PURE__ */t(s,{className:"text-primary hover:underline",to:n.REGISTER,children:"Register"})]}),r&&/* @__PURE__ */t(o,{variant:"h6",align:"center",children:[r.name," •"," ",
7
- /* @__PURE__ */t("button",{type:"button",className:"text-destructive cursor-pointer border-none bg-transparent p-0 hover:underline",onClick:async()=>{await c(),m(n.PUBLIC_EVENTS)},children:"Logout"})]})]})}),!h&&/* @__PURE__ */t(d,{})]})};export{u as n,g as t};
@@ -1,8 +0,0 @@
1
- import{h as a,t as s}from"./DrrpB4Om.js";import{D as e,n as o}from"./CaX2xgrP.js";import{c as r,t as l}from"./ChJXhA9c.js";import{t as i}from"./CATr-3VW.js";import{n as t}from"./DGGc10Cy.js";import{t as n}from"./C3dOFk9A.js";import{a as d,i as m,o as c,r as p,s as w,t as g}from"./DlqJDAie2.js";import{n as h,r as f,t as u}from"./DlRUi0u42.js";var C=()=>{const{t:C}=t(),[b,v]=a(""),[P,y]=a(""),[N,j]=a(""),[x,k]=a(""),[A,S]=a(""),[z,F]=a(null),[L,D]=a({}),[E,O]=a(!1),[R,W]=a({google:!1,apple:!1}),[G,H]=a({showPassword:!1,showConfirmPassword:!1}),I=r(),{registerUsingEmail:U,loginWithGoogle:K,loginWithApple:T}=o(),V=a=>{D(s=>s[a]?{...s,[a]:void 0}:s)},$=async(a,s)=>{W(s=>({...s,[a]:!0})),F(null);try{await(s?.())}catch(e){e instanceof Error?F(e.message):F(`Failed to sign up with ${a.charAt(0).toUpperCase()+a.slice(1)}`)}finally{W(s=>({...s,[a]:!1}))}};/* @__PURE__ */
2
- return s("div",{className:"bg-background w-full space-y-8",children:[/* @__PURE__ */s("form",{noValidate:!0,onSubmit:async a=>{a.preventDefault();const s=d(b),e=c(P),o=m(N),r=w(x),l=p(A,x);if(s||e||o||r||l)return void D({fname:s,lname:e,email:o,password:r,confirmPassword:l});D({}),O(!0),F(null);const i=await(U?.(N.toLowerCase(),x,b,P));i?.error&&F(i.error),O(!1)},className:"space-y-4",children:[
3
- /* @__PURE__ */s("div",{className:"grid grid-cols-2 gap-4",children:[/* @__PURE__ */s(g,{label:C("auth.firstName","First name"),name:"fname",disabled:E,type:"text",value:b,onChange:a=>{v(a.target.value),V("fname")},error:L.fname}),/* @__PURE__ */s(g,{label:C("auth.lastName","Last name"),name:"lname",disabled:E,type:"text",value:P,onChange:a=>{y(a.target.value),V("lname")},error:L.lname})]}),
4
- /* @__PURE__ */s(g,{label:C("auth.email","Email address"),name:"email",disabled:E,type:"email",value:N,onChange:a=>{j(a.target.value),V("email")},autoComplete:"email",error:L.email}),
5
- /* @__PURE__ */s(g,{label:C("auth.password","Password"),name:"password",disabled:E,type:G.showPassword?"text":"password",value:x,onChange:a=>{k(a.target.value),V("password")},autoComplete:"new-password",error:L.password,actionLabel:G.showPassword?"Hide password":"Show password",actionIcon:G.showPassword?/* @__PURE__ */s(u,{className:"size-5"}):/* @__PURE__ */s(h,{className:"size-5"}),onActionClick:()=>H(a=>({...a,showPassword:!a.showPassword}))}),
6
- /* @__PURE__ */s(g,{label:C("auth.confirmPassword","Confirm password"),name:"confirmPassword",disabled:E,type:G.showConfirmPassword?"text":"password",value:A,onChange:a=>{S(a.target.value),V("confirmPassword")},autoComplete:"new-password",error:L.confirmPassword,actionLabel:G.showConfirmPassword?"Hide password":"Show password",actionIcon:G.showConfirmPassword?/* @__PURE__ */s(u,{className:"size-5"}):/* @__PURE__ */s(h,{className:"size-5"}),onActionClick:()=>H(a=>({...a,showConfirmPassword:!a.showConfirmPassword}))}),z&&/* @__PURE__ */s(i,{align:"center",color:"error",className:"font-medium",children:z}),
7
- /* @__PURE__ */s("div",{className:"flex justify-end",children:/* @__PURE__ */s(l,{to:e.FORGOT_PASSWORD,state:{from:I.pathname},children:/* @__PURE__ */s(i,{variant:"h6",className:"w-fit",children:C("button.forgotPassword","Forgot Password?")})})}),
8
- /* @__PURE__ */s(n,{type:"submit",color:"primary",className:"w-full",disabled:E,loading:E,children:C("button.register","Register")})]}),/* @__PURE__ */s("div",{className:"grid grid-cols-2 gap-2",children:[/* @__PURE__ */s(f,{disabled:E||R.google||R.apple,loading:R.google,onClick:()=>$("google",K),provider:"google"}),/* @__PURE__ */s(f,{disabled:E||R.google||R.apple,loading:R.apple,onClick:()=>$("apple",T),provider:"apple"})]})]})};export{C as default};
@@ -1,8 +0,0 @@
1
- import{_ as r,t as e}from"./DrrpB4Om.js";import{D as a,i as s,n as t}from"./CaX2xgrP.js";import{c as i,i as o,l as m,n as d}from"./ChJXhA9c.js";import{t as l}from"./DGbyGc8b.js";import{t as c}from"./D35mTuTT.js";var n=()=>{const n=i(),b=m(),{initializing:f,organization:p,user:x}=t();return r(()=>{if(x){const r=n.state?.referrer;b(r||"/",{replace:!0})}},[x]),f?/* @__PURE__ */e("div",{className:"mx-auto max-w-lg space-y-8 py-8",children:[
2
- /* @__PURE__ */e(l,{className:"h-8"}),
3
- /* @__PURE__ */e(l,{className:"h-8"}),
4
- /* @__PURE__ */e(l,{className:"h-8"}),
5
- /* @__PURE__ */e(l,{className:"h-8"})]}):!p||p?.customAuth?null:/* @__PURE__ */e("div",{className:"bg-background mx-auto min-h-[80vh] max-w-md py-24",children:[
6
- /* @__PURE__ */e("div",{className:"my-8 flex w-full justify-around",children:[/* @__PURE__ */e(d,{to:a.LOGIN,state:n.state||void 0,className:({isActive:r})=>s(r?"border-primary text-primary font-semibold":"border-border","flex-1 border-2 border-x-0 border-t-0 pb-2 text-center"),children:"Login"}),/* @__PURE__ */e(d,{to:a.REGISTER,state:n.state||void 0,className:({isActive:r})=>s(r?"border-primary text-primary font-semibold":"border-border","flex-1 border-2 border-x-0 border-t-0 pb-2 text-center"),children:"Register"})]}),
7
- /* @__PURE__ */e(o,{}),
8
- /* @__PURE__ */e("div",{className:"mt-12",children:/* @__PURE__ */e(c,{})})]})};export{n as default};
File without changes