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