@frigade/react 1.37.11 → 1.37.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/dist/index.js +178 -176
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +240 -238
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnPropertyDescriptors;var Io=Object.getOwnPropertySymbols;var li=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable;var si=(e,t,o)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,T=(e,t)=>{for(var o in t||(t={}))li.call(t,o)&&si(e,o,t[o]);if(Io)for(var o of Io(t))ai.call(t,o)&&si(e,o,t[o]);return e},V=(e,t)=>sa(e,la(t));var pi=e=>typeof e=="symbol"?e:e+"",Le=(e,t)=>{var o={};for(var i in e)li.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Io)for(var i of Io(e))t.indexOf(i)<0&&ai.call(e,i)&&(o[i]=e[i]);return o};var M=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(s){n(s)}},l=d=>{try{p(o.throw(d))}catch(s){n(s)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,l);p((o=o.apply(e,t)).next())});import Ro,{createContext as Td,useEffect as er,useState as Ke}from"react";import{ThemeProvider as Fd}from"styled-components";import Nt,{useContext as Zp,useEffect as Zt,useState as Fo}from"react";import{useCallback as Bt,useContext as Sa,useEffect as ba}from"react";import ur,{useMemo as ci}from"react";var di="1.37.11";var lt="NOT_STARTED_STEP",oe="COMPLETED_FLOW",Lo="ABORTED_FLOW",vt="STARTED_FLOW",Ue="NOT_STARTED_FLOW",$e="COMPLETED_STEP",fo="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=ur.useContext(X);return{config:ci(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":di,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:ci(()=>`${o}/v1/public/`,[o])}}var aa="frigade-last-call-at-",pa="frigade-last-call-data-";function Vt(){let{shouldGracefullyDegrade:e,readonly:t}=ur.useContext(X);return(o,i)=>M(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Ht();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Ht();let n=aa+o,r=pa+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(p&&d&&d==i.body){let s=new Date(p);if(new Date().getTime()-s.getTime()<1e3)return Ht()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let l;try{l=yield fetch(o,i)}catch(p){return Ht(p)}return l?l.ok?l:Ht(l.statusText):Ht()})}function Ht(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function jt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=ur.useContext(X);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as xa,useState as mi}from"react";import{useContext as ca,useEffect as ma,useState as ua}from"react";import fa from"swr";import{useContext as da}from"react";function Ee(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=da(X);function r(c,f=!1){var S;return(S=e[c])!=null?S:f}function l(c,f){t(S=>V(T({},S),{[c]:f}))}function p(c){t(f=>{let b=f,{[c]:S}=b,w=Le(b,[pi(c)]);return T({},w)})}function d(c){n.includes(c)||i(f=>[...f,c])}function s(c){return n.includes(c)}function m(c){return Object.entries(e).some(([f,S])=>S&&f!=c)||o}return{getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}import ga from"swr/immutable";import go from"core-js-pure/actual/structured-clone";function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ye(...e){let t=e.shift(),o=e.length===1?e[0]:ye(...e);if(!fr(t)||!fr(o))throw new Error("deepmerge can only merge Objects");let i=go(t);return Object.entries(o).forEach(([n,r])=>{fr(r)?i[n]!==void 0?Object.assign(i,{[n]:ye(i[n],go(r))}):Object.assign(i,{[n]:go(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...go(r)]}):Object.assign(i,{[n]:go(r)}):Object.assign(i,{[n]:r})}),i}var ha="unknown";function _e(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=ca(X),{resetOpenFlowState:d}=Ee(),[s,m]=ua(!1),c={data:r.map(F=>({flowId:F.id,flowState:oe,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=F=>fetch(F,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${F}: ${P}. Will gracefully degrade and hide Frigade`),l(!0),c)),S=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:w,isLoading:b,mutate:x,error:v}=p?ga(S,f):fa(S,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),k=w==null?void 0:w.data;ma(()=>{!s&&!b&&k&&m(!0)},[k,s,b]);function B(F){return M(this,null,function*(){if(k&&!p){let P=k.find(I=>I.flowId===F);P&&P.flowState!==oe&&(P.flowState=oe),yield x(Promise.resolve(ye(w,{data:k})),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function L(F,P,I){return M(this,null,function*(){if(k){let O=k.find(A=>A.flowId===F);O&&(O.stepStates[P]=I,O.flowState=vt),yield x(Promise.resolve(ye(w,{data:k})),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function C(F,P,I){return M(this,null,function*(){if(k){let O=k.find(A=>A.flowId===F);O&&(O.lastStepId=P,O.stepStates[P]=I,O.flowState=vt),yield x(ye(w,{data:k}),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function u(F){return M(this,null,function*(){if(k){let P=k.find(I=>I.flowId===F);P&&P.flowState!==Ue&&(P.flowState=Ue,P.lastStepId=ha,Object.keys(P.stepStates).forEach(I=>{P.stepStates[I].actionType=lt,P.stepStates[I].createdAt=new Date().toISOString()}),yield x(ye(w,{data:k}),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1}),d(F))}})}function N(F,P,I){return M(this,null,function*(){if(k){let O=k.find(A=>A.flowId===F);O&&(O.stepStates[P]=I),yield x(Promise.resolve(ye(w,{data:k})),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:k,isLoadingUserFlowStateData:!s,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:B,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:L,optimisticallyMarkStepNotStarted:N,optimisticallyMarkStepStarted:C,error:v}}function ho(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=_e(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=xa(X),[d,s]=mi(new Set),[m,c]=mi(new Set),f=Vt();function S(x){let v=JSON.stringify(x);if(d.has(v))return null;d.add(v),s(d),m.add(x),c(m);let k=l==null?void 0:l.find(B=>B.flowSlug===x.flowSlug&&B.stepId===x.stepId&&B.actionType===x.actionType&&B.createdAt===x.createdAt);return f(`${t}flowResponses`,V(T({},e),{method:"POST",body:v})).then(B=>{B.status!==200&&B.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):k||p(L=>[...L!=null?L:[],x])})}function w(x){return M(this,null,function*(){x.foreignUserId&&(x.actionType===vt||x.actionType===Ue?yield S(x):x.actionType===oe?yield S(x):x.actionType===fo?yield S(x):x.actionType===$e?yield S(x):x.actionType===Lo?yield S(x):x.actionType===lt&&(yield S(x)))})}function b(){let x=[];return o==null||o.forEach(v=>{if(v&&v.stepStates&&Object.keys(v.stepStates).length!==0)for(let k in v.stepStates){let B=v.stepStates[k];x.push({foreignUserId:v.foreignUserId,flowSlug:v.flowId,stepId:B.stepId,actionType:B.actionType,data:{},createdAt:new Date(B.createdAt),blocked:B.blocked,hidden:B.hidden})}}),[...x,...l]}return{addResponse:w,setFlowResponses:p,getFlowResponses:b}}import wa from"swr";var Ca=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ui=e=>{let t=Ca.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=ya(i,"'","");r.startsWith("flow_")&&(o=r)}),o},ya=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function $o(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var gr=(s=>(s.CHECKLIST="CHECKLIST",s.FORM="FORM",s.TOUR="TOUR",s.SUPPORT="SUPPORT",s.CUSTOM="CUSTOM",s.BANNER="BANNER",s.EMBEDDED_TIP="EMBEDDED_TIP",s.NPS_SURVEY="NPS_SURVEY",s.ANNOUNCEMENT="ANNOUNCEMENT",s))(gr||{});function R(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:f,readonly:S,flowDataOverrides:w}=Sa(X),b={data:[]},{verifySDKInitiated:x}=jt(),{addResponse:v,getFlowResponses:k}=ho(),B=g=>fetch(g,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${g} (${y.status}): ${y.statusText}. Will gracefully degrade and hide Frigade`),f(!0),b)).catch(y=>(console.log(`Error fetching ${g}: ${y}. Will gracefully degrade and hide Frigade`),f(!0),b)),{mutateUserFlowState:L,userFlowStatesData:C,isLoadingUserFlowStateData:u,optimisticallyMarkFlowCompleted:N,optimisticallyMarkFlowNotStarted:F,optimisticallyMarkStepCompleted:P,optimisticallyMarkStepNotStarted:I,optimisticallyMarkStepStarted:O}=_e(),{data:A,error:G,isLoading:_}=wa(l?`${t}flows${S?"?readonly=true":""}`:null,B,{keepPreviousData:!0});ba(()=>{if(G){console.error(G);return}A&&A.data&&i(A.data)},[A,G]);function Q(g){if(_)return null;let y=o.find(h=>h.slug===g);return!y&&o.length>0&&!u&&!_?(console.log(`Flow with id ${g} not found`),null):(y&&w&&w[g]&&(y.data=w[g]),(y==null?void 0:y.active)===!1&&!S?null:y)}function Y(g){var D,ge,De,xt,Pt;if(!Q(g))return[];let y=(D=Q(g))==null?void 0:D.data;return y?(y=ae(y),((Pt=(xt=(ge=$o(y))==null?void 0:ge.data)!=null?xt:(De=$o(y))==null?void 0:De.steps)!=null?Pt:[]).map(ue=>{let mo=de(ue);return V(T({handleSecondaryButtonClick:()=>{ue.skippable===!0&&Z(g,ue.id,{skipped:!0})}},ue),{complete:xe(g,ue.id)===$e||mo>=1,started:xe(g,ue.id)===fo||xe(g,ue.id)===$e,currentlyActive:C==null?void 0:C.some(uo=>uo.flowId==g&&uo.lastStepId===ue.id),blocked:Ce(g,ue.id),hidden:H(g,ue.id),handlePrimaryButtonClick:()=>{(!ue.completionCriteria&&(ue.autoMarkCompleted||ue.autoMarkCompleted===void 0)||ue.completionCriteria&&ue.autoMarkCompleted===!0)&&Z(g,ue.id)},progress:mo})}).filter(ue=>ue.hidden!==!0)):[]}function ae(g){return g.replaceAll(/\${(.*?)}/g,(y,h)=>p[h]===void 0?"":String(p[h]).replace(/[\u00A0-\u9999<>\&]/g,function(D){return"&#"+D.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function J(g){var h;if(!Q(g))return[];let y=Q(g).data;return y?(y=ae(y),(h=JSON.parse(y))!=null?h:{}):[]}function q(g,y){d(h=>V(T({},h),{[g]:y}))}function pe(g){!u&&!_&&g&&JSON.stringify(p)!=JSON.stringify(T(T({},p),g))&&Object.keys(g).forEach(y=>{q(y,g[y])})}let we=Bt((g,y,h)=>M(this,null,function*(){if(!x())return;let D={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:y,actionType:fo,data:h!=null?h:{},createdAt:new Date,blocked:!1,hidden:!1};ke(D)&&(yield O(g,y,D),v(D))}),[n,r,C]),Ne=Bt((g,y,h)=>M(this,null,function*(){if(!x())return;let D={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:y,actionType:lt,data:h!=null?h:{},createdAt:new Date,blocked:!1,hidden:!1};ke(D)&&(yield I(g,y,D),v(D))}),[n,r,C]),Z=Bt((g,y,h)=>M(this,null,function*(){if(!x())return;let D={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:y,actionType:$e,data:h!=null?h:{},createdAt:new Date,blocked:!1,hidden:!1};ke(D)&&(yield P(g,y,D),v(D))}),[n,r,C]),ce=Bt((g,y)=>M(this,null,function*(){if(!x()||je(g)===Ue)return;let h={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:"unknown",actionType:Ue,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};yield F(g),ke(h)&&v(h)}),[n,r,C]),U=Bt((g,y)=>M(this,null,function*(){if(!x())return;let h={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:"unknown",actionType:vt,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};ke(h)&&v(h)}),[n,r,C]),te=Bt((g,y)=>M(this,null,function*(){if(!x())return;let h={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:"unknown",actionType:oe,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};ke(h)&&(yield N(g),v(h))}),[n,r,C]),Ie=Bt((g,y)=>M(this,null,function*(){if(!x())return;let h={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:"unknown",actionType:Lo,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};ke(h)&&(yield N(g),v(h))}),[n,r,C]);function ke(g){var y;if(C===void 0)return!1;if(C){let h=C.find(D=>D.flowId===g.flowSlug);if(g.actionType===lt&&(!(h!=null&&h.stepStates[g.stepId])||h.stepStates[g.stepId].actionType===lt))return!1;if(h&&((y=h.stepStates[g.stepId])==null?void 0:y.actionType)===g.actionType){if(g.actionType===$e&&(!g.data||JSON.stringify(g.data)===JSON.stringify({})))return!1;let D=Object.keys(h.stepStates).sort((ge,De)=>{let xt=new Date(h.stepStates[ge].createdAt),Pt=new Date(h.stepStates[De].createdAt);return xt.getTime()-Pt.getTime()});if(h.stepStates[D[D.length-1]].actionType===g.actionType&&g.stepId===D[D.length-1])return!1}if(h&&h.flowState===oe&&g.actionType===oe)return!1}return!0}function xe(g,y){let h=W(g,y);return u?null:h?h.actionType:lt}function Ce(g,y){let h=W(g,y);return h?h.blocked:!1}function H(g,y){let h=W(g,y);return h?h.hidden:!1}function W(g,y){var D;if(u)return null;let h=C==null?void 0:C.find(ge=>ge.flowId===g);return!h||!h.stepStates[y]?null:(D=h.stepStates[y])!=null?D:null}function $(g){var h,D;if(u||!C)return null;if(je(g)===Ue)return(h=Y(g)[0])!=null?h:null;let y=(D=C.find(ge=>ge.flowId===g))==null?void 0:D.lastStepId;return y?Y(g).find(ge=>ge.id===y):null}function z(g){var D;let y=$(g);if(!y)return 0;let h=(D=Y(g).findIndex(ge=>ge.id===y.id))!=null?D:0;return xe(g,y.id)===$e&&h<Y(g).length-1?h+1:h}function de(g){if(!g.completionCriteria)return;let y=ui(g.completionCriteria);if(y===null)return;let h=nt(y),D=kt(y);return D===0?void 0:h/D}function je(g){let y=C==null?void 0:C.find(h=>h.flowId===g);return y?y.flowState:null}function nt(g){let y=Y(g);return y.length===0?0:y.filter(D=>xe(g,D.id)===$e).length}function kt(g){return Y(g).length}function Je(g){let y=o.find(h=>h.slug===g);return y?(w&&w[g]&&(y.data=w[g]),$o(y.data)):null}function st(g){if(S)return!1;if(u)return!0;if(g!=null&&g.targetingLogic&&C){let y=C.find(h=>h.flowId===g.slug);if(y)return y.shouldTrigger===!1}return!!(g!=null&&g.targetingLogic&&n&&n.startsWith("guest_"))}function Xe(g){return!st(Q(g))}function Wt(){n&&L()}function zt(){return o}return{getAllFlows:zt,getFlow:Q,getFlowData:Je,isLoading:u||_,getStepStatus:xe,getFlowSteps:Y,getCurrentStepIndex:z,markStepStarted:we,markStepCompleted:Z,markFlowNotStarted:ce,markFlowStarted:U,markFlowCompleted:te,markFlowAborted:Ie,markStepNotStarted:Ne,getFlowStatus:je,getNumberOfStepsCompleted:nt,getNumberOfSteps:kt,targetingLogicShouldHideFlow:st,setCustomVariable:q,updateCustomVariables:pe,customVariables:p,getStepOptionalProgress:de,getFlowMetadata:J,isStepBlocked:Ce,isStepHidden:H,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Xe,refresh:Wt}}import{useCallback as hr,useContext as Ta,useEffect as Fa}from"react";var Gt="guest_";function xo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Ta(X),{config:r,apiUrl:l}=Ze(),{mutateUserFlowState:p}=_e(),d=Vt(),{verifySDKInitiated:s}=jt();function m(w){return`frigade-user-registered-${w}`}Fa(()=>{if(e&&!t){if(e.startsWith(Gt))return;let w=m(e);localStorage.getItem(w)||(d(`${l}users`,V(T({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(w,"true"))}},[e,n,t]);let c=hr(w=>M(this,null,function*(){if(!s())return;let b={foreignId:e,properties:w};yield d(`${l}users`,V(T({},r),{method:"POST",body:JSON.stringify(b)})),i(x=>T(T({},x),w)),p()}),[e,r,n,p]),f=hr((w,b)=>M(this,null,function*(){if(!s())return;let v={foreignId:e,events:[{event:w,properties:b}]};yield d(`${l}users`,V(T({},r),{method:"POST",body:JSON.stringify(v)})),p()}),[e,r,p]),S=hr((w,b)=>M(this,null,function*(){if(s())if(b){let x=m(w);localStorage.setItem(x,"true"),o(w);let v={foreignId:w,properties:b};yield d(`${l}users`,V(T({},r),{method:"POST",body:JSON.stringify(v)})),i(k=>T(T({},k),b)),p()}else o(w)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:S,addPropertiesToUser:c,trackEventForUser:f}}import{v4 as Rp}from"uuid";import ot,{useEffect as xn,useState as Jp}from"react";import qe,{useEffect as Sr,useState as Ia}from"react";import _o from"styled-components";import ka from"react";import Pa from"styled-components";var fi="fr-",Co="cfr-";function a(e,t){let o=`${fi}${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+" "+Co+e}return o}function E(e){if(!e.className||e.className.indexOf(Co)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(fi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Mo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Pe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Mo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function yo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var va=Pa.div`
|
|
2
|
+
var sa=Object.defineProperty,la=Object.defineProperties;var aa=Object.getOwnPropertyDescriptors;var $o=Object.getOwnPropertySymbols;var li=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable;var si=(e,t,o)=>t in e?sa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,T=(e,t)=>{for(var o in t||(t={}))li.call(t,o)&&si(e,o,t[o]);if($o)for(var o of $o(t))ai.call(t,o)&&si(e,o,t[o]);return e},j=(e,t)=>la(e,aa(t));var pi=e=>typeof e=="symbol"?e:e+"",Ie=(e,t)=>{var o={};for(var i in e)li.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&$o)for(var i of $o(e))t.indexOf(i)<0&&ai.call(e,i)&&(o[i]=e[i]);return o};var M=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(s){n(s)}},l=d=>{try{p(o.throw(d))}catch(s){n(s)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,l);p((o=o.apply(e,t)).next())});import Eo,{createContext as Fd,useEffect as or,useState as Ve}from"react";import{ThemeProvider as An}from"styled-components";import Nt,{useContext as Rp,useEffect as Rt,useState as ko}from"react";import{useCallback as Bt,useContext as ba,useEffect as wa}from"react";import gr,{useMemo as ci}from"react";var di="1.37.13";var nt="NOT_STARTED_STEP",re="COMPLETED_FLOW",Mo="ABORTED_FLOW",vt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Le="COMPLETED_STEP",go="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=gr.useContext(Q);return{config:ci(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":di,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:ci(()=>`${o}/v1/public/`,[o])}}var pa="frigade-last-call-at-",da="frigade-last-call-data-";function jt(){let{shouldGracefullyDegrade:e,readonly:t}=gr.useContext(Q);return(o,i)=>M(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Vt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Vt();let n=pa+o,r=da+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(p&&d&&d==i.body){let s=new Date(p);if(new Date().getTime()-s.getTime()<1e3)return Vt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let l;try{l=yield fetch(o,i)}catch(p){return Vt(p)}return l?l.ok?l:Vt(l.statusText):Vt()})}function Vt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Gt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=gr.useContext(Q);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as Ca,useState as mi}from"react";import{useContext as ma,useEffect as ua,useState as fa}from"react";import ga from"swr";import{useContext as ca}from"react";function Be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=ca(Q);function r(c,g=!1){var y;return(y=e[c])!=null?y:g}function l(c,g){t(y=>j(T({},y),{[c]:g}))}function p(c){t(g=>{let C=g,{[c]:y}=C,b=Ie(C,[pi(c)]);return T({},b)})}function d(c){n.includes(c)||i(g=>[...g,c])}function s(c){return n.includes(c)}function m(c){return Object.entries(e).some(([g,y])=>y&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}import ha from"swr/immutable";import ho from"core-js-pure/actual/structured-clone";function hr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ce(...e){let t=e.shift(),o=e.length===1?e[0]:Ce(...e);if(!hr(t)||!hr(o))throw new Error("deepmerge can only merge Objects");let i=ho(t);return Object.entries(o).forEach(([n,r])=>{hr(r)?i[n]!==void 0?Object.assign(i,{[n]:Ce(i[n],ho(r))}):Object.assign(i,{[n]:ho(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...ho(r)]}):Object.assign(i,{[n]:ho(r)}):Object.assign(i,{[n]:r})}),i}var xa="unknown";function De(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=ma(Q),{resetOpenFlowState:d}=Be(),[s,m]=fa(!1),c={data:r.map(w=>({flowId:w.id,flowState:re,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=w=>fetch(w,e).then(k=>{if(k.ok)return k.json();throw new Error("Failed to fetch user flow states")}).catch(k=>(console.log(`Error fetching ${w}: ${k}. Will gracefully degrade and hide Frigade`),l(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:b,isLoading:C,mutate:x,error:P}=p?ha(y,g):ga(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),S=b==null?void 0:b.data;ua(()=>{!s&&!C&&S&&m(!0)},[S,s,C]);function v(w){return M(this,null,function*(){if(S&&!p){let k=S.find(I=>I.flowId===w);k&&k.flowState!==re&&(k.flowState=re),yield x(Promise.resolve(Ce(b,{data:S})),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function $(w,k,I){return M(this,null,function*(){if(S){let N=S.find(A=>A.flowId===w);N&&(N.stepStates[k]=I,N.flowState=vt),yield x(Promise.resolve(Ce(b,{data:S})),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function B(w,k,I){return M(this,null,function*(){if(S){let N=S.find(A=>A.flowId===w);N&&(N.lastStepId=k,N.stepStates[k]=I,N.flowState=vt),yield x(Ce(b,{data:S}),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function u(w){return M(this,null,function*(){if(S){let k=S.find(I=>I.flowId===w);k&&k.flowState!==Me&&(k.flowState=Me,k.lastStepId=xa,Object.keys(k.stepStates).forEach(I=>{k.stepStates[I].actionType=nt,k.stepStates[I].createdAt=new Date().toISOString()}),yield x(Ce(b,{data:S}),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1}),d(w))}})}function O(w,k,I){return M(this,null,function*(){if(S){let N=S.find(A=>A.flowId===w);N&&(N.stepStates[k]=I),yield x(Promise.resolve(Ce(b,{data:S})),{optimisticData:Ce(b,{data:S}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:S,isLoadingUserFlowStateData:!s,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:v,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:$,optimisticallyMarkStepNotStarted:O,optimisticallyMarkStepStarted:B,error:P}}function xo(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=De(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=Ca(Q),[d,s]=mi(new Set),[m,c]=mi(new Set),g=jt();function y(x){let P=JSON.stringify(x);if(d.has(P))return null;d.add(P),s(d),m.add(x),c(m);let S=l==null?void 0:l.find(v=>v.flowSlug===x.flowSlug&&v.stepId===x.stepId&&v.actionType===x.actionType&&v.createdAt===x.createdAt);return g(`${t}flowResponses`,j(T({},e),{method:"POST",body:P})).then(v=>{v.status!==200&&v.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):S||p($=>[...$!=null?$:[],x])})}function b(x){return M(this,null,function*(){x.foreignUserId&&(x.actionType===vt||x.actionType===Me?yield y(x):x.actionType===re?yield y(x):x.actionType===go?yield y(x):x.actionType===Le?yield y(x):x.actionType===Mo?yield y(x):x.actionType===nt&&(yield y(x)))})}function C(){let x=[];return o==null||o.forEach(P=>{if(P&&P.stepStates&&Object.keys(P.stepStates).length!==0)for(let S in P.stepStates){let v=P.stepStates[S];x.push({foreignUserId:P.foreignUserId,flowSlug:P.flowId,stepId:v.stepId,actionType:v.actionType,data:{},createdAt:new Date(v.createdAt),blocked:v.blocked,hidden:v.hidden})}}),[...x,...l]}return{addResponse:b,setFlowResponses:p,getFlowResponses:C}}import Ta from"swr";var ya=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ui=e=>{let t=ya.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Sa(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Sa=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Do(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var xr=(s=>(s.CHECKLIST="CHECKLIST",s.FORM="FORM",s.TOUR="TOUR",s.SUPPORT="SUPPORT",s.CUSTOM="CUSTOM",s.BANNER="BANNER",s.EMBEDDED_TIP="EMBEDDED_TIP",s.NPS_SURVEY="NPS_SURVEY",s.ANNOUNCEMENT="ANNOUNCEMENT",s))(xr||{});function R(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:y,readonly:b,flowDataOverrides:C}=ba(Q),x={data:[]},{verifySDKInitiated:P}=Gt(),{addResponse:S,getFlowResponses:v}=xo(),$=h=>fetch(h,e).then(f=>f.ok?f.json():(console.log(`Error fetching ${h} (${f.status}): ${f.statusText}. Will gracefully degrade and hide Frigade`),g(!0),x)).catch(f=>(console.log(`Error fetching ${h}: ${f}. Will gracefully degrade and hide Frigade`),g(!0),x)),{mutateUserFlowState:B,userFlowStatesData:u,isLoadingUserFlowStateData:O,optimisticallyMarkFlowCompleted:w,optimisticallyMarkFlowNotStarted:k,optimisticallyMarkStepCompleted:I,optimisticallyMarkStepNotStarted:N,optimisticallyMarkStepStarted:A}=De(),{data:H,error:_,isLoading:ee}=Ta(l?`${t}flows${b?"?readonly=true":""}`:null,$,{keepPreviousData:!0});wa(()=>{if(_){console.error(_);return}H&&H.data&&i(H.data)},[H,_]);function X(h){if(ee)return null;let f=o.find(F=>F.slug===h);return!f&&o.length>0&&!O&&!ee?(console.log(`Flow with id ${h} not found`),null):(f&&C&&C[h]&&(f.data=C[h]),(f==null?void 0:f.active)===!1&&!b?null:f)}function q(h){var U,fe,ht,kt,Pt;if(!X(h))return[];let f=(U=X(h))==null?void 0:U.data;return f?(f=Y(f),((Pt=(kt=(fe=Do(f))==null?void 0:fe.data)!=null?kt:(ht=Do(f))==null?void 0:ht.steps)!=null?Pt:[]).map(ge=>{let uo=je(ge);return j(T({handleSecondaryButtonClick:()=>{ge.skippable===!0&&Z(h,ge.id,{skipped:!0})}},ge),{complete:ce(h,ge.id)===Le||uo>=1,started:ce(h,ge.id)===go||ce(h,ge.id)===Le,currentlyActive:u==null?void 0:u.some(fo=>fo.flowId==h&&fo.lastStepId===ge.id),blocked:V(h,ge.id),hidden:W(h,ge.id),handlePrimaryButtonClick:()=>{(!ge.completionCriteria&&(ge.autoMarkCompleted||ge.autoMarkCompleted===void 0)||ge.completionCriteria&&ge.autoMarkCompleted===!0)&&Z(h,ge.id)},progress:uo})}).filter(ge=>ge.hidden!==!0)):[]}function Y(h){return h.replaceAll(/\${(.*?)}/g,(f,F)=>p[F]===void 0?"":String(p[F]).replace(/[\u00A0-\u9999<>\&]/g,function(U){return"&#"+U.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function J(h){var F;if(!X(h))return[];let f=X(h).data;return f?(f=Y(f),(F=JSON.parse(f))!=null?F:{}):[]}function pe(h,f){d(F=>j(T({},F),{[h]:f}))}function we(h){!O&&!ee&&h&&JSON.stringify(p)!=JSON.stringify(T(T({},p),h))&&Object.keys(h).forEach(f=>{pe(f,h[f])})}let Oe=Bt((h,f,F)=>M(this,null,function*(){if(!P())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:go,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};xe(U)&&(yield A(h,f,U),S(U))}),[n,r,u]),de=Bt((h,f,F)=>M(this,null,function*(){if(!P())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:nt,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};xe(U)&&(yield N(h,f,U),S(U))}),[n,r,u]),Z=Bt((h,f,F)=>M(this,null,function*(){if(!P())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:Le,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};xe(U)&&(yield I(h,f,U),S(U))}),[n,r,u]),D=Bt((h,f)=>M(this,null,function*(){if(!P()||Xe(h)===Me)return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Me,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};yield k(h),xe(F)&&S(F)}),[n,r,u]),oe=Bt((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:vt,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};xe(F)&&S(F)}),[n,r,u]),Ne=Bt((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:re,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};xe(F)&&(yield w(h),S(F))}),[n,r,u]),Je=Bt((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Mo,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};xe(F)&&(yield w(h),S(F))}),[n,r,u]);function xe(h){var f;if(u===void 0)return!1;if(u){let F=u.find(U=>U.flowId===h.flowSlug);if(h.actionType===nt&&(!(F!=null&&F.stepStates[h.stepId])||F.stepStates[h.stepId].actionType===nt))return!1;if(F&&((f=F.stepStates[h.stepId])==null?void 0:f.actionType)===h.actionType){if(h.actionType===Le&&(!h.data||JSON.stringify(h.data)===JSON.stringify({})))return!1;let U=Object.keys(F.stepStates).sort((fe,ht)=>{let kt=new Date(F.stepStates[fe].createdAt),Pt=new Date(F.stepStates[ht].createdAt);return kt.getTime()-Pt.getTime()});if(F.stepStates[U[U.length-1]].actionType===h.actionType&&h.stepId===U[U.length-1])return!1}if(F&&F.flowState===re&&h.actionType===re)return!1}return!0}function ce(h,f){let F=L(h,f);return O?null:F?F.actionType:nt}function V(h,f){let F=L(h,f);return F?F.blocked:!1}function W(h,f){let F=L(h,f);return F?F.hidden:!1}function L(h,f){var U;if(O)return null;let F=u==null?void 0:u.find(fe=>fe.flowId===h);return!F||!F.stepStates[f]?null:(U=F.stepStates[f])!=null?U:null}function z(h){var F,U;if(O||!u)return null;if(Xe(h)===Me)return(F=q(h)[0])!=null?F:null;let f=(U=u.find(fe=>fe.flowId===h))==null?void 0:U.lastStepId;return f?q(h).find(fe=>fe.id===f):null}function me(h){var U;let f=z(h);if(!f)return 0;let F=(U=q(h).findIndex(fe=>fe.id===f.id))!=null?U:0;return ce(h,f.id)===Le&&F<q(h).length-1?F+1:F}function je(h){if(!h.completionCriteria)return;let f=ui(h.completionCriteria);if(f===null)return;let F=Ft(f),U=Ge(f);return U===0?void 0:F/U}function Xe(h){let f=u==null?void 0:u.find(F=>F.flowId===h);return f?f.flowState:null}function Ft(h){let f=q(h);return f.length===0?0:f.filter(U=>ce(h,U.id)===Le).length}function Ge(h){return q(h).length}function gt(h){let f=o.find(F=>F.slug===h);return f?(C&&C[h]&&(f.data=C[h]),Do(f.data)):null}function Ke(h){if(b)return!1;if(O||y)return!0;if(h!=null&&h.targetingLogic&&u){let f=u.find(F=>F.flowId===h.slug);if(f)return f.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function Wt(h){return!Ke(X(h))}function zt(){n&&B()}function Ht(){return o}return{getAllFlows:Ht,getFlow:X,getFlowData:gt,isLoading:O||ee,getStepStatus:ce,getFlowSteps:q,getCurrentStepIndex:me,markStepStarted:Oe,markStepCompleted:Z,markFlowNotStarted:D,markFlowStarted:oe,markFlowCompleted:Ne,markFlowAborted:Je,markStepNotStarted:de,getFlowStatus:Xe,getNumberOfStepsCompleted:Ft,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:Ke,setCustomVariable:pe,updateCustomVariables:we,customVariables:p,getStepOptionalProgress:je,getFlowMetadata:J,isStepBlocked:V,isStepHidden:W,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Wt,refresh:zt}}import{useCallback as Cr,useContext as Fa,useEffect as ka}from"react";var Kt="guest_";function Co(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Fa(Q),{config:r,apiUrl:l}=Ze(),{mutateUserFlowState:p}=De(),d=jt(),{verifySDKInitiated:s}=Gt();function m(b){return`frigade-user-registered-${b}`}ka(()=>{if(e&&!t){if(e.startsWith(Kt))return;let b=m(e);localStorage.getItem(b)||(d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(b,"true"))}},[e,n,t]);let c=Cr(b=>M(this,null,function*(){if(!s())return;let C={foreignId:e,properties:b};yield d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify(C)})),i(x=>T(T({},x),b)),p()}),[e,r,n,p]),g=Cr((b,C)=>M(this,null,function*(){if(!s())return;let P={foreignId:e,events:[{event:b,properties:C}]};yield d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify(P)})),p()}),[e,r,p]),y=Cr((b,C)=>M(this,null,function*(){if(s())if(C){let x=m(b);localStorage.setItem(x,"true"),o(b);let P={foreignId:b,properties:C};yield d(`${l}users`,j(T({},r),{method:"POST",body:JSON.stringify(P)})),i(S=>T(T({},S),C)),p()}else o(b)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g}}import{v4 as ed}from"uuid";import ot,{useEffect as xn,useState as Xp}from"react";import qe,{useEffect as wr,useState as La}from"react";import zo from"styled-components";import Pa from"react";import va from"styled-components";var fi="fr-",yo="cfr-";function a(e,t){let o=`${fi}${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+" "+yo+e}return o}function E(e){if(!e.className||e.className.indexOf(yo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(fi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Uo(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=>`${Uo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function So(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ba=va.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,gi=({onClose:e,appearance:t})=>
|
|
26
|
+
`,gi=({onClose:e,appearance:t})=>Pa.createElement(Ba,{className:a("modalBackground",t),onClick:()=>e()});import yr from"react";import Ea from"styled-components";var Aa=Ea.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,Ee=()=>yr.createElement(Aa,null,yr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},yr.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as $a}from"react-portal";import Bi from"react";import Sr from"react";function Oa({style:e,className:t}){return Sr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Sr.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"}),Sr.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 hi=Oa;import br from"styled-components";import st from"styled-components";var _o=st.div`
|
|
31
31
|
${e=>E(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
@@ -38,7 +38,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
38
38
|
min-width: 300px;
|
|
39
39
|
z-index: ${e=>e.zIndex};
|
|
40
40
|
overflow: hidden;
|
|
41
|
-
`,
|
|
41
|
+
`,Na=`
|
|
42
42
|
display: block;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
@@ -51,17 +51,19 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
51
51
|
box-sizing: border-box;
|
|
52
52
|
:hover {
|
|
53
53
|
opacity: 0.8;
|
|
54
|
-
}`,
|
|
54
|
+
}`,Ia=`
|
|
55
55
|
display: block;
|
|
56
56
|
cursor: pointer;
|
|
57
57
|
position: absolute;
|
|
58
58
|
top: 12px;
|
|
59
59
|
right: 12px;
|
|
60
|
-
|
|
60
|
+
background-color: transparent;
|
|
61
|
+
border: none;
|
|
62
|
+
`,xi=st.button`
|
|
61
63
|
${e=>E(e)} {
|
|
62
|
-
${e=>e.hasImage?
|
|
64
|
+
${e=>e.hasImage?Na:Ia};
|
|
63
65
|
}
|
|
64
|
-
`,Ci=
|
|
66
|
+
`,Ci=st.img`
|
|
65
67
|
${e=>E(e)} {
|
|
66
68
|
display: block;
|
|
67
69
|
width: 100%;
|
|
@@ -69,7 +71,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
69
71
|
min-height: 200px;
|
|
70
72
|
object-fit: cover;
|
|
71
73
|
}
|
|
72
|
-
`,yi=
|
|
74
|
+
`,yi=st.div`
|
|
73
75
|
${e=>E(e)} {
|
|
74
76
|
display: block;
|
|
75
77
|
width: 100%;
|
|
@@ -77,19 +79,19 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
77
79
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
78
80
|
object-fit: cover;
|
|
79
81
|
}
|
|
80
|
-
`,Si=
|
|
82
|
+
`,Si=st.div`
|
|
81
83
|
display: flex;
|
|
82
84
|
flex-direction: row;
|
|
83
85
|
justify-content: space-between;
|
|
84
86
|
align-content: center;
|
|
85
|
-
`,bi=
|
|
87
|
+
`,bi=st.div`
|
|
86
88
|
padding: 22px 22px 12px;
|
|
87
|
-
`,wi=
|
|
89
|
+
`,wi=st.div`
|
|
88
90
|
display: flex;
|
|
89
91
|
flex: 1;
|
|
90
92
|
flex-direction: column;
|
|
91
93
|
justify-content: center;
|
|
92
|
-
`,Ti=
|
|
94
|
+
`,Ti=st.div`
|
|
93
95
|
display: flex;
|
|
94
96
|
flex: 2;
|
|
95
97
|
flex-shrink: 1;
|
|
@@ -101,7 +103,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
101
103
|
align-content: center;
|
|
102
104
|
align-items: center;
|
|
103
105
|
}
|
|
104
|
-
`,Fi=
|
|
106
|
+
`,Fi=st.p`
|
|
105
107
|
${e=>E(e)} {
|
|
106
108
|
font-style: normal;
|
|
107
109
|
font-weight: 600;
|
|
@@ -110,7 +112,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
110
112
|
color: #808080;
|
|
111
113
|
}
|
|
112
114
|
margin: 0;
|
|
113
|
-
`;var ki=
|
|
115
|
+
`;var ki=br.div`
|
|
114
116
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
115
117
|
position: absolute;
|
|
116
118
|
bottom: -47px;
|
|
@@ -121,7 +123,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
121
123
|
align-items: center;
|
|
122
124
|
justify-content: center;
|
|
123
125
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
124
|
-
`,Pi=
|
|
126
|
+
`,Pi=br(_o)`
|
|
125
127
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
126
128
|
position: absolute;
|
|
127
129
|
bottom: -60px;
|
|
@@ -134,7 +136,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
134
136
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
135
137
|
padding: 0;
|
|
136
138
|
z-index: ${e=>e.zIndex};
|
|
137
|
-
`,vi=
|
|
139
|
+
`,vi=br.div`
|
|
138
140
|
display: flex;
|
|
139
141
|
justify-content: center;
|
|
140
142
|
align-items: center;
|
|
@@ -143,7 +145,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
143
145
|
font-size: 12px;
|
|
144
146
|
line-height: 18px;
|
|
145
147
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
146
|
-
`;function
|
|
148
|
+
`;function Wo({appearance:e}){return Bi.createElement(vi,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Bi.createElement(hi,null))}var Ma=zo.div`
|
|
147
149
|
${e=>E(e)} {
|
|
148
150
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
149
151
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -158,7 +160,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
158
160
|
width: ${e=>{var t;return(t=e.width)!=null?t:"1000px"}};
|
|
159
161
|
z-index: 1500;
|
|
160
162
|
border-radius: ${e=>{var t,o,i;return(i=(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)!=null?i:8}}px;
|
|
161
|
-
${e=>
|
|
163
|
+
${e=>ke(e)}
|
|
162
164
|
}
|
|
163
165
|
|
|
164
166
|
padding: 32px;
|
|
@@ -185,10 +187,10 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
185
187
|
opacity: 1;
|
|
186
188
|
}
|
|
187
189
|
}
|
|
188
|
-
`,
|
|
190
|
+
`,Da=zo.div`
|
|
189
191
|
position: relative;
|
|
190
192
|
flex: 0 1 auto;
|
|
191
|
-
`,
|
|
193
|
+
`,Ua=zo.div`
|
|
192
194
|
position: absolute;
|
|
193
195
|
top: 16px;
|
|
194
196
|
right: 16px;
|
|
@@ -198,14 +200,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
198
200
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
199
201
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
200
202
|
}
|
|
201
|
-
`,
|
|
203
|
+
`,_a=zo.div`
|
|
202
204
|
overflow: scroll;
|
|
203
205
|
flex: 1 1;
|
|
204
206
|
display: flex;
|
|
205
207
|
::-webkit-scrollbar {
|
|
206
208
|
display: none;
|
|
207
209
|
}
|
|
208
|
-
`,Re=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:l=!0,showFrigadeBranding:p=!1})=>{let[d,s]=
|
|
210
|
+
`,Re=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:l=!0,showFrigadeBranding:p=!1})=>{let[d,s]=La("");return wr(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");s(m)},[]),wr(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),wr(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?qe.createElement($a,null,qe.createElement(gi,{appearance:r,onClose:()=>{l&&e()}}),qe.createElement(Ma,{appearance:r,className:a("modalContainer",r),styleOverrides:i},l&&qe.createElement(Ua,{className:a("modalClose",r),onClick:()=>e(),appearance:r},qe.createElement(Ee,null)),o&&qe.createElement(Da,null,o),qe.createElement(_a,null,n),p&&qe.createElement(ki,{appearance:r,className:a("poweredByFrigadeRibbon",r)},qe.createElement(Wo,{appearance:r})))):qe.createElement(qe.Fragment,null)};import xt,{useEffect as Tr,useState as Wa}from"react";import Ho from"styled-components";import{Portal as za}from"react-portal";function Ha(e){switch(e){case"top-left":return`
|
|
209
211
|
top: 0;
|
|
210
212
|
left: 0;
|
|
211
213
|
`;case"top-right":return`
|
|
@@ -214,7 +216,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
214
216
|
`;case"bottom-left":return`
|
|
215
217
|
bottom: 0;
|
|
216
218
|
left: 0;
|
|
217
|
-
`}return"right: 0; bottom: 0;"}var
|
|
219
|
+
`}return"right: 0; bottom: 0;"}var Va=Ho.div`
|
|
218
220
|
${e=>E(e)} {
|
|
219
221
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
220
222
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -228,12 +230,12 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
228
230
|
width: 350px;
|
|
229
231
|
padding: 24px;
|
|
230
232
|
}
|
|
231
|
-
${e=>
|
|
233
|
+
${e=>Ha(e.modalPosition)}
|
|
232
234
|
margin: 28px;
|
|
233
|
-
`,
|
|
235
|
+
`,ja=Ho.div`
|
|
234
236
|
position: relative;
|
|
235
237
|
flex: 1;
|
|
236
|
-
`,
|
|
238
|
+
`,Ga=Ho.div`
|
|
237
239
|
position: absolute;
|
|
238
240
|
top: 16px;
|
|
239
241
|
right: 16px;
|
|
@@ -243,13 +245,13 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
243
245
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
244
246
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
245
247
|
}
|
|
246
|
-
`,
|
|
248
|
+
`,Ka=Ho.div`
|
|
247
249
|
overflow: scroll;
|
|
248
250
|
flex: 5;
|
|
249
251
|
::-webkit-scrollbar {
|
|
250
252
|
display: none;
|
|
251
253
|
}
|
|
252
|
-
`,
|
|
254
|
+
`,Vo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:l=!0})=>{let[p,d]=Wa("");return Tr(()=>{let s=getComputedStyle(document.body).getPropertyValue("overflow");d(s)},[]),Tr(()=>{let s=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[e]),Tr(()=>{let s=document.body.style;return t?s.setProperty("overflow","hidden"):s.setProperty("overflow",p),()=>{s.setProperty("overflow",p)}},[t]),t?xt.createElement(za,null,xt.createElement(Va,{appearance:n,className:a("cornerModalContainer",n),modalPosition:r},l&&xt.createElement(Ga,{className:a("cornerModalClose",n),onClick:()=>e()},xt.createElement(Ee,null)),o&&xt.createElement(ja,null,o),xt.createElement(Ka,null,i))):xt.createElement(xt.Fragment,null)};import{useContext as qa}from"react";function ie(){let{defaultAppearance:e}=qa(Q);function t(o){var n,r,l;let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((n=i.styleOverrides)!=null?n:{},(r=o.styleOverrides)!=null?r:{}),theme:Object.assign(i.theme,(l=o.theme)!=null?l:{})}:i}return{mergeAppearanceWithDefault:t}}import Et,{useContext as gp,useEffect as Gi,useState as Ir}from"react";import Yo from"styled-components";import Ko,{useEffect as Li,useState as Pr}from"react";import vr from"styled-components";import jo from"styled-components";var Ei=jo.label`
|
|
253
255
|
${e=>E(e)} {
|
|
254
256
|
font-size: 12px;
|
|
255
257
|
line-height: 18px;
|
|
@@ -260,14 +262,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
260
262
|
letter-spacing: 0.24px;
|
|
261
263
|
}
|
|
262
264
|
display: flex;
|
|
263
|
-
`,Ai=
|
|
265
|
+
`,Ai=jo.label`
|
|
264
266
|
${e=>E(e)} {
|
|
265
267
|
font-size: 12px;
|
|
266
268
|
line-height: 20px;
|
|
267
269
|
margin-bottom: 5px;
|
|
268
270
|
}
|
|
269
271
|
display: flex;
|
|
270
|
-
`,Oi=
|
|
272
|
+
`,Oi=jo.span`
|
|
271
273
|
font-weight: 400;
|
|
272
274
|
font-size: 14px;
|
|
273
275
|
line-height: 22px;
|
|
@@ -275,16 +277,16 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
275
277
|
display: flex;
|
|
276
278
|
margin-right: 5px;
|
|
277
279
|
margin-top: 10px;
|
|
278
|
-
`,
|
|
280
|
+
`,Go=jo.div`
|
|
279
281
|
display: flex;
|
|
280
282
|
align-items: flex-start;
|
|
281
283
|
justify-content: left;
|
|
282
284
|
margin-bottom: 10px;
|
|
283
|
-
`;import
|
|
285
|
+
`;import Fr from"react";var lt={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 Ct({title:e,required:t,appearance:o=lt}){return e?Fr.createElement(Go,{className:a("formLabelWrapper",o)},t?Fr.createElement(Oi,{className:a("formLabelRequired",o),appearance:o},"*"):null,Fr.createElement(Ei,{className:a("formLabel",o)},e)):null}import Ni from"react";function qt({title:e,appearance:t}){return e?Ni.createElement(Go,null,Ni.createElement(Ai,{className:a("formSubLabel",t)},e)):null}import{z as kr}from"zod";function Ii(e,t){var o,i,n,r,l,p,d;try{if(t){if(t.type=="number"){let s=kr.number();if(t.props)for(let m of t.props)m.requirement=="min"?s=s.min(Number(m.value),(o=m.message)!=null?o:"Value is too small"):m.requirement=="max"?s=s.max(Number(m.value),(i=m.message)!=null?i:"Value is too large"):m.requirement=="positive"?s=s.positive((n=m.message)!=null?n:"Value must be positive"):m.requirement=="negative"&&(s=s.nonpositive((r=m.message)!=null?r:"Value must be negative"));s.parse(Number(e))}if(t.type=="string"){let s=kr.string();if(t.props)for(let m of t.props)m.requirement=="min"?s=s.min(Number(m.value),(l=m.message)!=null?l:"Value is too short"):m.requirement=="max"?s=s.max(Number(m.value),(p=m.message)!=null?p:"Value is too long"):m.requirement=="regex"&&(s=s.regex(new RegExp(String(m.value)),(d=m.message)!=null?d:"Value does not match requirements"));s.parse(e)}return}}catch(s){if(s instanceof kr.ZodError)return s.issues&&s.issues.length>0?s.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,s)}return null}var Ya=vr.div`
|
|
284
286
|
display: flex;
|
|
285
287
|
flex-direction: column;
|
|
286
288
|
width: 100%;
|
|
287
|
-
`,
|
|
289
|
+
`,Br=vr.input`
|
|
288
290
|
${e=>E(e)} {
|
|
289
291
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
290
292
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -300,7 +302,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
300
302
|
box-sizing: border-box;
|
|
301
303
|
padding: 0 10px;
|
|
302
304
|
margin-bottom: 10px;
|
|
303
|
-
`,
|
|
305
|
+
`,Ja=vr.textarea`
|
|
304
306
|
${e=>E(e)} {
|
|
305
307
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
306
308
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -317,13 +319,13 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
317
319
|
box-sizing: border-box;
|
|
318
320
|
margin-bottom: 10px;
|
|
319
321
|
resize: none;
|
|
320
|
-
`;function
|
|
322
|
+
`;function Er({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[l,p]=Pr((n==null?void 0:n.text)||""),[d,s]=Pr(!1),[m,c]=Pr(!1),g=Br;Li(()=>{l===""&&!d&&(s(!0),y(""))},[]),Li(()=>{if(m){y(l);return}},[m]);function y(C){var P;if(p(C),o({text:C}),r.required===!0&&C.trim()===""){i([{id:r.id,message:`${(P=r.title)!=null?P:"Field"} is required`,hidden:!m}]);return}let x=Ii(C,r.validation);if(x&&(C.trim()!==""||r.required===!0)){i([{id:r.id,message:x,hidden:!m}]);return}i([])}r.multiline&&(g=Ja);function b(){var C;switch((C=r==null?void 0:r.validation)==null?void 0:C.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return Ko.createElement(Ya,null,Ko.createElement(Ct,{title:r.title,required:r.required,appearance:t.appearance}),Ko.createElement(g,{className:a("inputComponent",t.appearance),value:l,onChange:C=>{y(C.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:b(),onBlur:()=>{c(!0)}}),Ko.createElement(qt,{title:r.subtitle,appearance:t.appearance}))}import et,{useEffect as $i,useState as Mi}from"react";import Di from"styled-components";var Ar="",Xa=Di.div`
|
|
321
323
|
display: flex;
|
|
322
324
|
flex-direction: column;
|
|
323
325
|
width: 100%;
|
|
324
326
|
-webkit-appearance: none;
|
|
325
327
|
appearance: none;
|
|
326
|
-
`,
|
|
328
|
+
`,Qa=Di.select`
|
|
327
329
|
${e=>E(e)} {
|
|
328
330
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
329
331
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -344,15 +346,15 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
344
346
|
background-repeat: no-repeat;
|
|
345
347
|
background-size: 1.5em 1.5em;
|
|
346
348
|
-webkit-print-color-adjust: exact;
|
|
347
|
-
`;function Ui({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,
|
|
348
|
-
${e=>
|
|
349
|
-
`,
|
|
349
|
+
`;function Ui({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,g,y,b,C,x,P,S;let r=e,[l,p]=Mi(!1),[d,s]=Mi(!1);return $i(()=>{var v,$,B,u;if(!((v=i==null?void 0:i.choice)!=null&&v[0])&&!l){if(p(!0),r.requireSelection){o({choice:[Ar]});return}if(r.defaultValue&&(($=r.props.options)!=null&&$.find(O=>O.id===r.defaultValue))){let O=(B=r.props.options)==null?void 0:B.find(w=>w.id===r.defaultValue);o({choice:[O.id]})}else o({choice:[((u=r.props.options)==null?void 0:u[0].id)||""]})}},[]),$i(()=>{var v;d&&(r.requireSelection&&((v=i==null?void 0:i.choice)==null?void 0:v[0])===Ar?n([{message:"Please select an option",id:r.id}]):n([]))},[(m=i==null?void 0:i.choice)==null?void 0:m[0],d]),et.createElement(Xa,null,et.createElement(Ct,{title:r.title,required:!1,appearance:t.appearance}),et.createElement(Qa,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:v=>{s(!0),o({choice:[v.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&et.createElement("option",{key:"null-value",value:Ar,disabled:!0},(g=r.placeholder)!=null?g:"Select an option"),(y=r.props.options)==null?void 0:y.map(v=>et.createElement("option",{key:v.id,value:v.id},v.title))),((C=(b=r.props.options)==null?void 0:b.find(v=>{var $;return v.id===(($=i==null?void 0:i.choice)==null?void 0:$[0])}))==null?void 0:C.isOpenEnded)&&et.createElement(et.Fragment,null,et.createElement(Ct,{title:(S=(P=(x=r.props.options)==null?void 0:x.find(v=>{var $;return v.id===(($=i==null?void 0:i.choice)==null?void 0:$[0])}))==null?void 0:P.openEndedLabel)!=null?S:"Please specify",required:!1,appearance:t.appearance}),et.createElement(Br,{type:"text",placeholder:"Enter your answer here",onChange:v=>{o({choice:[v.target.value]})},appearance:t.appearance})),et.createElement(qt,{title:r.subtitle,appearance:t.appearance}))}import To,{useEffect as Or,useState as Wi}from"react";import zi from"styled-components";import wo from"react";import bo from"react";var _i=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return bo.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Za=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:l})=>bo.createElement("svg",{style:l,className:r,width:t,height:t,overflow:"visible"},bo.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},bo.createElement(_i,{color:n,size:t}),bo.createElement(_i,{color:e,percentage:Math.max(o,.1),size:t})),i),Yt=Za;import Ra from"styled-components";var ep=({color:e="#FFFFFF"})=>wo.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},wo.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),tp={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},op={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},rp={border:"1px solid #000000",color:"#FFFFFF"},ip={border:"1px solid #C5CBD3"},np={color:"#FFFFFF"},sp={border:"1px solid #C5CBD3"},lp=e=>e==="square"?tp:op,ap=(e,t)=>e==="square"?t?rp:ip:t?np:sp,pp=Ra.div`
|
|
350
|
+
${e=>ke(e)}
|
|
351
|
+
`,at=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=lt,style:r,className:l})=>{let p=lp(t),d=ap(t,e);return e===!0?p=j(T(T({},p),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=T(T({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?wo.createElement(Yt,{fillColor:o,percentage:i,size:22}):wo.createElement(pp,{styleOverrides:p,style:r,role:"checkbox",className:Te(a("checkIconContainer",n),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",l)},e&&wo.createElement(ep,{color:"#FFFFFF"}))};var dp=zi.div`
|
|
350
352
|
display: flex;
|
|
351
353
|
flex-direction: column;
|
|
352
354
|
width: 100%;
|
|
353
355
|
-webkit-appearance: none;
|
|
354
356
|
appearance: none;
|
|
355
|
-
`,
|
|
357
|
+
`,cp=zi.button`
|
|
356
358
|
${e=>E(e)} {
|
|
357
359
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
358
360
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -377,7 +379,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
377
379
|
height: 48px;
|
|
378
380
|
padding: 0 18px;
|
|
379
381
|
margin-bottom: 10px;
|
|
380
|
-
`;function Hi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[l,p]=Wi((i==null?void 0:i.choice)||[]),[d,s]=Wi(!1);return
|
|
382
|
+
`;function Hi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[l,p]=Wi((i==null?void 0:i.choice)||[]),[d,s]=Wi(!1);return Or(()=>{l.length==0&&!d&&(s(!0),o({choice:[]}))},[]),Or(()=>{o({choice:l})},[l]),Or(()=>{r.required&&(l.length<r.props.minChoices||l.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[l]),To.createElement(dp,null,To.createElement(Ct,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>To.createElement(cp,{appearance:t.appearance,className:a(l.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":l.includes(c.id),onClick:()=>{if(l.includes(c.id)){p(l.filter(g=>g!==c.id));return}l.length<r.props.maxChoices?p([...l,c.id]):l.length==1&&r.props.maxChoices==1&&p([c.id])}},c.title,To.createElement(at,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:l.includes(c.id),appearance:t.appearance}))),To.createElement(qt,{title:r.subtitle,appearance:t.appearance}))}import qo from"react";import Vi from"styled-components";import mp from"dompurify";function ne(e){return{__html:mp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var up=Vi.h1`
|
|
381
383
|
${e=>E(e)} {
|
|
382
384
|
font-style: normal;
|
|
383
385
|
font-weight: 700;
|
|
@@ -389,7 +391,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
389
391
|
margin-bottom: 4px;
|
|
390
392
|
color: ${e=>e.appearance.theme.colorText};
|
|
391
393
|
}
|
|
392
|
-
`,
|
|
394
|
+
`,fp=Vi.h2`
|
|
393
395
|
${e=>E(e)} {
|
|
394
396
|
font-style: normal;
|
|
395
397
|
font-weight: 400;
|
|
@@ -398,38 +400,38 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
398
400
|
letter-spacing: 0.28px;
|
|
399
401
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
400
402
|
}
|
|
401
|
-
`;function
|
|
403
|
+
`;function Ae({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n="",ariaPrefix:r=""}){return qo.createElement(qo.Fragment,null,qo.createElement(up,{appearance:e,id:r?`frigade${r}Title`:"frigadeTitle",className:a(`${n}${n?So(i):i}Title`,e),dangerouslySetInnerHTML:ne(t),size:i}),o&&qo.createElement(fp,{id:r?`frigade${r}Subtitle`:"frigadeSubtitle",appearance:e,className:a(`${n}${n?So(i):i}Subtitle`,e),dangerouslySetInnerHTML:ne(o),size:i}))}import*as Nr from"react";var ji=e=>Nr.createElement("svg",T({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Nr.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));var hp=Yo.div`
|
|
402
404
|
display: flex;
|
|
403
405
|
flex-direction: column;
|
|
404
406
|
justify-content: flex-end;
|
|
405
407
|
overflow: visible;
|
|
406
408
|
padding-top: 14px;
|
|
407
|
-
`,
|
|
409
|
+
`,xp=Yo.div`
|
|
408
410
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
409
411
|
font-size: 12px;
|
|
410
412
|
margin-bottom: 12px;
|
|
411
413
|
display: flex;
|
|
412
414
|
align-items: center;
|
|
413
|
-
`,
|
|
415
|
+
`,Cp=Yo.div`
|
|
414
416
|
margin-right: 4px;
|
|
415
417
|
display: inline-flex;
|
|
416
|
-
`,
|
|
418
|
+
`,yp=Yo.div`
|
|
417
419
|
padding-left: 1px;
|
|
418
420
|
padding-right: 1px;
|
|
419
|
-
`,
|
|
421
|
+
`,Sp={text:Er,multipleChoice:Ui,multipleChoiceList:Hi},Lr="frigade-multiInputStepTypeData";function Ki({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:l,prefillData:p}){var B;let d=t.props,[s,m]=Ir([]),[c,g]=Ir([]),{userId:y}=Co(),[b,C]=Ir(v()||(p?p[t.id]:null)||{}),{readonly:x}=gp(Q),P=T(T({},Sp),l);Gi(()=>{i(s.length===0)},[s,i]),Gi(()=>{n(b)},[b]);function S(u,O){C(w=>{let k=j(T({},w),{[u.id]:O});return typeof window!="undefined"&&window.localStorage&&!x&&window.localStorage.setItem($(),JSON.stringify(k)),k})}function v(){if(typeof window!="undefined"&&window.localStorage){let u=window.localStorage.getItem($());if(u)return JSON.parse(u)}return null}function $(){return`${Lr}-${e}-${t.id}-${y}`}return Et.createElement(yp,{className:a("multiInput",r)},Et.createElement(Ae,{appearance:r,title:t.title,subtitle:t.subtitle}),Et.createElement(hp,{className:a("multiInputContainer",r)},(B=d==null?void 0:d.data)==null?void 0:B.map(u=>{let O=s.reverse().find(w=>w.id===u.id);return P[u.type]?Et.createElement("span",{key:u.id,"data-field-id":u.id,className:a("multiInputField",r)},P[u.type]({formInput:u,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:w=>{!c.includes(u.id)&&w&&(w==null?void 0:w.text)!==""&&g(k=>[...k,u.id]),S(u,w)},inputData:b[u.id],setFormValidationErrors:w=>{w.length===0&&s.length===0||m(k=>w.length===0?k.filter(I=>I.id!==u.id):[...k,...w])}}),O&&O.message&&c.includes(u.id)&&O.hidden!==!0&&Et.createElement(xp,{key:u.id,style:{overflow:"hidden"},appearance:r,className:a("multiInputValidationError",r)},Et.createElement(Cp,{appearance:r,className:a("multiInputValidationErrorIcon",r)},Et.createElement(ji,null)),O.message)):null})))}import Jt from"styled-components";var qi=Jt.div`
|
|
420
422
|
align-items: center;
|
|
421
423
|
display: flex;
|
|
422
424
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
423
425
|
padding-top: 14px;
|
|
424
|
-
`,Yi=
|
|
426
|
+
`,Yi=Jt.div`
|
|
425
427
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
426
428
|
font-size: 12px;
|
|
427
|
-
`,Ji=
|
|
429
|
+
`,Ji=Jt.div`
|
|
428
430
|
display: flex;
|
|
429
431
|
gap: 12px;
|
|
430
432
|
width: 100%;
|
|
431
433
|
justify-content: flex-end;
|
|
432
|
-
`,Xi=
|
|
434
|
+
`,Xi=Jt.div`
|
|
433
435
|
display: flex;
|
|
434
436
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
435
437
|
// Otherwise, use 4px padding
|
|
@@ -437,11 +439,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
437
439
|
flex-grow: 1;
|
|
438
440
|
flex-basis: 0;
|
|
439
441
|
position: relative;
|
|
440
|
-
`,Qi=
|
|
442
|
+
`,Qi=Jt.div`
|
|
441
443
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
442
444
|
position: relative;
|
|
443
445
|
overflow-y: auto;
|
|
444
|
-
`,Zi=
|
|
446
|
+
`,Zi=Jt.div`
|
|
445
447
|
display: flex;
|
|
446
448
|
align-self: stretch;
|
|
447
449
|
flex-grow: 1;
|
|
@@ -453,7 +455,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
453
455
|
background-position: center;
|
|
454
456
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
455
457
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
456
|
-
`;import
|
|
458
|
+
`;import yt from"react";import en from"react";import tn from"styled-components";import bp from"styled-components";var Ri=bp.div`
|
|
457
459
|
width: 24px;
|
|
458
460
|
height: 24px;
|
|
459
461
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
@@ -471,7 +473,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
471
473
|
transform: rotate(360deg);
|
|
472
474
|
}
|
|
473
475
|
}
|
|
474
|
-
`;var
|
|
476
|
+
`;var wp=tn.button`
|
|
475
477
|
justify-content: center;
|
|
476
478
|
align-content: center;
|
|
477
479
|
align-items: center;
|
|
@@ -490,7 +492,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
490
492
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
491
493
|
line-height: 20px;
|
|
492
494
|
font-weight: 500;
|
|
493
|
-
${e=>
|
|
495
|
+
${e=>ke(e)}
|
|
494
496
|
}
|
|
495
497
|
|
|
496
498
|
font-family: inherit;
|
|
@@ -504,7 +506,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
504
506
|
opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
|
|
505
507
|
cursor: not-allowed;
|
|
506
508
|
}
|
|
507
|
-
`,
|
|
509
|
+
`,Jo=tn.div`
|
|
508
510
|
${e=>E(e)} {
|
|
509
511
|
display: flex;
|
|
510
512
|
flex-direction: row;
|
|
@@ -515,14 +517,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
515
517
|
margin-right: 8px;
|
|
516
518
|
}
|
|
517
519
|
}
|
|
518
|
-
`,
|
|
520
|
+
`,se=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:l=!1,appearance:p,withMargin:d=!0,classPrefix:s="",loading:m=!1,autoFocus:c=!1})=>{var y;function g(){let b=l?"buttonSecondary":"button";return s===""?b:`${s}${So(b)}`}return en.createElement(wp,{tabindex:l?"0":"1",secondary:l,appearance:p,disabled:i||m,loading:(y=m==null?void 0:m.toString())!=null?y:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:a(g(),p),autoFocus:c},m?en.createElement(Ri,{className:a("buttonLoader",p)}):t!=null?t:"Continue")};var on=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:l,onBack:p,allowBackNavigation:d,errorMessage:s,isSaving:m})=>{var y;let c=l.length>1&&r!=0&&d,g=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return yt.createElement(yt.Fragment,null,s!==null&&s!=null&&yt.createElement(Yi,{appearance:o,className:a("formCTAError",o)},s),yt.createElement(qi,{showBackButton:c,className:a("formCTAContainer",o)},c&&yt.createElement(se,{title:(y=e.backButtonTitle)!=null?y:"Back",onClick:p,secondary:!0,withMargin:!1,type:g,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),yt.createElement(Ji,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?yt.createElement(se,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:g,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?yt.createElement(se,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:g,appearance:o,loading:m}):null)))};import $r from"react";import Tp from"styled-components";var Fp=Tp.div`
|
|
519
521
|
text-align: center;
|
|
520
|
-
`,rn=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=
|
|
522
|
+
`,rn=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=ie().mergeAppearanceWithDefault(i);return $r.createElement(Fp,{className:o},$r.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,l)=>$r.createElement("rect",{key:l,x:16*l,y:0,width:8,height:8,rx:4,fill:t===l?n.colorPrimary:"#E6E6E6"}))))};import At from"react";import Xt from"styled-components";import{useContext as kp}from"react";function ue(){let e=kp(Q);function t(n){i(n.primaryButtonUri,n.primaryButtonUriTarget)}function o(n){i(n.secondaryButtonUri,n.secondaryButtonUriTarget)}function i(n,r){if(!n)return;let l=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(l="_self"),e.navigate(n,l)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Pp=Xt.div`
|
|
521
523
|
display: flex;
|
|
522
524
|
flex-wrap: wrap;
|
|
523
525
|
align-content: center;
|
|
524
526
|
justify-content: center;
|
|
525
|
-
`,
|
|
527
|
+
`,vp=Xt.div`
|
|
526
528
|
align-content: center;
|
|
527
529
|
align-items: center;
|
|
528
530
|
display: flex;
|
|
@@ -536,10 +538,10 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
536
538
|
flex-basis: 255px;
|
|
537
539
|
flex-grow: 0;
|
|
538
540
|
flex-shrink: 0;
|
|
539
|
-
`,
|
|
541
|
+
`,Bp=Xt.img`
|
|
540
542
|
width: 78px;
|
|
541
543
|
height: auto;
|
|
542
|
-
`,
|
|
544
|
+
`,Ep=Xt.button`
|
|
543
545
|
font-style: normal;
|
|
544
546
|
font-weight: 600;
|
|
545
547
|
font-size: 13px;
|
|
@@ -552,11 +554,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
552
554
|
border-radius: 100px;
|
|
553
555
|
padding: 8px 12px;
|
|
554
556
|
margin-top: 16px;
|
|
555
|
-
`,
|
|
557
|
+
`,Ap=Xt.h1`
|
|
556
558
|
font-weight: 700;
|
|
557
559
|
font-size: 28px;
|
|
558
560
|
line-height: 34px;
|
|
559
|
-
`,
|
|
561
|
+
`,Op=Xt.h2`
|
|
560
562
|
font-style: normal;
|
|
561
563
|
font-weight: 400;
|
|
562
564
|
font-size: 16px;
|
|
@@ -565,7 +567,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
565
567
|
margin-top: 12px;
|
|
566
568
|
margin-bottom: 16px;
|
|
567
569
|
max-width: 70%;
|
|
568
|
-
`;function nn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=
|
|
570
|
+
`;function nn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=ue();return At.createElement("div",null,At.createElement(Ap,{dangerouslySetInnerHTML:ne(e.title)}),At.createElement(Op,{dangerouslySetInnerHTML:ne(e.subtitle)}),At.createElement(Pp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>At.createElement(vp,{key:r.title},At.createElement(Bp,{src:r.imageUri}),At.createElement(Ep,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var l;r.uri&&o(r.uri,(l=r.uriTarget)!=null?l:"_blank")}},r.title)))))}import Zt,{useEffect as Wp}from"react";import Qo from"styled-components";import Mr from"react";var Xo=({style:e,className:t})=>Mr.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},Mr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Mr.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 Ot,{useRef as Np,useState as Ip}from"react";import Qt from"styled-components";var Lp=Qt.div`
|
|
569
571
|
display: flex;
|
|
570
572
|
align-items: center;
|
|
571
573
|
justify-content: flex-start;
|
|
@@ -573,7 +575,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
573
575
|
width: 100%;
|
|
574
576
|
height: 100%;
|
|
575
577
|
position: relative;
|
|
576
|
-
|
|
578
|
+
`,$p=Qt.div`
|
|
577
579
|
position: absolute;
|
|
578
580
|
display: flex;
|
|
579
581
|
align-items: center;
|
|
@@ -592,66 +594,66 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
592
594
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
593
595
|
border-radius: 50%;
|
|
594
596
|
}
|
|
595
|
-
|
|
597
|
+
`,Mp=Qt.video`
|
|
596
598
|
width: 100%;
|
|
597
599
|
height: 100%;
|
|
598
600
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
599
|
-
`,
|
|
601
|
+
`,Dp=Qt.iframe`
|
|
600
602
|
width: 100%;
|
|
601
603
|
height: 100%;
|
|
602
604
|
min-height: 260px;
|
|
603
605
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
604
|
-
`,
|
|
606
|
+
`,Up=Qt.iframe`
|
|
605
607
|
width: 100%;
|
|
606
608
|
height: 100%;
|
|
607
609
|
min-height: 400px;
|
|
608
610
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
609
|
-
}`,
|
|
611
|
+
}`,_p=Qt.iframe`
|
|
610
612
|
width: 100%;
|
|
611
613
|
height: 100%;
|
|
612
614
|
min-height: 400px;
|
|
613
615
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
614
|
-
`;function tt({appearance:e,videoUri:t}){let o=
|
|
616
|
+
`;function tt({appearance:e,videoUri:t}){let o=Np(),[i,n]=Ip(!1);if(t.includes("youtube")){let r=t.split("v=")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),Ot.createElement(Dp,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("youtubePlayer",e)})}if(t.includes("vimeo")){let r=t.split("vimeo.com/")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),Ot.createElement(Up,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("vimeoPlayer",e)})}if(t.includes("wistia")){let r=t.split("wistia.com/medias/")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),Ot.createElement(_p,{width:"100%",height:"100%",src:`https://fast.wistia.net/embed/iframe/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("wistiaPlayer",e)})}return Ot.createElement(Lp,{className:a("videoPlayerWrapper",e),appearance:e},!i&&Ot.createElement($p,{onClick:()=>{n(!0),o.current.play()},appearance:e},Ot.createElement(Xo,null)),Ot.createElement(Mp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var zp=Qo.div`
|
|
615
617
|
${e=>E(e)} {
|
|
616
618
|
display: flex;
|
|
617
619
|
flex-direction: column;
|
|
618
620
|
justify-content: center;
|
|
619
621
|
}
|
|
620
|
-
`,
|
|
622
|
+
`,Hp=Qo.img`
|
|
621
623
|
${e=>E(e)} {
|
|
622
624
|
width: 100%;
|
|
623
625
|
height: auto;
|
|
624
626
|
max-height: 250px;
|
|
625
627
|
margin-bottom: 24px;
|
|
626
628
|
}
|
|
627
|
-
`,
|
|
629
|
+
`,Vp=Qo.div`
|
|
628
630
|
${e=>E(e)} {
|
|
629
631
|
margin-bottom: 24px;
|
|
630
632
|
}
|
|
631
|
-
`,
|
|
633
|
+
`,jp=Qo.div`
|
|
632
634
|
${e=>E(e)} {
|
|
633
635
|
width: 100%;
|
|
634
636
|
height: auto;
|
|
635
637
|
max-height: 250px;
|
|
636
638
|
margin-bottom: 24px;
|
|
637
639
|
}
|
|
638
|
-
`;function sn({stepData:e,appearance:t,setCanContinue:o}){return
|
|
640
|
+
`;function sn({stepData:e,appearance:t,setCanContinue:o}){return Wp(()=>{o(!0)},[]),Zt.createElement(zp,{className:a("callToActionContainer",t)},Zt.createElement(Vp,{className:a("callToActionTextContainer",t)},Zt.createElement(Ae,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Zt.createElement(Hp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Zt.createElement(jp,{appearance:t,className:a("callToActionVideo",t)},Zt.createElement(tt,{appearance:t,videoUri:e.videoUri})))}import pt,{useEffect as Dr,useState as Ur}from"react";import St from"styled-components";var ln=St.div`
|
|
639
641
|
width: auto;
|
|
640
642
|
display: flex;
|
|
641
643
|
flex-direction: column;
|
|
642
644
|
justify-content: center;
|
|
643
645
|
align-items: center;
|
|
644
646
|
padding: 4px;
|
|
645
|
-
`,an=
|
|
647
|
+
`,an=St.div`
|
|
646
648
|
width: 100%;
|
|
647
649
|
text-align: left;
|
|
648
|
-
`,pn=
|
|
650
|
+
`,pn=St.h1`
|
|
649
651
|
font-style: normal;
|
|
650
652
|
font-weight: 700;
|
|
651
653
|
font-size: 32px;
|
|
652
654
|
line-height: 38px;
|
|
653
655
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
654
|
-
`,dn=
|
|
656
|
+
`,dn=St.h1`
|
|
655
657
|
font-style: normal;
|
|
656
658
|
font-weight: 400;
|
|
657
659
|
font-size: 16px;
|
|
@@ -659,7 +661,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
659
661
|
margin-top: 16px;
|
|
660
662
|
margin-bottom: 16px;
|
|
661
663
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
662
|
-
`,cn=
|
|
664
|
+
`,cn=St.div`
|
|
663
665
|
padding-top: 12px;
|
|
664
666
|
padding-bottom: 12px;
|
|
665
667
|
flex-direction: row;
|
|
@@ -670,17 +672,17 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
670
672
|
cursor: pointer;
|
|
671
673
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
672
674
|
width: 100%;
|
|
673
|
-
`,mn=
|
|
675
|
+
`,mn=St.div`
|
|
674
676
|
padding-top: 10px;
|
|
675
677
|
padding-bottom: 10px;
|
|
676
678
|
flex-direction: row;
|
|
677
679
|
display: flex;
|
|
678
680
|
justify-content: flex-start;
|
|
679
|
-
`,un=
|
|
681
|
+
`,un=St.img`
|
|
680
682
|
width: 42px;
|
|
681
683
|
height: 42px;
|
|
682
684
|
margin-right: 12px;
|
|
683
|
-
`,fn=
|
|
685
|
+
`,fn=St.p`
|
|
684
686
|
font-style: normal;
|
|
685
687
|
font-weight: 500;
|
|
686
688
|
font-size: 17px;
|
|
@@ -688,8 +690,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
688
690
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
689
691
|
display: flex;
|
|
690
692
|
align-self: center;
|
|
691
|
-
`;var gn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,l]=
|
|
692
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([l,p])=>`${Mo(l)}: ${p};`).join(" ")} }`:`${Mo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function le({appearance:e}){if(!e||!e.styleOverrides)return To.createElement(To.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?To.createElement(To.Fragment,null):To.createElement(Kp,{inlineStyles:t})}import{useEffect as qp,useState as Yp}from"react";function Ge(e,t=!0){let[o,i]=Yp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:l,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:s,getFlow:m}=R(),c=p(e);function f(){return M(this,null,function*(){!o&&!r&&l(e)===Ue&&s(m(e))===!1&&t&&(i(!0),yield n(e,c[d(e)].id))})}return qp(()=>{f()},[r,e,t]),{}}var Cn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:l,onComplete:p,appearance:d,hideOnFlowCompletion:s=!0,onStepCompletion:m,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:S=!1,modalPosition:w="center",repeatable:b=!1,onDismiss:x,showPagination:v=!1,allowBackNavigation:k=!1,validationHandler:B,showFrigadeBranding:L=!1,onFormDataChange:C,showFooter:u=!0,prefillData:N={},updateUrlOnPageChange:F=!1})=>{let{getFlow:P,getFlowSteps:I,isLoading:O,targetingLogicShouldHideFlow:A,getFlowStatus:G,getCurrentStepIndex:_,markFlowCompleted:Q,markFlowNotStarted:Y,markStepStarted:ae}=R(),J=_(e),{mergeAppearanceWithDefault:q}=re(),[pe,we]=Jp(null),{setOpenFlowState:Ne,getOpenFlowState:Z,hasOpenModals:ce}=Ee();Ge(e,i);let U=I(e);d=q(d);let[te,Ie]=i!==void 0&&n!==void 0?[i,n]:[Z(e,!0),H=>Ne(e,H)],ke=typeof window!="undefined"?window.location.hash:null;if(xn(()=>{var H;if(U&&U.length>0&&k){let W=typeof window!="undefined"&&((H=window==null?void 0:window.location)!=null&&H.hash)?window.location.hash.replace("#",""):"";if(U&&(U==null?void 0:U.length)>0){let $=-1;if(W){let z=W;$=U.findIndex(de=>de.id===z),pe===W&&($=-1)}$!==-1&&(we(W),ae(e,U[$].id))}}},[ke]),xn(()=>{!O&&U&&U.length&&typeof window!="undefined"&&k&&(we(U[J].id),window.location.hash=U[J].id)},[O,J,U]),O)return null;let xe=P(e);if(!xe||A(xe)||!U||i!==void 0&&i===!1||G(e)===oe&&s&&!b||(o=="modal"||o=="corner-modal")&&ce(e))return null;let Ce=()=>{Ie(!1),x&&x(),S===!0&&Q(e)};if(w=="center"&&o==="modal"||o==="large-modal"){let H={padding:"24px"};return o==="large-modal"?(H.width="85%",H.height="90%",H.maxHeight="800px",H.minHeight="500px",H.padding="0"):H.width="400px",ot.createElement(Re,{appearance:d,onClose:Ce,visible:te,style:H,dismissible:f,showFrigadeBranding:L},ot.createElement(le,{appearance:d}),ot.createElement(Qo,{appearance:d,steps:U,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ie,onDismiss:x,showPagination:v,customFormElements:l,allowBackNavigation:k,validationHandler:B,onFormDataChange:C,showFooter:u,prefillData:N,updateUrlOnPageChange:F,repeatable:b}))}return o==="modal"&&w!=="center"?ot.createElement(zo,{appearance:d,onClose:Ce,visible:te,modalPosition:w},ot.createElement(le,{appearance:d}),ot.createElement(Qo,{appearance:d,steps:U,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ie,onDismiss:x,showPagination:v,customFormElements:l,allowBackNavigation:k,validationHandler:B,onFormDataChange:C,showFooter:u,prefillData:N,updateUrlOnPageChange:F,repeatable:b})):ot.createElement(ot.Fragment,null,ot.createElement(le,{appearance:d}),ot.createElement(Qo,{appearance:d,steps:U,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ie,onDismiss:x,showPagination:v,customFormElements:l,allowBackNavigation:k,validationHandler:B,onFormDataChange:C,showFooter:u,prefillData:N,updateUrlOnPageChange:F,repeatable:b}))},yn=Cn;import{useCallback as Dr,useContext as Xp,useEffect as Qp}from"react";function Ur(){let{organizationId:e,userId:t,setOrganizationId:o}=Xp(X),{mutateUserFlowState:i}=_e(),{config:n,apiUrl:r}=Ze(),l=Vt(),{verifySDKInitiated:p}=jt();function d(f,S){return`frigade-user-group-registered-${f}-${S}`}Qp(()=>{if(t&&e){if(t.startsWith(Gt))return;let f=d(t,e);localStorage.getItem(f)||(l(`${r}userGroups`,V(T({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"))}},[t,e]);let s=Dr(f=>M(this,null,function*(){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 S={foreignUserId:t,foreignUserGroupId:e,properties:f};yield l(`${r}userGroups`,V(T({},n),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,n,i]),m=Dr((f,S)=>M(this,null,function*(){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 b={foreignUserId:t,foreignUserGroupId:e,events:[{event:f,properties:S}]};yield l(`${r}userGroups`,V(T({},n),{method:"POST",body:JSON.stringify(b)})),i()}),[e,t,n,i]),c=Dr((f,S)=>M(this,null,function*(){if(p())if(S){let w=d(t,f);localStorage.setItem(w,"true"),o(f);let b={foreignUserId:t,foreignUserGroupId:f,properties:S};yield l(`${r}userGroups`,V(T({},n),{method:"POST",body:JSON.stringify(b)})),i()}else o(f)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:m}}var Sn="frigade-xFrigade_guestUserId",ko="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=ho(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=_e(),{userId:n,setUserId:r}=xo(),[l,p]=Fo(n),{getFlowStatus:d}=R(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:f}=Zp(X),[S,w]=Fo([]),[b,x]=Fo([]),{organizationId:v}=Ur(),[k,B]=Fo(v),[L,C]=Fo(!1);Zt(()=>{if(!o&&t)for(let P=0;P<t.length;P++){let I=t[P],O=s.find(A=>A.slug===(I==null?void 0:I.flowId));if(O&&I&&I.shouldTrigger===!0&&O.type=="FORM"&&O.triggerType==="AUTOMATIC"&&!b.includes(O.slug)){setTimeout(()=>{u(I.flowId)},500);break}}},[o,t]),Zt(()=>{f.length>0&&i()},[f]),Zt(()=>{L||(C(!0),i())},[o,C]);function u(P){let I=s.find(O=>O.slug===P);I&&I.triggerType==="AUTOMATIC"&&!b.includes(I.slug)&&(x([...b,I.slug]),w([I]))}function N(){if(!n){let P=localStorage.getItem(ko);if(P){r(P);return}let I=localStorage.getItem(Sn);if(I){r(I);return}c(!0);let O=Gt+Rp();try{localStorage.setItem(Sn,O)}catch(A){console.log("Failed to save guest user id locally: Local storage unavailable",A)}r(A=>A||O)}}Zt(()=>{try{if(s){let P=[];s.forEach(I=>{if(I.data){let O=I.data.match(/"imageUri":"(.*?)"/g);O&&O.forEach(A=>{let G=A.replace('"imageUri":"',"").replace('"',"");if(P.includes(G))return;let _=new Image;_.src=G,P.push(G)})}})}}catch(P){}},[s]),Zt(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Gt))try{localStorage.setItem(ko,n)}catch(P){console.log("Failed to save user id locally: Local storage available",P)}n===null&&setTimeout(()=>{n===null&&N()},50)},[n,s,m]),Zt(()=>{v!=k&&(B(v),e([]),i())},[v,k,B]);function F(){return Nt.createElement(Nt.Fragment,null,S.map(P=>d(P.slug)!==Ue?null:Nt.createElement("span",{key:P.slug},Nt.createElement(yn,{flowId:P.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Nt.createElement(Nt.Fragment,null,Nt.createElement(F,null))};var wn={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 ed(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l]})}}),t}function td(e){if(!e)return;let t=ye({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=ed(t),n=td(o);return{overrides:i,css:n}}import gd from"styled-components";import{compose as hd,variant as kn}from"styled-system";import Fn from"react";import od,{ThemeProvider as rd,useTheme as id}from"styled-components";import{border as nd,color as sd,compose as ld,get as ad,shadow as pd,space as dd,system as cd,typography as md}from"styled-system";var ud={width:{property:"width",scale:"sizes",transform:(e,t)=>ad(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},fd=od("div")(({css:e})=>e,ld(nd,sd,pd,dd,md,cd(ud))),Po=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Le(r,["as","children","overrides"]);let l=id(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(fd,T(T({as:e},p),i),t);if(o!==void 0){let s=ye(l,o);return Fn.createElement(rd,{theme:s},d())}return d()};var vo={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"}},xd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=gd(Po)(()=>({whiteSpace:"nowrap"}),hd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:xd})));import Cd from"styled-components";import{variant as yd,system as Sd}from"styled-system";var Zo={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 vn=Cd(Po)(yd({scale:"components.Text",variants:"components.Text"}),Sd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",bd=20,wd=Object.fromEntries(Array.from(Array(bd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),Rt={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"},_r={colors:V(T({},Rt),{neutral:{foreground:Rt.gray300},primary:{background:Rt.blue500,foreground:Rt.white,inverted:Rt.blue500},negative:{foreground:Rt.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:wd,components:{Button:vo,Text:Zo}};var An="https://api.frigade.com",X=Td({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:pt,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:An,readonly:!1,debug:!1});function kd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Pd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var J,q,pe,we,Ne;let[r,l]=Ke(t||null),[p,d]=Ke(o||null),[s,m]=Ke([]),[c,f]=Ke([]),[S,w]=Ke([]),[b,x]=Ke({}),[v,k]=Ke({}),[B,L]=Ke([]),[C,u]=Ke({}),[N,F]=Ke(!1),[P,I]=Ke(!1),[O,A]=Ke(!Q(e)),G=(Z,ce)=>{if(ce==="_blank"){window.open(Z,"_blank");return}setTimeout(()=>{window.location.href=Z},50)},_={theme:T(T({},pt.theme),(q=(J=i==null?void 0:i.defaultAppearance)==null?void 0:J.theme)!=null?q:{}),styleOverrides:T(T({},pt.styleOverrides),(we=(pe=i==null?void 0:i.defaultAppearance)==null?void 0:pe.styleOverrides)!=null?we:{})};function Q(Z){return!!(Z&&Z.length>10&&Z.substring(0,10)==="api_public")}er(()=>{t&&l(t)},[t]),er(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(ko)&&window.localStorage.getItem(ko)!==r&&kd()},[r]),er(()=>{o&&d(o)},[o]),er(()=>{if(Q(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]);let Y={publicApiKey:e,userId:r,setUserId:l,setFlows:m,flows:s,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:S,setFlowResponses:w,userProperties:b,setUserProperties:x,openFlowStates:v,setOpenFlowStates:k,completedFlowsToKeepOpenDuringSession:B,setCompletedFlowsToKeepOpenDuringSession:L,customVariables:C,setCustomVariables:u,isNewGuestUser:N,setIsNewGuestUser:F,hasActiveFullPageFlow:P,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:G,defaultAppearance:_,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:A,apiUrl:i&&i.apiUrl?i.apiUrl:An,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0};if(O)return Ro.createElement(X.Provider,{value:Y},n);let{overrides:ae}=Tn(_);return Ro.createElement(X.Provider,{value:Y},Ro.createElement(Fd,{theme:ye(_.theme,_r,ae!=null?ae:{},(Ne=i==null?void 0:i.theme)!=null?Ne:{})},n,Ro.createElement(bn,null)))};import gc from"react";import Se,{useEffect as pr,useState as il}from"react";import Ye,{useState as jd}from"react";import $t from"styled-components";import rr from"react";import It from"react";import Nn from"styled-components";var On=Nn.span`
|
|
693
|
+
`;var gn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,l]=Ur([]),[p,d]=Ur(!1),[s,m]=Ur(e.id);return Dr(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Dr(()=>{s!==e.id&&(m(e.id),l([]))},[e]),Dr(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),pt.createElement(ln,{className:a("selectListContainer",i)},pt.createElement(an,null,pt.createElement(pn,{className:a("selectListTitle",i)},e.title),pt.createElement(dn,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),n.options.map((c,g)=>{let y=r.includes(c.id);return pt.createElement(cn,{key:`select-item-${g}`,onClick:()=>{if(r.includes(c.id)){l(r.filter(b=>b!==c.id));return}r.length<n.maxChoices?l([...r,c.id]):r.length==1&&n.maxChoices==1&&l([c.id])},hideBottomBorder:g===n.options.length-1,className:a("selectListSelectItem",i)},pt.createElement(mn,{className:a("selectListItemImage",i)},c.imageUri&&pt.createElement(un,{src:c.imageUri,alt:`select-icon-${g}`}),pt.createElement(fn,{appearance:i,className:a("selectListSelectItemText",i)},c.title)),pt.createElement(at,{appearance:i,value:y,primaryColor:i.theme.colorPrimary}))}))};import Ue,{useEffect as hn,useState as Zo}from"react";var Gp=({children:e,id:t,shouldWrap:o=!1})=>Ue.createElement(Ue.Fragment,null,o?Ue.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),Ro=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:l,flowId:p,type:d,hideOnFlowCompletion:s,onComplete:m,setVisible:c,setShowModal:g,onDismiss:y,showPagination:b=!1,customFormElements:C,allowBackNavigation:x,validationHandler:P,onFormDataChange:S,showFooter:v,prefillData:$,updateUrlOnPageChange:B,repeatable:u})=>{var ce;let w=T(T({},{linkCollection:nn,multiInput:Ki,callToAction:sn,selectList:gn}),i),{primaryCTAClickSideEffects:k,secondaryCTAClickSideEffects:I}=ue(),[N,A]=Zo(!1),[H,_]=Zo({}),[ee,X]=Zo(!1),[q,Y]=Zo(null),J=(ce=t[o])!=null?ce:null,{markStepCompleted:pe,markStepStarted:we,isLoading:Oe,updateCustomVariables:de,markFlowCompleted:Z}=R();hn(()=>{de(n)},[n,Oe]),hn(()=>{S&&S(H,D(),t[o],o)},[H]);function D(){var W;return{data:(W=H[t[o].id])!=null?W:{},stepId:t[o].id,customVariables:n}}function oe(V,W,L){let z=o+1<t.length?t[o+1]:null;return l&&l(V,L,z,H,D()),r?r(V,o,W,z):!0}function Ne(V,W){_(L=>{let z={};return z[V.id]=W,T(T({},L),z)})}function Je(V){return V.selectedStep.imageUri?Ue.createElement(Zi,{image:V.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let xe=v&&Ue.createElement(on,{step:t[o],canContinue:N&&!ee,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>M(void 0,null,function*(){if(X(!0),P){let L=yield P(t[o],o,t[o+1],H,D());if(L!==!0){Y(typeof L=="string"?L:null),X(!1);return}else Y(null)}let V=T({},D());yield pe(p,t[o].id,V),o+1<t.length&&!x&&(yield we(p,t[o+1].id));let W=oe(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),y&&y(),s&&W&&(c&&c(!1),g(!1)),yield Z(p),u&&(yield we(p,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(z=>{z.startsWith(Lr)&&window.localStorage.removeItem(z)}))),k(t[o]),X(!1),typeof window!="undefined"&&!x&&B&&o+1<t.length){let L=new URL(window.location.href);L.searchParams.set("p",t[o+1].id),window.history.pushState({},"",L.toString())}}),onSecondaryClick:()=>{oe(t[o],"secondary",o),I(t[o])},onBack:()=>M(void 0,null,function*(){o-1>=0&&(X(!0),yield we(p,t[o-1].id),X(!1))}),steps:t,allowBackNavigation:x,errorMessage:q,isSaving:ee});return Ue.createElement(Ue.Fragment,null,Ue.createElement(Xi,{className:a("formContainer",e)},Ue.createElement(Gp,{id:o,shouldWrap:d==="large-modal"},Ue.createElement(Qi,{key:J.id,type:d,className:a("formContent",e)},t.map(V=>{var L;let W=w[(L=V.type)!=null?L:"multiInput"];return J.id!==V.id?null:typeof W!="function"?W:Ue.createElement(W,{key:V.id,stepData:V,canContinue:N,setCanContinue:A,onSaveData:z=>{Ne(V,z)},appearance:e,customFormElements:C,flowId:p,prefillData:$})}),b&&Ue.createElement(rn,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),xe)),d=="large-modal"&&Ue.createElement(Je,{selectedStep:t[o]})))};import Fo from"react";import{createGlobalStyle as Kp}from"styled-components";var qp=Kp`
|
|
694
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([l,p])=>`${Uo(l)}: ${p};`).join(" ")} }`:`${Uo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ae({appearance:e}){if(!e||!e.styleOverrides)return Fo.createElement(Fo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?Fo.createElement(Fo.Fragment,null):Fo.createElement(qp,{inlineStyles:t})}import{useEffect as Yp,useState as Jp}from"react";function He(e,t=!0){let[o,i]=Jp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:l,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:s,getFlow:m}=R(),c=p(e);function g(){return M(this,null,function*(){!o&&!r&&l(e)===Me&&s(m(e))===!1&&t&&(i(!0),yield n(e,c[d(e)].id))})}return Yp(()=>{g()},[r,e,t]),{}}var Cn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:l,onComplete:p,appearance:d,hideOnFlowCompletion:s=!0,onStepCompletion:m,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:y=!1,modalPosition:b="center",repeatable:C=!1,onDismiss:x,showPagination:P=!1,allowBackNavigation:S=!1,validationHandler:v,showFrigadeBranding:$=!1,onFormDataChange:B,showFooter:u=!0,prefillData:O={},updateUrlOnPageChange:w=!1})=>{let{getFlow:k,getFlowSteps:I,isLoading:N,targetingLogicShouldHideFlow:A,getFlowStatus:H,getCurrentStepIndex:_,markFlowCompleted:ee,markFlowNotStarted:X,markStepStarted:q}=R(),Y=_(e),{mergeAppearanceWithDefault:J}=ie(),[pe,we]=Xp(null),{setOpenFlowState:Oe,getOpenFlowState:de,hasOpenModals:Z}=Be();He(e,i);let D=I(e);d=J(d);let[oe,Ne]=i!==void 0&&n!==void 0?[i,n]:[de(e,!0),V=>Oe(e,V)],Je=typeof window!="undefined"?window.location.hash:null;if(xn(()=>{var V;if(D&&D.length>0&&S){let W=typeof window!="undefined"&&((V=window==null?void 0:window.location)!=null&&V.hash)?window.location.hash.replace("#",""):"";if(D&&(D==null?void 0:D.length)>0){let L=-1;if(W){let z=W;L=D.findIndex(me=>me.id===z),pe===W&&(L=-1)}L!==-1&&(we(W),q(e,D[L].id))}}},[Je]),xn(()=>{!N&&D&&D.length&&typeof window!="undefined"&&S&&(we(D[Y].id),window.location.hash=D[Y].id)},[N,Y,D]),N)return null;let xe=k(e);if(!xe||A(xe)||!D||i!==void 0&&i===!1||H(e)===re&&s&&!C||(o=="modal"||o=="corner-modal")&&Z(e))return null;let ce=()=>{Ne(!1),x&&x(),y===!0&&ee(e)};if(b=="center"&&o==="modal"||o==="large-modal"){let V={padding:"24px"};return o==="large-modal"?(V.width="85%",V.height="90%",V.maxHeight="800px",V.minHeight="500px",V.padding="0"):V.width="400px",ot.createElement(Re,{appearance:d,onClose:ce,visible:oe,style:V,dismissible:g,showFrigadeBranding:$},ot.createElement(ae,{appearance:d}),ot.createElement(Ro,{appearance:d,steps:D,selectedStep:Y,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ne,onDismiss:x,showPagination:P,customFormElements:l,allowBackNavigation:S,validationHandler:v,onFormDataChange:B,showFooter:u,prefillData:O,updateUrlOnPageChange:w,repeatable:C}))}return o==="modal"&&b!=="center"?ot.createElement(Vo,{appearance:d,onClose:ce,visible:oe,modalPosition:b},ot.createElement(ae,{appearance:d}),ot.createElement(Ro,{appearance:d,steps:D,selectedStep:Y,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ne,onDismiss:x,showPagination:P,customFormElements:l,allowBackNavigation:S,validationHandler:v,onFormDataChange:B,showFooter:u,prefillData:O,updateUrlOnPageChange:w,repeatable:C})):ot.createElement(ot.Fragment,null,ot.createElement(ae,{appearance:d}),ot.createElement(Ro,{appearance:d,steps:D,selectedStep:Y,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ne,onDismiss:x,showPagination:P,customFormElements:l,allowBackNavigation:S,validationHandler:v,onFormDataChange:B,showFooter:u,prefillData:O,updateUrlOnPageChange:w,repeatable:C}))},yn=Cn;import{useCallback as _r,useContext as Qp,useEffect as Zp}from"react";function Wr(){let{organizationId:e,userId:t,setOrganizationId:o}=Qp(Q),{mutateUserFlowState:i}=De(),{config:n,apiUrl:r}=Ze(),l=jt(),{verifySDKInitiated:p}=Gt();function d(g,y){return`frigade-user-group-registered-${g}-${y}`}Zp(()=>{if(t&&e){if(t.startsWith(Kt))return;let g=d(t,e);localStorage.getItem(g)||(l(`${r}userGroups`,j(T({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let s=_r(g=>M(this,null,function*(){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 y={foreignUserId:t,foreignUserGroupId:e,properties:g};yield l(`${r}userGroups`,j(T({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=_r((g,y)=>M(this,null,function*(){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 C={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:y}]};yield l(`${r}userGroups`,j(T({},n),{method:"POST",body:JSON.stringify(C)})),i()}),[e,t,n,i]),c=_r((g,y)=>M(this,null,function*(){if(p())if(y){let b=d(t,g);localStorage.setItem(b,"true"),o(g);let C={foreignUserId:t,foreignUserGroupId:g,properties:y};yield l(`${r}userGroups`,j(T({},n),{method:"POST",body:JSON.stringify(C)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:m}}var Sn="frigade-xFrigade_guestUserId",Po="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=xo(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=De(),{userId:n,setUserId:r}=Co(),[l,p]=ko(n),{getFlowStatus:d}=R(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Rp(Q),[y,b]=ko([]),[C,x]=ko([]),{organizationId:P}=Wr(),[S,v]=ko(P),[$,B]=ko(!1);Rt(()=>{if(!o&&t)for(let k=0;k<t.length;k++){let I=t[k],N=s.find(A=>A.slug===(I==null?void 0:I.flowId));if(N&&I&&I.shouldTrigger===!0&&N.type=="FORM"&&N.triggerType==="AUTOMATIC"&&!C.includes(N.slug)){setTimeout(()=>{u(I.flowId)},500);break}}},[o,t]),Rt(()=>{g.length>0&&i()},[g]),Rt(()=>{$||(B(!0),i())},[o,B]);function u(k){let I=s.find(N=>N.slug===k);I&&I.triggerType==="AUTOMATIC"&&!C.includes(I.slug)&&(x([...C,I.slug]),b([I]))}function O(){if(!n){let k=localStorage.getItem(Po);if(k){r(k);return}let I=localStorage.getItem(Sn);if(I){r(I);return}c(!0);let N=Kt+ed();try{localStorage.setItem(Sn,N)}catch(A){console.log("Failed to save guest user id locally: Local storage unavailable",A)}r(A=>A||N)}}Rt(()=>{try{if(s){let k=[];s.forEach(I=>{if(I.data){let N=I.data.match(/"imageUri":"(.*?)"/g);N&&N.forEach(A=>{let H=A.replace('"imageUri":"',"").replace('"',"");if(k.includes(H))return;let _=new Image;_.src=H,k.push(H)})}})}}catch(k){}},[s]),Rt(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Kt))try{localStorage.setItem(Po,n)}catch(k){console.log("Failed to save user id locally: Local storage available",k)}n===null&&setTimeout(()=>{n===null&&O()},50)},[n,s,m]),Rt(()=>{P!=S&&(v(P),e([]),i())},[P,S,v]);function w(){return Nt.createElement(Nt.Fragment,null,y.map(k=>d(k.slug)!==Me?null:Nt.createElement("span",{key:k.slug},Nt.createElement(yn,{flowId:k.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Nt.createElement(Nt.Fragment,null,Nt.createElement(w,null))};var wn={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 td(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l]})}}),t}function od(e){if(!e)return;let t=Ce({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=td(t),n=od(o);return{overrides:i,css:n}}import hd from"styled-components";import{compose as xd,variant as kn}from"styled-system";import Fn from"react";import rd,{ThemeProvider as id,useTheme as nd}from"styled-components";import{border as sd,color as ld,compose as ad,get as pd,shadow as dd,space as cd,system as md,typography as ud}from"styled-system";var fd={width:{property:"width",scale:"sizes",transform:(e,t)=>pd(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},gd=rd("div")(({css:e})=>e,ad(sd,ld,dd,cd,ud,md(fd))),vo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Ie(r,["as","children","overrides"]);let l=nd(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(gd,T(T({as:e},p),i),t);if(o!==void 0){let s=Ce(l,o);return Fn.createElement(id,{theme:s},d())}return d()};var Bo={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"}},Cd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=hd(vo)(()=>({whiteSpace:"nowrap"}),xd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:Cd})));import yd from"styled-components";import{variant as Sd,system as bd}from"styled-system";var er={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 vn=yd(vo)(Sd({scale:"components.Text",variants:"components.Text"}),bd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",wd=20,Td=Object.fromEntries(Array.from(Array(wd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),eo={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"},tr={colors:j(T({},eo),{neutral:{foreground:eo.gray300},primary:{background:eo.blue500,foreground:eo.white,inverted:eo.blue500},negative:{foreground:eo.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:Td,components:{Button:Bo,Text:er}};var On="https://api.frigade.com",Q=Fd({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:lt,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:On,readonly:!1,debug:!1});function kd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Pd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var Y,J,pe,we,Oe,de;let[r,l]=Ve(t||null),[p,d]=Ve(o||null),[s,m]=Ve([]),[c,g]=Ve([]),[y,b]=Ve([]),[C,x]=Ve({}),[P,S]=Ve({}),[v,$]=Ve([]),[B,u]=Ve({}),[O,w]=Ve(!1),[k,I]=Ve(!1),[N,A]=Ve(!ee(e)),H=(Z,D)=>{if(D==="_blank"){window.open(Z,"_blank");return}setTimeout(()=>{window.location.href=Z},50)},_={theme:T(T({},lt.theme),(J=(Y=i==null?void 0:i.defaultAppearance)==null?void 0:Y.theme)!=null?J:{}),styleOverrides:T(T({},lt.styleOverrides),(we=(pe=i==null?void 0:i.defaultAppearance)==null?void 0:pe.styleOverrides)!=null?we:{})};function ee(Z){return!!(Z&&Z.length>10&&Z.substring(0,10)==="api_public")}or(()=>{t&&l(t)},[t]),or(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(Po)&&window.localStorage.getItem(Po)!==r&&kd()},[r]),or(()=>{o&&d(o)},[o]),or(()=>{if(ee(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]);let X={publicApiKey:e,userId:r,setUserId:l,setFlows:m,flows:s,failedFlowResponses:c,setFailedFlowResponses:g,flowResponses:y,setFlowResponses:b,userProperties:C,setUserProperties:x,openFlowStates:P,setOpenFlowStates:S,completedFlowsToKeepOpenDuringSession:v,setCompletedFlowsToKeepOpenDuringSession:$,customVariables:B,setCustomVariables:u,isNewGuestUser:O,setIsNewGuestUser:w,hasActiveFullPageFlow:k,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:H,defaultAppearance:_,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:A,apiUrl:i&&i.apiUrl?i.apiUrl:On,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0},{overrides:q}=Tn(_);return N?Eo.createElement(Q.Provider,{value:X},Eo.createElement(An,{theme:Ce(_.theme,tr,q!=null?q:{},(Oe=i==null?void 0:i.theme)!=null?Oe:{})},n)):Eo.createElement(Q.Provider,{value:X},Eo.createElement(An,{theme:Ce(_.theme,tr,q!=null?q:{},(de=i==null?void 0:i.theme)!=null?de:{})},n,Eo.createElement(bn,null)))};import gc from"react";import Se,{useEffect as cr,useState as nl}from"react";import Ye,{useState as jd}from"react";import $t from"styled-components";import nr from"react";import It from"react";import In from"styled-components";var Nn=In.span`
|
|
693
695
|
font-weight: 600;
|
|
694
696
|
font-size: 14px;
|
|
695
697
|
font-style: normal;
|
|
@@ -700,8 +702,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
700
702
|
vertical-align: middle;
|
|
701
703
|
margin-left: 32px;
|
|
702
704
|
padding-right: 12px;
|
|
703
|
-
${e=>
|
|
704
|
-
`,vd=
|
|
705
|
+
${e=>ke(e)}
|
|
706
|
+
`,vd=In.div`
|
|
705
707
|
flex-direction: row;
|
|
706
708
|
justify-content: space-between;
|
|
707
709
|
display: flex;
|
|
@@ -709,12 +711,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
709
711
|
padding-bottom: 20px;
|
|
710
712
|
padding-right: 8px;
|
|
711
713
|
width: 100%;
|
|
712
|
-
${e=>
|
|
713
|
-
`,
|
|
714
|
+
${e=>ke(e)}
|
|
715
|
+
`,rr=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:l="round",appearance:p})=>It.createElement(It.Fragment,null,It.createElement(vd,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:T({},n)},i==="left"&&e&&It.createElement(Nn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),It.createElement(at,{appearance:p,value:t,type:l,primaryColor:r}),i==="right"&&e&&It.createElement(Nn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),It.createElement(ae,{appearance:p}));import Ao from"styled-components";var Ln=Ao.div`
|
|
714
716
|
font-weight: 700;
|
|
715
717
|
font-size: 18px;
|
|
716
718
|
line-height: 22px;
|
|
717
|
-
|
|
719
|
+
`,$n=Ao.p`
|
|
718
720
|
font-weight: 600;
|
|
719
721
|
font-size: 16px;
|
|
720
722
|
line-height: 24px;
|
|
@@ -722,7 +724,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
722
724
|
letter-spacing: 0.32px;
|
|
723
725
|
font-style: normal;
|
|
724
726
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
725
|
-
|
|
727
|
+
`,Mn=Ao.p`
|
|
726
728
|
font-weight: 400;
|
|
727
729
|
font-size: 14px;
|
|
728
730
|
font-style: normal;
|
|
@@ -731,26 +733,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
731
733
|
letter-spacing: 0.28px;
|
|
732
734
|
margin: 8px 0px 0px 0px;
|
|
733
735
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
734
|
-
`,
|
|
736
|
+
`,ir=Ao.div`
|
|
735
737
|
width: 6px;
|
|
736
738
|
position: absolute;
|
|
737
739
|
left: 0;
|
|
738
740
|
height: 100%;
|
|
739
741
|
border-top-right-radius: 4px;
|
|
740
742
|
border-bottom-right-radius: 4px;
|
|
741
|
-
`,
|
|
743
|
+
`,Dn=Ao.div`
|
|
742
744
|
flex-direction: row;
|
|
743
745
|
justify-content: flex-start;
|
|
744
746
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
745
747
|
padding-right: 16px;
|
|
746
|
-
`;var
|
|
748
|
+
`;var Un=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:l})=>{var p,d,s,m,c;return nr.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&nr.createElement(ir,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(p=l==null?void 0:l.theme)==null?void 0:p.colorPrimary)!=null?d:i}}),nr.createElement(Dn,{className:a("checklistStepItem",l),key:`hero-checklist-step-${t}`,appearance:l,role:"listitem"},nr.createElement(rr,{value:e.complete,labelPosition:"left",label:(s=e.stepName)!=null?s:e.title,style:n,primaryColor:(c=(m=l==null?void 0:l.theme)==null?void 0:m.colorPrimary)!=null?c:i,appearance:l})))};import Lt from"react";import zr from"styled-components";import sr from"styled-components";var uC=sr.h1`
|
|
747
749
|
display: flex;
|
|
748
750
|
margin: 0;
|
|
749
751
|
font-size: 18px;
|
|
750
|
-
`,fC=
|
|
752
|
+
`,fC=sr.h2`
|
|
751
753
|
font-size: 15px;
|
|
752
754
|
color: #4d4d4d;
|
|
753
|
-
`,
|
|
755
|
+
`,_n=sr.div`
|
|
754
756
|
position: absolute;
|
|
755
757
|
left: 0;
|
|
756
758
|
top: 0;
|
|
@@ -759,7 +761,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
759
761
|
border-radius: 20px;
|
|
760
762
|
background-color: ${e=>e.theme.colorPrimary};
|
|
761
763
|
transition: width 0.5s;
|
|
762
|
-
`,
|
|
764
|
+
`,Wn=sr.div`
|
|
763
765
|
position: relative;
|
|
764
766
|
left: 0;
|
|
765
767
|
top: 0;
|
|
@@ -769,33 +771,33 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
769
771
|
border-radius: 20px;
|
|
770
772
|
background-color: ${e=>e.theme.colorPrimary};
|
|
771
773
|
opacity: 0.12;
|
|
772
|
-
`;var Bd=
|
|
774
|
+
`;var Bd=zr.div`
|
|
773
775
|
display: flex;
|
|
774
776
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
775
777
|
justify-content: flex-start;
|
|
776
778
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
777
779
|
width: 100%;
|
|
778
780
|
|
|
779
|
-
${e=>
|
|
780
|
-
`,Ed=
|
|
781
|
+
${e=>ke(e)}
|
|
782
|
+
`,Ed=zr.div`
|
|
781
783
|
flex-grow: 1;
|
|
782
784
|
position: relative;
|
|
783
785
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
784
|
-
`,Ad=
|
|
786
|
+
`,Ad=zr.span`
|
|
785
787
|
font-weight: 600;
|
|
786
788
|
font-size: 14px;
|
|
787
789
|
line-height: 18px;
|
|
788
790
|
padding-right: ${e=>e.padding};
|
|
789
791
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
790
|
-
${e=>
|
|
791
|
-
`;var
|
|
792
|
+
${e=>ke(e)}
|
|
793
|
+
`;var _e=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:l})=>{var g;if(t===0)return Lt.createElement(Lt.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(g=l==null?void 0:l.theme)==null?void 0:g.colorText});let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",s=Math.round(e/t*100),m=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${s}% complete`),i==="top"&&(m="0px"),Lt.createElement(Bd,{className:a("progressBarContainer",l),textLocation:i,styleOverrides:n},Lt.createElement(Ad,{className:a("progressBarStepText",l),styleOverrides:j(T({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:l,padding:m,textLocation:i},c),Lt.createElement(Ed,{textLocation:i,className:a("progressBar",l)},Lt.createElement(_n,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:l,className:a("progressBarFill",l)}),Lt.createElement(Wn,{className:a("progressBarBackground",l),barHeight:d,appearance:l})))};import Oo from"react";import Nd from"styled-components";import ar from"react";import lr from"react";var to=({stepData:e,appearance:t})=>lr.createElement(lr.Fragment,null,lr.createElement($n,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:ne(e.title)}),lr.createElement(Mn,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:ne(e.subtitle)}));import Hr from"react";var oo=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Hr.createElement(Jo,{className:a("ctaContainer",t)},Hr.createElement(se,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Hr.createElement(se,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var ro=({stepData:e,appearance:t})=>ar.createElement(ar.Fragment,null,ar.createElement(to,{stepData:e,appearance:t}),ar.createElement(oo,{stepData:e,appearance:t}));import Od from"react";function zn(e){return Od.createElement(tt,{appearance:e.appearance,videoUri:e.videoUri})}var Vr="default",Id=Nd.img`
|
|
792
794
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
793
795
|
width: 100%;
|
|
794
796
|
height: auto;
|
|
795
797
|
min-height: 200px;
|
|
796
|
-
`,
|
|
798
|
+
`,Hn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Oo.createElement("div",null,o)}return Oo.createElement(Ln,{className:a("checklistStepContent",t)},e.imageUri?Oo.createElement(Id,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle,appearance:t}):null,e.videoUri?Oo.createElement(zn,{videoUri:e.videoUri,appearance:t}):null,Oo.createElement(ro,{stepData:e,appearance:t}))};import We,{useRef as Ld,useState as $d}from"react";import io from"styled-components";var Vn=io.div`
|
|
797
799
|
display: block;
|
|
798
|
-
`,Md=
|
|
800
|
+
`,Md=io.div`
|
|
799
801
|
display: flex;
|
|
800
802
|
flex-direction: row;
|
|
801
803
|
flex-wrap: wrap;
|
|
@@ -805,20 +807,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
805
807
|
align-content: center;
|
|
806
808
|
margin-top: 24px;
|
|
807
809
|
margin-bottom: 24px;
|
|
808
|
-
`,Dd=
|
|
810
|
+
`,Dd=io.div`
|
|
809
811
|
display: flex;
|
|
810
812
|
align-items: center;
|
|
811
813
|
justify-content: flex-start;
|
|
812
814
|
flex-direction: column;
|
|
813
815
|
margin-right: 16px;
|
|
814
|
-
`,Ud=
|
|
816
|
+
`,Ud=io.video`
|
|
815
817
|
width: 200px;
|
|
816
818
|
height: 120px;
|
|
817
|
-
`,_d=
|
|
819
|
+
`,_d=io.div`
|
|
818
820
|
font-size: 14px;
|
|
819
821
|
line-height: 20px;
|
|
820
822
|
text-align: center;
|
|
821
|
-
`,Wd=
|
|
823
|
+
`,Wd=io.div`
|
|
822
824
|
position: absolute;
|
|
823
825
|
width: 200px;
|
|
824
826
|
height: 120px;
|
|
@@ -838,9 +840,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
838
840
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
839
841
|
border-radius: 50%;
|
|
840
842
|
}
|
|
841
|
-
`,
|
|
843
|
+
`,jn="videoCarousel",Gn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return We.createElement(Vn,null,We.createElement(ro,{stepData:e,appearance:t}));function o({video:r}){let l=Ld(),[p,d]=$d(!1);return We.createElement(Dd,null,!p&&We.createElement(Wd,{onClick:()=>{d(!0),l.current.play()},appearance:t},We.createElement(Xo,null)),We.createElement(Ud,{controls:p,ref:l,play:p,src:r.uri}),We.createElement(_d,null,r.title))}let i=e.props;return i.videos?We.createElement(Vn,null,We.createElement(to,{stepData:e,appearance:t}),We.createElement(Md,null,i.videos.map((r,l)=>We.createElement("span",{key:`${r.uri}-${l}`},We.createElement(o,{video:r})))),We.createElement(oo,{stepData:e,appearance:t})):null};import dt from"react";import pr from"styled-components";var Kn=pr.div`
|
|
842
844
|
display: block;
|
|
843
|
-
`,zd=
|
|
845
|
+
`,zd=pr.pre`
|
|
844
846
|
display: block;
|
|
845
847
|
background-color: #2a2a2a;
|
|
846
848
|
color: #f8f8f8;
|
|
@@ -856,21 +858,21 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
856
858
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
857
859
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
858
860
|
margin-bottom: 24px;
|
|
859
|
-
`,Hd=
|
|
861
|
+
`,Hd=pr.div`
|
|
860
862
|
font-size: 15px;
|
|
861
863
|
line-height: 20px;
|
|
862
864
|
margin-bottom: 12px;
|
|
863
865
|
margin-top: 12px;
|
|
864
|
-
`,Vd=
|
|
866
|
+
`,Vd=pr.div`
|
|
865
867
|
margin-top: 24px;
|
|
866
|
-
`,
|
|
868
|
+
`,qn="codeSnippet",Yn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return dt.createElement(Kn,null,dt.createElement(ro,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?dt.createElement(Kn,{className:a("codeSnippetContainer",t)},dt.createElement(to,{stepData:e,appearance:t}),dt.createElement(Vd,null,o.codeSnippets.map((n,r)=>dt.createElement("div",{key:r},n.title?dt.createElement(Hd,{dangerouslySetInnerHTML:ne(n.title)}):null,n.code?dt.createElement(zd,null,n.code):null))),dt.createElement(oo,{stepData:e,appearance:t})):null};var Gd=$t.div`
|
|
867
869
|
display: flex;
|
|
868
870
|
flex-direction: row;
|
|
869
871
|
overflow: hidden;
|
|
870
872
|
min-width: ${e=>e.type!="modal"?"600px":"100%"};
|
|
871
873
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
872
874
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
873
|
-
${e=>
|
|
875
|
+
${e=>ke(e)}
|
|
874
876
|
`,Kd=$t.h1`
|
|
875
877
|
font-size: 18px;
|
|
876
878
|
font-style: normal;
|
|
@@ -886,7 +888,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
886
888
|
letter-spacing: 0.28px;
|
|
887
889
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
888
890
|
margin: 10px 0px 0px 0px;
|
|
889
|
-
`,
|
|
891
|
+
`,Jn=$t.div``,Yd=$t.div`
|
|
890
892
|
list-style: none;
|
|
891
893
|
padding: 0;
|
|
892
894
|
margin: 0;
|
|
@@ -899,30 +901,30 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
899
901
|
`,Xd=$t.div`
|
|
900
902
|
flex: 2;
|
|
901
903
|
padding: 40px 40px 40px 0px;
|
|
902
|
-
`,Qd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:l="",customStepTypes:p=new Map,appearance:d,type:s})=>{let{mergeAppearanceWithDefault:m}=
|
|
904
|
+
`,Qd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:l="",customStepTypes:p=new Map,appearance:d,type:s})=>{let{mergeAppearanceWithDefault:m}=ie();d=m(d);let c={[Vr]:Hn,[jn]:Gn,[qn]:Yn},g=T(T({},c),p),[y,b]=jd(0),C=n!=null?n:y,x=r!=null?r:b,P=o.filter(v=>v.complete===!0).length,S=()=>{var v;return!((v=o[C])!=null&&v.type)||!g[o[C].type]?g[Vr]({stepData:o[C],appearance:d}):typeof g[o[C].type]!="function"?g[o[C].type]:g[o[C].type]({stepData:o[C],appearance:d})};return Ye.createElement(Gd,{type:s,styleOverrides:i,className:l,appearance:d},Ye.createElement(Jn,{style:{flex:1}},Ye.createElement(Jn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},Ye.createElement(Kd,{className:a("checklistTitle",d),appearance:d},e),Ye.createElement(qd,{className:a("checklistSubtitle",d),appearance:d},t),Ye.createElement(_e,{total:o.length,count:P,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Ye.createElement(Yd,{className:a("checklistStepsContainer",d)},o.map((v,$)=>Ye.createElement(Un,{data:v,index:$,key:$,listLength:o.length,isSelected:$===C,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{x($)},appearance:d})))),Ye.createElement(Jd,{appearance:d,className:a("checklistDivider",d)}),Ye.createElement(Xd,null,Ye.createElement(S,null)))},jr=Qd;import G,{useState as oc}from"react";import Xn from"react";import Zd from"styled-components";var Rd=Zd.svg`
|
|
903
905
|
transition: 'transform 0.35s ease-in-out';
|
|
904
|
-
`,
|
|
906
|
+
`,no=({style:e,className:t})=>Xn.createElement(Rd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Xn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import be from"styled-components";var Gr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Qn=be.div`
|
|
905
907
|
max-height: 350px;
|
|
906
908
|
padding-bottom: 40px;
|
|
907
|
-
`,
|
|
909
|
+
`,Zn=be.div`
|
|
908
910
|
display: flex;
|
|
909
911
|
flex-direction: column;
|
|
910
912
|
margin-top: 20px;
|
|
911
|
-
`,
|
|
913
|
+
`,Rn=be.h1`
|
|
912
914
|
font-style: normal;
|
|
913
915
|
font-weight: 600;
|
|
914
916
|
font-size: 30px;
|
|
915
917
|
line-height: 36px;
|
|
916
918
|
margin-bottom: 16px;
|
|
917
919
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
918
|
-
`,
|
|
920
|
+
`,es=be.h2`
|
|
919
921
|
font-weight: 400;
|
|
920
922
|
font-size: 16px;
|
|
921
923
|
line-height: 20px;
|
|
922
924
|
margin-bottom: 16px;
|
|
923
925
|
padding-left: 1px;
|
|
924
926
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
925
|
-
`,
|
|
927
|
+
`,ts=be.div`
|
|
926
928
|
${e=>E(e)} {
|
|
927
929
|
border: 1px solid #fafafa;
|
|
928
930
|
}
|
|
@@ -932,11 +934,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
932
934
|
flex-direction: column;
|
|
933
935
|
min-height: 240px;
|
|
934
936
|
overflow: hidden;
|
|
935
|
-
`,
|
|
937
|
+
`,os=be.div`
|
|
936
938
|
display: flex;
|
|
937
939
|
flex-direction: row;
|
|
938
940
|
justify-content: space-between;
|
|
939
|
-
`,
|
|
941
|
+
`,rs=be.p`
|
|
940
942
|
${e=>E(e)} {
|
|
941
943
|
font-weight: 400;
|
|
942
944
|
font-size: 10px;
|
|
@@ -945,12 +947,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
945
947
|
color: #8c8c8c;
|
|
946
948
|
margin: 20px;
|
|
947
949
|
}
|
|
948
|
-
`,
|
|
950
|
+
`,is=be.div`
|
|
949
951
|
display: flex;
|
|
950
952
|
flex-direction: row;
|
|
951
|
-
`,is=be.div`
|
|
952
|
-
flex: 1;
|
|
953
953
|
`,ns=be.div`
|
|
954
|
+
flex: 1;
|
|
955
|
+
`,ss=be.div`
|
|
954
956
|
${e=>E(e)} {
|
|
955
957
|
display: flex;
|
|
956
958
|
justify-content: center;
|
|
@@ -960,7 +962,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
960
962
|
padding-left: 8px;
|
|
961
963
|
padding-right: 8px;
|
|
962
964
|
}
|
|
963
|
-
`,
|
|
965
|
+
`,ls=be.p`
|
|
964
966
|
${e=>E(e)} {
|
|
965
967
|
font-style: normal;
|
|
966
968
|
font-weight: 600;
|
|
@@ -972,7 +974,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
972
974
|
margin-top: 20px;
|
|
973
975
|
margin-bottom: 16px;
|
|
974
976
|
}
|
|
975
|
-
`,
|
|
977
|
+
`,as=be.p`
|
|
976
978
|
${e=>E(e)} {
|
|
977
979
|
font-weight: 400;
|
|
978
980
|
font-size: 14px;
|
|
@@ -981,14 +983,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
981
983
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
982
984
|
margin-bottom: 8px;
|
|
983
985
|
}
|
|
984
|
-
`,
|
|
986
|
+
`,ps=be.div`
|
|
985
987
|
${e=>E(e)} {
|
|
986
988
|
display: flex;
|
|
987
989
|
flex-direction: row;
|
|
988
990
|
justify-content: center;
|
|
989
991
|
gap: 8px;
|
|
990
992
|
}
|
|
991
|
-
`,
|
|
993
|
+
`,ds=be.div`
|
|
992
994
|
${e=>E(e)} {
|
|
993
995
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
994
996
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
@@ -1008,7 +1010,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1008
1010
|
justify-content: space-between;
|
|
1009
1011
|
position: relative;
|
|
1010
1012
|
cursor: pointer;
|
|
1011
|
-
`,
|
|
1013
|
+
`,cs=be.p`
|
|
1012
1014
|
${e=>E(e)} {
|
|
1013
1015
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1014
1016
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
@@ -1017,12 +1019,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1017
1019
|
font-size: 14px;
|
|
1018
1020
|
line-height: 22px;
|
|
1019
1021
|
margin: 0;
|
|
1020
|
-
`,
|
|
1022
|
+
`,ms=be.div`
|
|
1021
1023
|
display: flex;
|
|
1022
1024
|
flex-direction: row;
|
|
1023
1025
|
justify-content: flex-end;
|
|
1024
1026
|
align-content: center;
|
|
1025
|
-
`,
|
|
1027
|
+
`,us=be.div`
|
|
1026
1028
|
display: flex;
|
|
1027
1029
|
flex: 1;
|
|
1028
1030
|
flex-direction: row;
|
|
@@ -1030,14 +1032,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1030
1032
|
align-content: center;
|
|
1031
1033
|
align-items: center;
|
|
1032
1034
|
margin-right: 20px;
|
|
1033
|
-
`,
|
|
1035
|
+
`,fs=be.div`
|
|
1034
1036
|
display: block;
|
|
1035
1037
|
width: 100%;
|
|
1036
|
-
`;import ec from"styled-components";var
|
|
1038
|
+
`;import ec from"styled-components";var gs=ec.div`
|
|
1037
1039
|
flex-direction: column;
|
|
1038
1040
|
justify-content: center;
|
|
1039
1041
|
display: flex;
|
|
1040
|
-
`;import
|
|
1042
|
+
`;import mt from"react";import ct from"styled-components";var hs=ct.div`
|
|
1041
1043
|
border: 1px solid #fafafa;
|
|
1042
1044
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1043
1045
|
border-radius: 14px;
|
|
@@ -1045,13 +1047,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1045
1047
|
display: flex;
|
|
1046
1048
|
flex-direction: column;
|
|
1047
1049
|
overflow: hidden;
|
|
1048
|
-
`,
|
|
1050
|
+
`,xs=ct.div`
|
|
1049
1051
|
display: flex;
|
|
1050
1052
|
flex-wrap: wrap;
|
|
1051
1053
|
justify-content: space-between;
|
|
1052
1054
|
overflow: hidden;
|
|
1053
1055
|
row-gap: 10px;
|
|
1054
|
-
`,
|
|
1056
|
+
`,Cs=ct.div`
|
|
1055
1057
|
${e=>E(e)} {
|
|
1056
1058
|
color: #595959;
|
|
1057
1059
|
}
|
|
@@ -1061,7 +1063,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1061
1063
|
line-height: 12px;
|
|
1062
1064
|
letter-spacing: 0.09em;
|
|
1063
1065
|
margin-bottom: 12px;
|
|
1064
|
-
`,
|
|
1066
|
+
`,ys=ct.div`
|
|
1065
1067
|
${e=>E(e)} {
|
|
1066
1068
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1067
1069
|
background: #ffffff;
|
|
@@ -1074,7 +1076,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1074
1076
|
|
|
1075
1077
|
max-width: 150px;
|
|
1076
1078
|
min-width: 200px;
|
|
1077
|
-
`,
|
|
1079
|
+
`,Ss=ct.div`
|
|
1078
1080
|
${e=>E(e)} {
|
|
1079
1081
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1080
1082
|
}
|
|
@@ -1086,13 +1088,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1086
1088
|
justify-content: center;
|
|
1087
1089
|
align-content: center;
|
|
1088
1090
|
align-items: center;
|
|
1089
|
-
`,
|
|
1091
|
+
`,bs=ct.div`
|
|
1090
1092
|
font-weight: 600;
|
|
1091
1093
|
font-size: 20px;
|
|
1092
1094
|
line-height: 24px;
|
|
1093
1095
|
width: 20px;
|
|
1094
1096
|
height: 20px;
|
|
1095
|
-
`,
|
|
1097
|
+
`,ws=ct.div`
|
|
1096
1098
|
${e=>E(e)} {
|
|
1097
1099
|
color: #434343;
|
|
1098
1100
|
}
|
|
@@ -1101,20 +1103,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1101
1103
|
line-height: 17px;
|
|
1102
1104
|
margin-top: 12px;
|
|
1103
1105
|
margin-bottom: 8px;
|
|
1104
|
-
`,
|
|
1106
|
+
`,Ts=ct.div`
|
|
1105
1107
|
${e=>E(e)} {
|
|
1106
1108
|
color: #8c8c8c;
|
|
1107
1109
|
}
|
|
1108
1110
|
font-weight: 400;
|
|
1109
1111
|
font-size: 12px;
|
|
1110
1112
|
line-height: 14px;
|
|
1111
|
-
`,
|
|
1113
|
+
`,Fs=ct.a`
|
|
1112
1114
|
color: ${e=>e.color};
|
|
1113
1115
|
font-size: 12px;
|
|
1114
1116
|
line-height: 14px;
|
|
1115
1117
|
font-weight: 400;
|
|
1116
1118
|
cursor: pointer;
|
|
1117
|
-
`;var tc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:l}=
|
|
1119
|
+
`;var tc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:l}=ue();return mt.createElement(hs,{style:t,className:a("guideContainer",n)},mt.createElement(Cs,{className:a("guideTitle",n)},o),mt.createElement(xs,{className:a("guideItemContainer",n)},e.map((p,d)=>{var s;return mt.createElement(ys,{key:`guide-${(s=p.id)!=null?s:d}`,className:a("guideItem",n)},p.icon&&mt.createElement(Ss,{className:a("guideIcon",n)},mt.createElement(bs,null,p.icon)),mt.createElement(ws,{className:a("guideItemTitle",n),dangerouslySetInnerHTML:ne(p.title)}),mt.createElement(Ts,{className:a("guideItemSubtitle",n),dangerouslySetInnerHTML:ne(p.subtitle)}),mt.createElement(Fs,{className:a("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&l(p),r&&r(p)}},p.primaryButtonTitle))})))},No=tc;var rc=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:l,setSelectedStep:p,customStepTypes:d,appearance:s,guideData:m,guideTitle:c,onGuideButtonClick:g})=>{let y=({stepData:u,handleSecondaryCTAClick:O,handleCTAClick:w})=>u?G.createElement(ss,{className:a("checklistStepContainer",s),"data-testid":"checklistStepContainer"},G.createElement(ls,{appearance:s,className:a("checklistStepTitle",s),dangerouslySetInnerHTML:ne(u.title)}),G.createElement(as,{appearance:s,className:a("checklistStepSubtitle",s),dangerouslySetInnerHTML:ne(u.subtitle)}),G.createElement(ps,{className:a("checklistCTAContainer",s)},u.secondaryButtonTitle&&G.createElement(se,{title:u.secondaryButtonTitle,onClick:O,appearance:s,secondary:!0}),G.createElement(se,{title:u.primaryButtonTitle,onClick:w,appearance:s}))):G.createElement(G.Fragment,null),C=T(T({},{default:u=>{var I;if((I=e[S])!=null&&I.StepContent){let N=e[S].StepContent;return G.createElement("div",null,N)}let O=e[S];return G.createElement(y,{stepData:u,handleCTAClick:()=>{O.handlePrimaryButtonClick&&O.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{O.handleSecondaryButtonClick&&O.handleSecondaryButtonClick()}})}}),d),[x,P]=oc(0),S=l!=null?l:x,v=p!=null?p:P,$=()=>{var u;return e?!((u=e[S])!=null&&u.type)||!C[e[S].type]?C.default(e[S]):typeof C[e[S].type]!="function"?C[e[S].type]:C[e[S].type]({stepData:e[S],primaryColor:s.theme.colorPrimary}):G.createElement(G.Fragment,null)},B=e.filter(u=>u.complete).length;return n?(s.theme.modalContainer||(s.theme.borderRadius&&(Gr.borderRadius=s.theme.borderRadius+"px"),s.theme.modalContainer=Gr),G.createElement(Re,{onClose:r,visible:n,appearance:s},G.createElement(fs,null,G.createElement(Zn,null,G.createElement(Rn,{appearance:s,className:a("checklistTitle",s)},t),G.createElement(es,{appearance:s,className:a("checklistSubtitle",s)},o)),G.createElement(Qn,null,e&&e.length>0&&G.createElement(ts,{className:a("stepsContainer",s)},G.createElement(os,null,G.createElement("div",{style:{flex:3}},G.createElement(rs,{className:a("stepsTitle",s)},i)),G.createElement(us,null,G.createElement(_e,{style:{width:"100%"},count:B,total:e.length,appearance:s}))),G.createElement(is,null,G.createElement(ns,{className:a("checklistStepListContainer",s),appearance:s},e.map((u,O)=>{var k;let w=S===O;return G.createElement(ds,{selected:w,className:a(`checklistStepListItem${w?"Selected":""}`,s),key:`checklist-guide-step-${(k=u.id)!=null?k:O}`,disabled:u.blocked,onClick:()=>{u.blocked||v(O)},title:u.blocked?"Finish remaining steps to continue":void 0},w&&G.createElement(ir,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklist-step-selected",style:{backgroundColor:s.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),G.createElement(cs,{selected:w,className:a(`checklistStepListStepName${w?"Selected":""}`,s)},u.stepName),G.createElement(ms,null,G.createElement(at,{value:u.complete,type:"round",primaryColor:s.theme.colorPrimary,progress:u.progress,appearance:s}),G.createElement(gs,null,G.createElement(no,{style:{marginLeft:"10px"},color:s.theme.colorBackgroundSecondary}))))})),G.createElement($,null))),m&&m.length>0&&G.createElement(No,{steps:m,title:c,primaryColor:s.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:s,onButtonClick:u=>(g&&g(u),!0)}))))):G.createElement(G.Fragment,null)},Kr=rc;import $e,{useEffect as dr,useState as ic}from"react";import Fe from"react";import ut from"styled-components";var ks=ut.div`
|
|
1118
1120
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1119
1121
|
border: 1px solid;
|
|
1120
1122
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1126,14 +1128,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1126
1128
|
display: flex;
|
|
1127
1129
|
flex-direction: column;
|
|
1128
1130
|
transition: max-height 0.25s;
|
|
1129
|
-
`,
|
|
1131
|
+
`,Ps=ut.div`
|
|
1130
1132
|
display: flex;
|
|
1131
1133
|
margin-bottom: 20px;
|
|
1132
|
-
`,
|
|
1134
|
+
`,vs=ut.img`
|
|
1133
1135
|
border-radius: 4px;
|
|
1134
1136
|
max-height: 260px;
|
|
1135
1137
|
min-height: 200px;
|
|
1136
|
-
`,
|
|
1138
|
+
`,Bs=ut.div`
|
|
1137
1139
|
display: flex;
|
|
1138
1140
|
flex-direction: row;
|
|
1139
1141
|
justify-content: space-between;
|
|
@@ -1142,7 +1144,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1142
1144
|
:hover {
|
|
1143
1145
|
opacity: 0.8;
|
|
1144
1146
|
}
|
|
1145
|
-
`,
|
|
1147
|
+
`,Es=ut.p`
|
|
1146
1148
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1147
1149
|
font-style: normal;
|
|
1148
1150
|
font-weight: 500;
|
|
@@ -1153,23 +1155,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1153
1155
|
:hover {
|
|
1154
1156
|
opacity: 0.8;
|
|
1155
1157
|
}
|
|
1156
|
-
`,
|
|
1158
|
+
`,As=ut.div`
|
|
1157
1159
|
cursor: pointer;
|
|
1158
1160
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1159
1161
|
:hover {
|
|
1160
1162
|
opacity: 0.8;
|
|
1161
1163
|
}
|
|
1162
|
-
`,m0=
|
|
1164
|
+
`,m0=ut.div``,Os=ut.p`
|
|
1163
1165
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1164
1166
|
font-weight: 400;
|
|
1165
1167
|
font-size: 14px;
|
|
1166
1168
|
line-height: 22px;
|
|
1167
|
-
`,
|
|
1169
|
+
`,Ns=ut.div`
|
|
1168
1170
|
display: flex;
|
|
1169
1171
|
flex-direction: row;
|
|
1170
1172
|
justify-content: flex-start;
|
|
1171
1173
|
align-items: center;
|
|
1172
|
-
`;var
|
|
1174
|
+
`;var Is=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:l})=>{var c,g;let p=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.35s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.7s ease-out"};function s(){var y;return Fe.createElement(Fe.Fragment,null,e.imageUri||e.videoUri?Fe.createElement(Ps,{className:a("stepMediaContainer",r)},e.imageUri?Fe.createElement(vs,{className:a("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Fe.createElement(tt,{appearance:r,videoUri:e.videoUri}):null):null,Fe.createElement(Os,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:ne(e.subtitle)}),Fe.createElement(Jo,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?Fe.createElement(se,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,Fe.createElement(se,{title:(y=e.primaryButtonTitle)!=null?y:"Continue",onClick:()=>i(),appearance:r})))}function m(){if(!l)return null;let y=l[e.type];return y?typeof y!="function"?y:y(e,r):null}return Fe.createElement(ks,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},Fe.createElement(Bs,{className:a("stepHeader",r),onClick:()=>o()},Fe.createElement(Ns,null,Fe.createElement(rr,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),Fe.createElement(Es,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:ne(e.title)})),Fe.createElement(As,{className:a("stepChevronContainer",r),appearance:r},Fe.createElement(no,{style:j(T({},p),{transition:"transform 0.2s ease-in-out"})}))),Fe.createElement("div",{key:e.id,style:T({},d)},(g=m())!=null?g:s()))};import so from"styled-components";var P0=so.div`
|
|
1173
1175
|
background: #ffffff;
|
|
1174
1176
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1175
1177
|
border-radius: 6px;
|
|
@@ -1183,26 +1185,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1183
1185
|
|
|
1184
1186
|
max-width: 800px;
|
|
1185
1187
|
min-width: 350px;
|
|
1186
|
-
`,
|
|
1188
|
+
`,Ls=so.div`
|
|
1187
1189
|
display: flex;
|
|
1188
1190
|
flex-direction: column;
|
|
1189
|
-
|
|
1191
|
+
`,$s=so.h1`
|
|
1190
1192
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1191
1193
|
font-style: normal;
|
|
1192
1194
|
font-weight: 700;
|
|
1193
1195
|
font-size: 20px;
|
|
1194
1196
|
line-height: 24px;
|
|
1195
1197
|
margin-bottom: 8px;
|
|
1196
|
-
|
|
1198
|
+
`,Ms=so.h2`
|
|
1197
1199
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1198
1200
|
font-weight: 400;
|
|
1199
1201
|
font-size: 14px;
|
|
1200
1202
|
line-height: 23px;
|
|
1201
1203
|
margin: 2px 0 0 0;
|
|
1202
|
-
`,
|
|
1204
|
+
`,Ds=so.div`
|
|
1203
1205
|
display: block;
|
|
1204
1206
|
width: 100%;
|
|
1205
|
-
`,
|
|
1207
|
+
`,Us=so.div`
|
|
1206
1208
|
display: flex;
|
|
1207
1209
|
width: 100%;
|
|
1208
1210
|
flex-direction: column;
|
|
@@ -1210,23 +1212,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1210
1212
|
padding: 24px;
|
|
1211
1213
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1212
1214
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1213
|
-
`;var nc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:l=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:s,appearance:m,type:c,className:
|
|
1215
|
+
`;var nc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:l=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:s,appearance:m,type:c,className:g,customStepTypes:y,style:b})=>{let C=o.filter(B=>B.complete).length,[x,P]=ic(Array(o.length).fill(!0));dr(()=>{let B=[...x];if(r){for(let u=0;u<o.length;u++)if(!o[u].complete){B[u]=!1;break}P(B)}},[]),dr(()=>{r&&S(d)},[d]),dr(()=>{p&&x[d]&&S(d)},[d]),dr(()=>{},[o]);let S=B=>{let u=[...x];if(l)for(let O=0;O<x.length;++O)O!=B&&u[B]&&(u[O]=!0);u[B]=!x[B],P(u)};if(!n&&c=="modal")return $e.createElement($e.Fragment,null);let v=$e.createElement($e.Fragment,null,$e.createElement(Ls,null,$e.createElement($s,{appearance:m,className:a("checklistTitle",m),dangerouslySetInnerHTML:ne(e)}),$e.createElement(Ms,{appearance:m,className:a("checklistSubtitle",m),dangerouslySetInnerHTML:ne(t)})),$e.createElement(_e,{display:"percent",count:C,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),$=$e.createElement(Ds,{className:Te(a("checklistContainer",m),g)},o.map((B,u)=>{var w;let O=x[u];return $e.createElement(Is,{appearance:m,stepData:B,collapsed:O,key:`modal-checklist-${(w=B.id)!=null?w:u}`,onClick:()=>{d==u?S(u):s(u)},onPrimaryButtonClick:()=>{p&&u<o.length-1&&s(u+1),B.handlePrimaryButtonClick&&B.handlePrimaryButtonClick()},onSecondaryButtonClick:()=>{B.handleSecondaryButtonClick&&B.handleSecondaryButtonClick()},customStepTypes:y})}));return c==="inline"?$e.createElement(Us,{appearance:m,className:Te(a("checklistInlineContainer",m),g),style:b},v,$):$e.createElement($e.Fragment,null,$e.createElement(Re,{onClose:i,visible:n,appearance:m,style:{maxWidth:"600px"},headerContent:v},$))},qr=nc;import he,{useEffect as Yr,useRef as uc,useState as Mt}from"react";import{useEffect as sc,useState as lc}from"react";var _s=()=>{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]=lc(t),n=null,r=()=>{n!==null?clearTimeout(n):l(),n=setTimeout(()=>{l()},16)},l=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,s])=>{if(!window)return[d,!1];let m=window.matchMedia(s);return m.addEventListener("change",r),[d,m.matches]}));i(p)};return sc(()=>{l()},[]),o};import lo from"react";import ye,{css as Ws,keyframes as zs}from"styled-components";var Hs=Ws`
|
|
1214
1216
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1215
|
-
`,ac=
|
|
1217
|
+
`,ac=Ws`
|
|
1216
1218
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1217
|
-
`,pc=
|
|
1219
|
+
`,pc=zs`
|
|
1218
1220
|
from {
|
|
1219
1221
|
opacity: 0;
|
|
1220
1222
|
} to {
|
|
1221
1223
|
opacity: 1;
|
|
1222
1224
|
}
|
|
1223
|
-
`,dc=
|
|
1225
|
+
`,dc=zs`
|
|
1224
1226
|
from {
|
|
1225
1227
|
opacity: 1;
|
|
1226
1228
|
} to {
|
|
1227
1229
|
opacity: 0;
|
|
1228
1230
|
}
|
|
1229
|
-
`,
|
|
1231
|
+
`,Vs=ye.div`
|
|
1230
1232
|
margin: 0 -20px;
|
|
1231
1233
|
overflow-x: auto;
|
|
1232
1234
|
padding-left: 20px;
|
|
@@ -1243,13 +1245,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1243
1245
|
::-webkit-scrollbar {
|
|
1244
1246
|
display: none;
|
|
1245
1247
|
}
|
|
1246
|
-
`,
|
|
1248
|
+
`,js=ye.div`
|
|
1247
1249
|
display: flex;
|
|
1248
1250
|
flex-flow: row nowrap;
|
|
1249
1251
|
gap: 0 16px;
|
|
1250
1252
|
scroll-snap-align: center;
|
|
1251
1253
|
scroll-snap-stop: always;
|
|
1252
|
-
`,
|
|
1254
|
+
`,Gs=ye.div`
|
|
1253
1255
|
animation: ${e=>e.reversed?dc:pc} 0.25s ease-out;
|
|
1254
1256
|
background: linear-gradient(
|
|
1255
1257
|
to right,
|
|
@@ -1259,8 +1261,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1259
1261
|
position: absolute;
|
|
1260
1262
|
width: 64px;
|
|
1261
1263
|
z-index: 10;
|
|
1262
|
-
`,
|
|
1263
|
-
${
|
|
1264
|
+
`,Ks=ye.button`
|
|
1265
|
+
${Hs}
|
|
1264
1266
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1265
1267
|
align-items: center;
|
|
1266
1268
|
border-radius: 50%;
|
|
@@ -1271,11 +1273,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1271
1273
|
justify-content: center;
|
|
1272
1274
|
position: absolute;
|
|
1273
1275
|
width: 48px;
|
|
1274
|
-
`,
|
|
1276
|
+
`,qs=ye.div`
|
|
1275
1277
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1276
1278
|
padding: 20px;
|
|
1277
|
-
`,
|
|
1278
|
-
${
|
|
1279
|
+
`,Ys=ye(qs)`
|
|
1280
|
+
${Hs}
|
|
1279
1281
|
background: ${({theme:e})=>e.colorBackground};
|
|
1280
1282
|
position: relative;
|
|
1281
1283
|
|
|
@@ -1287,104 +1289,104 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1287
1289
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1288
1290
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1289
1291
|
}
|
|
1290
|
-
`,
|
|
1292
|
+
`,Js=ye.img`
|
|
1291
1293
|
border-radius: 50%;
|
|
1292
1294
|
height: 40px;
|
|
1293
1295
|
margin-bottom: 12px;
|
|
1294
1296
|
width: 40px;
|
|
1295
|
-
`,
|
|
1297
|
+
`,Xs=ye(qs)`
|
|
1296
1298
|
${e=>E(e)} {
|
|
1297
1299
|
${ac}
|
|
1298
1300
|
|
|
1299
1301
|
background: ${({theme:e})=>e.colorBackground};
|
|
1300
1302
|
}
|
|
1301
|
-
`,V0=
|
|
1303
|
+
`,V0=ye.div`
|
|
1302
1304
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1303
1305
|
display: flex;
|
|
1304
1306
|
flex-flow: row nowrap;
|
|
1305
1307
|
align-items: center;
|
|
1306
|
-
`,j0=
|
|
1308
|
+
`,j0=ye.div`
|
|
1307
1309
|
white-space: nowrap;
|
|
1308
|
-
`,
|
|
1310
|
+
`,Qs=ye.div`
|
|
1309
1311
|
background: #d8fed8;
|
|
1310
1312
|
border-radius: 6px;
|
|
1311
1313
|
float: right;
|
|
1312
1314
|
margin-bottom: 12px;
|
|
1313
1315
|
padding: 4px 10px;
|
|
1314
|
-
`,cc=
|
|
1316
|
+
`,cc=ye.p`
|
|
1315
1317
|
font-weight: bold;
|
|
1316
1318
|
font-size: 18px;
|
|
1317
1319
|
line-height: 22px;
|
|
1318
1320
|
letter-spacing: calc(18px * -0.01);
|
|
1319
1321
|
margin: 0;
|
|
1320
|
-
`,
|
|
1322
|
+
`,Zs=ye(cc)`
|
|
1321
1323
|
margin-bottom: 4px;
|
|
1322
|
-
`,
|
|
1324
|
+
`,Rs=ye.div`
|
|
1323
1325
|
display: flex;
|
|
1324
1326
|
flex-flow: row nowrap;
|
|
1325
1327
|
align-items: center;
|
|
1326
1328
|
min-width: 50%;
|
|
1327
|
-
`,mc=
|
|
1329
|
+
`,mc=ye.p`
|
|
1328
1330
|
font-weight: bold;
|
|
1329
1331
|
font-size: 16px;
|
|
1330
1332
|
line-height: 20px;
|
|
1331
1333
|
letter-spacing: calc(16px * -0.01);
|
|
1332
1334
|
margin: 0;
|
|
1333
|
-
`,
|
|
1335
|
+
`,el=ye(mc)`
|
|
1334
1336
|
margin-bottom: 4px;
|
|
1335
1337
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1336
1338
|
`}
|
|
1337
|
-
`,
|
|
1339
|
+
`,bt=ye.p`
|
|
1338
1340
|
color: ${({theme:e})=>e.colorText};
|
|
1339
1341
|
font-weight: normal;
|
|
1340
1342
|
font-size: 14px;
|
|
1341
1343
|
line-height: 22px;
|
|
1342
1344
|
margin: 0;
|
|
1343
|
-
`,
|
|
1345
|
+
`,tl=ye.p`
|
|
1344
1346
|
color: ${({theme:e})=>e.colorText};
|
|
1345
1347
|
font-weight: 600;
|
|
1346
1348
|
font-size: 12px;
|
|
1347
1349
|
line-height: 16px;
|
|
1348
1350
|
margin: 0;
|
|
1349
|
-
`;
|
|
1351
|
+
`;bt.Loud=ye(bt)`
|
|
1350
1352
|
font-weight: 600;
|
|
1351
|
-
`;
|
|
1353
|
+
`;bt.Quiet=ye(bt)`
|
|
1352
1354
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1353
1355
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1354
1356
|
`}
|
|
1355
|
-
`;var
|
|
1357
|
+
`;var ol=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ie(),{primaryCTAClickSideEffects:n}=ue();o=i(o);let{imageUri:r=null,subtitle:l=null,title:p=null,complete:d=!1,blocked:s=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return lo.createElement(Ys,{className:a("carouselCard",o),onClick:s?null:c,style:t,blocked:s,complete:d},r&&lo.createElement(Js,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||s?.4:1}}),d&&lo.createElement(Qs,{className:a("carouselCompletedPill",o)},lo.createElement(tl,{style:{color:"#108E0B"}},"Complete")),p&&lo.createElement(el,{blocked:s,complete:d,className:a("carouselCardTitle",o)},p),l&&lo.createElement(bt.Quiet,{blocked:s,complete:d,className:a("carouselCardSubtitle",o)},l))};var fc=()=>he.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},he.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),he.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),he.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),rl=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=Mt(!1),[r,l]=Mt(!1);Yr(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&l(!0)},[t]);let p=()=>{n(!1),l(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?he.createElement(Gs,{style:d,reversed:r,onAnimationEnd:r?p:null},he.createElement(Ks,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},he.createElement(fc,null))):null},il=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=uc(null),[r,l]=Mt(!1),[p,d]=Mt(!1),[s,m]=Mt(null),[c,g]=Mt([]),[y,b]=Mt(0),{isSmall:C}=_s(),x=C?1:3,{getFlowMetadata:P,getFlowSteps:S,getNumberOfStepsCompleted:v,updateCustomVariables:$,isLoading:B}=R();Yr(()=>{$(o)},[o,B]),Yr(()=>{if(B)return;let N=P(e),A=v(e),H=S(e);m(N),(N.data!==null||N.steps!==null)&&(g(H.sort((_,ee)=>Number(_.complete)-Number(ee.complete))),d(H.length>x),b(A))},[B]);let u=[];for(let N=0;N<c.length;N+=x)u.push(c.slice(N,N+x));let O=N=>{let A=N.target,H=A.scrollWidth-A.clientWidth,_=Math.ceil(A.scrollLeft);_>0&&r===!1&&l(!0),_===0&&r===!0&&l(!1),_<H&&p===!1&&d(!0),_===H&&p===!0&&d(!1)},w=(N=!0)=>{let A=N?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*A,behavior:"smooth"})},k=null,I=N=>{k!==null?clearTimeout(k):O(N),k=setTimeout(()=>{O(N)},16)};return B?null:he.createElement(Xs,{className:Te(a("carouselContainer",t),i)},he.createElement("div",{style:{display:"flex",justifyContent:C?"center":"space-between",marginBottom:20,flexWrap:C?"wrap":"nowrap",gap:C?16:20}},he.createElement("div",null,he.createElement(Zs,{className:a("carouselTitle",t)},s==null?void 0:s.title),he.createElement(bt.Quiet,{className:a("carouselSubtitle",t)},s==null?void 0:s.subtitle)),he.createElement(Rs,{className:a("progressWrapper",t)},he.createElement(_e,{count:y,total:c.length,appearance:t}))),he.createElement("div",{style:{position:"relative"}},he.createElement(rl,{show:r,onClick:()=>w(!1)}),he.createElement(rl,{side:"right",show:p,onClick:w}),he.createElement(Vs,{ref:n,onScroll:I},u.map((N,A)=>he.createElement(js,{key:A,style:{flex:`0 0 calc(100% - ${c.length>x?36:0}px)`}},N.map((H,_)=>he.createElement(ol,{key:_,stepData:H,style:{flex:c.length>x?`0 1 calc(100% / ${x} - 16px * 2 / ${x})`:1},appearance:t})))))),he.createElement(ae,{appearance:t}))};var Jr=$=>{var B=$,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:l="inline",onDismiss:p,visible:d,customVariables:s,onStepCompletion:m,onButtonClick:c,appearance:g,hideOnFlowCompletion:y,setVisible:b,customStepTypes:C,checklistStyle:x="default",autoExpandFirstIncompleteStep:P,autoExpandNextStep:S}=B,v=Ie(B,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:u,getFlowSteps:O,markStepCompleted:w,getStepStatus:k,getNumberOfStepsCompleted:I,isLoading:N,targetingLogicShouldHideFlow:A,updateCustomVariables:H,getFlowMetadata:_,isStepBlocked:ee,getFlowStatus:X,hasActiveFullPageFlow:q,setHasActiveFullPageFlow:Y,markStepStarted:J,getCurrentStepIndex:pe}=R(),{primaryCTAClickSideEffects:we,secondaryCTAClickSideEffects:Oe}=ue(),{getOpenFlowState:de,setOpenFlowState:Z}=Be(),[D,oe]=nl(n||0),[Ne,Je]=nl(!1),xe=d===void 0?de(e):d,ce=l==="modal",{mergeAppearanceWithDefault:V}=ie();He(e,d);let W=O(e),L=pe(e);if(g=V(g),cr(()=>{H(s)},[s,N]),cr(()=>{d!==void 0&&(ce&&d===!0?Y(!0):ce&&d===!1&&Y(!1))},[d,b,q]),cr(()=>{!N&&W&&W[D]&&k(e,W[D].id)&&k(e,W[D].id)!==Le&&J(e,W[D].id)},[D]),cr(()=>{D!==L&&oe(L)},[L]),N)return null;let z=u(e);if(!z||A(z)||!W||y===!0&&X(e)===re)return null;let me=_(e);if(me!=null&&me.title&&(t=me.title),me!=null&&me.subtitle&&(o=me.subtitle),!Ne&&n===void 0&&I(e)>0){let f=W.findIndex(F=>F.complete===!1);oe(f>-1?f:W.length-1),Je(!0)}function je(){if(D+1>=W.length){ce&&Z(e,!1);return}ee(e,W[D+1].id)||oe(D+1)}function Xe(f,F,U){let fe=D+1<W.length?W[D+1]:null;c&&c(f,D,F,fe)===!0&&ce&&Ke(),m&&m(f,U,fe),!m&&!c&&(f.primaryButtonUri||f.secondaryButtonUri)&&ce&&Ke()}function Ft(){return W.map((f,F)=>j(T({},f),{handleSecondaryButtonClick:()=>{je(),Oe(f),f.skippable===!0&&w(e,f.id,{skipped:!0}),Xe(f,"secondary",F)},handlePrimaryButtonClick:()=>{(!f.completionCriteria&&(f.autoMarkCompleted||f.autoMarkCompleted===void 0)||f.completionCriteria&&f.autoMarkCompleted===!0)&&(w(e,f.id),je()),Xe(f,"primary",F),we(f),k(e,f.id)===Le&&je()}}))}function Ge(){return Se.createElement(ae,{appearance:g})}let gt={steps:Ft(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:C,type:l,className:r,autoExpandFirstIncompleteStep:P,autoExpandNextStep:S};function Ke(){Z(e,!1),p&&p(),b&&b(!1)}function Wt(){return Se.createElement(Se.Fragment,null,Se.createElement(Ge,null),Se.createElement(il,{flowId:e,appearance:g,customVariables:s,className:r}))}function zt(){return Se.createElement(Se.Fragment,null,Se.createElement(Ge,null),Se.createElement(qr,T({visible:xe,onClose:()=>{Ke()},selectedStep:D,setSelectedStep:oe,autoExpandNextStep:!0,appearance:g},gt)))}function Ht(){var U;let f=v.guideFlowId,F;return f&&u(f)&&(F=O(f)),Se.createElement(Se.Fragment,null,Se.createElement(Ge,null),Se.createElement(Kr,T({visible:xe,stepsTitle:me.stepsTitle?me.stepsTitle:"Your quick start guide",onClose:()=>{Ke()},selectedStep:D,setSelectedStep:oe,guideData:F,guideTitle:(U=v.guideTitle)!=null?U:"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:fe=>{Xe(fe,"link",0)},customStepTypes:C},gt)))}function h(){let f=Se.createElement(jr,T({flowId:e,style:i,selectedStep:D,setSelectedStep:oe,appearance:g,type:l},gt));return ce?Se.createElement(Re,{onClose:()=>{Ke()},visible:xe,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},Se.createElement(Ge,null),f):Se.createElement(Se.Fragment,null,Se.createElement(Ge,null),f)}switch(x){case"condensed":return zt();case"with-guide":return Ht();case"default":return h();case"carousel":return Wt();default:return h()}};var hc=e=>gc.createElement(Jr,T({type:"inline"},e));import Tt,{useEffect as xc}from"react";import rt from"react";import mr from"styled-components";var sl=mr.div`
|
|
1356
1358
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1357
1359
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1358
1360
|
padding: 10px 12px 10px 12px;
|
|
1359
1361
|
min-width: 160px;
|
|
1360
1362
|
cursor: pointer;
|
|
1361
1363
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1362
|
-
${e=>
|
|
1364
|
+
${e=>ke(e)}
|
|
1363
1365
|
|
|
1364
1366
|
&:hover {
|
|
1365
1367
|
filter: brightness(.99);
|
|
1366
1368
|
}
|
|
1367
|
-
`,
|
|
1369
|
+
`,ll=mr.div`
|
|
1368
1370
|
display: flex;
|
|
1369
1371
|
flex-direction: row;
|
|
1370
1372
|
justify-content: space-between;
|
|
1371
1373
|
align-items: center;
|
|
1372
1374
|
margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
|
|
1373
1375
|
flex-grow: 2;
|
|
1374
|
-
`,
|
|
1376
|
+
`,al=mr.div`
|
|
1375
1377
|
text-overflow: ellipsis;
|
|
1376
1378
|
font-weight: 600;
|
|
1377
1379
|
font-size: 14px;
|
|
1378
1380
|
line-height: 16px;
|
|
1379
1381
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1380
1382
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1381
|
-
`,
|
|
1383
|
+
`,pl=mr.div`
|
|
1382
1384
|
width: 20px;
|
|
1383
1385
|
margin-right: 8px;
|
|
1384
1386
|
display: flex;
|
|
1385
1387
|
height: 100%;
|
|
1386
1388
|
align-items: center;
|
|
1387
|
-
`;var
|
|
1389
|
+
`;var dl=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:l,type:p="default"})=>rt.createElement(rt.Fragment,null,rt.createElement(ae,{appearance:l}),rt.createElement(sl,{onClick:()=>i!==void 0&&i(),styleOverrides:T(T({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:Te(r!=null?r:"",a("progressBadgeContainer",l)),appearance:l},p=="condensed"&&o&&o!==0&&rt.createElement(pl,{className:a("progressRingContainer",l)},rt.createElement(Yt,{size:19,percentage:t/o,fillColor:l.theme.colorPrimary,bgColor:l.theme.colorBackgroundSecondary})),rt.createElement(ll,{type:p,className:a("badgeTitleContainer",l)},rt.createElement(al,{type:p,appearance:l,className:a("badgeTitle",l)},e),i!==void 0&&rt.createElement(no,{className:a("badgeChevron",l),color:l.theme.colorPrimary})),p=="default"&&o&&o!==0&&rt.createElement(_e,{display:"compact",count:t,total:o,bgColor:l.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:l,textStyle:{color:"#818898"}})));import wt from"react";import Io from"styled-components";var cl=Io.div`
|
|
1388
1390
|
display: flex;
|
|
1389
1391
|
flex-direction: row;
|
|
1390
1392
|
width: 100%;
|
|
@@ -1394,25 +1396,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1394
1396
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1395
1397
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1396
1398
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1397
|
-
`,
|
|
1399
|
+
`,ml=Io.div`
|
|
1398
1400
|
${e=>E(e)} {
|
|
1399
1401
|
display: flex;
|
|
1400
1402
|
justify-content: center;
|
|
1401
1403
|
align-items: center;
|
|
1402
1404
|
margin-right: 16px;
|
|
1403
1405
|
}
|
|
1404
|
-
`,
|
|
1406
|
+
`,ul=Io.div`
|
|
1405
1407
|
display: flex;
|
|
1406
1408
|
flex-direction: column;
|
|
1407
1409
|
flex: 1;
|
|
1408
1410
|
margin-top: 0;
|
|
1409
|
-
`,
|
|
1411
|
+
`,fl=Io.div`
|
|
1410
1412
|
display: flex;
|
|
1411
1413
|
flex-direction: column;
|
|
1412
1414
|
justify-content: center;
|
|
1413
1415
|
margin-left: 16px;
|
|
1414
1416
|
min-width: 200px;
|
|
1415
|
-
`,KS=
|
|
1417
|
+
`,KS=Io.div`
|
|
1416
1418
|
display: flex;
|
|
1417
1419
|
justify-content: center;
|
|
1418
1420
|
align-items: flex-end;
|
|
@@ -1421,7 +1423,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1421
1423
|
:hover {
|
|
1422
1424
|
opacity: 0.8;
|
|
1423
1425
|
}
|
|
1424
|
-
`;var
|
|
1426
|
+
`;var gl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:l,style:p})=>wt.createElement(wt.Fragment,null,wt.createElement(cl,{appearance:i,className:Te(a("fullWidthProgressBadgeContainer",i),l!=null?l:""),style:p},o&&wt.createElement(ml,{className:a("fullWidthProgressBadgeIcon",i)},o),wt.createElement(ul,null,wt.createElement(Ae,{size:"small",appearance:i,title:e,subtitle:t})),wt.createElement(fl,{className:a("fullWidthProgressBadgeProgressContainer",i)},wt.createElement(_e,{count:n,total:r,display:"percent",textLocation:"top"}))));var Cc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:l,customVariables:p,hideOnFlowCompletion:d,appearance:s,type:m="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:y,getNumberOfStepsCompleted:b,isLoading:C,targetingLogicShouldHideFlow:x,updateCustomVariables:P}=R(),{mergeAppearanceWithDefault:S}=ie();s=S(s);let{setOpenFlowState:v,getOpenFlowState:$}=Be();if(xc(()=>{P(p)},[p,C]),C)return null;let B=c(e);if(!B||x(B)||d===!0&&y(e)===re)return null;let u=g(e),O=b(e);return m==="full-width"?Tt.createElement(Tt.Fragment,null,Tt.createElement(ae,{appearance:s}),Tt.createElement(gl,{title:t,subtitle:o,count:O,total:u.length,style:n,className:l,appearance:s,icon:i,onClick:()=>{}})):Tt.createElement(Tt.Fragment,null,Tt.createElement(ae,{appearance:s}),Tt.createElement(dl,{count:O,total:u.length,title:t,style:n,onClick:()=>{v(e,!0),r&&r()},type:m,className:l,appearance:s}))};import yc from"react";var Sc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Ie(r,["flowId","style","appearance"]);let{getFlow:l,targetingLogicShouldHideFlow:p,getFlowSteps:d}=R(),{mergeAppearanceWithDefault:s}=ie();o=s(o);let m=l(e);if(!m||p(m))return null;let c=d(e);return yc.createElement(No,T({steps:c,style:t,appearance:o},i))};import Dt,{useContext as Ic,useEffect as Lc}from"react";import K,{useEffect as ao,useLayoutEffect as Cl,useRef as Pc,useState as po}from"react";import Lo from"styled-components";import{useCallback as bc,useEffect as wc,useState as Tc}from"react";var Xr=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,l=n=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+l,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+l,y:e.top-i.y+r}:{x:0,y:0}};function hl(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,n]=Tc(o),r=bc(()=>{e&&n(e.getBoundingClientRect())},[e]);return wc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as Fc,useState as kc}from"react";function xl(){let{debug:e}=Fc(Q),[t,o]=kc([]);function i(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.log(r)))}function n(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:i,logErrorIfDebugMode:n}}var yl=300,Sl=100,vc=500,co=12,Bc=Lo.div`
|
|
1425
1427
|
width: 100%;
|
|
1426
1428
|
height: 100%;
|
|
1427
1429
|
border-radius: 9999px;
|
|
@@ -1444,25 +1446,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1444
1446
|
opacity: 0;
|
|
1445
1447
|
}
|
|
1446
1448
|
}
|
|
1447
|
-
`,Ec=
|
|
1448
|
-
width: ${
|
|
1449
|
-
height: ${
|
|
1449
|
+
`,Ec=Lo.div`
|
|
1450
|
+
width: ${co}px;
|
|
1451
|
+
height: ${co}px;
|
|
1450
1452
|
border-radius: 100px;
|
|
1451
1453
|
background-color: ${e=>e.primaryColor};
|
|
1452
1454
|
z-index: 20;
|
|
1453
1455
|
opacity: 1;
|
|
1454
|
-
`,Ac=
|
|
1456
|
+
`,Ac=Lo.div`
|
|
1455
1457
|
pointer-events: all;
|
|
1456
|
-
`,
|
|
1458
|
+
`,bl=Lo.div`
|
|
1457
1459
|
display: flex;
|
|
1458
1460
|
align-content: center;
|
|
1459
1461
|
justify-content: center;
|
|
1460
1462
|
align-items: center;
|
|
1461
1463
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1462
|
-
`,Oc=
|
|
1463
|
-
width: ${
|
|
1464
|
-
height: ${
|
|
1465
|
-
`,Nc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:l={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:s=0,customStepTypes:m,appearance:c,dismissible:
|
|
1464
|
+
`,Oc=Lo(bl)`
|
|
1465
|
+
width: ${co+12}px;
|
|
1466
|
+
height: ${co+12}px;
|
|
1467
|
+
`,Nc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:l={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:s=0,customStepTypes:m,appearance:c,dismissible:g=!1,showHighlightOnly:y,showStepCount:b=!0,completedStepsCount:C=0,showFrigadeBranding:x=!1,cssPosition:P="absolute",onViewTooltip:S,className:v})=>{var Ft,Ge,gt,Ke,Wt,zt,Ht,h,f,F,U,fe,ht,kt,Pt,ge,uo,fo,ni;let{logErrorIfDebugMode:$}=xl(),[B,u]=po(),[O,w]=po(new Date),k=Pc(null),[I,N]=po(document.querySelector(e[s].selector)),A=hl(I,O),[H,_]=po(),[ee,X]=po(!y),q=(Ge=(Ft=e[s])==null?void 0:Ft.props)!=null&&Ge.position?e[s].props.position:P,Y=(Wt=(Ke=(gt=e[s])==null?void 0:gt.props)==null?void 0:Ke.zIndex)!=null?Wt:90,J=(zt=B==null?void 0:B.width)!=null?zt:yl,pe=(Ht=B==null?void 0:B.height)!=null?Ht:Sl,[we,Oe]=po(new Date().getTime());l=(F=(f=(h=e[s])==null?void 0:h.props)==null?void 0:f.offset)!=null?F:l;let de=window.location.pathname.split("/").pop();Cl(()=>{k.current&&u({width:k.current.clientWidth,height:k.current.clientHeight})},[s,O,q]),ao(()=>{y||X(!0)},[s]),ao(()=>{p&&ee&&S(s)},[ee]);let Z=()=>{let te=document.querySelector(e[s].selector);if(!te){_(void 0),N(null),$(`FrigadeTour: Could not find element with selector "${e[s].selector}" for step ${e[s].id}`);return}H&&H===JSON.stringify(te==null?void 0:te.getBoundingClientRect())||(N(te),w(new Date),te&&_(JSON.stringify(te.getBoundingClientRect())))};if(ao(()=>{let te=new MutationObserver(Z);return te.observe(document.body,{subtree:!0,childList:!0}),()=>te.disconnect()},[Z]),ao(()=>{let te=new MutationObserver(Z);return te.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>te.disconnect()},[Z]),ao(()=>{let te=setInterval(()=>{Z()},10);return()=>clearInterval(te)},[Z]),Cl(()=>{setTimeout(()=>{Z()},vc),Z()},[s,de]),ao(()=>{if(!p)return;let te=Qe=>{Qe.key==="Escape"&&t()};return document.addEventListener("keydown",te),()=>{document.removeEventListener("keydown",te)}},[]),I===null||!p)return null;let D=i==="auto"?"right":i,oe=Xr(A,D,J,l,q),Ne=A.right+J>(window.innerWidth||document.documentElement.clientWidth),Je=A.bottom+Sl>(window.innerHeight||document.documentElement.clientHeight);Ne&&i==="auto"&&(oe=Xr(A,"left",J,l,q),D="left"),(fe=(U=e[s])==null?void 0:U.props)!=null&&fe.tooltipPosition&&((kt=(ht=e[s])==null?void 0:ht.props)==null?void 0:kt.tooltipPosition)!=="auto"&&(((ge=(Pt=e[s])==null?void 0:Pt.props)==null?void 0:ge.tooltipPosition)==="left"||((fo=(uo=e[s])==null?void 0:uo.props)==null?void 0:fo.tooltipPosition)==="right")&&(D=e[s].props.tooltipPosition);let xe=()=>{let te=()=>{if(e[s].handlePrimaryButtonClick&&(e[s].handlePrimaryButtonClick(),X(!1),setTimeout(()=>{Z()},30)),C===e.length-1)return o()},Qe=()=>{e[s].handleSecondaryButtonClick&&(e[s].handleSecondaryButtonClick(),y&&!e[s].secondaryButtonUri&&X(!1))};return K.createElement(K.Fragment,null,b&&e.length>1&&K.createElement(wi,null,K.createElement(Fi,{role:"status",className:a("tooltipStepCounter",c)},s+1," of ",e.length)),(e[s].primaryButtonTitle||e[s].secondaryButtonTitle)&&K.createElement(Ti,{showStepCount:b,className:a("tooltipCTAContainer",c)},e[s].secondaryButtonTitle&&K.createElement(se,{title:e[s].secondaryButtonTitle,appearance:c,onClick:Qe,size:"small",withMargin:!1,secondary:!0}),e[s].primaryButtonTitle&&K.createElement(se,{title:e[s].primaryButtonTitle,appearance:c,onClick:te,autoFocus:!0,withMargin:!1,size:"small"})))},ce=()=>K.createElement(K.Fragment,null,g&&K.createElement(xi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[s].imageUri||!!e[s].videoUri,"aria-label":"Close Tooltip",role:"button",tabIndex:0},K.createElement(Ee,null)),e[s].imageUri&&K.createElement(Ci,{dismissible:g,appearance:c,role:"img","aria-label":e[s].title,src:e[s].imageUri,className:a("tooltipImageContainer",c)}),e[s].videoUri&&!e[s].imageUri&&K.createElement(yi,{dismissible:g,appearance:c,role:"video","aria-label":e[s].title,className:a("tooltipVideoContainer",c)},K.createElement(tt,{appearance:c,videoUri:e[s].videoUri})),K.createElement(bi,{className:a("tooltipContentContainer",c)},K.createElement(Ae,{appearance:c,title:e[s].title,subtitle:e[s].subtitle,size:"small",ariaPrefix:`Tooltip${e[s].id}`}),K.createElement(Si,{className:a("tooltipFooter",c)},K.createElement(xe,null)))),W=T(T({},{default:te=>{var Qe;if((Qe=e[s])!=null&&Qe.StepContent){let na=e[s].StepContent;return K.createElement("div",null,na)}return K.createElement(ce,null)}}),m),L=()=>{var te;return e?!((te=e[s])!=null&&te.type)||!W[e[s].type]?W.default(e[s]):W[e[s].type]({stepData:e[s],primaryColor:r}):K.createElement(K.Fragment,null)};if(e[s].complete===!0||oe.x==0&&oe.y==0&&new Date().getTime()-we<100)return null;let z={top:(oe==null?void 0:oe.y)-co,left:(ni=D=="left"?A.x+l.x:(oe==null?void 0:oe.x)-co)!=null?ni:0,cursor:y?"pointer":"default",position:q},me=()=>{let Qe=z.left+(D=="left"?-J:24);return Math.min(Math.max(Qe,20),window.innerWidth-J-20)},je=()=>{if(q==="fixed")return z.top;let te=z.top+pe,Qe=20;return te>window.innerHeight-Qe?z.top+-pe:z.top},Xe=()=>{y&&(w(new Date),X(!ee))};return K.createElement(Ac,{className:v},K.createElement(Oc,{style:z,zIndex:Y,className:a("tourHighlightContainer",c)},n&&e[s].showHighlight!==!1&&P!=="static"&&K.createElement(K.Fragment,null,K.createElement(Ec,{style:{position:q},onClick:Xe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),K.createElement(Bc,{style:{position:"absolute"},onClick:Xe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),K.createElement(bl,{style:j(T({},z),{left:me(),top:je()}),zIndex:Y+1,className:a("tooltipContainerWrapper",c)},ee&&K.createElement(K.Fragment,null,K.createElement(_o,{ref:k,role:"dialog","aria-labelledby":`frigadeTooltip${e[s].id}Title`,"aria-describedby":`frigadeTooltip${e[s].id}Subtitle`,layoutId:"tooltip-container",tabIndex:0,"aria-label":"Tooltip",style:T({position:"relative",width:"max-content",right:0,top:P!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:yl,zIndex:Y+10},K.createElement(L,null)),x&&K.createElement(Pi,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:Y+10},K.createElement(Wo,{appearance:c})))))},Qr=Nc;import{Portal as $c}from"react-portal";var Mc=x=>{var P=x,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:l,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:s=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:g=!1,cssPosition:y="absolute",className:b}=P,C=Ie(P,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition","className"]);let{getFlow:S,getFlowSteps:v,isLoading:$,targetingLogicShouldHideFlow:B,markStepCompleted:u,markStepStarted:O,markFlowCompleted:w,updateCustomVariables:k,getCurrentStepIndex:I,getStepStatus:N,isStepBlocked:A,getFlowStatus:H,getNumberOfStepsCompleted:_}=R(),{isLoadingUserFlowStateData:ee}=De(),{primaryCTAClickSideEffects:X,secondaryCTAClickSideEffects:q}=ue(),{hasOpenModals:Y}=Be(),J=I(e),{openFlowStates:pe}=Ic(Q),{mergeAppearanceWithDefault:we}=ie();if(o=we(o),Lc(()=>{k(t)},[t,$]),ee)return null;let Oe=S(e);if(!Oe||B(Oe)||H(e)==re||Y())return null;let de=v(e);if(Object.keys(pe).length>0){let L=Object.keys(pe).find(z=>pe[z]===!0);if(L!==void 0&&L!==e)return Dt.createElement(Dt.Fragment,null)}function Z(L){return M(this,null,function*(){if(yield u(e,L.id),de.map(z=>N(e,z.id)).every(z=>z===Le)){yield w(e);return}!s&&J+1<de.length&&!r&&A(e,de[J+1].id)})}function D(L,z,me){let je=J+1<de.length?de[J+1]:null;n&&n(L,J,z,je),i&&i(L,me,je)}function oe(){return de.map(L=>j(T({},L),{handleSecondaryButtonClick:()=>M(this,null,function*(){q(L),L.skippable===!0&&(yield u(e,L.id,{skipped:!0})),D(L,"secondary",J)}),handlePrimaryButtonClick:()=>M(this,null,function*(){(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&(yield Z(L)),D(L,"primary",J),X(L)})}))}function Ne(L){return M(this,null,function*(){l&&l(),m==="complete-flow"?yield w(e):yield u(e,L.id)})}function Je(){c&&c()}function xe(L){return M(this,null,function*(){yield O(e,de[L].id)})}let ce=!document.querySelector(de[J].selector);function V(){let L=de.findIndex(z=>!!document.querySelector(z.selector));return de.map((z,me)=>ce&&!r&&me!==L&&g||!r&&me!==J?null:Dt.createElement(Qr,T({key:z.id,appearance:o,steps:oe(),selectedStep:me,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Ne(z),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:_(e),onComplete:Je,cssPosition:y,onViewTooltip:xe,className:b},C)))}function W(){return Dt.createElement(Dt.Fragment,null,Dt.createElement(ae,{appearance:o}),V())}return y==="static"?W():Dt.createElement($c,null,W())};import ze,{useEffect as Dc,useRef as Uc,useState as _c}from"react";import{Portal as Wc}from"react-portal";import Ut from"styled-components";var wl=Ut.button`
|
|
1466
1468
|
${e=>E(e)} {
|
|
1467
1469
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1468
1470
|
|
|
@@ -1480,17 +1482,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1480
1482
|
opacity: 0.8;
|
|
1481
1483
|
}
|
|
1482
1484
|
}
|
|
1483
|
-
`,
|
|
1485
|
+
`,Tl=Ut.span`
|
|
1484
1486
|
${e=>E(e)} {
|
|
1485
1487
|
font-size: 12px;
|
|
1486
1488
|
display: inline-block;
|
|
1487
1489
|
}
|
|
1488
|
-
`,
|
|
1490
|
+
`,Fl=Ut.span`
|
|
1489
1491
|
${e=>E(e)} {
|
|
1490
1492
|
font-size: 12px;
|
|
1491
1493
|
display: inline-block;
|
|
1492
1494
|
}
|
|
1493
|
-
`,
|
|
1495
|
+
`,kl=Ut.div`
|
|
1494
1496
|
position: fixed;
|
|
1495
1497
|
right: 0;
|
|
1496
1498
|
bottom: 0;
|
|
@@ -1500,7 +1502,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1500
1502
|
flex-direction: column;
|
|
1501
1503
|
align-items: flex-end;
|
|
1502
1504
|
z-index: 50;
|
|
1503
|
-
`,
|
|
1505
|
+
`,Pl=Ut.button`
|
|
1504
1506
|
${e=>E(e)} {
|
|
1505
1507
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1506
1508
|
background-color: #ffffff;
|
|
@@ -1516,7 +1518,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1516
1518
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1517
1519
|
border-radius: 45px;
|
|
1518
1520
|
cursor: pointer;
|
|
1519
|
-
`,
|
|
1521
|
+
`,vl=Ut.div`
|
|
1520
1522
|
${e=>E(e)} {
|
|
1521
1523
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1522
1524
|
background: #ffffff;
|
|
@@ -1533,7 +1535,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1533
1535
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1534
1536
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1535
1537
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1536
|
-
`,
|
|
1538
|
+
`,Bl=Ut.button`
|
|
1537
1539
|
${e=>E(e)} {
|
|
1538
1540
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1539
1541
|
color: #434343;
|
|
@@ -1550,7 +1552,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1550
1552
|
font-size: 14px;
|
|
1551
1553
|
|
|
1552
1554
|
padding: 8px 12px;
|
|
1553
|
-
`;import
|
|
1555
|
+
`;import El from"react";var Al=({style:e,className:t})=>El.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},El.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 Ol from"react";var Nl=({style:e,className:t})=>Ol.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"},Ol.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 zc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:l})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:s,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y}=R(),{primaryCTAClickSideEffects:b}=ue(),C=Uc(null),[x,P]=_c(!1),{mergeAppearanceWithDefault:S}=ie();l=S(l),Dc(()=>(document.addEventListener("click",v,!1),()=>{document.removeEventListener("click",v,!1)}),[]);let v=w=>{C.current&&!C.current.contains(w.target)&&P(!1)};if(g)return null;let $=p(e);if(!$||y($))return null;let B=d(e);if(!B||!i)return null;function u(w,k){!w.completionCriteria&&(w.autoMarkCompleted||w.autoMarkCompleted===void 0)&&s(e,w.id),b(w),o&&o(w,k),P(!1)}function O(){return x&&ze.createElement(vl,{className:a("floatingWidgetMenu",l),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},B.map((w,k)=>ze.createElement(Bl,{className:a("floatingWidgetMenuItem",l),key:k,onClick:()=>u(w,k)},w.title)))}return n=="inline"?ze.createElement("span",{ref:C},ze.createElement(wl,{style:t,onClick:()=>{P(!x)},className:a("supportButton",l)},ze.createElement(Fl,{className:a("supportIconContainer",l)},ze.createElement(Nl,{className:a("supportIcon",l),style:{width:"18px",height:"18px"}})),ze.createElement(Tl,{className:a("supportButtonTitle",l)},r)),ze.createElement(O,null)):ze.createElement(Wc,null,ze.createElement(kl,{style:t,ref:C},ze.createElement(O,null),ze.createElement(Pl,{onClick:()=>{P(!x)},whileHover:{scale:1.1},className:a("floatingWidgetButton",l)},ze.createElement(Al,{className:a("floatingWidgetButtonIcon",l),style:{display:"flex",width:"20px",height:"20px"}}))))};import it,{useEffect as Hc}from"react";import ur from"styled-components";var Il=ur.div`
|
|
1554
1556
|
${e=>E(e)} {
|
|
1555
1557
|
display: flex;
|
|
1556
1558
|
flex-direction: column;
|
|
@@ -1565,17 +1567,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1565
1567
|
border-radius: 12px;
|
|
1566
1568
|
position: relative;
|
|
1567
1569
|
}
|
|
1568
|
-
`,
|
|
1570
|
+
`,Ll=ur.div`
|
|
1569
1571
|
display: flex;
|
|
1570
1572
|
flex-direction: column;
|
|
1571
1573
|
flex: 1;
|
|
1572
|
-
|
|
1574
|
+
`,$l=ur.div`
|
|
1573
1575
|
display: flex;
|
|
1574
1576
|
flex-direction: column;
|
|
1575
1577
|
justify-content: center;
|
|
1576
1578
|
align-items: flex-start;
|
|
1577
1579
|
margin-top: 16px;
|
|
1578
|
-
|
|
1580
|
+
`,Ml=ur.div`
|
|
1579
1581
|
${e=>E(e)} {
|
|
1580
1582
|
position: absolute;
|
|
1581
1583
|
top: 16px;
|
|
@@ -1586,7 +1588,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1586
1588
|
opacity: 0.8;
|
|
1587
1589
|
}
|
|
1588
1590
|
}
|
|
1589
|
-
`;var Vc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:
|
|
1591
|
+
`;var Vc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowSteps:b,getFlowStatus:C,getCurrentStepIndex:x}=R(),{primaryCTAClickSideEffects:P}=ue(),{mergeAppearanceWithDefault:S}=ie();if(He(e),n=S(n),Hc(()=>{y(o)},[o,c]),c)return null;let v=d(e);if(!v||g(v)||C(e)===re)return null;let B=b(e)[x(e)];return it.createElement(it.Fragment,null,it.createElement(ae,{appearance:n}),it.createElement(Il,{appearance:n,className:Te(a("embeddedTipContainer",n),r),style:l},(p===!0||B.dismissible)&&it.createElement(Ml,{onClick:()=>M(void 0,null,function*(){yield s(e),t&&t()}),className:a("embeddedTipDismissButton",n)},it.createElement(Ee,null)),it.createElement(Ll,null,it.createElement(Ae,{size:"small",appearance:n,title:B.title,subtitle:B.subtitle})),B.primaryButtonTitle&&it.createElement($l,{className:a("embeddedTipCallToActionContainer",n)},it.createElement(se,{classPrefix:"embeddedTip",title:B.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>M(void 0,null,function*(){B.handlePrimaryButtonClick(),P(B),!(i&&i(B,x(e),"primary")===!1)&&(yield m(e,B.id),yield s(e))})}))))};import Pe,{useEffect as jc}from"react";import mo from"styled-components";var Dl=mo.div`
|
|
1590
1592
|
// use the :not annotation
|
|
1591
1593
|
${e=>E(e)} {
|
|
1592
1594
|
display: flex;
|
|
@@ -1598,24 +1600,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1598
1600
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1599
1601
|
border-radius: 12px;
|
|
1600
1602
|
}
|
|
1601
|
-
`,
|
|
1603
|
+
`,Ul=mo.div`
|
|
1602
1604
|
${e=>E(e)} {
|
|
1603
1605
|
display: flex;
|
|
1604
1606
|
width: 46px;
|
|
1605
1607
|
height: 46px;
|
|
1606
1608
|
}
|
|
1607
|
-
`,
|
|
1609
|
+
`,_l=mo.div`
|
|
1608
1610
|
display: flex;
|
|
1609
1611
|
flex-direction: column;
|
|
1610
1612
|
flex: 1;
|
|
1611
1613
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1612
1614
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1613
|
-
`,
|
|
1615
|
+
`,Wl=mo.div`
|
|
1614
1616
|
display: flex;
|
|
1615
1617
|
flex-direction: column;
|
|
1616
1618
|
justify-content: center;
|
|
1617
1619
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1618
|
-
`,
|
|
1620
|
+
`,Zr=mo.div`
|
|
1619
1621
|
display: flex;
|
|
1620
1622
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1621
1623
|
align-items: flex-end;
|
|
@@ -1623,12 +1625,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1623
1625
|
:hover {
|
|
1624
1626
|
opacity: 0.8;
|
|
1625
1627
|
}
|
|
1626
|
-
`,
|
|
1628
|
+
`,Rr=mo.div`
|
|
1627
1629
|
display: flex;
|
|
1628
1630
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1629
1631
|
align-items: flex-end;
|
|
1630
1632
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1631
|
-
`;import
|
|
1633
|
+
`;import ei from"react";var zl=({style:e,className:t})=>ei.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},ei.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),ei.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 Gc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:l,type:p="full-width",icon:d})=>{let{getFlow:s,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowMetadata:b,getFlowStatus:C,getFlowSteps:x,getCurrentStepIndex:P}=R(),{primaryCTAClickSideEffects:S}=ue(),{mergeAppearanceWithDefault:v}=ie();if(He(e),l=v(l),jc(()=>{y(n)},[n,c]),c)return null;let $=s(e);if(!$||g($)||C(e)===re)return null;let B=x(e),u=B.length>0?B[P(e)]:b(e);return u!=null&&u.title&&(t=u.title),u!=null&&u.subtitle&&(o=u.subtitle),Pe.createElement(Pe.Fragment,null,Pe.createElement(ae,{appearance:l}),Pe.createElement(Dl,{type:p,appearance:l,className:a("bannerContainer",l)},p!="square"&&Pe.createElement(Ul,{className:a("bannerIconContainer",l)},d||Pe.createElement(zl,null)),p==="square"&&u.dismissible&&Pe.createElement(Rr,{type:p,className:a("bannerDismissButtonContainer",l)},Pe.createElement(Zr,{type:p,onClick:()=>M(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",l)},Pe.createElement(Ee,null))),Pe.createElement(_l,{type:p},Pe.createElement(Ae,{appearance:l,title:t,subtitle:o,classPrefix:"banner"})),(u==null?void 0:u.primaryButtonTitle)&&Pe.createElement(Wl,{type:p,className:a("bannerCallToActionContainer",l)},Pe.createElement(se,{title:u==null?void 0:u.primaryButtonTitle,appearance:l,onClick:()=>{S(u),r&&r(u,0,"primary")},classPrefix:"banner"})),p!=="square"&&u.dismissible&&Pe.createElement(Rr,{type:p,className:a("bannerDismissButtonContainer",l)},Pe.createElement(Zr,{type:p,onClick:()=>M(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",l)},Pe.createElement(Ee,null)))))};import le,{useEffect as Kc}from"react";import{Portal as qc}from"react-portal";import ft from"styled-components";var Hl=ft.div`
|
|
1632
1634
|
display: flex;
|
|
1633
1635
|
flex-direction: column;
|
|
1634
1636
|
width: 100%;
|
|
@@ -1650,7 +1652,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1650
1652
|
border-width: 1px;
|
|
1651
1653
|
border-color: ${t=>t.appearance.theme.colorBorder};
|
|
1652
1654
|
border-radius: ${t=>t.appearance.theme.borderRadius}px;`:""}
|
|
1653
|
-
`,
|
|
1655
|
+
`,Vl=ft.button`
|
|
1654
1656
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1655
1657
|
border-radius: 8px;
|
|
1656
1658
|
// If selected make border color primary and text color color priamry
|
|
@@ -1671,33 +1673,33 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1671
1673
|
display: flex;
|
|
1672
1674
|
justify-content: center;
|
|
1673
1675
|
align-items: center;
|
|
1674
|
-
`,
|
|
1676
|
+
`,ti=ft.div`
|
|
1675
1677
|
display: flex;
|
|
1676
1678
|
justify-content: space-between;
|
|
1677
1679
|
margin-top: 16px;
|
|
1678
1680
|
gap: 8px;
|
|
1679
|
-
`,
|
|
1681
|
+
`,jl=ft.div`
|
|
1680
1682
|
display: flex;
|
|
1681
1683
|
justify-content: space-between;
|
|
1682
1684
|
margin-top: 8px;
|
|
1683
|
-
`,
|
|
1685
|
+
`,oi=ft.div`
|
|
1684
1686
|
font-size: 12px;
|
|
1685
1687
|
line-height: 18px;
|
|
1686
1688
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1687
1689
|
font-style: normal;
|
|
1688
1690
|
font-weight: 400;
|
|
1689
1691
|
letter-spacing: 0.24px;
|
|
1690
|
-
`,
|
|
1692
|
+
`,ri=ft.div`
|
|
1691
1693
|
display: flex;
|
|
1692
1694
|
flex-direction: column;
|
|
1693
1695
|
flex: 1;
|
|
1694
|
-
`,uw=
|
|
1696
|
+
`,uw=ft.div`
|
|
1695
1697
|
display: flex;
|
|
1696
1698
|
flex-direction: column;
|
|
1697
1699
|
justify-content: center;
|
|
1698
1700
|
align-items: flex-start;
|
|
1699
1701
|
margin-top: 16px;
|
|
1700
|
-
`,
|
|
1702
|
+
`,Gl=ft.textarea`
|
|
1701
1703
|
${e=>E(e)} {
|
|
1702
1704
|
color: ${e=>e.appearance.theme.colorText};
|
|
1703
1705
|
margin-top: 16px;
|
|
@@ -1710,7 +1712,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1710
1712
|
height: 100px;
|
|
1711
1713
|
resize: none;
|
|
1712
1714
|
}
|
|
1713
|
-
`,
|
|
1715
|
+
`,Kl=ft.div`
|
|
1714
1716
|
${e=>E(e)} {
|
|
1715
1717
|
position: absolute;
|
|
1716
1718
|
top: 16px;
|
|
@@ -1721,7 +1723,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1721
1723
|
opacity: 0.8;
|
|
1722
1724
|
}
|
|
1723
1725
|
}
|
|
1724
|
-
`;var Yc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:
|
|
1726
|
+
`;var Yc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:b,getFlowSteps:C,getFlowStatus:x,getFlowMetadata:P}=R(),{primaryCTAClickSideEffects:S}=ue(),{mergeAppearanceWithDefault:v}=ie(),[$,B]=le.useState(null),[u,O]=le.useState(""),w=P(e),{hasOpenModals:k,setKeepCompletedFlowOpenDuringSession:I,shouldKeepCompletedFlowOpenDuringSession:N}=Be();if(He(e),n=v(n),Kc(()=>{b(o)},[o,g]),g)return null;let A=d(e);if(!A||y(A)||x(e)===re||c(e)===1&&!N(e)||k())return null;let _=C(e)[c(e)];function ee(){var Y,J;return le.createElement(le.Fragment,null,le.createElement(ri,null,le.createElement(Ae,{size:"large",appearance:n,title:_.title,subtitle:_.subtitle})),le.createElement(ti,{className:a("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(pe=>le.createElement(Vl,{className:a("npsNumberButton",n),selected:$===pe+1,key:pe,onClick:()=>M(this,null,function*(){I(e),B(pe+1),yield m(e,_.id,{score:pe+1})}),appearance:n},pe+1))),le.createElement(jl,{appearance:n},le.createElement(oi,{appearance:n},(Y=w==null?void 0:w.negativeLabel)!=null?Y:"Not likely at all"),le.createElement(oi,{appearance:n},(J=w==null?void 0:w.positiveLabel)!=null?J:"Extremely likely")))}function X(){var Y;return le.createElement(le.Fragment,null,le.createElement(ri,null,le.createElement(Ae,{appearance:n,title:(Y=_.title)!=null?Y:"Why did you choose this score?",size:"large"})),le.createElement(Gl,{appearance:n,value:u,onChange:J=>{O(J.target.value)},placeholder:"Add your optional feedback here..."}),le.createElement(ti,{appearance:n,className:a("npsNumberButtonContainer",n)},le.createElement(se,{size:"large",withMargin:!1,onClick:()=>M(this,null,function*(){yield s(e),i&&i(_,1,"primary")}),appearance:n,title:_.secondaryButtonTitle||"Skip",secondary:!0}),le.createElement(se,{size:"large",withMargin:!1,onClick:()=>M(this,null,function*(){yield m(e,_.id,{feedbackText:u}),yield s(e),i&&i(_,1,"primary")}),appearance:n,title:_.primaryButtonTitle||"Submit"})))}function q(){return c(e)>=2?null:le.createElement(le.Fragment,null,le.createElement(ae,{appearance:n}),le.createElement(Hl,{appearance:n,className:Te(a("npsSurveyContainer",n),r),style:l,type:p},le.createElement(Kl,{onClick:()=>M(this,null,function*(){yield s(e),t&&t()}),className:a("npsSurveyDismissButton",n)},le.createElement(Ee,null)),c(e)==0&&ee(),c(e)==1&&X()))}return p==="inline"?q():le.createElement(qc,null,q())};import ve,{useEffect as Qc}from"react";import _t from"styled-components";var ql=_t.div`
|
|
1725
1727
|
${e=>E(e)} {
|
|
1726
1728
|
display: flex;
|
|
1727
1729
|
flex-direction: column;
|
|
@@ -1732,21 +1734,21 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1732
1734
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1733
1735
|
position: relative;
|
|
1734
1736
|
}
|
|
1735
|
-
`,
|
|
1737
|
+
`,Yl=_t.div`
|
|
1736
1738
|
display: flex;
|
|
1737
1739
|
flex-direction: column;
|
|
1738
1740
|
flex: 1;
|
|
1739
|
-
`,
|
|
1741
|
+
`,Jl=_t.div`
|
|
1740
1742
|
display: flex;
|
|
1741
1743
|
flex-direction: row;
|
|
1742
1744
|
justify-content: center;
|
|
1743
1745
|
align-items: stretch;
|
|
1744
1746
|
gap: 16px;
|
|
1745
1747
|
margin-top: 8px;
|
|
1746
|
-
`,
|
|
1748
|
+
`,Xl=_t.div`
|
|
1747
1749
|
margin-top: 16px;
|
|
1748
1750
|
margin-bottom: 16px;
|
|
1749
|
-
`,
|
|
1751
|
+
`,Ql=_t.div`
|
|
1750
1752
|
${e=>E(e)} {
|
|
1751
1753
|
position: absolute;
|
|
1752
1754
|
top: -16px;
|
|
@@ -1757,7 +1759,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1757
1759
|
opacity: 0.8;
|
|
1758
1760
|
}
|
|
1759
1761
|
}
|
|
1760
|
-
`,
|
|
1762
|
+
`,Zl=_t.h1`
|
|
1761
1763
|
${e=>E(e)} {
|
|
1762
1764
|
font-style: normal;
|
|
1763
1765
|
justify-content: center;
|
|
@@ -1771,7 +1773,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1771
1773
|
color: ${e=>e.appearance.theme.colorText};
|
|
1772
1774
|
margin-bottom: 8px;
|
|
1773
1775
|
}
|
|
1774
|
-
`,
|
|
1776
|
+
`,Rl=_t.h2`
|
|
1775
1777
|
${e=>E(e)} {
|
|
1776
1778
|
font-style: normal;
|
|
1777
1779
|
justify-content: center;
|
|
@@ -1783,10 +1785,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${Co}${t}.${Co}${t} { ${Object.entries(o).map
|
|
|
1783
1785
|
letter-spacing: 0.28px;
|
|
1784
1786
|
margin-bottom: 8px;
|
|
1785
1787
|
}
|
|
1786
|
-
`;import
|
|
1788
|
+
`;import ea from"react";import Jc from"styled-components";var Xc=Jc.img`
|
|
1787
1789
|
width: 100%;
|
|
1788
1790
|
height: 100%;
|
|
1789
1791
|
min-height: 200px;
|
|
1790
1792
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1791
|
-
`;function
|
|
1793
|
+
`;function ta({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?ea.createElement(tt,{appearance:t,videoUri:e.videoUri}):e.imageUri?ea.createElement(Xc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Zc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:s,markFlowCompleted:m,markStepCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:b,getFlowSteps:C,getFlowStatus:x,getCurrentStepIndex:P}=R(),{primaryCTAClickSideEffects:S,secondaryCTAClickSideEffects:v}=ue(),{mergeAppearanceWithDefault:$}=ie(),{setOpenFlowState:B,getOpenFlowState:u,hasOpenModals:O}=Be();He(e);let[w,k]=[u(e,!0),X=>B(e,X)];if(n=$(n),Qc(()=>{b(o)},[o,g]),g)return null;let I=s(e);if(!I||y(I)||x(e)===re||O())return null;let A=C(e)[P(e)],H=()=>{k(!1),t&&t(),m(e)};function _(){return ve.createElement(ve.Fragment,null,ve.createElement(ae,{appearance:n}),ve.createElement(ql,{appearance:n,className:Te(a("announcementContainer",n),r),style:l},(p===!0||A.dismissible)&&d=="inline"&&ve.createElement(Ql,{onClick:()=>M(this,null,function*(){yield m(e),t&&t()}),className:a("announcementDismissButton",n)},ve.createElement(Ee,null)),ve.createElement(Yl,null,ve.createElement(Zl,{appearance:n,className:a("announcementTitle",n),dangerouslySetInnerHTML:ne(A.title)}),A.subtitle&&ve.createElement(Rl,{appearance:n,className:a("announcementSubtitle",n),dangerouslySetInnerHTML:ne(A.subtitle)})),(A.imageUri||A.videoUri)&&ve.createElement(Xl,{className:a("announcementMediaContainer",n)},ve.createElement(ta,{appearance:n,stepData:A})),(A.primaryButtonTitle||A.secondaryButtonTitle)&&ve.createElement(Jl,{className:a("announcementCTAContainer",n)},A.secondaryButtonTitle&&ve.createElement(se,{classPrefix:"announcement",title:A.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){A.handleSecondaryButtonClick(),v(A),i&&i(A,P(e),"secondary")}),secondary:!0}),A.primaryButtonTitle&&ve.createElement(se,{classPrefix:"announcement",title:A.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){A.handlePrimaryButtonClick(),S(A),!(i&&i(A,P(e),"primary")===!1)&&(yield c(e,A.id),yield m(e))})}))))}let ee={padding:"24px",maxWidth:"400px"};return d==="inline"?_():d!=="center"?ve.createElement(Vo,{modalPosition:d,onClose:H,visible:w,dismissible:p,appearance:n},_()):ve.createElement(Re,{appearance:n,onClose:H,visible:w,style:ee,dismissible:p},_())};import*as fr from"react";import oa from"react";var ra=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Ie(r,["as","children","variant"]);return oa.createElement(vn,T({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},Rc=Object.fromEntries(Object.keys(er).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>oa.createElement(ra,j(T({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),ii=Object.assign(ra,Rc);var ia=l=>{var p=l,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=p,r=Ie(p,["as","className","size","title","variant"]);var d;return fr.createElement(Pn,T({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),fr.createElement(ii,{color:(d=Bo[n])==null?void 0:d.color,fontWeight:"semibold"},i))},em=Object.fromEntries(Object.keys(Bo).map(e=>{let t=o=>fr.createElement(ia,j(T({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),tm=Object.assign(ia,em);export{vo as Box,tm as Button,at as CheckBox,xr as FlowType,Ct as FormLabel,Er as FormTextField,Zc as FrigadeAnnouncement,Gc as FrigadeBanner,Jr as FrigadeChecklist,lt as FrigadeDefaultAppearance,Vc as FrigadeEmbeddedTip,Cn as FrigadeForm,Sc as FrigadeGuide,hc as FrigadeHeroChecklist,Yc as FrigadeNPSSurvey,Cc as FrigadeProgressBadge,Pd as FrigadeProvider,zc as FrigadeSupportWidget,Mc as FrigadeTour,_e as ProgressBar,Yt as ProgressRing,ii as Text,tr as tokens,Be as useFlowOpens,xo as useFlowResponses,R as useFlows,Wr as useOrganization,Co as useUser,De as useUserFlowStates};
|
|
1792
1794
|
//# sourceMappingURL=index.mjs.map
|