@frigade/react 1.35.12 → 1.35.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +1 -0
- package/lib/index.js +82 -82
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +229 -229
- 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 wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import{ThemeProvider as Hp}from"styled-components";import bt,{useContext as xp,useEffect as Lo,useState as gr}from"react";import{useCallback as ht,useContext as Wl,useEffect as _l}from"react";import Yo,{useMemo as $r}from"react";var Dr="1.35.12 ";var Ie="NOT_STARTED_STEP",q="COMPLETED_FLOW",xo="ABORTED_FLOW",xt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ue="COMPLETED_STEP",ho="STARTED_STEP";function _e(){let{publicApiKey:e,userId:t,apiUrl:o}=Yo.useContext(K);return{config:$r(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Dr,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:$r(()=>`${o}/v1/public/`,[o])}}var Bl="frigade-last-call-at-",El="frigade-last-call-data-";function It(){let{shouldGracefullyDegrade:e,readonly:t}=Yo.useContext(K);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Nt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Nt();let r=Bl+o,n=El+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),c=window.localStorage.getItem(n);if(p&&c&&c==i.body){let a=new Date(p);if(new Date().getTime()-a.getTime()<1e3)return Nt()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return Nt(p)}return s?s.ok?s:Nt(s.statusText):Nt()}}function Nt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ot(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Yo.useContext(K);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Ml,useState as Mr}from"react";import{useContext as Nl,useEffect as Il,useState as Ol}from"react";import Ll from"swr";import{useContext as Al}from"react";function we(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Al(K);function n(d,y=!1){return e[d]??y}function s(d,y){t(w=>({...w,[d]:y}))}function p(d){t(y=>{let{[d]:w,...C}=y;return{...C}})}function c(d){r.includes(d)||i(y=>[...y,d])}function a(d){return r.includes(d)}function g(d){return Object.entries(e).some(([y,w])=>w&&y!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:a}}import Dl from"swr/immutable";var $l="unknown";function Be(){let{config:e,apiUrl:t}=_e(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=Nl(K),{resetOpenFlowState:c}=we(),[a,g]=Ol(!1),d={data:n.map(k=>({flowId:k.id,flowState:q,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},y=k=>fetch(k,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${k}: ${P}. Will gracefully degrade and hide Frigade`),s(!0),d)),w=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:C,isLoading:T,mutate:f,error:B}=p?Dl(w,y):Ll(w,y,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),b=C==null?void 0:C.data;Il(()=>{!a&&!T&&b&&g(!0)},[b,a,T]);async function S(k){if(b&&!p){let P=b.find(O=>O.flowId===k);P&&P.flowState!==q&&(P.flowState=q),await f(Promise.resolve({...C,data:b}),{optimisticData:{...C,data:b},revalidate:!1,rollbackOnError:!1})}}async function A(k,P,O){if(b){let N=b.find(I=>I.flowId===k);N&&(N.stepStates[P]=O,N.flowState=xt),await f(Promise.resolve({...C,data:b}),{optimisticData:{...C,data:b},revalidate:!1,rollbackOnError:!1})}}async function h(k,P,O){if(b){let N=b.find(I=>I.flowId===k);N&&(N.lastStepId=P,N.stepStates[P]=O,N.flowState=xt),await f({...C,data:b},{optimisticData:{...C,data:b},revalidate:!1,rollbackOnError:!1})}}async function m(k){if(b){let P=b.find(O=>O.flowId===k);P&&P.flowState!==Me&&(P.flowState=Me,P.lastStepId=$l,Object.keys(P.stepStates).forEach(O=>{P.stepStates[O].actionType=Ie,P.stepStates[O].createdAt=new Date().toISOString()}),await f({...C,data:b},{optimisticData:{...C,data:b},revalidate:!1,rollbackOnError:!1}),c(k))}}async function E(k,P){if(b){let O=b.find(N=>N.flowId===k);O&&O.stepStates[P]!==Ie&&(O.stepStates[P]=Ie),await f({...C,data:b},{optimisticData:{...C,data:b},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:b,isLoadingUserFlowStateData:!a,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:E,optimisticallyMarkStepStarted:h,error:B}}function Xt(){let{config:e,apiUrl:t}=_e(),{userFlowStatesData:o,mutateUserFlowState:i}=Be(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=Ml(K),[c,a]=Mr(new Set),[g,d]=Mr(new Set),y=It();function w(f){let B=JSON.stringify(f);if(c.has(B))return null;c.add(B),a(c),g.add(f),d(g);let b=s==null?void 0:s.find(S=>S.flowSlug===f.flowSlug&&S.stepId===f.stepId&&S.actionType===f.actionType&&S.createdAt===f.createdAt);return y(`${t}flowResponses`,{...e,method:"POST",body:B}).then(S=>{S.status!==200&&S.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...r,f])):b||p(A=>[...A??[],f])})}async function C(f){f.foreignUserId&&(f.actionType===xt||f.actionType===Me?await w(f):f.actionType===q?await w(f):f.actionType===ho?await w(f):f.actionType===Ue?await w(f):f.actionType===xo?await w(f):f.actionType===Ie&&await w(f))}function T(){let f=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let b in B.stepStates){let S=B.stepStates[b];f.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:S.stepId,actionType:S.actionType,data:{},createdAt:new Date(S.createdAt),blocked:S.blocked,hidden:S.hidden})}}),[...f,...s]}return{addResponse:C,setFlowResponses:p,getFlowResponses:T}}import Hl from"swr";var Ul=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,Ur=e=>{let t=Ul.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=zl(i,"'","");n.startsWith("flow_")&&(o=n)}),o},zl=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Y(){let{config:e,apiUrl:t}=_e(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:y}=Wl(K),w={data:[]},{verifySDKInitiated:C}=Ot(),{addResponse:T,getFlowResponses:f}=Xt(),B=u=>fetch(u,e).then(x=>x.ok?x.json():(console.log(`Error fetching ${u} (${x.status}): ${x.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),w)).catch(x=>(console.log(`Error fetching ${u}: ${x}. Will gracefully degrade and hide Frigade`),d(!0),w)),{mutateUserFlowState:b,userFlowStatesData:S,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:h,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:E,optimisticallyMarkStepNotStarted:k,optimisticallyMarkStepStarted:P}=Be(),{data:O,error:N,isLoading:I}=Hl(n?`${t}flows${y?"?readonly=true":""}`:null,B,{keepPreviousData:!0});_l(()=>{if(N){console.error(N);return}O&&O.data&&i(O.data)},[O,N]);function $(u){if(I)return null;let x=o.find(v=>v.slug===u);return!x&&o.length>0&&!A&&!I?(console.log(`Flow with id ${u} not found`),null):(x==null?void 0:x.active)===!1?null:x}function D(u){var W;if(!$(u))return[];let x=$(u).data;return x?(x=ee(x),(((W=JSON.parse(x))==null?void 0:W.data)??[]).map(M=>{let $e=se(M);return{handleSecondaryButtonClick:()=>{M.skippable===!0&&j(u,M.id,{skipped:!0})},...M,complete:ge(u,M.id)===Ue||$e>=1,blocked:re(u,M.id),hidden:L(u,M.id),handlePrimaryButtonClick:()=>{(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&j(u,M.id)},progress:$e}}).filter(M=>M.hidden!==!0)):[]}function ee(u){return u.replaceAll(/\${(.*?)}/g,(x,v)=>s[v]===void 0?"":String(s[v]).replace(/[\u00A0-\u9999<>\&]/g,function(W){return"&#"+W.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function U(u){if(!$(u))return[];let x=$(u).data;return x?(x=ee(x),JSON.parse(x)??{}):[]}function te(u,x){p(v=>({...v,[u]:x}))}function fe(u){!A&&!I&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(x=>{te(x,u[x])})}let X=ht(async(u,x,v)=>{if(!C())return;let W={foreignUserId:r,flowSlug:u,stepId:x,actionType:ho,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await P(u,x,W),T(W))},[r,S]),H=ht(async(u,x,v)=>{if(!C())return;let W={foreignUserId:r,flowSlug:u,stepId:x,actionType:Ie,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await k(u,x),T(W))},[r,S]),j=ht(async(u,x,v)=>{if(!C())return;let W={foreignUserId:r,flowSlug:u,stepId:x,actionType:Ue,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await E(u,x,W),T(W))},[r,S]),Ce=ht(async(u,x)=>{if(!C()||pe(u)===Me)return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Me,data:x??{},createdAt:new Date,blocked:!1,hidden:!1};await m(u),J(v)&&T(v)},[r,S]),Ne=ht(async(u,x)=>{if(!C())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xt,data:x??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&T(v)},[r,S]),be=ht(async(u,x)=>{if(!C())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:q,data:x??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await h(u),T(v))},[r,S]),me=ht(async(u,x)=>{if(!C())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xo,data:x??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await h(u),T(v))},[r,S]);function J(u){var x;if(!S&&u.actionType===Ie)return!1;if(S){let v=S.find(W=>W.flowId===u.flowSlug);if(u.actionType===Ie&&(!(v!=null&&v.stepStates[u.stepId])||v.stepStates[u.stepId].actionType===Ie)||v&&((x=v.stepStates[u.stepId])==null?void 0:x.actionType)===u.actionType||v&&v.flowState===q&&u.actionType===q)return!1}return!0}function ge(u,x){let v=V(u,x);return A?null:v?v.actionType:Ie}function re(u,x){let v=V(u,x);return v?v.blocked:!1}function L(u,x){let v=V(u,x);return v?v.hidden:!1}function V(u,x){if(A)return null;let v=S==null?void 0:S.find(W=>W.flowId===u);return!v||!v.stepStates[x]?null:v.stepStates[x]??null}function G(u){var v;if(A||!S)return null;if(pe(u)===Me)return D(u)[0]??null;let x=(v=S.find(W=>W.flowId===u))==null?void 0:v.lastStepId;return x?D(u).find(W=>W.id===x):null}function ne(u){let x=G(u);if(!x)return 0;let v=D(u).findIndex(W=>W.id===x.id)??0;return ge(u,x.id)===Ue&&v<D(u).length-1?v+1:v}function se(u){if(!u.completionCriteria)return;let x=Ur(u.completionCriteria);if(x===null)return;let v=Ye(x),W=De(x);return W===0?void 0:v/W}function pe(u){let x=S==null?void 0:S.find(v=>v.flowId===u);return x?x.flowState:null}function Ye(u){let x=D(u);return x.length===0?0:x.filter(W=>ge(u,W.id)===Ue).length}function De(u){return D(u).length}function Et(u){let x=o.find(v=>v.slug===u);return x?JSON.parse(x.data):null}function ft(u){if(y)return!1;if(A)return!0;if(u!=null&&u.targetingLogic&&S){let x=S.find(v=>v.flowId===u.slug);if(x)return x.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function At(u){return!ft($(u))}function gt(){r&&b()}return{getFlow:$,getFlowData:Et,isLoading:A||I,getStepStatus:ge,getFlowSteps:D,getCurrentStepIndex:ne,markStepStarted:X,markStepCompleted:j,markFlowNotStarted:Ce,markFlowStarted:Ne,markFlowCompleted:be,markFlowAborted:me,markStepNotStarted:H,getFlowStatus:pe,getNumberOfStepsCompleted:Ye,getNumberOfSteps:De,targetingLogicShouldHideFlow:ft,setCustomVariable:te,updateCustomVariables:fe,customVariables:s,getStepOptionalProgress:se,getFlowMetadata:U,isStepBlocked:re,isStepHidden:L,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:a,isFlowAvailableToUser:At,refresh:gt}}import{useCallback as Xo,useContext as jl,useEffect as Vl}from"react";var Lt="guest_";function Jt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=jl(K),{config:n,apiUrl:s}=_e(),{mutateUserFlowState:p}=Be(),c=It(),{verifySDKInitiated:a}=Ot();function g(C){return`frigade-user-registered-${C}`}Vl(()=>{if(e&&!t){if(e.startsWith(Lt))return;let C=g(e);localStorage.getItem(C)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(C,"true"))}},[e,r,t]);let d=Xo(async C=>{if(!a())return;let T={foreignId:e,properties:C};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(T)}),i(f=>({...f,...C})),p()},[e,n,r,p]),y=Xo(async(C,T)=>{if(!a())return;let B={foreignId:e,events:[{event:C,properties:T}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),p()},[e,n,p]),w=Xo(async(C,T)=>{if(a())if(T){let f=g(C);localStorage.setItem(f,"true"),o(C);let B={foreignId:C,properties:T};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),i(b=>({...b,...T})),p()}else o(C)},[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:w,addPropertiesToUser:d,trackEventForUser:y}}import{v4 as hp}from"uuid";import Ge,{useEffect as mp,useState as up}from"react";import ze,{useEffect as Rl}from"react";import So from"styled-components";import Gl from"react";import Kl from"styled-components";var zr="fr-",Qt="cfr-";function l(e,t){let o=`${zr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Qt+e}return o}function F(e){if(!e.className||e.className.indexOf(Qt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(zr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Jo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Jo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function xe(...e){return e.filter(Boolean).join(" ")}function Zt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ql=Kl.div`
|
|
2
|
+
import wt,{createContext as jp,useEffect as $o,useState as Oe}from"react";import{ThemeProvider as Vp}from"styled-components";import bt,{useContext as Cp,useEffect as Lo,useState as Cr}from"react";import{useCallback as ht,useContext as Hl,useEffect as jl}from"react";import Yo,{useMemo as zr}from"react";var Ur="1.35.13 ";var Ne="NOT_STARTED_STEP",q="COMPLETED_FLOW",xo="ABORTED_FLOW",xt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ue="COMPLETED_STEP",ho="STARTED_STEP";function _e(){let{publicApiKey:e,userId:t,apiUrl:o}=Yo.useContext(K);return{config:zr(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Ur,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:zr(()=>`${o}/v1/public/`,[o])}}var Al="frigade-last-call-at-",Il="frigade-last-call-data-";function Nt(){let{shouldGracefullyDegrade:e,readonly:t}=Yo.useContext(K);return async(o,i)=>{if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return It();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),It();let r=Al+o,n=Il+o;if(window&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(r),c=window.localStorage.getItem(n);if(p&&c&&c==i.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return It()}window.localStorage.setItem(r,new Date().toISOString()),window.localStorage.setItem(n,i.body)}let s;try{s=await fetch(o,i)}catch(p){return It(p)}return s?s.ok?s:It(s.statusText):It()}}function It(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ot(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Yo.useContext(K);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as zl,useState as Wr}from"react";import{useContext as Ol,useEffect as Ll,useState as Dl}from"react";import $l from"swr";import{useContext as Nl}from"react";function we(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:r}=Nl(K);function n(d,x=!1){return e[d]??x}function s(d,x){t(b=>({...b,[d]:x}))}function p(d){t(x=>{let{[d]:b,...h}=x;return{...h}})}function c(d){r.includes(d)||i(x=>[...x,d])}function l(d){return r.includes(d)}function g(d){return Object.entries(e).some(([x,b])=>b&&x!=d)||o}return{getOpenFlowState:n,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:g,setKeepCompletedFlowOpenDuringSession:c,shouldKeepCompletedFlowOpenDuringSession:l}}import Ml from"swr/immutable";var Ul="unknown";function Be(){let{config:e,apiUrl:t}=_e(),{publicApiKey:o,userId:i,organizationId:r,flows:n,setShouldGracefullyDegrade:s,readonly:p}=Ol(K),{resetOpenFlowState:c}=we(),[l,g]=Dl(!1),d={data:n.map(k=>({flowId:k.id,flowState:q,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},x=k=>fetch(k,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${k}: ${P}. Will gracefully degrade and hide Frigade`),s(!0),d)),b=o&&n&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${r?`&foreignUserGroupId=${encodeURIComponent(r)}`:""}`:null,{data:h,isLoading:T,mutate:f,error:B}=p?Ml(b,x):$l(b,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>d,onLoadingSlow:()=>d}),w=h==null?void 0:h.data;Ll(()=>{!l&&!T&&w&&g(!0)},[w,l,T]);async function S(k){if(w&&!p){let P=w.find(O=>O.flowId===k);P&&P.flowState!==q&&(P.flowState=q),await f(Promise.resolve({...h,data:w}),{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}async function A(k,P,O){if(w){let I=w.find(N=>N.flowId===k);I&&(I.stepStates[P]=O,I.flowState=xt),await f(Promise.resolve({...h,data:w}),{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}async function y(k,P,O){if(w){let I=w.find(N=>N.flowId===k);I&&(I.lastStepId=P,I.stepStates[P]=O,I.flowState=xt),await f({...h,data:w},{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}async function m(k){if(w){let P=w.find(O=>O.flowId===k);P&&P.flowState!==Me&&(P.flowState=Me,P.lastStepId=Ul,Object.keys(P.stepStates).forEach(O=>{P.stepStates[O].actionType=Ne,P.stepStates[O].createdAt=new Date().toISOString()}),await f({...h,data:w},{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1}),c(k))}}async function E(k,P){if(w){let O=w.find(I=>I.flowId===k);O&&O.stepStates[P]!==Ne&&(O.stepStates[P]=Ne),await f({...h,data:w},{optimisticData:{...h,data:w},revalidate:!1,rollbackOnError:!1})}}return{userFlowStatesData:w,isLoadingUserFlowStateData:!l,mutateUserFlowState:f,optimisticallyMarkFlowCompleted:S,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:E,optimisticallyMarkStepStarted:y,error:B}}function Xt(){let{config:e,apiUrl:t}=_e(),{userFlowStatesData:o,mutateUserFlowState:i}=Be(),{failedFlowResponses:r,setFailedFlowResponses:n,flowResponses:s,setFlowResponses:p}=zl(K),[c,l]=Wr(new Set),[g,d]=Wr(new Set),x=Nt();function b(f){let B=JSON.stringify(f);if(c.has(B))return null;c.add(B),l(c),g.add(f),d(g);let w=s==null?void 0:s.find(S=>S.flowSlug===f.flowSlug&&S.stepId===f.stepId&&S.actionType===f.actionType&&S.createdAt===f.createdAt);return x(`${t}flowResponses`,{...e,method:"POST",body:B}).then(S=>{S.status!==200&&S.status!==201?(console.log("Failed to send flow response for step "+f.stepId+". Will retry again later."),n([...r,f])):w||p(A=>[...A??[],f])})}async function h(f){f.foreignUserId&&(f.actionType===xt||f.actionType===Me?await b(f):f.actionType===q?await b(f):f.actionType===ho?await b(f):f.actionType===Ue?await b(f):f.actionType===xo?await b(f):f.actionType===Ne&&await b(f))}function T(){let f=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let w in B.stepStates){let S=B.stepStates[w];f.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:S.stepId,actionType:S.actionType,data:{},createdAt:new Date(S.createdAt),blocked:S.blocked,hidden:S.hidden})}}),[...f,...s]}return{addResponse:h,setFlowResponses:p,getFlowResponses:T}}import Vl from"swr";var Wl=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,_r=e=>{let t=Wl.exec(e);if(t===null)return null;let o=null;return t.forEach((i,r)=>{let n=_l(i,"'","");n.startsWith("flow_")&&(o=n)}),o},_l=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Y(){let{config:e,apiUrl:t}=_e(),{flows:o,setFlows:i,userId:r,publicApiKey:n,customVariables:s,setCustomVariables:p,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,setFlowResponses:g,setShouldGracefullyDegrade:d,readonly:x}=Hl(K),b={data:[]},{verifySDKInitiated:h}=Ot(),{addResponse:T,getFlowResponses:f}=Xt(),B=u=>fetch(u,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${u} (${C.status}): ${C.statusText}. .Will gracefully degrade and hide Frigade`),d(!0),b)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),d(!0),b)),{mutateUserFlowState:w,userFlowStatesData:S,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:y,optimisticallyMarkFlowNotStarted:m,optimisticallyMarkStepCompleted:E,optimisticallyMarkStepNotStarted:k,optimisticallyMarkStepStarted:P}=Be(),{data:O,error:I,isLoading:N}=Vl(n?`${t}flows${x?"?readonly=true":""}`:null,B,{keepPreviousData:!0});jl(()=>{if(I){console.error(I);return}O&&O.data&&i(O.data)},[O,I]);function $(u){if(N)return null;let C=o.find(v=>v.slug===u);return!C&&o.length>0&&!A&&!N?(console.log(`Flow with id ${u} not found`),null):(C==null?void 0:C.active)===!1?null:C}function D(u){var W;if(!$(u))return[];let C=$(u).data;return C?(C=ee(C),(((W=JSON.parse(C))==null?void 0:W.data)??[]).map(M=>{let $e=se(M);return{handleSecondaryButtonClick:()=>{M.skippable===!0&&j(u,M.id,{skipped:!0})},...M,complete:ge(u,M.id)===Ue||$e>=1,blocked:re(u,M.id),hidden:L(u,M.id),handlePrimaryButtonClick:()=>{(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&j(u,M.id)},progress:$e}}).filter(M=>M.hidden!==!0)):[]}function ee(u){return u.replaceAll(/\${(.*?)}/g,(C,v)=>s[v]===void 0?"":String(s[v]).replace(/[\u00A0-\u9999<>\&]/g,function(W){return"&#"+W.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function U(u){if(!$(u))return[];let C=$(u).data;return C?(C=ee(C),JSON.parse(C)??{}):[]}function te(u,C){p(v=>({...v,[u]:C}))}function fe(u){!A&&!N&&u&&JSON.stringify(s)!=JSON.stringify({...s,...u})&&Object.keys(u).forEach(C=>{te(C,u[C])})}let X=ht(async(u,C,v)=>{if(!h())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:ho,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await P(u,C,W),T(W))},[r,S]),H=ht(async(u,C,v)=>{if(!h())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ne,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await k(u,C),T(W))},[r,S]),j=ht(async(u,C,v)=>{if(!h())return;let W={foreignUserId:r,flowSlug:u,stepId:C,actionType:Ue,data:v??{},createdAt:new Date,blocked:!1,hidden:!1};J(W)&&(await E(u,C,W),T(W))},[r,S]),Ce=ht(async(u,C)=>{if(!h()||pe(u)===Me)return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:Me,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};await m(u),J(v)&&T(v)},[r,S]),Ie=ht(async(u,C)=>{if(!h())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xt,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&T(v)},[r,S]),be=ht(async(u,C)=>{if(!h())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:q,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await y(u),T(v))},[r,S]),me=ht(async(u,C)=>{if(!h())return;let v={foreignUserId:r,flowSlug:u,stepId:"unknown",actionType:xo,data:C??{},createdAt:new Date,blocked:!1,hidden:!1};J(v)&&(await y(u),T(v))},[r,S]);function J(u){var C;if(!S&&u.actionType===Ne)return!1;if(S){let v=S.find(W=>W.flowId===u.flowSlug);if(u.actionType===Ne&&(!(v!=null&&v.stepStates[u.stepId])||v.stepStates[u.stepId].actionType===Ne)||v&&((C=v.stepStates[u.stepId])==null?void 0:C.actionType)===u.actionType||v&&v.flowState===q&&u.actionType===q)return!1}return!0}function ge(u,C){let v=V(u,C);return A?null:v?v.actionType:Ne}function re(u,C){let v=V(u,C);return v?v.blocked:!1}function L(u,C){let v=V(u,C);return v?v.hidden:!1}function V(u,C){if(A)return null;let v=S==null?void 0:S.find(W=>W.flowId===u);return!v||!v.stepStates[C]?null:v.stepStates[C]??null}function G(u){var v;if(A||!S)return null;if(pe(u)===Me)return D(u)[0]??null;let C=(v=S.find(W=>W.flowId===u))==null?void 0:v.lastStepId;return C?D(u).find(W=>W.id===C):null}function ne(u){let C=G(u);if(!C)return 0;let v=D(u).findIndex(W=>W.id===C.id)??0;return ge(u,C.id)===Ue&&v<D(u).length-1?v+1:v}function se(u){if(!u.completionCriteria)return;let C=_r(u.completionCriteria);if(C===null)return;let v=Ye(C),W=De(C);return W===0?void 0:v/W}function pe(u){let C=S==null?void 0:S.find(v=>v.flowId===u);return C?C.flowState:null}function Ye(u){let C=D(u);return C.length===0?0:C.filter(W=>ge(u,W.id)===Ue).length}function De(u){return D(u).length}function Et(u){let C=o.find(v=>v.slug===u);return C?JSON.parse(C.data):null}function ft(u){if(x)return!1;if(A)return!0;if(u!=null&&u.targetingLogic&&S){let C=S.find(v=>v.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&r&&r.startsWith("guest_"))}function At(u){return!ft($(u))}function gt(){r&&w()}return{getFlow:$,getFlowData:Et,isLoading:A||N,getStepStatus:ge,getFlowSteps:D,getCurrentStepIndex:ne,markStepStarted:X,markStepCompleted:j,markFlowNotStarted:Ce,markFlowStarted:Ie,markFlowCompleted:be,markFlowAborted:me,markStepNotStarted:H,getFlowStatus:pe,getNumberOfStepsCompleted:Ye,getNumberOfSteps:De,targetingLogicShouldHideFlow:ft,setCustomVariable:te,updateCustomVariables:fe,customVariables:s,getStepOptionalProgress:se,getFlowMetadata:U,isStepBlocked:re,isStepHidden:L,hasActiveFullPageFlow:c,setHasActiveFullPageFlow:l,isFlowAvailableToUser:At,refresh:gt}}import{useCallback as Xo,useContext as Gl,useEffect as Kl}from"react";var Lt="guest_";function Jt(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:r}=Gl(K),{config:n,apiUrl:s}=_e(),{mutateUserFlowState:p}=Be(),c=Nt(),{verifySDKInitiated:l}=Ot();function g(h){return`frigade-user-registered-${h}`}Kl(()=>{if(e&&!t){if(e.startsWith(Lt))return;let h=g(e);localStorage.getItem(h)||(c(`${s}users`,{...n,method:"POST",body:JSON.stringify({foreignId:e})}),localStorage.setItem(h,"true"))}},[e,r,t]);let d=Xo(async h=>{if(!l())return;let T={foreignId:e,properties:h};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(T)}),i(f=>({...f,...h})),p()},[e,n,r,p]),x=Xo(async(h,T)=>{if(!l())return;let B={foreignId:e,events:[{event:h,properties:T}]};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),p()},[e,n,p]),b=Xo(async(h,T)=>{if(l())if(T){let f=g(h);localStorage.setItem(f,"true"),o(h);let B={foreignId:h,properties:T};await c(`${s}users`,{...n,method:"POST",body:JSON.stringify(B)}),i(w=>({...w,...T})),p()}else o(h)},[n,r,p]);return{userId:e,setUserId:o,setUserIdWithProperties:b,addPropertiesToUser:d,trackEventForUser:x}}import{v4 as yp}from"uuid";import Ge,{useEffect as fp,useState as gp}from"react";import ze,{useEffect as er,useState as ta}from"react";import So from"styled-components";import ql from"react";import Yl from"styled-components";var Hr="fr-",Qt="cfr-";function a(e,t){let o=`${Hr}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+Qt+e}return o}function F(e){if(!e.className||e.className.indexOf(Qt)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(Hr)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Jo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Jo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function xe(...e){return e.filter(Boolean).join(" ")}function Zt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Xl=Yl.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,jr=({onClose:e,appearance:t})=>ql.createElement(Xl,{className:a("modalBackground",t),onClick:()=>e()});import Qo from"react";import Jl from"styled-components";var Ql=Jl.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,Te=()=>Qo.createElement(
|
|
30
|
+
`,Te=()=>Qo.createElement(Ql,null,Qo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Qo.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as oa}from"react-portal";import oi from"react";import Zo from"react";function Zl({style:e,className:t}){return Zo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Zo.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"}),Zo.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 Vr=Zl;import Ro from"styled-components";import Xe from"styled-components";var Co=Xe.div`
|
|
31
31
|
${e=>F(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
@@ -38,7 +38,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
38
38
|
min-width: 300px;
|
|
39
39
|
z-index: ${e=>e.zIndex};
|
|
40
40
|
overflow: hidden;
|
|
41
|
-
`,
|
|
41
|
+
`,Rl=`
|
|
42
42
|
display: block;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
@@ -50,17 +50,17 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
50
50
|
right: 12px;
|
|
51
51
|
:hover {
|
|
52
52
|
opacity: 0.8;
|
|
53
|
-
}`,
|
|
53
|
+
}`,ea=`
|
|
54
54
|
display: block;
|
|
55
55
|
cursor: pointer;
|
|
56
56
|
position: absolute;
|
|
57
57
|
top: 12px;
|
|
58
58
|
right: 12px;
|
|
59
|
-
`,
|
|
59
|
+
`,Gr=Xe.div`
|
|
60
60
|
${e=>F(e)} {
|
|
61
|
-
${e=>e.hasImage?
|
|
61
|
+
${e=>e.hasImage?Rl:ea};
|
|
62
62
|
}
|
|
63
|
-
`,
|
|
63
|
+
`,Kr=Xe.img`
|
|
64
64
|
${e=>F(e)} {
|
|
65
65
|
display: block;
|
|
66
66
|
width: 100%;
|
|
@@ -68,7 +68,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
68
68
|
min-height: 200px;
|
|
69
69
|
object-fit: cover;
|
|
70
70
|
}
|
|
71
|
-
`,
|
|
71
|
+
`,qr=Xe.div`
|
|
72
72
|
${e=>F(e)} {
|
|
73
73
|
display: block;
|
|
74
74
|
width: 100%;
|
|
@@ -76,19 +76,19 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
76
76
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
77
77
|
object-fit: cover;
|
|
78
78
|
}
|
|
79
|
-
`,
|
|
79
|
+
`,Yr=Xe.div`
|
|
80
80
|
display: flex;
|
|
81
81
|
flex-direction: row;
|
|
82
82
|
justify-content: space-between;
|
|
83
83
|
align-content: center;
|
|
84
|
-
`,
|
|
84
|
+
`,Xr=Xe.div`
|
|
85
85
|
padding: 22px 22px 12px;
|
|
86
|
-
`,
|
|
86
|
+
`,Jr=Xe.div`
|
|
87
87
|
display: flex;
|
|
88
88
|
flex: 1;
|
|
89
89
|
flex-direction: column;
|
|
90
90
|
justify-content: center;
|
|
91
|
-
`,
|
|
91
|
+
`,Qr=Xe.div`
|
|
92
92
|
display: flex;
|
|
93
93
|
flex: 2;
|
|
94
94
|
flex-shrink: 1;
|
|
@@ -100,7 +100,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
100
100
|
align-content: center;
|
|
101
101
|
align-items: center;
|
|
102
102
|
}
|
|
103
|
-
`,
|
|
103
|
+
`,Zr=Xe.p`
|
|
104
104
|
${e=>F(e)} {
|
|
105
105
|
font-style: normal;
|
|
106
106
|
font-weight: 600;
|
|
@@ -109,7 +109,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
109
109
|
color: #808080;
|
|
110
110
|
}
|
|
111
111
|
margin: 0;
|
|
112
|
-
`;var
|
|
112
|
+
`;var Rr=Ro.div`
|
|
113
113
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
114
114
|
position: absolute;
|
|
115
115
|
bottom: -47px;
|
|
@@ -120,7 +120,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
120
120
|
align-items: center;
|
|
121
121
|
justify-content: center;
|
|
122
122
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
123
|
-
`,
|
|
123
|
+
`,ei=Ro(Co)`
|
|
124
124
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
125
125
|
position: absolute;
|
|
126
126
|
bottom: -60px;
|
|
@@ -133,7 +133,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
133
133
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
134
134
|
padding: 0;
|
|
135
135
|
z-index: ${e=>e.zIndex};
|
|
136
|
-
`,
|
|
136
|
+
`,ti=Ro.div`
|
|
137
137
|
display: flex;
|
|
138
138
|
justify-content: center;
|
|
139
139
|
align-items: center;
|
|
@@ -142,7 +142,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
142
142
|
font-size: 12px;
|
|
143
143
|
line-height: 18px;
|
|
144
144
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
145
|
-
`;function yo({appearance:e}){return
|
|
145
|
+
`;function yo({appearance:e}){return oi.createElement(ti,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",oi.createElement(Vr,null))}var ra=So.div`
|
|
146
146
|
${e=>F(e)} {
|
|
147
147
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
148
148
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -184,10 +184,10 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
184
184
|
opacity: 1;
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
`,
|
|
187
|
+
`,ia=So.div`
|
|
188
188
|
position: relative;
|
|
189
189
|
flex: 0 1 auto;
|
|
190
|
-
`,
|
|
190
|
+
`,na=So.div`
|
|
191
191
|
position: absolute;
|
|
192
192
|
top: 16px;
|
|
193
193
|
right: 16px;
|
|
@@ -197,14 +197,14 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
197
197
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
198
198
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
199
199
|
}
|
|
200
|
-
`,
|
|
200
|
+
`,sa=So.div`
|
|
201
201
|
overflow: scroll;
|
|
202
202
|
flex: 1 1;
|
|
203
203
|
display: flex;
|
|
204
204
|
::-webkit-scrollbar {
|
|
205
205
|
display: none;
|
|
206
206
|
}
|
|
207
|
-
`,He=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>(
|
|
207
|
+
`,He=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:r,appearance:n,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[c,l]=ta("");return er(()=>{let g=getComputedStyle(document.body).getPropertyValue("overflow");l(g)},[]),er(()=>{let g=d=>{d.key==="Escape"&&e()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[e]),er(()=>{let g=document.body.style;return t?g.setProperty("overflow","hidden"):g.setProperty("overflow",c),()=>{g.setProperty("overflow",c)}},[t]),t?ze.createElement(oa,null,ze.createElement(jr,{appearance:n,onClose:()=>{s&&e()}}),ze.createElement(ra,{appearance:n,className:a("modalContainer",n),styleOverrides:i},s&&ze.createElement(na,{className:a("modalClose",n),onClick:()=>e(),appearance:n},ze.createElement(Te,null)),o&&ze.createElement(ia,null,o),ze.createElement(sa,null,r),p&&ze.createElement(Rr,{appearance:n,className:a("poweredByFrigadeRibbon",n)},ze.createElement(yo,{appearance:n})))):ze.createElement(ze.Fragment,null)};import nt,{useEffect as tr,useState as la}from"react";import bo from"styled-components";import{Portal as aa}from"react-portal";function pa(e){switch(e){case"top-left":return`
|
|
208
208
|
top: 0;
|
|
209
209
|
left: 0;
|
|
210
210
|
`;case"top-right":return`
|
|
@@ -213,7 +213,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
213
213
|
`;case"bottom-left":return`
|
|
214
214
|
bottom: 0;
|
|
215
215
|
left: 0;
|
|
216
|
-
`}return"right: 0; bottom: 0;"}var
|
|
216
|
+
`}return"right: 0; bottom: 0;"}var da=bo.div`
|
|
217
217
|
${e=>F(e)} {
|
|
218
218
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
219
219
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -227,12 +227,12 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
227
227
|
width: 350px;
|
|
228
228
|
padding: 24px;
|
|
229
229
|
}
|
|
230
|
-
${e=>
|
|
230
|
+
${e=>pa(e.modalPosition)}
|
|
231
231
|
margin: 28px;
|
|
232
|
-
`,
|
|
232
|
+
`,ca=bo.div`
|
|
233
233
|
position: relative;
|
|
234
234
|
flex: 1;
|
|
235
|
-
`,
|
|
235
|
+
`,ma=bo.div`
|
|
236
236
|
position: absolute;
|
|
237
237
|
top: 16px;
|
|
238
238
|
right: 16px;
|
|
@@ -242,13 +242,13 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
242
242
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
243
243
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
244
244
|
}
|
|
245
|
-
`,
|
|
245
|
+
`,ua=bo.div`
|
|
246
246
|
overflow: scroll;
|
|
247
247
|
flex: 5;
|
|
248
248
|
::-webkit-scrollbar {
|
|
249
249
|
display: none;
|
|
250
250
|
}
|
|
251
|
-
`,wo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>(
|
|
251
|
+
`,wo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:r,modalPosition:n="bottom-right",dismissible:s=!0})=>{let[p,c]=la("");return tr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");c(l)},[]),tr(()=>{let l=g=>{g.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),tr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?nt.createElement(aa,null,nt.createElement(da,{appearance:r,className:a("cornerModalContainer",r),modalPosition:n},s&&nt.createElement(ma,{className:a("cornerModalClose",r),onClick:()=>e()},nt.createElement(Te,null)),o&&nt.createElement(ca,null,o),nt.createElement(ua,null,i))):nt.createElement(nt.Fragment,null)};import{useContext as fa}from"react";function Q(){let{defaultAppearance:e}=fa(K);function t(o){let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign(i.styleOverrides??{},o.styleOverrides??{}),theme:Object.assign(i.theme,o.theme??{})}:i}return{mergeAppearanceWithDefault:t}}import Ct,{useContext as Ma,useEffect as Ua,useState as dr}from"react";import vo from"styled-components";import ko,{useEffect as ga,useState as ai}from"react";import ir from"styled-components";import To from"styled-components";var ri=To.label`
|
|
252
252
|
${e=>F(e)} {
|
|
253
253
|
font-size: 12px;
|
|
254
254
|
line-height: 18px;
|
|
@@ -259,14 +259,14 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
259
259
|
letter-spacing: 0.24px;
|
|
260
260
|
}
|
|
261
261
|
display: flex;
|
|
262
|
-
`,
|
|
262
|
+
`,ii=To.label`
|
|
263
263
|
${e=>F(e)} {
|
|
264
264
|
font-size: 12px;
|
|
265
265
|
line-height: 20px;
|
|
266
266
|
margin-bottom: 5px;
|
|
267
267
|
}
|
|
268
268
|
display: flex;
|
|
269
|
-
`,
|
|
269
|
+
`,ni=To.span`
|
|
270
270
|
font-weight: 400;
|
|
271
271
|
font-size: 14px;
|
|
272
272
|
line-height: 22px;
|
|
@@ -279,11 +279,11 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
279
279
|
align-items: flex-start;
|
|
280
280
|
justify-content: left;
|
|
281
281
|
margin-bottom: 10px;
|
|
282
|
-
`;import
|
|
282
|
+
`;import or from"react";var Je={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function st({title:e,required:t,appearance:o=Je}){return e?or.createElement(Fo,null,t?or.createElement(ni,{className:a("formLabelRequired",o),appearance:o},"*"):null,or.createElement(ri,{className:a("formLabel",o)},e)):null}import si from"react";function Dt({title:e,appearance:t}){return e?si.createElement(Fo,null,si.createElement(ii,{className:a("formSubLabel",t)},e)):null}import{z as rr}from"zod";function li(e,t){try{if(t){if(t.type=="number"){let o=rr.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=rr.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 rr.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 xa=ir.div`
|
|
283
283
|
display: flex;
|
|
284
284
|
flex-direction: column;
|
|
285
285
|
width: 100%;
|
|
286
|
-
`,
|
|
286
|
+
`,nr=ir.input`
|
|
287
287
|
${e=>F(e)} {
|
|
288
288
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
289
289
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -299,7 +299,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
299
299
|
box-sizing: border-box;
|
|
300
300
|
padding: 0 10px;
|
|
301
301
|
margin-bottom: 10px;
|
|
302
|
-
`,
|
|
302
|
+
`,ha=ir.textarea`
|
|
303
303
|
${e=>F(e)} {
|
|
304
304
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
305
305
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -315,13 +315,13 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
315
315
|
min-height: 70px;
|
|
316
316
|
box-sizing: border-box;
|
|
317
317
|
margin-bottom: 10px;
|
|
318
|
-
`;function
|
|
318
|
+
`;function sr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:r}){let n=e,[s,p]=ai((r==null?void 0:r.text)||""),[c,l]=ai(!1),g=nr;ga(()=>{s===""&&!c&&(l(!0),d(""))},[]);function d(b){if(p(b),o({text:b}),n.required===!0&&b.trim()===""){i([{id:n.id,message:`${n.title??"Field"} is required`}]);return}let h=li(b,n.validation);if(h){i([{id:n.id,message:h}]);return}i([])}n.multiline&&(g=ha);function x(){var b;switch((b=n==null?void 0:n.validation)==null?void 0:b.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return ko.createElement(xa,null,ko.createElement(st,{title:n.title,required:n.required,appearance:t.appearance}),ko.createElement(g,{className:a("inputComponent",t.appearance),value:s,onChange:b=>{d(b.target.value)},appearance:t.appearance,placeholder:n.placeholder,type:x()}),ko.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import je,{useEffect as pi,useState as di}from"react";import ci from"styled-components";var lr="",Ca=ci.div`
|
|
319
319
|
display: flex;
|
|
320
320
|
flex-direction: column;
|
|
321
321
|
width: 100%;
|
|
322
322
|
-webkit-appearance: none;
|
|
323
323
|
appearance: none;
|
|
324
|
-
`,
|
|
324
|
+
`,ya=ci.select`
|
|
325
325
|
${e=>F(e)} {
|
|
326
326
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
327
327
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -342,15 +342,15 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
342
342
|
background-repeat: no-repeat;
|
|
343
343
|
background-size: 1.5em 1.5em;
|
|
344
344
|
-webkit-print-color-adjust: exact;
|
|
345
|
-
`;function
|
|
345
|
+
`;function mi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g,d,x,b,h,T;let n=e,[s,p]=di(((g=i==null?void 0:i.choice)==null?void 0:g[0])||""),[c,l]=di(!1);return pi(()=>{var f,B,w,S;if(s===""&&!c){if(l(!0),n.requireSelection){p(lr);return}if(n.defaultValue&&((f=n.props.options)!=null&&f.find(A=>A.id===n.defaultValue))){let A=(B=n.props.options)==null?void 0:B.find(y=>y.id===n.defaultValue);p(A.id),o({choice:[A.id]})}else p(((w=n.props.options)==null?void 0:w[0].id)||""),o({choice:[((S=n.props.options)==null?void 0:S[0].id)||""]})}},[]),pi(()=>{n.requireSelection&&s===lr?r([{message:"Please select an option",id:n.id}]):r([])},[s]),je.createElement(Ca,null,je.createElement(st,{title:n.title,required:!1,appearance:t.appearance}),je.createElement(ya,{value:s,onChange:f=>{p(f.target.value),o({choice:[f.target.value]})},placeholder:n.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},n.requireSelection&&je.createElement("option",{key:"null-value",value:lr,disabled:!0},n.placeholder??"Select an option"),(d=n.props.options)==null?void 0:d.map(f=>je.createElement("option",{key:f.id,value:f.id},f.title))),((b=(x=n.props.options)==null?void 0:x.find(f=>f.id===s))==null?void 0:b.isOpenEnded)&&je.createElement(je.Fragment,null,je.createElement(st,{title:((T=(h=n.props.options)==null?void 0:h.find(f=>f.id===s))==null?void 0:T.openEndedLabel)??"Please specify",required:!1,appearance:t.appearance}),je.createElement(nr,{type:"text",placeholder:"Enter your answer here",onChange:f=>{o({choice:[f.target.value]})},appearance:t.appearance})),je.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import to,{useEffect as ar,useState as fi}from"react";import gi from"styled-components";import eo from"react";import Rt from"react";var ui=({color:e,percentage:t,size:o})=>{let i=o*.5-2,r=2*Math.PI*i,n=(1-t)*r;return Rt.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:n!==r?e:"",strokeWidth:"3px",strokeDasharray:r,strokeDashoffset:t?n:0})},Sa=({fillColor:e,size:t,percentage:o,children:i,bgColor:r="#D9D9D9",className:n,style:s})=>Rt.createElement("svg",{style:s,className:n,width:t,height:t,overflow:"visible"},Rt.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Rt.createElement(ui,{color:r,size:t}),Rt.createElement(ui,{color:e,percentage:o,size:t})),i),$t=Sa;import ba from"styled-components";var wa=({color:e="#FFFFFF"})=>eo.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eo.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Ta={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},Fa={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},ka={border:"1px solid #000000",color:"#FFFFFF"},Pa={border:"1px solid #C5CBD3"},va={color:"#FFFFFF"},Ba={border:"1px solid #C5CBD3"},Ea=e=>e==="square"?Ta:Fa,Aa=(e,t)=>e==="square"?t?ka:Pa:t?va:Ba,Ia=ba.div`
|
|
346
346
|
${e=>ke(e)}
|
|
347
|
-
`,Qe=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Je,style:n,className:s})=>{let p=
|
|
347
|
+
`,Qe=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:r=Je,style:n,className:s})=>{let p=Ea(t),c=Aa(t,e);return e===!0?p={...p,...c,backgroundColor:r.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}:p={...p,...c},e!==!0&&t==="round"&&i!==void 0&&i!==1?eo.createElement($t,{fillColor:o,percentage:i,size:22}):eo.createElement(Ia,{styleOverrides:p,style:n,role:"checkbox",className:xe(a("checkIconContainer",r),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",r),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&eo.createElement(wa,{color:"#FFFFFF"}))};var Na=gi.div`
|
|
348
348
|
display: flex;
|
|
349
349
|
flex-direction: column;
|
|
350
350
|
width: 100%;
|
|
351
351
|
-webkit-appearance: none;
|
|
352
352
|
appearance: none;
|
|
353
|
-
`,
|
|
353
|
+
`,Oa=gi.button`
|
|
354
354
|
${e=>F(e)} {
|
|
355
355
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
356
356
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -375,7 +375,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
375
375
|
height: 48px;
|
|
376
376
|
padding: 0 18px;
|
|
377
377
|
margin-bottom: 10px;
|
|
378
|
-
`;function
|
|
378
|
+
`;function xi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:r}){var g;let n=e,[s,p]=fi((i==null?void 0:i.choice)||[]),[c,l]=fi(!1);return ar(()=>{s.length==0&&!c&&(l(!0),o({choice:[]}))},[]),ar(()=>{o({choice:s})},[s]),ar(()=>{n.required&&(s.length<n.props.minChoices||s.length>n.props.maxChoices)?r([{message:"",id:n.id}]):r([])},[s]),to.createElement(Na,null,to.createElement(st,{title:n.title,required:n.required,appearance:t.appearance}),(g=n.props.options)==null?void 0:g.map(d=>to.createElement(Oa,{appearance:t.appearance,className:a("multipleChoiceListItem",t.appearance),key:d.id,value:d.id,"data-selected":s.includes(d.id),onClick:()=>{if(s.includes(d.id)){p(s.filter(x=>x!==d.id));return}s.length<n.props.maxChoices?p([...s,d.id]):s.length==1&&n.props.maxChoices==1&&p([d.id])}},d.title,to.createElement(Qe,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(d.id),appearance:t.appearance}))),to.createElement(Dt,{title:n.subtitle,appearance:t.appearance}))}import Po from"react";import hi from"styled-components";import La from"dompurify";function le(e){return{__html:La.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var Da=hi.h1`
|
|
379
379
|
${e=>F(e)} {
|
|
380
380
|
font-style: normal;
|
|
381
381
|
font-weight: 700;
|
|
@@ -387,7 +387,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
387
387
|
margin-bottom: 4px;
|
|
388
388
|
color: ${e=>e.appearance.theme.colorText};
|
|
389
389
|
}
|
|
390
|
-
|
|
390
|
+
`,$a=hi.h2`
|
|
391
391
|
${e=>F(e)} {
|
|
392
392
|
font-style: normal;
|
|
393
393
|
font-weight: 400;
|
|
@@ -396,42 +396,42 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
396
396
|
letter-spacing: 0.28px;
|
|
397
397
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
398
398
|
}
|
|
399
|
-
`;function Fe({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return Po.createElement(Po.Fragment,null,Po.createElement(
|
|
399
|
+
`;function Fe({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:r=""}){return Po.createElement(Po.Fragment,null,Po.createElement(Da,{appearance:e,className:a(`${r}${r?Zt(i):i}Title`,e),dangerouslySetInnerHTML:le(t),size:i}),o&&Po.createElement($a,{appearance:e,className:a(`${r}${r?Zt(i):i}Subtitle`,e),dangerouslySetInnerHTML:le(o),size:i}))}import*as pr from"react";var Ci=e=>pr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16",...e},pr.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));var za=vo.div`
|
|
400
400
|
display: flex;
|
|
401
401
|
flex-direction: column;
|
|
402
402
|
justify-content: flex-end;
|
|
403
403
|
overflow: visible;
|
|
404
404
|
padding-top: 14px;
|
|
405
|
-
`,
|
|
405
|
+
`,Wa=vo.div`
|
|
406
406
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
407
407
|
font-size: 12px;
|
|
408
408
|
margin-bottom: 12px;
|
|
409
409
|
display: flex;
|
|
410
410
|
align-items: center;
|
|
411
|
-
`,
|
|
411
|
+
`,_a=vo.div`
|
|
412
412
|
margin-right: 4px;
|
|
413
413
|
display: inline-flex;
|
|
414
|
-
`,
|
|
414
|
+
`,Ha=vo.div`
|
|
415
415
|
padding-left: 1px;
|
|
416
416
|
padding-right: 1px;
|
|
417
|
-
`,
|
|
417
|
+
`,ja={text:sr,multipleChoice:mi,multipleChoiceList:xi},cr="frigade-multiInputStepTypeData";function yi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n,customFormElements:s,prefillData:p}){var y;let c=t.props,[l,g]=dr([]),[d,x]=dr([]),{userId:b}=Jt(),[h,T]=dr(S()||(p?p[t.id]:null)||{}),{readonly:f}=Ma(K),B={...ja,...s};Ua(()=>{i(l.length===0)},[l,i]);function w(m,E){let k={...h,[m.id]:E};T(k),r(k),window&&window.localStorage&&!f&&window.localStorage.setItem(A(),JSON.stringify(k))}function S(){if(window&&window.localStorage){let m=window.localStorage.getItem(A());if(m)return JSON.parse(m)}return null}function A(){return`${cr}-${e}-${t.id}-${b}`}return Ct.createElement(Ha,{className:a("multiInput",n)},Ct.createElement(Fe,{appearance:n,title:t.title,subtitle:t.subtitle}),Ct.createElement(za,{className:a("multiInputContainer",n)},(y=c.data)==null?void 0:y.map(m=>{var k;let E=(k=l.reverse().find(P=>P.id===m.id))==null?void 0:k.message;return B[m.type]?Ct.createElement("span",{key:m.id,"data-field-id":m.id,className:a("multiInputField",n)},B[m.type]({formInput:m,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:r,appearance:n},onSaveInputData:P=>{!d.includes(m.id)&&P&&(P==null?void 0:P.text)!==""&&x(O=>[...O,m.id]),w(m,P)},inputData:h[m.id],setFormValidationErrors:P=>{g(O=>P.length===0?O.filter(I=>I.id!==m.id):[...O,...P])}}),E&&d.includes(m.id)&&Ct.createElement(Wa,{initial:{opacity:0,height:0,marginBottom:0},animate:{opacity:1,height:"auto",marginBottom:12},exit:{opacity:0,height:0,marginBottom:0},key:m.id,style:{overflow:"hidden"},transition:{duration:.1,ease:"easeInOut",delay:.5},appearance:n,className:a("multiInputValidationError",n)},Ct.createElement(_a,{appearance:n,className:a("multiInputValidationErrorIcon",n)},Ct.createElement(Ci,null)),E)):null})))}import yt from"styled-components";var Si=yt.div`
|
|
418
418
|
align-items: center;
|
|
419
419
|
display: flex;
|
|
420
420
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
421
421
|
padding-top: 14px;
|
|
422
|
-
`,
|
|
422
|
+
`,bi=yt.div`
|
|
423
423
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
424
424
|
font-size: 12px;
|
|
425
|
-
`,
|
|
425
|
+
`,wi=yt.div`
|
|
426
426
|
display: flex;
|
|
427
427
|
gap: 12px;
|
|
428
428
|
width: 100%;
|
|
429
429
|
justify-content: flex-end;
|
|
430
|
-
`,
|
|
430
|
+
`,Ti=yt.div`
|
|
431
431
|
display: flex;
|
|
432
432
|
flex-direction: row;
|
|
433
433
|
flex: 1 1;
|
|
434
|
-
`,
|
|
434
|
+
`,Fi=yt.div`
|
|
435
435
|
display: flex;
|
|
436
436
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
437
437
|
// Otherwise, use 4px padding
|
|
@@ -439,11 +439,11 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
439
439
|
flex-grow: 1;
|
|
440
440
|
flex-basis: 0;
|
|
441
441
|
position: relative;
|
|
442
|
-
`,
|
|
442
|
+
`,ki=yt.div`
|
|
443
443
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
444
444
|
position: relative;
|
|
445
445
|
overflow-y: auto;
|
|
446
|
-
`,
|
|
446
|
+
`,Pi=yt.div`
|
|
447
447
|
display: flex;
|
|
448
448
|
align-self: stretch;
|
|
449
449
|
flex-grow: 1;
|
|
@@ -455,7 +455,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
455
455
|
background-position: center;
|
|
456
456
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
457
457
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
458
|
-
`;import lt from"react";import
|
|
458
|
+
`;import lt from"react";import Va from"react";import vi from"styled-components";var Ga=vi.button`
|
|
459
459
|
justify-content: center;
|
|
460
460
|
align-content: center;
|
|
461
461
|
${e=>F(e)} {
|
|
@@ -486,7 +486,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
486
486
|
opacity: 0.3;
|
|
487
487
|
cursor: not-allowed;
|
|
488
488
|
}
|
|
489
|
-
`,Bo=
|
|
489
|
+
`,Bo=vi.div`
|
|
490
490
|
${e=>F(e)} {
|
|
491
491
|
display: flex;
|
|
492
492
|
flex-direction: row;
|
|
@@ -497,14 +497,14 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
497
497
|
margin-right: 8px;
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
`,Z=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:
|
|
500
|
+
`,Z=({onClick:e,title:t,style:o,disabled:i,type:r="inline",size:n="medium",secondary:s=!1,appearance:p,withMargin:c=!0,classPrefix:l=""})=>{function g(){let d=s?"buttonSecondary":"button";return l===""?d:`${l}${Zt(d)}`}return Va.createElement(Ga,{secondary:s,appearance:p,disabled:i,onClick:e,styleOverrides:o,type:r,withMargin:c,size:n,className:a(g(),p)},t??"Continue")};var Bi=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:r,selectedStep:n,steps:s,onBack:p,allowBackNavigation:c,errorMessage:l})=>{let g=s.length>1&&n!=0&&c,d=e.primaryButtonTitle&&e.secondaryButtonTitle||g?"inline":"full-width";return lt.createElement(lt.Fragment,null,l!==null&&l!=null&<.createElement(bi,{appearance:o,className:a("formCTAError",o)},l),lt.createElement(Si,{showBackButton:g,className:a("formCTAContainer",o)},g&<.createElement(Z,{title:e.backButtonTitle??"Back",onClick:p,secondary:!0,withMargin:!1,type:d,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),lt.createElement(wi,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?lt.createElement(Z,{title:e.secondaryButtonTitle,onClick:r,secondary:!0,withMargin:!1,type:d,appearance:o}):null," ",e.primaryButtonTitle?lt.createElement(Z,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:d,appearance:o}):null)))};import mr from"react";import Ka from"styled-components";var qa=Ka.div`
|
|
501
501
|
text-align: center;
|
|
502
|
-
`,
|
|
502
|
+
`,Ei=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:r}=Q().mergeAppearanceWithDefault(i);return mr.createElement(qa,{className:o},mr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((n,s)=>mr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?r.colorPrimary:"#E6E6E6"}))))};import St from"react";import Mt from"styled-components";import{useContext as Ya}from"react";function ie(){let e=Ya(K);function t(r){i(r.primaryButtonUri,r.primaryButtonUriTarget)}function o(r){i(r.secondaryButtonUri,r.secondaryButtonUriTarget)}function i(r,n){if(!r)return;let s=r.startsWith("http")?"_blank":"_self";n&&n!=="_blank"&&(s="_self"),e.navigate(r,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Xa=Mt.div`
|
|
503
503
|
display: flex;
|
|
504
504
|
flex-wrap: wrap;
|
|
505
505
|
align-content: center;
|
|
506
506
|
justify-content: center;
|
|
507
|
-
`,
|
|
507
|
+
`,Ja=Mt.div`
|
|
508
508
|
align-content: center;
|
|
509
509
|
align-items: center;
|
|
510
510
|
display: flex;
|
|
@@ -518,10 +518,10 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
518
518
|
flex-basis: 255px;
|
|
519
519
|
flex-grow: 0;
|
|
520
520
|
flex-shrink: 0;
|
|
521
|
-
`,
|
|
521
|
+
`,Qa=Mt.img`
|
|
522
522
|
width: 78px;
|
|
523
523
|
height: auto;
|
|
524
|
-
`,
|
|
524
|
+
`,Za=Mt.button`
|
|
525
525
|
font-style: normal;
|
|
526
526
|
font-weight: 600;
|
|
527
527
|
font-size: 13px;
|
|
@@ -534,11 +534,11 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
534
534
|
border-radius: 100px;
|
|
535
535
|
padding: 8px 12px;
|
|
536
536
|
margin-top: 16px;
|
|
537
|
-
`,
|
|
537
|
+
`,Ra=Mt.h1`
|
|
538
538
|
font-weight: 700;
|
|
539
539
|
font-size: 28px;
|
|
540
540
|
line-height: 34px;
|
|
541
|
-
`,
|
|
541
|
+
`,ep=Mt.h2`
|
|
542
542
|
font-style: normal;
|
|
543
543
|
font-weight: 400;
|
|
544
544
|
font-size: 16px;
|
|
@@ -547,7 +547,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
547
547
|
margin-top: 12px;
|
|
548
548
|
margin-bottom: 16px;
|
|
549
549
|
max-width: 70%;
|
|
550
|
-
`;function
|
|
550
|
+
`;function Ai({stepData:e,appearance:t}){var i,r;let{handleUrl:o}=ie();return St.createElement("div",null,St.createElement(Ra,null,e.title),St.createElement(ep,null,e.subtitle),St.createElement(Xa,null,(r=(i=e.props)==null?void 0:i.links)==null?void 0:r.map(n=>St.createElement(Ja,{key:n.title},St.createElement(Qa,{src:n.imageUri}),St.createElement(Za,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{n.uri&&o(n.uri,n.uriTarget??"_blank")}},n.title)))))}import Ut,{useEffect as lp}from"react";import Io from"styled-components";import ur from"react";var Eo=({style:e,className:t})=>ur.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},ur.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),ur.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 oo,{useRef as tp,useState as op}from"react";import Ao from"styled-components";var rp=Ao.div`
|
|
551
551
|
display: flex;
|
|
552
552
|
align-items: center;
|
|
553
553
|
justify-content: flex-start;
|
|
@@ -555,7 +555,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
555
555
|
width: 100%;
|
|
556
556
|
height: 100%;
|
|
557
557
|
position: relative;
|
|
558
|
-
`,
|
|
558
|
+
`,ip=Ao.div`
|
|
559
559
|
position: absolute;
|
|
560
560
|
display: flex;
|
|
561
561
|
align-items: center;
|
|
@@ -574,56 +574,56 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
574
574
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
575
575
|
border-radius: 50%;
|
|
576
576
|
}
|
|
577
|
-
`,
|
|
577
|
+
`,np=Ao.video`
|
|
578
578
|
width: 100%;
|
|
579
579
|
height: 100%;
|
|
580
580
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
581
|
-
`,
|
|
581
|
+
`,sp=Ao.iframe`
|
|
582
582
|
width: 100%;
|
|
583
583
|
height: 100%;
|
|
584
584
|
min-height: 260px;
|
|
585
585
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
586
|
-
`;function Ve({appearance:e,videoUri:t}){let o=
|
|
586
|
+
`;function Ve({appearance:e,videoUri:t}){let o=tp(),[i,r]=op(!1);if(t.includes("youtube")){let n=t.split("v=")[1],s=n.indexOf("&");return s!==-1&&(n=n.substring(0,s)),oo.createElement(sp,{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 oo.createElement(rp,{className:a("videoPlayerWrapper",e),appearance:e},!i&&oo.createElement(ip,{onClick:()=>{r(!0),o.current.play()},appearance:e},oo.createElement(Eo,null)),oo.createElement(np,{appearance:e,controls:i,ref:o,play:i,src:t}))}var ap=Io.div`
|
|
587
587
|
${e=>F(e)} {
|
|
588
588
|
display: flex;
|
|
589
589
|
flex-direction: column;
|
|
590
590
|
justify-content: center;
|
|
591
591
|
}
|
|
592
|
-
`,
|
|
592
|
+
`,pp=Io.img`
|
|
593
593
|
${e=>F(e)} {
|
|
594
594
|
width: 100%;
|
|
595
595
|
height: auto;
|
|
596
596
|
max-height: 250px;
|
|
597
597
|
margin-bottom: 24px;
|
|
598
598
|
}
|
|
599
|
-
`,
|
|
599
|
+
`,dp=Io.div`
|
|
600
600
|
${e=>F(e)} {
|
|
601
601
|
margin-bottom: 24px;
|
|
602
602
|
}
|
|
603
|
-
`,
|
|
603
|
+
`,cp=Io.div`
|
|
604
604
|
${e=>F(e)} {
|
|
605
605
|
width: 100%;
|
|
606
606
|
height: auto;
|
|
607
607
|
max-height: 250px;
|
|
608
608
|
margin-bottom: 24px;
|
|
609
609
|
}
|
|
610
|
-
`;function
|
|
610
|
+
`;function Ii({stepData:e,appearance:t,setCanContinue:o}){return lp(()=>{o(!0)},[]),Ut.createElement(ap,{className:a("callToActionContainer",t)},Ut.createElement(dp,{className:a("callToActionTextContainer",t)},Ut.createElement(Fe,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Ut.createElement(pp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Ut.createElement(cp,{appearance:t,className:a("callToActionVideo",t)},Ut.createElement(Ve,{appearance:t,videoUri:e.videoUri})))}import Ze,{useEffect as fr,useState as gr}from"react";import at from"styled-components";var Ni=at.div`
|
|
611
611
|
width: auto;
|
|
612
612
|
display: flex;
|
|
613
613
|
flex-direction: column;
|
|
614
614
|
justify-content: center;
|
|
615
615
|
align-items: center;
|
|
616
616
|
padding: 4px;
|
|
617
|
-
`,
|
|
617
|
+
`,Oi=at.div`
|
|
618
618
|
width: 100%;
|
|
619
619
|
text-align: left;
|
|
620
|
-
`,
|
|
620
|
+
`,Li=at.h1`
|
|
621
621
|
font-style: normal;
|
|
622
622
|
font-weight: 700;
|
|
623
623
|
font-size: 32px;
|
|
624
624
|
line-height: 38px;
|
|
625
625
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
626
|
-
`,
|
|
626
|
+
`,Di=at.h1`
|
|
627
627
|
font-style: normal;
|
|
628
628
|
font-weight: 400;
|
|
629
629
|
font-size: 16px;
|
|
@@ -631,7 +631,7 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
631
631
|
margin-top: 16px;
|
|
632
632
|
margin-bottom: 16px;
|
|
633
633
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
634
|
-
|
|
634
|
+
`,$i=at.div`
|
|
635
635
|
padding-top: 12px;
|
|
636
636
|
padding-bottom: 12px;
|
|
637
637
|
flex-direction: row;
|
|
@@ -642,17 +642,17 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
642
642
|
cursor: pointer;
|
|
643
643
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
644
644
|
width: 100%;
|
|
645
|
-
`,
|
|
645
|
+
`,Mi=at.div`
|
|
646
646
|
padding-top: 10px;
|
|
647
647
|
padding-bottom: 10px;
|
|
648
648
|
flex-direction: row;
|
|
649
649
|
display: flex;
|
|
650
650
|
justify-content: flex-start;
|
|
651
|
-
`,
|
|
651
|
+
`,Ui=at.img`
|
|
652
652
|
width: 42px;
|
|
653
653
|
height: 42px;
|
|
654
654
|
margin-right: 12px;
|
|
655
|
-
|
|
655
|
+
`,zi=at.p`
|
|
656
656
|
font-style: normal;
|
|
657
657
|
font-weight: 500;
|
|
658
658
|
font-size: 17px;
|
|
@@ -660,8 +660,8 @@ import wt,{createContext as _p,useEffect as $o,useState as Oe}from"react";import
|
|
|
660
660
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
661
661
|
display: flex;
|
|
662
662
|
align-self: center;
|
|
663
|
-
`;var
|
|
664
|
-
${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map(([s,p])=>`${Jo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return io.createElement(o,{inlineStyles:t})}var Ui=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:a=!0,onStepCompletion:g,onButtonClick:d,dismissible:y=!0,endFlowOnDismiss:w=!1,modalPosition:C="center",repeatable:T=!1,onDismiss:f,showPagination:B=!1,allowBackNavigation:b=!1,validationHandler:S,showFrigadeBranding:A=!1,onFormDataChange:h,showFooter:m=!0,prefillData:E={}})=>{let{getFlow:k,getFlowSteps:P,isLoading:O,targetingLogicShouldHideFlow:N,getFlowStatus:I,getCurrentStepIndex:$,markFlowCompleted:D,markFlowNotStarted:ee}=Y(),U=$(e),{mergeAppearanceWithDefault:te}=Q(),[fe,X]=up(!1),{setOpenFlowState:H,getOpenFlowState:j,hasOpenModals:Ce}=we();c=te(c);let[Ne,be]=i!==void 0&&r!==void 0?[i,r]:[j(e,!0),re=>H(e,re)];if(mp(()=>{!fe&&!O&&(X(!0),I(e)===q&&T&&(ee(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(L=>{L.startsWith(pr)&&window.localStorage.removeItem(L)})),X(!0))},[fe,X,O]),O)return null;let me=k(e);if(!me||N(me))return null;let J=P(e);if(!J||i!==void 0&&i===!1||I(e)===q&&a||(o=="modal"||o=="corner-modal")&&Ce(e))return null;let ge=()=>{be(!1),f&&f(),w===!0&&D(e)};if(C=="center"&&o==="modal"||o==="large-modal"){let re={padding:"24px"};return o==="large-modal"?(re.width="85%",re.height="90%",re.maxHeight="800px",re.minHeight="500px",re.padding="0"):re.width="400px",Ge.createElement(He,{appearance:c,onClose:ge,visible:Ne,style:re,dismissible:y,showFrigadeBranding:A},Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:b,validationHandler:S,onFormDataChange:h,showFooter:m,prefillData:E}))}return o==="modal"&&C!=="center"?Ge.createElement(wo,{appearance:c,onClose:ge,visible:Ne,modalPosition:C},Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:b,validationHandler:S,onFormDataChange:h,showFooter:m,prefillData:E})):Ge.createElement(Ge.Fragment,null,Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:a,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:b,validationHandler:S,onFormDataChange:h,showFooter:m,prefillData:E}))},zi=Ui;import{useCallback as Wi,useContext as fp,useEffect as gp}from"react";function fr(){let{organizationId:e,userId:t,setOrganizationId:o}=fp(K),{mutateUserFlowState:i}=Be(),{config:r,apiUrl:n}=_e(),s=It(),{verifySDKInitiated:p}=Ot();gp(()=>{if(t&&e){if(t.startsWith(Lt))return;let g=`frigade-user-group-registered-${t}-${e}`;localStorage.getItem(g)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(g,"true"))}},[t,e]);let c=Wi(async g=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let d={foreignUserId:t,foreignUserGroupId:e,properties:g};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(d)}),i()},[e,t,r,i]),a=Wi(async(g,d)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationId:e,userId:t});return}let w={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:d}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(w)}),i()},[e,t,r,i]);return{organizationId:e,setOrganizationId:o,addPropertiesToOrganization:c,trackEventForOrganization:a}}var _i="frigade-xFrigade_guestUserId",no="frigade-xFrigade_userId",Hi=({})=>{let{setFlowResponses:e}=Xt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Be(),{userId:r,setUserId:n}=Jt(),[s,p]=gr(null),{getFlowStatus:c}=Y(),{flows:a,userProperties:g,setIsNewGuestUser:d,flowResponses:y}=xp(K),[w,C]=gr([]),[T,f]=gr([]),{organizationId:B}=fr();Lo(()=>{if(!o&&t)for(let h=0;h<t.length;h++){let m=t[h],E=a.find(k=>k.slug===(m==null?void 0:m.flowId));if(E&&m&&m.shouldTrigger===!0&&E.type=="FORM"&&E.triggerType==="AUTOMATIC"&&!T.includes(E.slug)){setTimeout(()=>{b(m.flowId)},500);break}}},[o,t]),Lo(()=>{y.length>0&&i()},[y]);function b(h){let m=a.find(E=>E.slug===h);m&&m.triggerType==="AUTOMATIC"&&!T.includes(m.slug)&&(f([...T,m.slug]),C([m]))}function S(){if(!r){let h=localStorage.getItem(no);if(h){n(h);return}let m=localStorage.getItem(_i);if(m){n(m);return}d(!0);let E=Lt+hp();try{localStorage.setItem(_i,E)}catch(k){console.log("Failed to save guest user id locally: Local storage unavailable",k)}n(k=>k||E)}}Lo(()=>{try{if(a){let h=[];a.forEach(m=>{if(m.data){let E=m.data.match(/"imageUri":"(.*?)"/g);E&&E.forEach(k=>{let P=k.replace('"imageUri":"',"").replace('"',"");if(h.includes(P))return;let O=new Image;O.src=P,h.push(P)})}})}}catch{}},[a]),Lo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Lt))try{localStorage.setItem(no,r)}catch(h){console.log("Failed to save user id locally: Local storage available",h)}r===null&&setTimeout(()=>{r===null&&S()},50)},[r,a,g]);function A(){return bt.createElement(bt.Fragment,null,w.map(h=>c(h.slug)!==Me?null:bt.createElement("span",{key:h.slug},bt.createElement(zi,{flowId:h.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return bt.createElement(bt.Fragment,null,bt.createElement(A,null))};import{ErrorBoundary as jp}from"react-error-boundary";import so from"core-js-pure/actual/structured-clone";function xr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pt(...e){let t=e.shift(),o=e.length===1?e[0]:pt(...e);if(!xr(t)||!xr(o))throw new Error("deepmerge can only merge Objects");let i=so(t);return Object.entries(o).forEach(([r,n])=>{xr(n)?i[r]!==void 0?Object.assign(i,{[r]:pt(i[r],so(n))}):Object.assign(i,{[r]:so(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...so(n)]}):Object.assign(i,{[r]:so(n)}):Object.assign(i,{[r]:n})}),i}var ji={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 Cp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(ji[o]){let r=ji[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function yp(e){if(!e)return;let t=pt({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function Vi(e){let{theme:t,styleOverrides:o}=e,i=Cp(t),r=yp(o);return{overrides:i,css:r}}import Op from"styled-components";import{compose as Lp,variant as Ki}from"styled-system";import Gi from"react";import Sp,{ThemeProvider as bp,useTheme as wp}from"styled-components";import{border as Tp,color as Fp,compose as kp,get as Pp,shadow as vp,space as Bp,system as Ep,typography as Ap}from"styled-system";var Np={width:{property:"width",scale:"sizes",transform:(e,t)=>Pp(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},Ip=Sp("div")(({css:e})=>e,kp(Tp,Fp,vp,Bp,Ap,Ep(Np))),lo=({as:e,children:t,overrides:o,...i})=>{let r=wp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>Gi.createElement(Ip,{as:e,...n,...i},t);if(o!==void 0){let p=pt(r,o);return Gi.createElement(bp,{theme:p},s())}return s()};var ao={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"}},Dp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},qi=Op(lo)(()=>({whiteSpace:"nowrap"}),Lp(Ki({scale:"components.Button",variants:"components.Button"}),Ki({prop:"size",variants:Dp})));import $p from"styled-components";import{variant as Mp,system as Up}from"styled-system";var Do={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 Yi=$p(lo)(Mp({scale:"components.Text",variants:"components.Text"}),Up({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Xi=4,Ji="px",zp=20,Wp=Object.fromEntries(Array.from(Array(zp+1),(e,t)=>t===0?[.5,`${.5*Xi}${Ji}`]:[t,`${t*Xi}${Ji}`])),zt={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"},hr={colors:{...zt,neutral:{foreground:zt.gray300},primary:{background:zt.blue500,foreground:zt.white,inverted:zt.blue500},negative:{foreground:zt.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:Wp,components:{Button:ao,Text:Do}};var Qi="https://api.frigade.com",K=_p({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:Je,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Qi,readonly:!1});function Vp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Gp=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var fe,X;let[n,s]=Oe(t||null),[p,c]=Oe(o||null),[a,g]=Oe([]),[d,y]=Oe([]),[w,C]=Oe([]),[T,f]=Oe({}),[B,b]=Oe({}),[S,A]=Oe([]),[h,m]=Oe({}),[E,k]=Oe(!1),[P,O]=Oe(!1),[N,I]=Oe(!ee(e)),$=(H,j)=>{if(j==="_blank"){window.open(H,"_blank");return}setTimeout(()=>{window.location.href=H},50)},D={theme:{...Je.theme,...((fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.theme)??{}},styleOverrides:{...Je.styleOverrides,...((X=i==null?void 0:i.defaultAppearance)==null?void 0:X.styleOverrides)??{}}};function ee(H){return!!(H&&H.length>10&&H.substring(0,10)==="api_public")}$o(()=>{t&&s(t)},[t]),$o(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(no)&&window.localStorage.getItem(no)!==n&&Vp()},[n]),$o(()=>{o&&c(o)},[o]),$o(()=>{if(ee(e))I(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),I(!0);return}},[e,I]);let U={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:a,failedFlowResponses:d,setFailedFlowResponses:y,flowResponses:w,setFlowResponses:C,userProperties:T,setUserProperties:f,openFlowStates:B,setOpenFlowStates:b,completedFlowsToKeepOpenDuringSession:S,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:h,setCustomVariables:m,isNewGuestUser:E,setIsNewGuestUser:k,hasActiveFullPageFlow:P,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:$,defaultAppearance:D,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:I,apiUrl:i&&i.apiUrl?i.apiUrl:Qi,readonly:i&&i.readonly?i.readonly:!1};if(N)return wt.createElement(K.Provider,{value:U},r);let{overrides:te}=Vi(D);return wt.createElement(jp,{fallback:wt.createElement(wt.Fragment,null,r)},wt.createElement(K.Provider,{value:U},wt.createElement(Hp,{theme:pt(D.theme,hr,te??{},(i==null?void 0:i.theme)??{})},r,wt.createElement(Hi,null))))};import Ld from"react";import ce,{useEffect as vs,useState as Bs}from"react";import We,{useState as pd}from"react";import kt from"styled-components";import zo from"react";import Tt from"react";import Ri from"styled-components";var Zi=Ri.span`
|
|
663
|
+
`;var Wi=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let r=e.props,[n,s]=gr([]),[p,c]=gr(!1),[l,g]=gr(e.id);return fr(()=>{n.length==0&&!p&&(c(!0),o({choice:[]}))},[p]),fr(()=>{l!==e.id&&(g(e.id),s([]))},[e]),fr(()=>{o({choice:n}),n.length>=r.minChoices?t(!0):t(!1)},[n]),Ze.createElement(Ni,{className:a("selectListContainer",i)},Ze.createElement(Oi,null,Ze.createElement(Li,{className:a("selectListTitle",i)},e.title),Ze.createElement(Di,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),r.options.map((d,x)=>{let b=n.includes(d.id);return Ze.createElement($i,{key:`select-item-${x}`,onClick:()=>{if(n.includes(d.id)){s(n.filter(h=>h!==d.id));return}n.length<r.maxChoices?s([...n,d.id]):n.length==1&&r.maxChoices==1&&s([d.id])},hideBottomBorder:x===r.options.length-1,className:a("selectListSelectItem",i)},Ze.createElement(Mi,{className:a("selectListItemImage",i)},d.imageUri&&Ze.createElement(Ui,{src:d.imageUri,alt:`select-icon-${x}`}),Ze.createElement(zi,{appearance:i,className:a("selectListSelectItemText",i)},d.title)),Ze.createElement(Qe,{appearance:i,value:b,primaryColor:i.theme.colorPrimary}))}))};import Pe,{useEffect as No,useState as ro}from"react";var mp=({children:e,id:t,shouldWrap:o=!1})=>Pe.createElement(Pe.Fragment,null,o?Pe.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Oo=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:r,onButtonClick:n,onStepCompletion:s,flowId:p,type:c,hideOnFlowCompletion:l,onComplete:g,setVisible:d,setShowModal:x,onDismiss:b,showPagination:h=!1,customFormElements:T,allowBackNavigation:f,validationHandler:B,onFormDataChange:w,showFooter:S,prefillData:A})=>{var V;let m={...{linkCollection:Ai,multiInput:yi,callToAction:Ii,selectList:Wi},...i},{primaryCTAClickSideEffects:E,secondaryCTAClickSideEffects:k}=ie(),[P,O]=ro(!1),[I,N]=ro({}),[$,D]=ro(!1),[ee,U]=ro(!1),[te,fe]=ro(null),X=t[o]??null,{markStepCompleted:H,markStepStarted:j,isLoading:Ce,updateCustomVariables:Ie,markFlowCompleted:be}=Y();No(()=>{Ie(r)},[r,Ce]),No(()=>{w&&w(I,me(),t[o],o)},[I]),No(()=>{window&&f&&!ee&&(window.location.hash=t[o].id,U(!0))},[f,ee,U]),No(()=>{var G;if(window&&((G=window==null?void 0:window.location)!=null&&G.hash)&&window.location.hash.replace("#","")!==t[o].id){let ne=window.location.hash.replace("#",""),se=t.findIndex(pe=>pe.id===ne);se!==-1&&j(p,t[se].id)}},[(V=window==null?void 0:window.location)==null?void 0:V.hash,j,o,t]);function me(){return{data:I[t[o].id]??{},stepId:t[o].id,customVariables:r}}function J(G,ne,se){let pe=o+1<t.length?t[o+1]:null;return s&&s(G,se,pe,I,me()),n?n(G,o,ne,pe):!0}function ge(G,ne){N(se=>{let pe={};return pe[G.id]=ne,{...se,...pe}})}function re(G){return G.selectedStep.imageUri?Pe.createElement(Pi,{image:G.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let L=S&&Pe.createElement(Bi,{step:t[o],canContinue:P&&!$,formType:c,selectedStep:o,appearance:e,onPrimaryClick:async()=>{if(D(!0),B){let se=await B(t[o],o,t[o+1],I,me());if(se||se===!1){fe(typeof se=="string"?se:null),D(!1);return}else fe(null)}let G={...me()};await H(p,t[o].id,G),o+1<t.length&&await j(p,t[o+1].id);let ne=J(t[o],"primary",o);o+1>=t.length&&(g&&g(),b&&b(),l&&ne&&(d&&d(!1),x(!1)),await be(p)),E(t[o]),D(!1),window&&f&&o+1<t.length&&(window.location.hash=t[o+1].id)},onSecondaryClick:()=>{J(t[o],"secondary",o),k(t[o])},onBack:async()=>{o-1>=0&&(D(!0),await j(p,t[o-1].id),D(!1))},steps:t,allowBackNavigation:f,errorMessage:te});return Pe.createElement(Pe.Fragment,null,Pe.createElement(Ti,{className:a("formContainer",e)},Pe.createElement(Fi,null,Pe.createElement(mp,{id:o,shouldWrap:c==="large-modal"},Pe.createElement(ki,{key:X.id,type:c,className:a("formContent",e)},t.map(G=>{let ne=m[G.type];return X.id!==G.id?null:Pe.createElement(ne,{key:G.id,stepData:G,canContinue:P,setCanContinue:O,onSaveData:se=>{ge(G,se)},appearance:e,customFormElements:T,flowId:p,prefillData:A})}),h&&Pe.createElement(Ei,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),L))),c=="large-modal"&&Pe.createElement(re,{selectedStep:t[o]})))};import io from"react";import{createGlobalStyle as up}from"styled-components";function oe({appearance:e}){if(!e||!e.styleOverrides)return io.createElement(io.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([i,r])=>typeof r=="object");if(t.length===0)return io.createElement(io.Fragment,null);let o=up`
|
|
664
|
+
${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map(([s,p])=>`${Jo(s)}: ${p};`).join(" ")} }`).join(" ")}`;return io.createElement(o,{inlineStyles:t})}var _i=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:r,customVariables:n,customFormElements:s,onComplete:p,appearance:c,hideOnFlowCompletion:l=!0,onStepCompletion:g,onButtonClick:d,dismissible:x=!0,endFlowOnDismiss:b=!1,modalPosition:h="center",repeatable:T=!1,onDismiss:f,showPagination:B=!1,allowBackNavigation:w=!1,validationHandler:S,showFrigadeBranding:A=!1,onFormDataChange:y,showFooter:m=!0,prefillData:E={}})=>{let{getFlow:k,getFlowSteps:P,isLoading:O,targetingLogicShouldHideFlow:I,getFlowStatus:N,getCurrentStepIndex:$,markFlowCompleted:D,markFlowNotStarted:ee}=Y(),U=$(e),{mergeAppearanceWithDefault:te}=Q(),[fe,X]=gp(!1),{setOpenFlowState:H,getOpenFlowState:j,hasOpenModals:Ce}=we();c=te(c);let[Ie,be]=i!==void 0&&r!==void 0?[i,r]:[j(e,!0),re=>H(e,re)];if(fp(()=>{!fe&&!O&&(X(!0),N(e)===q&&T&&(ee(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(L=>{L.startsWith(cr)&&window.localStorage.removeItem(L)})),X(!0))},[fe,X,O]),O)return null;let me=k(e);if(!me||I(me))return null;let J=P(e);if(!J||i!==void 0&&i===!1||N(e)===q&&l||(o=="modal"||o=="corner-modal")&&Ce(e))return null;let ge=()=>{be(!1),f&&f(),b===!0&&D(e)};if(h=="center"&&o==="modal"||o==="large-modal"){let re={padding:"24px"};return o==="large-modal"?(re.width="85%",re.height="90%",re.maxHeight="800px",re.minHeight="500px",re.padding="0"):re.width="400px",Ge.createElement(He,{appearance:c,onClose:ge,visible:Ie,style:re,dismissible:x,showFrigadeBranding:A},Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:S,onFormDataChange:y,showFooter:m,prefillData:E}))}return o==="modal"&&h!=="center"?Ge.createElement(wo,{appearance:c,onClose:ge,visible:Ie,modalPosition:h},Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:S,onFormDataChange:y,showFooter:m,prefillData:E})):Ge.createElement(Ge.Fragment,null,Ge.createElement(oe,{appearance:c}),Ge.createElement(Oo,{appearance:c,steps:J,selectedStep:U,customStepTypes:t,customVariables:n,onButtonClick:d,onStepCompletion:g,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:r,setShowModal:be,onDismiss:f,showPagination:B,customFormElements:s,allowBackNavigation:w,validationHandler:S,onFormDataChange:y,showFooter:m,prefillData:E}))},Hi=_i;import{useCallback as xr,useContext as xp,useEffect as hp}from"react";function hr(){let{organizationId:e,userId:t,setOrganizationId:o}=xp(K),{mutateUserFlowState:i}=Be(),{config:r,apiUrl:n}=_e(),s=Nt(),{verifySDKInitiated:p}=Ot();function c(x,b){return`frigade-user-group-registered-${x}-${b}`}hp(()=>{if(t&&e){if(t.startsWith(Lt))return;let x=c(t,e);localStorage.getItem(x)||(s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})}),localStorage.setItem(x,"true"))}},[t,e]);let l=xr(async x=>{if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let b={foreignUserId:t,foreignUserGroupId:e,properties:x};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(b)}),i()},[e,t,r,i]),g=xr(async(x,b)=>{if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let T={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:b}]};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(T)}),i()},[e,t,r,i]),d=xr(async(x,b)=>{if(p())if(b){let h=c(t,x);localStorage.setItem(h,"true"),o(x);let T={foreignUserId:t,foreignUserGroupId:x,properties:b};await s(`${n}userGroups`,{...r,method:"POST",body:JSON.stringify(T)}),i()}else o(x)},[t,r,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:d,addPropertiesToOrganization:l,trackEventForOrganization:g}}var ji="frigade-xFrigade_guestUserId",no="frigade-xFrigade_userId",Vi=({})=>{let{setFlowResponses:e}=Xt(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Be(),{userId:r,setUserId:n}=Jt(),[s,p]=Cr(null),{getFlowStatus:c}=Y(),{flows:l,userProperties:g,setIsNewGuestUser:d,flowResponses:x}=Cp(K),[b,h]=Cr([]),[T,f]=Cr([]),{organizationId:B}=hr();Lo(()=>{if(!o&&t)for(let y=0;y<t.length;y++){let m=t[y],E=l.find(k=>k.slug===(m==null?void 0:m.flowId));if(E&&m&&m.shouldTrigger===!0&&E.type=="FORM"&&E.triggerType==="AUTOMATIC"&&!T.includes(E.slug)){setTimeout(()=>{w(m.flowId)},500);break}}},[o,t]),Lo(()=>{x.length>0&&i()},[x]);function w(y){let m=l.find(E=>E.slug===y);m&&m.triggerType==="AUTOMATIC"&&!T.includes(m.slug)&&(f([...T,m.slug]),h([m]))}function S(){if(!r){let y=localStorage.getItem(no);if(y){n(y);return}let m=localStorage.getItem(ji);if(m){n(m);return}d(!0);let E=Lt+yp();try{localStorage.setItem(ji,E)}catch(k){console.log("Failed to save guest user id locally: Local storage unavailable",k)}n(k=>k||E)}}Lo(()=>{try{if(l){let y=[];l.forEach(m=>{if(m.data){let E=m.data.match(/"imageUri":"(.*?)"/g);E&&E.forEach(k=>{let P=k.replace('"imageUri":"',"").replace('"',"");if(y.includes(P))return;let O=new Image;O.src=P,y.push(P)})}})}}catch{}},[l]),Lo(()=>{if(r!==s&&e([]),p(r),r&&!r.startsWith(Lt))try{localStorage.setItem(no,r)}catch(y){console.log("Failed to save user id locally: Local storage available",y)}r===null&&setTimeout(()=>{r===null&&S()},50)},[r,l,g]);function A(){return bt.createElement(bt.Fragment,null,b.map(y=>c(y.slug)!==Me?null:bt.createElement("span",{key:y.slug},bt.createElement(Hi,{flowId:y.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return bt.createElement(bt.Fragment,null,bt.createElement(A,null))};import{ErrorBoundary as Gp}from"react-error-boundary";import so from"core-js-pure/actual/structured-clone";function yr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function pt(...e){let t=e.shift(),o=e.length===1?e[0]:pt(...e);if(!yr(t)||!yr(o))throw new Error("deepmerge can only merge Objects");let i=so(t);return Object.entries(o).forEach(([r,n])=>{yr(n)?i[r]!==void 0?Object.assign(i,{[r]:pt(i[r],so(n))}):Object.assign(i,{[r]:so(n)}):Array.isArray(n)?i[r]!==void 0?Object.assign(i,{[r]:[...i[r],...so(n)]}):Object.assign(i,{[r]:so(n)}):Object.assign(i,{[r]:n})}),i}var Gi={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 Sp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Gi[o]){let r=Gi[o].split("."),n=t;r.forEach((s,p)=>{n[s]||(n[s]=p===r.length-1?i:{}),n=n[s]})}}),t}function bp(e){if(!e)return;let t=pt({},e),o={};return Object.keys(t).forEach(i=>{let r=`.fr-${i}`;o[r]=t[i]}),o}function Ki(e){let{theme:t,styleOverrides:o}=e,i=Sp(t),r=bp(o);return{overrides:i,css:r}}import Dp from"styled-components";import{compose as $p,variant as Yi}from"styled-system";import qi from"react";import wp,{ThemeProvider as Tp,useTheme as Fp}from"styled-components";import{border as kp,color as Pp,compose as vp,get as Bp,shadow as Ep,space as Ap,system as Ip,typography as Np}from"styled-system";var Op={width:{property:"width",scale:"sizes",transform:(e,t)=>Bp(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},Lp=wp("div")(({css:e})=>e,vp(kp,Pp,Ep,Ap,Np,Ip(Op))),lo=({as:e,children:t,overrides:o,...i})=>{let r=Fp(),n={border:"none",boxSizing:"border-box",m:0,p:0},s=()=>qi.createElement(Lp,{as:e,...n,...i},t);if(o!==void 0){let p=pt(r,o);return qi.createElement(Tp,{theme:p},s())}return s()};var ao={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"}},Mp={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Xi=Dp(lo)(()=>({whiteSpace:"nowrap"}),$p(Yi({scale:"components.Button",variants:"components.Button"}),Yi({prop:"size",variants:Mp})));import Up from"styled-components";import{variant as zp,system as Wp}from"styled-system";var Do={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 Ji=Up(lo)(zp({scale:"components.Text",variants:"components.Text"}),Wp({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Qi=4,Zi="px",_p=20,Hp=Object.fromEntries(Array.from(Array(_p+1),(e,t)=>t===0?[.5,`${.5*Qi}${Zi}`]:[t,`${t*Qi}${Zi}`])),zt={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"},Sr={colors:{...zt,neutral:{foreground:zt.gray300},primary:{background:zt.blue500,foreground:zt.white,inverted:zt.blue500},negative:{foreground:zt.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:Hp,components:{Button:ao,Text:Do}};var Ri="https://api.frigade.com",K=jp({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:Je,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Ri,readonly:!1});function Kp(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var qp=({publicApiKey:e,userId:t,organizationId:o,config:i,children:r})=>{var fe,X;let[n,s]=Oe(t||null),[p,c]=Oe(o||null),[l,g]=Oe([]),[d,x]=Oe([]),[b,h]=Oe([]),[T,f]=Oe({}),[B,w]=Oe({}),[S,A]=Oe([]),[y,m]=Oe({}),[E,k]=Oe(!1),[P,O]=Oe(!1),[I,N]=Oe(!ee(e)),$=(H,j)=>{if(j==="_blank"){window.open(H,"_blank");return}setTimeout(()=>{window.location.href=H},50)},D={theme:{...Je.theme,...((fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.theme)??{}},styleOverrides:{...Je.styleOverrides,...((X=i==null?void 0:i.defaultAppearance)==null?void 0:X.styleOverrides)??{}}};function ee(H){return!!(H&&H.length>10&&H.substring(0,10)==="api_public")}$o(()=>{t&&s(t)},[t]),$o(()=>{n&&window&&window.localStorage&&window.localStorage.getItem(no)&&window.localStorage.getItem(no)!==n&&Kp()},[n]),$o(()=>{o&&c(o)},[o]),$o(()=>{if(ee(e))N(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),N(!0);return}},[e,N]);let U={publicApiKey:e,userId:n,setUserId:s,setFlows:g,flows:l,failedFlowResponses:d,setFailedFlowResponses:x,flowResponses:b,setFlowResponses:h,userProperties:T,setUserProperties:f,openFlowStates:B,setOpenFlowStates:w,completedFlowsToKeepOpenDuringSession:S,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:y,setCustomVariables:m,isNewGuestUser:E,setIsNewGuestUser:k,hasActiveFullPageFlow:P,setHasActiveFullPageFlow:O,organizationId:p,setOrganizationId:c,navigate:i&&i.navigate?i.navigate:$,defaultAppearance:D,shouldGracefullyDegrade:I,setShouldGracefullyDegrade:N,apiUrl:i&&i.apiUrl?i.apiUrl:Ri,readonly:i&&i.readonly?i.readonly:!1};if(I)return wt.createElement(K.Provider,{value:U},r);let{overrides:te}=Ki(D);return wt.createElement(Gp,{fallback:wt.createElement(wt.Fragment,null,r)},wt.createElement(K.Provider,{value:U},wt.createElement(Vp,{theme:pt(D.theme,Sr,te??{},(i==null?void 0:i.theme)??{})},r,wt.createElement(Vi,null))))};import $d from"react";import ce,{useEffect as Es,useState as As}from"react";import We,{useState as cd}from"react";import kt from"styled-components";import zo from"react";import Tt from"react";import tn from"styled-components";var en=tn.span`
|
|
665
665
|
font-weight: 600;
|
|
666
666
|
font-size: 14px;
|
|
667
667
|
font-style: normal;
|
|
@@ -673,7 +673,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
673
673
|
margin-left: 32px;
|
|
674
674
|
padding-right: 12px;
|
|
675
675
|
${e=>ke(e)}
|
|
676
|
-
`,
|
|
676
|
+
`,Yp=tn.div`
|
|
677
677
|
flex-direction: row;
|
|
678
678
|
justify-content: space-between;
|
|
679
679
|
display: flex;
|
|
@@ -682,11 +682,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
682
682
|
padding-right: 8px;
|
|
683
683
|
width: 100%;
|
|
684
684
|
${e=>ke(e)}
|
|
685
|
-
`,Mo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>Tt.createElement(Tt.Fragment,null,Tt.createElement(
|
|
685
|
+
`,Mo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:r,primaryColor:n="#000000",checkBoxType:s="round",appearance:p})=>Tt.createElement(Tt.Fragment,null,Tt.createElement(Yp,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:{...r}},i==="left"&&e&&Tt.createElement(en,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),Tt.createElement(Qe,{appearance:p,value:t,type:s,primaryColor:n}),i==="right"&&e&&Tt.createElement(en,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),Tt.createElement(oe,{appearance:p}));import po from"styled-components";var on=po.div`
|
|
686
686
|
font-weight: 700;
|
|
687
687
|
font-size: 18px;
|
|
688
688
|
line-height: 22px;
|
|
689
|
-
`,
|
|
689
|
+
`,rn=po.p`
|
|
690
690
|
font-weight: 600;
|
|
691
691
|
font-size: 16px;
|
|
692
692
|
line-height: 24px;
|
|
@@ -694,7 +694,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
694
694
|
letter-spacing: 0.32px;
|
|
695
695
|
font-style: normal;
|
|
696
696
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
697
|
-
`,
|
|
697
|
+
`,nn=po.p`
|
|
698
698
|
font-weight: 400;
|
|
699
699
|
font-size: 14px;
|
|
700
700
|
font-style: normal;
|
|
@@ -710,38 +710,38 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
710
710
|
height: 100%;
|
|
711
711
|
border-top-right-radius: 4px;
|
|
712
712
|
border-bottom-right-radius: 4px;
|
|
713
|
-
`,
|
|
713
|
+
`,sn=po.div`
|
|
714
714
|
flex-direction: row;
|
|
715
715
|
justify-content: flex-start;
|
|
716
716
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
717
717
|
padding-right: 16px;
|
|
718
|
-
`;var
|
|
718
|
+
`;var ln=({data:e,index:t,isSelected:o,primaryColor:i,style:r,onClick:n,appearance:s})=>{var p,c;return zo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{n()}},o&&zo.createElement(Uo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:((p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)??i}}),zo.createElement(sn,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},zo.createElement(Mo,{value:e.complete,labelPosition:"left",label:e.stepName??e.title,style:r,primaryColor:((c=s==null?void 0:s.theme)==null?void 0:c.colorPrimary)??i,appearance:s})))};import Ft from"react";import br from"styled-components";import Re from"styled-components";var sh=Re.div`
|
|
719
719
|
background: #ffffff;
|
|
720
720
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
721
721
|
border-radius: 20px;
|
|
722
722
|
width: 385px;
|
|
723
723
|
padding: 24px 16px 16px 16px;
|
|
724
|
-
`,
|
|
724
|
+
`,lh=Re.div`
|
|
725
725
|
/* Border bottom only on collapsable */
|
|
726
|
-
`,
|
|
726
|
+
`,ah=Re.div`
|
|
727
727
|
display: flex;
|
|
728
728
|
flex-direction: row;
|
|
729
729
|
justify-content: space-between;
|
|
730
730
|
align-content: flex-start;
|
|
731
|
-
`,
|
|
731
|
+
`,ph=Re.h1`
|
|
732
732
|
display: flex;
|
|
733
733
|
margin: 0;
|
|
734
734
|
font-size: 18px;
|
|
735
|
-
`,
|
|
735
|
+
`,dh=Re.h2`
|
|
736
736
|
font-size: 15px;
|
|
737
737
|
color: #4d4d4d;
|
|
738
|
-
`,
|
|
738
|
+
`,ch=Re.ul`
|
|
739
739
|
list-style: none;
|
|
740
|
-
`,
|
|
740
|
+
`,mh=Re.li`
|
|
741
741
|
display: flex;
|
|
742
742
|
justify-content: flex-start;
|
|
743
743
|
flex-direction: row;
|
|
744
|
-
`,
|
|
744
|
+
`,an=Re.div`
|
|
745
745
|
position: absolute;
|
|
746
746
|
left: 0;
|
|
747
747
|
top: 0;
|
|
@@ -749,7 +749,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
749
749
|
width: ${e=>e.fgWidth};
|
|
750
750
|
border-radius: 20px;
|
|
751
751
|
background-color: ${e=>e.theme.colorPrimary};
|
|
752
|
-
`,
|
|
752
|
+
`,pn=Re.div`
|
|
753
753
|
position: relative;
|
|
754
754
|
left: 0;
|
|
755
755
|
top: 0;
|
|
@@ -759,7 +759,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
759
759
|
border-radius: 20px;
|
|
760
760
|
background-color: ${e=>e.theme.colorPrimary};
|
|
761
761
|
opacity: 0.12;
|
|
762
|
-
`;var
|
|
762
|
+
`;var Xp=br.div`
|
|
763
763
|
display: flex;
|
|
764
764
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
765
765
|
justify-content: flex-start;
|
|
@@ -767,11 +767,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
767
767
|
width: 100%;
|
|
768
768
|
|
|
769
769
|
${e=>ke(e)}
|
|
770
|
-
`,
|
|
770
|
+
`,Jp=br.div`
|
|
771
771
|
flex-grow: 1;
|
|
772
772
|
position: relative;
|
|
773
773
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
774
|
-
`,
|
|
774
|
+
`,Qp=br.span`
|
|
775
775
|
font-weight: 600;
|
|
776
776
|
font-size: 14px;
|
|
777
777
|
line-height: 18px;
|
|
@@ -779,13 +779,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
779
779
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
780
780
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
781
781
|
${e=>ke(e)}
|
|
782
|
-
`;var Le=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Ft.createElement(Ft.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",
|
|
782
|
+
`;var Le=({count:e,total:t,display:o="count",textLocation:i="left",style:r={},textStyle:n={},appearance:s})=>{if(t===0)return Ft.createElement(Ft.Fragment,null);let p=e===0?"10px":`${e/t*100}%`,c=o==="compact"?"5px":"10px",l=Math.round(e/t*100),g=o==="compact"?"5px":"14px",d;return o==="count"?d=`${e}/${t}`:o==="compact"?d=`${l}%`:o==="percent"&&(d=`${l}% complete`),i==="top"&&(g="0px"),Ft.createElement(Xp,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:r},Ft.createElement(Qp,{className:a("progressBarStepText",s),style:{...n,fontSize:o==="compact"?12:14,fontWeight:o==="compact"?400:600},appearance:s,padding:g,textLocation:i},d),Ft.createElement(Jp,{textLocation:i,className:a("progressBar",s)},Ft.createElement(an,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:c,appearance:s,className:a("progressBarFill",s)}),Ft.createElement(pn,{className:a("progressBarBackground",s),barHeight:c,appearance:s})))};import co from"react";import Rp from"styled-components";import _o from"react";import Wo from"react";var Wt=({stepData:e,appearance:t})=>Wo.createElement(Wo.Fragment,null,Wo.createElement(rn,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:le(e.title)}),Wo.createElement(nn,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:le(e.subtitle)}));import wr from"react";var _t=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return wr.createElement(Bo,{className:a("ctaContainer",t)},wr.createElement(Z,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&wr.createElement(Z,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var Ht=({stepData:e,appearance:t})=>_o.createElement(_o.Fragment,null,_o.createElement(Wt,{stepData:e,appearance:t}),_o.createElement(_t,{stepData:e,appearance:t}));import Zp from"react";function dn(e){return Zp.createElement(Ve,{appearance:e.appearance,videoUri:e.videoUri})}var Tr="default",ed=Rp.img`
|
|
783
783
|
border-radius: 4px;
|
|
784
784
|
max-height: 260px;
|
|
785
785
|
min-height: 200px;
|
|
786
|
-
`,
|
|
786
|
+
`,cn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return co.createElement("div",null,o)}return co.createElement(on,{className:a("checklistStepContent",t)},e.imageUri?co.createElement(ed,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?co.createElement(dn,{videoUri:e.videoUri,appearance:t}):null,co.createElement(Ht,{stepData:e,appearance:t}))};import Ee,{useRef as td,useState as od}from"react";import jt from"styled-components";var mn=jt.div`
|
|
787
787
|
display: block;
|
|
788
|
-
`,
|
|
788
|
+
`,rd=jt.div`
|
|
789
789
|
display: flex;
|
|
790
790
|
flex-direction: row;
|
|
791
791
|
flex-wrap: wrap;
|
|
@@ -795,20 +795,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
795
795
|
align-content: center;
|
|
796
796
|
margin-top: 24px;
|
|
797
797
|
margin-bottom: 24px;
|
|
798
|
-
`,
|
|
798
|
+
`,id=jt.div`
|
|
799
799
|
display: flex;
|
|
800
800
|
align-items: center;
|
|
801
801
|
justify-content: flex-start;
|
|
802
802
|
flex-direction: column;
|
|
803
803
|
margin-right: 16px;
|
|
804
|
-
`,
|
|
804
|
+
`,nd=jt.video`
|
|
805
805
|
width: 200px;
|
|
806
806
|
height: 120px;
|
|
807
|
-
`,
|
|
807
|
+
`,sd=jt.div`
|
|
808
808
|
font-size: 14px;
|
|
809
809
|
line-height: 20px;
|
|
810
810
|
text-align: center;
|
|
811
|
-
`,
|
|
811
|
+
`,ld=jt.div`
|
|
812
812
|
position: absolute;
|
|
813
813
|
width: 200px;
|
|
814
814
|
height: 120px;
|
|
@@ -828,9 +828,9 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
828
828
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
829
829
|
border-radius: 50%;
|
|
830
830
|
}
|
|
831
|
-
`,
|
|
831
|
+
`,un="videoCarousel",fn=({stepData:e,appearance:t})=>{var r;if(!((r=e.props)!=null&&r.videos))return Ee.createElement(mn,null,Ee.createElement(Ht,{stepData:e,appearance:t}));function o({video:n}){let s=td(),[p,c]=od(!1);return Ee.createElement(id,null,!p&&Ee.createElement(ld,{onClick:()=>{c(!0),s.current.play()},appearance:t},Ee.createElement(Eo,null)),Ee.createElement(nd,{controls:p,ref:s,play:p,src:n.uri}),Ee.createElement(sd,null,n.title))}let i=e.props;return i.videos?Ee.createElement(mn,null,Ee.createElement(Wt,{stepData:e,appearance:t}),Ee.createElement(rd,null,i.videos.map((n,s)=>Ee.createElement("span",{key:`${n.uri}-${s}`},Ee.createElement(o,{video:n})))),Ee.createElement(_t,{stepData:e,appearance:t})):null};import et from"react";import Ho from"styled-components";var gn=Ho.div`
|
|
832
832
|
display: block;
|
|
833
|
-
`,
|
|
833
|
+
`,ad=Ho.pre`
|
|
834
834
|
display: block;
|
|
835
835
|
background-color: #2a2a2a;
|
|
836
836
|
color: #f8f8f8;
|
|
@@ -846,14 +846,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
846
846
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
847
847
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
848
848
|
margin-bottom: 24px;
|
|
849
|
-
`,
|
|
849
|
+
`,pd=Ho.div`
|
|
850
850
|
font-size: 15px;
|
|
851
851
|
line-height: 20px;
|
|
852
852
|
margin-bottom: 12px;
|
|
853
853
|
margin-top: 12px;
|
|
854
|
-
`,
|
|
854
|
+
`,dd=Ho.div`
|
|
855
855
|
margin-top: 24px;
|
|
856
|
-
`,
|
|
856
|
+
`,xn="codeSnippet",hn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return et.createElement(gn,null,et.createElement(Ht,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?et.createElement(gn,null,et.createElement(Wt,{stepData:e,appearance:t}),et.createElement(dd,null,o.codeSnippets.map((r,n)=>et.createElement("div",{key:n},r.title?et.createElement(pd,null,r.title):null,r.code?et.createElement(ad,null,r.code):null))),et.createElement(_t,{stepData:e,appearance:t})):null};var md=kt.div`
|
|
857
857
|
display: flex;
|
|
858
858
|
flex-direction: row;
|
|
859
859
|
overflow: hidden;
|
|
@@ -861,14 +861,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
861
861
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
862
862
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
863
863
|
${e=>ke(e)}
|
|
864
|
-
`,
|
|
864
|
+
`,ud=kt.h1`
|
|
865
865
|
font-size: 18px;
|
|
866
866
|
font-style: normal;
|
|
867
867
|
font-weight: 700;
|
|
868
868
|
line-height: 24px;
|
|
869
869
|
letter-spacing: 0.36px;
|
|
870
870
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
871
|
-
`,
|
|
871
|
+
`,fd=kt.h2`
|
|
872
872
|
font-size: 14px;
|
|
873
873
|
font-style: normal;
|
|
874
874
|
font-weight: 400;
|
|
@@ -876,43 +876,43 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
876
876
|
letter-spacing: 0.28px;
|
|
877
877
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
878
878
|
margin: 10px 0px 0px 0px;
|
|
879
|
-
`,
|
|
879
|
+
`,Cn=kt.div``,gd=kt.div`
|
|
880
880
|
list-style: none;
|
|
881
881
|
padding: 0;
|
|
882
882
|
margin: 0;
|
|
883
883
|
cursor: pointer;
|
|
884
884
|
width: 300px;
|
|
885
|
-
`,
|
|
885
|
+
`,xd=kt.div`
|
|
886
886
|
width: 1px;
|
|
887
887
|
margin-right: 40px;
|
|
888
888
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
889
|
-
`,
|
|
889
|
+
`,hd=kt.div`
|
|
890
890
|
flex: 2;
|
|
891
891
|
padding: 2rem 2rem 2rem 0rem;
|
|
892
|
-
`,
|
|
892
|
+
`,Cd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:r,setSelectedStep:n,className:s="",customStepTypes:p=new Map,appearance:c,type:l})=>{let{mergeAppearanceWithDefault:g}=Q();c=g(c);let x={...{[Tr]:cn,[un]:fn,[xn]:hn},...p},[b,h]=cd(0),T=r??b,f=n??h,B=o.filter(S=>S.complete===!0).length,w=()=>{var S;return!((S=o[T])!=null&&S.type)||!x[o[T].type]?x[Tr]({stepData:o[T],appearance:c}):x[o[T].type]({stepData:o[T],appearance:c})};return We.createElement(md,{type:l,styleOverrides:i,className:s,appearance:c},We.createElement(Cn,{style:{flex:1}},We.createElement(Cn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},We.createElement(ud,{className:a("checklistTitle",c),appearance:c},e),We.createElement(fd,{className:a("checklistSubtitle",c),appearance:c},t),We.createElement(Le,{total:o.length,count:B,style:{marginTop:"24px",paddingRight:"40px"},appearance:c})),We.createElement(gd,{className:a("checklistStepsContainer",c)},o.map((S,A)=>We.createElement(ln,{data:S,index:A,key:A,listLength:o.length,isSelected:A===T,primaryColor:c.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{f(A)},appearance:c})))),We.createElement(xd,{appearance:c,className:a("checklistDivider",c)}),We.createElement(hd,null,We.createElement(w,null)))},Fr=Cd;import z,{useState as Td}from"react";import yn from"react";import yd from"styled-components";var Sd=yd.svg`
|
|
893
893
|
transition: 'transform 0.35s ease-in-out';
|
|
894
|
-
`,Vt=({style:e,className:t})=>
|
|
894
|
+
`,Vt=({style:e,className:t})=>yn.createElement(Sd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},yn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ue from"styled-components";var kr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Sn=ue.div`
|
|
895
895
|
max-height: 350px;
|
|
896
896
|
padding-bottom: 40px;
|
|
897
|
-
`,
|
|
897
|
+
`,bn=ue.div`
|
|
898
898
|
display: flex;
|
|
899
899
|
flex-direction: column;
|
|
900
900
|
margin-top: 20px;
|
|
901
|
-
`,
|
|
901
|
+
`,wn=ue.h1`
|
|
902
902
|
font-style: normal;
|
|
903
903
|
font-weight: 600;
|
|
904
904
|
font-size: 30px;
|
|
905
905
|
line-height: 36px;
|
|
906
906
|
margin-bottom: 16px;
|
|
907
907
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
908
|
-
`,
|
|
908
|
+
`,Tn=ue.h2`
|
|
909
909
|
font-weight: 400;
|
|
910
910
|
font-size: 16px;
|
|
911
911
|
line-height: 20px;
|
|
912
912
|
margin-bottom: 16px;
|
|
913
913
|
padding-left: 1px;
|
|
914
914
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
915
|
-
`,
|
|
915
|
+
`,Fn=ue.div`
|
|
916
916
|
${e=>F(e)} {
|
|
917
917
|
border: 1px solid #fafafa;
|
|
918
918
|
}
|
|
@@ -922,11 +922,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
922
922
|
flex-direction: column;
|
|
923
923
|
min-height: 240px;
|
|
924
924
|
overflow: hidden;
|
|
925
|
-
`,
|
|
925
|
+
`,kn=ue.div`
|
|
926
926
|
display: flex;
|
|
927
927
|
flex-direction: row;
|
|
928
928
|
justify-content: space-between;
|
|
929
|
-
`,
|
|
929
|
+
`,Pn=ue.p`
|
|
930
930
|
${e=>F(e)} {
|
|
931
931
|
font-weight: 400;
|
|
932
932
|
font-size: 10px;
|
|
@@ -935,12 +935,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
935
935
|
color: #8c8c8c;
|
|
936
936
|
margin: 20px;
|
|
937
937
|
}
|
|
938
|
-
`,
|
|
938
|
+
`,vn=ue.div`
|
|
939
939
|
display: flex;
|
|
940
940
|
flex-direction: row;
|
|
941
|
-
`,
|
|
941
|
+
`,Bn=ue.div`
|
|
942
942
|
flex: 1;
|
|
943
|
-
`,
|
|
943
|
+
`,En=ue.div`
|
|
944
944
|
${e=>F(e)} {
|
|
945
945
|
display: flex;
|
|
946
946
|
justify-content: center;
|
|
@@ -950,7 +950,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
950
950
|
padding-left: 8px;
|
|
951
951
|
padding-right: 8px;
|
|
952
952
|
}
|
|
953
|
-
`,
|
|
953
|
+
`,An=ue.p`
|
|
954
954
|
${e=>F(e)} {
|
|
955
955
|
font-style: normal;
|
|
956
956
|
font-weight: 600;
|
|
@@ -962,7 +962,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
962
962
|
margin-top: 20px;
|
|
963
963
|
margin-bottom: 16px;
|
|
964
964
|
}
|
|
965
|
-
`,
|
|
965
|
+
`,In=ue.p`
|
|
966
966
|
${e=>F(e)} {
|
|
967
967
|
font-weight: 400;
|
|
968
968
|
font-size: 14px;
|
|
@@ -971,14 +971,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
971
971
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
972
972
|
margin-bottom: 8px;
|
|
973
973
|
}
|
|
974
|
-
`,
|
|
974
|
+
`,Nn=ue.div`
|
|
975
975
|
${e=>F(e)} {
|
|
976
976
|
display: flex;
|
|
977
977
|
flex-direction: row;
|
|
978
978
|
justify-content: center;
|
|
979
979
|
gap: 8px;
|
|
980
980
|
}
|
|
981
|
-
`,
|
|
981
|
+
`,On=ue.div`
|
|
982
982
|
${e=>F(e)} {
|
|
983
983
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
984
984
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
@@ -998,7 +998,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
998
998
|
justify-content: space-between;
|
|
999
999
|
position: relative;
|
|
1000
1000
|
cursor: pointer;
|
|
1001
|
-
`,
|
|
1001
|
+
`,Ln=ue.p`
|
|
1002
1002
|
${e=>F(e)} {
|
|
1003
1003
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1004
1004
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
@@ -1007,12 +1007,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1007
1007
|
font-size: 14px;
|
|
1008
1008
|
line-height: 22px;
|
|
1009
1009
|
margin: 0;
|
|
1010
|
-
`,
|
|
1010
|
+
`,Dn=ue.div`
|
|
1011
1011
|
display: flex;
|
|
1012
1012
|
flex-direction: row;
|
|
1013
1013
|
justify-content: flex-end;
|
|
1014
1014
|
align-content: center;
|
|
1015
|
-
|
|
1015
|
+
`,$n=ue.div`
|
|
1016
1016
|
display: flex;
|
|
1017
1017
|
flex: 1;
|
|
1018
1018
|
flex-direction: row;
|
|
@@ -1020,14 +1020,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1020
1020
|
align-content: center;
|
|
1021
1021
|
align-items: center;
|
|
1022
1022
|
margin-right: 20px;
|
|
1023
|
-
`,
|
|
1023
|
+
`,Mn=ue.div`
|
|
1024
1024
|
display: block;
|
|
1025
1025
|
width: 100%;
|
|
1026
|
-
`;import
|
|
1026
|
+
`;import bd from"styled-components";var Un=bd.div`
|
|
1027
1027
|
flex-direction: column;
|
|
1028
1028
|
justify-content: center;
|
|
1029
1029
|
display: flex;
|
|
1030
|
-
`;import ot from"react";import tt from"styled-components";var
|
|
1030
|
+
`;import ot from"react";import tt from"styled-components";var zn=tt.div`
|
|
1031
1031
|
border: 1px solid #fafafa;
|
|
1032
1032
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1033
1033
|
border-radius: 14px;
|
|
@@ -1035,13 +1035,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1035
1035
|
display: flex;
|
|
1036
1036
|
flex-direction: column;
|
|
1037
1037
|
overflow: hidden;
|
|
1038
|
-
`,
|
|
1038
|
+
`,Wn=tt.div`
|
|
1039
1039
|
display: flex;
|
|
1040
1040
|
flex-wrap: wrap;
|
|
1041
1041
|
justify-content: space-between;
|
|
1042
1042
|
overflow: hidden;
|
|
1043
1043
|
row-gap: 10px;
|
|
1044
|
-
`,
|
|
1044
|
+
`,_n=tt.div`
|
|
1045
1045
|
${e=>F(e)} {
|
|
1046
1046
|
color: #595959;
|
|
1047
1047
|
}
|
|
@@ -1051,7 +1051,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1051
1051
|
line-height: 12px;
|
|
1052
1052
|
letter-spacing: 0.09em;
|
|
1053
1053
|
margin-bottom: 12px;
|
|
1054
|
-
`,
|
|
1054
|
+
`,Hn=tt.div`
|
|
1055
1055
|
${e=>F(e)} {
|
|
1056
1056
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1057
1057
|
background: #ffffff;
|
|
@@ -1064,7 +1064,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1064
1064
|
|
|
1065
1065
|
max-width: 150px;
|
|
1066
1066
|
min-width: 200px;
|
|
1067
|
-
`,
|
|
1067
|
+
`,jn=tt.div`
|
|
1068
1068
|
${e=>F(e)} {
|
|
1069
1069
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1070
1070
|
}
|
|
@@ -1076,13 +1076,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1076
1076
|
justify-content: center;
|
|
1077
1077
|
align-content: center;
|
|
1078
1078
|
align-items: center;
|
|
1079
|
-
`,
|
|
1079
|
+
`,Vn=tt.div`
|
|
1080
1080
|
font-weight: 600;
|
|
1081
1081
|
font-size: 20px;
|
|
1082
1082
|
line-height: 24px;
|
|
1083
1083
|
width: 20px;
|
|
1084
1084
|
height: 20px;
|
|
1085
|
-
`,
|
|
1085
|
+
`,Gn=tt.div`
|
|
1086
1086
|
${e=>F(e)} {
|
|
1087
1087
|
color: #434343;
|
|
1088
1088
|
}
|
|
@@ -1091,20 +1091,20 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1091
1091
|
line-height: 17px;
|
|
1092
1092
|
margin-top: 12px;
|
|
1093
1093
|
margin-bottom: 8px;
|
|
1094
|
-
`,
|
|
1094
|
+
`,Kn=tt.div`
|
|
1095
1095
|
${e=>F(e)} {
|
|
1096
1096
|
color: #8c8c8c;
|
|
1097
1097
|
}
|
|
1098
1098
|
font-weight: 400;
|
|
1099
1099
|
font-size: 12px;
|
|
1100
1100
|
line-height: 14px;
|
|
1101
|
-
`,
|
|
1101
|
+
`,qn=tt.a`
|
|
1102
1102
|
color: ${e=>e.color};
|
|
1103
1103
|
font-size: 12px;
|
|
1104
1104
|
line-height: 14px;
|
|
1105
1105
|
font-weight: 400;
|
|
1106
1106
|
cursor: pointer;
|
|
1107
|
-
`;var
|
|
1107
|
+
`;var wd=({steps:e,style:t,title:o,primaryColor:i,appearance:r,onButtonClick:n})=>{let{primaryCTAClickSideEffects:s}=ie();return ot.createElement(zn,{style:t,className:a("guideContainer",r)},ot.createElement(_n,{className:a("guideTitle",r)},o),ot.createElement(Wn,{className:a("guideItemContainer",r)},e.map((p,c)=>ot.createElement(Hn,{key:`guide-${p.id??c}`,className:a("guideItem",r)},p.icon&&ot.createElement(jn,{className:a("guideIcon",r)},ot.createElement(Vn,null,p.icon)),ot.createElement(Gn,{className:a("guideItemTitle",r),dangerouslySetInnerHTML:le(p.title)}),ot.createElement(Kn,{className:a("guideItemSubtitle",r),dangerouslySetInnerHTML:le(p.subtitle)}),ot.createElement(qn,{className:a("guideItemLink",r),color:i,onClick:()=>{p.primaryButtonUri&&s(p),n&&n(p)}},p.primaryButtonTitle)))))},mo=wd;var Fd=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:r,onClose:n,selectedStep:s,setSelectedStep:p,customStepTypes:c,appearance:l,guideData:g,guideTitle:d,onGuideButtonClick:x})=>{let b=({stepData:m,handleSecondaryCTAClick:E,handleCTAClick:k})=>m?z.createElement(En,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},z.createElement(An,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:le(m.title)}),z.createElement(In,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:le(m.subtitle)}),z.createElement(Nn,{className:a("checklistCTAContainer",l)},m.secondaryButtonTitle&&z.createElement(Z,{title:m.secondaryButtonTitle,onClick:E,appearance:l,secondary:!0}),z.createElement(Z,{title:m.primaryButtonTitle,onClick:k,appearance:l}))):z.createElement(z.Fragment,null),T={...{default:m=>{var O;if((O=e[w])!=null&&O.StepContent){let I=e[w].StepContent;return z.createElement("div",null,I)}let E=e[w];return z.createElement(b,{stepData:m,handleCTAClick:()=>{E.handlePrimaryButtonClick&&E.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{E.handleSecondaryButtonClick&&E.handleSecondaryButtonClick()}})}},...c},[f,B]=Td(0),w=s??f,S=p??B,A=()=>{var m;return e?!((m=e[w])!=null&&m.type)||!T[e[w].type]?T.default(e[w]):T[e[w].type]({stepData:e[w],primaryColor:l.theme.colorPrimary}):z.createElement(z.Fragment,null)},y=e.filter(m=>m.complete).length;return r?(l.theme.modalContainer||(l.theme.borderRadius&&(kr.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=kr),z.createElement(He,{onClose:n,visible:r,appearance:l},z.createElement(Mn,null,z.createElement(bn,null,z.createElement(wn,{appearance:l,className:a("checklistTitle",l)},t),z.createElement(Tn,{appearance:l,className:a("checklistSubtitle",l)},o)),z.createElement(Sn,null,e&&e.length>0&&z.createElement(Fn,{className:a("stepsContainer",l)},z.createElement(kn,null,z.createElement("div",{style:{flex:3}},z.createElement(Pn,{className:a("stepsTitle",l)},i)),z.createElement($n,null,z.createElement(Le,{style:{width:"100%"},count:y,total:e.length,appearance:l}))),z.createElement(vn,null,z.createElement(Bn,{className:a("checklistStepListContainer",l),appearance:l},e.map((m,E)=>{let k=w===E;return z.createElement(On,{selected:k,className:a(`checklistStepListItem${k?"Selected":""}`,l),key:`checklist-guide-step-${m.id??E}`,disabled:m.blocked,onClick:()=>{m.blocked||S(E)},title:m.blocked?"Finish remaining steps to continue":void 0},k&&z.createElement(Uo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),z.createElement(Ln,{selected:k,className:a(`checklistStepListStepName${k?"Selected":""}`,l)},m.stepName),z.createElement(Dn,null,z.createElement(Qe,{value:m.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:m.progress,appearance:l}),z.createElement(Un,null,z.createElement(Vt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),z.createElement(A,null))),g&&g.length>0&&z.createElement(mo,{steps:g,title:d,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:m=>(x&&x(m),!0)}))))):z.createElement(z.Fragment,null)},Pr=Fd;import ve,{useEffect as as,useState as kd}from"react";import he from"react";import rt from"styled-components";var Yn=rt.div`
|
|
1108
1108
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1109
1109
|
border: 1px solid;
|
|
1110
1110
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1116,19 +1116,19 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1116
1116
|
display: flex;
|
|
1117
1117
|
flex-direction: column;
|
|
1118
1118
|
transition: max-height 0.25s;
|
|
1119
|
-
`,
|
|
1119
|
+
`,Xn=rt.div`
|
|
1120
1120
|
display: flex;
|
|
1121
1121
|
margin-bottom: 20px;
|
|
1122
|
-
`,
|
|
1122
|
+
`,Jn=rt.img`
|
|
1123
1123
|
border-radius: 4px;
|
|
1124
1124
|
max-height: 260px;
|
|
1125
1125
|
min-height: 200px;
|
|
1126
|
-
`,
|
|
1126
|
+
`,Qn=rt.div`
|
|
1127
1127
|
display: flex;
|
|
1128
1128
|
flex-direction: row;
|
|
1129
1129
|
justify-content: space-between;
|
|
1130
1130
|
align-items: center;
|
|
1131
|
-
`,
|
|
1131
|
+
`,Zn=rt.p`
|
|
1132
1132
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1133
1133
|
font-style: normal;
|
|
1134
1134
|
font-weight: 500;
|
|
@@ -1139,23 +1139,23 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1139
1139
|
:hover {
|
|
1140
1140
|
opacity: 0.8;
|
|
1141
1141
|
}
|
|
1142
|
-
`,
|
|
1142
|
+
`,Rn=rt.div`
|
|
1143
1143
|
cursor: pointer;
|
|
1144
1144
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1145
1145
|
:hover {
|
|
1146
1146
|
opacity: 0.8;
|
|
1147
1147
|
}
|
|
1148
|
-
`,
|
|
1148
|
+
`,ny=rt.div``,es=rt.p`
|
|
1149
1149
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1150
1150
|
font-weight: 400;
|
|
1151
1151
|
font-size: 14px;
|
|
1152
1152
|
line-height: 22px;
|
|
1153
|
-
`,
|
|
1153
|
+
`,ts=rt.div`
|
|
1154
1154
|
display: flex;
|
|
1155
1155
|
flex-direction: row;
|
|
1156
1156
|
justify-content: flex-start;
|
|
1157
1157
|
align-items: center;
|
|
1158
|
-
`;var
|
|
1158
|
+
`;var os=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:r,appearance:n,customStepTypes:s})=>{var d;let p=t?{}:{transform:"rotate(90deg)"},c=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.2s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.15s ease-in"};function l(){return he.createElement(he.Fragment,null,e.imageUri||e.videoUri?he.createElement(Xn,{className:a("stepMediaContainer",n)},e.imageUri?he.createElement(Jn,{className:a("stepImage",n),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?he.createElement(Ve,{appearance:n,videoUri:e.videoUri}):null):null,he.createElement(es,{className:a("stepSubtitle",n),appearance:n,dangerouslySetInnerHTML:le(e.subtitle)}),he.createElement(Bo,{className:a("checklistCTAContainer",n)},e.secondaryButtonTitle?he.createElement(Z,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>r(),appearance:n}):null,he.createElement(Z,{title:e.primaryButtonTitle??"Continue",onClick:()=>i(),appearance:n})))}function g(){if(!s)return null;let x=s[e.type];return x?x(e,n):null}return he.createElement(Yn,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",n),appearance:n},he.createElement(Qn,{className:a("stepHeader",n)},he.createElement(ts,null,he.createElement(Mo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(d=n==null?void 0:n.theme)==null?void 0:d.colorPrimary,appearance:n}),he.createElement(Zn,{appearance:n,className:a("stepTitle",n),dangerouslySetInnerHTML:le(e.title),onClick:()=>o()})),he.createElement(Rn,{className:a("stepChevronContainer",n),onClick:()=>o(),appearance:n},he.createElement(Vt,{style:{...p,transition:"transform 0.2s ease-in-out"}}))),he.createElement("div",{key:e.id,style:{...c}},g()??l()))};import Gt from"styled-components";var Cy=Gt.div`
|
|
1159
1159
|
background: #ffffff;
|
|
1160
1160
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1161
1161
|
border-radius: 6px;
|
|
@@ -1169,26 +1169,26 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1169
1169
|
|
|
1170
1170
|
max-width: 800px;
|
|
1171
1171
|
min-width: 350px;
|
|
1172
|
-
`,
|
|
1172
|
+
`,rs=Gt.div`
|
|
1173
1173
|
display: flex;
|
|
1174
1174
|
flex-direction: column;
|
|
1175
|
-
`,
|
|
1175
|
+
`,is=Gt.h1`
|
|
1176
1176
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1177
1177
|
font-style: normal;
|
|
1178
1178
|
font-weight: 700;
|
|
1179
1179
|
font-size: 20px;
|
|
1180
1180
|
line-height: 24px;
|
|
1181
1181
|
margin-bottom: 8px;
|
|
1182
|
-
`,
|
|
1182
|
+
`,ns=Gt.h2`
|
|
1183
1183
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1184
1184
|
font-weight: 400;
|
|
1185
1185
|
font-size: 14px;
|
|
1186
1186
|
line-height: 23px;
|
|
1187
1187
|
margin: 2px 0 0 0;
|
|
1188
|
-
`,
|
|
1188
|
+
`,ss=Gt.div`
|
|
1189
1189
|
display: block;
|
|
1190
1190
|
width: 100%;
|
|
1191
|
-
`,
|
|
1191
|
+
`,ls=Gt.div`
|
|
1192
1192
|
display: flex;
|
|
1193
1193
|
width: 100%;
|
|
1194
1194
|
flex-direction: column;
|
|
@@ -1196,23 +1196,23 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1196
1196
|
padding: 24px;
|
|
1197
1197
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1198
1198
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1199
|
-
`;var
|
|
1199
|
+
`;var Pd=({title:e,subtitle:t,steps:o,onClose:i,visible:r,autoExpandFirstIncompleteStep:n=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:c,setSelectedStep:l,appearance:g,type:d,className:x,customStepTypes:b,style:h})=>{let T=o.filter(y=>y.complete).length,[f,B]=kd(Array(o.length).fill(!0));as(()=>{let y=[...f];if(n){for(let m=0;m<o.length;m++)if(!o[m].complete){y[m]=!1;break}B(y)}},[]),as(()=>{w(c)},[c]);let w=y=>{let m=[...f];if(s)for(let E=0;E<f.length;++E)E!==y&&(m[E]=!0);m[y]=!m[y],B(m)};if(!r&&d=="modal")return ve.createElement(ve.Fragment,null);let S=ve.createElement(ve.Fragment,null,ve.createElement(rs,null,ve.createElement(is,{appearance:g,className:a("checklistTitle",g),dangerouslySetInnerHTML:le(e)}),ve.createElement(ns,{appearance:g,className:a("checklistSubtitle",g),dangerouslySetInnerHTML:le(t)})),ve.createElement(Le,{display:"percent",count:T,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:g})),A=ve.createElement(ss,{className:xe(a("checklistContainer",g),x)},o.map((y,m)=>{let E=f[m];return ve.createElement(os,{appearance:g,stepData:y,collapsed:E,key:`modal-checklist-${y.id??m}`,onClick:()=>{if(c===m){w(m);return}l(m)},onPrimaryButtonClick:()=>{y.handlePrimaryButtonClick&&y.handlePrimaryButtonClick(),p&&!y.completionCriteria&&m<f.length-1&&f[m+1]&&l(m+1)},onSecondaryButtonClick:()=>{y.handleSecondaryButtonClick&&y.handleSecondaryButtonClick()},customStepTypes:b})}));return d==="inline"?ve.createElement(ls,{appearance:g,className:xe(a("checklistInlineContainer",g),x),style:h},S,A):ve.createElement(ve.Fragment,null,ve.createElement(He,{onClose:i,visible:r,appearance:g,style:{maxWidth:"600px"},headerContent:S},A))},vr=Pd;import ae,{useEffect as Br,useRef as Ld,useState as Pt}from"react";import{useEffect as vd,useState as Bd}from"react";var ps=()=>{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]=Bd(t),r=null,n=()=>{r!==null?clearTimeout(r):s(),r=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([c,l])=>{if(!window)return[c,!1];let g=window.matchMedia(l);return g.addEventListener("change",n),[c,g.matches]}));i(p)};return vd(()=>{s()},[]),o};import Kt from"react";import de,{css as ds,keyframes as cs}from"styled-components";var ms=ds`
|
|
1200
1200
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1201
|
-
`,
|
|
1201
|
+
`,Ed=ds`
|
|
1202
1202
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1203
|
-
`,
|
|
1203
|
+
`,Ad=cs`
|
|
1204
1204
|
from {
|
|
1205
1205
|
opacity: 0;
|
|
1206
1206
|
} to {
|
|
1207
1207
|
opacity: 1;
|
|
1208
1208
|
}
|
|
1209
|
-
`,
|
|
1209
|
+
`,Id=cs`
|
|
1210
1210
|
from {
|
|
1211
1211
|
opacity: 1;
|
|
1212
1212
|
} to {
|
|
1213
1213
|
opacity: 0;
|
|
1214
1214
|
}
|
|
1215
|
-
`,
|
|
1215
|
+
`,us=de.div`
|
|
1216
1216
|
margin: 0 -20px;
|
|
1217
1217
|
overflow-x: auto;
|
|
1218
1218
|
padding-left: 20px;
|
|
@@ -1229,14 +1229,14 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1229
1229
|
::-webkit-scrollbar {
|
|
1230
1230
|
display: none;
|
|
1231
1231
|
}
|
|
1232
|
-
`,
|
|
1232
|
+
`,fs=de.div`
|
|
1233
1233
|
display: flex;
|
|
1234
1234
|
flex-flow: row nowrap;
|
|
1235
1235
|
gap: 0 16px;
|
|
1236
1236
|
scroll-snap-align: center;
|
|
1237
1237
|
scroll-snap-stop: always;
|
|
1238
|
-
`,
|
|
1239
|
-
animation: ${e=>e.reversed?
|
|
1238
|
+
`,gs=de.div`
|
|
1239
|
+
animation: ${e=>e.reversed?Id:Ad} 0.25s ease-out;
|
|
1240
1240
|
background: linear-gradient(
|
|
1241
1241
|
to right,
|
|
1242
1242
|
${({theme:e})=>e.colorBackground}00,
|
|
@@ -1245,8 +1245,8 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1245
1245
|
position: absolute;
|
|
1246
1246
|
width: 64px;
|
|
1247
1247
|
z-index: 10;
|
|
1248
|
-
`,
|
|
1249
|
-
${
|
|
1248
|
+
`,xs=de.button`
|
|
1249
|
+
${ms}
|
|
1250
1250
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1251
1251
|
align-items: center;
|
|
1252
1252
|
border-radius: 50%;
|
|
@@ -1257,11 +1257,11 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1257
1257
|
justify-content: center;
|
|
1258
1258
|
position: absolute;
|
|
1259
1259
|
width: 48px;
|
|
1260
|
-
`,
|
|
1260
|
+
`,hs=de.div`
|
|
1261
1261
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1262
1262
|
padding: 20px;
|
|
1263
|
-
`,
|
|
1264
|
-
${
|
|
1263
|
+
`,Cs=de(hs)`
|
|
1264
|
+
${ms}
|
|
1265
1265
|
background: ${({theme:e})=>e.colorBackground};
|
|
1266
1266
|
position: relative;
|
|
1267
1267
|
|
|
@@ -1273,50 +1273,50 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1273
1273
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1274
1274
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1275
1275
|
}
|
|
1276
|
-
`,
|
|
1276
|
+
`,ys=de.img`
|
|
1277
1277
|
border-radius: 50%;
|
|
1278
1278
|
height: 40px;
|
|
1279
1279
|
margin-bottom: 12px;
|
|
1280
1280
|
width: 40px;
|
|
1281
|
-
`,
|
|
1281
|
+
`,Ss=de(hs)`
|
|
1282
1282
|
${e=>F(e)} {
|
|
1283
|
-
${
|
|
1283
|
+
${Ed}
|
|
1284
1284
|
|
|
1285
1285
|
background: ${({theme:e})=>e.colorBackground};
|
|
1286
1286
|
}
|
|
1287
|
-
`,
|
|
1287
|
+
`,Dy=de.div`
|
|
1288
1288
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1289
1289
|
display: flex;
|
|
1290
1290
|
flex-flow: row nowrap;
|
|
1291
1291
|
align-items: center;
|
|
1292
|
-
|
|
1292
|
+
`,$y=de.div`
|
|
1293
1293
|
white-space: nowrap;
|
|
1294
|
-
`,
|
|
1294
|
+
`,bs=de.div`
|
|
1295
1295
|
background: #d8fed8;
|
|
1296
1296
|
border-radius: 6px;
|
|
1297
1297
|
float: right;
|
|
1298
1298
|
margin-bottom: 12px;
|
|
1299
1299
|
padding: 4px 10px;
|
|
1300
|
-
`,
|
|
1300
|
+
`,Nd=de.p`
|
|
1301
1301
|
font-weight: bold;
|
|
1302
1302
|
font-size: 18px;
|
|
1303
1303
|
line-height: 22px;
|
|
1304
1304
|
letter-spacing: calc(18px * -0.01);
|
|
1305
1305
|
margin: 0;
|
|
1306
|
-
`,
|
|
1306
|
+
`,ws=de(Nd)`
|
|
1307
1307
|
margin-bottom: 4px;
|
|
1308
|
-
`,
|
|
1308
|
+
`,Ts=de.div`
|
|
1309
1309
|
display: flex;
|
|
1310
1310
|
flex-flow: row nowrap;
|
|
1311
1311
|
align-items: center;
|
|
1312
1312
|
min-width: 50%;
|
|
1313
|
-
`,
|
|
1313
|
+
`,Od=de.p`
|
|
1314
1314
|
font-weight: bold;
|
|
1315
1315
|
font-size: 16px;
|
|
1316
1316
|
line-height: 20px;
|
|
1317
1317
|
letter-spacing: calc(16px * -0.01);
|
|
1318
1318
|
margin: 0;
|
|
1319
|
-
`,
|
|
1319
|
+
`,Fs=de(Od)`
|
|
1320
1320
|
margin-bottom: 4px;
|
|
1321
1321
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1322
1322
|
`}
|
|
@@ -1326,7 +1326,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1326
1326
|
font-size: 14px;
|
|
1327
1327
|
line-height: 22px;
|
|
1328
1328
|
margin: 0;
|
|
1329
|
-
`,
|
|
1329
|
+
`,ks=de.p`
|
|
1330
1330
|
color: ${({theme:e})=>e.colorText};
|
|
1331
1331
|
font-weight: 600;
|
|
1332
1332
|
font-size: 12px;
|
|
@@ -1338,21 +1338,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1338
1338
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1339
1339
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1340
1340
|
`}
|
|
1341
|
-
`;var
|
|
1341
|
+
`;var Ps=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=Q(),{primaryCTAClickSideEffects:r}=ie();o=i(o);let{imageUri:n=null,subtitle:s=null,title:p=null,complete:c=!1,blocked:l=!1}=e,g=e.primaryButtonTitle||e.secondaryButtonTitle,d=()=>{r(e)};return Kt.createElement(Cs,{className:a("carouselCard",o),onClick:l?null:d,style:t,blocked:l,complete:c},n&&Kt.createElement(ys,{className:a("carouselCardImage",o),src:n,alt:p,style:{opacity:c||l?.4:1}}),c&&Kt.createElement(bs,{className:a("carouselCompletedPill",o)},Kt.createElement(ks,{style:{color:"#108E0B"}},"Complete")),p&&Kt.createElement(Fs,{blocked:l,complete:c,className:a("carouselCardTitle",o)},p),s&&Kt.createElement(dt.Quiet,{blocked:l,complete:c,className:a("carouselCardSubtitle",o)},s))};var Dd=()=>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"})),vs=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,r]=Pt(!1),[n,s]=Pt(!1);Br(()=>{t===!0&&i===!1?r(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{r(!1),s(!1)},c=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?ae.createElement(gs,{style:c,reversed:n,onAnimationEnd:n?p:null},ae.createElement(xs,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ae.createElement(Dd,null))):null},Bs=({flowId:e,appearance:t,customVariables:o,className:i})=>{let r=Ld(null),[n,s]=Pt(!1),[p,c]=Pt(!1),[l,g]=Pt(null),[d,x]=Pt([]),[b,h]=Pt(0),{isSmall:T}=ps(),f=T?1:3,{getFlowMetadata:B,getFlowSteps:w,getNumberOfStepsCompleted:S,updateCustomVariables:A,isLoading:y}=Y();Br(()=>{A(o)},[o,y]),Br(()=>{if(y)return;let I=B(e),N=S(e),$=w(e);g(I),I.data!==null&&(x($.sort((D,ee)=>Number(D.complete)-Number(ee.complete))),c($.length>f),h(N))},[y]);let m=[];for(let I=0;I<d.length;I+=f)m.push(d.slice(I,I+f));let E=I=>{let N=I.target,$=N.scrollWidth-N.clientWidth,D=Math.ceil(N.scrollLeft);D>0&&n===!1&&s(!0),D===0&&n===!0&&s(!1),D<$&&p===!1&&c(!0),D===$&&p===!0&&c(!1)},k=(I=!0)=>{let N=I?1:-1;r.current!==null&&r.current.scrollBy({left:r.current.clientWidth*N,behavior:"smooth"})},P=null,O=I=>{P!==null?clearTimeout(P):E(I),P=setTimeout(()=>{E(I)},16)};return y?null:ae.createElement(Ss,{className:xe(a("carouselContainer",t),i)},ae.createElement("div",{style:{display:"flex",justifyContent:T?"center":"space-between",marginBottom:20,flexWrap:T?"wrap":"nowrap",gap:T?16:20}},ae.createElement("div",null,ae.createElement(ws,{className:a("carouselTitle",t)},l==null?void 0:l.title),ae.createElement(dt.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),ae.createElement(Ts,{className:a("progressWrapper",t)},ae.createElement(Le,{count:b,total:d.length,appearance:t}))),ae.createElement("div",{style:{position:"relative"}},ae.createElement(vs,{show:n,onClick:()=>k(!1)}),ae.createElement(vs,{side:"right",show:p,onClick:k}),ae.createElement(us,{ref:r,onScroll:O},m.map((I,N)=>ae.createElement(fs,{key:N,style:{flex:`0 0 calc(100% - ${d.length>f?36:0}px)`}},I.map(($,D)=>ae.createElement(Ps,{key:D,stepData:$,style:{flex:d.length>f?`0 1 calc(100% / ${f} - 16px * 2 / ${f})`:1},appearance:t})))))),ae.createElement(oe,{appearance:t}))};var Er=({flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:r,className:n,type:s="inline",onDismiss:p,visible:c,customVariables:l,onStepCompletion:g,onButtonClick:d,appearance:x,hideOnFlowCompletion:b,setVisible:h,customStepTypes:T,checklistStyle:f="default",autoExpandFirstIncompleteStep:B,autoExpandNextStep:w,...S})=>{let{getFlow:A,getFlowSteps:y,markStepCompleted:m,getStepStatus:E,getNumberOfStepsCompleted:k,isLoading:P,targetingLogicShouldHideFlow:O,updateCustomVariables:I,getFlowMetadata:N,isStepBlocked:$,getFlowStatus:D,hasActiveFullPageFlow:ee,setHasActiveFullPageFlow:U}=Y(),{primaryCTAClickSideEffects:te,secondaryCTAClickSideEffects:fe}=ie(),{getOpenFlowState:X,setOpenFlowState:H}=we(),[j,Ce]=As(r||0),[Ie,be]=As(!1),me=c===void 0?X(e):c,J=s==="modal",{mergeAppearanceWithDefault:ge}=Q();if(x=ge(x),Es(()=>{I(l)},[l,P]),Es(()=>{c!==void 0&&(J&&c===!0?U(!0):J&&c===!1&&U(!1))},[c,h,ee]),P)return null;let re=A(e);if(!re||O(re))return null;let L=y(e);if(!L||b===!0&&D(e)===q)return null;let V=N(e);if(V!=null&&V.title&&(t=V.title),V!=null&&V.subtitle&&(o=V.subtitle),!Ie&&r===void 0&&k(e)>0){let u=L.findIndex(C=>C.complete===!1);Ce(u>-1?u:L.length-1),be(!0)}function G(){if(j+1>=L.length){J&&H(e,!1);return}$(e,L[j+1].id)||Ce(j+1)}function ne(u,C,v){let W=j+1<L.length?L[j+1]:null;d&&d(u,j,C,W)===!0&&J&&De(),g&&g(u,v,W),!g&&!d&&(u.primaryButtonUri||u.secondaryButtonUri)&&J&&De()}function se(){return L.map((u,C)=>({...u,handleSecondaryButtonClick:()=>{G(),fe(u),u.skippable===!0&&m(e,u.id,{skipped:!0}),ne(u,"secondary",C)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(m(e,u.id),G()),ne(u,"primary",C),te(u),E(e,u.id)===Ue&&G()}}))}function pe(){return ce.createElement(oe,{appearance:x})}let Ye={steps:se(),title:t,subtitle:o,primaryColor:x.theme.colorPrimary,appearance:x,customStepTypes:T,type:s,className:n,autoExpandFirstIncompleteStep:B,autoExpandNextStep:w};function De(){H(e,!1),p&&p(),h&&h(!1)}function Et(){return ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(Bs,{flowId:e,appearance:x,customVariables:l,className:n}))}function ft(){return ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(vr,{visible:me,onClose:()=>{De()},selectedStep:j,setSelectedStep:Ce,autoExpandNextStep:!0,appearance:x,...Ye}))}function At(){let u=S.guideFlowId,C;return u&&A(u)&&(C=y(u)),ce.createElement(ce.Fragment,null,ce.createElement(pe,null),ce.createElement(Pr,{visible:me,stepsTitle:V.stepsTitle?V.stepsTitle:"Your quick start guide",onClose:()=>{De()},selectedStep:j,setSelectedStep:Ce,guideData:C,guideTitle:S.guideTitle??"Guide",appearance:x,title:t,subtitle:o,onGuideButtonClick:v=>{ne(v,"link",0)},customStepTypes:T,...Ye}))}function gt(){let u=ce.createElement(Fr,{flowId:e,style:i,selectedStep:j,setSelectedStep:Ce,appearance:x,type:s,...Ye});return J?ce.createElement(He,{onClose:()=>{De()},visible:me,appearance:x,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},ce.createElement(pe,null),u):ce.createElement(ce.Fragment,null,ce.createElement(pe,null),u)}switch(f){case"condensed":return ft();case"with-guide":return At();case"default":return gt();case"carousel":return Et();default:return gt()}};var Md=e=>$d.createElement(Er,{type:"inline",...e});import mt,{useEffect as Ud}from"react";import Ke from"react";import jo from"styled-components";var Is=jo.div`
|
|
1342
1342
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1343
1343
|
border-radius: 8px;
|
|
1344
1344
|
padding: 6px 10px 6px 10px;
|
|
1345
1345
|
min-width: 160px;
|
|
1346
1346
|
cursor: pointer;
|
|
1347
1347
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1348
|
-
`,
|
|
1348
|
+
`,Ns=jo.div`
|
|
1349
1349
|
display: flex;
|
|
1350
1350
|
flex-direction: row;
|
|
1351
1351
|
justify-content: space-between;
|
|
1352
1352
|
align-items: center;
|
|
1353
1353
|
margin-bottom: 2px;
|
|
1354
1354
|
flex-grow: 2;
|
|
1355
|
-
`,
|
|
1355
|
+
`,Os=jo.div`
|
|
1356
1356
|
text-overflow: ellipsis;
|
|
1357
1357
|
font-weight: 600;
|
|
1358
1358
|
font-size: 12px;
|
|
@@ -1360,13 +1360,13 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1360
1360
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1361
1361
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1362
1362
|
color: ${e=>e.appearance.theme.colorPrimary};
|
|
1363
|
-
`,
|
|
1363
|
+
`,Ls=jo.div`
|
|
1364
1364
|
width: 20px;
|
|
1365
1365
|
margin-right: 8px;
|
|
1366
1366
|
display: flex;
|
|
1367
1367
|
height: 100%;
|
|
1368
1368
|
align-items: center;
|
|
1369
|
-
`;var
|
|
1369
|
+
`;var Ds=({title:e,count:t,total:o,onClick:i,style:r={},className:n,appearance:s,type:p="default"})=>Ke.createElement(Ke.Fragment,null,Ke.createElement(oe,{appearance:s}),Ke.createElement(Is,{onClick:()=>i!==void 0&&i(),style:{...p=="condensed"?{display:"flex",justifyContent:"space-between"}:{},...r},className:xe(n??"",a("progressRingContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&Ke.createElement(Ls,{className:a("progressRingContainer",s)},Ke.createElement($t,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),Ke.createElement(Ns,{type:p,className:a("badgeTitleContainer",s)},Ke.createElement(Os,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&Ke.createElement(Vt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&Ke.createElement(Le,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s})));import ct from"react";import uo from"styled-components";var $s=uo.div`
|
|
1370
1370
|
display: flex;
|
|
1371
1371
|
flex-direction: row;
|
|
1372
1372
|
width: 100%;
|
|
@@ -1377,25 +1377,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1377
1377
|
border-width: 1px;
|
|
1378
1378
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1379
1379
|
border-radius: 12px;
|
|
1380
|
-
`,
|
|
1380
|
+
`,Ms=uo.div`
|
|
1381
1381
|
${e=>F(e)} {
|
|
1382
1382
|
display: flex;
|
|
1383
1383
|
justify-content: center;
|
|
1384
1384
|
align-items: center;
|
|
1385
1385
|
margin-right: 16px;
|
|
1386
1386
|
}
|
|
1387
|
-
|
|
1387
|
+
`,Us=uo.div`
|
|
1388
1388
|
display: flex;
|
|
1389
1389
|
flex-direction: column;
|
|
1390
1390
|
flex: 1;
|
|
1391
1391
|
margin-top: 0;
|
|
1392
|
-
`,
|
|
1392
|
+
`,zs=uo.div`
|
|
1393
1393
|
display: flex;
|
|
1394
1394
|
flex-direction: column;
|
|
1395
1395
|
justify-content: center;
|
|
1396
1396
|
margin-left: 16px;
|
|
1397
1397
|
min-width: 200px;
|
|
1398
|
-
`,
|
|
1398
|
+
`,O0=uo.div`
|
|
1399
1399
|
display: flex;
|
|
1400
1400
|
justify-content: center;
|
|
1401
1401
|
align-items: flex-end;
|
|
@@ -1404,7 +1404,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1404
1404
|
:hover {
|
|
1405
1405
|
opacity: 0.8;
|
|
1406
1406
|
}
|
|
1407
|
-
`;var
|
|
1407
|
+
`;var Ws=({title:e,subtitle:t,icon:o,appearance:i,count:r,total:n,className:s,style:p})=>ct.createElement(ct.Fragment,null,ct.createElement($s,{appearance:i,className:xe(a("fullWidthProgressBadgeContainer",i),s??""),style:p},o&&ct.createElement(Ms,{className:a("fullWidthProgressBadgeIcon",i)},o),ct.createElement(Us,null,ct.createElement(Fe,{size:"small",appearance:i,title:e,subtitle:t})),ct.createElement(zs,{className:a("fullWidthProgressBadgeProgressContainer",i)},ct.createElement(Le,{count:r,total:n,display:"percent",textLocation:"top"}))));var zd=({flowId:e,title:t,subtitle:o,icon:i,style:r,onClick:n,className:s,customVariables:p,hideOnFlowCompletion:c,appearance:l,type:g="default"})=>{let{getFlow:d,getFlowSteps:x,getFlowStatus:b,getNumberOfStepsCompleted:h,isLoading:T,targetingLogicShouldHideFlow:f,updateCustomVariables:B}=Y(),{mergeAppearanceWithDefault:w}=Q();l=w(l);let{setOpenFlowState:S,getOpenFlowState:A}=we();if(Ud(()=>{B(p)},[p,T]),T)return null;let y=d(e);if(!y||f(y)||c===!0&&b(e)===q)return null;let m=x(e),E=h(e);return g==="full-width"?mt.createElement(mt.Fragment,null,mt.createElement(oe,{appearance:l}),mt.createElement(Ws,{title:t,subtitle:o,count:E,total:m.length,style:r,className:s,appearance:l,icon:i,onClick:()=>{}})):mt.createElement(mt.Fragment,null,mt.createElement(oe,{appearance:l}),mt.createElement(Ds,{count:E,total:m.length,title:t,style:r,onClick:()=>{S(e,!0),n&&n()},type:g,className:s,appearance:l}))};import Wd from"react";var _d=({flowId:e,style:t,appearance:o,...i})=>{let{getFlow:r,targetingLogicShouldHideFlow:n,getFlowSteps:s}=Y(),{mergeAppearanceWithDefault:p}=Q();o=p(o);let c=r(e);if(!c||n(c))return null;let l=s(e);return Wd.createElement(mo,{steps:l,style:t,appearance:o,...i})};import ut,{useContext as Zd,useEffect as Rd}from"react";import _,{useEffect as Vo,useLayoutEffect as Hs,useRef as Gd,useState as fo}from"react";import go from"styled-components";import{useCallback as Hd,useEffect as jd,useState as Vd}from"react";var Ar=(e,t,o,i={x:20,y:20},r)=>{let n=r=="fixed"?0:window.scrollY,s=r=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+n}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+n}:{x:0,y:0}};function _s(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,r]=Vd(o),n=Hd(()=>{e&&r(e.getBoundingClientRect())},[e]);return jd(()=>(n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)),[e,t]),i}var js=300,Vs=100,Kd=500,qt=12,qd=go.div`
|
|
1408
1408
|
width: 100%;
|
|
1409
1409
|
height: 100%;
|
|
1410
1410
|
border-radius: 9999px;
|
|
@@ -1427,25 +1427,25 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1427
1427
|
opacity: 0;
|
|
1428
1428
|
}
|
|
1429
1429
|
}
|
|
1430
|
-
`,
|
|
1430
|
+
`,Yd=go.div`
|
|
1431
1431
|
width: ${qt}px;
|
|
1432
1432
|
height: ${qt}px;
|
|
1433
1433
|
border-radius: 100px;
|
|
1434
1434
|
background-color: ${e=>e.primaryColor};
|
|
1435
1435
|
z-index: 20;
|
|
1436
1436
|
opacity: 1;
|
|
1437
|
-
`,
|
|
1437
|
+
`,Xd=go.div`
|
|
1438
1438
|
pointer-events: all;
|
|
1439
|
-
`,
|
|
1439
|
+
`,Gs=go.div`
|
|
1440
1440
|
display: flex;
|
|
1441
1441
|
align-content: center;
|
|
1442
1442
|
justify-content: center;
|
|
1443
1443
|
align-items: center;
|
|
1444
1444
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1445
|
-
`,
|
|
1445
|
+
`,Jd=go(Gs)`
|
|
1446
1446
|
width: ${qt+12}px;
|
|
1447
1447
|
height: ${qt+12}px;
|
|
1448
|
-
`,
|
|
1448
|
+
`,Qd=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:r=!0,primaryColor:n="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:c={},selectedStep:l=0,customStepTypes:g,appearance:d,dismissible:x=!1,showHighlightOnly:b,showStepCount:h=!0,completedStepsCount:T=0,showFrigadeBranding:f=!1,cssPosition:B="absolute"})=>{var se,pe,Ye,De,Et,ft,At,gt,u,C,v,W;let[w,S]=fo(),[A,y]=fo(new Date),m=Gd(null),[E,k]=fo(document.querySelector(e[l].selector)),P=_s(E,A),[O,I]=fo(),[N,$]=fo(!b),D=(pe=(se=e[l])==null?void 0:se.props)!=null&&pe.position?e[l].props.position:B,ee=((De=(Ye=e[l])==null?void 0:Ye.props)==null?void 0:De.zIndex)??90,U=(w==null?void 0:w.width)??js,te=(w==null?void 0:w.height)??Vs,fe=window.location.pathname.split("/").pop();Hs(()=>{m.current&&S({width:m.current.clientWidth,height:m.current.clientHeight})},[l,A,D]),Vo(()=>{b||$(!0)},[l]);let X=()=>{let M=document.querySelector(e[l].selector);if(!M){I(void 0),k(null);return}O&&O===JSON.stringify(M==null?void 0:M.getBoundingClientRect())||(k(M),y(new Date),M&&I(JSON.stringify(M.getBoundingClientRect())))};if(Vo(()=>{let M=new MutationObserver(X);return M.observe(document.body,{subtree:!0,childList:!0}),()=>M.disconnect()},[X]),Vo(()=>{let M=new MutationObserver(X);return M.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>M.disconnect()},[X]),Vo(()=>{let M=setInterval(()=>{X()},10);return()=>clearInterval(M)},[X]),Hs(()=>{setTimeout(()=>{X()},Kd),X()},[l,fe]),E===null||!p||P.height===0&&P.width===0&&D!=="fixed"&&B!=="static")return null;let H=i==="auto"?"right":i,j=Ar(P,H,U,s,D),Ce=P.right+U>(window.innerWidth||document.documentElement.clientWidth),Ie=P.bottom+Vs>(window.innerHeight||document.documentElement.clientHeight);Ce&&i==="auto"&&(j=Ar(P,"left",U,s,D),H="left"),(ft=(Et=e[l])==null?void 0:Et.props)!=null&&ft.tooltipPosition&&((gt=(At=e[l])==null?void 0:At.props)==null?void 0:gt.tooltipPosition)!=="auto"&&(((C=(u=e[l])==null?void 0:u.props)==null?void 0:C.tooltipPosition)==="left"||((W=(v=e[l])==null?void 0:v.props)==null?void 0:W.tooltipPosition)==="right")&&(H=e[l].props.tooltipPosition);let be=()=>{let M=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),$(!1),setTimeout(()=>{X()},30)),T===e.length-1)return o()},$e=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),b&&!e[l].secondaryButtonUri&&$(!1))};return _.createElement(_.Fragment,null,h&&e.length>1&&_.createElement(Jr,null,_.createElement(Zr,{className:a("tooltipStepCounter",d)},l+1," of ",e.length)),_.createElement(Qr,{showStepCount:h,className:a("tooltipCTAContainer",d)},e[l].secondaryButtonTitle&&_.createElement(Z,{title:e[l].secondaryButtonTitle,appearance:d,onClick:$e,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&_.createElement(Z,{title:e[l].primaryButtonTitle,appearance:d,onClick:M,withMargin:!1,size:"small"})))},me=()=>_.createElement(_.Fragment,null,x&&_.createElement(Gr,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",d),hasImage:!!e[l].imageUri||!!e[l].videoUri},_.createElement(Te,null)),e[l].imageUri&&_.createElement(Kr,{dismissible:x,appearance:d,src:e[l].imageUri,className:a("tooltipImageContainer",d)}),e[l].videoUri&&!e[l].imageUri&&_.createElement(qr,{dismissible:x,appearance:d,className:a("tooltipVideoContainer",d)},_.createElement(Ve,{appearance:d,videoUri:e[l].videoUri})),_.createElement(Xr,{className:a("tooltipContentContainer",d)},_.createElement(Fe,{appearance:d,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),_.createElement(Yr,{className:a("tooltipFooter",d)},_.createElement(be,null)))),ge={...{default:M=>{var $e;if(($e=e[l])!=null&&$e.StepContent){let El=e[l].StepContent;return _.createElement("div",null,El)}return _.createElement(me,null)}},...g},re=()=>{var M;return e?!((M=e[l])!=null&&M.type)||!ge[e[l].type]?ge.default(e[l]):ge[e[l].type]({stepData:e[l],primaryColor:n}):_.createElement(_.Fragment,null)};if(b&&e[l].complete===!0)return null;let L={top:(j==null?void 0:j.y)-qt,left:(H=="left"?P.x+s.x:(j==null?void 0:j.x)-qt)??0,cursor:b?"pointer":"default",position:D},V=()=>{let $e=L.left+(H=="left"?-U:24);return Math.min(Math.max($e,20),window.innerWidth-U-20)},G=()=>{if(D==="fixed")return L.top;let M=L.top+te,$e=20;return M>window.innerHeight-$e?L.top+-te:L.top},ne=()=>{b&&(y(new Date),$(!N))};return _.createElement(Xd,null,_.createElement(Jd,{style:L,zIndex:ee,className:a("tourHighlightContainer",d)},r&&e[l].showHighlight!==!1&&B!=="static"&&_.createElement(_.Fragment,null,_.createElement(Yd,{style:{position:D},onClick:ne,primaryColor:d.theme.colorPrimary,className:a("tourHighlightInnerCircle",d)}),_.createElement(qd,{style:{position:"absolute"},onClick:ne,primaryColor:d.theme.colorPrimary,className:a("tourHighlightOuterCircle",d)}))),_.createElement(Gs,{style:{...L,left:V(),top:G()},zIndex:ee+1,className:a("tooltipContainerWrapper",d)},N&&_.createElement(_.Fragment,null,_.createElement(Co,{ref:m,layoutId:"tooltip-container",style:{position:"relative",width:"max-content",right:0,top:B!=="static"?12:0,...c},appearance:d,className:a("tooltipContainer",d),maxWidth:js,zIndex:ee+10},_.createElement(re,null)),f&&_.createElement(ei,{className:a("poweredByFrigadeTooltipRibbon",d),appearance:d,zIndex:ee+10},_.createElement(yo,{appearance:d})))))},Go=Qd;import{Portal as ec}from"react-portal";var tc=({flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:r,showTooltipsSimultaneously:n=!1,onDismiss:s,dismissible:p,tooltipPosition:c="auto",showHighlightOnly:l=!1,dismissBehavior:g="complete-flow",onComplete:d,skipIfNotFound:x=!1,cssPosition:b="absolute",...h})=>{let{getFlow:T,getFlowSteps:f,isLoading:B,targetingLogicShouldHideFlow:w,markStepCompleted:S,markStepStarted:A,markFlowCompleted:y,updateCustomVariables:m,getCurrentStepIndex:E,getStepStatus:k,isStepBlocked:P,getFlowStatus:O,getNumberOfStepsCompleted:I}=Y(),{isLoadingUserFlowStateData:N}=Be(),{primaryCTAClickSideEffects:$,secondaryCTAClickSideEffects:D}=ie(),{hasOpenModals:ee}=we(),U=E(e),{openFlowStates:te}=Zd(K),{mergeAppearanceWithDefault:fe}=Q();if(o=fe(o),Rd(()=>{m(t)},[t,B]),N)return null;let X=T(e);if(!X||w(X)||O(e)==q||ee())return null;let H=f(e);if(Object.keys(te).length>0){let L=Object.keys(te).find(V=>te[V]===!0);if(L!==void 0&&L!==e)return ut.createElement(ut.Fragment,null)}async function j(L){if(await S(e,L.id),H.map(V=>k(e,V.id)).every(V=>V===Ue)){await y(e);return}if(!l&&U+1<H.length){if(P(e,H[U+1].id))return;await A(e,H[U+1].id)}}function Ce(L,V,G){let ne=U+1<H.length?H[U+1]:null;r&&r(L,U,V,ne),i&&i(L,G,ne)}function Ie(){return H.map(L=>({...L,handleSecondaryButtonClick:async()=>{D(L),L.skippable===!0&&await S(e,L.id,{skipped:!0}),Ce(L,"secondary",U)},handlePrimaryButtonClick:async()=>{(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&await j(L),Ce(L,"primary",U),$(L)}}))}async function be(L){s&&s(),g==="complete-flow"?await y(e):await S(e,L.id)}function me(){d&&d()}let J=!document.querySelector(H[U].selector);function ge(){let L=H.findIndex(V=>!!document.querySelector(V.selector));return H.map((V,G)=>J&&!n&&G!==L&&x?null:ut.createElement(Go,{key:V.id,appearance:o,steps:Ie(),selectedStep:G,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>be(V),tooltipPosition:c,showHighlightOnly:l,completedStepsCount:I(e),onComplete:me,cssPosition:b,...h}))}function re(){return ut.createElement(ut.Fragment,null,ut.createElement(oe,{appearance:o}),n||J&&x?ge():ut.createElement(Go,{appearance:o,steps:Ie(),selectedStep:U,showTooltipsSimultaneously:n,dismissible:p,onDismiss:()=>be(H[U]),tooltipPosition:c,completedStepsCount:I(e),showHighlightOnly:l,onComplete:me,cssPosition:b,...h}))}return b==="static"?re():ut.createElement(ec,null,re())};import Ae,{useEffect as oc,useRef as rc,useState as ic}from"react";import{Portal as nc}from"react-portal";import vt from"styled-components";var Ks=vt.button`
|
|
1449
1449
|
${e=>F(e)} {
|
|
1450
1450
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1451
1451
|
|
|
@@ -1463,17 +1463,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1463
1463
|
opacity: 0.8;
|
|
1464
1464
|
}
|
|
1465
1465
|
}
|
|
1466
|
-
`,
|
|
1466
|
+
`,qs=vt.span`
|
|
1467
1467
|
${e=>F(e)} {
|
|
1468
1468
|
font-size: 12px;
|
|
1469
1469
|
display: inline-block;
|
|
1470
1470
|
}
|
|
1471
|
-
`,
|
|
1471
|
+
`,Ys=vt.span`
|
|
1472
1472
|
${e=>F(e)} {
|
|
1473
1473
|
font-size: 12px;
|
|
1474
1474
|
display: inline-block;
|
|
1475
1475
|
}
|
|
1476
|
-
`,
|
|
1476
|
+
`,Xs=vt.div`
|
|
1477
1477
|
position: fixed;
|
|
1478
1478
|
right: 0;
|
|
1479
1479
|
bottom: 0;
|
|
@@ -1483,7 +1483,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1483
1483
|
flex-direction: column;
|
|
1484
1484
|
align-items: flex-end;
|
|
1485
1485
|
z-index: 50;
|
|
1486
|
-
`,
|
|
1486
|
+
`,Js=vt.button`
|
|
1487
1487
|
${e=>F(e)} {
|
|
1488
1488
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1489
1489
|
background-color: #ffffff;
|
|
@@ -1499,7 +1499,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1499
1499
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1500
1500
|
border-radius: 45px;
|
|
1501
1501
|
cursor: pointer;
|
|
1502
|
-
`,
|
|
1502
|
+
`,Qs=vt.div`
|
|
1503
1503
|
${e=>F(e)} {
|
|
1504
1504
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1505
1505
|
background: #ffffff;
|
|
@@ -1516,7 +1516,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1516
1516
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1517
1517
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1518
1518
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1519
|
-
`,
|
|
1519
|
+
`,Zs=vt.button`
|
|
1520
1520
|
${e=>F(e)} {
|
|
1521
1521
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1522
1522
|
color: #434343;
|
|
@@ -1533,7 +1533,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1533
1533
|
font-size: 14px;
|
|
1534
1534
|
|
|
1535
1535
|
padding: 8px 12px;
|
|
1536
|
-
`;import
|
|
1536
|
+
`;import Rs from"react";var el=({style:e,className:t})=>Rs.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Rs.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 tl from"react";var ol=({style:e,className:t})=>tl.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"},tl.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 sc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:r="inline",title:n="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:c,markStepCompleted:l,getStepStatus:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:b}=Y(),{primaryCTAClickSideEffects:h}=ie(),T=rc(null),[f,B]=ic(!1),{mergeAppearanceWithDefault:w}=Q();s=w(s),oc(()=>(document.addEventListener("click",S,!1),()=>{document.removeEventListener("click",S,!1)}),[]);let S=k=>{T.current&&!T.current.contains(k.target)&&B(!1)};if(x)return null;let A=p(e);if(!A||b(A))return null;let y=c(e);if(!y||!i)return null;function m(k,P){!k.completionCriteria&&(k.autoMarkCompleted||k.autoMarkCompleted===void 0)&&l(e,k.id),h(k),o&&o(k,P),B(!1)}function E(){return f&&Ae.createElement(Qs,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:r},y.map((k,P)=>Ae.createElement(Zs,{className:a("floatingWidgetMenuItem",s),key:P,onClick:()=>m(k,P)},k.title)))}return r=="inline"?Ae.createElement("span",{ref:T},Ae.createElement(Ks,{style:t,onClick:()=>{B(!f)},className:a("supportButton",s)},Ae.createElement(Ys,{className:a("supportIconContainer",s)},Ae.createElement(ol,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),Ae.createElement(qs,{className:a("supportButtonTitle",s)},n)),Ae.createElement(E,null)):Ae.createElement(nc,null,Ae.createElement(Xs,{style:t,ref:T},Ae.createElement(E,null),Ae.createElement(Js,{onClick:()=>{B(!f)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},Ae.createElement(el,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import qe,{useEffect as lc}from"react";import Ko from"styled-components";var rl=Ko.div`
|
|
1537
1537
|
${e=>F(e)} {
|
|
1538
1538
|
display: flex;
|
|
1539
1539
|
flex-direction: column;
|
|
@@ -1548,17 +1548,17 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1548
1548
|
border-radius: 12px;
|
|
1549
1549
|
position: relative;
|
|
1550
1550
|
}
|
|
1551
|
-
`,
|
|
1551
|
+
`,il=Ko.div`
|
|
1552
1552
|
display: flex;
|
|
1553
1553
|
flex-direction: column;
|
|
1554
1554
|
flex: 1;
|
|
1555
|
-
`,
|
|
1555
|
+
`,nl=Ko.div`
|
|
1556
1556
|
display: flex;
|
|
1557
1557
|
flex-direction: column;
|
|
1558
1558
|
justify-content: center;
|
|
1559
1559
|
align-items: flex-start;
|
|
1560
1560
|
margin-top: 16px;
|
|
1561
|
-
`,
|
|
1561
|
+
`,sl=Ko.div`
|
|
1562
1562
|
${e=>F(e)} {
|
|
1563
1563
|
position: absolute;
|
|
1564
1564
|
top: 16px;
|
|
@@ -1569,7 +1569,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1569
1569
|
opacity: 0.8;
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
|
-
`;var
|
|
1572
|
+
`;var ac=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:b,getFlowSteps:h,getFlowStatus:T,getCurrentStepIndex:f}=Y(),{primaryCTAClickSideEffects:B}=ie(),{mergeAppearanceWithDefault:w}=Q();if(r=w(r),lc(()=>{b(o)},[o,d]),d)return null;let S=c(e);if(!S||x(S)||T(e)===q)return null;let y=h(e)[f(e)];return qe.createElement(qe.Fragment,null,qe.createElement(oe,{appearance:r}),qe.createElement(rl,{appearance:r,className:xe(a("embeddedTipContainer",r),n),style:s},(p===!0||y.dismissible)&&qe.createElement(sl,{onClick:async()=>{await l(e),t&&t()},className:a("embeddedTipDismissButton",r)},qe.createElement(Te,null)),qe.createElement(il,null,qe.createElement(Fe,{size:"small",appearance:r,title:y.title,subtitle:y.subtitle})),y.primaryButtonTitle&&qe.createElement(nl,{className:a("embeddedTipCallToActionContainer",r)},qe.createElement(Z,{classPrefix:"embeddedTip",title:y.primaryButtonTitle,appearance:r,withMargin:!1,size:"medium",type:"inline",onClick:async()=>{y.handlePrimaryButtonClick(),B(y),!(i&&i(y,f(e),"primary")===!1)&&(await g(e,y.id),await l(e))}}))))};import ye,{useEffect as pc}from"react";import Yt from"styled-components";var ll=Yt.div`
|
|
1573
1573
|
// use the :not annotation
|
|
1574
1574
|
${e=>F(e)} {
|
|
1575
1575
|
display: flex;
|
|
@@ -1581,24 +1581,24 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1581
1581
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1582
1582
|
border-radius: 12px;
|
|
1583
1583
|
}
|
|
1584
|
-
`,
|
|
1584
|
+
`,al=Yt.div`
|
|
1585
1585
|
${e=>F(e)} {
|
|
1586
1586
|
display: flex;
|
|
1587
1587
|
width: 46px;
|
|
1588
1588
|
height: 46px;
|
|
1589
1589
|
}
|
|
1590
|
-
`,
|
|
1590
|
+
`,pl=Yt.div`
|
|
1591
1591
|
display: flex;
|
|
1592
1592
|
flex-direction: column;
|
|
1593
1593
|
flex: 1;
|
|
1594
1594
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1595
1595
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1596
|
-
`,
|
|
1596
|
+
`,dl=Yt.div`
|
|
1597
1597
|
display: flex;
|
|
1598
1598
|
flex-direction: column;
|
|
1599
1599
|
justify-content: center;
|
|
1600
1600
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1601
|
-
`,
|
|
1601
|
+
`,Ir=Yt.div`
|
|
1602
1602
|
display: flex;
|
|
1603
1603
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1604
1604
|
align-items: flex-end;
|
|
@@ -1606,12 +1606,12 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1606
1606
|
:hover {
|
|
1607
1607
|
opacity: 0.8;
|
|
1608
1608
|
}
|
|
1609
|
-
`,
|
|
1609
|
+
`,Nr=Yt.div`
|
|
1610
1610
|
display: flex;
|
|
1611
1611
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1612
1612
|
align-items: flex-end;
|
|
1613
1613
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1614
|
-
`;import
|
|
1614
|
+
`;import Or from"react";var cl=({style:e,className:t})=>Or.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Or.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Or.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var dc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:r,onButtonClick:n,appearance:s,type:p="full-width",icon:c})=>{let{getFlow:l,markFlowCompleted:g,isLoading:d,targetingLogicShouldHideFlow:x,updateCustomVariables:b,getFlowMetadata:h,getFlowStatus:T,getFlowSteps:f,getCurrentStepIndex:B}=Y(),{primaryCTAClickSideEffects:w}=ie(),{mergeAppearanceWithDefault:S}=Q();if(s=S(s),pc(()=>{b(r)},[r,d]),d)return null;let A=l(e);if(!A||x(A)||T(e)===q)return null;let y=f(e),m=y.length>0?y[B(e)]:h(e);return m!=null&&m.title&&(t=m.title),m!=null&&m.subtitle&&(o=m.subtitle),ye.createElement(ye.Fragment,null,ye.createElement(oe,{appearance:s}),ye.createElement(ll,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&ye.createElement(al,{className:a("bannerIconContainer",s)},c||ye.createElement(cl,null)),p==="square"&&m.dismissible&&ye.createElement(Nr,{type:p,className:a("bannerDismissButtonContainer",s)},ye.createElement(Ir,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},ye.createElement(Te,null))),ye.createElement(pl,{type:p},ye.createElement(Fe,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(m==null?void 0:m.primaryButtonTitle)&&ye.createElement(dl,{type:p,className:a("bannerCallToActionContainer",s)},ye.createElement(Z,{title:m==null?void 0:m.primaryButtonTitle,appearance:s,onClick:()=>{w(m),n&&n(m,0,"primary")},classPrefix:"banner"})),p!=="square"&&m.dismissible&&ye.createElement(Nr,{type:p,className:a("bannerDismissButtonContainer",s)},ye.createElement(Ir,{type:p,onClick:async()=>{await g(e),i&&i()},className:a("bannerDismissButton",s)},ye.createElement(Te,null)))))};import R,{useEffect as cc}from"react";import{Portal as mc}from"react-portal";import it from"styled-components";var ml=it.div`
|
|
1615
1615
|
display: flex;
|
|
1616
1616
|
flex-direction: column;
|
|
1617
1617
|
width: 100%;
|
|
@@ -1630,7 +1630,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1630
1630
|
z-index: 1000;
|
|
1631
1631
|
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
1632
1632
|
min-width: 550px;
|
|
1633
|
-
`,
|
|
1633
|
+
`,ul=it.button`
|
|
1634
1634
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1635
1635
|
border-radius: 8px;
|
|
1636
1636
|
// If selected make border color primary and text color color priamry
|
|
@@ -1651,33 +1651,33 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1651
1651
|
display: flex;
|
|
1652
1652
|
justify-content: center;
|
|
1653
1653
|
align-items: center;
|
|
1654
|
-
`,
|
|
1654
|
+
`,Lr=it.div`
|
|
1655
1655
|
display: flex;
|
|
1656
1656
|
justify-content: space-between;
|
|
1657
1657
|
margin-top: 16px;
|
|
1658
1658
|
gap: 8px;
|
|
1659
|
-
`,
|
|
1659
|
+
`,fl=it.div`
|
|
1660
1660
|
display: flex;
|
|
1661
1661
|
justify-content: space-between;
|
|
1662
1662
|
margin-top: 8px;
|
|
1663
|
-
`,
|
|
1663
|
+
`,Dr=it.div`
|
|
1664
1664
|
font-size: 12px;
|
|
1665
1665
|
line-height: 18px;
|
|
1666
1666
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1667
1667
|
font-style: normal;
|
|
1668
1668
|
font-weight: 400;
|
|
1669
1669
|
letter-spacing: 0.24px;
|
|
1670
|
-
|
|
1670
|
+
`,$r=it.div`
|
|
1671
1671
|
display: flex;
|
|
1672
1672
|
flex-direction: column;
|
|
1673
1673
|
flex: 1;
|
|
1674
|
-
`,
|
|
1674
|
+
`,jb=it.div`
|
|
1675
1675
|
display: flex;
|
|
1676
1676
|
flex-direction: column;
|
|
1677
1677
|
justify-content: center;
|
|
1678
1678
|
align-items: flex-start;
|
|
1679
1679
|
margin-top: 16px;
|
|
1680
|
-
`,
|
|
1680
|
+
`,gl=it.textarea`
|
|
1681
1681
|
${e=>F(e)} {
|
|
1682
1682
|
margin-top: 16px;
|
|
1683
1683
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
@@ -1688,7 +1688,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1688
1688
|
width: 100%;
|
|
1689
1689
|
height: 100px;
|
|
1690
1690
|
}
|
|
1691
|
-
`,
|
|
1691
|
+
`,xl=it.div`
|
|
1692
1692
|
${e=>F(e)} {
|
|
1693
1693
|
position: absolute;
|
|
1694
1694
|
top: 16px;
|
|
@@ -1699,7 +1699,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1699
1699
|
opacity: 0.8;
|
|
1700
1700
|
}
|
|
1701
1701
|
}
|
|
1702
|
-
`;var
|
|
1702
|
+
`;var uc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,type:p="modal"})=>{let{getFlow:c,markFlowCompleted:l,markStepCompleted:g,getNumberOfStepsCompleted:d,isLoading:x,targetingLogicShouldHideFlow:b,updateCustomVariables:h,getFlowSteps:T,getFlowStatus:f,getCurrentStepIndex:B}=Y(),{primaryCTAClickSideEffects:w}=ie(),{mergeAppearanceWithDefault:S}=Q(),[A,y]=R.useState(null),[m,E]=R.useState(""),{hasOpenModals:k,setKeepCompletedFlowOpenDuringSession:P,shouldKeepCompletedFlowOpenDuringSession:O}=we();if(r=S(r),cc(()=>{h(o)},[o,x]),x)return null;let I=c(e);if(!I||b(I)||f(e)===q||d(e)===1&&!O(e)||k())return null;let $=T(e)[d(e)];function D(){return R.createElement(R.Fragment,null,R.createElement($r,null,R.createElement(Fe,{size:"large",appearance:r,title:$.title,subtitle:$.subtitle})),R.createElement(Lr,{className:a("npsNumberButtonContainer",r),appearance:r},Array.from(Array(10).keys()).map(te=>R.createElement(ul,{className:a("npsNumberButton",r),selected:A===te+1,key:te,onClick:async()=>{P(e),y(te+1),await g(e,$.id,{score:te+1})},appearance:r},te+1))),R.createElement(fl,{appearance:r},R.createElement(Dr,{appearance:r},"Not likely at all"),R.createElement(Dr,{appearance:r},"Extremely likely")))}function ee(){return R.createElement(R.Fragment,null,R.createElement($r,null,R.createElement(Fe,{appearance:r,title:$.title??"Why did you choose this score?",size:"large"})),R.createElement(gl,{appearance:r,value:m,onChange:te=>{E(te.target.value)},placeHolder:"Add your optional fedback here..."}),R.createElement(Lr,{appearance:r,className:a("npsNumberButtonContainer",r)},R.createElement(Z,{size:"large",withMargin:!1,onClick:async()=>{await l(e),i&&i($,1,"primary")},appearance:r,title:$.secondaryButtonTitle||"Skip",secondary:!0}),R.createElement(Z,{size:"large",withMargin:!1,onClick:async()=>{await g(e,$.id,{feedbackText:m}),await l(e),i&&i($,1,"primary")},appearance:r,title:$.primaryButtonTitle||"Submit"})))}function U(){return d(e)>=2?null:R.createElement(R.Fragment,null,R.createElement(oe,{appearance:r}),R.createElement(ml,{appearance:r,className:xe(a("npsSurveyContainer",r),n),style:s,type:p},R.createElement(xl,{onClick:async()=>{await l(e),t&&t()},className:a("npsSurveyDismissButton",r)},R.createElement(Te,null)),d(e)==0&&D(),d(e)==1&&ee()))}return p==="inline"?U():R.createElement(mc,null,U())};import Se,{useEffect as xc}from"react";import Bt from"styled-components";var hl=Bt.div`
|
|
1703
1703
|
${e=>F(e)} {
|
|
1704
1704
|
display: flex;
|
|
1705
1705
|
flex-direction: column;
|
|
@@ -1710,21 +1710,21 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1710
1710
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1711
1711
|
position: relative;
|
|
1712
1712
|
}
|
|
1713
|
-
`,
|
|
1713
|
+
`,Cl=Bt.div`
|
|
1714
1714
|
display: flex;
|
|
1715
1715
|
flex-direction: column;
|
|
1716
1716
|
flex: 1;
|
|
1717
|
-
`,
|
|
1717
|
+
`,yl=Bt.div`
|
|
1718
1718
|
display: flex;
|
|
1719
1719
|
flex-direction: row;
|
|
1720
1720
|
justify-content: center;
|
|
1721
1721
|
align-items: stretch;
|
|
1722
1722
|
gap: 16px;
|
|
1723
1723
|
margin-top: 8px;
|
|
1724
|
-
`,
|
|
1724
|
+
`,Sl=Bt.div`
|
|
1725
1725
|
margin-top: 16px;
|
|
1726
1726
|
margin-bottom: 16px;
|
|
1727
|
-
`,
|
|
1727
|
+
`,bl=Bt.div`
|
|
1728
1728
|
${e=>F(e)} {
|
|
1729
1729
|
position: absolute;
|
|
1730
1730
|
top: -16px;
|
|
@@ -1735,7 +1735,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1735
1735
|
opacity: 0.8;
|
|
1736
1736
|
}
|
|
1737
1737
|
}
|
|
1738
|
-
`,
|
|
1738
|
+
`,wl=Bt.h1`
|
|
1739
1739
|
${e=>F(e)} {
|
|
1740
1740
|
font-style: normal;
|
|
1741
1741
|
justify-content: center;
|
|
@@ -1749,7 +1749,7 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1749
1749
|
color: ${e=>e.appearance.theme.colorText};
|
|
1750
1750
|
margin-bottom: 8px;
|
|
1751
1751
|
}
|
|
1752
|
-
`,
|
|
1752
|
+
`,Tl=Bt.h2`
|
|
1753
1753
|
${e=>F(e)} {
|
|
1754
1754
|
font-style: normal;
|
|
1755
1755
|
justify-content: center;
|
|
@@ -1761,10 +1761,10 @@ ${i=>i.inlineStyles.map(([r,n])=>`.${Qt}${r}.${Qt}${r} { ${Object.entries(n).map
|
|
|
1761
1761
|
letter-spacing: 0.28px;
|
|
1762
1762
|
margin-bottom: 8px;
|
|
1763
1763
|
}
|
|
1764
|
-
`;import
|
|
1764
|
+
`;import Fl from"react";import fc from"styled-components";var gc=fc.img`
|
|
1765
1765
|
width: 100%;
|
|
1766
1766
|
height: 100%;
|
|
1767
1767
|
min-height: 200px;
|
|
1768
1768
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1769
|
-
`;function
|
|
1769
|
+
`;function kl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Fl.createElement(Ve,{appearance:t,videoUri:e.videoUri}):e.imageUri?Fl.createElement(gc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var hc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:r,className:n,style:s,dismissible:p=!0,modalPosition:c})=>{let{getFlow:l,markFlowCompleted:g,markStepCompleted:d,isLoading:x,targetingLogicShouldHideFlow:b,updateCustomVariables:h,getFlowSteps:T,getFlowStatus:f,getCurrentStepIndex:B}=Y(),{primaryCTAClickSideEffects:w,secondaryCTAClickSideEffects:S}=ie(),{mergeAppearanceWithDefault:A}=Q(),{setOpenFlowState:y,getOpenFlowState:m,hasOpenModals:E}=we(),[k,P]=[m(e,!0),U=>y(e,U)];if(r=A(r),xc(()=>{h(o)},[o,x]),x)return null;let O=l(e);if(!O||b(O)||f(e)===q||E())return null;let N=T(e)[B(e)],$=()=>{P(!1),t&&t(),g(e)};function D(){return Se.createElement(Se.Fragment,null,Se.createElement(oe,{appearance:r}),Se.createElement(hl,{appearance:r,className:xe(a("announcementContainer",r),n),style:s},(p===!0||N.dismissible)&&c=="inline"&&Se.createElement(bl,{onClick:async()=>{await g(e),t&&t()},className:a("announcementDismissButton",r)},Se.createElement(Te,null)),Se.createElement(Cl,null,Se.createElement(wl,{appearance:r,className:a("announcementTitle",r),dangerouslySetInnerHTML:le(N.title)}),N.subtitle&&Se.createElement(Tl,{appearance:r,className:a("announcementSubtitle",r),dangerouslySetInnerHTML:le(N.subtitle)})),(N.imageUri||N.videoUri)&&Se.createElement(Sl,{className:a("announcementMediaContainer",r)},Se.createElement(kl,{appearance:r,stepData:N})),(N.primaryButtonTitle||N.secondaryButtonTitle)&&Se.createElement(yl,{className:a("announcementCTAContainer",r)},N.secondaryButtonTitle&&Se.createElement(Z,{classPrefix:"announcement",title:N.secondaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{N.handleSecondaryButtonClick(),S(N),i&&i(N,B(e),"secondary")},secondary:!0}),N.primaryButtonTitle&&Se.createElement(Z,{classPrefix:"announcement",title:N.primaryButtonTitle,appearance:r,withMargin:!1,size:"small",type:"full-width",onClick:async()=>{N.handlePrimaryButtonClick(),w(N),!(i&&i(N,B(e),"primary")===!1)&&(await d(e,N.id),await g(e))}}))))}let ee={padding:"24px",maxWidth:"400px"};return c==="inline"?D():c!=="center"?Se.createElement(wo,{modalPosition:c,onClose:$,visible:k,dismissible:p,appearance:r},D()):Se.createElement(He,{appearance:r,onClose:$,visible:k,style:ee,dismissible:p},D())};import*as qo from"react";import Pl from"react";var vl=({as:e="span",children:t,variant:o="Body1",...i})=>Pl.createElement(Ji,{color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o,...i},t),Cc=Object.fromEntries(Object.keys(Do).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>Pl.createElement(vl,{as:t,...i,variant:e},i.children);return o.displayName=`Text.${e}`,[e,o]})),Mr=Object.assign(vl,Cc);var Bl=({as:e="button",className:t,size:o="md",title:i,variant:r="Primary",...n})=>{var s;return qo.createElement(Xi,{className:`fr-button-${r.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:r,size:o,borderRadius:"md",...n},qo.createElement(Mr,{color:(s=ao[r])==null?void 0:s.color,fontWeight:"semibold"},i))},yc=Object.fromEntries(Object.keys(ao).map(e=>{let t=o=>qo.createElement(Bl,{...o,variant:e});return t.displayName=`Button.${e}`,[e,t]})),Sc=Object.assign(Bl,yc);export{lo as Box,Sc as Button,Qe as CheckBox,st as FormLabel,sr as FormTextField,hc as FrigadeAnnouncement,dc as FrigadeBanner,Er as FrigadeChecklist,Je as FrigadeDefaultAppearance,ac as FrigadeEmbeddedTip,_i as FrigadeForm,_d as FrigadeGuide,Md as FrigadeHeroChecklist,uc as FrigadeNPSSurvey,zd as FrigadeProgressBadge,qp as FrigadeProvider,sc as FrigadeSupportWidget,tc as FrigadeTour,$t as ProgressRing,Mr as Text,Sr as tokens,we as useFlowOpens,Xt as useFlowResponses,Y as useFlows,hr as useOrganization,Jt as useUser,Be as useUserFlowStates};
|
|
1770
1770
|
//# sourceMappingURL=index.mjs.map
|