@frigade/react 1.32.20 → 1.32.22
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/lib/index.d.ts +1 -0
- package/lib/index.js +246 -242
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +248 -244
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import{ThemeProvider as na}from"styled-components";import lt,{useContext as oa,useEffect as so,useState as Mo}from"react";import{useCallback as rt,useContext as Is,useEffect as As}from"react";import bo,{useMemo as Ss}from"react";var Jo="1.32.20 ";var ge="https://api.frigade.com/v1/public/",be="NOT_STARTED_STEP",Q="COMPLETED_FLOW",Kt="ABORTED_FLOW",ot="STARTED_FLOW",Be="NOT_STARTED_FLOW",Fe="COMPLETED_STEP",Yt="STARTED_STEP";function Oe(){let{publicApiKey:e,userId:t}=bo.useContext(G);return{config:Ss(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Jo,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}function ft(){let{shouldGracefullyDegrade:e}=bo.useContext(G);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),qt();let i;try{i=await fetch(t,o)}catch(r){return qt(r)}return i?i.ok?i:qt(i.statusText):qt()}}function qt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function gt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=bo.useContext(G);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}import{useContext as Ps,useState as Qo}from"react";import{useContext as bs,useEffect as Ts,useState as ws}from"react";import Fs from"swr";import{useContext as ys}from"react";function ke(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o}=ys(G);function i(p,d=!1){return e[p]??d}function r(p,d){t(l=>({...l,[p]:d}))}function n(p){t(d=>{let{[p]:l,...h}=d;return{...h}})}function s(){return Object.values(e).some(p=>p)||o}return{getOpenFlowState:i,setOpenFlowState:r,resetOpenFlowState:n,hasOpenModals:s}}var ks="unknown";function Te(){let{config:e}=Oe(),{publicApiKey:t,userId:o,flows:i,setShouldGracefullyDegrade:r}=bs(G),{resetOpenFlowState:n}=ke(),[s,p]=ws(!1),d={data:i.map(k=>({flowId:k.id,flowState:Q,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},l=k=>fetch(k,e).then(c=>{if(c.ok)return c.json();throw new Error("Failed to fetch user flow states")}).catch(c=>(console.log(`Error fetching ${k}: ${c}. Will gracefully degrade and hide Frigade`),r(!0),d)),{data:h,isLoading:m,mutate:g,error:w}=Fs(t&&i&&o?`${ge}userFlowStates?foreignUserId=${encodeURIComponent(o)}`:null,l,{keepPreviousData:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),x=h==null?void 0:h.data;Ts(()=>{!s&&!m&&x&&p(!0)},[x,s,m]);async function S(k){if(x){let c=x.find(u=>u.flowId===k);c&&c.flowState!==Q&&(c.flowState=Q),await g(Promise.resolve({...h,data:x}),{optimisticData:{...h,data:x},revalidate:!1,rollbackOnError:!1})}}async function C(k,c,u){if(x){let b=x.find(I=>I.flowId===k);b&&(b.stepStates[c]=u,b.flowState=ot),await g(Promise.resolve({...h,data:x}),{optimisticData:{...h,data:x},revalidate:!1,rollbackOnError:!1})}}async function v(k,c,u){if(x){let b=x.find(I=>I.flowId===k);b&&(b.lastStepId=c,b.stepStates[c]=u,b.flowState=ot),await g({...h,data:x},{optimisticData:{...h,data:x},revalidate:!1,rollbackOnError:!1})}}async function F(k){if(x){let c=x.find(u=>u.flowId===k);c&&c.flowState!==Be&&(c.flowState=Be,c.lastStepId=ks,Object.keys(c.stepStates).forEach(u=>{c.stepStates[u].actionType=be,c.stepStates[u].createdAt=new Date().toISOString()}),await g({...h,data:x},{optimisticData:{...h,data:x},revalidate:!1,rollbackOnError:!1}),n(k))}}async function A(k,c){if(x){let u=x.find(b=>b.flowId===k);u&&u.stepStates[c]!==be&&(u.stepStates[c]=be),await g({...h,data:x},{optimisticData:{...h,data:x},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:x,isLoadingUserFlowStateData:!s,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowNotStarted:F,optimisticallyMarkStepCompleted:C,optimisticallyMarkStepNotStarted:A,optimisticallyMarkStepStarted:v,error:w}}function At(){let{config:e}=Oe(),{userFlowStatesData:t,mutateUserFlowState:o}=Te(),{failedFlowResponses:i,setFailedFlowResponses:r,flowResponses:n,setFlowResponses:s}=Ps(G),[p,d]=Qo(new Set),[l,h]=Qo(new Set),m=ft();function g(S){let C=JSON.stringify(S);if(p.has(C))return null;p.add(C),d(p),l.add(S),h(l);let v=n==null?void 0:n.find(F=>F.flowSlug===S.flowSlug&&F.stepId===S.stepId&&F.actionType===S.actionType&&F.createdAt===S.createdAt);return m(`${ge}flowResponses`,{...e,method:"POST",body:C}).then(F=>{F.status!==200&&F.status!==201?(console.log("Failed to send flow response for step "+S.stepId+". Will retry again later."),r([...i,S])):v||s(A=>[...A??[],S])})}async function w(S){S.foreignUserId&&(S.actionType===ot||S.actionType===Be?await g(S):S.actionType===Q?await g(S):S.actionType===Yt?await g(S):S.actionType===Fe?await g(S):S.actionType===Kt?await g(S):S.actionType===be&&await g(S))}function x(){let S=[];return t==null||t.forEach(C=>{if(C&&C.stepStates&&Object.keys(C.stepStates).length!==0)for(let v in C.stepStates){let F=C.stepStates[v];S.push({foreignUserId:C.foreignUserId,flowSlug:C.flowId,stepId:F.stepId,actionType:F.actionType,data:{},createdAt:new Date(F.createdAt),blocked:F.blocked,hidden:F.hidden})}}),[...S,...n]}return{addResponse:w,setFlowResponses:s,getFlowResponses:x}}import Bs from"swr";var vs=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Zo=e=>{let t=vs.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Es(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Es=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function X(){let{config:e}=Oe(),{flows:t,setFlows:o,userId:i,publicApiKey:r,customVariables:n,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,setFlowResponses:l,setShouldGracefullyDegrade:h}=Is(G),m={data:[]},{verifySDKInitiated:g}=gt(),{addResponse:w,getFlowResponses:x}=At(),S=f=>fetch(f,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${f} (${y.status}): ${y.statusText}. .Will gracefully degrade and hide Frigade`),h(!0),m)).catch(y=>(console.log(`Error fetching ${f}: ${y}. Will gracefully degrade and hide Frigade`),h(!0),m)),{userFlowStatesData:C,isLoadingUserFlowStateData:v,optimisticallyMarkFlowCompleted:F,optimisticallyMarkFlowNotStarted:A,optimisticallyMarkStepCompleted:k,optimisticallyMarkStepNotStarted:c,optimisticallyMarkStepStarted:u}=Te(),{data:b,error:I,isLoading:U}=Bs(r?`${ge}flows`:null,S,{keepPreviousData:!0});As(()=>{if(I){console.error(I);return}b&&b.data&&(b.data=o(b.data))},[b,I]);function M(f){if(U)return null;let y=t.find(P=>P.slug===f);return!y&&t.length>0&&!v&&!U?(console.log(`Flow with slug ${f} not found`),null):(y==null?void 0:y.active)===!1?null:y}function z(f){var E;if(!M(f))return[];let y=M(f).data;return y?(y=O(y),(((E=JSON.parse(y))==null?void 0:E.data)??[]).map(Y=>{let tt=_e(Y);return{handleSecondaryButtonClick:()=>{Y.skippable===!0&&K(f,Y.id,{skipped:!0})},...Y,complete:B(f,Y.id)===Fe||tt>=1,blocked:re(f,Y.id),hidden:Ue(f,Y.id),handlePrimaryButtonClick:()=>{(!Y.completionCriteria&&(Y.autoMarkCompleted||Y.autoMarkCompleted===void 0)||Y.completionCriteria&&Y.autoMarkCompleted===!0)&&K(f,Y.id)},progress:tt}}).filter(Y=>Y.hidden!==!0)):[]}function O(f){return f.replace(/\${(.*?)}/g,(y,P)=>n[P]!==void 0?String(n[P]):"")}function H(f){if(!M(f))return[];let y=M(f).data;return y?(y=O(y),JSON.parse(y)??{}):[]}function L(f,y){s(P=>({...P,[f]:y}))}function j(f){!v&&!U&&f&&JSON.stringify(n)!=JSON.stringify({...n,...f})&&Object.keys(f).forEach(y=>{L(y,f[y])})}let q=rt(async(f,y,P)=>{g();let E={foreignUserId:i,flowSlug:f,stepId:y,actionType:Yt,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};pe(E)&&(await u(f,y,E),w(E))},[i,C]),V=rt(async(f,y,P)=>{g();let E={foreignUserId:i,flowSlug:f,stepId:y,actionType:be,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};pe(E)&&(await c(f,y),w(E))},[i,C]),K=rt(async(f,y,P)=>{g();let E={foreignUserId:i,flowSlug:f,stepId:y,actionType:Fe,data:P??{},createdAt:new Date,blocked:!1,hidden:!1};pe(E)&&(await k(f,y,E),w(E))},[i,C]),$=rt(async(f,y)=>{g();let P={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:Be,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};await A(f),pe(P)&&w(P)},[i,C]),Z=rt(async(f,y)=>{g();let P={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:ot,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};pe(P)&&w(P)},[i,C]),_=rt(async(f,y)=>{g();let P={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:Q,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};pe(P)&&(await F(f),w(P))},[i,C]),ae=rt(async(f,y)=>{g();let P={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:Kt,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};pe(P)&&(await F(f),w(P))},[i,C]);function pe(f){var y;if(!C&&f.actionType===be)return!1;if(C){let P=C.find(E=>E.flowId===f.flowSlug);if(f.actionType===be&&(!(P!=null&&P.stepStates[f.stepId])||P.stepStates[f.stepId].actionType===be)||P&&((y=P.stepStates[f.stepId])==null?void 0:y.actionType)===f.actionType)return!1}return!0}function B(f,y){let P=xe(f,y);return v?null:P?P.actionType:be}function re(f,y){let P=xe(f,y);return P?P.blocked:!1}function Ue(f,y){let P=xe(f,y);return P?P.hidden:!1}function xe(f,y){if(v)return null;let P=C==null?void 0:C.find(E=>E.flowId===f);return!P||!P.stepStates[y]?null:P.stepStates[y]??null}function ye(f){var P;if(v||!C)return null;if(We(f)===Be)return z(f)[0]??null;let y=(P=C.find(E=>E.flowId===f))==null?void 0:P.lastStepId;return y?z(f).find(E=>E.id===y):null}function me(f){let y=ye(f);if(!y)return 0;let P=z(f).findIndex(E=>E.id===y.id)??0;return B(f,y.id)===Fe&&P<z(f).length-1?P+1:P}function _e(f){if(!f.completionCriteria)return;let y=Zo(f.completionCriteria);if(y===null)return;let P=et(y),E=W(y);return E===0?void 0:P/E}function We(f){let y=C==null?void 0:C.find(P=>P.flowId===f);return y?y.flowState:null}function et(f){let y=z(f);return y.length===0?0:y.filter(E=>B(f,E.id)===Fe).length}function W(f){return z(f).length}function Ie(f){return JSON.parse(t.find(y=>y.slug===f).data)}function Ae(f){if(v)return!0;if(f!=null&&f.targetingLogic&&C){let y=C.find(P=>P.flowId===f.slug);if(y)return y.shouldTrigger===!1}return!!(f!=null&&f.targetingLogic&&i&&i.startsWith("guest_"))}function yo(f){return!Ae(M(f))}return{getFlow:M,getFlowData:Ie,isLoading:v||U,getStepStatus:B,getFlowSteps:z,getCurrentStepIndex:me,markStepStarted:q,markStepCompleted:K,markFlowNotStarted:$,markFlowStarted:Z,markFlowCompleted:_,markFlowAborted:ae,markStepNotStarted:V,getFlowStatus:We,getNumberOfStepsCompleted:et,getNumberOfSteps:W,targetingLogicShouldHideFlow:Ae,setCustomVariable:L,updateCustomVariables:j,customVariables:n,getStepOptionalProgress:_e,getFlowMetadata:H,isStepBlocked:re,isStepHidden:Ue,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,isFlowAvailableToUser:yo}}import{useCallback as Ro,useContext as Os,useEffect as Ls}from"react";var ht="guest_";function To(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Os(G),{config:n}=Oe(),{mutateUserFlowState:s}=Te(),p=ft(),{verifySDKInitiated:d}=gt();Ls(()=>{if(e&&!t){if(e.startsWith(ht))return;let m=`frigade-user-registered-${e}`;localStorage.getItem(m)||(p(`${ge}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(m,"true"))}},[e,r,t]);let l=Ro(async m=>{d();let g={foreignId:e,properties:m};await p(`${ge}users`,{...n,method:"POST",body:JSON.stringify(g)}),i(w=>({...w,...m})),s()},[e,n,r,s]),h=Ro(async(m,g)=>{d();let x={foreignId:e,events:[{event:m,properties:g}]};await p(`${ge}users`,{...n,method:"POST",body:JSON.stringify(x)}),s()},[e,n,s]);return{userId:e,setUserId:o,addPropertiesToUser:l,trackEventForUser:h}}import{v4 as ra}from"uuid";import Le,{useEffect as Zl,useState as Rl}from"react";import He,{useEffect as _s}from"react";import Jt from"styled-components";import Ns from"react";import Ds from"styled-components";var er="fr-",Bt="cfr-";function a(e,t){let o=`${er}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Bt+e}return o}function T(e){if(!e.className||e.className.indexOf(Bt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(er)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function wo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function it(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${wo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function tr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ms=Ds.div`
|
|
2
|
+
import at,{createContext as na,useEffect as Uo,useState as ve}from"react";import{ThemeProvider as sa}from"styled-components";import lt,{useContext as ra,useEffect as lo,useState as $o}from"react";import{useCallback as rt,useContext as Bs,useEffect as As}from"react";import To,{useMemo as Ss}from"react";var Qo="1.32.22 ";var ge="https://api.frigade.com/v1/public/",be="NOT_STARTED_STEP",R="COMPLETED_FLOW",Yt="ABORTED_FLOW",ot="STARTED_FLOW",Ae="NOT_STARTED_FLOW",Fe="COMPLETED_STEP",Xt="STARTED_STEP";function Ne(){let{publicApiKey:e,userId:t}=To.useContext(G);return{config:Ss(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Qo,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}function ft(){let{shouldGracefullyDegrade:e}=To.useContext(G);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),Kt();let i;try{i=await fetch(t,o)}catch(r){return Kt(r)}return i?i.ok?i:Kt(i.statusText):Kt()}}function Kt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function gt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=To.useContext(G);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}import{useContext as vs,useState as Zo}from"react";import{useContext as Ts,useEffect as ws,useState as Fs}from"react";import ks from"swr";import{useContext as bs}from"react";function ke(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o}=bs(G);function i(p,d=!1){return e[p]??d}function r(p,d){t(l=>({...l,[p]:d}))}function n(p){t(d=>{let{[p]:l,...g}=d;return{...g}})}function s(){return Object.values(e).some(p=>p)||o}return{getOpenFlowState:i,setOpenFlowState:r,resetOpenFlowState:n,hasOpenModals:s}}var Ps="unknown";function Te(){let{config:e}=Ne(),{publicApiKey:t,userId:o,flows:i,setShouldGracefullyDegrade:r}=Ts(G),{resetOpenFlowState:n}=ke(),[s,p]=Fs(!1),d={data:i.map(P=>({flowId:P.id,flowState:R,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},l=P=>fetch(P,e).then(c=>{if(c.ok)return c.json();throw new Error("Failed to fetch user flow states")}).catch(c=>(console.log(`Error fetching ${P}: ${c}. Will gracefully degrade and hide Frigade`),r(!0),d)),{data:g,isLoading:m,mutate:h,error:F}=ks(t&&i&&o?`${ge}userFlowStates?foreignUserId=${encodeURIComponent(o)}`:null,l,{keepPreviousData:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),x=g==null?void 0:g.data;ws(()=>{!s&&!m&&x&&p(!0)},[x,s,m]);async function y(P){if(x){let c=x.find(u=>u.flowId===P);c&&c.flowState!==R&&(c.flowState=R),await h(Promise.resolve({...g,data:x}),{optimisticData:{...g,data:x},revalidate:!1,rollbackOnError:!1})}}async function C(P,c,u){if(x){let b=x.find(I=>I.flowId===P);b&&(b.stepStates[c]=u,b.flowState=ot),await h(Promise.resolve({...g,data:x}),{optimisticData:{...g,data:x},revalidate:!1,rollbackOnError:!1})}}async function E(P,c,u){if(x){let b=x.find(I=>I.flowId===P);b&&(b.lastStepId=c,b.stepStates[c]=u,b.flowState=ot),await h({...g,data:x},{optimisticData:{...g,data:x},revalidate:!1,rollbackOnError:!1})}}async function T(P){if(x){let c=x.find(u=>u.flowId===P);c&&c.flowState!==Ae&&(c.flowState=Ae,c.lastStepId=Ps,Object.keys(c.stepStates).forEach(u=>{c.stepStates[u].actionType=be,c.stepStates[u].createdAt=new Date().toISOString()}),await h({...g,data:x},{optimisticData:{...g,data:x},revalidate:!1,rollbackOnError:!1}),n(P))}}async function B(P,c){if(x){let u=x.find(b=>b.flowId===P);u&&u.stepStates[c]!==be&&(u.stepStates[c]=be),await h({...g,data:x},{optimisticData:{...g,data:x},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:x,isLoadingUserFlowStateData:!s,mutateUserFlowState:h,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:C,optimisticallyMarkStepNotStarted:B,optimisticallyMarkStepStarted:E,error:F}}function At(){let{config:e}=Ne(),{userFlowStatesData:t,mutateUserFlowState:o}=Te(),{failedFlowResponses:i,setFailedFlowResponses:r,flowResponses:n,setFlowResponses:s}=vs(G),[p,d]=Zo(new Set),[l,g]=Zo(new Set),m=ft();function h(y){let C=JSON.stringify(y);if(p.has(C))return null;p.add(C),d(p),l.add(y),g(l);let E=n==null?void 0:n.find(T=>T.flowSlug===y.flowSlug&&T.stepId===y.stepId&&T.actionType===y.actionType&&T.createdAt===y.createdAt);return m(`${ge}flowResponses`,{...e,method:"POST",body:C}).then(T=>{T.status!==200&&T.status!==201?(console.log("Failed to send flow response for step "+y.stepId+". Will retry again later."),r([...i,y])):E||s(B=>[...B??[],y])})}async function F(y){y.foreignUserId&&(y.actionType===ot||y.actionType===Ae?await h(y):y.actionType===R?await h(y):y.actionType===Xt?await h(y):y.actionType===Fe?await h(y):y.actionType===Yt?await h(y):y.actionType===be&&await h(y))}function x(){let y=[];return t==null||t.forEach(C=>{if(C&&C.stepStates&&Object.keys(C.stepStates).length!==0)for(let E in C.stepStates){let T=C.stepStates[E];y.push({foreignUserId:C.foreignUserId,flowSlug:C.flowId,stepId:T.stepId,actionType:T.actionType,data:{},createdAt:new Date(T.createdAt),blocked:T.blocked,hidden:T.hidden})}}),[...y,...n]}return{addResponse:F,setFlowResponses:s,getFlowResponses:x}}import Ns from"swr";var Es=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Ro=e=>{let t=Es.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Is(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Is=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function X(){let{config:e}=Ne(),{flows:t,setFlows:o,userId:i,publicApiKey:r,customVariables:n,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,setFlowResponses:l,setShouldGracefullyDegrade:g}=Bs(G),m={data:[]},{verifySDKInitiated:h}=gt(),{addResponse:F,getFlowResponses:x}=At(),y=f=>fetch(f,e).then(S=>S.ok?S.json():(console.log(`Error fetching ${f} (${S.status}): ${S.statusText}. .Will gracefully degrade and hide Frigade`),g(!0),m)).catch(S=>(console.log(`Error fetching ${f}: ${S}. Will gracefully degrade and hide Frigade`),g(!0),m)),{userFlowStatesData:C,isLoadingUserFlowStateData:E,optimisticallyMarkFlowCompleted:T,optimisticallyMarkFlowNotStarted:B,optimisticallyMarkStepCompleted:P,optimisticallyMarkStepNotStarted:c,optimisticallyMarkStepStarted:u}=Te(),{data:b,error:I,isLoading:U}=Ns(r?`${ge}flows`:null,y,{keepPreviousData:!0});As(()=>{if(I){console.error(I);return}b&&b.data&&(b.data=o(b.data))},[b,I]);function M(f){if(U)return null;let S=t.find(k=>k.slug===f);return!S&&t.length>0&&!E&&!U?(console.log(`Flow with slug ${f} not found`),null):(S==null?void 0:S.active)===!1?null:S}function _(f){var v;if(!M(f))return[];let S=M(f).data;return S?(S=O(S),(((v=JSON.parse(S))==null?void 0:v.data)??[]).map(Y=>{let tt=_e(Y);return{handleSecondaryButtonClick:()=>{Y.skippable===!0&&z(f,Y.id,{skipped:!0})},...Y,complete:A(f,Y.id)===Fe||tt>=1,blocked:q(f,Y.id),hidden:Ue(f,Y.id),handlePrimaryButtonClick:()=>{(!Y.completionCriteria&&(Y.autoMarkCompleted||Y.autoMarkCompleted===void 0)||Y.completionCriteria&&Y.autoMarkCompleted===!0)&&z(f,Y.id)},progress:tt}}).filter(Y=>Y.hidden!==!0)):[]}function O(f){return f.replace(/\${(.*?)}/g,(S,k)=>n[k]!==void 0?String(n[k]):"")}function H(f){if(!M(f))return[];let S=M(f).data;return S?(S=O(S),JSON.parse(S)??{}):[]}function N(f,S){s(k=>({...k,[f]:S}))}function j(f){!E&&!U&&f&&JSON.stringify(n)!=JSON.stringify({...n,...f})&&Object.keys(f).forEach(S=>{N(S,f[S])})}let K=rt(async(f,S,k)=>{h();let v={foreignUserId:i,flowSlug:f,stepId:S,actionType:Xt,data:k??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await u(f,S,v),F(v))},[i,C]),V=rt(async(f,S,k)=>{h();let v={foreignUserId:i,flowSlug:f,stepId:S,actionType:be,data:k??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await c(f,S),F(v))},[i,C]),z=rt(async(f,S,k)=>{h();let v={foreignUserId:i,flowSlug:f,stepId:S,actionType:Fe,data:k??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await P(f,S,v),F(v))},[i,C]),te=rt(async(f,S)=>{h();let k={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:Ae,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};await B(f),J(k)&&F(k)},[i,C]),oe=rt(async(f,S)=>{h();let k={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:ot,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};J(k)&&F(k)},[i,C]),Z=rt(async(f,S)=>{h();let k={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:R,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};J(k)&&(await T(f),F(k))},[i,C]),$=rt(async(f,S)=>{h();let k={foreignUserId:i,flowSlug:f,stepId:"unknown",actionType:Yt,data:S??{},createdAt:new Date,blocked:!1,hidden:!1};J(k)&&(await T(f),F(k))},[i,C]);function J(f){var S;if(!C&&f.actionType===be)return!1;if(C){let k=C.find(v=>v.flowId===f.flowSlug);if(f.actionType===be&&(!(k!=null&&k.stepStates[f.stepId])||k.stepStates[f.stepId].actionType===be)||k&&((S=k.stepStates[f.stepId])==null?void 0:S.actionType)===f.actionType)return!1}return!0}function A(f,S){let k=xe(f,S);return E?null:k?k.actionType:be}function q(f,S){let k=xe(f,S);return k?k.blocked:!1}function Ue(f,S){let k=xe(f,S);return k?k.hidden:!1}function xe(f,S){if(E)return null;let k=C==null?void 0:C.find(v=>v.flowId===f);return!k||!k.stepStates[S]?null:k.stepStates[S]??null}function Se(f){var k;if(E||!C)return null;if(We(f)===Ae)return _(f)[0]??null;let S=(k=C.find(v=>v.flowId===f))==null?void 0:k.lastStepId;return S?_(f).find(v=>v.id===S):null}function me(f){let S=Se(f);if(!S)return 0;let k=_(f).findIndex(v=>v.id===S.id)??0;return A(f,S.id)===Fe&&k<_(f).length-1?k+1:k}function _e(f){if(!f.completionCriteria)return;let S=Ro(f.completionCriteria);if(S===null)return;let k=et(S),v=W(S);return v===0?void 0:k/v}function We(f){let S=C==null?void 0:C.find(k=>k.flowId===f);return S?S.flowState:null}function et(f){let S=_(f);return S.length===0?0:S.filter(v=>A(f,v.id)===Fe).length}function W(f){return _(f).length}function Ie(f){return JSON.parse(t.find(S=>S.slug===f).data)}function Be(f){if(E)return!0;if(f!=null&&f.targetingLogic&&C){let S=C.find(k=>k.flowId===f.slug);if(S)return S.shouldTrigger===!1}return!!(f!=null&&f.targetingLogic&&i&&i.startsWith("guest_"))}function bo(f){return!Be(M(f))}return{getFlow:M,getFlowData:Ie,isLoading:E||U,getStepStatus:A,getFlowSteps:_,getCurrentStepIndex:me,markStepStarted:K,markStepCompleted:z,markFlowNotStarted:te,markFlowStarted:oe,markFlowCompleted:Z,markFlowAborted:$,markStepNotStarted:V,getFlowStatus:We,getNumberOfStepsCompleted:et,getNumberOfSteps:W,targetingLogicShouldHideFlow:Be,setCustomVariable:N,updateCustomVariables:j,customVariables:n,getStepOptionalProgress:_e,getFlowMetadata:H,isStepBlocked:q,isStepHidden:Ue,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,isFlowAvailableToUser:bo}}import{useCallback as er,useContext as Os,useEffect as Ls}from"react";var ht="guest_";function wo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Os(G),{config:n}=Ne(),{mutateUserFlowState:s}=Te(),p=ft(),{verifySDKInitiated:d}=gt();Ls(()=>{if(e&&!t){if(e.startsWith(ht))return;let m=`frigade-user-registered-${e}`;localStorage.getItem(m)||(p(`${ge}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(m,"true"))}},[e,r,t]);let l=er(async m=>{d();let h={foreignId:e,properties:m};await p(`${ge}users`,{...n,method:"POST",body:JSON.stringify(h)}),i(F=>({...F,...m})),s()},[e,n,r,s]),g=er(async(m,h)=>{d();let x={foreignId:e,events:[{event:m,properties:h}]};await p(`${ge}users`,{...n,method:"POST",body:JSON.stringify(x)}),s()},[e,n,s]);return{userId:e,setUserId:o,addPropertiesToUser:l,trackEventForUser:g}}import{v4 as ia}from"uuid";import Oe,{useEffect as Rl,useState as ea}from"react";import He,{useEffect as Ws}from"react";import Qt from"styled-components";import Ds from"react";import Ms from"styled-components";var tr="fr-",Nt="cfr-";function a(e,t){let o=`${tr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Nt+e}return o}function w(e){if(!e.className||e.className.indexOf(Nt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(tr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Fo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function it(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Fo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function or(e){return e.charAt(0).toUpperCase()+e.slice(1)}var $s=Ms.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -7,7 +7,7 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
7
7
|
left: 0;
|
|
8
8
|
bottom: 0;
|
|
9
9
|
right: 0;
|
|
10
|
-
${e=>
|
|
10
|
+
${e=>w(e)} {
|
|
11
11
|
background-color: rgba(0, 0, 0, 0.6);
|
|
12
12
|
z-index: 1400;
|
|
13
13
|
}
|
|
@@ -23,12 +23,12 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,rr=({onClose:e,appearance:t})=>Ds.createElement($s,{className:a("modalBackground",t),onClick:()=>e()});import Jt from"react";import Us from"styled-components";var _s=Us.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,Pe=()=>
|
|
31
|
-
${e=>
|
|
30
|
+
`,Pe=()=>Jt.createElement(_s,null,Jt.createElement("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Jt.createElement("rect",{y:"1.39844",width:"1.97669",height:"17.8213",rx:"0.988346",transform:"rotate(-45 0 1.39844)",fill:"currentColor"}),Jt.createElement("rect",{x:"12.6023",width:"1.97669",height:"17.8213",rx:"0.988346",transform:"rotate(45 12.6023 0)",fill:"currentColor"})));import{Portal as Hs}from"react-portal";var zs=Qt.div`
|
|
31
|
+
${e=>w(e)} {
|
|
32
32
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
33
33
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
34
34
|
/* Mobile */
|
|
@@ -71,28 +71,28 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
71
71
|
opacity: 1;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
`,
|
|
74
|
+
`,Gs=Qt.div`
|
|
75
75
|
position: relative;
|
|
76
76
|
flex: 0 1 auto;
|
|
77
|
-
`,
|
|
77
|
+
`,js=Qt.div`
|
|
78
78
|
position: absolute;
|
|
79
79
|
top: 24px;
|
|
80
80
|
right: 24px;
|
|
81
81
|
cursor: pointer;
|
|
82
82
|
z-index: 1501;
|
|
83
|
-
${e=>
|
|
83
|
+
${e=>w(e)} {
|
|
84
84
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
85
85
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
86
86
|
}
|
|
87
|
-
`,
|
|
87
|
+
`,Vs=Qt.div`
|
|
88
88
|
overflow: scroll;
|
|
89
89
|
flex: 1 1;
|
|
90
90
|
display: flex;
|
|
91
91
|
::-webkit-scrollbar {
|
|
92
92
|
display: none;
|
|
93
93
|
}
|
|
94
|
-
`,Ye=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0})=>(
|
|
95
|
-
${e=>
|
|
94
|
+
`,Ye=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0})=>(Ws(()=>{let p=d=>{d.key==="Escape"&&e()};return document.addEventListener("keydown",p),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",p)}},[e,t]),t?He.createElement(Hs,null,He.createElement(rr,{appearance:n,onClose:()=>{s&&e()}}),He.createElement(zs,{appearance:n,className:a("modalContainer",n),styleOverrides:i},s&&He.createElement(js,{className:a("modalClose",n),onClick:()=>e(),appearance:n},He.createElement(Pe,null)),o&&He.createElement(Gs,null,o),He.createElement(Vs,null,r))):He.createElement(He.Fragment,null));import Xe,{useEffect as qs}from"react";import Zt from"styled-components";import{Portal as Ks}from"react-portal";var Ys=Zt.div`
|
|
95
|
+
${e=>w(e)} {
|
|
96
96
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
97
97
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
98
98
|
position: fixed;
|
|
@@ -109,34 +109,34 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
109
109
|
bottom: 0;
|
|
110
110
|
margin-right: 28px;
|
|
111
111
|
margin-bottom: 28px;
|
|
112
|
-
`,
|
|
112
|
+
`,Xs=Zt.div`
|
|
113
113
|
position: relative;
|
|
114
114
|
flex: 1;
|
|
115
|
-
`,
|
|
115
|
+
`,Js=Zt.div`
|
|
116
116
|
position: absolute;
|
|
117
117
|
top: 24px;
|
|
118
118
|
right: 24px;
|
|
119
119
|
cursor: pointer;
|
|
120
120
|
z-index: 1501;
|
|
121
|
-
${e=>
|
|
121
|
+
${e=>w(e)} {
|
|
122
122
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
123
123
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
124
124
|
}
|
|
125
|
-
`,
|
|
125
|
+
`,Qs=Zt.div`
|
|
126
126
|
overflow: scroll;
|
|
127
127
|
flex: 5;
|
|
128
128
|
::-webkit-scrollbar {
|
|
129
129
|
display: none;
|
|
130
130
|
}
|
|
131
|
-
`,
|
|
132
|
-
${e=>
|
|
131
|
+
`,ir=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r})=>(qs(()=>{let n=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",n),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",n)}},[e,t]),t?Xe.createElement(Ks,null,Xe.createElement(Ys,{appearance:r,className:a("cornerModalContainer",r)},Xe.createElement(Js,{className:a("cornerModalClose",r),onClick:()=>e()},Xe.createElement(Pe,null)),o&&Xe.createElement(Xs,null,o),Xe.createElement(Qs,null,i))):Xe.createElement(Xe.Fragment,null));import{useContext as Zs}from"react";function Q(){let{defaultAppearance:e}=Zs(G);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}import to,{useEffect as pl,useState as yr}from"react";import Sr from"styled-components";import vo,{useEffect as Rs,useState as ar}from"react";import Eo from"styled-components";import ko from"styled-components";var nr=ko.label`
|
|
132
|
+
${e=>w(e)} {
|
|
133
133
|
font-size: 14px;
|
|
134
134
|
line-height: 20px;
|
|
135
135
|
margin-bottom: 5px;
|
|
136
136
|
margin-top: 10px;
|
|
137
137
|
}
|
|
138
138
|
display: flex;
|
|
139
|
-
`,
|
|
139
|
+
`,sr=ko.span`
|
|
140
140
|
font-weight: 400;
|
|
141
141
|
font-size: 14px;
|
|
142
142
|
line-height: 22px;
|
|
@@ -144,17 +144,17 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
144
144
|
display: flex;
|
|
145
145
|
margin-right: 5px;
|
|
146
146
|
margin-top: 10px;
|
|
147
|
-
`,
|
|
147
|
+
`,lr=ko.div`
|
|
148
148
|
display: flex;
|
|
149
149
|
align-items: flex-start;
|
|
150
150
|
justify-content: left;
|
|
151
151
|
margin-bottom: 10px;
|
|
152
|
-
`;import
|
|
152
|
+
`;import Po from"react";function nt({title:e,required:t,appearance:o}){return Po.createElement(lr,null,t?Po.createElement(sr,null,"*"):null,Po.createElement(nr,{className:a("formLabel",o)},e))}var el=Eo.div`
|
|
153
153
|
display: flex;
|
|
154
154
|
flex-direction: column;
|
|
155
155
|
width: 100%;
|
|
156
|
-
`,Eo
|
|
157
|
-
${e=>
|
|
156
|
+
`,Io=Eo.input`
|
|
157
|
+
${e=>w(e)} {
|
|
158
158
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
159
159
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
160
160
|
font-size: 14px;
|
|
@@ -169,8 +169,8 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
169
169
|
box-sizing: border-box;
|
|
170
170
|
padding: 0 10px;
|
|
171
171
|
margin-bottom: 10px;
|
|
172
|
-
`,
|
|
173
|
-
${e=>
|
|
172
|
+
`,tl=Eo.textarea`
|
|
173
|
+
${e=>w(e)} {
|
|
174
174
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
175
175
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
176
176
|
font-size: 14px;
|
|
@@ -185,14 +185,14 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
185
185
|
min-height: 70px;
|
|
186
186
|
box-sizing: border-box;
|
|
187
187
|
margin-bottom: 10px;
|
|
188
|
-
`;function
|
|
188
|
+
`;function pr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i}){let r=e,[n,s]=ar(""),[p,d]=ar(!1),l=Io;Rs(()=>{n===""&&!p&&(d(!0),g(""))},[]);function g(m){if(s(m),r.required===!0&&m.trim()===""){i([{id:r.id,message:`${r.title} is required`}]);return}i([]),o({text:m})}return r.multiline&&(l=tl),vo.createElement(el,null,vo.createElement(nt,{title:r.title,required:r.required,appearance:t.appearance}),vo.createElement(l,{className:a("inputComponent",t.appearance),value:n,onChange:m=>{g(m.target.value)},appearance:t.appearance,placeholder:r.placeholder}))}import ze,{useEffect as dr,useState as cr}from"react";import mr from"styled-components";var ol=mr.div`
|
|
189
189
|
display: flex;
|
|
190
190
|
flex-direction: column;
|
|
191
191
|
width: 100%;
|
|
192
192
|
-webkit-appearance: none;
|
|
193
193
|
appearance: none;
|
|
194
|
-
`,
|
|
195
|
-
${e=>
|
|
194
|
+
`,rl=mr.select`
|
|
195
|
+
${e=>w(e)} {
|
|
196
196
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
197
197
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
198
198
|
font-size: 14px;
|
|
@@ -215,14 +215,14 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
215
215
|
background-repeat: no-repeat;
|
|
216
216
|
background-size: 1.5em 1.5em;
|
|
217
217
|
-webkit-print-color-adjust: exact;
|
|
218
|
-
`,
|
|
218
|
+
`,Rt="null";function ur({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i}){var l,g,m,h,F;let r=e,[n,s]=cr(""),[p,d]=cr(!1);return dr(()=>{var x,y,C,E;if(n===""&&!p){if(d(!0),r.requireSelection){s(Rt);return}if(r.defaultValue&&((x=r.props.options)!=null&&x.find(T=>T.id===r.defaultValue))){let T=(y=r.props.options)==null?void 0:y.find(B=>B.id===r.defaultValue);s(T.id),o({choice:[T.id]})}else s(((C=r.props.options)==null?void 0:C[0].id)||""),o({choice:[((E=r.props.options)==null?void 0:E[0].id)||""]})}},[]),dr(()=>{r.requireSelection&&n===Rt?i([{message:"Please select an option",id:r.id}]):i([])},[n]),ze.createElement(ol,null,ze.createElement(nt,{title:r.title,required:!1,appearance:t.appearance}),ze.createElement(rl,{value:n,onChange:x=>{s(x.target.value),o({choice:[x.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&ze.createElement("option",{key:Rt,value:Rt},"Select an option"),(l=r.props.options)==null?void 0:l.map(x=>ze.createElement("option",{key:x.id,value:x.id},x.title))),((m=(g=r.props.options)==null?void 0:g.find(x=>x.id===n))==null?void 0:m.isOpenEnded)&&ze.createElement(ze.Fragment,null,ze.createElement(nt,{title:((F=(h=r.props.options)==null?void 0:h.find(x=>x.id===n))==null?void 0:F.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),ze.createElement(Io,{type:"text",placeholder:"Enter your answer here",onChange:x=>{o({choice:[x.target.value]})},appearance:t.appearance})))}import Bo,{useEffect as fr,useState as gr}from"react";import hr from"styled-components";var il=hr.div`
|
|
219
219
|
display: flex;
|
|
220
220
|
flex-direction: column;
|
|
221
221
|
width: 100%;
|
|
222
222
|
-webkit-appearance: none;
|
|
223
223
|
appearance: none;
|
|
224
|
-
`,
|
|
225
|
-
${e=>
|
|
224
|
+
`,nl=hr.button`
|
|
225
|
+
${e=>w(e)} {
|
|
226
226
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
227
227
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
228
228
|
font-size: 14px;
|
|
@@ -243,8 +243,8 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
243
243
|
height: 60px;
|
|
244
244
|
padding: 0 18px;
|
|
245
245
|
margin-bottom: 10px;
|
|
246
|
-
`;function
|
|
247
|
-
${e=>
|
|
246
|
+
`;function xr({formInput:e,customFormTypeProps:t,onSaveInputData:o}){var d;let i=e,[r,n]=gr([]),[s,p]=gr(!1);return fr(()=>{r.length==0&&!s&&(p(!0),o({choice:[]}))},[]),fr(()=>{o({choice:r})},[r]),Bo.createElement(il,null,Bo.createElement(nt,{title:i.title,required:i.required,appearance:t.appearance}),(d=i.props.options)==null?void 0:d.map(l=>Bo.createElement(nl,{appearance:t.appearance,key:l.id,value:l.id,"data-selected":r.includes(l.id),onClick:()=>{if(r.includes(l.id)){n(r.filter(g=>g!==l.id));return}r.length<i.props.maxChoices?n([...r,l.id]):r.length==1&&i.props.maxChoices==1&&n([l.id])}},l.title)))}import eo from"react";import Cr from"styled-components";import sl from"dompurify";function se(e){return{__html:sl.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var ll=Cr.h1`
|
|
247
|
+
${e=>w(e)} {
|
|
248
248
|
font-style: normal;
|
|
249
249
|
font-weight: 600;
|
|
250
250
|
font-size: ${e=>e.size=="small"?"15px":"18px"};
|
|
@@ -254,32 +254,36 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
254
254
|
margin-bottom: 4px;
|
|
255
255
|
color: ${e=>e.appearance.theme.colorText};
|
|
256
256
|
}
|
|
257
|
-
`,
|
|
258
|
-
${e=>
|
|
257
|
+
`,al=Cr.h2`
|
|
258
|
+
${e=>w(e)} {
|
|
259
259
|
font-style: normal;
|
|
260
260
|
font-weight: 400;
|
|
261
261
|
font-size: 15px;
|
|
262
262
|
line-height: 20px;
|
|
263
263
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
264
264
|
}
|
|
265
|
-
`;function we({appearance:e,title:t,subtitle:o,size:i="medium"}){return
|
|
265
|
+
`;function we({appearance:e,title:t,subtitle:o,size:i="medium"}){return eo.createElement(eo.Fragment,null,eo.createElement(ll,{appearance:e,className:a(`${i}Title`,e),dangerouslySetInnerHTML:se(t),size:i}),eo.createElement(al,{appearance:e,className:a(`${i}Subtitle`,e),dangerouslySetInnerHTML:se(o),size:i}))}var dl=Sr.div`
|
|
266
266
|
display: flex;
|
|
267
267
|
flex-direction: column;
|
|
268
268
|
justify-content: flex-end;
|
|
269
269
|
padding-bottom: 14px;
|
|
270
270
|
overflow: visible;
|
|
271
|
-
`,
|
|
271
|
+
`,cl=Sr.div`
|
|
272
272
|
padding-left: 1px;
|
|
273
273
|
padding-right: 1px;
|
|
274
|
-
`,
|
|
275
|
-
align-
|
|
276
|
-
|
|
274
|
+
`,ml={text:pr,multipleChoice:ur,multipleChoiceList:xr};function br({stepData:e,canContinue:t,setCanContinue:o,onSaveData:i,appearance:r,customFormElements:n}){var F;let s=e.props,[p,d]=yr({}),[l,g]=yr([]),m={...ml,...n};pl(()=>{o(l.length===0)},[l,o]);function h(x,y){let C={...p,[x.id]:y};d(C),i(C)}return to.createElement(cl,{className:a("multiInput",r)},to.createElement(we,{appearance:r,title:e.title,subtitle:e.subtitle}),to.createElement(dl,{className:a("multiInputContainer",r)},(F=s.data)==null?void 0:F.map(x=>m[x.type]?to.createElement("span",{key:x.id},m[x.type]({formInput:x,customFormTypeProps:{stepData:e,canContinue:t,setCanContinue:o,onSaveData:i,appearance:r},onSaveInputData:y=>{h(x,y)},setFormValidationErrors:y=>{g(C=>y.length===0?C.filter(E=>E.id!==x.id):[...C,...y])}})):null)))}import xt from"styled-components";var Tr=xt.div`
|
|
275
|
+
align-items: center;
|
|
276
|
+
display: flex;
|
|
277
|
+
justify-content: space-between;
|
|
277
278
|
padding-top: 14px;
|
|
278
|
-
`,
|
|
279
|
+
`,wr=xt.div`
|
|
280
|
+
display: flex;
|
|
281
|
+
gap: 12px;
|
|
282
|
+
`,Fr=xt.div`
|
|
279
283
|
display: flex;
|
|
280
284
|
flex-direction: row;
|
|
281
285
|
flex: 1 1;
|
|
282
|
-
`,
|
|
286
|
+
`,kr=xt.div`
|
|
283
287
|
display: flex;
|
|
284
288
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
285
289
|
// Otherwise, use 4px padding
|
|
@@ -287,11 +291,11 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
287
291
|
flex-grow: 1;
|
|
288
292
|
flex-basis: 0;
|
|
289
293
|
position: relative;
|
|
290
|
-
`,
|
|
294
|
+
`,Pr=xt.div`
|
|
291
295
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
292
296
|
position: relative;
|
|
293
297
|
overflow-y: auto;
|
|
294
|
-
`,
|
|
298
|
+
`,vr=xt.div`
|
|
295
299
|
display: flex;
|
|
296
300
|
align-self: stretch;
|
|
297
301
|
flex-grow: 1;
|
|
@@ -303,10 +307,10 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
303
307
|
background-position: center;
|
|
304
308
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
305
309
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
306
|
-
`;import
|
|
310
|
+
`;import Ot from"react";import ul from"react";import Er from"styled-components";var fl=Er.button`
|
|
307
311
|
justify-content: center;
|
|
308
312
|
align-content: center;
|
|
309
|
-
${e=>
|
|
313
|
+
${e=>w(e)} {
|
|
310
314
|
display: flex;
|
|
311
315
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
312
316
|
width: ${e=>e.type==="full-width"?"100%":"auto"};
|
|
@@ -333,8 +337,8 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
333
337
|
opacity: 0.3;
|
|
334
338
|
cursor: not-allowed;
|
|
335
339
|
}
|
|
336
|
-
`,
|
|
337
|
-
${e=>
|
|
340
|
+
`,oo=Er.div`
|
|
341
|
+
${e=>w(e)} {
|
|
338
342
|
display: flex;
|
|
339
343
|
flex-direction: row;
|
|
340
344
|
justify-content: flex-start;
|
|
@@ -343,14 +347,14 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
343
347
|
margin-right: 8px;
|
|
344
348
|
}
|
|
345
349
|
}
|
|
346
|
-
`,
|
|
350
|
+
`,ee=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:l=""})=>{function g(){let m=s?"buttonSecondary":"button";return l===""?m:`${l}${or(m)}`}return ul.createElement(fl,{secondary:s,appearance:p,disabled:i,onClick:e,style:o,type:r,withMargin:d,size:n,className:a(g(),p)},t)};var Ir=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,formType:n,selectedStep:s,steps:p,onBack:d,allowBackNavigation:l})=>{let g=n==="inline"?"inline":"full-width";return Ot.createElement(Tr,{className:a("formCTAContainer",o)},p.length>1&&s!=0&&l&&Ot.createElement(ee,{title:"\u2190",onClick:d,secondary:!0,withMargin:!1,type:g,appearance:o}),Ot.createElement(wr,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?Ot.createElement(ee,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:g,appearance:o}):null," ",e.primaryButtonTitle?Ot.createElement(ee,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:g,appearance:o}):null))};import Ao from"react";import gl from"styled-components";var hl=gl.div`
|
|
347
351
|
text-align: center;
|
|
348
|
-
`,
|
|
352
|
+
`,Br=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=Q().mergeAppearanceWithDefault(i);return Ao.createElement(hl,{className:o},Ao.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>Ao.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import st from"react";import Ct from"styled-components";import{useContext as xl}from"react";function le(){let e=xl(G);function t(r){i(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){i(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function i(r,n){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Cl=Ct.div`
|
|
349
353
|
display: flex;
|
|
350
354
|
flex-wrap: wrap;
|
|
351
355
|
align-content: center;
|
|
352
356
|
justify-content: center;
|
|
353
|
-
`,
|
|
357
|
+
`,yl=Ct.div`
|
|
354
358
|
align-content: center;
|
|
355
359
|
align-items: center;
|
|
356
360
|
display: flex;
|
|
@@ -364,10 +368,10 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
364
368
|
flex-basis: 255px;
|
|
365
369
|
flex-grow: 0;
|
|
366
370
|
flex-shrink: 0;
|
|
367
|
-
`,Sl=
|
|
371
|
+
`,Sl=Ct.img`
|
|
368
372
|
width: 78px;
|
|
369
373
|
height: auto;
|
|
370
|
-
`,
|
|
374
|
+
`,bl=Ct.button`
|
|
371
375
|
font-style: normal;
|
|
372
376
|
font-weight: 600;
|
|
373
377
|
font-size: 13px;
|
|
@@ -380,11 +384,11 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
380
384
|
border-radius: 100px;
|
|
381
385
|
padding: 8px 12px;
|
|
382
386
|
margin-top: 16px;
|
|
383
|
-
`,
|
|
387
|
+
`,Tl=Ct.h1`
|
|
384
388
|
font-weight: 700;
|
|
385
389
|
font-size: 28px;
|
|
386
390
|
line-height: 34px;
|
|
387
|
-
`,
|
|
391
|
+
`,wl=Ct.h2`
|
|
388
392
|
font-style: normal;
|
|
389
393
|
font-weight: 400;
|
|
390
394
|
font-size: 16px;
|
|
@@ -393,7 +397,7 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
393
397
|
margin-top: 12px;
|
|
394
398
|
margin-bottom: 16px;
|
|
395
399
|
max-width: 70%;
|
|
396
|
-
`;function
|
|
400
|
+
`;function Ar({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=le();return st.createElement("div",null,st.createElement(Tl,null,e.title),st.createElement(wl,null,e.subtitle),st.createElement(Cl,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>st.createElement(yl,{key:n.title},st.createElement(Sl,{src:n.imageUri}),st.createElement(bl,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import St,{useEffect as Bl}from"react";import no from"styled-components";import No from"react";var ro=({style:e,className:t})=>No.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:t,style:e},No.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),No.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));import Lt,{useRef as Fl,useState as kl}from"react";import io from"styled-components";var Pl=io.div`
|
|
397
401
|
display: flex;
|
|
398
402
|
align-items: center;
|
|
399
403
|
justify-content: flex-start;
|
|
@@ -401,7 +405,7 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
401
405
|
width: 100%;
|
|
402
406
|
height: 100%;
|
|
403
407
|
position: relative;
|
|
404
|
-
`,
|
|
408
|
+
`,vl=io.div`
|
|
405
409
|
position: absolute;
|
|
406
410
|
display: flex;
|
|
407
411
|
align-items: center;
|
|
@@ -420,59 +424,59 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
420
424
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
421
425
|
border-radius: 50%;
|
|
422
426
|
}
|
|
423
|
-
`,
|
|
427
|
+
`,El=io.video`
|
|
424
428
|
width: 100%;
|
|
425
429
|
height: 100%;
|
|
426
430
|
min-height: 200px;
|
|
427
431
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
428
|
-
`,
|
|
432
|
+
`,Il=io.iframe`
|
|
429
433
|
width: 100%;
|
|
430
434
|
height: 100%;
|
|
431
435
|
min-height: 200px;
|
|
432
436
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
433
|
-
`;function
|
|
434
|
-
${e=>
|
|
437
|
+
`;function yt({appearance:e,videoUri:t}){let o=Fl(),[i,r]=kl(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),Lt.createElement(Il,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return Lt.createElement(Pl,{appearance:e},!i&&Lt.createElement(vl,{onClick:()=>{r(!0),o.current.play()},appearance:e},Lt.createElement(ro,null)),Lt.createElement(El,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Al=no.div`
|
|
438
|
+
${e=>w(e)} {
|
|
435
439
|
display: flex;
|
|
436
440
|
flex-direction: column;
|
|
437
441
|
justify-content: center;
|
|
438
442
|
}
|
|
439
|
-
`,
|
|
440
|
-
${e=>
|
|
443
|
+
`,Nl=no.img`
|
|
444
|
+
${e=>w(e)} {
|
|
441
445
|
width: 100%;
|
|
442
446
|
height: auto;
|
|
443
447
|
max-height: 250px;
|
|
444
448
|
margin-bottom: 24px;
|
|
445
449
|
}
|
|
446
|
-
`,Ol=
|
|
447
|
-
${e=>
|
|
450
|
+
`,Ol=no.div`
|
|
451
|
+
${e=>w(e)} {
|
|
448
452
|
margin-bottom: 24px;
|
|
449
453
|
}
|
|
450
|
-
`,Ll=
|
|
451
|
-
${e=>
|
|
454
|
+
`,Ll=no.div`
|
|
455
|
+
${e=>w(e)} {
|
|
452
456
|
width: 100%;
|
|
453
457
|
height: auto;
|
|
454
458
|
max-height: 250px;
|
|
455
459
|
margin-bottom: 24px;
|
|
456
460
|
}
|
|
457
|
-
`;function
|
|
461
|
+
`;function Nr({stepData:e,appearance:t,setCanContinue:o}){return Bl(()=>{o(!0)},[]),St.createElement(Al,{className:a("callToActionContainer",t)},St.createElement(Ol,{className:a("callToActionTextContainer",t)},St.createElement(we,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&St.createElement(Nl,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&St.createElement(Ll,{appearance:t,className:a("callToActionVideo",t)},St.createElement(yt,{appearance:t,videoUri:e.videoUri})))}import Ge,{useEffect as Oo,useState as Lo}from"react";import $t from"react";import Dt from"react";import{motion as Dl}from"framer-motion";var Or=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r,s={duration:.3,delay:0,ease:"easeIn"},p={hidden:{strokeDashoffset:r,transition:s},show:{strokeDashoffset:n,transition:s}};return Dt.createElement(Dl.circle,{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0,variants:p,transition:s,initial:"hidden",animate:"show"})},Ml=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9"})=>Dt.createElement("svg",{width:t,height:t,overflow:"visible"},Dt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Dt.createElement(Or,{color:r,size:t}),Dt.createElement(Or,{color:e,percentage:o,size:t})),i),Mt=Ml;import $l from"styled-components";var Ul=({color:e="#FFFFFF"})=>$t.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$t.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),_l={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},Wl={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},Hl={border:"1px solid #000000",color:"#FFFFFF"},zl={border:"1px solid #E6E6E6"},Gl={color:"#FFFFFF"},jl={border:"3px solid #D9D9D9"},Vl=e=>e==="square"?_l:Wl,ql=(e,t)=>e==="square"?t?Hl:zl:t?Gl:jl,Kl=$l.div`
|
|
458
462
|
${e=>it(e)}
|
|
459
|
-
`,
|
|
463
|
+
`,bt=({value:e,type:t="square",primaryColor:o="#000000",progress:i,appearance:r})=>{let n=Vl(t),s=ql(t,e);return e===!0?n={...n,...s,backgroundColor:o,borderColor:t==="square"?o:"none"}:n={...n,...s},e!==!0&&t==="round"&&i!==void 0&&i!==1?$t.createElement(Mt,{fillColor:o,percentage:i,size:22}):$t.createElement(Kl,{styleOverrides:n,role:"checkbox",className:Ce(a("checkIconContainer",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked")},e&&$t.createElement(Ul,{color:"#FFFFFF"}))};import Je from"styled-components";var Lr=Je.div`
|
|
460
464
|
width: auto;
|
|
461
465
|
display: flex;
|
|
462
466
|
flex-direction: column;
|
|
463
467
|
justify-content: center;
|
|
464
468
|
align-items: center;
|
|
465
469
|
padding: 4px;
|
|
466
|
-
`,
|
|
470
|
+
`,Dr=Je.div`
|
|
467
471
|
width: 100%;
|
|
468
472
|
text-align: left;
|
|
469
|
-
`,
|
|
473
|
+
`,Mr=Je.h1`
|
|
470
474
|
font-style: normal;
|
|
471
475
|
font-weight: 700;
|
|
472
476
|
font-size: 32px;
|
|
473
477
|
line-height: 38px;
|
|
474
478
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
475
|
-
|
|
479
|
+
`,$r=Je.h1`
|
|
476
480
|
font-style: normal;
|
|
477
481
|
font-weight: 400;
|
|
478
482
|
font-size: 16px;
|
|
@@ -480,7 +484,7 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
480
484
|
margin-top: 16px;
|
|
481
485
|
margin-bottom: 16px;
|
|
482
486
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
483
|
-
`,
|
|
487
|
+
`,Ur=Je.div`
|
|
484
488
|
padding-top: 12px;
|
|
485
489
|
padding-bottom: 12px;
|
|
486
490
|
flex-direction: row;
|
|
@@ -491,17 +495,17 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
491
495
|
cursor: pointer;
|
|
492
496
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
493
497
|
width: 100%;
|
|
494
|
-
|
|
498
|
+
`,_r=Je.div`
|
|
495
499
|
padding-top: 10px;
|
|
496
500
|
padding-bottom: 10px;
|
|
497
501
|
flex-direction: row;
|
|
498
502
|
display: flex;
|
|
499
503
|
justify-content: flex-start;
|
|
500
|
-
`,
|
|
504
|
+
`,Wr=Je.img`
|
|
501
505
|
width: 42px;
|
|
502
506
|
height: 42px;
|
|
503
507
|
margin-right: 12px;
|
|
504
|
-
`,
|
|
508
|
+
`,Hr=Je.p`
|
|
505
509
|
font-style: normal;
|
|
506
510
|
font-weight: 500;
|
|
507
511
|
font-size: 17px;
|
|
@@ -509,8 +513,8 @@ import at,{createContext as ia,useEffect as $o,useState as ve}from"react";import
|
|
|
509
513
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
510
514
|
display: flex;
|
|
511
515
|
align-self: center;
|
|
512
|
-
`;var
|
|
513
|
-
${i=>i.inlineStyles.map(([r,n])=>`.${
|
|
516
|
+
`;var zr=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=Lo([]),[p,d]=Lo(!1),[l,g]=Lo(e.id);return Oo(()=>{n.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Oo(()=>{l!==e.id&&(g(e.id),s([]))},[e]),Oo(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),Ge.createElement(Lr,{className:a("selectListContainer",i)},Ge.createElement(Dr,null,Ge.createElement(Mr,{className:a("selectListTitle",i)},e.title),Ge.createElement($r,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),r.options.map((m,h)=>{let F=n.includes(m.id);return Ge.createElement(Ur,{key:`select-item-${h}`,onClick:()=>{if(n.includes(m.id)){s(n.filter(x=>x!==m.id));return}n.length<r.maxChoices?s([...n,m.id]):n.length==1&&r.maxChoices==1&&s([m.id])},hideBottomBorder:h===r.options.length-1,className:a("selectListSelectItem",i)},Ge.createElement(_r,{className:a("selectListItemImage",i)},m.imageUri&&Ge.createElement(Wr,{src:m.imageUri,alt:`select-icon-${h}`}),Ge.createElement(Hr,{appearance:i,className:a("selectListSelectItemText",i)},m.title)),Ge.createElement(bt,{appearance:i,value:F,primaryColor:i.theme.colorPrimary}))}))};import ue,{useEffect as Yl,useState as Do}from"react";import{AnimatePresence as Xl,motion as Jl}from"framer-motion";var Ql=({children:e,id:t,shouldWrap:o=!1})=>ue.createElement(ue.Fragment,null,o?ue.createElement(Xl,{initial:!1},ue.createElement(Jl.div,{key:t,initial:{opacity:1,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"-100%"},transition:{duration:.5,ease:"easeInOut"},style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e)):e),so=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:l,onComplete:g,setVisible:m,setShowModal:h,onDismiss:F,showPagination:x=!1,customFormElements:y,allowBackNavigation:C})=>{let T={...{linkCollection:Ar,multiInput:br,callToAction:Nr,selectList:zr},...i},{primaryCTAClickSideEffects:B,secondaryCTAClickSideEffects:P}=le(),[c,u]=Do(!1),[b,I]=Do({}),[U,M]=Do(!1),_=t[o]??null,{markStepCompleted:O,markStepStarted:H,isLoading:N,updateCustomVariables:j,markFlowCompleted:K}=X();Yl(()=>{j(r)},[r,N]);function V(){return{data:b[t[o].id]??{},stepId:t[o].id,customVariables:r}}function z($,J,A){let q=o+1<t.length?t[o+1]:null;n&&n($,o,J,q),s&&s($,A,q,b,V())}function te($,J){I(A=>{let q={};return q[$.id]=J,{...A,...q}})}function oe($){return $.selectedStep.imageUri?ue.createElement(vr,{image:$.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let Z=ue.createElement(Ir,{step:t[o],canContinue:c||!U,formType:d,selectedStep:o,appearance:e,onPrimaryClick:async()=>{M(!0);let $={...V()};await O(p,t[o].id,$),o+1<t.length&&await H(p,t[o+1].id),z(t[o],"primary",o),o+1>=t.length&&(g&&g(),F&&F(),l&&(m&&m(!1),h(!1)),await K(p)),B(t[o]),M(!1)},onSecondaryClick:()=>{z(t[o],"secondary",o),P(t[o])},onBack:async()=>{o-1>=0&&(M(!0),await H(p,t[o-1].id),M(!1))},steps:t,allowBackNavigation:C});return ue.createElement(ue.Fragment,null,ue.createElement(Fr,{className:a("formContainer",e)},ue.createElement(kr,null,ue.createElement(Ql,{id:o,shouldWrap:d==="large-modal"},ue.createElement(Pr,{key:_.id,type:d,className:a("formContent",e)},t.map($=>{let J=T[$.type];return _.id!==$.id?null:ue.createElement(J,{key:$.id,stepData:$,canContinue:c,setCanContinue:u,onSaveData:A=>{te($,A)},appearance:e,customFormElements:y})}),x&&ue.createElement(Br,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),Z))),d=="large-modal"&&ue.createElement(oe,{selectedStep:t[o]})))};import Ut from"react";import{createGlobalStyle as Zl}from"styled-components";function pe({appearance:e}){if(!e||!e.styleOverrides)return Ut.createElement(Ut.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,r])=>typeof r=="object");if(t.length===0)return Ut.createElement(Ut.Fragment,null);let o=Zl`
|
|
517
|
+
${i=>i.inlineStyles.map(([r,n])=>`.${Nt}${r}.${Nt}${r} { ${Object.entries(n).map(([s,p])=>`${Fo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Ut.createElement(o,{inlineStyles:t})}var Gr=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:g,onButtonClick:m,dismissible:h=!0,endFlowOnDismiss:F=!1,modalPosition:x="center",repeatable:y=!1,onDismiss:C,showPagination:E=!1,allowBackNavigation:T=!1})=>{let{getFlow:B,getFlowSteps:P,isLoading:c,targetingLogicShouldHideFlow:u,getFlowStatus:b,getCurrentStepIndex:I,markFlowCompleted:U,markFlowNotStarted:M}=X(),_=I(e),{mergeAppearanceWithDefault:O}=Q(),[H,N]=ea(!1),{setOpenFlowState:j,getOpenFlowState:K}=ke();d=O(d);let[V,z]=i!==void 0&&r!==void 0?[i,r]:[K(e,!0),$=>j(e,$)];if(Rl(()=>{!H&&!c&&(N(!0),b(e)===R&&y&&M(e),N(!0))},[H,N,c]),c)return null;let te=B(e);if(!te||u(te))return null;let oe=P(e);if(!oe||i!==void 0&&i===!1||b(e)===R&&l)return null;let Z=()=>{z(!1),C&&C(),F===!0&&U(e)};if(x=="center"&&o==="modal"||o==="large-modal"){let $={padding:"24px"};return o==="large-modal"?($.width="85%",$.height="90%",$.maxHeight="800px",$.minHeight="500px",$.padding="0"):$.width="400px",Oe.createElement(Ye,{appearance:d,onClose:Z,visible:V,style:$,dismissible:h},Oe.createElement(pe,{appearance:d}),Oe.createElement(so,{appearance:d,steps:oe,selectedStep:_,customStepTypes:t,customVariables:n,onButtonClick:m,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:z,onDismiss:C,showPagination:E,customFormElements:s,allowBackNavigation:T}))}return o==="modal"&&x!=="center"?Oe.createElement(ir,{appearance:d,onClose:Z,visible:V},Oe.createElement(pe,{appearance:d}),Oe.createElement(so,{appearance:d,steps:oe,selectedStep:_,customStepTypes:t,customVariables:n,onButtonClick:m,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:z,onDismiss:C,showPagination:E,customFormElements:s,allowBackNavigation:T})):Oe.createElement(Oe.Fragment,null,Oe.createElement(pe,{appearance:d}),Oe.createElement(so,{appearance:d,steps:oe,selectedStep:_,customStepTypes:t,customVariables:n,onButtonClick:m,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:z,onDismiss:C,showPagination:E,customFormElements:s,allowBackNavigation:T}))},jr=Gr;import{useCallback as Vr,useContext as ta,useEffect as oa}from"react";function Mo(){let{organizationId:e,userId:t,setOrganizationId:o}=ta(G),{mutateUserFlowState:i}=Te(),{config:r}=Ne(),n=ft(),{verifySDKInitiated:s}=gt();oa(()=>{if(t&&e){if(t.startsWith(ht))return;let l=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(l)||(n(`${ge}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(l,"true"))}},[t,e]);let p=Vr(async l=>{if(s(),!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let g={foreignUserId:t,foreignUserGroupId:e,properties:l};await n(`${ge}userGroups`,{...r,method:"POST",body:JSON.stringify(g)}),i()},[e,t,r,i]),d=Vr(async(l,g)=>{if(s(),!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let h={foreignUserId:t,foreignUserGroupId:e,events:[{event:l,properties:g}]};await n(`${ge}userGroups`,{...r,method:"POST",body:JSON.stringify(h)}),i()},[e,t,r,i]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:p,trackEventForOrganization:d}}var qr="xFrigade_guestUserId",Kr="xFrigade_userId",Yr=({})=>{let{setFlowResponses:e}=At(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Te(),{userId:r,setUserId:n}=wo(),[s,p]=$o(null),{getFlowStatus:d}=X(),{flows:l,userProperties:g,setIsNewGuestUser:m,flowResponses:h}=ra(G),[F,x]=$o([]),[y,C]=$o([]),{organizationId:E}=Mo();lo(()=>{if(!o&&t)for(let c=0;c<t.length;c++){let u=t[c],b=l.find(I=>I.slug===(u==null?void 0:u.flowId));if(b&&u&&u.shouldTrigger===!0&&b.type=="FORM"&&b.triggerType==="AUTOMATIC"&&!y.includes(b.slug)){setTimeout(()=>{T(u.flowId)},500);break}}},[o,t]),lo(()=>{h.length>0&&i()},[h]);function T(c){let u=l.find(b=>b.slug===c);u&&u.triggerType==="AUTOMATIC"&&!y.includes(u.slug)&&(C([...y,u.slug]),x([u]))}function B(){if(!r){let c=localStorage.getItem(Kr);if(c){n(c);return}let u=localStorage.getItem(qr);if(u){n(u);return}m(!0);let b=ht+ia();try{localStorage.setItem(qr,b)}catch(I){console.log("Failed to save guest user id locally: Local storage unavailable",I)}n(I=>I||b)}}lo(()=>{try{if(l){let c=[];l.forEach(u=>{if(u.data){let b=u.data.match(/"imageUri":"(.*?)"/g);b&&b.forEach(I=>{let U=I.replace('"imageUri":"',"").replace('"',"");if(c.includes(U))return;let M=new Image;M.src=U,c.push(U)})}})}}catch{}},[l]),lo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(ht))try{localStorage.setItem(Kr,r)}catch(c){console.log("Failed to save user id locally: Local storage available",c)}r===null&&setTimeout(()=>{r===null&&B()},50)},[r,l,g]);function P(){return lt.createElement(lt.Fragment,null,F.map(c=>d(c.slug)!==Ae?null:lt.createElement("span",{key:c.slug},lt.createElement(jr,{flowId:c.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return lt.createElement(lt.Fragment,null,lt.createElement(P,null))};var ao={theme:{colorPrimary:"#000000",colorText:"#000000",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#505050",colorTextDisabled:"#999999",colorBorder:"#E5E5E5",borderRadius:20}};import{ErrorBoundary as la}from"react-error-boundary";var G=na({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:ao,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{}}),aa=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var N,j;let[n,s]=ve(t||null),[p,d]=ve(o||null),[l,g]=ve([]),[m,h]=ve([]),[F,x]=ve([]),[y,C]=ve({}),[E,T]=ve({}),[B,P]=ve({}),[c,u]=ve(!1),[b,I]=ve(!1),[U,M]=ve(!H(e)),_=(K,V)=>{if(V==="_blank"){window.open(K,"_blank");return}setTimeout(()=>{window.location.href=K},50)},O={theme:{...ao.theme,...((N=i==null?void 0:i.defaultAppearance)==null?void 0:N.theme)??{}},styleOverrides:{...ao.styleOverrides,...((j=i==null?void 0:i.defaultAppearance)==null?void 0:j.styleOverrides)??{}}};function H(K){return!!(K&&K.length>10&&K.substring(0,10)==="api_public")}return Uo(()=>{t&&s(t)},[t]),Uo(()=>{o&&d(o)},[o]),Uo(()=>{if(H(e))M(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),M(!0);return}},[e,M]),U?at.createElement(G.Provider,{value:{publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:m,setFailedFlowResponses:h,flowResponses:F,setFlowResponses:x,userProperties:y,setUserProperties:C,openFlowStates:E,setOpenFlowStates:T,customVariables:B,setCustomVariables:P,isNewGuestUser:c,setIsNewGuestUser:u,hasActiveFullPageFlow:b,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:_,defaultAppearance:O,shouldGracefullyDegrade:U,setShouldGracefullyDegrade:M}},r):at.createElement(la,{fallback:at.createElement(at.Fragment,null,r)},at.createElement(G.Provider,{value:{publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:m,setFailedFlowResponses:h,flowResponses:F,setFlowResponses:x,userProperties:y,setUserProperties:C,openFlowStates:E,setOpenFlowStates:T,customVariables:B,setCustomVariables:P,isNewGuestUser:c,setIsNewGuestUser:u,hasActiveFullPageFlow:b,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:_,defaultAppearance:O,shouldGracefullyDegrade:U,setShouldGracefullyDegrade:M}},at.createElement(sa,{theme:O.theme},r,at.createElement(Yr,null))))};import np from"react";import ne,{useEffect as kn,useState as Pn}from"react";import Ee,{useState as Ba}from"react";import dt from"styled-components";import uo from"react";import po from"react";import Jr from"styled-components";var Xr=Jr.span`
|
|
514
518
|
font-weight: 400;
|
|
515
519
|
font-size: 15px;
|
|
516
520
|
line-height: 20px;
|
|
@@ -519,7 +523,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
519
523
|
vertical-align: middle;
|
|
520
524
|
margin-left: 12px;
|
|
521
525
|
padding-right: 12px;
|
|
522
|
-
`,
|
|
526
|
+
`,pa=Jr.div`
|
|
523
527
|
flex-direction: row;
|
|
524
528
|
justify-content: space-between;
|
|
525
529
|
display: flex;
|
|
@@ -527,24 +531,24 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
527
531
|
padding-bottom: 20px;
|
|
528
532
|
border-top: 1px solid ${e=>e.theme.colorBorder};
|
|
529
533
|
width: 100%;
|
|
530
|
-
`,
|
|
534
|
+
`,co=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="square",appearance:p})=>po.createElement(pa,{className:a("checklistStepsContainer",p),appearance:p,style:{...r}},i==="left"&&e&&po.createElement(Xr,{className:a("checklistStepLabel",p),style:o},e),po.createElement(bt,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&po.createElement(Xr,{className:a("checklistStepLabel",p),style:o},e));import{motion as da}from"framer-motion";import _t from"styled-components";var Qr=_t.div`
|
|
531
535
|
font-weight: 700;
|
|
532
536
|
font-size: 18px;
|
|
533
537
|
line-height: 22px;
|
|
534
|
-
`,
|
|
538
|
+
`,Zr=_t.p`
|
|
535
539
|
font-weight: 700;
|
|
536
540
|
font-size: 18px;
|
|
537
541
|
line-height: 22px;
|
|
538
542
|
margin: 20px 0px 0px 0px;
|
|
539
543
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
540
|
-
`,
|
|
544
|
+
`,Rr=_t.p`
|
|
541
545
|
font-weight: 400;
|
|
542
546
|
font-size: 15px;
|
|
543
547
|
line-height: 28px;
|
|
544
548
|
max-width: 540px;
|
|
545
549
|
margin: 8px 0px 0px 0px;
|
|
546
550
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
547
|
-
`,
|
|
551
|
+
`,mo=_t.div`
|
|
548
552
|
width: 4px;
|
|
549
553
|
position: absolute;
|
|
550
554
|
left: 0;
|
|
@@ -552,21 +556,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
552
556
|
height: 80%;
|
|
553
557
|
border-top-right-radius: 8px;
|
|
554
558
|
border-bottom-right-radius: 8px;
|
|
555
|
-
`,
|
|
559
|
+
`,ei=_t.div`
|
|
556
560
|
flex-direction: row;
|
|
557
561
|
justify-content: flex-start;
|
|
558
|
-
`;var
|
|
562
|
+
`;var ti=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,d;return uo.createElement("div",{style:{position:"relative",paddingLeft:"20px"},onClick:()=>{n()}},o&&uo.createElement(mo,{className:a("checklistStepItemSelectedIndicator",s),as:da.div,layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),uo.createElement(ei,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,role:"listitem"},uo.createElement(co,{value:e.complete,labelPosition:"left",label:e.stepName,style:r,primaryColor:((d=s==null?void 0:s.theme)==null?void 0:d.colorPrimary)??i,appearance:s})))};import pt from"react";import{motion as ca}from"framer-motion";import _o from"styled-components";var ma={backgroundColor:"#E6E6E6"},ua=_o.div`
|
|
559
563
|
display: flex;
|
|
560
564
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
561
565
|
justify-content: flex-start;
|
|
562
566
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
563
567
|
|
|
564
568
|
${e=>it(e)}
|
|
565
|
-
`,
|
|
569
|
+
`,fa=_o.div`
|
|
566
570
|
flex-grow: 1;
|
|
567
571
|
position: relative;
|
|
568
572
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
569
|
-
`,
|
|
573
|
+
`,ga=_o.span`
|
|
570
574
|
font-weight: 500;
|
|
571
575
|
font-size: 15px;
|
|
572
576
|
line-height: 18px;
|
|
@@ -574,13 +578,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
574
578
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
575
579
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
576
580
|
${e=>it(e)}
|
|
577
|
-
`,
|
|
581
|
+
`,ha={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},xa={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},Le=({count:e,total:t,fillColor:o,bgColor:i=ma.backgroundColor,display:r="count",textLocation:n="left",style:s={},textStyle:p={},appearance:d})=>{var x,y;if(t===0)return pt.createElement(pt.Fragment,null);let l=e===0?"10px":`${e/t*100}%`,g=r==="compact"?"5px":"10px",m=Math.round(e/t*100),h=r==="compact"?"5px":"20px",F;return r==="count"?F=`${e} of ${t}`:r==="compact"?F=`${m}%`:r==="percent"&&(F=`${m}% complete`),n==="top"&&(h="0px"),pt.createElement(ua,{className:a("progressBarContainer",d),textLocation:n,styleOverrides:s},pt.createElement(ga,{className:a("progressBarStepText",d),style:{...p,fontSize:r==="compact"?12:15,fontWeight:r==="compact"?400:500},appearance:d,padding:h,textLocation:n},F),pt.createElement(fa,{textLocation:n,className:a("progressBar",d)},pt.createElement(ca.div,{style:{...xa,width:l,height:g,backgroundColor:((x=d==null?void 0:d.theme)==null?void 0:x.colorPrimary)??o,zIndex:r=="compact"?1:5},className:a("progressBarFill",d)}),pt.createElement("div",{className:a("progressBarBackground",d),style:{...ha,height:g,backgroundColor:((y=d==null?void 0:d.theme)==null?void 0:y.colorSecondary)??i}})))};import Ht from"react";import Ca from"styled-components";import go from"react";import fo from"react";var Tt=({stepData:e,appearance:t})=>fo.createElement(fo.Fragment,null,fo.createElement(Zr,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:se(e.title)}),fo.createElement(Rr,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:se(e.subtitle)}));import Wt from"react";var wt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Wt.createElement(Wt.Fragment,null,Wt.createElement(oo,null,e.secondaryButtonTitle&&Wt.createElement(ee,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}),Wt.createElement(ee,{appearance:t,title:e.primaryButtonTitle,onClick:o})))};var Ft=({stepData:e,appearance:t})=>go.createElement(go.Fragment,null,go.createElement(Tt,{stepData:e,appearance:t}),go.createElement(wt,{stepData:e,appearance:t}));import oi from"react";function ri(e){if(e.videoUri.includes("youtube")){let t=e.videoUri.split("v=")[1],o=t.indexOf("&");return o!==-1&&(t=t.substring(0,o)),oi.createElement("iframe",{width:"480",height:"260",src:`https://www.youtube.com/embed/${t}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:a("checklistStepVideo",e.appearance)})}else return oi.createElement("video",{width:"480",height:"260",controls:!0,src:e.videoUri})}var Wo="default",ya=Ca.img`
|
|
578
582
|
border-radius: 4px;
|
|
579
583
|
max-height: 260px;
|
|
580
584
|
min-height: 200px;
|
|
581
|
-
`,
|
|
585
|
+
`,ii=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Ht.createElement("div",null,o)}return Ht.createElement(Qr,{className:a("checklistStepContent",t)},e.imageUri?Ht.createElement(ya,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Ht.createElement(ri,{videoUri:e.videoUri,appearance:t}):null,Ht.createElement(Ft,{stepData:e,appearance:t}))};import ye,{useRef as Sa,useState as ba}from"react";import kt from"styled-components";var ni=kt.div`
|
|
582
586
|
display: block;
|
|
583
|
-
`,
|
|
587
|
+
`,Ta=kt.div`
|
|
584
588
|
display: flex;
|
|
585
589
|
flex-direction: row;
|
|
586
590
|
flex-wrap: wrap;
|
|
@@ -590,20 +594,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
590
594
|
align-content: center;
|
|
591
595
|
margin-top: 24px;
|
|
592
596
|
margin-bottom: 24px;
|
|
593
|
-
`,
|
|
597
|
+
`,wa=kt.div`
|
|
594
598
|
display: flex;
|
|
595
599
|
align-items: center;
|
|
596
600
|
justify-content: flex-start;
|
|
597
601
|
flex-direction: column;
|
|
598
602
|
margin-right: 16px;
|
|
599
|
-
`,
|
|
603
|
+
`,Fa=kt.video`
|
|
600
604
|
width: 200px;
|
|
601
605
|
height: 120px;
|
|
602
|
-
`,
|
|
606
|
+
`,ka=kt.div`
|
|
603
607
|
font-size: 14px;
|
|
604
608
|
line-height: 20px;
|
|
605
609
|
text-align: center;
|
|
606
|
-
`,
|
|
610
|
+
`,Pa=kt.div`
|
|
607
611
|
position: absolute;
|
|
608
612
|
width: 200px;
|
|
609
613
|
height: 120px;
|
|
@@ -623,9 +627,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
623
627
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
624
628
|
border-radius: 50%;
|
|
625
629
|
}
|
|
626
|
-
`,
|
|
630
|
+
`,si="videoCarousel",li=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return ye.createElement(ni,null,ye.createElement(Ft,{stepData:e,appearance:t}));function o({video:n}){let s=Sa(),[p,d]=ba(!1);return ye.createElement(wa,null,!p&&ye.createElement(Pa,{onClick:()=>{d(!0),s.current.play()},appearance:t},ye.createElement(ro,null)),ye.createElement(Fa,{controls:p,ref:s,play:p,src:n.uri}),ye.createElement(ka,null,n.title))}let i=e.props;return i.videos?ye.createElement(ni,null,ye.createElement(Tt,{stepData:e,appearance:t}),ye.createElement(Ta,null,i.videos.map((n,s)=>ye.createElement("span",{key:`${n.uri}-${s}`},ye.createElement(o,{video:n})))),ye.createElement(wt,{stepData:e,appearance:t})):null};import je from"react";import ho from"styled-components";var ai=ho.div`
|
|
627
631
|
display: block;
|
|
628
|
-
`,
|
|
632
|
+
`,va=ho.pre`
|
|
629
633
|
display: block;
|
|
630
634
|
background-color: #2a2a2a;
|
|
631
635
|
color: #f8f8f8;
|
|
@@ -641,21 +645,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
641
645
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
642
646
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
643
647
|
margin-bottom: 24px;
|
|
644
|
-
`,
|
|
648
|
+
`,Ea=ho.div`
|
|
645
649
|
font-size: 15px;
|
|
646
650
|
line-height: 20px;
|
|
647
651
|
margin-bottom: 12px;
|
|
648
652
|
margin-top: 12px;
|
|
649
|
-
`,
|
|
653
|
+
`,Ia=ho.div`
|
|
650
654
|
margin-top: 24px;
|
|
651
|
-
`,
|
|
655
|
+
`,pi="codeSnippet",di=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return je.createElement(ai,null,je.createElement(Ft,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?je.createElement(ai,null,je.createElement(Tt,{stepData:e,appearance:t}),je.createElement(Ia,null,o.codeSnippets.map((r,n)=>je.createElement("div",{key:n},r.title?je.createElement(Ea,null,r.title):null,r.code?je.createElement(va,null,r.code):null))),je.createElement(wt,{stepData:e,appearance:t})):null};var Aa=dt.div`
|
|
652
656
|
display: flex;
|
|
653
657
|
flex-direction: row;
|
|
654
658
|
min-width: ${e=>e.type!="modal"?"1000px":"100%"};
|
|
655
659
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
656
660
|
box-shadow: ${e=>e.type!="modal"?"0px 6px 25px rgba(0, 0, 0, 0.06)":"none"};
|
|
657
661
|
border-radius: 8px;
|
|
658
|
-
`,
|
|
662
|
+
`,Na=dt.h1`
|
|
659
663
|
font-size: 24px;
|
|
660
664
|
font-weight: 600;
|
|
661
665
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
@@ -664,7 +668,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
664
668
|
line-height: 20px;
|
|
665
669
|
color: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary)??"#4d4d4d"}};
|
|
666
670
|
margin: 10px 0px 0px 0px;
|
|
667
|
-
`,
|
|
671
|
+
`,ci=dt.div`
|
|
668
672
|
padding-bottom: 16px;
|
|
669
673
|
`,La=dt.div`
|
|
670
674
|
list-style: none;
|
|
@@ -672,38 +676,38 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
672
676
|
margin: 0;
|
|
673
677
|
cursor: pointer;
|
|
674
678
|
width: 300px;
|
|
675
|
-
`,
|
|
679
|
+
`,Da=dt.div`
|
|
676
680
|
width: 1px;
|
|
677
681
|
margin: 40px;
|
|
678
682
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
679
|
-
`,
|
|
683
|
+
`,Ma=dt.div`
|
|
680
684
|
flex: 2;
|
|
681
685
|
padding: 2rem;
|
|
682
|
-
|
|
686
|
+
`,$a=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:g}=Q();d=g(d);let h={...{[Wo]:ii,[si]:li,[pi]:di},...p},[F,x]=Ba(0),y=r??F,C=n??x,E=o.filter(B=>B.complete===!0).length,T=()=>{var B;return!((B=o[y])!=null&&B.type)||!h[o[y].type]?h[Wo]({stepData:o[y],appearance:d}):h[o[y].type]({stepData:o[y],appearance:d})};return Ee.createElement(Aa,{type:l,style:i,className:s,appearance:d},Ee.createElement(ci,{style:{flex:1}},Ee.createElement(ci,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},Ee.createElement(Na,{className:a("checklistTitle",d),appearance:d},e),Ee.createElement(Oa,{className:a("checklistSubtitle",d),appearance:d},t),Ee.createElement(Le,{total:o.length,count:E,fillColor:d.theme.colorPrimary,style:{marginTop:"24px"},appearance:d})),Ee.createElement(La,{className:a("checklistStepsContainer",d)},o.map((B,P)=>Ee.createElement(ti,{data:B,index:P,key:P,listLength:o.length,isSelected:P===y,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{C(P)}})))),Ee.createElement(Da,{appearance:d,className:a("checklistDivider",d)}),Ee.createElement(Ma,null,Ee.createElement(T,null)))},Ho=$a;import L,{useState as Ga}from"react";import mi from"react";import Ua from"styled-components";var _a=Ua.svg`
|
|
683
687
|
transition: 'transform 0.35s ease-in-out';
|
|
684
|
-
`,
|
|
688
|
+
`,Pt=({color:e="#323232",style:t,className:o})=>mi.createElement(_a,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},mi.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import{motion as ja}from"framer-motion";import ae from"styled-components";var zo={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},ui=ae.div`
|
|
685
689
|
max-height: 350px;
|
|
686
690
|
padding-bottom: 40px;
|
|
687
|
-
`,
|
|
691
|
+
`,fi=ae.div`
|
|
688
692
|
display: flex;
|
|
689
693
|
flex-direction: column;
|
|
690
694
|
margin-top: 20px;
|
|
691
|
-
`,
|
|
695
|
+
`,gi=ae.h1`
|
|
692
696
|
font-style: normal;
|
|
693
697
|
font-weight: 600;
|
|
694
698
|
font-size: 30px;
|
|
695
699
|
line-height: 36px;
|
|
696
700
|
margin-bottom: 16px;
|
|
697
701
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
698
|
-
`,
|
|
702
|
+
`,hi=ae.h2`
|
|
699
703
|
font-weight: 400;
|
|
700
704
|
font-size: 16px;
|
|
701
705
|
line-height: 20px;
|
|
702
706
|
margin-bottom: 16px;
|
|
703
707
|
padding-left: 1px;
|
|
704
708
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
705
|
-
`,
|
|
706
|
-
${e=>
|
|
709
|
+
`,xi=ae.div`
|
|
710
|
+
${e=>w(e)} {
|
|
707
711
|
border: 1px solid #fafafa;
|
|
708
712
|
}
|
|
709
713
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
@@ -712,12 +716,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
712
716
|
flex-direction: column;
|
|
713
717
|
min-height: 240px;
|
|
714
718
|
overflow: hidden;
|
|
715
|
-
`,
|
|
719
|
+
`,Ci=ae.div`
|
|
716
720
|
display: flex;
|
|
717
721
|
flex-direction: row;
|
|
718
722
|
justify-content: space-between;
|
|
719
|
-
`,
|
|
720
|
-
${e=>
|
|
723
|
+
`,yi=ae.p`
|
|
724
|
+
${e=>w(e)} {
|
|
721
725
|
font-weight: 400;
|
|
722
726
|
font-size: 10px;
|
|
723
727
|
line-height: 12px;
|
|
@@ -725,13 +729,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
725
729
|
color: #8c8c8c;
|
|
726
730
|
margin: 20px;
|
|
727
731
|
}
|
|
728
|
-
`,Si=
|
|
732
|
+
`,Si=ae.div`
|
|
729
733
|
display: flex;
|
|
730
734
|
flex-direction: row;
|
|
731
|
-
`,
|
|
735
|
+
`,bi=ae.div`
|
|
732
736
|
flex: 1;
|
|
733
|
-
`,
|
|
734
|
-
${e=>
|
|
737
|
+
`,Ti=ae.div`
|
|
738
|
+
${e=>w(e)} {
|
|
735
739
|
display: flex;
|
|
736
740
|
justify-content: center;
|
|
737
741
|
align-content: center;
|
|
@@ -740,8 +744,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
740
744
|
padding-left: 8px;
|
|
741
745
|
padding-right: 8px;
|
|
742
746
|
}
|
|
743
|
-
`,
|
|
744
|
-
${e=>
|
|
747
|
+
`,wi=ae.p`
|
|
748
|
+
${e=>w(e)} {
|
|
745
749
|
font-style: normal;
|
|
746
750
|
font-weight: 600;
|
|
747
751
|
font-size: 22px;
|
|
@@ -752,8 +756,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
752
756
|
margin-top: 20px;
|
|
753
757
|
margin-bottom: 16px;
|
|
754
758
|
}
|
|
755
|
-
`,
|
|
756
|
-
${e=>
|
|
759
|
+
`,Fi=ae.p`
|
|
760
|
+
${e=>w(e)} {
|
|
757
761
|
font-weight: 400;
|
|
758
762
|
font-size: 14px;
|
|
759
763
|
line-height: 18px;
|
|
@@ -761,15 +765,15 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
761
765
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
762
766
|
margin-bottom: 8px;
|
|
763
767
|
}
|
|
764
|
-
`,
|
|
765
|
-
${e=>
|
|
768
|
+
`,ki=ae.div`
|
|
769
|
+
${e=>w(e)} {
|
|
766
770
|
display: flex;
|
|
767
771
|
flex-direction: row;
|
|
768
772
|
justify-content: center;
|
|
769
773
|
gap: 8px;
|
|
770
774
|
}
|
|
771
|
-
`,
|
|
772
|
-
${e=>
|
|
775
|
+
`,Pi=ae.div`
|
|
776
|
+
${e=>w(e)} {
|
|
773
777
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
774
778
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
775
779
|
:hover {
|
|
@@ -788,8 +792,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
788
792
|
justify-content: space-between;
|
|
789
793
|
position: relative;
|
|
790
794
|
cursor: pointer;
|
|
791
|
-
`,
|
|
792
|
-
${e=>
|
|
795
|
+
`,vi=ae.p`
|
|
796
|
+
${e=>w(e)} {
|
|
793
797
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
794
798
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
795
799
|
}
|
|
@@ -797,12 +801,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
797
801
|
font-size: 14px;
|
|
798
802
|
line-height: 22px;
|
|
799
803
|
margin: 0;
|
|
800
|
-
`,
|
|
804
|
+
`,Ei=ae.div`
|
|
801
805
|
display: flex;
|
|
802
806
|
flex-direction: row;
|
|
803
807
|
justify-content: flex-end;
|
|
804
808
|
align-content: center;
|
|
805
|
-
`,
|
|
809
|
+
`,Ii=ae.div`
|
|
806
810
|
display: flex;
|
|
807
811
|
flex: 1;
|
|
808
812
|
flex-direction: row;
|
|
@@ -810,14 +814,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
810
814
|
align-content: center;
|
|
811
815
|
align-items: center;
|
|
812
816
|
margin-right: 20px;
|
|
813
|
-
`,
|
|
817
|
+
`,Bi=ae.div`
|
|
814
818
|
display: block;
|
|
815
819
|
width: 100%;
|
|
816
|
-
`;import
|
|
820
|
+
`;import Wa from"styled-components";var Ai=Wa.div`
|
|
817
821
|
flex-direction: column;
|
|
818
822
|
justify-content: center;
|
|
819
823
|
display: flex;
|
|
820
|
-
`;import qe from"react";import{motion as
|
|
824
|
+
`;import qe from"react";import{motion as Ha}from"framer-motion";import Ve from"styled-components";var Ni=Ve.div`
|
|
821
825
|
border: 1px solid #fafafa;
|
|
822
826
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
823
827
|
border-radius: 14px;
|
|
@@ -832,7 +836,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
832
836
|
overflow: hidden;
|
|
833
837
|
row-gap: 10px;
|
|
834
838
|
`,Li=Ve.div`
|
|
835
|
-
${e=>
|
|
839
|
+
${e=>w(e)} {
|
|
836
840
|
color: #595959;
|
|
837
841
|
}
|
|
838
842
|
text-transform: uppercase;
|
|
@@ -841,8 +845,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
841
845
|
line-height: 12px;
|
|
842
846
|
letter-spacing: 0.09em;
|
|
843
847
|
margin-bottom: 12px;
|
|
844
|
-
`,
|
|
845
|
-
${e=>
|
|
848
|
+
`,Di=Ve.div`
|
|
849
|
+
${e=>w(e)} {
|
|
846
850
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
847
851
|
background: #ffffff;
|
|
848
852
|
border: 1px solid #fafafa;
|
|
@@ -854,8 +858,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
854
858
|
|
|
855
859
|
max-width: 150px;
|
|
856
860
|
min-width: 200px;
|
|
857
|
-
`,
|
|
858
|
-
${e=>
|
|
861
|
+
`,Mi=Ve.div`
|
|
862
|
+
${e=>w(e)} {
|
|
859
863
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
860
864
|
}
|
|
861
865
|
width: 40px;
|
|
@@ -866,14 +870,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
866
870
|
justify-content: center;
|
|
867
871
|
align-content: center;
|
|
868
872
|
align-items: center;
|
|
869
|
-
|
|
873
|
+
`,$i=Ve.div`
|
|
870
874
|
font-weight: 600;
|
|
871
875
|
font-size: 20px;
|
|
872
876
|
line-height: 24px;
|
|
873
877
|
width: 20px;
|
|
874
878
|
height: 20px;
|
|
875
|
-
|
|
876
|
-
${e=>
|
|
879
|
+
`,Ui=Ve.div`
|
|
880
|
+
${e=>w(e)} {
|
|
877
881
|
color: #434343;
|
|
878
882
|
}
|
|
879
883
|
font-weight: 600;
|
|
@@ -881,20 +885,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
881
885
|
line-height: 17px;
|
|
882
886
|
margin-top: 12px;
|
|
883
887
|
margin-bottom: 8px;
|
|
884
|
-
`,
|
|
885
|
-
${e=>
|
|
888
|
+
`,_i=Ve.div`
|
|
889
|
+
${e=>w(e)} {
|
|
886
890
|
color: #8c8c8c;
|
|
887
891
|
}
|
|
888
892
|
font-weight: 400;
|
|
889
893
|
font-size: 12px;
|
|
890
894
|
line-height: 14px;
|
|
891
|
-
`,
|
|
895
|
+
`,Wi=Ve.a`
|
|
892
896
|
color: ${e=>e.color};
|
|
893
897
|
font-size: 12px;
|
|
894
898
|
line-height: 14px;
|
|
895
899
|
font-weight: 400;
|
|
896
900
|
cursor: pointer;
|
|
897
|
-
`;var
|
|
901
|
+
`;var za=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=le();return qe.createElement(Ni,{style:t,className:a("guideContainer",r)},qe.createElement(Li,{className:a("guideTitle",r)},o),qe.createElement(Oi,{className:a("guideItemContainer",r)},e.map((p,d)=>qe.createElement(Di,{key:`guide-${p.id??d}`,as:Ha.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:a("guideItem",r)},p.icon&&qe.createElement(Mi,{className:a("guideIcon",r)},qe.createElement($i,null,p.icon)),qe.createElement(Ui,{className:a("guideItemTitle",r),dangerouslySetInnerHTML:se(p.title)}),qe.createElement(_i,{className:a("guideItemSubtitle",r),dangerouslySetInnerHTML:se(p.subtitle)}),qe.createElement(Wi,{className:a("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},zt=za;var Va=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:l,guideData:g,guideTitle:m,onGuideButtonClick:h})=>{let F=({stepData:u,handleSecondaryCTAClick:b,handleCTAClick:I})=>u?L.createElement(Ti,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},L.createElement(wi,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:se(u.title)}),L.createElement(Fi,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:se(u.subtitle)}),L.createElement(ki,{className:a("checklistCTAContainer",l)},u.secondaryButtonTitle&&L.createElement(ee,{title:u.secondaryButtonTitle,onClick:b,appearance:l,secondary:!0}),L.createElement(ee,{title:u.primaryButtonTitle,onClick:I,appearance:l}))):L.createElement(L.Fragment,null),y={...{default:u=>{var M;if((M=e[T])!=null&&M.StepContent){let _=e[T].StepContent;return L.createElement("div",null,_)}let b=e[T];return L.createElement(F,{stepData:u,handleCTAClick:()=>{b.handlePrimaryButtonClick&&b.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{b.handleSecondaryButtonClick&&b.handleSecondaryButtonClick()}})}},...d},[C,E]=Ga(0),T=s??C,B=p??E,P=()=>{var u;return e?!((u=e[T])!=null&&u.type)||!y[e[T].type]?y.default(e[T]):y[e[T].type]({stepData:e[T],primaryColor:l.theme.colorPrimary}):L.createElement(L.Fragment,null)},c=e.filter(u=>u.complete).length;return r?(l.theme.modalContainer||(l.theme.borderRadius&&(zo.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=zo),L.createElement(Ye,{onClose:n,visible:r,appearance:l},L.createElement(Bi,null,L.createElement(fi,null,L.createElement(gi,{appearance:l,className:a("checklistTitle",l)},t),L.createElement(hi,{appearance:l,className:a("checklistSubtitle",l)},o)),L.createElement(ui,null,e&&e.length>0&&L.createElement(xi,{className:a("stepsContainer",l)},L.createElement(Ci,null,L.createElement("div",{style:{flex:3}},L.createElement(yi,{className:a("stepsTitle",l)},i)),L.createElement(Ii,null,L.createElement(Le,{fillColor:l.theme.colorPrimary,style:{width:"100%"},count:c,total:e.length,appearance:l}))),L.createElement(Si,null,L.createElement(bi,{className:a("checklistStepListContainer",l),appearance:l},e.map((u,b)=>{let I=T===b;return L.createElement(Pi,{selected:I,className:a(`checklistStepListItem${I?"Selected":""}`,l),key:`checklist-guide-step-${u.id??b}`,disabled:u.blocked,onClick:()=>{u.blocked||B(b)},title:u.blocked?"Finish remaining steps to continue":void 0},I&&L.createElement(mo,{className:a("checklistStepItemSelectedIndicator",l),as:ja.div,layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),L.createElement(vi,{selected:I,className:a(`checklistStepListStepName${I?"Selected":""}`,l)},u.stepName),L.createElement(Ei,null,L.createElement(bt,{value:u.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:u.progress,appearance:l}),L.createElement(Ai,null,L.createElement(Pt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),L.createElement(P,null))),g&&g.length>0&&L.createElement(zt,{steps:g,title:m,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:u=>(h&&h(u),!0)}))))):L.createElement(L.Fragment,null)},Go=Va;import{useEffect as qa,useState as Ka}from"react";var Hi=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=Ka(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let g=window.matchMedia(l);return g.addEventListener("change",n),[d,g.matches]}));i(p)};return qa(()=>{s()},[]),o};import he,{useEffect as on,useState as Ja}from"react";import de from"react";import{AnimatePresence as Ya,motion as Xa}from"framer-motion";import Ke from"styled-components";var zi=Ke.div`
|
|
898
902
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
899
903
|
border: 1px solid;
|
|
900
904
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -906,42 +910,42 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
906
910
|
display: flex;
|
|
907
911
|
flex-direction: column;
|
|
908
912
|
transition: max-height 0.25s;
|
|
909
|
-
`,
|
|
913
|
+
`,Gi=Ke.div`
|
|
910
914
|
display: flex;
|
|
911
915
|
margin-bottom: 20px;
|
|
912
|
-
`,
|
|
916
|
+
`,ji=Ke.img`
|
|
913
917
|
border-radius: 4px;
|
|
914
918
|
max-height: 260px;
|
|
915
919
|
min-height: 200px;
|
|
916
|
-
`,
|
|
920
|
+
`,Vi=Ke.div`
|
|
917
921
|
display: flex;
|
|
918
922
|
flex-direction: row;
|
|
919
923
|
justify-content: space-between;
|
|
920
924
|
align-items: center;
|
|
921
|
-
`,
|
|
925
|
+
`,qi=Ke.p`
|
|
922
926
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
923
927
|
font-style: normal;
|
|
924
928
|
font-weight: 500;
|
|
925
929
|
font-size: 16px;
|
|
926
930
|
line-height: 18px;
|
|
927
931
|
margin-left: 8px;
|
|
928
|
-
`,
|
|
932
|
+
`,Ki=Ke.div`
|
|
929
933
|
padding: 20px;
|
|
930
934
|
cursor: pointer;
|
|
931
935
|
:hover {
|
|
932
936
|
opacity: 0.8;
|
|
933
937
|
}
|
|
934
|
-
`,
|
|
938
|
+
`,th=Ke.div``,Yi=Ke.p`
|
|
935
939
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
936
940
|
font-weight: 400;
|
|
937
941
|
font-size: 14px;
|
|
938
942
|
line-height: 22px;
|
|
939
|
-
`,
|
|
943
|
+
`,Xi=Ke.div`
|
|
940
944
|
display: flex;
|
|
941
945
|
flex-direction: row;
|
|
942
946
|
justify-content: flex-start;
|
|
943
947
|
align-items: center;
|
|
944
|
-
`;var
|
|
948
|
+
`;var Ji=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n})=>{var p,d;let s=t?{}:{transform:"rotate(90deg)"};return de.createElement(zi,{onClick:()=>t?o():null,"data-testid":`step-${e.id}`,className:a("checklistStepContainer",n),appearance:n},de.createElement(Vi,{className:a("stepHeader",n)},de.createElement(Xi,null,de.createElement(co,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(p=n==null?void 0:n.theme)==null?void 0:p.colorPrimary,appearance:n}),de.createElement(qi,{appearance:n,className:a("stepTitle",n),dangerouslySetInnerHTML:se(e.title)})),de.createElement(Ki,{className:a("stepChevronContainer",n),onClick:()=>o()},de.createElement(Pt,{style:{...s,transition:"transform 0.1s ease-in-out"},color:(d=n==null?void 0:n.theme)==null?void 0:d.colorTextSecondary}))),de.createElement(Ya,null,!t&&de.createElement(Xa.div,{initial:{opacity:1,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:1,height:0},key:e.id,style:{overflow:"hidden"}},e.imageUri||e.videoUri&&de.createElement(Gi,{className:a("stepMediaContainer",n)},e.imageUri?de.createElement(ji,{className:a("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?de.createElement(yt,{appearance:n,videoUri:e.videoUri}):null),de.createElement(Yi,{className:a("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:se(e.subtitle)}),de.createElement(oo,{className:a("checklistCTAContainer",n)},e.secondaryButtonTitle?de.createElement(ee,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,de.createElement(ee,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:n})))))};import vt from"styled-components";var gh=vt.div`
|
|
945
949
|
background: #ffffff;
|
|
946
950
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
947
951
|
border-radius: 6px;
|
|
@@ -955,49 +959,49 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
955
959
|
|
|
956
960
|
max-width: 800px;
|
|
957
961
|
min-width: 350px;
|
|
958
|
-
`,
|
|
962
|
+
`,Qi=vt.div`
|
|
959
963
|
display: flex;
|
|
960
964
|
flex-direction: column;
|
|
961
|
-
`,
|
|
965
|
+
`,Zi=vt.h1`
|
|
962
966
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
963
967
|
font-style: normal;
|
|
964
968
|
font-weight: 700;
|
|
965
969
|
font-size: 20px;
|
|
966
970
|
line-height: 24px;
|
|
967
971
|
margin-bottom: 8px;
|
|
968
|
-
`,
|
|
972
|
+
`,Ri=vt.h2`
|
|
969
973
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
970
974
|
font-weight: 400;
|
|
971
975
|
font-size: 14px;
|
|
972
976
|
line-height: 23px;
|
|
973
977
|
margin: 2px 0 0 0;
|
|
974
|
-
`,
|
|
978
|
+
`,en=vt.div`
|
|
975
979
|
display: block;
|
|
976
980
|
width: 100%;
|
|
977
|
-
`,
|
|
981
|
+
`,tn=vt.div`
|
|
978
982
|
display: flex;
|
|
979
983
|
width: 100%;
|
|
980
984
|
flex-direction: column;
|
|
981
985
|
justify-content: space-between;
|
|
982
986
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
983
987
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
984
|
-
`;var
|
|
988
|
+
`;var Qa=({title:e,subtitle:t,steps:o,onClose:i,visible:r,onCompleteStep:n,autoExpandFirstIncompleteStep:s=!0,autoCollapse:p=!0,autoExpandNextStep:d=!0,primaryColor:l="#000000",selectedStep:g,setSelectedStep:m,appearance:h,type:F,className:x})=>{let y=o.filter(c=>c.complete).length,[C,E]=Ja(Array(o.length).fill(!0));on(()=>{let c=[...C];if(s){for(let u=0;u<o.length;u++)if(!o[u].complete){c[u]=!1;break}E(c)}},[]),on(()=>{T(g)},[g]);let T=c=>{let u=[...C];if(p)for(let b=0;b<C.length;++b)b!==c&&(u[b]=!0);u[c]=!u[c],E(u)};if(!r&&F=="modal")return he.createElement(he.Fragment,null);let B=he.createElement(he.Fragment,null,he.createElement(Qi,null,he.createElement(Zi,{appearance:h,className:a("checklistTitle",h),dangerouslySetInnerHTML:se(e)}),he.createElement(Ri,{appearance:h,className:a("checklistSubtitle",h),dangerouslySetInnerHTML:se(t)})),he.createElement(Le,{display:"percent",count:y,total:o.length,fillColor:l,style:{margin:"14px 0px 8px 0px"},appearance:h})),P=he.createElement(en,{className:Ce(a("checklistContainer",h),x)},o.map((c,u)=>{let b=C[u];return he.createElement(Ji,{appearance:h,stepData:c,collapsed:b,key:`modal-checklist-${c.id??u}`,onClick:()=>{if(g===u){T(u);return}m(u)},onPrimaryButtonClick:()=>{n&&n(u,c),c.handlePrimaryButtonClick&&c.handlePrimaryButtonClick(),d&&!c.completionCriteria&&u<C.length-1&&C[u+1]&&m(u+1)},onSecondaryButtonClick:()=>{c.handleSecondaryButtonClick&&c.handleSecondaryButtonClick()}})}));return F==="inline"?he.createElement(tn,{appearance:h,className:Ce(a("checklistInlineContainer",h),x)},B,P):he.createElement(he.Fragment,null,he.createElement(Ye,{onClose:i,visible:r,appearance:h,style:{maxWidth:"600px"},headerContent:B},P))},jo=Qa;import ie,{useEffect as Vo,useRef as rp,useState as mt}from"react";import ct from"react";import re,{css as rn,keyframes as nn}from"styled-components";var sn=rn`
|
|
985
989
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
986
|
-
`,Qa=on`
|
|
987
|
-
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
988
990
|
`,Za=rn`
|
|
991
|
+
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
992
|
+
`,Ra=nn`
|
|
989
993
|
from {
|
|
990
994
|
opacity: 0;
|
|
991
995
|
} to {
|
|
992
996
|
opacity: 1;
|
|
993
997
|
}
|
|
994
|
-
`,
|
|
998
|
+
`,ep=nn`
|
|
995
999
|
from {
|
|
996
1000
|
opacity: 1;
|
|
997
1001
|
} to {
|
|
998
1002
|
opacity: 0;
|
|
999
1003
|
}
|
|
1000
|
-
`,
|
|
1004
|
+
`,ln=re.div`
|
|
1001
1005
|
margin: 0 -20px;
|
|
1002
1006
|
overflow-x: auto;
|
|
1003
1007
|
padding-left: 20px;
|
|
@@ -1014,14 +1018,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1014
1018
|
::-webkit-scrollbar {
|
|
1015
1019
|
display: none;
|
|
1016
1020
|
}
|
|
1017
|
-
`,
|
|
1021
|
+
`,an=re.div`
|
|
1018
1022
|
display: flex;
|
|
1019
1023
|
flex-flow: row nowrap;
|
|
1020
1024
|
gap: 0 16px;
|
|
1021
1025
|
scroll-snap-align: center;
|
|
1022
1026
|
scroll-snap-stop: always;
|
|
1023
|
-
`,
|
|
1024
|
-
animation: ${e=>e.reversed?Ra
|
|
1027
|
+
`,pn=re.div`
|
|
1028
|
+
animation: ${e=>e.reversed?ep:Ra} 0.25s ease-out;
|
|
1025
1029
|
background: linear-gradient(
|
|
1026
1030
|
to right,
|
|
1027
1031
|
${({theme:e})=>e.colorBackground}00,
|
|
@@ -1029,8 +1033,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1029
1033
|
);
|
|
1030
1034
|
position: absolute;
|
|
1031
1035
|
width: 64px;
|
|
1032
|
-
`,
|
|
1033
|
-
${
|
|
1036
|
+
`,dn=re.button`
|
|
1037
|
+
${sn}
|
|
1034
1038
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1035
1039
|
align-items: center;
|
|
1036
1040
|
border-radius: 50%;
|
|
@@ -1041,11 +1045,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1041
1045
|
justify-content: center;
|
|
1042
1046
|
position: absolute;
|
|
1043
1047
|
width: 48px;
|
|
1044
|
-
`,
|
|
1048
|
+
`,cn=re.div`
|
|
1045
1049
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1046
1050
|
padding: 20px;
|
|
1047
|
-
`,
|
|
1048
|
-
${
|
|
1051
|
+
`,mn=re(cn)`
|
|
1052
|
+
${sn}
|
|
1049
1053
|
background: ${({theme:e})=>e.colorBackground};
|
|
1050
1054
|
|
|
1051
1055
|
&:active {
|
|
@@ -1056,94 +1060,94 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1056
1060
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1057
1061
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1058
1062
|
}
|
|
1059
|
-
`,
|
|
1063
|
+
`,un=re.img`
|
|
1060
1064
|
border-radius: 50%;
|
|
1061
1065
|
height: 40px;
|
|
1062
1066
|
margin-bottom: 12px;
|
|
1063
1067
|
width: 40px;
|
|
1064
|
-
`,
|
|
1065
|
-
${e=>
|
|
1066
|
-
${
|
|
1068
|
+
`,fn=re(cn)`
|
|
1069
|
+
${e=>w(e)} {
|
|
1070
|
+
${Za}
|
|
1067
1071
|
|
|
1068
1072
|
background: ${({theme:e})=>e.colorBackground};
|
|
1069
1073
|
}
|
|
1070
|
-
`,
|
|
1074
|
+
`,gn=re.div`
|
|
1071
1075
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1072
1076
|
display: flex;
|
|
1073
1077
|
flex-flow: row nowrap;
|
|
1074
1078
|
align-items: center;
|
|
1075
1079
|
margin-left: 20px;
|
|
1076
|
-
`,
|
|
1080
|
+
`,hn=re.div`
|
|
1077
1081
|
white-space: nowrap;
|
|
1078
|
-
`,
|
|
1082
|
+
`,xn=re.div`
|
|
1079
1083
|
background: #d8fed8;
|
|
1080
1084
|
border-radius: 6px;
|
|
1081
1085
|
margin-bottom: 12px;
|
|
1082
1086
|
padding: 4px 10px;
|
|
1083
|
-
`,
|
|
1087
|
+
`,tp=re.p`
|
|
1084
1088
|
font-weight: bold;
|
|
1085
1089
|
font-size: 18px;
|
|
1086
1090
|
line-height: 22px;
|
|
1087
1091
|
letter-spacing: calc(18px * -0.01);
|
|
1088
1092
|
margin: 0;
|
|
1089
|
-
`,
|
|
1093
|
+
`,Cn=re(tp)`
|
|
1090
1094
|
margin-bottom: 4px;
|
|
1091
|
-
`,
|
|
1095
|
+
`,op=re.p`
|
|
1092
1096
|
font-weight: bold;
|
|
1093
1097
|
font-size: 16px;
|
|
1094
1098
|
line-height: 20px;
|
|
1095
1099
|
letter-spacing: calc(16px * -0.01);
|
|
1096
1100
|
margin: 0;
|
|
1097
|
-
`,
|
|
1101
|
+
`,yn=re(op)`
|
|
1098
1102
|
margin-bottom: 4px;
|
|
1099
1103
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1100
1104
|
`}
|
|
1101
|
-
`,De=
|
|
1105
|
+
`,De=re.p`
|
|
1102
1106
|
color: ${({theme:e})=>e.colorText};
|
|
1103
1107
|
font-weight: normal;
|
|
1104
1108
|
font-size: 14px;
|
|
1105
1109
|
line-height: 22px;
|
|
1106
1110
|
margin: 0;
|
|
1107
|
-
`,Sn=
|
|
1111
|
+
`,Sn=re.p`
|
|
1108
1112
|
color: ${({theme:e})=>e.colorText};
|
|
1109
1113
|
font-weight: 600;
|
|
1110
1114
|
font-size: 12px;
|
|
1111
1115
|
line-height: 16px;
|
|
1112
1116
|
margin: 0;
|
|
1113
|
-
`;De.Loud=
|
|
1117
|
+
`;De.Loud=re(De)`
|
|
1114
1118
|
font-weight: 600;
|
|
1115
|
-
`;De.Quiet=
|
|
1119
|
+
`;De.Quiet=re(De)`
|
|
1116
1120
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1117
1121
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1118
1122
|
`}
|
|
1119
|
-
`;var
|
|
1123
|
+
`;var bn=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=Q(),{primaryCTAClickSideEffects:r}=le(),{theme:n,styleOverrides:s}=i(o),{imageUri:p=null,subtitle:d=null,title:l=null,complete:g=!1,blocked:m=!1}=e,h=()=>{r(e)};return ct.createElement(mn,{className:a("carouselCard",o),onClick:m?null:h,style:t,blocked:m,complete:g},ct.createElement("div",{style:{alignItems:"flex-start",display:"flex",justifyContent:"space-between"}},p&&ct.createElement(un,{className:a("carouselCardImage",o),src:p,alt:l,style:{opacity:g||m?.4:1}}),g&&ct.createElement(xn,{className:a("carouselCompletedPill",o)},ct.createElement(Sn,{style:{color:"#108E0B"}},"Complete"))),l&&ct.createElement(yn,{blocked:m,complete:g,className:a("carouselCardTitle",o)},l),d&&ct.createElement(De.Quiet,{blocked:m,complete:g,className:a("carouselCardSubtitle",o)},d))};import Gt from"react";var Tn=({numberOfStepsCompleted:e,numberOfSteps:t,appearance:o})=>{let i=t>0?e/t:0,r=200,n=Math.min(r,Math.max(10,Math.round(r*i)));return Gt.createElement(gn,{className:a("carouselProgressBar",o)},Gt.createElement(hn,{as:De.Loud,style:{marginRight:8}},e," of ",t),Gt.createElement("svg",{height:10,width:r},Gt.createElement("rect",{x:0,y:0,rx:5,width:r,height:10,fill:"#E6E6E6"}),Gt.createElement("rect",{x:0,y:0,rx:5,width:n,height:10,fill:"currentColor"})))};var ip=()=>ie.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ie.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ie.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ie.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),wn=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=mt(!1),[n,s]=mt(!1);Vo(()=>{t===!0&&i===!1?r(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?ie.createElement(pn,{style:d,reversed:n,onAnimationEnd:n?p:null},ie.createElement(dn,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ie.createElement(ip,null))):null},Fn=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=rp(null),[n,s]=mt(!1),[p,d]=mt(!1),[l,g]=mt(null),[m,h]=mt([]),[F,x]=mt(0),{getFlowMetadata:y,getFlowSteps:C,getNumberOfStepsCompleted:E,updateCustomVariables:T,getFlowStatus:B,isLoading:P,targetingLogicShouldHideFlow:c,getFlow:u}=X();Vo(()=>{T(o)},[o,P]),Vo(()=>{if(P)return;let O=y(e),H=E(e),N=C(e);g(O),O.data!==null&&(h(N.sort((j,K)=>Number(j.complete)-Number(K.complete))),d(N.length>3),x(H))},[P]);let b=[];for(let O=0;O<m.length;O+=3)b.push(m.slice(O,O+3));let I=O=>{let H=O.target,N=H.scrollWidth-H.clientWidth,j=Math.ceil(H.scrollLeft);j>0&&n===!1&&s(!0),j===0&&n===!0&&s(!1),j<N&&p===!1&&d(!0),j===N&&p===!0&&d(!1)},U=(O=!0)=>{let H=O?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*H,behavior:"smooth"})},M=null,_=O=>{M!==null?clearTimeout(M):I(O),M=setTimeout(()=>{I(O)},16)};return P?null:ie.createElement(fn,{className:Ce(a("carouselContainer",t),i)},ie.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},ie.createElement("div",null,ie.createElement(Cn,{className:a("carouselTitle",t)},l==null?void 0:l.title),ie.createElement(De.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),ie.createElement(Tn,{numberOfStepsCompleted:F,numberOfSteps:m.length})),ie.createElement("div",{style:{position:"relative"}},ie.createElement(wn,{show:n,onClick:()=>U(!1)}),ie.createElement(wn,{side:"right",show:p,onClick:U}),ie.createElement(ln,{ref:r,onScroll:_},b.map((O,H)=>ie.createElement(an,{key:H,style:{flex:`0 0 calc(100% - ${m.length>3?36:0}px)`}},O.map((N,j)=>ie.createElement(bn,{key:j,stepData:N,style:{flex:m.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))))};var qo=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:d,customVariables:l,onStepCompletion:g,onButtonClick:m,appearance:h,hideOnFlowCompletion:F,setVisible:x,customStepTypes:y,checklistStyle:C="default",...E})=>{let{getFlow:T,getFlowSteps:B,markStepCompleted:P,getStepStatus:c,getNumberOfStepsCompleted:u,isLoading:b,targetingLogicShouldHideFlow:I,updateCustomVariables:U,getFlowMetadata:M,isStepBlocked:_,getFlowStatus:O,hasActiveFullPageFlow:H,setHasActiveFullPageFlow:N}=X(),{primaryCTAClickSideEffects:j,secondaryCTAClickSideEffects:K}=le(),{getOpenFlowState:V,setOpenFlowState:z}=ke(),[te,oe]=Pn(r||0),[Z,$]=Pn(!1),J=d===void 0?V(e):d,A=s==="modal",{mergeAppearanceWithDefault:q}=Q(),{isLarge:Ue}=Hi();if(h=q(h),kn(()=>{U(l)},[l,b]),kn(()=>{d!==void 0&&(A&&d===!0?N(!0):A&&d===!1&&N(!1))},[d,x,H]),b)return null;let xe=T(e);if(!xe||I(xe))return null;let Se=B(e);if(!Se||F===!0&&O(e)===R)return null;let me=M(e);if(me!=null&&me.title&&(t=me.title),me!=null&&me.subtitle&&(o=me.subtitle),!Z&&r===void 0&&u(e)>0){let v=Math.min(u(e),Se.length-1);oe(v),$(!0)}function _e(){if(te+1>=Se.length){A&&z(e,!1);return}_(e,Se[te+1].id)||oe(te+1)}function We(v,Y,tt){let Jo=te+1<Se.length?Se[te+1]:null;m&&m(v,te,Y,Jo)===!0&&A&&Be(),g&&g(v,tt,Jo),!g&&!m&&(v.primaryButtonUri||v.secondaryButtonUri)&&A&&Be()}function et(){return Se.map((v,Y)=>({...v,handleSecondaryButtonClick:()=>{_e(),K(v),v.skippable===!0&&P(e,v.id,{skipped:!0}),We(v,"secondary",Y)},handlePrimaryButtonClick:()=>{(!v.completionCriteria&&(v.autoMarkCompleted||v.autoMarkCompleted===void 0)||v.completionCriteria&&v.autoMarkCompleted===!0)&&(P(e,v.id),_e()),We(v,"primary",Y),j(v),c(e,v.id)===Fe&&_e()}}))}function W(){return ne.createElement(pe,{appearance:h})}let Ie={steps:et(),title:t,subtitle:o,primaryColor:h.theme.colorPrimary,appearance:h,customStepTypes:y,type:s,className:n};function Be(){z(e,!1),p&&p(),x&&x(!1)}function bo(){return ne.createElement(ne.Fragment,null,ne.createElement(W,null),ne.createElement(Fn,{flowId:e,appearance:h,customVariables:l,className:n}))}function f(){return ne.createElement(ne.Fragment,null,ne.createElement(W,null),ne.createElement(jo,{visible:J,onClose:()=>{Be()},selectedStep:te,setSelectedStep:oe,autoExpandNextStep:!0,appearance:h,...Ie}))}function S(){if(!Ue)return f();let v=E.guideFlowId,Y;return v&&T(v)&&(Y=B(v)),ne.createElement(ne.Fragment,null,ne.createElement(W,null),ne.createElement(Go,{visible:J,stepsTitle:me.stepsTitle?me.stepsTitle:"Your quick start guide",onClose:()=>{Be()},selectedStep:te,setSelectedStep:oe,guideData:Y,guideTitle:E.guideTitle??"Guide",appearance:h,title:t,subtitle:o,onGuideButtonClick:tt=>{We(tt,"link",0)},...Ie}))}function k(){if(!Ue)return f();let v=ne.createElement(Ho,{flowId:e,style:i,selectedStep:te,setSelectedStep:oe,appearance:h,type:s,...Ie});return A?ne.createElement(Ye,{onClose:()=>{Be()},visible:J,appearance:h,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ne.createElement(W,null),v):ne.createElement(ne.Fragment,null,ne.createElement(W,null),v)}switch(C){case"condensed":return f();case"with-guide":return S();case"default":return k();case"carousel":return bo();default:return k()}};var sp=e=>np.createElement(qo,{type:"inline",...e});import Ze,{useEffect as ap}from"react";import Me from"react";import xo from"styled-components";var vn=xo.div`
|
|
1120
1124
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1121
1125
|
border-radius: 8px;
|
|
1122
1126
|
padding: 6px 10px 6px 10px;
|
|
1123
1127
|
min-width: 160px;
|
|
1124
1128
|
cursor: pointer;
|
|
1125
1129
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1126
|
-
`,
|
|
1130
|
+
`,En=xo.div`
|
|
1127
1131
|
display: flex;
|
|
1128
1132
|
flex-direction: row;
|
|
1129
1133
|
justify-content: space-between;
|
|
1130
1134
|
align-items: center;
|
|
1131
1135
|
margin-bottom: 2px;
|
|
1132
1136
|
flex-grow: 2;
|
|
1133
|
-
`,
|
|
1137
|
+
`,In=xo.div`
|
|
1134
1138
|
text-overflow: ellipsis;
|
|
1135
1139
|
font-weight: 600;
|
|
1136
1140
|
font-size: 12px;
|
|
1137
1141
|
line-height: 15px;
|
|
1138
1142
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1139
1143
|
color: ${e=>e.appearance.theme.colorPrimary};
|
|
1140
|
-
`,
|
|
1144
|
+
`,Bn=xo.div`
|
|
1141
1145
|
width: 20px;
|
|
1142
1146
|
margin-right: 8px;
|
|
1143
1147
|
display: flex;
|
|
1144
1148
|
height: 100%;
|
|
1145
1149
|
align-items: center;
|
|
1146
|
-
`;import{motion as
|
|
1150
|
+
`;import{motion as lp}from"framer-motion";var An=({title:e,count:t,total:o,onClick:i,style:r={},className:n,appearance:s,type:p="default"})=>Me.createElement(Me.Fragment,null,Me.createElement(pe,{appearance:s}),Me.createElement(vn,{as:lp.div,whileHover:{opacity:.9},whileTap:{scale:.98},onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:Ce(n??"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Me.createElement(Bn,{className:a("progressRingContainer",s)},Me.createElement(Mt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Me.createElement(En,{type:p,className:a("badgeTitleContainer",s)},Me.createElement(In,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&Me.createElement(Pt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Me.createElement(Le,{display:"compact",count:t,total:o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import Qe from"react";import jt from"styled-components";var Nn=jt.div`
|
|
1147
1151
|
display: flex;
|
|
1148
1152
|
flex-direction: row;
|
|
1149
1153
|
width: 100%;
|
|
@@ -1154,25 +1158,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1154
1158
|
border-width: 1px;
|
|
1155
1159
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1156
1160
|
border-radius: 12px;
|
|
1157
|
-
`,On=
|
|
1158
|
-
${e=>
|
|
1161
|
+
`,On=jt.div`
|
|
1162
|
+
${e=>w(e)} {
|
|
1159
1163
|
display: flex;
|
|
1160
1164
|
justify-content: center;
|
|
1161
1165
|
align-items: center;
|
|
1162
1166
|
margin-right: 16px;
|
|
1163
1167
|
}
|
|
1164
|
-
`,Ln=
|
|
1168
|
+
`,Ln=jt.div`
|
|
1165
1169
|
display: flex;
|
|
1166
1170
|
flex-direction: column;
|
|
1167
1171
|
flex: 1;
|
|
1168
1172
|
margin-top: 0;
|
|
1169
|
-
`,
|
|
1173
|
+
`,Dn=jt.div`
|
|
1170
1174
|
display: flex;
|
|
1171
1175
|
flex-direction: column;
|
|
1172
1176
|
justify-content: center;
|
|
1173
1177
|
margin-left: 16px;
|
|
1174
1178
|
min-width: 200px;
|
|
1175
|
-
`,Ax=
|
|
1179
|
+
`,Ax=jt.div`
|
|
1176
1180
|
display: flex;
|
|
1177
1181
|
justify-content: center;
|
|
1178
1182
|
align-items: flex-end;
|
|
@@ -1181,8 +1185,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1181
1185
|
:hover {
|
|
1182
1186
|
opacity: 0.8;
|
|
1183
1187
|
}
|
|
1184
|
-
`;var
|
|
1185
|
-
${e=>
|
|
1188
|
+
`;var Mn=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>Qe.createElement(Qe.Fragment,null,Qe.createElement(Nn,{appearance:i,className:Ce(a("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&Qe.createElement(On,{className:a("fullWidthProgressBadgeIcon",i)},o),Qe.createElement(Ln,null,Qe.createElement(we,{size:"small",appearance:i,title:e,subtitle:t})),Qe.createElement(Dn,{className:a("fullWidthProgressBadgeProgressContainer",i)},Qe.createElement(Le,{count:r,total:n,display:"percent",textLocation:"top",fillColor:i.theme.colorPrimary}))));var pp=({flowId:e,title:t,subtitle:o,icon:i,style:r,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:l,type:g="default"})=>{let{getFlow:m,getFlowSteps:h,getFlowStatus:F,getNumberOfStepsCompleted:x,isLoading:y,targetingLogicShouldHideFlow:C,updateCustomVariables:E}=X(),{mergeAppearanceWithDefault:T}=Q();l=T(l);let{setOpenFlowState:B,getOpenFlowState:P}=ke();if(ap(()=>{E(p)},[p,y]),y)return null;let c=m(e);if(!c||C(c)||d===!0&&F(e)===R)return null;let u=h(e),b=x(e);return g==="full-width"?Ze.createElement(Ze.Fragment,null,Ze.createElement(pe,{appearance:l}),Ze.createElement(Mn,{title:t,subtitle:o,count:b,total:u.length,style:r,className:s,appearance:l,icon:i,onClick:()=>{}})):Ze.createElement(Ze.Fragment,null,Ze.createElement(pe,{appearance:l}),Ze.createElement(An,{count:b,total:u.length,title:t,style:r,onClick:()=>{B(e,!0),n&&n()},type:g,className:s,appearance:l}))};import dp from"react";var cp=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:r,targetingLogicShouldHideFlow:n,getFlowSteps:s}=X(),{mergeAppearanceWithDefault:p}=Q();o=p(o);let d=r(e);if(!d||n(d))return null;let l=s(e);return dp.createElement(zt,{steps:l,style:t,appearance:o,...i})};import It,{useContext as wp,useEffect as Fp}from"react";import D,{useEffect as Co,useLayoutEffect as Kn,useRef as hp,useState as Vt}from"react";import qt from"styled-components";import{useCallback as mp,useEffect as up,useState as fp}from"react";var Ko=(e,t,o,i={x:20,y:20},r)=>{let n=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return!e||!e.left||!e.top?{x:0,y:0}:t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+n}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+n}:{x:0,y:0}},$n={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function gp(e){let t=$n;return e&&(t=e.getBoundingClientRect()),t}function Un(e,t){let[o,i]=fp($n),r=mp(()=>{e&&i(gp(e))},[e]);return up(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),o}import Re from"styled-components";var _n=Re.div`
|
|
1189
|
+
${e=>w(e)} {
|
|
1186
1190
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
1187
1191
|
}
|
|
1188
1192
|
|
|
@@ -1192,14 +1196,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1192
1196
|
min-width: 300px;
|
|
1193
1197
|
padding: 22px 22px 12px;
|
|
1194
1198
|
z-index: ${e=>e.zIndex};
|
|
1195
|
-
`,
|
|
1199
|
+
`,Wn=Re.div`
|
|
1196
1200
|
display: block;
|
|
1197
1201
|
cursor: pointer;
|
|
1198
1202
|
position: absolute;
|
|
1199
1203
|
top: 25px;
|
|
1200
1204
|
right: 22px;
|
|
1201
|
-
`,
|
|
1202
|
-
${e=>
|
|
1205
|
+
`,Hn=Re.img`
|
|
1206
|
+
${e=>w(e)} {
|
|
1203
1207
|
display: block;
|
|
1204
1208
|
width: 100%;
|
|
1205
1209
|
height: auto;
|
|
@@ -1207,8 +1211,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1207
1211
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
1208
1212
|
margin-bottom: 16px;
|
|
1209
1213
|
}
|
|
1210
|
-
`,
|
|
1211
|
-
${e=>
|
|
1214
|
+
`,zn=Re.div`
|
|
1215
|
+
${e=>w(e)} {
|
|
1212
1216
|
display: block;
|
|
1213
1217
|
width: 100%;
|
|
1214
1218
|
height: auto;
|
|
@@ -1216,30 +1220,30 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1216
1220
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
1217
1221
|
margin-bottom: 16px;
|
|
1218
1222
|
}
|
|
1219
|
-
`,
|
|
1223
|
+
`,Gn=Re.div`
|
|
1220
1224
|
display: flex;
|
|
1221
1225
|
flex-direction: row;
|
|
1222
1226
|
justify-content: space-between;
|
|
1223
1227
|
align-content: center;
|
|
1224
|
-
`,
|
|
1228
|
+
`,jn=Re.div`
|
|
1225
1229
|
display: flex;
|
|
1226
1230
|
flex: 1;
|
|
1227
1231
|
flex-direction: column;
|
|
1228
1232
|
justify-content: center;
|
|
1229
|
-
`,
|
|
1233
|
+
`,Vn=Re.div`
|
|
1230
1234
|
display: flex;
|
|
1231
1235
|
flex: 2;
|
|
1232
1236
|
flex-shrink: 1;
|
|
1233
1237
|
gap: 8px;
|
|
1234
1238
|
height: 64px;
|
|
1235
|
-
${e=>
|
|
1239
|
+
${e=>w(e)} {
|
|
1236
1240
|
flex-direction: row;
|
|
1237
1241
|
justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
|
|
1238
1242
|
align-content: center;
|
|
1239
1243
|
align-items: center;
|
|
1240
1244
|
}
|
|
1241
|
-
`,
|
|
1242
|
-
${e=>
|
|
1245
|
+
`,qn=Re.p`
|
|
1246
|
+
${e=>w(e)} {
|
|
1243
1247
|
font-style: normal;
|
|
1244
1248
|
font-weight: 600;
|
|
1245
1249
|
font-size: 15px;
|
|
@@ -1247,7 +1251,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1247
1251
|
color: #808080;
|
|
1248
1252
|
}
|
|
1249
1253
|
margin: 0;
|
|
1250
|
-
`;var
|
|
1254
|
+
`;var Yn=300,Xn=100,xp=500,Et=12,Cp=qt.div`
|
|
1251
1255
|
width: 100%;
|
|
1252
1256
|
height: 100%;
|
|
1253
1257
|
border-radius: 9999px;
|
|
@@ -1270,26 +1274,26 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1270
1274
|
opacity: 0;
|
|
1271
1275
|
}
|
|
1272
1276
|
}
|
|
1273
|
-
`,
|
|
1274
|
-
width: ${
|
|
1275
|
-
height: ${
|
|
1277
|
+
`,yp=qt.div`
|
|
1278
|
+
width: ${Et}px;
|
|
1279
|
+
height: ${Et}px;
|
|
1276
1280
|
border-radius: 100px;
|
|
1277
1281
|
background-color: ${e=>e.primaryColor};
|
|
1278
1282
|
z-index: 20;
|
|
1279
1283
|
opacity: 1;
|
|
1280
|
-
`,Sp=
|
|
1284
|
+
`,Sp=qt.div`
|
|
1281
1285
|
pointer-events: all;
|
|
1282
|
-
`,
|
|
1286
|
+
`,Jn=qt.div`
|
|
1283
1287
|
display: flex;
|
|
1284
1288
|
align-content: center;
|
|
1285
1289
|
justify-content: center;
|
|
1286
1290
|
align-items: center;
|
|
1287
1291
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1288
|
-
`,
|
|
1289
|
-
width: ${
|
|
1290
|
-
height: ${
|
|
1291
|
-
`,
|
|
1292
|
-
${e=>
|
|
1292
|
+
`,bp=qt(Jn)`
|
|
1293
|
+
width: ${Et+12}px;
|
|
1294
|
+
height: ${Et+12}px;
|
|
1295
|
+
`,Tp=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:r=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:g,appearance:m,dismissible:h=!1,showHighlightOnly:F,showStepCount:x=!0,completedStepsCount:y=0})=>{var me,_e,We,et;let[C,E]=Vt(),[T,B]=Vt(new Date),P=hp(null),[c,u]=Vt(document.querySelector(e[l].selector)),b=Un(c,T),[I,U]=Vt(),[M,_]=Vt(!F),O=(_e=(me=e[l])==null?void 0:me.props)!=null&&_e.position?e[l].props.position:"absolute",H=((et=(We=e[l])==null?void 0:We.props)==null?void 0:et.zIndex)??90,N=(C==null?void 0:C.width)??Yn,j=(C==null?void 0:C.height)??Xn;Kn(()=>{P.current&&E({width:P.current.clientWidth,height:P.current.clientHeight})},[l,T,O]),Co(()=>{F||_(!0)},[l]);let K=i==="auto"?"right":i,V=Ko(b,K,N,s,O),z=b.right+N>(window.innerWidth||document.documentElement.clientWidth),te=b.bottom+Xn>(window.innerHeight||document.documentElement.clientHeight);z&&i==="auto"&&(V=Ko(b,"left",N,s,O),K="left");let oe=window.location.pathname.split("/").pop(),Z=()=>{let W=document.querySelector(e[l].selector);I&&I===JSON.stringify(W==null?void 0:W.getBoundingClientRect())||(u(W),B(new Date),W&&U(JSON.stringify(W.getBoundingClientRect())))};if(Co(()=>{let W=new MutationObserver(Z);return W.observe(document.body,{subtree:!0,childList:!0}),()=>W.disconnect()},[Z]),Co(()=>{let W=new MutationObserver(Z);return W.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>W.disconnect()},[Z]),Co(()=>{let W=setInterval(()=>{Z()},10);return()=>clearInterval(W)},[Z]),Kn(()=>{setTimeout(()=>{Z()},xp),Z()},[l,oe]),c===null)return D.createElement(D.Fragment,null);if(V.x==0&&V.y==0)return D.createElement(D.Fragment,null);if(!p)return D.createElement(D.Fragment,null);let $=()=>{let W=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),_(!1),setTimeout(()=>{Z()},30)),y===e.length-1)return o()},Ie=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),F&&_(!1))};return D.createElement(D.Fragment,null,x&&D.createElement(jn,null,D.createElement(qn,{className:a("tooltipStepCounter",m)},l+1," of ",e.length)),D.createElement(Vn,{showStepCount:x,className:a("tooltipCTAContainer",m)},e[l].secondaryButtonTitle&&D.createElement(ee,{title:e[l].secondaryButtonTitle,appearance:m,onClick:Ie,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&D.createElement(ee,{title:e[l].primaryButtonTitle,appearance:m,onClick:W,withMargin:!1,size:"small"})))},J=()=>D.createElement(D.Fragment,null,h&&D.createElement(Wn,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",m)},D.createElement(Pe,null)),e[l].imageUri&&D.createElement(Hn,{dismissible:h,appearance:m,src:e[l].imageUri,className:a("tooltipImageContainer",m)}),e[l].videoUri&&!e[l].imageUri&&D.createElement(zn,{dismissible:h,appearance:m,className:a("tooltipVideoContainer",m)},D.createElement(yt,{appearance:m,videoUri:e[l].videoUri})),D.createElement(we,{appearance:m,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),D.createElement(Gn,{className:a("tooltipFooter",m)},D.createElement($,null))),q={...{default:W=>{var Ie;if((Ie=e[l])!=null&&Ie.StepContent){let Be=e[l].StepContent;return D.createElement("div",null,Be)}return D.createElement(J,null)}},...g},Ue=()=>{var W;return e?!((W=e[l])!=null&&W.type)||!q[e[l].type]?q.default(e[l]):q[e[l].type]({stepData:e[l],primaryColor:n}):D.createElement(D.Fragment,null)};if(F&&e[l].complete===!0)return null;let xe={top:(V==null?void 0:V.y)-Et,left:(K=="left"?b.x+s.x:(V==null?void 0:V.x)-Et)??0,cursor:F?"pointer":"default",position:O},Se=()=>{F&&(B(new Date),_(!M))};return D.createElement(Sp,null,D.createElement(bp,{style:xe,zIndex:H,className:a("tourHighlightContainer",m)},r&&e[l].showHighlight!==!1&&D.createElement(D.Fragment,null,D.createElement(yp,{style:{position:O},onClick:Se,primaryColor:m.theme.colorPrimary}),D.createElement(Cp,{style:{position:"absolute"},onClick:Se,primaryColor:m.theme.colorPrimary}))),D.createElement(Jn,{style:{...xe,left:xe.left+(K=="left"?-N:24)},zIndex:H+1,className:a("tooltipContainerWrapper",m)},M&&D.createElement(_n,{ref:P,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...d},appearance:m,className:a("tooltipContainer",m),maxWidth:Yn,zIndex:H+10},D.createElement(Ue,null))))},yo=Tp;import{Portal as kp}from"react-portal";var Pp=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:g="complete-flow",onComplete:m,...h})=>{let{getFlow:F,getFlowSteps:x,isLoading:y,targetingLogicShouldHideFlow:C,markStepCompleted:E,markStepStarted:T,markFlowCompleted:B,updateCustomVariables:P,getCurrentStepIndex:c,getStepStatus:u,isStepBlocked:b,getFlowStatus:I,getNumberOfStepsCompleted:U}=X(),{isLoadingUserFlowStateData:M}=Te(),{primaryCTAClickSideEffects:_,secondaryCTAClickSideEffects:O}=le(),{hasOpenModals:H}=ke(),N=c(e),{openFlowStates:j}=wp(G),{mergeAppearanceWithDefault:K}=Q();if(o=K(o),Fp(()=>{P(t)},[t,y]),M)return null;let V=F(e);if(!V||C(V)||I(e)==R||H())return null;let z=x(e);if(Object.keys(j).length>0){let A=Object.keys(j).find(q=>j[q]===!0);if(A!==void 0&&A!==e)return It.createElement(It.Fragment,null)}async function te(A){if(await E(e,A.id),z.map(q=>u(e,q.id)).every(q=>q===Fe)){await B(e);return}if(!l&&N+1<z.length){if(b(e,z[N+1].id))return;await T(e,z[N+1].id)}}function oe(A,q,Ue){let xe=N+1<z.length?z[N+1]:null;r&&r(A,N,q,xe),i&&i(A,Ue,xe)}function Z(){return z.map(A=>({...A,handleSecondaryButtonClick:async()=>{O(A),A.skippable===!0&&await E(e,A.id,{skipped:!0}),oe(A,"secondary",N)},handlePrimaryButtonClick:async()=>{(!A.completionCriteria&&(A.autoMarkCompleted||A.autoMarkCompleted===void 0)||A.completionCriteria&&A.autoMarkCompleted===!0)&&await te(A),oe(A,"primary",N),_(A)}}))}async function $(A){s&&s(),g==="complete-flow"?await B(e):await E(e,A.id)}function J(){m&&m()}return It.createElement(kp,null,It.createElement(pe,{appearance:o}),n?z.map((A,q)=>It.createElement(yo,{key:A.id,appearance:o,steps:Z(),selectedStep:q,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>$(A),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:U(e),onComplete:J,...h})):It.createElement(yo,{appearance:o,steps:Z(),selectedStep:N,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>$(z[N]),tooltipPosition:d,completedStepsCount:U(e),showHighlightOnly:l,onComplete:J,...h}))};import fe,{useEffect as vp,useRef as Ep,useState as Ip}from"react";import{Portal as Bp}from"react-portal";import ut from"styled-components";var Qn=ut.button`
|
|
1296
|
+
${e=>w(e)} {
|
|
1293
1297
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1294
1298
|
|
|
1295
1299
|
display: flex;
|
|
@@ -1306,17 +1310,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1306
1310
|
opacity: 0.8;
|
|
1307
1311
|
}
|
|
1308
1312
|
}
|
|
1309
|
-
`,
|
|
1310
|
-
${e=>
|
|
1313
|
+
`,Zn=ut.span`
|
|
1314
|
+
${e=>w(e)} {
|
|
1311
1315
|
font-size: 12px;
|
|
1312
1316
|
display: inline-block;
|
|
1313
1317
|
}
|
|
1314
|
-
`,
|
|
1315
|
-
${e=>
|
|
1318
|
+
`,Rn=ut.span`
|
|
1319
|
+
${e=>w(e)} {
|
|
1316
1320
|
font-size: 12px;
|
|
1317
1321
|
display: inline-block;
|
|
1318
1322
|
}
|
|
1319
|
-
`,
|
|
1323
|
+
`,es=ut.div`
|
|
1320
1324
|
position: fixed;
|
|
1321
1325
|
right: 0;
|
|
1322
1326
|
bottom: 0;
|
|
@@ -1326,8 +1330,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1326
1330
|
flex-direction: column;
|
|
1327
1331
|
align-items: flex-end;
|
|
1328
1332
|
z-index: 50;
|
|
1329
|
-
`,
|
|
1330
|
-
${e=>
|
|
1333
|
+
`,ts=ut.button`
|
|
1334
|
+
${e=>w(e)} {
|
|
1331
1335
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1332
1336
|
background-color: #ffffff;
|
|
1333
1337
|
border: 1px solid #f5f5f5;
|
|
@@ -1342,8 +1346,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1342
1346
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1343
1347
|
border-radius: 45px;
|
|
1344
1348
|
cursor: pointer;
|
|
1345
|
-
`,
|
|
1346
|
-
${e=>
|
|
1349
|
+
`,os=ut.div`
|
|
1350
|
+
${e=>w(e)} {
|
|
1347
1351
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1348
1352
|
background: #ffffff;
|
|
1349
1353
|
}
|
|
@@ -1359,8 +1363,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1359
1363
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1360
1364
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1361
1365
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1362
|
-
`,
|
|
1363
|
-
${e=>
|
|
1366
|
+
`,rs=ut.button`
|
|
1367
|
+
${e=>w(e)} {
|
|
1364
1368
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1365
1369
|
color: #434343;
|
|
1366
1370
|
:hover {
|
|
@@ -1376,8 +1380,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1376
1380
|
font-size: 14px;
|
|
1377
1381
|
|
|
1378
1382
|
padding: 8px 12px;
|
|
1379
|
-
`;import{AnimatePresence as
|
|
1380
|
-
${e=>
|
|
1383
|
+
`;import{AnimatePresence as as,motion as ps}from"framer-motion";import is from"react";var ns=({style:e,className:t})=>is.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},is.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import ss from"react";var ls=({style:e,className:t})=>ss.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},ss.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Ap=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:l,getStepStatus:g,getNumberOfStepsCompleted:m,isLoading:h,targetingLogicShouldHideFlow:F}=X(),{primaryCTAClickSideEffects:x}=le(),y=Ep(null),[C,E]=Ip(!1),{mergeAppearanceWithDefault:T}=Q();s=T(s),vp(()=>(document.addEventListener("click",B,!1),()=>{document.removeEventListener("click",B,!1)}),[]);let B=I=>{y.current&&!y.current.contains(I.target)&&E(!1)};if(h)return null;let P=p(e);if(!P||F(P))return null;let c=d(e);if(!c||!i)return null;function u(I,U){!I.completionCriteria&&(I.autoMarkCompleted||I.autoMarkCompleted===void 0)&&l(e,I.id),x(I),o&&o(I,U),E(!1)}function b(){return C&&fe.createElement(os,{className:a("floatingWidgetMenu",s),as:ps.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},c.map((I,U)=>fe.createElement(rs,{className:a("floatingWidgetMenuItem",s),key:U,onClick:()=>u(I,U)},I.title)))}return r=="inline"?fe.createElement("span",{ref:y},fe.createElement(Qn,{style:t,onClick:()=>{E(!C)},className:a("supportButton",s)},fe.createElement(Rn,{className:a("supportIconContainer",s)},fe.createElement(ls,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),fe.createElement(Zn,{className:a("supportButtonTitle",s)},n)),fe.createElement(as,null,fe.createElement(b,null))):fe.createElement(Bp,null,fe.createElement(es,{style:t,ref:y},fe.createElement(as,null,fe.createElement(b,null)),fe.createElement(ts,{onClick:()=>{E(!C)},as:ps.button,whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},fe.createElement(ns,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import $e,{useEffect as Np}from"react";import So from"styled-components";var ds=So.div`
|
|
1384
|
+
${e=>w(e)} {
|
|
1381
1385
|
display: flex;
|
|
1382
1386
|
flex-direction: column;
|
|
1383
1387
|
width: 100%;
|
|
@@ -1391,18 +1395,18 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1391
1395
|
border-radius: 12px;
|
|
1392
1396
|
position: relative;
|
|
1393
1397
|
}
|
|
1394
|
-
`,
|
|
1398
|
+
`,cs=So.div`
|
|
1395
1399
|
display: flex;
|
|
1396
1400
|
flex-direction: column;
|
|
1397
1401
|
flex: 1;
|
|
1398
|
-
`,
|
|
1402
|
+
`,ms=So.div`
|
|
1399
1403
|
display: flex;
|
|
1400
1404
|
flex-direction: column;
|
|
1401
1405
|
justify-content: center;
|
|
1402
1406
|
align-items: flex-start;
|
|
1403
1407
|
margin-top: 16px;
|
|
1404
|
-
`,
|
|
1405
|
-
${e=>
|
|
1408
|
+
`,us=So.div`
|
|
1409
|
+
${e=>w(e)} {
|
|
1406
1410
|
position: absolute;
|
|
1407
1411
|
top: 16px;
|
|
1408
1412
|
right: 16px;
|
|
@@ -1412,9 +1416,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1412
1416
|
opacity: 0.8;
|
|
1413
1417
|
}
|
|
1414
1418
|
}
|
|
1415
|
-
`;var Op=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:
|
|
1419
|
+
`;var Op=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:g,isLoading:m,targetingLogicShouldHideFlow:h,updateCustomVariables:F,getFlowSteps:x,getFlowStatus:y,getCurrentStepIndex:C}=X(),{primaryCTAClickSideEffects:E}=le(),{mergeAppearanceWithDefault:T}=Q();if(r=T(r),Np(()=>{F(o)},[o,m]),m)return null;let B=d(e);if(!B||h(B)||y(e)===R)return null;let c=x(e)[C(e)];return $e.createElement($e.Fragment,null,$e.createElement(pe,{appearance:r}),$e.createElement(ds,{appearance:r,className:Ce(a("embeddedTipContainer",r),n),style:s},(p===!0||c.dismissible)&&$e.createElement(us,{onClick:async()=>{await l(e),t&&t()},className:a("embeddedTipDismissButton",r)},$e.createElement(Pe,null)),$e.createElement(cs,null,$e.createElement(we,{size:"small",appearance:r,title:c.title,subtitle:c.subtitle})),c.primaryButtonTitle&&$e.createElement(ms,{className:a("embeddedTipCallToActionContainer",r)},$e.createElement(ee,{classPrefix:"embeddedTip",title:c.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"inline",onClick:async()=>{c.handlePrimaryButtonClick(),E(c),!(i&&i(c,C(e),"primary")===!1)&&(await g(e,c.id),await l(e))}}))))};import ce,{useEffect as Lp}from"react";import Bt from"styled-components";var fs=Bt.div`
|
|
1416
1420
|
// use the :not annotation
|
|
1417
|
-
${e=>
|
|
1421
|
+
${e=>w(e)} {
|
|
1418
1422
|
display: flex;
|
|
1419
1423
|
flex-direction: ${e=>e.type==="square"?"column":"row"};
|
|
1420
1424
|
width: 100%;
|
|
@@ -1426,24 +1430,24 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1426
1430
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1427
1431
|
border-radius: 12px;
|
|
1428
1432
|
}
|
|
1429
|
-
`,
|
|
1430
|
-
${e=>
|
|
1433
|
+
`,gs=Bt.div`
|
|
1434
|
+
${e=>w(e)} {
|
|
1431
1435
|
display: flex;
|
|
1432
1436
|
width: 36px;
|
|
1433
1437
|
height: 36px;
|
|
1434
1438
|
}
|
|
1435
|
-
`,
|
|
1439
|
+
`,hs=Bt.div`
|
|
1436
1440
|
display: flex;
|
|
1437
1441
|
flex-direction: column;
|
|
1438
1442
|
flex: 1;
|
|
1439
1443
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1440
1444
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1441
|
-
`,
|
|
1445
|
+
`,xs=Bt.div`
|
|
1442
1446
|
display: flex;
|
|
1443
1447
|
flex-direction: column;
|
|
1444
1448
|
justify-content: center;
|
|
1445
1449
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1446
|
-
`,
|
|
1450
|
+
`,Yo=Bt.div`
|
|
1447
1451
|
display: flex;
|
|
1448
1452
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1449
1453
|
align-items: flex-end;
|
|
@@ -1452,10 +1456,10 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Bt}${r}.${Bt}${r} { ${Object.entries(n).map
|
|
|
1452
1456
|
:hover {
|
|
1453
1457
|
opacity: 0.8;
|
|
1454
1458
|
}
|
|
1455
|
-
`,
|
|
1459
|
+
`,Xo=Bt.div`
|
|
1456
1460
|
display: flex;
|
|
1457
1461
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1458
1462
|
align-items: flex-end;
|
|
1459
1463
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1460
|
-
`;import
|
|
1464
|
+
`;import Cs from"react";var ys=({style:e,className:t})=>Cs.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor"},Cs.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}));var Dp=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width"})=>{let{getFlow:d,markFlowCompleted:l,isLoading:g,targetingLogicShouldHideFlow:m,updateCustomVariables:h,getFlowMetadata:F,getFlowStatus:x,getFlowSteps:y,getCurrentStepIndex:C}=X(),{primaryCTAClickSideEffects:E}=le(),{mergeAppearanceWithDefault:T}=Q();if(s=T(s),Lp(()=>{h(r)},[r,g]),g)return null;let B=d(e);if(!B||m(B)||x(e)===R)return null;let P=y(e),c=P.length>0?P[C(e)]:F(e);return c!=null&&c.title&&(t=c.title),c!=null&&c.subtitle&&(o=c.subtitle),ce.createElement(ce.Fragment,null,ce.createElement(pe,{appearance:s}),ce.createElement(fs,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&ce.createElement(gs,null,ce.createElement(ys,null)),p==="square"&&c.dismissible&&ce.createElement(Xo,{type:p,className:a("bannerDismissButtonContainer",s)},ce.createElement(Yo,{type:p,onClick:async()=>{await l(e),i&&i()},className:a("bannerDismissButton",s)},ce.createElement(Pe,null))),ce.createElement(hs,{type:p},ce.createElement(we,{appearance:s,title:t,subtitle:o})),ce.createElement(xs,{type:p,className:a("bannerCallToActionContainer",s)},ce.createElement(ee,{title:(c==null?void 0:c.primaryButtonTitle)??"Get started",appearance:s,onClick:()=>{E(c),n&&n(c,0,"primary")}})),p!=="square"&&c.dismissible&&ce.createElement(Xo,{type:p,className:a("bannerDismissButtonContainer",s)},ce.createElement(Yo,{type:p,onClick:async()=>{await l(e),i&&i()},className:a("bannerDismissButton",s)},ce.createElement(Pe,null)))))};export{Dp as FrigadeBanner,qo as FrigadeChecklist,Op as FrigadeEmbeddedTip,Gr as FrigadeForm,cp as FrigadeGuide,sp as FrigadeHeroChecklist,pp as FrigadeProgressBadge,aa as FrigadeProvider,Ap as FrigadeSupportWidget,Pp as FrigadeTour,ke as useFlowOpens,At as useFlowResponses,X as useFlows,Mo as useOrganization,wo as useUser};
|
|
1461
1465
|
//# sourceMappingURL=index.mjs.map
|