@frigade/react 1.36.1 → 1.36.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +9 -2
- package/lib/index.js +114 -113
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +183 -182
- 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 Eo=Object.getOwnPropertySymbols;var ni=Object.prototype.hasOwnProperty,si=Object.prototype.propertyIsEnumerable;var ii=(e,t,o)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,b=(e,t)=>{for(var o in t||(t={}))ni.call(t,o)&&ii(e,o,t[o]);if(Eo)for(var o of Eo(t))si.call(t,o)&&ii(e,o,t[o]);return e},j=(e,t)=>na(e,sa(t));var li=e=>typeof e=="symbol"?e:e+"",Ne=(e,t)=>{var o={};for(var i in e)ni.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Eo)for(var i of Eo(e))t.indexOf(i)<0&&si.call(e,i)&&(o[i]=e[i]);return o};var U=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(s){n(s)}},l=d=>{try{p(o.throw(d))}catch(s){n(s)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,l);p((o=o.apply(e,t)).next())});import Bt,{createContext as bd,useEffect as Jo,useState as je}from"react";import{ThemeProvider as wd}from"styled-components";import vt,{useContext as Xp,useEffect as Jt,useState as Co}from"react";import{useCallback as Ft,useContext as ya,useEffect as Sa}from"react";import sr,{useMemo as pi}from"react";var ai="1.36.1 ";var ot="NOT_STARTED_STEP",R="COMPLETED_FLOW",Ao="ABORTED_FLOW",Tt="STARTED_FLOW",Me="NOT_STARTED_FLOW",De="COMPLETED_STEP",Oo="STARTED_STEP";function Je(){let{publicApiKey:e,userId:t,apiUrl:o}=sr.useContext(J);return{config:pi(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":ai,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:pi(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function zt(){let{shouldGracefullyDegrade:e,readonly:t}=sr.useContext(J);return(o,i)=>U(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Wt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Wt();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 s=new Date(p);if(new Date().getTime()-s.getTime()<1e3)return Wt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let l;try{l=yield fetch(o,i)}catch(p){return Wt(p)}return l?l.ok?l:Wt(l.statusText):Wt()})}function Wt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function _t(){let{publicApiKey:e,shouldGracefullyDegrade:t}=sr.useContext(J);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as ha,useState as di}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(J);function r(c,g=!1){var y;return(y=e[c])!=null?y:g}function l(c,g){t(y=>j(b({},y),{[c]:g}))}function p(c){t(g=>{let C=g,{[c]:y}=C,T=Ne(C,[li(c)]);return b({},T)})}function d(c){n.includes(c)||i(g=>[...g,c])}function s(c){return n.includes(c)}function m(c){return Object.entries(e).some(([g,y])=>y&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}import fa from"swr/immutable";import lo from"core-js-pure/actual/structured-clone";function lr(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(!lr(t)||!lr(o))throw new Error("deepmerge can only merge Objects");let i=lo(t);return Object.entries(o).forEach(([n,r])=>{lr(r)?i[n]!==void 0?Object.assign(i,{[n]:xe(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 Ue(){let{config:e,apiUrl:t}=Je(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=da(J),{resetOpenFlowState:d}=Be(),[s,m]=ma(!1),c={data:r.map(S=>({flowId:S.id,flowState:R,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=S=>fetch(S,e).then(k=>{if(k.ok)return k.json();throw new Error("Failed to fetch user flow states")}).catch(k=>(console.log(`Error fetching ${S}: ${k}. Will gracefully degrade and hide Frigade`),l(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:T,isLoading:C,mutate:h,error:A}=p?fa(y,g):ua(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),F=T==null?void 0:T.data;ca(()=>{!s&&!C&&F&&m(!0)},[F,s,C]);function P(S){return U(this,null,function*(){if(F&&!p){let k=F.find(L=>L.flowId===S);k&&k.flowState!==R&&(k.flowState=R),yield h(Promise.resolve(xe(T,{data:F})),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1})}})}function B(S,k,L){return U(this,null,function*(){if(F){let O=F.find(N=>N.flowId===S);O&&(O.stepStates[k]=L,O.flowState=Tt),yield h(Promise.resolve(xe(T,{data:F})),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1})}})}function v(S,k,L){return U(this,null,function*(){if(F){let O=F.find(N=>N.flowId===S);O&&(O.lastStepId=k,O.stepStates[k]=L,O.flowState=Tt),yield h(xe(T,{data:F}),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1})}})}function f(S){return U(this,null,function*(){if(F){let k=F.find(L=>L.flowId===S);k&&k.flowState!==Me&&(k.flowState=Me,k.lastStepId=ga,Object.keys(k.stepStates).forEach(L=>{k.stepStates[L].actionType=ot,k.stepStates[L].createdAt=new Date().toISOString()}),yield h(xe(T,{data:F}),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1}),d(S))}})}function I(S,k,L){return U(this,null,function*(){if(F){let O=F.find(N=>N.flowId===S);O&&(O.stepStates[k]=L),yield h(Promise.resolve(xe(T,{data:F})),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:F,isLoadingUserFlowStateData:!s,mutateUserFlowState:h,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:f,optimisticallyMarkStepCompleted:B,optimisticallyMarkStepNotStarted:I,optimisticallyMarkStepStarted:v,error:A}}function ao(){let{config:e,apiUrl:t}=Je(),{userFlowStatesData:o,mutateUserFlowState:i}=Ue(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=ha(J),[d,s]=di(new Set),[m,c]=di(new Set),g=zt();function y(h){let A=JSON.stringify(h);if(d.has(A))return null;d.add(A),s(d),m.add(h),c(m);let F=l==null?void 0:l.find(P=>P.flowSlug===h.flowSlug&&P.stepId===h.stepId&&P.actionType===h.actionType&&P.createdAt===h.createdAt);return g(`${t}flowResponses`,j(b({},e),{method:"POST",body:A})).then(P=>{P.status!==200&&P.status!==201?(console.log("Failed to send flow response for step "+h.stepId+". Will retry again later."),r([...n,h])):F||p(B=>[...B!=null?B:[],h])})}function T(h){return U(this,null,function*(){h.foreignUserId&&(h.actionType===Tt||h.actionType===Me?yield y(h):h.actionType===R?yield y(h):h.actionType===Oo?yield y(h):h.actionType===De?yield y(h):h.actionType===Ao?yield y(h):h.actionType===ot&&(yield y(h)))})}function C(){let h=[];return o==null||o.forEach(A=>{if(A&&A.stepStates&&Object.keys(A.stepStates).length!==0)for(let F in A.stepStates){let P=A.stepStates[F];h.push({foreignUserId:A.foreignUserId,flowSlug:A.flowId,stepId:P.stepId,actionType:P.actionType,data:{},createdAt:new Date(P.createdAt),blocked:P.blocked,hidden:P.hidden})}}),[...h,...l]}return{addResponse:T,setFlowResponses:p,getFlowResponses:C}}import ba from"swr";var xa=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ci=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 ar(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var pr=(s=>(s.CHECKLIST="CHECKLIST",s.FORM="FORM",s.TOUR="TOUR",s.SUPPORT="SUPPORT",s.CUSTOM="CUSTOM",s.BANNER="BANNER",s.EMBEDDED_TIP="EMBEDDED_TIP",s.NPS_SURVEY="NPS_SURVEY",s.ANNOUNCEMENT="ANNOUNCEMENT",s))(pr||{});function X(){let{config:e,apiUrl:t}=Je(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,readonly:y}=ya(J),T={data:[]},{verifySDKInitiated:C}=_t(),{addResponse:h,getFlowResponses:A}=ao(),F=x=>fetch(x,e).then(u=>u.ok?u.json():(console.log(`Error fetching ${x} (${u.status}): ${u.statusText}. Will gracefully degrade and hide Frigade`),g(!0),T)).catch(u=>(console.log(`Error fetching ${x}: ${u}. Will gracefully degrade and hide Frigade`),g(!0),T)),{mutateUserFlowState:P,userFlowStatesData:B,isLoadingUserFlowStateData:v,optimisticallyMarkFlowCompleted:f,optimisticallyMarkFlowNotStarted:I,optimisticallyMarkStepCompleted:S,optimisticallyMarkStepNotStarted:k,optimisticallyMarkStepStarted:L}=Ue(),{data:O,error:N,isLoading:V}=ba(l?`${t}flows${y?"?readonly=true":""}`:null,F,{keepPreviousData:!0});Sa(()=>{if(N){console.error(N);return}O&&O.data&&i(O.data)},[O,N]);function W(x){if(V)return null;let u=o.find(w=>w.slug===x);return!u&&o.length>0&&!v&&!V?(console.log(`Flow with id ${x} not found`),null):(u==null?void 0:u.active)===!1&&!y?null:u}function Y(x){var z,de;if(!W(x))return[];let u=W(x).data;return u?(u=Q(u),((de=(z=ar(u))==null?void 0:z.data)!=null?de:[]).map(ce=>{let wt=ie(ce);return j(b({handleSecondaryButtonClick:()=>{ce.skippable===!0&&re(x,ce.id,{skipped:!0})}},ce),{complete:Fe(x,ce.id)===De||wt>=1,blocked:ye(x,ce.id),hidden:$e(x,ce.id),handlePrimaryButtonClick:()=>{(!ce.completionCriteria&&(ce.autoMarkCompleted||ce.autoMarkCompleted===void 0)||ce.completionCriteria&&ce.autoMarkCompleted===!0)&&re(x,ce.id)},progress:wt})}).filter(ce=>ce.hidden!==!0)):[]}function Q(x){return x.replaceAll(/\${(.*?)}/g,(u,w)=>p[w]===void 0?"":String(p[w]).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(x){var w;if(!W(x))return[];let u=W(x).data;return u?(u=Q(u),(w=JSON.parse(u))!=null?w:{}):[]}function H(x,u){d(w=>j(b({},w),{[x]:u}))}function le(x){!v&&!V&&x&&JSON.stringify(p)!=JSON.stringify(b(b({},p),x))&&Object.keys(x).forEach(u=>{H(u,x[u])})}let fe=Ft((x,u,w)=>U(this,null,function*(){if(!C())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:u,actionType:Oo,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};he(z)&&(yield L(x,u,z),h(z))}),[n,r,B]),Te=Ft((x,u,w)=>U(this,null,function*(){if(!C())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:u,actionType:ot,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};he(z)&&(yield k(x,u,z),h(z))}),[n,r,B]),re=Ft((x,u,w)=>U(this,null,function*(){if(!C())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:u,actionType:De,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};he(z)&&(yield S(x,u,z),h(z))}),[n,r,B]),Z=Ft((x,u)=>U(this,null,function*(){if(!C()||Oe(x)===Me)return;let w={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:"unknown",actionType:Me,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};yield I(x),he(w)&&h(w)}),[n,r,B]),q=Ft((x,u)=>U(this,null,function*(){if(!C())return;let w={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:"unknown",actionType:Tt,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};he(w)&&h(w)}),[n,r,B]),_=Ft((x,u)=>U(this,null,function*(){if(!C())return;let w={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:"unknown",actionType:R,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};he(w)&&(yield f(x),h(w))}),[n,r,B]),Le=Ft((x,u)=>U(this,null,function*(){if(!C())return;let w={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:"unknown",actionType:Ao,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};he(w)&&(yield f(x),h(w))}),[n,r,B]);function he(x){var u;if(B===void 0)return!1;if(B){let w=B.find(z=>z.flowId===x.flowSlug);if(x.actionType===ot&&(!(w!=null&&w.stepStates[x.stepId])||w.stepStates[x.stepId].actionType===ot))return!1;if(w&&((u=w.stepStates[x.stepId])==null?void 0:u.actionType)===x.actionType){if(x.actionType===De&&JSON.stringify(x.data)===JSON.stringify({}))return!1;let z=Object.keys(w.stepStates).sort((de,ce)=>{let wt=new Date(w.stepStates[de].createdAt),Bo=new Date(w.stepStates[ce].createdAt);return wt.getTime()-Bo.getTime()});if(w.stepStates[z[z.length-1]].actionType===x.actionType&&x.stepId===z[z.length-1])return!1}if(w&&w.flowState===R&&x.actionType===R)return!1}return!0}function Fe(x,u){let w=$(x,u);return v?null:w?w.actionType:ot}function ye(x,u){let w=$(x,u);return w?w.blocked:!1}function $e(x,u){let w=$(x,u);return w?w.hidden:!1}function $(x,u){var z;if(v)return null;let w=B==null?void 0:B.find(de=>de.flowId===x);return!w||!w.stepStates[u]?null:(z=w.stepStates[u])!=null?z:null}function M(x){var w,z;if(v||!B)return null;if(Oe(x)===Me)return(w=Y(x)[0])!=null?w:null;let u=(z=B.find(de=>de.flowId===x))==null?void 0:z.lastStepId;return u?Y(x).find(de=>de.id===u):null}function D(x){var z;let u=M(x);if(!u)return 0;let w=(z=Y(x).findIndex(de=>de.id===u.id))!=null?z:0;return Fe(x,u.id)===De&&w<Y(x).length-1?w+1:w}function ie(x){if(!x.completionCriteria)return;let u=ci(x.completionCriteria);if(u===null)return;let w=bt(u),z=Ge(u);return z===0?void 0:w/z}function Oe(x){let u=B==null?void 0:B.find(w=>w.flowId===x);return u?u.flowState:null}function bt(x){let u=Y(x);return u.length===0?0:u.filter(z=>Fe(x,z.id)===De).length}function Ge(x){return Y(x).length}function mt(x){let u=o.find(w=>w.slug===x);return u?ar(u.data):null}function Ke(x){if(y)return!1;if(v)return!0;if(x!=null&&x.targetingLogic&&B){let u=B.find(w=>w.flowId===x.slug);if(u)return u.shouldTrigger===!1}return!!(x!=null&&x.targetingLogic&&n&&n.startsWith("guest_"))}function Mt(x){return!Ke(W(x))}function Dt(){n&&P()}function Ut(){return o}return{getAllFlows:Ut,getFlow:W,getFlowData:mt,isLoading:v||V,getStepStatus:Fe,getFlowSteps:Y,getCurrentStepIndex:D,markStepStarted:fe,markStepCompleted:re,markFlowNotStarted:Z,markFlowStarted:q,markFlowCompleted:_,markFlowAborted:Le,markStepNotStarted:Te,getFlowStatus:Oe,getNumberOfStepsCompleted:bt,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:Ke,setCustomVariable:H,updateCustomVariables:le,customVariables:p,getStepOptionalProgress:ie,getFlowMetadata:pe,isStepBlocked:ye,isStepHidden:$e,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Mt,refresh:Dt}}import{useCallback as dr,useContext as wa,useEffect as Ta}from"react";var Ht="guest_";function po(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=wa(J),{config:r,apiUrl:l}=Je(),{mutateUserFlowState:p}=Ue(),d=zt(),{verifySDKInitiated:s}=_t();function m(T){return`frigade-user-registered-${T}`}Ta(()=>{if(e&&!t){if(e.startsWith(Ht))return;let T=m(e);localStorage.getItem(T)||(d(`${l}users`,j(b({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(T,"true"))}},[e,n,t]);let c=dr(T=>U(this,null,function*(){if(!s())return;let C={foreignId:e,properties:T};yield d(`${l}users`,j(b({},r),{method:"POST",body:JSON.stringify(C)})),i(h=>b(b({},h),T)),p()}),[e,r,n,p]),g=dr((T,C)=>U(this,null,function*(){if(!s())return;let A={foreignId:e,events:[{event:T,properties:C}]};yield d(`${l}users`,j(b({},r),{method:"POST",body:JSON.stringify(A)})),p()}),[e,r,p]),y=dr((T,C)=>U(this,null,function*(){if(s())if(C){let h=m(T);localStorage.setItem(h,"true"),o(T);let A={foreignId:T,properties:C};yield d(`${l}users`,j(b({},r),{method:"POST",body:JSON.stringify(A)})),i(F=>b(b({},F),C)),p()}else o(T)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g}}import{v4 as Qp}from"uuid";import Re,{useEffect as gn,useState as qp}from"react";import qe,{useEffect as fr,useState as Na}from"react";import $o from"styled-components";import Fa from"react";import ka from"styled-components";var mi="fr-",co="cfr-";function a(e,t){let o=`${mi}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+co+e}return o}function E(e){if(!e.className||e.className.indexOf(co)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(mi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function No(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=>`${No(t)}: ${e.styleOverrides[t]};`).join(" "):""}function be(...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 Eo=Object.getOwnPropertySymbols;var si=Object.prototype.hasOwnProperty,li=Object.prototype.propertyIsEnumerable;var ni=(e,t,o)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,b=(e,t)=>{for(var o in t||(t={}))si.call(t,o)&&ni(e,o,t[o]);if(Eo)for(var o of Eo(t))li.call(t,o)&&ni(e,o,t[o]);return e},j=(e,t)=>na(e,sa(t));var ai=e=>typeof e=="symbol"?e:e+"",Ne=(e,t)=>{var o={};for(var i in e)si.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Eo)for(var i of Eo(e))t.indexOf(i)<0&&li.call(e,i)&&(o[i]=e[i]);return o};var U=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(s){n(s)}},l=d=>{try{p(o.throw(d))}catch(s){n(s)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,l);p((o=o.apply(e,t)).next())});import Et,{createContext as bd,useEffect as Jo,useState as je}from"react";import{ThemeProvider as wd}from"styled-components";import Bt,{useContext as Xp,useEffect as Xt,useState as yo}from"react";import{useCallback as kt,useContext as ya,useEffect as Sa}from"react";import lr,{useMemo as di}from"react";var pi="1.36.3 ";var ot="NOT_STARTED_STEP",R="COMPLETED_FLOW",Ao="ABORTED_FLOW",Ft="STARTED_FLOW",Me="NOT_STARTED_FLOW",De="COMPLETED_STEP",Oo="STARTED_STEP";function Je(){let{publicApiKey:e,userId:t,apiUrl:o}=lr.useContext(J);return{config:di(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":pi,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:di(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function _t(){let{shouldGracefullyDegrade:e,readonly:t}=lr.useContext(J);return(o,i)=>U(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return zt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),zt();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 s=new Date(p);if(new Date().getTime()-s.getTime()<1e3)return zt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let l;try{l=yield fetch(o,i)}catch(p){return zt(p)}return l?l.ok?l:zt(l.statusText):zt()})}function zt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Ht(){let{publicApiKey:e,shouldGracefullyDegrade:t}=lr.useContext(J);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as ha,useState as ci}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(J);function r(c,g=!1){var y;return(y=e[c])!=null?y:g}function l(c,g){t(y=>j(b({},y),{[c]:g}))}function p(c){t(g=>{let C=g,{[c]:y}=C,T=Ne(C,[ai(c)]);return b({},T)})}function d(c){n.includes(c)||i(g=>[...g,c])}function s(c){return n.includes(c)}function m(c){return Object.entries(e).some(([g,y])=>y&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}import fa from"swr/immutable";import ao from"core-js-pure/actual/structured-clone";function ar(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(!ar(t)||!ar(o))throw new Error("deepmerge can only merge Objects");let i=ao(t);return Object.entries(o).forEach(([n,r])=>{ar(r)?i[n]!==void 0?Object.assign(i,{[n]:xe(i[n],ao(r))}):Object.assign(i,{[n]:ao(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...ao(r)]}):Object.assign(i,{[n]:ao(r)}):Object.assign(i,{[n]:r})}),i}var ga="unknown";function Ue(){let{config:e,apiUrl:t}=Je(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=da(J),{resetOpenFlowState:d}=Be(),[s,m]=ma(!1),c={data:r.map(S=>({flowId:S.id,flowState:R,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=S=>fetch(S,e).then(k=>{if(k.ok)return k.json();throw new Error("Failed to fetch user flow states")}).catch(k=>(console.log(`Error fetching ${S}: ${k}. Will gracefully degrade and hide Frigade`),l(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:T,isLoading:C,mutate:h,error:A}=p?fa(y,g):ua(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),F=T==null?void 0:T.data;ca(()=>{!s&&!C&&F&&m(!0)},[F,s,C]);function P(S){return U(this,null,function*(){if(F&&!p){let k=F.find(L=>L.flowId===S);k&&k.flowState!==R&&(k.flowState=R),yield h(Promise.resolve(xe(T,{data:F})),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1})}})}function v(S,k,L){return U(this,null,function*(){if(F){let O=F.find(N=>N.flowId===S);O&&(O.stepStates[k]=L,O.flowState=Ft),yield h(Promise.resolve(xe(T,{data:F})),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1})}})}function B(S,k,L){return U(this,null,function*(){if(F){let O=F.find(N=>N.flowId===S);O&&(O.lastStepId=k,O.stepStates[k]=L,O.flowState=Ft),yield h(xe(T,{data:F}),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1})}})}function f(S){return U(this,null,function*(){if(F){let k=F.find(L=>L.flowId===S);k&&k.flowState!==Me&&(k.flowState=Me,k.lastStepId=ga,Object.keys(k.stepStates).forEach(L=>{k.stepStates[L].actionType=ot,k.stepStates[L].createdAt=new Date().toISOString()}),yield h(xe(T,{data:F}),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1}),d(S))}})}function I(S,k,L){return U(this,null,function*(){if(F){let O=F.find(N=>N.flowId===S);O&&(O.stepStates[k]=L),yield h(Promise.resolve(xe(T,{data:F})),{optimisticData:xe(T,{data:F}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:F,isLoadingUserFlowStateData:!s,mutateUserFlowState:h,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:f,optimisticallyMarkStepCompleted:v,optimisticallyMarkStepNotStarted:I,optimisticallyMarkStepStarted:B,error:A}}function po(){let{config:e,apiUrl:t}=Je(),{userFlowStatesData:o,mutateUserFlowState:i}=Ue(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=ha(J),[d,s]=ci(new Set),[m,c]=ci(new Set),g=_t();function y(h){let A=JSON.stringify(h);if(d.has(A))return null;d.add(A),s(d),m.add(h),c(m);let F=l==null?void 0:l.find(P=>P.flowSlug===h.flowSlug&&P.stepId===h.stepId&&P.actionType===h.actionType&&P.createdAt===h.createdAt);return g(`${t}flowResponses`,j(b({},e),{method:"POST",body:A})).then(P=>{P.status!==200&&P.status!==201?(console.log("Failed to send flow response for step "+h.stepId+". Will retry again later."),r([...n,h])):F||p(v=>[...v!=null?v:[],h])})}function T(h){return U(this,null,function*(){h.foreignUserId&&(h.actionType===Ft||h.actionType===Me?yield y(h):h.actionType===R?yield y(h):h.actionType===Oo?yield y(h):h.actionType===De?yield y(h):h.actionType===Ao?yield y(h):h.actionType===ot&&(yield y(h)))})}function C(){let h=[];return o==null||o.forEach(A=>{if(A&&A.stepStates&&Object.keys(A.stepStates).length!==0)for(let F in A.stepStates){let P=A.stepStates[F];h.push({foreignUserId:A.foreignUserId,flowSlug:A.flowId,stepId:P.stepId,actionType:P.actionType,data:{},createdAt:new Date(P.createdAt),blocked:P.blocked,hidden:P.hidden})}}),[...h,...l]}return{addResponse:T,setFlowResponses:p,getFlowResponses:C}}import ba from"swr";var xa=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,mi=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 pr(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var dr=(s=>(s.CHECKLIST="CHECKLIST",s.FORM="FORM",s.TOUR="TOUR",s.SUPPORT="SUPPORT",s.CUSTOM="CUSTOM",s.BANNER="BANNER",s.EMBEDDED_TIP="EMBEDDED_TIP",s.NPS_SURVEY="NPS_SURVEY",s.ANNOUNCEMENT="ANNOUNCEMENT",s))(dr||{});function X(){let{config:e,apiUrl:t}=Je(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,readonly:y}=ya(J),T={data:[]},{verifySDKInitiated:C}=Ht(),{addResponse:h,getFlowResponses:A}=po(),F=x=>fetch(x,e).then(u=>u.ok?u.json():(console.log(`Error fetching ${x} (${u.status}): ${u.statusText}. Will gracefully degrade and hide Frigade`),g(!0),T)).catch(u=>(console.log(`Error fetching ${x}: ${u}. Will gracefully degrade and hide Frigade`),g(!0),T)),{mutateUserFlowState:P,userFlowStatesData:v,isLoadingUserFlowStateData:B,optimisticallyMarkFlowCompleted:f,optimisticallyMarkFlowNotStarted:I,optimisticallyMarkStepCompleted:S,optimisticallyMarkStepNotStarted:k,optimisticallyMarkStepStarted:L}=Ue(),{data:O,error:N,isLoading:V}=ba(l?`${t}flows${y?"?readonly=true":""}`:null,F,{keepPreviousData:!0});Sa(()=>{if(N){console.error(N);return}O&&O.data&&i(O.data)},[O,N]);function W(x){if(V)return null;let u=o.find(w=>w.slug===x);return!u&&o.length>0&&!B&&!V?(console.log(`Flow with id ${x} not found`),null):(u==null?void 0:u.active)===!1&&!y?null:u}function Y(x){var z,ce;if(!W(x))return[];let u=W(x).data;return u?(u=Q(u),((ce=(z=pr(u))==null?void 0:z.data)!=null?ce:[]).map(ae=>{let wt=ie(ae);return j(b({handleSecondaryButtonClick:()=>{ae.skippable===!0&&re(x,ae.id,{skipped:!0})}},ae),{complete:Fe(x,ae.id)===De||wt>=1,currentlyActive:v==null?void 0:v.some(Tt=>Tt.flowId==x&&Tt.lastStepId===ae.id),blocked:ye(x,ae.id),hidden:$e(x,ae.id),handlePrimaryButtonClick:()=>{(!ae.completionCriteria&&(ae.autoMarkCompleted||ae.autoMarkCompleted===void 0)||ae.completionCriteria&&ae.autoMarkCompleted===!0)&&re(x,ae.id)},progress:wt})}).filter(ae=>ae.hidden!==!0)):[]}function Q(x){return x.replaceAll(/\${(.*?)}/g,(u,w)=>p[w]===void 0?"":String(p[w]).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 de(x){var w;if(!W(x))return[];let u=W(x).data;return u?(u=Q(u),(w=JSON.parse(u))!=null?w:{}):[]}function H(x,u){d(w=>j(b({},w),{[x]:u}))}function le(x){!B&&!V&&x&&JSON.stringify(p)!=JSON.stringify(b(b({},p),x))&&Object.keys(x).forEach(u=>{H(u,x[u])})}let fe=kt((x,u,w)=>U(this,null,function*(){if(!C())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:u,actionType:Oo,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};he(z)&&(yield L(x,u,z),h(z))}),[n,r,v]),Te=kt((x,u,w)=>U(this,null,function*(){if(!C())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:u,actionType:ot,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};he(z)&&(yield k(x,u,z),h(z))}),[n,r,v]),re=kt((x,u,w)=>U(this,null,function*(){if(!C())return;let z={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:u,actionType:De,data:w!=null?w:{},createdAt:new Date,blocked:!1,hidden:!1};he(z)&&(yield S(x,u,z),h(z))}),[n,r,v]),Z=kt((x,u)=>U(this,null,function*(){if(!C()||Oe(x)===Me)return;let w={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:"unknown",actionType:Me,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};yield I(x),he(w)&&h(w)}),[n,r,v]),q=kt((x,u)=>U(this,null,function*(){if(!C())return;let w={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:"unknown",actionType:Ft,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};he(w)&&h(w)}),[n,r,v]),_=kt((x,u)=>U(this,null,function*(){if(!C())return;let w={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:"unknown",actionType:R,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};he(w)&&(yield f(x),h(w))}),[n,r,v]),Le=kt((x,u)=>U(this,null,function*(){if(!C())return;let w={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:x,stepId:"unknown",actionType:Ao,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};he(w)&&(yield f(x),h(w))}),[n,r,v]);function he(x){var u;if(v===void 0)return!1;if(v){let w=v.find(z=>z.flowId===x.flowSlug);if(x.actionType===ot&&(!(w!=null&&w.stepStates[x.stepId])||w.stepStates[x.stepId].actionType===ot))return!1;if(w&&((u=w.stepStates[x.stepId])==null?void 0:u.actionType)===x.actionType){if(x.actionType===De&&(!x.data||JSON.stringify(x.data)===JSON.stringify({})))return!1;let z=Object.keys(w.stepStates).sort((ce,ae)=>{let wt=new Date(w.stepStates[ce].createdAt),Tt=new Date(w.stepStates[ae].createdAt);return wt.getTime()-Tt.getTime()});if(w.stepStates[z[z.length-1]].actionType===x.actionType&&x.stepId===z[z.length-1])return!1}if(w&&w.flowState===R&&x.actionType===R)return!1}return!0}function Fe(x,u){let w=$(x,u);return B?null:w?w.actionType:ot}function ye(x,u){let w=$(x,u);return w?w.blocked:!1}function $e(x,u){let w=$(x,u);return w?w.hidden:!1}function $(x,u){var z;if(B)return null;let w=v==null?void 0:v.find(ce=>ce.flowId===x);return!w||!w.stepStates[u]?null:(z=w.stepStates[u])!=null?z:null}function M(x){var w,z;if(B||!v)return null;if(Oe(x)===Me)return(w=Y(x)[0])!=null?w:null;let u=(z=v.find(ce=>ce.flowId===x))==null?void 0:z.lastStepId;return u?Y(x).find(ce=>ce.id===u):null}function D(x){var z;let u=M(x);if(!u)return 0;let w=(z=Y(x).findIndex(ce=>ce.id===u.id))!=null?z:0;return Fe(x,u.id)===De&&w<Y(x).length-1?w+1:w}function ie(x){if(!x.completionCriteria)return;let u=mi(x.completionCriteria);if(u===null)return;let w=bt(u),z=Ge(u);return z===0?void 0:w/z}function Oe(x){let u=v==null?void 0:v.find(w=>w.flowId===x);return u?u.flowState:null}function bt(x){let u=Y(x);return u.length===0?0:u.filter(z=>Fe(x,z.id)===De).length}function Ge(x){return Y(x).length}function mt(x){let u=o.find(w=>w.slug===x);return u?pr(u.data):null}function Ke(x){if(y)return!1;if(B)return!0;if(x!=null&&x.targetingLogic&&v){let u=v.find(w=>w.flowId===x.slug);if(u)return u.shouldTrigger===!1}return!!(x!=null&&x.targetingLogic&&n&&n.startsWith("guest_"))}function Dt(x){return!Ke(W(x))}function Ut(){n&&P()}function Wt(){return o}return{getAllFlows:Wt,getFlow:W,getFlowData:mt,isLoading:B||V,getStepStatus:Fe,getFlowSteps:Y,getCurrentStepIndex:D,markStepStarted:fe,markStepCompleted:re,markFlowNotStarted:Z,markFlowStarted:q,markFlowCompleted:_,markFlowAborted:Le,markStepNotStarted:Te,getFlowStatus:Oe,getNumberOfStepsCompleted:bt,getNumberOfSteps:Ge,targetingLogicShouldHideFlow:Ke,setCustomVariable:H,updateCustomVariables:le,customVariables:p,getStepOptionalProgress:ie,getFlowMetadata:de,isStepBlocked:ye,isStepHidden:$e,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Dt,refresh:Ut}}import{useCallback as cr,useContext as wa,useEffect as Ta}from"react";var Vt="guest_";function co(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=wa(J),{config:r,apiUrl:l}=Je(),{mutateUserFlowState:p}=Ue(),d=_t(),{verifySDKInitiated:s}=Ht();function m(T){return`frigade-user-registered-${T}`}Ta(()=>{if(e&&!t){if(e.startsWith(Vt))return;let T=m(e);localStorage.getItem(T)||(d(`${l}users`,j(b({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(T,"true"))}},[e,n,t]);let c=cr(T=>U(this,null,function*(){if(!s())return;let C={foreignId:e,properties:T};yield d(`${l}users`,j(b({},r),{method:"POST",body:JSON.stringify(C)})),i(h=>b(b({},h),T)),p()}),[e,r,n,p]),g=cr((T,C)=>U(this,null,function*(){if(!s())return;let A={foreignId:e,events:[{event:T,properties:C}]};yield d(`${l}users`,j(b({},r),{method:"POST",body:JSON.stringify(A)})),p()}),[e,r,p]),y=cr((T,C)=>U(this,null,function*(){if(s())if(C){let h=m(T);localStorage.setItem(h,"true"),o(T);let A={foreignId:T,properties:C};yield d(`${l}users`,j(b({},r),{method:"POST",body:JSON.stringify(A)})),i(F=>b(b({},F),C)),p()}else o(T)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g}}import{v4 as Qp}from"uuid";import Re,{useEffect as hn,useState as qp}from"react";import qe,{useEffect as gr,useState as Na}from"react";import $o from"styled-components";import Fa from"react";import ka from"styled-components";var ui="fr-",mo="cfr-";function a(e,t){let o=`${ui}${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+" "+mo+e}return o}function E(e){if(!e.className||e.className.indexOf(mo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(ui)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function No(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=>`${No(t)}: ${e.styleOverrides[t]};`).join(" "):""}function be(...e){return e.filter(Boolean).join(" ")}function uo(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
|
-
`,
|
|
26
|
+
`,fi=({onClose:e,appearance:t})=>Fa.createElement(Pa,{className:a("modalBackground",t),onClick:()=>e()});import mr from"react";import va from"styled-components";var Ba=va.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,Ee=()=>
|
|
30
|
+
`,Ee=()=>mr.createElement(Ba,null,mr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},mr.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Ia}from"react-portal";import vi from"react";import ur from"react";function Ea({style:e,className:t}){return ur.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},ur.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"}),ur.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 gi=Ea;import fr from"styled-components";import rt from"styled-components";var Io=rt.div`
|
|
31
31
|
${e=>E(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
@@ -57,11 +57,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
57
57
|
position: absolute;
|
|
58
58
|
top: 12px;
|
|
59
59
|
right: 12px;
|
|
60
|
-
`,
|
|
60
|
+
`,hi=rt.div`
|
|
61
61
|
${e=>E(e)} {
|
|
62
62
|
${e=>e.hasImage?Aa:Oa};
|
|
63
63
|
}
|
|
64
|
-
`,
|
|
64
|
+
`,xi=rt.img`
|
|
65
65
|
${e=>E(e)} {
|
|
66
66
|
display: block;
|
|
67
67
|
width: 100%;
|
|
@@ -69,7 +69,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
69
69
|
min-height: 200px;
|
|
70
70
|
object-fit: cover;
|
|
71
71
|
}
|
|
72
|
-
`,
|
|
72
|
+
`,Ci=rt.div`
|
|
73
73
|
${e=>E(e)} {
|
|
74
74
|
display: block;
|
|
75
75
|
width: 100%;
|
|
@@ -77,19 +77,19 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
77
77
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
78
78
|
object-fit: cover;
|
|
79
79
|
}
|
|
80
|
-
`,
|
|
80
|
+
`,yi=rt.div`
|
|
81
81
|
display: flex;
|
|
82
82
|
flex-direction: row;
|
|
83
83
|
justify-content: space-between;
|
|
84
84
|
align-content: center;
|
|
85
|
-
`,yi=rt.div`
|
|
86
|
-
padding: 22px 22px 12px;
|
|
87
85
|
`,Si=rt.div`
|
|
86
|
+
padding: 22px 22px 12px;
|
|
87
|
+
`,bi=rt.div`
|
|
88
88
|
display: flex;
|
|
89
89
|
flex: 1;
|
|
90
90
|
flex-direction: column;
|
|
91
91
|
justify-content: center;
|
|
92
|
-
`,
|
|
92
|
+
`,wi=rt.div`
|
|
93
93
|
display: flex;
|
|
94
94
|
flex: 2;
|
|
95
95
|
flex-shrink: 1;
|
|
@@ -101,7 +101,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
101
101
|
align-content: center;
|
|
102
102
|
align-items: center;
|
|
103
103
|
}
|
|
104
|
-
`,
|
|
104
|
+
`,Ti=rt.p`
|
|
105
105
|
${e=>E(e)} {
|
|
106
106
|
font-style: normal;
|
|
107
107
|
font-weight: 600;
|
|
@@ -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
|
|
113
|
+
`;var Fi=fr.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
|
-
`,
|
|
124
|
+
`,ki=fr(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
|
-
`,
|
|
137
|
+
`,Pi=fr.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 Lo({appearance:e}){return
|
|
146
|
+
`;function Lo({appearance:e}){return vi.createElement(Pi,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",vi.createElement(gi,null))}var La=$o.div`
|
|
147
147
|
${e=>E(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}};
|
|
@@ -205,7 +205,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
205
205
|
::-webkit-scrollbar {
|
|
206
206
|
display: none;
|
|
207
207
|
}
|
|
208
|
-
`,Xe=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:l=!0,showFrigadeBranding:p=!1})=>{let[d,s]=Na("");return
|
|
208
|
+
`,Xe=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:l=!0,showFrigadeBranding:p=!1})=>{let[d,s]=Na("");return gr(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");s(m)},[]),gr(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),gr(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?qe.createElement(Ia,null,qe.createElement(fi,{appearance:r,onClose:()=>{l&&e()}}),qe.createElement(La,{appearance:r,className:a("modalContainer",r),styleOverrides:i},l&&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(Fi,{appearance:r,className:a("poweredByFrigadeRibbon",r)},qe.createElement(Lo,{appearance:r})))):qe.createElement(qe.Fragment,null)};import ft,{useEffect as hr,useState as Ua}from"react";import Mo 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`
|
|
@@ -249,7 +249,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
249
249
|
::-webkit-scrollbar {
|
|
250
250
|
display: none;
|
|
251
251
|
}
|
|
252
|
-
`,Do=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:l=!0})=>{let[p,d]=Ua("");return
|
|
252
|
+
`,Do=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:l=!0})=>{let[p,d]=Ua("");return hr(()=>{let s=getComputedStyle(document.body).getPropertyValue("overflow");d(s)},[]),hr(()=>{let s=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[e]),hr(()=>{let s=document.body.style;return t?s.setProperty("overflow","hidden"):s.setProperty("overflow",p),()=>{s.setProperty("overflow",p)}},[t]),t?ft.createElement(Wa,null,ft.createElement(_a,{appearance:n,className:a("cornerModalContainer",n),modalPosition:r},l&&ft.createElement(Va,{className:a("cornerModalClose",n),onClick:()=>e()},ft.createElement(Ee,null)),o&&ft.createElement(Ha,null,o),ft.createElement(ja,null,i))):ft.createElement(ft.Fragment,null)};import{useContext as Ga}from"react";function ee(){let{defaultAppearance:e}=Ga(J);function t(o){var n,r,l;let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((n=i.styleOverrides)!=null?n:{},(r=o.styleOverrides)!=null?r:{}),theme:Object.assign(i.theme,(l=o.theme)!=null?l:{})}:i}return{mergeAppearanceWithDefault:t}}import Pt,{useContext as up,useEffect as ji,useState as Pr}from"react";import Ho from"styled-components";import zo,{useEffect as Ii,useState as yr}from"react";import Sr from"styled-components";import Uo from"styled-components";var Bi=Uo.label`
|
|
253
253
|
${e=>E(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
|
-
`,
|
|
263
|
+
`,Ei=Uo.label`
|
|
264
264
|
${e=>E(e)} {
|
|
265
265
|
font-size: 12px;
|
|
266
266
|
line-height: 20px;
|
|
267
267
|
margin-bottom: 5px;
|
|
268
268
|
}
|
|
269
269
|
display: flex;
|
|
270
|
-
`,
|
|
270
|
+
`,Ai=Uo.span`
|
|
271
271
|
font-weight: 400;
|
|
272
272
|
font-size: 14px;
|
|
273
273
|
line-height: 22px;
|
|
@@ -280,11 +280,11 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
280
280
|
align-items: flex-start;
|
|
281
281
|
justify-content: left;
|
|
282
282
|
margin-bottom: 10px;
|
|
283
|
-
`;import
|
|
283
|
+
`;import xr 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 gt({title:e,required:t,appearance:o=it}){return e?xr.createElement(Wo,{className:a("formLabelWrapper",o)},t?xr.createElement(Ai,{className:a("formLabelRequired",o),appearance:o},"*"):null,xr.createElement(Bi,{className:a("formLabel",o)},e)):null}import Oi from"react";function jt({title:e,appearance:t}){return e?Oi.createElement(Wo,null,Oi.createElement(Ei,{className:a("formSubLabel",t)},e)):null}import{z as Cr}from"zod";function Ni(e,t){var o,i,n,r,l,p,d;try{if(t){if(t.type=="number"){let s=Cr.number();if(t.props)for(let m of t.props)m.requirement=="min"?s=s.min(Number(m.value),(o=m.message)!=null?o:"Value is too small"):m.requirement=="max"?s=s.max(Number(m.value),(i=m.message)!=null?i:"Value is too large"):m.requirement=="positive"?s=s.positive((n=m.message)!=null?n:"Value must be positive"):m.requirement=="negative"&&(s=s.nonpositive((r=m.message)!=null?r:"Value must be negative"));s.parse(Number(e))}if(t.type=="string"){let s=Cr.string();if(t.props)for(let m of t.props)m.requirement=="min"?s=s.min(Number(m.value),(l=m.message)!=null?l:"Value is too short"):m.requirement=="max"?s=s.max(Number(m.value),(p=m.message)!=null?p:"Value is too long"):m.requirement=="regex"&&(s=s.regex(new RegExp(String(m.value)),(d=m.message)!=null?d:"Value does not match requirements"));s.parse(e)}return}}catch(s){if(s instanceof Cr.ZodError)return s.issues&&s.issues.length>0?s.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,s)}return null}var Ka=Sr.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex-direction: column;
|
|
286
286
|
width: 100%;
|
|
287
|
-
`,Sr
|
|
287
|
+
`,br=Sr.input`
|
|
288
288
|
${e=>E(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=Sr.textarea`
|
|
304
304
|
${e=>E(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,13 +317,13 @@ 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 wr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[l,p]=yr((n==null?void 0:n.text)||""),[d,s]=yr(!1),[m,c]=yr(!1),g=br;Ii(()=>{l===""&&!d&&(s(!0),y(""))},[]),Ii(()=>{if(m){y(l);return}},[m]);function y(C){var A;if(p(C),o({text:C}),r.required===!0&&C.trim()===""){i([{id:r.id,message:`${(A=r.title)!=null?A:"Field"} is required`,hidden:!m}]);return}let h=Ni(C,r.validation);if(h&&(C.trim()!==""||r.required===!0)){i([{id:r.id,message:h,hidden:!m}]);return}i([])}r.multiline&&(g=qa);function T(){var C;switch((C=r==null?void 0:r.validation)==null?void 0:C.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return zo.createElement(Ka,null,zo.createElement(gt,{title:r.title,required:r.required,appearance:t.appearance}),zo.createElement(g,{className:a("inputComponent",t.appearance),value:l,onChange:C=>{y(C.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:T(),onBlur:()=>{c(!0)}}),zo.createElement(jt,{title:r.subtitle,appearance:t.appearance}))}import Qe,{useEffect as Li,useState as $i}from"react";import Mi from"styled-components";var Tr="",Ya=Mi.div`
|
|
321
321
|
display: flex;
|
|
322
322
|
flex-direction: column;
|
|
323
323
|
width: 100%;
|
|
324
324
|
-webkit-appearance: none;
|
|
325
325
|
appearance: none;
|
|
326
|
-
`,Ja
|
|
326
|
+
`,Ja=Mi.select`
|
|
327
327
|
${e=>E(e)} {
|
|
328
328
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
329
329
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -344,15 +344,15 @@ 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
|
|
347
|
+
`;function Di({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,g,y,T,C,h,A,F;let r=e,[l,p]=$i(!1),[d,s]=$i(!1);return Li(()=>{var P,v,B,f;if(!((P=i==null?void 0:i.choice)!=null&&P[0])&&!l){if(p(!0),r.requireSelection){o({choice:[Tr]});return}if(r.defaultValue&&((v=r.props.options)!=null&&v.find(I=>I.id===r.defaultValue))){let I=(B=r.props.options)==null?void 0:B.find(S=>S.id===r.defaultValue);o({choice:[I.id]})}else o({choice:[((f=r.props.options)==null?void 0:f[0].id)||""]})}},[]),Li(()=>{var P;d&&(r.requireSelection&&((P=i==null?void 0:i.choice)==null?void 0:P[0])===Tr?n([{message:"Please select an option",id:r.id}]):n([]))},[(m=i==null?void 0:i.choice)==null?void 0:m[0],d]),Qe.createElement(Ya,null,Qe.createElement(gt,{title:r.title,required:!1,appearance:t.appearance}),Qe.createElement(Ja,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:P=>{s(!0),o({choice:[P.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&Qe.createElement("option",{key:"null-value",value:Tr,disabled:!0},(g=r.placeholder)!=null?g:"Select an option"),(y=r.props.options)==null?void 0:y.map(P=>Qe.createElement("option",{key:P.id,value:P.id},P.title))),((C=(T=r.props.options)==null?void 0:T.find(P=>{var v;return P.id===((v=i==null?void 0:i.choice)==null?void 0:v[0])}))==null?void 0:C.isOpenEnded)&&Qe.createElement(Qe.Fragment,null,Qe.createElement(gt,{title:(F=(A=(h=r.props.options)==null?void 0:h.find(P=>{var v;return P.id===((v=i==null?void 0:i.choice)==null?void 0:v[0])}))==null?void 0:A.openEndedLabel)!=null?F:"Please specify",required:!1,appearance:t.appearance}),Qe.createElement(br,{type:"text",placeholder:"Enter your answer here",onChange:P=>{o({choice:[P.target.value]})},appearance:t.appearance})),Qe.createElement(jt,{title:r.subtitle,appearance:t.appearance}))}import ho,{useEffect as Fr,useState as Wi}from"react";import zi from"styled-components";import go from"react";import fo from"react";var Ui=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return fo.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Xa=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:l})=>fo.createElement("svg",{style:l,className:r,width:t,height:t,overflow:"visible"},fo.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},fo.createElement(Ui,{color:n,size:t}),fo.createElement(Ui,{color:e,percentage:Math.max(o,.1),size:t})),i),Gt=Xa;import Qa from"styled-components";var Za=({color:e="#FFFFFF"})=>go.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},go.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
348
|
${e=>ke(e)}
|
|
349
|
-
`,nt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=it,style:r,className:l})=>{let p=np(t),d=sp(t,e);return e===!0?p=j(b(b({},p),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=b(b({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?
|
|
349
|
+
`,nt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=it,style:r,className:l})=>{let p=np(t),d=sp(t,e);return e===!0?p=j(b(b({},p),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=b(b({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?go.createElement(Gt,{fillColor:o,percentage:i,size:22}):go.createElement(lp,{styleOverrides:p,style:r,role:"checkbox",className:be(a("checkIconContainer",n),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",l)},e&&go.createElement(Za,{color:"#FFFFFF"}))};var ap=zi.div`
|
|
350
350
|
display: flex;
|
|
351
351
|
flex-direction: column;
|
|
352
352
|
width: 100%;
|
|
353
353
|
-webkit-appearance: none;
|
|
354
354
|
appearance: none;
|
|
355
|
-
`,pp=
|
|
355
|
+
`,pp=zi.button`
|
|
356
356
|
${e=>E(e)} {
|
|
357
357
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
358
358
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -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
|
|
380
|
+
`;function _i({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[l,p]=Wi((i==null?void 0:i.choice)||[]),[d,s]=Wi(!1);return Fr(()=>{l.length==0&&!d&&(s(!0),o({choice:[]}))},[]),Fr(()=>{o({choice:l})},[l]),Fr(()=>{r.required&&(l.length<r.props.minChoices||l.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[l]),ho.createElement(ap,null,ho.createElement(gt,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>ho.createElement(pp,{appearance:t.appearance,className:a(l.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":l.includes(c.id),onClick:()=>{if(l.includes(c.id)){p(l.filter(g=>g!==c.id));return}l.length<r.props.maxChoices?p([...l,c.id]):l.length==1&&r.props.maxChoices==1&&p([c.id])}},c.title,ho.createElement(nt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:l.includes(c.id),appearance:t.appearance}))),ho.createElement(jt,{title:r.subtitle,appearance:t.appearance}))}import _o from"react";import Hi from"styled-components";import dp from"dompurify";function me(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=Hi.h1`
|
|
381
381
|
${e=>E(e)} {
|
|
382
382
|
font-style: normal;
|
|
383
383
|
font-weight: 700;
|
|
@@ -389,7 +389,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
389
389
|
margin-bottom: 4px;
|
|
390
390
|
color: ${e=>e.appearance.theme.colorText};
|
|
391
391
|
}
|
|
392
|
-
`,mp=
|
|
392
|
+
`,mp=Hi.h2`
|
|
393
393
|
${e=>E(e)} {
|
|
394
394
|
font-style: normal;
|
|
395
395
|
font-weight: 400;
|
|
@@ -398,7 +398,7 @@ 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 Ae({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n=""}){return _o.createElement(_o.Fragment,null,_o.createElement(cp,{appearance:e,className:a(`${n}${n?
|
|
401
|
+
`;function Ae({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n=""}){return _o.createElement(_o.Fragment,null,_o.createElement(cp,{appearance:e,className:a(`${n}${n?uo(i):i}Title`,e),dangerouslySetInnerHTML:me(t),size:i}),o&&_o.createElement(mp,{appearance:e,className:a(`${n}${n?uo(i):i}Subtitle`,e),dangerouslySetInnerHTML:me(o),size:i}))}import*as kr from"react";var Vi=e=>kr.createElement("svg",b({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),kr.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=Ho.div`
|
|
402
402
|
display: flex;
|
|
403
403
|
flex-direction: column;
|
|
404
404
|
justify-content: flex-end;
|
|
@@ -416,20 +416,20 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
416
416
|
`,xp=Ho.div`
|
|
417
417
|
padding-left: 1px;
|
|
418
418
|
padding-right: 1px;
|
|
419
|
-
`,Cp={text:
|
|
419
|
+
`,Cp={text:wr,multipleChoice:Di,multipleChoiceList:_i},vr="frigade-multiInputStepTypeData";function Gi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:l,prefillData:p}){var B;let d=t.props,[s,m]=Pr([]),[c,g]=Pr([]),{userId:y}=co(),[T,C]=Pr(P()||(p?p[t.id]:null)||{}),{readonly:h}=up(J),A=b(b({},Cp),l);ji(()=>{i(s.length===0)},[s,i]),ji(()=>{n(T)},[T]);function F(f,I){C(S=>{let k=j(b({},S),{[f.id]:I});return typeof window!="undefined"&&window.localStorage&&!h&&window.localStorage.setItem(v(),JSON.stringify(k)),k})}function P(){if(typeof window!="undefined"&&window.localStorage){let f=window.localStorage.getItem(v());if(f)return JSON.parse(f)}return null}function v(){return`${vr}-${e}-${t.id}-${y}`}return Pt.createElement(xp,{className:a("multiInput",r)},Pt.createElement(Ae,{appearance:r,title:t.title,subtitle:t.subtitle}),Pt.createElement(fp,{className:a("multiInputContainer",r)},(B=d==null?void 0:d.data)==null?void 0:B.map(f=>{let I=s.reverse().find(S=>S.id===f.id);return A[f.type]?Pt.createElement("span",{key:f.id,"data-field-id":f.id,className:a("multiInputField",r)},A[f.type]({formInput:f,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:S=>{!c.includes(f.id)&&S&&(S==null?void 0:S.text)!==""&&g(k=>[...k,f.id]),F(f,S)},inputData:T[f.id],setFormValidationErrors:S=>{S.length===0&&s.length===0||m(k=>S.length===0?k.filter(L=>L.id!==f.id):[...k,...S])}}),I&&I.message&&c.includes(f.id)&&I.hidden!==!0&&Pt.createElement(gp,{key:f.id,style:{overflow:"hidden"},appearance:r,className:a("multiInputValidationError",r)},Pt.createElement(hp,{appearance:r,className:a("multiInputValidationErrorIcon",r)},Pt.createElement(Vi,null)),I.message)):null})))}import Kt from"styled-components";var Ki=Kt.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
|
-
`,
|
|
424
|
+
`,qi=Kt.div`
|
|
425
425
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
426
426
|
font-size: 12px;
|
|
427
|
-
`,
|
|
427
|
+
`,Yi=Kt.div`
|
|
428
428
|
display: flex;
|
|
429
429
|
gap: 12px;
|
|
430
430
|
width: 100%;
|
|
431
431
|
justify-content: flex-end;
|
|
432
|
-
`,
|
|
432
|
+
`,Ji=Kt.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
|
-
`,
|
|
440
|
+
`,Xi=Kt.div`
|
|
441
441
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
442
442
|
position: relative;
|
|
443
443
|
overflow-y: auto;
|
|
444
|
-
`,
|
|
444
|
+
`,Qi=Kt.div`
|
|
445
445
|
display: flex;
|
|
446
446
|
align-self: stretch;
|
|
447
447
|
flex-grow: 1;
|
|
@@ -453,7 +453,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
453
453
|
background-position: center;
|
|
454
454
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
455
455
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
456
|
-
`;import ht from"react";import
|
|
456
|
+
`;import ht from"react";import Ri from"react";import en from"styled-components";import yp from"styled-components";var Zi=yp.div`
|
|
457
457
|
width: 24px;
|
|
458
458
|
height: 24px;
|
|
459
459
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
@@ -471,7 +471,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
471
471
|
transform: rotate(360deg);
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
`;var Sp=
|
|
474
|
+
`;var Sp=en.button`
|
|
475
475
|
justify-content: center;
|
|
476
476
|
align-content: center;
|
|
477
477
|
align-items: center;
|
|
@@ -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
|
-
`,Vo=
|
|
507
|
+
`,Vo=en.div`
|
|
508
508
|
${e=>E(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
|
-
`,te=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:l=!1,appearance:p,withMargin:d=!0,classPrefix:s="",loading:m=!1})=>{var g;function c(){let y=l?"buttonSecondary":"button";return s===""?y:`${s}${
|
|
518
|
+
`,te=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:l=!1,appearance:p,withMargin:d=!0,classPrefix:s="",loading:m=!1})=>{var g;function c(){let y=l?"buttonSecondary":"button";return s===""?y:`${s}${uo(y)}`}return Ri.createElement(Sp,{secondary:l,appearance:p,disabled:i||m,loading:(g=m==null?void 0:m.toString())!=null?g:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:a(c(),p)},m?Ri.createElement(Zi,{className:a("buttonLoader",p)}):t!=null?t:"Continue")};var tn=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:l,onBack:p,allowBackNavigation:d,errorMessage:s,isSaving:m})=>{var y;let c=l.length>1&&r!=0&&d,g=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return ht.createElement(ht.Fragment,null,s!==null&&s!=null&&ht.createElement(qi,{appearance:o,className:a("formCTAError",o)},s),ht.createElement(Ki,{showBackButton:c,className:a("formCTAContainer",o)},c&&ht.createElement(te,{title:(y=e.backButtonTitle)!=null?y:"Back",onClick:p,secondary:!0,withMargin:!1,type:g,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),ht.createElement(Yi,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?ht.createElement(te,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:g,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?ht.createElement(te,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:g,appearance:o,loading:m}):null)))};import Br from"react";import bp from"styled-components";var wp=bp.div`
|
|
519
519
|
text-align: center;
|
|
520
|
-
`,
|
|
520
|
+
`,on=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=ee().mergeAppearanceWithDefault(i);return Br.createElement(wp,{className:o},Br.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,l)=>Br.createElement("rect",{key:l,x:16*l,y:0,width:8,height:8,rx:4,fill:t===l?n.colorPrimary:"#E6E6E6"}))))};import vt from"react";import qt from"styled-components";import{useContext as Tp}from"react";function pe(){let e=Tp(J);function t(n){i(n.primaryButtonUri,n.primaryButtonUriTarget)}function o(n){i(n.secondaryButtonUri,n.secondaryButtonUriTarget)}function i(n,r){if(!n)return;let l=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(l="_self"),e.navigate(n,l)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var Fp=qt.div`
|
|
521
521
|
display: flex;
|
|
522
522
|
flex-wrap: wrap;
|
|
523
523
|
align-content: center;
|
|
524
524
|
justify-content: center;
|
|
525
|
-
`,kp=
|
|
525
|
+
`,kp=qt.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=qt.img`
|
|
540
540
|
width: 78px;
|
|
541
541
|
height: auto;
|
|
542
|
-
`,vp=
|
|
542
|
+
`,vp=qt.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=qt.h1`
|
|
556
556
|
font-weight: 700;
|
|
557
557
|
font-size: 28px;
|
|
558
558
|
line-height: 34px;
|
|
559
|
-
`,Ep=
|
|
559
|
+
`,Ep=qt.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
|
|
568
|
+
`;function rn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=pe();return vt.createElement("div",null,vt.createElement(Bp,null,e.title),vt.createElement(Ep,null,e.subtitle),vt.createElement(Fp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>vt.createElement(kp,{key:r.title},vt.createElement(Pp,{src:r.imageUri}),vt.createElement(vp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var l;r.uri&&o(r.uri,(l=r.uriTarget)!=null?l:"_blank")}},r.title)))))}import Jt,{useEffect as Dp}from"react";import Go from"styled-components";import Er from"react";var jo=({style:e,className:t})=>Er.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},Er.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Er.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 Yt,{useRef as Ap,useState as Op}from"react";import xo from"styled-components";var Np=xo.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
|
-
`,Ip=
|
|
576
|
+
`,Ip=xo.div`
|
|
577
577
|
position: absolute;
|
|
578
578
|
display: flex;
|
|
579
579
|
align-items: center;
|
|
@@ -592,21 +592,21 @@ 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=xo.video`
|
|
596
596
|
width: 100%;
|
|
597
597
|
height: 100%;
|
|
598
598
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
599
|
-
`,$p=
|
|
599
|
+
`,$p=xo.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=xo.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 Ze({appearance:e,videoUri:t}){let o=Ap(),[i,n]=Op(!1);if(t.includes("youtube")){let r=t.split("v=")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),
|
|
609
|
+
}`;function Ze({appearance:e,videoUri:t}){let o=Ap(),[i,n]=Op(!1);if(t.includes("youtube")){let r=t.split("v=")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),Yt.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],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),Yt.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 Yt.createElement(Np,{className:a("videoPlayerWrapper",e),appearance:e},!i&&Yt.createElement(Ip,{onClick:()=>{n(!0),o.current.play()},appearance:e},Yt.createElement(jo,null)),Yt.createElement(Lp,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Up=Go.div`
|
|
610
610
|
${e=>E(e)} {
|
|
611
611
|
display: flex;
|
|
612
612
|
flex-direction: column;
|
|
@@ -630,23 +630,23 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
630
630
|
max-height: 250px;
|
|
631
631
|
margin-bottom: 24px;
|
|
632
632
|
}
|
|
633
|
-
`;function
|
|
633
|
+
`;function nn({stepData:e,appearance:t,setCanContinue:o}){return Dp(()=>{o(!0)},[]),Jt.createElement(Up,{className:a("callToActionContainer",t)},Jt.createElement(zp,{className:a("callToActionTextContainer",t)},Jt.createElement(Ae,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Jt.createElement(Wp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Jt.createElement(_p,{appearance:t,className:a("callToActionVideo",t)},Jt.createElement(Ze,{appearance:t,videoUri:e.videoUri})))}import st,{useEffect as Ar,useState as Or}from"react";import xt from"styled-components";var sn=xt.div`
|
|
634
634
|
width: auto;
|
|
635
635
|
display: flex;
|
|
636
636
|
flex-direction: column;
|
|
637
637
|
justify-content: center;
|
|
638
638
|
align-items: center;
|
|
639
639
|
padding: 4px;
|
|
640
|
-
`,
|
|
640
|
+
`,ln=xt.div`
|
|
641
641
|
width: 100%;
|
|
642
642
|
text-align: left;
|
|
643
|
-
`,
|
|
643
|
+
`,an=xt.h1`
|
|
644
644
|
font-style: normal;
|
|
645
645
|
font-weight: 700;
|
|
646
646
|
font-size: 32px;
|
|
647
647
|
line-height: 38px;
|
|
648
648
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
649
|
-
`,
|
|
649
|
+
`,pn=xt.h1`
|
|
650
650
|
font-style: normal;
|
|
651
651
|
font-weight: 400;
|
|
652
652
|
font-size: 16px;
|
|
@@ -654,7 +654,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
654
654
|
margin-top: 16px;
|
|
655
655
|
margin-bottom: 16px;
|
|
656
656
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
657
|
-
`,
|
|
657
|
+
`,dn=xt.div`
|
|
658
658
|
padding-top: 12px;
|
|
659
659
|
padding-bottom: 12px;
|
|
660
660
|
flex-direction: row;
|
|
@@ -665,17 +665,17 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
665
665
|
cursor: pointer;
|
|
666
666
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
667
667
|
width: 100%;
|
|
668
|
-
`,
|
|
668
|
+
`,cn=xt.div`
|
|
669
669
|
padding-top: 10px;
|
|
670
670
|
padding-bottom: 10px;
|
|
671
671
|
flex-direction: row;
|
|
672
672
|
display: flex;
|
|
673
673
|
justify-content: flex-start;
|
|
674
|
-
`,
|
|
674
|
+
`,mn=xt.img`
|
|
675
675
|
width: 42px;
|
|
676
676
|
height: 42px;
|
|
677
677
|
margin-right: 12px;
|
|
678
|
-
`,
|
|
678
|
+
`,un=xt.p`
|
|
679
679
|
font-style: normal;
|
|
680
680
|
font-weight: 500;
|
|
681
681
|
font-size: 17px;
|
|
@@ -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
|
|
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(([l,p])=>`${No(l)}: ${p};`).join(" ")} }`:`${No(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ne({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(jp,{inlineStyles:t})}import{useEffect as Gp,useState as Kp}from"react";function Ve(e){let[t,o]=Kp(!1),{markStepStarted:i,isLoading:n,getFlowStatus:r,getFlowSteps:l,getCurrentStepIndex:p}=X(),d=l(e);function s(){return U(this,null,function*(){!t&&!n&&r(e)===Me&&(o(!0),yield i(e,d[p(e)].id))})}return Gp(()=>{s()},[n,e]),{}}var hn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:l,onComplete:p,appearance:d,hideOnFlowCompletion:s=!0,onStepCompletion:m,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:y=!1,modalPosition:T="center",repeatable:C=!1,onDismiss:h,showPagination:A=!1,allowBackNavigation:F=!1,validationHandler:P,showFrigadeBranding:B=!1,onFormDataChange:v,showFooter:f=!0,prefillData:I={},updateUrlOnPageChange:S=!1})=>{let{getFlow:k,getFlowSteps:L,isLoading:O,targetingLogicShouldHideFlow:N,getFlowStatus:V,getCurrentStepIndex:W,markFlowCompleted:Y,markFlowNotStarted:Q,markStepStarted:pe}=X(),H=W(e),{mergeAppearanceWithDefault:le}=ee(),[fe,Te]=qp(null),{setOpenFlowState:re,getOpenFlowState:Z,hasOpenModals:q}=Be();Ve(e);let _=L(e);d=le(d);let[Le,he]=i!==void 0&&n!==void 0?[i,n]:[Z(e,!0),$=>re(e,$)],Fe=typeof window!="undefined"?window.location.hash:null;if(gn(()=>{var $;if(_&&_.length>0&&F){let M=typeof window!="undefined"&&(($=window==null?void 0:window.location)!=null&&$.hash)?window.location.hash.replace("#",""):"";if(_&&(_==null?void 0:_.length)>0){let D=-1;if(M){let ie=M;D=_.findIndex(Oe=>Oe.id===ie),fe===M&&(D=-1)}D!==-1&&(Te(M),pe(e,_[D].id))}}},[Fe]),gn(()=>{!O&&_&&_.length&&typeof window!="undefined"&&F&&(window.location.hash=_[H].id)},[O,H,_]),O)return null;let ye=k(e);if(!ye||N(ye)||!_||i!==void 0&&i===!1||V(e)===R&&s&&!C||(o=="modal"||o=="corner-modal")&&q(e))return null;let $e=()=>{he(!1),h&&h(),y===!0&&Y(e)};if(T=="center"&&o==="modal"||o==="large-modal"){let $={padding:"24px"};return o==="large-modal"?($.width="85%",$.height="90%",$.maxHeight="800px",$.minHeight="500px",$.padding="0"):$.width="400px",Re.createElement(Xe,{appearance:d,onClose:$e,visible:Le,style:$,dismissible:g,showFrigadeBranding:B},Re.createElement(ne,{appearance:d}),Re.createElement(qo,{appearance:d,steps:_,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:A,customFormElements:l,allowBackNavigation:F,validationHandler:P,onFormDataChange:v,showFooter:f,prefillData:I,updateUrlOnPageChange:S,repeatable:C}))}return o==="modal"&&T!=="center"?Re.createElement(Do,{appearance:d,onClose:$e,visible:Le,modalPosition:T},Re.createElement(ne,{appearance:d}),Re.createElement(qo,{appearance:d,steps:_,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:A,customFormElements:l,allowBackNavigation:F,validationHandler:P,onFormDataChange:v,showFooter:f,prefillData:I,updateUrlOnPageChange:S,repeatable:C})):Re.createElement(Re.Fragment,null,Re.createElement(ne,{appearance:d}),Re.createElement(qo,{appearance:d,steps:_,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:A,customFormElements:l,allowBackNavigation:F,validationHandler:P,onFormDataChange:v,showFooter:f,prefillData:I,updateUrlOnPageChange:S,repeatable:C}))},xn=hn;import{useCallback as Or,useContext as Yp,useEffect as Jp}from"react";function Nr(){let{organizationId:e,userId:t,setOrganizationId:o}=Yp(J),{mutateUserFlowState:i}=Ue(),{config:n,apiUrl:r}=Je(),l=zt(),{verifySDKInitiated:p}=_t();function d(g,y){return`frigade-user-group-registered-${g}-${y}`}Jp(()=>{if(t&&e){if(t.startsWith(Ht))return;let g=d(t,e);localStorage.getItem(g)||(l(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let s=Or(g=>U(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let y={foreignUserId:t,foreignUserGroupId:e,properties:g};yield l(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=Or((g,y)=>U(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let C={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:y}]};yield l(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(C)})),i()}),[e,t,n,i]),c=Or((g,y)=>U(this,null,function*(){if(p())if(y){let T=d(t,g);localStorage.setItem(T,"true"),o(g);let C={foreignUserId:t,foreignUserGroupId:g,properties:y};yield l(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(C)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:m}}var Cn="frigade-xFrigade_guestUserId",yo="frigade-xFrigade_userId",yn=({})=>{let{setFlowResponses:e}=ao(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ue(),{userId:n,setUserId:r}=po(),[l,p]=Co(n),{getFlowStatus:d}=X(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Xp(J),[y,T]=Co([]),[C,h]=Co([]),{organizationId:A}=Nr(),[F,P]=Co(A),[B,v]=Co(!1);Jt(()=>{if(!o&&t)for(let k=0;k<t.length;k++){let L=t[k],O=s.find(N=>N.slug===(L==null?void 0:L.flowId));if(O&&L&&L.shouldTrigger===!0&&O.type=="FORM"&&O.triggerType==="AUTOMATIC"&&!C.includes(O.slug)){setTimeout(()=>{f(L.flowId)},500);break}}},[o,t]),Jt(()=>{g.length>0&&i()},[g]),Jt(()=>{B||(v(!0),i())},[o,v]);function f(k){let L=s.find(O=>O.slug===k);L&&L.triggerType==="AUTOMATIC"&&!C.includes(L.slug)&&(h([...C,L.slug]),T([L]))}function I(){if(!n){let k=localStorage.getItem(yo);if(k){r(k);return}let L=localStorage.getItem(Cn);if(L){r(L);return}c(!0);let O=Ht+Qp();try{localStorage.setItem(Cn,O)}catch(N){console.log("Failed to save guest user id locally: Local storage unavailable",N)}r(N=>N||O)}}Jt(()=>{try{if(s){let k=[];s.forEach(L=>{if(L.data){let O=L.data.match(/"imageUri":"(.*?)"/g);O&&O.forEach(N=>{let V=N.replace('"imageUri":"',"").replace('"',"");if(k.includes(V))return;let W=new Image;W.src=V,k.push(V)})}})}}catch(k){}},[s]),Jt(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Ht))try{localStorage.setItem(yo,n)}catch(k){console.log("Failed to save user id locally: Local storage available",k)}n===null&&setTimeout(()=>{n===null&&I()},50)},[n,s,m]),Jt(()=>{A!=F&&(P(A),e([]),i())},[A,F,P]);function S(){return vt.createElement(vt.Fragment,null,y.map(k=>d(k.slug)!==Me?null:vt.createElement("span",{key:k.slug},vt.createElement(xn,{flowId:k.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return vt.createElement(vt.Fragment,null,vt.createElement(S,null))};import{ErrorBoundary as Td}from"react-error-boundary";var Sn={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 Zp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Sn[o]){let n=Sn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l]})}}),t}function Rp(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 bn(e){let{theme:t,styleOverrides:o}=e,i=Zp(t),n=Rp(o);return{overrides:i,css:n}}import ud from"styled-components";import{compose as fd,variant as Tn}from"styled-system";import wn from"react";import ed,{ThemeProvider as td,useTheme as od}from"styled-components";import{border as rd,color as id,compose as nd,get as sd,shadow as ld,space as ad,system as pd,typography as dd}from"styled-system";var cd={width:{property:"width",scale:"sizes",transform:(e,t)=>sd(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},md=ed("div")(({css:e})=>e,nd(rd,id,ld,ad,dd,pd(cd))),So=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Ne(r,["as","children","overrides"]);let l=od(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>wn.createElement(md,b(b({as:e},p),i),t);if(o!==void 0){let s=xe(l,o);return wn.createElement(td,{theme:s},d())}return d()};var bo={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},gd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Fn=ud(So)(()=>({whiteSpace:"nowrap"}),fd(Tn({scale:"components.Button",variants:"components.Button"}),Tn({prop:"size",variants:gd})));import hd from"styled-components";import{variant as xd,system as Cd}from"styled-system";var Yo={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 kn=hd(So)(xd({scale:"components.Text",variants:"components.Text"}),Cd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Pn=4,vn="px",yd=20,Sd=Object.fromEntries(Array.from(Array(yd+1),(e,t)=>t===0?[.5,`${.5*Pn}${vn}`]:[t,`${t*Pn}${vn}`])),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:j(b({},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:Sd,components:{Button:bo,Text:Yo}};var Bn="https://api.frigade.com",J=bd({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:Bn,readonly:!1,debug:!1});function Fd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var kd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var H,le,fe,Te,re;let[r,l]=je(t||null),[p,d]=je(o||null),[s,m]=je([]),[c,g]=je([]),[y,T]=je([]),[C,h]=je({}),[A,F]=je({}),[P,B]=je([]),[v,f]=je({}),[I,S]=je(!1),[k,L]=je(!1),[O,N]=je(!Y(e)),V=(Z,q)=>{if(q==="_blank"){window.open(Z,"_blank");return}setTimeout(()=>{window.location.href=Z},50)},W={theme:b(b({},it.theme),(le=(H=i==null?void 0:i.defaultAppearance)==null?void 0:H.theme)!=null?le:{}),styleOverrides:b(b({},it.styleOverrides),(Te=(fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.styleOverrides)!=null?Te:{})};function Y(Z){return!!(Z&&Z.length>10&&Z.substring(0,10)==="api_public")}Jo(()=>{t&&l(t)},[t]),Jo(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(yo)&&window.localStorage.getItem(yo)!==r&&Fd()},[r]),Jo(()=>{o&&d(o)},[o]),Jo(()=>{if(Y(e))N(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),N(!0);return}},[e,N]);let Q={publicApiKey:e,userId:r,setUserId:l,setFlows:m,flows:s,failedFlowResponses:c,setFailedFlowResponses:g,flowResponses:y,setFlowResponses:T,userProperties:C,setUserProperties:h,openFlowStates:A,setOpenFlowStates:F,completedFlowsToKeepOpenDuringSession:P,setCompletedFlowsToKeepOpenDuringSession:B,customVariables:v,setCustomVariables:f,isNewGuestUser:I,setIsNewGuestUser:S,hasActiveFullPageFlow:k,setHasActiveFullPageFlow:L,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:V,defaultAppearance:W,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:N,apiUrl:i&&i.apiUrl?i.apiUrl:Bn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(O)return Bt.createElement(J.Provider,{value:Q},n);let{overrides:pe}=bn(W);return Bt.createElement(Td,{fallback:Bt.createElement(Bt.Fragment,null,n)},Bt.createElement(J.Provider,{value:Q},Bt.createElement(wd,{theme:xe(W.theme,Ir,pe!=null?pe:{},(re=i==null?void 0:i.theme)!=null?re:{})},n,Bt.createElement(yn,null))))};import fc from"react";import Ce,{useEffect as Hr,useState as rl}from"react";import Ye,{useState as Vd}from"react";import Ot from"styled-components";import Zo from"react";import Et from"react";import An from"styled-components";var En=An.span`
|
|
686
|
+
`;var fn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,l]=Or([]),[p,d]=Or(!1),[s,m]=Or(e.id);return Ar(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Ar(()=>{s!==e.id&&(m(e.id),l([]))},[e]),Ar(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),st.createElement(sn,{className:a("selectListContainer",i)},st.createElement(ln,null,st.createElement(an,{className:a("selectListTitle",i)},e.title),st.createElement(pn,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),n.options.map((c,g)=>{let y=r.includes(c.id);return st.createElement(dn,{key:`select-item-${g}`,onClick:()=>{if(r.includes(c.id)){l(r.filter(T=>T!==c.id));return}r.length<n.maxChoices?l([...r,c.id]):r.length==1&&n.maxChoices==1&&l([c.id])},hideBottomBorder:g===n.options.length-1,className:a("selectListSelectItem",i)},st.createElement(cn,{className:a("selectListItemImage",i)},c.imageUri&&st.createElement(mn,{src:c.imageUri,alt:`select-icon-${g}`}),st.createElement(un,{appearance:i,className:a("selectListSelectItemText",i)},c.title)),st.createElement(nt,{appearance:i,value:y,primaryColor:i.theme.colorPrimary}))}))};import We,{useEffect as gn,useState as Ko}from"react";var Hp=({children:e,id:t,shouldWrap:o=!1})=>We.createElement(We.Fragment,null,o?We.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),qo=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:l,flowId:p,type:d,hideOnFlowCompletion:s,onComplete:m,setVisible:c,setShowModal:g,onDismiss:y,showPagination:T=!1,customFormElements:C,allowBackNavigation:h,validationHandler:A,onFormDataChange:F,showFooter:P,prefillData:v,updateUrlOnPageChange:B,repeatable:f})=>{var $e;let S=b(b({},{linkCollection:rn,multiInput:Gi,callToAction:nn,selectList:fn}),i),{primaryCTAClickSideEffects:k,secondaryCTAClickSideEffects:L}=pe(),[O,N]=Ko(!1),[V,W]=Ko({}),[Y,Q]=Ko(!1),[de,H]=Ko(null),le=($e=t[o])!=null?$e:null,{markStepCompleted:fe,markStepStarted:Te,isLoading:re,updateCustomVariables:Z,markFlowCompleted:q}=X();gn(()=>{Z(n)},[n,re]),gn(()=>{F&&F(V,_(),t[o],o)},[V]);function _(){var M;return{data:(M=V[t[o].id])!=null?M:{},stepId:t[o].id,customVariables:n}}function Le($,M,D){let ie=o+1<t.length?t[o+1]:null;return l&&l($,D,ie,V,_()),r?r($,o,M,ie):!0}function he($,M){W(D=>{let ie={};return ie[$.id]=M,b(b({},D),ie)})}function Fe($){return $.selectedStep.imageUri?We.createElement(Qi,{image:$.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let ye=P&&We.createElement(tn,{step:t[o],canContinue:O&&!Y,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>U(void 0,null,function*(){if(Q(!0),A){let D=yield A(t[o],o,t[o+1],V,_());if(D!==!0){H(typeof D=="string"?D:null),Q(!1);return}else H(null)}let $=b({},_());yield fe(p,t[o].id,$),o+1<t.length&&!h&&(yield Te(p,t[o+1].id));let M=Le(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),y&&y(),s&&M&&(c&&c(!1),g(!1)),yield q(p),f&&(yield Te(p,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(ie=>{ie.startsWith(vr)&&window.localStorage.removeItem(ie)}))),k(t[o]),Q(!1),typeof window!="undefined"&&!h&&B&&o+1<t.length){let D=new URL(window.location.href);D.searchParams.set("p",t[o+1].id),window.history.pushState({},"",D.toString())}}),onSecondaryClick:()=>{Le(t[o],"secondary",o),L(t[o])},onBack:()=>U(void 0,null,function*(){o-1>=0&&(Q(!0),yield Te(p,t[o-1].id),Q(!1))}),steps:t,allowBackNavigation:h,errorMessage:de,isSaving:Y});return We.createElement(We.Fragment,null,We.createElement(Ji,{className:a("formContainer",e)},We.createElement(Hp,{id:o,shouldWrap:d==="large-modal"},We.createElement(Xi,{key:le.id,type:d,className:a("formContent",e)},t.map($=>{let M=S[$.type];return le.id!==$.id?null:typeof M!="function"?M:We.createElement(M,{key:$.id,stepData:$,canContinue:O,setCanContinue:N,onSaveData:D=>{he($,D)},appearance:e,customFormElements:C,flowId:p,prefillData:v})}),T&&We.createElement(on,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),ye)),d=="large-modal"&&We.createElement(Fe,{selectedStep:t[o]})))};import Co from"react";import{createGlobalStyle as Vp}from"styled-components";var jp=Vp`
|
|
687
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${mo}${t}.${mo}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([l,p])=>`${No(l)}: ${p};`).join(" ")} }`:`${No(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ne({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(jp,{inlineStyles:t})}import{useEffect as Gp,useState as Kp}from"react";function Ve(e){let[t,o]=Kp(!1),{markStepStarted:i,isLoading:n,getFlowStatus:r,getFlowSteps:l,getCurrentStepIndex:p,targetingLogicShouldHideFlow:d,getFlow:s}=X(),m=l(e);function c(){return U(this,null,function*(){!t&&!n&&r(e)===Me&&d(s(e))===!1&&(o(!0),yield i(e,m[p(e)].id))})}return Gp(()=>{c()},[n,e]),{}}var xn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:l,onComplete:p,appearance:d,hideOnFlowCompletion:s=!0,onStepCompletion:m,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:y=!1,modalPosition:T="center",repeatable:C=!1,onDismiss:h,showPagination:A=!1,allowBackNavigation:F=!1,validationHandler:P,showFrigadeBranding:v=!1,onFormDataChange:B,showFooter:f=!0,prefillData:I={},updateUrlOnPageChange:S=!1})=>{let{getFlow:k,getFlowSteps:L,isLoading:O,targetingLogicShouldHideFlow:N,getFlowStatus:V,getCurrentStepIndex:W,markFlowCompleted:Y,markFlowNotStarted:Q,markStepStarted:de}=X(),H=W(e),{mergeAppearanceWithDefault:le}=ee(),[fe,Te]=qp(null),{setOpenFlowState:re,getOpenFlowState:Z,hasOpenModals:q}=Be();Ve(e);let _=L(e);d=le(d);let[Le,he]=i!==void 0&&n!==void 0?[i,n]:[Z(e,!0),$=>re(e,$)],Fe=typeof window!="undefined"?window.location.hash:null;if(hn(()=>{var $;if(_&&_.length>0&&F){let M=typeof window!="undefined"&&(($=window==null?void 0:window.location)!=null&&$.hash)?window.location.hash.replace("#",""):"";if(_&&(_==null?void 0:_.length)>0){let D=-1;if(M){let ie=M;D=_.findIndex(Oe=>Oe.id===ie),fe===M&&(D=-1)}D!==-1&&(Te(M),de(e,_[D].id))}}},[Fe]),hn(()=>{!O&&_&&_.length&&typeof window!="undefined"&&F&&(window.location.hash=_[H].id)},[O,H,_]),O)return null;let ye=k(e);if(!ye||N(ye)||!_||i!==void 0&&i===!1||V(e)===R&&s&&!C||(o=="modal"||o=="corner-modal")&&q(e))return null;let $e=()=>{he(!1),h&&h(),y===!0&&Y(e)};if(T=="center"&&o==="modal"||o==="large-modal"){let $={padding:"24px"};return o==="large-modal"?($.width="85%",$.height="90%",$.maxHeight="800px",$.minHeight="500px",$.padding="0"):$.width="400px",Re.createElement(Xe,{appearance:d,onClose:$e,visible:Le,style:$,dismissible:g,showFrigadeBranding:v},Re.createElement(ne,{appearance:d}),Re.createElement(qo,{appearance:d,steps:_,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:A,customFormElements:l,allowBackNavigation:F,validationHandler:P,onFormDataChange:B,showFooter:f,prefillData:I,updateUrlOnPageChange:S,repeatable:C}))}return o==="modal"&&T!=="center"?Re.createElement(Do,{appearance:d,onClose:$e,visible:Le,modalPosition:T},Re.createElement(ne,{appearance:d}),Re.createElement(qo,{appearance:d,steps:_,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:A,customFormElements:l,allowBackNavigation:F,validationHandler:P,onFormDataChange:B,showFooter:f,prefillData:I,updateUrlOnPageChange:S,repeatable:C})):Re.createElement(Re.Fragment,null,Re.createElement(ne,{appearance:d}),Re.createElement(qo,{appearance:d,steps:_,selectedStep:H,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:he,onDismiss:h,showPagination:A,customFormElements:l,allowBackNavigation:F,validationHandler:P,onFormDataChange:B,showFooter:f,prefillData:I,updateUrlOnPageChange:S,repeatable:C}))},Cn=xn;import{useCallback as Nr,useContext as Yp,useEffect as Jp}from"react";function Ir(){let{organizationId:e,userId:t,setOrganizationId:o}=Yp(J),{mutateUserFlowState:i}=Ue(),{config:n,apiUrl:r}=Je(),l=_t(),{verifySDKInitiated:p}=Ht();function d(g,y){return`frigade-user-group-registered-${g}-${y}`}Jp(()=>{if(t&&e){if(t.startsWith(Vt))return;let g=d(t,e);localStorage.getItem(g)||(l(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let s=Nr(g=>U(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let y={foreignUserId:t,foreignUserGroupId:e,properties:g};yield l(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=Nr((g,y)=>U(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let C={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:y}]};yield l(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(C)})),i()}),[e,t,n,i]),c=Nr((g,y)=>U(this,null,function*(){if(p())if(y){let T=d(t,g);localStorage.setItem(T,"true"),o(g);let C={foreignUserId:t,foreignUserGroupId:g,properties:y};yield l(`${r}userGroups`,j(b({},n),{method:"POST",body:JSON.stringify(C)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:m}}var yn="frigade-xFrigade_guestUserId",So="frigade-xFrigade_userId",Sn=({})=>{let{setFlowResponses:e}=po(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ue(),{userId:n,setUserId:r}=co(),[l,p]=yo(n),{getFlowStatus:d}=X(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Xp(J),[y,T]=yo([]),[C,h]=yo([]),{organizationId:A}=Ir(),[F,P]=yo(A),[v,B]=yo(!1);Xt(()=>{if(!o&&t)for(let k=0;k<t.length;k++){let L=t[k],O=s.find(N=>N.slug===(L==null?void 0:L.flowId));if(O&&L&&L.shouldTrigger===!0&&O.type=="FORM"&&O.triggerType==="AUTOMATIC"&&!C.includes(O.slug)){setTimeout(()=>{f(L.flowId)},500);break}}},[o,t]),Xt(()=>{g.length>0&&i()},[g]),Xt(()=>{v||(B(!0),i())},[o,B]);function f(k){let L=s.find(O=>O.slug===k);L&&L.triggerType==="AUTOMATIC"&&!C.includes(L.slug)&&(h([...C,L.slug]),T([L]))}function I(){if(!n){let k=localStorage.getItem(So);if(k){r(k);return}let L=localStorage.getItem(yn);if(L){r(L);return}c(!0);let O=Vt+Qp();try{localStorage.setItem(yn,O)}catch(N){console.log("Failed to save guest user id locally: Local storage unavailable",N)}r(N=>N||O)}}Xt(()=>{try{if(s){let k=[];s.forEach(L=>{if(L.data){let O=L.data.match(/"imageUri":"(.*?)"/g);O&&O.forEach(N=>{let V=N.replace('"imageUri":"',"").replace('"',"");if(k.includes(V))return;let W=new Image;W.src=V,k.push(V)})}})}}catch(k){}},[s]),Xt(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Vt))try{localStorage.setItem(So,n)}catch(k){console.log("Failed to save user id locally: Local storage available",k)}n===null&&setTimeout(()=>{n===null&&I()},50)},[n,s,m]),Xt(()=>{A!=F&&(P(A),e([]),i())},[A,F,P]);function S(){return Bt.createElement(Bt.Fragment,null,y.map(k=>d(k.slug)!==Me?null:Bt.createElement("span",{key:k.slug},Bt.createElement(Cn,{flowId:k.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Bt.createElement(Bt.Fragment,null,Bt.createElement(S,null))};import{ErrorBoundary as Td}from"react-error-boundary";var bn={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 Zp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(bn[o]){let n=bn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l]})}}),t}function Rp(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 wn(e){let{theme:t,styleOverrides:o}=e,i=Zp(t),n=Rp(o);return{overrides:i,css:n}}import ud from"styled-components";import{compose as fd,variant as Fn}from"styled-system";import Tn from"react";import ed,{ThemeProvider as td,useTheme as od}from"styled-components";import{border as rd,color as id,compose as nd,get as sd,shadow as ld,space as ad,system as pd,typography as dd}from"styled-system";var cd={width:{property:"width",scale:"sizes",transform:(e,t)=>sd(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},md=ed("div")(({css:e})=>e,nd(rd,id,ld,ad,dd,pd(cd))),bo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Ne(r,["as","children","overrides"]);let l=od(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Tn.createElement(md,b(b({as:e},p),i),t);if(o!==void 0){let s=xe(l,o);return Tn.createElement(td,{theme:s},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"}},gd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},kn=ud(bo)(()=>({whiteSpace:"nowrap"}),fd(Fn({scale:"components.Button",variants:"components.Button"}),Fn({prop:"size",variants:gd})));import hd from"styled-components";import{variant as xd,system as Cd}from"styled-system";var Yo={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 Pn=hd(bo)(xd({scale:"components.Text",variants:"components.Text"}),Cd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var vn=4,Bn="px",yd=20,Sd=Object.fromEntries(Array.from(Array(yd+1),(e,t)=>t===0?[.5,`${.5*vn}${Bn}`]:[t,`${t*vn}${Bn}`])),Qt={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"},Lr={colors:j(b({},Qt),{neutral:{foreground:Qt.gray300},primary:{background:Qt.blue500,foreground:Qt.white,inverted:Qt.blue500},negative:{foreground:Qt.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:Sd,components:{Button:wo,Text:Yo}};var En="https://api.frigade.com",J=bd({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:En,readonly:!1,debug:!1});function Fd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var kd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var H,le,fe,Te,re;let[r,l]=je(t||null),[p,d]=je(o||null),[s,m]=je([]),[c,g]=je([]),[y,T]=je([]),[C,h]=je({}),[A,F]=je({}),[P,v]=je([]),[B,f]=je({}),[I,S]=je(!1),[k,L]=je(!1),[O,N]=je(!Y(e)),V=(Z,q)=>{if(q==="_blank"){window.open(Z,"_blank");return}setTimeout(()=>{window.location.href=Z},50)},W={theme:b(b({},it.theme),(le=(H=i==null?void 0:i.defaultAppearance)==null?void 0:H.theme)!=null?le:{}),styleOverrides:b(b({},it.styleOverrides),(Te=(fe=i==null?void 0:i.defaultAppearance)==null?void 0:fe.styleOverrides)!=null?Te:{})};function Y(Z){return!!(Z&&Z.length>10&&Z.substring(0,10)==="api_public")}Jo(()=>{t&&l(t)},[t]),Jo(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(So)&&window.localStorage.getItem(So)!==r&&Fd()},[r]),Jo(()=>{o&&d(o)},[o]),Jo(()=>{if(Y(e))N(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),N(!0);return}},[e,N]);let Q={publicApiKey:e,userId:r,setUserId:l,setFlows:m,flows:s,failedFlowResponses:c,setFailedFlowResponses:g,flowResponses:y,setFlowResponses:T,userProperties:C,setUserProperties:h,openFlowStates:A,setOpenFlowStates:F,completedFlowsToKeepOpenDuringSession:P,setCompletedFlowsToKeepOpenDuringSession:v,customVariables:B,setCustomVariables:f,isNewGuestUser:I,setIsNewGuestUser:S,hasActiveFullPageFlow:k,setHasActiveFullPageFlow:L,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:V,defaultAppearance:W,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:N,apiUrl:i&&i.apiUrl?i.apiUrl:En,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(O)return Et.createElement(J.Provider,{value:Q},n);let{overrides:de}=wn(W);return Et.createElement(Td,{fallback:Et.createElement(Et.Fragment,null,n)},Et.createElement(J.Provider,{value:Q},Et.createElement(wd,{theme:xe(W.theme,Lr,de!=null?de:{},(re=i==null?void 0:i.theme)!=null?re:{})},n,Et.createElement(Sn,null))))};import fc from"react";import Ce,{useEffect as Vr,useState as rl}from"react";import Ye,{useState as Vd}from"react";import Nt from"styled-components";import Zo from"react";import At from"react";import On from"styled-components";var An=On.span`
|
|
688
688
|
font-weight: 600;
|
|
689
689
|
font-size: 14px;
|
|
690
690
|
font-style: normal;
|
|
@@ -696,7 +696,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
696
696
|
margin-left: 32px;
|
|
697
697
|
padding-right: 12px;
|
|
698
698
|
${e=>ke(e)}
|
|
699
|
-
`,Pd=
|
|
699
|
+
`,Pd=On.div`
|
|
700
700
|
flex-direction: row;
|
|
701
701
|
justify-content: space-between;
|
|
702
702
|
display: flex;
|
|
@@ -705,11 +705,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
705
705
|
padding-right: 8px;
|
|
706
706
|
width: 100%;
|
|
707
707
|
${e=>ke(e)}
|
|
708
|
-
`,Xo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:l="round",appearance:p})=>
|
|
708
|
+
`,Xo=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:l="round",appearance:p})=>At.createElement(At.Fragment,null,At.createElement(Pd,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:b({},n)},i==="left"&&e&&At.createElement(An,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),At.createElement(nt,{appearance:p,value:t,type:l,primaryColor:r}),i==="right"&&e&&At.createElement(An,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),At.createElement(ne,{appearance:p}));import To from"styled-components";var Nn=To.div`
|
|
709
709
|
font-weight: 700;
|
|
710
710
|
font-size: 18px;
|
|
711
711
|
line-height: 22px;
|
|
712
|
-
`,
|
|
712
|
+
`,In=To.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
|
-
`,
|
|
720
|
+
`,Ln=To.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
|
-
`,Qo=
|
|
729
|
+
`,Qo=To.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
|
-
|
|
736
|
+
`,$n=To.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
|
|
741
|
+
`;var Mn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:l})=>{var p,d,s,m,c;return Zo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&Zo.createElement(Qo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(p=l==null?void 0:l.theme)==null?void 0:p.colorPrimary)!=null?d:i}}),Zo.createElement($n,{className:a("checklistStepItem",l),key:`hero-checklist-step-${t}`,appearance:l,role:"listitem"},Zo.createElement(Xo,{value:e.complete,labelPosition:"left",label:(s=e.stepName)!=null?s:e.title,style:n,primaryColor:(c=(m=l==null?void 0:l.theme)==null?void 0:m.colorPrimary)!=null?c:i,appearance:l})))};import Ot from"react";import $r from"styled-components";import Ro from"styled-components";var mC=Ro.h1`
|
|
742
742
|
display: flex;
|
|
743
743
|
margin: 0;
|
|
744
744
|
font-size: 18px;
|
|
745
745
|
`,uC=Ro.h2`
|
|
746
746
|
font-size: 15px;
|
|
747
747
|
color: #4d4d4d;
|
|
748
|
-
`,
|
|
748
|
+
`,Dn=Ro.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
|
-
`,
|
|
757
|
+
`,Un=Ro.div`
|
|
758
758
|
position: relative;
|
|
759
759
|
left: 0;
|
|
760
760
|
top: 0;
|
|
@@ -764,7 +764,7 @@ ${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 vd
|
|
767
|
+
`;var vd=$r.div`
|
|
768
768
|
display: flex;
|
|
769
769
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
770
770
|
justify-content: flex-start;
|
|
@@ -772,24 +772,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
772
772
|
width: 100%;
|
|
773
773
|
|
|
774
774
|
${e=>ke(e)}
|
|
775
|
-
`,Bd
|
|
775
|
+
`,Bd=$r.div`
|
|
776
776
|
flex-grow: 1;
|
|
777
777
|
position: relative;
|
|
778
778
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
779
|
-
`,Ed
|
|
779
|
+
`,Ed=$r.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
785
|
${e=>ke(e)}
|
|
786
|
-
`;var ze=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:l})=>{var g;if(t===0)return
|
|
787
|
-
border-radius:
|
|
788
|
-
|
|
786
|
+
`;var ze=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:l})=>{var g;if(t===0)return Ot.createElement(Ot.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(g=l==null?void 0:l.theme)==null?void 0:g.colorText});let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",s=Math.round(e/t*100),m=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${s}% complete`),i==="top"&&(m="0px"),Ot.createElement(vd,{className:a("progressBarContainer",l),textLocation:i,styleOverrides:n},Ot.createElement(Ed,{className:a("progressBarStepText",l),styleOverrides:j(b({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:l,padding:m,textLocation:i},c),Ot.createElement(Bd,{textLocation:i,className:a("progressBar",l)},Ot.createElement(Dn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:l,className:a("progressBarFill",l)}),Ot.createElement(Un,{className:a("progressBarBackground",l),barHeight:d,appearance:l})))};import Fo from"react";import Od from"styled-components";import tr from"react";import er from"react";var Zt=({stepData:e,appearance:t})=>er.createElement(er.Fragment,null,er.createElement(In,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:me(e.title)}),er.createElement(Ln,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:me(e.subtitle)}));import Mr from"react";var Rt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Mr.createElement(Vo,{className:a("ctaContainer",t)},Mr.createElement(te,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Mr.createElement(te,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var eo=({stepData:e,appearance:t})=>tr.createElement(tr.Fragment,null,tr.createElement(Zt,{stepData:e,appearance:t}),tr.createElement(Rt,{stepData:e,appearance:t}));import Ad from"react";function Wn(e){return Ad.createElement(Ze,{appearance:e.appearance,videoUri:e.videoUri})}var Dr="default",Nd=Od.img`
|
|
787
|
+
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
788
|
+
width: 100%;
|
|
789
|
+
height: auto;
|
|
789
790
|
min-height: 200px;
|
|
790
|
-
`,
|
|
791
|
+
`,zn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Fo.createElement("div",null,o)}return Fo.createElement(Nn,{className:a("checklistStepContent",t)},e.imageUri?Fo.createElement(Nd,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle,appearance:t}):null,e.videoUri?Fo.createElement(Wn,{videoUri:e.videoUri,appearance:t}):null,Fo.createElement(eo,{stepData:e,appearance:t}))};import _e,{useRef as Id,useState as Ld}from"react";import to from"styled-components";var _n=to.div`
|
|
791
792
|
display: block;
|
|
792
|
-
`,$d=
|
|
793
|
+
`,$d=to.div`
|
|
793
794
|
display: flex;
|
|
794
795
|
flex-direction: row;
|
|
795
796
|
flex-wrap: wrap;
|
|
@@ -799,20 +800,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
799
800
|
align-content: center;
|
|
800
801
|
margin-top: 24px;
|
|
801
802
|
margin-bottom: 24px;
|
|
802
|
-
`,Md=
|
|
803
|
+
`,Md=to.div`
|
|
803
804
|
display: flex;
|
|
804
805
|
align-items: center;
|
|
805
806
|
justify-content: flex-start;
|
|
806
807
|
flex-direction: column;
|
|
807
808
|
margin-right: 16px;
|
|
808
|
-
`,Dd=
|
|
809
|
+
`,Dd=to.video`
|
|
809
810
|
width: 200px;
|
|
810
811
|
height: 120px;
|
|
811
|
-
`,Ud=
|
|
812
|
+
`,Ud=to.div`
|
|
812
813
|
font-size: 14px;
|
|
813
814
|
line-height: 20px;
|
|
814
815
|
text-align: center;
|
|
815
|
-
`,Wd=
|
|
816
|
+
`,Wd=to.div`
|
|
816
817
|
position: absolute;
|
|
817
818
|
width: 200px;
|
|
818
819
|
height: 120px;
|
|
@@ -832,7 +833,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
832
833
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
833
834
|
border-radius: 50%;
|
|
834
835
|
}
|
|
835
|
-
`,
|
|
836
|
+
`,Hn="videoCarousel",Vn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return _e.createElement(_n,null,_e.createElement(eo,{stepData:e,appearance:t}));function o({video:r}){let l=Id(),[p,d]=Ld(!1);return _e.createElement(Md,null,!p&&_e.createElement(Wd,{onClick:()=>{d(!0),l.current.play()},appearance:t},_e.createElement(jo,null)),_e.createElement(Dd,{controls:p,ref:l,play:p,src:r.uri}),_e.createElement(Ud,null,r.title))}let i=e.props;return i.videos?_e.createElement(_n,null,_e.createElement(Zt,{stepData:e,appearance:t}),_e.createElement($d,null,i.videos.map((r,l)=>_e.createElement("span",{key:`${r.uri}-${l}`},_e.createElement(o,{video:r})))),_e.createElement(Rt,{stepData:e,appearance:t})):null};import lt from"react";import or from"styled-components";var jn=or.div`
|
|
836
837
|
display: block;
|
|
837
838
|
`,zd=or.pre`
|
|
838
839
|
display: block;
|
|
@@ -857,7 +858,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
857
858
|
margin-top: 12px;
|
|
858
859
|
`,Hd=or.div`
|
|
859
860
|
margin-top: 24px;
|
|
860
|
-
`,
|
|
861
|
+
`,Gn="codeSnippet",Kn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return lt.createElement(jn,null,lt.createElement(eo,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?lt.createElement(jn,null,lt.createElement(Zt,{stepData:e,appearance:t}),lt.createElement(Hd,null,o.codeSnippets.map((n,r)=>lt.createElement("div",{key:r},n.title?lt.createElement(_d,null,n.title):null,n.code?lt.createElement(zd,null,n.code):null))),lt.createElement(Rt,{stepData:e,appearance:t})):null};var jd=Nt.div`
|
|
861
862
|
display: flex;
|
|
862
863
|
flex-direction: row;
|
|
863
864
|
overflow: hidden;
|
|
@@ -865,14 +866,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
865
866
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
866
867
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
867
868
|
${e=>ke(e)}
|
|
868
|
-
`,Gd=
|
|
869
|
+
`,Gd=Nt.h1`
|
|
869
870
|
font-size: 18px;
|
|
870
871
|
font-style: normal;
|
|
871
872
|
font-weight: 700;
|
|
872
873
|
line-height: 24px;
|
|
873
874
|
letter-spacing: 0.36px;
|
|
874
875
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
875
|
-
`,Kd=
|
|
876
|
+
`,Kd=Nt.h2`
|
|
876
877
|
font-size: 14px;
|
|
877
878
|
font-style: normal;
|
|
878
879
|
font-weight: 400;
|
|
@@ -880,43 +881,43 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
880
881
|
letter-spacing: 0.28px;
|
|
881
882
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
882
883
|
margin: 10px 0px 0px 0px;
|
|
883
|
-
`,
|
|
884
|
+
`,qn=Nt.div``,qd=Nt.div`
|
|
884
885
|
list-style: none;
|
|
885
886
|
padding: 0;
|
|
886
887
|
margin: 0;
|
|
887
888
|
cursor: pointer;
|
|
888
889
|
width: 300px;
|
|
889
|
-
`,Yd=
|
|
890
|
+
`,Yd=Nt.div`
|
|
890
891
|
width: 1px;
|
|
891
892
|
margin-right: 40px;
|
|
892
893
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
893
|
-
`,Jd=
|
|
894
|
+
`,Jd=Nt.div`
|
|
894
895
|
flex: 2;
|
|
895
|
-
padding:
|
|
896
|
-
`,Xd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:l="",customStepTypes:p=new Map,appearance:d,type:s})=>{let{mergeAppearanceWithDefault:m}=ee();d=m(d);let c={[
|
|
896
|
+
padding: 40px 40px 40px 0px;
|
|
897
|
+
`,Xd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:l="",customStepTypes:p=new Map,appearance:d,type:s})=>{let{mergeAppearanceWithDefault:m}=ee();d=m(d);let c={[Dr]:zn,[Hn]:Vn,[Gn]:Kn},g=b(b({},c),p),[y,T]=Vd(0),C=n!=null?n:y,h=r!=null?r:T,A=o.filter(P=>P.complete===!0).length,F=()=>{var P;return!((P=o[C])!=null&&P.type)||!g[o[C].type]?g[Dr]({stepData:o[C],appearance:d}):typeof g[o[C].type]!="function"?g[o[C].type]:g[o[C].type]({stepData:o[C],appearance:d})};return Ye.createElement(jd,{type:s,styleOverrides:i,className:l,appearance:d},Ye.createElement(qn,{style:{flex:1}},Ye.createElement(qn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},Ye.createElement(Gd,{className:a("checklistTitle",d),appearance:d},e),Ye.createElement(Kd,{className:a("checklistSubtitle",d),appearance:d},t),Ye.createElement(ze,{total:o.length,count:A,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Ye.createElement(qd,{className:a("checklistStepsContainer",d)},o.map((P,v)=>Ye.createElement(Mn,{data:P,index:v,key:v,listLength:o.length,isSelected:v===C,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{h(v)},appearance:d})))),Ye.createElement(Yd,{appearance:d,className:a("checklistDivider",d)}),Ye.createElement(Jd,null,Ye.createElement(F,null)))},Ur=Xd;import G,{useState as tc}from"react";import Yn from"react";import Qd from"styled-components";var Zd=Qd.svg`
|
|
897
898
|
transition: 'transform 0.35s ease-in-out';
|
|
898
|
-
`,
|
|
899
|
+
`,oo=({style:e,className:t})=>Yn.createElement(Zd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Yn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import Se from"styled-components";var Wr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Jn=Se.div`
|
|
899
900
|
max-height: 350px;
|
|
900
901
|
padding-bottom: 40px;
|
|
901
|
-
`,
|
|
902
|
+
`,Xn=Se.div`
|
|
902
903
|
display: flex;
|
|
903
904
|
flex-direction: column;
|
|
904
905
|
margin-top: 20px;
|
|
905
|
-
`,
|
|
906
|
+
`,Qn=Se.h1`
|
|
906
907
|
font-style: normal;
|
|
907
908
|
font-weight: 600;
|
|
908
909
|
font-size: 30px;
|
|
909
910
|
line-height: 36px;
|
|
910
911
|
margin-bottom: 16px;
|
|
911
912
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
912
|
-
`,
|
|
913
|
+
`,Zn=Se.h2`
|
|
913
914
|
font-weight: 400;
|
|
914
915
|
font-size: 16px;
|
|
915
916
|
line-height: 20px;
|
|
916
917
|
margin-bottom: 16px;
|
|
917
918
|
padding-left: 1px;
|
|
918
919
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
919
|
-
`,
|
|
920
|
+
`,Rn=Se.div`
|
|
920
921
|
${e=>E(e)} {
|
|
921
922
|
border: 1px solid #fafafa;
|
|
922
923
|
}
|
|
@@ -926,11 +927,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
926
927
|
flex-direction: column;
|
|
927
928
|
min-height: 240px;
|
|
928
929
|
overflow: hidden;
|
|
929
|
-
`,
|
|
930
|
+
`,es=Se.div`
|
|
930
931
|
display: flex;
|
|
931
932
|
flex-direction: row;
|
|
932
933
|
justify-content: space-between;
|
|
933
|
-
`,
|
|
934
|
+
`,ts=Se.p`
|
|
934
935
|
${e=>E(e)} {
|
|
935
936
|
font-weight: 400;
|
|
936
937
|
font-size: 10px;
|
|
@@ -939,12 +940,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
939
940
|
color: #8c8c8c;
|
|
940
941
|
margin: 20px;
|
|
941
942
|
}
|
|
942
|
-
`,
|
|
943
|
+
`,os=Se.div`
|
|
943
944
|
display: flex;
|
|
944
945
|
flex-direction: row;
|
|
945
|
-
`,os=Se.div`
|
|
946
|
-
flex: 1;
|
|
947
946
|
`,rs=Se.div`
|
|
947
|
+
flex: 1;
|
|
948
|
+
`,is=Se.div`
|
|
948
949
|
${e=>E(e)} {
|
|
949
950
|
display: flex;
|
|
950
951
|
justify-content: center;
|
|
@@ -954,7 +955,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
954
955
|
padding-left: 8px;
|
|
955
956
|
padding-right: 8px;
|
|
956
957
|
}
|
|
957
|
-
`,
|
|
958
|
+
`,ns=Se.p`
|
|
958
959
|
${e=>E(e)} {
|
|
959
960
|
font-style: normal;
|
|
960
961
|
font-weight: 600;
|
|
@@ -966,7 +967,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
966
967
|
margin-top: 20px;
|
|
967
968
|
margin-bottom: 16px;
|
|
968
969
|
}
|
|
969
|
-
`,
|
|
970
|
+
`,ss=Se.p`
|
|
970
971
|
${e=>E(e)} {
|
|
971
972
|
font-weight: 400;
|
|
972
973
|
font-size: 14px;
|
|
@@ -975,14 +976,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
975
976
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
976
977
|
margin-bottom: 8px;
|
|
977
978
|
}
|
|
978
|
-
`,
|
|
979
|
+
`,ls=Se.div`
|
|
979
980
|
${e=>E(e)} {
|
|
980
981
|
display: flex;
|
|
981
982
|
flex-direction: row;
|
|
982
983
|
justify-content: center;
|
|
983
984
|
gap: 8px;
|
|
984
985
|
}
|
|
985
|
-
`,
|
|
986
|
+
`,as=Se.div`
|
|
986
987
|
${e=>E(e)} {
|
|
987
988
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
988
989
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
@@ -1002,7 +1003,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1002
1003
|
justify-content: space-between;
|
|
1003
1004
|
position: relative;
|
|
1004
1005
|
cursor: pointer;
|
|
1005
|
-
`,
|
|
1006
|
+
`,ps=Se.p`
|
|
1006
1007
|
${e=>E(e)} {
|
|
1007
1008
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1008
1009
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
@@ -1011,12 +1012,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1011
1012
|
font-size: 14px;
|
|
1012
1013
|
line-height: 22px;
|
|
1013
1014
|
margin: 0;
|
|
1014
|
-
`,
|
|
1015
|
+
`,ds=Se.div`
|
|
1015
1016
|
display: flex;
|
|
1016
1017
|
flex-direction: row;
|
|
1017
1018
|
justify-content: flex-end;
|
|
1018
1019
|
align-content: center;
|
|
1019
|
-
`,
|
|
1020
|
+
`,cs=Se.div`
|
|
1020
1021
|
display: flex;
|
|
1021
1022
|
flex: 1;
|
|
1022
1023
|
flex-direction: row;
|
|
@@ -1024,14 +1025,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1024
1025
|
align-content: center;
|
|
1025
1026
|
align-items: center;
|
|
1026
1027
|
margin-right: 20px;
|
|
1027
|
-
`,
|
|
1028
|
+
`,ms=Se.div`
|
|
1028
1029
|
display: block;
|
|
1029
1030
|
width: 100%;
|
|
1030
|
-
`;import Rd from"styled-components";var
|
|
1031
|
+
`;import Rd from"styled-components";var us=Rd.div`
|
|
1031
1032
|
flex-direction: column;
|
|
1032
1033
|
justify-content: center;
|
|
1033
1034
|
display: flex;
|
|
1034
|
-
`;import pt from"react";import at from"styled-components";var
|
|
1035
|
+
`;import pt from"react";import at from"styled-components";var fs=at.div`
|
|
1035
1036
|
border: 1px solid #fafafa;
|
|
1036
1037
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
1037
1038
|
border-radius: 14px;
|
|
@@ -1039,13 +1040,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1039
1040
|
display: flex;
|
|
1040
1041
|
flex-direction: column;
|
|
1041
1042
|
overflow: hidden;
|
|
1042
|
-
`,
|
|
1043
|
+
`,gs=at.div`
|
|
1043
1044
|
display: flex;
|
|
1044
1045
|
flex-wrap: wrap;
|
|
1045
1046
|
justify-content: space-between;
|
|
1046
1047
|
overflow: hidden;
|
|
1047
1048
|
row-gap: 10px;
|
|
1048
|
-
`,
|
|
1049
|
+
`,hs=at.div`
|
|
1049
1050
|
${e=>E(e)} {
|
|
1050
1051
|
color: #595959;
|
|
1051
1052
|
}
|
|
@@ -1055,7 +1056,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1055
1056
|
line-height: 12px;
|
|
1056
1057
|
letter-spacing: 0.09em;
|
|
1057
1058
|
margin-bottom: 12px;
|
|
1058
|
-
`,
|
|
1059
|
+
`,xs=at.div`
|
|
1059
1060
|
${e=>E(e)} {
|
|
1060
1061
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1061
1062
|
background: #ffffff;
|
|
@@ -1068,7 +1069,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1068
1069
|
|
|
1069
1070
|
max-width: 150px;
|
|
1070
1071
|
min-width: 200px;
|
|
1071
|
-
`,
|
|
1072
|
+
`,Cs=at.div`
|
|
1072
1073
|
${e=>E(e)} {
|
|
1073
1074
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1074
1075
|
}
|
|
@@ -1080,13 +1081,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1080
1081
|
justify-content: center;
|
|
1081
1082
|
align-content: center;
|
|
1082
1083
|
align-items: center;
|
|
1083
|
-
`,
|
|
1084
|
+
`,ys=at.div`
|
|
1084
1085
|
font-weight: 600;
|
|
1085
1086
|
font-size: 20px;
|
|
1086
1087
|
line-height: 24px;
|
|
1087
1088
|
width: 20px;
|
|
1088
1089
|
height: 20px;
|
|
1089
|
-
`,
|
|
1090
|
+
`,Ss=at.div`
|
|
1090
1091
|
${e=>E(e)} {
|
|
1091
1092
|
color: #434343;
|
|
1092
1093
|
}
|
|
@@ -1095,20 +1096,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1095
1096
|
line-height: 17px;
|
|
1096
1097
|
margin-top: 12px;
|
|
1097
1098
|
margin-bottom: 8px;
|
|
1098
|
-
`,
|
|
1099
|
+
`,bs=at.div`
|
|
1099
1100
|
${e=>E(e)} {
|
|
1100
1101
|
color: #8c8c8c;
|
|
1101
1102
|
}
|
|
1102
1103
|
font-weight: 400;
|
|
1103
1104
|
font-size: 12px;
|
|
1104
1105
|
line-height: 14px;
|
|
1105
|
-
`,
|
|
1106
|
+
`,ws=at.a`
|
|
1106
1107
|
color: ${e=>e.color};
|
|
1107
1108
|
font-size: 12px;
|
|
1108
1109
|
line-height: 14px;
|
|
1109
1110
|
font-weight: 400;
|
|
1110
1111
|
cursor: pointer;
|
|
1111
|
-
`;var ec=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:l}=
|
|
1112
|
+
`;var ec=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:l}=pe();return pt.createElement(fs,{style:t,className:a("guideContainer",n)},pt.createElement(hs,{className:a("guideTitle",n)},o),pt.createElement(gs,{className:a("guideItemContainer",n)},e.map((p,d)=>{var s;return pt.createElement(xs,{key:`guide-${(s=p.id)!=null?s:d}`,className:a("guideItem",n)},p.icon&&pt.createElement(Cs,{className:a("guideIcon",n)},pt.createElement(ys,null,p.icon)),pt.createElement(Ss,{className:a("guideItemTitle",n),dangerouslySetInnerHTML:me(p.title)}),pt.createElement(bs,{className:a("guideItemSubtitle",n),dangerouslySetInnerHTML:me(p.subtitle)}),pt.createElement(ws,{className:a("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&l(p),r&&r(p)}},p.primaryButtonTitle))})))},ko=ec;var oc=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:l,setSelectedStep:p,customStepTypes:d,appearance:s,guideData:m,guideTitle:c,onGuideButtonClick:g})=>{let y=({stepData:f,handleSecondaryCTAClick:I,handleCTAClick:S})=>f?G.createElement(is,{className:a("checklistStepContainer",s),"data-testid":"checklistStepContainer"},G.createElement(ns,{appearance:s,className:a("checklistStepTitle",s),dangerouslySetInnerHTML:me(f.title)}),G.createElement(ss,{appearance:s,className:a("checklistStepSubtitle",s),dangerouslySetInnerHTML:me(f.subtitle)}),G.createElement(ls,{className:a("checklistCTAContainer",s)},f.secondaryButtonTitle&&G.createElement(te,{title:f.secondaryButtonTitle,onClick:I,appearance:s,secondary:!0}),G.createElement(te,{title:f.primaryButtonTitle,onClick:S,appearance:s}))):G.createElement(G.Fragment,null),C=b(b({},{default:f=>{var L;if((L=e[F])!=null&&L.StepContent){let O=e[F].StepContent;return G.createElement("div",null,O)}let I=e[F];return G.createElement(y,{stepData:f,handleCTAClick:()=>{I.handlePrimaryButtonClick&&I.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{I.handleSecondaryButtonClick&&I.handleSecondaryButtonClick()}})}}),d),[h,A]=tc(0),F=l!=null?l:h,P=p!=null?p:A,v=()=>{var f;return e?!((f=e[F])!=null&&f.type)||!C[e[F].type]?C.default(e[F]):typeof C[e[F].type]!="function"?C[e[F].type]:C[e[F].type]({stepData:e[F],primaryColor:s.theme.colorPrimary}):G.createElement(G.Fragment,null)},B=e.filter(f=>f.complete).length;return n?(s.theme.modalContainer||(s.theme.borderRadius&&(Wr.borderRadius=s.theme.borderRadius+"px"),s.theme.modalContainer=Wr),G.createElement(Xe,{onClose:r,visible:n,appearance:s},G.createElement(ms,null,G.createElement(Xn,null,G.createElement(Qn,{appearance:s,className:a("checklistTitle",s)},t),G.createElement(Zn,{appearance:s,className:a("checklistSubtitle",s)},o)),G.createElement(Jn,null,e&&e.length>0&&G.createElement(Rn,{className:a("stepsContainer",s)},G.createElement(es,null,G.createElement("div",{style:{flex:3}},G.createElement(ts,{className:a("stepsTitle",s)},i)),G.createElement(cs,null,G.createElement(ze,{style:{width:"100%"},count:B,total:e.length,appearance:s}))),G.createElement(os,null,G.createElement(rs,{className:a("checklistStepListContainer",s),appearance:s},e.map((f,I)=>{var k;let S=F===I;return G.createElement(as,{selected:S,className:a(`checklistStepListItem${S?"Selected":""}`,s),key:`checklist-guide-step-${(k=f.id)!=null?k:I}`,disabled:f.blocked,onClick:()=>{f.blocked||P(I)},title:f.blocked?"Finish remaining steps to continue":void 0},S&&G.createElement(Qo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklist-step-selected",style:{backgroundColor:s.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),G.createElement(ps,{selected:S,className:a(`checklistStepListStepName${S?"Selected":""}`,s)},f.stepName),G.createElement(ds,null,G.createElement(nt,{value:f.complete,type:"round",primaryColor:s.theme.colorPrimary,progress:f.progress,appearance:s}),G.createElement(us,null,G.createElement(oo,{style:{marginLeft:"10px"},color:s.theme.colorBackgroundSecondary}))))})),G.createElement(v,null))),m&&m.length>0&&G.createElement(ko,{steps:m,title:c,primaryColor:s.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:s,onButtonClick:f=>(g&&g(f),!0)}))))):G.createElement(G.Fragment,null)},zr=oc;import Ie,{useEffect as rr,useState as rc}from"react";import we from"react";import dt from"styled-components";var Ts=dt.div`
|
|
1112
1113
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1113
1114
|
border: 1px solid;
|
|
1114
1115
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1120,19 +1121,19 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1120
1121
|
display: flex;
|
|
1121
1122
|
flex-direction: column;
|
|
1122
1123
|
transition: max-height 0.25s;
|
|
1123
|
-
`,
|
|
1124
|
+
`,Fs=dt.div`
|
|
1124
1125
|
display: flex;
|
|
1125
1126
|
margin-bottom: 20px;
|
|
1126
|
-
`,
|
|
1127
|
+
`,ks=dt.img`
|
|
1127
1128
|
border-radius: 4px;
|
|
1128
1129
|
max-height: 260px;
|
|
1129
1130
|
min-height: 200px;
|
|
1130
|
-
`,
|
|
1131
|
+
`,Ps=dt.div`
|
|
1131
1132
|
display: flex;
|
|
1132
1133
|
flex-direction: row;
|
|
1133
1134
|
justify-content: space-between;
|
|
1134
1135
|
align-items: center;
|
|
1135
|
-
`,
|
|
1136
|
+
`,vs=dt.p`
|
|
1136
1137
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1137
1138
|
font-style: normal;
|
|
1138
1139
|
font-weight: 500;
|
|
@@ -1143,23 +1144,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1143
1144
|
:hover {
|
|
1144
1145
|
opacity: 0.8;
|
|
1145
1146
|
}
|
|
1146
|
-
`,
|
|
1147
|
+
`,Bs=dt.div`
|
|
1147
1148
|
cursor: pointer;
|
|
1148
1149
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
1149
1150
|
:hover {
|
|
1150
1151
|
opacity: 0.8;
|
|
1151
1152
|
}
|
|
1152
|
-
`,p0=dt.div``,
|
|
1153
|
+
`,p0=dt.div``,Es=dt.p`
|
|
1153
1154
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1154
1155
|
font-weight: 400;
|
|
1155
1156
|
font-size: 14px;
|
|
1156
1157
|
line-height: 22px;
|
|
1157
|
-
`,
|
|
1158
|
+
`,As=dt.div`
|
|
1158
1159
|
display: flex;
|
|
1159
1160
|
flex-direction: row;
|
|
1160
1161
|
justify-content: flex-start;
|
|
1161
1162
|
align-items: center;
|
|
1162
|
-
`;var
|
|
1163
|
+
`;var Os=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:l})=>{var c,g;let p=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.35s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.7s ease-out"};function s(){var y;return we.createElement(we.Fragment,null,e.imageUri||e.videoUri?we.createElement(Fs,{className:a("stepMediaContainer",r)},e.imageUri?we.createElement(ks,{className:a("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?we.createElement(Ze,{appearance:r,videoUri:e.videoUri}):null):null,we.createElement(Es,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:me(e.subtitle)}),we.createElement(Vo,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?we.createElement(te,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,we.createElement(te,{title:(y=e.primaryButtonTitle)!=null?y:"Continue",onClick:()=>i(),appearance:r})))}function m(){if(!l)return null;let y=l[e.type];return y?typeof y!="function"?y:y(e,r):null}return we.createElement(Ts,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},we.createElement(Ps,{className:a("stepHeader",r)},we.createElement(As,null,we.createElement(Xo,{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(vs,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:me(e.title),onClick:()=>o()})),we.createElement(Bs,{className:a("stepChevronContainer",r),onClick:()=>o(),appearance:r},we.createElement(oo,{style:j(b({},p),{transition:"transform 0.2s ease-in-out"})}))),we.createElement("div",{key:e.id,style:b({},d)},(g=m())!=null?g:s()))};import ro from"styled-components";var T0=ro.div`
|
|
1163
1164
|
background: #ffffff;
|
|
1164
1165
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1165
1166
|
border-radius: 6px;
|
|
@@ -1173,26 +1174,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1173
1174
|
|
|
1174
1175
|
max-width: 800px;
|
|
1175
1176
|
min-width: 350px;
|
|
1176
|
-
`,
|
|
1177
|
+
`,Ns=ro.div`
|
|
1177
1178
|
display: flex;
|
|
1178
1179
|
flex-direction: column;
|
|
1179
|
-
`,
|
|
1180
|
+
`,Is=ro.h1`
|
|
1180
1181
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1181
1182
|
font-style: normal;
|
|
1182
1183
|
font-weight: 700;
|
|
1183
1184
|
font-size: 20px;
|
|
1184
1185
|
line-height: 24px;
|
|
1185
1186
|
margin-bottom: 8px;
|
|
1186
|
-
`,
|
|
1187
|
+
`,Ls=ro.h2`
|
|
1187
1188
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1188
1189
|
font-weight: 400;
|
|
1189
1190
|
font-size: 14px;
|
|
1190
1191
|
line-height: 23px;
|
|
1191
1192
|
margin: 2px 0 0 0;
|
|
1192
|
-
|
|
1193
|
+
`,$s=ro.div`
|
|
1193
1194
|
display: block;
|
|
1194
1195
|
width: 100%;
|
|
1195
|
-
|
|
1196
|
+
`,Ms=ro.div`
|
|
1196
1197
|
display: flex;
|
|
1197
1198
|
width: 100%;
|
|
1198
1199
|
flex-direction: column;
|
|
@@ -1200,7 +1201,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1200
1201
|
padding: 24px;
|
|
1201
1202
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1202
1203
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1203
|
-
`;var ic=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:l=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:s,appearance:m,type:c,className:g,customStepTypes:y,style:T})=>{let C=o.filter(
|
|
1204
|
+
`;var ic=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:l=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:s,appearance:m,type:c,className:g,customStepTypes:y,style:T})=>{let C=o.filter(B=>B.complete).length,[h,A]=rc(Array(o.length).fill(!0));rr(()=>{let B=[...h];if(r){for(let f=0;f<o.length;f++)if(!o[f].complete){B[f]=!1;break}A(B)}},[]),rr(()=>{r&&F(d)},[d]),rr(()=>{p&&h[d]&&F(d)},[d]),rr(()=>{},[o]);let F=B=>{let f=[...h];if(l)for(let I=0;I<h.length;++I)I!=B&&f[B]&&(f[I]=!0);f[B]=!f[B],A(f)};if(!n&&c=="modal")return Ie.createElement(Ie.Fragment,null);let P=Ie.createElement(Ie.Fragment,null,Ie.createElement(Ns,null,Ie.createElement(Is,{appearance:m,className:a("checklistTitle",m),dangerouslySetInnerHTML:me(e)}),Ie.createElement(Ls,{appearance:m,className:a("checklistSubtitle",m),dangerouslySetInnerHTML:me(t)})),Ie.createElement(ze,{display:"percent",count:C,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),v=Ie.createElement($s,{className:be(a("checklistContainer",m),g)},o.map((B,f)=>{var S;let I=h[f];return Ie.createElement(Os,{appearance:m,stepData:B,collapsed:I,key:`modal-checklist-${(S=B.id)!=null?S:f}`,onClick:()=>{F(f),s(f)},onPrimaryButtonClick:()=>{p&&f<o.length-1&&s(f+1),B.handlePrimaryButtonClick&&B.handlePrimaryButtonClick()},onSecondaryButtonClick:()=>{B.handleSecondaryButtonClick&&B.handleSecondaryButtonClick()},customStepTypes:y})}));return c==="inline"?Ie.createElement(Ms,{appearance:m,className:be(a("checklistInlineContainer",m),g),style:T},P,v):Ie.createElement(Ie.Fragment,null,Ie.createElement(Xe,{onClose:i,visible:n,appearance:m,style:{maxWidth:"600px"},headerContent:P},v))},_r=ic;import ue,{useEffect as Hr,useRef as mc,useState as It}from"react";import{useEffect as nc,useState as sc}from"react";var Ds=()=>{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]=sc(t),n=null,r=()=>{n!==null?clearTimeout(n):l(),n=setTimeout(()=>{l()},16)},l=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,s])=>{if(!window)return[d,!1];let m=window.matchMedia(s);return m.addEventListener("change",r),[d,m.matches]}));i(p)};return nc(()=>{l()},[]),o};import io from"react";import ge,{css as Us,keyframes as Ws}from"styled-components";var zs=Us`
|
|
1204
1205
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1205
1206
|
`,lc=Us`
|
|
1206
1207
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
@@ -1342,7 +1343,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1342
1343
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1343
1344
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1344
1345
|
`}
|
|
1345
|
-
`;var el=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ee(),{primaryCTAClickSideEffects:n}=
|
|
1346
|
+
`;var el=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ee(),{primaryCTAClickSideEffects:n}=pe();o=i(o);let{imageUri:r=null,subtitle:l=null,title:p=null,complete:d=!1,blocked:s=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return io.createElement(Ks,{className:a("carouselCard",o),onClick:s?null:c,style:t,blocked:s,complete:d},r&&io.createElement(qs,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||s?.4:1}}),d&&io.createElement(Js,{className:a("carouselCompletedPill",o)},io.createElement(Rs,{style:{color:"#108E0B"}},"Complete")),p&&io.createElement(Zs,{blocked:s,complete:d,className:a("carouselCardTitle",o)},p),l&&io.createElement(Ct.Quiet,{blocked:s,complete:d,className:a("carouselCardSubtitle",o)},l))};var uc=()=>ue.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ue.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ue.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),ue.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),tl=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=It(!1),[r,l]=It(!1);Hr(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&l(!0)},[t]);let p=()=>{n(!1),l(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?ue.createElement(Vs,{style:d,reversed:r,onAnimationEnd:r?p:null},ue.createElement(js,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},ue.createElement(uc,null))):null},ol=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=mc(null),[r,l]=It(!1),[p,d]=It(!1),[s,m]=It(null),[c,g]=It([]),[y,T]=It(0),{isSmall:C}=Ds(),h=C?1:3,{getFlowMetadata:A,getFlowSteps:F,getNumberOfStepsCompleted:P,updateCustomVariables:v,isLoading:B}=X();Hr(()=>{v(o)},[o,B]),Hr(()=>{if(B)return;let O=A(e),N=P(e),V=F(e);m(O),O.data!==null&&(g(V.sort((W,Y)=>Number(W.complete)-Number(Y.complete))),d(V.length>h),T(N))},[B]);let f=[];for(let O=0;O<c.length;O+=h)f.push(c.slice(O,O+h));let I=O=>{let N=O.target,V=N.scrollWidth-N.clientWidth,W=Math.ceil(N.scrollLeft);W>0&&r===!1&&l(!0),W===0&&r===!0&&l(!1),W<V&&p===!1&&d(!0),W===V&&p===!0&&d(!1)},S=(O=!0)=>{let N=O?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*N,behavior:"smooth"})},k=null,L=O=>{k!==null?clearTimeout(k):I(O),k=setTimeout(()=>{I(O)},16)};return B?null:ue.createElement(Ys,{className:be(a("carouselContainer",t),i)},ue.createElement("div",{style:{display:"flex",justifyContent:C?"center":"space-between",marginBottom:20,flexWrap:C?"wrap":"nowrap",gap:C?16:20}},ue.createElement("div",null,ue.createElement(Xs,{className:a("carouselTitle",t)},s==null?void 0:s.title),ue.createElement(Ct.Quiet,{className:a("carouselSubtitle",t)},s==null?void 0:s.subtitle)),ue.createElement(Qs,{className:a("progressWrapper",t)},ue.createElement(ze,{count:y,total:c.length,appearance:t}))),ue.createElement("div",{style:{position:"relative"}},ue.createElement(tl,{show:r,onClick:()=>S(!1)}),ue.createElement(tl,{side:"right",show:p,onClick:S}),ue.createElement(_s,{ref:n,onScroll:L},f.map((O,N)=>ue.createElement(Hs,{key:N,style:{flex:`0 0 calc(100% - ${c.length>h?36:0}px)`}},O.map((V,W)=>ue.createElement(el,{key:W,stepData:V,style:{flex:c.length>h?`0 1 calc(100% / ${h} - 16px * 2 / ${h})`:1},appearance:t})))))),ue.createElement(ne,{appearance:t}))};var jr=v=>{var B=v,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:l="inline",onDismiss:p,visible:d,customVariables:s,onStepCompletion:m,onButtonClick:c,appearance:g,hideOnFlowCompletion:y,setVisible:T,customStepTypes:C,checklistStyle:h="default",autoExpandFirstIncompleteStep:A,autoExpandNextStep:F}=B,P=Ne(B,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:f,getFlowSteps:I,markStepCompleted:S,getStepStatus:k,getNumberOfStepsCompleted:L,isLoading:O,targetingLogicShouldHideFlow:N,updateCustomVariables:V,getFlowMetadata:W,isStepBlocked:Y,getFlowStatus:Q,hasActiveFullPageFlow:de,setHasActiveFullPageFlow:H,markStepStarted:le}=X(),{primaryCTAClickSideEffects:fe,secondaryCTAClickSideEffects:Te}=pe(),{getOpenFlowState:re,setOpenFlowState:Z}=Be(),[q,_]=rl(n||0),[Le,he]=rl(!1),Fe=d===void 0?re(e):d,ye=l==="modal",{mergeAppearanceWithDefault:$e}=ee();Ve(e);let $=I(e);if(g=$e(g),Vr(()=>{V(s)},[s,O]),Vr(()=>{d!==void 0&&(ye&&d===!0?H(!0):ye&&d===!1&&H(!1))},[d,T,de]),Vr(()=>{!O&&$&&$[q]&&k(e,$[q].id)&&k(e,$[q].id)!==De&&le(e,$[q].id)},[q]),O)return null;let M=f(e);if(!M||N(M)||!$||y===!0&&Q(e)===R)return null;let D=W(e);if(D!=null&&D.title&&(t=D.title),D!=null&&D.subtitle&&(o=D.subtitle),!Le&&n===void 0&&L(e)>0){let u=$.findIndex(w=>w.complete===!1);_(u>-1?u:$.length-1),he(!0)}function ie(){if(q+1>=$.length){ye&&Z(e,!1);return}Y(e,$[q+1].id)||_(q+1)}function Oe(u,w,z){let ce=q+1<$.length?$[q+1]:null;c&&c(u,q,w,ce)===!0&&ye&&Ke(),m&&m(u,z,ce),!m&&!c&&(u.primaryButtonUri||u.secondaryButtonUri)&&ye&&Ke()}function bt(){return $.map((u,w)=>j(b({},u),{handleSecondaryButtonClick:()=>{ie(),Te(u),u.skippable===!0&&S(e,u.id,{skipped:!0}),Oe(u,"secondary",w)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(S(e,u.id),ie()),Oe(u,"primary",w),fe(u),k(e,u.id)===De&&ie()}}))}function Ge(){return Ce.createElement(ne,{appearance:g})}let mt={steps:bt(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:C,type:l,className:r,autoExpandFirstIncompleteStep:A,autoExpandNextStep:F};function Ke(){Z(e,!1),p&&p(),T&&T(!1)}function Dt(){return Ce.createElement(Ce.Fragment,null,Ce.createElement(Ge,null),Ce.createElement(ol,{flowId:e,appearance:g,customVariables:s,className:r}))}function Ut(){return Ce.createElement(Ce.Fragment,null,Ce.createElement(Ge,null),Ce.createElement(_r,b({visible:Fe,onClose:()=>{Ke()},selectedStep:q,setSelectedStep:_,autoExpandNextStep:!0,appearance:g},mt)))}function Wt(){var z;let u=P.guideFlowId,w;return u&&f(u)&&(w=I(u)),Ce.createElement(Ce.Fragment,null,Ce.createElement(Ge,null),Ce.createElement(zr,b({visible:Fe,stepsTitle:D.stepsTitle?D.stepsTitle:"Your quick start guide",onClose:()=>{Ke()},selectedStep:q,setSelectedStep:_,guideData:w,guideTitle:(z=P.guideTitle)!=null?z:"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:ce=>{Oe(ce,"link",0)},customStepTypes:C},mt)))}function x(){let u=Ce.createElement(Ur,b({flowId:e,style:i,selectedStep:q,setSelectedStep:_,appearance:g,type:l},mt));return ye?Ce.createElement(Xe,{onClose:()=>{Ke()},visible:Fe,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},Ce.createElement(Ge,null),u):Ce.createElement(Ce.Fragment,null,Ce.createElement(Ge,null),u)}switch(h){case"condensed":return Ut();case"with-guide":return Wt();case"default":return x();case"carousel":return Dt();default:return x()}};var gc=e=>fc.createElement(jr,b({type:"inline"},e));import St,{useEffect as hc}from"react";import et from"react";import ir from"styled-components";var il=ir.div`
|
|
1346
1347
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1347
1348
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1348
1349
|
padding: 10px 12px 10px 12px;
|
|
@@ -1354,27 +1355,27 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1354
1355
|
&:hover {
|
|
1355
1356
|
filter: brightness(.99);
|
|
1356
1357
|
}
|
|
1357
|
-
`,nl=
|
|
1358
|
+
`,nl=ir.div`
|
|
1358
1359
|
display: flex;
|
|
1359
1360
|
flex-direction: row;
|
|
1360
1361
|
justify-content: space-between;
|
|
1361
1362
|
align-items: center;
|
|
1362
1363
|
margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
|
|
1363
1364
|
flex-grow: 2;
|
|
1364
|
-
`,sl=
|
|
1365
|
+
`,sl=ir.div`
|
|
1365
1366
|
text-overflow: ellipsis;
|
|
1366
1367
|
font-weight: 600;
|
|
1367
1368
|
font-size: 14px;
|
|
1368
1369
|
line-height: 16px;
|
|
1369
1370
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1370
1371
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1371
|
-
`,ll=
|
|
1372
|
+
`,ll=ir.div`
|
|
1372
1373
|
width: 20px;
|
|
1373
1374
|
margin-right: 8px;
|
|
1374
1375
|
display: flex;
|
|
1375
1376
|
height: 100%;
|
|
1376
1377
|
align-items: center;
|
|
1377
|
-
`;var al=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:l,type:p="default"})=>et.createElement(et.Fragment,null,et.createElement(ne,{appearance:l}),et.createElement(il,{onClick:()=>i!==void 0&&i(),styleOverrides:b(b({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:be(r!=null?r:"",a("progressBadgeContainer",l)),appearance:l},p=="condensed"&&o&&o!==0&&et.createElement(ll,{className:a("progressRingContainer",l)},et.createElement(
|
|
1378
|
+
`;var al=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:l,type:p="default"})=>et.createElement(et.Fragment,null,et.createElement(ne,{appearance:l}),et.createElement(il,{onClick:()=>i!==void 0&&i(),styleOverrides:b(b({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:be(r!=null?r:"",a("progressBadgeContainer",l)),appearance:l},p=="condensed"&&o&&o!==0&&et.createElement(ll,{className:a("progressRingContainer",l)},et.createElement(Gt,{size:19,percentage:t/o,fillColor:l.theme.colorPrimary,bgColor:l.theme.colorBackgroundSecondary})),et.createElement(nl,{type:p,className:a("badgeTitleContainer",l)},et.createElement(sl,{type:p,appearance:l,className:a("badgeTitle",l)},e),i!==void 0&&et.createElement(oo,{className:a("badgeChevron",l),color:l.theme.colorPrimary})),p=="default"&&o&&o!==0&&et.createElement(ze,{display:"compact",count:t,total:o,bgColor:l.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:l,textStyle:{color:"#818898"}})));import yt from"react";import Po from"styled-components";var pl=Po.div`
|
|
1378
1379
|
display: flex;
|
|
1379
1380
|
flex-direction: row;
|
|
1380
1381
|
width: 100%;
|
|
@@ -1384,25 +1385,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1384
1385
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1385
1386
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1386
1387
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1387
|
-
`,dl=
|
|
1388
|
+
`,dl=Po.div`
|
|
1388
1389
|
${e=>E(e)} {
|
|
1389
1390
|
display: flex;
|
|
1390
1391
|
justify-content: center;
|
|
1391
1392
|
align-items: center;
|
|
1392
1393
|
margin-right: 16px;
|
|
1393
1394
|
}
|
|
1394
|
-
`,cl=
|
|
1395
|
+
`,cl=Po.div`
|
|
1395
1396
|
display: flex;
|
|
1396
1397
|
flex-direction: column;
|
|
1397
1398
|
flex: 1;
|
|
1398
1399
|
margin-top: 0;
|
|
1399
|
-
`,ml=
|
|
1400
|
+
`,ml=Po.div`
|
|
1400
1401
|
display: flex;
|
|
1401
1402
|
flex-direction: column;
|
|
1402
1403
|
justify-content: center;
|
|
1403
1404
|
margin-left: 16px;
|
|
1404
1405
|
min-width: 200px;
|
|
1405
|
-
`,VS=
|
|
1406
|
+
`,VS=Po.div`
|
|
1406
1407
|
display: flex;
|
|
1407
1408
|
justify-content: center;
|
|
1408
1409
|
align-items: flex-end;
|
|
@@ -1411,7 +1412,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1411
1412
|
:hover {
|
|
1412
1413
|
opacity: 0.8;
|
|
1413
1414
|
}
|
|
1414
|
-
`;var ul=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:l,style:p})=>yt.createElement(yt.Fragment,null,yt.createElement(pl,{appearance:i,className:be(a("fullWidthProgressBadgeContainer",i),l!=null?l:""),style:p},o&&yt.createElement(dl,{className:a("fullWidthProgressBadgeIcon",i)},o),yt.createElement(cl,null,yt.createElement(Ae,{size:"small",appearance:i,title:e,subtitle:t})),yt.createElement(ml,{className:a("fullWidthProgressBadgeProgressContainer",i)},yt.createElement(ze,{count:n,total:r,display:"percent",textLocation:"top"}))));var xc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:l,customVariables:p,hideOnFlowCompletion:d,appearance:s,type:m="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:y,getNumberOfStepsCompleted:T,isLoading:C,targetingLogicShouldHideFlow:h,updateCustomVariables:A}=X(),{mergeAppearanceWithDefault:F}=ee();s=F(s);let{setOpenFlowState:P,getOpenFlowState:
|
|
1415
|
+
`;var ul=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:l,style:p})=>yt.createElement(yt.Fragment,null,yt.createElement(pl,{appearance:i,className:be(a("fullWidthProgressBadgeContainer",i),l!=null?l:""),style:p},o&&yt.createElement(dl,{className:a("fullWidthProgressBadgeIcon",i)},o),yt.createElement(cl,null,yt.createElement(Ae,{size:"small",appearance:i,title:e,subtitle:t})),yt.createElement(ml,{className:a("fullWidthProgressBadgeProgressContainer",i)},yt.createElement(ze,{count:n,total:r,display:"percent",textLocation:"top"}))));var xc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:l,customVariables:p,hideOnFlowCompletion:d,appearance:s,type:m="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:y,getNumberOfStepsCompleted:T,isLoading:C,targetingLogicShouldHideFlow:h,updateCustomVariables:A}=X(),{mergeAppearanceWithDefault:F}=ee();s=F(s);let{setOpenFlowState:P,getOpenFlowState:v}=Be();if(hc(()=>{A(p)},[p,C]),C)return null;let B=c(e);if(!B||h(B)||d===!0&&y(e)===R)return null;let f=g(e),I=T(e);return m==="full-width"?St.createElement(St.Fragment,null,St.createElement(ne,{appearance:s}),St.createElement(ul,{title:t,subtitle:o,count:I,total:f.length,style:n,className:l,appearance:s,icon:i,onClick:()=>{}})):St.createElement(St.Fragment,null,St.createElement(ne,{appearance:s}),St.createElement(al,{count:I,total:f.length,title:t,style:n,onClick:()=>{P(e,!0),r&&r()},type:m,className:l,appearance:s}))};import Cc from"react";var yc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Ne(r,["flowId","style","appearance"]);let{getFlow:l,targetingLogicShouldHideFlow:p,getFlowSteps:d}=X(),{mergeAppearanceWithDefault:s}=ee();o=s(o);let m=l(e);if(!m||p(m))return null;let c=d(e);return Cc.createElement(ko,b({steps:c,style:t,appearance:o},i))};import Lt,{useContext as Nc,useEffect as Ic}from"react";import K,{useEffect as vo,useLayoutEffect as hl,useRef as kc,useState as no}from"react";import Bo from"styled-components";import{useCallback as Sc,useEffect as bc,useState as wc}from"react";var Gr=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,l=n=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+l,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+l,y:e.top-i.y+r}:{x:0,y:0}};function 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]=wc(o),r=Sc(()=>{e&&n(e.getBoundingClientRect())},[e]);return bc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as Tc,useState as Fc}from"react";function gl(){let{debug:e}=Tc(J),[t,o]=Fc([]);function i(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.log(r)))}function n(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:i,logErrorIfDebugMode:n}}var xl=300,Cl=100,Pc=500,so=12,vc=Bo.div`
|
|
1415
1416
|
width: 100%;
|
|
1416
1417
|
height: 100%;
|
|
1417
1418
|
border-radius: 9999px;
|
|
@@ -1434,25 +1435,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1434
1435
|
opacity: 0;
|
|
1435
1436
|
}
|
|
1436
1437
|
}
|
|
1437
|
-
`,Bc=
|
|
1438
|
-
width: ${
|
|
1439
|
-
height: ${
|
|
1438
|
+
`,Bc=Bo.div`
|
|
1439
|
+
width: ${so}px;
|
|
1440
|
+
height: ${so}px;
|
|
1440
1441
|
border-radius: 100px;
|
|
1441
1442
|
background-color: ${e=>e.primaryColor};
|
|
1442
1443
|
z-index: 20;
|
|
1443
1444
|
opacity: 1;
|
|
1444
|
-
`,Ec=
|
|
1445
|
+
`,Ec=Bo.div`
|
|
1445
1446
|
pointer-events: all;
|
|
1446
|
-
`,yl=
|
|
1447
|
+
`,yl=Bo.div`
|
|
1447
1448
|
display: flex;
|
|
1448
1449
|
align-content: center;
|
|
1449
1450
|
justify-content: center;
|
|
1450
1451
|
align-items: center;
|
|
1451
1452
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1452
|
-
`,Ac=
|
|
1453
|
-
width: ${
|
|
1454
|
-
height: ${
|
|
1455
|
-
`,Oc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:l={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:s=0,customStepTypes:m,appearance:c,dismissible:g=!1,showHighlightOnly:y,showStepCount:T=!0,completedStepsCount:C=0,showFrigadeBranding:h=!1,cssPosition:A="absolute",onViewTooltip:F})=>{var Ge,mt,Ke,
|
|
1453
|
+
`,Ac=Bo(yl)`
|
|
1454
|
+
width: ${so+12}px;
|
|
1455
|
+
height: ${so+12}px;
|
|
1456
|
+
`,Oc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:l={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:s=0,customStepTypes:m,appearance:c,dismissible:g=!1,showHighlightOnly:y,showStepCount:T=!0,completedStepsCount:C=0,showFrigadeBranding:h=!1,cssPosition:A="absolute",onViewTooltip:F})=>{var Ge,mt,Ke,Dt,Ut,Wt,x,u,w,z,ce,ae,wt,Tt,ei,ti,oi,ri,ii;let{logErrorIfDebugMode:P}=gl(),[v,B]=no(),[f,I]=no(new Date),S=kc(null),[k,L]=no(document.querySelector(e[s].selector)),O=fl(k,f),[N,V]=no(),[W,Y]=no(!y),Q=(mt=(Ge=e[s])==null?void 0:Ge.props)!=null&&mt.position?e[s].props.position:A,de=(Ut=(Dt=(Ke=e[s])==null?void 0:Ke.props)==null?void 0:Dt.zIndex)!=null?Ut:90,H=(Wt=v==null?void 0:v.width)!=null?Wt:xl,le=(x=v==null?void 0:v.height)!=null?x:Cl,[fe,Te]=no(new Date().getTime());l=(z=(w=(u=e[s])==null?void 0:u.props)==null?void 0:w.offset)!=null?z:l;let re=window.location.pathname.split("/").pop();hl(()=>{S.current&&B({width:S.current.clientWidth,height:S.current.clientHeight})},[s,f,Q]),vo(()=>{y||Y(!0)},[s]),vo(()=>{p&&W&&F(s)},[W]);let Z=()=>{let se=document.querySelector(e[s].selector);if(!se){V(void 0),L(null),P(`FrigadeTour: Could not find element with selector "${e[s].selector}" for step ${e[s].id}`);return}N&&N===JSON.stringify(se==null?void 0:se.getBoundingClientRect())||(L(se),I(new Date),se&&V(JSON.stringify(se.getBoundingClientRect())))};if(vo(()=>{let se=new MutationObserver(Z);return se.observe(document.body,{subtree:!0,childList:!0}),()=>se.disconnect()},[Z]),vo(()=>{let se=new MutationObserver(Z);return se.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>se.disconnect()},[Z]),vo(()=>{let se=setInterval(()=>{Z()},10);return()=>clearInterval(se)},[Z]),hl(()=>{setTimeout(()=>{Z()},Pc),Z()},[s,re]),k===null||!p)return null;let q=i==="auto"?"right":i,_=Gr(O,q,H,l,Q),Le=O.right+H>(window.innerWidth||document.documentElement.clientWidth),he=O.bottom+Cl>(window.innerHeight||document.documentElement.clientHeight);Le&&i==="auto"&&(_=Gr(O,"left",H,l,Q),q="left"),(ae=(ce=e[s])==null?void 0:ce.props)!=null&&ae.tooltipPosition&&((Tt=(wt=e[s])==null?void 0:wt.props)==null?void 0:Tt.tooltipPosition)!=="auto"&&(((ti=(ei=e[s])==null?void 0:ei.props)==null?void 0:ti.tooltipPosition)==="left"||((ri=(oi=e[s])==null?void 0:oi.props)==null?void 0:ri.tooltipPosition)==="right")&&(q=e[s].props.tooltipPosition);let Fe=()=>{let se=()=>{if(e[s].handlePrimaryButtonClick&&(e[s].handlePrimaryButtonClick(),Y(!1),setTimeout(()=>{Z()},30)),C===e.length-1)return o()},ut=()=>{e[s].handleSecondaryButtonClick&&(e[s].handleSecondaryButtonClick(),y&&!e[s].secondaryButtonUri&&Y(!1))};return K.createElement(K.Fragment,null,T&&e.length>1&&K.createElement(bi,null,K.createElement(Ti,{className:a("tooltipStepCounter",c)},s+1," of ",e.length)),(e[s].primaryButtonTitle||e[s].secondaryButtonTitle)&&K.createElement(wi,{showStepCount:T,className:a("tooltipCTAContainer",c)},e[s].secondaryButtonTitle&&K.createElement(te,{title:e[s].secondaryButtonTitle,appearance:c,onClick:ut,size:"small",withMargin:!1,secondary:!0}),e[s].primaryButtonTitle&&K.createElement(te,{title:e[s].primaryButtonTitle,appearance:c,onClick:se,withMargin:!1,size:"small"})))},ye=()=>K.createElement(K.Fragment,null,g&&K.createElement(hi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[s].imageUri||!!e[s].videoUri},K.createElement(Ee,null)),e[s].imageUri&&K.createElement(xi,{dismissible:g,appearance:c,src:e[s].imageUri,className:a("tooltipImageContainer",c)}),e[s].videoUri&&!e[s].imageUri&&K.createElement(Ci,{dismissible:g,appearance:c,className:a("tooltipVideoContainer",c)},K.createElement(Ze,{appearance:c,videoUri:e[s].videoUri})),K.createElement(Si,{className:a("tooltipContentContainer",c)},K.createElement(Ae,{appearance:c,title:e[s].title,subtitle:e[s].subtitle,size:"small"}),K.createElement(yi,{className:a("tooltipFooter",c)},K.createElement(Fe,null)))),$=b(b({},{default:se=>{var ut;if((ut=e[s])!=null&&ut.StepContent){let ra=e[s].StepContent;return K.createElement("div",null,ra)}return K.createElement(ye,null)}}),m),M=()=>{var se;return e?!((se=e[s])!=null&&se.type)||!$[e[s].type]?$.default(e[s]):$[e[s].type]({stepData:e[s],primaryColor:r}):K.createElement(K.Fragment,null)};if(e[s].complete===!0||_.x==0&&_.y==0&&new Date().getTime()-fe<100)return null;let D={top:(_==null?void 0:_.y)-so,left:(ii=q=="left"?O.x+l.x:(_==null?void 0:_.x)-so)!=null?ii:0,cursor:y?"pointer":"default",position:Q},ie=()=>{let ut=D.left+(q=="left"?-H:24);return Math.min(Math.max(ut,20),window.innerWidth-H-20)},Oe=()=>{if(Q==="fixed")return D.top;let se=D.top+le,ut=20;return se>window.innerHeight-ut?D.top+-le:D.top},bt=()=>{y&&(I(new Date),Y(!W))};return K.createElement(Ec,null,K.createElement(Ac,{style:D,zIndex:de,className:a("tourHighlightContainer",c)},n&&e[s].showHighlight!==!1&&A!=="static"&&K.createElement(K.Fragment,null,K.createElement(Bc,{style:{position:Q},onClick:bt,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),K.createElement(vc,{style:{position:"absolute"},onClick:bt,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),K.createElement(yl,{style:j(b({},D),{left:ie(),top:Oe()}),zIndex:de+1,className:a("tooltipContainerWrapper",c)},W&&K.createElement(K.Fragment,null,K.createElement(Io,{ref:S,layoutId:"tooltip-container",style:b({position:"relative",width:"max-content",right:0,top:A!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:xl,zIndex:de+10},K.createElement(M,null)),h&&K.createElement(ki,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:de+10},K.createElement(Lo,{appearance:c})))))},Kr=Oc;import{Portal as Lc}from"react-portal";var $c=C=>{var h=C,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:l,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:s=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:g=!1,cssPosition:y="absolute"}=h,T=Ne(h,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition"]);let{getFlow:A,getFlowSteps:F,isLoading:P,targetingLogicShouldHideFlow:v,markStepCompleted:B,markStepStarted:f,markFlowCompleted:I,updateCustomVariables:S,getCurrentStepIndex:k,getStepStatus:L,isStepBlocked:O,getFlowStatus:N,getNumberOfStepsCompleted:V}=X(),{isLoadingUserFlowStateData:W}=Ue(),{primaryCTAClickSideEffects:Y,secondaryCTAClickSideEffects:Q}=pe(),{hasOpenModals:de}=Be(),H=k(e),{openFlowStates:le}=Nc(J),{mergeAppearanceWithDefault:fe}=ee();if(o=fe(o),Ic(()=>{S(t)},[t,P]),W)return null;let Te=A(e);if(!Te||v(Te)||N(e)==R||de())return null;let re=F(e);if(Object.keys(le).length>0){let M=Object.keys(le).find(D=>le[D]===!0);if(M!==void 0&&M!==e)return Lt.createElement(Lt.Fragment,null)}function Z(M){return U(this,null,function*(){if(yield B(e,M.id),re.map(D=>L(e,D.id)).every(D=>D===De)){yield I(e);return}!s&&H+1<re.length&&!r&&O(e,re[H+1].id)})}function q(M,D,ie){let Oe=H+1<re.length?re[H+1]:null;n&&n(M,H,D,Oe),i&&i(M,ie,Oe)}function _(){return re.map(M=>j(b({},M),{handleSecondaryButtonClick:()=>U(this,null,function*(){Q(M),M.skippable===!0&&(yield B(e,M.id,{skipped:!0})),q(M,"secondary",H)}),handlePrimaryButtonClick:()=>U(this,null,function*(){(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&(yield Z(M)),q(M,"primary",H),Y(M)})}))}function Le(M){return U(this,null,function*(){l&&l(),m==="complete-flow"?yield I(e):yield B(e,M.id)})}function he(){c&&c()}function Fe(M){return U(this,null,function*(){yield f(e,re[M].id)})}let ye=!document.querySelector(re[H].selector);function $e(){let M=re.findIndex(D=>!!document.querySelector(D.selector));return re.map((D,ie)=>ye&&!r&&ie!==M&&g||!r&&ie!==H?null:Lt.createElement(Kr,b({key:D.id,appearance:o,steps:_(),selectedStep:ie,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Le(D),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:V(e),onComplete:he,cssPosition:y,onViewTooltip:Fe},T)))}function $(){return Lt.createElement(Lt.Fragment,null,Lt.createElement(ne,{appearance:o}),$e())}return y==="static"?$():Lt.createElement(Lc,null,$())};import He,{useEffect as Mc,useRef as Dc,useState as Uc}from"react";import{Portal as Wc}from"react-portal";import $t from"styled-components";var Sl=$t.button`
|
|
1456
1457
|
${e=>E(e)} {
|
|
1457
1458
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1458
1459
|
|
|
@@ -1470,17 +1471,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1470
1471
|
opacity: 0.8;
|
|
1471
1472
|
}
|
|
1472
1473
|
}
|
|
1473
|
-
`,bl
|
|
1474
|
+
`,bl=$t.span`
|
|
1474
1475
|
${e=>E(e)} {
|
|
1475
1476
|
font-size: 12px;
|
|
1476
1477
|
display: inline-block;
|
|
1477
1478
|
}
|
|
1478
|
-
`,wl
|
|
1479
|
+
`,wl=$t.span`
|
|
1479
1480
|
${e=>E(e)} {
|
|
1480
1481
|
font-size: 12px;
|
|
1481
1482
|
display: inline-block;
|
|
1482
1483
|
}
|
|
1483
|
-
`,Tl
|
|
1484
|
+
`,Tl=$t.div`
|
|
1484
1485
|
position: fixed;
|
|
1485
1486
|
right: 0;
|
|
1486
1487
|
bottom: 0;
|
|
@@ -1490,7 +1491,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1490
1491
|
flex-direction: column;
|
|
1491
1492
|
align-items: flex-end;
|
|
1492
1493
|
z-index: 50;
|
|
1493
|
-
`,Fl
|
|
1494
|
+
`,Fl=$t.button`
|
|
1494
1495
|
${e=>E(e)} {
|
|
1495
1496
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1496
1497
|
background-color: #ffffff;
|
|
@@ -1506,7 +1507,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1506
1507
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1507
1508
|
border-radius: 45px;
|
|
1508
1509
|
cursor: pointer;
|
|
1509
|
-
`,kl
|
|
1510
|
+
`,kl=$t.div`
|
|
1510
1511
|
${e=>E(e)} {
|
|
1511
1512
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1512
1513
|
background: #ffffff;
|
|
@@ -1523,7 +1524,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1523
1524
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1524
1525
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1525
1526
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1526
|
-
`,Pl
|
|
1527
|
+
`,Pl=$t.button`
|
|
1527
1528
|
${e=>E(e)} {
|
|
1528
1529
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1529
1530
|
color: #434343;
|
|
@@ -1540,7 +1541,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1540
1541
|
font-size: 14px;
|
|
1541
1542
|
|
|
1542
1543
|
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 zc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:l})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:s,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y}=X(),{primaryCTAClickSideEffects:T}=
|
|
1544
|
+
`;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 zc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:l})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:s,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y}=X(),{primaryCTAClickSideEffects:T}=pe(),C=Dc(null),[h,A]=Uc(!1),{mergeAppearanceWithDefault:F}=ee();l=F(l),Mc(()=>(document.addEventListener("click",P,!1),()=>{document.removeEventListener("click",P,!1)}),[]);let P=S=>{C.current&&!C.current.contains(S.target)&&A(!1)};if(g)return null;let v=p(e);if(!v||y(v))return null;let B=d(e);if(!B||!i)return null;function f(S,k){!S.completionCriteria&&(S.autoMarkCompleted||S.autoMarkCompleted===void 0)&&s(e,S.id),T(S),o&&o(S,k),A(!1)}function I(){return h&&He.createElement(kl,{className:a("floatingWidgetMenu",l),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},B.map((S,k)=>He.createElement(Pl,{className:a("floatingWidgetMenuItem",l),key:k,onClick:()=>f(S,k)},S.title)))}return n=="inline"?He.createElement("span",{ref:C},He.createElement(Sl,{style:t,onClick:()=>{A(!h)},className:a("supportButton",l)},He.createElement(wl,{className:a("supportIconContainer",l)},He.createElement(Al,{className:a("supportIcon",l),style:{width:"18px",height:"18px"}})),He.createElement(bl,{className:a("supportButtonTitle",l)},r)),He.createElement(I,null)):He.createElement(Wc,null,He.createElement(Tl,{style:t,ref:C},He.createElement(I,null),He.createElement(Fl,{onClick:()=>{A(!h)},whileHover:{scale:1.1},className:a("floatingWidgetButton",l)},He.createElement(Bl,{className:a("floatingWidgetButtonIcon",l),style:{display:"flex",width:"20px",height:"20px"}}))))};import tt,{useEffect as _c}from"react";import nr from"styled-components";var Ol=nr.div`
|
|
1544
1545
|
${e=>E(e)} {
|
|
1545
1546
|
display: flex;
|
|
1546
1547
|
flex-direction: column;
|
|
@@ -1555,17 +1556,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1555
1556
|
border-radius: 12px;
|
|
1556
1557
|
position: relative;
|
|
1557
1558
|
}
|
|
1558
|
-
`,Nl=
|
|
1559
|
+
`,Nl=nr.div`
|
|
1559
1560
|
display: flex;
|
|
1560
1561
|
flex-direction: column;
|
|
1561
1562
|
flex: 1;
|
|
1562
|
-
`,Il=
|
|
1563
|
+
`,Il=nr.div`
|
|
1563
1564
|
display: flex;
|
|
1564
1565
|
flex-direction: column;
|
|
1565
1566
|
justify-content: center;
|
|
1566
1567
|
align-items: flex-start;
|
|
1567
1568
|
margin-top: 16px;
|
|
1568
|
-
`,Ll=
|
|
1569
|
+
`,Ll=nr.div`
|
|
1569
1570
|
${e=>E(e)} {
|
|
1570
1571
|
position: absolute;
|
|
1571
1572
|
top: 16px;
|
|
@@ -1576,7 +1577,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1576
1577
|
opacity: 0.8;
|
|
1577
1578
|
}
|
|
1578
1579
|
}
|
|
1579
|
-
`;var Hc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowSteps:T,getFlowStatus:C,getCurrentStepIndex:h}=X(),{primaryCTAClickSideEffects:A}=
|
|
1580
|
+
`;var Hc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowSteps:T,getFlowStatus:C,getCurrentStepIndex:h}=X(),{primaryCTAClickSideEffects:A}=pe(),{mergeAppearanceWithDefault:F}=ee();if(Ve(e),n=F(n),_c(()=>{y(o)},[o,c]),c)return null;let P=d(e);if(!P||g(P)||C(e)===R)return null;let B=T(e)[h(e)];return tt.createElement(tt.Fragment,null,tt.createElement(ne,{appearance:n}),tt.createElement(Ol,{appearance:n,className:be(a("embeddedTipContainer",n),r),style:l},(p===!0||B.dismissible)&&tt.createElement(Ll,{onClick:()=>U(void 0,null,function*(){yield s(e),t&&t()}),className:a("embeddedTipDismissButton",n)},tt.createElement(Ee,null)),tt.createElement(Nl,null,tt.createElement(Ae,{size:"small",appearance:n,title:B.title,subtitle:B.subtitle})),B.primaryButtonTitle&&tt.createElement(Il,{className:a("embeddedTipCallToActionContainer",n)},tt.createElement(te,{classPrefix:"embeddedTip",title:B.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>U(void 0,null,function*(){B.handlePrimaryButtonClick(),A(B),!(i&&i(B,h(e),"primary")===!1)&&(yield m(e,B.id),yield s(e))})}))))};import Pe,{useEffect as Vc}from"react";import lo from"styled-components";var $l=lo.div`
|
|
1580
1581
|
// use the :not annotation
|
|
1581
1582
|
${e=>E(e)} {
|
|
1582
1583
|
display: flex;
|
|
@@ -1588,24 +1589,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1588
1589
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1589
1590
|
border-radius: 12px;
|
|
1590
1591
|
}
|
|
1591
|
-
`,Ml=
|
|
1592
|
+
`,Ml=lo.div`
|
|
1592
1593
|
${e=>E(e)} {
|
|
1593
1594
|
display: flex;
|
|
1594
1595
|
width: 46px;
|
|
1595
1596
|
height: 46px;
|
|
1596
1597
|
}
|
|
1597
|
-
`,Dl=
|
|
1598
|
+
`,Dl=lo.div`
|
|
1598
1599
|
display: flex;
|
|
1599
1600
|
flex-direction: column;
|
|
1600
1601
|
flex: 1;
|
|
1601
1602
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1602
1603
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1603
|
-
`,Ul=
|
|
1604
|
+
`,Ul=lo.div`
|
|
1604
1605
|
display: flex;
|
|
1605
1606
|
flex-direction: column;
|
|
1606
1607
|
justify-content: center;
|
|
1607
1608
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1608
|
-
`,
|
|
1609
|
+
`,qr=lo.div`
|
|
1609
1610
|
display: flex;
|
|
1610
1611
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1611
1612
|
align-items: flex-end;
|
|
@@ -1613,12 +1614,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1613
1614
|
:hover {
|
|
1614
1615
|
opacity: 0.8;
|
|
1615
1616
|
}
|
|
1616
|
-
`,
|
|
1617
|
+
`,Yr=lo.div`
|
|
1617
1618
|
display: flex;
|
|
1618
1619
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1619
1620
|
align-items: flex-end;
|
|
1620
1621
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1621
|
-
`;import
|
|
1622
|
+
`;import Jr from"react";var Wl=({style:e,className:t})=>Jr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Jr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Jr.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 jc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:l,type:p="full-width",icon:d})=>{let{getFlow:s,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowMetadata:T,getFlowStatus:C,getFlowSteps:h,getCurrentStepIndex:A}=X(),{primaryCTAClickSideEffects:F}=pe(),{mergeAppearanceWithDefault:P}=ee();if(Ve(e),l=P(l),Vc(()=>{y(n)},[n,c]),c)return null;let v=s(e);if(!v||g(v)||C(e)===R)return null;let B=h(e),f=B.length>0?B[A(e)]:T(e);return f!=null&&f.title&&(t=f.title),f!=null&&f.subtitle&&(o=f.subtitle),Pe.createElement(Pe.Fragment,null,Pe.createElement(ne,{appearance:l}),Pe.createElement($l,{type:p,appearance:l,className:a("bannerContainer",l)},p!="square"&&Pe.createElement(Ml,{className:a("bannerIconContainer",l)},d||Pe.createElement(Wl,null)),p==="square"&&f.dismissible&&Pe.createElement(Yr,{type:p,className:a("bannerDismissButtonContainer",l)},Pe.createElement(qr,{type:p,onClick:()=>U(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",l)},Pe.createElement(Ee,null))),Pe.createElement(Dl,{type:p},Pe.createElement(Ae,{appearance:l,title:t,subtitle:o,classPrefix:"banner"})),(f==null?void 0:f.primaryButtonTitle)&&Pe.createElement(Ul,{type:p,className:a("bannerCallToActionContainer",l)},Pe.createElement(te,{title:f==null?void 0:f.primaryButtonTitle,appearance:l,onClick:()=>{F(f),r&&r(f,0,"primary")},classPrefix:"banner"})),p!=="square"&&f.dismissible&&Pe.createElement(Yr,{type:p,className:a("bannerDismissButtonContainer",l)},Pe.createElement(qr,{type:p,onClick:()=>U(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",l)},Pe.createElement(Ee,null)))))};import oe,{useEffect as Gc}from"react";import{Portal as Kc}from"react-portal";import ct from"styled-components";var zl=ct.div`
|
|
1622
1623
|
display: flex;
|
|
1623
1624
|
flex-direction: column;
|
|
1624
1625
|
width: 100%;
|
|
@@ -1661,7 +1662,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1661
1662
|
display: flex;
|
|
1662
1663
|
justify-content: center;
|
|
1663
1664
|
align-items: center;
|
|
1664
|
-
`,
|
|
1665
|
+
`,Xr=ct.div`
|
|
1665
1666
|
display: flex;
|
|
1666
1667
|
justify-content: space-between;
|
|
1667
1668
|
margin-top: 16px;
|
|
@@ -1670,14 +1671,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1670
1671
|
display: flex;
|
|
1671
1672
|
justify-content: space-between;
|
|
1672
1673
|
margin-top: 8px;
|
|
1673
|
-
`,
|
|
1674
|
+
`,Qr=ct.div`
|
|
1674
1675
|
font-size: 12px;
|
|
1675
1676
|
line-height: 18px;
|
|
1676
1677
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1677
1678
|
font-style: normal;
|
|
1678
1679
|
font-weight: 400;
|
|
1679
1680
|
letter-spacing: 0.24px;
|
|
1680
|
-
`,
|
|
1681
|
+
`,Zr=ct.div`
|
|
1681
1682
|
display: flex;
|
|
1682
1683
|
flex-direction: column;
|
|
1683
1684
|
flex: 1;
|
|
@@ -1710,7 +1711,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1710
1711
|
opacity: 0.8;
|
|
1711
1712
|
}
|
|
1712
1713
|
}
|
|
1713
|
-
`;var qc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:C,getFlowStatus:h,getFlowMetadata:A}=X(),{primaryCTAClickSideEffects:F}=
|
|
1714
|
+
`;var qc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:C,getFlowStatus:h,getFlowMetadata:A}=X(),{primaryCTAClickSideEffects:F}=pe(),{mergeAppearanceWithDefault:P}=ee(),[v,B]=oe.useState(null),[f,I]=oe.useState(""),S=A(e),{hasOpenModals:k,setKeepCompletedFlowOpenDuringSession:L,shouldKeepCompletedFlowOpenDuringSession:O}=Be();if(Ve(e),n=P(n),Gc(()=>{T(o)},[o,g]),g)return null;let N=d(e);if(!N||y(N)||h(e)===R||c(e)===1&&!O(e)||k())return null;let W=C(e)[c(e)];function Y(){var H,le;return oe.createElement(oe.Fragment,null,oe.createElement(Zr,null,oe.createElement(Ae,{size:"large",appearance:n,title:W.title,subtitle:W.subtitle})),oe.createElement(Xr,{className:a("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(fe=>oe.createElement(_l,{className:a("npsNumberButton",n),selected:v===fe+1,key:fe,onClick:()=>U(this,null,function*(){L(e),B(fe+1),yield m(e,W.id,{score:fe+1})}),appearance:n},fe+1))),oe.createElement(Hl,{appearance:n},oe.createElement(Qr,{appearance:n},(H=S==null?void 0:S.negativeLabel)!=null?H:"Not likely at all"),oe.createElement(Qr,{appearance:n},(le=S==null?void 0:S.positiveLabel)!=null?le:"Extremely likely")))}function Q(){var H;return oe.createElement(oe.Fragment,null,oe.createElement(Zr,null,oe.createElement(Ae,{appearance:n,title:(H=W.title)!=null?H:"Why did you choose this score?",size:"large"})),oe.createElement(Vl,{appearance:n,value:f,onChange:le=>{I(le.target.value)},placeHolder:"Add your optional fedback here..."}),oe.createElement(Xr,{appearance:n,className:a("npsNumberButtonContainer",n)},oe.createElement(te,{size:"large",withMargin:!1,onClick:()=>U(this,null,function*(){yield s(e),i&&i(W,1,"primary")}),appearance:n,title:W.secondaryButtonTitle||"Skip",secondary:!0}),oe.createElement(te,{size:"large",withMargin:!1,onClick:()=>U(this,null,function*(){yield m(e,W.id,{feedbackText:f}),yield s(e),i&&i(W,1,"primary")}),appearance:n,title:W.primaryButtonTitle||"Submit"})))}function de(){return c(e)>=2?null:oe.createElement(oe.Fragment,null,oe.createElement(ne,{appearance:n}),oe.createElement(zl,{appearance:n,className:be(a("npsSurveyContainer",n),r),style:l,type:p},oe.createElement(jl,{onClick:()=>U(this,null,function*(){yield s(e),t&&t()}),className:a("npsSurveyDismissButton",n)},oe.createElement(Ee,null)),c(e)==0&&Y(),c(e)==1&&Q()))}return p==="inline"?de():oe.createElement(Kc,null,de())};import ve,{useEffect as Xc}from"react";import Mt from"styled-components";var Gl=Mt.div`
|
|
1714
1715
|
${e=>E(e)} {
|
|
1715
1716
|
display: flex;
|
|
1716
1717
|
flex-direction: column;
|
|
@@ -1721,21 +1722,21 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1721
1722
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1722
1723
|
position: relative;
|
|
1723
1724
|
}
|
|
1724
|
-
`,Kl
|
|
1725
|
+
`,Kl=Mt.div`
|
|
1725
1726
|
display: flex;
|
|
1726
1727
|
flex-direction: column;
|
|
1727
1728
|
flex: 1;
|
|
1728
|
-
`,ql
|
|
1729
|
+
`,ql=Mt.div`
|
|
1729
1730
|
display: flex;
|
|
1730
1731
|
flex-direction: row;
|
|
1731
1732
|
justify-content: center;
|
|
1732
1733
|
align-items: stretch;
|
|
1733
1734
|
gap: 16px;
|
|
1734
1735
|
margin-top: 8px;
|
|
1735
|
-
`,Yl
|
|
1736
|
+
`,Yl=Mt.div`
|
|
1736
1737
|
margin-top: 16px;
|
|
1737
1738
|
margin-bottom: 16px;
|
|
1738
|
-
`,Jl
|
|
1739
|
+
`,Jl=Mt.div`
|
|
1739
1740
|
${e=>E(e)} {
|
|
1740
1741
|
position: absolute;
|
|
1741
1742
|
top: -16px;
|
|
@@ -1746,7 +1747,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1746
1747
|
opacity: 0.8;
|
|
1747
1748
|
}
|
|
1748
1749
|
}
|
|
1749
|
-
`,Xl
|
|
1750
|
+
`,Xl=Mt.h1`
|
|
1750
1751
|
${e=>E(e)} {
|
|
1751
1752
|
font-style: normal;
|
|
1752
1753
|
justify-content: center;
|
|
@@ -1760,7 +1761,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1760
1761
|
color: ${e=>e.appearance.theme.colorText};
|
|
1761
1762
|
margin-bottom: 8px;
|
|
1762
1763
|
}
|
|
1763
|
-
`,Ql
|
|
1764
|
+
`,Ql=Mt.h2`
|
|
1764
1765
|
${e=>E(e)} {
|
|
1765
1766
|
font-style: normal;
|
|
1766
1767
|
justify-content: center;
|
|
@@ -1777,5 +1778,5 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${co}${t}.${co}${t} { ${Object.entries(o).map
|
|
|
1777
1778
|
height: 100%;
|
|
1778
1779
|
min-height: 200px;
|
|
1779
1780
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1780
|
-
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(Ze,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(Jc,{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:l,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:s,markFlowCompleted:m,markStepCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:C,getFlowStatus:h,getCurrentStepIndex:A}=X(),{primaryCTAClickSideEffects:F,secondaryCTAClickSideEffects:P}=
|
|
1781
|
+
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(Ze,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(Jc,{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:l,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:s,markFlowCompleted:m,markStepCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:T,getFlowSteps:C,getFlowStatus:h,getCurrentStepIndex:A}=X(),{primaryCTAClickSideEffects:F,secondaryCTAClickSideEffects:P}=pe(),{mergeAppearanceWithDefault:v}=ee(),{setOpenFlowState:B,getOpenFlowState:f,hasOpenModals:I}=Be();Ve(e);let[S,k]=[f(e,!0),Q=>B(e,Q)];if(n=v(n),Xc(()=>{T(o)},[o,g]),g)return null;let L=s(e);if(!L||y(L)||h(e)===R||I())return null;let N=C(e)[A(e)],V=()=>{k(!1),t&&t(),m(e)};function W(){return ve.createElement(ve.Fragment,null,ve.createElement(ne,{appearance:n}),ve.createElement(Gl,{appearance:n,className:be(a("announcementContainer",n),r),style:l},(p===!0||N.dismissible)&&d=="inline"&&ve.createElement(Jl,{onClick:()=>U(this,null,function*(){yield m(e),t&&t()}),className:a("announcementDismissButton",n)},ve.createElement(Ee,null)),ve.createElement(Kl,null,ve.createElement(Xl,{appearance:n,className:a("announcementTitle",n),dangerouslySetInnerHTML:me(N.title)}),N.subtitle&&ve.createElement(Ql,{appearance:n,className:a("announcementSubtitle",n),dangerouslySetInnerHTML:me(N.subtitle)})),(N.imageUri||N.videoUri)&&ve.createElement(Yl,{className:a("announcementMediaContainer",n)},ve.createElement(Rl,{appearance:n,stepData:N})),(N.primaryButtonTitle||N.secondaryButtonTitle)&&ve.createElement(ql,{className:a("announcementCTAContainer",n)},N.secondaryButtonTitle&&ve.createElement(te,{classPrefix:"announcement",title:N.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>U(this,null,function*(){N.handleSecondaryButtonClick(),P(N),i&&i(N,A(e),"secondary")}),secondary:!0}),N.primaryButtonTitle&&ve.createElement(te,{classPrefix:"announcement",title:N.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>U(this,null,function*(){N.handlePrimaryButtonClick(),F(N),!(i&&i(N,A(e),"primary")===!1)&&(yield c(e,N.id),yield m(e))})}))))}let Y={padding:"24px",maxWidth:"400px"};return d==="inline"?W():d!=="center"?ve.createElement(Do,{modalPosition:d,onClose:V,visible:S,dismissible:p,appearance:n},W()):ve.createElement(Xe,{appearance:n,onClose:V,visible:S,style:Y,dismissible:p},W())};import*as sr from"react";import ea from"react";var ta=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Ne(r,["as","children","variant"]);return ea.createElement(Pn,b({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},Zc=Object.fromEntries(Object.keys(Yo).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>ea.createElement(ta,j(b({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),Rr=Object.assign(ta,Zc);var oa=l=>{var p=l,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=p,r=Ne(p,["as","className","size","title","variant"]);var d;return sr.createElement(kn,b({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),sr.createElement(Rr,{color:(d=wo[n])==null?void 0:d.color,fontWeight:"semibold"},i))},Rc=Object.fromEntries(Object.keys(wo).map(e=>{let t=o=>sr.createElement(oa,j(b({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),em=Object.assign(oa,Rc);export{bo as Box,em as Button,nt as CheckBox,dr as FlowType,gt as FormLabel,wr as FormTextField,Qc as FrigadeAnnouncement,jc as FrigadeBanner,jr as FrigadeChecklist,it as FrigadeDefaultAppearance,Hc as FrigadeEmbeddedTip,xn as FrigadeForm,yc as FrigadeGuide,gc as FrigadeHeroChecklist,qc as FrigadeNPSSurvey,xc as FrigadeProgressBadge,kd as FrigadeProvider,zc as FrigadeSupportWidget,$c as FrigadeTour,ze as ProgressBar,Gt as ProgressRing,Rr as Text,Lr as tokens,Be as useFlowOpens,po as useFlowResponses,X as useFlows,Ir as useOrganization,co as useUser,Ue as useUserFlowStates};
|
|
1781
1782
|
//# sourceMappingURL=index.mjs.map
|