@frigade/react 1.35.1 → 1.35.2

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.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import{ThemeProvider as Pp}from"styled-components";import St,{useContext as ep,useEffect as Ao,useState as dr}from"react";import{useCallback as gt,useContext as vl,useEffect as Bl}from"react";import jo,{useMemo as Nr}from"react";var Ir="1.35.1 ";var Ne="NOT_STARTED_STEP",Q="COMPLETED_FLOW",uo="ABORTED_FLOW",ft="STARTED_FLOW",$e="NOT_STARTED_FLOW",Me="COMPLETED_STEP",fo="STARTED_STEP";function ze(){let{publicApiKey:e,userId:t,apiUrl:o}=jo.useContext(K);return{config:Nr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Ir,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:Nr(()=>`${o}/v1/public/`,[o])}}var gl="frigade-last-call-at-",xl="frigade-last-call-data-";function vt(){let{shouldGracefullyDegrade:e,readonly:t}=jo.useContext(K);return async(o,r)=>{if(t&&(r.method==="POST"||r.method==="PUT"||r.method==="DELETE"))return Pt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Pt();let i=gl+o,n=xl+o;if(window&&window.localStorage&&r&&r.body&&r.method==="POST"){let p=window.localStorage.getItem(i),c=window.localStorage.getItem(n);if(p&&c&&c==r.body){let a=new Date(p);if(new Date().getTime()-a.getTime()<1e3)return Pt()}window.localStorage.setItem(i,new Date().toISOString()),window.localStorage.setItem(n,r.body)}let s;try{s=await fetch(o,r)}catch(p){return Pt(p)}return s?s.ok?s:Pt(s.statusText):Pt()}}function Pt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Bt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=jo.useContext(K);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Fl,useState as Or}from"react";import{useContext as Cl,useEffect as Sl,useState as yl}from"react";import bl from"swr";import{useContext as hl}from"react";function Pe(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:r,completedFlowsToKeepOpenDuringSession:i}=hl(K);function n(d,x=!1){return e[d]??x}function s(d,x){t(y=>({...y,[d]:x}))}function p(d){t(x=>{let{[d]:y,...w}=x;return{...w}})}function c(d){i.includes(d)||r(x=>[...x,d])}function a(d){return i.includes(d)}function g(d){return Object.entries(e).some(([x,y])=>y&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:a}}import wl from"swr/immutable";var Tl="unknown";function ve(){let{config:e,apiUrl:t}=ze(),{publicApiKey:o,userId:r,organizationId:i,flows:n,setShouldGracefullyDegrade:s,readonly:p}=Cl(K),{resetOpenFlowState:c}=Pe(),[a,g]=yl(!1),d={data:n.map(F=>({flowId:F.id,flowState:Q,lastStepId:null,userId:r,foreignUserId:r,stepStates:{},shouldTrigger:!1}))},x=F=>fetch(F,e).then(T=>{if(T.ok)return T.json();throw new Error("Failed to fetch user flow states")}).catch(T=>(console.log(`Error fetching ${F}: ${T}. Will gracefully degrade and hide Frigade`),s(!0),d)),y=o&&n&&r?`${t}userFlowStates?foreignUserId=${encodeURIComponent(r)}${i?`&foreignUserGroupId=${encodeURIComponent(i)}`:""}`:null,{data:w,isLoading:P,mutate:f,error:E}=p?wl(y,x):bl(y,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),b=w==null?void 0:w.data;Sl(()=>{!a&&!P&&b&&g(!0)},[b,a,P]);async function S(F){if(b&&!p){let T=b.find(O=>O.flowId===F);T&&T.flowState!==Q&&(T.flowState=Q),await f(Promise.resolve({...w,data:b}),{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}async function A(F,T,O){if(b){let I=b.find(M=>M.flowId===F);I&&(I.stepStates[T]=O,I.flowState=ft),await f(Promise.resolve({...w,data:b}),{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}async function C(F,T,O){if(b){let I=b.find(M=>M.flowId===F);I&&(I.lastStepId=T,I.stepStates[T]=O,I.flowState=ft),await f({...w,data:b},{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}async function m(F){if(b){let T=b.find(O=>O.flowId===F);T&&T.flowState!==$e&&(T.flowState=$e,T.lastStepId=Tl,Object.keys(T.stepStates).forEach(O=>{T.stepStates[O].actionType=Ne,T.stepStates[O].createdAt=new Date().toISOString()}),await f({...w,data:b},{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1}),c(F))}}async function B(F,T){if(b){let O=b.find(I=>I.flowId===F);O&&O.stepStates[T]!==Ne&&(O.stepStates[T]=Ne),await f({...w,data:b},{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:b,isLoadingUserFlowStateData:!a,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:B,optimisticallyMarkStepStarted:C,error:E}}function Gt(){let{config:e,apiUrl:t}=ze(),{userFlowStatesData:o,mutateUserFlowState:r}=ve(),{failedFlowResponses:i,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=Fl(K),[c,a]=Or(new Set),[g,d]=Or(new Set),x=vt();function y(f){let E=JSON.stringify(f);if(c.has(E))return null;c.add(E),a(c),g.add(f),d(g);let b=s==null?void 0:s.find(S=>S.flowSlug===f.flowSlug&&S.stepId===f.stepId&&S.actionType===f.actionType&&S.createdAt===f.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:E}).then(S=>{S.status!==200&&S.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...i,f])):b||p(A=>[...A??[],f])})}async function w(f){f.foreignUserId&&(f.actionType===ft||f.actionType===$e?await y(f):f.actionType===Q?await y(f):f.actionType===fo?await y(f):f.actionType===Me?await y(f):f.actionType===uo?await y(f):f.actionType===Ne&&await y(f))}function P(){let f=[];return o==null||o.forEach(E=>{if(E&&E.stepStates&&Object.keys(E.stepStates).length!==0)for(let b in E.stepStates){let S=E.stepStates[b];f.push({foreignUserId:E.foreignUserId,flowSlug:E.flowId,stepId:S.stepId,actionType:S.actionType,data:{},createdAt:new Date(S.createdAt),blocked:S.blocked,hidden:S.hidden})}}),[...f,...s]}return{addResponse:w,setFlowResponses:p,getFlowResponses:P}}import El from"swr";var kl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Lr=e=>{let t=kl.exec(e);if(t===null)return null;let o=null;return t.forEach((r,i)=>{let n=Pl(r,"'","");n.startsWith("flow_")&&(o=n)}),o},Pl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Z(){let{config:e,apiUrl:t}=ze(),{flows:o,setFlows:r,userId:i,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=vl(K),y={data:[]},{verifySDKInitiated:w}=Bt(),{addResponse:P,getFlowResponses:f}=Gt(),E=u=>fetch(u,e).then(h=>h.ok?h.json():(console.log(`Error fetching ${u} (${h.status}): ${h.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),y)).catch(h=>(console.log(`Error fetching ${u}: ${h}. Will gracefully degrade and hide Frigade`),d(!0),y)),{mutateUserFlowState:b,userFlowStatesData:S,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:C,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:B,optimisticallyMarkStepNotStarted:F,optimisticallyMarkStepStarted:T}=ve(),{data:O,error:I,isLoading:M}=El(n?`${t}flows${x?"?readonly=true":""}`:null,E,{keepPreviousData:!0});Bl(()=>{if(I){console.error(I);return}O&&O.data&&r(O.data)},[O,I]);function D(u){if(M)return null;let h=o.find(v=>v.slug===u);return!h&&o.length>0&&!A&&!M?(console.log(`Flow with slug ${u} not found`),null):(h==null?void 0:h.active)===!1?null:h}function L(u){var z;if(!D(u))return[];let h=D(u).data;return h?(h=ee(h),(((z=JSON.parse(h))==null?void 0:z.data)??[]).map(Ce=>{let Ar=ne(Ce);return{handleSecondaryButtonClick:()=>{Ce.skippable===!0&&H(u,Ce.id,{skipped:!0})},...Ce,complete:ge(u,Ce.id)===Me||Ar>=1,blocked:te(u,Ce.id),hidden:N(u,Ce.id),handlePrimaryButtonClick:()=>{(!Ce.completionCriteria&&(Ce.autoMarkCompleted||Ce.autoMarkCompleted===void 0)||Ce.completionCriteria&&Ce.autoMarkCompleted===!0)&&H(u,Ce.id)},progress:Ar}}).filter(Ce=>Ce.hidden!==!0)):[]}function ee(u){return u.replaceAll(/\${(.*?)}/g,(h,v)=>s[v]===void 0?"":String(s[v]).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 U(u){if(!D(u))return[];let h=D(u).data;return h?(h=ee(h),JSON.parse(h)??{}):[]}function J(u,h){p(v=>({...v,[u]:h}))}function fe(u){!A&&!M&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(h=>{J(h,u[h])})}let q=gt(async(u,h,v)=>{if(!w())return;let z={foreignUserId:i,flowSlug:u,stepId:h,actionType:fo,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};Y(z)&&(await T(u,h,z),P(z))},[i,S]),W=gt(async(u,h,v)=>{if(!w())return;let z={foreignUserId:i,flowSlug:u,stepId:h,actionType:Ne,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};Y(z)&&(await F(u,h),P(z))},[i,S]),H=gt(async(u,h,v)=>{if(!w())return;let z={foreignUserId:i,flowSlug:u,stepId:h,actionType:Me,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};Y(z)&&(await B(u,h,z),P(z))},[i,S]),he=gt(async(u,h)=>{if(!w()||le(u)===$e)return;let v={foreignUserId:i,flowSlug:u,stepId:"unknown",actionType:$e,data:h??{},createdAt:new Date,blocked:!1,hidden:!1};await m(u),Y(v)&&P(v)},[i,S]),Ie=gt(async(u,h)=>{if(!w())return;let v={foreignUserId:i,flowSlug:u,stepId:"unknown",actionType:ft,data:h??{},createdAt:new Date,blocked:!1,hidden:!1};Y(v)&&P(v)},[i,S]),ye=gt(async(u,h)=>{if(!w())return;let v={foreignUserId:i,flowSlug:u,stepId:"unknown",actionType:Q,data:h??{},createdAt:new Date,blocked:!1,hidden:!1};Y(v)&&(await C(u),P(v))},[i,S]),ce=gt(async(u,h)=>{if(!w())return;let v={foreignUserId:i,flowSlug:u,stepId:"unknown",actionType:uo,data:h??{},createdAt:new Date,blocked:!1,hidden:!1};Y(v)&&(await C(u),P(v))},[i,S]);function Y(u){var h;if(!S&&u.actionType===Ne)return!1;if(S){let v=S.find(z=>z.flowId===u.flowSlug);if(u.actionType===Ne&&(!(v!=null&&v.stepStates[u.stepId])||v.stepStates[u.stepId].actionType===Ne)||v&&((h=v.stepStates[u.stepId])==null?void 0:h.actionType)===u.actionType||v&&v.flowState===Q&&u.actionType===Q)return!1}return!0}function ge(u,h){let v=V(u,h);return A?null:v?v.actionType:Ne}function te(u,h){let v=V(u,h);return v?v.blocked:!1}function N(u,h){let v=V(u,h);return v?v.hidden:!1}function V(u,h){if(A)return null;let v=S==null?void 0:S.find(z=>z.flowId===u);return!v||!v.stepStates[h]?null:v.stepStates[h]??null}function j(u){var v;if(A||!S)return null;if(le(u)===$e)return L(u)[0]??null;let h=(v=S.find(z=>z.flowId===u))==null?void 0:v.lastStepId;return h?L(u).find(z=>z.id===h):null}function ie(u){let h=j(u);if(!h)return 0;let v=L(u).findIndex(z=>z.id===h.id)??0;return ge(u,h.id)===Me&&v<L(u).length-1?v+1:v}function ne(u){if(!u.completionCriteria)return;let h=Lr(u.completionCriteria);if(h===null)return;let v=Ge(h),z=De(h);return z===0?void 0:v/z}function le(u){let h=S==null?void 0:S.find(v=>v.flowId===u);return h?h.flowState:null}function Ge(u){let h=L(u);return h.length===0?0:h.filter(z=>ge(u,z.id)===Me).length}function De(u){return L(u).length}function G(u){let h=o.find(v=>v.slug===u);return h?JSON.parse(h.data):null}function ke(u){if(x)return!1;if(A)return!0;if(u!=null&&u.targetingLogic&&S){let h=S.find(v=>v.flowId===u.slug);if(h)return h.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&i&&i.startsWith("guest_"))}function jt(u){return!ke(D(u))}function mo(){i&&b()}return{getFlow:D,getFlowData:G,isLoading:A||M,getStepStatus:ge,getFlowSteps:L,getCurrentStepIndex:ie,markStepStarted:q,markStepCompleted:H,markFlowNotStarted:he,markFlowStarted:Ie,markFlowCompleted:ye,markFlowAborted:ce,markStepNotStarted:W,getFlowStatus:le,getNumberOfStepsCompleted:Ge,getNumberOfSteps:De,targetingLogicShouldHideFlow:ke,setCustomVariable:J,updateCustomVariables:fe,customVariables:s,getStepOptionalProgress:ne,getFlowMetadata:U,isStepBlocked:te,isStepHidden:N,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,isFlowAvailableToUser:jt,refresh:mo}}import{useCallback as Dr,useContext as Al,useEffect as Il}from"react";var Et="guest_";function Kt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:r,shouldGracefullyDegrade:i}=Al(K),{config:n,apiUrl:s}=ze(),{mutateUserFlowState:p}=ve(),c=vt(),{verifySDKInitiated:a}=Bt();Il(()=>{if(e&&!t){if(e.startsWith(Et))return;let x=`frigade-user-registered-${e}`;localStorage.getItem(x)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(x,"true"))}},[e,i,t]);let g=Dr(async x=>{if(!a())return;let y={foreignId:e,properties:x};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(y)}),r(w=>({...w,...x})),p()},[e,n,i,p]),d=Dr(async(x,y)=>{if(!a())return;let P={foreignId:e,events:[{event:x,properties:y}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(P)}),p()},[e,n,p]);return{userId:e,setUserId:o,addPropertiesToUser:g,trackEventForUser:d}}import{v4 as tp}from"uuid";import He,{useEffect as Ja,useState as Qa}from"react";import Ue,{useEffect as Ul}from"react";import ho from"styled-components";import Nl from"react";import Ol from"styled-components";var $r="fr-",qt="cfr-";function l(e,t){let o=`${$r}${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+" "+qt+e}return o}function k(e){if(!e.className||e.className.indexOf(qt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith($r)?"":`:not(${o.map(r=>`.${r}`).join(", ")})`}function Go(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Go(t)}: ${e.styleOverrides[t]};`).join(" "):""}function be(...e){return e.filter(Boolean).join(" ")}function Yt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ll=Ol.div`
2
+ import bt,{createContext as Ip,useEffect as Lo,useState as Oe}from"react";import{ThemeProvider as Op}from"styled-components";import St,{useContext as lp,useEffect as Io,useState as ur}from"react";import{useCallback as xt,useContext as Ol,useEffect as Ll}from"react";import qo,{useMemo as Dr}from"react";var Lr="1.35.2 ";var Ie="NOT_STARTED_STEP",q="COMPLETED_FLOW",fo="ABORTED_FLOW",gt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ue="COMPLETED_STEP",go="STARTED_STEP";function We(){let{publicApiKey:e,userId:t,apiUrl:o}=qo.useContext(K);return{config:Dr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Lr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:Dr(()=>`${o}/v1/public/`,[o])}}var bl="frigade-last-call-at-",wl="frigade-last-call-data-";function Bt(){let{shouldGracefullyDegrade:e,readonly:t}=qo.useContext(K);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return vt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),vt();let r=bl+o,n=wl+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),c=window.localStorage.getItem(n);if(p&&c&&c==i.body){let a=new Date(p);if(new Date().getTime()-a.getTime()<1e3)return vt()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return vt(p)}return s?s.ok?s:vt(s.statusText):vt()}}function vt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Et(){let{publicApiKey:e,shouldGracefullyDegrade:t}=qo.useContext(K);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Al,useState as $r}from"react";import{useContext as Fl,useEffect as kl,useState as Pl}from"react";import vl from"swr";import{useContext as Tl}from"react";function Te(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Tl(K);function n(d,x=!1){return e[d]??x}function s(d,x){t(S=>({...S,[d]:x}))}function p(d){t(x=>{let{[d]:S,...w}=x;return{...w}})}function c(d){r.includes(d)||i(x=>[...x,d])}function a(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,S])=>S&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:a}}import Bl from"swr/immutable";var El="unknown";function Be(){let{config:e,apiUrl:t}=We(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=Fl(K),{resetOpenFlowState:c}=Te(),[a,g]=Pl(!1),d={data:n.map(F=>({flowId:F.id,flowState:q,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=F=>fetch(F,e).then(T=>{if(T.ok)return T.json();throw new Error("Failed to fetch user flow states")}).catch(T=>(console.log(`Error fetching ${F}: ${T}. Will gracefully degrade and hide Frigade`),s(!0),d)),S=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:w,isLoading:P,mutate:f,error:A}=p?Bl(S,x):vl(S,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),b=w==null?void 0:w.data;kl(()=>{!a&&!P&&b&&g(!0)},[b,a,P]);async function y(F){if(b&&!p){let T=b.find(O=>O.flowId===F);T&&T.flowState!==q&&(T.flowState=q),await f(Promise.resolve({...w,data:b}),{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}async function N(F,T,O){if(b){let E=b.find($=>$.flowId===F);E&&(E.stepStates[T]=O,E.flowState=gt),await f(Promise.resolve({...w,data:b}),{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}async function h(F,T,O){if(b){let E=b.find($=>$.flowId===F);E&&(E.lastStepId=T,E.stepStates[T]=O,E.flowState=gt),await f({...w,data:b},{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}async function m(F){if(b){let T=b.find(O=>O.flowId===F);T&&T.flowState!==Me&&(T.flowState=Me,T.lastStepId=El,Object.keys(T.stepStates).forEach(O=>{T.stepStates[O].actionType=Ie,T.stepStates[O].createdAt=new Date().toISOString()}),await f({...w,data:b},{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1}),c(F))}}async function v(F,T){if(b){let O=b.find(E=>E.flowId===F);O&&O.stepStates[T]!==Ie&&(O.stepStates[T]=Ie),await f({...w,data:b},{optimisticData:{...w,data:b},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:b,isLoadingUserFlowStateData:!a,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:N,optimisticallyMarkStepNotStarted:v,optimisticallyMarkStepStarted:h,error:A}}function Kt(){let{config:e,apiUrl:t}=We(),{userFlowStatesData:o,mutateUserFlowState:i}=Be(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=Al(K),[c,a]=$r(new Set),[g,d]=$r(new Set),x=Bt();function S(f){let A=JSON.stringify(f);if(c.has(A))return null;c.add(A),a(c),g.add(f),d(g);let b=s==null?void 0:s.find(y=>y.flowSlug===f.flowSlug&&y.stepId===f.stepId&&y.actionType===f.actionType&&y.createdAt===f.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:A}).then(y=>{y.status!==200&&y.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...r,f])):b||p(N=>[...N??[],f])})}async function w(f){f.foreignUserId&&(f.actionType===gt||f.actionType===Me?await S(f):f.actionType===q?await S(f):f.actionType===go?await S(f):f.actionType===Ue?await S(f):f.actionType===fo?await S(f):f.actionType===Ie&&await S(f))}function P(){let f=[];return o==null||o.forEach(A=>{if(A&&A.stepStates&&Object.keys(A.stepStates).length!==0)for(let b in A.stepStates){let y=A.stepStates[b];f.push({foreignUserId:A.foreignUserId,flowSlug:A.flowId,stepId:y.stepId,actionType:y.actionType,data:{},createdAt:new Date(y.createdAt),blocked:y.blocked,hidden:y.hidden})}}),[...f,...s]}return{addResponse:w,setFlowResponses:p,getFlowResponses:P}}import Dl from"swr";var Nl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Mr=e=>{let t=Nl.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=Il(i,"'","");n.startsWith("flow_")&&(o=n)}),o},Il=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Y(){let{config:e,apiUrl:t}=We(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=Ol(K),S={data:[]},{verifySDKInitiated:w}=Et(),{addResponse:P,getFlowResponses:f}=Kt(),A=u=>fetch(u,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${u} (${C.status}): ${C.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),S)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),d(!0),S)),{mutateUserFlowState:b,userFlowStatesData:y,isLoadingUserFlowStateData:N,optimisticallyMarkFlowCompleted:h,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:v,optimisticallyMarkStepNotStarted:F,optimisticallyMarkStepStarted:T}=Be(),{data:O,error:E,isLoading:$}=Dl(n?`${t}flows${x?"?readonly=true":""}`:null,A,{keepPreviousData:!0});Ll(()=>{if(E){console.error(E);return}O&&O.data&&i(O.data)},[O,E]);function D(u){if($)return null;let C=o.find(B=>B.slug===u);return!C&&o.length>0&&!N&&!$?(console.log(`Flow with slug ${u} not found`),null):(C==null?void 0:C.active)===!1?null:C}function L(u){var _;if(!D(u))return[];let C=D(u).data;return C?(C=X(C),(((_=JSON.parse(C))==null?void 0:_.data)??[]).map(Se=>{let Or=se(Se);return{handleSecondaryButtonClick:()=>{Se.skippable===!0&&H(u,Se.id,{skipped:!0})},...Se,complete:ge(u,Se.id)===Ue||Or>=1,blocked:re(u,Se.id),hidden:I(u,Se.id),handlePrimaryButtonClick:()=>{(!Se.completionCriteria&&(Se.autoMarkCompleted||Se.autoMarkCompleted===void 0)||Se.completionCriteria&&Se.autoMarkCompleted===!0)&&H(u,Se.id)},progress:Or}}).filter(Se=>Se.hidden!==!0)):[]}function X(u){return u.replaceAll(/\${(.*?)}/g,(C,B)=>s[B]===void 0?"":String(s[B]).replace(/[\u00A0-\u9999<>\&]/g,function(_){return"&#"+_.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 U(u){if(!D(u))return[];let C=D(u).data;return C?(C=X(C),JSON.parse(C)??{}):[]}function ee(u,C){p(B=>({...B,[u]:C}))}function fe(u){!N&&!$&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(C=>{ee(C,u[C])})}let J=xt(async(u,C,B)=>{if(!w())return;let _={foreignUserId:r,flowSlug:u,stepId:C,actionType:go,data:B??{},createdAt:new Date,blocked:!1,hidden:!1};Q(_)&&(await T(u,C,_),P(_))},[r,y]),W=xt(async(u,C,B)=>{if(!w())return;let _={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ie,data:B??{},createdAt:new Date,blocked:!1,hidden:!1};Q(_)&&(await F(u,C),P(_))},[r,y]),H=xt(async(u,C,B)=>{if(!w())return;let _={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ue,data:B??{},createdAt:new Date,blocked:!1,hidden:!1};Q(_)&&(await v(u,C,_),P(_))},[r,y]),ye=xt(async(u,C)=>{if(!w()||ae(u)===Me)return;let B={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Me,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};await m(u),Q(B)&&P(B)},[r,y]),Ne=xt(async(u,C)=>{if(!w())return;let B={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:gt,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};Q(B)&&P(B)},[r,y]),we=xt(async(u,C)=>{if(!w())return;let B={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:q,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};Q(B)&&(await h(u),P(B))},[r,y]),ce=xt(async(u,C)=>{if(!w())return;let B={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:fo,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};Q(B)&&(await h(u),P(B))},[r,y]);function Q(u){var C;if(!y&&u.actionType===Ie)return!1;if(y){let B=y.find(_=>_.flowId===u.flowSlug);if(u.actionType===Ie&&(!(B!=null&&B.stepStates[u.stepId])||B.stepStates[u.stepId].actionType===Ie)||B&&((C=B.stepStates[u.stepId])==null?void 0:C.actionType)===u.actionType||B&&B.flowState===q&&u.actionType===q)return!1}return!0}function ge(u,C){let B=V(u,C);return N?null:B?B.actionType:Ie}function re(u,C){let B=V(u,C);return B?B.blocked:!1}function I(u,C){let B=V(u,C);return B?B.hidden:!1}function V(u,C){if(N)return null;let B=y==null?void 0:y.find(_=>_.flowId===u);return!B||!B.stepStates[C]?null:B.stepStates[C]??null}function j(u){var B;if(N||!y)return null;if(ae(u)===Me)return L(u)[0]??null;let C=(B=y.find(_=>_.flowId===u))==null?void 0:B.lastStepId;return C?L(u).find(_=>_.id===C):null}function ne(u){let C=j(u);if(!C)return 0;let B=L(u).findIndex(_=>_.id===C.id)??0;return ge(u,C.id)===Ue&&B<L(u).length-1?B+1:B}function se(u){if(!u.completionCriteria)return;let C=Mr(u.completionCriteria);if(C===null)return;let B=qe(C),_=$e(C);return _===0?void 0:B/_}function ae(u){let C=y==null?void 0:y.find(B=>B.flowId===u);return C?C.flowState:null}function qe(u){let C=L(u);return C.length===0?0:C.filter(_=>ge(u,_.id)===Ue).length}function $e(u){return L(u).length}function G(u){let C=o.find(B=>B.slug===u);return C?JSON.parse(C.data):null}function ve(u){if(x)return!1;if(N)return!0;if(u!=null&&u.targetingLogic&&y){let C=y.find(B=>B.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function Gt(u){return!ve(D(u))}function uo(){r&&b()}return{getFlow:D,getFlowData:G,isLoading:N||$,getStepStatus:ge,getFlowSteps:L,getCurrentStepIndex:ne,markStepStarted:J,markStepCompleted:H,markFlowNotStarted:ye,markFlowStarted:Ne,markFlowCompleted:we,markFlowAborted:ce,markStepNotStarted:W,getFlowStatus:ae,getNumberOfStepsCompleted:qe,getNumberOfSteps:$e,targetingLogicShouldHideFlow:ve,setCustomVariable:ee,updateCustomVariables:fe,customVariables:s,getStepOptionalProgress:se,getFlowMetadata:U,isStepBlocked:re,isStepHidden:I,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,isFlowAvailableToUser:Gt,refresh:uo}}import{useCallback as Ur,useContext as $l,useEffect as Ml}from"react";var At="guest_";function qt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=$l(K),{config:n,apiUrl:s}=We(),{mutateUserFlowState:p}=Be(),c=Bt(),{verifySDKInitiated:a}=Et();Ml(()=>{if(e&&!t){if(e.startsWith(At))return;let x=`frigade-user-registered-${e}`;localStorage.getItem(x)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(x,"true"))}},[e,r,t]);let g=Ur(async x=>{if(!a())return;let S={foreignId:e,properties:x};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(S)}),i(w=>({...w,...x})),p()},[e,n,r,p]),d=Ur(async(x,S)=>{if(!a())return;let P={foreignId:e,events:[{event:x,properties:S}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(P)}),p()},[e,n,p]);return{userId:e,setUserId:o,addPropertiesToUser:g,trackEventForUser:d}}import{v4 as ap}from"uuid";import je,{useEffect as rp,useState as ip}from"react";import ze,{useEffect as jl}from"react";import Co from"styled-components";import Ul from"react";import zl from"styled-components";var zr="fr-",Yt="cfr-";function l(e,t){let o=`${zr}${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+" "+Yt+e}return o}function k(e){if(!e.className||e.className.indexOf(Yt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(zr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Yo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Ye(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Yo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function xe(...e){return e.filter(Boolean).join(" ")}function Xt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var _l=zl.div`
3
3
  display: flex;
4
4
  justify-content: center;
5
5
  position: fixed;
@@ -23,11 +23,11 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
23
23
  opacity: 1;
24
24
  }
25
25
  }
26
- `,Mr=({onClose:e,appearance:t})=>Nl.createElement(Ll,{className:l("modalBackground",t),onClick:()=>e()});import Ko from"react";import Dl from"styled-components";var $l=Dl.div`
26
+ `,_r=({onClose:e,appearance:t})=>Ul.createElement(_l,{className:l("modalBackground",t),onClick:()=>e()});import Xo from"react";import Wl from"styled-components";var Hl=Wl.div`
27
27
  :hover {
28
28
  opacity: 0.8;
29
29
  }
30
- `,Be=()=>Ko.createElement($l,null,Ko.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Ko.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as _l}from"react-portal";import Xr from"react";import qo from"react";function Ml({style:e,className:t}){return qo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},qo.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"}),qo.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 Ur=Ml;import Yo from"styled-components";import ot from"styled-components";var go=ot.div`
30
+ `,Fe=()=>Xo.createElement(Hl,null,Xo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Xo.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Gl}from"react-portal";import Zr from"react";import Jo from"react";function Vl({style:e,className:t}){return Jo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Jo.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"}),Jo.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 Wr=Vl;import Qo from"styled-components";import it from"styled-components";var xo=it.div`
31
31
  ${e=>k(e)} {
32
32
  background: ${e=>e.appearance.theme.colorBackground};
33
33
  }
@@ -38,13 +38,13 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
38
38
  min-width: 300px;
39
39
  padding: 22px 22px 12px;
40
40
  z-index: ${e=>e.zIndex};
41
- `,_r=ot.div`
41
+ `,Hr=it.div`
42
42
  display: block;
43
43
  cursor: pointer;
44
44
  position: absolute;
45
45
  top: 12px;
46
46
  right: 12px;
47
- `,zr=ot.img`
47
+ `,Vr=it.img`
48
48
  ${e=>k(e)} {
49
49
  display: block;
50
50
  width: 100%;
@@ -53,7 +53,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
53
53
  margin-top: ${e=>e.dismissible?"24px":"0px"};
54
54
  margin-bottom: 16px;
55
55
  }
56
- `,Wr=ot.div`
56
+ `,jr=it.div`
57
57
  ${e=>k(e)} {
58
58
  display: block;
59
59
  width: 100%;
@@ -61,17 +61,17 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
61
61
  margin-top: ${e=>e.dismissible?"24px":"0px"};
62
62
  margin-bottom: 16px;
63
63
  }
64
- `,Hr=ot.div`
64
+ `,Gr=it.div`
65
65
  display: flex;
66
66
  flex-direction: row;
67
67
  justify-content: space-between;
68
68
  align-content: center;
69
- `,Vr=ot.div`
69
+ `,Kr=it.div`
70
70
  display: flex;
71
71
  flex: 1;
72
72
  flex-direction: column;
73
73
  justify-content: center;
74
- `,jr=ot.div`
74
+ `,qr=it.div`
75
75
  display: flex;
76
76
  flex: 2;
77
77
  flex-shrink: 1;
@@ -83,7 +83,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
83
83
  align-content: center;
84
84
  align-items: center;
85
85
  }
86
- `,Gr=ot.p`
86
+ `,Yr=it.p`
87
87
  ${e=>k(e)} {
88
88
  font-style: normal;
89
89
  font-weight: 600;
@@ -92,7 +92,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
92
92
  color: #808080;
93
93
  }
94
94
  margin: 0;
95
- `;var Kr=Yo.div`
95
+ `;var Xr=Qo.div`
96
96
  background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
97
97
  position: absolute;
98
98
  bottom: -47px;
@@ -103,7 +103,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
103
103
  align-items: center;
104
104
  justify-content: center;
105
105
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
106
- `,qr=Yo(go)`
106
+ `,Jr=Qo(xo)`
107
107
  background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
108
108
  position: absolute;
109
109
  bottom: -60px;
@@ -116,7 +116,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
116
116
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
117
117
  padding: 0;
118
118
  z-index: ${e=>e.zIndex};
119
- `,Yr=Yo.div`
119
+ `,Qr=Qo.div`
120
120
  display: flex;
121
121
  justify-content: center;
122
122
  align-items: center;
@@ -125,7 +125,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
125
125
  font-size: 12px;
126
126
  line-height: 18px;
127
127
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
128
- `;function xo({appearance:e}){return Xr.createElement(Yr,{className:l("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Xr.createElement(Ur,null))}var zl=ho.div`
128
+ `;function ho({appearance:e}){return Zr.createElement(Qr,{className:l("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Zr.createElement(Wr,null))}var Kl=Co.div`
129
129
  ${e=>k(e)} {
130
130
  // Anything inside this block will be ignored if the user provides a custom class
131
131
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
@@ -140,7 +140,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
140
140
  width: ${e=>e.width??"1000px"};
141
141
  z-index: 1500;
142
142
  border-radius: ${e=>{var t,o;return((o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)??8}}px;
143
- ${e=>Ke(e)}
143
+ ${e=>Ye(e)}
144
144
  }
145
145
 
146
146
  padding: 32px;
@@ -167,10 +167,10 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
167
167
  opacity: 1;
168
168
  }
169
169
  }
170
- `,Wl=ho.div`
170
+ `,ql=Co.div`
171
171
  position: relative;
172
172
  flex: 0 1 auto;
173
- `,Hl=ho.div`
173
+ `,Yl=Co.div`
174
174
  position: absolute;
175
175
  top: 24px;
176
176
  right: 24px;
@@ -180,14 +180,23 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
180
180
  // Anything inside this block will be ignored if the user provides a custom class
181
181
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
182
182
  }
183
- `,Vl=ho.div`
183
+ `,Xl=Co.div`
184
184
  overflow: scroll;
185
185
  flex: 1 1;
186
186
  display: flex;
187
187
  ::-webkit-scrollbar {
188
188
  display: none;
189
189
  }
190
- `,rt=({onClose:e,visible:t,headerContent:o=null,style:r=null,children:i,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>(Ul(()=>{let c=a=>{a.key==="Escape"&&e()};return document.addEventListener("keydown",c),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",c)}},[e,t]),t?Ue.createElement(_l,null,Ue.createElement(Mr,{appearance:n,onClose:()=>{s&&e()}}),Ue.createElement(zl,{appearance:n,className:l("modalContainer",n),styleOverrides:r},s&&Ue.createElement(Hl,{className:l("modalClose",n),onClick:()=>e(),appearance:n},Ue.createElement(Be,null)),o&&Ue.createElement(Wl,null,o),Ue.createElement(Vl,null,i),p&&Ue.createElement(Kr,{appearance:n,className:l("poweredByFrigadeRibbon",n)},Ue.createElement(xo,{appearance:n})))):Ue.createElement(Ue.Fragment,null));import it,{useEffect as jl}from"react";import Co from"styled-components";import{Portal as Gl}from"react-portal";var Kl=Co.div`
190
+ `,He=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>(jl(()=>{let c=a=>{a.key==="Escape"&&e()};return document.addEventListener("keydown",c),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",c)}},[e,t]),t?ze.createElement(Gl,null,ze.createElement(_r,{appearance:n,onClose:()=>{s&&e()}}),ze.createElement(Kl,{appearance:n,className:l("modalContainer",n),styleOverrides:i},s&&ze.createElement(Yl,{className:l("modalClose",n),onClick:()=>e(),appearance:n},ze.createElement(Fe,null)),o&&ze.createElement(ql,null,o),ze.createElement(Xl,null,r),p&&ze.createElement(Xr,{appearance:n,className:l("poweredByFrigadeRibbon",n)},ze.createElement(ho,{appearance:n})))):ze.createElement(ze.Fragment,null));import nt,{useEffect as Jl}from"react";import yo from"styled-components";import{Portal as Ql}from"react-portal";function Zl(e){switch(e){case"top-left":return`
191
+ top: 0;
192
+ left: 0;
193
+ `;case"top-right":return`
194
+ top: 0;
195
+ right: 0;
196
+ `;case"bottom-left":return`
197
+ bottom: 0;
198
+ left: 0;
199
+ `}return"right: 0; bottom: 0;"}var Rl=yo.div`
191
200
  ${e=>k(e)} {
192
201
  // Anything inside this block will be ignored if the user provides a custom class
193
202
  background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
@@ -201,14 +210,12 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
201
210
  width: 350px;
202
211
  padding: 24px;
203
212
  }
204
- right: 0;
205
- bottom: 0;
206
- margin-right: 28px;
207
- margin-bottom: 28px;
208
- `,ql=Co.div`
213
+ ${e=>Zl(e.modalPosition)}
214
+ margin: 28px;
215
+ `,ea=yo.div`
209
216
  position: relative;
210
217
  flex: 1;
211
- `,Yl=Co.div`
218
+ `,ta=yo.div`
212
219
  position: absolute;
213
220
  top: 24px;
214
221
  right: 24px;
@@ -218,13 +225,13 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
218
225
  // Anything inside this block will be ignored if the user provides a custom class
219
226
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
220
227
  }
221
- `,Xl=Co.div`
228
+ `,oa=yo.div`
222
229
  overflow: scroll;
223
230
  flex: 5;
224
231
  ::-webkit-scrollbar {
225
232
  display: none;
226
233
  }
227
- `,Jr=({onClose:e,visible:t,headerContent:o=null,children:r,appearance:i})=>(jl(()=>{let n=s=>{s.key==="Escape"&&e()};return document.addEventListener("keydown",n),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",n)}},[e,t]),t?it.createElement(Gl,null,it.createElement(Kl,{appearance:i,className:l("cornerModalContainer",i)},it.createElement(Yl,{className:l("cornerModalClose",i),onClick:()=>e()},it.createElement(Be,null)),o&&it.createElement(ql,null,o),it.createElement(Xl,null,r))):it.createElement(it.Fragment,null));import{useContext as Jl}from"react";function R(){let{defaultAppearance:e}=Jl(K);function t(o){let r=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(r.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(r.theme,o.theme??{})}:r}return{mergeAppearanceWithDefault:t}}import xt,{useContext as Sa,useEffect as ya,useState as rr}from"react";import To from"styled-components";import bo,{useEffect as Ql,useState as oi}from"react";import Qo from"styled-components";import So from"styled-components";var Qr=So.label`
234
+ `,So=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>(Jl(()=>{if(!s)return;let p=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",p),t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset",document.removeEventListener("keydown",p)}},[e,t]),t?nt.createElement(Ql,null,nt.createElement(Rl,{appearance:r,className:l("cornerModalContainer",r),modalPosition:n},s&&nt.createElement(ta,{className:l("cornerModalClose",r),onClick:()=>e()},nt.createElement(Fe,null)),o&&nt.createElement(ea,null,o),nt.createElement(oa,null,i))):nt.createElement(nt.Fragment,null));import{useContext as ra}from"react";function Z(){let{defaultAppearance:e}=ra(K);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}import ht,{useContext as Pa,useEffect as va,useState as sr}from"react";import ko from"styled-components";import To,{useEffect as ia,useState as ii}from"react";import er from"styled-components";import bo from"styled-components";var Rr=bo.label`
228
235
  ${e=>k(e)} {
229
236
  font-size: 12px;
230
237
  line-height: 18px;
@@ -235,14 +242,14 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
235
242
  letter-spacing: 0.24px;
236
243
  }
237
244
  display: flex;
238
- `,Zr=So.label`
245
+ `,ei=bo.label`
239
246
  ${e=>k(e)} {
240
247
  font-size: 12px;
241
248
  line-height: 20px;
242
249
  margin-bottom: 5px;
243
250
  }
244
251
  display: flex;
245
- `,Rr=So.span`
252
+ `,ti=bo.span`
246
253
  font-weight: 400;
247
254
  font-size: 14px;
248
255
  line-height: 22px;
@@ -250,16 +257,16 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
250
257
  display: flex;
251
258
  margin-right: 5px;
252
259
  margin-top: 10px;
253
- `,yo=So.div`
260
+ `,wo=bo.div`
254
261
  display: flex;
255
262
  align-items: flex-start;
256
263
  justify-content: left;
257
264
  margin-bottom: 10px;
258
- `;import Xo from"react";var qe={theme:{colorPrimary:"#0171F8",colorSecondary:"#EEEEEE",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function nt({title:e,required:t,appearance:o=qe}){return e?Xo.createElement(yo,null,t?Xo.createElement(Rr,{className:l("formLabelRequired",o),appearance:o},"*"):null,Xo.createElement(Qr,{className:l("formLabel",o)},e)):null}import ei from"react";function At({title:e,appearance:t}){return e?ei.createElement(yo,null,ei.createElement(Zr,{className:l("formSubLabel",t)},e)):null}import{z as Jo}from"zod";function ti(e,t){try{if(t){if(t.type=="number"){let o=Jo.number();if(t.props)for(let r of t.props)r.requirement=="min"?o=o.min(Number(r.value),r.message??"Value is too small"):r.requirement=="max"?o=o.max(Number(r.value),r.message??"Value is too large"):r.requirement=="positive"?o=o.positive(r.message??"Value must be positive"):r.requirement=="negative"&&(o=o.nonpositive(r.message??"Value must be negative"));o.parse(Number(e))}if(t.type=="string"){let o=Jo.string();if(t.props)for(let r of t.props)r.requirement=="min"?o=o.min(Number(r.value),r.message??"Value is too short"):r.requirement=="max"?o=o.max(Number(r.value),r.message??"Value is too long"):r.requirement=="regex"&&(o=o.regex(new RegExp(String(r.value)),r.message??"Value does not match requirements"));o.parse(e)}return}}catch(o){if(o instanceof Jo.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 Zl=Qo.div`
265
+ `;import Zo from"react";var Xe={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function st({title:e,required:t,appearance:o=Xe}){return e?Zo.createElement(wo,null,t?Zo.createElement(ti,{className:l("formLabelRequired",o),appearance:o},"*"):null,Zo.createElement(Rr,{className:l("formLabel",o)},e)):null}import oi from"react";function Nt({title:e,appearance:t}){return e?oi.createElement(wo,null,oi.createElement(ei,{className:l("formSubLabel",t)},e)):null}import{z as Ro}from"zod";function ri(e,t){try{if(t){if(t.type=="number"){let o=Ro.number();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too small"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too large"):i.requirement=="positive"?o=o.positive(i.message??"Value must be positive"):i.requirement=="negative"&&(o=o.nonpositive(i.message??"Value must be negative"));o.parse(Number(e))}if(t.type=="string"){let o=Ro.string();if(t.props)for(let i of t.props)i.requirement=="min"?o=o.min(Number(i.value),i.message??"Value is too short"):i.requirement=="max"?o=o.max(Number(i.value),i.message??"Value is too long"):i.requirement=="regex"&&(o=o.regex(new RegExp(String(i.value)),i.message??"Value does not match requirements"));o.parse(e)}return}}catch(o){if(o instanceof Ro.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 na=er.div`
259
266
  display: flex;
260
267
  flex-direction: column;
261
268
  width: 100%;
262
- `,Zo=Qo.input`
269
+ `,tr=er.input`
263
270
  ${e=>k(e)} {
264
271
  // Anything inside this block will be ignored if the user provides a custom class
265
272
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -275,7 +282,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
275
282
  box-sizing: border-box;
276
283
  padding: 0 10px;
277
284
  margin-bottom: 10px;
278
- `,Rl=Qo.textarea`
285
+ `,sa=er.textarea`
279
286
  ${e=>k(e)} {
280
287
  // Anything inside this block will be ignored if the user provides a custom class
281
288
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -291,13 +298,13 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
291
298
  min-height: 70px;
292
299
  box-sizing: border-box;
293
300
  margin-bottom: 10px;
294
- `;function Ro({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:r,inputData:i}){let n=e,[s,p]=oi((i==null?void 0:i.text)||""),[c,a]=oi(!1),g=Zo;Ql(()=>{s===""&&!c&&(a(!0),d(""))},[]);function d(y){if(p(y),o({text:y}),n.required===!0&&y.trim()===""){r([{id:n.id,message:`${n.title??"Field"} is required`}]);return}let w=ti(y,n.validation);if(w){r([{id:n.id,message:w}]);return}r([])}n.multiline&&(g=Rl);function x(){var y;switch((y=n==null?void 0:n.validation)==null?void 0:y.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return bo.createElement(Zl,null,bo.createElement(nt,{title:n.title,required:n.required,appearance:t.appearance}),bo.createElement(g,{className:l("inputComponent",t.appearance),value:s,onChange:y=>{d(y.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:x()}),bo.createElement(At,{title:n.subtitle,appearance:t.appearance}))}import We,{useEffect as ri,useState as ii}from"react";import ni from"styled-components";var er="",ea=ni.div`
301
+ `;function or({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=ii((r==null?void 0:r.text)||""),[c,a]=ii(!1),g=tr;ia(()=>{s===""&&!c&&(a(!0),d(""))},[]);function d(S){if(p(S),o({text:S}),n.required===!0&&S.trim()===""){i([{id:n.id,message:`${n.title??"Field"} is required`}]);return}let w=ri(S,n.validation);if(w){i([{id:n.id,message:w}]);return}i([])}n.multiline&&(g=sa);function x(){var S;switch((S=n==null?void 0:n.validation)==null?void 0:S.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return To.createElement(na,null,To.createElement(st,{title:n.title,required:n.required,appearance:t.appearance}),To.createElement(g,{className:l("inputComponent",t.appearance),value:s,onChange:S=>{d(S.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:x()}),To.createElement(Nt,{title:n.subtitle,appearance:t.appearance}))}import Ve,{useEffect as ni,useState as si}from"react";import li from"styled-components";var rr="",la=li.div`
295
302
  display: flex;
296
303
  flex-direction: column;
297
304
  width: 100%;
298
305
  -webkit-appearance: none;
299
306
  appearance: none;
300
- `,ta=ni.select`
307
+ `,aa=li.select`
301
308
  ${e=>k(e)} {
302
309
  // Anything inside this block will be ignored if the user provides a custom class
303
310
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -310,7 +317,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
310
317
 
311
318
  padding: 0 10px;
312
319
  margin-bottom: 10px;
313
- color: ${e=>{var t,o,r,i;return e.value==""?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextDisabled:(i=(r=e.appearance)==null?void 0:r.theme)==null?void 0:i.colorText}};
320
+ color: ${e=>{var t,o,i,r;return e.value==""?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextDisabled:(r=(i=e.appearance)==null?void 0:i.theme)==null?void 0:r.colorText}};
314
321
 
315
322
  appearance: none;
316
323
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'><path stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/></svg>");
@@ -318,15 +325,15 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
318
325
  background-repeat: no-repeat;
319
326
  background-size: 1.5em 1.5em;
320
327
  -webkit-print-color-adjust: exact;
321
- `;function si({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:r,setFormValidationErrors:i}){var g,d,x,y,w,P;let n=e,[s,p]=ii(((g=r==null?void 0:r.choice)==null?void 0:g[0])||""),[c,a]=ii(!1);return ri(()=>{var f,E,b,S;if(s===""&&!c){if(a(!0),n.requireSelection){p(er);return}if(n.defaultValue&&((f=n.props.options)!=null&&f.find(A=>A.id===n.defaultValue))){let A=(E=n.props.options)==null?void 0:E.find(C=>C.id===n.defaultValue);p(A.id),o({choice:[A.id]})}else p(((b=n.props.options)==null?void 0:b[0].id)||""),o({choice:[((S=n.props.options)==null?void 0:S[0].id)||""]})}},[]),ri(()=>{n.requireSelection&&s===er?i([{message:"Please select an option",id:n.id}]):i([])},[s]),We.createElement(ea,null,We.createElement(nt,{title:n.title,required:!1,appearance:t.appearance}),We.createElement(ta,{value:s,onChange:f=>{p(f.target.value),o({choice:[f.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},n.requireSelection&&We.createElement("option",{key:"null-value",value:er,disabled:!0},n.placeholder??"Select an option"),(d=n.props.options)==null?void 0:d.map(f=>We.createElement("option",{key:f.id,value:f.id},f.title))),((y=(x=n.props.options)==null?void 0:x.find(f=>f.id===s))==null?void 0:y.isOpenEnded)&&We.createElement(We.Fragment,null,We.createElement(nt,{title:((P=(w=n.props.options)==null?void 0:w.find(f=>f.id===s))==null?void 0:P.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),We.createElement(Zo,{type:"text",placeholder:"Enter your answer here",onChange:f=>{o({choice:[f.target.value]})},appearance:t.appearance})),We.createElement(At,{title:n.subtitle,appearance:t.appearance}))}import Qt,{useEffect as tr,useState as ai}from"react";import pi from"styled-components";import Jt from"react";import Xt from"react";var li=({color:e,percentage:t,size:o})=>{let r=o*.5-2,i=2*Math.PI*r,n=(1-t)*i;return Xt.createElement("circle",{r,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==i?e:"",strokeWidth:"3px",strokeDasharray:i,strokeDashoffset:t?n:0})},oa=({fillColor:e,size:t,percentage:o,children:r,bgColor:i="#D9D9D9",className:n,style:s})=>Xt.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},Xt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Xt.createElement(li,{color:i,size:t}),Xt.createElement(li,{color:e,percentage:o,size:t})),r),It=oa;import ra from"styled-components";var ia=({color:e="#FFFFFF"})=>Jt.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Jt.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),na={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},sa={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},la={border:"1px solid #000000",color:"#FFFFFF"},aa={border:"1px solid #C5CBD3"},pa={color:"#FFFFFF"},da={border:"1px solid #C5CBD3"},ca=e=>e==="square"?na:sa,ma=(e,t)=>e==="square"?t?la:aa:t?pa:da,ua=ra.div`
322
- ${e=>Ke(e)}
323
- `,Ye=({value:e,type:t="round",primaryColor:o="#000000",progress:r,appearance:i=qe,style:n,className:s})=>{let p=ca(t),c=ma(t,e);return e===!0?p={...p,...c,backgroundColor:i.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}:p={...p,...c},e!==!0&&t==="round"&&r!==void 0&&r!==1?Jt.createElement(It,{fillColor:o,percentage:r,size:22}):Jt.createElement(ua,{styleOverrides:p,style:n,role:"checkbox",className:be(l("checkIconContainer",i),l(e?"checkIconContainerChecked":"checkIconContainerUnchecked",i),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&Jt.createElement(ia,{color:"#FFFFFF"}))};var fa=pi.div`
328
+ `;function ai({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g,d,x,S,w,P;let n=e,[s,p]=si(((g=i==null?void 0:i.choice)==null?void 0:g[0])||""),[c,a]=si(!1);return ni(()=>{var f,A,b,y;if(s===""&&!c){if(a(!0),n.requireSelection){p(rr);return}if(n.defaultValue&&((f=n.props.options)!=null&&f.find(N=>N.id===n.defaultValue))){let N=(A=n.props.options)==null?void 0:A.find(h=>h.id===n.defaultValue);p(N.id),o({choice:[N.id]})}else p(((b=n.props.options)==null?void 0:b[0].id)||""),o({choice:[((y=n.props.options)==null?void 0:y[0].id)||""]})}},[]),ni(()=>{n.requireSelection&&s===rr?r([{message:"Please select an option",id:n.id}]):r([])},[s]),Ve.createElement(la,null,Ve.createElement(st,{title:n.title,required:!1,appearance:t.appearance}),Ve.createElement(aa,{value:s,onChange:f=>{p(f.target.value),o({choice:[f.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:l("multipleChoiceSelect",t.appearance)},n.requireSelection&&Ve.createElement("option",{key:"null-value",value:rr,disabled:!0},n.placeholder??"Select an option"),(d=n.props.options)==null?void 0:d.map(f=>Ve.createElement("option",{key:f.id,value:f.id},f.title))),((S=(x=n.props.options)==null?void 0:x.find(f=>f.id===s))==null?void 0:S.isOpenEnded)&&Ve.createElement(Ve.Fragment,null,Ve.createElement(st,{title:((P=(w=n.props.options)==null?void 0:w.find(f=>f.id===s))==null?void 0:P.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),Ve.createElement(tr,{type:"text",placeholder:"Enter your answer here",onChange:f=>{o({choice:[f.target.value]})},appearance:t.appearance})),Ve.createElement(Nt,{title:n.subtitle,appearance:t.appearance}))}import Zt,{useEffect as ir,useState as di}from"react";import ci from"styled-components";import Qt from"react";import Jt from"react";var pi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r;return Jt.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0})},pa=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9",className:n,style:s})=>Jt.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},Jt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Jt.createElement(pi,{color:r,size:t}),Jt.createElement(pi,{color:e,percentage:o,size:t})),i),It=pa;import da from"styled-components";var ca=({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"})),ma={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ua={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},fa={border:"1px solid #000000",color:"#FFFFFF"},ga={border:"1px solid #C5CBD3"},xa={color:"#FFFFFF"},ha={border:"1px solid #C5CBD3"},Ca=e=>e==="square"?ma:ua,ya=(e,t)=>e==="square"?t?fa:ga:t?xa:ha,Sa=da.div`
329
+ ${e=>Ye(e)}
330
+ `,Je=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Xe,style:n,className:s})=>{let p=Ca(t),c=ya(t,e);return e===!0?p={...p,...c,backgroundColor:r.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}:p={...p,...c},e!==!0&&t==="round"&&i!==void 0&&i!==1?Qt.createElement(It,{fillColor:o,percentage:i,size:22}):Qt.createElement(Sa,{styleOverrides:p,style:n,role:"checkbox",className:xe(l("checkIconContainer",r),l(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&Qt.createElement(ca,{color:"#FFFFFF"}))};var ba=ci.div`
324
331
  display: flex;
325
332
  flex-direction: column;
326
333
  width: 100%;
327
334
  -webkit-appearance: none;
328
335
  appearance: none;
329
- `,ga=pi.button`
336
+ `,wa=ci.button`
330
337
  ${e=>k(e)} {
331
338
  // Anything inside this block will be ignored if the user provides a custom class
332
339
  border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -351,7 +358,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
351
358
  height: 48px;
352
359
  padding: 0 18px;
353
360
  margin-bottom: 10px;
354
- `;function di({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:r,setFormValidationErrors:i}){var g;let n=e,[s,p]=ai((r==null?void 0:r.choice)||[]),[c,a]=ai(!1);return tr(()=>{s.length==0&&!c&&(a(!0),o({choice:[]}))},[]),tr(()=>{o({choice:s})},[s]),tr(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?i([{message:"",id:n.id}]):i([])},[s]),Qt.createElement(fa,null,Qt.createElement(nt,{title:n.title,required:n.required,appearance:t.appearance}),(g=n.props.options)==null?void 0:g.map(d=>Qt.createElement(ga,{appearance:t.appearance,className:l("multipleChoiceListItem",t.appearance),key:d.id,value:d.id,"data-selected":s.includes(d.id),onClick:()=>{if(s.includes(d.id)){p(s.filter(x=>x!==d.id));return}s.length<n.props.maxChoices?p([...s,d.id]):s.length==1&&n.props.maxChoices==1&&p([d.id])}},d.title,Qt.createElement(Ye,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(d.id),appearance:t.appearance}))),Qt.createElement(At,{title:n.subtitle,appearance:t.appearance}))}import wo from"react";import ci from"styled-components";import xa from"dompurify";function me(e){return{__html:xa.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var ha=ci.h1`
361
+ `;function mi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g;let n=e,[s,p]=di((i==null?void 0:i.choice)||[]),[c,a]=di(!1);return ir(()=>{s.length==0&&!c&&(a(!0),o({choice:[]}))},[]),ir(()=>{o({choice:s})},[s]),ir(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),Zt.createElement(ba,null,Zt.createElement(st,{title:n.title,required:n.required,appearance:t.appearance}),(g=n.props.options)==null?void 0:g.map(d=>Zt.createElement(wa,{appearance:t.appearance,className:l("multipleChoiceListItem",t.appearance),key:d.id,value:d.id,"data-selected":s.includes(d.id),onClick:()=>{if(s.includes(d.id)){p(s.filter(x=>x!==d.id));return}s.length<n.props.maxChoices?p([...s,d.id]):s.length==1&&n.props.maxChoices==1&&p([d.id])}},d.title,Zt.createElement(Je,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(d.id),appearance:t.appearance}))),Zt.createElement(Nt,{title:n.subtitle,appearance:t.appearance}))}import Fo from"react";import ui from"styled-components";import Ta from"dompurify";function me(e){return{__html:Ta.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var Fa=ui.h1`
355
362
  ${e=>k(e)} {
356
363
  font-style: normal;
357
364
  font-weight: 700;
@@ -363,7 +370,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
363
370
  margin-bottom: 4px;
364
371
  color: ${e=>e.appearance.theme.colorText};
365
372
  }
366
- `,Ca=ci.h2`
373
+ `,ka=ui.h2`
367
374
  ${e=>k(e)} {
368
375
  font-style: normal;
369
376
  font-weight: 400;
@@ -372,40 +379,40 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
372
379
  letter-spacing: 0.28px;
373
380
  color: ${e=>e.appearance.theme.colorTextSecondary};
374
381
  }
375
- `;function we({appearance:e,title:t,subtitle:o,size:r="medium",classPrefix:i=""}){return wo.createElement(wo.Fragment,null,wo.createElement(ha,{appearance:e,className:l(`${i}${i?Yt(r):r}Title`,e),dangerouslySetInnerHTML:me(t),size:r}),o&&wo.createElement(Ca,{appearance:e,className:l(`${i}${i?Yt(r):r}Subtitle`,e),dangerouslySetInnerHTML:me(o),size:r}))}import*as or from"react";var mi=e=>or.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},or.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"}));var ba=To.div`
382
+ `;function he({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return Fo.createElement(Fo.Fragment,null,Fo.createElement(Fa,{appearance:e,className:l(`${r}${r?Xt(i):i}Title`,e),dangerouslySetInnerHTML:me(t),size:i}),o&&Fo.createElement(ka,{appearance:e,className:l(`${r}${r?Xt(i):i}Subtitle`,e),dangerouslySetInnerHTML:me(o),size:i}))}import*as nr from"react";var fi=e=>nr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},nr.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"}));var Ba=ko.div`
376
383
  display: flex;
377
384
  flex-direction: column;
378
385
  justify-content: flex-end;
379
- padding-bottom: 14px;
380
386
  overflow: visible;
381
- `,wa=To.div`
387
+ padding-top: 14px;
388
+ `,Ea=ko.div`
382
389
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
383
390
  font-size: 12px;
384
391
  margin-bottom: 12px;
385
392
  display: flex;
386
393
  align-items: center;
387
- `,Ta=To.div`
394
+ `,Aa=ko.div`
388
395
  margin-right: 4px;
389
396
  display: inline-flex;
390
- `,Fa=To.div`
397
+ `,Na=ko.div`
391
398
  padding-left: 1px;
392
399
  padding-right: 1px;
393
- `,ka={text:Ro,multipleChoice:si,multipleChoiceList:di},ir="frigade-multiInputStepTypeData";function ui({flowId:e,stepData:t,canContinue:o,setCanContinue:r,onSaveData:i,appearance:n,customFormElements:s,prefillData:p}){var C;let c=t.props,[a,g]=rr([]),[d,x]=rr([]),{userId:y}=Kt(),[w,P]=rr(S()||(p?p[t.id]:null)||{}),{readonly:f}=Sa(K),E={...ka,...s};ya(()=>{r(a.length===0)},[a,r]);function b(m,B){let F={...w,[m.id]:B};P(F),i(F),window&&window.localStorage&&!f&&window.localStorage.setItem(A(),JSON.stringify(F))}function S(){if(window&&window.localStorage){let m=window.localStorage.getItem(A());if(m)return JSON.parse(m)}return null}function A(){return`${ir}-${e}-${t.id}-${y}`}return xt.createElement(Fa,{className:l("multiInput",n)},xt.createElement(we,{appearance:n,title:t.title,subtitle:t.subtitle}),xt.createElement(ba,{className:l("multiInputContainer",n)},(C=c.data)==null?void 0:C.map(m=>{var F;let B=(F=a.reverse().find(T=>T.id===m.id))==null?void 0:F.message;return E[m.type]?xt.createElement("span",{key:m.id,"data-field-id":m.id,className:l("multiInputField",n)},E[m.type]({formInput:m,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:r,onSaveData:i,appearance:n},onSaveInputData:T=>{!d.includes(m.id)&&T&&(T==null?void 0:T.text)!==""&&x(O=>[...O,m.id]),b(m,T)},inputData:w[m.id],setFormValidationErrors:T=>{g(O=>T.length===0?O.filter(I=>I.id!==m.id):[...O,...T])}}),B&&d.includes(m.id)&&xt.createElement(wa,{initial:{opacity:0,height:0,marginBottom:0},animate:{opacity:1,height:"auto",marginBottom:12},exit:{opacity:0,height:0,marginBottom:0},key:m.id,style:{overflow:"hidden"},transition:{duration:.1,ease:"easeInOut",delay:.5},appearance:n,className:l("multiInputValidationError",n)},xt.createElement(Ta,{appearance:n,className:l("multiInputValidationErrorIcon",n)},xt.createElement(mi,null)),B)):null})))}import ht from"styled-components";var fi=ht.div`
400
+ `,Ia={text:or,multipleChoice:ai,multipleChoiceList:mi},lr="frigade-multiInputStepTypeData";function gi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n,customFormElements:s,prefillData:p}){var h;let c=t.props,[a,g]=sr([]),[d,x]=sr([]),{userId:S}=qt(),[w,P]=sr(y()||(p?p[t.id]:null)||{}),{readonly:f}=Pa(K),A={...Ia,...s};va(()=>{i(a.length===0)},[a,i]);function b(m,v){let F={...w,[m.id]:v};P(F),r(F),window&&window.localStorage&&!f&&window.localStorage.setItem(N(),JSON.stringify(F))}function y(){if(window&&window.localStorage){let m=window.localStorage.getItem(N());if(m)return JSON.parse(m)}return null}function N(){return`${lr}-${e}-${t.id}-${S}`}return ht.createElement(Na,{className:l("multiInput",n)},ht.createElement(he,{appearance:n,title:t.title,subtitle:t.subtitle}),ht.createElement(Ba,{className:l("multiInputContainer",n)},(h=c.data)==null?void 0:h.map(m=>{var F;let v=(F=a.reverse().find(T=>T.id===m.id))==null?void 0:F.message;return A[m.type]?ht.createElement("span",{key:m.id,"data-field-id":m.id,className:l("multiInputField",n)},A[m.type]({formInput:m,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n},onSaveInputData:T=>{!d.includes(m.id)&&T&&(T==null?void 0:T.text)!==""&&x(O=>[...O,m.id]),b(m,T)},inputData:w[m.id],setFormValidationErrors:T=>{g(O=>T.length===0?O.filter(E=>E.id!==m.id):[...O,...T])}}),v&&d.includes(m.id)&&ht.createElement(Ea,{initial:{opacity:0,height:0,marginBottom:0},animate:{opacity:1,height:"auto",marginBottom:12},exit:{opacity:0,height:0,marginBottom:0},key:m.id,style:{overflow:"hidden"},transition:{duration:.1,ease:"easeInOut",delay:.5},appearance:n,className:l("multiInputValidationError",n)},ht.createElement(Aa,{appearance:n,className:l("multiInputValidationErrorIcon",n)},ht.createElement(fi,null)),v)):null})))}import Ct from"styled-components";var xi=Ct.div`
394
401
  align-items: center;
395
402
  display: flex;
396
403
  justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
397
404
  padding-top: 14px;
398
- `,gi=ht.div`
405
+ `,hi=Ct.div`
399
406
  color: ${e=>e.appearance.theme.colorTextError};
400
407
  font-size: 12px;
401
- `,xi=ht.div`
408
+ `,Ci=Ct.div`
402
409
  display: flex;
403
410
  gap: 12px;
404
- `,hi=ht.div`
411
+ `,yi=Ct.div`
405
412
  display: flex;
406
413
  flex-direction: row;
407
414
  flex: 1 1;
408
- `,Ci=ht.div`
415
+ `,Si=Ct.div`
409
416
  display: flex;
410
417
  // If type is set to large-modal, use padding 60px horizontal, 80px vertical
411
418
  // Otherwise, use 4px padding
@@ -413,11 +420,11 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
413
420
  flex-grow: 1;
414
421
  flex-basis: 0;
415
422
  position: relative;
416
- `,Si=ht.div`
423
+ `,bi=Ct.div`
417
424
  padding: ${e=>e.type==="large-modal"?"50px":"0px"};
418
425
  position: relative;
419
426
  overflow-y: auto;
420
- `,yi=ht.div`
427
+ `,wi=Ct.div`
421
428
  display: flex;
422
429
  align-self: stretch;
423
430
  flex-grow: 1;
@@ -429,7 +436,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
429
436
  background-position: center;
430
437
  border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
431
438
  border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
432
- `;import st from"react";import Pa from"react";import bi from"styled-components";var va=bi.button`
439
+ `;import lt from"react";import Oa from"react";import Ti from"styled-components";var La=Ti.button`
433
440
  justify-content: center;
434
441
  align-content: center;
435
442
  ${e=>k(e)} {
@@ -440,14 +447,14 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
440
447
  ${e=>e.withMargin?"margin: 16px 0px 16px 0px;":""}
441
448
 
442
449
  border: 1px solid ${e=>{var t,o;return e.secondary?"#C5CBD3":(o=(t=e==null?void 0:e.appearance)==null?void 0:t.theme)==null?void 0:o.colorPrimary}};
443
- color: ${e=>{var t,o,r,i;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText:(i=(r=e.appearance)==null?void 0:r.theme)==null?void 0:i.colorTextOnPrimaryBackground}};
444
- background-color: ${e=>{var t,o,r,i;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground:(i=(r=e==null?void 0:e.appearance)==null?void 0:r.theme)==null?void 0:i.colorPrimary}};
450
+ color: ${e=>{var t,o,i,r;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText:(r=(i=e.appearance)==null?void 0:i.theme)==null?void 0:r.colorTextOnPrimaryBackground}};
451
+ background-color: ${e=>{var t,o,i,r;return e.secondary?(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground:(r=(i=e==null?void 0:e.appearance)==null?void 0:i.theme)==null?void 0:r.colorPrimary}};
445
452
  border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
446
453
  padding: ${e=>e.size=="small"?"6px 14px 6px 14px":"8px 20px 8px 20px"};
447
454
  font-size: ${e=>e.size=="small"?"14px":"15px"};
448
455
  line-height: 20px;
449
456
  font-weight: 500;
450
- ${e=>Ke(e)}
457
+ ${e=>Ye(e)}
451
458
  }
452
459
 
453
460
  font-family: inherit;
@@ -460,7 +467,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
460
467
  opacity: 0.3;
461
468
  cursor: not-allowed;
462
469
  }
463
- `,Fo=bi.div`
470
+ `,Po=Ti.div`
464
471
  ${e=>k(e)} {
465
472
  display: flex;
466
473
  flex-direction: row;
@@ -471,14 +478,14 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
471
478
  margin-right: 8px;
472
479
  }
473
480
  }
474
- `,oe=({onClick:e,title:t,style:o,disabled:r,type:i="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:a=""})=>{function g(){let d=s?"buttonSecondary":"button";return a===""?d:`${a}${Yt(d)}`}return Pa.createElement(va,{secondary:s,appearance:p,disabled:r,onClick:e,styleOverrides:o,type:i,withMargin:c,size:n,className:l(g(),p)},t??"Continue")};var wi=({step:e,canContinue:t,appearance:o,onPrimaryClick:r,onSecondaryClick:i,formType:n,selectedStep:s,steps:p,onBack:c,allowBackNavigation:a,errorMessage:g})=>{let d=n==="inline"?"inline":"full-width",x=p.length>1&&s!=0&&a;return st.createElement(st.Fragment,null,g!==null&&g!=null&&st.createElement(gi,{appearance:o,className:l("formCTAError",o)},g),st.createElement(fi,{showBackButton:x,className:l("formCTAContainer",o)},x&&st.createElement(oe,{title:e.backButtonTitle??"\u2190",onClick:c,secondary:!0,withMargin:!1,type:d,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),st.createElement(xi,{className:l("ctaWrapper",o)},e.secondaryButtonTitle?st.createElement(oe,{title:e.secondaryButtonTitle,onClick:i,secondary:!0,withMargin:!1,type:d,appearance:o}):null," ",e.primaryButtonTitle?st.createElement(oe,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:r,type:d,appearance:o}):null)))};import nr from"react";import Ba from"styled-components";var Ea=Ba.div`
481
+ `,te=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:a=""})=>{function g(){let d=s?"buttonSecondary":"button";return a===""?d:`${a}${Xt(d)}`}return Oa.createElement(La,{secondary:s,appearance:p,disabled:i,onClick:e,styleOverrides:o,type:r,withMargin:c,size:n,className:l(g(),p)},t??"Continue")};var Fi=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,formType:n,selectedStep:s,steps:p,onBack:c,allowBackNavigation:a,errorMessage:g})=>{let d=n==="inline"?"inline":"full-width",x=p.length>1&&s!=0&&a;return lt.createElement(lt.Fragment,null,g!==null&&g!=null&&lt.createElement(hi,{appearance:o,className:l("formCTAError",o)},g),lt.createElement(xi,{showBackButton:x,className:l("formCTAContainer",o)},x&&lt.createElement(te,{title:e.backButtonTitle??"\u2190",onClick:c,secondary:!0,withMargin:!1,type:d,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),lt.createElement(Ci,{className:l("ctaWrapper",o)},e.secondaryButtonTitle?lt.createElement(te,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:d,appearance:o}):null," ",e.primaryButtonTitle?lt.createElement(te,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:d,appearance:o}):null)))};import ar from"react";import Da from"styled-components";var $a=Da.div`
475
482
  text-align: center;
476
- `,Ti=({stepCount:e=0,currentStep:t=0,className:o,appearance:r})=>{let{theme:i}=R().mergeAppearanceWithDefault(r);return nr.createElement(Ea,{className:o},nr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>nr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?i.colorPrimary:"#E6E6E6"}))))};import Ct from"react";import Nt from"styled-components";import{useContext as Aa}from"react";function ae(){let e=Aa(K);function t(i){r(i.primaryButtonUri,i.primaryButtonUriTarget)}function o(i){r(i.secondaryButtonUri,i.secondaryButtonUriTarget)}function r(i,n){if(!i)return;let s=i.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(i,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:r}}var Ia=Nt.div`
483
+ `,ki=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=Z().mergeAppearanceWithDefault(i);return ar.createElement($a,{className:o},ar.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>ar.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import yt from"react";import Ot from"styled-components";import{useContext as Ma}from"react";function ie(){let e=Ma(K);function t(r){i(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){i(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function i(r,n){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Ua=Ot.div`
477
484
  display: flex;
478
485
  flex-wrap: wrap;
479
486
  align-content: center;
480
487
  justify-content: center;
481
- `,Na=Nt.div`
488
+ `,za=Ot.div`
482
489
  align-content: center;
483
490
  align-items: center;
484
491
  display: flex;
@@ -492,10 +499,10 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
492
499
  flex-basis: 255px;
493
500
  flex-grow: 0;
494
501
  flex-shrink: 0;
495
- `,Oa=Nt.img`
502
+ `,_a=Ot.img`
496
503
  width: 78px;
497
504
  height: auto;
498
- `,La=Nt.button`
505
+ `,Wa=Ot.button`
499
506
  font-style: normal;
500
507
  font-weight: 600;
501
508
  font-size: 13px;
@@ -508,11 +515,11 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
508
515
  border-radius: 100px;
509
516
  padding: 8px 12px;
510
517
  margin-top: 16px;
511
- `,Da=Nt.h1`
518
+ `,Ha=Ot.h1`
512
519
  font-weight: 700;
513
520
  font-size: 28px;
514
521
  line-height: 34px;
515
- `,$a=Nt.h2`
522
+ `,Va=Ot.h2`
516
523
  font-style: normal;
517
524
  font-weight: 400;
518
525
  font-size: 16px;
@@ -521,7 +528,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
521
528
  margin-top: 12px;
522
529
  margin-bottom: 16px;
523
530
  max-width: 70%;
524
- `;function Fi({stepData:e,appearance:t}){var r,i;let{handleUrl:o}=ae();return Ct.createElement("div",null,Ct.createElement(Da,null,e.title),Ct.createElement($a,null,e.subtitle),Ct.createElement(Ia,null,(i=(r=e.props)==null?void 0:r.links)==null?void 0:i.map(n=>Ct.createElement(Na,{key:n.title},Ct.createElement(Oa,{src:n.imageUri}),Ct.createElement(La,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import Ot,{useEffect as Va}from"react";import vo from"styled-components";import sr from"react";var ko=({style:e,className:t})=>sr.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},sr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),sr.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 Zt,{useRef as Ma,useState as Ua}from"react";import Po from"styled-components";var _a=Po.div`
531
+ `;function Pi({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=ie();return yt.createElement("div",null,yt.createElement(Ha,null,e.title),yt.createElement(Va,null,e.subtitle),yt.createElement(Ua,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>yt.createElement(za,{key:n.title},yt.createElement(_a,{src:n.imageUri}),yt.createElement(Wa,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import Lt,{useEffect as Ja}from"react";import Eo from"styled-components";import pr from"react";var vo=({style:e,className:t})=>pr.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},pr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),pr.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 Rt,{useRef as ja,useState as Ga}from"react";import Bo from"styled-components";var Ka=Bo.div`
525
532
  display: flex;
526
533
  align-items: center;
527
534
  justify-content: flex-start;
@@ -529,7 +536,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
529
536
  width: 100%;
530
537
  height: 100%;
531
538
  position: relative;
532
- `,za=Po.div`
539
+ `,qa=Bo.div`
533
540
  position: absolute;
534
541
  display: flex;
535
542
  align-items: center;
@@ -548,56 +555,56 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
548
555
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
549
556
  border-radius: 50%;
550
557
  }
551
- `,Wa=Po.video`
558
+ `,Ya=Bo.video`
552
559
  width: 100%;
553
560
  height: 100%;
554
561
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
555
- `,Ha=Po.iframe`
562
+ `,Xa=Bo.iframe`
556
563
  width: 100%;
557
564
  height: 100%;
558
565
  min-height: 260px;
559
566
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
560
- `;function lt({appearance:e,videoUri:t}){let o=Ma(),[r,i]=Ua(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),Zt.createElement(Ha,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return Zt.createElement(_a,{className:l("videoPlayerWrapper",e),appearance:e},!r&&Zt.createElement(za,{onClick:()=>{i(!0),o.current.play()},appearance:e},Zt.createElement(ko,null)),Zt.createElement(Wa,{appearance:e,controls:r,ref:o,play:r,src:t}))}var ja=vo.div`
567
+ `;function at({appearance:e,videoUri:t}){let o=ja(),[i,r]=Ga(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),Rt.createElement(Xa,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return Rt.createElement(Ka,{className:l("videoPlayerWrapper",e),appearance:e},!i&&Rt.createElement(qa,{onClick:()=>{r(!0),o.current.play()},appearance:e},Rt.createElement(vo,null)),Rt.createElement(Ya,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Qa=Eo.div`
561
568
  ${e=>k(e)} {
562
569
  display: flex;
563
570
  flex-direction: column;
564
571
  justify-content: center;
565
572
  }
566
- `,Ga=vo.img`
573
+ `,Za=Eo.img`
567
574
  ${e=>k(e)} {
568
575
  width: 100%;
569
576
  height: auto;
570
577
  max-height: 250px;
571
578
  margin-bottom: 24px;
572
579
  }
573
- `,Ka=vo.div`
580
+ `,Ra=Eo.div`
574
581
  ${e=>k(e)} {
575
582
  margin-bottom: 24px;
576
583
  }
577
- `,qa=vo.div`
584
+ `,ep=Eo.div`
578
585
  ${e=>k(e)} {
579
586
  width: 100%;
580
587
  height: auto;
581
588
  max-height: 250px;
582
589
  margin-bottom: 24px;
583
590
  }
584
- `;function ki({stepData:e,appearance:t,setCanContinue:o}){return Va(()=>{o(!0)},[]),Ot.createElement(ja,{className:l("callToActionContainer",t)},Ot.createElement(Ka,{className:l("callToActionTextContainer",t)},Ot.createElement(we,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Ot.createElement(Ga,{className:l("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Ot.createElement(qa,{appearance:t,className:l("callToActionVideo",t)},Ot.createElement(lt,{appearance:t,videoUri:e.videoUri})))}import Xe,{useEffect as lr,useState as ar}from"react";import at from"styled-components";var Pi=at.div`
591
+ `;function vi({stepData:e,appearance:t,setCanContinue:o}){return Ja(()=>{o(!0)},[]),Lt.createElement(Qa,{className:l("callToActionContainer",t)},Lt.createElement(Ra,{className:l("callToActionTextContainer",t)},Lt.createElement(he,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Lt.createElement(Za,{className:l("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Lt.createElement(ep,{appearance:t,className:l("callToActionVideo",t)},Lt.createElement(at,{appearance:t,videoUri:e.videoUri})))}import Qe,{useEffect as dr,useState as cr}from"react";import pt from"styled-components";var Bi=pt.div`
585
592
  width: auto;
586
593
  display: flex;
587
594
  flex-direction: column;
588
595
  justify-content: center;
589
596
  align-items: center;
590
597
  padding: 4px;
591
- `,vi=at.div`
598
+ `,Ei=pt.div`
592
599
  width: 100%;
593
600
  text-align: left;
594
- `,Bi=at.h1`
601
+ `,Ai=pt.h1`
595
602
  font-style: normal;
596
603
  font-weight: 700;
597
604
  font-size: 32px;
598
605
  line-height: 38px;
599
606
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
600
- `,Ei=at.h1`
607
+ `,Ni=pt.h1`
601
608
  font-style: normal;
602
609
  font-weight: 400;
603
610
  font-size: 16px;
@@ -605,7 +612,7 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
605
612
  margin-top: 16px;
606
613
  margin-bottom: 16px;
607
614
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
608
- `,Ai=at.div`
615
+ `,Ii=pt.div`
609
616
  padding-top: 12px;
610
617
  padding-bottom: 12px;
611
618
  flex-direction: row;
@@ -616,17 +623,17 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
616
623
  cursor: pointer;
617
624
  border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
618
625
  width: 100%;
619
- `,Ii=at.div`
626
+ `,Oi=pt.div`
620
627
  padding-top: 10px;
621
628
  padding-bottom: 10px;
622
629
  flex-direction: row;
623
630
  display: flex;
624
631
  justify-content: flex-start;
625
- `,Ni=at.img`
632
+ `,Li=pt.img`
626
633
  width: 42px;
627
634
  height: 42px;
628
635
  margin-right: 12px;
629
- `,Oi=at.p`
636
+ `,Di=pt.p`
630
637
  font-style: normal;
631
638
  font-weight: 500;
632
639
  font-size: 17px;
@@ -634,79 +641,85 @@ import yt,{createContext as kp,useEffect as No,useState as Oe}from"react";import
634
641
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
635
642
  display: flex;
636
643
  align-self: center;
637
- `;var Li=({stepData:e,setCanContinue:t,onSaveData:o,appearance:r})=>{let i=e.props,[n,s]=ar([]),[p,c]=ar(!1),[a,g]=ar(e.id);return lr(()=>{n.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),lr(()=>{a!==e.id&&(g(e.id),s([]))},[e]),lr(()=>{o({choice:n}),n.length>=i.minChoices?t(!0):t(!1)},[n]),Xe.createElement(Pi,{className:l("selectListContainer",r)},Xe.createElement(vi,null,Xe.createElement(Bi,{className:l("selectListTitle",r)},e.title),Xe.createElement(Ei,{appearance:r,className:l("selectListSubtitle",r)},e.subtitle)),i.options.map((d,x)=>{let y=n.includes(d.id);return Xe.createElement(Ai,{key:`select-item-${x}`,onClick:()=>{if(n.includes(d.id)){s(n.filter(w=>w!==d.id));return}n.length<i.maxChoices?s([...n,d.id]):n.length==1&&i.maxChoices==1&&s([d.id])},hideBottomBorder:x===i.options.length-1,className:l("selectListSelectItem",r)},Xe.createElement(Ii,{className:l("selectListItemImage",r)},d.imageUri&&Xe.createElement(Ni,{src:d.imageUri,alt:`select-icon-${x}`}),Xe.createElement(Oi,{appearance:r,className:l("selectListSelectItemText",r)},d.title)),Xe.createElement(Ye,{appearance:r,value:y,primaryColor:r.theme.colorPrimary}))}))};import Te,{useEffect as Bo,useState as Rt}from"react";var Ya=({children:e,id:t,shouldWrap:o=!1})=>Te.createElement(Te.Fragment,null,o?Te.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Eo=({appearance:e,steps:t,selectedStep:o,customStepTypes:r,customVariables:i,onButtonClick:n,onStepCompletion:s,flowId:p,type:c,hideOnFlowCompletion:a,onComplete:g,setVisible:d,setShowModal:x,onDismiss:y,showPagination:w=!1,customFormElements:P,allowBackNavigation:f,validationHandler:E,onFormDataChange:b,showFooter:S,prefillData:A})=>{var V;let m={...{linkCollection:Fi,multiInput:ui,callToAction:ki,selectList:Li},...r},{primaryCTAClickSideEffects:B,secondaryCTAClickSideEffects:F}=ae(),[T,O]=Rt(!1),[I,M]=Rt({}),[D,L]=Rt(!1),[ee,U]=Rt(!1),[J,fe]=Rt(null),q=t[o]??null,{markStepCompleted:W,markStepStarted:H,isLoading:he,updateCustomVariables:Ie,markFlowCompleted:ye}=Z();Bo(()=>{Ie(i)},[i,he]),Bo(()=>{b&&b(I,ce(),t[o],o)},[I]),Bo(()=>{window&&f&&!ee&&(window.location.hash=t[o].id,U(!0))},[f,ee,U]),Bo(()=>{var j;if(window&&((j=window==null?void 0:window.location)!=null&&j.hash)&&window.location.hash.replace("#","")!==t[o].id){let ie=window.location.hash.replace("#",""),ne=t.findIndex(le=>le.id===ie);ne!==-1&&H(p,t[ne].id)}},[(V=window==null?void 0:window.location)==null?void 0:V.hash,H,o,t]);function ce(){return{data:I[t[o].id]??{},stepId:t[o].id,customVariables:i}}function Y(j,ie,ne){let le=o+1<t.length?t[o+1]:null;return s&&s(j,ne,le,I,ce()),n?n(j,o,ie,le):!0}function ge(j,ie){M(ne=>{let le={};return le[j.id]=ie,{...ne,...le}})}function te(j){return j.selectedStep.imageUri?Te.createElement(yi,{image:j.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let N=S&&Te.createElement(wi,{step:t[o],canContinue:T&&!D,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(L(!0),E){let ne=await E(t[o],o,t[o+1],I,ce());if(ne||ne===!1){fe(typeof ne=="string"?ne:null),L(!1);return}else fe(null)}let j={...ce()};await W(p,t[o].id,j),o+1<t.length&&await H(p,t[o+1].id);let ie=Y(t[o],"primary",o);o+1>=t.length&&(g&&g(),y&&y(),a&&ie&&(d&&d(!1),x(!1)),await ye(p)),B(t[o]),L(!1),window&&f&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{Y(t[o],"secondary",o),F(t[o])},onBack:async()=>{o-1>=0&&(L(!0),await H(p,t[o-1].id),L(!1))},steps:t,allowBackNavigation:f,errorMessage:J});return Te.createElement(Te.Fragment,null,Te.createElement(hi,{className:l("formContainer",e)},Te.createElement(Ci,null,Te.createElement(Ya,{id:o,shouldWrap:c==="large-modal"},Te.createElement(Si,{key:q.id,type:c,className:l("formContent",e)},t.map(j=>{let ie=m[j.type];return q.id!==j.id?null:Te.createElement(ie,{key:j.id,stepData:j,canContinue:T,setCanContinue:O,onSaveData:ne=>{ge(j,ne)},appearance:e,customFormElements:P,flowId:p,prefillData:A})}),w&&Te.createElement(Ti,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),N))),c=="large-modal"&&Te.createElement(te,{selectedStep:t[o]})))};import eo from"react";import{createGlobalStyle as Xa}from"styled-components";function re({appearance:e}){if(!e||!e.styleOverrides)return eo.createElement(eo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([r,i])=>typeof i=="object");if(t.length===0)return eo.createElement(eo.Fragment,null);let o=Xa`
638
- ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map(([s,p])=>`${Go(s)}: ${p};`).join(" ")} }`).join(" ")}`;return eo.createElement(o,{inlineStyles:t})}var Di=({flowId:e,customStepTypes:t={},type:o="inline",visible:r,setVisible:i,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:a=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:y=!1,modalPosition:w="center",repeatable:P=!1,onDismiss:f,showPagination:E=!1,allowBackNavigation:b=!1,validationHandler:S,showFrigadeBranding:A=!1,onFormDataChange:C,showFooter:m=!0,prefillData:B={}})=>{let{getFlow:F,getFlowSteps:T,isLoading:O,targetingLogicShouldHideFlow:I,getFlowStatus:M,getCurrentStepIndex:D,markFlowCompleted:L,markFlowNotStarted:ee}=Z(),U=D(e),{mergeAppearanceWithDefault:J}=R(),[fe,q]=Qa(!1),{setOpenFlowState:W,getOpenFlowState:H,hasOpenModals:he}=Pe();c=J(c);let[Ie,ye]=r!==void 0&&i!==void 0?[r,i]:[H(e,!0),te=>W(e,te)];if(Ja(()=>{!fe&&!O&&(q(!0),M(e)===Q&&P&&(ee(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(N=>{N.startsWith(ir)&&window.localStorage.removeItem(N)})),q(!0))},[fe,q,O]),O)return null;let ce=F(e);if(!ce||I(ce))return null;let Y=T(e);if(!Y||r!==void 0&&r===!1||M(e)===Q&&a||(o=="modal"||o=="corner-modal")&&he(e))return null;let ge=()=>{ye(!1),f&&f(),y===!0&&L(e)};if(w=="center"&&o==="modal"||o==="large-modal"){let te={padding:"24px"};return o==="large-modal"?(te.width="85%",te.height="90%",te.maxHeight="800px",te.minHeight="500px",te.padding="0"):te.width="400px",He.createElement(rt,{appearance:c,onClose:ge,visible:Ie,style:te,dismissible:x,showFrigadeBranding:A},He.createElement(re,{appearance:c}),He.createElement(Eo,{appearance:c,steps:Y,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:i,setShowModal:ye,onDismiss:f,showPagination:E,customFormElements:s,allowBackNavigation:b,validationHandler:S,onFormDataChange:C,showFooter:m,prefillData:B}))}return o==="modal"&&w!=="center"?He.createElement(Jr,{appearance:c,onClose:ge,visible:Ie},He.createElement(re,{appearance:c}),He.createElement(Eo,{appearance:c,steps:Y,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:i,setShowModal:ye,onDismiss:f,showPagination:E,customFormElements:s,allowBackNavigation:b,validationHandler:S,onFormDataChange:C,showFooter:m,prefillData:B})):He.createElement(He.Fragment,null,He.createElement(re,{appearance:c}),He.createElement(Eo,{appearance:c,steps:Y,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:i,setShowModal:ye,onDismiss:f,showPagination:E,customFormElements:s,allowBackNavigation:b,validationHandler:S,onFormDataChange:C,showFooter:m,prefillData:B}))},$i=Di;import{useCallback as Mi,useContext as Za,useEffect as Ra}from"react";function pr(){let{organizationId:e,userId:t,setOrganizationId:o}=Za(K),{mutateUserFlowState:r}=ve(),{config:i,apiUrl:n}=ze(),s=vt(),{verifySDKInitiated:p}=Bt();Ra(()=>{if(t&&e){if(t.startsWith(Et))return;let g=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(g)||(s(`${n}userGroups`,{...i,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(g,"true"))}},[t,e]);let c=Mi(async g=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let d={foreignUserId:t,foreignUserGroupId:e,properties:g};await s(`${n}userGroups`,{...i,method:"POST",body:JSON.stringify(d)}),r()},[e,t,i,r]),a=Mi(async(g,d)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let y={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:d}]};await s(`${n}userGroups`,{...i,method:"POST",body:JSON.stringify(y)}),r()},[e,t,i,r]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:c,trackEventForOrganization:a}}var Ui="frigade-xFrigade_guestUserId",to="frigade-xFrigade_userId",_i=({})=>{let{setFlowResponses:e}=Gt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:r}=ve(),{userId:i,setUserId:n}=Kt(),[s,p]=dr(null),{getFlowStatus:c}=Z(),{flows:a,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=ep(K),[y,w]=dr([]),[P,f]=dr([]),{organizationId:E}=pr();Ao(()=>{if(!o&&t)for(let C=0;C<t.length;C++){let m=t[C],B=a.find(F=>F.slug===(m==null?void 0:m.flowId));if(B&&m&&m.shouldTrigger===!0&&B.type=="FORM"&&B.triggerType==="AUTOMATIC"&&!P.includes(B.slug)){setTimeout(()=>{b(m.flowId)},500);break}}},[o,t]),Ao(()=>{x.length>0&&r()},[x]);function b(C){let m=a.find(B=>B.slug===C);m&&m.triggerType==="AUTOMATIC"&&!P.includes(m.slug)&&(f([...P,m.slug]),w([m]))}function S(){if(!i){let C=localStorage.getItem(to);if(C){n(C);return}let m=localStorage.getItem(Ui);if(m){n(m);return}d(!0);let B=Et+tp();try{localStorage.setItem(Ui,B)}catch(F){console.log("Failed to save guest user id locally: Local storage unavailable",F)}n(F=>F||B)}}Ao(()=>{try{if(a){let C=[];a.forEach(m=>{if(m.data){let B=m.data.match(/"imageUri":"(.*?)"/g);B&&B.forEach(F=>{let T=F.replace('"imageUri":"',"").replace('"',"");if(C.includes(T))return;let O=new Image;O.src=T,C.push(T)})}})}}catch{}},[a]),Ao(()=>{if(i!==s&&e([]),p(i),i&&!i.startsWith(Et))try{localStorage.setItem(to,i)}catch(C){console.log("Failed to save user id locally: Local storage available",C)}i===null&&setTimeout(()=>{i===null&&S()},50)},[i,a,g]);function A(){return St.createElement(St.Fragment,null,y.map(C=>c(C.slug)!==$e?null:St.createElement("span",{key:C.slug},St.createElement($i,{flowId:C.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return St.createElement(St.Fragment,null,St.createElement(A,null))};import{ErrorBoundary as vp}from"react-error-boundary";import oo from"core-js-pure/actual/structured-clone";function cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pt(...e){let t=e.shift(),o=e.length===1?e[0]:pt(...e);if(!cr(t)||!cr(o))throw new Error("deepmerge can only merge Objects");let r=oo(t);return Object.entries(o).forEach(([i,n])=>{cr(n)?r[i]!==void 0?Object.assign(r,{[i]:pt(r[i],oo(n))}):Object.assign(r,{[i]:oo(n)}):Array.isArray(n)?r[i]!==void 0?Object.assign(r,{[i]:[...r[i],...oo(n)]}):Object.assign(r,{[i]:oo(n)}):Object.assign(r,{[i]:n})}),r}var zi={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function op(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,r])=>{if(zi[o]){let i=zi[o].split("."),n=t;i.forEach((s,p)=>{n[s]||(n[s]=p===i.length-1?r:{}),n=n[s]})}}),t}function rp(e){if(!e)return;let t=pt({},e),o={};return Object.keys(t).forEach(r=>{let i=`.fr-${r}`;o[i]=t[r]}),o}function Wi(e){let{theme:t,styleOverrides:o}=e,r=op(t),i=rp(o);return{overrides:r,css:i}}import hp from"styled-components";import{compose as Cp,variant as Vi}from"styled-system";import Hi from"react";import ip,{ThemeProvider as np,useTheme as sp}from"styled-components";import{border as lp,color as ap,compose as pp,get as dp,shadow as cp,space as mp,system as up,typography as fp}from"styled-system";var gp={width:{property:"width",scale:"sizes",transform:(e,t)=>dp(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},xp=ip("div")(({css:e})=>e,pp(lp,ap,cp,mp,fp,up(gp))),ro=({as:e,children:t,overrides:o,...r})=>{let i=sp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>Hi.createElement(xp,{as:e,...n,...r},t);if(o!==void 0){let p=pt(i,o);return Hi.createElement(np,{theme:p},s())}return s()};var io={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},Sp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},ji=hp(ro)(()=>({whiteSpace:"nowrap"}),Cp(Vi({scale:"components.Button",variants:"components.Button"}),Vi({prop:"size",variants:Sp})));import yp from"styled-components";import{variant as bp,system as wp}from"styled-system";var Io={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var Gi=yp(ro)(bp({scale:"components.Text",variants:"components.Text"}),wp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Ki=4,qi="px",Tp=20,Fp=Object.fromEntries(Array.from(Array(Tp+1),(e,t)=>t===0?[.5,`${.5*Ki}${qi}`]:[t,`${t*Ki}${qi}`])),Lt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},mr={colors:{...Lt,neutral:{foreground:Lt.gray300},primary:{background:Lt.blue500,foreground:Lt.white,inverted:Lt.blue500},negative:{foreground:Lt.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:Fp,components:{Button:io,Text:Io}};var Yi="https://api.frigade.com",K=kp({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:Yi,readonly:!1});function Bp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Ep=({publicApiKey:e,userId:t,organizationId:o,config:r,children:i})=>{var fe,q;let[n,s]=Oe(t||null),[p,c]=Oe(o||null),[a,g]=Oe([]),[d,x]=Oe([]),[y,w]=Oe([]),[P,f]=Oe({}),[E,b]=Oe({}),[S,A]=Oe([]),[C,m]=Oe({}),[B,F]=Oe(!1),[T,O]=Oe(!1),[I,M]=Oe(!ee(e)),D=(W,H)=>{if(H==="_blank"){window.open(W,"_blank");return}setTimeout(()=>{window.location.href=W},50)},L={theme:{...qe.theme,...((fe=r==null?void 0:r.defaultAppearance)==null?void 0:fe.theme)??{}},styleOverrides:{...qe.styleOverrides,...((q=r==null?void 0:r.defaultAppearance)==null?void 0:q.styleOverrides)??{}}};function ee(W){return!!(W&&W.length>10&&W.substring(0,10)==="api_public")}No(()=>{t&&s(t)},[t]),No(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(to)&&window.localStorage.getItem(to)!==n&&Bp()},[n]),No(()=>{o&&c(o)},[o]),No(()=>{if(ee(e))M(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),M(!0);return}},[e,M]);let U={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:a,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:y,setFlowResponses:w,userProperties:P,setUserProperties:f,openFlowStates:E,setOpenFlowStates:b,completedFlowsToKeepOpenDuringSession:S,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:C,setCustomVariables:m,isNewGuestUser:B,setIsNewGuestUser:F,hasActiveFullPageFlow:T,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:r&&r.navigate?r.navigate:D,defaultAppearance:L,shouldGracefullyDegrade:I,setShouldGracefullyDegrade:M,apiUrl:r&&r.apiUrl?r.apiUrl:Yi,readonly:r&&r.readonly?r.readonly:!1};if(I)return yt.createElement(K.Provider,{value:U},i);let{overrides:J}=Wi(L);return yt.createElement(vp,{fallback:yt.createElement(yt.Fragment,null,i)},yt.createElement(K.Provider,{value:U},yt.createElement(Pp,{theme:pt(L.theme,mr,J??{},(r==null?void 0:r.theme)??{})},i,yt.createElement(_i,null))))};import Cd from"react";import de,{useEffect as Fs,useState as ks}from"react";import _e,{useState as qp}from"react";import Tt from"styled-components";import Do from"react";import bt from"react";import Ji from"styled-components";var Xi=Ji.span`
639
- font-weight: 400;
640
- font-size: 15px;
641
- line-height: 20px;
644
+ `;var $i=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=cr([]),[p,c]=cr(!1),[a,g]=cr(e.id);return dr(()=>{n.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),dr(()=>{a!==e.id&&(g(e.id),s([]))},[e]),dr(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),Qe.createElement(Bi,{className:l("selectListContainer",i)},Qe.createElement(Ei,null,Qe.createElement(Ai,{className:l("selectListTitle",i)},e.title),Qe.createElement(Ni,{appearance:i,className:l("selectListSubtitle",i)},e.subtitle)),r.options.map((d,x)=>{let S=n.includes(d.id);return Qe.createElement(Ii,{key:`select-item-${x}`,onClick:()=>{if(n.includes(d.id)){s(n.filter(w=>w!==d.id));return}n.length<r.maxChoices?s([...n,d.id]):n.length==1&&r.maxChoices==1&&s([d.id])},hideBottomBorder:x===r.options.length-1,className:l("selectListSelectItem",i)},Qe.createElement(Oi,{className:l("selectListItemImage",i)},d.imageUri&&Qe.createElement(Li,{src:d.imageUri,alt:`select-icon-${x}`}),Qe.createElement(Di,{appearance:i,className:l("selectListSelectItemText",i)},d.title)),Qe.createElement(Je,{appearance:i,value:S,primaryColor:i.theme.colorPrimary}))}))};import ke,{useEffect as Ao,useState as eo}from"react";var tp=({children:e,id:t,shouldWrap:o=!1})=>ke.createElement(ke.Fragment,null,o?ke.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),No=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:c,hideOnFlowCompletion:a,onComplete:g,setVisible:d,setShowModal:x,onDismiss:S,showPagination:w=!1,customFormElements:P,allowBackNavigation:f,validationHandler:A,onFormDataChange:b,showFooter:y,prefillData:N})=>{var V;let m={...{linkCollection:Pi,multiInput:gi,callToAction:vi,selectList:$i},...i},{primaryCTAClickSideEffects:v,secondaryCTAClickSideEffects:F}=ie(),[T,O]=eo(!1),[E,$]=eo({}),[D,L]=eo(!1),[X,U]=eo(!1),[ee,fe]=eo(null),J=t[o]??null,{markStepCompleted:W,markStepStarted:H,isLoading:ye,updateCustomVariables:Ne,markFlowCompleted:we}=Y();Ao(()=>{Ne(r)},[r,ye]),Ao(()=>{b&&b(E,ce(),t[o],o)},[E]),Ao(()=>{window&&f&&!X&&(window.location.hash=t[o].id,U(!0))},[f,X,U]),Ao(()=>{var j;if(window&&((j=window==null?void 0:window.location)!=null&&j.hash)&&window.location.hash.replace("#","")!==t[o].id){let ne=window.location.hash.replace("#",""),se=t.findIndex(ae=>ae.id===ne);se!==-1&&H(p,t[se].id)}},[(V=window==null?void 0:window.location)==null?void 0:V.hash,H,o,t]);function ce(){return{data:E[t[o].id]??{},stepId:t[o].id,customVariables:r}}function Q(j,ne,se){let ae=o+1<t.length?t[o+1]:null;return s&&s(j,se,ae,E,ce()),n?n(j,o,ne,ae):!0}function ge(j,ne){$(se=>{let ae={};return ae[j.id]=ne,{...se,...ae}})}function re(j){return j.selectedStep.imageUri?ke.createElement(wi,{image:j.selectedStep.imageUri,appearance:e,className:l("formContainerSidebarImage",e)}):null}let I=y&&ke.createElement(Fi,{step:t[o],canContinue:T&&!D,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(L(!0),A){let se=await A(t[o],o,t[o+1],E,ce());if(se||se===!1){fe(typeof se=="string"?se:null),L(!1);return}else fe(null)}let j={...ce()};await W(p,t[o].id,j),o+1<t.length&&await H(p,t[o+1].id);let ne=Q(t[o],"primary",o);o+1>=t.length&&(g&&g(),S&&S(),a&&ne&&(d&&d(!1),x(!1)),await we(p)),v(t[o]),L(!1),window&&f&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{Q(t[o],"secondary",o),F(t[o])},onBack:async()=>{o-1>=0&&(L(!0),await H(p,t[o-1].id),L(!1))},steps:t,allowBackNavigation:f,errorMessage:ee});return ke.createElement(ke.Fragment,null,ke.createElement(yi,{className:l("formContainer",e)},ke.createElement(Si,null,ke.createElement(tp,{id:o,shouldWrap:c==="large-modal"},ke.createElement(bi,{key:J.id,type:c,className:l("formContent",e)},t.map(j=>{let ne=m[j.type];return J.id!==j.id?null:ke.createElement(ne,{key:j.id,stepData:j,canContinue:T,setCanContinue:O,onSaveData:se=>{ge(j,se)},appearance:e,customFormElements:P,flowId:p,prefillData:N})}),w&&ke.createElement(ki,{className:l("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),I))),c=="large-modal"&&ke.createElement(re,{selectedStep:t[o]})))};import to from"react";import{createGlobalStyle as op}from"styled-components";function oe({appearance:e}){if(!e||!e.styleOverrides)return to.createElement(to.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,r])=>typeof r=="object");if(t.length===0)return to.createElement(to.Fragment,null);let o=op`
645
+ ${i=>i.inlineStyles.map(([r,n])=>`.${Yt}${r}.${Yt}${r} { ${Object.entries(n).map(([s,p])=>`${Yo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return to.createElement(o,{inlineStyles:t})}var Mi=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:a=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:S=!1,modalPosition:w="center",repeatable:P=!1,onDismiss:f,showPagination:A=!1,allowBackNavigation:b=!1,validationHandler:y,showFrigadeBranding:N=!1,onFormDataChange:h,showFooter:m=!0,prefillData:v={}})=>{let{getFlow:F,getFlowSteps:T,isLoading:O,targetingLogicShouldHideFlow:E,getFlowStatus:$,getCurrentStepIndex:D,markFlowCompleted:L,markFlowNotStarted:X}=Y(),U=D(e),{mergeAppearanceWithDefault:ee}=Z(),[fe,J]=ip(!1),{setOpenFlowState:W,getOpenFlowState:H,hasOpenModals:ye}=Te();c=ee(c);let[Ne,we]=i!==void 0&&r!==void 0?[i,r]:[H(e,!0),re=>W(e,re)];if(rp(()=>{!fe&&!O&&(J(!0),$(e)===q&&P&&(X(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(I=>{I.startsWith(lr)&&window.localStorage.removeItem(I)})),J(!0))},[fe,J,O]),O)return null;let ce=F(e);if(!ce||E(ce))return null;let Q=T(e);if(!Q||i!==void 0&&i===!1||$(e)===q&&a||(o=="modal"||o=="corner-modal")&&ye(e))return null;let ge=()=>{we(!1),f&&f(),S===!0&&L(e)};if(w=="center"&&o==="modal"||o==="large-modal"){let re={padding:"24px"};return o==="large-modal"?(re.width="85%",re.height="90%",re.maxHeight="800px",re.minHeight="500px",re.padding="0"):re.width="400px",je.createElement(He,{appearance:c,onClose:ge,visible:Ne,style:re,dismissible:x,showFrigadeBranding:N},je.createElement(oe,{appearance:c}),je.createElement(No,{appearance:c,steps:Q,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:we,onDismiss:f,showPagination:A,customFormElements:s,allowBackNavigation:b,validationHandler:y,onFormDataChange:h,showFooter:m,prefillData:v}))}return o==="modal"&&w!=="center"?je.createElement(So,{appearance:c,onClose:ge,visible:Ne,modalPosition:w},je.createElement(oe,{appearance:c}),je.createElement(No,{appearance:c,steps:Q,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:we,onDismiss:f,showPagination:A,customFormElements:s,allowBackNavigation:b,validationHandler:y,onFormDataChange:h,showFooter:m,prefillData:v})):je.createElement(je.Fragment,null,je.createElement(oe,{appearance:c}),je.createElement(No,{appearance:c,steps:Q,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:we,onDismiss:f,showPagination:A,customFormElements:s,allowBackNavigation:b,validationHandler:y,onFormDataChange:h,showFooter:m,prefillData:v}))},Ui=Mi;import{useCallback as zi,useContext as np,useEffect as sp}from"react";function mr(){let{organizationId:e,userId:t,setOrganizationId:o}=np(K),{mutateUserFlowState:i}=Be(),{config:r,apiUrl:n}=We(),s=Bt(),{verifySDKInitiated:p}=Et();sp(()=>{if(t&&e){if(t.startsWith(At))return;let g=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(g)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(g,"true"))}},[t,e]);let c=zi(async g=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let d={foreignUserId:t,foreignUserGroupId:e,properties:g};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(d)}),i()},[e,t,r,i]),a=zi(async(g,d)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:d}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(S)}),i()},[e,t,r,i]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:c,trackEventForOrganization:a}}var _i="frigade-xFrigade_guestUserId",oo="frigade-xFrigade_userId",Wi=({})=>{let{setFlowResponses:e}=Kt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Be(),{userId:r,setUserId:n}=qt(),[s,p]=ur(null),{getFlowStatus:c}=Y(),{flows:a,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=lp(K),[S,w]=ur([]),[P,f]=ur([]),{organizationId:A}=mr();Io(()=>{if(!o&&t)for(let h=0;h<t.length;h++){let m=t[h],v=a.find(F=>F.slug===(m==null?void 0:m.flowId));if(v&&m&&m.shouldTrigger===!0&&v.type=="FORM"&&v.triggerType==="AUTOMATIC"&&!P.includes(v.slug)){setTimeout(()=>{b(m.flowId)},500);break}}},[o,t]),Io(()=>{x.length>0&&i()},[x]);function b(h){let m=a.find(v=>v.slug===h);m&&m.triggerType==="AUTOMATIC"&&!P.includes(m.slug)&&(f([...P,m.slug]),w([m]))}function y(){if(!r){let h=localStorage.getItem(oo);if(h){n(h);return}let m=localStorage.getItem(_i);if(m){n(m);return}d(!0);let v=At+ap();try{localStorage.setItem(_i,v)}catch(F){console.log("Failed to save guest user id locally: Local storage unavailable",F)}n(F=>F||v)}}Io(()=>{try{if(a){let h=[];a.forEach(m=>{if(m.data){let v=m.data.match(/"imageUri":"(.*?)"/g);v&&v.forEach(F=>{let T=F.replace('"imageUri":"',"").replace('"',"");if(h.includes(T))return;let O=new Image;O.src=T,h.push(T)})}})}}catch{}},[a]),Io(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(At))try{localStorage.setItem(oo,r)}catch(h){console.log("Failed to save user id locally: Local storage available",h)}r===null&&setTimeout(()=>{r===null&&y()},50)},[r,a,g]);function N(){return St.createElement(St.Fragment,null,S.map(h=>c(h.slug)!==Me?null:St.createElement("span",{key:h.slug},St.createElement(Ui,{flowId:h.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return St.createElement(St.Fragment,null,St.createElement(N,null))};import{ErrorBoundary as Lp}from"react-error-boundary";import ro from"core-js-pure/actual/structured-clone";function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function dt(...e){let t=e.shift(),o=e.length===1?e[0]:dt(...e);if(!fr(t)||!fr(o))throw new Error("deepmerge can only merge Objects");let i=ro(t);return Object.entries(o).forEach(([r,n])=>{fr(n)?i[r]!==void 0?Object.assign(i,{[r]:dt(i[r],ro(n))}):Object.assign(i,{[r]:ro(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...ro(n)]}):Object.assign(i,{[r]:ro(n)}):Object.assign(i,{[r]:n})}),i}var Hi={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function pp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Hi[o]){let r=Hi[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function dp(e){if(!e)return;let t=dt({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function Vi(e){let{theme:t,styleOverrides:o}=e,i=pp(t),r=dp(o);return{overrides:i,css:r}}import Fp from"styled-components";import{compose as kp,variant as Gi}from"styled-system";import ji from"react";import cp,{ThemeProvider as mp,useTheme as up}from"styled-components";import{border as fp,color as gp,compose as xp,get as hp,shadow as Cp,space as yp,system as Sp,typography as bp}from"styled-system";var wp={width:{property:"width",scale:"sizes",transform:(e,t)=>hp(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},Tp=cp("div")(({css:e})=>e,xp(fp,gp,Cp,yp,bp,Sp(wp))),io=({as:e,children:t,overrides:o,...i})=>{let r=up(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>ji.createElement(Tp,{as:e,...n,...i},t);if(o!==void 0){let p=dt(r,o);return ji.createElement(mp,{theme:p},s())}return s()};var no={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},Pp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Ki=Fp(io)(()=>({whiteSpace:"nowrap"}),kp(Gi({scale:"components.Button",variants:"components.Button"}),Gi({prop:"size",variants:Pp})));import vp from"styled-components";import{variant as Bp,system as Ep}from"styled-system";var Oo={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var qi=vp(io)(Bp({scale:"components.Text",variants:"components.Text"}),Ep({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Yi=4,Xi="px",Ap=20,Np=Object.fromEntries(Array.from(Array(Ap+1),(e,t)=>t===0?[.5,`${.5*Yi}${Xi}`]:[t,`${t*Yi}${Xi}`])),Dt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},gr={colors:{...Dt,neutral:{foreground:Dt.gray300},primary:{background:Dt.blue500,foreground:Dt.white,inverted:Dt.blue500},negative:{foreground:Dt.red500}},fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:Np,components:{Button:no,Text:Oo}};var Ji="https://api.frigade.com",K=Ip({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:Xe,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Ji,readonly:!1});function Dp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var $p=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var fe,J;let[n,s]=Oe(t||null),[p,c]=Oe(o||null),[a,g]=Oe([]),[d,x]=Oe([]),[S,w]=Oe([]),[P,f]=Oe({}),[A,b]=Oe({}),[y,N]=Oe([]),[h,m]=Oe({}),[v,F]=Oe(!1),[T,O]=Oe(!1),[E,$]=Oe(!X(e)),D=(W,H)=>{if(H==="_blank"){window.open(W,"_blank");return}setTimeout(()=>{window.location.href=W},50)},L={theme:{...Xe.theme,...((fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.theme)??{}},styleOverrides:{...Xe.styleOverrides,...((J=i==null?void 0:i.defaultAppearance)==null?void 0:J.styleOverrides)??{}}};function X(W){return!!(W&&W.length>10&&W.substring(0,10)==="api_public")}Lo(()=>{t&&s(t)},[t]),Lo(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(oo)&&window.localStorage.getItem(oo)!==n&&Dp()},[n]),Lo(()=>{o&&c(o)},[o]),Lo(()=>{if(X(e))$(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),$(!0);return}},[e,$]);let U={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:a,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:S,setFlowResponses:w,userProperties:P,setUserProperties:f,openFlowStates:A,setOpenFlowStates:b,completedFlowsToKeepOpenDuringSession:y,setCompletedFlowsToKeepOpenDuringSession:N,customVariables:h,setCustomVariables:m,isNewGuestUser:v,setIsNewGuestUser:F,hasActiveFullPageFlow:T,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:D,defaultAppearance:L,shouldGracefullyDegrade:E,setShouldGracefullyDegrade:$,apiUrl:i&&i.apiUrl?i.apiUrl:Ji,readonly:i&&i.readonly?i.readonly:!1};if(E)return bt.createElement(K.Provider,{value:U},r);let{overrides:ee}=Vi(L);return bt.createElement(Lp,{fallback:bt.createElement(bt.Fragment,null,r)},bt.createElement(K.Provider,{value:U},bt.createElement(Op,{theme:dt(L.theme,gr,ee??{},(i==null?void 0:i.theme)??{})},r,bt.createElement(Wi,null))))};import kd from"react";import de,{useEffect as Ps,useState as vs}from"react";import _e,{useState as ed}from"react";import Ft from"styled-components";import Mo from"react";import wt from"react";import Zi from"styled-components";var Qi=Zi.span`
646
+ font-weight: 600;
647
+ font-size: 14px;
648
+ font-style: normal;
649
+ line-height: 22px;
650
+ letter-spacing: 0.28px;
642
651
  color: #4d4d4d;
643
652
  display: inline-block;
644
653
  vertical-align: middle;
645
- margin-left: 12px;
654
+ margin-left: 32px;
646
655
  padding-right: 12px;
647
- `,Ap=Ji.div`
656
+ `,Mp=Zi.div`
648
657
  flex-direction: row;
649
658
  justify-content: space-between;
650
659
  display: flex;
651
660
  padding-top: 20px;
652
661
  padding-bottom: 20px;
662
+ padding-right: 40px;
653
663
  border-top: 1px solid ${e=>e.theme.colorBorder};
654
664
  width: 100%;
655
- `,Oo=({label:e,value:t,labelStyle:o={},labelPosition:r="right",style:i,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>bt.createElement(bt.Fragment,null,bt.createElement(Ap,{className:l("checklistStepsContainer",p),appearance:p,style:{...i}},r==="left"&&e&&bt.createElement(Xi,{className:l("checklistStepLabel",p),style:o},e),bt.createElement(Ye,{appearance:p,value:t,type:s,primaryColor:n}),r==="right"&&e&&bt.createElement(Xi,{className:l("checklistStepLabel",p),style:o},e)),bt.createElement(re,{appearance:p}));import no from"styled-components";var Qi=no.div`
665
+ `,Do=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>wt.createElement(wt.Fragment,null,wt.createElement(Mp,{className:l("checklistStepsContainer",p),appearance:p,style:{...r}},i==="left"&&e&&wt.createElement(Qi,{className:l("checklistStepLabel",p),style:o},e),wt.createElement(Je,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&wt.createElement(Qi,{className:l("checklistStepLabel",p),style:o},e)),wt.createElement(oe,{appearance:p}));import so from"styled-components";var Ri=so.div`
656
666
  font-weight: 700;
657
667
  font-size: 18px;
658
668
  line-height: 22px;
659
- `,Zi=no.p`
660
- font-weight: 700;
661
- font-size: 18px;
662
- line-height: 30px;
669
+ `,en=so.p`
670
+ font-weight: 600;
671
+ font-size: 16px;
672
+ line-height: 24px;
663
673
  margin: 20px 0px 0px 0px;
674
+ letter-spacing: 0.32px;
675
+ font-style: normal;
664
676
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
665
- `,Ri=no.p`
677
+ `,tn=so.p`
666
678
  font-weight: 400;
667
- font-size: 15px;
668
- line-height: 28px;
679
+ font-size: 14px;
680
+ font-style: normal;
681
+ line-height: 22px;
669
682
  max-width: 540px;
683
+ letter-spacing: 0.28px;
670
684
  margin: 8px 0px 0px 0px;
671
685
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
672
- `,Lo=no.div`
673
- width: 4px;
686
+ `,$o=so.div`
687
+ width: 6px;
674
688
  position: absolute;
675
689
  left: 0;
676
- top: 10%;
677
- height: 80%;
678
- border-top-right-radius: 8px;
679
- border-bottom-right-radius: 8px;
680
- `,en=no.div`
690
+ height: 100%;
691
+ border-top-right-radius: 4px;
692
+ border-bottom-right-radius: 4px;
693
+ `,on=so.div`
681
694
  flex-direction: row;
682
695
  justify-content: flex-start;
683
- `;var tn=({data:e,index:t,isSelected:o,primaryColor:r,style:i,onClick:n,appearance:s})=>{var p,c;return Do.createElement("div",{style:{position:"relative",paddingLeft:"20px"},onClick:()=>{n()}},o&&Do.createElement(Lo,{className:l("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??r}}),Do.createElement(en,{className:l("checklistStepItem",s),key:`hero-checklist-step-${t}`,role:"listitem"},Do.createElement(Oo,{value:e.complete,labelPosition:"left",label:e.stepName??e.title,style:i,primaryColor:((c=s==null?void 0:s.theme)==null?void 0:c.colorPrimary)??r,appearance:s})))};import wt from"react";import ur from"styled-components";import Je from"styled-components";var Ux=Je.div`
696
+ `;var rn=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,c;return Mo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{n()}},o&&Mo.createElement($o,{className:l("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),Mo.createElement(on,{className:l("checklistStepItem",s),key:`hero-checklist-step-${t}`,role:"listitem"},Mo.createElement(Do,{value:e.complete,labelPosition:"left",label:e.stepName??e.title,style:r,primaryColor:((c=s==null?void 0:s.theme)==null?void 0:c.colorPrimary)??i,appearance:s})))};import Tt from"react";import xr from"styled-components";import Ze from"styled-components";var qx=Ze.div`
684
697
  background: #ffffff;
685
698
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
686
699
  border-radius: 20px;
687
700
  width: 385px;
688
701
  padding: 24px 16px 16px 16px;
689
- `,_x=Je.div`
702
+ `,Yx=Ze.div`
690
703
  /* Border bottom only on collapsable */
691
- `,zx=Je.div`
704
+ `,Xx=Ze.div`
692
705
  display: flex;
693
706
  flex-direction: row;
694
707
  justify-content: space-between;
695
708
  align-content: flex-start;
696
- `,Wx=Je.h1`
709
+ `,Jx=Ze.h1`
697
710
  display: flex;
698
711
  margin: 0;
699
712
  font-size: 18px;
700
- `,Hx=Je.h2`
713
+ `,Qx=Ze.h2`
701
714
  font-size: 15px;
702
715
  color: #4d4d4d;
703
- `,Vx=Je.ul`
716
+ `,Zx=Ze.ul`
704
717
  list-style: none;
705
- `,jx=Je.li`
718
+ `,Rx=Ze.li`
706
719
  display: flex;
707
720
  justify-content: flex-start;
708
721
  flex-direction: row;
709
- `,on=Je.div`
722
+ `,nn=Ze.div`
710
723
  position: absolute;
711
724
  left: 0;
712
725
  top: 0;
@@ -714,7 +727,7 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
714
727
  width: ${e=>e.fgWidth};
715
728
  border-radius: 20px;
716
729
  background-color: ${e=>e.theme.colorPrimary};
717
- `,rn=Je.div`
730
+ `,sn=Ze.div`
718
731
  position: relative;
719
732
  left: 0;
720
733
  top: 0;
@@ -724,33 +737,33 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
724
737
  border-radius: 20px;
725
738
  background-color: ${e=>e.theme.colorPrimary};
726
739
  opacity: 0.12;
727
- `;var Ip=ur.div`
740
+ `;var Up=xr.div`
728
741
  display: flex;
729
742
  flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
730
743
  justify-content: flex-start;
731
744
  align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
732
745
  width: 100%;
733
746
 
734
- ${e=>Ke(e)}
735
- `,Np=ur.div`
747
+ ${e=>Ye(e)}
748
+ `,zp=xr.div`
736
749
  flex-grow: 1;
737
750
  position: relative;
738
751
  ${e=>e.textLocation=="top"?"width: 100%;":""}
739
- `,Op=ur.span`
752
+ `,_p=xr.span`
740
753
  font-weight: 600;
741
754
  font-size: 14px;
742
755
  line-height: 18px;
743
756
  padding-right: ${e=>e.padding};
744
757
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
745
758
  margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
746
- ${e=>Ke(e)}
747
- `;var Le=({count:e,total:t,display:o="count",textLocation:r="left",style:i={},textStyle:n={},appearance:s})=>{if(t===0)return wt.createElement(wt.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",a=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${a}%`:o==="percent"&&(d=`${a}% complete`),r==="top"&&(g="0px"),wt.createElement(Ip,{className:l("progressBarContainer",s),textLocation:r,styleOverrides:i},wt.createElement(Op,{className:l("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600},appearance:s,padding:g,textLocation:r},d),wt.createElement(Np,{textLocation:r,className:l("progressBar",s)},wt.createElement(on,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:c,appearance:s,className:l("progressBarFill",s)}),wt.createElement(rn,{className:l("progressBarBackground",s),barHeight:c,appearance:s})))};import so from"react";import Dp from"styled-components";import Mo from"react";import $o from"react";var Dt=({stepData:e,appearance:t})=>$o.createElement($o.Fragment,null,$o.createElement(Zi,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:me(e.title)}),$o.createElement(Ri,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:me(e.subtitle)}));import fr from"react";var $t=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},r=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return fr.createElement(Fo,{className:l("ctaContainer",t)},e.secondaryButtonTitle&&fr.createElement(oe,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:r,style:{width:"auto",marginRight:"12px"}}),fr.createElement(oe,{appearance:t,title:e.primaryButtonTitle,onClick:o}))};var Mt=({stepData:e,appearance:t})=>Mo.createElement(Mo.Fragment,null,Mo.createElement(Dt,{stepData:e,appearance:t}),Mo.createElement($t,{stepData:e,appearance:t}));import Lp from"react";function nn(e){return Lp.createElement(lt,{appearance:e.appearance,videoUri:e.videoUri})}var gr="default",$p=Dp.img`
759
+ ${e=>Ye(e)}
760
+ `;var Le=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Tt.createElement(Tt.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",a=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${a}%`:o==="percent"&&(d=`${a}% complete`),i==="top"&&(g="0px"),Tt.createElement(Up,{className:l("progressBarContainer",s),textLocation:i,styleOverrides:r},Tt.createElement(_p,{className:l("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600},appearance:s,padding:g,textLocation:i},d),Tt.createElement(zp,{textLocation:i,className:l("progressBar",s)},Tt.createElement(nn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:c,appearance:s,className:l("progressBarFill",s)}),Tt.createElement(sn,{className:l("progressBarBackground",s),barHeight:c,appearance:s})))};import lo from"react";import Hp from"styled-components";import zo from"react";import Uo from"react";var $t=({stepData:e,appearance:t})=>Uo.createElement(Uo.Fragment,null,Uo.createElement(en,{appearance:t,className:l("checklistStepTitle",t),dangerouslySetInnerHTML:me(e.title)}),Uo.createElement(tn,{appearance:t,className:l("checklistStepSubtitle",t),dangerouslySetInnerHTML:me(e.subtitle)}));import hr from"react";var Mt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return hr.createElement(Po,{className:l("ctaContainer",t)},e.secondaryButtonTitle&&hr.createElement(te,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}),hr.createElement(te,{appearance:t,title:e.primaryButtonTitle,onClick:o}))};var Ut=({stepData:e,appearance:t})=>zo.createElement(zo.Fragment,null,zo.createElement($t,{stepData:e,appearance:t}),zo.createElement(Mt,{stepData:e,appearance:t}));import Wp from"react";function ln(e){return Wp.createElement(at,{appearance:e.appearance,videoUri:e.videoUri})}var Cr="default",Vp=Hp.img`
748
761
  border-radius: 4px;
749
762
  max-height: 260px;
750
763
  min-height: 200px;
751
- `,sn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return so.createElement("div",null,o)}return so.createElement(Qi,{className:l("checklistStepContent",t)},e.imageUri?so.createElement($p,{className:l("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?so.createElement(nn,{videoUri:e.videoUri,appearance:t}):null,so.createElement(Mt,{stepData:e,appearance:t}))};import Ee,{useRef as Mp,useState as Up}from"react";import Ut from"styled-components";var ln=Ut.div`
764
+ `,an=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return lo.createElement("div",null,o)}return lo.createElement(Ri,{className:l("checklistStepContent",t)},e.imageUri?lo.createElement(Vp,{className:l("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?lo.createElement(ln,{videoUri:e.videoUri,appearance:t}):null,lo.createElement(Ut,{stepData:e,appearance:t}))};import Ee,{useRef as jp,useState as Gp}from"react";import zt from"styled-components";var pn=zt.div`
752
765
  display: block;
753
- `,_p=Ut.div`
766
+ `,Kp=zt.div`
754
767
  display: flex;
755
768
  flex-direction: row;
756
769
  flex-wrap: wrap;
@@ -760,20 +773,20 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
760
773
  align-content: center;
761
774
  margin-top: 24px;
762
775
  margin-bottom: 24px;
763
- `,zp=Ut.div`
776
+ `,qp=zt.div`
764
777
  display: flex;
765
778
  align-items: center;
766
779
  justify-content: flex-start;
767
780
  flex-direction: column;
768
781
  margin-right: 16px;
769
- `,Wp=Ut.video`
782
+ `,Yp=zt.video`
770
783
  width: 200px;
771
784
  height: 120px;
772
- `,Hp=Ut.div`
785
+ `,Xp=zt.div`
773
786
  font-size: 14px;
774
787
  line-height: 20px;
775
788
  text-align: center;
776
- `,Vp=Ut.div`
789
+ `,Jp=zt.div`
777
790
  position: absolute;
778
791
  width: 200px;
779
792
  height: 120px;
@@ -793,9 +806,9 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
793
806
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
794
807
  border-radius: 50%;
795
808
  }
796
- `,an="videoCarousel",pn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.videos))return Ee.createElement(ln,null,Ee.createElement(Mt,{stepData:e,appearance:t}));function o({video:n}){let s=Mp(),[p,c]=Up(!1);return Ee.createElement(zp,null,!p&&Ee.createElement(Vp,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ee.createElement(ko,null)),Ee.createElement(Wp,{controls:p,ref:s,play:p,src:n.uri}),Ee.createElement(Hp,null,n.title))}let r=e.props;return r.videos?Ee.createElement(ln,null,Ee.createElement(Dt,{stepData:e,appearance:t}),Ee.createElement(_p,null,r.videos.map((n,s)=>Ee.createElement("span",{key:`${n.uri}-${s}`},Ee.createElement(o,{video:n})))),Ee.createElement($t,{stepData:e,appearance:t})):null};import Qe from"react";import Uo from"styled-components";var dn=Uo.div`
809
+ `,dn="videoCarousel",cn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Ee.createElement(pn,null,Ee.createElement(Ut,{stepData:e,appearance:t}));function o({video:n}){let s=jp(),[p,c]=Gp(!1);return Ee.createElement(qp,null,!p&&Ee.createElement(Jp,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ee.createElement(vo,null)),Ee.createElement(Yp,{controls:p,ref:s,play:p,src:n.uri}),Ee.createElement(Xp,null,n.title))}let i=e.props;return i.videos?Ee.createElement(pn,null,Ee.createElement($t,{stepData:e,appearance:t}),Ee.createElement(Kp,null,i.videos.map((n,s)=>Ee.createElement("span",{key:`${n.uri}-${s}`},Ee.createElement(o,{video:n})))),Ee.createElement(Mt,{stepData:e,appearance:t})):null};import Re from"react";import _o from"styled-components";var mn=_o.div`
797
810
  display: block;
798
- `,jp=Uo.pre`
811
+ `,Qp=_o.pre`
799
812
  display: block;
800
813
  background-color: #2a2a2a;
801
814
  color: #f8f8f8;
@@ -811,27 +824,27 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
811
824
  white-space: -o-pre-wrap; /* Opera 7 */
812
825
  word-wrap: break-word; /* Internet Explorer 5.5+ */
813
826
  margin-bottom: 24px;
814
- `,Gp=Uo.div`
827
+ `,Zp=_o.div`
815
828
  font-size: 15px;
816
829
  line-height: 20px;
817
830
  margin-bottom: 12px;
818
831
  margin-top: 12px;
819
- `,Kp=Uo.div`
832
+ `,Rp=_o.div`
820
833
  margin-top: 24px;
821
- `,cn="codeSnippet",mn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.codeSnippets))return Qe.createElement(dn,null,Qe.createElement(Mt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?Qe.createElement(dn,null,Qe.createElement(Dt,{stepData:e,appearance:t}),Qe.createElement(Kp,null,o.codeSnippets.map((i,n)=>Qe.createElement("div",{key:n},i.title?Qe.createElement(Gp,null,i.title):null,i.code?Qe.createElement(jp,null,i.code):null))),Qe.createElement($t,{stepData:e,appearance:t})):null};var Yp=Tt.div`
834
+ `,un="codeSnippet",fn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return Re.createElement(mn,null,Re.createElement(Ut,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?Re.createElement(mn,null,Re.createElement($t,{stepData:e,appearance:t}),Re.createElement(Rp,null,o.codeSnippets.map((r,n)=>Re.createElement("div",{key:n},r.title?Re.createElement(Zp,null,r.title):null,r.code?Re.createElement(Qp,null,r.code):null))),Re.createElement(Mt,{stepData:e,appearance:t})):null};var td=Ft.div`
822
835
  display: flex;
823
836
  flex-direction: row;
824
837
  min-width: ${e=>e.type!="modal"?"600px":"100%"};
825
838
  background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
826
839
  border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
827
- `,Xp=Tt.h1`
840
+ `,od=Ft.h1`
828
841
  font-size: 18px;
829
842
  font-style: normal;
830
843
  font-weight: 700;
831
844
  line-height: 24px;
832
845
  letter-spacing: 0.36px;
833
846
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
834
- `,Jp=Tt.h2`
847
+ `,rd=Ft.h2`
835
848
  font-size: 14px;
836
849
  font-style: normal;
837
850
  font-weight: 400;
@@ -839,45 +852,43 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
839
852
  letter-spacing: 0.28px;
840
853
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
841
854
  margin: 10px 0px 0px 0px;
842
- `,un=Tt.div`
843
- padding-bottom: 16px;
844
- `,Qp=Tt.div`
855
+ `,gn=Ft.div``,id=Ft.div`
845
856
  list-style: none;
846
857
  padding: 0;
847
858
  margin: 0;
848
859
  cursor: pointer;
849
860
  width: 300px;
850
- `,Zp=Tt.div`
861
+ `,nd=Ft.div`
851
862
  width: 1px;
852
- margin: 40px;
863
+ margin-right: 40px;
853
864
  background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
854
- `,Rp=Tt.div`
865
+ `,sd=Ft.div`
855
866
  flex: 2;
856
- padding: 2rem;
857
- `,ed=({title:e,subtitle:t,steps:o=[],style:r={},selectedStep:i,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:a})=>{let{mergeAppearanceWithDefault:g}=R();c=g(c);let x={...{[gr]:sn,[an]:pn,[cn]:mn},...p},[y,w]=qp(0),P=i??y,f=n??w,E=o.filter(S=>S.complete===!0).length,b=()=>{var S;return!((S=o[P])!=null&&S.type)||!x[o[P].type]?x[gr]({stepData:o[P],appearance:c}):x[o[P].type]({stepData:o[P],appearance:c})};return _e.createElement(Yp,{type:a,style:r,className:s,appearance:c},_e.createElement(un,{style:{flex:1}},_e.createElement(un,{style:{padding:"30px 0px 30px 30px",borderBottom:"none"}},_e.createElement(Xp,{className:l("checklistTitle",c),appearance:c},e),_e.createElement(Jp,{className:l("checklistSubtitle",c),appearance:c},t),_e.createElement(Le,{total:o.length,count:E,style:{marginTop:"24px"},appearance:c})),_e.createElement(Qp,{className:l("checklistStepsContainer",c)},o.map((S,A)=>_e.createElement(tn,{data:S,index:A,key:A,listLength:o.length,isSelected:A===P,primaryColor:c.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{f(A)}})))),_e.createElement(Zp,{appearance:c,className:l("checklistDivider",c)}),_e.createElement(Rp,null,_e.createElement(b,null)))},xr=ed;import $,{useState as nd}from"react";import fn from"react";import td from"styled-components";var od=td.svg`
867
+ padding: 2rem 2rem 2rem 0rem;
868
+ `,ld=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:a})=>{let{mergeAppearanceWithDefault:g}=Z();c=g(c);let x={...{[Cr]:an,[dn]:cn,[un]:fn},...p},[S,w]=ed(0),P=r??S,f=n??w,A=o.filter(y=>y.complete===!0).length,b=()=>{var y;return!((y=o[P])!=null&&y.type)||!x[o[P].type]?x[Cr]({stepData:o[P],appearance:c}):x[o[P].type]({stepData:o[P],appearance:c})};return _e.createElement(td,{type:a,style:i,className:s,appearance:c},_e.createElement(gn,{style:{flex:1}},_e.createElement(gn,{style:{padding:"28px 0px 28px 28px",borderBottom:"none"}},_e.createElement(od,{className:l("checklistTitle",c),appearance:c},e),_e.createElement(rd,{className:l("checklistSubtitle",c),appearance:c},t),_e.createElement(Le,{total:o.length,count:A,style:{marginTop:"24px",paddingRight:"40px"},appearance:c})),_e.createElement(id,{className:l("checklistStepsContainer",c)},o.map((y,N)=>_e.createElement(rn,{data:y,index:N,key:N,listLength:o.length,isSelected:N===P,primaryColor:c.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{f(N)}})))),_e.createElement(nd,{appearance:c,className:l("checklistDivider",c)}),_e.createElement(sd,null,_e.createElement(b,null)))},yr=ld;import M,{useState as md}from"react";import xn from"react";import ad from"styled-components";var pd=ad.svg`
858
869
  transition: 'transform 0.35s ease-in-out';
859
- `,_t=({color:e="#323232",style:t,className:o})=>fn.createElement(od,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},fn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ue from"styled-components";var hr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},gn=ue.div`
870
+ `,_t=({color:e="#323232",style:t,className:o})=>xn.createElement(pd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:t,className:o},xn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ue 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"},hn=ue.div`
860
871
  max-height: 350px;
861
872
  padding-bottom: 40px;
862
- `,xn=ue.div`
873
+ `,Cn=ue.div`
863
874
  display: flex;
864
875
  flex-direction: column;
865
876
  margin-top: 20px;
866
- `,hn=ue.h1`
877
+ `,yn=ue.h1`
867
878
  font-style: normal;
868
879
  font-weight: 600;
869
880
  font-size: 30px;
870
881
  line-height: 36px;
871
882
  margin-bottom: 16px;
872
883
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
873
- `,Cn=ue.h2`
884
+ `,Sn=ue.h2`
874
885
  font-weight: 400;
875
886
  font-size: 16px;
876
887
  line-height: 20px;
877
888
  margin-bottom: 16px;
878
889
  padding-left: 1px;
879
890
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
880
- `,Sn=ue.div`
891
+ `,bn=ue.div`
881
892
  ${e=>k(e)} {
882
893
  border: 1px solid #fafafa;
883
894
  }
@@ -887,11 +898,11 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
887
898
  flex-direction: column;
888
899
  min-height: 240px;
889
900
  overflow: hidden;
890
- `,yn=ue.div`
901
+ `,wn=ue.div`
891
902
  display: flex;
892
903
  flex-direction: row;
893
904
  justify-content: space-between;
894
- `,bn=ue.p`
905
+ `,Tn=ue.p`
895
906
  ${e=>k(e)} {
896
907
  font-weight: 400;
897
908
  font-size: 10px;
@@ -900,12 +911,12 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
900
911
  color: #8c8c8c;
901
912
  margin: 20px;
902
913
  }
903
- `,wn=ue.div`
914
+ `,Fn=ue.div`
904
915
  display: flex;
905
916
  flex-direction: row;
906
- `,Tn=ue.div`
917
+ `,kn=ue.div`
907
918
  flex: 1;
908
- `,Fn=ue.div`
919
+ `,Pn=ue.div`
909
920
  ${e=>k(e)} {
910
921
  display: flex;
911
922
  justify-content: center;
@@ -915,7 +926,7 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
915
926
  padding-left: 8px;
916
927
  padding-right: 8px;
917
928
  }
918
- `,kn=ue.p`
929
+ `,vn=ue.p`
919
930
  ${e=>k(e)} {
920
931
  font-style: normal;
921
932
  font-weight: 600;
@@ -927,7 +938,7 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
927
938
  margin-top: 20px;
928
939
  margin-bottom: 16px;
929
940
  }
930
- `,Pn=ue.p`
941
+ `,Bn=ue.p`
931
942
  ${e=>k(e)} {
932
943
  font-weight: 400;
933
944
  font-size: 14px;
@@ -936,14 +947,14 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
936
947
  color: ${e=>e.appearance.theme.colorTextSecondary};
937
948
  margin-bottom: 8px;
938
949
  }
939
- `,vn=ue.div`
950
+ `,En=ue.div`
940
951
  ${e=>k(e)} {
941
952
  display: flex;
942
953
  flex-direction: row;
943
954
  justify-content: center;
944
955
  gap: 8px;
945
956
  }
946
- `,Bn=ue.div`
957
+ `,An=ue.div`
947
958
  ${e=>k(e)} {
948
959
  // Anything inside this block will be ignored if the user provides a custom class
949
960
  background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
@@ -963,7 +974,7 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
963
974
  justify-content: space-between;
964
975
  position: relative;
965
976
  cursor: pointer;
966
- `,En=ue.p`
977
+ `,Nn=ue.p`
967
978
  ${e=>k(e)} {
968
979
  // Anything inside this block will be ignored if the user provides a custom class
969
980
  color: ${e=>e.selected?"#434343":"#BFBFBF"};
@@ -972,12 +983,12 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
972
983
  font-size: 14px;
973
984
  line-height: 22px;
974
985
  margin: 0;
975
- `,An=ue.div`
986
+ `,In=ue.div`
976
987
  display: flex;
977
988
  flex-direction: row;
978
989
  justify-content: flex-end;
979
990
  align-content: center;
980
- `,In=ue.div`
991
+ `,On=ue.div`
981
992
  display: flex;
982
993
  flex: 1;
983
994
  flex-direction: row;
@@ -985,14 +996,14 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
985
996
  align-content: center;
986
997
  align-items: center;
987
998
  margin-right: 20px;
988
- `,Nn=ue.div`
999
+ `,Ln=ue.div`
989
1000
  display: block;
990
1001
  width: 100%;
991
- `;import rd from"styled-components";var On=rd.div`
1002
+ `;import dd from"styled-components";var Dn=dd.div`
992
1003
  flex-direction: column;
993
1004
  justify-content: center;
994
1005
  display: flex;
995
- `;import Re from"react";import Ze from"styled-components";var Ln=Ze.div`
1006
+ `;import tt from"react";import et from"styled-components";var $n=et.div`
996
1007
  border: 1px solid #fafafa;
997
1008
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
998
1009
  border-radius: 14px;
@@ -1000,13 +1011,13 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1000
1011
  display: flex;
1001
1012
  flex-direction: column;
1002
1013
  overflow: hidden;
1003
- `,Dn=Ze.div`
1014
+ `,Mn=et.div`
1004
1015
  display: flex;
1005
1016
  flex-wrap: wrap;
1006
1017
  justify-content: space-between;
1007
1018
  overflow: hidden;
1008
1019
  row-gap: 10px;
1009
- `,$n=Ze.div`
1020
+ `,Un=et.div`
1010
1021
  ${e=>k(e)} {
1011
1022
  color: #595959;
1012
1023
  }
@@ -1016,7 +1027,7 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1016
1027
  line-height: 12px;
1017
1028
  letter-spacing: 0.09em;
1018
1029
  margin-bottom: 12px;
1019
- `,Mn=Ze.div`
1030
+ `,zn=et.div`
1020
1031
  ${e=>k(e)} {
1021
1032
  // Anything inside this block will be ignored if the user provides a custom class
1022
1033
  background: #ffffff;
@@ -1029,7 +1040,7 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1029
1040
 
1030
1041
  max-width: 150px;
1031
1042
  min-width: 200px;
1032
- `,Un=Ze.div`
1043
+ `,_n=et.div`
1033
1044
  ${e=>k(e)} {
1034
1045
  background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
1035
1046
  }
@@ -1041,13 +1052,13 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1041
1052
  justify-content: center;
1042
1053
  align-content: center;
1043
1054
  align-items: center;
1044
- `,_n=Ze.div`
1055
+ `,Wn=et.div`
1045
1056
  font-weight: 600;
1046
1057
  font-size: 20px;
1047
1058
  line-height: 24px;
1048
1059
  width: 20px;
1049
1060
  height: 20px;
1050
- `,zn=Ze.div`
1061
+ `,Hn=et.div`
1051
1062
  ${e=>k(e)} {
1052
1063
  color: #434343;
1053
1064
  }
@@ -1056,20 +1067,20 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1056
1067
  line-height: 17px;
1057
1068
  margin-top: 12px;
1058
1069
  margin-bottom: 8px;
1059
- `,Wn=Ze.div`
1070
+ `,Vn=et.div`
1060
1071
  ${e=>k(e)} {
1061
1072
  color: #8c8c8c;
1062
1073
  }
1063
1074
  font-weight: 400;
1064
1075
  font-size: 12px;
1065
1076
  line-height: 14px;
1066
- `,Hn=Ze.a`
1077
+ `,jn=et.a`
1067
1078
  color: ${e=>e.color};
1068
1079
  font-size: 12px;
1069
1080
  line-height: 14px;
1070
1081
  font-weight: 400;
1071
1082
  cursor: pointer;
1072
- `;var id=({steps:e,style:t,title:o,primaryColor:r,appearance:i,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ae();return Re.createElement(Ln,{style:t,className:l("guideContainer",i)},Re.createElement($n,{className:l("guideTitle",i)},o),Re.createElement(Dn,{className:l("guideItemContainer",i)},e.map((p,c)=>Re.createElement(Mn,{key:`guide-${p.id??c}`,className:l("guideItem",i)},p.icon&&Re.createElement(Un,{className:l("guideIcon",i)},Re.createElement(_n,null,p.icon)),Re.createElement(zn,{className:l("guideItemTitle",i),dangerouslySetInnerHTML:me(p.title)}),Re.createElement(Wn,{className:l("guideItemSubtitle",i),dangerouslySetInnerHTML:me(p.subtitle)}),Re.createElement(Hn,{className:l("guideItemLink",i),color:r,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},lo=id;var sd=({steps:e,title:t,subtitle:o,stepsTitle:r,visible:i,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:a,guideData:g,guideTitle:d,onGuideButtonClick:x})=>{let y=({stepData:m,handleSecondaryCTAClick:B,handleCTAClick:F})=>m?$.createElement(Fn,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},$.createElement(kn,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:me(m.title)}),$.createElement(Pn,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:me(m.subtitle)}),$.createElement(vn,{className:l("checklistCTAContainer",a)},m.secondaryButtonTitle&&$.createElement(oe,{title:m.secondaryButtonTitle,onClick:B,appearance:a,secondary:!0}),$.createElement(oe,{title:m.primaryButtonTitle,onClick:F,appearance:a}))):$.createElement($.Fragment,null),P={...{default:m=>{var O;if((O=e[b])!=null&&O.StepContent){let I=e[b].StepContent;return $.createElement("div",null,I)}let B=e[b];return $.createElement(y,{stepData:m,handleCTAClick:()=>{B.handlePrimaryButtonClick&&B.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{B.handleSecondaryButtonClick&&B.handleSecondaryButtonClick()}})}},...c},[f,E]=nd(0),b=s??f,S=p??E,A=()=>{var m;return e?!((m=e[b])!=null&&m.type)||!P[e[b].type]?P.default(e[b]):P[e[b].type]({stepData:e[b],primaryColor:a.theme.colorPrimary}):$.createElement($.Fragment,null)},C=e.filter(m=>m.complete).length;return i?(a.theme.modalContainer||(a.theme.borderRadius&&(hr.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=hr),$.createElement(rt,{onClose:n,visible:i,appearance:a},$.createElement(Nn,null,$.createElement(xn,null,$.createElement(hn,{appearance:a,className:l("checklistTitle",a)},t),$.createElement(Cn,{appearance:a,className:l("checklistSubtitle",a)},o)),$.createElement(gn,null,e&&e.length>0&&$.createElement(Sn,{className:l("stepsContainer",a)},$.createElement(yn,null,$.createElement("div",{style:{flex:3}},$.createElement(bn,{className:l("stepsTitle",a)},r)),$.createElement(In,null,$.createElement(Le,{style:{width:"100%"},count:C,total:e.length,appearance:a}))),$.createElement(wn,null,$.createElement(Tn,{className:l("checklistStepListContainer",a),appearance:a},e.map((m,B)=>{let F=b===B;return $.createElement(Bn,{selected:F,className:l(`checklistStepListItem${F?"Selected":""}`,a),key:`checklist-guide-step-${m.id??B}`,disabled:m.blocked,onClick:()=>{m.blocked||S(B)},title:m.blocked?"Finish remaining steps to continue":void 0},F&&$.createElement(Lo,{className:l("checklistStepItemSelectedIndicator",a),layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),$.createElement(En,{selected:F,className:l(`checklistStepListStepName${F?"Selected":""}`,a)},m.stepName),$.createElement(An,null,$.createElement(Ye,{value:m.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:m.progress,appearance:a}),$.createElement(On,null,$.createElement(_t,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),$.createElement(A,null))),g&&g.length>0&&$.createElement(lo,{steps:g,title:d,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:m=>(x&&x(m),!0)}))))):$.createElement($.Fragment,null)},Cr=sd;import Fe,{useEffect as rs,useState as ld}from"react";import xe from"react";import et from"styled-components";var Vn=et.div`
1083
+ `;var cd=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ie();return tt.createElement($n,{style:t,className:l("guideContainer",r)},tt.createElement(Un,{className:l("guideTitle",r)},o),tt.createElement(Mn,{className:l("guideItemContainer",r)},e.map((p,c)=>tt.createElement(zn,{key:`guide-${p.id??c}`,className:l("guideItem",r)},p.icon&&tt.createElement(_n,{className:l("guideIcon",r)},tt.createElement(Wn,null,p.icon)),tt.createElement(Hn,{className:l("guideItemTitle",r),dangerouslySetInnerHTML:me(p.title)}),tt.createElement(Vn,{className:l("guideItemSubtitle",r),dangerouslySetInnerHTML:me(p.subtitle)}),tt.createElement(jn,{className:l("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},ao=cd;var ud=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:a,guideData:g,guideTitle:d,onGuideButtonClick:x})=>{let S=({stepData:m,handleSecondaryCTAClick:v,handleCTAClick:F})=>m?M.createElement(Pn,{className:l("checklistStepContainer",a),"data-testid":"checklistStepContainer"},M.createElement(vn,{appearance:a,className:l("checklistStepTitle",a),dangerouslySetInnerHTML:me(m.title)}),M.createElement(Bn,{appearance:a,className:l("checklistStepSubtitle",a),dangerouslySetInnerHTML:me(m.subtitle)}),M.createElement(En,{className:l("checklistCTAContainer",a)},m.secondaryButtonTitle&&M.createElement(te,{title:m.secondaryButtonTitle,onClick:v,appearance:a,secondary:!0}),M.createElement(te,{title:m.primaryButtonTitle,onClick:F,appearance:a}))):M.createElement(M.Fragment,null),P={...{default:m=>{var O;if((O=e[b])!=null&&O.StepContent){let E=e[b].StepContent;return M.createElement("div",null,E)}let v=e[b];return M.createElement(S,{stepData:m,handleCTAClick:()=>{v.handlePrimaryButtonClick&&v.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{v.handleSecondaryButtonClick&&v.handleSecondaryButtonClick()}})}},...c},[f,A]=md(0),b=s??f,y=p??A,N=()=>{var m;return e?!((m=e[b])!=null&&m.type)||!P[e[b].type]?P.default(e[b]):P[e[b].type]({stepData:e[b],primaryColor:a.theme.colorPrimary}):M.createElement(M.Fragment,null)},h=e.filter(m=>m.complete).length;return r?(a.theme.modalContainer||(a.theme.borderRadius&&(Sr.borderRadius=a.theme.borderRadius+"px"),a.theme.modalContainer=Sr),M.createElement(He,{onClose:n,visible:r,appearance:a},M.createElement(Ln,null,M.createElement(Cn,null,M.createElement(yn,{appearance:a,className:l("checklistTitle",a)},t),M.createElement(Sn,{appearance:a,className:l("checklistSubtitle",a)},o)),M.createElement(hn,null,e&&e.length>0&&M.createElement(bn,{className:l("stepsContainer",a)},M.createElement(wn,null,M.createElement("div",{style:{flex:3}},M.createElement(Tn,{className:l("stepsTitle",a)},i)),M.createElement(On,null,M.createElement(Le,{style:{width:"100%"},count:h,total:e.length,appearance:a}))),M.createElement(Fn,null,M.createElement(kn,{className:l("checklistStepListContainer",a),appearance:a},e.map((m,v)=>{let F=b===v;return M.createElement(An,{selected:F,className:l(`checklistStepListItem${F?"Selected":""}`,a),key:`checklist-guide-step-${m.id??v}`,disabled:m.blocked,onClick:()=>{m.blocked||y(v)},title:m.blocked?"Finish remaining steps to continue":void 0},F&&M.createElement($o,{className:l("checklistStepItemSelectedIndicator",a),layoutId:"checklist-step-selected",style:{backgroundColor:a.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),M.createElement(Nn,{selected:F,className:l(`checklistStepListStepName${F?"Selected":""}`,a)},m.stepName),M.createElement(In,null,M.createElement(Je,{value:m.complete,type:"round",primaryColor:a.theme.colorPrimary,progress:m.progress,appearance:a}),M.createElement(Dn,null,M.createElement(_t,{style:{marginLeft:"10px"},color:a.theme.colorBackgroundSecondary}))))})),M.createElement(N,null))),g&&g.length>0&&M.createElement(ao,{steps:g,title:d,primaryColor:a.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:a,onButtonClick:m=>(x&&x(m),!0)}))))):M.createElement(M.Fragment,null)},br=ud;import Pe,{useEffect as ns,useState as fd}from"react";import Ce from"react";import ot from"styled-components";var Gn=ot.div`
1073
1084
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1074
1085
  border: 1px solid;
1075
1086
  border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -1081,41 +1092,41 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1081
1092
  display: flex;
1082
1093
  flex-direction: column;
1083
1094
  transition: max-height 0.25s;
1084
- `,jn=et.div`
1095
+ `,Kn=ot.div`
1085
1096
  display: flex;
1086
1097
  margin-bottom: 20px;
1087
- `,Gn=et.img`
1098
+ `,qn=ot.img`
1088
1099
  border-radius: 4px;
1089
1100
  max-height: 260px;
1090
1101
  min-height: 200px;
1091
- `,Kn=et.div`
1102
+ `,Yn=ot.div`
1092
1103
  display: flex;
1093
1104
  flex-direction: row;
1094
1105
  justify-content: space-between;
1095
1106
  align-items: center;
1096
- `,qn=et.p`
1107
+ `,Xn=ot.p`
1097
1108
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1098
1109
  font-style: normal;
1099
1110
  font-weight: 500;
1100
1111
  font-size: 16px;
1101
1112
  line-height: 18px;
1102
1113
  margin-left: 8px;
1103
- `,Yn=et.div`
1114
+ `,Jn=ot.div`
1104
1115
  cursor: pointer;
1105
1116
  :hover {
1106
1117
  opacity: 0.8;
1107
1118
  }
1108
- `,MC=et.div``,Xn=et.p`
1119
+ `,KC=ot.div``,Qn=ot.p`
1109
1120
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1110
1121
  font-weight: 400;
1111
1122
  font-size: 14px;
1112
1123
  line-height: 22px;
1113
- `,Jn=et.div`
1124
+ `,Zn=ot.div`
1114
1125
  display: flex;
1115
1126
  flex-direction: row;
1116
1127
  justify-content: flex-start;
1117
1128
  align-items: center;
1118
- `;var Qn=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:r,onSecondaryButtonClick:i,appearance:n,customStepTypes:s})=>{var d,x;let p=t?{}:{transform:"rotate(90deg)"},c=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.2s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.15s ease-in"};function a(){return xe.createElement(xe.Fragment,null,e.imageUri||e.videoUri?xe.createElement(jn,{className:l("stepMediaContainer",n)},e.imageUri?xe.createElement(Gn,{className:l("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?xe.createElement(lt,{appearance:n,videoUri:e.videoUri}):null):null,xe.createElement(Xn,{className:l("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:me(e.subtitle)}),xe.createElement(Fo,{className:l("checklistCTAContainer",n)},e.secondaryButtonTitle?xe.createElement(oe,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>i(),appearance:n}):null,xe.createElement(oe,{title:e.primaryButtonTitle??"Continue",onClick:()=>r(),appearance:n})))}function g(){if(!s)return null;let y=s[e.type];return y?y(e,n):null}return xe.createElement(Vn,{"data-testid":`step-${e.id}`,className:l("checklistStepContainer",n),appearance:n},xe.createElement(Kn,{className:l("stepHeader",n)},xe.createElement(Jn,null,xe.createElement(Oo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(d=n==null?void 0:n.theme)==null?void 0:d.colorPrimary,appearance:n}),xe.createElement(qn,{appearance:n,className:l("stepTitle",n),dangerouslySetInnerHTML:me(e.title),onClick:()=>o()})),xe.createElement(Yn,{className:l("stepChevronContainer",n),onClick:()=>o()},xe.createElement(_t,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(x=n==null?void 0:n.theme)==null?void 0:x.colorTextSecondary}))),xe.createElement("div",{key:e.id,style:{...c}},g()??a()))};import zt from"styled-components";var JC=zt.div`
1129
+ `;var Rn=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n,customStepTypes:s})=>{var d,x;let p=t?{}:{transform:"rotate(90deg)"},c=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.2s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.15s ease-in"};function a(){return Ce.createElement(Ce.Fragment,null,e.imageUri||e.videoUri?Ce.createElement(Kn,{className:l("stepMediaContainer",n)},e.imageUri?Ce.createElement(qn,{className:l("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Ce.createElement(at,{appearance:n,videoUri:e.videoUri}):null):null,Ce.createElement(Qn,{className:l("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:me(e.subtitle)}),Ce.createElement(Po,{className:l("checklistCTAContainer",n)},e.secondaryButtonTitle?Ce.createElement(te,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,Ce.createElement(te,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:n})))}function g(){if(!s)return null;let S=s[e.type];return S?S(e,n):null}return Ce.createElement(Gn,{"data-testid":`step-${e.id}`,className:l("checklistStepContainer",n),appearance:n},Ce.createElement(Yn,{className:l("stepHeader",n)},Ce.createElement(Zn,null,Ce.createElement(Do,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(d=n==null?void 0:n.theme)==null?void 0:d.colorPrimary,appearance:n}),Ce.createElement(Xn,{appearance:n,className:l("stepTitle",n),dangerouslySetInnerHTML:me(e.title),onClick:()=>o()})),Ce.createElement(Jn,{className:l("stepChevronContainer",n),onClick:()=>o()},Ce.createElement(_t,{style:{...p,transition:"transform 0.1s ease-in-out"},color:(x=n==null?void 0:n.theme)==null?void 0:x.colorTextSecondary}))),Ce.createElement("div",{key:e.id,style:{...c}},g()??a()))};import Wt from"styled-components";var n0=Wt.div`
1119
1130
  background: #ffffff;
1120
1131
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
1121
1132
  border-radius: 6px;
@@ -1129,26 +1140,26 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1129
1140
 
1130
1141
  max-width: 800px;
1131
1142
  min-width: 350px;
1132
- `,Zn=zt.div`
1143
+ `,es=Wt.div`
1133
1144
  display: flex;
1134
1145
  flex-direction: column;
1135
- `,Rn=zt.h1`
1146
+ `,ts=Wt.h1`
1136
1147
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1137
1148
  font-style: normal;
1138
1149
  font-weight: 700;
1139
1150
  font-size: 20px;
1140
1151
  line-height: 24px;
1141
1152
  margin-bottom: 8px;
1142
- `,es=zt.h2`
1153
+ `,os=Wt.h2`
1143
1154
  color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
1144
1155
  font-weight: 400;
1145
1156
  font-size: 14px;
1146
1157
  line-height: 23px;
1147
1158
  margin: 2px 0 0 0;
1148
- `,ts=zt.div`
1159
+ `,rs=Wt.div`
1149
1160
  display: block;
1150
1161
  width: 100%;
1151
- `,os=zt.div`
1162
+ `,is=Wt.div`
1152
1163
  display: flex;
1153
1164
  width: 100%;
1154
1165
  flex-direction: column;
@@ -1156,23 +1167,23 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1156
1167
  padding: 24px;
1157
1168
  border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
1158
1169
  background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1159
- `;var ad=({title:e,subtitle:t,steps:o,onClose:r,visible:i,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:c,setSelectedStep:a,appearance:g,type:d,className:x,customStepTypes:y,style:w})=>{let P=o.filter(C=>C.complete).length,[f,E]=ld(Array(o.length).fill(!0));rs(()=>{let C=[...f];if(n){for(let m=0;m<o.length;m++)if(!o[m].complete){C[m]=!1;break}E(C)}},[]),rs(()=>{b(c)},[c]);let b=C=>{let m=[...f];if(s)for(let B=0;B<f.length;++B)B!==C&&(m[B]=!0);m[C]=!m[C],E(m)};if(!i&&d=="modal")return Fe.createElement(Fe.Fragment,null);let S=Fe.createElement(Fe.Fragment,null,Fe.createElement(Zn,null,Fe.createElement(Rn,{appearance:g,className:l("checklistTitle",g),dangerouslySetInnerHTML:me(e)}),Fe.createElement(es,{appearance:g,className:l("checklistSubtitle",g),dangerouslySetInnerHTML:me(t)})),Fe.createElement(Le,{display:"percent",count:P,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:g})),A=Fe.createElement(ts,{className:be(l("checklistContainer",g),x)},o.map((C,m)=>{let B=f[m];return Fe.createElement(Qn,{appearance:g,stepData:C,collapsed:B,key:`modal-checklist-${C.id??m}`,onClick:()=>{if(c===m){b(m);return}a(m)},onPrimaryButtonClick:()=>{C.handlePrimaryButtonClick&&C.handlePrimaryButtonClick(),p&&!C.completionCriteria&&m<f.length-1&&f[m+1]&&a(m+1)},onSecondaryButtonClick:()=>{C.handleSecondaryButtonClick&&C.handleSecondaryButtonClick()},customStepTypes:y})}));return d==="inline"?Fe.createElement(os,{appearance:g,className:be(l("checklistInlineContainer",g),x),style:w},S,A):Fe.createElement(Fe.Fragment,null,Fe.createElement(rt,{onClose:r,visible:i,appearance:g,style:{maxWidth:"600px"},headerContent:S},A))},Sr=ad;import se,{useEffect as yr,useRef as xd,useState as Ft}from"react";import{useEffect as pd,useState as dd}from"react";var is=()=>{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,r]=dd(t),i=null,n=()=>{i!==null?clearTimeout(i):s(),i=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([c,a])=>{if(!window)return[c,!1];let g=window.matchMedia(a);return g.addEventListener("change",n),[c,g.matches]}));r(p)};return pd(()=>{s()},[]),o};import Wt from"react";import pe,{css as ns,keyframes as ss}from"styled-components";var ls=ns`
1170
+ `;var gd=({title:e,subtitle:t,steps:o,onClose:i,visible:r,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:c,setSelectedStep:a,appearance:g,type:d,className:x,customStepTypes:S,style:w})=>{let P=o.filter(h=>h.complete).length,[f,A]=fd(Array(o.length).fill(!0));ns(()=>{let h=[...f];if(n){for(let m=0;m<o.length;m++)if(!o[m].complete){h[m]=!1;break}A(h)}},[]),ns(()=>{b(c)},[c]);let b=h=>{let m=[...f];if(s)for(let v=0;v<f.length;++v)v!==h&&(m[v]=!0);m[h]=!m[h],A(m)};if(!r&&d=="modal")return Pe.createElement(Pe.Fragment,null);let y=Pe.createElement(Pe.Fragment,null,Pe.createElement(es,null,Pe.createElement(ts,{appearance:g,className:l("checklistTitle",g),dangerouslySetInnerHTML:me(e)}),Pe.createElement(os,{appearance:g,className:l("checklistSubtitle",g),dangerouslySetInnerHTML:me(t)})),Pe.createElement(Le,{display:"percent",count:P,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:g})),N=Pe.createElement(rs,{className:xe(l("checklistContainer",g),x)},o.map((h,m)=>{let v=f[m];return Pe.createElement(Rn,{appearance:g,stepData:h,collapsed:v,key:`modal-checklist-${h.id??m}`,onClick:()=>{if(c===m){b(m);return}a(m)},onPrimaryButtonClick:()=>{h.handlePrimaryButtonClick&&h.handlePrimaryButtonClick(),p&&!h.completionCriteria&&m<f.length-1&&f[m+1]&&a(m+1)},onSecondaryButtonClick:()=>{h.handleSecondaryButtonClick&&h.handleSecondaryButtonClick()},customStepTypes:S})}));return d==="inline"?Pe.createElement(is,{appearance:g,className:xe(l("checklistInlineContainer",g),x),style:w},y,N):Pe.createElement(Pe.Fragment,null,Pe.createElement(He,{onClose:i,visible:r,appearance:g,style:{maxWidth:"600px"},headerContent:y},N))},wr=gd;import le,{useEffect as Tr,useRef as Td,useState as kt}from"react";import{useEffect as xd,useState as hd}from"react";var ss=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=hd(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([c,a])=>{if(!window)return[c,!1];let g=window.matchMedia(a);return g.addEventListener("change",n),[c,g.matches]}));i(p)};return xd(()=>{s()},[]),o};import Ht from"react";import pe,{css as ls,keyframes as as}from"styled-components";var ps=ls`
1160
1171
  border: 1px solid ${({theme:e})=>e.colorBorder};
1161
- `,cd=ns`
1172
+ `,Cd=ls`
1162
1173
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
1163
- `,md=ss`
1174
+ `,yd=as`
1164
1175
  from {
1165
1176
  opacity: 0;
1166
1177
  } to {
1167
1178
  opacity: 1;
1168
1179
  }
1169
- `,ud=ss`
1180
+ `,Sd=as`
1170
1181
  from {
1171
1182
  opacity: 1;
1172
1183
  } to {
1173
1184
  opacity: 0;
1174
1185
  }
1175
- `,as=pe.div`
1186
+ `,ds=pe.div`
1176
1187
  margin: 0 -20px;
1177
1188
  overflow-x: auto;
1178
1189
  padding-left: 20px;
@@ -1189,14 +1200,14 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1189
1200
  ::-webkit-scrollbar {
1190
1201
  display: none;
1191
1202
  }
1192
- `,ps=pe.div`
1203
+ `,cs=pe.div`
1193
1204
  display: flex;
1194
1205
  flex-flow: row nowrap;
1195
1206
  gap: 0 16px;
1196
1207
  scroll-snap-align: center;
1197
1208
  scroll-snap-stop: always;
1198
- `,ds=pe.div`
1199
- animation: ${e=>e.reversed?ud:md} 0.25s ease-out;
1209
+ `,ms=pe.div`
1210
+ animation: ${e=>e.reversed?Sd:yd} 0.25s ease-out;
1200
1211
  background: linear-gradient(
1201
1212
  to right,
1202
1213
  ${({theme:e})=>e.colorBackground}00,
@@ -1205,8 +1216,8 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1205
1216
  position: absolute;
1206
1217
  width: 64px;
1207
1218
  z-index: 10;
1208
- `,cs=pe.button`
1209
- ${ls}
1219
+ `,us=pe.button`
1220
+ ${ps}
1210
1221
  box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
1211
1222
  align-items: center;
1212
1223
  border-radius: 50%;
@@ -1217,11 +1228,11 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1217
1228
  justify-content: center;
1218
1229
  position: absolute;
1219
1230
  width: 48px;
1220
- `,ms=pe.div`
1231
+ `,fs=pe.div`
1221
1232
  border-radius: ${({theme:e})=>e.borderRadius}px;
1222
1233
  padding: 20px;
1223
- `,us=pe(ms)`
1224
- ${ls}
1234
+ `,gs=pe(fs)`
1235
+ ${ps}
1225
1236
  background: ${({theme:e})=>e.colorBackground};
1226
1237
  position: relative;
1227
1238
 
@@ -1233,86 +1244,86 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1233
1244
  ${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
1234
1245
  ${e=>e.blocked?"cursor: default":"cursor: pointer"}
1235
1246
  }
1236
- `,fs=pe.img`
1247
+ `,xs=pe.img`
1237
1248
  border-radius: 50%;
1238
1249
  height: 40px;
1239
1250
  margin-bottom: 12px;
1240
1251
  width: 40px;
1241
- `,gs=pe(ms)`
1252
+ `,hs=pe(fs)`
1242
1253
  ${e=>k(e)} {
1243
- ${cd}
1254
+ ${Cd}
1244
1255
 
1245
1256
  background: ${({theme:e})=>e.colorBackground};
1246
1257
  }
1247
- `,u0=pe.div`
1258
+ `,w0=pe.div`
1248
1259
  color: ${({theme:e})=>e.colorPrimary};
1249
1260
  display: flex;
1250
1261
  flex-flow: row nowrap;
1251
1262
  align-items: center;
1252
- `,f0=pe.div`
1263
+ `,T0=pe.div`
1253
1264
  white-space: nowrap;
1254
- `,xs=pe.div`
1265
+ `,Cs=pe.div`
1255
1266
  background: #d8fed8;
1256
1267
  border-radius: 6px;
1257
1268
  float: right;
1258
1269
  margin-bottom: 12px;
1259
1270
  padding: 4px 10px;
1260
- `,fd=pe.p`
1271
+ `,bd=pe.p`
1261
1272
  font-weight: bold;
1262
1273
  font-size: 18px;
1263
1274
  line-height: 22px;
1264
1275
  letter-spacing: calc(18px * -0.01);
1265
1276
  margin: 0;
1266
- `,hs=pe(fd)`
1277
+ `,ys=pe(bd)`
1267
1278
  margin-bottom: 4px;
1268
- `,Cs=pe.div`
1279
+ `,Ss=pe.div`
1269
1280
  display: flex;
1270
1281
  flex-flow: row nowrap;
1271
1282
  align-items: center;
1272
1283
  min-width: 50%;
1273
- `,gd=pe.p`
1284
+ `,wd=pe.p`
1274
1285
  font-weight: bold;
1275
1286
  font-size: 16px;
1276
1287
  line-height: 20px;
1277
1288
  letter-spacing: calc(16px * -0.01);
1278
1289
  margin: 0;
1279
- `,Ss=pe(gd)`
1290
+ `,bs=pe(wd)`
1280
1291
  margin-bottom: 4px;
1281
1292
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1282
1293
  `}
1283
- `,dt=pe.p`
1294
+ `,ct=pe.p`
1284
1295
  color: ${({theme:e})=>e.colorText};
1285
1296
  font-weight: normal;
1286
1297
  font-size: 14px;
1287
1298
  line-height: 22px;
1288
1299
  margin: 0;
1289
- `,ys=pe.p`
1300
+ `,ws=pe.p`
1290
1301
  color: ${({theme:e})=>e.colorText};
1291
1302
  font-weight: 600;
1292
1303
  font-size: 12px;
1293
1304
  line-height: 16px;
1294
1305
  margin: 0;
1295
- `;dt.Loud=pe(dt)`
1306
+ `;ct.Loud=pe(ct)`
1296
1307
  font-weight: 600;
1297
- `;dt.Quiet=pe(dt)`
1308
+ `;ct.Quiet=pe(ct)`
1298
1309
  color: ${({theme:e})=>e.colorTextSecondary};
1299
1310
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1300
1311
  `}
1301
- `;var bs=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:r}=R(),{primaryCTAClickSideEffects:i}=ae();o=r(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:c=!1,blocked:a=!1}=e,g=e.primaryButtonTitle||e.secondaryButtonTitle,d=()=>{i(e)};return Wt.createElement(us,{className:l("carouselCard",o),onClick:a?null:d,style:t,blocked:a,complete:c},n&&Wt.createElement(fs,{className:l("carouselCardImage",o),src:n,alt:p,style:{opacity:c||a?.4:1}}),c&&Wt.createElement(xs,{className:l("carouselCompletedPill",o)},Wt.createElement(ys,{style:{color:"#108E0B"}},"Complete")),p&&Wt.createElement(Ss,{blocked:a,complete:c,className:l("carouselCardTitle",o)},p),s&&Wt.createElement(dt.Quiet,{blocked:a,complete:c,className:l("carouselCardSubtitle",o)},s))};var hd=()=>se.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},se.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),se.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),se.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),ws=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[r,i]=Ft(!1),[n,s]=Ft(!1);yr(()=>{t===!0&&r===!1?i(!0):t===!1&&r===!0&&s(!0)},[t]);let p=()=>{i(!1),s(!1)},c=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return r?se.createElement(ds,{style:c,reversed:n,onAnimationEnd:n?p:null},se.createElement(cs,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},se.createElement(hd,null))):null},Ts=({flowId:e,appearance:t,customVariables:o,className:r})=>{let i=xd(null),[n,s]=Ft(!1),[p,c]=Ft(!1),[a,g]=Ft(null),[d,x]=Ft([]),[y,w]=Ft(0),{isSmall:P}=is(),f=P?1:3,{getFlowMetadata:E,getFlowSteps:b,getNumberOfStepsCompleted:S,updateCustomVariables:A,isLoading:C}=Z();yr(()=>{A(o)},[o,C]),yr(()=>{if(C)return;let I=E(e),M=S(e),D=b(e);g(I),I.data!==null&&(x(D.sort((L,ee)=>Number(L.complete)-Number(ee.complete))),c(D.length>f),w(M))},[C]);let m=[];for(let I=0;I<d.length;I+=f)m.push(d.slice(I,I+f));let B=I=>{let M=I.target,D=M.scrollWidth-M.clientWidth,L=Math.ceil(M.scrollLeft);L>0&&n===!1&&s(!0),L===0&&n===!0&&s(!1),L<D&&p===!1&&c(!0),L===D&&p===!0&&c(!1)},F=(I=!0)=>{let M=I?1:-1;i.current!==null&&i.current.scrollBy({left:i.current.clientWidth*M,behavior:"smooth"})},T=null,O=I=>{T!==null?clearTimeout(T):B(I),T=setTimeout(()=>{B(I)},16)};return C?null:se.createElement(gs,{className:be(l("carouselContainer",t),r)},se.createElement("div",{style:{display:"flex",justifyContent:P?"center":"space-between",marginBottom:20,flexWrap:P?"wrap":"nowrap",gap:P?16:20}},se.createElement("div",null,se.createElement(hs,{className:l("carouselTitle",t)},a==null?void 0:a.title),se.createElement(dt.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),se.createElement(Cs,{className:l("progressWrapper",t)},se.createElement(Le,{count:y,total:d.length,appearance:t}))),se.createElement("div",{style:{position:"relative"}},se.createElement(ws,{show:n,onClick:()=>F(!1)}),se.createElement(ws,{side:"right",show:p,onClick:F}),se.createElement(as,{ref:i,onScroll:O},m.map((I,M)=>se.createElement(ps,{key:M,style:{flex:`0 0 calc(100% - ${d.length>f?36:0}px)`}},I.map((D,L)=>se.createElement(bs,{key:L,stepData:D,style:{flex:d.length>f?`0 1 calc(100% / ${f} - 16px * 2 / ${f})`:1},appearance:t})))))),se.createElement(re,{appearance:t}))};var br=({flowId:e,title:t,subtitle:o,style:r,initialSelectedStep:i,className:n,type:s="inline",onDismiss:p,visible:c,customVariables:a,onStepCompletion:g,onButtonClick:d,appearance:x,hideOnFlowCompletion:y,setVisible:w,customStepTypes:P,checklistStyle:f="default",autoExpandFirstIncompleteStep:E,autoExpandNextStep:b,...S})=>{let{getFlow:A,getFlowSteps:C,markStepCompleted:m,getStepStatus:B,getNumberOfStepsCompleted:F,isLoading:T,targetingLogicShouldHideFlow:O,updateCustomVariables:I,getFlowMetadata:M,isStepBlocked:D,getFlowStatus:L,hasActiveFullPageFlow:ee,setHasActiveFullPageFlow:U}=Z(),{primaryCTAClickSideEffects:J,secondaryCTAClickSideEffects:fe}=ae(),{getOpenFlowState:q,setOpenFlowState:W}=Pe(),[H,he]=ks(i||0),[Ie,ye]=ks(!1),ce=c===void 0?q(e):c,Y=s==="modal",{mergeAppearanceWithDefault:ge}=R();if(x=ge(x),Fs(()=>{I(a)},[a,T]),Fs(()=>{c!==void 0&&(Y&&c===!0?U(!0):Y&&c===!1&&U(!1))},[c,w,ee]),T)return null;let te=A(e);if(!te||O(te))return null;let N=C(e);if(!N||y===!0&&L(e)===Q)return null;let V=M(e);if(V!=null&&V.title&&(t=V.title),V!=null&&V.subtitle&&(o=V.subtitle),!Ie&&i===void 0&&F(e)>0){let u=N.findIndex(h=>h.complete===!1);he(u>-1?u:N.length-1),ye(!0)}function j(){if(H+1>=N.length){Y&&W(e,!1);return}D(e,N[H+1].id)||he(H+1)}function ie(u,h,v){let z=H+1<N.length?N[H+1]:null;d&&d(u,H,h,z)===!0&&Y&&De(),g&&g(u,v,z),!g&&!d&&(u.primaryButtonUri||u.secondaryButtonUri)&&Y&&De()}function ne(){return N.map((u,h)=>({...u,handleSecondaryButtonClick:()=>{j(),fe(u),u.skippable===!0&&m(e,u.id,{skipped:!0}),ie(u,"secondary",h)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(m(e,u.id),j()),ie(u,"primary",h),J(u),B(e,u.id)===Me&&j()}}))}function le(){return de.createElement(re,{appearance:x})}let Ge={steps:ne(),title:t,subtitle:o,primaryColor:x.theme.colorPrimary,appearance:x,customStepTypes:P,type:s,className:n,autoExpandFirstIncompleteStep:E,autoExpandNextStep:b};function De(){W(e,!1),p&&p(),w&&w(!1)}function G(){return de.createElement(de.Fragment,null,de.createElement(le,null),de.createElement(Ts,{flowId:e,appearance:x,customVariables:a,className:n}))}function ke(){return de.createElement(de.Fragment,null,de.createElement(le,null),de.createElement(Sr,{visible:ce,onClose:()=>{De()},selectedStep:H,setSelectedStep:he,autoExpandNextStep:!0,appearance:x,...Ge}))}function jt(){let u=S.guideFlowId,h;return u&&A(u)&&(h=C(u)),de.createElement(de.Fragment,null,de.createElement(le,null),de.createElement(Cr,{visible:ce,stepsTitle:V.stepsTitle?V.stepsTitle:"Your quick start guide",onClose:()=>{De()},selectedStep:H,setSelectedStep:he,guideData:h,guideTitle:S.guideTitle??"Guide",appearance:x,title:t,subtitle:o,onGuideButtonClick:v=>{ie(v,"link",0)},customStepTypes:P,...Ge}))}function mo(){let u=de.createElement(xr,{flowId:e,style:r,selectedStep:H,setSelectedStep:he,appearance:x,type:s,...Ge});return Y?de.createElement(rt,{onClose:()=>{De()},visible:ce,appearance:x,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},de.createElement(le,null),u):de.createElement(de.Fragment,null,de.createElement(le,null),u)}switch(f){case"condensed":return ke();case"with-guide":return jt();case"default":return mo();case"carousel":return G();default:return mo()}};var Sd=e=>Cd.createElement(br,{type:"inline",...e});import mt,{useEffect as yd}from"react";import Ve from"react";import _o from"styled-components";var Ps=_o.div`
1312
+ `;var Ts=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=Z(),{primaryCTAClickSideEffects:r}=ie();o=i(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:c=!1,blocked:a=!1}=e,g=e.primaryButtonTitle||e.secondaryButtonTitle,d=()=>{r(e)};return Ht.createElement(gs,{className:l("carouselCard",o),onClick:a?null:d,style:t,blocked:a,complete:c},n&&Ht.createElement(xs,{className:l("carouselCardImage",o),src:n,alt:p,style:{opacity:c||a?.4:1}}),c&&Ht.createElement(Cs,{className:l("carouselCompletedPill",o)},Ht.createElement(ws,{style:{color:"#108E0B"}},"Complete")),p&&Ht.createElement(bs,{blocked:a,complete:c,className:l("carouselCardTitle",o)},p),s&&Ht.createElement(ct.Quiet,{blocked:a,complete:c,className:l("carouselCardSubtitle",o)},s))};var Fd=()=>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"})),Fs=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=kt(!1),[n,s]=kt(!1);Tr(()=>{t===!0&&i===!1?r(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},c=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?le.createElement(ms,{style:c,reversed:n,onAnimationEnd:n?p:null},le.createElement(us,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},le.createElement(Fd,null))):null},ks=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=Td(null),[n,s]=kt(!1),[p,c]=kt(!1),[a,g]=kt(null),[d,x]=kt([]),[S,w]=kt(0),{isSmall:P}=ss(),f=P?1:3,{getFlowMetadata:A,getFlowSteps:b,getNumberOfStepsCompleted:y,updateCustomVariables:N,isLoading:h}=Y();Tr(()=>{N(o)},[o,h]),Tr(()=>{if(h)return;let E=A(e),$=y(e),D=b(e);g(E),E.data!==null&&(x(D.sort((L,X)=>Number(L.complete)-Number(X.complete))),c(D.length>f),w($))},[h]);let m=[];for(let E=0;E<d.length;E+=f)m.push(d.slice(E,E+f));let v=E=>{let $=E.target,D=$.scrollWidth-$.clientWidth,L=Math.ceil($.scrollLeft);L>0&&n===!1&&s(!0),L===0&&n===!0&&s(!1),L<D&&p===!1&&c(!0),L===D&&p===!0&&c(!1)},F=(E=!0)=>{let $=E?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*$,behavior:"smooth"})},T=null,O=E=>{T!==null?clearTimeout(T):v(E),T=setTimeout(()=>{v(E)},16)};return h?null:le.createElement(hs,{className:xe(l("carouselContainer",t),i)},le.createElement("div",{style:{display:"flex",justifyContent:P?"center":"space-between",marginBottom:20,flexWrap:P?"wrap":"nowrap",gap:P?16:20}},le.createElement("div",null,le.createElement(ys,{className:l("carouselTitle",t)},a==null?void 0:a.title),le.createElement(ct.Quiet,{className:l("carouselSubtitle",t)},a==null?void 0:a.subtitle)),le.createElement(Ss,{className:l("progressWrapper",t)},le.createElement(Le,{count:S,total:d.length,appearance:t}))),le.createElement("div",{style:{position:"relative"}},le.createElement(Fs,{show:n,onClick:()=>F(!1)}),le.createElement(Fs,{side:"right",show:p,onClick:F}),le.createElement(ds,{ref:r,onScroll:O},m.map((E,$)=>le.createElement(cs,{key:$,style:{flex:`0 0 calc(100% - ${d.length>f?36:0}px)`}},E.map((D,L)=>le.createElement(Ts,{key:L,stepData:D,style:{flex:d.length>f?`0 1 calc(100% / ${f} - 16px * 2 / ${f})`:1},appearance:t})))))),le.createElement(oe,{appearance:t}))};var Fr=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:c,customVariables:a,onStepCompletion:g,onButtonClick:d,appearance:x,hideOnFlowCompletion:S,setVisible:w,customStepTypes:P,checklistStyle:f="default",autoExpandFirstIncompleteStep:A,autoExpandNextStep:b,...y})=>{let{getFlow:N,getFlowSteps:h,markStepCompleted:m,getStepStatus:v,getNumberOfStepsCompleted:F,isLoading:T,targetingLogicShouldHideFlow:O,updateCustomVariables:E,getFlowMetadata:$,isStepBlocked:D,getFlowStatus:L,hasActiveFullPageFlow:X,setHasActiveFullPageFlow:U}=Y(),{primaryCTAClickSideEffects:ee,secondaryCTAClickSideEffects:fe}=ie(),{getOpenFlowState:J,setOpenFlowState:W}=Te(),[H,ye]=vs(r||0),[Ne,we]=vs(!1),ce=c===void 0?J(e):c,Q=s==="modal",{mergeAppearanceWithDefault:ge}=Z();if(x=ge(x),Ps(()=>{E(a)},[a,T]),Ps(()=>{c!==void 0&&(Q&&c===!0?U(!0):Q&&c===!1&&U(!1))},[c,w,X]),T)return null;let re=N(e);if(!re||O(re))return null;let I=h(e);if(!I||S===!0&&L(e)===q)return null;let V=$(e);if(V!=null&&V.title&&(t=V.title),V!=null&&V.subtitle&&(o=V.subtitle),!Ne&&r===void 0&&F(e)>0){let u=I.findIndex(C=>C.complete===!1);ye(u>-1?u:I.length-1),we(!0)}function j(){if(H+1>=I.length){Q&&W(e,!1);return}D(e,I[H+1].id)||ye(H+1)}function ne(u,C,B){let _=H+1<I.length?I[H+1]:null;d&&d(u,H,C,_)===!0&&Q&&$e(),g&&g(u,B,_),!g&&!d&&(u.primaryButtonUri||u.secondaryButtonUri)&&Q&&$e()}function se(){return I.map((u,C)=>({...u,handleSecondaryButtonClick:()=>{j(),fe(u),u.skippable===!0&&m(e,u.id,{skipped:!0}),ne(u,"secondary",C)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(m(e,u.id),j()),ne(u,"primary",C),ee(u),v(e,u.id)===Ue&&j()}}))}function ae(){return de.createElement(oe,{appearance:x})}let qe={steps:se(),title:t,subtitle:o,primaryColor:x.theme.colorPrimary,appearance:x,customStepTypes:P,type:s,className:n,autoExpandFirstIncompleteStep:A,autoExpandNextStep:b};function $e(){W(e,!1),p&&p(),w&&w(!1)}function G(){return de.createElement(de.Fragment,null,de.createElement(ae,null),de.createElement(ks,{flowId:e,appearance:x,customVariables:a,className:n}))}function ve(){return de.createElement(de.Fragment,null,de.createElement(ae,null),de.createElement(wr,{visible:ce,onClose:()=>{$e()},selectedStep:H,setSelectedStep:ye,autoExpandNextStep:!0,appearance:x,...qe}))}function Gt(){let u=y.guideFlowId,C;return u&&N(u)&&(C=h(u)),de.createElement(de.Fragment,null,de.createElement(ae,null),de.createElement(br,{visible:ce,stepsTitle:V.stepsTitle?V.stepsTitle:"Your quick start guide",onClose:()=>{$e()},selectedStep:H,setSelectedStep:ye,guideData:C,guideTitle:y.guideTitle??"Guide",appearance:x,title:t,subtitle:o,onGuideButtonClick:B=>{ne(B,"link",0)},customStepTypes:P,...qe}))}function uo(){let u=de.createElement(yr,{flowId:e,style:i,selectedStep:H,setSelectedStep:ye,appearance:x,type:s,...qe});return Q?de.createElement(He,{onClose:()=>{$e()},visible:ce,appearance:x,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},de.createElement(ae,null),u):de.createElement(de.Fragment,null,de.createElement(ae,null),u)}switch(f){case"condensed":return ve();case"with-guide":return Gt();case"default":return uo();case"carousel":return G();default:return uo()}};var Pd=e=>kd.createElement(Fr,{type:"inline",...e});import ut,{useEffect as vd}from"react";import Ge from"react";import Wo from"styled-components";var Bs=Wo.div`
1302
1313
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1303
1314
  border-radius: 8px;
1304
1315
  padding: 6px 10px 6px 10px;
1305
1316
  min-width: 160px;
1306
1317
  cursor: pointer;
1307
1318
  background-color: ${e=>e.appearance.theme.colorBackground}};
1308
- `,vs=_o.div`
1319
+ `,Es=Wo.div`
1309
1320
  display: flex;
1310
1321
  flex-direction: row;
1311
1322
  justify-content: space-between;
1312
1323
  align-items: center;
1313
1324
  margin-bottom: 2px;
1314
1325
  flex-grow: 2;
1315
- `,Bs=_o.div`
1326
+ `,As=Wo.div`
1316
1327
  text-overflow: ellipsis;
1317
1328
  font-weight: 600;
1318
1329
  font-size: 12px;
@@ -1320,13 +1331,13 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1320
1331
  margin-right: ${e=>e.type==="condensed"?"8px":"0"};
1321
1332
  text-align: ${e=>e.type==="condensed"?"left":"right"};
1322
1333
  color: ${e=>e.appearance.theme.colorPrimary};
1323
- `,Es=_o.div`
1334
+ `,Ns=Wo.div`
1324
1335
  width: 20px;
1325
1336
  margin-right: 8px;
1326
1337
  display: flex;
1327
1338
  height: 100%;
1328
1339
  align-items: center;
1329
- `;var As=({title:e,count:t,total:o,onClick:r,style:i={},className:n,appearance:s,type:p="default"})=>Ve.createElement(Ve.Fragment,null,Ve.createElement(re,{appearance:s}),Ve.createElement(Ps,{onClick:()=>r!==void 0&&r(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...i},className:be(n??"",l("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Ve.createElement(Es,{className:l("progressRingContainer",s)},Ve.createElement(It,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Ve.createElement(vs,{type:p,className:l("badgeTitleContainer",s)},Ve.createElement(Bs,{type:p,appearance:s,className:l("badgeTitle",s)},e),r!==void 0&&Ve.createElement(_t,{className:l("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Ve.createElement(Le,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import ct from"react";import ao from"styled-components";var Is=ao.div`
1340
+ `;var Is=({title:e,count:t,total:o,onClick:i,style:r={},className:n,appearance:s,type:p="default"})=>Ge.createElement(Ge.Fragment,null,Ge.createElement(oe,{appearance:s}),Ge.createElement(Bs,{onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:xe(n??"",l("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Ge.createElement(Ns,{className:l("progressRingContainer",s)},Ge.createElement(It,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Ge.createElement(Es,{type:p,className:l("badgeTitleContainer",s)},Ge.createElement(As,{type:p,appearance:s,className:l("badgeTitle",s)},e),i!==void 0&&Ge.createElement(_t,{className:l("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Ge.createElement(Le,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import mt from"react";import po from"styled-components";var Os=po.div`
1330
1341
  display: flex;
1331
1342
  flex-direction: row;
1332
1343
  width: 100%;
@@ -1337,25 +1348,25 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1337
1348
  border-width: 1px;
1338
1349
  border-color: ${e=>e.appearance.theme.colorPrimary};
1339
1350
  border-radius: 12px;
1340
- `,Ns=ao.div`
1351
+ `,Ls=po.div`
1341
1352
  ${e=>k(e)} {
1342
1353
  display: flex;
1343
1354
  justify-content: center;
1344
1355
  align-items: center;
1345
1356
  margin-right: 16px;
1346
1357
  }
1347
- `,Os=ao.div`
1358
+ `,Ds=po.div`
1348
1359
  display: flex;
1349
1360
  flex-direction: column;
1350
1361
  flex: 1;
1351
1362
  margin-top: 0;
1352
- `,Ls=ao.div`
1363
+ `,$s=po.div`
1353
1364
  display: flex;
1354
1365
  flex-direction: column;
1355
1366
  justify-content: center;
1356
1367
  margin-left: 16px;
1357
1368
  min-width: 200px;
1358
- `,cS=ao.div`
1369
+ `,Sy=po.div`
1359
1370
  display: flex;
1360
1371
  justify-content: center;
1361
1372
  align-items: flex-end;
@@ -1364,7 +1375,7 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1364
1375
  :hover {
1365
1376
  opacity: 0.8;
1366
1377
  }
1367
- `;var Ds=({title:e,subtitle:t,icon:o,appearance:r,count:i,total:n,className:s,style:p})=>ct.createElement(ct.Fragment,null,ct.createElement(Is,{appearance:r,className:be(l("fullWidthProgressBadgeContainer",r),s??""),style:p},o&&ct.createElement(Ns,{className:l("fullWidthProgressBadgeIcon",r)},o),ct.createElement(Os,null,ct.createElement(we,{size:"small",appearance:r,title:e,subtitle:t})),ct.createElement(Ls,{className:l("fullWidthProgressBadgeProgressContainer",r)},ct.createElement(Le,{count:i,total:n,display:"percent",textLocation:"top"}))));var bd=({flowId:e,title:t,subtitle:o,icon:r,style:i,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:c,appearance:a,type:g="default"})=>{let{getFlow:d,getFlowSteps:x,getFlowStatus:y,getNumberOfStepsCompleted:w,isLoading:P,targetingLogicShouldHideFlow:f,updateCustomVariables:E}=Z(),{mergeAppearanceWithDefault:b}=R();a=b(a);let{setOpenFlowState:S,getOpenFlowState:A}=Pe();if(yd(()=>{E(p)},[p,P]),P)return null;let C=d(e);if(!C||f(C)||c===!0&&y(e)===Q)return null;let m=x(e),B=w(e);return g==="full-width"?mt.createElement(mt.Fragment,null,mt.createElement(re,{appearance:a}),mt.createElement(Ds,{title:t,subtitle:o,count:B,total:m.length,style:i,className:s,appearance:a,icon:r,onClick:()=>{}})):mt.createElement(mt.Fragment,null,mt.createElement(re,{appearance:a}),mt.createElement(As,{count:B,total:m.length,title:t,style:i,onClick:()=>{S(e,!0),n&&n()},type:g,className:s,appearance:a}))};import wd from"react";var Td=({flowId:e,style:t,appearance:o,...r})=>{let{getFlow:i,targetingLogicShouldHideFlow:n,getFlowSteps:s}=Z(),{mergeAppearanceWithDefault:p}=R();o=p(o);let c=i(e);if(!c||n(c))return null;let a=s(e);return wd.createElement(lo,{steps:a,style:t,appearance:o,...r})};import ut,{useContext as Ld,useEffect as Dd}from"react";import _,{useEffect as zo,useLayoutEffect as Ms,useRef as vd,useState as po}from"react";import co from"styled-components";import{useCallback as Fd,useEffect as kd,useState as Pd}from"react";var wr=(e,t,o,r={x:20,y:20},i)=>{let n=i=="fixed"?0:window.scrollY,s=i=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+r.x+s,y:e.top-r.y+n}:t==="right"?{x:e.left+e.width+r.x+s,y:e.top-r.y+n}:{x:0,y:0}};function $s(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[r,i]=Pd(o),n=Fd(()=>{e&&i(e.getBoundingClientRect())},[e]);return kd(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),r}var Us=300,_s=100,Bd=500,Ht=12,Ed=co.div`
1378
+ `;var Ms=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>mt.createElement(mt.Fragment,null,mt.createElement(Os,{appearance:i,className:xe(l("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&mt.createElement(Ls,{className:l("fullWidthProgressBadgeIcon",i)},o),mt.createElement(Ds,null,mt.createElement(he,{size:"small",appearance:i,title:e,subtitle:t})),mt.createElement($s,{className:l("fullWidthProgressBadgeProgressContainer",i)},mt.createElement(Le,{count:r,total:n,display:"percent",textLocation:"top"}))));var Bd=({flowId:e,title:t,subtitle:o,icon:i,style:r,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:c,appearance:a,type:g="default"})=>{let{getFlow:d,getFlowSteps:x,getFlowStatus:S,getNumberOfStepsCompleted:w,isLoading:P,targetingLogicShouldHideFlow:f,updateCustomVariables:A}=Y(),{mergeAppearanceWithDefault:b}=Z();a=b(a);let{setOpenFlowState:y,getOpenFlowState:N}=Te();if(vd(()=>{A(p)},[p,P]),P)return null;let h=d(e);if(!h||f(h)||c===!0&&S(e)===q)return null;let m=x(e),v=w(e);return g==="full-width"?ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:a}),ut.createElement(Ms,{title:t,subtitle:o,count:v,total:m.length,style:r,className:s,appearance:a,icon:i,onClick:()=>{}})):ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:a}),ut.createElement(Is,{count:v,total:m.length,title:t,style:r,onClick:()=>{y(e,!0),n&&n()},type:g,className:s,appearance:a}))};import Ed from"react";var Ad=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:r,targetingLogicShouldHideFlow:n,getFlowSteps:s}=Y(),{mergeAppearanceWithDefault:p}=Z();o=p(o);let c=r(e);if(!c||n(c))return null;let a=s(e);return Ed.createElement(ao,{steps:a,style:t,appearance:o,...i})};import ft,{useContext as Wd,useEffect as Hd}from"react";import z,{useEffect as Ho,useLayoutEffect as zs,useRef as Ld,useState as co}from"react";import mo from"styled-components";import{useCallback as Nd,useEffect as Id,useState as Od}from"react";var kr=(e,t,o,i={x:20,y:20},r)=>{let n=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+n}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+n}:{x:0,y:0}};function Us(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,r]=Od(o),n=Nd(()=>{e&&r(e.getBoundingClientRect())},[e]);return Id(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),i}var _s=300,Ws=100,Dd=500,Vt=12,$d=mo.div`
1368
1379
  width: 100%;
1369
1380
  height: 100%;
1370
1381
  border-radius: 9999px;
@@ -1387,25 +1398,25 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1387
1398
  opacity: 0;
1388
1399
  }
1389
1400
  }
1390
- `,Ad=co.div`
1391
- width: ${Ht}px;
1392
- height: ${Ht}px;
1401
+ `,Md=mo.div`
1402
+ width: ${Vt}px;
1403
+ height: ${Vt}px;
1393
1404
  border-radius: 100px;
1394
1405
  background-color: ${e=>e.primaryColor};
1395
1406
  z-index: 20;
1396
1407
  opacity: 1;
1397
- `,Id=co.div`
1408
+ `,Ud=mo.div`
1398
1409
  pointer-events: all;
1399
- `,zs=co.div`
1410
+ `,Hs=mo.div`
1400
1411
  display: flex;
1401
1412
  align-content: center;
1402
1413
  justify-content: center;
1403
1414
  align-items: center;
1404
1415
  z-index: ${e=>e.zIndex?e.zIndex:90};
1405
- `,Nd=co(zs)`
1406
- width: ${Ht+12}px;
1407
- height: ${Ht+12}px;
1408
- `,Od=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:r="auto",showHighlight:i=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:c={},selectedStep:a=0,customStepTypes:g,appearance:d,dismissible:x=!1,showHighlightOnly:y,showStepCount:w=!0,completedStepsCount:P=0,showFrigadeBranding:f=!1,cssPosition:E="absolute"})=>{var ne,le,Ge,De;let[b,S]=po(),[A,C]=po(new Date),m=vd(null),[B,F]=po(document.querySelector(e[a].selector)),T=$s(B,A),[O,I]=po(),[M,D]=po(!y),L=(le=(ne=e[a])==null?void 0:ne.props)!=null&&le.position?e[a].props.position:E,ee=((De=(Ge=e[a])==null?void 0:Ge.props)==null?void 0:De.zIndex)??90,U=(b==null?void 0:b.width)??Us,J=(b==null?void 0:b.height)??_s,fe=window.location.pathname.split("/").pop();Ms(()=>{m.current&&S({width:m.current.clientWidth,height:m.current.clientHeight})},[a,A,L]),zo(()=>{y||D(!0)},[a]);let q=()=>{let G=document.querySelector(e[a].selector);if(!G){I(void 0),F(null);return}O&&O===JSON.stringify(G==null?void 0:G.getBoundingClientRect())||(F(G),C(new Date),G&&I(JSON.stringify(G.getBoundingClientRect())))};if(zo(()=>{let G=new MutationObserver(q);return G.observe(document.body,{subtree:!0,childList:!0}),()=>G.disconnect()},[q]),zo(()=>{let G=new MutationObserver(q);return G.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>G.disconnect()},[q]),zo(()=>{let G=setInterval(()=>{q()},10);return()=>clearInterval(G)},[q]),Ms(()=>{setTimeout(()=>{q()},Bd),q()},[a,fe]),B===null||!p||T.height===0&&T.width===0&&L!=="fixed"&&E!=="static")return null;let W=r==="auto"?"right":r,H=wr(T,W,U,s,L),he=T.right+U>(window.innerWidth||document.documentElement.clientWidth),Ie=T.bottom+_s>(window.innerHeight||document.documentElement.clientHeight);he&&r==="auto"&&(H=wr(T,"left",U,s,L),W="left");let ye=()=>{let G=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),D(!1),setTimeout(()=>{q()},30)),P===e.length-1)return o()},ke=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),y&&!e[a].secondaryButtonUri&&D(!1))};return _.createElement(_.Fragment,null,w&&e.length>1&&_.createElement(Vr,null,_.createElement(Gr,{className:l("tooltipStepCounter",d)},a+1," of ",e.length)),_.createElement(jr,{showStepCount:w,className:l("tooltipCTAContainer",d)},e[a].secondaryButtonTitle&&_.createElement(oe,{title:e[a].secondaryButtonTitle,appearance:d,onClick:ke,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&_.createElement(oe,{title:e[a].primaryButtonTitle,appearance:d,onClick:G,withMargin:!1,size:"small"})))},ce=()=>_.createElement(_.Fragment,null,x&&_.createElement(_r,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:l("tooltipClose",d)},_.createElement(Be,null)),e[a].imageUri&&_.createElement(zr,{dismissible:x,appearance:d,src:e[a].imageUri,className:l("tooltipImageContainer",d)}),e[a].videoUri&&!e[a].imageUri&&_.createElement(Wr,{dismissible:x,appearance:d,className:l("tooltipVideoContainer",d)},_.createElement(lt,{appearance:d,videoUri:e[a].videoUri})),_.createElement(we,{appearance:d,title:e[a].title,subtitle:e[a].subtitle,size:"small"}),_.createElement(Hr,{className:l("tooltipFooter",d)},_.createElement(ye,null))),ge={...{default:G=>{var ke;if((ke=e[a])!=null&&ke.StepContent){let jt=e[a].StepContent;return _.createElement("div",null,jt)}return _.createElement(ce,null)}},...g},te=()=>{var G;return e?!((G=e[a])!=null&&G.type)||!ge[e[a].type]?ge.default(e[a]):ge[e[a].type]({stepData:e[a],primaryColor:n}):_.createElement(_.Fragment,null)};if(y&&e[a].complete===!0)return null;let N={top:(H==null?void 0:H.y)-Ht,left:(W=="left"?T.x+s.x:(H==null?void 0:H.x)-Ht)??0,cursor:y?"pointer":"default",position:L},V=()=>{let ke=N.left+(W=="left"?-U:24);return Math.min(Math.max(ke,20),window.innerWidth-U-20)},j=()=>{if(L==="fixed")return N.top;let G=N.top+J,ke=20;return G>window.innerHeight-ke?N.top+-J:N.top},ie=()=>{y&&(C(new Date),D(!M))};return _.createElement(Id,null,_.createElement(Nd,{style:N,zIndex:ee,className:l("tourHighlightContainer",d)},i&&e[a].showHighlight!==!1&&E!=="static"&&_.createElement(_.Fragment,null,_.createElement(Ad,{style:{position:L},onClick:ie,primaryColor:d.theme.colorPrimary,className:l("tourHighlightInnerCircle",d)}),_.createElement(Ed,{style:{position:"absolute"},onClick:ie,primaryColor:d.theme.colorPrimary,className:l("tourHighlightOuterCircle",d)}))),_.createElement(zs,{style:{...N,left:V(),top:j()},zIndex:ee+1,className:l("tooltipContainerWrapper",d)},M&&_.createElement(_.Fragment,null,_.createElement(go,{ref:m,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:E!=="static"?12:0,...c},appearance:d,className:l("tooltipContainer",d),maxWidth:Us,zIndex:ee+10},_.createElement(te,null)),f&&_.createElement(qr,{className:l("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:ee+10},_.createElement(xo,{appearance:d})))))},Wo=Od;import{Portal as $d}from"react-portal";var Md=({flowId:e,customVariables:t,appearance:o,onStepCompletion:r,onButtonClick:i,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:c="auto",showHighlightOnly:a=!1,dismissBehavior:g="complete-flow",onComplete:d,skipIfNotFound:x=!1,cssPosition:y="absolute",...w})=>{let{getFlow:P,getFlowSteps:f,isLoading:E,targetingLogicShouldHideFlow:b,markStepCompleted:S,markStepStarted:A,markFlowCompleted:C,updateCustomVariables:m,getCurrentStepIndex:B,getStepStatus:F,isStepBlocked:T,getFlowStatus:O,getNumberOfStepsCompleted:I}=Z(),{isLoadingUserFlowStateData:M}=ve(),{primaryCTAClickSideEffects:D,secondaryCTAClickSideEffects:L}=ae(),{hasOpenModals:ee}=Pe(),U=B(e),{openFlowStates:J}=Ld(K),{mergeAppearanceWithDefault:fe}=R();if(o=fe(o),Dd(()=>{m(t)},[t,E]),M)return null;let q=P(e);if(!q||b(q)||O(e)==Q||ee())return null;let W=f(e);if(Object.keys(J).length>0){let N=Object.keys(J).find(V=>J[V]===!0);if(N!==void 0&&N!==e)return ut.createElement(ut.Fragment,null)}async function H(N){if(await S(e,N.id),W.map(V=>F(e,V.id)).every(V=>V===Me)){await C(e);return}if(!a&&U+1<W.length){if(T(e,W[U+1].id))return;await A(e,W[U+1].id)}}function he(N,V,j){let ie=U+1<W.length?W[U+1]:null;i&&i(N,U,V,ie),r&&r(N,j,ie)}function Ie(){return W.map(N=>({...N,handleSecondaryButtonClick:async()=>{L(N),N.skippable===!0&&await S(e,N.id,{skipped:!0}),he(N,"secondary",U)},handlePrimaryButtonClick:async()=>{(!N.completionCriteria&&(N.autoMarkCompleted||N.autoMarkCompleted===void 0)||N.completionCriteria&&N.autoMarkCompleted===!0)&&await H(N),he(N,"primary",U),D(N)}}))}async function ye(N){s&&s(),g==="complete-flow"?await C(e):await S(e,N.id)}function ce(){d&&d()}let Y=!document.querySelector(W[U].selector);function ge(){let N=W.findIndex(V=>!!document.querySelector(V.selector));return W.map((V,j)=>Y&&!n&&j!==N&&x?null:ut.createElement(Wo,{key:V.id,appearance:o,steps:Ie(),selectedStep:j,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>ye(V),tooltipPosition:c,showHighlightOnly:a,completedStepsCount:I(e),onComplete:ce,cssPosition:y,...w}))}function te(){return ut.createElement(ut.Fragment,null,ut.createElement(re,{appearance:o}),n||Y&&x?ge():ut.createElement(Wo,{appearance:o,steps:Ie(),selectedStep:U,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>ye(W[U]),tooltipPosition:c,completedStepsCount:I(e),showHighlightOnly:a,onComplete:ce,cssPosition:y,...w}))}return y==="static"?te():ut.createElement($d,null,te())};import Ae,{useEffect as Ud,useRef as _d,useState as zd}from"react";import{Portal as Wd}from"react-portal";import kt from"styled-components";var Ws=kt.button`
1416
+ `,zd=mo(Hs)`
1417
+ width: ${Vt+12}px;
1418
+ height: ${Vt+12}px;
1419
+ `,_d=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:r=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:c={},selectedStep:a=0,customStepTypes:g,appearance:d,dismissible:x=!1,showHighlightOnly:S,showStepCount:w=!0,completedStepsCount:P=0,showFrigadeBranding:f=!1,cssPosition:A="absolute"})=>{var se,ae,qe,$e;let[b,y]=co(),[N,h]=co(new Date),m=Ld(null),[v,F]=co(document.querySelector(e[a].selector)),T=Us(v,N),[O,E]=co(),[$,D]=co(!S),L=(ae=(se=e[a])==null?void 0:se.props)!=null&&ae.position?e[a].props.position:A,X=(($e=(qe=e[a])==null?void 0:qe.props)==null?void 0:$e.zIndex)??90,U=(b==null?void 0:b.width)??_s,ee=(b==null?void 0:b.height)??Ws,fe=window.location.pathname.split("/").pop();zs(()=>{m.current&&y({width:m.current.clientWidth,height:m.current.clientHeight})},[a,N,L]),Ho(()=>{S||D(!0)},[a]);let J=()=>{let G=document.querySelector(e[a].selector);if(!G){E(void 0),F(null);return}O&&O===JSON.stringify(G==null?void 0:G.getBoundingClientRect())||(F(G),h(new Date),G&&E(JSON.stringify(G.getBoundingClientRect())))};if(Ho(()=>{let G=new MutationObserver(J);return G.observe(document.body,{subtree:!0,childList:!0}),()=>G.disconnect()},[J]),Ho(()=>{let G=new MutationObserver(J);return G.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>G.disconnect()},[J]),Ho(()=>{let G=setInterval(()=>{J()},10);return()=>clearInterval(G)},[J]),zs(()=>{setTimeout(()=>{J()},Dd),J()},[a,fe]),v===null||!p||T.height===0&&T.width===0&&L!=="fixed"&&A!=="static")return null;let W=i==="auto"?"right":i,H=kr(T,W,U,s,L),ye=T.right+U>(window.innerWidth||document.documentElement.clientWidth),Ne=T.bottom+Ws>(window.innerHeight||document.documentElement.clientHeight);ye&&i==="auto"&&(H=kr(T,"left",U,s,L),W="left");let we=()=>{let G=()=>{if(e[a].handlePrimaryButtonClick&&(e[a].handlePrimaryButtonClick(),D(!1),setTimeout(()=>{J()},30)),P===e.length-1)return o()},ve=()=>{e[a].handleSecondaryButtonClick&&(e[a].handleSecondaryButtonClick(),S&&!e[a].secondaryButtonUri&&D(!1))};return z.createElement(z.Fragment,null,w&&e.length>1&&z.createElement(Kr,null,z.createElement(Yr,{className:l("tooltipStepCounter",d)},a+1," of ",e.length)),z.createElement(qr,{showStepCount:w,className:l("tooltipCTAContainer",d)},e[a].secondaryButtonTitle&&z.createElement(te,{title:e[a].secondaryButtonTitle,appearance:d,onClick:ve,size:"small",withMargin:!1,secondary:!0}),e[a].primaryButtonTitle&&z.createElement(te,{title:e[a].primaryButtonTitle,appearance:d,onClick:G,withMargin:!1,size:"small"})))},ce=()=>z.createElement(z.Fragment,null,x&&z.createElement(Hr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:l("tooltipClose",d)},z.createElement(Fe,null)),e[a].imageUri&&z.createElement(Vr,{dismissible:x,appearance:d,src:e[a].imageUri,className:l("tooltipImageContainer",d)}),e[a].videoUri&&!e[a].imageUri&&z.createElement(jr,{dismissible:x,appearance:d,className:l("tooltipVideoContainer",d)},z.createElement(at,{appearance:d,videoUri:e[a].videoUri})),z.createElement(he,{appearance:d,title:e[a].title,subtitle:e[a].subtitle,size:"small"}),z.createElement(Gr,{className:l("tooltipFooter",d)},z.createElement(we,null))),ge={...{default:G=>{var ve;if((ve=e[a])!=null&&ve.StepContent){let Gt=e[a].StepContent;return z.createElement("div",null,Gt)}return z.createElement(ce,null)}},...g},re=()=>{var G;return e?!((G=e[a])!=null&&G.type)||!ge[e[a].type]?ge.default(e[a]):ge[e[a].type]({stepData:e[a],primaryColor:n}):z.createElement(z.Fragment,null)};if(S&&e[a].complete===!0)return null;let I={top:(H==null?void 0:H.y)-Vt,left:(W=="left"?T.x+s.x:(H==null?void 0:H.x)-Vt)??0,cursor:S?"pointer":"default",position:L},V=()=>{let ve=I.left+(W=="left"?-U:24);return Math.min(Math.max(ve,20),window.innerWidth-U-20)},j=()=>{if(L==="fixed")return I.top;let G=I.top+ee,ve=20;return G>window.innerHeight-ve?I.top+-ee:I.top},ne=()=>{S&&(h(new Date),D(!$))};return z.createElement(Ud,null,z.createElement(zd,{style:I,zIndex:X,className:l("tourHighlightContainer",d)},r&&e[a].showHighlight!==!1&&A!=="static"&&z.createElement(z.Fragment,null,z.createElement(Md,{style:{position:L},onClick:ne,primaryColor:d.theme.colorPrimary,className:l("tourHighlightInnerCircle",d)}),z.createElement($d,{style:{position:"absolute"},onClick:ne,primaryColor:d.theme.colorPrimary,className:l("tourHighlightOuterCircle",d)}))),z.createElement(Hs,{style:{...I,left:V(),top:j()},zIndex:X+1,className:l("tooltipContainerWrapper",d)},$&&z.createElement(z.Fragment,null,z.createElement(xo,{ref:m,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:A!=="static"?12:0,...c},appearance:d,className:l("tooltipContainer",d),maxWidth:_s,zIndex:X+10},z.createElement(re,null)),f&&z.createElement(Jr,{className:l("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:X+10},z.createElement(ho,{appearance:d})))))},Vo=_d;import{Portal as Vd}from"react-portal";var jd=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:c="auto",showHighlightOnly:a=!1,dismissBehavior:g="complete-flow",onComplete:d,skipIfNotFound:x=!1,cssPosition:S="absolute",...w})=>{let{getFlow:P,getFlowSteps:f,isLoading:A,targetingLogicShouldHideFlow:b,markStepCompleted:y,markStepStarted:N,markFlowCompleted:h,updateCustomVariables:m,getCurrentStepIndex:v,getStepStatus:F,isStepBlocked:T,getFlowStatus:O,getNumberOfStepsCompleted:E}=Y(),{isLoadingUserFlowStateData:$}=Be(),{primaryCTAClickSideEffects:D,secondaryCTAClickSideEffects:L}=ie(),{hasOpenModals:X}=Te(),U=v(e),{openFlowStates:ee}=Wd(K),{mergeAppearanceWithDefault:fe}=Z();if(o=fe(o),Hd(()=>{m(t)},[t,A]),$)return null;let J=P(e);if(!J||b(J)||O(e)==q||X())return null;let W=f(e);if(Object.keys(ee).length>0){let I=Object.keys(ee).find(V=>ee[V]===!0);if(I!==void 0&&I!==e)return ft.createElement(ft.Fragment,null)}async function H(I){if(await y(e,I.id),W.map(V=>F(e,V.id)).every(V=>V===Ue)){await h(e);return}if(!a&&U+1<W.length){if(T(e,W[U+1].id))return;await N(e,W[U+1].id)}}function ye(I,V,j){let ne=U+1<W.length?W[U+1]:null;r&&r(I,U,V,ne),i&&i(I,j,ne)}function Ne(){return W.map(I=>({...I,handleSecondaryButtonClick:async()=>{L(I),I.skippable===!0&&await y(e,I.id,{skipped:!0}),ye(I,"secondary",U)},handlePrimaryButtonClick:async()=>{(!I.completionCriteria&&(I.autoMarkCompleted||I.autoMarkCompleted===void 0)||I.completionCriteria&&I.autoMarkCompleted===!0)&&await H(I),ye(I,"primary",U),D(I)}}))}async function we(I){s&&s(),g==="complete-flow"?await h(e):await y(e,I.id)}function ce(){d&&d()}let Q=!document.querySelector(W[U].selector);function ge(){let I=W.findIndex(V=>!!document.querySelector(V.selector));return W.map((V,j)=>Q&&!n&&j!==I&&x?null:ft.createElement(Vo,{key:V.id,appearance:o,steps:Ne(),selectedStep:j,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>we(V),tooltipPosition:c,showHighlightOnly:a,completedStepsCount:E(e),onComplete:ce,cssPosition:S,...w}))}function re(){return ft.createElement(ft.Fragment,null,ft.createElement(oe,{appearance:o}),n||Q&&x?ge():ft.createElement(Vo,{appearance:o,steps:Ne(),selectedStep:U,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>we(W[U]),tooltipPosition:c,completedStepsCount:E(e),showHighlightOnly:a,onComplete:ce,cssPosition:S,...w}))}return S==="static"?re():ft.createElement(Vd,null,re())};import Ae,{useEffect as Gd,useRef as Kd,useState as qd}from"react";import{Portal as Yd}from"react-portal";import Pt from"styled-components";var Vs=Pt.button`
1409
1420
  ${e=>k(e)} {
1410
1421
  // Anything inside this block will be ignored if the user provides a custom class
1411
1422
 
@@ -1423,17 +1434,17 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1423
1434
  opacity: 0.8;
1424
1435
  }
1425
1436
  }
1426
- `,Hs=kt.span`
1437
+ `,js=Pt.span`
1427
1438
  ${e=>k(e)} {
1428
1439
  font-size: 12px;
1429
1440
  display: inline-block;
1430
1441
  }
1431
- `,Vs=kt.span`
1442
+ `,Gs=Pt.span`
1432
1443
  ${e=>k(e)} {
1433
1444
  font-size: 12px;
1434
1445
  display: inline-block;
1435
1446
  }
1436
- `,js=kt.div`
1447
+ `,Ks=Pt.div`
1437
1448
  position: fixed;
1438
1449
  right: 0;
1439
1450
  bottom: 0;
@@ -1443,7 +1454,7 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1443
1454
  flex-direction: column;
1444
1455
  align-items: flex-end;
1445
1456
  z-index: 50;
1446
- `,Gs=kt.button`
1457
+ `,qs=Pt.button`
1447
1458
  ${e=>k(e)} {
1448
1459
  // Anything inside this block will be ignored if the user provides a custom class
1449
1460
  background-color: #ffffff;
@@ -1459,7 +1470,7 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1459
1470
  0px 3px 6px -4px rgba(0, 0, 0, 0.12);
1460
1471
  border-radius: 45px;
1461
1472
  cursor: pointer;
1462
- `,Ks=kt.div`
1473
+ `,Ys=Pt.div`
1463
1474
  ${e=>k(e)} {
1464
1475
  // Anything inside this block will be ignored if the user provides a custom class
1465
1476
  background: #ffffff;
@@ -1476,7 +1487,7 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1476
1487
  position: ${e=>e.type=="inline"?"absolute":"relative"};
1477
1488
  top: ${e=>e.type=="inline"?"68px":0};
1478
1489
  margin-left: ${e=>e.type=="inline"?"-127px":0};
1479
- `,qs=kt.button`
1490
+ `,Xs=Pt.button`
1480
1491
  ${e=>k(e)} {
1481
1492
  // Anything inside this block will be ignored if the user provides a custom class
1482
1493
  color: #434343;
@@ -1493,7 +1504,7 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1493
1504
  font-size: 14px;
1494
1505
 
1495
1506
  padding: 8px 12px;
1496
- `;import Ys from"react";var Xs=({style:e,className:t})=>Ys.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Ys.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 Js from"react";var Qs=({style:e,className:t})=>Js.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"},Js.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 Hd=({flowId:e,style:t,onStepCompletion:o,visible:r=!0,type:i="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:a,getStepStatus:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:y}=Z(),{primaryCTAClickSideEffects:w}=ae(),P=_d(null),[f,E]=zd(!1),{mergeAppearanceWithDefault:b}=R();s=b(s),Ud(()=>(document.addEventListener("click",S,!1),()=>{document.removeEventListener("click",S,!1)}),[]);let S=F=>{P.current&&!P.current.contains(F.target)&&E(!1)};if(x)return null;let A=p(e);if(!A||y(A))return null;let C=c(e);if(!C||!r)return null;function m(F,T){!F.completionCriteria&&(F.autoMarkCompleted||F.autoMarkCompleted===void 0)&&a(e,F.id),w(F),o&&o(F,T),E(!1)}function B(){return f&&Ae.createElement(Ks,{className:l("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:i},C.map((F,T)=>Ae.createElement(qs,{className:l("floatingWidgetMenuItem",s),key:T,onClick:()=>m(F,T)},F.title)))}return i=="inline"?Ae.createElement("span",{ref:P},Ae.createElement(Ws,{style:t,onClick:()=>{E(!f)},className:l("supportButton",s)},Ae.createElement(Vs,{className:l("supportIconContainer",s)},Ae.createElement(Qs,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),Ae.createElement(Hs,{className:l("supportButtonTitle",s)},n)),Ae.createElement(B,null)):Ae.createElement(Wd,null,Ae.createElement(js,{style:t,ref:P},Ae.createElement(B,null),Ae.createElement(Gs,{onClick:()=>{E(!f)},whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},Ae.createElement(Xs,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import je,{useEffect as Vd}from"react";import Ho from"styled-components";var Zs=Ho.div`
1507
+ `;import Js from"react";var Qs=({style:e,className:t})=>Js.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Js.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 Zs from"react";var Rs=({style:e,className:t})=>Zs.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"},Zs.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 Xd=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:a,getStepStatus:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:S}=Y(),{primaryCTAClickSideEffects:w}=ie(),P=Kd(null),[f,A]=qd(!1),{mergeAppearanceWithDefault:b}=Z();s=b(s),Gd(()=>(document.addEventListener("click",y,!1),()=>{document.removeEventListener("click",y,!1)}),[]);let y=F=>{P.current&&!P.current.contains(F.target)&&A(!1)};if(x)return null;let N=p(e);if(!N||S(N))return null;let h=c(e);if(!h||!i)return null;function m(F,T){!F.completionCriteria&&(F.autoMarkCompleted||F.autoMarkCompleted===void 0)&&a(e,F.id),w(F),o&&o(F,T),A(!1)}function v(){return f&&Ae.createElement(Ys,{className:l("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},h.map((F,T)=>Ae.createElement(Xs,{className:l("floatingWidgetMenuItem",s),key:T,onClick:()=>m(F,T)},F.title)))}return r=="inline"?Ae.createElement("span",{ref:P},Ae.createElement(Vs,{style:t,onClick:()=>{A(!f)},className:l("supportButton",s)},Ae.createElement(Gs,{className:l("supportIconContainer",s)},Ae.createElement(Rs,{className:l("supportIcon",s),style:{width:"18px",height:"18px"}})),Ae.createElement(js,{className:l("supportButtonTitle",s)},n)),Ae.createElement(v,null)):Ae.createElement(Yd,null,Ae.createElement(Ks,{style:t,ref:P},Ae.createElement(v,null),Ae.createElement(qs,{onClick:()=>{A(!f)},whileHover:{scale:1.1},className:l("floatingWidgetButton",s)},Ae.createElement(Qs,{className:l("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import Ke,{useEffect as Jd}from"react";import jo from"styled-components";var el=jo.div`
1497
1508
  ${e=>k(e)} {
1498
1509
  display: flex;
1499
1510
  flex-direction: column;
@@ -1508,17 +1519,17 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1508
1519
  border-radius: 12px;
1509
1520
  position: relative;
1510
1521
  }
1511
- `,Rs=Ho.div`
1522
+ `,tl=jo.div`
1512
1523
  display: flex;
1513
1524
  flex-direction: column;
1514
1525
  flex: 1;
1515
- `,el=Ho.div`
1526
+ `,ol=jo.div`
1516
1527
  display: flex;
1517
1528
  flex-direction: column;
1518
1529
  justify-content: center;
1519
1530
  align-items: flex-start;
1520
1531
  margin-top: 16px;
1521
- `,tl=Ho.div`
1532
+ `,rl=jo.div`
1522
1533
  ${e=>k(e)} {
1523
1534
  position: absolute;
1524
1535
  top: 16px;
@@ -1529,7 +1540,7 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1529
1540
  opacity: 0.8;
1530
1541
  }
1531
1542
  }
1532
- `;var jd=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:r,appearance:i,className:n,style:s,dismissible:p})=>{let{getFlow:c,markFlowCompleted:a,markStepCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:y,getFlowSteps:w,getFlowStatus:P,getCurrentStepIndex:f}=Z(),{primaryCTAClickSideEffects:E}=ae(),{mergeAppearanceWithDefault:b}=R();if(i=b(i),Vd(()=>{y(o)},[o,d]),d)return null;let S=c(e);if(!S||x(S)||P(e)===Q)return null;let C=w(e)[f(e)];return je.createElement(je.Fragment,null,je.createElement(re,{appearance:i}),je.createElement(Zs,{appearance:i,className:be(l("embeddedTipContainer",i),n),style:s},(p===!0||C.dismissible)&&je.createElement(tl,{onClick:async()=>{await a(e),t&&t()},className:l("embeddedTipDismissButton",i)},je.createElement(Be,null)),je.createElement(Rs,null,je.createElement(we,{size:"small",appearance:i,title:C.title,subtitle:C.subtitle})),C.primaryButtonTitle&&je.createElement(el,{className:l("embeddedTipCallToActionContainer",i)},je.createElement(oe,{classPrefix:"embeddedTip",title:C.primaryButtonTitle,appearance:i,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{C.handlePrimaryButtonClick(),E(C),!(r&&r(C,f(e),"primary")===!1)&&(await g(e,C.id),await a(e))}}))))};import Se,{useEffect as Gd}from"react";import Vt from"styled-components";var ol=Vt.div`
1543
+ `;var Qd=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:c,markFlowCompleted:a,markStepCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:S,getFlowSteps:w,getFlowStatus:P,getCurrentStepIndex:f}=Y(),{primaryCTAClickSideEffects:A}=ie(),{mergeAppearanceWithDefault:b}=Z();if(r=b(r),Jd(()=>{S(o)},[o,d]),d)return null;let y=c(e);if(!y||x(y)||P(e)===q)return null;let h=w(e)[f(e)];return Ke.createElement(Ke.Fragment,null,Ke.createElement(oe,{appearance:r}),Ke.createElement(el,{appearance:r,className:xe(l("embeddedTipContainer",r),n),style:s},(p===!0||h.dismissible)&&Ke.createElement(rl,{onClick:async()=>{await a(e),t&&t()},className:l("embeddedTipDismissButton",r)},Ke.createElement(Fe,null)),Ke.createElement(tl,null,Ke.createElement(he,{size:"small",appearance:r,title:h.title,subtitle:h.subtitle})),h.primaryButtonTitle&&Ke.createElement(ol,{className:l("embeddedTipCallToActionContainer",r)},Ke.createElement(te,{classPrefix:"embeddedTip",title:h.primaryButtonTitle,appearance:r,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{h.handlePrimaryButtonClick(),A(h),!(i&&i(h,f(e),"primary")===!1)&&(await g(e,h.id),await a(e))}}))))};import be,{useEffect as Zd}from"react";import jt from"styled-components";var il=jt.div`
1533
1544
  // use the :not annotation
1534
1545
  ${e=>k(e)} {
1535
1546
  display: flex;
@@ -1541,24 +1552,24 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1541
1552
  background-color: ${e=>e.appearance.theme.colorBackground};
1542
1553
  border-radius: 12px;
1543
1554
  }
1544
- `,rl=Vt.div`
1555
+ `,nl=jt.div`
1545
1556
  ${e=>k(e)} {
1546
1557
  display: flex;
1547
1558
  width: 46px;
1548
1559
  height: 46px;
1549
1560
  }
1550
- `,il=Vt.div`
1561
+ `,sl=jt.div`
1551
1562
  display: flex;
1552
1563
  flex-direction: column;
1553
1564
  flex: 1;
1554
1565
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1555
1566
  margin-top: ${e=>e.type==="square"?"12px":"0"};
1556
- `,nl=Vt.div`
1567
+ `,ll=jt.div`
1557
1568
  display: flex;
1558
1569
  flex-direction: column;
1559
1570
  justify-content: center;
1560
1571
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1561
- `,Tr=Vt.div`
1572
+ `,Pr=jt.div`
1562
1573
  display: flex;
1563
1574
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1564
1575
  align-items: flex-end;
@@ -1566,16 +1577,16 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1566
1577
  :hover {
1567
1578
  opacity: 0.8;
1568
1579
  }
1569
- `,Fr=Vt.div`
1580
+ `,vr=jt.div`
1570
1581
  display: flex;
1571
1582
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1572
1583
  align-items: flex-end;
1573
1584
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1574
- `;import kr from"react";var sl=({style:e,className:t})=>kr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},kr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),kr.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var Kd=({flowId:e,title:t,subtitle:o,onDismiss:r,customVariables:i,onButtonClick:n,appearance:s,type:p="full-width",icon:c})=>{let{getFlow:a,markFlowCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:y,getFlowMetadata:w,getFlowStatus:P,getFlowSteps:f,getCurrentStepIndex:E}=Z(),{primaryCTAClickSideEffects:b}=ae(),{mergeAppearanceWithDefault:S}=R();if(s=S(s),Gd(()=>{y(i)},[i,d]),d)return null;let A=a(e);if(!A||x(A)||P(e)===Q)return null;let C=f(e),m=C.length>0?C[E(e)]:w(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),Se.createElement(Se.Fragment,null,Se.createElement(re,{appearance:s}),Se.createElement(ol,{type:p,appearance:s,className:l("bannerContainer",s)},p!="square"&&Se.createElement(rl,{className:l("bannerIconContainer",s)},c||Se.createElement(sl,null)),p==="square"&&m.dismissible&&Se.createElement(Fr,{type:p,className:l("bannerDismissButtonContainer",s)},Se.createElement(Tr,{type:p,onClick:async()=>{await g(e),r&&r()},className:l("bannerDismissButton",s)},Se.createElement(Be,null))),Se.createElement(il,{type:p},Se.createElement(we,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(m==null?void 0:m.primaryButtonTitle)&&Se.createElement(nl,{type:p,className:l("bannerCallToActionContainer",s)},Se.createElement(oe,{title:m==null?void 0:m.primaryButtonTitle,appearance:s,onClick:()=>{b(m),n&&n(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&Se.createElement(Fr,{type:p,className:l("bannerDismissButtonContainer",s)},Se.createElement(Tr,{type:p,onClick:async()=>{await g(e),r&&r()},className:l("bannerDismissButton",s)},Se.createElement(Be,null)))))};import X,{useEffect as qd}from"react";import{Portal as Yd}from"react-portal";import tt from"styled-components";var ll=tt.div`
1585
+ `;import Br from"react";var al=({style:e,className:t})=>Br.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Br.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Br.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var Rd=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width",icon:c})=>{let{getFlow:a,markFlowCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:S,getFlowMetadata:w,getFlowStatus:P,getFlowSteps:f,getCurrentStepIndex:A}=Y(),{primaryCTAClickSideEffects:b}=ie(),{mergeAppearanceWithDefault:y}=Z();if(s=y(s),Zd(()=>{S(r)},[r,d]),d)return null;let N=a(e);if(!N||x(N)||P(e)===q)return null;let h=f(e),m=h.length>0?h[A(e)]:w(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),be.createElement(be.Fragment,null,be.createElement(oe,{appearance:s}),be.createElement(il,{type:p,appearance:s,className:l("bannerContainer",s)},p!="square"&&be.createElement(nl,{className:l("bannerIconContainer",s)},c||be.createElement(al,null)),p==="square"&&m.dismissible&&be.createElement(vr,{type:p,className:l("bannerDismissButtonContainer",s)},be.createElement(Pr,{type:p,onClick:async()=>{await g(e),i&&i()},className:l("bannerDismissButton",s)},be.createElement(Fe,null))),be.createElement(sl,{type:p},be.createElement(he,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(m==null?void 0:m.primaryButtonTitle)&&be.createElement(ll,{type:p,className:l("bannerCallToActionContainer",s)},be.createElement(te,{title:m==null?void 0:m.primaryButtonTitle,appearance:s,onClick:()=>{b(m),n&&n(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&be.createElement(vr,{type:p,className:l("bannerDismissButtonContainer",s)},be.createElement(Pr,{type:p,onClick:async()=>{await g(e),i&&i()},className:l("bannerDismissButton",s)},be.createElement(Fe,null)))))};import R,{useEffect as ec}from"react";import{Portal as tc}from"react-portal";import rt from"styled-components";var pl=rt.div`
1575
1586
  display: flex;
1576
1587
  flex-direction: column;
1577
1588
  width: 100%;
1578
- max-width: 400px;
1589
+ max-width: 600px;
1579
1590
  padding: 28px 18px;
1580
1591
  box-sizing: border-box;
1581
1592
  align-items: unset;
@@ -1590,7 +1601,7 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1590
1601
  z-index: 1000;
1591
1602
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
1592
1603
  min-width: 550px;
1593
- `,al=tt.button`
1604
+ `,dl=rt.button`
1594
1605
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1595
1606
  border-radius: 8px;
1596
1607
  // If selected make border color primary and text color color priamry
@@ -1611,33 +1622,33 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1611
1622
  display: flex;
1612
1623
  justify-content: center;
1613
1624
  align-items: center;
1614
- `,Pr=tt.div`
1625
+ `,Er=rt.div`
1615
1626
  display: flex;
1616
1627
  justify-content: space-between;
1617
1628
  margin-top: 16px;
1618
1629
  gap: 8px;
1619
- `,pl=tt.div`
1630
+ `,cl=rt.div`
1620
1631
  display: flex;
1621
1632
  justify-content: space-between;
1622
1633
  margin-top: 8px;
1623
- `,vr=tt.div`
1634
+ `,Ar=rt.div`
1624
1635
  font-size: 12px;
1625
1636
  line-height: 18px;
1626
1637
  color: ${e=>e.appearance.theme.colorTextDisabled};
1627
1638
  font-style: normal;
1628
1639
  font-weight: 400;
1629
1640
  letter-spacing: 0.24px;
1630
- `,Br=tt.div`
1641
+ `,Nr=rt.div`
1631
1642
  display: flex;
1632
1643
  flex-direction: column;
1633
1644
  flex: 1;
1634
- `,bb=tt.div`
1645
+ `,Ab=rt.div`
1635
1646
  display: flex;
1636
1647
  flex-direction: column;
1637
1648
  justify-content: center;
1638
1649
  align-items: flex-start;
1639
1650
  margin-top: 16px;
1640
- `,dl=tt.textarea`
1651
+ `,ml=rt.textarea`
1641
1652
  ${e=>k(e)} {
1642
1653
  margin-top: 16px;
1643
1654
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
@@ -1648,7 +1659,40 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1648
1659
  width: 100%;
1649
1660
  height: 100px;
1650
1661
  }
1651
- `,cl=tt.div`
1662
+ `,ul=rt.div`
1663
+ ${e=>k(e)} {
1664
+ position: absolute;
1665
+ top: 16px;
1666
+ right: 16px;
1667
+ cursor: pointer;
1668
+
1669
+ :hover {
1670
+ opacity: 0.8;
1671
+ }
1672
+ }
1673
+ `;var oc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,type:p="modal"})=>{let{getFlow:c,markFlowCompleted:a,markStepCompleted:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:S,updateCustomVariables:w,getFlowSteps:P,getFlowStatus:f,getCurrentStepIndex:A}=Y(),{primaryCTAClickSideEffects:b}=ie(),{mergeAppearanceWithDefault:y}=Z(),[N,h]=R.useState(null),[m,v]=R.useState(""),{hasOpenModals:F,setKeepCompletedFlowOpenDuringSession:T,shouldKeepCompletedFlowOpenDuringSession:O}=Te();if(r=y(r),ec(()=>{w(o)},[o,x]),x)return null;let E=c(e);if(!E||S(E)||f(e)===q||d(e)===1&&!O(e)||F())return null;let D=P(e)[d(e)];function L(){return R.createElement(R.Fragment,null,R.createElement(Nr,null,R.createElement(he,{size:"large",appearance:r,title:D.title,subtitle:D.subtitle})),R.createElement(Er,{className:l("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(ee=>R.createElement(dl,{className:l("npsNumberButton",r),selected:N===ee+1,key:ee,onClick:async()=>{T(e),h(ee+1),await g(e,D.id,{score:ee+1})},appearance:r},ee+1))),R.createElement(cl,{appearance:r},R.createElement(Ar,{appearance:r},"Not likely at all"),R.createElement(Ar,{appearance:r},"Extremely likely")))}function X(){return R.createElement(R.Fragment,null,R.createElement(Nr,null,R.createElement(he,{appearance:r,title:D.title??"Why did you choose this score?",size:"large"})),R.createElement(ml,{appearance:r,value:m,onChange:ee=>{v(ee.target.value)},placeHolder:"Add your optional fedback here..."}),R.createElement(Er,{appearance:r,className:l("npsNumberButtonContainer",r)},R.createElement(te,{size:"large",withMargin:!1,onClick:async()=>{await a(e),i&&i(D,1,"primary")},appearance:r,title:D.secondaryButtonTitle||"Skip",secondary:!0}),R.createElement(te,{size:"large",withMargin:!1,onClick:async()=>{await g(e,D.id,{feedbackText:m}),await a(e),i&&i(D,1,"primary")},appearance:r,title:D.primaryButtonTitle||"Submit"})))}function U(){return d(e)>=2?null:R.createElement(R.Fragment,null,R.createElement(oe,{appearance:r}),R.createElement(pl,{appearance:r,className:xe(l("npsSurveyContainer",r),n),style:s,type:p},R.createElement(ul,{onClick:async()=>{await a(e),t&&t()},className:l("npsSurveyDismissButton",r)},R.createElement(Fe,null)),d(e)==0&&L(),d(e)==1&&X()))}return p==="inline"?U():R.createElement(tc,null,U())};import De,{useEffect as rc}from"react";import Go from"styled-components";var fl=Go.div`
1674
+ ${e=>k(e)} {
1675
+ display: flex;
1676
+ flex-direction: column;
1677
+ width: 100%;
1678
+ max-width: 400px;
1679
+ box-sizing: border-box;
1680
+ align-items: unset;
1681
+ background-color: ${e=>e.appearance.theme.colorBackground};
1682
+ position: relative;
1683
+ padding-top: 24px;
1684
+ }
1685
+ `,gl=Go.div`
1686
+ display: flex;
1687
+ flex-direction: column;
1688
+ flex: 1;
1689
+ `,xl=Go.div`
1690
+ display: flex;
1691
+ flex-direction: column;
1692
+ justify-content: center;
1693
+ align-items: flex-start;
1694
+ margin-top: 16px;
1695
+ `,hl=Go.div`
1652
1696
  ${e=>k(e)} {
1653
1697
  position: absolute;
1654
1698
  top: 16px;
@@ -1659,5 +1703,5 @@ ${r=>r.inlineStyles.map(([i,n])=>`.${qt}${i}.${qt}${i} { ${Object.entries(n).map
1659
1703
  opacity: 0.8;
1660
1704
  }
1661
1705
  }
1662
- `;var Xd=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:r,appearance:i,className:n,style:s,type:p="modal"})=>{let{getFlow:c,markFlowCompleted:a,markStepCompleted:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:y,updateCustomVariables:w,getFlowSteps:P,getFlowStatus:f,getCurrentStepIndex:E}=Z(),{primaryCTAClickSideEffects:b}=ae(),{mergeAppearanceWithDefault:S}=R(),[A,C]=X.useState(null),[m,B]=X.useState(""),{hasOpenModals:F,setKeepCompletedFlowOpenDuringSession:T,shouldKeepCompletedFlowOpenDuringSession:O}=Pe();if(i=S(i),qd(()=>{w(o)},[o,x]),x)return null;let I=c(e);if(!I||y(I)||f(e)===Q||d(e)===1&&!O(e)||F())return null;let D=P(e)[d(e)];function L(){return X.createElement(X.Fragment,null,X.createElement(Br,null,X.createElement(we,{size:"large",appearance:i,title:D.title,subtitle:D.subtitle})),X.createElement(Pr,{className:l("npsNumberButtonContainer",i),appearance:i},Array.from(Array(10).keys()).map(J=>X.createElement(al,{className:l("npsNumberButton",i),selected:A===J+1,key:J,onClick:async()=>{T(e),C(J+1),await g(e,D.id,{score:J+1})},appearance:i},J+1))),X.createElement(pl,{appearance:i},X.createElement(vr,{appearance:i},"Not likely at all"),X.createElement(vr,{appearance:i},"Extremely likely")))}function ee(){return X.createElement(X.Fragment,null,X.createElement(Br,null,X.createElement(we,{appearance:i,title:D.title??"Why did you choose this score?",size:"large"})),X.createElement(dl,{appearance:i,value:m,onChange:J=>{B(J.target.value)},placeHolder:"Add your optional fedback here..."}),X.createElement(Pr,{appearance:i,className:l("npsNumberButtonContainer",i)},X.createElement(oe,{size:"large",withMargin:!1,onClick:async()=>{await a(e),r&&r(D,1,"primary")},appearance:i,title:D.secondaryButtonTitle||"Skip",secondary:!0}),X.createElement(oe,{size:"large",withMargin:!1,onClick:async()=>{await g(e,D.id,{feedbackText:m}),await a(e),r&&r(D,1,"primary")},appearance:i,title:D.primaryButtonTitle||"Submit"})))}function U(){return d(e)>=2?null:X.createElement(X.Fragment,null,X.createElement(re,{appearance:i}),X.createElement(ll,{appearance:i,className:be(l("npsSurveyContainer",i),n),style:s,type:p},X.createElement(cl,{onClick:async()=>{await a(e),t&&t()},className:l("npsSurveyDismissButton",i)},X.createElement(Be,null)),d(e)==0&&L(),d(e)==1&&ee()))}return p==="inline"?U():X.createElement(Yd,null,U())};import*as Vo from"react";import ml from"react";var ul=({as:e="span",children:t,variant:o="Body1",...r})=>ml.createElement(Gi,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...r},t),Jd=Object.fromEntries(Object.keys(Io).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=r=>ml.createElement(ul,{as:t,...r,variant:e},r.children);return o.displayName=`Text.${e}`,[e,o]})),Er=Object.assign(ul,Jd);var fl=({as:e="button",className:t,size:o="md",title:r,variant:i="Primary",...n})=>{var s;return Vo.createElement(ji,{className:`fr-button-${i.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:i,size:o,borderRadius:"md",...n},Vo.createElement(Er,{color:(s=io[i])==null?void 0:s.color,fontWeight:"semibold"},r))},Qd=Object.fromEntries(Object.keys(io).map(e=>{let t=o=>Vo.createElement(fl,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),Zd=Object.assign(fl,Qd);export{ro as Box,Zd as Button,Ye as CheckBox,nt as FormLabel,Ro as FormTextField,Kd as FrigadeBanner,br as FrigadeChecklist,qe as FrigadeDefaultAppearance,jd as FrigadeEmbeddedTip,Di as FrigadeForm,Td as FrigadeGuide,Sd as FrigadeHeroChecklist,Xd as FrigadeNPSSurvey,bd as FrigadeProgressBadge,Ep as FrigadeProvider,Hd as FrigadeSupportWidget,Md as FrigadeTour,It as ProgressRing,Er as Text,mr as tokens,Pe as useFlowOpens,Gt as useFlowResponses,Z as useFlows,pr as useOrganization,Kt as useUser,ve as useUserFlowStates};
1706
+ `;var ic=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p=!0,modalPosition:c})=>{let{getFlow:a,markFlowCompleted:g,markStepCompleted:d,isLoading:x,targetingLogicShouldHideFlow:S,updateCustomVariables:w,getFlowSteps:P,getFlowStatus:f,getCurrentStepIndex:A}=Y(),{primaryCTAClickSideEffects:b}=ie(),{mergeAppearanceWithDefault:y}=Z(),{setOpenFlowState:N,getOpenFlowState:h,hasOpenModals:m}=Te(),[v,F]=[h(e,!0),X=>N(e,X)];if(r=y(r),rc(()=>{w(o)},[o,x]),x)return null;let T=a(e);if(!T||S(T)||f(e)===q||m())return null;let E=P(e)[A(e)],$=()=>{F(!1),t&&t(),g(e)};function D(){return De.createElement(De.Fragment,null,De.createElement(oe,{appearance:r}),De.createElement(fl,{appearance:r,className:xe(l("announcementContainer",r),n),style:s},(p===!0||E.dismissible)&&c=="inline"&&De.createElement(hl,{onClick:async()=>{await g(e),t&&t()},className:l("announcementDismissButton",r)},De.createElement(Fe,null)),De.createElement(gl,null,De.createElement(he,{size:"small",appearance:r,title:E.title,subtitle:E.subtitle})),E.primaryButtonTitle&&De.createElement(xl,{className:l("announcementCTAContainer",r)},De.createElement(te,{classPrefix:"announcement",title:E.primaryButtonTitle,appearance:r,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{E.handlePrimaryButtonClick(),b(E),!(i&&i(E,A(e),"primary")===!1)&&(await d(e,E.id),await g(e))}}))))}let L={padding:"24px",maxWidth:"400px"};return c==="inline"?D():c!=="center"?De.createElement(So,{modalPosition:c,onClose:$,visible:v,dismissible:p,appearance:r},D()):De.createElement(He,{appearance:r,onClose:$,visible:v,style:L,dismissible:p},D())};import*as Ko from"react";import Cl from"react";var yl=({as:e="span",children:t,variant:o="Body1",...i})=>Cl.createElement(qi,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...i},t),nc=Object.fromEntries(Object.keys(Oo).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>Cl.createElement(yl,{as:t,...i,variant:e},i.children);return o.displayName=`Text.${e}`,[e,o]})),Ir=Object.assign(yl,nc);var Sl=({as:e="button",className:t,size:o="md",title:i,variant:r="Primary",...n})=>{var s;return Ko.createElement(Ki,{className:`fr-button-${r.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:r,size:o,borderRadius:"md",...n},Ko.createElement(Ir,{color:(s=no[r])==null?void 0:s.color,fontWeight:"semibold"},i))},sc=Object.fromEntries(Object.keys(no).map(e=>{let t=o=>Ko.createElement(Sl,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),lc=Object.assign(Sl,sc);export{io as Box,lc as Button,Je as CheckBox,st as FormLabel,or as FormTextField,ic as FrigadeAnnouncement,Rd as FrigadeBanner,Fr as FrigadeChecklist,Xe as FrigadeDefaultAppearance,Qd as FrigadeEmbeddedTip,Mi as FrigadeForm,Ad as FrigadeGuide,Pd as FrigadeHeroChecklist,oc as FrigadeNPSSurvey,Bd as FrigadeProgressBadge,$p as FrigadeProvider,Xd as FrigadeSupportWidget,jd as FrigadeTour,It as ProgressRing,Ir as Text,gr as tokens,Te as useFlowOpens,Kt as useFlowResponses,Y as useFlows,mr as useOrganization,qt as useUser,Be as useUserFlowStates};
1663
1707
  //# sourceMappingURL=index.mjs.map