@frigade/react 1.32.30 → 1.32.32
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 +22 -20
- package/lib/index.js +212 -212
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +212 -212
- 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 ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import{ThemeProvider as Sa}from"styled-components";import dt,{useContext as ha,useEffect as xo,useState as zo}from"react";import{useCallback as st,useContext as js,useEffect as Gs}from"react";import Io,{useMemo as Ls}from"react";var ir="1.32.30 ";var Ce="https://api.frigade.com/v1/public/",ke="NOT_STARTED_STEP",Q="COMPLETED_FLOW",Rt="ABORTED_FLOW",nt="STARTED_FLOW",Ne="NOT_STARTED_FLOW",Ee="COMPLETED_STEP",eo="STARTED_STEP";function Le(){let{publicApiKey:e,userId:t}=Io.useContext(G);return{config:Ls(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":ir,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}function Ct(){let{shouldGracefullyDegrade:e}=Io.useContext(G);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),Zt();let n;try{n=await fetch(t,o)}catch(r){return Zt(r)}return n?n.ok?n:Zt(n.statusText):Zt()}}function Zt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function St(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Io.useContext(G);function o(){if(t){console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize");return}e||console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider")}return{verifySDKInitiated:o}}import{useContext as Ws,useState as nr}from"react";import{useContext as Ds,useEffect as $s,useState as Ms}from"react";import Us from"swr";import{useContext as Os}from"react";function be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:n,completedFlowsToKeepOpenDuringSession:r}=Os(G);function i(c,m=!1){return e[c]??m}function s(c,m){t(b=>({...b,[c]:m}))}function p(c){t(m=>{let{[c]:b,...w}=m;return{...w}})}function d(c){r.includes(c)||n(m=>[...m,c])}function l(c){return r.includes(c)}function u(){return Object.values(e).some(c=>c)||o}return{getOpenFlowState:i,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:u,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}var _s="unknown";function Pe(){let{config:e}=Le(),{publicApiKey:t,userId:o,flows:n,setShouldGracefullyDegrade:r}=Ds(G),{resetOpenFlowState:i}=be(),[s,p]=Ms(!1),d={data:n.map(P=>({flowId:P.id,flowState:Q,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},l=P=>fetch(P,e).then(g=>{if(g.ok)return g.json();throw new Error("Failed to fetch user flow states")}).catch(g=>(console.log(`Error fetching ${P}: ${g}. Will gracefully degrade and hide Frigade`),r(!0),d)),{data:u,isLoading:c,mutate:m,error:b}=Us(t&&n&&o?`${Ce}userFlowStates?foreignUserId=${encodeURIComponent(o)}`:null,l,{keepPreviousData:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),w=u==null?void 0:u.data;$s(()=>{!s&&!c&&w&&p(!0)},[w,s,c]);async function S(P){if(w){let g=w.find(h=>h.flowId===P);g&&g.flowState!==Q&&(g.flowState=Q),await m(Promise.resolve({...u,data:w}),{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}async function f(P,g,h){if(w){let C=w.find(v=>v.flowId===P);C&&(C.stepStates[g]=h,C.flowState=nt),await m(Promise.resolve({...u,data:w}),{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}async function k(P,g,h){if(w){let C=w.find(v=>v.flowId===P);C&&(C.lastStepId=g,C.stepStates[g]=h,C.flowState=nt),await m({...u,data:w},{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}async function T(P){if(w){let g=w.find(h=>h.flowId===P);g&&g.flowState!==Ne&&(g.flowState=Ne,g.lastStepId=_s,Object.keys(g.stepStates).forEach(h=>{g.stepStates[h].actionType=ke,g.stepStates[h].createdAt=new Date().toISOString()}),await m({...u,data:w},{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1}),i(P))}}async function B(P,g){if(w){let h=w.find(C=>C.flowId===P);h&&h.stepStates[g]!==ke&&(h.stepStates[g]=ke),await m({...u,data:w},{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:w,isLoadingUserFlowStateData:!s,mutateUserFlowState:m,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:f,optimisticallyMarkStepNotStarted:B,optimisticallyMarkStepStarted:k,error:b}}function Mt(){let{config:e}=Le(),{userFlowStatesData:t,mutateUserFlowState:o}=Pe(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:i,setFlowResponses:s}=Ws(G),[p,d]=nr(new Set),[l,u]=nr(new Set),c=Ct();function m(S){let f=JSON.stringify(S);if(p.has(f))return null;p.add(f),d(p),l.add(S),u(l);let k=i==null?void 0:i.find(T=>T.flowSlug===S.flowSlug&&T.stepId===S.stepId&&T.actionType===S.actionType&&T.createdAt===S.createdAt);return c(`${Ce}flowResponses`,{...e,method:"POST",body:f}).then(T=>{T.status!==200&&T.status!==201?(console.log("Failed to send flow response for step "+S.stepId+". Will retry again later."),r([...n,S])):k||s(B=>[...B??[],S])})}async function b(S){S.foreignUserId&&(S.actionType===nt||S.actionType===Ne?await m(S):S.actionType===Q?await m(S):S.actionType===eo?await m(S):S.actionType===Ee?await m(S):S.actionType===Rt?await m(S):S.actionType===ke&&await m(S))}function w(){let S=[];return t==null||t.forEach(f=>{if(f&&f.stepStates&&Object.keys(f.stepStates).length!==0)for(let k in f.stepStates){let T=f.stepStates[k];S.push({foreignUserId:f.foreignUserId,flowSlug:f.flowId,stepId:T.stepId,actionType:T.actionType,data:{},createdAt:new Date(T.createdAt),blocked:T.blocked,hidden:T.hidden})}}),[...S,...i]}return{addResponse:b,setFlowResponses:s,getFlowResponses:w}}import Vs from"swr";var zs=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,sr=e=>{let t=zs.exec(e);if(t===null)return null;let o=null;return t.forEach((n,r)=>{let i=Hs(n,"'","");i.startsWith("flow_")&&(o=i)}),o},Hs=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function K(){let{config:e}=Le(),{flows:t,setFlows:o,userId:n,publicApiKey:r,customVariables:i,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,setFlowResponses:l,setShouldGracefullyDegrade:u}=js(G),c={data:[]},{verifySDKInitiated:m}=St(),{addResponse:b,getFlowResponses:w}=Mt(),S=x=>fetch(x,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${x} (${y.status}): ${y.statusText}. .Will gracefully degrade and hide Frigade`),u(!0),c)).catch(y=>(console.log(`Error fetching ${x}: ${y}. Will gracefully degrade and hide Frigade`),u(!0),c)),{userFlowStatesData:f,isLoadingUserFlowStateData:k,optimisticallyMarkFlowCompleted:T,optimisticallyMarkFlowNotStarted:B,optimisticallyMarkStepCompleted:P,optimisticallyMarkStepNotStarted:g,optimisticallyMarkStepStarted:h}=Pe(),{data:C,error:v,isLoading:U}=Vs(r?`${Ce}flows`:null,S,{keepPreviousData:!0});Gs(()=>{if(v){console.error(v);return}C&&C.data&&(C.data=o(C.data))},[C,v]);function $(x){if(U)return null;let y=t.find(E=>E.slug===x);return!y&&t.length>0&&!k&&!U?(console.log(`Flow with slug ${x} not found`),null):(y==null?void 0:y.active)===!1?null:y}function W(x){var I;if(!$(x))return[];let y=$(x).data;return y?(y=A(y),(((I=JSON.parse(y))==null?void 0:I.data)??[]).map(J=>{let it=ze(J);return{handleSecondaryButtonClick:()=>{J.skippable===!0&&_(x,J.id,{skipped:!0})},...J,complete:N(x,J.id)===Ee||it>=1,blocked:q(x,J.id),hidden:We(x,J.id),handlePrimaryButtonClick:()=>{(!J.completionCriteria&&(J.autoMarkCompleted||J.autoMarkCompleted===void 0)||J.completionCriteria&&J.autoMarkCompleted===!0)&&_(x,J.id)},progress:it}}).filter(J=>J.hidden!==!0)):[]}function A(x){return x.replace(/\${(.*?)}/g,(y,E)=>i[E]!==void 0?String(i[E]):"")}function H(x){if(!$(x))return[];let y=$(x).data;return y?(y=A(y),JSON.parse(y)??{}):[]}function L(x,y){s(E=>({...E,[x]:y}))}function z(x){!k&&!U&&x&&JSON.stringify(i)!=JSON.stringify({...i,...x})&&Object.keys(x).forEach(y=>{L(y,x[y])})}let ie=st(async(x,y,E)=>{m();let I={foreignUserId:n,flowSlug:x,stepId:y,actionType:eo,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};R(I)&&(await h(x,y,I),b(I))},[n,f]),V=st(async(x,y,E)=>{m();let I={foreignUserId:n,flowSlug:x,stepId:y,actionType:ke,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};R(I)&&(await g(x,y),b(I))},[n,f]),_=st(async(x,y,E)=>{console.log("markStepCompleted",x,y,E),m();let I={foreignUserId:n,flowSlug:x,stepId:y,actionType:Ee,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};R(I)&&(await P(x,y,I),b(I))},[n,f]),ee=st(async(x,y)=>{m();let E={foreignUserId:n,flowSlug:x,stepId:"unknown",actionType:Ne,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};await B(x),R(E)&&b(E)},[n,f]),ne=st(async(x,y)=>{m();let E={foreignUserId:n,flowSlug:x,stepId:"unknown",actionType:nt,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};R(E)&&b(E)},[n,f]),te=st(async(x,y)=>{m();let E={foreignUserId:n,flowSlug:x,stepId:"unknown",actionType:Q,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};R(E)&&(await T(x),b(E))},[n,f]),M=st(async(x,y)=>{m();let E={foreignUserId:n,flowSlug:x,stepId:"unknown",actionType:Rt,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};R(E)&&(await T(x),b(E))},[n,f]);function R(x){var y;if(!f&&x.actionType===ke)return!1;if(f){let E=f.find(I=>I.flowId===x.flowSlug);if(x.actionType===ke&&(!(E!=null&&E.stepStates[x.stepId])||E.stepStates[x.stepId].actionType===ke)||E&&((y=E.stepStates[x.stepId])==null?void 0:y.actionType)===x.actionType)return!1}return!0}function N(x,y){let E=ye(x,y);return k?null:E?E.actionType:ke}function q(x,y){let E=ye(x,y);return E?E.blocked:!1}function We(x,y){let E=ye(x,y);return E?E.hidden:!1}function ye(x,y){if(k)return null;let E=f==null?void 0:f.find(I=>I.flowId===x);return!E||!E.stepStates[y]?null:E.stepStates[y]??null}function Fe(x){var E;if(k||!f)return null;if(He(x)===Ne)return W(x)[0]??null;let y=(E=f.find(I=>I.flowId===x))==null?void 0:E.lastStepId;return y?W(x).find(I=>I.id===y):null}function ue(x){let y=Fe(x);if(!y)return 0;let E=W(x).findIndex(I=>I.id===y.id)??0;return N(x,y.id)===Ee&&E<W(x).length-1?E+1:E}function ze(x){if(!x.completionCriteria)return;let y=sr(x.completionCriteria);if(y===null)return;let E=rt(y),I=j(y);return I===0?void 0:E/I}function He(x){let y=f==null?void 0:f.find(E=>E.flowId===x);return y?y.flowState:null}function rt(x){let y=W(x);return y.length===0?0:y.filter(I=>N(x,I.id)===Ee).length}function j(x){return W(x).length}function Be(x){return JSON.parse(t.find(y=>y.slug===x).data)}function Ae(x){if(k)return!0;if(x!=null&&x.targetingLogic&&f){let y=f.find(E=>E.flowId===x.slug);if(y)return y.shouldTrigger===!1}return!!(x!=null&&x.targetingLogic&&n&&n.startsWith("guest_"))}function Eo(x){return!Ae($(x))}return{getFlow:$,getFlowData:Be,isLoading:k||U,getStepStatus:N,getFlowSteps:W,getCurrentStepIndex:ue,markStepStarted:ie,markStepCompleted:_,markFlowNotStarted:ee,markFlowStarted:ne,markFlowCompleted:te,markFlowAborted:M,markStepNotStarted:V,getFlowStatus:He,getNumberOfStepsCompleted:rt,getNumberOfSteps:j,targetingLogicShouldHideFlow:Ae,setCustomVariable:L,updateCustomVariables:z,customVariables:i,getStepOptionalProgress:ze,getFlowMetadata:H,isStepBlocked:q,isStepHidden:We,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,isFlowAvailableToUser:Eo}}import{useCallback as lr,useContext as Ks,useEffect as qs}from"react";var yt="guest_";function Bo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:n,shouldGracefullyDegrade:r}=Ks(G),{config:i}=Le(),{mutateUserFlowState:s}=Pe(),p=Ct(),{verifySDKInitiated:d}=St();qs(()=>{if(e&&!t){if(e.startsWith(yt))return;let c=`frigade-user-registered-${e}`;localStorage.getItem(c)||(p(`${Ce}users`,{...i,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(c,"true"))}},[e,r,t]);let l=lr(async c=>{d();let m={foreignId:e,properties:c};await p(`${Ce}users`,{...i,method:"POST",body:JSON.stringify(m)}),n(b=>({...b,...c})),s()},[e,i,r,s]),u=lr(async(c,m)=>{d();let w={foreignId:e,events:[{event:c,properties:m}]};await p(`${Ce}users`,{...i,method:"POST",body:JSON.stringify(w)}),s()},[e,i,s]);return{userId:e,setUserId:o,addPropertiesToUser:l,trackEventForUser:u}}import{v4 as xa}from"uuid";import De,{useEffect as ma,useState as ua}from"react";import je,{useEffect as Rs}from"react";import oo from"styled-components";import Ys from"react";import Xs from"styled-components";var ar="fr-",Ut="cfr-";function a(e,t){let o=`${ar}${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+" "+Ut+e}return o}function F(e){if(!e.className||e.className.indexOf(Ut)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(ar)?"":`:not(${o.map(n=>`.${n}`).join(", ")})`}function Ao(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function lt(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Ao(t)}: ${e.styleOverrides[t]};`).join(" "):""}function fe(...e){return e.filter(Boolean).join(" ")}function pr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Js=Xs.div`
|
|
2
|
+
import mt,{createContext as ya,useEffect as Go,useState as Ae}from"react";import{ThemeProvider as ba}from"styled-components";import ct,{useContext as Ca,useEffect as yo,useState as jo}from"react";import{useCallback as lt,useContext as Vs,useEffect as Ks}from"react";import Io,{useMemo as Ds}from"react";var sr="1.32.32 ";var Se="https://api.frigade.com/v1/public/",Ee="NOT_STARTED_STEP",Z="COMPLETED_FLOW",oo="ABORTED_FLOW",st="STARTED_FLOW",Le="NOT_STARTED_FLOW",Ie="COMPLETED_STEP",ro="STARTED_STEP";function Oe(){let{publicApiKey:e,userId:t}=Io.useContext(K);return{config:Ds(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":sr,"X-Frigade-SDK-Platform":"React"}}),[e,t])}}function yt(){let{shouldGracefullyDegrade:e}=Io.useContext(K);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),to();let n;try{n=await fetch(t,o)}catch(r){return to(r)}return n?n.ok?n:to(n.statusText):to()}}function to(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function bt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Io.useContext(K);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 Hs,useState as lr}from"react";import{useContext as Ms,useEffect as Us,useState as _s}from"react";import Ws from"swr";import{useContext as $s}from"react";function Fe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:n,completedFlowsToKeepOpenDuringSession:r}=$s(K);function i(c,m=!1){return e[c]??m}function s(c,m){t(b=>({...b,[c]:m}))}function p(c){t(m=>{let{[c]:b,...w}=m;return{...w}})}function d(c){r.includes(c)||n(m=>[...m,c])}function l(c){return r.includes(c)}function u(){return Object.values(e).some(c=>c)||o}return{getOpenFlowState:i,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:u,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}var zs="unknown";function Be(){let{config:e}=Oe(),{publicApiKey:t,userId:o,flows:n,setShouldGracefullyDegrade:r}=Ms(K),{resetOpenFlowState:i}=Fe(),[s,p]=_s(!1),d={data:n.map(k=>({flowId:k.id,flowState:Z,lastStepId:null,userId:o,foreignUserId:o,stepStates:{},shouldTrigger:!1}))},l=k=>fetch(k,e).then(g=>{if(g.ok)return g.json();throw new Error("Failed to fetch user flow states")}).catch(g=>(console.log(`Error fetching ${k}: ${g}. Will gracefully degrade and hide Frigade`),r(!0),d)),{data:u,isLoading:c,mutate:m,error:b}=Ws(t&&n&&o?`${Se}userFlowStates?foreignUserId=${encodeURIComponent(o)}`:null,l,{keepPreviousData:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),w=u==null?void 0:u.data;Us(()=>{!s&&!c&&w&&p(!0)},[w,s,c]);async function S(k){if(w){let g=w.find(x=>x.flowId===k);g&&g.flowState!==Z&&(g.flowState=Z),await m(Promise.resolve({...u,data:w}),{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}async function f(k,g,x){if(w){let C=w.find(v=>v.flowId===k);C&&(C.stepStates[g]=x,C.flowState=st),await m(Promise.resolve({...u,data:w}),{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}async function P(k,g,x){if(w){let C=w.find(v=>v.flowId===k);C&&(C.lastStepId=g,C.stepStates[g]=x,C.flowState=st),await m({...u,data:w},{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}async function T(k){if(w){let g=w.find(x=>x.flowId===k);g&&g.flowState!==Le&&(g.flowState=Le,g.lastStepId=zs,Object.keys(g.stepStates).forEach(x=>{g.stepStates[x].actionType=Ee,g.stepStates[x].createdAt=new Date().toISOString()}),await m({...u,data:w},{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1}),i(k))}}async function B(k,g){if(w){let x=w.find(C=>C.flowId===k);x&&x.stepStates[g]!==Ee&&(x.stepStates[g]=Ee),await m({...u,data:w},{optimisticData:{...u,data:w},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:w,isLoadingUserFlowStateData:!s,mutateUserFlowState:m,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:f,optimisticallyMarkStepNotStarted:B,optimisticallyMarkStepStarted:P,error:b}}function _t(){let{config:e}=Oe(),{userFlowStatesData:t,mutateUserFlowState:o}=Be(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:i,setFlowResponses:s}=Hs(K),[p,d]=lr(new Set),[l,u]=lr(new Set),c=yt();function m(S){let f=JSON.stringify(S);if(p.has(f))return null;p.add(f),d(p),l.add(S),u(l);let P=i==null?void 0:i.find(T=>T.flowSlug===S.flowSlug&&T.stepId===S.stepId&&T.actionType===S.actionType&&T.createdAt===S.createdAt);return c(`${Se}flowResponses`,{...e,method:"POST",body:f}).then(T=>{T.status!==200&&T.status!==201?(console.log("Failed to send flow response for step "+S.stepId+". Will retry again later."),r([...n,S])):P||s(B=>[...B??[],S])})}async function b(S){S.foreignUserId&&(S.actionType===st||S.actionType===Le?await m(S):S.actionType===Z?await m(S):S.actionType===ro?await m(S):S.actionType===Ie?await m(S):S.actionType===oo?await m(S):S.actionType===Ee&&await m(S))}function w(){let S=[];return t==null||t.forEach(f=>{if(f&&f.stepStates&&Object.keys(f.stepStates).length!==0)for(let P in f.stepStates){let T=f.stepStates[P];S.push({foreignUserId:f.foreignUserId,flowSlug:f.flowId,stepId:T.stepId,actionType:T.actionType,data:{},createdAt:new Date(T.createdAt),blocked:T.blocked,hidden:T.hidden})}}),[...S,...i]}return{addResponse:b,setFlowResponses:s,getFlowResponses:w}}import qs from"swr";var js=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ar=e=>{let t=js.exec(e);if(t===null)return null;let o=null;return t.forEach((n,r)=>{let i=Gs(n,"'","");i.startsWith("flow_")&&(o=i)}),o},Gs=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function X(){let{config:e}=Oe(),{flows:t,setFlows:o,userId:n,publicApiKey:r,customVariables:i,setCustomVariables:s,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,setFlowResponses:l,setShouldGracefullyDegrade:u}=Vs(K),c={data:[]},{verifySDKInitiated:m}=bt(),{addResponse:b,getFlowResponses:w}=_t(),S=h=>fetch(h,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${h} (${y.status}): ${y.statusText}. .Will gracefully degrade and hide Frigade`),u(!0),c)).catch(y=>(console.log(`Error fetching ${h}: ${y}. Will gracefully degrade and hide Frigade`),u(!0),c)),{userFlowStatesData:f,isLoadingUserFlowStateData:P,optimisticallyMarkFlowCompleted:T,optimisticallyMarkFlowNotStarted:B,optimisticallyMarkStepCompleted:k,optimisticallyMarkStepNotStarted:g,optimisticallyMarkStepStarted:x}=Be(),{data:C,error:v,isLoading:M}=qs(r?`${Se}flows`:null,S,{keepPreviousData:!0});Ks(()=>{if(v){console.error(v);return}C&&C.data&&(C.data=o(C.data))},[C,v]);function $(h){if(M)return null;let y=t.find(E=>E.slug===h);return!y&&t.length>0&&!P&&!M?(console.log(`Flow with slug ${h} not found`),null):(y==null?void 0:y.active)===!1?null:y}function U(h){var j;if(!$(h))return[];let y=$(h).data;return y?(y=A(y),(((j=JSON.parse(y))==null?void 0:j.data)??[]).map(le=>{let z=Te(le);return{handleSecondaryButtonClick:()=>{le.skippable===!0&&W(h,le.id,{skipped:!0})},...le,complete:N(h,le.id)===Ie||z>=1,blocked:V(h,le.id),hidden:we(h,le.id),handlePrimaryButtonClick:()=>{(!le.completionCriteria&&(le.autoMarkCompleted||le.autoMarkCompleted===void 0)||le.completionCriteria&&le.autoMarkCompleted===!0)&&W(h,le.id)},progress:z}}).filter(le=>le.hidden!==!0)):[]}function A(h){return h.replace(/\${(.*?)}/g,(y,E)=>i[E]!==void 0?String(i[E]):"")}function H(h){if(!$(h))return[];let y=$(h).data;return y?(y=A(y),JSON.parse(y)??{}):[]}function I(h,y){s(E=>({...E,[h]:y}))}function _(h){!P&&!M&&h&&JSON.stringify(i)!=JSON.stringify({...i,...h})&&Object.keys(h).forEach(y=>{I(y,h[y])})}let te=lt(async(h,y,E)=>{m();let j={foreignUserId:n,flowSlug:h,stepId:y,actionType:ro,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};oe(j)&&(await x(h,y,j),b(j))},[n,f]),q=lt(async(h,y,E)=>{m();let j={foreignUserId:n,flowSlug:h,stepId:y,actionType:Ee,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};oe(j)&&(await g(h,y),b(j))},[n,f]),W=lt(async(h,y,E)=>{console.log("markStepCompleted",h,y,E),m();let j={foreignUserId:n,flowSlug:h,stepId:y,actionType:Ie,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};oe(j)&&(await k(h,y,j),b(j))},[n,f]),be=lt(async(h,y)=>{m();let E={foreignUserId:n,flowSlug:h,stepId:"unknown",actionType:Le,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};await B(h),oe(E)&&b(E)},[n,f]),ce=lt(async(h,y)=>{m();let E={foreignUserId:n,flowSlug:h,stepId:"unknown",actionType:st,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};oe(E)&&b(E)},[n,f]),G=lt(async(h,y)=>{m();let E={foreignUserId:n,flowSlug:h,stepId:"unknown",actionType:Z,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};oe(E)&&(await T(h),b(E))},[n,f]),L=lt(async(h,y)=>{m();let E={foreignUserId:n,flowSlug:h,stepId:"unknown",actionType:oo,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};oe(E)&&(await T(h),b(E))},[n,f]);function oe(h){var y;if(!f&&h.actionType===Ee)return!1;if(f){let E=f.find(j=>j.flowId===h.flowSlug);if(h.actionType===Ee&&(!(E!=null&&E.stepStates[h.stepId])||E.stepStates[h.stepId].actionType===Ee)||E&&((y=E.stepStates[h.stepId])==null?void 0:y.actionType)===h.actionType)return!1}return!0}function N(h,y){let E=ve(h,y);return P?null:E?E.actionType:Ee}function V(h,y){let E=ve(h,y);return E?E.blocked:!1}function we(h,y){let E=ve(h,y);return E?E.hidden:!1}function ve(h,y){if(P)return null;let E=f==null?void 0:f.find(j=>j.flowId===h);return!E||!E.stepStates[y]?null:E.stepStates[y]??null}function St(h){var E;if(P||!f)return null;if(me(h)===Le)return U(h)[0]??null;let y=(E=f.find(j=>j.flowId===h))==null?void 0:E.lastStepId;return y?U(h).find(j=>j.id===y):null}function rt(h){let y=St(h);if(!y)return 0;let E=U(h).findIndex(j=>j.id===y.id)??0;return N(h,y.id)===Ie&&E<U(h).length-1?E+1:E}function Te(h){if(!h.completionCriteria)return;let y=ar(h.completionCriteria);if(y===null)return;let E=ze(y),j=He(y);return j===0?void 0:E/j}function me(h){let y=f==null?void 0:f.find(E=>E.flowId===h);return y?y.flowState:null}function ze(h){let y=U(h);return y.length===0?0:y.filter(j=>N(h,j.id)===Ie).length}function He(h){return U(h).length}function Y(h){return JSON.parse(t.find(y=>y.slug===h).data)}function fe(h){if(P)return!0;if(h!=null&&h.targetingLogic&&f){let y=f.find(E=>E.flowId===h.slug);if(y)return y.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function it(h){return!fe($(h))}return{getFlow:$,getFlowData:Y,isLoading:P||M,getStepStatus:N,getFlowSteps:U,getCurrentStepIndex:rt,markStepStarted:te,markStepCompleted:W,markFlowNotStarted:be,markFlowStarted:ce,markFlowCompleted:G,markFlowAborted:L,markStepNotStarted:q,getFlowStatus:me,getNumberOfStepsCompleted:ze,getNumberOfSteps:He,targetingLogicShouldHideFlow:fe,setCustomVariable:I,updateCustomVariables:_,customVariables:i,getStepOptionalProgress:Te,getFlowMetadata:H,isStepBlocked:V,isStepHidden:we,hasActiveFullPageFlow:p,setHasActiveFullPageFlow:d,isFlowAvailableToUser:it}}import{useCallback as pr,useContext as Ys,useEffect as Xs}from"react";var wt="guest_";function No(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:n,shouldGracefullyDegrade:r}=Ys(K),{config:i}=Oe(),{mutateUserFlowState:s}=Be(),p=yt(),{verifySDKInitiated:d}=bt();Xs(()=>{if(e&&!t){if(e.startsWith(wt))return;let c=`frigade-user-registered-${e}`;localStorage.getItem(c)||(p(`${Se}users`,{...i,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(c,"true"))}},[e,r,t]);let l=pr(async c=>{d();let m={foreignId:e,properties:c};await p(`${Se}users`,{...i,method:"POST",body:JSON.stringify(m)}),n(b=>({...b,...c})),s()},[e,i,r,s]),u=pr(async(c,m)=>{d();let w={foreignId:e,events:[{event:c,properties:m}]};await p(`${Se}users`,{...i,method:"POST",body:JSON.stringify(w)}),s()},[e,i,s]);return{userId:e,setUserId:o,addPropertiesToUser:l,trackEventForUser:u}}import{v4 as Sa}from"uuid";import $e,{useEffect as fa,useState as ga}from"react";import je,{useEffect as tl}from"react";import no from"styled-components";import Js from"react";import Qs from"styled-components";var dr="fr-",Wt="cfr-";function a(e,t){let o=`${dr}${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+" "+Wt+e}return o}function F(e){if(!e.className||e.className.indexOf(Wt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(dr)?"":`:not(${o.map(n=>`.${n}`).join(", ")})`}function Lo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function at(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Lo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function ge(...e){return e.filter(Boolean).join(" ")}function cr(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Zs=Qs.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,mr=({onClose:e,appearance:t})=>Js.createElement(Zs,{className:a("modalBackground",t),onClick:()=>e()});import io from"react";import Rs from"styled-components";var el=Rs.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,ke=()=>io.createElement(el,null,io.createElement("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},io.createElement("rect",{y:"1.39844",width:"1.97669",height:"17.8213",rx:"0.988346",transform:"rotate(-45 0 1.39844)",fill:"currentColor"}),io.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 ol}from"react-portal";var rl=no.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}};
|
|
@@ -45,7 +45,7 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
45
45
|
|
|
46
46
|
border-radius: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)??8}}px;
|
|
47
47
|
|
|
48
|
-
${e=>
|
|
48
|
+
${e=>at(e)}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
padding: 32px;
|
|
@@ -71,10 +71,10 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
71
71
|
opacity: 1;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
`,
|
|
74
|
+
`,il=no.div`
|
|
75
75
|
position: relative;
|
|
76
76
|
flex: 0 1 auto;
|
|
77
|
-
`,
|
|
77
|
+
`,nl=no.div`
|
|
78
78
|
position: absolute;
|
|
79
79
|
top: 24px;
|
|
80
80
|
right: 24px;
|
|
@@ -84,14 +84,14 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}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
|
+
`,sl=no.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
|
-
`,Je=({onClose:e,visible:t,headerContent:o=null,style:n=null,children:r,appearance:i,dismissible:s=!0})=>(
|
|
94
|
+
`,Je=({onClose:e,visible:t,headerContent:o=null,style:n=null,children:r,appearance:i,dismissible:s=!0})=>(tl(()=>{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?je.createElement(ol,null,je.createElement(mr,{appearance:i,onClose:()=>{s&&e()}}),je.createElement(rl,{appearance:i,className:a("modalContainer",i),styleOverrides:n},s&&je.createElement(nl,{className:a("modalClose",i),onClick:()=>e(),appearance:i},je.createElement(ke,null)),o&&je.createElement(il,null,o),je.createElement(sl,null,r))):je.createElement(je.Fragment,null));import Qe,{useEffect as ll}from"react";import so from"styled-components";import{Portal as al}from"react-portal";var pl=so.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 ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
109
109
|
bottom: 0;
|
|
110
110
|
margin-right: 28px;
|
|
111
111
|
margin-bottom: 28px;
|
|
112
|
-
`,
|
|
112
|
+
`,dl=so.div`
|
|
113
113
|
position: relative;
|
|
114
114
|
flex: 1;
|
|
115
|
-
`,
|
|
115
|
+
`,cl=so.div`
|
|
116
116
|
position: absolute;
|
|
117
117
|
top: 24px;
|
|
118
118
|
right: 24px;
|
|
@@ -122,13 +122,13 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}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
|
+
`,ml=so.div`
|
|
126
126
|
overflow: scroll;
|
|
127
127
|
flex: 5;
|
|
128
128
|
::-webkit-scrollbar {
|
|
129
129
|
display: none;
|
|
130
130
|
}
|
|
131
|
-
`,
|
|
131
|
+
`,ur=({onClose:e,visible:t,headerContent:o=null,children:n,appearance:r})=>(ll(()=>{let i=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",i),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",i)}},[e,t]),t?Qe.createElement(al,null,Qe.createElement(pl,{appearance:r,className:a("cornerModalContainer",r)},Qe.createElement(cl,{className:a("cornerModalClose",r),onClick:()=>e()},Qe.createElement(ke,null)),o&&Qe.createElement(dl,null,o),Qe.createElement(ml,null,n))):Qe.createElement(Qe.Fragment,null));import{useContext as ul}from"react";function J(){let{defaultAppearance:e}=ul(K);function t(o){let n=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(n.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(n.theme,o.theme??{})}:n}return{mergeAppearanceWithDefault:t}}import fo,{useEffect as Fl,useState as Br}from"react";import Ar from"styled-components";import po,{useEffect as fl,useState as Cr}from"react";import Do from"styled-components";import lo from"styled-components";var fr=lo.label`
|
|
132
132
|
${e=>F(e)} {
|
|
133
133
|
font-size: 14px;
|
|
134
134
|
line-height: 20px;
|
|
@@ -136,14 +136,14 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
136
136
|
margin-top: 10px;
|
|
137
137
|
}
|
|
138
138
|
display: flex;
|
|
139
|
-
`,
|
|
139
|
+
`,gr=lo.label`
|
|
140
140
|
${e=>F(e)} {
|
|
141
141
|
font-size: 12px;
|
|
142
142
|
line-height: 20px;
|
|
143
143
|
margin-bottom: 5px;
|
|
144
144
|
}
|
|
145
145
|
display: flex;
|
|
146
|
-
`,
|
|
146
|
+
`,hr=lo.span`
|
|
147
147
|
font-weight: 400;
|
|
148
148
|
font-size: 14px;
|
|
149
149
|
line-height: 22px;
|
|
@@ -151,16 +151,16 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
151
151
|
display: flex;
|
|
152
152
|
margin-right: 5px;
|
|
153
153
|
margin-top: 10px;
|
|
154
|
-
`,
|
|
154
|
+
`,ao=lo.div`
|
|
155
155
|
display: flex;
|
|
156
156
|
align-items: flex-start;
|
|
157
157
|
justify-content: left;
|
|
158
158
|
margin-bottom: 10px;
|
|
159
|
-
`;import
|
|
159
|
+
`;import Oo from"react";function Ze({title:e,required:t,appearance:o}){return Oo.createElement(ao,null,t?Oo.createElement(hr,null,"*"):null,Oo.createElement(fr,{className:a("formLabel",o)},e))}import xr from"react";function Tt({title:e,appearance:t}){return e?xr.createElement(ao,null,xr.createElement(gr,{className:a("formSubLabel",t)},e)):null}var gl=Do.div`
|
|
160
160
|
display: flex;
|
|
161
161
|
flex-direction: column;
|
|
162
162
|
width: 100%;
|
|
163
|
-
|
|
163
|
+
`,$o=Do.input`
|
|
164
164
|
${e=>F(e)} {
|
|
165
165
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
166
166
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -176,7 +176,7 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
176
176
|
box-sizing: border-box;
|
|
177
177
|
padding: 0 10px;
|
|
178
178
|
margin-bottom: 10px;
|
|
179
|
-
`,
|
|
179
|
+
`,hl=Do.textarea`
|
|
180
180
|
${e=>F(e)} {
|
|
181
181
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
182
182
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -192,13 +192,13 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
192
192
|
min-height: 70px;
|
|
193
193
|
box-sizing: border-box;
|
|
194
194
|
margin-bottom: 10px;
|
|
195
|
-
`;function
|
|
195
|
+
`;function Sr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:n,inputData:r}){let i=e,[s,p]=Cr((r==null?void 0:r.text)||""),[d,l]=Cr(!1),u=$o;fl(()=>{s===""&&!d&&(l(!0),c(""))},[]);function c(b){if(p(b),i.required===!0&&b.trim()===""){n([{id:i.id,message:`${i.title} is required`}]);return}n([]),o({text:b})}i.multiline&&(u=hl);function m(){var b;switch((b=i==null?void 0:i.validation)==null?void 0:b.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return po.createElement(gl,null,po.createElement(Ze,{title:i.title,required:i.required,appearance:t.appearance}),po.createElement(u,{className:a("inputComponent",t.appearance),value:s,onChange:b=>{c(b.target.value)},appearance:t.appearance,placeholder:i.placeholder,type:m()}),po.createElement(Tt,{title:i.subtitle,appearance:t.appearance}))}import De,{useEffect as yr,useState as br}from"react";import wr from"styled-components";var xl=wr.div`
|
|
196
196
|
display: flex;
|
|
197
197
|
flex-direction: column;
|
|
198
198
|
width: 100%;
|
|
199
199
|
-webkit-appearance: none;
|
|
200
200
|
appearance: none;
|
|
201
|
-
`,
|
|
201
|
+
`,Cl=wr.select`
|
|
202
202
|
${e=>F(e)} {
|
|
203
203
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
204
204
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -222,13 +222,13 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
222
222
|
background-repeat: no-repeat;
|
|
223
223
|
background-size: 1.5em 1.5em;
|
|
224
224
|
-webkit-print-color-adjust: exact;
|
|
225
|
-
`,
|
|
225
|
+
`,co="null";function Tr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:r}){var u,c,m,b,w,S;let i=e,[s,p]=br(((u=n==null?void 0:n.choice)==null?void 0:u[0])||""),[d,l]=br(!1);return yr(()=>{var f,P,T,B;if(s===""&&!d){if(l(!0),i.requireSelection){p(co);return}if(i.defaultValue&&((f=i.props.options)!=null&&f.find(k=>k.id===i.defaultValue))){let k=(P=i.props.options)==null?void 0:P.find(g=>g.id===i.defaultValue);p(k.id),o({choice:[k.id]})}else p(((T=i.props.options)==null?void 0:T[0].id)||""),o({choice:[((B=i.props.options)==null?void 0:B[0].id)||""]})}},[]),yr(()=>{i.requireSelection&&s===co?r([{message:"Please select an option",id:i.id}]):r([])},[s]),De.createElement(xl,null,De.createElement(Ze,{title:i.title,required:!1,appearance:t.appearance}),De.createElement(Cl,{value:s,onChange:f=>{p(f.target.value),o({choice:[f.target.value]})},placeholder:i.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},i.requireSelection&&De.createElement("option",{key:co,value:co},"Select an option"),(c=i.props.options)==null?void 0:c.map(f=>De.createElement("option",{key:f.id,value:f.id},f.title))),((b=(m=i.props.options)==null?void 0:m.find(f=>f.id===s))==null?void 0:b.isOpenEnded)&&De.createElement(De.Fragment,null,De.createElement(Ze,{title:((S=(w=i.props.options)==null?void 0:w.find(f=>f.id===s))==null?void 0:S.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),De.createElement($o,{type:"text",placeholder:"Enter your answer here",onChange:f=>{o({choice:[f.target.value]})},appearance:t.appearance})),De.createElement(Tt,{title:i.subtitle,appearance:t.appearance}))}import mo,{useEffect as Fr,useState as kr}from"react";import Pr from"styled-components";var Sl=Pr.div`
|
|
226
226
|
display: flex;
|
|
227
227
|
flex-direction: column;
|
|
228
228
|
width: 100%;
|
|
229
229
|
-webkit-appearance: none;
|
|
230
230
|
appearance: none;
|
|
231
|
-
`,
|
|
231
|
+
`,yl=Pr.button`
|
|
232
232
|
${e=>F(e)} {
|
|
233
233
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
234
234
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -250,7 +250,7 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
250
250
|
height: 60px;
|
|
251
251
|
padding: 0 18px;
|
|
252
252
|
margin-bottom: 10px;
|
|
253
|
-
`;function
|
|
253
|
+
`;function vr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n}){var l;let r=e,[i,s]=kr((n==null?void 0:n.choice)||[]),[p,d]=kr(!1);return Fr(()=>{i.length==0&&!p&&(d(!0),o({choice:[]}))},[]),Fr(()=>{o({choice:i})},[i]),mo.createElement(Sl,null,mo.createElement(Ze,{title:r.title,required:r.required,appearance:t.appearance}),(l=r.props.options)==null?void 0:l.map(u=>mo.createElement(yl,{appearance:t.appearance,key:u.id,value:u.id,"data-selected":i.includes(u.id),onClick:()=>{if(i.includes(u.id)){s(i.filter(c=>c!==u.id));return}i.length<r.props.maxChoices?s([...i,u.id]):i.length==1&&r.props.maxChoices==1&&s([u.id])}},u.title)),mo.createElement(Tt,{title:r.subtitle,appearance:t.appearance}))}import uo from"react";import Er from"styled-components";import bl from"dompurify";function ae(e){return{__html:bl.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var wl=Er.h1`
|
|
254
254
|
${e=>F(e)} {
|
|
255
255
|
font-style: normal;
|
|
256
256
|
font-weight: 600;
|
|
@@ -261,7 +261,7 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
261
261
|
margin-bottom: 4px;
|
|
262
262
|
color: ${e=>e.appearance.theme.colorText};
|
|
263
263
|
}
|
|
264
|
-
`,
|
|
264
|
+
`,Tl=Er.h2`
|
|
265
265
|
${e=>F(e)} {
|
|
266
266
|
font-style: normal;
|
|
267
267
|
font-weight: 400;
|
|
@@ -269,28 +269,28 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
269
269
|
line-height: 20px;
|
|
270
270
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
271
271
|
}
|
|
272
|
-
`;function
|
|
272
|
+
`;function he({appearance:e,title:t,subtitle:o,size:n="medium"}){return uo.createElement(uo.Fragment,null,uo.createElement(wl,{appearance:e,className:a(`${n}Title`,e),dangerouslySetInnerHTML:ae(t),size:n}),o&&uo.createElement(Tl,{appearance:e,className:a(`${n}Subtitle`,e),dangerouslySetInnerHTML:ae(o),size:n}))}var kl=Ar.div`
|
|
273
273
|
display: flex;
|
|
274
274
|
flex-direction: column;
|
|
275
275
|
justify-content: flex-end;
|
|
276
276
|
padding-bottom: 14px;
|
|
277
277
|
overflow: visible;
|
|
278
|
-
`,
|
|
278
|
+
`,Pl=Ar.div`
|
|
279
279
|
padding-left: 1px;
|
|
280
280
|
padding-right: 1px;
|
|
281
|
-
`,
|
|
281
|
+
`,vl={text:Sr,multipleChoice:Tr,multipleChoiceList:vr};function Ir({stepData:e,canContinue:t,setCanContinue:o,onSaveData:n,appearance:r,customFormElements:i}){var S;let s=e.props,[p,d]=Br(b()||{}),[l,u]=Br([]),c={...vl,...i};Fl(()=>{o(l.length===0)},[l,o]);function m(f,P){let T={...p,[f.id]:P};d(T),n(T),window&&window.localStorage&&window.localStorage.setItem(w(),JSON.stringify(T))}function b(){if(window&&window.localStorage){let f=window.localStorage.getItem(w());if(f)return JSON.parse(f)}return{}}function w(){return`frigade-multiInputStepTypeData-${e.id}`}return fo.createElement(Pl,{className:a("multiInput",r)},fo.createElement(he,{appearance:r,title:e.title,subtitle:e.subtitle}),fo.createElement(kl,{className:a("multiInputContainer",r)},(S=s.data)==null?void 0:S.map(f=>c[f.type]?fo.createElement("span",{key:f.id},c[f.type]({formInput:f,customFormTypeProps:{stepData:e,canContinue:t,setCanContinue:o,onSaveData:n,appearance:r},onSaveInputData:P=>{m(f,P)},inputData:p[f.id],setFormValidationErrors:P=>{u(T=>P.length===0?T.filter(B=>B.id!==f.id):[...T,...P])}})):null)))}import Ft from"styled-components";var Nr=Ft.div`
|
|
282
282
|
align-items: center;
|
|
283
283
|
display: flex;
|
|
284
284
|
justify-content: space-between;
|
|
285
285
|
padding-top: 14px;
|
|
286
|
-
`,
|
|
286
|
+
`,Lr=Ft.div`
|
|
287
287
|
display: flex;
|
|
288
288
|
gap: 12px;
|
|
289
|
-
`,
|
|
289
|
+
`,Or=Ft.div`
|
|
290
290
|
display: flex;
|
|
291
291
|
flex-direction: row;
|
|
292
292
|
flex: 1 1;
|
|
293
|
-
`,
|
|
293
|
+
`,Dr=Ft.div`
|
|
294
294
|
display: flex;
|
|
295
295
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
296
296
|
// Otherwise, use 4px padding
|
|
@@ -298,11 +298,11 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
298
298
|
flex-grow: 1;
|
|
299
299
|
flex-basis: 0;
|
|
300
300
|
position: relative;
|
|
301
|
-
|
|
301
|
+
`,$r=Ft.div`
|
|
302
302
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
303
303
|
position: relative;
|
|
304
304
|
overflow-y: auto;
|
|
305
|
-
`,
|
|
305
|
+
`,Mr=Ft.div`
|
|
306
306
|
display: flex;
|
|
307
307
|
align-self: stretch;
|
|
308
308
|
flex-grow: 1;
|
|
@@ -314,7 +314,7 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
314
314
|
background-position: center;
|
|
315
315
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
316
316
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
317
|
-
`;import
|
|
317
|
+
`;import zt from"react";import El from"react";import Ur from"styled-components";var Bl=Ur.button`
|
|
318
318
|
justify-content: center;
|
|
319
319
|
align-content: center;
|
|
320
320
|
${e=>F(e)} {
|
|
@@ -344,7 +344,7 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
344
344
|
opacity: 0.3;
|
|
345
345
|
cursor: not-allowed;
|
|
346
346
|
}
|
|
347
|
-
`,
|
|
347
|
+
`,go=Ur.div`
|
|
348
348
|
${e=>F(e)} {
|
|
349
349
|
display: flex;
|
|
350
350
|
flex-direction: row;
|
|
@@ -354,14 +354,14 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
354
354
|
margin-right: 8px;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
`,
|
|
357
|
+
`,R=({onClick:e,title:t,style:o,disabled:n,type:r="inline",size:i="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:l=""})=>{function u(){let c=s?"buttonSecondary":"button";return l===""?c:`${l}${cr(c)}`}return El.createElement(Bl,{secondary:s,appearance:p,disabled:n,onClick:e,style:o,type:r,withMargin:d,size:i,className:a(u(),p)},t)};var _r=({step:e,canContinue:t,appearance:o,onPrimaryClick:n,onSecondaryClick:r,formType:i,selectedStep:s,steps:p,onBack:d,allowBackNavigation:l})=>{let u=i==="inline"?"inline":"full-width";return zt.createElement(Nr,{className:a("formCTAContainer",o)},p.length>1&&s!=0&&l&&zt.createElement(R,{title:"\u2190",onClick:d,secondary:!0,withMargin:!1,type:u,appearance:o}),zt.createElement(Lr,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?zt.createElement(R,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:u,appearance:o}):null," ",e.primaryButtonTitle?zt.createElement(R,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:n,type:u,appearance:o}):null))};import Mo from"react";import Al from"styled-components";var Il=Al.div`
|
|
358
358
|
text-align: center;
|
|
359
|
-
`,
|
|
359
|
+
`,Wr=({stepCount:e=0,currentStep:t=0,className:o,appearance:n})=>{let{theme:r}=J().mergeAppearanceWithDefault(n);return Mo.createElement(Il,{className:o},Mo.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((i,s)=>Mo.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import pt from"react";import kt from"styled-components";import{useContext as Nl}from"react";function re(){let e=Nl(K);function t(r){n(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){n(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function n(r,i){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";i&&i!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:n}}var Ll=kt.div`
|
|
360
360
|
display: flex;
|
|
361
361
|
flex-wrap: wrap;
|
|
362
362
|
align-content: center;
|
|
363
363
|
justify-content: center;
|
|
364
|
-
`,
|
|
364
|
+
`,Ol=kt.div`
|
|
365
365
|
align-content: center;
|
|
366
366
|
align-items: center;
|
|
367
367
|
display: flex;
|
|
@@ -375,10 +375,10 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
375
375
|
flex-basis: 255px;
|
|
376
376
|
flex-grow: 0;
|
|
377
377
|
flex-shrink: 0;
|
|
378
|
-
`,
|
|
378
|
+
`,Dl=kt.img`
|
|
379
379
|
width: 78px;
|
|
380
380
|
height: auto;
|
|
381
|
-
|
|
381
|
+
`,$l=kt.button`
|
|
382
382
|
font-style: normal;
|
|
383
383
|
font-weight: 600;
|
|
384
384
|
font-size: 13px;
|
|
@@ -391,11 +391,11 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
391
391
|
border-radius: 100px;
|
|
392
392
|
padding: 8px 12px;
|
|
393
393
|
margin-top: 16px;
|
|
394
|
-
`,
|
|
394
|
+
`,Ml=kt.h1`
|
|
395
395
|
font-weight: 700;
|
|
396
396
|
font-size: 28px;
|
|
397
397
|
line-height: 34px;
|
|
398
|
-
|
|
398
|
+
`,Ul=kt.h2`
|
|
399
399
|
font-style: normal;
|
|
400
400
|
font-weight: 400;
|
|
401
401
|
font-size: 16px;
|
|
@@ -404,7 +404,7 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
404
404
|
margin-top: 12px;
|
|
405
405
|
margin-bottom: 16px;
|
|
406
406
|
max-width: 70%;
|
|
407
|
-
`;function
|
|
407
|
+
`;function zr({stepData:e,appearance:t}){var n,r;let{handleUrl:o}=re();return pt.createElement("div",null,pt.createElement(Ml,null,e.title),pt.createElement(Ul,null,e.subtitle),pt.createElement(Ll,null,(r=(n=e.props)==null?void 0:n.links)==null?void 0:r.map(i=>pt.createElement(Ol,{key:i.title},pt.createElement(Dl,{src:i.imageUri}),pt.createElement($l,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{i.uri&&o(i.uri,i.uriTarget??"_blank")}},i.title)))))}import vt,{useEffect as Vl}from"react";import Co from"styled-components";import Uo from"react";var ho=({style:e,className:t})=>Uo.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},Uo.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Uo.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 Ht,{useRef as _l,useState as Wl}from"react";import xo from"styled-components";var zl=xo.div`
|
|
408
408
|
display: flex;
|
|
409
409
|
align-items: center;
|
|
410
410
|
justify-content: flex-start;
|
|
@@ -412,7 +412,7 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
412
412
|
width: 100%;
|
|
413
413
|
height: 100%;
|
|
414
414
|
position: relative;
|
|
415
|
-
`,
|
|
415
|
+
`,Hl=xo.div`
|
|
416
416
|
position: absolute;
|
|
417
417
|
display: flex;
|
|
418
418
|
align-items: center;
|
|
@@ -431,59 +431,59 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
431
431
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
432
432
|
border-radius: 50%;
|
|
433
433
|
}
|
|
434
|
-
`,
|
|
434
|
+
`,jl=xo.video`
|
|
435
435
|
width: 100%;
|
|
436
436
|
height: 100%;
|
|
437
437
|
min-height: 200px;
|
|
438
438
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
439
|
-
`,
|
|
439
|
+
`,Gl=xo.iframe`
|
|
440
440
|
width: 100%;
|
|
441
441
|
height: 100%;
|
|
442
442
|
min-height: 200px;
|
|
443
443
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
444
|
-
`;function
|
|
444
|
+
`;function Pt({appearance:e,videoUri:t}){let o=_l(),[n,r]=Wl(!1);if(t.includes("youtube")){let i=t.split("v=")[1],s=i.indexOf("&");return s!==-1&&(i=i.substring(0,s)),Ht.createElement(Gl,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${i}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return Ht.createElement(zl,{appearance:e},!n&&Ht.createElement(Hl,{onClick:()=>{r(!0),o.current.play()},appearance:e},Ht.createElement(ho,null)),Ht.createElement(jl,{appearance:e,controls:n,ref:o,play:n,src:t}))}var Kl=Co.div`
|
|
445
445
|
${e=>F(e)} {
|
|
446
446
|
display: flex;
|
|
447
447
|
flex-direction: column;
|
|
448
448
|
justify-content: center;
|
|
449
449
|
}
|
|
450
|
-
`,
|
|
450
|
+
`,ql=Co.img`
|
|
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
|
-
`,
|
|
457
|
+
`,Yl=Co.div`
|
|
458
458
|
${e=>F(e)} {
|
|
459
459
|
margin-bottom: 24px;
|
|
460
460
|
}
|
|
461
|
-
`,
|
|
461
|
+
`,Xl=Co.div`
|
|
462
462
|
${e=>F(e)} {
|
|
463
463
|
width: 100%;
|
|
464
464
|
height: auto;
|
|
465
465
|
max-height: 250px;
|
|
466
466
|
margin-bottom: 24px;
|
|
467
467
|
}
|
|
468
|
-
`;function
|
|
469
|
-
${e=>
|
|
470
|
-
`,
|
|
468
|
+
`;function Hr({stepData:e,appearance:t,setCanContinue:o}){return Vl(()=>{o(!0)},[]),vt.createElement(Kl,{className:a("callToActionContainer",t)},vt.createElement(Yl,{className:a("callToActionTextContainer",t)},vt.createElement(he,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&vt.createElement(ql,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&vt.createElement(Xl,{appearance:t,className:a("callToActionVideo",t)},vt.createElement(Pt,{appearance:t,videoUri:e.videoUri})))}import Ge,{useEffect as _o,useState as Wo}from"react";import Gt from"react";import jt from"react";import{motion as Jl}from"framer-motion";var jr=({color:e,percentage:t,size:o})=>{let n=o*.5-2,r=2*Math.PI*n,i=(1-t)*r,s={duration:.3,delay:0,ease:"easeIn"},p={hidden:{strokeDashoffset:r,transition:s},show:{strokeDashoffset:i,transition:s}};return jt.createElement(Jl.circle,{r:n,cx:o*.5,cy:o*.5,fill:"transparent",stroke:i!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?i:0,variants:p,transition:s,initial:"hidden",animate:"show"})},Ql=({fillColor:e,size:t,percentage:o,children:n,bgColor:r="#D9D9D9",className:i,style:s})=>jt.createElement("svg",{style:s,className:i,width:t,height:t,overflow:"visible"},jt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},jt.createElement(jr,{color:r,size:t}),jt.createElement(jr,{color:e,percentage:o,size:t})),n),Et=Ql;var Bt={theme:{colorPrimary:"#000000",colorText:"#000000",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#505050",colorTextDisabled:"#999999",colorBorder:"#E5E5E5",borderRadius:20}};import Zl from"styled-components";var Rl=({color:e="#FFFFFF"})=>Gt.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Gt.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),ea={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ta={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},oa={border:"1px solid #000000",color:"#FFFFFF"},ra={border:"1px solid #E6E6E6"},ia={color:"#FFFFFF"},na={border:"3px solid #D9D9D9"},sa=e=>e==="square"?ea:ta,la=(e,t)=>e==="square"?t?oa:ra:t?ia:na,aa=Zl.div`
|
|
469
|
+
${e=>at(e)}
|
|
470
|
+
`,dt=({value:e,type:t="square",primaryColor:o="#000000",progress:n,appearance:r=Bt,style:i,className:s})=>{let p=sa(t),d=la(t,e);return e===!0?p={...p,...d,backgroundColor:o,borderColor:t==="square"?o:"none"}:p={...p,...d},e!==!0&&t==="round"&&n!==void 0&&n!==1?Gt.createElement(Et,{fillColor:o,percentage:n,size:22}):Gt.createElement(aa,{styleOverrides:p,style:i,role:"checkbox",className:ge(a("checkIconContainer",r),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&Gt.createElement(Rl,{color:"#FFFFFF"}))};import Re from"styled-components";var Gr=Re.div`
|
|
471
471
|
width: auto;
|
|
472
472
|
display: flex;
|
|
473
473
|
flex-direction: column;
|
|
474
474
|
justify-content: center;
|
|
475
475
|
align-items: center;
|
|
476
476
|
padding: 4px;
|
|
477
|
-
`,
|
|
477
|
+
`,Vr=Re.div`
|
|
478
478
|
width: 100%;
|
|
479
479
|
text-align: left;
|
|
480
|
-
`,
|
|
480
|
+
`,Kr=Re.h1`
|
|
481
481
|
font-style: normal;
|
|
482
482
|
font-weight: 700;
|
|
483
483
|
font-size: 32px;
|
|
484
484
|
line-height: 38px;
|
|
485
485
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
486
|
-
`,
|
|
486
|
+
`,qr=Re.h1`
|
|
487
487
|
font-style: normal;
|
|
488
488
|
font-weight: 400;
|
|
489
489
|
font-size: 16px;
|
|
@@ -491,7 +491,7 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
491
491
|
margin-top: 16px;
|
|
492
492
|
margin-bottom: 16px;
|
|
493
493
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
494
|
-
`,
|
|
494
|
+
`,Yr=Re.div`
|
|
495
495
|
padding-top: 12px;
|
|
496
496
|
padding-bottom: 12px;
|
|
497
497
|
flex-direction: row;
|
|
@@ -502,17 +502,17 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
502
502
|
cursor: pointer;
|
|
503
503
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
504
504
|
width: 100%;
|
|
505
|
-
`,
|
|
505
|
+
`,Xr=Re.div`
|
|
506
506
|
padding-top: 10px;
|
|
507
507
|
padding-bottom: 10px;
|
|
508
508
|
flex-direction: row;
|
|
509
509
|
display: flex;
|
|
510
510
|
justify-content: flex-start;
|
|
511
|
-
`,
|
|
511
|
+
`,Jr=Re.img`
|
|
512
512
|
width: 42px;
|
|
513
513
|
height: 42px;
|
|
514
514
|
margin-right: 12px;
|
|
515
|
-
`,
|
|
515
|
+
`,Qr=Re.p`
|
|
516
516
|
font-style: normal;
|
|
517
517
|
font-weight: 500;
|
|
518
518
|
font-size: 17px;
|
|
@@ -520,8 +520,8 @@ import ct,{createContext as Ca,useEffect as Ho,useState as ve}from"react";import
|
|
|
520
520
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
521
521
|
display: flex;
|
|
522
522
|
align-self: center;
|
|
523
|
-
`;var
|
|
524
|
-
${n=>n.inlineStyles.map(([r,i])=>`.${
|
|
523
|
+
`;var Zr=({stepData:e,setCanContinue:t,onSaveData:o,appearance:n})=>{let r=e.props,[i,s]=Wo([]),[p,d]=Wo(!1),[l,u]=Wo(e.id);return _o(()=>{i.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),_o(()=>{l!==e.id&&(u(e.id),s([]))},[e]),_o(()=>{o({choice:i}),i.length>=r.minChoices?t(!0):t(!1)},[i]),Ge.createElement(Gr,{className:a("selectListContainer",n)},Ge.createElement(Vr,null,Ge.createElement(Kr,{className:a("selectListTitle",n)},e.title),Ge.createElement(qr,{appearance:n,className:a("selectListSubtitle",n)},e.subtitle)),r.options.map((c,m)=>{let b=i.includes(c.id);return Ge.createElement(Yr,{key:`select-item-${m}`,onClick:()=>{if(i.includes(c.id)){s(i.filter(w=>w!==c.id));return}i.length<r.maxChoices?s([...i,c.id]):i.length==1&&r.maxChoices==1&&s([c.id])},hideBottomBorder:m===r.options.length-1,className:a("selectListSelectItem",n)},Ge.createElement(Xr,{className:a("selectListItemImage",n)},c.imageUri&&Ge.createElement(Jr,{src:c.imageUri,alt:`select-icon-${m}`}),Ge.createElement(Qr,{appearance:n,className:a("selectListSelectItemText",n)},c.title)),Ge.createElement(dt,{appearance:n,value:b,primaryColor:n.theme.colorPrimary}))}))};import xe,{useEffect as pa,useState as zo}from"react";import{AnimatePresence as da,motion as ca}from"framer-motion";var ma=({children:e,id:t,shouldWrap:o=!1})=>xe.createElement(xe.Fragment,null,o?xe.createElement(da,{initial:!1},xe.createElement(ca.div,{key:t,initial:{opacity:1,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"-100%"},transition:{duration:.5,ease:"easeInOut"},style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e)):e),So=({appearance:e,steps:t,selectedStep:o,customStepTypes:n,customVariables:r,onButtonClick:i,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:l,onComplete:u,setVisible:c,setShowModal:m,onDismiss:b,showPagination:w=!1,customFormElements:S,allowBackNavigation:f})=>{let T={...{linkCollection:zr,multiInput:Ir,callToAction:Hr,selectList:Zr},...n},{primaryCTAClickSideEffects:B,secondaryCTAClickSideEffects:k}=re(),[g,x]=zo(!1),[C,v]=zo({}),[M,$]=zo(!1),U=t[o]??null,{markStepCompleted:A,markStepStarted:H,isLoading:I,updateCustomVariables:_,markFlowCompleted:te}=X();pa(()=>{_(r)},[r,I]);function q(){return{data:C[t[o].id]??{},stepId:t[o].id,customVariables:r}}function W(L,oe,N){let V=o+1<t.length?t[o+1]:null;i&&i(L,o,oe,V),s&&s(L,N,V,C,q())}function be(L,oe){v(N=>{let V={};return V[L.id]=oe,{...N,...V}})}function ce(L){return L.selectedStep.imageUri?xe.createElement(Mr,{image:L.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let G=xe.createElement(_r,{step:t[o],canContinue:g||!M,formType:d,selectedStep:o,appearance:e,onPrimaryClick:async()=>{$(!0);let L={...q()};await A(p,t[o].id,L),o+1<t.length&&await H(p,t[o+1].id),W(t[o],"primary",o),o+1>=t.length&&(u&&u(),b&&b(),l&&(c&&c(!1),m(!1)),await te(p)),B(t[o]),$(!1)},onSecondaryClick:()=>{W(t[o],"secondary",o),k(t[o])},onBack:async()=>{o-1>=0&&($(!0),await H(p,t[o-1].id),$(!1))},steps:t,allowBackNavigation:f});return xe.createElement(xe.Fragment,null,xe.createElement(Or,{className:a("formContainer",e)},xe.createElement(Dr,null,xe.createElement(ma,{id:o,shouldWrap:d==="large-modal"},xe.createElement($r,{key:U.id,type:d,className:a("formContent",e)},t.map(L=>{let oe=T[L.type];return U.id!==L.id?null:xe.createElement(oe,{key:L.id,stepData:L,canContinue:g,setCanContinue:x,onSaveData:N=>{be(L,N)},appearance:e,customFormElements:S})}),w&&xe.createElement(Wr,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),G))),d=="large-modal"&&xe.createElement(ce,{selectedStep:t[o]})))};import Vt from"react";import{createGlobalStyle as ua}from"styled-components";function ee({appearance:e}){if(!e||!e.styleOverrides)return Vt.createElement(Vt.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([n,r])=>typeof r=="object");if(t.length===0)return Vt.createElement(Vt.Fragment,null);let o=ua`
|
|
524
|
+
${n=>n.inlineStyles.map(([r,i])=>`.${Wt}${r}.${Wt}${r} { ${Object.entries(i).map(([s,p])=>`${Lo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Vt.createElement(o,{inlineStyles:t})}var Rr=({flowId:e,customStepTypes:t={},type:o="inline",visible:n,setVisible:r,customVariables:i,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:u,onButtonClick:c,dismissible:m=!0,endFlowOnDismiss:b=!1,modalPosition:w="center",repeatable:S=!1,onDismiss:f,showPagination:P=!1,allowBackNavigation:T=!1})=>{let{getFlow:B,getFlowSteps:k,isLoading:g,targetingLogicShouldHideFlow:x,getFlowStatus:C,getCurrentStepIndex:v,markFlowCompleted:M,markFlowNotStarted:$}=X(),U=v(e),{mergeAppearanceWithDefault:A}=J(),[H,I]=ga(!1),{setOpenFlowState:_,getOpenFlowState:te}=Fe();d=A(d);let[q,W]=n!==void 0&&r!==void 0?[n,r]:[te(e,!0),L=>_(e,L)];if(fa(()=>{!H&&!g&&(I(!0),C(e)===Z&&S&&$(e),I(!0))},[H,I,g]),g)return null;let be=B(e);if(!be||x(be))return null;let ce=k(e);if(!ce||n!==void 0&&n===!1||C(e)===Z&&l)return null;let G=()=>{W(!1),f&&f(),b===!0&&M(e)};if(w=="center"&&o==="modal"||o==="large-modal"){let L={padding:"24px"};return o==="large-modal"?(L.width="85%",L.height="90%",L.maxHeight="800px",L.minHeight="500px",L.padding="0"):L.width="400px",$e.createElement(Je,{appearance:d,onClose:G,visible:q,style:L,dismissible:m},$e.createElement(ee,{appearance:d}),$e.createElement(So,{appearance:d,steps:ce,selectedStep:U,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:W,onDismiss:f,showPagination:P,customFormElements:s,allowBackNavigation:T}))}return o==="modal"&&w!=="center"?$e.createElement(ur,{appearance:d,onClose:G,visible:q},$e.createElement(ee,{appearance:d}),$e.createElement(So,{appearance:d,steps:ce,selectedStep:U,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:W,onDismiss:f,showPagination:P,customFormElements:s,allowBackNavigation:T})):$e.createElement($e.Fragment,null,$e.createElement(ee,{appearance:d}),$e.createElement(So,{appearance:d,steps:ce,selectedStep:U,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:u,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:W,onDismiss:f,showPagination:P,customFormElements:s,allowBackNavigation:T}))},ei=Rr;import{useCallback as ti,useContext as ha,useEffect as xa}from"react";function Ho(){let{organizationId:e,userId:t,setOrganizationId:o}=ha(K),{mutateUserFlowState:n}=Be(),{config:r}=Oe(),i=yt(),{verifySDKInitiated:s}=bt();xa(()=>{if(t&&e){if(t.startsWith(wt))return;let l=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(l)||(i(`${Se}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(l,"true"))}},[t,e]);let p=ti(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 u={foreignUserId:t,foreignUserGroupId:e,properties:l};await i(`${Se}userGroups`,{...r,method:"POST",body:JSON.stringify(u)}),n()},[e,t,r,n]),d=ti(async(l,u)=>{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 m={foreignUserId:t,foreignUserGroupId:e,events:[{event:l,properties:u}]};await i(`${Se}userGroups`,{...r,method:"POST",body:JSON.stringify(m)}),n()},[e,t,r,n]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:p,trackEventForOrganization:d}}var oi="xFrigade_guestUserId",ri="xFrigade_userId",ii=({})=>{let{setFlowResponses:e}=_t(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:n}=Be(),{userId:r,setUserId:i}=No(),[s,p]=jo(null),{getFlowStatus:d}=X(),{flows:l,userProperties:u,setIsNewGuestUser:c,flowResponses:m}=Ca(K),[b,w]=jo([]),[S,f]=jo([]),{organizationId:P}=Ho();yo(()=>{if(!o&&t)for(let g=0;g<t.length;g++){let x=t[g],C=l.find(v=>v.slug===(x==null?void 0:x.flowId));if(C&&x&&x.shouldTrigger===!0&&C.type=="FORM"&&C.triggerType==="AUTOMATIC"&&!S.includes(C.slug)){setTimeout(()=>{T(x.flowId)},500);break}}},[o,t]),yo(()=>{m.length>0&&n()},[m]);function T(g){let x=l.find(C=>C.slug===g);x&&x.triggerType==="AUTOMATIC"&&!S.includes(x.slug)&&(f([...S,x.slug]),w([x]))}function B(){if(!r){let g=localStorage.getItem(ri);if(g){i(g);return}let x=localStorage.getItem(oi);if(x){i(x);return}c(!0);let C=wt+Sa();try{localStorage.setItem(oi,C)}catch(v){console.log("Failed to save guest user id locally: Local storage unavailable",v)}i(v=>v||C)}}yo(()=>{try{if(l){let g=[];l.forEach(x=>{if(x.data){let C=x.data.match(/"imageUri":"(.*?)"/g);C&&C.forEach(v=>{let M=v.replace('"imageUri":"',"").replace('"',"");if(g.includes(M))return;let $=new Image;$.src=M,g.push(M)})}})}}catch{}},[l]),yo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(wt))try{localStorage.setItem(ri,r)}catch(g){console.log("Failed to save user id locally: Local storage available",g)}r===null&&setTimeout(()=>{r===null&&B()},50)},[r,l,u]);function k(){return ct.createElement(ct.Fragment,null,b.map(g=>d(g.slug)!==Le?null:ct.createElement("span",{key:g.slug},ct.createElement(ei,{flowId:g.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return ct.createElement(ct.Fragment,null,ct.createElement(k,null))};import{ErrorBoundary as wa}from"react-error-boundary";var K=ya({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:Bt,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{}}),Ta=({publicApiKey:e,userId:t,organizationId:o,config:n,children:r})=>{var te,q;let[i,s]=Ae(t||null),[p,d]=Ae(o||null),[l,u]=Ae([]),[c,m]=Ae([]),[b,w]=Ae([]),[S,f]=Ae({}),[P,T]=Ae({}),[B,k]=Ae([]),[g,x]=Ae({}),[C,v]=Ae(!1),[M,$]=Ae(!1),[U,A]=Ae(!_(e)),H=(W,be)=>{if(be==="_blank"){window.open(W,"_blank");return}setTimeout(()=>{window.location.href=W},50)},I={theme:{...Bt.theme,...((te=n==null?void 0:n.defaultAppearance)==null?void 0:te.theme)??{}},styleOverrides:{...Bt.styleOverrides,...((q=n==null?void 0:n.defaultAppearance)==null?void 0:q.styleOverrides)??{}}};function _(W){return!!(W&&W.length>10&&W.substring(0,10)==="api_public")}return Go(()=>{t&&s(t)},[t]),Go(()=>{o&&d(o)},[o]),Go(()=>{if(_(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]),U?mt.createElement(K.Provider,{value:{publicApiKey:e,userId:i,setUserId:s,setFlows:u,flows:l,failedFlowResponses:c,setFailedFlowResponses:m,flowResponses:b,setFlowResponses:w,userProperties:S,setUserProperties:f,openFlowStates:P,setOpenFlowStates:T,completedFlowsToKeepOpenDuringSession:B,setCompletedFlowsToKeepOpenDuringSession:k,customVariables:g,setCustomVariables:x,isNewGuestUser:C,setIsNewGuestUser:v,hasActiveFullPageFlow:M,setHasActiveFullPageFlow:$,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:H,defaultAppearance:I,shouldGracefullyDegrade:U,setShouldGracefullyDegrade:A}},r):mt.createElement(wa,{fallback:mt.createElement(mt.Fragment,null,r)},mt.createElement(K.Provider,{value:{publicApiKey:e,userId:i,setUserId:s,setFlows:u,flows:l,failedFlowResponses:c,setFailedFlowResponses:m,flowResponses:b,setFlowResponses:w,userProperties:S,setUserProperties:f,openFlowStates:P,setOpenFlowStates:T,completedFlowsToKeepOpenDuringSession:B,setCompletedFlowsToKeepOpenDuringSession:k,customVariables:g,setCustomVariables:x,isNewGuestUser:C,setIsNewGuestUser:v,hasActiveFullPageFlow:M,setHasActiveFullPageFlow:$,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:H,defaultAppearance:I,shouldGracefullyDegrade:U,setShouldGracefullyDegrade:A}},mt.createElement(ba,{theme:I.theme},r,mt.createElement(ii,null))))};import yp from"react";import se,{useEffect as Dn,useState as $n}from"react";import Ne,{useState as Va}from"react";import gt from"styled-components";import To from"react";import ut from"react";import si from"styled-components";var ni=si.span`
|
|
525
525
|
font-weight: 400;
|
|
526
526
|
font-size: 15px;
|
|
527
527
|
line-height: 20px;
|
|
@@ -530,7 +530,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
530
530
|
vertical-align: middle;
|
|
531
531
|
margin-left: 12px;
|
|
532
532
|
padding-right: 12px;
|
|
533
|
-
`,
|
|
533
|
+
`,Fa=si.div`
|
|
534
534
|
flex-direction: row;
|
|
535
535
|
justify-content: space-between;
|
|
536
536
|
display: flex;
|
|
@@ -538,24 +538,24 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
538
538
|
padding-bottom: 20px;
|
|
539
539
|
border-top: 1px solid ${e=>e.theme.colorBorder};
|
|
540
540
|
width: 100%;
|
|
541
|
-
`,
|
|
541
|
+
`,bo=({label:e,value:t,labelStyle:o={},labelPosition:n="right",style:r,primaryColor:i="#000000",checkBoxType:s="square",appearance:p})=>ut.createElement(ut.Fragment,null,ut.createElement(Fa,{className:a("checklistStepsContainer",p),appearance:p,style:{...r}},n==="left"&&e&&ut.createElement(ni,{className:a("checklistStepLabel",p),style:o},e),ut.createElement(dt,{appearance:p,value:t,type:s,primaryColor:i}),n==="right"&&e&&ut.createElement(ni,{className:a("checklistStepLabel",p),style:o},e)),ut.createElement(ee,{appearance:p}));import{motion as ka}from"framer-motion";import Kt from"styled-components";var li=Kt.div`
|
|
542
542
|
font-weight: 700;
|
|
543
543
|
font-size: 18px;
|
|
544
544
|
line-height: 22px;
|
|
545
|
-
`,
|
|
545
|
+
`,ai=Kt.p`
|
|
546
546
|
font-weight: 700;
|
|
547
547
|
font-size: 18px;
|
|
548
548
|
line-height: 22px;
|
|
549
549
|
margin: 20px 0px 0px 0px;
|
|
550
550
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
551
|
-
`,
|
|
551
|
+
`,pi=Kt.p`
|
|
552
552
|
font-weight: 400;
|
|
553
553
|
font-size: 15px;
|
|
554
554
|
line-height: 28px;
|
|
555
555
|
max-width: 540px;
|
|
556
556
|
margin: 8px 0px 0px 0px;
|
|
557
557
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
558
|
-
`,
|
|
558
|
+
`,wo=Kt.div`
|
|
559
559
|
width: 4px;
|
|
560
560
|
position: absolute;
|
|
561
561
|
left: 0;
|
|
@@ -563,35 +563,35 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
563
563
|
height: 80%;
|
|
564
564
|
border-top-right-radius: 8px;
|
|
565
565
|
border-bottom-right-radius: 8px;
|
|
566
|
-
`,
|
|
566
|
+
`,di=Kt.div`
|
|
567
567
|
flex-direction: row;
|
|
568
568
|
justify-content: flex-start;
|
|
569
|
-
`;var
|
|
569
|
+
`;var ci=({data:e,index:t,isSelected:o,primaryColor:n,style:r,onClick:i,appearance:s})=>{var p,d;return To.createElement("div",{style:{position:"relative",paddingLeft:"20px"},onClick:()=>{i()}},o&&To.createElement(wo,{className:a("checklistStepItemSelectedIndicator",s),as:ka.div,layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??n}}),To.createElement(di,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,role:"listitem"},To.createElement(bo,{value:e.complete,labelPosition:"left",label:e.stepName,style:r,primaryColor:((d=s==null?void 0:s.theme)==null?void 0:d.colorPrimary)??n,appearance:s})))};import ft from"react";import{motion as Pa}from"framer-motion";import Vo from"styled-components";var va={backgroundColor:"#E6E6E6"},Ea=Vo.div`
|
|
570
570
|
display: flex;
|
|
571
571
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
572
572
|
justify-content: flex-start;
|
|
573
573
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
574
574
|
|
|
575
|
-
${e=>
|
|
576
|
-
`,
|
|
575
|
+
${e=>at(e)}
|
|
576
|
+
`,Ba=Vo.div`
|
|
577
577
|
flex-grow: 1;
|
|
578
578
|
position: relative;
|
|
579
579
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
580
|
-
`,
|
|
580
|
+
`,Aa=Vo.span`
|
|
581
581
|
font-weight: 500;
|
|
582
582
|
font-size: 15px;
|
|
583
583
|
line-height: 18px;
|
|
584
584
|
padding-right: ${e=>e.padding};
|
|
585
585
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
586
586
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
587
|
-
${e=>
|
|
588
|
-
`,Ia={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},
|
|
587
|
+
${e=>at(e)}
|
|
588
|
+
`,Ia={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},Na={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},Me=({count:e,total:t,fillColor:o,bgColor:n=va.backgroundColor,display:r="count",textLocation:i="left",style:s={},textStyle:p={},appearance:d})=>{var w,S;if(t===0)return ft.createElement(ft.Fragment,null);let l=e===0?"10px":`${e/t*100}%`,u=r==="compact"?"5px":"10px",c=Math.round(e/t*100),m=r==="compact"?"5px":"20px",b;return r==="count"?b=`${e} of ${t}`:r==="compact"?b=`${c}%`:r==="percent"&&(b=`${c}% complete`),i==="top"&&(m="0px"),ft.createElement(Ea,{className:a("progressBarContainer",d),textLocation:i,styleOverrides:s},ft.createElement(Aa,{className:a("progressBarStepText",d),style:{...p,fontSize:r==="compact"?12:15,fontWeight:r==="compact"?400:500},appearance:d,padding:m,textLocation:i},b),ft.createElement(Ba,{textLocation:i,className:a("progressBar",d)},ft.createElement(Pa.div,{style:{...Na,width:l,height:u,backgroundColor:((w=d==null?void 0:d.theme)==null?void 0:w.colorPrimary)??o,zIndex:r=="compact"?1:5},className:a("progressBarFill",d)}),ft.createElement("div",{className:a("progressBarBackground",d),style:{...Ia,height:u,backgroundColor:((S=d==null?void 0:d.theme)==null?void 0:S.colorSecondary)??n}})))};import Yt from"react";import La from"styled-components";import ko from"react";import Fo from"react";var At=({stepData:e,appearance:t})=>Fo.createElement(Fo.Fragment,null,Fo.createElement(ai,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:ae(e.title)}),Fo.createElement(pi,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:ae(e.subtitle)}));import qt from"react";var It=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},n=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return qt.createElement(qt.Fragment,null,qt.createElement(go,null,e.secondaryButtonTitle&&qt.createElement(R,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:n,style:{width:"auto",marginRight:"12px"}}),qt.createElement(R,{appearance:t,title:e.primaryButtonTitle,onClick:o})))};var Nt=({stepData:e,appearance:t})=>ko.createElement(ko.Fragment,null,ko.createElement(At,{stepData:e,appearance:t}),ko.createElement(It,{stepData:e,appearance:t}));import mi from"react";function ui(e){if(e.videoUri.includes("youtube")){let t=e.videoUri.split("v=")[1],o=t.indexOf("&");return o!==-1&&(t=t.substring(0,o)),mi.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 mi.createElement("video",{width:"480",height:"260",controls:!0,src:e.videoUri})}var Ko="default",Oa=La.img`
|
|
589
589
|
border-radius: 4px;
|
|
590
590
|
max-height: 260px;
|
|
591
591
|
min-height: 200px;
|
|
592
|
-
`,
|
|
592
|
+
`,fi=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Yt.createElement("div",null,o)}return Yt.createElement(li,{className:a("checklistStepContent",t)},e.imageUri?Yt.createElement(Oa,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Yt.createElement(ui,{videoUri:e.videoUri,appearance:t}):null,Yt.createElement(Nt,{stepData:e,appearance:t}))};import Pe,{useRef as Da,useState as $a}from"react";import Lt from"styled-components";var gi=Lt.div`
|
|
593
593
|
display: block;
|
|
594
|
-
`,
|
|
594
|
+
`,Ma=Lt.div`
|
|
595
595
|
display: flex;
|
|
596
596
|
flex-direction: row;
|
|
597
597
|
flex-wrap: wrap;
|
|
@@ -601,20 +601,20 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
601
601
|
align-content: center;
|
|
602
602
|
margin-top: 24px;
|
|
603
603
|
margin-bottom: 24px;
|
|
604
|
-
|
|
604
|
+
`,Ua=Lt.div`
|
|
605
605
|
display: flex;
|
|
606
606
|
align-items: center;
|
|
607
607
|
justify-content: flex-start;
|
|
608
608
|
flex-direction: column;
|
|
609
609
|
margin-right: 16px;
|
|
610
|
-
`,
|
|
610
|
+
`,_a=Lt.video`
|
|
611
611
|
width: 200px;
|
|
612
612
|
height: 120px;
|
|
613
|
-
`,
|
|
613
|
+
`,Wa=Lt.div`
|
|
614
614
|
font-size: 14px;
|
|
615
615
|
line-height: 20px;
|
|
616
616
|
text-align: center;
|
|
617
|
-
`,
|
|
617
|
+
`,za=Lt.div`
|
|
618
618
|
position: absolute;
|
|
619
619
|
width: 200px;
|
|
620
620
|
height: 120px;
|
|
@@ -634,9 +634,9 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
634
634
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
635
635
|
border-radius: 50%;
|
|
636
636
|
}
|
|
637
|
-
`,
|
|
637
|
+
`,hi="videoCarousel",xi=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Pe.createElement(gi,null,Pe.createElement(Nt,{stepData:e,appearance:t}));function o({video:i}){let s=Da(),[p,d]=$a(!1);return Pe.createElement(Ua,null,!p&&Pe.createElement(za,{onClick:()=>{d(!0),s.current.play()},appearance:t},Pe.createElement(ho,null)),Pe.createElement(_a,{controls:p,ref:s,play:p,src:i.uri}),Pe.createElement(Wa,null,i.title))}let n=e.props;return n.videos?Pe.createElement(gi,null,Pe.createElement(At,{stepData:e,appearance:t}),Pe.createElement(Ma,null,n.videos.map((i,s)=>Pe.createElement("span",{key:`${i.uri}-${s}`},Pe.createElement(o,{video:i})))),Pe.createElement(It,{stepData:e,appearance:t})):null};import Ve from"react";import Po from"styled-components";var Ci=Po.div`
|
|
638
638
|
display: block;
|
|
639
|
-
`,
|
|
639
|
+
`,Ha=Po.pre`
|
|
640
640
|
display: block;
|
|
641
641
|
background-color: #2a2a2a;
|
|
642
642
|
color: #f8f8f8;
|
|
@@ -652,68 +652,68 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
652
652
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
653
653
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
654
654
|
margin-bottom: 24px;
|
|
655
|
-
`,
|
|
655
|
+
`,ja=Po.div`
|
|
656
656
|
font-size: 15px;
|
|
657
657
|
line-height: 20px;
|
|
658
658
|
margin-bottom: 12px;
|
|
659
659
|
margin-top: 12px;
|
|
660
|
-
`,
|
|
660
|
+
`,Ga=Po.div`
|
|
661
661
|
margin-top: 24px;
|
|
662
|
-
`,
|
|
662
|
+
`,Si="codeSnippet",yi=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.codeSnippets))return Ve.createElement(Ci,null,Ve.createElement(Nt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?Ve.createElement(Ci,null,Ve.createElement(At,{stepData:e,appearance:t}),Ve.createElement(Ga,null,o.codeSnippets.map((r,i)=>Ve.createElement("div",{key:i},r.title?Ve.createElement(ja,null,r.title):null,r.code?Ve.createElement(Ha,null,r.code):null))),Ve.createElement(It,{stepData:e,appearance:t})):null};var Ka=gt.div`
|
|
663
663
|
display: flex;
|
|
664
664
|
flex-direction: row;
|
|
665
665
|
min-width: ${e=>e.type!="modal"?"1000px":"100%"};
|
|
666
666
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
667
667
|
box-shadow: ${e=>e.type!="modal"?"0px 6px 25px rgba(0, 0, 0, 0.06)":"none"};
|
|
668
668
|
border-radius: 8px;
|
|
669
|
-
`,
|
|
669
|
+
`,qa=gt.h1`
|
|
670
670
|
font-size: 24px;
|
|
671
671
|
font-weight: 600;
|
|
672
672
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
673
|
-
`,
|
|
673
|
+
`,Ya=gt.h2`
|
|
674
674
|
font-size: 15px;
|
|
675
675
|
line-height: 20px;
|
|
676
676
|
color: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary)??"#4d4d4d"}};
|
|
677
677
|
margin: 10px 0px 0px 0px;
|
|
678
|
-
`,
|
|
678
|
+
`,bi=gt.div`
|
|
679
679
|
padding-bottom: 16px;
|
|
680
|
-
`,
|
|
680
|
+
`,Xa=gt.div`
|
|
681
681
|
list-style: none;
|
|
682
682
|
padding: 0;
|
|
683
683
|
margin: 0;
|
|
684
684
|
cursor: pointer;
|
|
685
685
|
width: 300px;
|
|
686
|
-
`,
|
|
686
|
+
`,Ja=gt.div`
|
|
687
687
|
width: 1px;
|
|
688
688
|
margin: 40px;
|
|
689
689
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
690
|
-
`,
|
|
690
|
+
`,Qa=gt.div`
|
|
691
691
|
flex: 2;
|
|
692
692
|
padding: 2rem;
|
|
693
|
-
`,
|
|
693
|
+
`,Za=({title:e,subtitle:t,steps:o=[],style:n={},selectedStep:r,setSelectedStep:i,className:s="",customStepTypes:p=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:u}=J();d=u(d);let m={...{[Ko]:fi,[hi]:xi,[Si]:yi},...p},[b,w]=Va(0),S=r??b,f=i??w,P=o.filter(B=>B.complete===!0).length,T=()=>{var B;return!((B=o[S])!=null&&B.type)||!m[o[S].type]?m[Ko]({stepData:o[S],appearance:d}):m[o[S].type]({stepData:o[S],appearance:d})};return Ne.createElement(Ka,{type:l,style:n,className:s,appearance:d},Ne.createElement(bi,{style:{flex:1}},Ne.createElement(bi,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},Ne.createElement(qa,{className:a("checklistTitle",d),appearance:d},e),Ne.createElement(Ya,{className:a("checklistSubtitle",d),appearance:d},t),Ne.createElement(Me,{total:o.length,count:P,fillColor:d.theme.colorPrimary,style:{marginTop:"24px"},appearance:d})),Ne.createElement(Xa,{className:a("checklistStepsContainer",d)},o.map((B,k)=>Ne.createElement(ci,{data:B,index:k,key:k,listLength:o.length,isSelected:k===S,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{f(k)}})))),Ne.createElement(Ja,{appearance:d,className:a("checklistDivider",d)}),Ne.createElement(Qa,null,Ne.createElement(T,null)))},qo=Za;import O,{useState as ip}from"react";import wi from"react";import Ra from"styled-components";var ep=Ra.svg`
|
|
694
694
|
transition: 'transform 0.35s ease-in-out';
|
|
695
|
-
`,
|
|
695
|
+
`,Ot=({color:e="#323232",style:t,className:o})=>wi.createElement(ep,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},wi.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import{motion as np}from"framer-motion";import pe from"styled-components";var Yo={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Ti=pe.div`
|
|
696
696
|
max-height: 350px;
|
|
697
697
|
padding-bottom: 40px;
|
|
698
|
-
`,
|
|
698
|
+
`,Fi=pe.div`
|
|
699
699
|
display: flex;
|
|
700
700
|
flex-direction: column;
|
|
701
701
|
margin-top: 20px;
|
|
702
|
-
`,
|
|
702
|
+
`,ki=pe.h1`
|
|
703
703
|
font-style: normal;
|
|
704
704
|
font-weight: 600;
|
|
705
705
|
font-size: 30px;
|
|
706
706
|
line-height: 36px;
|
|
707
707
|
margin-bottom: 16px;
|
|
708
708
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
709
|
-
`,
|
|
709
|
+
`,Pi=pe.h2`
|
|
710
710
|
font-weight: 400;
|
|
711
711
|
font-size: 16px;
|
|
712
712
|
line-height: 20px;
|
|
713
713
|
margin-bottom: 16px;
|
|
714
714
|
padding-left: 1px;
|
|
715
715
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
716
|
-
`,
|
|
716
|
+
`,vi=pe.div`
|
|
717
717
|
${e=>F(e)} {
|
|
718
718
|
border: 1px solid #fafafa;
|
|
719
719
|
}
|
|
@@ -723,11 +723,11 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
723
723
|
flex-direction: column;
|
|
724
724
|
min-height: 240px;
|
|
725
725
|
overflow: hidden;
|
|
726
|
-
`,
|
|
726
|
+
`,Ei=pe.div`
|
|
727
727
|
display: flex;
|
|
728
728
|
flex-direction: row;
|
|
729
729
|
justify-content: space-between;
|
|
730
|
-
`,
|
|
730
|
+
`,Bi=pe.p`
|
|
731
731
|
${e=>F(e)} {
|
|
732
732
|
font-weight: 400;
|
|
733
733
|
font-size: 10px;
|
|
@@ -736,12 +736,12 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
736
736
|
color: #8c8c8c;
|
|
737
737
|
margin: 20px;
|
|
738
738
|
}
|
|
739
|
-
`,
|
|
739
|
+
`,Ai=pe.div`
|
|
740
740
|
display: flex;
|
|
741
741
|
flex-direction: row;
|
|
742
|
-
`,Ii=
|
|
742
|
+
`,Ii=pe.div`
|
|
743
743
|
flex: 1;
|
|
744
|
-
`,
|
|
744
|
+
`,Ni=pe.div`
|
|
745
745
|
${e=>F(e)} {
|
|
746
746
|
display: flex;
|
|
747
747
|
justify-content: center;
|
|
@@ -751,7 +751,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
751
751
|
padding-left: 8px;
|
|
752
752
|
padding-right: 8px;
|
|
753
753
|
}
|
|
754
|
-
`,
|
|
754
|
+
`,Li=pe.p`
|
|
755
755
|
${e=>F(e)} {
|
|
756
756
|
font-style: normal;
|
|
757
757
|
font-weight: 600;
|
|
@@ -763,7 +763,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
763
763
|
margin-top: 20px;
|
|
764
764
|
margin-bottom: 16px;
|
|
765
765
|
}
|
|
766
|
-
`,
|
|
766
|
+
`,Oi=pe.p`
|
|
767
767
|
${e=>F(e)} {
|
|
768
768
|
font-weight: 400;
|
|
769
769
|
font-size: 14px;
|
|
@@ -772,14 +772,14 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
772
772
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
773
773
|
margin-bottom: 8px;
|
|
774
774
|
}
|
|
775
|
-
`,
|
|
775
|
+
`,Di=pe.div`
|
|
776
776
|
${e=>F(e)} {
|
|
777
777
|
display: flex;
|
|
778
778
|
flex-direction: row;
|
|
779
779
|
justify-content: center;
|
|
780
780
|
gap: 8px;
|
|
781
781
|
}
|
|
782
|
-
|
|
782
|
+
`,$i=pe.div`
|
|
783
783
|
${e=>F(e)} {
|
|
784
784
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
785
785
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
@@ -799,7 +799,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
799
799
|
justify-content: space-between;
|
|
800
800
|
position: relative;
|
|
801
801
|
cursor: pointer;
|
|
802
|
-
`,
|
|
802
|
+
`,Mi=pe.p`
|
|
803
803
|
${e=>F(e)} {
|
|
804
804
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
805
805
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
@@ -808,12 +808,12 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
808
808
|
font-size: 14px;
|
|
809
809
|
line-height: 22px;
|
|
810
810
|
margin: 0;
|
|
811
|
-
|
|
811
|
+
`,Ui=pe.div`
|
|
812
812
|
display: flex;
|
|
813
813
|
flex-direction: row;
|
|
814
814
|
justify-content: flex-end;
|
|
815
815
|
align-content: center;
|
|
816
|
-
`,
|
|
816
|
+
`,_i=pe.div`
|
|
817
817
|
display: flex;
|
|
818
818
|
flex: 1;
|
|
819
819
|
flex-direction: row;
|
|
@@ -821,14 +821,14 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
821
821
|
align-content: center;
|
|
822
822
|
align-items: center;
|
|
823
823
|
margin-right: 20px;
|
|
824
|
-
`,
|
|
824
|
+
`,Wi=pe.div`
|
|
825
825
|
display: block;
|
|
826
826
|
width: 100%;
|
|
827
|
-
`;import
|
|
827
|
+
`;import tp from"styled-components";var zi=tp.div`
|
|
828
828
|
flex-direction: column;
|
|
829
829
|
justify-content: center;
|
|
830
830
|
display: flex;
|
|
831
|
-
`;import qe from"react";import{motion as
|
|
831
|
+
`;import qe from"react";import{motion as op}from"framer-motion";import Ke from"styled-components";var Hi=Ke.div`
|
|
832
832
|
border: 1px solid #fafafa;
|
|
833
833
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
834
834
|
border-radius: 14px;
|
|
@@ -836,13 +836,13 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
836
836
|
display: flex;
|
|
837
837
|
flex-direction: column;
|
|
838
838
|
overflow: hidden;
|
|
839
|
-
`,
|
|
839
|
+
`,ji=Ke.div`
|
|
840
840
|
display: flex;
|
|
841
841
|
flex-wrap: wrap;
|
|
842
842
|
justify-content: space-between;
|
|
843
843
|
overflow: hidden;
|
|
844
844
|
row-gap: 10px;
|
|
845
|
-
`,
|
|
845
|
+
`,Gi=Ke.div`
|
|
846
846
|
${e=>F(e)} {
|
|
847
847
|
color: #595959;
|
|
848
848
|
}
|
|
@@ -852,7 +852,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
852
852
|
line-height: 12px;
|
|
853
853
|
letter-spacing: 0.09em;
|
|
854
854
|
margin-bottom: 12px;
|
|
855
|
-
`,
|
|
855
|
+
`,Vi=Ke.div`
|
|
856
856
|
${e=>F(e)} {
|
|
857
857
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
858
858
|
background: #ffffff;
|
|
@@ -865,7 +865,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
865
865
|
|
|
866
866
|
max-width: 150px;
|
|
867
867
|
min-width: 200px;
|
|
868
|
-
`,
|
|
868
|
+
`,Ki=Ke.div`
|
|
869
869
|
${e=>F(e)} {
|
|
870
870
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
871
871
|
}
|
|
@@ -877,13 +877,13 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
877
877
|
justify-content: center;
|
|
878
878
|
align-content: center;
|
|
879
879
|
align-items: center;
|
|
880
|
-
`,
|
|
880
|
+
`,qi=Ke.div`
|
|
881
881
|
font-weight: 600;
|
|
882
882
|
font-size: 20px;
|
|
883
883
|
line-height: 24px;
|
|
884
884
|
width: 20px;
|
|
885
885
|
height: 20px;
|
|
886
|
-
`,
|
|
886
|
+
`,Yi=Ke.div`
|
|
887
887
|
${e=>F(e)} {
|
|
888
888
|
color: #434343;
|
|
889
889
|
}
|
|
@@ -892,20 +892,20 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
892
892
|
line-height: 17px;
|
|
893
893
|
margin-top: 12px;
|
|
894
894
|
margin-bottom: 8px;
|
|
895
|
-
`,
|
|
895
|
+
`,Xi=Ke.div`
|
|
896
896
|
${e=>F(e)} {
|
|
897
897
|
color: #8c8c8c;
|
|
898
898
|
}
|
|
899
899
|
font-weight: 400;
|
|
900
900
|
font-size: 12px;
|
|
901
901
|
line-height: 14px;
|
|
902
|
-
`,
|
|
902
|
+
`,Ji=Ke.a`
|
|
903
903
|
color: ${e=>e.color};
|
|
904
904
|
font-size: 12px;
|
|
905
905
|
line-height: 14px;
|
|
906
906
|
font-weight: 400;
|
|
907
907
|
cursor: pointer;
|
|
908
|
-
`;var
|
|
908
|
+
`;var rp=({steps:e,style:t,title:o,primaryColor:n,appearance:r,onButtonClick:i})=>{let{primaryCTAClickSideEffects:s}=re();return qe.createElement(Hi,{style:t,className:a("guideContainer",r)},qe.createElement(Gi,{className:a("guideTitle",r)},o),qe.createElement(ji,{className:a("guideItemContainer",r)},e.map((p,d)=>qe.createElement(Vi,{key:`guide-${p.id??d}`,as:op.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:a("guideItem",r)},p.icon&&qe.createElement(Ki,{className:a("guideIcon",r)},qe.createElement(qi,null,p.icon)),qe.createElement(Yi,{className:a("guideItemTitle",r),dangerouslySetInnerHTML:ae(p.title)}),qe.createElement(Xi,{className:a("guideItemSubtitle",r),dangerouslySetInnerHTML:ae(p.subtitle)}),qe.createElement(Ji,{className:a("guideItemLink",r),color:n,onClick:()=>{p.primaryButtonUri&&s(p),i&&i(p)}},p.primaryButtonTitle)))))},Xt=rp;var sp=({steps:e,title:t,subtitle:o,stepsTitle:n,visible:r,onClose:i,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:l,guideData:u,guideTitle:c,onGuideButtonClick:m})=>{let b=({stepData:x,handleSecondaryCTAClick:C,handleCTAClick:v})=>x?O.createElement(Ni,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},O.createElement(Li,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:ae(x.title)}),O.createElement(Oi,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:ae(x.subtitle)}),O.createElement(Di,{className:a("checklistCTAContainer",l)},x.secondaryButtonTitle&&O.createElement(R,{title:x.secondaryButtonTitle,onClick:C,appearance:l,secondary:!0}),O.createElement(R,{title:x.primaryButtonTitle,onClick:v,appearance:l}))):O.createElement(O.Fragment,null),S={...{default:x=>{var $;if(($=e[T])!=null&&$.StepContent){let U=e[T].StepContent;return O.createElement("div",null,U)}let C=e[T];return O.createElement(b,{stepData:x,handleCTAClick:()=>{C.handlePrimaryButtonClick&&C.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{C.handleSecondaryButtonClick&&C.handleSecondaryButtonClick()}})}},...d},[f,P]=ip(0),T=s??f,B=p??P,k=()=>{var x;return e?!((x=e[T])!=null&&x.type)||!S[e[T].type]?S.default(e[T]):S[e[T].type]({stepData:e[T],primaryColor:l.theme.colorPrimary}):O.createElement(O.Fragment,null)},g=e.filter(x=>x.complete).length;return r?(l.theme.modalContainer||(l.theme.borderRadius&&(Yo.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Yo),O.createElement(Je,{onClose:i,visible:r,appearance:l},O.createElement(Wi,null,O.createElement(Fi,null,O.createElement(ki,{appearance:l,className:a("checklistTitle",l)},t),O.createElement(Pi,{appearance:l,className:a("checklistSubtitle",l)},o)),O.createElement(Ti,null,e&&e.length>0&&O.createElement(vi,{className:a("stepsContainer",l)},O.createElement(Ei,null,O.createElement("div",{style:{flex:3}},O.createElement(Bi,{className:a("stepsTitle",l)},n)),O.createElement(_i,null,O.createElement(Me,{fillColor:l.theme.colorPrimary,style:{width:"100%"},count:g,total:e.length,appearance:l}))),O.createElement(Ai,null,O.createElement(Ii,{className:a("checklistStepListContainer",l),appearance:l},e.map((x,C)=>{let v=T===C;return O.createElement($i,{selected:v,className:a(`checklistStepListItem${v?"Selected":""}`,l),key:`checklist-guide-step-${x.id??C}`,disabled:x.blocked,onClick:()=>{x.blocked||B(C)},title:x.blocked?"Finish remaining steps to continue":void 0},v&&O.createElement(wo,{className:a("checklistStepItemSelectedIndicator",l),as:np.div,layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),O.createElement(Mi,{selected:v,className:a(`checklistStepListStepName${v?"Selected":""}`,l)},x.stepName),O.createElement(Ui,null,O.createElement(dt,{value:x.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:x.progress,appearance:l}),O.createElement(zi,null,O.createElement(Ot,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),O.createElement(k,null))),u&&u.length>0&&O.createElement(Xt,{steps:u,title:c,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:x=>(m&&m(x),!0)}))))):O.createElement(O.Fragment,null)},Xo=sp;import{useEffect as lp,useState as ap}from"react";var Qi=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,n]=ap(t),r=null,i=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let u=window.matchMedia(l);return u.addEventListener("change",i),[d,u.matches]}));n(p)};return lp(()=>{s()},[]),o};import ye,{useEffect as un,useState as cp}from"react";import de from"react";import{AnimatePresence as pp,motion as dp}from"framer-motion";import Ye from"styled-components";var Zi=Ye.div`
|
|
909
909
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
910
910
|
border: 1px solid;
|
|
911
911
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -917,42 +917,42 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
917
917
|
display: flex;
|
|
918
918
|
flex-direction: column;
|
|
919
919
|
transition: max-height 0.25s;
|
|
920
|
-
`,
|
|
920
|
+
`,Ri=Ye.div`
|
|
921
921
|
display: flex;
|
|
922
922
|
margin-bottom: 20px;
|
|
923
|
-
`,
|
|
923
|
+
`,en=Ye.img`
|
|
924
924
|
border-radius: 4px;
|
|
925
925
|
max-height: 260px;
|
|
926
926
|
min-height: 200px;
|
|
927
|
-
`,
|
|
927
|
+
`,tn=Ye.div`
|
|
928
928
|
display: flex;
|
|
929
929
|
flex-direction: row;
|
|
930
930
|
justify-content: space-between;
|
|
931
931
|
align-items: center;
|
|
932
|
-
`,
|
|
932
|
+
`,on=Ye.p`
|
|
933
933
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
934
934
|
font-style: normal;
|
|
935
935
|
font-weight: 500;
|
|
936
936
|
font-size: 16px;
|
|
937
937
|
line-height: 18px;
|
|
938
938
|
margin-left: 8px;
|
|
939
|
-
`,
|
|
939
|
+
`,rn=Ye.div`
|
|
940
940
|
padding: 20px;
|
|
941
941
|
cursor: pointer;
|
|
942
942
|
:hover {
|
|
943
943
|
opacity: 0.8;
|
|
944
944
|
}
|
|
945
|
-
`,
|
|
945
|
+
`,Bh=Ye.div``,nn=Ye.p`
|
|
946
946
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
947
947
|
font-weight: 400;
|
|
948
948
|
font-size: 14px;
|
|
949
949
|
line-height: 22px;
|
|
950
|
-
`,
|
|
950
|
+
`,sn=Ye.div`
|
|
951
951
|
display: flex;
|
|
952
952
|
flex-direction: row;
|
|
953
953
|
justify-content: flex-start;
|
|
954
954
|
align-items: center;
|
|
955
|
-
`;var
|
|
955
|
+
`;var ln=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:n,onSecondaryButtonClick:r,appearance:i,customStepTypes:s})=>{var u,c;let p=t?{}:{transform:"rotate(90deg)"};function d(){return de.createElement(de.Fragment,null,e.imageUri||e.videoUri?de.createElement(Ri,{className:a("stepMediaContainer",i)},e.imageUri?de.createElement(en,{className:a("stepImage",i),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?de.createElement(Pt,{appearance:i,videoUri:e.videoUri}):null):null,de.createElement(nn,{className:a("stepSubtitle",i),appearance:i,dangerouslySetInnerHTML:ae(e.subtitle)}),de.createElement(go,{className:a("checklistCTAContainer",i)},e.secondaryButtonTitle?de.createElement(R,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:i}):null,de.createElement(R,{title:e.primaryButtonTitle??"Continue",onClick:()=>n(),appearance:i})))}function l(){if(!s)return null;let m=s[e.type];return m?m(e,i):null}return de.createElement(Zi,{onClick:()=>t?o():null,"data-testid":`step-${e.id}`,className:a("checklistStepContainer",i),appearance:i},de.createElement(tn,{className:a("stepHeader",i)},de.createElement(sn,null,de.createElement(bo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(u=i==null?void 0:i.theme)==null?void 0:u.colorPrimary,appearance:i}),de.createElement(on,{appearance:i,className:a("stepTitle",i),dangerouslySetInnerHTML:ae(e.title)})),de.createElement(rn,{className:a("stepChevronContainer",i),onClick:()=>o()},de.createElement(Ot,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(c=i==null?void 0:i.theme)==null?void 0:c.colorTextSecondary}))),de.createElement(pp,null,!t&&de.createElement(dp.div,{initial:{opacity:1,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:1,height:0},key:e.id,style:{overflow:"hidden"}},l()??d())))};import Dt from"styled-components";var jh=Dt.div`
|
|
956
956
|
background: #ffffff;
|
|
957
957
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
958
958
|
border-radius: 6px;
|
|
@@ -966,49 +966,49 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
966
966
|
|
|
967
967
|
max-width: 800px;
|
|
968
968
|
min-width: 350px;
|
|
969
|
-
`,
|
|
969
|
+
`,an=Dt.div`
|
|
970
970
|
display: flex;
|
|
971
971
|
flex-direction: column;
|
|
972
|
-
`,
|
|
972
|
+
`,pn=Dt.h1`
|
|
973
973
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
974
974
|
font-style: normal;
|
|
975
975
|
font-weight: 700;
|
|
976
976
|
font-size: 20px;
|
|
977
977
|
line-height: 24px;
|
|
978
978
|
margin-bottom: 8px;
|
|
979
|
-
`,
|
|
979
|
+
`,dn=Dt.h2`
|
|
980
980
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
981
981
|
font-weight: 400;
|
|
982
982
|
font-size: 14px;
|
|
983
983
|
line-height: 23px;
|
|
984
984
|
margin: 2px 0 0 0;
|
|
985
|
-
`,
|
|
985
|
+
`,cn=Dt.div`
|
|
986
986
|
display: block;
|
|
987
987
|
width: 100%;
|
|
988
|
-
`,
|
|
988
|
+
`,mn=Dt.div`
|
|
989
989
|
display: flex;
|
|
990
990
|
width: 100%;
|
|
991
991
|
flex-direction: column;
|
|
992
992
|
justify-content: space-between;
|
|
993
993
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
994
994
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
995
|
-
`;var
|
|
995
|
+
`;var mp=({title:e,subtitle:t,steps:o,onClose:n,visible:r,onCompleteStep:i,autoExpandFirstIncompleteStep:s=!0,autoCollapse:p=!0,autoExpandNextStep:d=!0,primaryColor:l="#000000",selectedStep:u,setSelectedStep:c,appearance:m,type:b,className:w,customStepTypes:S})=>{let f=o.filter(x=>x.complete).length,[P,T]=cp(Array(o.length).fill(!0));un(()=>{let x=[...P];if(s){for(let C=0;C<o.length;C++)if(!o[C].complete){x[C]=!1;break}T(x)}},[]),un(()=>{B(u)},[u]);let B=x=>{let C=[...P];if(p)for(let v=0;v<P.length;++v)v!==x&&(C[v]=!0);C[x]=!C[x],T(C)};if(!r&&b=="modal")return ye.createElement(ye.Fragment,null);let k=ye.createElement(ye.Fragment,null,ye.createElement(an,null,ye.createElement(pn,{appearance:m,className:a("checklistTitle",m),dangerouslySetInnerHTML:ae(e)}),ye.createElement(dn,{appearance:m,className:a("checklistSubtitle",m),dangerouslySetInnerHTML:ae(t)})),ye.createElement(Me,{display:"percent",count:f,total:o.length,fillColor:l,style:{margin:"14px 0px 8px 0px"},appearance:m})),g=ye.createElement(cn,{className:ge(a("checklistContainer",m),w)},o.map((x,C)=>{let v=P[C];return ye.createElement(ln,{appearance:m,stepData:x,collapsed:v,key:`modal-checklist-${x.id??C}`,onClick:()=>{if(u===C){B(C);return}c(C)},onPrimaryButtonClick:()=>{i&&i(C,x),x.handlePrimaryButtonClick&&x.handlePrimaryButtonClick(),d&&!x.completionCriteria&&C<P.length-1&&P[C+1]&&c(C+1)},onSecondaryButtonClick:()=>{x.handleSecondaryButtonClick&&x.handleSecondaryButtonClick()},customStepTypes:S})}));return b==="inline"?ye.createElement(mn,{appearance:m,className:ge(a("checklistInlineContainer",m),w)},k,g):ye.createElement(ye.Fragment,null,ye.createElement(Je,{onClose:n,visible:r,appearance:m,style:{maxWidth:"600px"},headerContent:k},g))},Jo=mp;import ne,{useEffect as Qo,useRef as Cp,useState as xt}from"react";import ht from"react";import ie,{css as fn,keyframes as gn}from"styled-components";var hn=fn`
|
|
996
996
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
997
|
-
`,
|
|
997
|
+
`,up=fn`
|
|
998
998
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
999
|
-
`,
|
|
999
|
+
`,fp=gn`
|
|
1000
1000
|
from {
|
|
1001
1001
|
opacity: 0;
|
|
1002
1002
|
} to {
|
|
1003
1003
|
opacity: 1;
|
|
1004
1004
|
}
|
|
1005
|
-
`,
|
|
1005
|
+
`,gp=gn`
|
|
1006
1006
|
from {
|
|
1007
1007
|
opacity: 1;
|
|
1008
1008
|
} to {
|
|
1009
1009
|
opacity: 0;
|
|
1010
1010
|
}
|
|
1011
|
-
`,
|
|
1011
|
+
`,xn=ie.div`
|
|
1012
1012
|
margin: 0 -20px;
|
|
1013
1013
|
overflow-x: auto;
|
|
1014
1014
|
padding-left: 20px;
|
|
@@ -1025,14 +1025,14 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1025
1025
|
::-webkit-scrollbar {
|
|
1026
1026
|
display: none;
|
|
1027
1027
|
}
|
|
1028
|
-
`,
|
|
1028
|
+
`,Cn=ie.div`
|
|
1029
1029
|
display: flex;
|
|
1030
1030
|
flex-flow: row nowrap;
|
|
1031
1031
|
gap: 0 16px;
|
|
1032
1032
|
scroll-snap-align: center;
|
|
1033
1033
|
scroll-snap-stop: always;
|
|
1034
|
-
`,
|
|
1035
|
-
animation: ${e=>e.reversed?
|
|
1034
|
+
`,Sn=ie.div`
|
|
1035
|
+
animation: ${e=>e.reversed?gp:fp} 0.25s ease-out;
|
|
1036
1036
|
background: linear-gradient(
|
|
1037
1037
|
to right,
|
|
1038
1038
|
${({theme:e})=>e.colorBackground}00,
|
|
@@ -1040,8 +1040,8 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1040
1040
|
);
|
|
1041
1041
|
position: absolute;
|
|
1042
1042
|
width: 64px;
|
|
1043
|
-
`,
|
|
1044
|
-
${
|
|
1043
|
+
`,yn=ie.button`
|
|
1044
|
+
${hn}
|
|
1045
1045
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1046
1046
|
align-items: center;
|
|
1047
1047
|
border-radius: 50%;
|
|
@@ -1052,11 +1052,11 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1052
1052
|
justify-content: center;
|
|
1053
1053
|
position: absolute;
|
|
1054
1054
|
width: 48px;
|
|
1055
|
-
`,
|
|
1055
|
+
`,bn=ie.div`
|
|
1056
1056
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1057
1057
|
padding: 20px;
|
|
1058
|
-
`,
|
|
1059
|
-
${
|
|
1058
|
+
`,wn=ie(bn)`
|
|
1059
|
+
${hn}
|
|
1060
1060
|
background: ${({theme:e})=>e.colorBackground};
|
|
1061
1061
|
|
|
1062
1062
|
&:active {
|
|
@@ -1067,94 +1067,94 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1067
1067
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1068
1068
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1069
1069
|
}
|
|
1070
|
-
`,
|
|
1070
|
+
`,Tn=ie.img`
|
|
1071
1071
|
border-radius: 50%;
|
|
1072
1072
|
height: 40px;
|
|
1073
1073
|
margin-bottom: 12px;
|
|
1074
1074
|
width: 40px;
|
|
1075
|
-
`,
|
|
1075
|
+
`,Fn=ie(bn)`
|
|
1076
1076
|
${e=>F(e)} {
|
|
1077
|
-
${
|
|
1077
|
+
${up}
|
|
1078
1078
|
|
|
1079
1079
|
background: ${({theme:e})=>e.colorBackground};
|
|
1080
1080
|
}
|
|
1081
|
-
`,
|
|
1081
|
+
`,kn=ie.div`
|
|
1082
1082
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1083
1083
|
display: flex;
|
|
1084
1084
|
flex-flow: row nowrap;
|
|
1085
1085
|
align-items: center;
|
|
1086
1086
|
margin-left: 20px;
|
|
1087
|
-
`,
|
|
1087
|
+
`,Pn=ie.div`
|
|
1088
1088
|
white-space: nowrap;
|
|
1089
|
-
`,
|
|
1089
|
+
`,vn=ie.div`
|
|
1090
1090
|
background: #d8fed8;
|
|
1091
1091
|
border-radius: 6px;
|
|
1092
1092
|
margin-bottom: 12px;
|
|
1093
1093
|
padding: 4px 10px;
|
|
1094
|
-
`,
|
|
1094
|
+
`,hp=ie.p`
|
|
1095
1095
|
font-weight: bold;
|
|
1096
1096
|
font-size: 18px;
|
|
1097
1097
|
line-height: 22px;
|
|
1098
1098
|
letter-spacing: calc(18px * -0.01);
|
|
1099
1099
|
margin: 0;
|
|
1100
|
-
`,
|
|
1100
|
+
`,En=ie(hp)`
|
|
1101
1101
|
margin-bottom: 4px;
|
|
1102
|
-
`,
|
|
1102
|
+
`,xp=ie.p`
|
|
1103
1103
|
font-weight: bold;
|
|
1104
1104
|
font-size: 16px;
|
|
1105
1105
|
line-height: 20px;
|
|
1106
1106
|
letter-spacing: calc(16px * -0.01);
|
|
1107
1107
|
margin: 0;
|
|
1108
|
-
`,
|
|
1108
|
+
`,Bn=ie(xp)`
|
|
1109
1109
|
margin-bottom: 4px;
|
|
1110
1110
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1111
1111
|
`}
|
|
1112
|
-
`,
|
|
1112
|
+
`,Ue=ie.p`
|
|
1113
1113
|
color: ${({theme:e})=>e.colorText};
|
|
1114
1114
|
font-weight: normal;
|
|
1115
1115
|
font-size: 14px;
|
|
1116
1116
|
line-height: 22px;
|
|
1117
1117
|
margin: 0;
|
|
1118
|
-
`,
|
|
1118
|
+
`,An=ie.p`
|
|
1119
1119
|
color: ${({theme:e})=>e.colorText};
|
|
1120
1120
|
font-weight: 600;
|
|
1121
1121
|
font-size: 12px;
|
|
1122
1122
|
line-height: 16px;
|
|
1123
1123
|
margin: 0;
|
|
1124
|
-
`;
|
|
1124
|
+
`;Ue.Loud=ie(Ue)`
|
|
1125
1125
|
font-weight: 600;
|
|
1126
|
-
`;
|
|
1126
|
+
`;Ue.Quiet=ie(Ue)`
|
|
1127
1127
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1128
1128
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1129
1129
|
`}
|
|
1130
|
-
`;var In=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:n}=
|
|
1130
|
+
`;var In=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:n}=J(),{primaryCTAClickSideEffects:r}=re(),{theme:i,styleOverrides:s}=n(o),{imageUri:p=null,subtitle:d=null,title:l=null,complete:u=!1,blocked:c=!1}=e,m=()=>{r(e)};return ht.createElement(wn,{className:a("carouselCard",o),onClick:c?null:m,style:t,blocked:c,complete:u},ht.createElement("div",{style:{alignItems:"flex-start",display:"flex",justifyContent:"space-between"}},p&&ht.createElement(Tn,{className:a("carouselCardImage",o),src:p,alt:l,style:{opacity:u||c?.4:1}}),u&&ht.createElement(vn,{className:a("carouselCompletedPill",o)},ht.createElement(An,{style:{color:"#108E0B"}},"Complete"))),l&&ht.createElement(Bn,{blocked:c,complete:u,className:a("carouselCardTitle",o)},l),d&&ht.createElement(Ue.Quiet,{blocked:c,complete:u,className:a("carouselCardSubtitle",o)},d))};import Jt from"react";var Nn=({numberOfStepsCompleted:e,numberOfSteps:t,appearance:o})=>{let n=t>0?e/t:0,r=200,i=Math.min(r,Math.max(10,Math.round(r*n)));return Jt.createElement(kn,{className:a("carouselProgressBar",o)},Jt.createElement(Pn,{as:Ue.Loud,style:{marginRight:8}},e," of ",t),Jt.createElement("svg",{height:10,width:r},Jt.createElement("rect",{x:0,y:0,rx:5,width:r,height:10,fill:"#E6E6E6"}),Jt.createElement("rect",{x:0,y:0,rx:5,width:i,height:10,fill:"currentColor"})))};var Sp=()=>ne.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ne.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ne.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ne.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),Ln=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[n,r]=xt(!1),[i,s]=xt(!1);Qo(()=>{t===!0&&n===!1?r(!0):t===!1&&n===!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 n?ne.createElement(Sn,{style:d,reversed:i,onAnimationEnd:i?p:null},ne.createElement(yn,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ne.createElement(Sp,null))):null},On=({flowId:e,appearance:t,customVariables:o,className:n})=>{let r=Cp(null),[i,s]=xt(!1),[p,d]=xt(!1),[l,u]=xt(null),[c,m]=xt([]),[b,w]=xt(0),{getFlowMetadata:S,getFlowSteps:f,getNumberOfStepsCompleted:P,updateCustomVariables:T,getFlowStatus:B,isLoading:k,targetingLogicShouldHideFlow:g,getFlow:x}=X();Qo(()=>{T(o)},[o,k]),Qo(()=>{if(k)return;let A=S(e),H=P(e),I=f(e);u(A),A.data!==null&&(m(I.sort((_,te)=>Number(_.complete)-Number(te.complete))),d(I.length>3),w(H))},[k]);let C=[];for(let A=0;A<c.length;A+=3)C.push(c.slice(A,A+3));let v=A=>{let H=A.target,I=H.scrollWidth-H.clientWidth,_=Math.ceil(H.scrollLeft);_>0&&i===!1&&s(!0),_===0&&i===!0&&s(!1),_<I&&p===!1&&d(!0),_===I&&p===!0&&d(!1)},M=(A=!0)=>{let H=A?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*H,behavior:"smooth"})},$=null,U=A=>{$!==null?clearTimeout($):v(A),$=setTimeout(()=>{v(A)},16)};return k?null:ne.createElement(Fn,{className:ge(a("carouselContainer",t),n)},ne.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},ne.createElement("div",null,ne.createElement(En,{className:a("carouselTitle",t)},l==null?void 0:l.title),ne.createElement(Ue.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),ne.createElement(Nn,{numberOfStepsCompleted:b,numberOfSteps:c.length})),ne.createElement("div",{style:{position:"relative"}},ne.createElement(Ln,{show:i,onClick:()=>M(!1)}),ne.createElement(Ln,{side:"right",show:p,onClick:M}),ne.createElement(xn,{ref:r,onScroll:U},C.map((A,H)=>ne.createElement(Cn,{key:H,style:{flex:`0 0 calc(100% - ${c.length>3?36:0}px)`}},A.map((I,_)=>ne.createElement(In,{key:_,stepData:I,style:{flex:c.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))))};var Zo=({flowId:e,title:t,subtitle:o,style:n,initialSelectedStep:r,className:i,type:s="inline",onDismiss:p,visible:d,customVariables:l,onStepCompletion:u,onButtonClick:c,appearance:m,hideOnFlowCompletion:b,setVisible:w,customStepTypes:S,checklistStyle:f="default",autoExpandFirstIncompleteStep:P,autoExpandNextStep:T,...B})=>{let{getFlow:k,getFlowSteps:g,markStepCompleted:x,getStepStatus:C,getNumberOfStepsCompleted:v,isLoading:M,targetingLogicShouldHideFlow:$,updateCustomVariables:U,getFlowMetadata:A,isStepBlocked:H,getFlowStatus:I,hasActiveFullPageFlow:_,setHasActiveFullPageFlow:te}=X(),{primaryCTAClickSideEffects:q,secondaryCTAClickSideEffects:W}=re(),{getOpenFlowState:be,setOpenFlowState:ce}=Fe(),[G,L]=$n(r||0),[oe,N]=$n(!1),V=d===void 0?be(e):d,we=s==="modal",{mergeAppearanceWithDefault:ve}=J(),{isLarge:St}=Qi();if(m=ve(m),Dn(()=>{U(l)},[l,M]),Dn(()=>{d!==void 0&&(we&&d===!0?te(!0):we&&d===!1&&te(!1))},[d,w,_]),M)return null;let rt=k(e);if(!rt||$(rt))return null;let Te=g(e);if(!Te||b===!0&&I(e)===Z)return null;let me=A(e);if(me!=null&&me.title&&(t=me.title),me!=null&&me.subtitle&&(o=me.subtitle),!oe&&r===void 0&&v(e)>0){let z=Math.min(v(e),Te.length-1);L(z),N(!0)}function ze(){if(G+1>=Te.length){we&&ce(e,!1);return}H(e,Te[G+1].id)||L(G+1)}function He(z,nt,eo){let nr=G+1<Te.length?Te[G+1]:null;c&&c(z,G,nt,nr)===!0&&we&&h(),u&&u(z,eo,nr),!u&&!c&&(z.primaryButtonUri||z.secondaryButtonUri)&&we&&h()}function Y(){return Te.map((z,nt)=>({...z,handleSecondaryButtonClick:()=>{ze(),W(z),z.skippable===!0&&x(e,z.id,{skipped:!0}),He(z,"secondary",nt)},handlePrimaryButtonClick:()=>{(!z.completionCriteria&&(z.autoMarkCompleted||z.autoMarkCompleted===void 0)||z.completionCriteria&&z.autoMarkCompleted===!0)&&(x(e,z.id),ze()),He(z,"primary",nt),q(z),C(e,z.id)===Ie&&ze()}}))}function fe(){return se.createElement(ee,{appearance:m})}let it={steps:Y(),title:t,subtitle:o,primaryColor:m.theme.colorPrimary,appearance:m,customStepTypes:S,type:s,className:i,autoExpandFirstIncompleteStep:P,autoExpandNextStep:T};function h(){ce(e,!1),p&&p(),w&&w(!1)}function y(){return se.createElement(se.Fragment,null,se.createElement(fe,null),se.createElement(On,{flowId:e,appearance:m,customVariables:l,className:i}))}function E(){return se.createElement(se.Fragment,null,se.createElement(fe,null),se.createElement(Jo,{visible:V,onClose:()=>{h()},selectedStep:G,setSelectedStep:L,autoExpandNextStep:!0,appearance:m,...it}))}function j(){if(!St)return E();let z=B.guideFlowId,nt;return z&&k(z)&&(nt=g(z)),se.createElement(se.Fragment,null,se.createElement(fe,null),se.createElement(Xo,{visible:V,stepsTitle:me.stepsTitle?me.stepsTitle:"Your quick start guide",onClose:()=>{h()},selectedStep:G,setSelectedStep:L,guideData:nt,guideTitle:B.guideTitle??"Guide",appearance:m,title:t,subtitle:o,onGuideButtonClick:eo=>{He(eo,"link",0)},customStepTypes:S,...it}))}function le(){if(!St)return E();let z=se.createElement(qo,{flowId:e,style:n,selectedStep:G,setSelectedStep:L,appearance:m,type:s,...it});return we?se.createElement(Je,{onClose:()=>{h()},visible:V,appearance:m,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},se.createElement(fe,null),z):se.createElement(se.Fragment,null,se.createElement(fe,null),z)}switch(f){case"condensed":return E();case"with-guide":return j();case"default":return le();case"carousel":return y();default:return le()}};var bp=e=>yp.createElement(Zo,{type:"inline",...e});import tt,{useEffect as Tp}from"react";import _e from"react";import vo from"styled-components";var Mn=vo.div`
|
|
1131
1131
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1132
1132
|
border-radius: 8px;
|
|
1133
1133
|
padding: 6px 10px 6px 10px;
|
|
1134
1134
|
min-width: 160px;
|
|
1135
1135
|
cursor: pointer;
|
|
1136
1136
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1137
|
-
|
|
1137
|
+
`,Un=vo.div`
|
|
1138
1138
|
display: flex;
|
|
1139
1139
|
flex-direction: row;
|
|
1140
1140
|
justify-content: space-between;
|
|
1141
1141
|
align-items: center;
|
|
1142
1142
|
margin-bottom: 2px;
|
|
1143
1143
|
flex-grow: 2;
|
|
1144
|
-
`,
|
|
1144
|
+
`,_n=vo.div`
|
|
1145
1145
|
text-overflow: ellipsis;
|
|
1146
1146
|
font-weight: 600;
|
|
1147
1147
|
font-size: 12px;
|
|
1148
1148
|
line-height: 15px;
|
|
1149
1149
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1150
1150
|
color: ${e=>e.appearance.theme.colorPrimary};
|
|
1151
|
-
`,
|
|
1151
|
+
`,Wn=vo.div`
|
|
1152
1152
|
width: 20px;
|
|
1153
1153
|
margin-right: 8px;
|
|
1154
1154
|
display: flex;
|
|
1155
1155
|
height: 100%;
|
|
1156
1156
|
align-items: center;
|
|
1157
|
-
`;import{motion as
|
|
1157
|
+
`;import{motion as wp}from"framer-motion";var zn=({title:e,count:t,total:o,onClick:n,style:r={},className:i,appearance:s,type:p="default"})=>_e.createElement(_e.Fragment,null,_e.createElement(ee,{appearance:s}),_e.createElement(Mn,{as:wp.div,whileHover:{opacity:.9},whileTap:{scale:.98},onClick:()=>n!==void 0&&n(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:ge(i??"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&_e.createElement(Wn,{className:a("progressRingContainer",s)},_e.createElement(Et,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),_e.createElement(Un,{type:p,className:a("badgeTitleContainer",s)},_e.createElement(_n,{type:p,appearance:s,className:a("badgeTitle",s)},e),n!==void 0&&_e.createElement(Ot,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&_e.createElement(Me,{display:"compact",count:t,total:o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import et from"react";import Qt from"styled-components";var Hn=Qt.div`
|
|
1158
1158
|
display: flex;
|
|
1159
1159
|
flex-direction: row;
|
|
1160
1160
|
width: 100%;
|
|
@@ -1165,25 +1165,25 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1165
1165
|
border-width: 1px;
|
|
1166
1166
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1167
1167
|
border-radius: 12px;
|
|
1168
|
-
`,
|
|
1168
|
+
`,jn=Qt.div`
|
|
1169
1169
|
${e=>F(e)} {
|
|
1170
1170
|
display: flex;
|
|
1171
1171
|
justify-content: center;
|
|
1172
1172
|
align-items: center;
|
|
1173
1173
|
margin-right: 16px;
|
|
1174
1174
|
}
|
|
1175
|
-
`,
|
|
1175
|
+
`,Gn=Qt.div`
|
|
1176
1176
|
display: flex;
|
|
1177
1177
|
flex-direction: column;
|
|
1178
1178
|
flex: 1;
|
|
1179
1179
|
margin-top: 0;
|
|
1180
|
-
`,
|
|
1180
|
+
`,Vn=Qt.div`
|
|
1181
1181
|
display: flex;
|
|
1182
1182
|
flex-direction: column;
|
|
1183
1183
|
justify-content: center;
|
|
1184
1184
|
margin-left: 16px;
|
|
1185
1185
|
min-width: 200px;
|
|
1186
|
-
`,
|
|
1186
|
+
`,nC=Qt.div`
|
|
1187
1187
|
display: flex;
|
|
1188
1188
|
justify-content: center;
|
|
1189
1189
|
align-items: flex-end;
|
|
@@ -1192,7 +1192,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1192
1192
|
:hover {
|
|
1193
1193
|
opacity: 0.8;
|
|
1194
1194
|
}
|
|
1195
|
-
`;var
|
|
1195
|
+
`;var Kn=({title:e,subtitle:t,icon:o,appearance:n,count:r,total:i,className:s,style:p})=>et.createElement(et.Fragment,null,et.createElement(Hn,{appearance:n,className:ge(a("fullWidthProgressBadgeContainer",n),s??""),style:p},o&&et.createElement(jn,{className:a("fullWidthProgressBadgeIcon",n)},o),et.createElement(Gn,null,et.createElement(he,{size:"small",appearance:n,title:e,subtitle:t})),et.createElement(Vn,{className:a("fullWidthProgressBadgeProgressContainer",n)},et.createElement(Me,{count:r,total:i,display:"percent",textLocation:"top",fillColor:n.theme.colorPrimary}))));var Fp=({flowId:e,title:t,subtitle:o,icon:n,style:r,onClick:i,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:l,type:u="default"})=>{let{getFlow:c,getFlowSteps:m,getFlowStatus:b,getNumberOfStepsCompleted:w,isLoading:S,targetingLogicShouldHideFlow:f,updateCustomVariables:P}=X(),{mergeAppearanceWithDefault:T}=J();l=T(l);let{setOpenFlowState:B,getOpenFlowState:k}=Fe();if(Tp(()=>{P(p)},[p,S]),S)return null;let g=c(e);if(!g||f(g)||d===!0&&b(e)===Z)return null;let x=m(e),C=w(e);return u==="full-width"?tt.createElement(tt.Fragment,null,tt.createElement(ee,{appearance:l}),tt.createElement(Kn,{title:t,subtitle:o,count:C,total:x.length,style:r,className:s,appearance:l,icon:n,onClick:()=>{}})):tt.createElement(tt.Fragment,null,tt.createElement(ee,{appearance:l}),tt.createElement(zn,{count:C,total:x.length,title:t,style:r,onClick:()=>{B(e,!0),i&&i()},type:u,className:s,appearance:l}))};import kp from"react";var Pp=({flowId:e,style:t,appearance:o,...n})=>{let{getFlow:r,targetingLogicShouldHideFlow:i,getFlowSteps:s}=X(),{mergeAppearanceWithDefault:p}=J();o=p(o);let d=r(e);if(!d||i(d))return null;let l=s(e);return kp.createElement(Xt,{steps:l,style:t,appearance:o,...n})};import Mt,{useContext as Up,useEffect as _p}from"react";import D,{useEffect as Eo,useLayoutEffect as rs,useRef as Ip,useState as Zt}from"react";import Rt from"styled-components";import{useCallback as vp,useEffect as Ep,useState as Bp}from"react";var Ro=(e,t,o,n={x:20,y:20},r)=>{let i=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+n.x+s,y:e.top-n.y+i}:t==="right"?{x:e.left+e.width+n.x+s,y:e.top-n.y+i}:{x:0,y:0}},qn={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Ap(e){let t=qn;return e&&(t=e.getBoundingClientRect()),t}function Yn(e,t){let[o,n]=Bp(qn),r=vp(()=>{e&&n(Ap(e))},[e]);return Ep(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),o}import ot from"styled-components";var Xn=ot.div`
|
|
1196
1196
|
${e=>F(e)} {
|
|
1197
1197
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
1198
1198
|
}
|
|
@@ -1203,13 +1203,13 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1203
1203
|
min-width: 300px;
|
|
1204
1204
|
padding: 22px 22px 12px;
|
|
1205
1205
|
z-index: ${e=>e.zIndex};
|
|
1206
|
-
`,
|
|
1206
|
+
`,Jn=ot.div`
|
|
1207
1207
|
display: block;
|
|
1208
1208
|
cursor: pointer;
|
|
1209
1209
|
position: absolute;
|
|
1210
1210
|
top: 25px;
|
|
1211
1211
|
right: 22px;
|
|
1212
|
-
`,
|
|
1212
|
+
`,Qn=ot.img`
|
|
1213
1213
|
${e=>F(e)} {
|
|
1214
1214
|
display: block;
|
|
1215
1215
|
width: 100%;
|
|
@@ -1218,7 +1218,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1218
1218
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
1219
1219
|
margin-bottom: 16px;
|
|
1220
1220
|
}
|
|
1221
|
-
`,
|
|
1221
|
+
`,Zn=ot.div`
|
|
1222
1222
|
${e=>F(e)} {
|
|
1223
1223
|
display: block;
|
|
1224
1224
|
width: 100%;
|
|
@@ -1227,17 +1227,17 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1227
1227
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
1228
1228
|
margin-bottom: 16px;
|
|
1229
1229
|
}
|
|
1230
|
-
`,
|
|
1230
|
+
`,Rn=ot.div`
|
|
1231
1231
|
display: flex;
|
|
1232
1232
|
flex-direction: row;
|
|
1233
1233
|
justify-content: space-between;
|
|
1234
1234
|
align-content: center;
|
|
1235
|
-
`,
|
|
1235
|
+
`,es=ot.div`
|
|
1236
1236
|
display: flex;
|
|
1237
1237
|
flex: 1;
|
|
1238
1238
|
flex-direction: column;
|
|
1239
1239
|
justify-content: center;
|
|
1240
|
-
`,
|
|
1240
|
+
`,ts=ot.div`
|
|
1241
1241
|
display: flex;
|
|
1242
1242
|
flex: 2;
|
|
1243
1243
|
flex-shrink: 1;
|
|
@@ -1249,7 +1249,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1249
1249
|
align-content: center;
|
|
1250
1250
|
align-items: center;
|
|
1251
1251
|
}
|
|
1252
|
-
`,
|
|
1252
|
+
`,os=ot.p`
|
|
1253
1253
|
${e=>F(e)} {
|
|
1254
1254
|
font-style: normal;
|
|
1255
1255
|
font-weight: 600;
|
|
@@ -1258,7 +1258,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1258
1258
|
color: #808080;
|
|
1259
1259
|
}
|
|
1260
1260
|
margin: 0;
|
|
1261
|
-
`;var
|
|
1261
|
+
`;var is=300,ns=100,Np=500,$t=12,Lp=Rt.div`
|
|
1262
1262
|
width: 100%;
|
|
1263
1263
|
height: 100%;
|
|
1264
1264
|
border-radius: 9999px;
|
|
@@ -1281,25 +1281,25 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1281
1281
|
opacity: 0;
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
|
-
`,
|
|
1285
|
-
width: ${
|
|
1286
|
-
height: ${
|
|
1284
|
+
`,Op=Rt.div`
|
|
1285
|
+
width: ${$t}px;
|
|
1286
|
+
height: ${$t}px;
|
|
1287
1287
|
border-radius: 100px;
|
|
1288
1288
|
background-color: ${e=>e.primaryColor};
|
|
1289
1289
|
z-index: 20;
|
|
1290
1290
|
opacity: 1;
|
|
1291
|
-
`,
|
|
1291
|
+
`,Dp=Rt.div`
|
|
1292
1292
|
pointer-events: all;
|
|
1293
|
-
`,
|
|
1293
|
+
`,ss=Rt.div`
|
|
1294
1294
|
display: flex;
|
|
1295
1295
|
align-content: center;
|
|
1296
1296
|
justify-content: center;
|
|
1297
1297
|
align-items: center;
|
|
1298
1298
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1299
|
-
|
|
1300
|
-
width: ${
|
|
1301
|
-
height: ${
|
|
1302
|
-
`,
|
|
1299
|
+
`,$p=Rt(ss)`
|
|
1300
|
+
width: ${$t+12}px;
|
|
1301
|
+
height: ${$t+12}px;
|
|
1302
|
+
`,Mp=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:n="auto",showHighlight:r=!0,primaryColor:i="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:u,appearance:c,dismissible:m=!1,showHighlightOnly:b,showStepCount:w=!0,completedStepsCount:S=0})=>{var Te,me,ze,He;let[f,P]=Zt(),[T,B]=Zt(new Date),k=Ip(null),[g,x]=Zt(document.querySelector(e[l].selector)),C=Yn(g,T),[v,M]=Zt(),[$,U]=Zt(!b),A=(me=(Te=e[l])==null?void 0:Te.props)!=null&&me.position?e[l].props.position:"absolute",H=((He=(ze=e[l])==null?void 0:ze.props)==null?void 0:He.zIndex)??90,I=(f==null?void 0:f.width)??is,_=(f==null?void 0:f.height)??ns;rs(()=>{k.current&&P({width:k.current.clientWidth,height:k.current.clientHeight})},[l,T,A]),Eo(()=>{b||U(!0)},[l]);let te=n==="auto"?"right":n,q=Ro(C,te,I,s,A),W=C.right+I>(window.innerWidth||document.documentElement.clientWidth),be=C.bottom+ns>(window.innerHeight||document.documentElement.clientHeight);W&&n==="auto"&&(q=Ro(C,"left",I,s,A),te="left");let ce=window.location.pathname.split("/").pop(),G=()=>{let Y=document.querySelector(e[l].selector);v&&v===JSON.stringify(Y==null?void 0:Y.getBoundingClientRect())||(x(Y),B(new Date),Y&&M(JSON.stringify(Y.getBoundingClientRect())))};if(Eo(()=>{let Y=new MutationObserver(G);return Y.observe(document.body,{subtree:!0,childList:!0}),()=>Y.disconnect()},[G]),Eo(()=>{let Y=new MutationObserver(G);return Y.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>Y.disconnect()},[G]),Eo(()=>{let Y=setInterval(()=>{G()},10);return()=>clearInterval(Y)},[G]),rs(()=>{setTimeout(()=>{G()},Np),G()},[l,ce]),g===null)return D.createElement(D.Fragment,null);if(q.x==0&&q.y==0)return D.createElement(D.Fragment,null);if(!p)return D.createElement(D.Fragment,null);let L=()=>{let Y=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),U(!1),setTimeout(()=>{G()},30)),S===e.length-1)return o()},fe=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),b&&U(!1))};return D.createElement(D.Fragment,null,w&&D.createElement(es,null,D.createElement(os,{className:a("tooltipStepCounter",c)},l+1," of ",e.length)),D.createElement(ts,{showStepCount:w,className:a("tooltipCTAContainer",c)},e[l].secondaryButtonTitle&&D.createElement(R,{title:e[l].secondaryButtonTitle,appearance:c,onClick:fe,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&D.createElement(R,{title:e[l].primaryButtonTitle,appearance:c,onClick:Y,withMargin:!1,size:"small"})))},oe=()=>D.createElement(D.Fragment,null,m&&D.createElement(Jn,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c)},D.createElement(ke,null)),e[l].imageUri&&D.createElement(Qn,{dismissible:m,appearance:c,src:e[l].imageUri,className:a("tooltipImageContainer",c)}),e[l].videoUri&&!e[l].imageUri&&D.createElement(Zn,{dismissible:m,appearance:c,className:a("tooltipVideoContainer",c)},D.createElement(Pt,{appearance:c,videoUri:e[l].videoUri})),D.createElement(he,{appearance:c,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),D.createElement(Rn,{className:a("tooltipFooter",c)},D.createElement(L,null))),V={...{default:Y=>{var fe;if((fe=e[l])!=null&&fe.StepContent){let it=e[l].StepContent;return D.createElement("div",null,it)}return D.createElement(oe,null)}},...u},we=()=>{var Y;return e?!((Y=e[l])!=null&&Y.type)||!V[e[l].type]?V.default(e[l]):V[e[l].type]({stepData:e[l],primaryColor:i}):D.createElement(D.Fragment,null)};if(b&&e[l].complete===!0)return null;let ve={top:(q==null?void 0:q.y)-$t,left:(te=="left"?C.x+s.x:(q==null?void 0:q.x)-$t)??0,cursor:b?"pointer":"default",position:A},St=()=>{let fe=ve.left+(te=="left"?-I:24);return Math.min(Math.max(fe,20),window.innerWidth-I-20)},rt=()=>{b&&(B(new Date),U(!$))};return D.createElement(Dp,null,D.createElement($p,{style:ve,zIndex:H,className:a("tourHighlightContainer",c)},r&&e[l].showHighlight!==!1&&D.createElement(D.Fragment,null,D.createElement(Op,{style:{position:A},onClick:rt,primaryColor:c.theme.colorPrimary}),D.createElement(Lp,{style:{position:"absolute"},onClick:rt,primaryColor:c.theme.colorPrimary}))),D.createElement(ss,{style:{...ve,left:St()},zIndex:H+1,className:a("tooltipContainerWrapper",c)},$&&D.createElement(Xn,{ref:k,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...d},appearance:c,className:a("tooltipContainer",c),maxWidth:is,zIndex:H+10},D.createElement(we,null))))},Bo=Mp;import{Portal as Wp}from"react-portal";var zp=({flowId:e,customVariables:t,appearance:o,onStepCompletion:n,onButtonClick:r,showTooltipsSimultaneously:i=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:u="complete-flow",onComplete:c,...m})=>{let{getFlow:b,getFlowSteps:w,isLoading:S,targetingLogicShouldHideFlow:f,markStepCompleted:P,markStepStarted:T,markFlowCompleted:B,updateCustomVariables:k,getCurrentStepIndex:g,getStepStatus:x,isStepBlocked:C,getFlowStatus:v,getNumberOfStepsCompleted:M}=X(),{isLoadingUserFlowStateData:$}=Be(),{primaryCTAClickSideEffects:U,secondaryCTAClickSideEffects:A}=re(),{hasOpenModals:H}=Fe(),I=g(e),{openFlowStates:_}=Up(K),{mergeAppearanceWithDefault:te}=J();if(o=te(o),_p(()=>{k(t)},[t,S]),$)return null;let q=b(e);if(!q||f(q)||v(e)==Z||H())return null;let W=w(e);if(Object.keys(_).length>0){let N=Object.keys(_).find(V=>_[V]===!0);if(N!==void 0&&N!==e)return Mt.createElement(Mt.Fragment,null)}async function be(N){if(await P(e,N.id),W.map(V=>x(e,V.id)).every(V=>V===Ie)){await B(e);return}if(!l&&I+1<W.length){if(C(e,W[I+1].id))return;await T(e,W[I+1].id)}}function ce(N,V,we){let ve=I+1<W.length?W[I+1]:null;r&&r(N,I,V,ve),n&&n(N,we,ve)}function G(){return W.map(N=>({...N,handleSecondaryButtonClick:async()=>{A(N),N.skippable===!0&&await P(e,N.id,{skipped:!0}),ce(N,"secondary",I)},handlePrimaryButtonClick:async()=>{(!N.completionCriteria&&(N.autoMarkCompleted||N.autoMarkCompleted===void 0)||N.completionCriteria&&N.autoMarkCompleted===!0)&&await be(N),ce(N,"primary",I),U(N)}}))}async function L(N){s&&s(),u==="complete-flow"?await B(e):await P(e,N.id)}function oe(){c&&c()}return Mt.createElement(Wp,null,Mt.createElement(ee,{appearance:o}),i?W.map((N,V)=>Mt.createElement(Bo,{key:N.id,appearance:o,steps:G(),selectedStep:V,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>L(N),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:M(e),onComplete:oe,...m})):Mt.createElement(Bo,{appearance:o,steps:G(),selectedStep:I,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>L(W[I]),tooltipPosition:d,completedStepsCount:M(e),showHighlightOnly:l,onComplete:oe,...m}))};import Ce,{useEffect as Hp,useRef as jp,useState as Gp}from"react";import{Portal as Vp}from"react-portal";import Ct from"styled-components";var ls=Ct.button`
|
|
1303
1303
|
${e=>F(e)} {
|
|
1304
1304
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1305
1305
|
|
|
@@ -1317,17 +1317,17 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1317
1317
|
opacity: 0.8;
|
|
1318
1318
|
}
|
|
1319
1319
|
}
|
|
1320
|
-
`,
|
|
1320
|
+
`,as=Ct.span`
|
|
1321
1321
|
${e=>F(e)} {
|
|
1322
1322
|
font-size: 12px;
|
|
1323
1323
|
display: inline-block;
|
|
1324
1324
|
}
|
|
1325
|
-
`,
|
|
1325
|
+
`,ps=Ct.span`
|
|
1326
1326
|
${e=>F(e)} {
|
|
1327
1327
|
font-size: 12px;
|
|
1328
1328
|
display: inline-block;
|
|
1329
1329
|
}
|
|
1330
|
-
`,
|
|
1330
|
+
`,ds=Ct.div`
|
|
1331
1331
|
position: fixed;
|
|
1332
1332
|
right: 0;
|
|
1333
1333
|
bottom: 0;
|
|
@@ -1337,7 +1337,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1337
1337
|
flex-direction: column;
|
|
1338
1338
|
align-items: flex-end;
|
|
1339
1339
|
z-index: 50;
|
|
1340
|
-
`,
|
|
1340
|
+
`,cs=Ct.button`
|
|
1341
1341
|
${e=>F(e)} {
|
|
1342
1342
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1343
1343
|
background-color: #ffffff;
|
|
@@ -1353,7 +1353,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1353
1353
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1354
1354
|
border-radius: 45px;
|
|
1355
1355
|
cursor: pointer;
|
|
1356
|
-
`,
|
|
1356
|
+
`,ms=Ct.div`
|
|
1357
1357
|
${e=>F(e)} {
|
|
1358
1358
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1359
1359
|
background: #ffffff;
|
|
@@ -1370,7 +1370,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1370
1370
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1371
1371
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1372
1372
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1373
|
-
`,
|
|
1373
|
+
`,us=Ct.button`
|
|
1374
1374
|
${e=>F(e)} {
|
|
1375
1375
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1376
1376
|
color: #434343;
|
|
@@ -1387,7 +1387,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1387
1387
|
font-size: 14px;
|
|
1388
1388
|
|
|
1389
1389
|
padding: 8px 12px;
|
|
1390
|
-
`;import{AnimatePresence as
|
|
1390
|
+
`;import{AnimatePresence as Cs,motion as Ss}from"framer-motion";import fs from"react";var gs=({style:e,className:t})=>fs.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},fs.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 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:"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 Kp=({flowId:e,style:t,onStepCompletion:o,visible:n=!0,type:r="inline",title:i="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:l,getStepStatus:u,getNumberOfStepsCompleted:c,isLoading:m,targetingLogicShouldHideFlow:b}=X(),{primaryCTAClickSideEffects:w}=re(),S=jp(null),[f,P]=Gp(!1),{mergeAppearanceWithDefault:T}=J();s=T(s),Hp(()=>(document.addEventListener("click",B,!1),()=>{document.removeEventListener("click",B,!1)}),[]);let B=v=>{S.current&&!S.current.contains(v.target)&&P(!1)};if(m)return null;let k=p(e);if(!k||b(k))return null;let g=d(e);if(!g||!n)return null;function x(v,M){!v.completionCriteria&&(v.autoMarkCompleted||v.autoMarkCompleted===void 0)&&l(e,v.id),w(v),o&&o(v,M),P(!1)}function C(){return f&&Ce.createElement(ms,{className:a("floatingWidgetMenu",s),as:Ss.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},g.map((v,M)=>Ce.createElement(us,{className:a("floatingWidgetMenuItem",s),key:M,onClick:()=>x(v,M)},v.title)))}return r=="inline"?Ce.createElement("span",{ref:S},Ce.createElement(ls,{style:t,onClick:()=>{P(!f)},className:a("supportButton",s)},Ce.createElement(ps,{className:a("supportIconContainer",s)},Ce.createElement(xs,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),Ce.createElement(as,{className:a("supportButtonTitle",s)},i)),Ce.createElement(Cs,null,Ce.createElement(C,null))):Ce.createElement(Vp,null,Ce.createElement(ds,{style:t,ref:S},Ce.createElement(Cs,null,Ce.createElement(C,null)),Ce.createElement(cs,{onClick:()=>{P(!f)},as:Ss.button,whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},Ce.createElement(gs,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import We,{useEffect as qp}from"react";import Ao from"styled-components";var ys=Ao.div`
|
|
1391
1391
|
${e=>F(e)} {
|
|
1392
1392
|
display: flex;
|
|
1393
1393
|
flex-direction: column;
|
|
@@ -1402,17 +1402,17 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1402
1402
|
border-radius: 12px;
|
|
1403
1403
|
position: relative;
|
|
1404
1404
|
}
|
|
1405
|
-
`,
|
|
1405
|
+
`,bs=Ao.div`
|
|
1406
1406
|
display: flex;
|
|
1407
1407
|
flex-direction: column;
|
|
1408
1408
|
flex: 1;
|
|
1409
|
-
`,
|
|
1409
|
+
`,ws=Ao.div`
|
|
1410
1410
|
display: flex;
|
|
1411
1411
|
flex-direction: column;
|
|
1412
1412
|
justify-content: center;
|
|
1413
1413
|
align-items: flex-start;
|
|
1414
1414
|
margin-top: 16px;
|
|
1415
|
-
`,
|
|
1415
|
+
`,Ts=Ao.div`
|
|
1416
1416
|
${e=>F(e)} {
|
|
1417
1417
|
position: absolute;
|
|
1418
1418
|
top: 16px;
|
|
@@ -1423,7 +1423,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1423
1423
|
opacity: 0.8;
|
|
1424
1424
|
}
|
|
1425
1425
|
}
|
|
1426
|
-
`;var
|
|
1426
|
+
`;var Yp=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:r,className:i,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:u,isLoading:c,targetingLogicShouldHideFlow:m,updateCustomVariables:b,getFlowSteps:w,getFlowStatus:S,getCurrentStepIndex:f}=X(),{primaryCTAClickSideEffects:P}=re(),{mergeAppearanceWithDefault:T}=J();if(r=T(r),qp(()=>{b(o)},[o,c]),c)return null;let B=d(e);if(!B||m(B)||S(e)===Z)return null;let g=w(e)[f(e)];return We.createElement(We.Fragment,null,We.createElement(ee,{appearance:r}),We.createElement(ys,{appearance:r,className:ge(a("embeddedTipContainer",r),i),style:s},(p===!0||g.dismissible)&&We.createElement(Ts,{onClick:async()=>{await l(e),t&&t()},className:a("embeddedTipDismissButton",r)},We.createElement(ke,null)),We.createElement(bs,null,We.createElement(he,{size:"small",appearance:r,title:g.title,subtitle:g.subtitle})),g.primaryButtonTitle&&We.createElement(ws,{className:a("embeddedTipCallToActionContainer",r)},We.createElement(R,{classPrefix:"embeddedTip",title:g.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"inline",onClick:async()=>{g.handlePrimaryButtonClick(),P(g),!(n&&n(g,f(e),"primary")===!1)&&(await u(e,g.id),await l(e))}}))))};import ue,{useEffect as Xp}from"react";import Ut from"styled-components";var Fs=Ut.div`
|
|
1427
1427
|
// use the :not annotation
|
|
1428
1428
|
${e=>F(e)} {
|
|
1429
1429
|
display: flex;
|
|
@@ -1437,24 +1437,24 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1437
1437
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1438
1438
|
border-radius: 12px;
|
|
1439
1439
|
}
|
|
1440
|
-
`,
|
|
1440
|
+
`,ks=Ut.div`
|
|
1441
1441
|
${e=>F(e)} {
|
|
1442
1442
|
display: flex;
|
|
1443
1443
|
width: 36px;
|
|
1444
1444
|
height: 36px;
|
|
1445
1445
|
}
|
|
1446
|
-
`,
|
|
1446
|
+
`,Ps=Ut.div`
|
|
1447
1447
|
display: flex;
|
|
1448
1448
|
flex-direction: column;
|
|
1449
1449
|
flex: 1;
|
|
1450
1450
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1451
1451
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1452
|
-
`,
|
|
1452
|
+
`,vs=Ut.div`
|
|
1453
1453
|
display: flex;
|
|
1454
1454
|
flex-direction: column;
|
|
1455
1455
|
justify-content: center;
|
|
1456
1456
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1457
|
-
`,
|
|
1457
|
+
`,er=Ut.div`
|
|
1458
1458
|
display: flex;
|
|
1459
1459
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1460
1460
|
align-items: flex-end;
|
|
@@ -1463,12 +1463,12 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1463
1463
|
:hover {
|
|
1464
1464
|
opacity: 0.8;
|
|
1465
1465
|
}
|
|
1466
|
-
`,
|
|
1466
|
+
`,tr=Ut.div`
|
|
1467
1467
|
display: flex;
|
|
1468
1468
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1469
1469
|
align-items: flex-end;
|
|
1470
1470
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1471
|
-
`;import
|
|
1471
|
+
`;import Es from"react";var Bs=({style:e,className:t})=>Es.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"},Es.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 Jp=({flowId:e,title:t,subtitle:o,onDismiss:n,customVariables:r,onButtonClick:i,appearance:s,type:p="full-width"})=>{let{getFlow:d,markFlowCompleted:l,isLoading:u,targetingLogicShouldHideFlow:c,updateCustomVariables:m,getFlowMetadata:b,getFlowStatus:w,getFlowSteps:S,getCurrentStepIndex:f}=X(),{primaryCTAClickSideEffects:P}=re(),{mergeAppearanceWithDefault:T}=J();if(s=T(s),Xp(()=>{m(r)},[r,u]),u)return null;let B=d(e);if(!B||c(B)||w(e)===Z)return null;let k=S(e),g=k.length>0?k[f(e)]:b(e);return g!=null&&g.title&&(t=g.title),g!=null&&g.subtitle&&(o=g.subtitle),ue.createElement(ue.Fragment,null,ue.createElement(ee,{appearance:s}),ue.createElement(Fs,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&ue.createElement(ks,null,ue.createElement(Bs,null)),p==="square"&&g.dismissible&&ue.createElement(tr,{type:p,className:a("bannerDismissButtonContainer",s)},ue.createElement(er,{type:p,onClick:async()=>{await l(e),n&&n()},className:a("bannerDismissButton",s)},ue.createElement(ke,null))),ue.createElement(Ps,{type:p},ue.createElement(he,{appearance:s,title:t,subtitle:o})),ue.createElement(vs,{type:p,className:a("bannerCallToActionContainer",s)},ue.createElement(R,{title:(g==null?void 0:g.primaryButtonTitle)??"Get started",appearance:s,onClick:()=>{P(g),i&&i(g,0,"primary")}})),p!=="square"&&g.dismissible&&ue.createElement(tr,{type:p,className:a("bannerDismissButtonContainer",s)},ue.createElement(er,{type:p,onClick:async()=>{await l(e),n&&n()},className:a("bannerDismissButton",s)},ue.createElement(ke,null)))))};import Q,{useEffect as Qp}from"react";import{Portal as Zp}from"react-portal";import Xe from"styled-components";var As=Xe.div`
|
|
1472
1472
|
${e=>F(e)} {
|
|
1473
1473
|
display: flex;
|
|
1474
1474
|
flex-direction: column;
|
|
@@ -1510,30 +1510,30 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1510
1510
|
display: flex;
|
|
1511
1511
|
justify-content: center;
|
|
1512
1512
|
align-items: center;
|
|
1513
|
-
`,
|
|
1513
|
+
`,or=Xe.div`
|
|
1514
1514
|
display: flex;
|
|
1515
1515
|
justify-content: flex-end;
|
|
1516
1516
|
margin-top: 24px;
|
|
1517
1517
|
gap: 8px;
|
|
1518
|
-
`,
|
|
1518
|
+
`,Ns=Xe.div`
|
|
1519
1519
|
display: flex;
|
|
1520
1520
|
justify-content: space-between;
|
|
1521
1521
|
margin-top: 24px;
|
|
1522
|
-
`,
|
|
1522
|
+
`,rr=Xe.div`
|
|
1523
1523
|
font-size: 12px;
|
|
1524
1524
|
line-height: 16px;
|
|
1525
1525
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1526
|
-
`,
|
|
1526
|
+
`,ir=Xe.div`
|
|
1527
1527
|
display: flex;
|
|
1528
1528
|
flex-direction: column;
|
|
1529
1529
|
flex: 1;
|
|
1530
|
-
`,
|
|
1530
|
+
`,xy=Xe.div`
|
|
1531
1531
|
display: flex;
|
|
1532
1532
|
flex-direction: column;
|
|
1533
1533
|
justify-content: center;
|
|
1534
1534
|
align-items: flex-start;
|
|
1535
1535
|
margin-top: 16px;
|
|
1536
|
-
`,
|
|
1536
|
+
`,Ls=Xe.textarea`
|
|
1537
1537
|
${e=>F(e)} {
|
|
1538
1538
|
margin-top: 16px;
|
|
1539
1539
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
@@ -1544,7 +1544,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1544
1544
|
width: 100%;
|
|
1545
1545
|
height: 100px;
|
|
1546
1546
|
}
|
|
1547
|
-
`,
|
|
1547
|
+
`,Os=Xe.div`
|
|
1548
1548
|
${e=>F(e)} {
|
|
1549
1549
|
position: absolute;
|
|
1550
1550
|
top: 16px;
|
|
@@ -1555,5 +1555,5 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Ut}${r}.${Ut}${r} { ${Object.entries(i).map
|
|
|
1555
1555
|
opacity: 0.8;
|
|
1556
1556
|
}
|
|
1557
1557
|
}
|
|
1558
|
-
`;var
|
|
1558
|
+
`;var Rp=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:r,className:i,style:s})=>{let{getFlow:p,markFlowCompleted:d,markStepCompleted:l,getNumberOfStepsCompleted:u,isLoading:c,targetingLogicShouldHideFlow:m,updateCustomVariables:b,getFlowSteps:w,getFlowStatus:S,getCurrentStepIndex:f}=X(),{primaryCTAClickSideEffects:P}=re(),{mergeAppearanceWithDefault:T}=J(),[B,k]=Q.useState(null),[g,x]=Q.useState(""),{hasOpenModals:C,setKeepCompletedFlowOpenDuringSession:v,shouldKeepCompletedFlowOpenDuringSession:M}=Fe();if(r=T(r),Qp(()=>{b(o)},[o,c]),c)return null;let $=p(e);if(!$||m($)||S(e)===Z||u(e)===1&&!M(e)||C())return null;let A=w(e)[f(e)];function H(){return Q.createElement(Q.Fragment,null,Q.createElement(ir,null,Q.createElement(he,{size:"large",appearance:r,title:A.title,subtitle:A.subtitle})),Q.createElement(or,{className:a("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(_=>Q.createElement(Is,{className:a("npsNumberButton",r),selected:B===_+1,key:_,onClick:async()=>{v(e),k(_+1),await l(e,A.id,{score:_+1})},appearance:r},_+1))),Q.createElement(Ns,{appearance:r},Q.createElement(rr,{appearance:r},"Not likely at all"),Q.createElement(rr,{appearance:r},"Extremely likely")))}function I(){return Q.createElement(Q.Fragment,null,Q.createElement(ir,null,Q.createElement(he,{appearance:r,title:"Why did you choose this score?",size:"large"})),Q.createElement(Ls,{appearance:r,value:g,onChange:_=>{x(_.target.value)},placeHolder:"Add your optional fedback here..."}),Q.createElement(or,{appearance:r,className:a("npsNumberButtonContainer",r)},Q.createElement(R,{size:"large",withMargin:!1,onClick:async()=>{await d(e),n&&n(A,1,"primary")},appearance:r,title:A.secondaryButtonTitle||"Skip",secondary:!0}),Q.createElement(R,{size:"large",withMargin:!1,onClick:async()=>{await l(e,A.id,{feedbackText:g}),await d(e),n&&n(A,1,"primary")},appearance:r,title:A.primaryButtonTitle||"Submit"})))}return Q.createElement(Zp,null,Q.createElement(ee,{appearance:r}),Q.createElement(As,{appearance:r,className:ge(a("npsSurveyContainer",r),i),style:s},Q.createElement(Os,{onClick:async()=>{await d(e),t&&t()},className:a("npsSurveyDismissButton",r)},Q.createElement(ke,null)),u(e)==0&&H(),u(e)==1&&I()))};export{dt as CheckBox,Ze as FormLabel,Jp as FrigadeBanner,Zo as FrigadeChecklist,Yp as FrigadeEmbeddedTip,Rr as FrigadeForm,Pp as FrigadeGuide,bp as FrigadeHeroChecklist,Rp as FrigadeNPSSurvey,Fp as FrigadeProgressBadge,Ta as FrigadeProvider,Kp as FrigadeSupportWidget,zp as FrigadeTour,Et as ProgressRing,Fe as useFlowOpens,_t as useFlowResponses,X as useFlows,Ho as useOrganization,No as useUser};
|
|
1559
1559
|
//# sourceMappingURL=index.mjs.map
|