@frigade/react 1.32.82 → 1.32.84
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 +5 -0
- package/lib/index.js +199 -200
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +223 -224
- package/lib/index.mjs.map +1 -1
- package/package.json +2 -2
package/lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import{ThemeProvider as Wa}from"styled-components";import gt,{useContext as Ua,useEffect as To,useState as tr}from"react";import{useCallback as mt,useContext as ll,useEffect as al}from"react";import Do,{useMemo as yr}from"react";var Sr="1.32.82 ";var Ee="NOT_STARTED_STEP",J="COMPLETED_FLOW",so="ABORTED_FLOW",ct="STARTED_FLOW",Ne="NOT_STARTED_FLOW",Le="COMPLETED_STEP",lo="STARTED_STEP";function Me(){let{publicApiKey:e,userId:t,apiUrl:o}=Do.useContext(K);return{config:yr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Sr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:yr(()=>`${o}/v1/public/`,[o])}}var Xs="frigade-last-call-at-",Qs="frigade-last-call-data-";function wt(){let{shouldGracefullyDegrade:e}=Do.useContext(K);return async(t,o)=>{if(e)return console.log(`Skipping ${t} call to Frigade due to error`),zt();let n=Xs+t,r=Qs+t;if(window&&window.localStorage&&o&&o.body&&o.method==="POST"){let s=window.localStorage.getItem(n),p=window.localStorage.getItem(r);if(s&&p&&p==o.body){let d=new Date(s);if(new Date().getTime()-d.getTime()<1e3)return zt()}window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,o.body)}let i;try{i=await fetch(t,o)}catch(s){return zt(s)}return i?i.ok?i:zt(i.statusText):zt()}}function zt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Tt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Do.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 il,useState as br}from"react";import{useContext as Rs,useEffect as el,useState as tl}from"react";import ol from"swr";import{useContext as Zs}from"react";function Fe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:n,completedFlowsToKeepOpenDuringSession:r}=Zs(K);function i(c,f=!1){return e[c]??f}function s(c,f){t(C=>({...C,[c]:f}))}function p(c){t(f=>{let{[c]:C,...k}=f;return{...k}})}function d(c){r.includes(c)||n(f=>[...f,c])}function a(c){return r.includes(c)}function x(c){return Object.entries(e).some(([f,C])=>C&&f!=c)||o}return{getOpenFlowState:i,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:x,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:a}}var rl="unknown";function Ae(){let{config:e,apiUrl:t}=Me(),{publicApiKey:o,userId:n,organizationId:r,flows:i,setShouldGracefullyDegrade:s}=Rs(K),{resetOpenFlowState:p}=Fe(),[d,a]=tl(!1),x={data:i.map(m=>({flowId:m.id,flowState:J,lastStepId:null,userId:n,foreignUserId:n,stepStates:{},shouldTrigger:!1}))},c=m=>fetch(m,e).then(h=>{if(h.ok)return h.json();throw new Error("Failed to fetch user flow states")}).catch(h=>(console.log(`Error fetching ${m}: ${h}. Will gracefully degrade and hide Frigade`),s(!0),x)),{data:f,isLoading:C,mutate:k,error:E}=ol(o&&i&&n?`${t}userFlowStates?foreignUserId=${encodeURIComponent(n)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,c,{revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>x,onLoadingSlow:()=>x}),u=f==null?void 0:f.data;el(()=>{!d&&!C&&u&&a(!0)},[u,d,C]);async function b(m){if(u){let h=u.find(w=>w.flowId===m);h&&h.flowState!==J&&(h.flowState=J),await k(Promise.resolve({...f,data:u}),{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1})}}async function v(m,h,w){if(u){let N=u.find(U=>U.flowId===m);N&&(N.stepStates[h]=w,N.flowState=ct),await k(Promise.resolve({...f,data:u}),{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1})}}async function P(m,h,w){if(u){let N=u.find(U=>U.flowId===m);N&&(N.lastStepId=h,N.stepStates[h]=w,N.flowState=ct),await k({...f,data:u},{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1})}}async function T(m){if(u){let h=u.find(w=>w.flowId===m);h&&h.flowState!==Ne&&(h.flowState=Ne,h.lastStepId=rl,Object.keys(h.stepStates).forEach(w=>{h.stepStates[w].actionType=Ee,h.stepStates[w].createdAt=new Date().toISOString()}),await k({...f,data:u},{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1}),p(m))}}async function S(m,h){if(u){let w=u.find(N=>N.flowId===m);w&&w.stepStates[h]!==Ee&&(w.stepStates[h]=Ee),await k({...f,data:u},{optimisticData:{...f,data:u},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:u,isLoadingUserFlowStateData:!d,mutateUserFlowState:k,optimisticallyMarkFlowCompleted:b,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:v,optimisticallyMarkStepNotStarted:S,optimisticallyMarkStepStarted:P,error:E}}function Wt(){let{config:e,apiUrl:t}=Me(),{userFlowStatesData:o,mutateUserFlowState:n}=Ae(),{failedFlowResponses:r,setFailedFlowResponses:i,flowResponses:s,setFlowResponses:p}=il(K),[d,a]=br(new Set),[x,c]=br(new Set),f=wt();function C(u){let b=JSON.stringify(u);if(d.has(b))return null;d.add(b),a(d),x.add(u),c(x);let v=s==null?void 0:s.find(P=>P.flowSlug===u.flowSlug&&P.stepId===u.stepId&&P.actionType===u.actionType&&P.createdAt===u.createdAt);return f(`${t}flowResponses`,{...e,method:"POST",body:b}).then(P=>{P.status!==200&&P.status!==201?(console.log("Failed to send flow response for step "+u.stepId+". Will retry again later."),i([...r,u])):v||p(T=>[...T??[],u])})}async function k(u){u.foreignUserId&&(u.actionType===ct||u.actionType===Ne?await C(u):u.actionType===J?await C(u):u.actionType===lo?await C(u):u.actionType===Le?await C(u):u.actionType===so?await C(u):u.actionType===Ee&&await C(u))}function E(){let u=[];return o==null||o.forEach(b=>{if(b&&b.stepStates&&Object.keys(b.stepStates).length!==0)for(let v in b.stepStates){let P=b.stepStates[v];u.push({foreignUserId:b.foreignUserId,flowSlug:b.flowId,stepId:P.stepId,actionType:P.actionType,data:{},createdAt:new Date(P.createdAt),blocked:P.blocked,hidden:P.hidden})}}),[...u,...s]}return{addResponse:k,setFlowResponses:p,getFlowResponses:E}}import pl from"swr";var nl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,wr=e=>{let t=nl.exec(e);if(t===null)return null;let o=null;return t.forEach((n,r)=>{let i=sl(n,"'","");i.startsWith("flow_")&&(o=i)}),o},sl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function X(){let{config:e,apiUrl:t}=Me(),{flows:o,setFlows:n,userId:r,publicApiKey:i,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:a,setFlowResponses:x,setShouldGracefullyDegrade:c}=ll(K),f={data:[]},{verifySDKInitiated:C}=Tt(),{addResponse:k,getFlowResponses:E}=Wt(),u=g=>fetch(g,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${g} (${y.status}): ${y.statusText}. .Will gracefully degrade and hide Frigade`),c(!0),f)).catch(y=>(console.log(`Error fetching ${g}: ${y}. Will gracefully degrade and hide Frigade`),c(!0),f)),{userFlowStatesData:b,isLoadingUserFlowStateData:v,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:S,optimisticallyMarkStepNotStarted:m,optimisticallyMarkStepStarted:h}=Ae(),{data:w,error:N,isLoading:U}=pl(i?`${t}flows`:null,u,{keepPreviousData:!0});al(()=>{if(N){console.error(N);return}w&&w.data&&(w.data=n(w.data))},[w,N]);function W(g){if(U)return null;let y=o.find(B=>B.slug===g);return!y&&o.length>0&&!v&&!U?(console.log(`Flow with slug ${g} not found`),null):(y==null?void 0:y.active)===!1?null:y}function A(g){var z;if(!W(g))return[];let y=W(g).data;return y?(y=_(y),(((z=JSON.parse(y))==null?void 0:z.data)??[]).map(L=>{let Be=Z(L);return{handleSecondaryButtonClick:()=>{L.skippable===!0&&Y(g,L.id,{skipped:!0})},...L,complete:Q(g,L.id)===Le||Be>=1,blocked:ge(g,L.id),hidden:M(g,L.id),handlePrimaryButtonClick:()=>{(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&Y(g,L.id)},progress:Be}}).filter(L=>L.hidden!==!0)):[]}function _(g){return g.replaceAll(/\${(.*?)}/g,(y,B)=>s[B]===void 0?"":String(s[B]).replace(/[\u00A0-\u9999<>\&]/g,function(z){return"&#"+z.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function j(g){if(!W(g))return[];let y=W(g).data;return y?(y=_(y),JSON.parse(y)??{}):[]}function I(g,y){p(B=>({...B,[g]:y}))}function ie(g){!v&&!U&&g&&JSON.stringify(s)!=JSON.stringify({...s,...g})&&Object.keys(g).forEach(y=>{I(y,g[y])})}let fe=mt(async(g,y,B)=>{C();let z={foreignUserId:r,flowSlug:g,stepId:y,actionType:lo,data:B??{},createdAt:new Date,blocked:!1,hidden:!1};ae(z)&&(await h(g,y,z),k(z))},[r,b]),H=mt(async(g,y,B)=>{C();let z={foreignUserId:r,flowSlug:g,stepId:y,actionType:Ee,data:B??{},createdAt:new Date,blocked:!1,hidden:!1};ae(z)&&(await m(g,y),k(z))},[r,b]),Y=mt(async(g,y,B)=>{C();let z={foreignUserId:r,flowSlug:g,stepId:y,actionType:Le,data:B??{},createdAt:new Date,blocked:!1,hidden:!1};ae(z)&&(await S(g,y,z),k(z))},[r,b]),ve=mt(async(g,y)=>{if(C(),$e(g)===Ne)return;let B={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:Ne,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};await T(g),ae(B)&&k(B)},[r,b]),te=mt(async(g,y)=>{C();let B={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:ct,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};ae(B)&&k(B)},[r,b]),q=mt(async(g,y)=>{C();let B={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:J,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};ae(B)&&(await P(g),k(B))},[r,b]),he=mt(async(g,y)=>{C();let B={foreignUserId:r,flowSlug:g,stepId:"unknown",actionType:so,data:y??{},createdAt:new Date,blocked:!1,hidden:!1};ae(B)&&(await P(g),k(B))},[r,b]);function ae(g){var y;if(!b&&g.actionType===Ee)return!1;if(b){let B=b.find(z=>z.flowId===g.flowSlug);if(g.actionType===Ee&&(!(B!=null&&B.stepStates[g.stepId])||B.stepStates[g.stepId].actionType===Ee)||B&&((y=B.stepStates[g.stepId])==null?void 0:y.actionType)===g.actionType||B&&B.flowState===J&&g.actionType===J)return!1}return!0}function Q(g,y){let B=O(g,y);return v?null:B?B.actionType:Ee}function ge(g,y){let B=O(g,y);return B?B.blocked:!1}function M(g,y){let B=O(g,y);return B?B.hidden:!1}function O(g,y){if(v)return null;let B=b==null?void 0:b.find(z=>z.flowId===g);return!B||!B.stepStates[y]?null:B.stepStates[y]??null}function ne(g){var B;if(v||!b)return null;if($e(g)===Ne)return A(g)[0]??null;let y=(B=b.find(z=>z.flowId===g))==null?void 0:B.lastStepId;return y?A(g).find(z=>z.id===y):null}function G(g){let y=ne(g);if(!y)return 0;let B=A(g).findIndex(z=>z.id===y.id)??0;return Q(g,y.id)===Le&&B<A(g).length-1?B+1:B}function Z(g){if(!g.completionCriteria)return;let y=wr(g.completionCriteria);if(y===null)return;let B=je(y),z=dt(y);return z===0?void 0:B/z}function $e(g){let y=b==null?void 0:b.find(B=>B.flowId===g);return y?y.flowState:null}function je(g){let y=A(g);return y.length===0?0:y.filter(z=>Q(g,z.id)===Le).length}function dt(g){return A(g).length}function V(g){return JSON.parse(o.find(y=>y.slug===g).data)}function Te(g){if(v)return!0;if(g!=null&&g.targetingLogic&&b){let y=b.find(B=>B.flowId===g.slug);if(y)return y.shouldTrigger===!1}return!!(g!=null&&g.targetingLogic&&r&&r.startsWith("guest_"))}function Ge(g){return!Te(W(g))}return{getFlow:W,getFlowData:V,isLoading:v||U,getStepStatus:Q,getFlowSteps:A,getCurrentStepIndex:G,markStepStarted:fe,markStepCompleted:Y,markFlowNotStarted:ve,markFlowStarted:te,markFlowCompleted:q,markFlowAborted:he,markStepNotStarted:H,getFlowStatus:$e,getNumberOfStepsCompleted:je,getNumberOfSteps:dt,targetingLogicShouldHideFlow:Te,setCustomVariable:I,updateCustomVariables:ie,customVariables:s,getStepOptionalProgress:Z,getFlowMetadata:j,isStepBlocked:ge,isStepHidden:M,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:a,isFlowAvailableToUser:Ge}}import{useCallback as Tr,useContext as dl,useEffect as cl}from"react";var Ft="guest_";function Ht(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:n,shouldGracefullyDegrade:r}=dl(K),{config:i,apiUrl:s}=Me(),{mutateUserFlowState:p}=Ae(),d=wt(),{verifySDKInitiated:a}=Tt();cl(()=>{if(e&&!t){if(e.startsWith(Ft))return;let f=`frigade-user-registered-${e}`;localStorage.getItem(f)||(d(`${s}users`,{...i,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(f,"true"))}},[e,r,t]);let x=Tr(async f=>{a();let C={foreignId:e,properties:f};await d(`${s}users`,{...i,method:"POST",body:JSON.stringify(C)}),n(k=>({...k,...f})),p()},[e,i,r,p]),c=Tr(async(f,C)=>{a();let E={foreignId:e,events:[{event:f,properties:C}]};await d(`${s}users`,{...i,method:"POST",body:JSON.stringify(E)}),p()},[e,i,p]);return{userId:e,setUserId:o,addPropertiesToUser:x,trackEventForUser:c}}import{v4 as _a}from"uuid";import _e,{useEffect as Oa,useState as Da}from"react";import Oe,{useEffect as Cl}from"react";import co from"styled-components";import ml from"react";import ul from"styled-components";var Fr="fr-",Vt="cfr-";function l(e,t){let o=`${Fr}${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+" "+Vt+e}return o}function F(e){if(!e.className||e.className.indexOf(Vt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Fr)?"":`:not(${o.map(n=>`.${n}`).join(", ")})`}function $o(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function qe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${$o(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function jt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var fl=ul.div`
|
|
2
|
+
import ht,{createContext as Wa,useEffect as To,useState as Ae}from"react";import{ThemeProvider as Ha}from"styled-components";import gt,{useContext as _a,useEffect as wo,useState as tr}from"react";import{useCallback as mt,useContext as ll,useEffect as al}from"react";import Do,{useMemo as Sr}from"react";var Cr="1.32.84 ";var Ee="NOT_STARTED_STEP",X="COMPLETED_FLOW",no="ABORTED_FLOW",ct="STARTED_FLOW",Ie="NOT_STARTED_FLOW",Ne="COMPLETED_STEP",so="STARTED_STEP";function Me(){let{publicApiKey:e,userId:t,apiUrl:o}=Do.useContext(G);return{config:Sr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Cr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:Sr(()=>`${o}/v1/public/`,[o])}}var Xs="frigade-last-call-at-",Qs="frigade-last-call-data-";function Tt(){let{shouldGracefullyDegrade:e,readonly:t}=Do.useContext(G);return async(o,n)=>{if(t&&(n.method==="POST"||n.method==="PUT"||n.method==="DELETE"))return wt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),wt();let r=Xs+o,i=Qs+o;if(window&&window.localStorage&&n&&n.body&&n.method==="POST"){let p=window.localStorage.getItem(r),d=window.localStorage.getItem(i);if(p&&d&&d==n.body){let a=new Date(p);if(new Date().getTime()-a.getTime()<1e3)return wt()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(i,n.body)}let s;try{s=await fetch(o,n)}catch(p){return wt(p)}return s?s.ok?s:wt(s.statusText):wt()}}function wt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ft(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Do.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 il,useState as yr}from"react";import{useContext as Rs,useEffect as el,useState as tl}from"react";import ol from"swr";import{useContext as Zs}from"react";function Fe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:n,completedFlowsToKeepOpenDuringSession:r}=Zs(G);function i(c,h=!1){return e[c]??h}function s(c,h){t(f=>({...f,[c]:h}))}function p(c){t(h=>{let{[c]:f,...v}=h;return{...v}})}function d(c){r.includes(c)||n(h=>[...h,c])}function a(c){return r.includes(c)}function S(c){return Object.entries(e).some(([h,f])=>f&&h!=c)||o}return{getOpenFlowState:i,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:S,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:a}}var rl="unknown";function Be(){let{config:e,apiUrl:t}=Me(),{publicApiKey:o,userId:n,organizationId:r,flows:i,setShouldGracefullyDegrade:s,readonly:p}=Rs(G),{resetOpenFlowState:d}=Fe(),[a,S]=tl(!1),c={data:i.map(x=>({flowId:x.id,flowState:X,lastStepId:null,userId:n,foreignUserId:n,stepStates:{},shouldTrigger:!1}))},h=x=>fetch(x,e).then(g=>{if(g.ok)return g.json();throw new Error("Failed to fetch user flow states")}).catch(g=>(console.log(`Error fetching ${x}: ${g}. Will gracefully degrade and hide Frigade`),s(!0),c)),{data:f,isLoading:v,mutate:F,error:C}=ol(o&&i&&n?`${t}userFlowStates?foreignUserId=${encodeURIComponent(n)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,h,{revalidateOnFocus:p!==!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),y=f==null?void 0:f.data;el(()=>{!a&&!v&&y&&S(!0)},[y,a,v]);async function T(x){if(y&&!p){let g=y.find(I=>I.flowId===x);g&&g.flowState!==X&&(g.flowState=X),await F(Promise.resolve({...f,data:y}),{optimisticData:{...f,data:y},revalidate:!1,rollbackOnError:!1})}}async function k(x,g,I){if(y){let D=y.find(z=>z.flowId===x);D&&(D.stepStates[g]=I,D.flowState=ct),await F(Promise.resolve({...f,data:y}),{optimisticData:{...f,data:y},revalidate:!1,rollbackOnError:!1})}}async function A(x,g,I){if(y){let D=y.find(z=>z.flowId===x);D&&(D.lastStepId=g,D.stepStates[g]=I,D.flowState=ct),await F({...f,data:y},{optimisticData:{...f,data:y},revalidate:!1,rollbackOnError:!1})}}async function b(x){if(y){let g=y.find(I=>I.flowId===x);g&&g.flowState!==Ie&&(g.flowState=Ie,g.lastStepId=rl,Object.keys(g.stepStates).forEach(I=>{g.stepStates[I].actionType=Ee,g.stepStates[I].createdAt=new Date().toISOString()}),await F({...f,data:y},{optimisticData:{...f,data:y},revalidate:!1,rollbackOnError:!1}),d(x))}}async function m(x,g){if(y){let I=y.find(D=>D.flowId===x);I&&I.stepStates[g]!==Ee&&(I.stepStates[g]=Ee),await F({...f,data:y},{optimisticData:{...f,data:y},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:y,isLoadingUserFlowStateData:!a,mutateUserFlowState:F,optimisticallyMarkFlowCompleted:T,optimisticallyMarkFlowNotStarted:b,optimisticallyMarkStepCompleted:k,optimisticallyMarkStepNotStarted:m,optimisticallyMarkStepStarted:A,error:C}}function Wt(){let{config:e,apiUrl:t}=Me(),{userFlowStatesData:o,mutateUserFlowState:n}=Be(),{failedFlowResponses:r,setFailedFlowResponses:i,flowResponses:s,setFlowResponses:p}=il(G),[d,a]=yr(new Set),[S,c]=yr(new Set),h=Tt();function f(C){let y=JSON.stringify(C);if(d.has(y))return null;d.add(y),a(d),S.add(C),c(S);let T=s==null?void 0:s.find(k=>k.flowSlug===C.flowSlug&&k.stepId===C.stepId&&k.actionType===C.actionType&&k.createdAt===C.createdAt);return h(`${t}flowResponses`,{...e,method:"POST",body:y}).then(k=>{k.status!==200&&k.status!==201?(console.log("Failed to send flow response for step "+C.stepId+". Will retry again later."),i([...r,C])):T||p(A=>[...A??[],C])})}async function v(C){C.foreignUserId&&(C.actionType===ct||C.actionType===Ie?await f(C):C.actionType===X?await f(C):C.actionType===so?await f(C):C.actionType===Ne?await f(C):C.actionType===no?await f(C):C.actionType===Ee&&await f(C))}function F(){let C=[];return o==null||o.forEach(y=>{if(y&&y.stepStates&&Object.keys(y.stepStates).length!==0)for(let T in y.stepStates){let k=y.stepStates[T];C.push({foreignUserId:y.foreignUserId,flowSlug:y.flowId,stepId:k.stepId,actionType:k.actionType,data:{},createdAt:new Date(k.createdAt),blocked:k.blocked,hidden:k.hidden})}}),[...C,...s]}return{addResponse:v,setFlowResponses:p,getFlowResponses:F}}import pl from"swr";var nl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,br=e=>{let t=nl.exec(e);if(t===null)return null;let o=null;return t.forEach((n,r)=>{let i=sl(n,"'","");i.startsWith("flow_")&&(o=i)}),o},sl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Q(){let{config:e,apiUrl:t}=Me(),{flows:o,setFlows:n,userId:r,publicApiKey:i,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:a,setFlowResponses:S,setShouldGracefullyDegrade:c,readonly:h}=ll(G),f={data:[]},{verifySDKInitiated:v}=Ft(),{addResponse:F,getFlowResponses:C}=Wt(),y=u=>fetch(u,e).then(w=>w.ok?w.json():(console.log(`Error fetching ${u} (${w.status}): ${w.statusText}. .Will gracefully degrade and hide Frigade`),c(!0),f)).catch(w=>(console.log(`Error fetching ${u}: ${w}. Will gracefully degrade and hide Frigade`),c(!0),f)),{userFlowStatesData:T,isLoadingUserFlowStateData:k,optimisticallyMarkFlowCompleted:A,optimisticallyMarkFlowNotStarted:b,optimisticallyMarkStepCompleted:m,optimisticallyMarkStepNotStarted:x,optimisticallyMarkStepStarted:g}=Be(),{data:I,error:D,isLoading:z}=pl(i?`${t}flows${h?"?readonly=true":""}`:null,y,{keepPreviousData:!0});al(()=>{if(D){console.error(D);return}I&&I.data&&n(I.data)},[I,D]);function N(u){if(z)return null;let w=o.find(E=>E.slug===u);return!w&&o.length>0&&!k&&!z?(console.log(`Flow with slug ${u} not found`),null):(w==null?void 0:w.active)===!1?null:w}function M(u){var B;if(!N(u))return[];let w=N(u).data;return w?(w=H(w),(((B=JSON.parse(w))==null?void 0:B.data)??[]).map(J=>{let dt=je(J);return{handleSecondaryButtonClick:()=>{J.skippable===!0&&ge(u,J.id,{skipped:!0})},...J,complete:ae(u,J.id)===Ne||dt>=1,blocked:_(u,J.id),hidden:O(u,J.id),handlePrimaryButtonClick:()=>{(!J.completionCriteria&&(J.autoMarkCompleted||J.autoMarkCompleted===void 0)||J.completionCriteria&&J.autoMarkCompleted===!0)&&ge(u,J.id)},progress:dt}}).filter(J=>J.hidden!==!0)):[]}function H(u){return u.replaceAll(/\${(.*?)}/g,(w,E)=>s[E]===void 0?"":String(s[E]).replace(/[\u00A0-\u9999<>\&]/g,function(B){return"&#"+B.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function L(u){if(!N(u))return[];let w=N(u).data;return w?(w=H(w),JSON.parse(w)??{}):[]}function ne(u,w){p(E=>({...E,[u]:w}))}function fe(u){!k&&!z&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(w=>{ne(w,u[w])})}let Y=mt(async(u,w,E)=>{v();let B={foreignUserId:r,flowSlug:u,stepId:w,actionType:so,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};K(B)&&(await g(u,w,B),F(B))},[r,T]),V=mt(async(u,w,E)=>{v();let B={foreignUserId:r,flowSlug:u,stepId:w,actionType:Ee,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};K(B)&&(await x(u,w),F(B))},[r,T]),ge=mt(async(u,w,E)=>{v();let B={foreignUserId:r,flowSlug:u,stepId:w,actionType:Ne,data:E??{},createdAt:new Date,blocked:!1,hidden:!1};K(B)&&(await m(u,w,B),F(B))},[r,T]),ee=mt(async(u,w)=>{if(v(),De(u)===Ie)return;let E={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Ie,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};await b(u),K(E)&&F(E)},[r,T]),q=mt(async(u,w)=>{v();let E={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:ct,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};K(E)&&F(E)},[r,T]),he=mt(async(u,w)=>{v();let E={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:X,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};K(E)&&(await A(u),F(E))},[r,T]),Te=mt(async(u,w)=>{v();let E={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:no,data:w??{},createdAt:new Date,blocked:!1,hidden:!1};K(E)&&(await A(u),F(E))},[r,T]);function K(u){var w;if(!T&&u.actionType===Ee)return!1;if(T){let E=T.find(B=>B.flowId===u.flowSlug);if(u.actionType===Ee&&(!(E!=null&&E.stepStates[u.stepId])||E.stepStates[u.stepId].actionType===Ee)||E&&((w=E.stepStates[u.stepId])==null?void 0:w.actionType)===u.actionType||E&&E.flowState===X&&u.actionType===X)return!1}return!0}function ae(u,w){let E=te(u,w);return k?null:E?E.actionType:Ee}function _(u,w){let E=te(u,w);return E?E.blocked:!1}function O(u,w){let E=te(u,w);return E?E.hidden:!1}function te(u,w){if(k)return null;let E=T==null?void 0:T.find(B=>B.flowId===u);return!E||!E.stepStates[w]?null:E.stepStates[w]??null}function j(u){var E;if(k||!T)return null;if(De(u)===Ie)return M(u)[0]??null;let w=(E=T.find(B=>B.flowId===u))==null?void 0:E.lastStepId;return w?M(u).find(B=>B.id===w):null}function oe(u){let w=j(u);if(!w)return 0;let E=M(u).findIndex(B=>B.id===w.id)??0;return ae(u,w.id)===Ne&&E<M(u).length-1?E+1:E}function je(u){if(!u.completionCriteria)return;let w=br(u.completionCriteria);if(w===null)return;let E=pt(w),B=W(w);return B===0?void 0:E/B}function De(u){let w=T==null?void 0:T.find(E=>E.flowId===u);return w?w.flowState:null}function pt(u){let w=M(u);return w.length===0?0:w.filter(B=>ae(u,B.id)===Ne).length}function W(u){return M(u).length}function ve(u){return JSON.parse(o.find(w=>w.slug===u).data)}function $e(u){if(h)return!1;if(k)return!0;if(u!=null&&u.targetingLogic&&T){let w=T.find(E=>E.flowId===u.slug);if(w)return w.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function Oo(u){return!$e(N(u))}return{getFlow:N,getFlowData:ve,isLoading:k||z,getStepStatus:ae,getFlowSteps:M,getCurrentStepIndex:oe,markStepStarted:Y,markStepCompleted:ge,markFlowNotStarted:ee,markFlowStarted:q,markFlowCompleted:he,markFlowAborted:Te,markStepNotStarted:V,getFlowStatus:De,getNumberOfStepsCompleted:pt,getNumberOfSteps:W,targetingLogicShouldHideFlow:$e,setCustomVariable:ne,updateCustomVariables:fe,customVariables:s,getStepOptionalProgress:je,getFlowMetadata:L,isStepBlocked:_,isStepHidden:O,hasActiveFullPageFlow:d,setHasActiveFullPageFlow:a,isFlowAvailableToUser:Oo}}import{useCallback as wr,useContext as dl,useEffect as cl}from"react";var kt="guest_";function Ht(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:n,shouldGracefullyDegrade:r}=dl(G),{config:i,apiUrl:s}=Me(),{mutateUserFlowState:p}=Be(),d=Tt(),{verifySDKInitiated:a}=Ft();cl(()=>{if(e&&!t){if(e.startsWith(kt))return;let h=`frigade-user-registered-${e}`;localStorage.getItem(h)||(d(`${s}users`,{...i,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(h,"true"))}},[e,r,t]);let S=wr(async h=>{a();let f={foreignId:e,properties:h};await d(`${s}users`,{...i,method:"POST",body:JSON.stringify(f)}),n(v=>({...v,...h})),p()},[e,i,r,p]),c=wr(async(h,f)=>{a();let F={foreignId:e,events:[{event:h,properties:f}]};await d(`${s}users`,{...i,method:"POST",body:JSON.stringify(F)}),p()},[e,i,p]);return{userId:e,setUserId:o,addPropertiesToUser:S,trackEventForUser:c}}import{v4 as za}from"uuid";import _e,{useEffect as Da,useState as $a}from"react";import Le,{useEffect as Cl}from"react";import po from"styled-components";import ml from"react";import ul from"styled-components";var Tr="fr-",Vt="cfr-";function l(e,t){let o=`${Tr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Vt+e}return o}function P(e){if(!e.className||e.className.indexOf(Vt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Tr)?"":`:not(${o.map(n=>`.${n}`).join(", ")})`}function $o(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Ge(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${$o(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Ce(...e){return e.filter(Boolean).join(" ")}function jt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var fl=ul.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -7,7 +7,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
7
7
|
left: 0;
|
|
8
8
|
bottom: 0;
|
|
9
9
|
right: 0;
|
|
10
|
-
${e=>
|
|
10
|
+
${e=>P(e)} {
|
|
11
11
|
background-color: rgba(0, 0, 0, 0.6);
|
|
12
12
|
z-index: 1400;
|
|
13
13
|
}
|
|
@@ -23,12 +23,12 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,Fr=({onClose:e,appearance:t})=>ml.createElement(fl,{className:l("modalBackground",t),onClick:()=>e()});import Mo from"react";import gl from"styled-components";var hl=gl.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,ke=()=>Mo.createElement(hl,null,Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Mo.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Sl}from"react-portal";import
|
|
31
|
-
${e=>
|
|
30
|
+
`,ke=()=>Mo.createElement(hl,null,Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Mo.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Sl}from"react-portal";import $r from"react";import Uo from"react";function xl({style:e,className:t}){return Uo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Uo.createElement("path",{fill:"currentColor",d:"M16.293 3.476v1.036h1.593v1.256h-1.593v5.098h-1.41V5.768H14V4.512h.883V3.244c0-.67.294-1.744 1.777-1.744.515 0 .969.049 1.361.146l-.233 1.232a5.939 5.939 0 00-.833-.073c-.442 0-.662.22-.662.67zm6.534.975V5.83c-.846 0-1.63.159-2.342.476v4.56h-1.41V4.513h1.263l.086.61c.846-.451 1.655-.67 2.403-.67zm2.505-.951c-.331.33-.944.33-1.287 0a.93.93 0 01-.246-.659c0-.268.086-.487.246-.646.343-.33.956-.33 1.287 0 .343.33.343.964 0 1.305zm.061 7.366h-1.41V4.512h1.41v6.354zm6.928-5.756c.246.146.368.402.368.756v4.976c0 1.804-.858 2.658-2.672 2.658-.92 0-1.753-.146-2.514-.439l.417-1.073c.674.22 1.336.33 1.974.33.98 0 1.385-.379 1.385-1.403v-.171c-.588.134-1.09.207-1.52.207-.907 0-1.655-.305-2.231-.902-.576-.598-.87-1.39-.87-2.354 0-.963.294-1.756.87-2.354.576-.61 1.324-.914 2.231-.914 1.005 0 1.864.232 2.562.683zm-2.488 4.634a5.15 5.15 0 001.446-.22V5.951a3.695 3.695 0 00-1.446-.292c-1.08 0-1.778.841-1.778 2.048 0 1.22.699 2.037 1.778 2.037zm7.34-5.317c1.52 0 2.28.878 2.28 2.634v3.805h-1.275l-.073-.524c-.601.414-1.288.621-2.084.621-1.263 0-2.06-.658-2.06-1.731 0-1.269 1.25-2.025 3.408-2.025.135 0 .503.013.662.013v-.171c0-1.012-.343-1.451-1.115-1.451-.675 0-1.435.158-2.256.475l-.466-1.012c1.017-.427 2.01-.634 2.979-.634zm-1.839 4.756c0 .427.343.695 1.017.695.528 0 1.251-.22 1.68-.512V8.22h-.441c-1.508 0-2.256.317-2.256.963zm9.953-4.549v-2.83h1.41v7.72c0 .354-.123.598-.368.757-.71.45-1.57.67-2.562.67-.907 0-1.655-.305-2.231-.902-.577-.61-.87-1.39-.87-2.354 0-.963.293-1.756.87-2.354.576-.61 1.324-.914 2.23-.914.43 0 .933.073 1.521.207zM43.84 9.72c.503 0 .981-.098 1.447-.293V5.854a5.15 5.15 0 00-1.447-.22c-1.078 0-1.777.817-1.777 2.037s.699 2.049 1.777 2.049zM54 7.866v.439h-4.573c.184.963.858 1.512 1.827 1.512.613 0 1.275-.146 1.986-.451l.466 1.024c-.87.378-1.729.573-2.575.573-.931 0-1.692-.304-2.268-.902-.576-.61-.87-1.402-.87-2.366 0-.975.294-1.768.87-2.366.576-.597 1.324-.902 2.244-.902.968 0 1.691.33 2.17.975.478.647.723 1.464.723 2.464zm-4.61-.586h3.298c-.086-1.073-.613-1.731-1.581-1.731-.969 0-1.582.695-1.717 1.731z"}),Uo.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.196 1.229A4.009 4.009 0 014.08 0l4.092.027C9.183.027 10 .867 10 1.904c0 .6-.273 1.133-.7 1.478-.31.25-.7.399-1.126.4h-.001l-4.09-.027h-.002a4.804 4.804 0 00-2.614.77A4.986 4.986 0 000 5.974v-1.78C0 3.036.456 1.988 1.196 1.23zm4.525 4.65a4.282 4.282 0 00-1.184 2.513l3.637.023c.131 0 .259-.015.382-.042h.002c.81-.178 1.42-.908 1.44-1.788v-.046a1.9 1.9 0 00-.533-1.328 1.813 1.813 0 00-.908-.508h-.002l-.002-.001a1.68 1.68 0 00-.366-.042A4.084 4.084 0 005.72 5.88zm-4.525-.016A4.235 4.235 0 000 8.829C0 10.997 1.601 12.78 3.654 13V9.265h-.005l.005-.439v-.437h.023a5.175 5.175 0 011.439-3.13 5.05 5.05 0 01.72-.614l-1.754-.011H4.08c-.787 0-1.521.229-2.144.625a4.11 4.11 0 00-.74.603z",clipRule:"evenodd"}))}var kr=xl;import _o from"styled-components";import et from"styled-components";var lo=et.div`
|
|
31
|
+
${e=>P(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -38,14 +38,14 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
38
38
|
min-width: 300px;
|
|
39
39
|
padding: 22px 22px 12px;
|
|
40
40
|
z-index: ${e=>e.zIndex};
|
|
41
|
-
`,
|
|
41
|
+
`,Pr=et.div`
|
|
42
42
|
display: block;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
45
45
|
top: 12px;
|
|
46
46
|
right: 12px;
|
|
47
|
-
`,
|
|
48
|
-
${e=>
|
|
47
|
+
`,vr=et.img`
|
|
48
|
+
${e=>P(e)} {
|
|
49
49
|
display: block;
|
|
50
50
|
width: 100%;
|
|
51
51
|
height: auto;
|
|
@@ -53,8 +53,8 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
53
53
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
54
54
|
margin-bottom: 16px;
|
|
55
55
|
}
|
|
56
|
-
`,Er=
|
|
57
|
-
${e=>
|
|
56
|
+
`,Er=et.div`
|
|
57
|
+
${e=>P(e)} {
|
|
58
58
|
display: block;
|
|
59
59
|
width: 100%;
|
|
60
60
|
height: auto;
|
|
@@ -62,30 +62,30 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
62
62
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
63
63
|
margin-bottom: 16px;
|
|
64
64
|
}
|
|
65
|
-
`,
|
|
65
|
+
`,Br=et.div`
|
|
66
66
|
display: flex;
|
|
67
67
|
flex-direction: row;
|
|
68
68
|
justify-content: space-between;
|
|
69
69
|
align-content: center;
|
|
70
|
-
`,
|
|
70
|
+
`,Ar=et.div`
|
|
71
71
|
display: flex;
|
|
72
72
|
flex: 1;
|
|
73
73
|
flex-direction: column;
|
|
74
74
|
justify-content: center;
|
|
75
|
-
`,
|
|
75
|
+
`,Ir=et.div`
|
|
76
76
|
display: flex;
|
|
77
77
|
flex: 2;
|
|
78
78
|
flex-shrink: 1;
|
|
79
79
|
gap: 8px;
|
|
80
80
|
height: 64px;
|
|
81
|
-
${e=>
|
|
81
|
+
${e=>P(e)} {
|
|
82
82
|
flex-direction: row;
|
|
83
83
|
justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
|
|
84
84
|
align-content: center;
|
|
85
85
|
align-items: center;
|
|
86
86
|
}
|
|
87
|
-
`,
|
|
88
|
-
${e=>
|
|
87
|
+
`,Nr=et.p`
|
|
88
|
+
${e=>P(e)} {
|
|
89
89
|
font-style: normal;
|
|
90
90
|
font-weight: 600;
|
|
91
91
|
font-size: 15px;
|
|
@@ -93,7 +93,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
93
93
|
color: #808080;
|
|
94
94
|
}
|
|
95
95
|
margin: 0;
|
|
96
|
-
`;var
|
|
96
|
+
`;var Lr=_o.div`
|
|
97
97
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
98
98
|
position: absolute;
|
|
99
99
|
bottom: -47px;
|
|
@@ -104,7 +104,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
104
104
|
align-items: center;
|
|
105
105
|
justify-content: center;
|
|
106
106
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
107
|
-
`,
|
|
107
|
+
`,Or=_o(lo)`
|
|
108
108
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
109
109
|
position: absolute;
|
|
110
110
|
bottom: -60px;
|
|
@@ -117,7 +117,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
117
117
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
118
118
|
padding: 0;
|
|
119
119
|
z-index: ${e=>e.zIndex};
|
|
120
|
-
|
|
120
|
+
`,Dr=_o.div`
|
|
121
121
|
display: flex;
|
|
122
122
|
justify-content: center;
|
|
123
123
|
align-items: center;
|
|
@@ -126,8 +126,8 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
126
126
|
font-size: 12px;
|
|
127
127
|
line-height: 18px;
|
|
128
128
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
129
|
-
`;function
|
|
130
|
-
${e=>
|
|
129
|
+
`;function ao({appearance:e}){return $r.createElement(Dr,{className:l("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",$r.createElement(kr,null))}var yl=po.div`
|
|
130
|
+
${e=>P(e)} {
|
|
131
131
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
132
132
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
133
133
|
/* Mobile */
|
|
@@ -141,7 +141,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
141
141
|
width: ${e=>e.width??"1000px"};
|
|
142
142
|
z-index: 1500;
|
|
143
143
|
border-radius: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)??8}}px;
|
|
144
|
-
${e=>
|
|
144
|
+
${e=>Ge(e)}
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
padding: 32px;
|
|
@@ -168,28 +168,28 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
168
168
|
opacity: 1;
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
`,bl=
|
|
171
|
+
`,bl=po.div`
|
|
172
172
|
position: relative;
|
|
173
173
|
flex: 0 1 auto;
|
|
174
|
-
`,wl=
|
|
174
|
+
`,wl=po.div`
|
|
175
175
|
position: absolute;
|
|
176
176
|
top: 24px;
|
|
177
177
|
right: 24px;
|
|
178
178
|
cursor: pointer;
|
|
179
179
|
z-index: 1501;
|
|
180
|
-
${e=>
|
|
180
|
+
${e=>P(e)} {
|
|
181
181
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
182
182
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
183
183
|
}
|
|
184
|
-
`,Tl=
|
|
184
|
+
`,Tl=po.div`
|
|
185
185
|
overflow: scroll;
|
|
186
186
|
flex: 1 1;
|
|
187
187
|
display: flex;
|
|
188
188
|
::-webkit-scrollbar {
|
|
189
189
|
display: none;
|
|
190
190
|
}
|
|
191
|
-
`,
|
|
192
|
-
${e=>
|
|
191
|
+
`,tt=({onClose:e,visible:t,headerContent:o=null,style:n=null,children:r,appearance:i,dismissible:s=!0,showFrigadeBranding:p=!1})=>(Cl(()=>{let d=a=>{a.key==="Escape"&&e()};return document.addEventListener("keydown",d),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",d)}},[e,t]),t?Le.createElement(Sl,null,Le.createElement(Fr,{appearance:i,onClose:()=>{s&&e()}}),Le.createElement(yl,{appearance:i,className:l("modalContainer",i),styleOverrides:n},s&&Le.createElement(wl,{className:l("modalClose",i),onClick:()=>e(),appearance:i},Le.createElement(ke,null)),o&&Le.createElement(bl,null,o),Le.createElement(Tl,null,r),p&&Le.createElement(Lr,{appearance:i,className:l("poweredByFrigadeRibbon",i)},Le.createElement(ao,{appearance:i})))):Le.createElement(Le.Fragment,null));import ot,{useEffect as Fl}from"react";import co from"styled-components";import{Portal as kl}from"react-portal";var Pl=co.div`
|
|
192
|
+
${e=>P(e)} {
|
|
193
193
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
194
194
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
195
195
|
position: fixed;
|
|
@@ -206,41 +206,41 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
206
206
|
bottom: 0;
|
|
207
207
|
margin-right: 28px;
|
|
208
208
|
margin-bottom: 28px;
|
|
209
|
-
`,vl=
|
|
209
|
+
`,vl=co.div`
|
|
210
210
|
position: relative;
|
|
211
211
|
flex: 1;
|
|
212
|
-
`,
|
|
212
|
+
`,El=co.div`
|
|
213
213
|
position: absolute;
|
|
214
214
|
top: 24px;
|
|
215
215
|
right: 24px;
|
|
216
216
|
cursor: pointer;
|
|
217
217
|
z-index: 1501;
|
|
218
|
-
${e=>
|
|
218
|
+
${e=>P(e)} {
|
|
219
219
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
220
220
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
221
221
|
}
|
|
222
|
-
`,
|
|
222
|
+
`,Bl=co.div`
|
|
223
223
|
overflow: scroll;
|
|
224
224
|
flex: 5;
|
|
225
225
|
::-webkit-scrollbar {
|
|
226
226
|
display: none;
|
|
227
227
|
}
|
|
228
|
-
`,
|
|
229
|
-
${e=>
|
|
228
|
+
`,Mr=({onClose:e,visible:t,headerContent:o=null,children:n,appearance:r})=>(Fl(()=>{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?ot.createElement(kl,null,ot.createElement(Pl,{appearance:r,className:l("cornerModalContainer",r)},ot.createElement(El,{className:l("cornerModalClose",r),onClick:()=>e()},ot.createElement(ke,null)),o&&ot.createElement(vl,null,o),ot.createElement(Bl,null,n))):ot.createElement(ot.Fragment,null));import{useContext as Al}from"react";function Z(){let{defaultAppearance:e}=Al(G);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 it,{useContext as ea,useEffect as ta,useState as Yo}from"react";import ho from"styled-components";import fo,{useEffect as Il,useState as Vr}from"react";import Ho from"styled-components";import mo from"styled-components";var Ur=mo.label`
|
|
229
|
+
${e=>P(e)} {
|
|
230
230
|
font-size: 14px;
|
|
231
231
|
line-height: 20px;
|
|
232
232
|
margin-bottom: 5px;
|
|
233
233
|
margin-top: 10px;
|
|
234
234
|
}
|
|
235
235
|
display: flex;
|
|
236
|
-
`,
|
|
237
|
-
${e=>
|
|
236
|
+
`,_r=mo.label`
|
|
237
|
+
${e=>P(e)} {
|
|
238
238
|
font-size: 12px;
|
|
239
239
|
line-height: 20px;
|
|
240
240
|
margin-bottom: 5px;
|
|
241
241
|
}
|
|
242
242
|
display: flex;
|
|
243
|
-
`,
|
|
243
|
+
`,zr=mo.span`
|
|
244
244
|
font-weight: 400;
|
|
245
245
|
font-size: 14px;
|
|
246
246
|
line-height: 22px;
|
|
@@ -248,17 +248,17 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
248
248
|
display: flex;
|
|
249
249
|
margin-right: 5px;
|
|
250
250
|
margin-top: 10px;
|
|
251
|
-
`,
|
|
251
|
+
`,uo=mo.div`
|
|
252
252
|
display: flex;
|
|
253
253
|
align-items: flex-start;
|
|
254
254
|
justify-content: left;
|
|
255
255
|
margin-bottom: 10px;
|
|
256
|
-
`;import zo from"react";var
|
|
256
|
+
`;import zo from"react";var qe={theme:{colorPrimary:"#000000",colorText:"#000000",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#505050",colorTextDisabled:"#C7C7C7",colorBorder:"#E5E5E5",colorTextError:"#c00000",borderRadius:20}};function rt({title:e,required:t,appearance:o=qe}){return e?zo.createElement(uo,null,t?zo.createElement(zr,{className:l("formLabelRequired",o),appearance:o},"*"):null,zo.createElement(Ur,{className:l("formLabel",o)},e)):null}import Wr from"react";function Pt({title:e,appearance:t}){return e?Wr.createElement(uo,null,Wr.createElement(_r,{className:l("formSubLabel",t)},e)):null}import{z as Wo}from"zod";function Hr(e,t){try{if(t){if(t.type=="number"){let o=Wo.number();if(t.props)for(let n of t.props)n.requirement=="min"?o=o.min(Number(n.value),n.message??"Value is too small"):n.requirement=="max"?o=o.max(Number(n.value),n.message??"Value is too large"):n.requirement=="positive"?o=o.positive(n.message??"Value must be positive"):n.requirement=="negative"&&(o=o.nonpositive(n.message??"Value must be negative"));o.parse(Number(e))}if(t.type=="string"){let o=Wo.string();if(t.props)for(let n of t.props)n.requirement=="min"?o=o.min(Number(n.value),n.message??"Value is too short"):n.requirement=="max"?o=o.max(Number(n.value),n.message??"Value is too long"):n.requirement=="regex"&&(o=o.regex(new RegExp(String(n.value)),n.message??"Value does not match requirements"));o.parse(e)}return}}catch(o){if(o instanceof Wo.ZodError)return o.issues&&o.issues.length>0?o.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,o)}return null}var Nl=Ho.div`
|
|
257
257
|
display: flex;
|
|
258
258
|
flex-direction: column;
|
|
259
259
|
width: 100%;
|
|
260
260
|
`,Vo=Ho.input`
|
|
261
|
-
${e=>
|
|
261
|
+
${e=>P(e)} {
|
|
262
262
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
263
263
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
264
264
|
font-size: 14px;
|
|
@@ -274,7 +274,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
274
274
|
padding: 0 10px;
|
|
275
275
|
margin-bottom: 10px;
|
|
276
276
|
`,Ll=Ho.textarea`
|
|
277
|
-
${e=>
|
|
277
|
+
${e=>P(e)} {
|
|
278
278
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
279
279
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
280
280
|
font-size: 14px;
|
|
@@ -289,14 +289,14 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
289
289
|
min-height: 70px;
|
|
290
290
|
box-sizing: border-box;
|
|
291
291
|
margin-bottom: 10px;
|
|
292
|
-
`;function jo({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:n,inputData:r}){let i=e,[s,p]=
|
|
292
|
+
`;function jo({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:n,inputData:r}){let i=e,[s,p]=Vr((r==null?void 0:r.text)||""),[d,a]=Vr(!1),S=Vo;Il(()=>{s===""&&!d&&(a(!0),c(""))},[]);function c(f){if(p(f),o({text:f}),i.required===!0&&f.trim()===""){n([{id:i.id,message:`${i.title??"Field"} is required`}]);return}let v=Hr(f,i.validation);if(v){n([{id:i.id,message:v}]);return}n([])}i.multiline&&(S=Ll);function h(){var f;switch((f=i==null?void 0:i.validation)==null?void 0:f.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return fo.createElement(Nl,null,fo.createElement(rt,{title:i.title,required:i.required,appearance:t.appearance}),fo.createElement(S,{className:l("inputComponent",t.appearance),value:s,onChange:f=>{c(f.target.value)},appearance:t.appearance,placeholder:i.placeholder,type:h()}),fo.createElement(Pt,{title:i.subtitle,appearance:t.appearance}))}import Ue,{useEffect as jr,useState as Gr}from"react";import qr from"styled-components";var Go="",Ol=qr.div`
|
|
293
293
|
display: flex;
|
|
294
294
|
flex-direction: column;
|
|
295
295
|
width: 100%;
|
|
296
296
|
-webkit-appearance: none;
|
|
297
297
|
appearance: none;
|
|
298
|
-
`,Dl=
|
|
299
|
-
${e=>
|
|
298
|
+
`,Dl=qr.select`
|
|
299
|
+
${e=>P(e)} {
|
|
300
300
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
301
301
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
302
302
|
font-size: 14px;
|
|
@@ -316,16 +316,16 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
316
316
|
background-repeat: no-repeat;
|
|
317
317
|
background-size: 1.5em 1.5em;
|
|
318
318
|
-webkit-print-color-adjust: exact;
|
|
319
|
-
`;function
|
|
320
|
-
${e=>
|
|
321
|
-
`,
|
|
319
|
+
`;function Kr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:r}){var S,c,h,f,v,F;let i=e,[s,p]=Gr(((S=n==null?void 0:n.choice)==null?void 0:S[0])||""),[d,a]=Gr(!1);return jr(()=>{var C,y,T,k;if(s===""&&!d){if(a(!0),i.requireSelection){p(Go);return}if(i.defaultValue&&((C=i.props.options)!=null&&C.find(A=>A.id===i.defaultValue))){let A=(y=i.props.options)==null?void 0:y.find(b=>b.id===i.defaultValue);p(A.id),o({choice:[A.id]})}else p(((T=i.props.options)==null?void 0:T[0].id)||""),o({choice:[((k=i.props.options)==null?void 0:k[0].id)||""]})}},[]),jr(()=>{i.requireSelection&&s===Go?r([{message:"Please select an option",id:i.id}]):r([])},[s]),Ue.createElement(Ol,null,Ue.createElement(rt,{title:i.title,required:!1,appearance:t.appearance}),Ue.createElement(Dl,{value:s,onChange:C=>{p(C.target.value),o({choice:[C.target.value]})},placeholder:i.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},i.requireSelection&&Ue.createElement("option",{key:"null-value",value:Go,disabled:!0},i.placeholder??"Select an option"),(c=i.props.options)==null?void 0:c.map(C=>Ue.createElement("option",{key:C.id,value:C.id},C.title))),((f=(h=i.props.options)==null?void 0:h.find(C=>C.id===s))==null?void 0:f.isOpenEnded)&&Ue.createElement(Ue.Fragment,null,Ue.createElement(rt,{title:((F=(v=i.props.options)==null?void 0:v.find(C=>C.id===s))==null?void 0:F.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),Ue.createElement(Vo,{type:"text",placeholder:"Enter your answer here",onChange:C=>{o({choice:[C.target.value]})},appearance:t.appearance})),Ue.createElement(Pt,{title:i.subtitle,appearance:t.appearance}))}import Kt,{useEffect as qo,useState as Jr}from"react";import Xr from"styled-components";import qt from"react";import Gt from"react";import{motion as $l}from"framer-motion";var Yr=({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 Gt.createElement($l.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"})},Ml=({fillColor:e,size:t,percentage:o,children:n,bgColor:r="#D9D9D9",className:i,style:s})=>Gt.createElement("svg",{style:s,className:i,width:t,height:t,overflow:"visible"},Gt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Gt.createElement(Yr,{color:r,size:t}),Gt.createElement(Yr,{color:e,percentage:o,size:t})),n),vt=Ml;import Ul from"styled-components";var _l=({color:e="#FFFFFF"})=>qt.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},qt.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),zl={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},Wl={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},Hl={border:"1px solid #000000",color:"#FFFFFF"},Vl={border:"1px solid #E6E6E6"},jl={color:"#FFFFFF"},Gl={border:"3px solid #D9D9D9"},ql=e=>e==="square"?zl:Wl,Kl=(e,t)=>e==="square"?t?Hl:Vl:t?jl:Gl,Yl=Ul.div`
|
|
320
|
+
${e=>Ge(e)}
|
|
321
|
+
`,Ke=({value:e,type:t="square",primaryColor:o="#000000",progress:n,appearance:r=qe,style:i,className:s})=>{let p=ql(t),d=Kl(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?qt.createElement(vt,{fillColor:o,percentage:n,size:22}):qt.createElement(Yl,{styleOverrides:p,style:i,role:"checkbox",className:Ce(l("checkIconContainer",r),l(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&qt.createElement(_l,{color:"#FFFFFF"}))};var Jl=Xr.div`
|
|
322
322
|
display: flex;
|
|
323
323
|
flex-direction: column;
|
|
324
324
|
width: 100%;
|
|
325
325
|
-webkit-appearance: none;
|
|
326
326
|
appearance: none;
|
|
327
|
-
`,Xl=
|
|
328
|
-
${e=>
|
|
327
|
+
`,Xl=Xr.button`
|
|
328
|
+
${e=>P(e)} {
|
|
329
329
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
330
330
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
331
331
|
font-size: 14px;
|
|
@@ -349,8 +349,8 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
349
349
|
height: 60px;
|
|
350
350
|
padding: 0 18px;
|
|
351
351
|
margin-bottom: 10px;
|
|
352
|
-
`;function
|
|
353
|
-
${e=>
|
|
352
|
+
`;function Qr({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:r}){var S;let i=e,[s,p]=Jr((n==null?void 0:n.choice)||[]),[d,a]=Jr(!1);return qo(()=>{s.length==0&&!d&&(a(!0),o({choice:[]}))},[]),qo(()=>{o({choice:s})},[s]),qo(()=>{i.required&&(s.length<i.props.minChoices||s.length>i.props.maxChoices)?r([{message:"",id:i.id}]):r([])},[s]),Kt.createElement(Jl,null,Kt.createElement(rt,{title:i.title,required:i.required,appearance:t.appearance}),(S=i.props.options)==null?void 0:S.map(c=>Kt.createElement(Xl,{appearance:t.appearance,className:l("multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":s.includes(c.id),onClick:()=>{if(s.includes(c.id)){p(s.filter(h=>h!==c.id));return}s.length<i.props.maxChoices?p([...s,c.id]):s.length==1&&i.props.maxChoices==1&&p([c.id])}},c.title,Kt.createElement(Ke,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),Kt.createElement(Pt,{title:i.subtitle,appearance:t.appearance}))}import go from"react";import Zr from"styled-components";import Ql from"dompurify";function ce(e){return{__html:Ql.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var Zl=Zr.h1`
|
|
353
|
+
${e=>P(e)} {
|
|
354
354
|
font-style: normal;
|
|
355
355
|
font-weight: 600;
|
|
356
356
|
font-size: ${e=>e.size=="small"?"15px":"18px"};
|
|
@@ -360,48 +360,48 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
360
360
|
margin-bottom: 4px;
|
|
361
361
|
color: ${e=>e.appearance.theme.colorText};
|
|
362
362
|
}
|
|
363
|
-
`,Rl=
|
|
364
|
-
${e=>
|
|
363
|
+
`,Rl=Zr.h2`
|
|
364
|
+
${e=>P(e)} {
|
|
365
365
|
font-style: normal;
|
|
366
366
|
font-weight: 400;
|
|
367
367
|
font-size: 15px;
|
|
368
368
|
line-height: 20px;
|
|
369
369
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
370
370
|
}
|
|
371
|
-
`;function Se({appearance:e,title:t,subtitle:o,size:n="medium",classPrefix:r=""}){return
|
|
371
|
+
`;function Se({appearance:e,title:t,subtitle:o,size:n="medium",classPrefix:r=""}){return go.createElement(go.Fragment,null,go.createElement(Zl,{appearance:e,className:l(`${r}${r?jt(n):n}Title`,e),dangerouslySetInnerHTML:ce(t),size:n}),o&&go.createElement(Rl,{appearance:e,className:l(`${r}${r?jt(n):n}Subtitle`,e),dangerouslySetInnerHTML:ce(o),size:n}))}import*as Ko from"react";var Rr=e=>Ko.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},Ko.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));import{AnimatePresence as oa,motion as ra}from"framer-motion";var ia=ho.div`
|
|
372
372
|
display: flex;
|
|
373
373
|
flex-direction: column;
|
|
374
374
|
justify-content: flex-end;
|
|
375
375
|
padding-bottom: 14px;
|
|
376
376
|
overflow: visible;
|
|
377
|
-
`,
|
|
377
|
+
`,na=ho(ra.div)`
|
|
378
378
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
379
379
|
font-size: 12px;
|
|
380
380
|
margin-bottom: 12px;
|
|
381
381
|
display: flex;
|
|
382
382
|
align-items: center;
|
|
383
|
-
`,
|
|
383
|
+
`,sa=ho.div`
|
|
384
384
|
margin-right: 4px;
|
|
385
385
|
display: inline-flex;
|
|
386
|
-
`,
|
|
386
|
+
`,la=ho.div`
|
|
387
387
|
padding-left: 1px;
|
|
388
388
|
padding-right: 1px;
|
|
389
|
-
`,
|
|
389
|
+
`,aa={text:jo,multipleChoice:Kr,multipleChoiceList:Qr};function ei({flowId:e,stepData:t,canContinue:o,setCanContinue:n,onSaveData:r,appearance:i,customFormElements:s}){var A;let p=t.props,[d,a]=Yo([]),[S,c]=Yo([]),{userId:h}=Ht(),[f,v]=Yo(T()||{}),{readonly:F}=ea(G),C={...aa,...s};ta(()=>{n(d.length===0)},[d,n]);function y(b,m){let x={...f,[b.id]:m};v(x),r(x),window&&window.localStorage&&!F&&window.localStorage.setItem(k(),JSON.stringify(x))}function T(){if(window&&window.localStorage){let b=window.localStorage.getItem(k());if(b)return JSON.parse(b)}return{}}function k(){return`frigade-multiInputStepTypeData-${e}-${t.id}-${h}`}return it.createElement(la,{className:l("multiInput",i)},it.createElement(Se,{appearance:i,title:t.title,subtitle:t.subtitle}),it.createElement(ia,{className:l("multiInputContainer",i)},(A=p.data)==null?void 0:A.map(b=>{var x;let m=(x=d.reverse().find(g=>g.id===b.id))==null?void 0:x.message;return C[b.type]?it.createElement("span",{key:b.id,"data-field-id":b.id,className:l("multiInputField",i)},C[b.type]({formInput:b,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:n,onSaveData:r,appearance:i},onSaveInputData:g=>{!S.includes(b.id)&&g&&(g==null?void 0:g.text)!==""&&c(I=>[...I,b.id]),y(b,g)},inputData:f[b.id],setFormValidationErrors:g=>{a(I=>g.length===0?I.filter(D=>D.id!==b.id):[...I,...g])}}),it.createElement(oa,null,m&&S.includes(b.id)&&it.createElement(na,{initial:{opacity:0,height:0,marginBottom:0},animate:{opacity:1,height:"auto",marginBottom:12},exit:{opacity:0,height:0,marginBottom:0},key:b.id,style:{overflow:"hidden"},transition:{duration:.1,ease:"easeInOut",delay:.5},appearance:i,className:l("multiInputValidationError",i)},it.createElement(sa,{appearance:i,className:l("multiInputValidationErrorIcon",i)},it.createElement(Rr,null)),m))):null})))}import ut from"styled-components";var ti=ut.div`
|
|
390
390
|
align-items: center;
|
|
391
391
|
display: flex;
|
|
392
392
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
393
393
|
padding-top: 14px;
|
|
394
|
-
`,
|
|
394
|
+
`,oi=ut.div`
|
|
395
395
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
396
396
|
font-size: 12px;
|
|
397
|
-
`,
|
|
397
|
+
`,ri=ut.div`
|
|
398
398
|
display: flex;
|
|
399
399
|
gap: 12px;
|
|
400
|
-
`,
|
|
400
|
+
`,ii=ut.div`
|
|
401
401
|
display: flex;
|
|
402
402
|
flex-direction: row;
|
|
403
403
|
flex: 1 1;
|
|
404
|
-
`,
|
|
404
|
+
`,ni=ut.div`
|
|
405
405
|
display: flex;
|
|
406
406
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
407
407
|
// Otherwise, use 4px padding
|
|
@@ -409,11 +409,11 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
409
409
|
flex-grow: 1;
|
|
410
410
|
flex-basis: 0;
|
|
411
411
|
position: relative;
|
|
412
|
-
`,
|
|
412
|
+
`,si=ut.div`
|
|
413
413
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
414
414
|
position: relative;
|
|
415
415
|
overflow-y: auto;
|
|
416
|
-
`,
|
|
416
|
+
`,li=ut.div`
|
|
417
417
|
display: flex;
|
|
418
418
|
align-self: stretch;
|
|
419
419
|
flex-grow: 1;
|
|
@@ -425,10 +425,10 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
425
425
|
background-position: center;
|
|
426
426
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
427
427
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
428
|
-
`;import
|
|
428
|
+
`;import nt from"react";import pa from"react";import ai from"styled-components";var da=ai.button`
|
|
429
429
|
justify-content: center;
|
|
430
430
|
align-content: center;
|
|
431
|
-
${e=>
|
|
431
|
+
${e=>P(e)} {
|
|
432
432
|
display: flex;
|
|
433
433
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
434
434
|
width: ${e=>e.type==="full-width"?"100%":"auto"};
|
|
@@ -443,7 +443,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
443
443
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
444
444
|
line-height: 20px;
|
|
445
445
|
font-weight: 500;
|
|
446
|
-
${e=>
|
|
446
|
+
${e=>Ge(e)}
|
|
447
447
|
}
|
|
448
448
|
|
|
449
449
|
font-family: inherit;
|
|
@@ -456,8 +456,8 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
456
456
|
opacity: 0.3;
|
|
457
457
|
cursor: not-allowed;
|
|
458
458
|
}
|
|
459
|
-
`,
|
|
460
|
-
${e=>
|
|
459
|
+
`,xo=ai.div`
|
|
460
|
+
${e=>P(e)} {
|
|
461
461
|
display: flex;
|
|
462
462
|
flex-direction: row;
|
|
463
463
|
justify-content: flex-start;
|
|
@@ -466,14 +466,14 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
466
466
|
margin-right: 8px;
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
`,
|
|
469
|
+
`,re=({onClick:e,title:t,style:o,disabled:n,type:r="inline",size:i="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:a=""})=>{function S(){let c=s?"buttonSecondary":"button";return a===""?c:`${a}${jt(c)}`}return pa.createElement(da,{secondary:s,appearance:p,disabled:n,onClick:e,styleOverrides:o,type:r,withMargin:d,size:i,className:l(S(),p)},t)};var pi=({step:e,canContinue:t,appearance:o,onPrimaryClick:n,onSecondaryClick:r,formType:i,selectedStep:s,steps:p,onBack:d,allowBackNavigation:a,errorMessage:S})=>{let c=i==="inline"?"inline":"full-width",h=p.length>1&&s!=0&&a;return nt.createElement(nt.Fragment,null,S&&nt.createElement(oi,{appearance:o,className:l("formCTAError",o)},S),nt.createElement(ti,{showBackButton:h,className:l("formCTAContainer",o)},h&&nt.createElement(re,{title:e.backButtonTitle??"\u2190",onClick:d,secondary:!0,withMargin:!1,type:c,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),nt.createElement(ri,{className:l("ctaWrapper",o)},e.secondaryButtonTitle?nt.createElement(re,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:c,appearance:o}):null," ",e.primaryButtonTitle?nt.createElement(re,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:n,type:c,appearance:o}):null)))};import Jo from"react";import ca from"styled-components";var ma=ca.div`
|
|
470
470
|
text-align: center;
|
|
471
|
-
`,
|
|
471
|
+
`,di=({stepCount:e=0,currentStep:t=0,className:o,appearance:n})=>{let{theme:r}=Z().mergeAppearanceWithDefault(n);return Jo.createElement(ma,{className:o},Jo.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((i,s)=>Jo.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import ft from"react";import Et from"styled-components";import{useContext as ua}from"react";function se(){let e=ua(G);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 fa=Et.div`
|
|
472
472
|
display: flex;
|
|
473
473
|
flex-wrap: wrap;
|
|
474
474
|
align-content: center;
|
|
475
475
|
justify-content: center;
|
|
476
|
-
`,
|
|
476
|
+
`,ga=Et.div`
|
|
477
477
|
align-content: center;
|
|
478
478
|
align-items: center;
|
|
479
479
|
display: flex;
|
|
@@ -487,10 +487,10 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
487
487
|
flex-basis: 255px;
|
|
488
488
|
flex-grow: 0;
|
|
489
489
|
flex-shrink: 0;
|
|
490
|
-
`,
|
|
490
|
+
`,ha=Et.img`
|
|
491
491
|
width: 78px;
|
|
492
492
|
height: auto;
|
|
493
|
-
`,
|
|
493
|
+
`,xa=Et.button`
|
|
494
494
|
font-style: normal;
|
|
495
495
|
font-weight: 600;
|
|
496
496
|
font-size: 13px;
|
|
@@ -503,11 +503,11 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
503
503
|
border-radius: 100px;
|
|
504
504
|
padding: 8px 12px;
|
|
505
505
|
margin-top: 16px;
|
|
506
|
-
`,
|
|
506
|
+
`,Ca=Et.h1`
|
|
507
507
|
font-weight: 700;
|
|
508
508
|
font-size: 28px;
|
|
509
509
|
line-height: 34px;
|
|
510
|
-
`,
|
|
510
|
+
`,Sa=Et.h2`
|
|
511
511
|
font-style: normal;
|
|
512
512
|
font-weight: 400;
|
|
513
513
|
font-size: 16px;
|
|
@@ -516,7 +516,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
516
516
|
margin-top: 12px;
|
|
517
517
|
margin-bottom: 16px;
|
|
518
518
|
max-width: 70%;
|
|
519
|
-
`;function
|
|
519
|
+
`;function ci({stepData:e,appearance:t}){var n,r;let{handleUrl:o}=se();return ft.createElement("div",null,ft.createElement(Ca,null,e.title),ft.createElement(Sa,null,e.subtitle),ft.createElement(fa,null,(r=(n=e.props)==null?void 0:n.links)==null?void 0:r.map(i=>ft.createElement(ga,{key:i.title},ft.createElement(ha,{src:i.imageUri}),ft.createElement(xa,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{i.uri&&o(i.uri,i.uriTarget??"_blank")}},i.title)))))}import At,{useEffect as Pa}from"react";import yo from"styled-components";import Xo from"react";var Co=({style:e,className:t})=>Xo.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},Xo.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Xo.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 Yt,{useRef as ya,useState as ba}from"react";import So from"styled-components";var wa=So.div`
|
|
520
520
|
display: flex;
|
|
521
521
|
align-items: center;
|
|
522
522
|
justify-content: flex-start;
|
|
@@ -524,7 +524,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
524
524
|
width: 100%;
|
|
525
525
|
height: 100%;
|
|
526
526
|
position: relative;
|
|
527
|
-
`,
|
|
527
|
+
`,Ta=So.div`
|
|
528
528
|
position: absolute;
|
|
529
529
|
display: flex;
|
|
530
530
|
align-items: center;
|
|
@@ -543,57 +543,57 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
543
543
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
544
544
|
border-radius: 50%;
|
|
545
545
|
}
|
|
546
|
-
`,
|
|
546
|
+
`,Fa=So.video`
|
|
547
547
|
width: 100%;
|
|
548
548
|
height: 100%;
|
|
549
549
|
min-height: 200px;
|
|
550
550
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
551
|
-
`,
|
|
551
|
+
`,ka=So.iframe`
|
|
552
552
|
width: 100%;
|
|
553
553
|
height: 100%;
|
|
554
554
|
min-height: 200px;
|
|
555
555
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
556
|
-
`;function Bt({appearance:e,videoUri:t}){let o=
|
|
557
|
-
${e=>
|
|
556
|
+
`;function Bt({appearance:e,videoUri:t}){let o=ya(),[n,r]=ba(!1);if(t.includes("youtube")){let i=t.split("v=")[1],s=i.indexOf("&");return s!==-1&&(i=i.substring(0,s)),Yt.createElement(ka,{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 Yt.createElement(wa,{appearance:e},!n&&Yt.createElement(Ta,{onClick:()=>{r(!0),o.current.play()},appearance:e},Yt.createElement(Co,null)),Yt.createElement(Fa,{appearance:e,controls:n,ref:o,play:n,src:t}))}var va=yo.div`
|
|
557
|
+
${e=>P(e)} {
|
|
558
558
|
display: flex;
|
|
559
559
|
flex-direction: column;
|
|
560
560
|
justify-content: center;
|
|
561
561
|
}
|
|
562
|
-
`,
|
|
563
|
-
${e=>
|
|
562
|
+
`,Ea=yo.img`
|
|
563
|
+
${e=>P(e)} {
|
|
564
564
|
width: 100%;
|
|
565
565
|
height: auto;
|
|
566
566
|
max-height: 250px;
|
|
567
567
|
margin-bottom: 24px;
|
|
568
568
|
}
|
|
569
|
-
`,Ba=
|
|
570
|
-
${e=>
|
|
569
|
+
`,Ba=yo.div`
|
|
570
|
+
${e=>P(e)} {
|
|
571
571
|
margin-bottom: 24px;
|
|
572
572
|
}
|
|
573
|
-
`,
|
|
574
|
-
${e=>
|
|
573
|
+
`,Aa=yo.div`
|
|
574
|
+
${e=>P(e)} {
|
|
575
575
|
width: 100%;
|
|
576
576
|
height: auto;
|
|
577
577
|
max-height: 250px;
|
|
578
578
|
margin-bottom: 24px;
|
|
579
579
|
}
|
|
580
|
-
`;function
|
|
580
|
+
`;function mi({stepData:e,appearance:t,setCanContinue:o}){return Pa(()=>{o(!0)},[]),At.createElement(va,{className:l("callToActionContainer",t)},At.createElement(Ba,{className:l("callToActionTextContainer",t)},At.createElement(Se,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&At.createElement(Ea,{className:l("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&At.createElement(Aa,{appearance:t,className:l("callToActionVideo",t)},At.createElement(Bt,{appearance:t,videoUri:e.videoUri})))}import Ye,{useEffect as Qo,useState as Zo}from"react";import st from"styled-components";var ui=st.div`
|
|
581
581
|
width: auto;
|
|
582
582
|
display: flex;
|
|
583
583
|
flex-direction: column;
|
|
584
584
|
justify-content: center;
|
|
585
585
|
align-items: center;
|
|
586
586
|
padding: 4px;
|
|
587
|
-
`,
|
|
587
|
+
`,fi=st.div`
|
|
588
588
|
width: 100%;
|
|
589
589
|
text-align: left;
|
|
590
|
-
`,
|
|
590
|
+
`,gi=st.h1`
|
|
591
591
|
font-style: normal;
|
|
592
592
|
font-weight: 700;
|
|
593
593
|
font-size: 32px;
|
|
594
594
|
line-height: 38px;
|
|
595
595
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
596
|
-
`,
|
|
596
|
+
`,hi=st.h1`
|
|
597
597
|
font-style: normal;
|
|
598
598
|
font-weight: 400;
|
|
599
599
|
font-size: 16px;
|
|
@@ -601,7 +601,7 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
601
601
|
margin-top: 16px;
|
|
602
602
|
margin-bottom: 16px;
|
|
603
603
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
604
|
-
`,
|
|
604
|
+
`,xi=st.div`
|
|
605
605
|
padding-top: 12px;
|
|
606
606
|
padding-bottom: 12px;
|
|
607
607
|
flex-direction: row;
|
|
@@ -612,17 +612,17 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
612
612
|
cursor: pointer;
|
|
613
613
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
614
614
|
width: 100%;
|
|
615
|
-
`,
|
|
615
|
+
`,Ci=st.div`
|
|
616
616
|
padding-top: 10px;
|
|
617
617
|
padding-bottom: 10px;
|
|
618
618
|
flex-direction: row;
|
|
619
619
|
display: flex;
|
|
620
620
|
justify-content: flex-start;
|
|
621
|
-
`,
|
|
621
|
+
`,Si=st.img`
|
|
622
622
|
width: 42px;
|
|
623
623
|
height: 42px;
|
|
624
624
|
margin-right: 12px;
|
|
625
|
-
`,
|
|
625
|
+
`,yi=st.p`
|
|
626
626
|
font-style: normal;
|
|
627
627
|
font-weight: 500;
|
|
628
628
|
font-size: 17px;
|
|
@@ -630,8 +630,8 @@ import ht,{createContext as za,useEffect as Fo,useState as Ie}from"react";import
|
|
|
630
630
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
631
631
|
display: flex;
|
|
632
632
|
align-self: center;
|
|
633
|
-
`;var
|
|
634
|
-
${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map(([s,p])=>`${$o(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Xt.createElement(o,{inlineStyles:t})}var
|
|
633
|
+
`;var bi=({stepData:e,setCanContinue:t,onSaveData:o,appearance:n})=>{let r=e.props,[i,s]=Zo([]),[p,d]=Zo(!1),[a,S]=Zo(e.id);return Qo(()=>{i.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Qo(()=>{a!==e.id&&(S(e.id),s([]))},[e]),Qo(()=>{o({choice:i}),i.length>=r.minChoices?t(!0):t(!1)},[i]),Ye.createElement(ui,{className:l("selectListContainer",n)},Ye.createElement(fi,null,Ye.createElement(gi,{className:l("selectListTitle",n)},e.title),Ye.createElement(hi,{appearance:n,className:l("selectListSubtitle",n)},e.subtitle)),r.options.map((c,h)=>{let f=i.includes(c.id);return Ye.createElement(xi,{key:`select-item-${h}`,onClick:()=>{if(i.includes(c.id)){s(i.filter(v=>v!==c.id));return}i.length<r.maxChoices?s([...i,c.id]):i.length==1&&r.maxChoices==1&&s([c.id])},hideBottomBorder:h===r.options.length-1,className:l("selectListSelectItem",n)},Ye.createElement(Ci,{className:l("selectListItemImage",n)},c.imageUri&&Ye.createElement(Si,{src:c.imageUri,alt:`select-icon-${h}`}),Ye.createElement(yi,{appearance:n,className:l("selectListSelectItemText",n)},c.title)),Ye.createElement(Ke,{appearance:n,value:f,primaryColor:n.theme.colorPrimary}))}))};import ye,{useEffect as Ro,useState as Jt}from"react";import{AnimatePresence as Ia,motion as Na}from"framer-motion";var La=({children:e,id:t,shouldWrap:o=!1})=>ye.createElement(ye.Fragment,null,o?ye.createElement(Ia,{initial:!1},ye.createElement(Na.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),bo=({appearance:e,steps:t,selectedStep:o,customStepTypes:n,customVariables:r,onButtonClick:i,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:a,onComplete:S,setVisible:c,setShowModal:h,onDismiss:f,showPagination:v=!1,customFormElements:F,allowBackNavigation:C,validationHandler:y})=>{var _;let k={...{linkCollection:ci,multiInput:ei,callToAction:mi,selectList:bi},...n},{primaryCTAClickSideEffects:A,secondaryCTAClickSideEffects:b}=se(),[m,x]=Jt(!1),[g,I]=Jt({}),[D,z]=Jt(!1),[N,M]=Jt(!1),[H,L]=Jt(null),ne=t[o]??null,{markStepCompleted:fe,markStepStarted:Y,isLoading:V,updateCustomVariables:ge,markFlowCompleted:ee}=Q();Ro(()=>{ge(r)},[r,V]),Ro(()=>{window&&C&&!N&&(window.location.hash=t[o].id,M(!0))},[C,N,M]),Ro(()=>{var O;if(window&&((O=window==null?void 0:window.location)!=null&&O.hash)&&window.location.hash.replace("#","")!==t[o].id){let te=window.location.hash.replace("#",""),j=t.findIndex(oe=>oe.id===te);j!==-1&&Y(p,t[j].id)}},[(_=window==null?void 0:window.location)==null?void 0:_.hash,Y,o,t]);function q(){return{data:g[t[o].id]??{},stepId:t[o].id,customVariables:r}}function he(O,te,j){let oe=o+1<t.length?t[o+1]:null;return s&&s(O,j,oe,g,q()),i?i(O,o,te,oe):!0}function Te(O,te){I(j=>{let oe={};return oe[O.id]=te,{...j,...oe}})}function K(O){return O.selectedStep.imageUri?ye.createElement(li,{image:O.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let ae=ye.createElement(pi,{step:t[o],canContinue:m&&!D,formType:d,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(z(!0),y){let j=await y(t[o],o,t[o+1],g,q());if(j){L(j),z(!1);return}else L(null)}let O={...q()};await fe(p,t[o].id,O),o+1<t.length&&await Y(p,t[o+1].id);let te=he(t[o],"primary",o);o+1>=t.length&&(S&&S(),f&&f(),a&&te&&(c&&c(!1),h(!1)),await ee(p)),A(t[o]),z(!1),window&&C&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{he(t[o],"secondary",o),b(t[o])},onBack:async()=>{o-1>=0&&(z(!0),await Y(p,t[o-1].id),z(!1))},steps:t,allowBackNavigation:C,errorMessage:H});return ye.createElement(ye.Fragment,null,ye.createElement(ii,{className:l("formContainer",e)},ye.createElement(ni,null,ye.createElement(La,{id:o,shouldWrap:d==="large-modal"},ye.createElement(si,{key:ne.id,type:d,className:l("formContent",e)},t.map(O=>{let te=k[O.type];return ne.id!==O.id?null:ye.createElement(te,{key:O.id,stepData:O,canContinue:m,setCanContinue:x,onSaveData:j=>{Te(O,j)},appearance:e,customFormElements:F,flowId:p})}),v&&ye.createElement(di,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),ae))),d=="large-modal"&&ye.createElement(K,{selectedStep:t[o]})))};import Xt from"react";import{createGlobalStyle as Oa}from"styled-components";function ie({appearance:e}){if(!e||!e.styleOverrides)return Xt.createElement(Xt.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([n,r])=>typeof r=="object");if(t.length===0)return Xt.createElement(Xt.Fragment,null);let o=Oa`
|
|
634
|
+
${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map(([s,p])=>`${$o(s)}: ${p};`).join(" ")} }`).join(" ")}`;return Xt.createElement(o,{inlineStyles:t})}var wi=({flowId:e,customStepTypes:t={},type:o="inline",visible:n,setVisible:r,customVariables:i,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:a=!0,onStepCompletion:S,onButtonClick:c,dismissible:h=!0,endFlowOnDismiss:f=!1,modalPosition:v="center",repeatable:F=!1,onDismiss:C,showPagination:y=!1,allowBackNavigation:T=!1,validationHandler:k,showFrigadeBranding:A=!1})=>{let{getFlow:b,getFlowSteps:m,isLoading:x,targetingLogicShouldHideFlow:g,getFlowStatus:I,getCurrentStepIndex:D,markFlowCompleted:z,markFlowNotStarted:N}=Q(),M=D(e),{mergeAppearanceWithDefault:H}=Z(),[L,ne]=$a(!1),{setOpenFlowState:fe,getOpenFlowState:Y,hasOpenModals:V}=Fe();d=H(d);let[ge,ee]=n!==void 0&&r!==void 0?[n,r]:[Y(e,!0),K=>fe(e,K)];if(Da(()=>{!L&&!x&&(ne(!0),I(e)===X&&F&&N(e),ne(!0))},[L,ne,x]),x)return null;let q=b(e);if(!q||g(q))return null;let he=m(e);if(!he||n!==void 0&&n===!1||I(e)===X&&a||(o=="modal"||o=="corner-modal")&&V(e))return null;let Te=()=>{ee(!1),C&&C(),f===!0&&z(e)};if(v=="center"&&o==="modal"||o==="large-modal"){let K={padding:"24px"};return o==="large-modal"?(K.width="85%",K.height="90%",K.maxHeight="800px",K.minHeight="500px",K.padding="0"):K.width="400px",_e.createElement(tt,{appearance:d,onClose:Te,visible:ge,style:K,dismissible:h,showFrigadeBranding:A},_e.createElement(ie,{appearance:d}),_e.createElement(bo,{appearance:d,steps:he,selectedStep:M,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:S,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:ee,onDismiss:C,showPagination:y,customFormElements:s,allowBackNavigation:T,validationHandler:k}))}return o==="modal"&&v!=="center"?_e.createElement(Mr,{appearance:d,onClose:Te,visible:ge},_e.createElement(ie,{appearance:d}),_e.createElement(bo,{appearance:d,steps:he,selectedStep:M,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:S,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:ee,onDismiss:C,showPagination:y,customFormElements:s,allowBackNavigation:T,validationHandler:k})):_e.createElement(_e.Fragment,null,_e.createElement(ie,{appearance:d}),_e.createElement(bo,{appearance:d,steps:he,selectedStep:M,customStepTypes:t,customVariables:i,onButtonClick:c,onStepCompletion:S,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:ee,onDismiss:C,showPagination:y,customFormElements:s,allowBackNavigation:T,validationHandler:k}))},Ti=wi;import{useCallback as Fi,useContext as Ma,useEffect as Ua}from"react";function er(){let{organizationId:e,userId:t,setOrganizationId:o}=Ma(G),{mutateUserFlowState:n}=Be(),{config:r,apiUrl:i}=Me(),s=Tt(),{verifySDKInitiated:p}=Ft();Ua(()=>{if(t&&e){if(t.startsWith(kt))return;let S=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(S)||(s(`${i}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(S,"true"))}},[t,e]);let d=Fi(async S=>{if(p(),!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let c={foreignUserId:t,foreignUserGroupId:e,properties:S};await s(`${i}userGroups`,{...r,method:"POST",body:JSON.stringify(c)}),n()},[e,t,r,n]),a=Fi(async(S,c)=>{if(p(),!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let f={foreignUserId:t,foreignUserGroupId:e,events:[{event:S,properties:c}]};await s(`${i}userGroups`,{...r,method:"POST",body:JSON.stringify(f)}),n()},[e,t,r,n]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:d,trackEventForOrganization:a}}var ki="frigade-xFrigade_guestUserId",Qt="frigade-xFrigade_userId",Pi=({})=>{let{setFlowResponses:e}=Wt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:n}=Be(),{userId:r,setUserId:i}=Ht(),[s,p]=tr(null),{getFlowStatus:d}=Q(),{flows:a,userProperties:S,setIsNewGuestUser:c,flowResponses:h}=_a(G),[f,v]=tr([]),[F,C]=tr([]),{organizationId:y}=er();wo(()=>{if(!o&&t)for(let b=0;b<t.length;b++){let m=t[b],x=a.find(g=>g.slug===(m==null?void 0:m.flowId));if(x&&m&&m.shouldTrigger===!0&&x.type=="FORM"&&x.triggerType==="AUTOMATIC"&&!F.includes(x.slug)){setTimeout(()=>{T(m.flowId)},500);break}}},[o,t]),wo(()=>{h.length>0&&n()},[h]);function T(b){let m=a.find(x=>x.slug===b);m&&m.triggerType==="AUTOMATIC"&&!F.includes(m.slug)&&(C([...F,m.slug]),v([m]))}function k(){if(!r){let b=localStorage.getItem(Qt);if(b){i(b);return}let m=localStorage.getItem(ki);if(m){i(m);return}c(!0);let x=kt+za();try{localStorage.setItem(ki,x)}catch(g){console.log("Failed to save guest user id locally: Local storage unavailable",g)}i(g=>g||x)}}wo(()=>{try{if(a){let b=[];a.forEach(m=>{if(m.data){let x=m.data.match(/"imageUri":"(.*?)"/g);x&&x.forEach(g=>{let I=g.replace('"imageUri":"',"").replace('"',"");if(b.includes(I))return;let D=new Image;D.src=I,b.push(I)})}})}}catch{}},[a]),wo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(kt))try{localStorage.setItem(Qt,r)}catch(b){console.log("Failed to save user id locally: Local storage available",b)}r===null&&setTimeout(()=>{r===null&&k()},50)},[r,a,S]);function A(){return gt.createElement(gt.Fragment,null,f.map(b=>d(b.slug)!==Ie?null:gt.createElement("span",{key:b.slug},gt.createElement(Ti,{flowId:b.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return gt.createElement(gt.Fragment,null,gt.createElement(A,null))};import{ErrorBoundary as Va}from"react-error-boundary";var vi="https://api.frigade.com",G=Wa({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:qe,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:vi,readonly:!1});function ja(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Ga=({publicApiKey:e,userId:t,organizationId:o,config:n,children:r})=>{var fe,Y;let[i,s]=Ae(t||null),[p,d]=Ae(o||null),[a,S]=Ae([]),[c,h]=Ae([]),[f,v]=Ae([]),[F,C]=Ae({}),[y,T]=Ae({}),[k,A]=Ae([]),[b,m]=Ae({}),[x,g]=Ae(!1),[I,D]=Ae(!1),[z,N]=Ae(!L(e)),M=(V,ge)=>{if(ge==="_blank"){window.open(V,"_blank");return}setTimeout(()=>{window.location.href=V},50)},H={theme:{...qe.theme,...((fe=n==null?void 0:n.defaultAppearance)==null?void 0:fe.theme)??{}},styleOverrides:{...qe.styleOverrides,...((Y=n==null?void 0:n.defaultAppearance)==null?void 0:Y.styleOverrides)??{}}};function L(V){return!!(V&&V.length>10&&V.substring(0,10)==="api_public")}To(()=>{t&&s(t)},[t]),To(()=>{i&&window&&window.localStorage&&window.localStorage.getItem(Qt)&&window.localStorage.getItem(Qt)!==i&&ja()},[i]),To(()=>{o&&d(o)},[o]),To(()=>{if(L(e))N(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),N(!0);return}},[e,N]);let ne={publicApiKey:e,userId:i,setUserId:s,setFlows:S,flows:a,failedFlowResponses:c,setFailedFlowResponses:h,flowResponses:f,setFlowResponses:v,userProperties:F,setUserProperties:C,openFlowStates:y,setOpenFlowStates:T,completedFlowsToKeepOpenDuringSession:k,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:b,setCustomVariables:m,isNewGuestUser:x,setIsNewGuestUser:g,hasActiveFullPageFlow:I,setHasActiveFullPageFlow:D,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:M,defaultAppearance:H,shouldGracefullyDegrade:z,setShouldGracefullyDegrade:N,apiUrl:n&&n.apiUrl?n.apiUrl:vi,readonly:n&&n.readonly?n.readonly:!1};return z?ht.createElement(G.Provider,{value:ne},r):ht.createElement(Va,{fallback:ht.createElement(ht.Fragment,null,r)},ht.createElement(G.Provider,{value:ne},ht.createElement(Ha,{theme:H.theme},r,ht.createElement(Pi,null))))};import Hp from"react";import de,{useEffect as is,useState as ns}from"react";import Oe,{useState as up}from"react";import St from"styled-components";import Po from"react";import xt from"react";import Bi from"styled-components";var Ei=Bi.span`
|
|
635
635
|
font-weight: 400;
|
|
636
636
|
font-size: 15px;
|
|
637
637
|
line-height: 20px;
|
|
@@ -640,7 +640,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
640
640
|
vertical-align: middle;
|
|
641
641
|
margin-left: 12px;
|
|
642
642
|
padding-right: 12px;
|
|
643
|
-
`,
|
|
643
|
+
`,qa=Bi.div`
|
|
644
644
|
flex-direction: row;
|
|
645
645
|
justify-content: space-between;
|
|
646
646
|
display: flex;
|
|
@@ -648,7 +648,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
648
648
|
padding-bottom: 20px;
|
|
649
649
|
border-top: 1px solid ${e=>e.theme.colorBorder};
|
|
650
650
|
width: 100%;
|
|
651
|
-
`,
|
|
651
|
+
`,Fo=({label:e,value:t,labelStyle:o={},labelPosition:n="right",style:r,primaryColor:i="#000000",checkBoxType:s="square",appearance:p})=>xt.createElement(xt.Fragment,null,xt.createElement(qa,{className:l("checklistStepsContainer",p),appearance:p,style:{...r}},n==="left"&&e&&xt.createElement(Ei,{className:l("checklistStepLabel",p),style:o},e),xt.createElement(Ke,{appearance:p,value:t,type:s,primaryColor:i}),n==="right"&&e&&xt.createElement(Ei,{className:l("checklistStepLabel",p),style:o},e)),xt.createElement(ie,{appearance:p}));import{motion as Ka}from"framer-motion";import Zt from"styled-components";var Ai=Zt.div`
|
|
652
652
|
font-weight: 700;
|
|
653
653
|
font-size: 18px;
|
|
654
654
|
line-height: 22px;
|
|
@@ -665,7 +665,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
665
665
|
max-width: 540px;
|
|
666
666
|
margin: 8px 0px 0px 0px;
|
|
667
667
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
668
|
-
`,
|
|
668
|
+
`,ko=Zt.div`
|
|
669
669
|
width: 4px;
|
|
670
670
|
position: absolute;
|
|
671
671
|
left: 0;
|
|
@@ -676,32 +676,32 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
676
676
|
`,Li=Zt.div`
|
|
677
677
|
flex-direction: row;
|
|
678
678
|
justify-content: flex-start;
|
|
679
|
-
`;var Oi=({data:e,index:t,isSelected:o,primaryColor:n,style:r,onClick:i,appearance:s})=>{var p,d;return
|
|
679
|
+
`;var Oi=({data:e,index:t,isSelected:o,primaryColor:n,style:r,onClick:i,appearance:s})=>{var p,d;return Po.createElement("div",{style:{position:"relative",paddingLeft:"20px"},onClick:()=>{i()}},o&&Po.createElement(ko,{className:l("checklistStepItemSelectedIndicator",s),as:Ka.div,layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??n}}),Po.createElement(Li,{className:l("checklistStepItem",s),key:`hero-checklist-step-${t}`,role:"listitem"},Po.createElement(Fo,{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 Ct from"react";import{motion as Ya}from"framer-motion";import or from"styled-components";var Ja={backgroundColor:"#E6E6E6"},Xa=or.div`
|
|
680
680
|
display: flex;
|
|
681
681
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
682
682
|
justify-content: flex-start;
|
|
683
683
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
684
684
|
|
|
685
|
-
${e=>
|
|
686
|
-
`,
|
|
685
|
+
${e=>Ge(e)}
|
|
686
|
+
`,Qa=or.div`
|
|
687
687
|
flex-grow: 1;
|
|
688
688
|
position: relative;
|
|
689
689
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
690
|
-
`,
|
|
690
|
+
`,Za=or.span`
|
|
691
691
|
font-weight: 500;
|
|
692
692
|
font-size: 15px;
|
|
693
693
|
line-height: 18px;
|
|
694
694
|
padding-right: ${e=>e.padding};
|
|
695
695
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
696
696
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
697
|
-
${e=>
|
|
698
|
-
`,
|
|
697
|
+
${e=>Ge(e)}
|
|
698
|
+
`,Ra={position:"relative",left:0,top:0,width:"100%",minWidth:"40px",height:"10px",borderRadius:"20px"},ep={position:"absolute",left:0,top:0,height:"10px",borderRadius:"20px"},ze=({count:e,total:t,fillColor:o,bgColor:n=Ja.backgroundColor,display:r="count",textLocation:i="left",style:s={},textStyle:p={},appearance:d})=>{var v,F;if(t===0)return Ct.createElement(Ct.Fragment,null);let a=e===0?"10px":`${e/t*100}%`,S=r==="compact"?"5px":"10px",c=Math.round(e/t*100),h=r==="compact"?"5px":"20px",f;return r==="count"?f=`${e} of ${t}`:r==="compact"?f=`${c}%`:r==="percent"&&(f=`${c}% complete`),i==="top"&&(h="0px"),Ct.createElement(Xa,{className:l("progressBarContainer",d),textLocation:i,styleOverrides:s},Ct.createElement(Za,{className:l("progressBarStepText",d),style:{...p,fontSize:r==="compact"?12:15,fontWeight:r==="compact"?400:500},appearance:d,padding:h,textLocation:i},f),Ct.createElement(Qa,{textLocation:i,className:l("progressBar",d)},Ct.createElement(Ya.div,{style:{...ep,width:a,height:S,backgroundColor:((v=d==null?void 0:d.theme)==null?void 0:v.colorPrimary)??o,zIndex:r=="compact"?1:5},className:l("progressBarFill",d)}),Ct.createElement("div",{className:l("progressBarBackground",d),style:{...Ra,height:S,backgroundColor:((F=d==null?void 0:d.theme)==null?void 0:F.colorSecondary)??n}})))};import Rt from"react";import tp from"styled-components";import Eo from"react";import vo from"react";var It=({stepData:e,appearance:t})=>vo.createElement(vo.Fragment,null,vo.createElement(Ii,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:ce(e.title)}),vo.createElement(Ni,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:ce(e.subtitle)}));import rr from"react";var Nt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},n=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return rr.createElement(xo,{className:l("ctaContainer",t)},e.secondaryButtonTitle&&rr.createElement(re,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:n,style:{width:"auto",marginRight:"12px"}}),rr.createElement(re,{appearance:t,title:e.primaryButtonTitle,onClick:o}))};var Lt=({stepData:e,appearance:t})=>Eo.createElement(Eo.Fragment,null,Eo.createElement(It,{stepData:e,appearance:t}),Eo.createElement(Nt,{stepData:e,appearance:t}));import Di from"react";function $i(e){if(e.videoUri.includes("youtube")){let t=e.videoUri.split("v=")[1],o=t.indexOf("&");return o!==-1&&(t=t.substring(0,o)),Di.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:l("checklistStepVideo",e.appearance)})}else return Di.createElement("video",{width:"480",height:"260",controls:!0,src:e.videoUri})}var ir="default",op=tp.img`
|
|
699
699
|
border-radius: 4px;
|
|
700
700
|
max-height: 260px;
|
|
701
701
|
min-height: 200px;
|
|
702
|
-
`,Mi=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Rt.createElement("div",null,o)}return Rt.createElement(Ai,{className:l("checklistStepContent",t)},e.imageUri?Rt.createElement(
|
|
702
|
+
`,Mi=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Rt.createElement("div",null,o)}return Rt.createElement(Ai,{className:l("checklistStepContent",t)},e.imageUri?Rt.createElement(op,{className:l("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Rt.createElement($i,{videoUri:e.videoUri,appearance:t}):null,Rt.createElement(Lt,{stepData:e,appearance:t}))};import Pe,{useRef as rp,useState as ip}from"react";import Ot from"styled-components";var Ui=Ot.div`
|
|
703
703
|
display: block;
|
|
704
|
-
`,
|
|
704
|
+
`,np=Ot.div`
|
|
705
705
|
display: flex;
|
|
706
706
|
flex-direction: row;
|
|
707
707
|
flex-wrap: wrap;
|
|
@@ -711,20 +711,20 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
711
711
|
align-content: center;
|
|
712
712
|
margin-top: 24px;
|
|
713
713
|
margin-bottom: 24px;
|
|
714
|
-
`,
|
|
714
|
+
`,sp=Ot.div`
|
|
715
715
|
display: flex;
|
|
716
716
|
align-items: center;
|
|
717
717
|
justify-content: flex-start;
|
|
718
718
|
flex-direction: column;
|
|
719
719
|
margin-right: 16px;
|
|
720
|
-
`,
|
|
720
|
+
`,lp=Ot.video`
|
|
721
721
|
width: 200px;
|
|
722
722
|
height: 120px;
|
|
723
|
-
`,
|
|
723
|
+
`,ap=Ot.div`
|
|
724
724
|
font-size: 14px;
|
|
725
725
|
line-height: 20px;
|
|
726
726
|
text-align: center;
|
|
727
|
-
`,
|
|
727
|
+
`,pp=Ot.div`
|
|
728
728
|
position: absolute;
|
|
729
729
|
width: 200px;
|
|
730
730
|
height: 120px;
|
|
@@ -744,9 +744,9 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
744
744
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
745
745
|
border-radius: 50%;
|
|
746
746
|
}
|
|
747
|
-
`,_i="videoCarousel",zi=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Pe.createElement(Ui,null,Pe.createElement(
|
|
747
|
+
`,_i="videoCarousel",zi=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Pe.createElement(Ui,null,Pe.createElement(Lt,{stepData:e,appearance:t}));function o({video:i}){let s=rp(),[p,d]=ip(!1);return Pe.createElement(sp,null,!p&&Pe.createElement(pp,{onClick:()=>{d(!0),s.current.play()},appearance:t},Pe.createElement(Co,null)),Pe.createElement(lp,{controls:p,ref:s,play:p,src:i.uri}),Pe.createElement(ap,null,i.title))}let n=e.props;return n.videos?Pe.createElement(Ui,null,Pe.createElement(It,{stepData:e,appearance:t}),Pe.createElement(np,null,n.videos.map((i,s)=>Pe.createElement("span",{key:`${i.uri}-${s}`},Pe.createElement(o,{video:i})))),Pe.createElement(Nt,{stepData:e,appearance:t})):null};import Je from"react";import Bo from"styled-components";var Wi=Bo.div`
|
|
748
748
|
display: block;
|
|
749
|
-
`,
|
|
749
|
+
`,dp=Bo.pre`
|
|
750
750
|
display: block;
|
|
751
751
|
background-color: #2a2a2a;
|
|
752
752
|
color: #f8f8f8;
|
|
@@ -762,47 +762,47 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
762
762
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
763
763
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
764
764
|
margin-bottom: 24px;
|
|
765
|
-
`,
|
|
765
|
+
`,cp=Bo.div`
|
|
766
766
|
font-size: 15px;
|
|
767
767
|
line-height: 20px;
|
|
768
768
|
margin-bottom: 12px;
|
|
769
769
|
margin-top: 12px;
|
|
770
|
-
`,
|
|
770
|
+
`,mp=Bo.div`
|
|
771
771
|
margin-top: 24px;
|
|
772
|
-
`,Hi="codeSnippet",Vi=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.codeSnippets))return
|
|
772
|
+
`,Hi="codeSnippet",Vi=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.codeSnippets))return Je.createElement(Wi,null,Je.createElement(Lt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?Je.createElement(Wi,null,Je.createElement(It,{stepData:e,appearance:t}),Je.createElement(mp,null,o.codeSnippets.map((r,i)=>Je.createElement("div",{key:i},r.title?Je.createElement(cp,null,r.title):null,r.code?Je.createElement(dp,null,r.code):null))),Je.createElement(Nt,{stepData:e,appearance:t})):null};var fp=St.div`
|
|
773
773
|
display: flex;
|
|
774
774
|
flex-direction: row;
|
|
775
775
|
min-width: ${e=>e.type!="modal"?"1000px":"100%"};
|
|
776
776
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
777
777
|
box-shadow: ${e=>e.type!="modal"?"0px 6px 25px rgba(0, 0, 0, 0.06)":"none"};
|
|
778
778
|
border-radius: 8px;
|
|
779
|
-
`,
|
|
779
|
+
`,gp=St.h1`
|
|
780
780
|
font-size: 24px;
|
|
781
781
|
font-weight: 600;
|
|
782
782
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
783
|
-
`,
|
|
783
|
+
`,hp=St.h2`
|
|
784
784
|
font-size: 15px;
|
|
785
785
|
line-height: 20px;
|
|
786
786
|
color: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary)??"#4d4d4d"}};
|
|
787
787
|
margin: 10px 0px 0px 0px;
|
|
788
788
|
`,ji=St.div`
|
|
789
789
|
padding-bottom: 16px;
|
|
790
|
-
`,
|
|
790
|
+
`,xp=St.div`
|
|
791
791
|
list-style: none;
|
|
792
792
|
padding: 0;
|
|
793
793
|
margin: 0;
|
|
794
794
|
cursor: pointer;
|
|
795
795
|
width: 300px;
|
|
796
|
-
`,
|
|
796
|
+
`,Cp=St.div`
|
|
797
797
|
width: 1px;
|
|
798
798
|
margin: 40px;
|
|
799
799
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
800
|
-
`,
|
|
800
|
+
`,Sp=St.div`
|
|
801
801
|
flex: 2;
|
|
802
802
|
padding: 2rem;
|
|
803
|
-
`,
|
|
803
|
+
`,yp=({title:e,subtitle:t,steps:o=[],style:n={},selectedStep:r,setSelectedStep:i,className:s="",customStepTypes:p=new Map,appearance:d,type:a})=>{let{mergeAppearanceWithDefault:S}=Z();d=S(d);let h={...{[ir]:Mi,[_i]:zi,[Hi]:Vi},...p},[f,v]=up(0),F=r??f,C=i??v,y=o.filter(k=>k.complete===!0).length,T=()=>{var k;return!((k=o[F])!=null&&k.type)||!h[o[F].type]?h[ir]({stepData:o[F],appearance:d}):h[o[F].type]({stepData:o[F],appearance:d})};return Oe.createElement(fp,{type:a,style:n,className:s,appearance:d},Oe.createElement(ji,{style:{flex:1}},Oe.createElement(ji,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},Oe.createElement(gp,{className:l("checklistTitle",d),appearance:d},e),Oe.createElement(hp,{className:l("checklistSubtitle",d),appearance:d},t),Oe.createElement(ze,{total:o.length,count:y,fillColor:d.theme.colorPrimary,style:{marginTop:"24px"},appearance:d})),Oe.createElement(xp,{className:l("checklistStepsContainer",d)},o.map((k,A)=>Oe.createElement(Oi,{data:k,index:A,key:A,listLength:o.length,isSelected:A===F,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{C(A)}})))),Oe.createElement(Cp,{appearance:d,className:l("checklistDivider",d)}),Oe.createElement(Sp,null,Oe.createElement(T,null)))},nr=yp;import U,{useState as Pp}from"react";import Gi from"react";import bp from"styled-components";var wp=bp.svg`
|
|
804
804
|
transition: 'transform 0.35s ease-in-out';
|
|
805
|
-
`,
|
|
805
|
+
`,Dt=({color:e="#323232",style:t,className:o})=>Gi.createElement(wp,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},Gi.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import{motion as vp}from"framer-motion";import me from"styled-components";var sr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},qi=me.div`
|
|
806
806
|
max-height: 350px;
|
|
807
807
|
padding-bottom: 40px;
|
|
808
808
|
`,Ki=me.div`
|
|
@@ -824,7 +824,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
824
824
|
padding-left: 1px;
|
|
825
825
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
826
826
|
`,Xi=me.div`
|
|
827
|
-
${e=>
|
|
827
|
+
${e=>P(e)} {
|
|
828
828
|
border: 1px solid #fafafa;
|
|
829
829
|
}
|
|
830
830
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
@@ -838,7 +838,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
838
838
|
flex-direction: row;
|
|
839
839
|
justify-content: space-between;
|
|
840
840
|
`,Zi=me.p`
|
|
841
|
-
${e=>
|
|
841
|
+
${e=>P(e)} {
|
|
842
842
|
font-weight: 400;
|
|
843
843
|
font-size: 10px;
|
|
844
844
|
line-height: 12px;
|
|
@@ -852,7 +852,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
852
852
|
`,en=me.div`
|
|
853
853
|
flex: 1;
|
|
854
854
|
`,tn=me.div`
|
|
855
|
-
${e=>
|
|
855
|
+
${e=>P(e)} {
|
|
856
856
|
display: flex;
|
|
857
857
|
justify-content: center;
|
|
858
858
|
align-content: center;
|
|
@@ -862,7 +862,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
862
862
|
padding-right: 8px;
|
|
863
863
|
}
|
|
864
864
|
`,on=me.p`
|
|
865
|
-
${e=>
|
|
865
|
+
${e=>P(e)} {
|
|
866
866
|
font-style: normal;
|
|
867
867
|
font-weight: 600;
|
|
868
868
|
font-size: 22px;
|
|
@@ -874,7 +874,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
874
874
|
margin-bottom: 16px;
|
|
875
875
|
}
|
|
876
876
|
`,rn=me.p`
|
|
877
|
-
${e=>
|
|
877
|
+
${e=>P(e)} {
|
|
878
878
|
font-weight: 400;
|
|
879
879
|
font-size: 14px;
|
|
880
880
|
line-height: 18px;
|
|
@@ -883,14 +883,14 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
883
883
|
margin-bottom: 8px;
|
|
884
884
|
}
|
|
885
885
|
`,nn=me.div`
|
|
886
|
-
${e=>
|
|
886
|
+
${e=>P(e)} {
|
|
887
887
|
display: flex;
|
|
888
888
|
flex-direction: row;
|
|
889
889
|
justify-content: center;
|
|
890
890
|
gap: 8px;
|
|
891
891
|
}
|
|
892
892
|
`,sn=me.div`
|
|
893
|
-
${e=>
|
|
893
|
+
${e=>P(e)} {
|
|
894
894
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
895
895
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
896
896
|
:hover {
|
|
@@ -910,7 +910,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
910
910
|
position: relative;
|
|
911
911
|
cursor: pointer;
|
|
912
912
|
`,ln=me.p`
|
|
913
|
-
${e=>
|
|
913
|
+
${e=>P(e)} {
|
|
914
914
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
915
915
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
916
916
|
}
|
|
@@ -934,11 +934,11 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
934
934
|
`,dn=me.div`
|
|
935
935
|
display: block;
|
|
936
936
|
width: 100%;
|
|
937
|
-
`;import
|
|
937
|
+
`;import Tp from"styled-components";var cn=Tp.div`
|
|
938
938
|
flex-direction: column;
|
|
939
939
|
justify-content: center;
|
|
940
940
|
display: flex;
|
|
941
|
-
`;import
|
|
941
|
+
`;import Qe from"react";import{motion as Fp}from"framer-motion";import Xe from"styled-components";var mn=Xe.div`
|
|
942
942
|
border: 1px solid #fafafa;
|
|
943
943
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
944
944
|
border-radius: 14px;
|
|
@@ -946,14 +946,14 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
946
946
|
display: flex;
|
|
947
947
|
flex-direction: column;
|
|
948
948
|
overflow: hidden;
|
|
949
|
-
`,un=
|
|
949
|
+
`,un=Xe.div`
|
|
950
950
|
display: flex;
|
|
951
951
|
flex-wrap: wrap;
|
|
952
952
|
justify-content: space-between;
|
|
953
953
|
overflow: hidden;
|
|
954
954
|
row-gap: 10px;
|
|
955
|
-
`,fn=
|
|
956
|
-
${e=>
|
|
955
|
+
`,fn=Xe.div`
|
|
956
|
+
${e=>P(e)} {
|
|
957
957
|
color: #595959;
|
|
958
958
|
}
|
|
959
959
|
text-transform: uppercase;
|
|
@@ -962,8 +962,8 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
962
962
|
line-height: 12px;
|
|
963
963
|
letter-spacing: 0.09em;
|
|
964
964
|
margin-bottom: 12px;
|
|
965
|
-
`,gn=
|
|
966
|
-
${e=>
|
|
965
|
+
`,gn=Xe.div`
|
|
966
|
+
${e=>P(e)} {
|
|
967
967
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
968
968
|
background: #ffffff;
|
|
969
969
|
border: 1px solid #fafafa;
|
|
@@ -975,8 +975,8 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
975
975
|
|
|
976
976
|
max-width: 150px;
|
|
977
977
|
min-width: 200px;
|
|
978
|
-
`,hn=
|
|
979
|
-
${e=>
|
|
978
|
+
`,hn=Xe.div`
|
|
979
|
+
${e=>P(e)} {
|
|
980
980
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
981
981
|
}
|
|
982
982
|
width: 40px;
|
|
@@ -987,14 +987,14 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
987
987
|
justify-content: center;
|
|
988
988
|
align-content: center;
|
|
989
989
|
align-items: center;
|
|
990
|
-
`,xn=
|
|
990
|
+
`,xn=Xe.div`
|
|
991
991
|
font-weight: 600;
|
|
992
992
|
font-size: 20px;
|
|
993
993
|
line-height: 24px;
|
|
994
994
|
width: 20px;
|
|
995
995
|
height: 20px;
|
|
996
|
-
`,Cn=
|
|
997
|
-
${e=>
|
|
996
|
+
`,Cn=Xe.div`
|
|
997
|
+
${e=>P(e)} {
|
|
998
998
|
color: #434343;
|
|
999
999
|
}
|
|
1000
1000
|
font-weight: 600;
|
|
@@ -1002,20 +1002,20 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1002
1002
|
line-height: 17px;
|
|
1003
1003
|
margin-top: 12px;
|
|
1004
1004
|
margin-bottom: 8px;
|
|
1005
|
-
`,Sn=
|
|
1006
|
-
${e=>
|
|
1005
|
+
`,Sn=Xe.div`
|
|
1006
|
+
${e=>P(e)} {
|
|
1007
1007
|
color: #8c8c8c;
|
|
1008
1008
|
}
|
|
1009
1009
|
font-weight: 400;
|
|
1010
1010
|
font-size: 12px;
|
|
1011
1011
|
line-height: 14px;
|
|
1012
|
-
`,yn=
|
|
1012
|
+
`,yn=Xe.a`
|
|
1013
1013
|
color: ${e=>e.color};
|
|
1014
1014
|
font-size: 12px;
|
|
1015
1015
|
line-height: 14px;
|
|
1016
1016
|
font-weight: 400;
|
|
1017
1017
|
cursor: pointer;
|
|
1018
|
-
`;var
|
|
1018
|
+
`;var kp=({steps:e,style:t,title:o,primaryColor:n,appearance:r,onButtonClick:i})=>{let{primaryCTAClickSideEffects:s}=se();return Qe.createElement(mn,{style:t,className:l("guideContainer",r)},Qe.createElement(fn,{className:l("guideTitle",r)},o),Qe.createElement(un,{className:l("guideItemContainer",r)},e.map((p,d)=>Qe.createElement(gn,{key:`guide-${p.id??d}`,as:Fp.div,whileHover:{boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.05)",transition:{duration:.25}},className:l("guideItem",r)},p.icon&&Qe.createElement(hn,{className:l("guideIcon",r)},Qe.createElement(xn,null,p.icon)),Qe.createElement(Cn,{className:l("guideItemTitle",r),dangerouslySetInnerHTML:ce(p.title)}),Qe.createElement(Sn,{className:l("guideItemSubtitle",r),dangerouslySetInnerHTML:ce(p.subtitle)}),Qe.createElement(yn,{className:l("guideItemLink",r),color:n,onClick:()=>{p.primaryButtonUri&&s(p),i&&i(p)}},p.primaryButtonTitle)))))},eo=kp;var Ep=({steps:e,title:t,subtitle:o,stepsTitle:n,visible:r,onClose:i,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:a,guideData:S,guideTitle:c,onGuideButtonClick:h})=>{let f=({stepData:m,handleSecondaryCTAClick:x,handleCTAClick:g})=>m?U.createElement(tn,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},U.createElement(on,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:ce(m.title)}),U.createElement(rn,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:ce(m.subtitle)}),U.createElement(nn,{className:l("checklistCTAContainer",a)},m.secondaryButtonTitle&&U.createElement(re,{title:m.secondaryButtonTitle,onClick:x,appearance:a,secondary:!0}),U.createElement(re,{title:m.primaryButtonTitle,onClick:g,appearance:a}))):U.createElement(U.Fragment,null),F={...{default:m=>{var D;if((D=e[T])!=null&&D.StepContent){let z=e[T].StepContent;return U.createElement("div",null,z)}let x=e[T];return U.createElement(f,{stepData:m,handleCTAClick:()=>{x.handlePrimaryButtonClick&&x.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{x.handleSecondaryButtonClick&&x.handleSecondaryButtonClick()}})}},...d},[C,y]=Pp(0),T=s??C,k=p??y,A=()=>{var m;return e?!((m=e[T])!=null&&m.type)||!F[e[T].type]?F.default(e[T]):F[e[T].type]({stepData:e[T],primaryColor:a.theme.colorPrimary}):U.createElement(U.Fragment,null)},b=e.filter(m=>m.complete).length;return r?(a.theme.modalContainer||(a.theme.borderRadius&&(sr.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=sr),U.createElement(tt,{onClose:i,visible:r,appearance:a},U.createElement(dn,null,U.createElement(Ki,null,U.createElement(Yi,{appearance:a,className:l("checklistTitle",a)},t),U.createElement(Ji,{appearance:a,className:l("checklistSubtitle",a)},o)),U.createElement(qi,null,e&&e.length>0&&U.createElement(Xi,{className:l("stepsContainer",a)},U.createElement(Qi,null,U.createElement("div",{style:{flex:3}},U.createElement(Zi,{className:l("stepsTitle",a)},n)),U.createElement(pn,null,U.createElement(ze,{fillColor:a.theme.colorPrimary,style:{width:"100%"},count:b,total:e.length,appearance:a}))),U.createElement(Ri,null,U.createElement(en,{className:l("checklistStepListContainer",a),appearance:a},e.map((m,x)=>{let g=T===x;return U.createElement(sn,{selected:g,className:l(`checklistStepListItem${g?"Selected":""}`,a),key:`checklist-guide-step-${m.id??x}`,disabled:m.blocked,onClick:()=>{m.blocked||k(x)},title:m.blocked?"Finish remaining steps to continue":void 0},g&&U.createElement(ko,{className:l("checklistStepItemSelectedIndicator",a),as:vp.div,layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),U.createElement(ln,{selected:g,className:l(`checklistStepListStepName${g?"Selected":""}`,a)},m.stepName),U.createElement(an,null,U.createElement(Ke,{value:m.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:m.progress,appearance:a}),U.createElement(cn,null,U.createElement(Dt,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),U.createElement(A,null))),S&&S.length>0&&U.createElement(eo,{steps:S,title:c,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:m=>(h&&h(m),!0)}))))):U.createElement(U.Fragment,null)},lr=Ep;import{useEffect as Bp,useState as Ap}from"react";var bn=()=>{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,a])=>{if(!window)return[d,!1];let S=window.matchMedia(a);return S.addEventListener("change",i),[d,S.matches]}));n(p)};return Bp(()=>{s()},[]),o};import we,{useEffect as $n,useState as Lp}from"react";import ue from"react";import{AnimatePresence as Ip,motion as Np}from"framer-motion";import Ze from"styled-components";var wn=Ze.div`
|
|
1019
1019
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1020
1020
|
border: 1px solid;
|
|
1021
1021
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1027,42 +1027,42 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1027
1027
|
display: flex;
|
|
1028
1028
|
flex-direction: column;
|
|
1029
1029
|
transition: max-height 0.25s;
|
|
1030
|
-
`,Tn=
|
|
1030
|
+
`,Tn=Ze.div`
|
|
1031
1031
|
display: flex;
|
|
1032
1032
|
margin-bottom: 20px;
|
|
1033
|
-
`,Fn=
|
|
1033
|
+
`,Fn=Ze.img`
|
|
1034
1034
|
border-radius: 4px;
|
|
1035
1035
|
max-height: 260px;
|
|
1036
1036
|
min-height: 200px;
|
|
1037
|
-
`,kn=
|
|
1037
|
+
`,kn=Ze.div`
|
|
1038
1038
|
display: flex;
|
|
1039
1039
|
flex-direction: row;
|
|
1040
1040
|
justify-content: space-between;
|
|
1041
1041
|
align-items: center;
|
|
1042
|
-
`,Pn=
|
|
1042
|
+
`,Pn=Ze.p`
|
|
1043
1043
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1044
1044
|
font-style: normal;
|
|
1045
1045
|
font-weight: 500;
|
|
1046
1046
|
font-size: 16px;
|
|
1047
1047
|
line-height: 18px;
|
|
1048
1048
|
margin-left: 8px;
|
|
1049
|
-
`,vn=
|
|
1049
|
+
`,vn=Ze.div`
|
|
1050
1050
|
padding: 20px;
|
|
1051
1051
|
cursor: pointer;
|
|
1052
1052
|
:hover {
|
|
1053
1053
|
opacity: 0.8;
|
|
1054
1054
|
}
|
|
1055
|
-
`,
|
|
1055
|
+
`,Fx=Ze.div``,En=Ze.p`
|
|
1056
1056
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1057
1057
|
font-weight: 400;
|
|
1058
1058
|
font-size: 14px;
|
|
1059
1059
|
line-height: 22px;
|
|
1060
|
-
`,
|
|
1060
|
+
`,Bn=Ze.div`
|
|
1061
1061
|
display: flex;
|
|
1062
1062
|
flex-direction: row;
|
|
1063
1063
|
justify-content: flex-start;
|
|
1064
1064
|
align-items: center;
|
|
1065
|
-
`;var An=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:n,onSecondaryButtonClick:r,appearance:i,customStepTypes:s})=>{var
|
|
1065
|
+
`;var An=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:n,onSecondaryButtonClick:r,appearance:i,customStepTypes:s})=>{var S,c;let p=t?{}:{transform:"rotate(90deg)"};function d(){return ue.createElement(ue.Fragment,null,e.imageUri||e.videoUri?ue.createElement(Tn,{className:l("stepMediaContainer",i)},e.imageUri?ue.createElement(Fn,{className:l("stepImage",i),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?ue.createElement(Bt,{appearance:i,videoUri:e.videoUri}):null):null,ue.createElement(En,{className:l("stepSubtitle",i),appearance:i,dangerouslySetInnerHTML:ce(e.subtitle)}),ue.createElement(xo,{className:l("checklistCTAContainer",i)},e.secondaryButtonTitle?ue.createElement(re,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:i}):null,ue.createElement(re,{title:e.primaryButtonTitle??"Continue",onClick:()=>n(),appearance:i})))}function a(){if(!s)return null;let h=s[e.type];return h?h(e,i):null}return ue.createElement(wn,{onClick:()=>t?o():null,"data-testid":`step-${e.id}`,className:l("checklistStepContainer",i),appearance:i},ue.createElement(kn,{className:l("stepHeader",i)},ue.createElement(Bn,null,ue.createElement(Fo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(S=i==null?void 0:i.theme)==null?void 0:S.colorPrimary,appearance:i}),ue.createElement(Pn,{appearance:i,className:l("stepTitle",i),dangerouslySetInnerHTML:ce(e.title)})),ue.createElement(vn,{className:l("stepChevronContainer",i),onClick:()=>o()},ue.createElement(Dt,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(c=i==null?void 0:i.theme)==null?void 0:c.colorTextSecondary}))),ue.createElement(Ip,null,!t&&ue.createElement(Np.div,{initial:{opacity:1,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:1,height:0},key:e.id,style:{overflow:"hidden"}},a()??d())))};import $t from"styled-components";var Ux=$t.div`
|
|
1066
1066
|
background: #ffffff;
|
|
1067
1067
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1068
1068
|
border-radius: 6px;
|
|
@@ -1076,43 +1076,42 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1076
1076
|
|
|
1077
1077
|
max-width: 800px;
|
|
1078
1078
|
min-width: 350px;
|
|
1079
|
-
`,In
|
|
1079
|
+
`,In=$t.div`
|
|
1080
1080
|
display: flex;
|
|
1081
1081
|
flex-direction: column;
|
|
1082
|
-
`,Nn
|
|
1082
|
+
`,Nn=$t.h1`
|
|
1083
1083
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1084
1084
|
font-style: normal;
|
|
1085
1085
|
font-weight: 700;
|
|
1086
1086
|
font-size: 20px;
|
|
1087
1087
|
line-height: 24px;
|
|
1088
1088
|
margin-bottom: 8px;
|
|
1089
|
-
`,Ln
|
|
1089
|
+
`,Ln=$t.h2`
|
|
1090
1090
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1091
1091
|
font-weight: 400;
|
|
1092
1092
|
font-size: 14px;
|
|
1093
1093
|
line-height: 23px;
|
|
1094
1094
|
margin: 2px 0 0 0;
|
|
1095
|
-
`,On
|
|
1095
|
+
`,On=$t.div`
|
|
1096
1096
|
display: block;
|
|
1097
1097
|
width: 100%;
|
|
1098
|
-
`,Dn
|
|
1098
|
+
`,Dn=$t.div`
|
|
1099
1099
|
display: flex;
|
|
1100
1100
|
width: 100%;
|
|
1101
1101
|
flex-direction: column;
|
|
1102
1102
|
justify-content: space-between;
|
|
1103
1103
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1104
|
-
|
|
1105
|
-
`;var Lp=({title:e,subtitle:t,steps:o,onClose:n,visible:r,autoExpandFirstIncompleteStep:i=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,primaryColor:d="#000000",selectedStep:a,setSelectedStep:x,appearance:c,type:f,className:C,customStepTypes:k})=>{let E=o.filter(S=>S.complete).length,[u,b]=Np(Array(o.length).fill(!0));$n(()=>{let S=[...u];if(i){for(let m=0;m<o.length;m++)if(!o[m].complete){S[m]=!1;break}b(S)}},[]),$n(()=>{v(a)},[a]);let v=S=>{let m=[...u];if(s)for(let h=0;h<u.length;++h)h!==S&&(m[h]=!0);m[S]=!m[S],b(m)};if(!r&&f=="modal")return we.createElement(we.Fragment,null);let P=we.createElement(we.Fragment,null,we.createElement(In,null,we.createElement(Nn,{appearance:c,className:l("checklistTitle",c),dangerouslySetInnerHTML:ce(e)}),we.createElement(Ln,{appearance:c,className:l("checklistSubtitle",c),dangerouslySetInnerHTML:ce(t)})),we.createElement(ze,{display:"percent",count:E,total:o.length,fillColor:d,style:{margin:"14px 0px 8px 0px"},appearance:c})),T=we.createElement(On,{className:Ce(l("checklistContainer",c),C)},o.map((S,m)=>{let h=u[m];return we.createElement(An,{appearance:c,stepData:S,collapsed:h,key:`modal-checklist-${S.id??m}`,onClick:()=>{if(a===m){v(m);return}x(m)},onPrimaryButtonClick:()=>{S.handlePrimaryButtonClick&&S.handlePrimaryButtonClick(),p&&!S.completionCriteria&&m<u.length-1&&u[m+1]&&x(m+1)},onSecondaryButtonClick:()=>{S.handleSecondaryButtonClick&&S.handleSecondaryButtonClick()},customStepTypes:k})}));return f==="inline"?we.createElement(Dn,{appearance:c,className:Ce(l("checklistInlineContainer",c),C)},P,T):we.createElement(we.Fragment,null,we.createElement(ot,{onClose:n,visible:r,appearance:c,style:{maxWidth:"600px"},headerContent:P},T))},pr=Lp;import le,{useEffect as dr,useRef as _p,useState as yt}from"react";import $t from"react";import pe,{css as Mn,keyframes as Un}from"styled-components";var _n=Mn`
|
|
1104
|
+
`;var Op=({title:e,subtitle:t,steps:o,onClose:n,visible:r,autoExpandFirstIncompleteStep:i=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,primaryColor:d="#000000",selectedStep:a,setSelectedStep:S,appearance:c,type:h,className:f,customStepTypes:v,style:F})=>{let C=o.filter(m=>m.complete).length,[y,T]=Lp(Array(o.length).fill(!0));$n(()=>{let m=[...y];if(i){for(let x=0;x<o.length;x++)if(!o[x].complete){m[x]=!1;break}T(m)}},[]),$n(()=>{k(a)},[a]);let k=m=>{let x=[...y];if(s)for(let g=0;g<y.length;++g)g!==m&&(x[g]=!0);x[m]=!x[m],T(x)};if(!r&&h=="modal")return we.createElement(we.Fragment,null);let A=we.createElement(we.Fragment,null,we.createElement(In,null,we.createElement(Nn,{appearance:c,className:l("checklistTitle",c),dangerouslySetInnerHTML:ce(e)}),we.createElement(Ln,{appearance:c,className:l("checklistSubtitle",c),dangerouslySetInnerHTML:ce(t)})),we.createElement(ze,{display:"percent",count:C,total:o.length,fillColor:d,style:{margin:"14px 0px 8px 0px"},appearance:c})),b=we.createElement(On,{className:Ce(l("checklistContainer",c),f)},o.map((m,x)=>{let g=y[x];return we.createElement(An,{appearance:c,stepData:m,collapsed:g,key:`modal-checklist-${m.id??x}`,onClick:()=>{if(a===x){k(x);return}S(x)},onPrimaryButtonClick:()=>{m.handlePrimaryButtonClick&&m.handlePrimaryButtonClick(),p&&!m.completionCriteria&&x<y.length-1&&y[x+1]&&S(x+1)},onSecondaryButtonClick:()=>{m.handleSecondaryButtonClick&&m.handleSecondaryButtonClick()},customStepTypes:v})}));return h==="inline"?we.createElement(Dn,{appearance:c,className:Ce(l("checklistInlineContainer",c),f),style:F},A,b):we.createElement(we.Fragment,null,we.createElement(tt,{onClose:n,visible:r,appearance:c,style:{maxWidth:"600px"},headerContent:A},b))},ar=Op;import le,{useEffect as pr,useRef as zp,useState as yt}from"react";import Mt from"react";import pe,{css as Mn,keyframes as Un}from"styled-components";var _n=Mn`
|
|
1106
1105
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1107
|
-
`,
|
|
1106
|
+
`,Dp=Mn`
|
|
1108
1107
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1109
|
-
|
|
1108
|
+
`,$p=Un`
|
|
1110
1109
|
from {
|
|
1111
1110
|
opacity: 0;
|
|
1112
1111
|
} to {
|
|
1113
1112
|
opacity: 1;
|
|
1114
1113
|
}
|
|
1115
|
-
|
|
1114
|
+
`,Mp=Un`
|
|
1116
1115
|
from {
|
|
1117
1116
|
opacity: 1;
|
|
1118
1117
|
} to {
|
|
@@ -1142,7 +1141,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1142
1141
|
scroll-snap-align: center;
|
|
1143
1142
|
scroll-snap-stop: always;
|
|
1144
1143
|
`,Hn=pe.div`
|
|
1145
|
-
animation: ${e=>e.reversed
|
|
1144
|
+
animation: ${e=>e.reversed?Mp:$p} 0.25s ease-out;
|
|
1146
1145
|
background: linear-gradient(
|
|
1147
1146
|
to right,
|
|
1148
1147
|
${({theme:e})=>e.colorBackground}00,
|
|
@@ -1185,8 +1184,8 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1185
1184
|
margin-bottom: 12px;
|
|
1186
1185
|
width: 40px;
|
|
1187
1186
|
`,Kn=pe(jn)`
|
|
1188
|
-
${e=>
|
|
1189
|
-
${
|
|
1187
|
+
${e=>P(e)} {
|
|
1188
|
+
${Dp}
|
|
1190
1189
|
|
|
1191
1190
|
background: ${({theme:e})=>e.colorBackground};
|
|
1192
1191
|
}
|
|
@@ -1204,21 +1203,21 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1204
1203
|
float: right;
|
|
1205
1204
|
margin-bottom: 12px;
|
|
1206
1205
|
padding: 4px 10px;
|
|
1207
|
-
`,
|
|
1206
|
+
`,Up=pe.p`
|
|
1208
1207
|
font-weight: bold;
|
|
1209
1208
|
font-size: 18px;
|
|
1210
1209
|
line-height: 22px;
|
|
1211
1210
|
letter-spacing: calc(18px * -0.01);
|
|
1212
1211
|
margin: 0;
|
|
1213
|
-
`,Qn=pe(
|
|
1212
|
+
`,Qn=pe(Up)`
|
|
1214
1213
|
margin-bottom: 4px;
|
|
1215
|
-
`,
|
|
1214
|
+
`,_p=pe.p`
|
|
1216
1215
|
font-weight: bold;
|
|
1217
1216
|
font-size: 16px;
|
|
1218
1217
|
line-height: 20px;
|
|
1219
1218
|
letter-spacing: calc(16px * -0.01);
|
|
1220
1219
|
margin: 0;
|
|
1221
|
-
`,Zn=pe(
|
|
1220
|
+
`,Zn=pe(_p)`
|
|
1222
1221
|
margin-bottom: 4px;
|
|
1223
1222
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1224
1223
|
`}
|
|
@@ -1240,34 +1239,34 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1240
1239
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1241
1240
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1242
1241
|
`}
|
|
1243
|
-
`;var es=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:n}=
|
|
1242
|
+
`;var es=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:n}=Z(),{primaryCTAClickSideEffects:r}=se();o=n(o);let{imageUri:i=null,subtitle:s=null,title:p=null,complete:d=!1,blocked:a=!1}=e,S=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{r(e)};return Mt.createElement(Gn,{className:l("carouselCard",o),onClick:a?null:c,style:t,blocked:a,complete:d},i&&Mt.createElement(qn,{className:l("carouselCardImage",o),src:i,alt:p,style:{opacity:d||a?.4:1}}),(d||!0)&&Mt.createElement(Xn,{className:l("carouselCompletedPill",o)},Mt.createElement(Rn,{style:{color:"#108E0B"}},"Complete")),p&&Mt.createElement(Zn,{blocked:a,complete:d,className:l("carouselCardTitle",o)},p),s&&Mt.createElement(We.Quiet,{blocked:a,complete:d,className:l("carouselCardSubtitle",o)},s))};import to from"react";var ts=({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 to.createElement(Yn,{className:l("carouselProgressBar",o)},to.createElement(Jn,{as:We.Loud,style:{marginRight:8}},e," of ",t),to.createElement("svg",{height:10,width:r},to.createElement("rect",{x:0,y:0,rx:5,width:r,height:10,fill:"#E6E6E6"}),to.createElement("rect",{x:0,y:0,rx:5,width:i,height:10,fill:"currentColor"})))};var Wp=()=>le.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},le.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),le.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),le.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),os=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[n,r]=yt(!1),[i,s]=yt(!1);pr(()=>{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?le.createElement(Hn,{style:d,reversed:i,onAnimationEnd:i?p:null},le.createElement(Vn,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},le.createElement(Wp,null))):null},rs=({flowId:e,appearance:t,customVariables:o,className:n})=>{let r=zp(null),[i,s]=yt(!1),[p,d]=yt(!1),[a,S]=yt(null),[c,h]=yt([]),[f,v]=yt(0),{getFlowMetadata:F,getFlowSteps:C,getNumberOfStepsCompleted:y,updateCustomVariables:T,getFlowStatus:k,isLoading:A,targetingLogicShouldHideFlow:b,getFlow:m}=Q();pr(()=>{T(o)},[o,A]),pr(()=>{if(A)return;let N=F(e),M=y(e),H=C(e);S(N),N.data!==null&&(h(H.sort((L,ne)=>Number(L.complete)-Number(ne.complete))),d(H.length>3),v(M))},[A]);let x=[];for(let N=0;N<c.length;N+=3)x.push(c.slice(N,N+3));let g=N=>{let M=N.target,H=M.scrollWidth-M.clientWidth,L=Math.ceil(M.scrollLeft);L>0&&i===!1&&s(!0),L===0&&i===!0&&s(!1),L<H&&p===!1&&d(!0),L===H&&p===!0&&d(!1)},I=(N=!0)=>{let M=N?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*M,behavior:"smooth"})},D=null,z=N=>{D!==null?clearTimeout(D):g(N),D=setTimeout(()=>{g(N)},16)};return A?null:le.createElement(Kn,{className:Ce(l("carouselContainer",t),n)},le.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:20}},le.createElement("div",null,le.createElement(Qn,{className:l("carouselTitle",t)},a==null?void 0:a.title),le.createElement(We.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),le.createElement(ts,{numberOfStepsCompleted:f,numberOfSteps:c.length})),le.createElement("div",{style:{position:"relative"}},le.createElement(os,{show:i,onClick:()=>I(!1)}),le.createElement(os,{side:"right",show:p,onClick:I}),le.createElement(zn,{ref:r,onScroll:z},x.map((N,M)=>le.createElement(Wn,{key:M,style:{flex:`0 0 calc(100% - ${c.length>3?36:0}px)`}},N.map((H,L)=>le.createElement(es,{key:L,stepData:H,style:{flex:c.length>3?"0 1 calc(33% - 16px * 2 / 3)":1},appearance:t})))))),le.createElement(ie,{appearance:t}))};var dr=({flowId:e,title:t,subtitle:o,style:n,initialSelectedStep:r,className:i,type:s="inline",onDismiss:p,visible:d,customVariables:a,onStepCompletion:S,onButtonClick:c,appearance:h,hideOnFlowCompletion:f,setVisible:v,customStepTypes:F,checklistStyle:C="default",autoExpandFirstIncompleteStep:y,autoExpandNextStep:T,...k})=>{let{getFlow:A,getFlowSteps:b,markStepCompleted:m,getStepStatus:x,getNumberOfStepsCompleted:g,isLoading:I,targetingLogicShouldHideFlow:D,updateCustomVariables:z,getFlowMetadata:N,isStepBlocked:M,getFlowStatus:H,hasActiveFullPageFlow:L,setHasActiveFullPageFlow:ne}=Q(),{primaryCTAClickSideEffects:fe,secondaryCTAClickSideEffects:Y}=se(),{getOpenFlowState:V,setOpenFlowState:ge}=Fe(),[ee,q]=ns(r||0),[he,Te]=ns(!1),K=d===void 0?V(e):d,ae=s==="modal",{mergeAppearanceWithDefault:_}=Z(),{isLarge:O}=bn();if(h=_(h),is(()=>{z(a)},[a,I]),is(()=>{d!==void 0&&(ae&&d===!0?ne(!0):ae&&d===!1&&ne(!1))},[d,v,L]),I)return null;let te=A(e);if(!te||D(te))return null;let j=b(e);if(!j||f===!0&&H(e)===X)return null;let oe=N(e);if(oe!=null&&oe.title&&(t=oe.title),oe!=null&&oe.subtitle&&(o=oe.subtitle),!he&&r===void 0&&g(e)>0){let B=j.findIndex(J=>J.complete===!1);q(B>-1?B:j.length-1),Te(!0)}function je(){if(ee+1>=j.length){ae&&ge(e,!1);return}M(e,j[ee+1].id)||q(ee+1)}function De(B,J,dt){let xr=ee+1<j.length?j[ee+1]:null;c&&c(B,ee,J,xr)===!0&&ae&&$e(),S&&S(B,dt,xr),!S&&!c&&(B.primaryButtonUri||B.secondaryButtonUri)&&ae&&$e()}function pt(){return j.map((B,J)=>({...B,handleSecondaryButtonClick:()=>{je(),Y(B),B.skippable===!0&&m(e,B.id,{skipped:!0}),De(B,"secondary",J)},handlePrimaryButtonClick:()=>{(!B.completionCriteria&&(B.autoMarkCompleted||B.autoMarkCompleted===void 0)||B.completionCriteria&&B.autoMarkCompleted===!0)&&(m(e,B.id),je()),De(B,"primary",J),fe(B),x(e,B.id)===Ne&&je()}}))}function W(){return de.createElement(ie,{appearance:h})}let ve={steps:pt(),title:t,subtitle:o,primaryColor:h.theme.colorPrimary,appearance:h,customStepTypes:F,type:s,className:i,autoExpandFirstIncompleteStep:y,autoExpandNextStep:T};function $e(){ge(e,!1),p&&p(),v&&v(!1)}function Oo(){return de.createElement(de.Fragment,null,de.createElement(W,null),de.createElement(rs,{flowId:e,appearance:h,customVariables:a,className:i}))}function u(){return de.createElement(de.Fragment,null,de.createElement(W,null),de.createElement(ar,{visible:K,onClose:()=>{$e()},selectedStep:ee,setSelectedStep:q,autoExpandNextStep:!0,appearance:h,...ve}))}function w(){if(!O)return u();let B=k.guideFlowId,J;return B&&A(B)&&(J=b(B)),de.createElement(de.Fragment,null,de.createElement(W,null),de.createElement(lr,{visible:K,stepsTitle:oe.stepsTitle?oe.stepsTitle:"Your quick start guide",onClose:()=>{$e()},selectedStep:ee,setSelectedStep:q,guideData:J,guideTitle:k.guideTitle??"Guide",appearance:h,title:t,subtitle:o,onGuideButtonClick:dt=>{De(dt,"link",0)},customStepTypes:F,...ve}))}function E(){if(!O)return u();let B=de.createElement(nr,{flowId:e,style:n,selectedStep:ee,setSelectedStep:q,appearance:h,type:s,...ve});return ae?de.createElement(tt,{onClose:()=>{$e()},visible:K,appearance:h,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},de.createElement(W,null),B):de.createElement(de.Fragment,null,de.createElement(W,null),B)}switch(C){case"condensed":return u();case"with-guide":return w();case"default":return E();case"carousel":return Oo();default:return E()}};var Vp=e=>Hp.createElement(dr,{type:"inline",...e});import at,{useEffect as Gp}from"react";import He from"react";import Ao from"styled-components";var ss=Ao.div`
|
|
1244
1243
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1245
1244
|
border-radius: 8px;
|
|
1246
1245
|
padding: 6px 10px 6px 10px;
|
|
1247
1246
|
min-width: 160px;
|
|
1248
1247
|
cursor: pointer;
|
|
1249
1248
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1250
|
-
`,ls=
|
|
1249
|
+
`,ls=Ao.div`
|
|
1251
1250
|
display: flex;
|
|
1252
1251
|
flex-direction: row;
|
|
1253
1252
|
justify-content: space-between;
|
|
1254
1253
|
align-items: center;
|
|
1255
1254
|
margin-bottom: 2px;
|
|
1256
1255
|
flex-grow: 2;
|
|
1257
|
-
`,as=
|
|
1256
|
+
`,as=Ao.div`
|
|
1258
1257
|
text-overflow: ellipsis;
|
|
1259
1258
|
font-weight: 600;
|
|
1260
1259
|
font-size: 12px;
|
|
1261
1260
|
line-height: 15px;
|
|
1262
1261
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1263
1262
|
color: ${e=>e.appearance.theme.colorPrimary};
|
|
1264
|
-
`,ps=
|
|
1263
|
+
`,ps=Ao.div`
|
|
1265
1264
|
width: 20px;
|
|
1266
1265
|
margin-right: 8px;
|
|
1267
1266
|
display: flex;
|
|
1268
1267
|
height: 100%;
|
|
1269
1268
|
align-items: center;
|
|
1270
|
-
`;import{motion as
|
|
1269
|
+
`;import{motion as jp}from"framer-motion";var ds=({title:e,count:t,total:o,onClick:n,style:r={},className:i,appearance:s,type:p="default"})=>He.createElement(He.Fragment,null,He.createElement(ie,{appearance:s}),He.createElement(ss,{as:jp.div,whileHover:{opacity:.9},whileTap:{scale:.98},onClick:()=>n!==void 0&&n(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:Ce(i??"",l("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&He.createElement(ps,{className:l("progressRingContainer",s)},He.createElement(vt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),He.createElement(ls,{type:p,className:l("badgeTitleContainer",s)},He.createElement(as,{type:p,appearance:s,className:l("badgeTitle",s)},e),n!==void 0&&He.createElement(Dt,{className:l("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&He.createElement(ze,{display:"compact",count:t,total:o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import lt from"react";import oo from"styled-components";var cs=oo.div`
|
|
1271
1270
|
display: flex;
|
|
1272
1271
|
flex-direction: row;
|
|
1273
1272
|
width: 100%;
|
|
@@ -1279,7 +1278,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1279
1278
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1280
1279
|
border-radius: 12px;
|
|
1281
1280
|
`,ms=oo.div`
|
|
1282
|
-
${e=>
|
|
1281
|
+
${e=>P(e)} {
|
|
1283
1282
|
display: flex;
|
|
1284
1283
|
justify-content: center;
|
|
1285
1284
|
align-items: center;
|
|
@@ -1296,7 +1295,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1296
1295
|
justify-content: center;
|
|
1297
1296
|
margin-left: 16px;
|
|
1298
1297
|
min-width: 200px;
|
|
1299
|
-
`,
|
|
1298
|
+
`,t0=oo.div`
|
|
1300
1299
|
display: flex;
|
|
1301
1300
|
justify-content: center;
|
|
1302
1301
|
align-items: flex-end;
|
|
@@ -1305,7 +1304,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1305
1304
|
:hover {
|
|
1306
1305
|
opacity: 0.8;
|
|
1307
1306
|
}
|
|
1308
|
-
`;var gs=({title:e,subtitle:t,icon:o,appearance:n,count:r,total:i,className:s,style:p})=>
|
|
1307
|
+
`;var gs=({title:e,subtitle:t,icon:o,appearance:n,count:r,total:i,className:s,style:p})=>lt.createElement(lt.Fragment,null,lt.createElement(cs,{appearance:n,className:Ce(l("fullWidthProgressBadgeContainer",n),s??""),style:p},o&<.createElement(ms,{className:l("fullWidthProgressBadgeIcon",n)},o),lt.createElement(us,null,lt.createElement(Se,{size:"small",appearance:n,title:e,subtitle:t})),lt.createElement(fs,{className:l("fullWidthProgressBadgeProgressContainer",n)},lt.createElement(ze,{count:r,total:i,display:"percent",textLocation:"top",fillColor:n.theme.colorPrimary}))));var qp=({flowId:e,title:t,subtitle:o,icon:n,style:r,onClick:i,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:a,type:S="default"})=>{let{getFlow:c,getFlowSteps:h,getFlowStatus:f,getNumberOfStepsCompleted:v,isLoading:F,targetingLogicShouldHideFlow:C,updateCustomVariables:y}=Q(),{mergeAppearanceWithDefault:T}=Z();a=T(a);let{setOpenFlowState:k,getOpenFlowState:A}=Fe();if(Gp(()=>{y(p)},[p,F]),F)return null;let b=c(e);if(!b||C(b)||d===!0&&f(e)===X)return null;let m=h(e),x=v(e);return S==="full-width"?at.createElement(at.Fragment,null,at.createElement(ie,{appearance:a}),at.createElement(gs,{title:t,subtitle:o,count:x,total:m.length,style:r,className:s,appearance:a,icon:n,onClick:()=>{}})):at.createElement(at.Fragment,null,at.createElement(ie,{appearance:a}),at.createElement(ds,{count:x,total:m.length,title:t,style:r,onClick:()=>{k(e,!0),i&&i()},type:S,className:s,appearance:a}))};import Kp from"react";var Yp=({flowId:e,style:t,appearance:o,...n})=>{let{getFlow:r,targetingLogicShouldHideFlow:i,getFlowSteps:s}=Q(),{mergeAppearanceWithDefault:p}=Z();o=p(o);let d=r(e);if(!d||i(d))return null;let a=s(e);return Kp.createElement(eo,{steps:a,style:t,appearance:o,...n})};import _t,{useContext as sd,useEffect as ld}from"react";import $,{useEffect as Io,useLayoutEffect as Cs,useRef as Rp,useState as ro}from"react";import io from"styled-components";import{useCallback as Jp,useEffect as Xp,useState as Qp}from"react";var cr=(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}},hs={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0};function Zp(e){let t=hs;return e&&(t=e.getBoundingClientRect()),t}function xs(e,t){let[o,n]=Qp(hs),r=Jp(()=>{e&&n(Zp(e))},[e]);return Xp(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),o}var Ss=300,ys=100,ed=500,Ut=12,td=io.div`
|
|
1309
1308
|
width: 100%;
|
|
1310
1309
|
height: 100%;
|
|
1311
1310
|
border-radius: 9999px;
|
|
@@ -1328,14 +1327,14 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1328
1327
|
opacity: 0;
|
|
1329
1328
|
}
|
|
1330
1329
|
}
|
|
1331
|
-
`,
|
|
1332
|
-
width: ${
|
|
1333
|
-
height: ${
|
|
1330
|
+
`,od=io.div`
|
|
1331
|
+
width: ${Ut}px;
|
|
1332
|
+
height: ${Ut}px;
|
|
1334
1333
|
border-radius: 100px;
|
|
1335
1334
|
background-color: ${e=>e.primaryColor};
|
|
1336
1335
|
z-index: 20;
|
|
1337
1336
|
opacity: 1;
|
|
1338
|
-
`,
|
|
1337
|
+
`,rd=io.div`
|
|
1339
1338
|
pointer-events: all;
|
|
1340
1339
|
`,bs=io.div`
|
|
1341
1340
|
display: flex;
|
|
@@ -1343,11 +1342,11 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1343
1342
|
justify-content: center;
|
|
1344
1343
|
align-items: center;
|
|
1345
1344
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1346
|
-
`,
|
|
1347
|
-
width: ${
|
|
1348
|
-
height: ${
|
|
1349
|
-
`,
|
|
1350
|
-
${e=>
|
|
1345
|
+
`,id=io(bs)`
|
|
1346
|
+
width: ${Ut+12}px;
|
|
1347
|
+
height: ${Ut+12}px;
|
|
1348
|
+
`,nd=({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:a=0,customStepTypes:S,appearance:c,dismissible:h=!1,showHighlightOnly:f,showStepCount:v=!0,completedStepsCount:F=0,showFrigadeBranding:C=!1})=>{var oe,je,De,pt;let[y,T]=ro(),[k,A]=ro(new Date),b=Rp(null),[m,x]=ro(document.querySelector(e[a].selector)),g=xs(m,k),[I,D]=ro(),[z,N]=ro(!f),M=(je=(oe=e[a])==null?void 0:oe.props)!=null&&je.position?e[a].props.position:"absolute",H=((pt=(De=e[a])==null?void 0:De.props)==null?void 0:pt.zIndex)??90,L=(y==null?void 0:y.width)??Ss,ne=(y==null?void 0:y.height)??ys;Cs(()=>{b.current&&T({width:b.current.clientWidth,height:b.current.clientHeight})},[a,k,M]),Io(()=>{f||N(!0)},[a]);let fe=n==="auto"?"right":n,Y=cr(g,fe,L,s,M),V=g.right+L>(window.innerWidth||document.documentElement.clientWidth),ge=g.bottom+ys>(window.innerHeight||document.documentElement.clientHeight);V&&n==="auto"&&(Y=cr(g,"left",L,s,M),fe="left");let ee=window.location.pathname.split("/").pop(),q=()=>{let W=document.querySelector(e[a].selector);I&&I===JSON.stringify(W==null?void 0:W.getBoundingClientRect())||(x(W),A(new Date),W&&D(JSON.stringify(W.getBoundingClientRect())))};if(Io(()=>{let W=new MutationObserver(q);return W.observe(document.body,{subtree:!0,childList:!0}),()=>W.disconnect()},[q]),Io(()=>{let W=new MutationObserver(q);return W.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>W.disconnect()},[q]),Io(()=>{let W=setInterval(()=>{q()},10);return()=>clearInterval(W)},[q]),Cs(()=>{setTimeout(()=>{q()},ed),q()},[a,ee]),m===null)return $.createElement($.Fragment,null);if(Y.x==0&&Y.y==0)return $.createElement($.Fragment,null);if(!p)return $.createElement($.Fragment,null);let he=()=>{let W=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),N(!1),setTimeout(()=>{q()},30)),F===e.length-1)return o()},ve=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),f&&!e[a].secondaryButtonUri&&N(!1))};return $.createElement($.Fragment,null,v&&e.length>1&&$.createElement(Ar,null,$.createElement(Nr,{className:l("tooltipStepCounter",c)},a+1," of ",e.length)),$.createElement(Ir,{showStepCount:v,className:l("tooltipCTAContainer",c)},e[a].secondaryButtonTitle&&$.createElement(re,{title:e[a].secondaryButtonTitle,appearance:c,onClick:ve,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&$.createElement(re,{title:e[a].primaryButtonTitle,appearance:c,onClick:W,withMargin:!1,size:"small"})))},Te=()=>$.createElement($.Fragment,null,h&&$.createElement(Pr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:l("tooltipClose",c)},$.createElement(ke,null)),e[a].imageUri&&$.createElement(vr,{dismissible:h,appearance:c,src:e[a].imageUri,className:l("tooltipImageContainer",c)}),e[a].videoUri&&!e[a].imageUri&&$.createElement(Er,{dismissible:h,appearance:c,className:l("tooltipVideoContainer",c)},$.createElement(Bt,{appearance:c,videoUri:e[a].videoUri})),$.createElement(Se,{appearance:c,title:e[a].title,subtitle:e[a].subtitle,size:"small"}),$.createElement(Br,{className:l("tooltipFooter",c)},$.createElement(he,null))),ae={...{default:W=>{var ve;if((ve=e[a])!=null&&ve.StepContent){let $e=e[a].StepContent;return $.createElement("div",null,$e)}return $.createElement(Te,null)}},...S},_=()=>{var W;return e?!((W=e[a])!=null&&W.type)||!ae[e[a].type]?ae.default(e[a]):ae[e[a].type]({stepData:e[a],primaryColor:i}):$.createElement($.Fragment,null)};if(f&&e[a].complete===!0)return null;let O={top:(Y==null?void 0:Y.y)-Ut,left:(fe=="left"?g.x+s.x:(Y==null?void 0:Y.x)-Ut)??0,cursor:f?"pointer":"default",position:M},te=()=>{let ve=O.left+(fe=="left"?-L:24);return Math.min(Math.max(ve,20),window.innerWidth-L-20)},j=()=>{f&&(A(new Date),N(!z))};return $.createElement(rd,null,$.createElement(id,{style:O,zIndex:H,className:l("tourHighlightContainer",c)},r&&e[a].showHighlight!==!1&&$.createElement($.Fragment,null,$.createElement(od,{style:{position:M},onClick:j,primaryColor:c.theme.colorPrimary,className:l("tourHighlightInnerCircle",c)}),$.createElement(td,{style:{position:"absolute"},onClick:j,primaryColor:c.theme.colorPrimary,className:l("tourHighlightOuterCircle",c)}))),$.createElement(bs,{style:{...O,left:te()},zIndex:H+1,className:l("tooltipContainerWrapper",c)},z&&$.createElement($.Fragment,null,$.createElement(lo,{ref:b,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:12,...d},appearance:c,className:l("tooltipContainer",c),maxWidth:Ss,zIndex:H+10},$.createElement(_,null)),C&&$.createElement(Or,{className:l("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:H+10},$.createElement(ao,{appearance:c})))))},No=nd;import{Portal as ad}from"react-portal";var pd=({flowId:e,customVariables:t,appearance:o,onStepCompletion:n,onButtonClick:r,showTooltipsSimultaneously:i=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:a=!1,dismissBehavior:S="complete-flow",onComplete:c,skipIfNotFound:h=!1,...f})=>{let{getFlow:v,getFlowSteps:F,isLoading:C,targetingLogicShouldHideFlow:y,markStepCompleted:T,markStepStarted:k,markFlowCompleted:A,updateCustomVariables:b,getCurrentStepIndex:m,getStepStatus:x,isStepBlocked:g,getFlowStatus:I,getNumberOfStepsCompleted:D}=Q(),{isLoadingUserFlowStateData:z}=Be(),{primaryCTAClickSideEffects:N,secondaryCTAClickSideEffects:M}=se(),{hasOpenModals:H}=Fe(),L=m(e),{openFlowStates:ne}=sd(G),{mergeAppearanceWithDefault:fe}=Z();if(o=fe(o),ld(()=>{b(t)},[t,C]),z)return null;let Y=v(e);if(!Y||y(Y)||I(e)==X||H())return null;let V=F(e);if(Object.keys(ne).length>0){let _=Object.keys(ne).find(O=>ne[O]===!0);if(_!==void 0&&_!==e)return _t.createElement(_t.Fragment,null)}async function ge(_){if(await T(e,_.id),V.map(O=>x(e,O.id)).every(O=>O===Ne)){await A(e);return}if(!a&&L+1<V.length){if(g(e,V[L+1].id))return;await k(e,V[L+1].id)}}function ee(_,O,te){let j=L+1<V.length?V[L+1]:null;r&&r(_,L,O,j),n&&n(_,te,j)}function q(){return V.map(_=>({..._,handleSecondaryButtonClick:async()=>{M(_),_.skippable===!0&&await T(e,_.id,{skipped:!0}),ee(_,"secondary",L)},handlePrimaryButtonClick:async()=>{(!_.completionCriteria&&(_.autoMarkCompleted||_.autoMarkCompleted===void 0)||_.completionCriteria&&_.autoMarkCompleted===!0)&&await ge(_),ee(_,"primary",L),N(_)}}))}async function he(_){s&&s(),S==="complete-flow"?await A(e):await T(e,_.id)}function Te(){c&&c()}let K=!document.querySelector(V[L].selector);function ae(){let _=V.findIndex(O=>!!document.querySelector(O.selector));return V.map((O,te)=>K&&!i&&te!==_&&h?null:_t.createElement(No,{key:O.id,appearance:o,steps:q(),selectedStep:te,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>he(O),tooltipPosition:d,showHighlightOnly:a,completedStepsCount:D(e),onComplete:Te,...f}))}return _t.createElement(ad,null,_t.createElement(ie,{appearance:o}),i||K&&h?ae():_t.createElement(No,{appearance:o,steps:q(),selectedStep:L,showTooltipsSimultaneously:i,dismissible:p,onDismiss:()=>he(V[L]),tooltipPosition:d,completedStepsCount:D(e),showHighlightOnly:a,onComplete:Te,...f}))};import be,{useEffect as dd,useRef as cd,useState as md}from"react";import{Portal as ud}from"react-portal";import bt from"styled-components";var ws=bt.button`
|
|
1349
|
+
${e=>P(e)} {
|
|
1351
1350
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1352
1351
|
|
|
1353
1352
|
display: flex;
|
|
@@ -1365,12 +1364,12 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1365
1364
|
}
|
|
1366
1365
|
}
|
|
1367
1366
|
`,Ts=bt.span`
|
|
1368
|
-
${e=>
|
|
1367
|
+
${e=>P(e)} {
|
|
1369
1368
|
font-size: 12px;
|
|
1370
1369
|
display: inline-block;
|
|
1371
1370
|
}
|
|
1372
1371
|
`,Fs=bt.span`
|
|
1373
|
-
${e=>
|
|
1372
|
+
${e=>P(e)} {
|
|
1374
1373
|
font-size: 12px;
|
|
1375
1374
|
display: inline-block;
|
|
1376
1375
|
}
|
|
@@ -1385,7 +1384,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1385
1384
|
align-items: flex-end;
|
|
1386
1385
|
z-index: 50;
|
|
1387
1386
|
`,Ps=bt.button`
|
|
1388
|
-
${e=>
|
|
1387
|
+
${e=>P(e)} {
|
|
1389
1388
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1390
1389
|
background-color: #ffffff;
|
|
1391
1390
|
border: 1px solid #f5f5f5;
|
|
@@ -1401,7 +1400,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1401
1400
|
border-radius: 45px;
|
|
1402
1401
|
cursor: pointer;
|
|
1403
1402
|
`,vs=bt.div`
|
|
1404
|
-
${e=>
|
|
1403
|
+
${e=>P(e)} {
|
|
1405
1404
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1406
1405
|
background: #ffffff;
|
|
1407
1406
|
}
|
|
@@ -1417,8 +1416,8 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1417
1416
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1418
1417
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1419
1418
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1420
|
-
`,
|
|
1421
|
-
${e=>
|
|
1419
|
+
`,Es=bt.button`
|
|
1420
|
+
${e=>P(e)} {
|
|
1422
1421
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1423
1422
|
color: #434343;
|
|
1424
1423
|
:hover {
|
|
@@ -1434,8 +1433,8 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1434
1433
|
font-size: 14px;
|
|
1435
1434
|
|
|
1436
1435
|
padding: 8px 12px;
|
|
1437
|
-
`;import{AnimatePresence as Ls,motion as Os}from"framer-motion";import
|
|
1438
|
-
${e=>
|
|
1436
|
+
`;import{AnimatePresence as Ls,motion as Os}from"framer-motion";import Bs from"react";var As=({style:e,className:t})=>Bs.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Bs.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import Is from"react";var Ns=({style:e,className:t})=>Is.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},Is.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var fd=({flowId:e,style:t,onStepCompletion:o,visible:n=!0,type:r="inline",title:i="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:a,getStepStatus:S,getNumberOfStepsCompleted:c,isLoading:h,targetingLogicShouldHideFlow:f}=Q(),{primaryCTAClickSideEffects:v}=se(),F=cd(null),[C,y]=md(!1),{mergeAppearanceWithDefault:T}=Z();s=T(s),dd(()=>(document.addEventListener("click",k,!1),()=>{document.removeEventListener("click",k,!1)}),[]);let k=g=>{F.current&&!F.current.contains(g.target)&&y(!1)};if(h)return null;let A=p(e);if(!A||f(A))return null;let b=d(e);if(!b||!n)return null;function m(g,I){!g.completionCriteria&&(g.autoMarkCompleted||g.autoMarkCompleted===void 0)&&a(e,g.id),v(g),o&&o(g,I),y(!1)}function x(){return C&&be.createElement(vs,{className:l("floatingWidgetMenu",s),as:Os.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},b.map((g,I)=>be.createElement(Es,{className:l("floatingWidgetMenuItem",s),key:I,onClick:()=>m(g,I)},g.title)))}return r=="inline"?be.createElement("span",{ref:F},be.createElement(ws,{style:t,onClick:()=>{y(!C)},className:l("supportButton",s)},be.createElement(Fs,{className:l("supportIconContainer",s)},be.createElement(Ns,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),be.createElement(Ts,{className:l("supportButtonTitle",s)},i)),be.createElement(Ls,null,be.createElement(x,null))):be.createElement(ud,null,be.createElement(ks,{style:t,ref:F},be.createElement(Ls,null,be.createElement(x,null)),be.createElement(Ps,{onClick:()=>{y(!C)},as:Os.button,whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},be.createElement(As,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import Ve,{useEffect as gd}from"react";import Lo from"styled-components";var Ds=Lo.div`
|
|
1437
|
+
${e=>P(e)} {
|
|
1439
1438
|
display: flex;
|
|
1440
1439
|
flex-direction: column;
|
|
1441
1440
|
width: 100%;
|
|
@@ -1449,18 +1448,18 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1449
1448
|
border-radius: 12px;
|
|
1450
1449
|
position: relative;
|
|
1451
1450
|
}
|
|
1452
|
-
`,$s=
|
|
1451
|
+
`,$s=Lo.div`
|
|
1453
1452
|
display: flex;
|
|
1454
1453
|
flex-direction: column;
|
|
1455
1454
|
flex: 1;
|
|
1456
|
-
`,Ms=
|
|
1455
|
+
`,Ms=Lo.div`
|
|
1457
1456
|
display: flex;
|
|
1458
1457
|
flex-direction: column;
|
|
1459
1458
|
justify-content: center;
|
|
1460
1459
|
align-items: flex-start;
|
|
1461
1460
|
margin-top: 16px;
|
|
1462
|
-
`,Us=
|
|
1463
|
-
${e=>
|
|
1461
|
+
`,Us=Lo.div`
|
|
1462
|
+
${e=>P(e)} {
|
|
1464
1463
|
position: absolute;
|
|
1465
1464
|
top: 16px;
|
|
1466
1465
|
right: 16px;
|
|
@@ -1470,9 +1469,9 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1470
1469
|
opacity: 0.8;
|
|
1471
1470
|
}
|
|
1472
1471
|
}
|
|
1473
|
-
`;var
|
|
1472
|
+
`;var hd=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:r,className:i,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:a,markStepCompleted:S,isLoading:c,targetingLogicShouldHideFlow:h,updateCustomVariables:f,getFlowSteps:v,getFlowStatus:F,getCurrentStepIndex:C}=Q(),{primaryCTAClickSideEffects:y}=se(),{mergeAppearanceWithDefault:T}=Z();if(r=T(r),gd(()=>{f(o)},[o,c]),c)return null;let k=d(e);if(!k||h(k)||F(e)===X)return null;let b=v(e)[C(e)];return Ve.createElement(Ve.Fragment,null,Ve.createElement(ie,{appearance:r}),Ve.createElement(Ds,{appearance:r,className:Ce(l("embeddedTipContainer",r),i),style:s},(p===!0||b.dismissible)&&Ve.createElement(Us,{onClick:async()=>{await a(e),t&&t()},className:l("embeddedTipDismissButton",r)},Ve.createElement(ke,null)),Ve.createElement($s,null,Ve.createElement(Se,{size:"small",appearance:r,title:b.title,subtitle:b.subtitle})),b.primaryButtonTitle&&Ve.createElement(Ms,{className:l("embeddedTipCallToActionContainer",r)},Ve.createElement(re,{classPrefix:"embeddedTip",title:b.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"inline",onClick:async()=>{b.handlePrimaryButtonClick(),y(b),!(n&&n(b,C(e),"primary")===!1)&&(await S(e,b.id),await a(e))}}))))};import xe,{useEffect as xd}from"react";import zt from"styled-components";var _s=zt.div`
|
|
1474
1473
|
// use the :not annotation
|
|
1475
|
-
${e=>
|
|
1474
|
+
${e=>P(e)} {
|
|
1476
1475
|
display: flex;
|
|
1477
1476
|
flex-direction: ${e=>e.type==="square"?"column":"row"};
|
|
1478
1477
|
width: 100%;
|
|
@@ -1484,24 +1483,24 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1484
1483
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1485
1484
|
border-radius: 12px;
|
|
1486
1485
|
}
|
|
1487
|
-
`,zs=
|
|
1488
|
-
${e=>
|
|
1486
|
+
`,zs=zt.div`
|
|
1487
|
+
${e=>P(e)} {
|
|
1489
1488
|
display: flex;
|
|
1490
1489
|
width: 36px;
|
|
1491
1490
|
height: 36px;
|
|
1492
1491
|
}
|
|
1493
|
-
`,Ws=
|
|
1492
|
+
`,Ws=zt.div`
|
|
1494
1493
|
display: flex;
|
|
1495
1494
|
flex-direction: column;
|
|
1496
1495
|
flex: 1;
|
|
1497
1496
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1498
1497
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1499
|
-
`,Hs=
|
|
1498
|
+
`,Hs=zt.div`
|
|
1500
1499
|
display: flex;
|
|
1501
1500
|
flex-direction: column;
|
|
1502
1501
|
justify-content: center;
|
|
1503
1502
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1504
|
-
`,
|
|
1503
|
+
`,mr=zt.div`
|
|
1505
1504
|
display: flex;
|
|
1506
1505
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1507
1506
|
align-items: flex-end;
|
|
@@ -1510,13 +1509,13 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1510
1509
|
:hover {
|
|
1511
1510
|
opacity: 0.8;
|
|
1512
1511
|
}
|
|
1513
|
-
`,
|
|
1512
|
+
`,ur=zt.div`
|
|
1514
1513
|
display: flex;
|
|
1515
1514
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1516
1515
|
align-items: flex-end;
|
|
1517
1516
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1518
|
-
`;import Vs from"react";var js=({style:e,className:t})=>Vs.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"},Vs.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
|
|
1519
|
-
${e=>
|
|
1517
|
+
`;import Vs from"react";var js=({style:e,className:t})=>Vs.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"},Vs.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 Cd=({flowId:e,title:t,subtitle:o,onDismiss:n,customVariables:r,onButtonClick:i,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:a,markFlowCompleted:S,isLoading:c,targetingLogicShouldHideFlow:h,updateCustomVariables:f,getFlowMetadata:v,getFlowStatus:F,getFlowSteps:C,getCurrentStepIndex:y}=Q(),{primaryCTAClickSideEffects:T}=se(),{mergeAppearanceWithDefault:k}=Z();if(s=k(s),xd(()=>{f(r)},[r,c]),c)return null;let A=a(e);if(!A||h(A)||F(e)===X)return null;let b=C(e),m=b.length>0?b[y(e)]:v(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),xe.createElement(xe.Fragment,null,xe.createElement(ie,{appearance:s}),xe.createElement(_s,{type:p,appearance:s,className:l("bannerContainer",s)},p!="square"&&xe.createElement(zs,{className:l("bannerIconContainer",s)},d||xe.createElement(js,null)),p==="square"&&m.dismissible&&xe.createElement(ur,{type:p,className:l("bannerDismissButtonContainer",s)},xe.createElement(mr,{type:p,onClick:async()=>{await S(e),n&&n()},className:l("bannerDismissButton",s)},xe.createElement(ke,null))),xe.createElement(Ws,{type:p},xe.createElement(Se,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),xe.createElement(Hs,{type:p,className:l("bannerCallToActionContainer",s)},xe.createElement(re,{title:(m==null?void 0:m.primaryButtonTitle)??"Get started",appearance:s,onClick:()=>{T(m),i&&i(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&xe.createElement(ur,{type:p,className:l("bannerDismissButtonContainer",s)},xe.createElement(mr,{type:p,onClick:async()=>{await S(e),n&&n()},className:l("bannerDismissButton",s)},xe.createElement(ke,null)))))};import R,{useEffect as Sd}from"react";import{Portal as yd}from"react-portal";import Re from"styled-components";var Gs=Re.div`
|
|
1518
|
+
${e=>P(e)} {
|
|
1520
1519
|
display: flex;
|
|
1521
1520
|
flex-direction: column;
|
|
1522
1521
|
width: 100%;
|
|
@@ -1536,7 +1535,7 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1536
1535
|
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
1537
1536
|
min-width: 550px;
|
|
1538
1537
|
}
|
|
1539
|
-
`,qs=
|
|
1538
|
+
`,qs=Re.button`
|
|
1540
1539
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1541
1540
|
border-radius: 8px;
|
|
1542
1541
|
// If selected make border color primary and text color color priamry
|
|
@@ -1557,31 +1556,31 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1557
1556
|
display: flex;
|
|
1558
1557
|
justify-content: center;
|
|
1559
1558
|
align-items: center;
|
|
1560
|
-
`,
|
|
1559
|
+
`,fr=Re.div`
|
|
1561
1560
|
display: flex;
|
|
1562
1561
|
justify-content: flex-end;
|
|
1563
1562
|
margin-top: 16px;
|
|
1564
1563
|
gap: 8px;
|
|
1565
|
-
`,Ks=
|
|
1564
|
+
`,Ks=Re.div`
|
|
1566
1565
|
display: flex;
|
|
1567
1566
|
justify-content: space-between;
|
|
1568
1567
|
margin-top: 8px;
|
|
1569
|
-
`,
|
|
1568
|
+
`,gr=Re.div`
|
|
1570
1569
|
font-size: 12px;
|
|
1571
1570
|
line-height: 16px;
|
|
1572
1571
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1573
|
-
`,
|
|
1572
|
+
`,hr=Re.div`
|
|
1574
1573
|
display: flex;
|
|
1575
1574
|
flex-direction: column;
|
|
1576
1575
|
flex: 1;
|
|
1577
|
-
`,
|
|
1576
|
+
`,my=Re.div`
|
|
1578
1577
|
display: flex;
|
|
1579
1578
|
flex-direction: column;
|
|
1580
1579
|
justify-content: center;
|
|
1581
1580
|
align-items: flex-start;
|
|
1582
1581
|
margin-top: 16px;
|
|
1583
|
-
`,Ys=
|
|
1584
|
-
${e=>
|
|
1582
|
+
`,Ys=Re.textarea`
|
|
1583
|
+
${e=>P(e)} {
|
|
1585
1584
|
margin-top: 16px;
|
|
1586
1585
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1587
1586
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
@@ -1591,8 +1590,8 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1591
1590
|
width: 100%;
|
|
1592
1591
|
height: 100px;
|
|
1593
1592
|
}
|
|
1594
|
-
`,Js=
|
|
1595
|
-
${e=>
|
|
1593
|
+
`,Js=Re.div`
|
|
1594
|
+
${e=>P(e)} {
|
|
1596
1595
|
position: absolute;
|
|
1597
1596
|
top: 16px;
|
|
1598
1597
|
right: 16px;
|
|
@@ -1602,5 +1601,5 @@ ${n=>n.inlineStyles.map(([r,i])=>`.${Vt}${r}.${Vt}${r} { ${Object.entries(i).map
|
|
|
1602
1601
|
opacity: 0.8;
|
|
1603
1602
|
}
|
|
1604
1603
|
}
|
|
1605
|
-
`;var
|
|
1604
|
+
`;var bd=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:r,className:i,style:s})=>{let{getFlow:p,markFlowCompleted:d,markStepCompleted:a,getNumberOfStepsCompleted:S,isLoading:c,targetingLogicShouldHideFlow:h,updateCustomVariables:f,getFlowSteps:v,getFlowStatus:F,getCurrentStepIndex:C}=Q(),{primaryCTAClickSideEffects:y}=se(),{mergeAppearanceWithDefault:T}=Z(),[k,A]=R.useState(null),[b,m]=R.useState(""),{hasOpenModals:x,setKeepCompletedFlowOpenDuringSession:g,shouldKeepCompletedFlowOpenDuringSession:I}=Fe();if(r=T(r),Sd(()=>{f(o)},[o,c]),c)return null;let D=p(e);if(!D||h(D)||F(e)===X||S(e)===1&&!I(e)||x())return null;let N=v(e)[C(e)];function M(){return R.createElement(R.Fragment,null,R.createElement(hr,null,R.createElement(Se,{size:"large",appearance:r,title:N.title,subtitle:N.subtitle})),R.createElement(fr,{className:l("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(L=>R.createElement(qs,{className:l("npsNumberButton",r),selected:k===L+1,key:L,onClick:async()=>{g(e),A(L+1),await a(e,N.id,{score:L+1})},appearance:r},L+1))),R.createElement(Ks,{appearance:r},R.createElement(gr,{appearance:r},"Not likely at all"),R.createElement(gr,{appearance:r},"Extremely likely")))}function H(){return R.createElement(R.Fragment,null,R.createElement(hr,null,R.createElement(Se,{appearance:r,title:"Why did you choose this score?",size:"large"})),R.createElement(Ys,{appearance:r,value:b,onChange:L=>{m(L.target.value)},placeHolder:"Add your optional fedback here..."}),R.createElement(fr,{appearance:r,className:l("npsNumberButtonContainer",r)},R.createElement(re,{size:"large",withMargin:!1,onClick:async()=>{await d(e),n&&n(N,1,"primary")},appearance:r,title:N.secondaryButtonTitle||"Skip",secondary:!0}),R.createElement(re,{size:"large",withMargin:!1,onClick:async()=>{await a(e,N.id,{feedbackText:b}),await d(e),n&&n(N,1,"primary")},appearance:r,title:N.primaryButtonTitle||"Submit"})))}return R.createElement(yd,null,R.createElement(ie,{appearance:r}),R.createElement(Gs,{appearance:r,className:Ce(l("npsSurveyContainer",r),i),style:s},R.createElement(Js,{onClick:async()=>{await d(e),t&&t()},className:l("npsSurveyDismissButton",r)},R.createElement(ke,null)),S(e)==0&&M(),S(e)==1&&H()))};export{Ke as CheckBox,rt as FormLabel,jo as FormTextField,Cd as FrigadeBanner,dr as FrigadeChecklist,qe as FrigadeDefaultAppearance,hd as FrigadeEmbeddedTip,wi as FrigadeForm,Yp as FrigadeGuide,Vp as FrigadeHeroChecklist,bd as FrigadeNPSSurvey,qp as FrigadeProgressBadge,Ga as FrigadeProvider,fd as FrigadeSupportWidget,pd as FrigadeTour,vt as ProgressRing,Fe as useFlowOpens,Wt as useFlowResponses,Q as useFlows,er as useOrganization,Ht as useUser};
|
|
1606
1605
|
//# sourceMappingURL=index.mjs.map
|