@frigade/react 1.35.54 → 1.35.56
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/README.md +1 -0
- package/lib/index.js +162 -161
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +175 -174
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnPropertyDescriptors;var Bo=Object.getOwnPropertySymbols;var oi=Object.prototype.hasOwnProperty,ri=Object.prototype.propertyIsEnumerable;var ti=(e,t,o)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,w=(e,t)=>{for(var o in t||(t={}))oi.call(t,o)&&ti(e,o,t[o]);if(Bo)for(var o of Bo(t))ri.call(t,o)&&ti(e,o,t[o]);return e},_=(e,t)=>na(e,sa(t));var ii=e=>typeof e=="symbol"?e:e+"",Ie=(e,t)=>{var o={};for(var i in e)oi.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Bo)for(var i of Bo(e))t.indexOf(i)<0&&ri.call(e,i)&&(o[i]=e[i]);return o};var D=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(l){n(l)}},s=d=>{try{p(o.throw(d))}catch(l){n(l)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,s);p((o=o.apply(e,t)).next())});import vt,{createContext as Cd,useEffect as Ko,useState as je}from"react";import{ThemeProvider as yd}from"styled-components";import Pt,{useContext as qp,useEffect as qt,useState as yo}from"react";import{useCallback as Tt,useContext as ya,useEffect as Sa}from"react";import ir,{useMemo as si}from"react";var ni="1.35.54 ";var He="NOT_STARTED_STEP",Z="COMPLETED_FLOW",Eo="ABORTED_FLOW",wt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ke="COMPLETED_STEP",so="STARTED_STEP";function Je(){let{publicApiKey:e,userId:t,apiUrl:o}=ir.useContext(Q);return{config:si(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":ni,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:si(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function Ut(){let{shouldGracefullyDegrade:e,readonly:t}=ir.useContext(Q);return(o,i)=>D(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Dt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Dt();let n=la+o,r=aa+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 l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return Dt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let s;try{s=yield fetch(o,i)}catch(p){return Dt(p)}return s?s.ok?s:Dt(s.statusText):Dt()})}function Dt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Wt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=ir.useContext(Q);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as ha,useState as li}from"react";import{useContext as da,useEffect as ca,useState as ma}from"react";import ua from"swr";import{useContext as pa}from"react";function ve(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=pa(Q);function r(c,f=!1){var y;return(y=e[c])!=null?y:f}function s(c,f){t(y=>_(w({},y),{[c]:f}))}function p(c){t(f=>{let S=f,{[c]:y}=S,T=Ie(S,[ii(c)]);return w({},T)})}function d(c){n.includes(c)||i(f=>[...f,c])}function l(c){return n.includes(c)}function m(c){return Object.entries(e).some(([f,y])=>y&&f!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import fa from"swr/immutable";import lo from"core-js-pure/actual/structured-clone";function nr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function he(...e){let t=e.shift(),o=e.length===1?e[0]:he(...e);if(!nr(t)||!nr(o))throw new Error("deepmerge can only merge Objects");let i=lo(t);return Object.entries(o).forEach(([n,r])=>{nr(r)?i[n]!==void 0?Object.assign(i,{[n]:he(i[n],lo(r))}):Object.assign(i,{[n]:lo(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...lo(r)]}):Object.assign(i,{[n]:lo(r)}):Object.assign(i,{[n]:r})}),i}var ga="unknown";function De(){let{config:e,apiUrl:t}=Je(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:p}=da(Q),{resetOpenFlowState:d}=ve(),[l,m]=ma(!1),c={data:r.map(h=>({flowId:h.id,flowState:Z,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=h=>fetch(h,e).then(b=>{if(b.ok)return b.json();throw new Error("Failed to fetch user flow states")}).catch(b=>(console.log(`Error fetching ${h}: ${b}. Will gracefully degrade and hide Frigade`),s(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:T,isLoading:S,mutate:g,error:E}=p?fa(y,f):ua(y,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),k=T==null?void 0:T.data;ca(()=>{!l&&!S&&k&&m(!0)},[k,l,S]);function F(h){return D(this,null,function*(){if(k&&!p){let b=k.find(N=>N.flowId===h);b&&b.flowState!==Z&&(b.flowState=Z),yield g(Promise.resolve(he(T,{data:k})),{optimisticData:he(T,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function A(h,b,N){return D(this,null,function*(){if(k){let L=k.find(O=>O.flowId===h);L&&(L.stepStates[b]=N,L.flowState=wt),yield g(Promise.resolve(he(T,{data:k})),{optimisticData:he(T,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function I(h,b,N){return D(this,null,function*(){if(k){let L=k.find(O=>O.flowId===h);L&&(L.lastStepId=b,L.stepStates[b]=N,L.flowState=wt),yield g(he(T,{data:k}),{optimisticData:he(T,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function x(h){return D(this,null,function*(){if(k){let b=k.find(N=>N.flowId===h);b&&b.flowState!==Me&&(b.flowState=Me,b.lastStepId=ga,Object.keys(b.stepStates).forEach(N=>{b.stepStates[N].actionType=He,b.stepStates[N].createdAt=new Date().toISOString()}),yield g(he(T,{data:k}),{optimisticData:he(T,{data:k}),revalidate:!1,rollbackOnError:!1}),d(h))}})}function v(h,b){return D(this,null,function*(){if(k){let N=k.find(L=>L.flowId===h);N&&N.stepStates[b]!==He&&(N.stepStates[b]=He),yield g(he(T,{data:k}),{optimisticData:he(T,{data:k}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:k,isLoadingUserFlowStateData:!l,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:F,optimisticallyMarkFlowNotStarted:x,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:v,optimisticallyMarkStepStarted:I,error:E}}function ao(){let{config:e,apiUrl:t}=Je(),{userFlowStatesData:o,mutateUserFlowState:i}=De(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:p}=ha(Q),[d,l]=li(new Set),[m,c]=li(new Set),f=Ut();function y(g){let E=JSON.stringify(g);if(d.has(E))return null;d.add(E),l(d),m.add(g),c(m);let k=s==null?void 0:s.find(F=>F.flowSlug===g.flowSlug&&F.stepId===g.stepId&&F.actionType===g.actionType&&F.createdAt===g.createdAt);return f(`${t}flowResponses`,_(w({},e),{method:"POST",body:E})).then(F=>{F.status!==200&&F.status!==201?(console.log("Failed to send flow response for step "+g.stepId+". Will retry again later."),r([...n,g])):k||p(A=>[...A!=null?A:[],g])})}function T(g){return D(this,null,function*(){g.foreignUserId&&(g.actionType===wt||g.actionType===Me?yield y(g):g.actionType===Z?yield y(g):g.actionType===so?yield y(g):g.actionType===Ke?yield y(g):g.actionType===Eo?yield y(g):g.actionType===He&&(yield y(g)))})}function S(){let g=[];return o==null||o.forEach(E=>{if(E&&E.stepStates&&Object.keys(E.stepStates).length!==0)for(let k in E.stepStates){let F=E.stepStates[k];g.push({foreignUserId:E.foreignUserId,flowSlug:E.flowId,stepId:F.stepId,actionType:F.actionType,data:{},createdAt:new Date(F.createdAt),blocked:F.blocked,hidden:F.hidden})}}),[...g,...s]}return{addResponse:T,setFlowResponses:p,getFlowResponses:S}}import ba from"swr";var xa=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ai=e=>{let t=xa.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Ca(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Ca=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function sr(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var lr=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(lr||{});function R(){let{config:e,apiUrl:t}=Je(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:f,readonly:y}=ya(Q),T={data:[]},{verifySDKInitiated:S}=Wt(),{addResponse:g,getFlowResponses:E}=ao(),k=u=>fetch(u,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${u} (${C.status}): ${C.statusText}. Will gracefully degrade and hide Frigade`),f(!0),T)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),f(!0),T)),{mutateUserFlowState:F,userFlowStatesData:A,isLoadingUserFlowStateData:I,optimisticallyMarkFlowCompleted:x,optimisticallyMarkFlowNotStarted:v,optimisticallyMarkStepCompleted:h,optimisticallyMarkStepNotStarted:b,optimisticallyMarkStepStarted:N}=De(),{data:L,error:O,isLoading:j}=ba(s?`${t}flows${y?"?readonly=true":""}`:null,k,{keepPreviousData:!0});Sa(()=>{if(O){console.error(O);return}L&&L.data&&i(L.data)},[L,O]);function M(u){if(j)return null;let C=o.find(P=>P.slug===u);return!C&&o.length>0&&!I&&!j?(console.log(`Flow with id ${u} not found`),null):(C==null?void 0:C.active)===!1&&!y?null:C}function G(u){var z,Oe;if(!M(u))return[];let C=M(u).data;return C?(C=le(C),((Oe=(z=sr(C))==null?void 0:z.data)!=null?Oe:[]).map(Ce=>{let no=J(Ce);return _(w({handleSecondaryButtonClick:()=>{Ce.skippable===!0&&V(u,Ce.id,{skipped:!0})}},Ce),{complete:ue(u,Ce.id)===Ke||no>=1,blocked:Ae(u,Ce.id),hidden:be(u,Ce.id),handlePrimaryButtonClick:()=>{(!Ce.completionCriteria&&(Ce.autoMarkCompleted||Ce.autoMarkCompleted===void 0)||Ce.completionCriteria&&Ce.autoMarkCompleted===!0)&&V(u,Ce.id)},progress:no})}).filter(Ce=>Ce.hidden!==!0)):[]}function le(u){return u.replaceAll(/\${(.*?)}/g,(C,P)=>p[P]===void 0?"":String(p[P]).replace(/[\u00A0-\u9999<>\&]/g,function(z){return"&#"+z.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function pe(u){var P;if(!M(u))return[];let C=M(u).data;return C?(C=le(C),(P=JSON.parse(C))!=null?P:{}):[]}function q(u,C){d(P=>_(w({},P),{[u]:C}))}function se(u){!I&&!j&&u&&JSON.stringify(p)!=JSON.stringify(w(w({},p),u))&&Object.keys(u).forEach(C=>{q(C,u[C])})}let de=Tt((u,C,P)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:C,actionType:so,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield N(u,C,z),g(z))}),[n,r,A]),Se=Tt((u,C,P)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:C,actionType:He,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield b(u,C),g(z))}),[n,r,A]),V=Tt((u,C,P)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:C,actionType:Ke,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield h(u,C,z),g(z))}),[n,r,A]),Y=Tt((u,C)=>D(this,null,function*(){if(!S()||fe(u)===Me)return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Me,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};yield v(u),X(P)&&g(P)}),[n,r,A]),ee=Tt((u,C)=>D(this,null,function*(){if(!S())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:wt,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};X(P)&&g(P)}),[n,r,A]),Ve=Tt((u,C)=>D(this,null,function*(){if(!S())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Z,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};X(P)&&(yield x(u),g(P))}),[n,r,A]),Le=Tt((u,C)=>D(this,null,function*(){if(!S())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Eo,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};X(P)&&(yield x(u),g(P))}),[n,r,A]);function X(u){var C;if(!A&&u.actionType===He)return!1;if(A){let P=A.find(z=>z.flowId===u.flowSlug);if(u.actionType===He&&(!(P!=null&&P.stepStates[u.stepId])||P.stepStates[u.stepId].actionType===He)||P&&((C=P.stepStates[u.stepId])==null?void 0:C.actionType)===u.actionType&&u.actionType!==so||P&&P.flowState===Z&&u.actionType===Z)return!1}return!0}function ue(u,C){let P=U(u,C);return I?null:P?P.actionType:He}function Ae(u,C){let P=U(u,C);return P?P.blocked:!1}function be(u,C){let P=U(u,C);return P?P.hidden:!1}function U(u,C){var z;if(I)return null;let P=A==null?void 0:A.find(Oe=>Oe.flowId===u);return!P||!P.stepStates[C]?null:(z=P.stepStates[C])!=null?z:null}function $(u){var P,z;if(I||!A)return null;if(fe(u)===Me)return(P=G(u)[0])!=null?P:null;let C=(z=A.find(Oe=>Oe.flowId===u))==null?void 0:z.lastStepId;return C?G(u).find(Oe=>Oe.id===C):null}function W(u){var z;let C=$(u);if(!C)return 0;let P=(z=G(u).findIndex(Oe=>Oe.id===C.id))!=null?z:0;return ue(u,C.id)===Ke&&P<G(u).length-1?P+1:P}function J(u){if(!u.completionCriteria)return;let C=ai(u.completionCriteria);if(C===null)return;let P=$e(C),z=Ge(C);return z===0?void 0:P/z}function fe(u){let C=A==null?void 0:A.find(P=>P.flowId===u);return C?C.flowState:null}function $e(u){let C=G(u);return C.length===0?0:C.filter(z=>ue(u,z.id)===Ke).length}function Ge(u){return G(u).length}function Xe(u){let C=o.find(P=>P.slug===u);return C?sr(C.data):null}function St(u){if(y)return!1;if(I)return!0;if(u!=null&&u.targetingLogic&&A){let C=A.find(P=>P.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&n&&n.startsWith("guest_"))}function $t(u){return!St(M(u))}function Mt(){n&&F()}function bt(){return o}return{getAllFlows:bt,getFlow:M,getFlowData:Xe,isLoading:I||j,getStepStatus:ue,getFlowSteps:G,getCurrentStepIndex:W,markStepStarted:de,markStepCompleted:V,markFlowNotStarted:Y,markFlowStarted:ee,markFlowCompleted:Ve,markFlowAborted:Le,markStepNotStarted:Se,getFlowStatus:fe,getNumberOfStepsCompleted:$e,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:St,setCustomVariable:q,updateCustomVariables:se,customVariables:p,getStepOptionalProgress:J,getFlowMetadata:pe,isStepBlocked:Ae,isStepHidden:be,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,isFlowAvailableToUser:$t,refresh:Mt}}import{useCallback as ar,useContext as wa,useEffect as Ta}from"react";var zt="guest_";function po(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=wa(Q),{config:r,apiUrl:s}=Je(),{mutateUserFlowState:p}=De(),d=Ut(),{verifySDKInitiated:l}=Wt();function m(T){return`frigade-user-registered-${T}`}Ta(()=>{if(e&&!t){if(e.startsWith(zt))return;let T=m(e);localStorage.getItem(T)||(d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(T,"true"))}},[e,n,t]);let c=ar(T=>D(this,null,function*(){if(!l())return;let S={foreignId:e,properties:T};yield d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify(S)})),i(g=>w(w({},g),T)),p()}),[e,r,n,p]),f=ar((T,S)=>D(this,null,function*(){if(!l())return;let E={foreignId:e,events:[{event:T,properties:S}]};yield d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify(E)})),p()}),[e,r,p]),y=ar((T,S)=>D(this,null,function*(){if(l())if(S){let g=m(T);localStorage.setItem(g,"true"),o(T);let E={foreignId:T,properties:S};yield d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify(E)})),i(k=>w(w({},k),S)),p()}else o(T)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:f}}import{v4 as Yp}from"uuid";import et,{useEffect as mn,useState as un}from"react";import qe,{useEffect as mr,useState as Ia}from"react";import No from"styled-components";import Fa from"react";import ka from"styled-components";var pi="fr-",co="cfr-";function a(e,t){let o=`${pi}${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 B(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(pi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Ao(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Fe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Ao(t)}: ${e.styleOverrides[t]};`).join(" "):""}function we(...e){return e.filter(Boolean).join(" ")}function mo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Pa=ka.div`
|
|
2
|
+
var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnPropertyDescriptors;var Bo=Object.getOwnPropertySymbols;var oi=Object.prototype.hasOwnProperty,ri=Object.prototype.propertyIsEnumerable;var ti=(e,t,o)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,w=(e,t)=>{for(var o in t||(t={}))oi.call(t,o)&&ti(e,o,t[o]);if(Bo)for(var o of Bo(t))ri.call(t,o)&&ti(e,o,t[o]);return e},_=(e,t)=>na(e,sa(t));var ii=e=>typeof e=="symbol"?e:e+"",Ie=(e,t)=>{var o={};for(var i in e)oi.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Bo)for(var i of Bo(e))t.indexOf(i)<0&&ri.call(e,i)&&(o[i]=e[i]);return o};var D=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(l){n(l)}},s=d=>{try{p(o.throw(d))}catch(l){n(l)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,s);p((o=o.apply(e,t)).next())});import Bt,{createContext as Cd,useEffect as qo,useState as je}from"react";import{ThemeProvider as yd}from"styled-components";import vt,{useContext as qp,useEffect as Yt,useState as Co}from"react";import{useCallback as Ft,useContext as ya,useEffect as Sa}from"react";import nr,{useMemo as si}from"react";var ni="1.35.56 ";var He="NOT_STARTED_STEP",Z="COMPLETED_FLOW",Eo="ABORTED_FLOW",Tt="STARTED_FLOW",Me="NOT_STARTED_FLOW",Ke="COMPLETED_STEP",Ao="STARTED_STEP";function Je(){let{publicApiKey:e,userId:t,apiUrl:o}=nr.useContext(Q);return{config:si(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":ni,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:si(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function Wt(){let{shouldGracefullyDegrade:e,readonly:t}=nr.useContext(Q);return(o,i)=>D(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Ut();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Ut();let n=la+o,r=aa+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 l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return Ut()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let s;try{s=yield fetch(o,i)}catch(p){return Ut(p)}return s?s.ok?s:Ut(s.statusText):Ut()})}function Ut(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function zt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=nr.useContext(Q);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as ha,useState as li}from"react";import{useContext as da,useEffect as ca,useState as ma}from"react";import ua from"swr";import{useContext as pa}from"react";function Be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=pa(Q);function r(c,f=!1){var y;return(y=e[c])!=null?y:f}function s(c,f){t(y=>_(w({},y),{[c]:f}))}function p(c){t(f=>{let S=f,{[c]:y}=S,T=Ie(S,[ii(c)]);return w({},T)})}function d(c){n.includes(c)||i(f=>[...f,c])}function l(c){return n.includes(c)}function m(c){return Object.entries(e).some(([f,y])=>y&&f!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import fa from"swr/immutable";import so from"core-js-pure/actual/structured-clone";function sr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xe(...e){let t=e.shift(),o=e.length===1?e[0]:xe(...e);if(!sr(t)||!sr(o))throw new Error("deepmerge can only merge Objects");let i=so(t);return Object.entries(o).forEach(([n,r])=>{sr(r)?i[n]!==void 0?Object.assign(i,{[n]:xe(i[n],so(r))}):Object.assign(i,{[n]:so(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...so(r)]}):Object.assign(i,{[n]:so(r)}):Object.assign(i,{[n]:r})}),i}var ga="unknown";function De(){let{config:e,apiUrl:t}=Je(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:p}=da(Q),{resetOpenFlowState:d}=Be(),[l,m]=ma(!1),c={data:r.map(h=>({flowId:h.id,flowState:Z,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=h=>fetch(h,e).then(b=>{if(b.ok)return b.json();throw new Error("Failed to fetch user flow states")}).catch(b=>(console.log(`Error fetching ${h}: ${b}. Will gracefully degrade and hide Frigade`),s(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:T,isLoading:S,mutate:g,error:E}=p?fa(y,f):ua(y,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),P=T==null?void 0:T.data;ca(()=>{!l&&!S&&P&&m(!0)},[P,l,S]);function F(h){return D(this,null,function*(){if(P&&!p){let b=P.find(N=>N.flowId===h);b&&b.flowState!==Z&&(b.flowState=Z),yield g(Promise.resolve(xe(T,{data:P})),{optimisticData:xe(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}function A(h,b,N){return D(this,null,function*(){if(P){let L=P.find(O=>O.flowId===h);L&&(L.stepStates[b]=N,L.flowState=Tt),yield g(Promise.resolve(xe(T,{data:P})),{optimisticData:xe(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}function I(h,b,N){return D(this,null,function*(){if(P){let L=P.find(O=>O.flowId===h);L&&(L.lastStepId=b,L.stepStates[b]=N,L.flowState=Tt),yield g(xe(T,{data:P}),{optimisticData:xe(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}function x(h){return D(this,null,function*(){if(P){let b=P.find(N=>N.flowId===h);b&&b.flowState!==Me&&(b.flowState=Me,b.lastStepId=ga,Object.keys(b.stepStates).forEach(N=>{b.stepStates[N].actionType=He,b.stepStates[N].createdAt=new Date().toISOString()}),yield g(xe(T,{data:P}),{optimisticData:xe(T,{data:P}),revalidate:!1,rollbackOnError:!1}),d(h))}})}function v(h,b){return D(this,null,function*(){if(P){let N=P.find(L=>L.flowId===h);N&&N.stepStates[b]!==He&&(N.stepStates[b]=He),yield g(xe(T,{data:P}),{optimisticData:xe(T,{data:P}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:P,isLoadingUserFlowStateData:!l,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:F,optimisticallyMarkFlowNotStarted:x,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:v,optimisticallyMarkStepStarted:I,error:E}}function lo(){let{config:e,apiUrl:t}=Je(),{userFlowStatesData:o,mutateUserFlowState:i}=De(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:p}=ha(Q),[d,l]=li(new Set),[m,c]=li(new Set),f=Wt();function y(g){let E=JSON.stringify(g);if(d.has(E))return null;d.add(E),l(d),m.add(g),c(m);let P=s==null?void 0:s.find(F=>F.flowSlug===g.flowSlug&&F.stepId===g.stepId&&F.actionType===g.actionType&&F.createdAt===g.createdAt);return f(`${t}flowResponses`,_(w({},e),{method:"POST",body:E})).then(F=>{F.status!==200&&F.status!==201?(console.log("Failed to send flow response for step "+g.stepId+". Will retry again later."),r([...n,g])):P||p(A=>[...A!=null?A:[],g])})}function T(g){return D(this,null,function*(){g.foreignUserId&&(g.actionType===Tt||g.actionType===Me?yield y(g):g.actionType===Z?yield y(g):g.actionType===Ao?yield y(g):g.actionType===Ke?yield y(g):g.actionType===Eo?yield y(g):g.actionType===He&&(yield y(g)))})}function S(){let g=[];return o==null||o.forEach(E=>{if(E&&E.stepStates&&Object.keys(E.stepStates).length!==0)for(let P in E.stepStates){let F=E.stepStates[P];g.push({foreignUserId:E.foreignUserId,flowSlug:E.flowId,stepId:F.stepId,actionType:F.actionType,data:{},createdAt:new Date(F.createdAt),blocked:F.blocked,hidden:F.hidden})}}),[...g,...s]}return{addResponse:T,setFlowResponses:p,getFlowResponses:S}}import ba from"swr";var xa=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ai=e=>{let t=xa.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=Ca(i,"'","");r.startsWith("flow_")&&(o=r)}),o},Ca=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function lr(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var ar=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(ar||{});function R(){let{config:e,apiUrl:t}=Je(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:f,readonly:y}=ya(Q),T={data:[]},{verifySDKInitiated:S}=zt(),{addResponse:g,getFlowResponses:E}=lo(),P=u=>fetch(u,e).then(C=>C.ok?C.json():(console.log(`Error fetching ${u} (${C.status}): ${C.statusText}. Will gracefully degrade and hide Frigade`),f(!0),T)).catch(C=>(console.log(`Error fetching ${u}: ${C}. Will gracefully degrade and hide Frigade`),f(!0),T)),{mutateUserFlowState:F,userFlowStatesData:A,isLoadingUserFlowStateData:I,optimisticallyMarkFlowCompleted:x,optimisticallyMarkFlowNotStarted:v,optimisticallyMarkStepCompleted:h,optimisticallyMarkStepNotStarted:b,optimisticallyMarkStepStarted:N}=De(),{data:L,error:O,isLoading:j}=ba(s?`${t}flows${y?"?readonly=true":""}`:null,P,{keepPreviousData:!0});Sa(()=>{if(O){console.error(O);return}L&&L.data&&i(L.data)},[L,O]);function M(u){if(j)return null;let C=o.find(k=>k.slug===u);return!C&&o.length>0&&!I&&!j?(console.log(`Flow with id ${u} not found`),null):(C==null?void 0:C.active)===!1&&!y?null:C}function G(u){var z,Fe;if(!M(u))return[];let C=M(u).data;return C?(C=le(C),((Fe=(z=lr(C))==null?void 0:z.data)!=null?Fe:[]).map(ge=>{let wt=J(ge);return _(w({handleSecondaryButtonClick:()=>{ge.skippable===!0&&V(u,ge.id,{skipped:!0})}},ge),{complete:ue(u,ge.id)===Ke||wt>=1,blocked:Oe(u,ge.id),hidden:Te(u,ge.id),handlePrimaryButtonClick:()=>{(!ge.completionCriteria&&(ge.autoMarkCompleted||ge.autoMarkCompleted===void 0)||ge.completionCriteria&&ge.autoMarkCompleted===!0)&&V(u,ge.id)},progress:wt})}).filter(ge=>ge.hidden!==!0)):[]}function le(u){return u.replaceAll(/\${(.*?)}/g,(C,k)=>p[k]===void 0?"":String(p[k]).replace(/[\u00A0-\u9999<>\&]/g,function(z){return"&#"+z.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function pe(u){var k;if(!M(u))return[];let C=M(u).data;return C?(C=le(C),(k=JSON.parse(C))!=null?k:{}):[]}function q(u,C){d(k=>_(w({},k),{[u]:C}))}function se(u){!I&&!j&&u&&JSON.stringify(p)!=JSON.stringify(w(w({},p),u))&&Object.keys(u).forEach(C=>{q(C,u[C])})}let de=Ft((u,C,k)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:C,actionType:Ao,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield N(u,C,z),g(z))}),[n,r,A]),Se=Ft((u,C,k)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:C,actionType:He,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield b(u,C),g(z))}),[n,r,A]),V=Ft((u,C,k)=>D(this,null,function*(){if(!S())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:C,actionType:Ke,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};X(z)&&(yield h(u,C,z),g(z))}),[n,r,A]),Y=Ft((u,C)=>D(this,null,function*(){if(!S()||fe(u)===Me)return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Me,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};yield v(u),X(k)&&g(k)}),[n,r,A]),ee=Ft((u,C)=>D(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Tt,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&g(k)}),[n,r,A]),Ve=Ft((u,C)=>D(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Z,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&(yield x(u),g(k))}),[n,r,A]),Le=Ft((u,C)=>D(this,null,function*(){if(!S())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Eo,data:C!=null?C:{},createdAt:new Date,blocked:!1,hidden:!1};X(k)&&(yield x(u),g(k))}),[n,r,A]);function X(u){var C;if(!A&&u.actionType===He)return!1;if(A){let k=A.find(z=>z.flowId===u.flowSlug);if(u.actionType===He&&(!(k!=null&&k.stepStates[u.stepId])||k.stepStates[u.stepId].actionType===He))return!1;if(k&&((C=k.stepStates[u.stepId])==null?void 0:C.actionType)===u.actionType){let z=Object.keys(k.stepStates).sort((Fe,ge)=>{let wt=new Date(k.stepStates[Fe].createdAt),vo=new Date(k.stepStates[ge].createdAt);return wt.getTime()-vo.getTime()});if(k.stepStates[z[z.length-1]].actionType===u.actionType)return!1}if(k&&k.flowState===Z&&u.actionType===Z)return!1}return!0}function ue(u,C){let k=U(u,C);return I?null:k?k.actionType:He}function Oe(u,C){let k=U(u,C);return k?k.blocked:!1}function Te(u,C){let k=U(u,C);return k?k.hidden:!1}function U(u,C){var z;if(I)return null;let k=A==null?void 0:A.find(Fe=>Fe.flowId===u);return!k||!k.stepStates[C]?null:(z=k.stepStates[C])!=null?z:null}function $(u){var k,z;if(I||!A)return null;if(fe(u)===Me)return(k=G(u)[0])!=null?k:null;let C=(z=A.find(Fe=>Fe.flowId===u))==null?void 0:z.lastStepId;return C?G(u).find(Fe=>Fe.id===C):null}function W(u){var z;let C=$(u);if(!C)return 0;let k=(z=G(u).findIndex(Fe=>Fe.id===C.id))!=null?z:0;return ue(u,C.id)===Ke&&k<G(u).length-1?k+1:k}function J(u){if(!u.completionCriteria)return;let C=ai(u.completionCriteria);if(C===null)return;let k=$e(C),z=Ge(C);return z===0?void 0:k/z}function fe(u){let C=A==null?void 0:A.find(k=>k.flowId===u);return C?C.flowState:null}function $e(u){let C=G(u);return C.length===0?0:C.filter(z=>ue(u,z.id)===Ke).length}function Ge(u){return G(u).length}function Xe(u){let C=o.find(k=>k.slug===u);return C?lr(C.data):null}function St(u){if(y)return!1;if(I)return!0;if(u!=null&&u.targetingLogic&&A){let C=A.find(k=>k.flowId===u.slug);if(C)return C.shouldTrigger===!1}return!!(u!=null&&u.targetingLogic&&n&&n.startsWith("guest_"))}function Mt(u){return!St(M(u))}function Dt(){n&&F()}function bt(){return o}return{getAllFlows:bt,getFlow:M,getFlowData:Xe,isLoading:I||j,getStepStatus:ue,getFlowSteps:G,getCurrentStepIndex:W,markStepStarted:de,markStepCompleted:V,markFlowNotStarted:Y,markFlowStarted:ee,markFlowCompleted:Ve,markFlowAborted:Le,markStepNotStarted:Se,getFlowStatus:fe,getNumberOfStepsCompleted:$e,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:St,setCustomVariable:q,updateCustomVariables:se,customVariables:p,getStepOptionalProgress:J,getFlowMetadata:pe,isStepBlocked:Oe,isStepHidden:Te,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Mt,refresh:Dt}}import{useCallback as pr,useContext as wa,useEffect as Ta}from"react";var _t="guest_";function ao(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=wa(Q),{config:r,apiUrl:s}=Je(),{mutateUserFlowState:p}=De(),d=Wt(),{verifySDKInitiated:l}=zt();function m(T){return`frigade-user-registered-${T}`}Ta(()=>{if(e&&!t){if(e.startsWith(_t))return;let T=m(e);localStorage.getItem(T)||(d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(T,"true"))}},[e,n,t]);let c=pr(T=>D(this,null,function*(){if(!l())return;let S={foreignId:e,properties:T};yield d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify(S)})),i(g=>w(w({},g),T)),p()}),[e,r,n,p]),f=pr((T,S)=>D(this,null,function*(){if(!l())return;let E={foreignId:e,events:[{event:T,properties:S}]};yield d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify(E)})),p()}),[e,r,p]),y=pr((T,S)=>D(this,null,function*(){if(l())if(S){let g=m(T);localStorage.setItem(g,"true"),o(T);let E={foreignId:T,properties:S};yield d(`${s}users`,_(w({},r),{method:"POST",body:JSON.stringify(E)})),i(P=>w(w({},P),S)),p()}else o(T)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:f}}import{v4 as Yp}from"uuid";import et,{useEffect as mn,useState as un}from"react";import qe,{useEffect as ur,useState as Ia}from"react";import Lo from"styled-components";import Fa from"react";import ka from"styled-components";var pi="fr-",po="cfr-";function a(e,t){let o=`${pi}${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+" "+po+e}return o}function B(e){if(!e.className||e.className.indexOf(po)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(pi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Oo(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=>`${Oo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function be(...e){return e.filter(Boolean).join(" ")}function co(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Pa=ka.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,di=({onClose:e,appearance:t})=>Fa.createElement(Pa,{className:a("modalBackground",t),onClick:()=>e()});import
|
|
26
|
+
`,di=({onClose:e,appearance:t})=>Fa.createElement(Pa,{className:a("modalBackground",t),onClick:()=>e()});import dr from"react";import va from"styled-components";var Ba=va.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
30
|
+
`,Ee=()=>dr.createElement(Ba,null,dr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},dr.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Na}from"react-portal";import Ti from"react";import cr from"react";function Ea({style:e,className:t}){return cr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},cr.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"}),cr.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 ci=Ea;import mr from"styled-components";import rt from"styled-components";var Io=rt.div`
|
|
31
31
|
${e=>B(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
@@ -110,7 +110,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
110
110
|
color: #808080;
|
|
111
111
|
}
|
|
112
112
|
margin: 0;
|
|
113
|
-
`;var Si=
|
|
113
|
+
`;var Si=mr.div`
|
|
114
114
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
115
115
|
position: absolute;
|
|
116
116
|
bottom: -47px;
|
|
@@ -121,7 +121,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
121
121
|
align-items: center;
|
|
122
122
|
justify-content: center;
|
|
123
123
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
124
|
-
`,bi=
|
|
124
|
+
`,bi=mr(Io)`
|
|
125
125
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
126
126
|
position: absolute;
|
|
127
127
|
bottom: -60px;
|
|
@@ -134,7 +134,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
134
134
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
135
135
|
padding: 0;
|
|
136
136
|
z-index: ${e=>e.zIndex};
|
|
137
|
-
`,wi=
|
|
137
|
+
`,wi=mr.div`
|
|
138
138
|
display: flex;
|
|
139
139
|
justify-content: center;
|
|
140
140
|
align-items: center;
|
|
@@ -143,7 +143,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
143
143
|
font-size: 12px;
|
|
144
144
|
line-height: 18px;
|
|
145
145
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
146
|
-
`;function
|
|
146
|
+
`;function No({appearance:e}){return Ti.createElement(wi,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Ti.createElement(ci,null))}var La=Lo.div`
|
|
147
147
|
${e=>B(e)} {
|
|
148
148
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
149
149
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -158,7 +158,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
158
158
|
width: ${e=>{var t;return(t=e.width)!=null?t:"1000px"}};
|
|
159
159
|
z-index: 1500;
|
|
160
160
|
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=>
|
|
161
|
+
${e=>ke(e)}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
padding: 32px;
|
|
@@ -185,10 +185,10 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
185
185
|
opacity: 1;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`,$a=
|
|
188
|
+
`,$a=Lo.div`
|
|
189
189
|
position: relative;
|
|
190
190
|
flex: 0 1 auto;
|
|
191
|
-
`,Ma=
|
|
191
|
+
`,Ma=Lo.div`
|
|
192
192
|
position: absolute;
|
|
193
193
|
top: 16px;
|
|
194
194
|
right: 16px;
|
|
@@ -198,14 +198,14 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
198
198
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
199
199
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
200
200
|
}
|
|
201
|
-
`,Da=
|
|
201
|
+
`,Da=Lo.div`
|
|
202
202
|
overflow: scroll;
|
|
203
203
|
flex: 1 1;
|
|
204
204
|
display: flex;
|
|
205
205
|
::-webkit-scrollbar {
|
|
206
206
|
display: none;
|
|
207
207
|
}
|
|
208
|
-
`,Qe=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[d,l]=Ia("");return
|
|
208
|
+
`,Qe=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[d,l]=Ia("");return ur(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");l(m)},[]),ur(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),ur(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?qe.createElement(Na,null,qe.createElement(di,{appearance:r,onClose:()=>{s&&e()}}),qe.createElement(La,{appearance:r,className:a("modalContainer",r),styleOverrides:i},s&&qe.createElement(Ma,{className:a("modalClose",r),onClick:()=>e(),appearance:r},qe.createElement(Ee,null)),o&&qe.createElement($a,null,o),qe.createElement(Da,null,n),p&&qe.createElement(Si,{appearance:r,className:a("poweredByFrigadeRibbon",r)},qe.createElement(No,{appearance:r})))):qe.createElement(qe.Fragment,null)};import ut,{useEffect as fr,useState as Ua}from"react";import $o from"styled-components";import{Portal as Wa}from"react-portal";function za(e){switch(e){case"top-left":return`
|
|
209
209
|
top: 0;
|
|
210
210
|
left: 0;
|
|
211
211
|
`;case"top-right":return`
|
|
@@ -214,7 +214,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
214
214
|
`;case"bottom-left":return`
|
|
215
215
|
bottom: 0;
|
|
216
216
|
left: 0;
|
|
217
|
-
`}return"right: 0; bottom: 0;"}var _a
|
|
217
|
+
`}return"right: 0; bottom: 0;"}var _a=$o.div`
|
|
218
218
|
${e=>B(e)} {
|
|
219
219
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
220
220
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -230,10 +230,10 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
230
230
|
}
|
|
231
231
|
${e=>za(e.modalPosition)}
|
|
232
232
|
margin: 28px;
|
|
233
|
-
`,Ha
|
|
233
|
+
`,Ha=$o.div`
|
|
234
234
|
position: relative;
|
|
235
235
|
flex: 1;
|
|
236
|
-
`,ja
|
|
236
|
+
`,ja=$o.div`
|
|
237
237
|
position: absolute;
|
|
238
238
|
top: 16px;
|
|
239
239
|
right: 16px;
|
|
@@ -243,13 +243,13 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
243
243
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
244
244
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
245
245
|
}
|
|
246
|
-
`,Va
|
|
246
|
+
`,Va=$o.div`
|
|
247
247
|
overflow: scroll;
|
|
248
248
|
flex: 5;
|
|
249
249
|
::-webkit-scrollbar {
|
|
250
250
|
display: none;
|
|
251
251
|
}
|
|
252
|
-
|
|
252
|
+
`,Mo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:s=!0})=>{let[p,d]=Ua("");return fr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");d(l)},[]),fr(()=>{let l=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),fr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?ut.createElement(Wa,null,ut.createElement(_a,{appearance:n,className:a("cornerModalContainer",n),modalPosition:r},s&&ut.createElement(ja,{className:a("cornerModalClose",n),onClick:()=>e()},ut.createElement(Ee,null)),o&&ut.createElement(Ha,null,o),ut.createElement(Va,null,i))):ut.createElement(ut.Fragment,null)};import{useContext as Ga}from"react";function te(){let{defaultAppearance:e}=Ga(Q);function t(o){var n,r,s;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,(s=o.theme)!=null?s:{})}:i}return{mergeAppearanceWithDefault:t}}import kt,{useContext as up,useEffect as zi,useState as Fr}from"react";import _o from"styled-components";import Wo,{useEffect as Ei,useState as xr}from"react";import Cr from"styled-components";import Do from"styled-components";var Fi=Do.label`
|
|
253
253
|
${e=>B(e)} {
|
|
254
254
|
font-size: 12px;
|
|
255
255
|
line-height: 18px;
|
|
@@ -260,14 +260,14 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
260
260
|
letter-spacing: 0.24px;
|
|
261
261
|
}
|
|
262
262
|
display: flex;
|
|
263
|
-
`,ki=
|
|
263
|
+
`,ki=Do.label`
|
|
264
264
|
${e=>B(e)} {
|
|
265
265
|
font-size: 12px;
|
|
266
266
|
line-height: 20px;
|
|
267
267
|
margin-bottom: 5px;
|
|
268
268
|
}
|
|
269
269
|
display: flex;
|
|
270
|
-
`,Pi=
|
|
270
|
+
`,Pi=Do.span`
|
|
271
271
|
font-weight: 400;
|
|
272
272
|
font-size: 14px;
|
|
273
273
|
line-height: 22px;
|
|
@@ -275,16 +275,16 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
275
275
|
display: flex;
|
|
276
276
|
margin-right: 5px;
|
|
277
277
|
margin-top: 10px;
|
|
278
|
-
`,Do
|
|
278
|
+
`,Uo=Do.div`
|
|
279
279
|
display: flex;
|
|
280
280
|
align-items: flex-start;
|
|
281
281
|
justify-content: left;
|
|
282
282
|
margin-bottom: 10px;
|
|
283
|
-
`;import
|
|
283
|
+
`;import gr from"react";var it={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 ft({title:e,required:t,appearance:o=it}){return e?gr.createElement(Uo,{className:a("formLabelWrapper",o)},t?gr.createElement(Pi,{className:a("formLabelRequired",o),appearance:o},"*"):null,gr.createElement(Fi,{className:a("formLabel",o)},e)):null}import vi from"react";function Ht({title:e,appearance:t}){return e?vi.createElement(Uo,null,vi.createElement(ki,{className:a("formSubLabel",t)},e)):null}import{z as hr}from"zod";function Bi(e,t){var o,i,n,r,s,p,d;try{if(t){if(t.type=="number"){let l=hr.number();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(o=m.message)!=null?o:"Value is too small"):m.requirement=="max"?l=l.max(Number(m.value),(i=m.message)!=null?i:"Value is too large"):m.requirement=="positive"?l=l.positive((n=m.message)!=null?n:"Value must be positive"):m.requirement=="negative"&&(l=l.nonpositive((r=m.message)!=null?r:"Value must be negative"));l.parse(Number(e))}if(t.type=="string"){let l=hr.string();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(s=m.message)!=null?s:"Value is too short"):m.requirement=="max"?l=l.max(Number(m.value),(p=m.message)!=null?p:"Value is too long"):m.requirement=="regex"&&(l=l.regex(new RegExp(String(m.value)),(d=m.message)!=null?d:"Value does not match requirements"));l.parse(e)}return}}catch(l){if(l instanceof hr.ZodError)return l.issues&&l.issues.length>0?l.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,l)}return null}var Ka=Cr.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex-direction: column;
|
|
286
286
|
width: 100%;
|
|
287
|
-
`,Cr
|
|
287
|
+
`,yr=Cr.input`
|
|
288
288
|
${e=>B(e)} {
|
|
289
289
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
290
290
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -300,7 +300,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
300
300
|
box-sizing: border-box;
|
|
301
301
|
padding: 0 10px;
|
|
302
302
|
margin-bottom: 10px;
|
|
303
|
-
`,qa=
|
|
303
|
+
`,qa=Cr.textarea`
|
|
304
304
|
${e=>B(e)} {
|
|
305
305
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
306
306
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -317,7 +317,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
317
317
|
box-sizing: border-box;
|
|
318
318
|
margin-bottom: 10px;
|
|
319
319
|
resize: none;
|
|
320
|
-
`;function
|
|
320
|
+
`;function Sr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[s,p]=xr((n==null?void 0:n.text)||""),[d,l]=xr(!1),[m,c]=xr(!1),f=yr;Ei(()=>{s===""&&!d&&(l(!0),y(""))},[]),Ei(()=>{if(m){y(s);return}},[m]);function y(S){var E;if(p(S),o({text:S}),r.required===!0&&S.trim()===""){i([{id:r.id,message:`${(E=r.title)!=null?E:"Field"} is required`,hidden:!m}]);return}let g=Bi(S,r.validation);if(g&&(S.trim()!==""||r.required===!0)){i([{id:r.id,message:g,hidden:!m}]);return}i([])}r.multiline&&(f=qa);function T(){var S;switch((S=r==null?void 0:r.validation)==null?void 0:S.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return Wo.createElement(Ka,null,Wo.createElement(ft,{title:r.title,required:r.required,appearance:t.appearance}),Wo.createElement(f,{className:a("inputComponent",t.appearance),value:s,onChange:S=>{y(S.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:T(),onBlur:()=>{c(!0)}}),Wo.createElement(Ht,{title:r.subtitle,appearance:t.appearance}))}import Ze,{useEffect as Ai,useState as Oi}from"react";import Ii from"styled-components";var br="",Ya=Ii.div`
|
|
321
321
|
display: flex;
|
|
322
322
|
flex-direction: column;
|
|
323
323
|
width: 100%;
|
|
@@ -344,9 +344,9 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
344
344
|
background-repeat: no-repeat;
|
|
345
345
|
background-size: 1.5em 1.5em;
|
|
346
346
|
-webkit-print-color-adjust: exact;
|
|
347
|
-
`;function Ni({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,f,y,T,S,g,E,
|
|
348
|
-
${e=>
|
|
349
|
-
`,nt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=it,style:r,className:s})=>{let p=np(t),d=sp(t,e);return e===!0?p=_(w(w({},p),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=w(w({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?
|
|
347
|
+
`;function Ni({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,f,y,T,S,g,E,P;let r=e,[s,p]=Oi(!1),[d,l]=Oi(!1);return Ai(()=>{var F,A,I,x;if(!((F=i==null?void 0:i.choice)!=null&&F[0])&&!s){if(p(!0),r.requireSelection){o({choice:[br]});return}if(r.defaultValue&&((A=r.props.options)!=null&&A.find(v=>v.id===r.defaultValue))){let v=(I=r.props.options)==null?void 0:I.find(h=>h.id===r.defaultValue);o({choice:[v.id]})}else o({choice:[((x=r.props.options)==null?void 0:x[0].id)||""]})}},[]),Ai(()=>{var F;d&&(r.requireSelection&&((F=i==null?void 0:i.choice)==null?void 0:F[0])===br?n([{message:"Please select an option",id:r.id}]):n([]))},[(m=i==null?void 0:i.choice)==null?void 0:m[0],d]),Ze.createElement(Ya,null,Ze.createElement(ft,{title:r.title,required:!1,appearance:t.appearance}),Ze.createElement(Xa,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:F=>{l(!0),o({choice:[F.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&Ze.createElement("option",{key:"null-value",value:br,disabled:!0},(f=r.placeholder)!=null?f:"Select an option"),(y=r.props.options)==null?void 0:y.map(F=>Ze.createElement("option",{key:F.id,value:F.id},F.title))),((S=(T=r.props.options)==null?void 0:T.find(F=>{var A;return F.id===((A=i==null?void 0:i.choice)==null?void 0:A[0])}))==null?void 0:S.isOpenEnded)&&Ze.createElement(Ze.Fragment,null,Ze.createElement(ft,{title:(P=(E=(g=r.props.options)==null?void 0:g.find(F=>{var A;return F.id===((A=i==null?void 0:i.choice)==null?void 0:A[0])}))==null?void 0:E.openEndedLabel)!=null?P:"Please specify",required:!1,appearance:t.appearance}),Ze.createElement(yr,{type:"text",placeholder:"Enter your answer here",onChange:F=>{o({choice:[F.target.value]})},appearance:t.appearance})),Ze.createElement(Ht,{title:r.subtitle,appearance:t.appearance}))}import fo,{useEffect as wr,useState as $i}from"react";import Mi from"styled-components";import uo from"react";import mo from"react";var Li=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return mo.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Ja=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:s})=>mo.createElement("svg",{style:s,className:r,width:t,height:t,overflow:"visible"},mo.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},mo.createElement(Li,{color:n,size:t}),mo.createElement(Li,{color:e,percentage:Math.max(o,.1),size:t})),i),jt=Ja;import Qa from"styled-components";var Za=({color:e="#FFFFFF"})=>uo.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},uo.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Ra={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ep={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},tp={border:"1px solid #000000",color:"#FFFFFF"},op={border:"1px solid #C5CBD3"},rp={color:"#FFFFFF"},ip={border:"1px solid #C5CBD3"},np=e=>e==="square"?Ra:ep,sp=(e,t)=>e==="square"?t?tp:op:t?rp:ip,lp=Qa.div`
|
|
348
|
+
${e=>ke(e)}
|
|
349
|
+
`,nt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=it,style:r,className:s})=>{let p=np(t),d=sp(t,e);return e===!0?p=_(w(w({},p),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=w(w({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?uo.createElement(jt,{fillColor:o,percentage:i,size:22}):uo.createElement(lp,{styleOverrides:p,style:r,role:"checkbox",className:be(a("checkIconContainer",n),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&uo.createElement(Za,{color:"#FFFFFF"}))};var ap=Mi.div`
|
|
350
350
|
display: flex;
|
|
351
351
|
flex-direction: column;
|
|
352
352
|
width: 100%;
|
|
@@ -377,7 +377,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
377
377
|
height: 48px;
|
|
378
378
|
padding: 0 18px;
|
|
379
379
|
margin-bottom: 10px;
|
|
380
|
-
`;function Di({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[s,p]=$i((i==null?void 0:i.choice)||[]),[d,l]=$i(!1);return
|
|
380
|
+
`;function Di({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[s,p]=$i((i==null?void 0:i.choice)||[]),[d,l]=$i(!1);return wr(()=>{s.length==0&&!d&&(l(!0),o({choice:[]}))},[]),wr(()=>{o({choice:s})},[s]),wr(()=>{r.required&&(s.length<r.props.minChoices||s.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[s]),fo.createElement(ap,null,fo.createElement(ft,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>fo.createElement(pp,{appearance:t.appearance,className:a(s.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":s.includes(c.id),onClick:()=>{if(s.includes(c.id)){p(s.filter(f=>f!==c.id));return}s.length<r.props.maxChoices?p([...s,c.id]):s.length==1&&r.props.maxChoices==1&&p([c.id])}},c.title,fo.createElement(nt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),fo.createElement(Ht,{title:r.subtitle,appearance:t.appearance}))}import zo from"react";import Ui from"styled-components";import dp from"dompurify";function ce(e){return{__html:dp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var cp=Ui.h1`
|
|
381
381
|
${e=>B(e)} {
|
|
382
382
|
font-style: normal;
|
|
383
383
|
font-weight: 700;
|
|
@@ -398,38 +398,38 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
398
398
|
letter-spacing: 0.28px;
|
|
399
399
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
400
400
|
}
|
|
401
|
-
`;function
|
|
401
|
+
`;function Ae({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n=""}){return zo.createElement(zo.Fragment,null,zo.createElement(cp,{appearance:e,className:a(`${n}${n?co(i):i}Title`,e),dangerouslySetInnerHTML:ce(t),size:i}),o&&zo.createElement(mp,{appearance:e,className:a(`${n}${n?co(i):i}Subtitle`,e),dangerouslySetInnerHTML:ce(o),size:i}))}import*as Tr from"react";var Wi=e=>Tr.createElement("svg",w({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Tr.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 fp=_o.div`
|
|
402
402
|
display: flex;
|
|
403
403
|
flex-direction: column;
|
|
404
404
|
justify-content: flex-end;
|
|
405
405
|
overflow: visible;
|
|
406
406
|
padding-top: 14px;
|
|
407
|
-
`,gp=
|
|
407
|
+
`,gp=_o.div`
|
|
408
408
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
409
409
|
font-size: 12px;
|
|
410
410
|
margin-bottom: 12px;
|
|
411
411
|
display: flex;
|
|
412
412
|
align-items: center;
|
|
413
|
-
`,hp=
|
|
413
|
+
`,hp=_o.div`
|
|
414
414
|
margin-right: 4px;
|
|
415
415
|
display: inline-flex;
|
|
416
|
-
`,xp=
|
|
416
|
+
`,xp=_o.div`
|
|
417
417
|
padding-left: 1px;
|
|
418
418
|
padding-right: 1px;
|
|
419
|
-
`,Cp={text:
|
|
419
|
+
`,Cp={text:Sr,multipleChoice:Ni,multipleChoiceList:Di},kr="frigade-multiInputStepTypeData";function _i({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:s,prefillData:p}){var I;let d=t.props,[l,m]=Fr([]),[c,f]=Fr([]),{userId:y}=ao(),[T,S]=Fr(F()||(p?p[t.id]:null)||{}),{readonly:g}=up(Q),E=w(w({},Cp),s);zi(()=>{i(l.length===0)},[l,i]),zi(()=>{n(T)},[T]);function P(x,v){S(h=>{let b=_(w({},h),{[x.id]:v});return typeof window!="undefined"&&window.localStorage&&!g&&window.localStorage.setItem(A(),JSON.stringify(b)),b})}function F(){if(typeof window!="undefined"&&window.localStorage){let x=window.localStorage.getItem(A());if(x)return JSON.parse(x)}return null}function A(){return`${kr}-${e}-${t.id}-${y}`}return kt.createElement(xp,{className:a("multiInput",r)},kt.createElement(Ae,{appearance:r,title:t.title,subtitle:t.subtitle}),kt.createElement(fp,{className:a("multiInputContainer",r)},(I=d==null?void 0:d.data)==null?void 0:I.map(x=>{let v=l.reverse().find(h=>h.id===x.id);return E[x.type]?kt.createElement("span",{key:x.id,"data-field-id":x.id,className:a("multiInputField",r)},E[x.type]({formInput:x,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:h=>{!c.includes(x.id)&&h&&(h==null?void 0:h.text)!==""&&f(b=>[...b,x.id]),P(x,h)},inputData:T[x.id],setFormValidationErrors:h=>{h.length===0&&l.length===0||m(b=>h.length===0?b.filter(N=>N.id!==x.id):[...b,...h])}}),v&&v.message&&c.includes(x.id)&&v.hidden!==!0&&kt.createElement(gp,{key:x.id,style:{overflow:"hidden"},appearance:r,className:a("multiInputValidationError",r)},kt.createElement(hp,{appearance:r,className:a("multiInputValidationErrorIcon",r)},kt.createElement(Wi,null)),v.message)):null})))}import Vt from"styled-components";var Hi=Vt.div`
|
|
420
420
|
align-items: center;
|
|
421
421
|
display: flex;
|
|
422
422
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
423
423
|
padding-top: 14px;
|
|
424
|
-
`,ji=
|
|
424
|
+
`,ji=Vt.div`
|
|
425
425
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
426
426
|
font-size: 12px;
|
|
427
|
-
`,Vi=
|
|
427
|
+
`,Vi=Vt.div`
|
|
428
428
|
display: flex;
|
|
429
429
|
gap: 12px;
|
|
430
430
|
width: 100%;
|
|
431
431
|
justify-content: flex-end;
|
|
432
|
-
`,Gi=
|
|
432
|
+
`,Gi=Vt.div`
|
|
433
433
|
display: flex;
|
|
434
434
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
435
435
|
// Otherwise, use 4px padding
|
|
@@ -437,11 +437,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
437
437
|
flex-grow: 1;
|
|
438
438
|
flex-basis: 0;
|
|
439
439
|
position: relative;
|
|
440
|
-
`,Ki=
|
|
440
|
+
`,Ki=Vt.div`
|
|
441
441
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
442
442
|
position: relative;
|
|
443
443
|
overflow-y: auto;
|
|
444
|
-
`,qi=
|
|
444
|
+
`,qi=Vt.div`
|
|
445
445
|
display: flex;
|
|
446
446
|
align-self: stretch;
|
|
447
447
|
flex-grow: 1;
|
|
@@ -490,7 +490,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
490
490
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
491
491
|
line-height: 20px;
|
|
492
492
|
font-weight: 500;
|
|
493
|
-
${e=>
|
|
493
|
+
${e=>ke(e)}
|
|
494
494
|
}
|
|
495
495
|
|
|
496
496
|
font-family: inherit;
|
|
@@ -504,7 +504,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
504
504
|
opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
|
|
505
505
|
cursor: not-allowed;
|
|
506
506
|
}
|
|
507
|
-
`,
|
|
507
|
+
`,Ho=Ji.div`
|
|
508
508
|
${e=>B(e)} {
|
|
509
509
|
display: flex;
|
|
510
510
|
flex-direction: row;
|
|
@@ -515,14 +515,14 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
515
515
|
margin-right: 8px;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
`,oe=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:l="",loading:m=!1})=>{var f;function c(){let y=s?"buttonSecondary":"button";return l===""?y:`${l}${
|
|
518
|
+
`,oe=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:l="",loading:m=!1})=>{var f;function c(){let y=s?"buttonSecondary":"button";return l===""?y:`${l}${co(y)}`}return Xi.createElement(Sp,{secondary:s,appearance:p,disabled:i||m,loading:(f=m==null?void 0:m.toString())!=null?f:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:a(c(),p)},m?Xi.createElement(Yi,{className:a("buttonLoader",p)}):t!=null?t:"Continue")};var Qi=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:s,onBack:p,allowBackNavigation:d,errorMessage:l,isSaving:m})=>{var y;let c=s.length>1&&r!=0&&d,f=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return gt.createElement(gt.Fragment,null,l!==null&&l!=null&>.createElement(ji,{appearance:o,className:a("formCTAError",o)},l),gt.createElement(Hi,{showBackButton:c,className:a("formCTAContainer",o)},c&>.createElement(oe,{title:(y=e.backButtonTitle)!=null?y:"Back",onClick:p,secondary:!0,withMargin:!1,type:f,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),gt.createElement(Vi,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?gt.createElement(oe,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:f,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?gt.createElement(oe,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:f,appearance:o,loading:m}):null)))};import Pr from"react";import bp from"styled-components";var wp=bp.div`
|
|
519
519
|
text-align: center;
|
|
520
|
-
`,Zi=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=te().mergeAppearanceWithDefault(i);return
|
|
520
|
+
`,Zi=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=te().mergeAppearanceWithDefault(i);return Pr.createElement(wp,{className:o},Pr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,s)=>Pr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?n.colorPrimary:"#E6E6E6"}))))};import Pt from"react";import Gt from"styled-components";import{useContext as Tp}from"react";function ae(){let e=Tp(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 s=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(s="_self"),e.navigate(n,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Fp=Gt.div`
|
|
521
521
|
display: flex;
|
|
522
522
|
flex-wrap: wrap;
|
|
523
523
|
align-content: center;
|
|
524
524
|
justify-content: center;
|
|
525
|
-
`,kp=
|
|
525
|
+
`,kp=Gt.div`
|
|
526
526
|
align-content: center;
|
|
527
527
|
align-items: center;
|
|
528
528
|
display: flex;
|
|
@@ -536,10 +536,10 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
536
536
|
flex-basis: 255px;
|
|
537
537
|
flex-grow: 0;
|
|
538
538
|
flex-shrink: 0;
|
|
539
|
-
`,Pp=
|
|
539
|
+
`,Pp=Gt.img`
|
|
540
540
|
width: 78px;
|
|
541
541
|
height: auto;
|
|
542
|
-
`,vp=
|
|
542
|
+
`,vp=Gt.button`
|
|
543
543
|
font-style: normal;
|
|
544
544
|
font-weight: 600;
|
|
545
545
|
font-size: 13px;
|
|
@@ -552,11 +552,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
552
552
|
border-radius: 100px;
|
|
553
553
|
padding: 8px 12px;
|
|
554
554
|
margin-top: 16px;
|
|
555
|
-
`,Bp=
|
|
555
|
+
`,Bp=Gt.h1`
|
|
556
556
|
font-weight: 700;
|
|
557
557
|
font-size: 28px;
|
|
558
558
|
line-height: 34px;
|
|
559
|
-
`,Ep=
|
|
559
|
+
`,Ep=Gt.h2`
|
|
560
560
|
font-style: normal;
|
|
561
561
|
font-weight: 400;
|
|
562
562
|
font-size: 16px;
|
|
@@ -565,7 +565,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
565
565
|
margin-top: 12px;
|
|
566
566
|
margin-bottom: 16px;
|
|
567
567
|
max-width: 70%;
|
|
568
|
-
`;function Ri({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=ae();return
|
|
568
|
+
`;function Ri({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=ae();return Pt.createElement("div",null,Pt.createElement(Bp,null,e.title),Pt.createElement(Ep,null,e.subtitle),Pt.createElement(Fp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>Pt.createElement(kp,{key:r.title},Pt.createElement(Pp,{src:r.imageUri}),Pt.createElement(vp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var s;r.uri&&o(r.uri,(s=r.uriTarget)!=null?s:"_blank")}},r.title)))))}import qt,{useEffect as Dp}from"react";import Vo from"styled-components";import vr from"react";var jo=({style:e,className:t})=>vr.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},vr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),vr.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 Kt,{useRef as Ap,useState as Op}from"react";import go from"styled-components";var Ip=go.div`
|
|
569
569
|
display: flex;
|
|
570
570
|
align-items: center;
|
|
571
571
|
justify-content: flex-start;
|
|
@@ -573,7 +573,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
573
573
|
width: 100%;
|
|
574
574
|
height: 100%;
|
|
575
575
|
position: relative;
|
|
576
|
-
`,Np=
|
|
576
|
+
`,Np=go.div`
|
|
577
577
|
position: absolute;
|
|
578
578
|
display: flex;
|
|
579
579
|
align-items: center;
|
|
@@ -592,45 +592,45 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
592
592
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
593
593
|
border-radius: 50%;
|
|
594
594
|
}
|
|
595
|
-
`,Lp=
|
|
595
|
+
`,Lp=go.video`
|
|
596
596
|
width: 100%;
|
|
597
597
|
height: 100%;
|
|
598
598
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
599
|
-
`,$p=
|
|
599
|
+
`,$p=go.iframe`
|
|
600
600
|
width: 100%;
|
|
601
601
|
height: 100%;
|
|
602
602
|
min-height: 260px;
|
|
603
603
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
604
|
-
`,Mp=
|
|
604
|
+
`,Mp=go.iframe`
|
|
605
605
|
width: 100%;
|
|
606
606
|
height: 100%;
|
|
607
607
|
min-height: 400px;
|
|
608
608
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
609
|
-
}`;function Re({appearance:e,videoUri:t}){let o=Ap(),[i,n]=Op(!1);if(t.includes("youtube")){let r=t.split("v=")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),
|
|
609
|
+
}`;function Re({appearance:e,videoUri:t}){let o=Ap(),[i,n]=Op(!1);if(t.includes("youtube")){let r=t.split("v=")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),Kt.createElement($p,{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],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),Kt.createElement(Mp,{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)})}return Kt.createElement(Ip,{className:a("videoPlayerWrapper",e),appearance:e},!i&&Kt.createElement(Np,{onClick:()=>{n(!0),o.current.play()},appearance:e},Kt.createElement(jo,null)),Kt.createElement(Lp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Up=Vo.div`
|
|
610
610
|
${e=>B(e)} {
|
|
611
611
|
display: flex;
|
|
612
612
|
flex-direction: column;
|
|
613
613
|
justify-content: center;
|
|
614
614
|
}
|
|
615
|
-
`,Wp=
|
|
615
|
+
`,Wp=Vo.img`
|
|
616
616
|
${e=>B(e)} {
|
|
617
617
|
width: 100%;
|
|
618
618
|
height: auto;
|
|
619
619
|
max-height: 250px;
|
|
620
620
|
margin-bottom: 24px;
|
|
621
621
|
}
|
|
622
|
-
`,zp=
|
|
622
|
+
`,zp=Vo.div`
|
|
623
623
|
${e=>B(e)} {
|
|
624
624
|
margin-bottom: 24px;
|
|
625
625
|
}
|
|
626
|
-
`,_p=
|
|
626
|
+
`,_p=Vo.div`
|
|
627
627
|
${e=>B(e)} {
|
|
628
628
|
width: 100%;
|
|
629
629
|
height: auto;
|
|
630
630
|
max-height: 250px;
|
|
631
631
|
margin-bottom: 24px;
|
|
632
632
|
}
|
|
633
|
-
`;function en({stepData:e,appearance:t,setCanContinue:o}){return Dp(()=>{o(!0)},[]),
|
|
633
|
+
`;function en({stepData:e,appearance:t,setCanContinue:o}){return Dp(()=>{o(!0)},[]),qt.createElement(Up,{className:a("callToActionContainer",t)},qt.createElement(zp,{className:a("callToActionTextContainer",t)},qt.createElement(Ae,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&qt.createElement(Wp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&qt.createElement(_p,{appearance:t,className:a("callToActionVideo",t)},qt.createElement(Re,{appearance:t,videoUri:e.videoUri})))}import st,{useEffect as Br,useState as Er}from"react";import ht from"styled-components";var tn=ht.div`
|
|
634
634
|
width: auto;
|
|
635
635
|
display: flex;
|
|
636
636
|
flex-direction: column;
|
|
@@ -683,8 +683,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
683
683
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
684
684
|
display: flex;
|
|
685
685
|
align-self: center;
|
|
686
|
-
`;var dn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,s]=
|
|
687
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,p])=>`${Ao(s)}: ${p};`).join(" ")} }`:`${Ao(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ie({appearance:e}){if(!e||!e.styleOverrides)return Co.createElement(Co.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?Co.createElement(Co.Fragment,null):Co.createElement(Vp,{inlineStyles:t})}var fn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:m,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:y=!1,modalPosition:T="center",repeatable:S=!1,onDismiss:g,showPagination:E=!1,allowBackNavigation:k=!1,validationHandler:F,showFrigadeBranding:A=!1,onFormDataChange:I,showFooter:x=!0,prefillData:v={},updateUrlOnPageChange:h=!1})=>{var $;let{getFlow:b,getFlowSteps:N,isLoading:L,targetingLogicShouldHideFlow:O,getFlowStatus:j,getCurrentStepIndex:M,markFlowCompleted:G,markFlowNotStarted:le,markStepStarted:pe}=R(),q=M(e),{mergeAppearanceWithDefault:se}=te(),[de,Se]=un(!1),[V,Y]=un(""),{setOpenFlowState:ee,getOpenFlowState:Ve,hasOpenModals:Le}=ve(),X=N(e);d=se(d);let[ue,Ae]=i!==void 0&&n!==void 0?[i,n]:[Ve(e,!0),W=>ee(e,W)];if(mn(()=>{!de&&!L&&(Se(!0),(j(e)===Z&&S||j(e)===Me)&&(j(e)===Z&&S&&le(e),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(J=>{J.startsWith(Fr)&&window.localStorage.removeItem(J)})),Se(!0))},[de,Se,L]),mn(()=>{var J;let W=(J=window==null?void 0:window.location)!=null&&J.hash?window.location.hash.replace("#",""):"";if(W!=V&&X&&(X==null?void 0:X.length)>0){let fe=-1;if(W){let $e=W;fe=X.findIndex(Ge=>Ge.id===$e),V===W&&(fe=-1),Y(W)}else fe=0,Y("");fe!==-1&&pe(e,X[fe].id)}},[X,($=window==null?void 0:window.location)==null?void 0:$.hash]),L)return null;let be=b(e);if(!be||O(be)||!X||i!==void 0&&i===!1||j(e)===Z&&l||(o=="modal"||o=="corner-modal")&&Le(e))return null;let U=()=>{Ae(!1),g&&g(),y===!0&&G(e)};if(T=="center"&&o==="modal"||o==="large-modal"){let W={padding:"24px"};return o==="large-modal"?(W.width="85%",W.height="90%",W.maxHeight="800px",W.minHeight="500px",W.padding="0"):W.width="400px",et.createElement(Qe,{appearance:d,onClose:U,visible:ue,style:W,dismissible:f,showFrigadeBranding:A},et.createElement(ie,{appearance:d}),et.createElement(Vo,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:Ae,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:k,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:v,updateUrlOnPageChange:h}))}return o==="modal"&&T!=="center"?et.createElement($o,{appearance:d,onClose:U,visible:ue,modalPosition:T},et.createElement(ie,{appearance:d}),et.createElement(Vo,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:Ae,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:k,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:v,updateUrlOnPageChange:h})):et.createElement(et.Fragment,null,et.createElement(ie,{appearance:d}),et.createElement(Vo,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:Ae,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:k,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:v,updateUrlOnPageChange:h}))},gn=fn;import{useCallback as Er,useContext as Gp,useEffect as Kp}from"react";function Ar(){let{organizationId:e,userId:t,setOrganizationId:o}=Gp(Q),{mutateUserFlowState:i}=De(),{config:n,apiUrl:r}=Je(),s=Ut(),{verifySDKInitiated:p}=Wt();function d(f,y){return`frigade-user-group-registered-${f}-${y}`}Kp(()=>{if(t&&e){if(t.startsWith(zt))return;let f=d(t,e);localStorage.getItem(f)||(s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"))}},[t,e]);let l=Er(f=>D(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:f};yield s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=Er((f,y)=>D(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 S={foreignUserId:t,foreignUserGroupId:e,events:[{event:f,properties:y}]};yield s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,n,i]),c=Er((f,y)=>D(this,null,function*(){if(p())if(y){let T=d(t,f);localStorage.setItem(T,"true"),o(f);let S={foreignUserId:t,foreignUserGroupId:f,properties:y};yield s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(S)})),i()}else o(f)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var hn="frigade-xFrigade_guestUserId",So="frigade-xFrigade_userId",xn=({})=>{let{setFlowResponses:e}=ao(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=De(),{userId:n,setUserId:r}=po(),[s,p]=yo(n),{getFlowStatus:d}=R(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:f}=qp(Q),[y,T]=yo([]),[S,g]=yo([]),{organizationId:E}=Ar(),[k,F]=yo(E),[A,I]=yo(!1);qt(()=>{if(!o&&t)for(let b=0;b<t.length;b++){let N=t[b],L=l.find(O=>O.slug===(N==null?void 0:N.flowId));if(L&&N&&N.shouldTrigger===!0&&L.type=="FORM"&&L.triggerType==="AUTOMATIC"&&!S.includes(L.slug)){setTimeout(()=>{x(N.flowId)},500);break}}},[o,t]),qt(()=>{f.length>0&&i()},[f]),qt(()=>{A||(I(!0),i())},[o,I]);function x(b){let N=l.find(L=>L.slug===b);N&&N.triggerType==="AUTOMATIC"&&!S.includes(N.slug)&&(g([...S,N.slug]),T([N]))}function v(){if(!n){let b=localStorage.getItem(So);if(b){r(b);return}let N=localStorage.getItem(hn);if(N){r(N);return}c(!0);let L=zt+Yp();try{localStorage.setItem(hn,L)}catch(O){console.log("Failed to save guest user id locally: Local storage unavailable",O)}r(O=>O||L)}}qt(()=>{try{if(l){let b=[];l.forEach(N=>{if(N.data){let L=N.data.match(/"imageUri":"(.*?)"/g);L&&L.forEach(O=>{let j=O.replace('"imageUri":"',"").replace('"',"");if(b.includes(j))return;let M=new Image;M.src=j,b.push(j)})}})}}catch(b){}},[l]),qt(()=>{if(n!==s&&(e([]),i()),p(n),n&&!n.startsWith(zt))try{localStorage.setItem(So,n)}catch(b){console.log("Failed to save user id locally: Local storage available",b)}n===null&&setTimeout(()=>{n===null&&v()},50)},[n,l,m]),qt(()=>{E!=k&&(F(E),e([]),i())},[E,k,F]);function h(){return Pt.createElement(Pt.Fragment,null,y.map(b=>d(b.slug)!==Me?null:Pt.createElement("span",{key:b.slug},Pt.createElement(gn,{flowId:b.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Pt.createElement(Pt.Fragment,null,Pt.createElement(h,null))};import{ErrorBoundary as Sd}from"react-error-boundary";var Cn={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 Xp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Cn[o]){let n=Cn[o].split("."),r=t;n.forEach((s,p)=>{r[s]||(r[s]=p===n.length-1?i:{}),r=r[s]})}}),t}function Jp(e){if(!e)return;let t=he({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function yn(e){let{theme:t,styleOverrides:o}=e,i=Xp(t),n=Jp(o);return{overrides:i,css:n}}import dd from"styled-components";import{compose as cd,variant as bn}from"styled-system";import Sn from"react";import Qp,{ThemeProvider as Zp,useTheme as Rp}from"styled-components";import{border as ed,color as td,compose as od,get as rd,shadow as id,space as nd,system as sd,typography as ld}from"styled-system";var ad={width:{property:"width",scale:"sizes",transform:(e,t)=>rd(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},pd=Qp("div")(({css:e})=>e,od(ed,td,id,nd,ld,sd(ad))),bo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Ie(r,["as","children","overrides"]);let s=Rp(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Sn.createElement(pd,w(w({as:e},p),i),t);if(o!==void 0){let l=he(s,o);return Sn.createElement(Zp,{theme:l},d())}return d()};var wo={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"}},md={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},wn=dd(bo)(()=>({whiteSpace:"nowrap"}),cd(bn({scale:"components.Button",variants:"components.Button"}),bn({prop:"size",variants:md})));import ud from"styled-components";import{variant as fd,system as gd}from"styled-system";var Go={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 Tn=ud(bo)(fd({scale:"components.Text",variants:"components.Text"}),gd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Fn=4,kn="px",hd=20,xd=Object.fromEntries(Array.from(Array(hd+1),(e,t)=>t===0?[.5,`${.5*Fn}${kn}`]:[t,`${t*Fn}${kn}`])),Yt={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"},Or={colors:_(w({},Yt),{neutral:{foreground:Yt.gray300},primary:{background:Yt.blue500,foreground:Yt.white,inverted:Yt.blue500},negative:{foreground:Yt.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:xd,components:{Button:wo,Text:Go}};var Pn="https://api.frigade.com",Q=Cd({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:it,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Pn,readonly:!1,debug:!1});function bd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var wd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var q,se,de,Se,V;let[r,s]=je(t||null),[p,d]=je(o||null),[l,m]=je([]),[c,f]=je([]),[y,T]=je([]),[S,g]=je({}),[E,k]=je({}),[F,A]=je([]),[I,x]=je({}),[v,h]=je(!1),[b,N]=je(!1),[L,O]=je(!G(e)),j=(Y,ee)=>{if(ee==="_blank"){window.open(Y,"_blank");return}setTimeout(()=>{window.location.href=Y},50)},M={theme:w(w({},it.theme),(se=(q=i==null?void 0:i.defaultAppearance)==null?void 0:q.theme)!=null?se:{}),styleOverrides:w(w({},it.styleOverrides),(Se=(de=i==null?void 0:i.defaultAppearance)==null?void 0:de.styleOverrides)!=null?Se:{})};function G(Y){return!!(Y&&Y.length>10&&Y.substring(0,10)==="api_public")}Ko(()=>{t&&s(t)},[t]),Ko(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(So)&&window.localStorage.getItem(So)!==r&&bd()},[r]),Ko(()=>{o&&d(o)},[o]),Ko(()=>{if(G(e))O(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),O(!0);return}},[e,O]);let le={publicApiKey:e,userId:r,setUserId:s,setFlows:m,flows:l,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:y,setFlowResponses:T,userProperties:S,setUserProperties:g,openFlowStates:E,setOpenFlowStates:k,completedFlowsToKeepOpenDuringSession:F,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:I,setCustomVariables:x,isNewGuestUser:v,setIsNewGuestUser:h,hasActiveFullPageFlow:b,setHasActiveFullPageFlow:N,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:j,defaultAppearance:M,shouldGracefullyDegrade:L,setShouldGracefullyDegrade:O,apiUrl:i&&i.apiUrl?i.apiUrl:Pn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(L)return vt.createElement(Q.Provider,{value:le},n);let{overrides:pe}=yn(M);return vt.createElement(Sd,{fallback:vt.createElement(vt.Fragment,null,n)},vt.createElement(Q.Provider,{value:le},vt.createElement(yd,{theme:he(M.theme,Or,pe!=null?pe:{},(V=i==null?void 0:i.theme)!=null?V:{})},n,vt.createElement(xn,null))))};import dc from"react";import xe,{useEffect as ol,useState as rl}from"react";import Ye,{useState as zd}from"react";import At from"styled-components";import Xo from"react";import Bt from"react";import Bn from"styled-components";var vn=Bn.span`
|
|
686
|
+
`;var dn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,s]=Er([]),[p,d]=Er(!1),[l,m]=Er(e.id);return Br(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Br(()=>{l!==e.id&&(m(e.id),s([]))},[e]),Br(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),st.createElement(tn,{className:a("selectListContainer",i)},st.createElement(on,null,st.createElement(rn,{className:a("selectListTitle",i)},e.title),st.createElement(nn,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),n.options.map((c,f)=>{let y=r.includes(c.id);return st.createElement(sn,{key:`select-item-${f}`,onClick:()=>{if(r.includes(c.id)){s(r.filter(T=>T!==c.id));return}r.length<n.maxChoices?s([...r,c.id]):r.length==1&&n.maxChoices==1&&s([c.id])},hideBottomBorder:f===n.options.length-1,className:a("selectListSelectItem",i)},st.createElement(ln,{className:a("selectListItemImage",i)},c.imageUri&&st.createElement(an,{src:c.imageUri,alt:`select-icon-${f}`}),st.createElement(pn,{appearance:i,className:a("selectListSelectItemText",i)},c.title)),st.createElement(nt,{appearance:i,value:y,primaryColor:i.theme.colorPrimary}))}))};import Ue,{useEffect as cn,useState as ho}from"react";var Hp=({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),Go=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:l,onComplete:m,setVisible:c,setShowModal:f,onDismiss:y,showPagination:T=!1,customFormElements:S,allowBackNavigation:g,validationHandler:E,onFormDataChange:P,showFooter:F,prefillData:A,updateUrlOnPageChange:I})=>{var U;let v=w(w({},{linkCollection:Ri,multiInput:_i,callToAction:en,selectList:dn}),i),{primaryCTAClickSideEffects:h,secondaryCTAClickSideEffects:b}=ae(),[N,L]=ho(!1),[O,j]=ho({}),[M,G]=ho(!1),[le,pe]=ho(!1),[q,se]=ho(null),de=(U=t[o])!=null?U:null,{markStepCompleted:Se,markStepStarted:V,isLoading:Y,updateCustomVariables:ee,markFlowCompleted:Ve}=R();cn(()=>{ee(n)},[n,Y]),cn(()=>{P&&P(O,Le(),t[o],o)},[O]);function Le(){var W;return{data:(W=O[t[o].id])!=null?W:{},stepId:t[o].id,customVariables:n}}function X($,W,J){let fe=o+1<t.length?t[o+1]:null;return s&&s($,J,fe,O,Le()),r?r($,o,W,fe):!0}function ue($,W){j(J=>{let fe={};return fe[$.id]=W,w(w({},J),fe)})}function Oe($){return $.selectedStep.imageUri?Ue.createElement(qi,{image:$.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let Te=F&&Ue.createElement(Qi,{step:t[o],canContinue:N&&!M,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>D(void 0,null,function*(){if(G(!0),E){let J=yield E(t[o],o,t[o+1],O,Le());if(J!==!0){se(typeof J=="string"?J:null),G(!1);return}else se(null)}let $=w({},Le());yield Se(p,t[o].id,$),o+1<t.length&&!g&&(yield V(p,t[o+1].id));let W=X(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),y&&y(),l&&W&&(c&&c(!1),f(!1)),yield Ve(p)),h(t[o]),G(!1),typeof window!="undefined"&&g&&o+1<t.length&&(window.location.hash=t[o+1].id),typeof window!="undefined"&&!g&&I&&o+1<t.length){let J=new URL(window.location.href);J.searchParams.set("p",t[o+1].id),window.history.pushState({},"",J.toString())}}),onSecondaryClick:()=>{X(t[o],"secondary",o),b(t[o])},onBack:()=>D(void 0,null,function*(){o-1>=0&&(G(!0),g&&typeof window!="undefined"&&(window.location.hash=t[o-1].id),yield V(p,t[o-1].id),G(!1))}),steps:t,allowBackNavigation:g,errorMessage:q,isSaving:M});return Ue.createElement(Ue.Fragment,null,Ue.createElement(Gi,{className:a("formContainer",e)},Ue.createElement(Hp,{id:o,shouldWrap:d==="large-modal"},Ue.createElement(Ki,{key:de.id,type:d,className:a("formContent",e)},t.map($=>{let W=v[$.type];return de.id!==$.id?null:typeof W!="function"?W:Ue.createElement(W,{key:$.id,stepData:$,canContinue:N,setCanContinue:L,onSaveData:J=>{ue($,J)},appearance:e,customFormElements:S,flowId:p,prefillData:A})}),T&&Ue.createElement(Zi,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),Te)),d=="large-modal"&&Ue.createElement(Oe,{selectedStep:t[o]})))};import xo from"react";import{createGlobalStyle as jp}from"styled-components";var Vp=jp`
|
|
687
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${po}${t}.${po}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,p])=>`${Oo(s)}: ${p};`).join(" ")} }`:`${Oo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ie({appearance:e}){if(!e||!e.styleOverrides)return xo.createElement(xo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?xo.createElement(xo.Fragment,null):xo.createElement(Vp,{inlineStyles:t})}var fn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:m,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:y=!1,modalPosition:T="center",repeatable:S=!1,onDismiss:g,showPagination:E=!1,allowBackNavigation:P=!1,validationHandler:F,showFrigadeBranding:A=!1,onFormDataChange:I,showFooter:x=!0,prefillData:v={},updateUrlOnPageChange:h=!1})=>{let{getFlow:b,getFlowSteps:N,isLoading:L,targetingLogicShouldHideFlow:O,getFlowStatus:j,getCurrentStepIndex:M,markFlowCompleted:G,markFlowNotStarted:le,markStepStarted:pe}=R(),q=M(e),{mergeAppearanceWithDefault:se}=te(),[de,Se]=un(!1),[V,Y]=un(""),{setOpenFlowState:ee,getOpenFlowState:Ve,hasOpenModals:Le}=Be(),X=N(e);d=se(d);let[ue,Oe]=i!==void 0&&n!==void 0?[i,n]:[Ve(e,!0),W=>ee(e,W)];mn(()=>{!de&&!L&&(Se(!0),(j(e)===Z&&S||j(e)===Me)&&(j(e)===Z&&S&&le(e),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(J=>{J.startsWith(kr)&&window.localStorage.removeItem(J)})),Se(!0))},[de,Se,L]);let Te=typeof window!="undefined"?window.location.hash:null;if(mn(()=>{var J;let W=typeof window!="undefined"&&((J=window==null?void 0:window.location)!=null&&J.hash)?window.location.hash.replace("#",""):"";if(W!=V&&X&&(X==null?void 0:X.length)>0){let fe=-1;if(W){let $e=W;fe=X.findIndex(Ge=>Ge.id===$e),V===W&&(fe=-1),Y(W)}else fe=0,Y("");fe!==-1&&pe(e,X[fe].id)}},[X,Te]),L)return null;let U=b(e);if(!U||O(U)||!X||i!==void 0&&i===!1||j(e)===Z&&l||(o=="modal"||o=="corner-modal")&&Le(e))return null;let $=()=>{Oe(!1),g&&g(),y===!0&&G(e)};if(T=="center"&&o==="modal"||o==="large-modal"){let W={padding:"24px"};return o==="large-modal"?(W.width="85%",W.height="90%",W.maxHeight="800px",W.minHeight="500px",W.padding="0"):W.width="400px",et.createElement(Qe,{appearance:d,onClose:$,visible:ue,style:W,dismissible:f,showFrigadeBranding:A},et.createElement(ie,{appearance:d}),et.createElement(Go,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:v,updateUrlOnPageChange:h}))}return o==="modal"&&T!=="center"?et.createElement(Mo,{appearance:d,onClose:$,visible:ue,modalPosition:T},et.createElement(ie,{appearance:d}),et.createElement(Go,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:v,updateUrlOnPageChange:h})):et.createElement(et.Fragment,null,et.createElement(ie,{appearance:d}),et.createElement(Go,{appearance:d,steps:X,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:Oe,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:P,validationHandler:F,onFormDataChange:I,showFooter:x,prefillData:v,updateUrlOnPageChange:h}))},gn=fn;import{useCallback as Ar,useContext as Gp,useEffect as Kp}from"react";function Or(){let{organizationId:e,userId:t,setOrganizationId:o}=Gp(Q),{mutateUserFlowState:i}=De(),{config:n,apiUrl:r}=Je(),s=Wt(),{verifySDKInitiated:p}=zt();function d(f,y){return`frigade-user-group-registered-${f}-${y}`}Kp(()=>{if(t&&e){if(t.startsWith(_t))return;let f=d(t,e);localStorage.getItem(f)||(s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"))}},[t,e]);let l=Ar(f=>D(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:f};yield s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=Ar((f,y)=>D(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 S={foreignUserId:t,foreignUserGroupId:e,events:[{event:f,properties:y}]};yield s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,n,i]),c=Ar((f,y)=>D(this,null,function*(){if(p())if(y){let T=d(t,f);localStorage.setItem(T,"true"),o(f);let S={foreignUserId:t,foreignUserGroupId:f,properties:y};yield s(`${r}userGroups`,_(w({},n),{method:"POST",body:JSON.stringify(S)})),i()}else o(f)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var hn="frigade-xFrigade_guestUserId",yo="frigade-xFrigade_userId",xn=({})=>{let{setFlowResponses:e}=lo(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=De(),{userId:n,setUserId:r}=ao(),[s,p]=Co(n),{getFlowStatus:d}=R(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:f}=qp(Q),[y,T]=Co([]),[S,g]=Co([]),{organizationId:E}=Or(),[P,F]=Co(E),[A,I]=Co(!1);Yt(()=>{if(!o&&t)for(let b=0;b<t.length;b++){let N=t[b],L=l.find(O=>O.slug===(N==null?void 0:N.flowId));if(L&&N&&N.shouldTrigger===!0&&L.type=="FORM"&&L.triggerType==="AUTOMATIC"&&!S.includes(L.slug)){setTimeout(()=>{x(N.flowId)},500);break}}},[o,t]),Yt(()=>{f.length>0&&i()},[f]),Yt(()=>{A||(I(!0),i())},[o,I]);function x(b){let N=l.find(L=>L.slug===b);N&&N.triggerType==="AUTOMATIC"&&!S.includes(N.slug)&&(g([...S,N.slug]),T([N]))}function v(){if(!n){let b=localStorage.getItem(yo);if(b){r(b);return}let N=localStorage.getItem(hn);if(N){r(N);return}c(!0);let L=_t+Yp();try{localStorage.setItem(hn,L)}catch(O){console.log("Failed to save guest user id locally: Local storage unavailable",O)}r(O=>O||L)}}Yt(()=>{try{if(l){let b=[];l.forEach(N=>{if(N.data){let L=N.data.match(/"imageUri":"(.*?)"/g);L&&L.forEach(O=>{let j=O.replace('"imageUri":"',"").replace('"',"");if(b.includes(j))return;let M=new Image;M.src=j,b.push(j)})}})}}catch(b){}},[l]),Yt(()=>{if(n!==s&&(e([]),i()),p(n),n&&!n.startsWith(_t))try{localStorage.setItem(yo,n)}catch(b){console.log("Failed to save user id locally: Local storage available",b)}n===null&&setTimeout(()=>{n===null&&v()},50)},[n,l,m]),Yt(()=>{E!=P&&(F(E),e([]),i())},[E,P,F]);function h(){return vt.createElement(vt.Fragment,null,y.map(b=>d(b.slug)!==Me?null:vt.createElement("span",{key:b.slug},vt.createElement(gn,{flowId:b.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return vt.createElement(vt.Fragment,null,vt.createElement(h,null))};import{ErrorBoundary as Sd}from"react-error-boundary";var Cn={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 Xp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Cn[o]){let n=Cn[o].split("."),r=t;n.forEach((s,p)=>{r[s]||(r[s]=p===n.length-1?i:{}),r=r[s]})}}),t}function Jp(e){if(!e)return;let t=xe({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function yn(e){let{theme:t,styleOverrides:o}=e,i=Xp(t),n=Jp(o);return{overrides:i,css:n}}import dd from"styled-components";import{compose as cd,variant as bn}from"styled-system";import Sn from"react";import Qp,{ThemeProvider as Zp,useTheme as Rp}from"styled-components";import{border as ed,color as td,compose as od,get as rd,shadow as id,space as nd,system as sd,typography as ld}from"styled-system";var ad={width:{property:"width",scale:"sizes",transform:(e,t)=>rd(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},pd=Qp("div")(({css:e})=>e,od(ed,td,id,nd,ld,sd(ad))),So=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Ie(r,["as","children","overrides"]);let s=Rp(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Sn.createElement(pd,w(w({as:e},p),i),t);if(o!==void 0){let l=xe(s,o);return Sn.createElement(Zp,{theme:l},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"}},md={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},wn=dd(So)(()=>({whiteSpace:"nowrap"}),cd(bn({scale:"components.Button",variants:"components.Button"}),bn({prop:"size",variants:md})));import ud from"styled-components";import{variant as fd,system as gd}from"styled-system";var Ko={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 Tn=ud(So)(fd({scale:"components.Text",variants:"components.Text"}),gd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Fn=4,kn="px",hd=20,xd=Object.fromEntries(Array.from(Array(hd+1),(e,t)=>t===0?[.5,`${.5*Fn}${kn}`]:[t,`${t*Fn}${kn}`])),Xt={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"},Ir={colors:_(w({},Xt),{neutral:{foreground:Xt.gray300},primary:{background:Xt.blue500,foreground:Xt.white,inverted:Xt.blue500},negative:{foreground:Xt.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:xd,components:{Button:bo,Text:Ko}};var Pn="https://api.frigade.com",Q=Cd({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:it,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Pn,readonly:!1,debug:!1});function bd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var wd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var q,se,de,Se,V;let[r,s]=je(t||null),[p,d]=je(o||null),[l,m]=je([]),[c,f]=je([]),[y,T]=je([]),[S,g]=je({}),[E,P]=je({}),[F,A]=je([]),[I,x]=je({}),[v,h]=je(!1),[b,N]=je(!1),[L,O]=je(!G(e)),j=(Y,ee)=>{if(ee==="_blank"){window.open(Y,"_blank");return}setTimeout(()=>{window.location.href=Y},50)},M={theme:w(w({},it.theme),(se=(q=i==null?void 0:i.defaultAppearance)==null?void 0:q.theme)!=null?se:{}),styleOverrides:w(w({},it.styleOverrides),(Se=(de=i==null?void 0:i.defaultAppearance)==null?void 0:de.styleOverrides)!=null?Se:{})};function G(Y){return!!(Y&&Y.length>10&&Y.substring(0,10)==="api_public")}qo(()=>{t&&s(t)},[t]),qo(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(yo)&&window.localStorage.getItem(yo)!==r&&bd()},[r]),qo(()=>{o&&d(o)},[o]),qo(()=>{if(G(e))O(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),O(!0);return}},[e,O]);let le={publicApiKey:e,userId:r,setUserId:s,setFlows:m,flows:l,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:y,setFlowResponses:T,userProperties:S,setUserProperties:g,openFlowStates:E,setOpenFlowStates:P,completedFlowsToKeepOpenDuringSession:F,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:I,setCustomVariables:x,isNewGuestUser:v,setIsNewGuestUser:h,hasActiveFullPageFlow:b,setHasActiveFullPageFlow:N,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:j,defaultAppearance:M,shouldGracefullyDegrade:L,setShouldGracefullyDegrade:O,apiUrl:i&&i.apiUrl?i.apiUrl:Pn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(L)return Bt.createElement(Q.Provider,{value:le},n);let{overrides:pe}=yn(M);return Bt.createElement(Sd,{fallback:Bt.createElement(Bt.Fragment,null,n)},Bt.createElement(Q.Provider,{value:le},Bt.createElement(yd,{theme:xe(M.theme,Ir,pe!=null?pe:{},(V=i==null?void 0:i.theme)!=null?V:{})},n,Bt.createElement(xn,null))))};import dc from"react";import Ce,{useEffect as ol,useState as rl}from"react";import Ye,{useState as zd}from"react";import Ot from"styled-components";import Jo from"react";import Et from"react";import Bn from"styled-components";var vn=Bn.span`
|
|
688
688
|
font-weight: 600;
|
|
689
689
|
font-size: 14px;
|
|
690
690
|
font-style: normal;
|
|
@@ -695,7 +695,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
695
695
|
vertical-align: middle;
|
|
696
696
|
margin-left: 32px;
|
|
697
697
|
padding-right: 12px;
|
|
698
|
-
${e=>
|
|
698
|
+
${e=>ke(e)}
|
|
699
699
|
`,Td=Bn.div`
|
|
700
700
|
flex-direction: row;
|
|
701
701
|
justify-content: space-between;
|
|
@@ -704,12 +704,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
704
704
|
padding-bottom: 20px;
|
|
705
705
|
padding-right: 8px;
|
|
706
706
|
width: 100%;
|
|
707
|
-
${e=>
|
|
708
|
-
`,
|
|
707
|
+
${e=>ke(e)}
|
|
708
|
+
`,Yo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:s="round",appearance:p})=>Et.createElement(Et.Fragment,null,Et.createElement(Td,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:w({},n)},i==="left"&&e&&Et.createElement(vn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),Et.createElement(nt,{appearance:p,value:t,type:s,primaryColor:r}),i==="right"&&e&&Et.createElement(vn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),Et.createElement(ie,{appearance:p}));import wo from"styled-components";var En=wo.div`
|
|
709
709
|
font-weight: 700;
|
|
710
710
|
font-size: 18px;
|
|
711
711
|
line-height: 22px;
|
|
712
|
-
`,An=
|
|
712
|
+
`,An=wo.p`
|
|
713
713
|
font-weight: 600;
|
|
714
714
|
font-size: 16px;
|
|
715
715
|
line-height: 24px;
|
|
@@ -717,7 +717,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
717
717
|
letter-spacing: 0.32px;
|
|
718
718
|
font-style: normal;
|
|
719
719
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
720
|
-
`,On=
|
|
720
|
+
`,On=wo.p`
|
|
721
721
|
font-weight: 400;
|
|
722
722
|
font-size: 14px;
|
|
723
723
|
font-style: normal;
|
|
@@ -726,26 +726,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
726
726
|
letter-spacing: 0.28px;
|
|
727
727
|
margin: 8px 0px 0px 0px;
|
|
728
728
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
729
|
-
`,
|
|
729
|
+
`,Xo=wo.div`
|
|
730
730
|
width: 6px;
|
|
731
731
|
position: absolute;
|
|
732
732
|
left: 0;
|
|
733
733
|
height: 100%;
|
|
734
734
|
border-top-right-radius: 4px;
|
|
735
735
|
border-bottom-right-radius: 4px;
|
|
736
|
-
`,In=
|
|
736
|
+
`,In=wo.div`
|
|
737
737
|
flex-direction: row;
|
|
738
738
|
justify-content: flex-start;
|
|
739
739
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
740
740
|
padding-right: 16px;
|
|
741
|
-
`;var Nn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:s})=>{var p,d,l,m,c;return
|
|
741
|
+
`;var Nn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:s})=>{var p,d,l,m,c;return Jo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&Jo.createElement(Xo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)!=null?d:i}}),Jo.createElement(In,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},Jo.createElement(Yo,{value:e.complete,labelPosition:"left",label:(l=e.stepName)!=null?l:e.title,style:n,primaryColor:(c=(m=s==null?void 0:s.theme)==null?void 0:m.colorPrimary)!=null?c:i,appearance:s})))};import At from"react";import Nr from"styled-components";import Qo from"styled-components";var rC=Qo.h1`
|
|
742
742
|
display: flex;
|
|
743
743
|
margin: 0;
|
|
744
744
|
font-size: 18px;
|
|
745
|
-
`,iC=
|
|
745
|
+
`,iC=Qo.h2`
|
|
746
746
|
font-size: 15px;
|
|
747
747
|
color: #4d4d4d;
|
|
748
|
-
`,Ln=
|
|
748
|
+
`,Ln=Qo.div`
|
|
749
749
|
position: absolute;
|
|
750
750
|
left: 0;
|
|
751
751
|
top: 0;
|
|
@@ -754,7 +754,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
754
754
|
border-radius: 20px;
|
|
755
755
|
background-color: ${e=>e.theme.colorPrimary};
|
|
756
756
|
transition: width 0.5s;
|
|
757
|
-
`,$n=
|
|
757
|
+
`,$n=Qo.div`
|
|
758
758
|
position: relative;
|
|
759
759
|
left: 0;
|
|
760
760
|
top: 0;
|
|
@@ -764,32 +764,32 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
764
764
|
border-radius: 20px;
|
|
765
765
|
background-color: ${e=>e.theme.colorPrimary};
|
|
766
766
|
opacity: 0.12;
|
|
767
|
-
`;var Fd=
|
|
767
|
+
`;var Fd=Nr.div`
|
|
768
768
|
display: flex;
|
|
769
769
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
770
770
|
justify-content: flex-start;
|
|
771
771
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
772
772
|
width: 100%;
|
|
773
773
|
|
|
774
|
-
${e=>
|
|
775
|
-
`,kd=
|
|
774
|
+
${e=>ke(e)}
|
|
775
|
+
`,kd=Nr.div`
|
|
776
776
|
flex-grow: 1;
|
|
777
777
|
position: relative;
|
|
778
778
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
779
|
-
`,Pd=
|
|
779
|
+
`,Pd=Nr.span`
|
|
780
780
|
font-weight: 600;
|
|
781
781
|
font-size: 14px;
|
|
782
782
|
line-height: 18px;
|
|
783
783
|
padding-right: ${e=>e.padding};
|
|
784
784
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
785
|
-
${e=>
|
|
786
|
-
`;var We=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:s})=>{var f;if(t===0)return
|
|
785
|
+
${e=>ke(e)}
|
|
786
|
+
`;var We=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:s})=>{var f;if(t===0)return At.createElement(At.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(f=s==null?void 0:s.theme)==null?void 0:f.colorText});let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",l=Math.round(e/t*100),m=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${l}% complete`),i==="top"&&(m="0px"),At.createElement(Fd,{className:a("progressBarContainer",s),textLocation:i,styleOverrides:n},At.createElement(Pd,{className:a("progressBarStepText",s),styleOverrides:_(w({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:s,padding:m,textLocation:i},c),At.createElement(kd,{textLocation:i,className:a("progressBar",s)},At.createElement(Ln,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:s,className:a("progressBarFill",s)}),At.createElement($n,{className:a("progressBarBackground",s),barHeight:d,appearance:s})))};import To from"react";import Bd from"styled-components";import Ro from"react";import Zo from"react";var Jt=({stepData:e,appearance:t})=>Zo.createElement(Zo.Fragment,null,Zo.createElement(An,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:ce(e.title)}),Zo.createElement(On,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:ce(e.subtitle)}));import Lr from"react";var Qt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Lr.createElement(Ho,{className:a("ctaContainer",t)},Lr.createElement(oe,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Lr.createElement(oe,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var Zt=({stepData:e,appearance:t})=>Ro.createElement(Ro.Fragment,null,Ro.createElement(Jt,{stepData:e,appearance:t}),Ro.createElement(Qt,{stepData:e,appearance:t}));import vd from"react";function Mn(e){return vd.createElement(Re,{appearance:e.appearance,videoUri:e.videoUri})}var $r="default",Ed=Bd.img`
|
|
787
787
|
border-radius: 4px;
|
|
788
788
|
max-height: 260px;
|
|
789
789
|
min-height: 200px;
|
|
790
|
-
`,Dn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return
|
|
790
|
+
`,Dn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return To.createElement("div",null,o)}return To.createElement(En,{className:a("checklistStepContent",t)},e.imageUri?To.createElement(Ed,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?To.createElement(Mn,{videoUri:e.videoUri,appearance:t}):null,To.createElement(Zt,{stepData:e,appearance:t}))};import ze,{useRef as Ad,useState as Od}from"react";import Rt from"styled-components";var Un=Rt.div`
|
|
791
791
|
display: block;
|
|
792
|
-
`,Id=
|
|
792
|
+
`,Id=Rt.div`
|
|
793
793
|
display: flex;
|
|
794
794
|
flex-direction: row;
|
|
795
795
|
flex-wrap: wrap;
|
|
@@ -799,20 +799,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
799
799
|
align-content: center;
|
|
800
800
|
margin-top: 24px;
|
|
801
801
|
margin-bottom: 24px;
|
|
802
|
-
`,Nd=
|
|
802
|
+
`,Nd=Rt.div`
|
|
803
803
|
display: flex;
|
|
804
804
|
align-items: center;
|
|
805
805
|
justify-content: flex-start;
|
|
806
806
|
flex-direction: column;
|
|
807
807
|
margin-right: 16px;
|
|
808
|
-
`,Ld=
|
|
808
|
+
`,Ld=Rt.video`
|
|
809
809
|
width: 200px;
|
|
810
810
|
height: 120px;
|
|
811
|
-
`,$d=
|
|
811
|
+
`,$d=Rt.div`
|
|
812
812
|
font-size: 14px;
|
|
813
813
|
line-height: 20px;
|
|
814
814
|
text-align: center;
|
|
815
|
-
`,Md=
|
|
815
|
+
`,Md=Rt.div`
|
|
816
816
|
position: absolute;
|
|
817
817
|
width: 200px;
|
|
818
818
|
height: 120px;
|
|
@@ -832,9 +832,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
832
832
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
833
833
|
border-radius: 50%;
|
|
834
834
|
}
|
|
835
|
-
`,Wn="videoCarousel",zn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return ze.createElement(Un,null,ze.createElement(
|
|
835
|
+
`,Wn="videoCarousel",zn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return ze.createElement(Un,null,ze.createElement(Zt,{stepData:e,appearance:t}));function o({video:r}){let s=Ad(),[p,d]=Od(!1);return ze.createElement(Nd,null,!p&&ze.createElement(Md,{onClick:()=>{d(!0),s.current.play()},appearance:t},ze.createElement(jo,null)),ze.createElement(Ld,{controls:p,ref:s,play:p,src:r.uri}),ze.createElement($d,null,r.title))}let i=e.props;return i.videos?ze.createElement(Un,null,ze.createElement(Jt,{stepData:e,appearance:t}),ze.createElement(Id,null,i.videos.map((r,s)=>ze.createElement("span",{key:`${r.uri}-${s}`},ze.createElement(o,{video:r})))),ze.createElement(Qt,{stepData:e,appearance:t})):null};import lt from"react";import er from"styled-components";var _n=er.div`
|
|
836
836
|
display: block;
|
|
837
|
-
`,Dd=
|
|
837
|
+
`,Dd=er.pre`
|
|
838
838
|
display: block;
|
|
839
839
|
background-color: #2a2a2a;
|
|
840
840
|
color: #f8f8f8;
|
|
@@ -850,29 +850,29 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
850
850
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
851
851
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
852
852
|
margin-bottom: 24px;
|
|
853
|
-
`,Ud=
|
|
853
|
+
`,Ud=er.div`
|
|
854
854
|
font-size: 15px;
|
|
855
855
|
line-height: 20px;
|
|
856
856
|
margin-bottom: 12px;
|
|
857
857
|
margin-top: 12px;
|
|
858
|
-
`,Wd=
|
|
858
|
+
`,Wd=er.div`
|
|
859
859
|
margin-top: 24px;
|
|
860
|
-
`,Hn="codeSnippet",jn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return lt.createElement(_n,null,lt.createElement(
|
|
860
|
+
`,Hn="codeSnippet",jn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return lt.createElement(_n,null,lt.createElement(Zt,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?lt.createElement(_n,null,lt.createElement(Jt,{stepData:e,appearance:t}),lt.createElement(Wd,null,o.codeSnippets.map((n,r)=>lt.createElement("div",{key:r},n.title?lt.createElement(Ud,null,n.title):null,n.code?lt.createElement(Dd,null,n.code):null))),lt.createElement(Qt,{stepData:e,appearance:t})):null};var _d=Ot.div`
|
|
861
861
|
display: flex;
|
|
862
862
|
flex-direction: row;
|
|
863
863
|
overflow: hidden;
|
|
864
864
|
min-width: ${e=>e.type!="modal"?"600px":"100%"};
|
|
865
865
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
866
866
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
867
|
-
${e=>
|
|
868
|
-
`,Hd=
|
|
867
|
+
${e=>ke(e)}
|
|
868
|
+
`,Hd=Ot.h1`
|
|
869
869
|
font-size: 18px;
|
|
870
870
|
font-style: normal;
|
|
871
871
|
font-weight: 700;
|
|
872
872
|
line-height: 24px;
|
|
873
873
|
letter-spacing: 0.36px;
|
|
874
874
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
875
|
-
`,jd=
|
|
875
|
+
`,jd=Ot.h2`
|
|
876
876
|
font-size: 14px;
|
|
877
877
|
font-style: normal;
|
|
878
878
|
font-weight: 400;
|
|
@@ -880,22 +880,22 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
880
880
|
letter-spacing: 0.28px;
|
|
881
881
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
882
882
|
margin: 10px 0px 0px 0px;
|
|
883
|
-
`,Vn=
|
|
883
|
+
`,Vn=Ot.div``,Vd=Ot.div`
|
|
884
884
|
list-style: none;
|
|
885
885
|
padding: 0;
|
|
886
886
|
margin: 0;
|
|
887
887
|
cursor: pointer;
|
|
888
888
|
width: 300px;
|
|
889
|
-
`,Gd=
|
|
889
|
+
`,Gd=Ot.div`
|
|
890
890
|
width: 1px;
|
|
891
891
|
margin-right: 40px;
|
|
892
892
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
893
|
-
`,Kd=
|
|
893
|
+
`,Kd=Ot.div`
|
|
894
894
|
flex: 2;
|
|
895
895
|
padding: 2rem 2rem 2rem 0rem;
|
|
896
|
-
`,qd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:s="",customStepTypes:p=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:m}=te();d=m(d);let c={[
|
|
896
|
+
`,qd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:s="",customStepTypes:p=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:m}=te();d=m(d);let c={[$r]:Dn,[Wn]:zn,[Hn]:jn},f=w(w({},c),p),[y,T]=zd(0),S=n!=null?n:y,g=r!=null?r:T,E=o.filter(F=>F.complete===!0).length,P=()=>{var F;return!((F=o[S])!=null&&F.type)||!f[o[S].type]?f[$r]({stepData:o[S],appearance:d}):f[o[S].type]({stepData:o[S],appearance:d})};return Ye.createElement(_d,{type:l,styleOverrides:i,className:s,appearance:d},Ye.createElement(Vn,{style:{flex:1}},Ye.createElement(Vn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},Ye.createElement(Hd,{className:a("checklistTitle",d),appearance:d},e),Ye.createElement(jd,{className:a("checklistSubtitle",d),appearance:d},t),Ye.createElement(We,{total:o.length,count:E,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Ye.createElement(Vd,{className:a("checklistStepsContainer",d)},o.map((F,A)=>Ye.createElement(Nn,{data:F,index:A,key:A,listLength:o.length,isSelected:A===S,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{g(A)},appearance:d})))),Ye.createElement(Gd,{appearance:d,className:a("checklistDivider",d)}),Ye.createElement(Kd,null,Ye.createElement(P,null)))},Mr=qd;import H,{useState as Zd}from"react";import Gn from"react";import Yd from"styled-components";var Xd=Yd.svg`
|
|
897
897
|
transition: 'transform 0.35s ease-in-out';
|
|
898
|
-
`,
|
|
898
|
+
`,eo=({style:e,className:t})=>Gn.createElement(Xd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Gn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import ye from"styled-components";var Dr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Kn=ye.div`
|
|
899
899
|
max-height: 350px;
|
|
900
900
|
padding-bottom: 40px;
|
|
901
901
|
`,qn=ye.div`
|
|
@@ -1108,7 +1108,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1108
1108
|
line-height: 14px;
|
|
1109
1109
|
font-weight: 400;
|
|
1110
1110
|
cursor: pointer;
|
|
1111
|
-
`;var Qd=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=ae();return pt.createElement(cs,{style:t,className:a("guideContainer",n)},pt.createElement(us,{className:a("guideTitle",n)},o),pt.createElement(ms,{className:a("guideItemContainer",n)},e.map((p,d)=>{var l;return pt.createElement(fs,{key:`guide-${(l=p.id)!=null?l:d}`,className:a("guideItem",n)},p.icon&&pt.createElement(gs,{className:a("guideIcon",n)},pt.createElement(hs,null,p.icon)),pt.createElement(xs,{className:a("guideItemTitle",n),dangerouslySetInnerHTML:ce(p.title)}),pt.createElement(Cs,{className:a("guideItemSubtitle",n),dangerouslySetInnerHTML:ce(p.subtitle)}),pt.createElement(ys,{className:a("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&s(p),r&&r(p)}},p.primaryButtonTitle))})))},
|
|
1111
|
+
`;var Qd=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=ae();return pt.createElement(cs,{style:t,className:a("guideContainer",n)},pt.createElement(us,{className:a("guideTitle",n)},o),pt.createElement(ms,{className:a("guideItemContainer",n)},e.map((p,d)=>{var l;return pt.createElement(fs,{key:`guide-${(l=p.id)!=null?l:d}`,className:a("guideItem",n)},p.icon&&pt.createElement(gs,{className:a("guideIcon",n)},pt.createElement(hs,null,p.icon)),pt.createElement(xs,{className:a("guideItemTitle",n),dangerouslySetInnerHTML:ce(p.title)}),pt.createElement(Cs,{className:a("guideItemSubtitle",n),dangerouslySetInnerHTML:ce(p.subtitle)}),pt.createElement(ys,{className:a("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&s(p),r&&r(p)}},p.primaryButtonTitle))})))},Fo=Qd;var Rd=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:l,guideData:m,guideTitle:c,onGuideButtonClick:f})=>{let y=({stepData:x,handleSecondaryCTAClick:v,handleCTAClick:h})=>x?H.createElement(ts,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},H.createElement(os,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:ce(x.title)}),H.createElement(rs,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:ce(x.subtitle)}),H.createElement(is,{className:a("checklistCTAContainer",l)},x.secondaryButtonTitle&&H.createElement(oe,{title:x.secondaryButtonTitle,onClick:v,appearance:l,secondary:!0}),H.createElement(oe,{title:x.primaryButtonTitle,onClick:h,appearance:l}))):H.createElement(H.Fragment,null),S=w(w({},{default:x=>{var N;if((N=e[P])!=null&&N.StepContent){let L=e[P].StepContent;return H.createElement("div",null,L)}let v=e[P];return H.createElement(y,{stepData:x,handleCTAClick:()=>{v.handlePrimaryButtonClick&&v.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{v.handleSecondaryButtonClick&&v.handleSecondaryButtonClick()}})}}),d),[g,E]=Zd(0),P=s!=null?s:g,F=p!=null?p:E,A=()=>{var x;return e?!((x=e[P])!=null&&x.type)||!S[e[P].type]?S.default(e[P]):S[e[P].type]({stepData:e[P],primaryColor:l.theme.colorPrimary}):H.createElement(H.Fragment,null)},I=e.filter(x=>x.complete).length;return n?(l.theme.modalContainer||(l.theme.borderRadius&&(Dr.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=Dr),H.createElement(Qe,{onClose:r,visible:n,appearance:l},H.createElement(ps,null,H.createElement(qn,null,H.createElement(Yn,{appearance:l,className:a("checklistTitle",l)},t),H.createElement(Xn,{appearance:l,className:a("checklistSubtitle",l)},o)),H.createElement(Kn,null,e&&e.length>0&&H.createElement(Jn,{className:a("stepsContainer",l)},H.createElement(Qn,null,H.createElement("div",{style:{flex:3}},H.createElement(Zn,{className:a("stepsTitle",l)},i)),H.createElement(as,null,H.createElement(We,{style:{width:"100%"},count:I,total:e.length,appearance:l}))),H.createElement(Rn,null,H.createElement(es,{className:a("checklistStepListContainer",l),appearance:l},e.map((x,v)=>{var b;let h=P===v;return H.createElement(ns,{selected:h,className:a(`checklistStepListItem${h?"Selected":""}`,l),key:`checklist-guide-step-${(b=x.id)!=null?b:v}`,disabled:x.blocked,onClick:()=>{x.blocked||F(v)},title:x.blocked?"Finish remaining steps to continue":void 0},h&&H.createElement(Xo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),H.createElement(ss,{selected:h,className:a(`checklistStepListStepName${h?"Selected":""}`,l)},x.stepName),H.createElement(ls,null,H.createElement(nt,{value:x.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:x.progress,appearance:l}),H.createElement(ds,null,H.createElement(eo,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),H.createElement(A,null))),m&&m.length>0&&H.createElement(Fo,{steps:m,title:c,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:x=>(f&&f(x),!0)}))))):H.createElement(H.Fragment,null)},Ur=Rd;import Ne,{useEffect as Ls,useState as $s}from"react";import we from"react";import dt from"styled-components";var Ss=dt.div`
|
|
1112
1112
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1113
1113
|
border: 1px solid;
|
|
1114
1114
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1159,7 +1159,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1159
1159
|
flex-direction: row;
|
|
1160
1160
|
justify-content: flex-start;
|
|
1161
1161
|
align-items: center;
|
|
1162
|
-
`;var Bs=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:s})=>{var c,f;let p=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.
|
|
1162
|
+
`;var Bs=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:s})=>{var c,f;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.35s ease-out"};function l(){var y;return we.createElement(we.Fragment,null,e.imageUri||e.videoUri?we.createElement(bs,{className:a("stepMediaContainer",r)},e.imageUri?we.createElement(ws,{className:a("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?we.createElement(Re,{appearance:r,videoUri:e.videoUri}):null):null,we.createElement(Ps,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:ce(e.subtitle)}),we.createElement(Ho,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?we.createElement(oe,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,we.createElement(oe,{title:(y=e.primaryButtonTitle)!=null?y:"Continue",onClick:()=>i(),appearance:r})))}function m(){if(!s)return null;let y=s[e.type];return y?y(e,r):null}return we.createElement(Ss,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},we.createElement(Ts,{className:a("stepHeader",r)},we.createElement(vs,null,we.createElement(Yo,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),we.createElement(Fs,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:ce(e.title),onClick:()=>o()})),we.createElement(ks,{className:a("stepChevronContainer",r),onClick:()=>o(),appearance:r},we.createElement(eo,{style:_(w({},p),{transition:"transform 0.2s ease-in-out"})}))),we.createElement("div",{key:e.id,style:w({},d)},(f=m())!=null?f:l()))};import to from"styled-components";var f0=to.div`
|
|
1163
1163
|
background: #ffffff;
|
|
1164
1164
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1165
1165
|
border-radius: 6px;
|
|
@@ -1173,26 +1173,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1173
1173
|
|
|
1174
1174
|
max-width: 800px;
|
|
1175
1175
|
min-width: 350px;
|
|
1176
|
-
`,Es=
|
|
1176
|
+
`,Es=to.div`
|
|
1177
1177
|
display: flex;
|
|
1178
1178
|
flex-direction: column;
|
|
1179
|
-
`,As=
|
|
1179
|
+
`,As=to.h1`
|
|
1180
1180
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1181
1181
|
font-style: normal;
|
|
1182
1182
|
font-weight: 700;
|
|
1183
1183
|
font-size: 20px;
|
|
1184
1184
|
line-height: 24px;
|
|
1185
1185
|
margin-bottom: 8px;
|
|
1186
|
-
`,Os=
|
|
1186
|
+
`,Os=to.h2`
|
|
1187
1187
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1188
1188
|
font-weight: 400;
|
|
1189
1189
|
font-size: 14px;
|
|
1190
1190
|
line-height: 23px;
|
|
1191
1191
|
margin: 2px 0 0 0;
|
|
1192
|
-
`,Is=
|
|
1192
|
+
`,Is=to.div`
|
|
1193
1193
|
display: block;
|
|
1194
1194
|
width: 100%;
|
|
1195
|
-
`,Ns=
|
|
1195
|
+
`,Ns=to.div`
|
|
1196
1196
|
display: flex;
|
|
1197
1197
|
width: 100%;
|
|
1198
1198
|
flex-direction: column;
|
|
@@ -1200,7 +1200,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1200
1200
|
padding: 24px;
|
|
1201
1201
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1202
1202
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1203
|
-
`;var ec=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:l,appearance:m,type:c,className:f,customStepTypes:y,style:T})=>{let S=o.filter(v=>v.complete).length,[g,E]=$s(Array(o.length).fill(!0)),[
|
|
1203
|
+
`;var ec=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:l,appearance:m,type:c,className:f,customStepTypes:y,style:T})=>{let S=o.filter(v=>v.complete).length,[g,E]=$s(Array(o.length).fill(!0)),[P,F]=$s(!1);Ls(()=>{let v=[...g];if(r){for(let h=0;h<o.length;h++)if(!o[h].complete){v[h]=!1;break}E(v)}},[]),Ls(()=>{if(!P&&!r){F(!0);return}A(d)},[d]);let A=v=>{let h=[...g];if(s)for(let b=0;b<g.length;++b)b!==v&&(h[b]=!0);h[v]=!h[v],E(h)};if(!n&&c=="modal")return Ne.createElement(Ne.Fragment,null);let I=Ne.createElement(Ne.Fragment,null,Ne.createElement(Es,null,Ne.createElement(As,{appearance:m,className:a("checklistTitle",m),dangerouslySetInnerHTML:ce(e)}),Ne.createElement(Os,{appearance:m,className:a("checklistSubtitle",m),dangerouslySetInnerHTML:ce(t)})),Ne.createElement(We,{display:"percent",count:S,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),x=Ne.createElement(Is,{className:be(a("checklistContainer",m),f)},o.map((v,h)=>{var N;let b=g[h];return Ne.createElement(Bs,{appearance:m,stepData:v,collapsed:b,key:`modal-checklist-${(N=v.id)!=null?N:h}`,onClick:()=>{if(d===h){A(h);return}l(h)},onPrimaryButtonClick:()=>{v.handlePrimaryButtonClick&&v.handlePrimaryButtonClick(),p&&!v.completionCriteria&&h<g.length-1&&g[h+1]&&l(h+1)},onSecondaryButtonClick:()=>{v.handleSecondaryButtonClick&&v.handleSecondaryButtonClick()},customStepTypes:y})}));return c==="inline"?Ne.createElement(Ns,{appearance:m,className:be(a("checklistInlineContainer",m),f),style:T},I,x):Ne.createElement(Ne.Fragment,null,Ne.createElement(Qe,{onClose:i,visible:n,appearance:m,style:{maxWidth:"600px"},headerContent:I},x))},Wr=ec;import me,{useEffect as zr,useRef as ac,useState as It}from"react";import{useEffect as tc,useState as oc}from"react";var Ms=()=>{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]=oc(t),n=null,r=()=>{n!==null?clearTimeout(n):s(),n=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let m=window.matchMedia(l);return m.addEventListener("change",r),[d,m.matches]}));i(p)};return tc(()=>{s()},[]),o};import oo from"react";import he,{css as Ds,keyframes as Us}from"styled-components";var Ws=Ds`
|
|
1204
1204
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1205
1205
|
`,rc=Ds`
|
|
1206
1206
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
@@ -1216,7 +1216,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1216
1216
|
} to {
|
|
1217
1217
|
opacity: 0;
|
|
1218
1218
|
}
|
|
1219
|
-
`,zs=
|
|
1219
|
+
`,zs=he.div`
|
|
1220
1220
|
margin: 0 -20px;
|
|
1221
1221
|
overflow-x: auto;
|
|
1222
1222
|
padding-left: 20px;
|
|
@@ -1233,13 +1233,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1233
1233
|
::-webkit-scrollbar {
|
|
1234
1234
|
display: none;
|
|
1235
1235
|
}
|
|
1236
|
-
`,_s=
|
|
1236
|
+
`,_s=he.div`
|
|
1237
1237
|
display: flex;
|
|
1238
1238
|
flex-flow: row nowrap;
|
|
1239
1239
|
gap: 0 16px;
|
|
1240
1240
|
scroll-snap-align: center;
|
|
1241
1241
|
scroll-snap-stop: always;
|
|
1242
|
-
`,Hs=
|
|
1242
|
+
`,Hs=he.div`
|
|
1243
1243
|
animation: ${e=>e.reversed?nc:ic} 0.25s ease-out;
|
|
1244
1244
|
background: linear-gradient(
|
|
1245
1245
|
to right,
|
|
@@ -1249,7 +1249,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1249
1249
|
position: absolute;
|
|
1250
1250
|
width: 64px;
|
|
1251
1251
|
z-index: 10;
|
|
1252
|
-
`,js=
|
|
1252
|
+
`,js=he.button`
|
|
1253
1253
|
${Ws}
|
|
1254
1254
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1255
1255
|
align-items: center;
|
|
@@ -1261,10 +1261,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1261
1261
|
justify-content: center;
|
|
1262
1262
|
position: absolute;
|
|
1263
1263
|
width: 48px;
|
|
1264
|
-
`,Vs=
|
|
1264
|
+
`,Vs=he.div`
|
|
1265
1265
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1266
1266
|
padding: 20px;
|
|
1267
|
-
`,Gs=
|
|
1267
|
+
`,Gs=he(Vs)`
|
|
1268
1268
|
${Ws}
|
|
1269
1269
|
background: ${({theme:e})=>e.colorBackground};
|
|
1270
1270
|
position: relative;
|
|
@@ -1277,104 +1277,104 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1277
1277
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1278
1278
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1279
1279
|
}
|
|
1280
|
-
`,Ks=
|
|
1280
|
+
`,Ks=he.img`
|
|
1281
1281
|
border-radius: 50%;
|
|
1282
1282
|
height: 40px;
|
|
1283
1283
|
margin-bottom: 12px;
|
|
1284
1284
|
width: 40px;
|
|
1285
|
-
`,qs=
|
|
1285
|
+
`,qs=he(Vs)`
|
|
1286
1286
|
${e=>B(e)} {
|
|
1287
1287
|
${rc}
|
|
1288
1288
|
|
|
1289
1289
|
background: ${({theme:e})=>e.colorBackground};
|
|
1290
1290
|
}
|
|
1291
|
-
`,O0=
|
|
1291
|
+
`,O0=he.div`
|
|
1292
1292
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1293
1293
|
display: flex;
|
|
1294
1294
|
flex-flow: row nowrap;
|
|
1295
1295
|
align-items: center;
|
|
1296
|
-
`,I0=
|
|
1296
|
+
`,I0=he.div`
|
|
1297
1297
|
white-space: nowrap;
|
|
1298
|
-
`,Ys=
|
|
1298
|
+
`,Ys=he.div`
|
|
1299
1299
|
background: #d8fed8;
|
|
1300
1300
|
border-radius: 6px;
|
|
1301
1301
|
float: right;
|
|
1302
1302
|
margin-bottom: 12px;
|
|
1303
1303
|
padding: 4px 10px;
|
|
1304
|
-
`,sc=
|
|
1304
|
+
`,sc=he.p`
|
|
1305
1305
|
font-weight: bold;
|
|
1306
1306
|
font-size: 18px;
|
|
1307
1307
|
line-height: 22px;
|
|
1308
1308
|
letter-spacing: calc(18px * -0.01);
|
|
1309
1309
|
margin: 0;
|
|
1310
|
-
`,Xs=
|
|
1310
|
+
`,Xs=he(sc)`
|
|
1311
1311
|
margin-bottom: 4px;
|
|
1312
|
-
`,Js=
|
|
1312
|
+
`,Js=he.div`
|
|
1313
1313
|
display: flex;
|
|
1314
1314
|
flex-flow: row nowrap;
|
|
1315
1315
|
align-items: center;
|
|
1316
1316
|
min-width: 50%;
|
|
1317
|
-
`,lc=
|
|
1317
|
+
`,lc=he.p`
|
|
1318
1318
|
font-weight: bold;
|
|
1319
1319
|
font-size: 16px;
|
|
1320
1320
|
line-height: 20px;
|
|
1321
1321
|
letter-spacing: calc(16px * -0.01);
|
|
1322
1322
|
margin: 0;
|
|
1323
|
-
`,Qs=
|
|
1323
|
+
`,Qs=he(lc)`
|
|
1324
1324
|
margin-bottom: 4px;
|
|
1325
1325
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1326
1326
|
`}
|
|
1327
|
-
`,xt=
|
|
1327
|
+
`,xt=he.p`
|
|
1328
1328
|
color: ${({theme:e})=>e.colorText};
|
|
1329
1329
|
font-weight: normal;
|
|
1330
1330
|
font-size: 14px;
|
|
1331
1331
|
line-height: 22px;
|
|
1332
1332
|
margin: 0;
|
|
1333
|
-
`,Zs=
|
|
1333
|
+
`,Zs=he.p`
|
|
1334
1334
|
color: ${({theme:e})=>e.colorText};
|
|
1335
1335
|
font-weight: 600;
|
|
1336
1336
|
font-size: 12px;
|
|
1337
1337
|
line-height: 16px;
|
|
1338
1338
|
margin: 0;
|
|
1339
|
-
`;xt.Loud=
|
|
1339
|
+
`;xt.Loud=he(xt)`
|
|
1340
1340
|
font-weight: 600;
|
|
1341
|
-
`;xt.Quiet=
|
|
1341
|
+
`;xt.Quiet=he(xt)`
|
|
1342
1342
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1343
1343
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1344
1344
|
`}
|
|
1345
|
-
`;var Rs=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=te(),{primaryCTAClickSideEffects:n}=ae();o=i(o);let{imageUri:r=null,subtitle:s=null,title:p=null,complete:d=!1,blocked:l=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return
|
|
1345
|
+
`;var Rs=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=te(),{primaryCTAClickSideEffects:n}=ae();o=i(o);let{imageUri:r=null,subtitle:s=null,title:p=null,complete:d=!1,blocked:l=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return oo.createElement(Gs,{className:a("carouselCard",o),onClick:l?null:c,style:t,blocked:l,complete:d},r&&oo.createElement(Ks,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||l?.4:1}}),d&&oo.createElement(Ys,{className:a("carouselCompletedPill",o)},oo.createElement(Zs,{style:{color:"#108E0B"}},"Complete")),p&&oo.createElement(Qs,{blocked:l,complete:d,className:a("carouselCardTitle",o)},p),s&&oo.createElement(xt.Quiet,{blocked:l,complete:d,className:a("carouselCardSubtitle",o)},s))};var pc=()=>me.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},me.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),me.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),me.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),el=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=It(!1),[r,s]=It(!1);zr(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&s(!0)},[t]);let p=()=>{n(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?me.createElement(Hs,{style:d,reversed:r,onAnimationEnd:r?p:null},me.createElement(js,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},me.createElement(pc,null))):null},tl=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=ac(null),[r,s]=It(!1),[p,d]=It(!1),[l,m]=It(null),[c,f]=It([]),[y,T]=It(0),{isSmall:S}=Ms(),g=S?1:3,{getFlowMetadata:E,getFlowSteps:P,getNumberOfStepsCompleted:F,updateCustomVariables:A,isLoading:I}=R();zr(()=>{A(o)},[o,I]),zr(()=>{if(I)return;let L=E(e),O=F(e),j=P(e);m(L),L.data!==null&&(f(j.sort((M,G)=>Number(M.complete)-Number(G.complete))),d(j.length>g),T(O))},[I]);let x=[];for(let L=0;L<c.length;L+=g)x.push(c.slice(L,L+g));let v=L=>{let O=L.target,j=O.scrollWidth-O.clientWidth,M=Math.ceil(O.scrollLeft);M>0&&r===!1&&s(!0),M===0&&r===!0&&s(!1),M<j&&p===!1&&d(!0),M===j&&p===!0&&d(!1)},h=(L=!0)=>{let O=L?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*O,behavior:"smooth"})},b=null,N=L=>{b!==null?clearTimeout(b):v(L),b=setTimeout(()=>{v(L)},16)};return I?null:me.createElement(qs,{className:be(a("carouselContainer",t),i)},me.createElement("div",{style:{display:"flex",justifyContent:S?"center":"space-between",marginBottom:20,flexWrap:S?"wrap":"nowrap",gap:S?16:20}},me.createElement("div",null,me.createElement(Xs,{className:a("carouselTitle",t)},l==null?void 0:l.title),me.createElement(xt.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),me.createElement(Js,{className:a("progressWrapper",t)},me.createElement(We,{count:y,total:c.length,appearance:t}))),me.createElement("div",{style:{position:"relative"}},me.createElement(el,{show:r,onClick:()=>h(!1)}),me.createElement(el,{side:"right",show:p,onClick:h}),me.createElement(zs,{ref:n,onScroll:N},x.map((L,O)=>me.createElement(_s,{key:O,style:{flex:`0 0 calc(100% - ${c.length>g?36:0}px)`}},L.map((j,M)=>me.createElement(Rs,{key:M,stepData:j,style:{flex:c.length>g?`0 1 calc(100% / ${g} - 16px * 2 / ${g})`:1},appearance:t})))))),me.createElement(ie,{appearance:t}))};var _r=A=>{var I=A,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:s="inline",onDismiss:p,visible:d,customVariables:l,onStepCompletion:m,onButtonClick:c,appearance:f,hideOnFlowCompletion:y,setVisible:T,customStepTypes:S,checklistStyle:g="default",autoExpandFirstIncompleteStep:E,autoExpandNextStep:P}=I,F=Ie(I,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:x,getFlowSteps:v,markStepCompleted:h,getStepStatus:b,getNumberOfStepsCompleted:N,isLoading:L,targetingLogicShouldHideFlow:O,updateCustomVariables:j,getFlowMetadata:M,isStepBlocked:G,getFlowStatus:le,hasActiveFullPageFlow:pe,setHasActiveFullPageFlow:q}=R(),{primaryCTAClickSideEffects:se,secondaryCTAClickSideEffects:de}=ae(),{getOpenFlowState:Se,setOpenFlowState:V}=Be(),[Y,ee]=rl(n||0),[Ve,Le]=rl(!1),X=d===void 0?Se(e):d,ue=s==="modal",{mergeAppearanceWithDefault:Oe}=te();if(f=Oe(f),ol(()=>{j(l)},[l,L]),ol(()=>{d!==void 0&&(ue&&d===!0?q(!0):ue&&d===!1&&q(!1))},[d,T,pe]),L)return null;let Te=x(e);if(!Te||O(Te))return null;let U=v(e);if(!U||y===!0&&le(e)===Z)return null;let $=M(e);if($!=null&&$.title&&(t=$.title),$!=null&&$.subtitle&&(o=$.subtitle),!Ve&&n===void 0&&N(e)>0){let u=U.findIndex(C=>C.complete===!1);ee(u>-1?u:U.length-1),Le(!0)}function W(){if(Y+1>=U.length){ue&&V(e,!1);return}G(e,U[Y+1].id)||ee(Y+1)}function J(u,C,k){let z=Y+1<U.length?U[Y+1]:null;c&&c(u,Y,C,z)===!0&&ue&&Xe(),m&&m(u,k,z),!m&&!c&&(u.primaryButtonUri||u.secondaryButtonUri)&&ue&&Xe()}function fe(){return U.map((u,C)=>_(w({},u),{handleSecondaryButtonClick:()=>{W(),de(u),u.skippable===!0&&h(e,u.id,{skipped:!0}),J(u,"secondary",C)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(h(e,u.id),W()),J(u,"primary",C),se(u),b(e,u.id)===Ke&&W()}}))}function $e(){return Ce.createElement(ie,{appearance:f})}let Ge={steps:fe(),title:t,subtitle:o,primaryColor:f.theme.colorPrimary,appearance:f,customStepTypes:S,type:s,className:r,autoExpandFirstIncompleteStep:E,autoExpandNextStep:P};function Xe(){V(e,!1),p&&p(),T&&T(!1)}function St(){return Ce.createElement(Ce.Fragment,null,Ce.createElement($e,null),Ce.createElement(tl,{flowId:e,appearance:f,customVariables:l,className:r}))}function Mt(){return Ce.createElement(Ce.Fragment,null,Ce.createElement($e,null),Ce.createElement(Wr,w({visible:X,onClose:()=>{Xe()},selectedStep:Y,setSelectedStep:ee,autoExpandNextStep:!0,appearance:f},Ge)))}function Dt(){var k;let u=F.guideFlowId,C;return u&&x(u)&&(C=v(u)),Ce.createElement(Ce.Fragment,null,Ce.createElement($e,null),Ce.createElement(Ur,w({visible:X,stepsTitle:$.stepsTitle?$.stepsTitle:"Your quick start guide",onClose:()=>{Xe()},selectedStep:Y,setSelectedStep:ee,guideData:C,guideTitle:(k=F.guideTitle)!=null?k:"Guide",appearance:f,title:t,subtitle:o,onGuideButtonClick:z=>{J(z,"link",0)},customStepTypes:S},Ge)))}function bt(){let u=Ce.createElement(Mr,w({flowId:e,style:i,selectedStep:Y,setSelectedStep:ee,appearance:f,type:s},Ge));return ue?Ce.createElement(Qe,{onClose:()=>{Xe()},visible:X,appearance:f,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},Ce.createElement($e,null),u):Ce.createElement(Ce.Fragment,null,Ce.createElement($e,null),u)}switch(g){case"condensed":return Mt();case"with-guide":return Dt();case"default":return bt();case"carousel":return St();default:return bt()}};var cc=e=>dc.createElement(_r,w({type:"inline"},e));import yt,{useEffect as mc}from"react";import tt from"react";import tr from"styled-components";var il=tr.div`
|
|
1346
1346
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1347
1347
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1348
1348
|
padding: 10px 12px 10px 12px;
|
|
1349
1349
|
min-width: 160px;
|
|
1350
1350
|
cursor: pointer;
|
|
1351
1351
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1352
|
-
${e=>
|
|
1352
|
+
${e=>ke(e)}
|
|
1353
1353
|
|
|
1354
1354
|
&:hover {
|
|
1355
1355
|
filter: brightness(.99);
|
|
1356
1356
|
}
|
|
1357
|
-
`,nl=
|
|
1357
|
+
`,nl=tr.div`
|
|
1358
1358
|
display: flex;
|
|
1359
1359
|
flex-direction: row;
|
|
1360
1360
|
justify-content: space-between;
|
|
1361
1361
|
align-items: center;
|
|
1362
1362
|
margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
|
|
1363
1363
|
flex-grow: 2;
|
|
1364
|
-
`,sl=
|
|
1364
|
+
`,sl=tr.div`
|
|
1365
1365
|
text-overflow: ellipsis;
|
|
1366
1366
|
font-weight: 600;
|
|
1367
1367
|
font-size: 14px;
|
|
1368
1368
|
line-height: 16px;
|
|
1369
1369
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1370
1370
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1371
|
-
`,ll=
|
|
1371
|
+
`,ll=tr.div`
|
|
1372
1372
|
width: 20px;
|
|
1373
1373
|
margin-right: 8px;
|
|
1374
1374
|
display: flex;
|
|
1375
1375
|
height: 100%;
|
|
1376
1376
|
align-items: center;
|
|
1377
|
-
`;var al=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:s,type:p="default"})=>tt.createElement(tt.Fragment,null,tt.createElement(ie,{appearance:s}),tt.createElement(il,{onClick:()=>i!==void 0&&i(),styleOverrides:w(w({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:
|
|
1377
|
+
`;var al=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:s,type:p="default"})=>tt.createElement(tt.Fragment,null,tt.createElement(ie,{appearance:s}),tt.createElement(il,{onClick:()=>i!==void 0&&i(),styleOverrides:w(w({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:be(r!=null?r:"",a("progressBadgeContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&tt.createElement(ll,{className:a("progressRingContainer",s)},tt.createElement(jt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),tt.createElement(nl,{type:p,className:a("badgeTitleContainer",s)},tt.createElement(sl,{type:p,appearance:s,className:a("badgeTitle",s)},e),i!==void 0&&tt.createElement(eo,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&tt.createElement(We,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s,textStyle:{color:"#818898"}})));import Ct from"react";import ko from"styled-components";var pl=ko.div`
|
|
1378
1378
|
display: flex;
|
|
1379
1379
|
flex-direction: row;
|
|
1380
1380
|
width: 100%;
|
|
@@ -1384,25 +1384,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1384
1384
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1385
1385
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1386
1386
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1387
|
-
`,dl=
|
|
1387
|
+
`,dl=ko.div`
|
|
1388
1388
|
${e=>B(e)} {
|
|
1389
1389
|
display: flex;
|
|
1390
1390
|
justify-content: center;
|
|
1391
1391
|
align-items: center;
|
|
1392
1392
|
margin-right: 16px;
|
|
1393
1393
|
}
|
|
1394
|
-
`,cl=
|
|
1394
|
+
`,cl=ko.div`
|
|
1395
1395
|
display: flex;
|
|
1396
1396
|
flex-direction: column;
|
|
1397
1397
|
flex: 1;
|
|
1398
1398
|
margin-top: 0;
|
|
1399
|
-
`,ml=
|
|
1399
|
+
`,ml=ko.div`
|
|
1400
1400
|
display: flex;
|
|
1401
1401
|
flex-direction: column;
|
|
1402
1402
|
justify-content: center;
|
|
1403
1403
|
margin-left: 16px;
|
|
1404
1404
|
min-width: 200px;
|
|
1405
|
-
`,NS=
|
|
1405
|
+
`,NS=ko.div`
|
|
1406
1406
|
display: flex;
|
|
1407
1407
|
justify-content: center;
|
|
1408
1408
|
align-items: flex-end;
|
|
@@ -1411,7 +1411,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1411
1411
|
:hover {
|
|
1412
1412
|
opacity: 0.8;
|
|
1413
1413
|
}
|
|
1414
|
-
`;var ul=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:s,style:p})=>Ct.createElement(Ct.Fragment,null,Ct.createElement(pl,{appearance:i,className:
|
|
1414
|
+
`;var ul=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:s,style:p})=>Ct.createElement(Ct.Fragment,null,Ct.createElement(pl,{appearance:i,className:be(a("fullWidthProgressBadgeContainer",i),s!=null?s:""),style:p},o&&Ct.createElement(dl,{className:a("fullWidthProgressBadgeIcon",i)},o),Ct.createElement(cl,null,Ct.createElement(Ae,{size:"small",appearance:i,title:e,subtitle:t})),Ct.createElement(ml,{className:a("fullWidthProgressBadgeProgressContainer",i)},Ct.createElement(We,{count:n,total:r,display:"percent",textLocation:"top"}))));var uc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:l,type:m="default"})=>{let{getFlow:c,getFlowSteps:f,getFlowStatus:y,getNumberOfStepsCompleted:T,isLoading:S,targetingLogicShouldHideFlow:g,updateCustomVariables:E}=R(),{mergeAppearanceWithDefault:P}=te();l=P(l);let{setOpenFlowState:F,getOpenFlowState:A}=Be();if(mc(()=>{E(p)},[p,S]),S)return null;let I=c(e);if(!I||g(I)||d===!0&&y(e)===Z)return null;let x=f(e),v=T(e);return m==="full-width"?yt.createElement(yt.Fragment,null,yt.createElement(ie,{appearance:l}),yt.createElement(ul,{title:t,subtitle:o,count:v,total:x.length,style:n,className:s,appearance:l,icon:i,onClick:()=>{}})):yt.createElement(yt.Fragment,null,yt.createElement(ie,{appearance:l}),yt.createElement(al,{count:v,total:x.length,title:t,style:n,onClick:()=>{F(e,!0),r&&r()},type:m,className:s,appearance:l}))};import fc from"react";var gc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Ie(r,["flowId","style","appearance"]);let{getFlow:s,targetingLogicShouldHideFlow:p,getFlowSteps:d}=R(),{mergeAppearanceWithDefault:l}=te();o=l(o);let m=s(e);if(!m||p(m))return null;let c=d(e);return fc.createElement(Fo,w({steps:c,style:t,appearance:o},i))};import Nt,{useContext as Bc,useEffect as Ec}from"react";import K,{useEffect as or,useLayoutEffect as hl,useRef as bc,useState as ro}from"react";import Po from"styled-components";import{useCallback as hc,useEffect as xc,useState as Cc}from"react";var Hr=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,s=n=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+r}:{x:0,y:0}};function fl(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]=Cc(o),r=hc(()=>{e&&n(e.getBoundingClientRect())},[e]);return xc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as yc,useState as Sc}from"react";function gl(){let{debug:e}=yc(Q),[t,o]=Sc([]);function i(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.log(r)))}function n(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:i,logErrorIfDebugMode:n}}var xl=300,Cl=100,wc=500,io=12,Tc=Po.div`
|
|
1415
1415
|
width: 100%;
|
|
1416
1416
|
height: 100%;
|
|
1417
1417
|
border-radius: 9999px;
|
|
@@ -1434,25 +1434,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1434
1434
|
opacity: 0;
|
|
1435
1435
|
}
|
|
1436
1436
|
}
|
|
1437
|
-
`,Fc=
|
|
1438
|
-
width: ${
|
|
1439
|
-
height: ${
|
|
1437
|
+
`,Fc=Po.div`
|
|
1438
|
+
width: ${io}px;
|
|
1439
|
+
height: ${io}px;
|
|
1440
1440
|
border-radius: 100px;
|
|
1441
1441
|
background-color: ${e=>e.primaryColor};
|
|
1442
1442
|
z-index: 20;
|
|
1443
1443
|
opacity: 1;
|
|
1444
|
-
`,kc=
|
|
1444
|
+
`,kc=Po.div`
|
|
1445
1445
|
pointer-events: all;
|
|
1446
|
-
`,yl=
|
|
1446
|
+
`,yl=Po.div`
|
|
1447
1447
|
display: flex;
|
|
1448
1448
|
align-content: center;
|
|
1449
1449
|
justify-content: center;
|
|
1450
1450
|
align-items: center;
|
|
1451
1451
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1452
|
-
`,Pc=
|
|
1453
|
-
width: ${
|
|
1454
|
-
height: ${
|
|
1455
|
-
`,vc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:m,appearance:c,dismissible:f=!1,showHighlightOnly:y,showStepCount:T=!0,completedStepsCount:S=0,showFrigadeBranding:g=!1,cssPosition:E="absolute"})=>{var $e,Ge,Xe,St
|
|
1452
|
+
`,Pc=Po(yl)`
|
|
1453
|
+
width: ${io+12}px;
|
|
1454
|
+
height: ${io+12}px;
|
|
1455
|
+
`,vc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:m,appearance:c,dismissible:f=!1,showHighlightOnly:y,showStepCount:T=!0,completedStepsCount:S=0,showFrigadeBranding:g=!1,cssPosition:E="absolute"})=>{var $e,Ge,Xe,St,Mt,Dt,bt,u,C,k,z,Fe,ge,wt,vo,Qr,Zr,Rr,ei;let{logErrorIfDebugMode:P}=gl(),[F,A]=ro(),[I,x]=ro(new Date),v=bc(null),[h,b]=ro(document.querySelector(e[l].selector)),N=fl(h,I),[L,O]=ro(),[j,M]=ro(!y),G=(Ge=($e=e[l])==null?void 0:$e.props)!=null&&Ge.position?e[l].props.position:E,le=(Mt=(St=(Xe=e[l])==null?void 0:Xe.props)==null?void 0:St.zIndex)!=null?Mt:90,pe=(Dt=F==null?void 0:F.width)!=null?Dt:xl,q=(bt=F==null?void 0:F.height)!=null?bt:Cl,[se,de]=ro(new Date().getTime());s=(k=(C=(u=e[l])==null?void 0:u.props)==null?void 0:C.offset)!=null?k:s;let Se=window.location.pathname.split("/").pop();hl(()=>{v.current&&A({width:v.current.clientWidth,height:v.current.clientHeight})},[l,I,G]),or(()=>{y||M(!0)},[l]);let V=()=>{let ne=document.querySelector(e[l].selector);if(!ne){O(void 0),b(null),P(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}L&&L===JSON.stringify(ne==null?void 0:ne.getBoundingClientRect())||(b(ne),x(new Date),ne&&O(JSON.stringify(ne.getBoundingClientRect())))};if(or(()=>{let ne=new MutationObserver(V);return ne.observe(document.body,{subtree:!0,childList:!0}),()=>ne.disconnect()},[V]),or(()=>{let ne=new MutationObserver(V);return ne.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>ne.disconnect()},[V]),or(()=>{let ne=setInterval(()=>{V()},10);return()=>clearInterval(ne)},[V]),hl(()=>{setTimeout(()=>{V()},wc),V()},[l,Se]),h===null||!p)return null;let Y=i==="auto"?"right":i,ee=Hr(N,Y,pe,s,G),Ve=N.right+pe>(window.innerWidth||document.documentElement.clientWidth),Le=N.bottom+Cl>(window.innerHeight||document.documentElement.clientHeight);Ve&&i==="auto"&&(ee=Hr(N,"left",pe,s,G),Y="left"),(Fe=(z=e[l])==null?void 0:z.props)!=null&&Fe.tooltipPosition&&((wt=(ge=e[l])==null?void 0:ge.props)==null?void 0:wt.tooltipPosition)!=="auto"&&(((Qr=(vo=e[l])==null?void 0:vo.props)==null?void 0:Qr.tooltipPosition)==="left"||((Rr=(Zr=e[l])==null?void 0:Zr.props)==null?void 0:Rr.tooltipPosition)==="right")&&(Y=e[l].props.tooltipPosition);let X=()=>{let ne=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),M(!1),setTimeout(()=>{V()},30)),S===e.length-1)return o()},mt=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),y&&!e[l].secondaryButtonUri&&M(!1))};return K.createElement(K.Fragment,null,T&&e.length>1&&K.createElement(xi,null,K.createElement(yi,{className:a("tooltipStepCounter",c)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&K.createElement(Ci,{showStepCount:T,className:a("tooltipCTAContainer",c)},e[l].secondaryButtonTitle&&K.createElement(oe,{title:e[l].secondaryButtonTitle,appearance:c,onClick:mt,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&K.createElement(oe,{title:e[l].primaryButtonTitle,appearance:c,onClick:ne,withMargin:!1,size:"small"})))},ue=()=>K.createElement(K.Fragment,null,f&&K.createElement(mi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[l].imageUri||!!e[l].videoUri},K.createElement(Ee,null)),e[l].imageUri&&K.createElement(ui,{dismissible:f,appearance:c,src:e[l].imageUri,className:a("tooltipImageContainer",c)}),e[l].videoUri&&!e[l].imageUri&&K.createElement(fi,{dismissible:f,appearance:c,className:a("tooltipVideoContainer",c)},K.createElement(Re,{appearance:c,videoUri:e[l].videoUri})),K.createElement(hi,{className:a("tooltipContentContainer",c)},K.createElement(Ae,{appearance:c,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),K.createElement(gi,{className:a("tooltipFooter",c)},K.createElement(X,null)))),Te=w(w({},{default:ne=>{var mt;if((mt=e[l])!=null&&mt.StepContent){let ra=e[l].StepContent;return K.createElement("div",null,ra)}return K.createElement(ue,null)}}),m),U=()=>{var ne;return e?!((ne=e[l])!=null&&ne.type)||!Te[e[l].type]?Te.default(e[l]):Te[e[l].type]({stepData:e[l],primaryColor:r}):K.createElement(K.Fragment,null)};if(e[l].complete===!0||ee.x==0&&ee.y==0&&new Date().getTime()-se<100)return null;let $={top:(ee==null?void 0:ee.y)-io,left:(ei=Y=="left"?N.x+s.x:(ee==null?void 0:ee.x)-io)!=null?ei:0,cursor:y?"pointer":"default",position:G},W=()=>{let mt=$.left+(Y=="left"?-pe:24);return Math.min(Math.max(mt,20),window.innerWidth-pe-20)},J=()=>{if(G==="fixed")return $.top;let ne=$.top+q,mt=20;return ne>window.innerHeight-mt?$.top+-q:$.top},fe=()=>{y&&(x(new Date),M(!j))};return K.createElement(kc,null,K.createElement(Pc,{style:$,zIndex:le,className:a("tourHighlightContainer",c)},n&&e[l].showHighlight!==!1&&E!=="static"&&K.createElement(K.Fragment,null,K.createElement(Fc,{style:{position:G},onClick:fe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),K.createElement(Tc,{style:{position:"absolute"},onClick:fe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),K.createElement(yl,{style:_(w({},$),{left:W(),top:J()}),zIndex:le+1,className:a("tooltipContainerWrapper",c)},j&&K.createElement(K.Fragment,null,K.createElement(Io,{ref:v,layoutId:"tooltip-container",style:w({position:"relative",width:"max-content",right:0,top:E!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:xl,zIndex:le+10},K.createElement(U,null)),g&&K.createElement(bi,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:le+10},K.createElement(No,{appearance:c})))))},jr=vc;import{Portal as Ac}from"react-portal";var Oc=S=>{var g=S,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:f=!1,cssPosition:y="absolute"}=g,T=Ie(g,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition"]);let{getFlow:E,getFlowSteps:P,isLoading:F,targetingLogicShouldHideFlow:A,markStepCompleted:I,markStepStarted:x,markFlowCompleted:v,updateCustomVariables:h,getCurrentStepIndex:b,getStepStatus:N,isStepBlocked:L,getFlowStatus:O,getNumberOfStepsCompleted:j}=R(),{isLoadingUserFlowStateData:M}=De(),{primaryCTAClickSideEffects:G,secondaryCTAClickSideEffects:le}=ae(),{hasOpenModals:pe}=Be(),q=b(e),{openFlowStates:se}=Bc(Q),{mergeAppearanceWithDefault:de}=te();if(o=de(o),Ec(()=>{h(t)},[t,F]),M)return null;let Se=E(e);if(!Se||A(Se)||O(e)==Z||pe())return null;let V=P(e);if(Object.keys(se).length>0){let U=Object.keys(se).find($=>se[$]===!0);if(U!==void 0&&U!==e)return Nt.createElement(Nt.Fragment,null)}function Y(U){return D(this,null,function*(){if(yield I(e,U.id),V.map($=>N(e,$.id)).every($=>$===Ke)){yield v(e);return}if(!l&&q+1<V.length&&!r){if(L(e,V[q+1].id))return;yield x(e,V[q+1].id)}})}function ee(U,$,W){let J=q+1<V.length?V[q+1]:null;n&&n(U,q,$,J),i&&i(U,W,J)}function Ve(){return V.map(U=>_(w({},U),{handleSecondaryButtonClick:()=>D(this,null,function*(){le(U),U.skippable===!0&&(yield I(e,U.id,{skipped:!0})),ee(U,"secondary",q)}),handlePrimaryButtonClick:()=>D(this,null,function*(){(!U.completionCriteria&&(U.autoMarkCompleted||U.autoMarkCompleted===void 0)||U.completionCriteria&&U.autoMarkCompleted===!0)&&(yield Y(U)),ee(U,"primary",q),G(U)})}))}function Le(U){return D(this,null,function*(){s&&s(),m==="complete-flow"?yield v(e):yield I(e,U.id)})}function X(){c&&c()}let ue=!document.querySelector(V[q].selector);function Oe(){let U=V.findIndex($=>!!document.querySelector($.selector));return V.map(($,W)=>ue&&!r&&W!==U&&f||!r&&W!==q?null:Nt.createElement(jr,w({key:$.id,appearance:o,steps:Ve(),selectedStep:W,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Le($),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:j(e),onComplete:X,cssPosition:y},T)))}function Te(){return Nt.createElement(Nt.Fragment,null,Nt.createElement(ie,{appearance:o}),Oe())}return y==="static"?Te():Nt.createElement(Ac,null,Te())};import _e,{useEffect as Ic,useRef as Nc,useState as Lc}from"react";import{Portal as $c}from"react-portal";import Lt from"styled-components";var Sl=Lt.button`
|
|
1456
1456
|
${e=>B(e)} {
|
|
1457
1457
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1458
1458
|
|
|
@@ -1470,17 +1470,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1470
1470
|
opacity: 0.8;
|
|
1471
1471
|
}
|
|
1472
1472
|
}
|
|
1473
|
-
`,bl=
|
|
1473
|
+
`,bl=Lt.span`
|
|
1474
1474
|
${e=>B(e)} {
|
|
1475
1475
|
font-size: 12px;
|
|
1476
1476
|
display: inline-block;
|
|
1477
1477
|
}
|
|
1478
|
-
`,wl=
|
|
1478
|
+
`,wl=Lt.span`
|
|
1479
1479
|
${e=>B(e)} {
|
|
1480
1480
|
font-size: 12px;
|
|
1481
1481
|
display: inline-block;
|
|
1482
1482
|
}
|
|
1483
|
-
`,Tl=
|
|
1483
|
+
`,Tl=Lt.div`
|
|
1484
1484
|
position: fixed;
|
|
1485
1485
|
right: 0;
|
|
1486
1486
|
bottom: 0;
|
|
@@ -1490,7 +1490,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1490
1490
|
flex-direction: column;
|
|
1491
1491
|
align-items: flex-end;
|
|
1492
1492
|
z-index: 50;
|
|
1493
|
-
`,Fl=
|
|
1493
|
+
`,Fl=Lt.button`
|
|
1494
1494
|
${e=>B(e)} {
|
|
1495
1495
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1496
1496
|
background-color: #ffffff;
|
|
@@ -1506,7 +1506,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1506
1506
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1507
1507
|
border-radius: 45px;
|
|
1508
1508
|
cursor: pointer;
|
|
1509
|
-
`,kl=
|
|
1509
|
+
`,kl=Lt.div`
|
|
1510
1510
|
${e=>B(e)} {
|
|
1511
1511
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1512
1512
|
background: #ffffff;
|
|
@@ -1523,7 +1523,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1523
1523
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1524
1524
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1525
1525
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1526
|
-
`,Pl=
|
|
1526
|
+
`,Pl=Lt.button`
|
|
1527
1527
|
${e=>B(e)} {
|
|
1528
1528
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1529
1529
|
color: #434343;
|
|
@@ -1540,7 +1540,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1540
1540
|
font-size: 14px;
|
|
1541
1541
|
|
|
1542
1542
|
padding: 8px 12px;
|
|
1543
|
-
`;import vl from"react";var Bl=({style:e,className:t})=>vl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},vl.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 El from"react";var Al=({style:e,className:t})=>El.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"},El.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 Mc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:l,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:y}=R(),{primaryCTAClickSideEffects:T}=ae(),S=Nc(null),[g,E]=Lc(!1),{mergeAppearanceWithDefault:
|
|
1543
|
+
`;import vl from"react";var Bl=({style:e,className:t})=>vl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},vl.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 El from"react";var Al=({style:e,className:t})=>El.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"},El.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 Mc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:l,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:y}=R(),{primaryCTAClickSideEffects:T}=ae(),S=Nc(null),[g,E]=Lc(!1),{mergeAppearanceWithDefault:P}=te();s=P(s),Ic(()=>(document.addEventListener("click",F,!1),()=>{document.removeEventListener("click",F,!1)}),[]);let F=h=>{S.current&&!S.current.contains(h.target)&&E(!1)};if(f)return null;let A=p(e);if(!A||y(A))return null;let I=d(e);if(!I||!i)return null;function x(h,b){!h.completionCriteria&&(h.autoMarkCompleted||h.autoMarkCompleted===void 0)&&l(e,h.id),T(h),o&&o(h,b),E(!1)}function v(){return g&&_e.createElement(kl,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},I.map((h,b)=>_e.createElement(Pl,{className:a("floatingWidgetMenuItem",s),key:b,onClick:()=>x(h,b)},h.title)))}return n=="inline"?_e.createElement("span",{ref:S},_e.createElement(Sl,{style:t,onClick:()=>{E(!g)},className:a("supportButton",s)},_e.createElement(wl,{className:a("supportIconContainer",s)},_e.createElement(Al,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),_e.createElement(bl,{className:a("supportButtonTitle",s)},r)),_e.createElement(v,null)):_e.createElement($c,null,_e.createElement(Tl,{style:t,ref:S},_e.createElement(v,null),_e.createElement(Fl,{onClick:()=>{E(!g)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},_e.createElement(Bl,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import ot,{useEffect as Dc}from"react";import rr from"styled-components";var Ol=rr.div`
|
|
1544
1544
|
${e=>B(e)} {
|
|
1545
1545
|
display: flex;
|
|
1546
1546
|
flex-direction: column;
|
|
@@ -1555,17 +1555,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1555
1555
|
border-radius: 12px;
|
|
1556
1556
|
position: relative;
|
|
1557
1557
|
}
|
|
1558
|
-
`,Il=
|
|
1558
|
+
`,Il=rr.div`
|
|
1559
1559
|
display: flex;
|
|
1560
1560
|
flex-direction: column;
|
|
1561
1561
|
flex: 1;
|
|
1562
|
-
`,Nl=
|
|
1562
|
+
`,Nl=rr.div`
|
|
1563
1563
|
display: flex;
|
|
1564
1564
|
flex-direction: column;
|
|
1565
1565
|
justify-content: center;
|
|
1566
1566
|
align-items: flex-start;
|
|
1567
1567
|
margin-top: 16px;
|
|
1568
|
-
`,Ll=
|
|
1568
|
+
`,Ll=rr.div`
|
|
1569
1569
|
${e=>B(e)} {
|
|
1570
1570
|
position: absolute;
|
|
1571
1571
|
top: 16px;
|
|
@@ -1576,7 +1576,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1576
1576
|
opacity: 0.8;
|
|
1577
1577
|
}
|
|
1578
1578
|
}
|
|
1579
|
-
`;var Uc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:y,getFlowSteps:T,getFlowStatus:S,getCurrentStepIndex:g}=R(),{primaryCTAClickSideEffects:E}=ae(),{mergeAppearanceWithDefault:
|
|
1579
|
+
`;var Uc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:y,getFlowSteps:T,getFlowStatus:S,getCurrentStepIndex:g}=R(),{primaryCTAClickSideEffects:E}=ae(),{mergeAppearanceWithDefault:P}=te();if(n=P(n),Dc(()=>{y(o)},[o,c]),c)return null;let F=d(e);if(!F||f(F)||S(e)===Z)return null;let I=T(e)[g(e)];return ot.createElement(ot.Fragment,null,ot.createElement(ie,{appearance:n}),ot.createElement(Ol,{appearance:n,className:be(a("embeddedTipContainer",n),r),style:s},(p===!0||I.dismissible)&&ot.createElement(Ll,{onClick:()=>D(void 0,null,function*(){yield l(e),t&&t()}),className:a("embeddedTipDismissButton",n)},ot.createElement(Ee,null)),ot.createElement(Il,null,ot.createElement(Ae,{size:"small",appearance:n,title:I.title,subtitle:I.subtitle})),I.primaryButtonTitle&&ot.createElement(Nl,{className:a("embeddedTipCallToActionContainer",n)},ot.createElement(oe,{classPrefix:"embeddedTip",title:I.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>D(void 0,null,function*(){I.handlePrimaryButtonClick(),E(I),!(i&&i(I,g(e),"primary")===!1)&&(yield m(e,I.id),yield l(e))})}))))};import Pe,{useEffect as Wc}from"react";import no from"styled-components";var $l=no.div`
|
|
1580
1580
|
// use the :not annotation
|
|
1581
1581
|
${e=>B(e)} {
|
|
1582
1582
|
display: flex;
|
|
@@ -1588,24 +1588,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1588
1588
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1589
1589
|
border-radius: 12px;
|
|
1590
1590
|
}
|
|
1591
|
-
`,Ml=
|
|
1591
|
+
`,Ml=no.div`
|
|
1592
1592
|
${e=>B(e)} {
|
|
1593
1593
|
display: flex;
|
|
1594
1594
|
width: 46px;
|
|
1595
1595
|
height: 46px;
|
|
1596
1596
|
}
|
|
1597
|
-
`,Dl=
|
|
1597
|
+
`,Dl=no.div`
|
|
1598
1598
|
display: flex;
|
|
1599
1599
|
flex-direction: column;
|
|
1600
1600
|
flex: 1;
|
|
1601
1601
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1602
1602
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1603
|
-
`,Ul=
|
|
1603
|
+
`,Ul=no.div`
|
|
1604
1604
|
display: flex;
|
|
1605
1605
|
flex-direction: column;
|
|
1606
1606
|
justify-content: center;
|
|
1607
1607
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1608
|
-
`,
|
|
1608
|
+
`,Vr=no.div`
|
|
1609
1609
|
display: flex;
|
|
1610
1610
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1611
1611
|
align-items: flex-end;
|
|
@@ -1613,12 +1613,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1613
1613
|
:hover {
|
|
1614
1614
|
opacity: 0.8;
|
|
1615
1615
|
}
|
|
1616
|
-
`,
|
|
1616
|
+
`,Gr=no.div`
|
|
1617
1617
|
display: flex;
|
|
1618
1618
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1619
1619
|
align-items: flex-end;
|
|
1620
1620
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1621
|
-
`;import
|
|
1621
|
+
`;import Kr from"react";var Wl=({style:e,className:t})=>Kr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Kr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Kr.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var zc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:l,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:y,getFlowMetadata:T,getFlowStatus:S,getFlowSteps:g,getCurrentStepIndex:E}=R(),{primaryCTAClickSideEffects:P}=ae(),{mergeAppearanceWithDefault:F}=te();if(s=F(s),Wc(()=>{y(n)},[n,c]),c)return null;let A=l(e);if(!A||f(A)||S(e)===Z)return null;let I=g(e),x=I.length>0?I[E(e)]:T(e);return x!=null&&x.title&&(t=x.title),x!=null&&x.subtitle&&(o=x.subtitle),Pe.createElement(Pe.Fragment,null,Pe.createElement(ie,{appearance:s}),Pe.createElement($l,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&Pe.createElement(Ml,{className:a("bannerIconContainer",s)},d||Pe.createElement(Wl,null)),p==="square"&&x.dismissible&&Pe.createElement(Gr,{type:p,className:a("bannerDismissButtonContainer",s)},Pe.createElement(Vr,{type:p,onClick:()=>D(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",s)},Pe.createElement(Ee,null))),Pe.createElement(Dl,{type:p},Pe.createElement(Ae,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(x==null?void 0:x.primaryButtonTitle)&&Pe.createElement(Ul,{type:p,className:a("bannerCallToActionContainer",s)},Pe.createElement(oe,{title:x==null?void 0:x.primaryButtonTitle,appearance:s,onClick:()=>{P(x),r&&r(x,0,"primary")},classPrefix:"banner"})),p!=="square"&&x.dismissible&&Pe.createElement(Gr,{type:p,className:a("bannerDismissButtonContainer",s)},Pe.createElement(Vr,{type:p,onClick:()=>D(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",s)},Pe.createElement(Ee,null)))))};import re,{useEffect as _c}from"react";import{Portal as Hc}from"react-portal";import ct from"styled-components";var zl=ct.div`
|
|
1622
1622
|
display: flex;
|
|
1623
1623
|
flex-direction: column;
|
|
1624
1624
|
width: 100%;
|
|
@@ -1628,12 +1628,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1628
1628
|
align-items: unset;
|
|
1629
1629
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1630
1630
|
position: ${e=>e.type=="modal"?"fixed":"relative"};
|
|
1631
|
-
|
|
1632
|
-
transform: translate(-50%);
|
|
1633
|
-
bottom: 24px;
|
|
1631
|
+
|
|
1634
1632
|
min-width: 550px;
|
|
1635
1633
|
|
|
1636
1634
|
${e=>e.type=="modal"?`
|
|
1635
|
+
left: 50%;
|
|
1636
|
+
transform: translate(-50%);
|
|
1637
|
+
bottom: 24px;
|
|
1637
1638
|
z-index: 1000;
|
|
1638
1639
|
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
1639
1640
|
border-width: 1px;
|
|
@@ -1660,7 +1661,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1660
1661
|
display: flex;
|
|
1661
1662
|
justify-content: center;
|
|
1662
1663
|
align-items: center;
|
|
1663
|
-
`,
|
|
1664
|
+
`,qr=ct.div`
|
|
1664
1665
|
display: flex;
|
|
1665
1666
|
justify-content: space-between;
|
|
1666
1667
|
margin-top: 16px;
|
|
@@ -1669,14 +1670,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1669
1670
|
display: flex;
|
|
1670
1671
|
justify-content: space-between;
|
|
1671
1672
|
margin-top: 8px;
|
|
1672
|
-
`,
|
|
1673
|
+
`,Yr=ct.div`
|
|
1673
1674
|
font-size: 12px;
|
|
1674
1675
|
line-height: 18px;
|
|
1675
1676
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1676
1677
|
font-style: normal;
|
|
1677
1678
|
font-weight: 400;
|
|
1678
1679
|
letter-spacing: 0.24px;
|
|
1679
|
-
`,
|
|
1680
|
+
`,Xr=ct.div`
|
|
1680
1681
|
display: flex;
|
|
1681
1682
|
flex-direction: column;
|
|
1682
1683
|
flex: 1;
|
|
@@ -1709,7 +1710,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1709
1710
|
opacity: 0.8;
|
|
1710
1711
|
}
|
|
1711
1712
|
}
|
|
1712
|
-
`;var jc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:S,getFlowStatus:g,getFlowMetadata:E}=R(),{primaryCTAClickSideEffects:
|
|
1713
|
+
`;var jc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:S,getFlowStatus:g,getFlowMetadata:E}=R(),{primaryCTAClickSideEffects:P}=ae(),{mergeAppearanceWithDefault:F}=te(),[A,I]=re.useState(null),[x,v]=re.useState(""),h=E(e),{hasOpenModals:b,setKeepCompletedFlowOpenDuringSession:N,shouldKeepCompletedFlowOpenDuringSession:L}=Be();if(n=F(n),_c(()=>{T(o)},[o,f]),f)return null;let O=d(e);if(!O||y(O)||g(e)===Z||c(e)===1&&!L(e)||b())return null;let M=S(e)[c(e)];function G(){var q,se;return re.createElement(re.Fragment,null,re.createElement(Xr,null,re.createElement(Ae,{size:"large",appearance:n,title:M.title,subtitle:M.subtitle})),re.createElement(qr,{className:a("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(de=>re.createElement(_l,{className:a("npsNumberButton",n),selected:A===de+1,key:de,onClick:()=>D(this,null,function*(){N(e),I(de+1),yield m(e,M.id,{score:de+1})}),appearance:n},de+1))),re.createElement(Hl,{appearance:n},re.createElement(Yr,{appearance:n},(q=h==null?void 0:h.negativeLabel)!=null?q:"Not likely at all"),re.createElement(Yr,{appearance:n},(se=h==null?void 0:h.positiveLabel)!=null?se:"Extremely likely")))}function le(){var q;return re.createElement(re.Fragment,null,re.createElement(Xr,null,re.createElement(Ae,{appearance:n,title:(q=M.title)!=null?q:"Why did you choose this score?",size:"large"})),re.createElement(jl,{appearance:n,value:x,onChange:se=>{v(se.target.value)},placeHolder:"Add your optional fedback here..."}),re.createElement(qr,{appearance:n,className:a("npsNumberButtonContainer",n)},re.createElement(oe,{size:"large",withMargin:!1,onClick:()=>D(this,null,function*(){yield l(e),i&&i(M,1,"primary")}),appearance:n,title:M.secondaryButtonTitle||"Skip",secondary:!0}),re.createElement(oe,{size:"large",withMargin:!1,onClick:()=>D(this,null,function*(){yield m(e,M.id,{feedbackText:x}),yield l(e),i&&i(M,1,"primary")}),appearance:n,title:M.primaryButtonTitle||"Submit"})))}function pe(){return c(e)>=2?null:re.createElement(re.Fragment,null,re.createElement(ie,{appearance:n}),re.createElement(zl,{appearance:n,className:be(a("npsSurveyContainer",n),r),style:s,type:p},re.createElement(Vl,{onClick:()=>D(this,null,function*(){yield l(e),t&&t()}),className:a("npsSurveyDismissButton",n)},re.createElement(Ee,null)),c(e)==0&&G(),c(e)==1&&le()))}return p==="inline"?pe():re.createElement(Hc,null,pe())};import ve,{useEffect as Kc}from"react";import $t from"styled-components";var Gl=$t.div`
|
|
1713
1714
|
${e=>B(e)} {
|
|
1714
1715
|
display: flex;
|
|
1715
1716
|
flex-direction: column;
|
|
@@ -1720,21 +1721,21 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1720
1721
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1721
1722
|
position: relative;
|
|
1722
1723
|
}
|
|
1723
|
-
`,Kl
|
|
1724
|
+
`,Kl=$t.div`
|
|
1724
1725
|
display: flex;
|
|
1725
1726
|
flex-direction: column;
|
|
1726
1727
|
flex: 1;
|
|
1727
|
-
`,ql
|
|
1728
|
+
`,ql=$t.div`
|
|
1728
1729
|
display: flex;
|
|
1729
1730
|
flex-direction: row;
|
|
1730
1731
|
justify-content: center;
|
|
1731
1732
|
align-items: stretch;
|
|
1732
1733
|
gap: 16px;
|
|
1733
1734
|
margin-top: 8px;
|
|
1734
|
-
`,Yl
|
|
1735
|
+
`,Yl=$t.div`
|
|
1735
1736
|
margin-top: 16px;
|
|
1736
1737
|
margin-bottom: 16px;
|
|
1737
|
-
`,Xl
|
|
1738
|
+
`,Xl=$t.div`
|
|
1738
1739
|
${e=>B(e)} {
|
|
1739
1740
|
position: absolute;
|
|
1740
1741
|
top: -16px;
|
|
@@ -1745,7 +1746,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1745
1746
|
opacity: 0.8;
|
|
1746
1747
|
}
|
|
1747
1748
|
}
|
|
1748
|
-
`,Jl
|
|
1749
|
+
`,Jl=$t.h1`
|
|
1749
1750
|
${e=>B(e)} {
|
|
1750
1751
|
font-style: normal;
|
|
1751
1752
|
justify-content: center;
|
|
@@ -1759,7 +1760,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1759
1760
|
color: ${e=>e.appearance.theme.colorText};
|
|
1760
1761
|
margin-bottom: 8px;
|
|
1761
1762
|
}
|
|
1762
|
-
`,Ql
|
|
1763
|
+
`,Ql=$t.h2`
|
|
1763
1764
|
${e=>B(e)} {
|
|
1764
1765
|
font-style: normal;
|
|
1765
1766
|
justify-content: center;
|
|
@@ -1776,5 +1777,5 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1776
1777
|
height: 100%;
|
|
1777
1778
|
min-height: 200px;
|
|
1778
1779
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1779
|
-
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(Re,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(Gc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var qc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:l,markFlowCompleted:m,markStepCompleted:c,isLoading:f,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:S,getFlowStatus:g,getCurrentStepIndex:E}=R(),{primaryCTAClickSideEffects:
|
|
1780
|
+
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(Re,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(Gc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var qc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:l,markFlowCompleted:m,markStepCompleted:c,isLoading:f,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:S,getFlowStatus:g,getCurrentStepIndex:E}=R(),{primaryCTAClickSideEffects:P,secondaryCTAClickSideEffects:F}=ae(),{mergeAppearanceWithDefault:A}=te(),{setOpenFlowState:I,getOpenFlowState:x,hasOpenModals:v}=Be(),[h,b]=[x(e,!0),le=>I(e,le)];if(n=A(n),Kc(()=>{T(o)},[o,f]),f)return null;let N=l(e);if(!N||y(N)||g(e)===Z||v())return null;let O=S(e)[E(e)],j=()=>{b(!1),t&&t(),m(e)};function M(){return ve.createElement(ve.Fragment,null,ve.createElement(ie,{appearance:n}),ve.createElement(Gl,{appearance:n,className:be(a("announcementContainer",n),r),style:s},(p===!0||O.dismissible)&&d=="inline"&&ve.createElement(Xl,{onClick:()=>D(this,null,function*(){yield m(e),t&&t()}),className:a("announcementDismissButton",n)},ve.createElement(Ee,null)),ve.createElement(Kl,null,ve.createElement(Jl,{appearance:n,className:a("announcementTitle",n),dangerouslySetInnerHTML:ce(O.title)}),O.subtitle&&ve.createElement(Ql,{appearance:n,className:a("announcementSubtitle",n),dangerouslySetInnerHTML:ce(O.subtitle)})),(O.imageUri||O.videoUri)&&ve.createElement(Yl,{className:a("announcementMediaContainer",n)},ve.createElement(Rl,{appearance:n,stepData:O})),(O.primaryButtonTitle||O.secondaryButtonTitle)&&ve.createElement(ql,{className:a("announcementCTAContainer",n)},O.secondaryButtonTitle&&ve.createElement(oe,{classPrefix:"announcement",title:O.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>D(this,null,function*(){O.handleSecondaryButtonClick(),F(O),i&&i(O,E(e),"secondary")}),secondary:!0}),O.primaryButtonTitle&&ve.createElement(oe,{classPrefix:"announcement",title:O.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>D(this,null,function*(){O.handlePrimaryButtonClick(),P(O),!(i&&i(O,E(e),"primary")===!1)&&(yield c(e,O.id),yield m(e))})}))))}let G={padding:"24px",maxWidth:"400px"};return d==="inline"?M():d!=="center"?ve.createElement(Mo,{modalPosition:d,onClose:j,visible:h,dismissible:p,appearance:n},M()):ve.createElement(Qe,{appearance:n,onClose:j,visible:h,style:G,dismissible:p},M())};import*as ir from"react";import ea from"react";var ta=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Ie(r,["as","children","variant"]);return ea.createElement(Tn,w({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},Yc=Object.fromEntries(Object.keys(Ko).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>ea.createElement(ta,_(w({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),Jr=Object.assign(ta,Yc);var oa=s=>{var p=s,{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 ir.createElement(wn,w({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),ir.createElement(Jr,{color:(d=bo[n])==null?void 0:d.color,fontWeight:"semibold"},i))},Xc=Object.fromEntries(Object.keys(bo).map(e=>{let t=o=>ir.createElement(oa,_(w({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),Jc=Object.assign(oa,Xc);export{So as Box,Jc as Button,nt as CheckBox,ar as FlowType,ft as FormLabel,Sr as FormTextField,qc as FrigadeAnnouncement,zc as FrigadeBanner,_r as FrigadeChecklist,it as FrigadeDefaultAppearance,Uc as FrigadeEmbeddedTip,fn as FrigadeForm,gc as FrigadeGuide,cc as FrigadeHeroChecklist,jc as FrigadeNPSSurvey,uc as FrigadeProgressBadge,wd as FrigadeProvider,Mc as FrigadeSupportWidget,Oc as FrigadeTour,We as ProgressBar,jt as ProgressRing,Jr as Text,Ir as tokens,Be as useFlowOpens,lo as useFlowResponses,R as useFlows,Or as useOrganization,ao as useUser,De as useUserFlowStates};
|
|
1780
1781
|
//# sourceMappingURL=index.mjs.map
|