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