@frigade/react 1.37.5 → 1.37.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -0
- package/dist/index.js +264 -264
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +229 -229
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnPropertyDescriptors;var Oo=Object.getOwnPropertySymbols;var li=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable;var si=(e,t,o)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,S=(e,t)=>{for(var o in t||(t={}))li.call(t,o)&&si(e,o,t[o]);if(Oo)for(var o of Oo(t))ai.call(t,o)&&si(e,o,t[o]);return e},j=(e,t)=>sa(e,la(t));var pi=e=>typeof e=="symbol"?e:e+"",Le=(e,t)=>{var o={};for(var i in e)li.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Oo)for(var i of Oo(e))t.indexOf(i)<0&&ai.call(e,i)&&(o[i]=e[i]);return o};var D=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(l){n(l)}},s=d=>{try{p(o.throw(d))}catch(l){n(l)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,s);p((o=o.apply(e,t)).next())});import Zo,{createContext as Td,useEffect as Ro,useState as Ke}from"react";import{ThemeProvider as Fd}from"styled-components";import Nt,{useContext as Zp,useEffect as Qt,useState as wo}from"react";import{useCallback as vt,useContext as Sa,useEffect as ba}from"react";import mr,{useMemo as ci}from"react";var di="1.37.5";var st="NOT_STARTED_STEP",te="COMPLETED_FLOW",Io="ABORTED_FLOW",Pt="STARTED_FLOW",Ue="NOT_STARTED_FLOW",$e="COMPLETED_STEP",mo="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=mr.useContext(X);return{config:ci(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":di,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:ci(()=>`${o}/v1/public/`,[o])}}var aa="frigade-last-call-at-",pa="frigade-last-call-data-";function Ht(){let{shouldGracefullyDegrade:e,readonly:t}=mr.useContext(X);return(o,i)=>D(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return _t();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),_t();let n=aa+o,r=pa+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(p&&d&&d==i.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return _t()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let s;try{s=yield fetch(o,i)}catch(p){return _t(p)}return s?s.ok?s:_t(s.statusText):_t()})}function _t(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Vt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=mr.useContext(X);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 xa,useState as mi}from"react";import{useContext as ca,useEffect as ma,useState as ua}from"react";import fa from"swr";import{useContext as da}from"react";function Ne(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=da(X);function r(c,f=!1){var C;return(C=e[c])!=null?C:f}function s(c,f){t(C=>j(S({},C),{[c]:f}))}function p(c){t(f=>{let x=f,{[c]:C}=x,w=Le(x,[pi(c)]);return S({},w)})}function d(c){n.includes(c)||i(f=>[...f,c])}function l(c){return n.includes(c)}function m(c){return Object.entries(e).some(([f,C])=>C&&f!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import ga from"swr/immutable";import uo from"core-js-pure/actual/structured-clone";function ur(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ye(...e){let t=e.shift(),o=e.length===1?e[0]:ye(...e);if(!ur(t)||!ur(o))throw new Error("deepmerge can only merge Objects");let i=uo(t);return Object.entries(o).forEach(([n,r])=>{ur(r)?i[n]!==void 0?Object.assign(i,{[n]:ye(i[n],uo(r))}):Object.assign(i,{[n]:uo(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...uo(r)]}):Object.assign(i,{[n]:uo(r)}):Object.assign(i,{[n]:r})}),i}var ha="unknown";function We(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:p}=ca(X),{resetOpenFlowState:d}=Ne(),[l,m]=ua(!1),c={data:r.map(b=>({flowId:b.id,flowState:te,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=b=>fetch(b,e).then(F=>{if(F.ok)return F.json();throw new Error("Failed to fetch user flow states")}).catch(F=>(console.log(`Error fetching ${b}: ${F}. Will gracefully degrade and hide Frigade`),s(!0),c)),C=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:w,isLoading:x,mutate:g,error:E}=p?ga(C,f):fa(C,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),T=w==null?void 0:w.data;ma(()=>{!l&&!x&&T&&m(!0)},[T,l,x]);function P(b){return D(this,null,function*(){if(T&&!p){let F=T.find($=>$.flowId===b);F&&F.flowState!==te&&(F.flowState=te),yield g(Promise.resolve(ye(w,{data:T})),{optimisticData:ye(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}function B(b,F,$){return D(this,null,function*(){if(T){let N=T.find(O=>O.flowId===b);N&&(N.stepStates[F]=$,N.flowState=Pt),yield g(Promise.resolve(ye(w,{data:T})),{optimisticData:ye(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}function k(b,F,$){return D(this,null,function*(){if(T){let N=T.find(O=>O.flowId===b);N&&(N.lastStepId=F,N.stepStates[F]=$,N.flowState=Pt),yield g(ye(w,{data:T}),{optimisticData:ye(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}function u(b){return D(this,null,function*(){if(T){let F=T.find($=>$.flowId===b);F&&F.flowState!==Ue&&(F.flowState=Ue,F.lastStepId=ha,Object.keys(F.stepStates).forEach($=>{F.stepStates[$].actionType=st,F.stepStates[$].createdAt=new Date().toISOString()}),yield g(ye(w,{data:T}),{optimisticData:ye(w,{data:T}),revalidate:!1,rollbackOnError:!1}),d(b))}})}function L(b,F,$){return D(this,null,function*(){if(T){let N=T.find(O=>O.flowId===b);N&&(N.stepStates[F]=$),yield g(Promise.resolve(ye(w,{data:T})),{optimisticData:ye(w,{data:T}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:T,isLoadingUserFlowStateData:!l,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:B,optimisticallyMarkStepNotStarted:L,optimisticallyMarkStepStarted:k,error:E}}function fo(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=We(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:p}=xa(X),[d,l]=mi(new Set),[m,c]=mi(new Set),f=Ht();function C(g){let E=JSON.stringify(g);if(d.has(E))return null;d.add(E),l(d),m.add(g),c(m);let T=s==null?void 0:s.find(P=>P.flowSlug===g.flowSlug&&P.stepId===g.stepId&&P.actionType===g.actionType&&P.createdAt===g.createdAt);return f(`${t}flowResponses`,j(S({},e),{method:"POST",body:E})).then(P=>{P.status!==200&&P.status!==201?(console.log("Failed to send flow response for step "+g.stepId+". Will retry again later."),r([...n,g])):T||p(B=>[...B!=null?B:[],g])})}function w(g){return D(this,null,function*(){g.foreignUserId&&(g.actionType===Pt||g.actionType===Ue?yield C(g):g.actionType===te?yield C(g):g.actionType===mo?yield C(g):g.actionType===$e?yield C(g):g.actionType===Io?yield C(g):g.actionType===st&&(yield C(g)))})}function x(){let g=[];return o==null||o.forEach(E=>{if(E&&E.stepStates&&Object.keys(E.stepStates).length!==0)for(let T in E.stepStates){let P=E.stepStates[T];g.push({foreignUserId:E.foreignUserId,flowSlug:E.flowId,stepId:P.stepId,actionType:P.actionType,data:{},createdAt:new Date(P.createdAt),blocked:P.blocked,hidden:P.hidden})}}),[...g,...s]}return{addResponse:w,setFlowResponses:p,getFlowResponses:x}}import wa from"swr";var Ca=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ui=e=>{let t=Ca.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=ya(i,"'","");r.startsWith("flow_")&&(o=r)}),o},ya=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Lo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var fr=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(fr||{});function Q(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:f,readonly:C}=Sa(X),w={data:[]},{verifySDKInitiated:x}=Vt(),{addResponse:g,getFlowResponses:E}=fo(),T=h=>fetch(h,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${h} (${y.status}): ${y.statusText}. Will gracefully degrade and hide Frigade`),f(!0),w)).catch(y=>(console.log(`Error fetching ${h}: ${y}. Will gracefully degrade and hide Frigade`),f(!0),w)),{mutateUserFlowState:P,userFlowStatesData:B,isLoadingUserFlowStateData:k,optimisticallyMarkFlowCompleted:u,optimisticallyMarkFlowNotStarted:L,optimisticallyMarkStepCompleted:b,optimisticallyMarkStepNotStarted:F,optimisticallyMarkStepStarted:$}=We(),{data:N,error:O,isLoading:V}=wa(s?`${t}flows${C?"?readonly=true":""}`:null,T,{keepPreviousData:!0});ba(()=>{if(O){console.error(O);return}N&&N.data&&i(N.data)},[N,O]);function W(h){if(V)return null;let y=o.find(v=>v.slug===h);return!y&&o.length>0&&!k&&!V?(console.log(`Flow with id ${h} not found`),null):(y==null?void 0:y.active)===!1&&!C?null:y}function J(h){var I,ne,je,De,xt;if(!W(h))return[];let y=(I=W(h))==null?void 0:I.data;return y?(y=R(y),((xt=(De=(ne=Lo(y))==null?void 0:ne.data)!=null?De:(je=Lo(y))==null?void 0:je.steps)!=null?xt:[]).map(fe=>{let po=_(fe);return j(S({handleSecondaryButtonClick:()=>{fe.skippable===!0&&ke(h,fe.id,{skipped:!0})}},fe),{complete:Ee(h,fe.id)===$e||po>=1,started:Ee(h,fe.id)===mo||Ee(h,fe.id)===$e,currentlyActive:B==null?void 0:B.some(co=>co.flowId==h&&co.lastStepId===fe.id),blocked:Ae(h,fe.id),hidden:Ce(h,fe.id),handlePrimaryButtonClick:()=>{(!fe.completionCriteria&&(fe.autoMarkCompleted||fe.autoMarkCompleted===void 0)||fe.completionCriteria&&fe.autoMarkCompleted===!0)&&ke(h,fe.id)},progress:po})}).filter(fe=>fe.hidden!==!0)):[]}function R(h){return h.replaceAll(/\${(.*?)}/g,(y,v)=>p[v]===void 0?"":String(p[v]).replace(/[\u00A0-\u9999<>\&]/g,function(I){return"&#"+I.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(h){var v;if(!W(h))return[];let y=W(h).data;return y?(y=R(y),(v=JSON.parse(y))!=null?v:{}):[]}function q(h,y){d(v=>j(S({},v),{[h]:y}))}function Y(h){!k&&!V&&h&&JSON.stringify(p)!=JSON.stringify(S(S({},p),h))&&Object.keys(h).forEach(y=>{q(y,h[y])})}let de=vt((h,y,v)=>D(this,null,function*(){if(!x())return;let I={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:y,actionType:mo,data:v!=null?v:{},createdAt:new Date,blocked:!1,hidden:!1};he(I)&&(yield $(h,y,I),g(I))}),[n,r,B]),we=vt((h,y,v)=>D(this,null,function*(){if(!x())return;let I={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:y,actionType:st,data:v!=null?v:{},createdAt:new Date,blocked:!1,hidden:!1};he(I)&&(yield F(h,y,I),g(I))}),[n,r,B]),ke=vt((h,y,v)=>D(this,null,function*(){if(!x())return;let I={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:y,actionType:$e,data:v!=null?v:{},createdAt:new Date,blocked:!1,hidden:!1};he(I)&&(yield b(h,y,I),g(I))}),[n,r,B]),Z=vt((h,y)=>D(this,null,function*(){if(!x()||le(h)===Ue)return;let v={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Ue,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};yield L(h),he(v)&&g(v)}),[n,r,B]),me=vt((h,y)=>D(this,null,function*(){if(!x())return;let v={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Pt,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};he(v)&&g(v)}),[n,r,B]),U=vt((h,y)=>D(this,null,function*(){if(!x())return;let v={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:te,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};he(v)&&(yield u(h),g(v))}),[n,r,B]),ee=vt((h,y)=>D(this,null,function*(){if(!x())return;let v={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Io,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};he(v)&&(yield u(h),g(v))}),[n,r,B]);function he(h){var y;if(B===void 0)return!1;if(B){let v=B.find(I=>I.flowId===h.flowSlug);if(h.actionType===st&&(!(v!=null&&v.stepStates[h.stepId])||v.stepStates[h.stepId].actionType===st))return!1;if(v&&((y=v.stepStates[h.stepId])==null?void 0:y.actionType)===h.actionType){if(h.actionType===$e&&(!h.data||JSON.stringify(h.data)===JSON.stringify({})))return!1;let I=Object.keys(v.stepStates).sort((ne,je)=>{let De=new Date(v.stepStates[ne].createdAt),xt=new Date(v.stepStates[je].createdAt);return De.getTime()-xt.getTime()});if(v.stepStates[I[I.length-1]].actionType===h.actionType&&h.stepId===I[I.length-1])return!1}if(v&&v.flowState===te&&h.actionType===te)return!1}return!0}function Ee(h,y){let v=H(h,y);return k?null:v?v.actionType:st}function Ae(h,y){let v=H(h,y);return v?v.blocked:!1}function Ce(h,y){let v=H(h,y);return v?v.hidden:!1}function H(h,y){var I;if(k)return null;let v=B==null?void 0:B.find(ne=>ne.flowId===h);return!v||!v.stepStates[y]?null:(I=v.stepStates[y])!=null?I:null}function z(h){var v,I;if(k||!B)return null;if(le(h)===Ue)return(v=J(h)[0])!=null?v:null;let y=(I=B.find(ne=>ne.flowId===h))==null?void 0:I.lastStepId;return y?J(h).find(ne=>ne.id===y):null}function M(h){var I;let y=z(h);if(!y)return 0;let v=(I=J(h).findIndex(ne=>ne.id===y.id))!=null?I:0;return Ee(h,y.id)===$e&&v<J(h).length-1?v+1:v}function _(h){if(!h.completionCriteria)return;let y=ui(h.completionCriteria);if(y===null)return;let v=qe(y),I=nt(y);return I===0?void 0:v/I}function le(h){let y=B==null?void 0:B.find(v=>v.flowId===h);return y?y.flowState:null}function qe(h){let y=J(h);return y.length===0?0:y.filter(I=>Ee(h,I.id)===$e).length}function nt(h){return J(h).length}function Wt(h){let y=o.find(v=>v.slug===h);return y?Lo(y.data):null}function Ye(h){if(C)return!1;if(k)return!0;if(h!=null&&h.targetingLogic&&B){let y=B.find(v=>v.flowId===h.slug);if(y)return y.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function ht(h){return!Ye(W(h))}function Qe(){n&&P()}function zt(){return o}return{getAllFlows:zt,getFlow:W,getFlowData:Wt,isLoading:k||V,getStepStatus:Ee,getFlowSteps:J,getCurrentStepIndex:M,markStepStarted:de,markStepCompleted:ke,markFlowNotStarted:Z,markFlowStarted:me,markFlowCompleted:U,markFlowAborted:ee,markStepNotStarted:we,getFlowStatus:le,getNumberOfStepsCompleted:qe,getNumberOfSteps:nt,targetingLogicShouldHideFlow:Ye,setCustomVariable:q,updateCustomVariables:Y,customVariables:p,getStepOptionalProgress:_,getFlowMetadata:pe,isStepBlocked:Ae,isStepHidden:Ce,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,isFlowAvailableToUser:ht,refresh:Qe}}import{useCallback as gr,useContext as Ta,useEffect as Fa}from"react";var jt="guest_";function go(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Ta(X),{config:r,apiUrl:s}=Ze(),{mutateUserFlowState:p}=We(),d=Ht(),{verifySDKInitiated:l}=Vt();function m(w){return`frigade-user-registered-${w}`}Fa(()=>{if(e&&!t){if(e.startsWith(jt))return;let w=m(e);localStorage.getItem(w)||(d(`${s}users`,j(S({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(w,"true"))}},[e,n,t]);let c=gr(w=>D(this,null,function*(){if(!l())return;let x={foreignId:e,properties:w};yield d(`${s}users`,j(S({},r),{method:"POST",body:JSON.stringify(x)})),i(g=>S(S({},g),w)),p()}),[e,r,n,p]),f=gr((w,x)=>D(this,null,function*(){if(!l())return;let E={foreignId:e,events:[{event:w,properties:x}]};yield d(`${s}users`,j(S({},r),{method:"POST",body:JSON.stringify(E)})),p()}),[e,r,p]),C=gr((w,x)=>D(this,null,function*(){if(l())if(x){let g=m(w);localStorage.setItem(g,"true"),o(w);let E={foreignId:w,properties:x};yield d(`${s}users`,j(S({},r),{method:"POST",body:JSON.stringify(E)})),i(T=>S(S({},T),x)),p()}else o(w)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:C,addPropertiesToUser:c,trackEventForUser:f}}import{v4 as Rp}from"uuid";import ot,{useEffect as xn,useState as Jp}from"react";import Je,{useEffect as yr,useState as Ia}from"react";import Uo from"styled-components";import ka from"react";import Pa from"styled-components";var fi="fr-",ho="cfr-";function a(e,t){let o=`${fi}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+ho+e}return o}function A(e){if(!e.className||e.className.indexOf(ho)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(fi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function $o(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Pe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${$o(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function xo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var va=Pa.div`
|
|
2
|
+
var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnPropertyDescriptors;var Io=Object.getOwnPropertySymbols;var li=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable;var si=(e,t,o)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,T=(e,t)=>{for(var o in t||(t={}))li.call(t,o)&&si(e,o,t[o]);if(Io)for(var o of Io(t))ai.call(t,o)&&si(e,o,t[o]);return e},V=(e,t)=>sa(e,la(t));var pi=e=>typeof e=="symbol"?e:e+"",Le=(e,t)=>{var o={};for(var i in e)li.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Io)for(var i of Io(e))t.indexOf(i)<0&&ai.call(e,i)&&(o[i]=e[i]);return o};var M=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(s){n(s)}},l=d=>{try{p(o.throw(d))}catch(s){n(s)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,l);p((o=o.apply(e,t)).next())});import Ro,{createContext as Td,useEffect as er,useState as Ke}from"react";import{ThemeProvider as Fd}from"styled-components";import Nt,{useContext as Zp,useEffect as Zt,useState as To}from"react";import{useCallback as Bt,useContext as Sa,useEffect as ba}from"react";import ur,{useMemo as ci}from"react";var di="1.37.7";var st="NOT_STARTED_STEP",te="COMPLETED_FLOW",Lo="ABORTED_FLOW",vt="STARTED_FLOW",Ue="NOT_STARTED_FLOW",$e="COMPLETED_STEP",uo="STARTED_STEP";function Qe(){let{publicApiKey:e,userId:t,apiUrl:o}=ur.useContext(X);return{config:ci(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":di,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:ci(()=>`${o}/v1/public/`,[o])}}var aa="frigade-last-call-at-",pa="frigade-last-call-data-";function Vt(){let{shouldGracefullyDegrade:e,readonly:t}=ur.useContext(X);return(o,i)=>M(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Ht();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Ht();let n=aa+o,r=pa+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(p&&d&&d==i.body){let s=new Date(p);if(new Date().getTime()-s.getTime()<1e3)return Ht()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let l;try{l=yield fetch(o,i)}catch(p){return Ht(p)}return l?l.ok?l:Ht(l.statusText):Ht()})}function Ht(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function jt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=ur.useContext(X);function o(){return t?(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 xa,useState as mi}from"react";import{useContext as ca,useEffect as ma,useState as ua}from"react";import fa from"swr";import{useContext as da}from"react";function Ee(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=da(X);function r(c,f=!1){var S;return(S=e[c])!=null?S:f}function l(c,f){t(S=>V(T({},S),{[c]:f}))}function p(c){t(f=>{let b=f,{[c]:S}=b,w=Le(b,[pi(c)]);return T({},w)})}function d(c){n.includes(c)||i(f=>[...f,c])}function s(c){return n.includes(c)}function m(c){return Object.entries(e).some(([f,S])=>S&&f!=c)||o}return{getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}import ga from"swr/immutable";import fo from"core-js-pure/actual/structured-clone";function fr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ye(...e){let t=e.shift(),o=e.length===1?e[0]:ye(...e);if(!fr(t)||!fr(o))throw new Error("deepmerge can only merge Objects");let i=fo(t);return Object.entries(o).forEach(([n,r])=>{fr(r)?i[n]!==void 0?Object.assign(i,{[n]:ye(i[n],fo(r))}):Object.assign(i,{[n]:fo(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...fo(r)]}):Object.assign(i,{[n]:fo(r)}):Object.assign(i,{[n]:r})}),i}var ha="unknown";function _e(){let{config:e,apiUrl:t}=Qe(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=ca(X),{resetOpenFlowState:d}=Ee(),[s,m]=ua(!1),c={data:r.map(F=>({flowId:F.id,flowState:te,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=F=>fetch(F,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${F}: ${P}. Will gracefully degrade and hide Frigade`),l(!0),c)),S=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:w,isLoading:b,mutate:x,error:v}=p?ga(S,f):fa(S,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),k=w==null?void 0:w.data;ma(()=>{!s&&!b&&k&&m(!0)},[k,s,b]);function B(F){return M(this,null,function*(){if(k&&!p){let P=k.find(I=>I.flowId===F);P&&P.flowState!==te&&(P.flowState=te),yield x(Promise.resolve(ye(w,{data:k})),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function L(F,P,I){return M(this,null,function*(){if(k){let O=k.find(A=>A.flowId===F);O&&(O.stepStates[P]=I,O.flowState=vt),yield x(Promise.resolve(ye(w,{data:k})),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function C(F,P,I){return M(this,null,function*(){if(k){let O=k.find(A=>A.flowId===F);O&&(O.lastStepId=P,O.stepStates[P]=I,O.flowState=vt),yield x(ye(w,{data:k}),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1})}})}function u(F){return M(this,null,function*(){if(k){let P=k.find(I=>I.flowId===F);P&&P.flowState!==Ue&&(P.flowState=Ue,P.lastStepId=ha,Object.keys(P.stepStates).forEach(I=>{P.stepStates[I].actionType=st,P.stepStates[I].createdAt=new Date().toISOString()}),yield x(ye(w,{data:k}),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1}),d(F))}})}function N(F,P,I){return M(this,null,function*(){if(k){let O=k.find(A=>A.flowId===F);O&&(O.stepStates[P]=I),yield x(Promise.resolve(ye(w,{data:k})),{optimisticData:ye(w,{data:k}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:k,isLoadingUserFlowStateData:!s,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:B,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:L,optimisticallyMarkStepNotStarted:N,optimisticallyMarkStepStarted:C,error:v}}function go(){let{config:e,apiUrl:t}=Qe(),{userFlowStatesData:o,mutateUserFlowState:i}=_e(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=xa(X),[d,s]=mi(new Set),[m,c]=mi(new Set),f=Vt();function S(x){let v=JSON.stringify(x);if(d.has(v))return null;d.add(v),s(d),m.add(x),c(m);let k=l==null?void 0:l.find(B=>B.flowSlug===x.flowSlug&&B.stepId===x.stepId&&B.actionType===x.actionType&&B.createdAt===x.createdAt);return f(`${t}flowResponses`,V(T({},e),{method:"POST",body:v})).then(B=>{B.status!==200&&B.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):k||p(L=>[...L!=null?L:[],x])})}function w(x){return M(this,null,function*(){x.foreignUserId&&(x.actionType===vt||x.actionType===Ue?yield S(x):x.actionType===te?yield S(x):x.actionType===uo?yield S(x):x.actionType===$e?yield S(x):x.actionType===Lo?yield S(x):x.actionType===st&&(yield S(x)))})}function b(){let x=[];return o==null||o.forEach(v=>{if(v&&v.stepStates&&Object.keys(v.stepStates).length!==0)for(let k in v.stepStates){let B=v.stepStates[k];x.push({foreignUserId:v.foreignUserId,flowSlug:v.flowId,stepId:B.stepId,actionType:B.actionType,data:{},createdAt:new Date(B.createdAt),blocked:B.blocked,hidden:B.hidden})}}),[...x,...l]}return{addResponse:w,setFlowResponses:p,getFlowResponses:b}}import wa from"swr";var Ca=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ui=e=>{let t=Ca.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=ya(i,"'","");r.startsWith("flow_")&&(o=r)}),o},ya=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function $o(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var gr=(s=>(s.CHECKLIST="CHECKLIST",s.FORM="FORM",s.TOUR="TOUR",s.SUPPORT="SUPPORT",s.CUSTOM="CUSTOM",s.BANNER="BANNER",s.EMBEDDED_TIP="EMBEDDED_TIP",s.NPS_SURVEY="NPS_SURVEY",s.ANNOUNCEMENT="ANNOUNCEMENT",s))(gr||{});function R(){let{config:e,apiUrl:t}=Qe(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:f,readonly:S,flowDataOverrides:w}=Sa(X),b={data:[]},{verifySDKInitiated:x}=jt(),{addResponse:v,getFlowResponses:k}=go(),B=g=>fetch(g,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${g} (${y.status}): ${y.statusText}. Will gracefully degrade and hide Frigade`),f(!0),b)).catch(y=>(console.log(`Error fetching ${g}: ${y}. Will gracefully degrade and hide Frigade`),f(!0),b)),{mutateUserFlowState:L,userFlowStatesData:C,isLoadingUserFlowStateData:u,optimisticallyMarkFlowCompleted:N,optimisticallyMarkFlowNotStarted:F,optimisticallyMarkStepCompleted:P,optimisticallyMarkStepNotStarted:I,optimisticallyMarkStepStarted:O}=_e(),{data:A,error:G,isLoading:_}=wa(l?`${t}flows${S?"?readonly=true":""}`:null,B,{keepPreviousData:!0});ba(()=>{if(G){console.error(G);return}A&&A.data&&i(A.data)},[A,G]);function Q(g){if(_)return null;let y=o.find(h=>h.slug===g);return!y&&o.length>0&&!u&&!_?(console.log(`Flow with id ${g} not found`),null):(y&&w&&w[g]&&(y.data=w[g]),(y==null?void 0:y.active)===!1&&!S?null:y)}function Y(g){var D,ge,De,ht,Pt;if(!Q(g))return[];let y=(D=Q(g))==null?void 0:D.data;return y?(y=se(y),((Pt=(ht=(ge=$o(y))==null?void 0:ge.data)!=null?ht:(De=$o(y))==null?void 0:De.steps)!=null?Pt:[]).map(ue=>{let co=pe(ue);return V(T({handleSecondaryButtonClick:()=>{ue.skippable===!0&&Z(g,ue.id,{skipped:!0})}},ue),{complete:xe(g,ue.id)===$e||co>=1,started:xe(g,ue.id)===uo||xe(g,ue.id)===$e,currentlyActive:C==null?void 0:C.some(mo=>mo.flowId==g&&mo.lastStepId===ue.id),blocked:Ce(g,ue.id),hidden:H(g,ue.id),handlePrimaryButtonClick:()=>{(!ue.completionCriteria&&(ue.autoMarkCompleted||ue.autoMarkCompleted===void 0)||ue.completionCriteria&&ue.autoMarkCompleted===!0)&&Z(g,ue.id)},progress:co})}).filter(ue=>ue.hidden!==!0)):[]}function se(g){return g.replaceAll(/\${(.*?)}/g,(y,h)=>p[h]===void 0?"":String(p[h]).replace(/[\u00A0-\u9999<>\&]/g,function(D){return"&#"+D.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function J(g){var h;if(!Q(g))return[];let y=Q(g).data;return y?(y=se(y),(h=JSON.parse(y))!=null?h:{}):[]}function q(g,y){d(h=>V(T({},h),{[g]:y}))}function ae(g){!u&&!_&&g&&JSON.stringify(p)!=JSON.stringify(T(T({},p),g))&&Object.keys(g).forEach(y=>{q(y,g[y])})}let we=Bt((g,y,h)=>M(this,null,function*(){if(!x())return;let D={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:y,actionType:uo,data:h!=null?h:{},createdAt:new Date,blocked:!1,hidden:!1};ke(D)&&(yield O(g,y,D),v(D))}),[n,r,C]),Ne=Bt((g,y,h)=>M(this,null,function*(){if(!x())return;let D={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:y,actionType:st,data:h!=null?h:{},createdAt:new Date,blocked:!1,hidden:!1};ke(D)&&(yield I(g,y,D),v(D))}),[n,r,C]),Z=Bt((g,y,h)=>M(this,null,function*(){if(!x())return;let D={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:y,actionType:$e,data:h!=null?h:{},createdAt:new Date,blocked:!1,hidden:!1};ke(D)&&(yield P(g,y,D),v(D))}),[n,r,C]),ce=Bt((g,y)=>M(this,null,function*(){if(!x()||je(g)===Ue)return;let h={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:"unknown",actionType:Ue,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};yield F(g),ke(h)&&v(h)}),[n,r,C]),U=Bt((g,y)=>M(this,null,function*(){if(!x())return;let h={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:"unknown",actionType:vt,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};ke(h)&&v(h)}),[n,r,C]),ee=Bt((g,y)=>M(this,null,function*(){if(!x())return;let h={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:"unknown",actionType:te,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};ke(h)&&(yield N(g),v(h))}),[n,r,C]),Ie=Bt((g,y)=>M(this,null,function*(){if(!x())return;let h={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:g,stepId:"unknown",actionType:Lo,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};ke(h)&&(yield N(g),v(h))}),[n,r,C]);function ke(g){var y;if(C===void 0)return!1;if(C){let h=C.find(D=>D.flowId===g.flowSlug);if(g.actionType===st&&(!(h!=null&&h.stepStates[g.stepId])||h.stepStates[g.stepId].actionType===st))return!1;if(h&&((y=h.stepStates[g.stepId])==null?void 0:y.actionType)===g.actionType){if(g.actionType===$e&&(!g.data||JSON.stringify(g.data)===JSON.stringify({})))return!1;let D=Object.keys(h.stepStates).sort((ge,De)=>{let ht=new Date(h.stepStates[ge].createdAt),Pt=new Date(h.stepStates[De].createdAt);return ht.getTime()-Pt.getTime()});if(h.stepStates[D[D.length-1]].actionType===g.actionType&&g.stepId===D[D.length-1])return!1}if(h&&h.flowState===te&&g.actionType===te)return!1}return!0}function xe(g,y){let h=W(g,y);return u?null:h?h.actionType:st}function Ce(g,y){let h=W(g,y);return h?h.blocked:!1}function H(g,y){let h=W(g,y);return h?h.hidden:!1}function W(g,y){var D;if(u)return null;let h=C==null?void 0:C.find(ge=>ge.flowId===g);return!h||!h.stepStates[y]?null:(D=h.stepStates[y])!=null?D:null}function $(g){var h,D;if(u||!C)return null;if(je(g)===Ue)return(h=Y(g)[0])!=null?h:null;let y=(D=C.find(ge=>ge.flowId===g))==null?void 0:D.lastStepId;return y?Y(g).find(ge=>ge.id===y):null}function z(g){var D;let y=$(g);if(!y)return 0;let h=(D=Y(g).findIndex(ge=>ge.id===y.id))!=null?D:0;return xe(g,y.id)===$e&&h<Y(g).length-1?h+1:h}function pe(g){if(!g.completionCriteria)return;let y=ui(g.completionCriteria);if(y===null)return;let h=it(y),D=kt(y);return D===0?void 0:h/D}function je(g){let y=C==null?void 0:C.find(h=>h.flowId===g);return y?y.flowState:null}function it(g){let y=Y(g);return y.length===0?0:y.filter(D=>xe(g,D.id)===$e).length}function kt(g){return Y(g).length}function Je(g){let y=o.find(h=>h.slug===g);return y?(w&&w[g]&&(y.data=w[g]),$o(y.data)):null}function nt(g){if(S)return!1;if(u)return!0;if(g!=null&&g.targetingLogic&&C){let y=C.find(h=>h.flowId===g.slug);if(y)return y.shouldTrigger===!1}return!!(g!=null&&g.targetingLogic&&n&&n.startsWith("guest_"))}function Xe(g){return!nt(Q(g))}function Wt(){n&&L()}function zt(){return o}return{getAllFlows:zt,getFlow:Q,getFlowData:Je,isLoading:u||_,getStepStatus:xe,getFlowSteps:Y,getCurrentStepIndex:z,markStepStarted:we,markStepCompleted:Z,markFlowNotStarted:ce,markFlowStarted:U,markFlowCompleted:ee,markFlowAborted:Ie,markStepNotStarted:Ne,getFlowStatus:je,getNumberOfStepsCompleted:it,getNumberOfSteps:kt,targetingLogicShouldHideFlow:nt,setCustomVariable:q,updateCustomVariables:ae,customVariables:p,getStepOptionalProgress:pe,getFlowMetadata:J,isStepBlocked:Ce,isStepHidden:H,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Xe,refresh:Wt}}import{useCallback as hr,useContext as Ta,useEffect as Fa}from"react";var Gt="guest_";function ho(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Ta(X),{config:r,apiUrl:l}=Qe(),{mutateUserFlowState:p}=_e(),d=Vt(),{verifySDKInitiated:s}=jt();function m(w){return`frigade-user-registered-${w}`}Fa(()=>{if(e&&!t){if(e.startsWith(Gt))return;let w=m(e);localStorage.getItem(w)||(d(`${l}users`,V(T({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(w,"true"))}},[e,n,t]);let c=hr(w=>M(this,null,function*(){if(!s())return;let b={foreignId:e,properties:w};yield d(`${l}users`,V(T({},r),{method:"POST",body:JSON.stringify(b)})),i(x=>T(T({},x),w)),p()}),[e,r,n,p]),f=hr((w,b)=>M(this,null,function*(){if(!s())return;let v={foreignId:e,events:[{event:w,properties:b}]};yield d(`${l}users`,V(T({},r),{method:"POST",body:JSON.stringify(v)})),p()}),[e,r,p]),S=hr((w,b)=>M(this,null,function*(){if(s())if(b){let x=m(w);localStorage.setItem(x,"true"),o(w);let v={foreignId:w,properties:b};yield d(`${l}users`,V(T({},r),{method:"POST",body:JSON.stringify(v)})),i(k=>T(T({},k),b)),p()}else o(w)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:S,addPropertiesToUser:c,trackEventForUser:f}}import{v4 as Rp}from"uuid";import tt,{useEffect as xn,useState as Jp}from"react";import qe,{useEffect as Sr,useState as Ia}from"react";import _o from"styled-components";import ka from"react";import Pa from"styled-components";var fi="fr-",xo="cfr-";function a(e,t){let o=`${fi}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+xo+e}return o}function E(e){if(!e.className||e.className.indexOf(xo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(fi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function Mo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Pe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Mo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function Co(e){return e.charAt(0).toUpperCase()+e.slice(1)}var va=Pa.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -7,7 +7,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
7
7
|
left: 0;
|
|
8
8
|
bottom: 0;
|
|
9
9
|
right: 0;
|
|
10
|
-
${e=>
|
|
10
|
+
${e=>E(e)} {
|
|
11
11
|
background-color: rgba(0, 0, 0, 0.6);
|
|
12
12
|
z-index: 1400;
|
|
13
13
|
}
|
|
@@ -23,12 +23,12 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,gi=({onClose:e,appearance:t})=>ka.createElement(va,{className:a("modalBackground",t),onClick:()=>e()});import
|
|
26
|
+
`,gi=({onClose:e,appearance:t})=>ka.createElement(va,{className:a("modalBackground",t),onClick:()=>e()});import xr from"react";import Ba from"styled-components";var Ea=Ba.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
31
|
-
${e=>
|
|
30
|
+
`,Ae=()=>xr.createElement(Ea,null,xr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},xr.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as La}from"react-portal";import Bi from"react";import Cr from"react";function Aa({style:e,className:t}){return Cr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Cr.createElement("path",{fill:"currentColor",d:"M16.293 3.476v1.036h1.593v1.256h-1.593v5.098h-1.41V5.768H14V4.512h.883V3.244c0-.67.294-1.744 1.777-1.744.515 0 .969.049 1.361.146l-.233 1.232a5.939 5.939 0 00-.833-.073c-.442 0-.662.22-.662.67zm6.534.975V5.83c-.846 0-1.63.159-2.342.476v4.56h-1.41V4.513h1.263l.086.61c.846-.451 1.655-.67 2.403-.67zm2.505-.951c-.331.33-.944.33-1.287 0a.93.93 0 01-.246-.659c0-.268.086-.487.246-.646.343-.33.956-.33 1.287 0 .343.33.343.964 0 1.305zm.061 7.366h-1.41V4.512h1.41v6.354zm6.928-5.756c.246.146.368.402.368.756v4.976c0 1.804-.858 2.658-2.672 2.658-.92 0-1.753-.146-2.514-.439l.417-1.073c.674.22 1.336.33 1.974.33.98 0 1.385-.379 1.385-1.403v-.171c-.588.134-1.09.207-1.52.207-.907 0-1.655-.305-2.231-.902-.576-.598-.87-1.39-.87-2.354 0-.963.294-1.756.87-2.354.576-.61 1.324-.914 2.231-.914 1.005 0 1.864.232 2.562.683zm-2.488 4.634a5.15 5.15 0 001.446-.22V5.951a3.695 3.695 0 00-1.446-.292c-1.08 0-1.778.841-1.778 2.048 0 1.22.699 2.037 1.778 2.037zm7.34-5.317c1.52 0 2.28.878 2.28 2.634v3.805h-1.275l-.073-.524c-.601.414-1.288.621-2.084.621-1.263 0-2.06-.658-2.06-1.731 0-1.269 1.25-2.025 3.408-2.025.135 0 .503.013.662.013v-.171c0-1.012-.343-1.451-1.115-1.451-.675 0-1.435.158-2.256.475l-.466-1.012c1.017-.427 2.01-.634 2.979-.634zm-1.839 4.756c0 .427.343.695 1.017.695.528 0 1.251-.22 1.68-.512V8.22h-.441c-1.508 0-2.256.317-2.256.963zm9.953-4.549v-2.83h1.41v7.72c0 .354-.123.598-.368.757-.71.45-1.57.67-2.562.67-.907 0-1.655-.305-2.231-.902-.577-.61-.87-1.39-.87-2.354 0-.963.293-1.756.87-2.354.576-.61 1.324-.914 2.23-.914.43 0 .933.073 1.521.207zM43.84 9.72c.503 0 .981-.098 1.447-.293V5.854a5.15 5.15 0 00-1.447-.22c-1.078 0-1.777.817-1.777 2.037s.699 2.049 1.777 2.049zM54 7.866v.439h-4.573c.184.963.858 1.512 1.827 1.512.613 0 1.275-.146 1.986-.451l.466 1.024c-.87.378-1.729.573-2.575.573-.931 0-1.692-.304-2.268-.902-.576-.61-.87-1.402-.87-2.366 0-.975.294-1.768.87-2.366.576-.597 1.324-.902 2.244-.902.968 0 1.691.33 2.17.975.478.647.723 1.464.723 2.464zm-4.61-.586h3.298c-.086-1.073-.613-1.731-1.581-1.731-.969 0-1.582.695-1.717 1.731z"}),Cr.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.196 1.229A4.009 4.009 0 014.08 0l4.092.027C9.183.027 10 .867 10 1.904c0 .6-.273 1.133-.7 1.478-.31.25-.7.399-1.126.4h-.001l-4.09-.027h-.002a4.804 4.804 0 00-2.614.77A4.986 4.986 0 000 5.974v-1.78C0 3.036.456 1.988 1.196 1.23zm4.525 4.65a4.282 4.282 0 00-1.184 2.513l3.637.023c.131 0 .259-.015.382-.042h.002c.81-.178 1.42-.908 1.44-1.788v-.046a1.9 1.9 0 00-.533-1.328 1.813 1.813 0 00-.908-.508h-.002l-.002-.001a1.68 1.68 0 00-.366-.042A4.084 4.084 0 005.72 5.88zm-4.525-.016A4.235 4.235 0 000 8.829C0 10.997 1.601 12.78 3.654 13V9.265h-.005l.005-.439v-.437h.023a5.175 5.175 0 011.439-3.13 5.05 5.05 0 01.72-.614l-1.754-.011H4.08c-.787 0-1.521.229-2.144.625a4.11 4.11 0 00-.74.603z",clipRule:"evenodd"}))}var hi=Aa;import yr from"styled-components";import lt from"styled-components";var Do=lt.div`
|
|
31
|
+
${e=>E(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -38,7 +38,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
38
38
|
min-width: 300px;
|
|
39
39
|
z-index: ${e=>e.zIndex};
|
|
40
40
|
overflow: hidden;
|
|
41
|
-
`,
|
|
41
|
+
`,Oa=`
|
|
42
42
|
display: block;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
@@ -51,18 +51,18 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
51
51
|
box-sizing: border-box;
|
|
52
52
|
:hover {
|
|
53
53
|
opacity: 0.8;
|
|
54
|
-
}`,
|
|
54
|
+
}`,Na=`
|
|
55
55
|
display: block;
|
|
56
56
|
cursor: pointer;
|
|
57
57
|
position: absolute;
|
|
58
58
|
top: 12px;
|
|
59
59
|
right: 12px;
|
|
60
60
|
`,xi=lt.div`
|
|
61
|
-
${e=>
|
|
62
|
-
${e=>e.hasImage?Na
|
|
61
|
+
${e=>E(e)} {
|
|
62
|
+
${e=>e.hasImage?Oa:Na};
|
|
63
63
|
}
|
|
64
64
|
`,Ci=lt.img`
|
|
65
|
-
${e=>
|
|
65
|
+
${e=>E(e)} {
|
|
66
66
|
display: block;
|
|
67
67
|
width: 100%;
|
|
68
68
|
height: auto;
|
|
@@ -70,7 +70,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
70
70
|
object-fit: cover;
|
|
71
71
|
}
|
|
72
72
|
`,yi=lt.div`
|
|
73
|
-
${e=>
|
|
73
|
+
${e=>E(e)} {
|
|
74
74
|
display: block;
|
|
75
75
|
width: 100%;
|
|
76
76
|
height: auto;
|
|
@@ -95,14 +95,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
95
95
|
flex-shrink: 1;
|
|
96
96
|
gap: 8px;
|
|
97
97
|
height: 64px;
|
|
98
|
-
${e=>
|
|
98
|
+
${e=>E(e)} {
|
|
99
99
|
flex-direction: row;
|
|
100
100
|
justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
|
|
101
101
|
align-content: center;
|
|
102
102
|
align-items: center;
|
|
103
103
|
}
|
|
104
104
|
`,Fi=lt.p`
|
|
105
|
-
${e=>
|
|
105
|
+
${e=>E(e)} {
|
|
106
106
|
font-style: normal;
|
|
107
107
|
font-weight: 600;
|
|
108
108
|
font-size: 15px;
|
|
@@ -110,7 +110,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
110
110
|
color: #808080;
|
|
111
111
|
}
|
|
112
112
|
margin: 0;
|
|
113
|
-
`;var ki=
|
|
113
|
+
`;var ki=yr.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 na=Object.defineProperty,sa=Object.defineProperties;var la=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
|
-
`,Pi=
|
|
124
|
+
`,Pi=yr(Do)`
|
|
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 na=Object.defineProperty,sa=Object.defineProperties;var la=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
|
-
`,vi=
|
|
137
|
+
`,vi=yr.div`
|
|
138
138
|
display: flex;
|
|
139
139
|
justify-content: center;
|
|
140
140
|
align-items: center;
|
|
@@ -143,8 +143,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=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
|
|
147
|
-
${e=>
|
|
146
|
+
`;function Uo({appearance:e}){return Bi.createElement(vi,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Bi.createElement(hi,null))}var $a=_o.div`
|
|
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}};
|
|
150
150
|
/* Mobile */
|
|
@@ -185,27 +185,27 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
185
185
|
opacity: 1;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`,Ma=
|
|
188
|
+
`,Ma=_o.div`
|
|
189
189
|
position: relative;
|
|
190
190
|
flex: 0 1 auto;
|
|
191
|
-
`,Da=
|
|
191
|
+
`,Da=_o.div`
|
|
192
192
|
position: absolute;
|
|
193
193
|
top: 16px;
|
|
194
194
|
right: 16px;
|
|
195
195
|
cursor: pointer;
|
|
196
196
|
z-index: 1501;
|
|
197
|
-
${e=>
|
|
197
|
+
${e=>E(e)} {
|
|
198
198
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
199
199
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
200
200
|
}
|
|
201
|
-
`,Ua=
|
|
201
|
+
`,Ua=_o.div`
|
|
202
202
|
overflow: scroll;
|
|
203
203
|
flex: 1 1;
|
|
204
204
|
display: flex;
|
|
205
205
|
::-webkit-scrollbar {
|
|
206
206
|
display: none;
|
|
207
207
|
}
|
|
208
|
-
`,
|
|
208
|
+
`,Ze=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:l=!0,showFrigadeBranding:p=!1})=>{let[d,s]=Ia("");return Sr(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");s(m)},[]),Sr(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),Sr(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?qe.createElement(La,null,qe.createElement(gi,{appearance:r,onClose:()=>{l&&e()}}),qe.createElement($a,{appearance:r,className:a("modalContainer",r),styleOverrides:i},l&&qe.createElement(Da,{className:a("modalClose",r),onClick:()=>e(),appearance:r},qe.createElement(Ae,null)),o&&qe.createElement(Ma,null,o),qe.createElement(Ua,null,n),p&&qe.createElement(ki,{appearance:r,className:a("poweredByFrigadeRibbon",r)},qe.createElement(Uo,{appearance:r})))):qe.createElement(qe.Fragment,null)};import Ct,{useEffect as br,useState as _a}from"react";import Wo 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`
|
|
@@ -215,7 +215,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
215
215
|
bottom: 0;
|
|
216
216
|
left: 0;
|
|
217
217
|
`}return"right: 0; bottom: 0;"}var Ha=Wo.div`
|
|
218
|
-
${e=>
|
|
218
|
+
${e=>E(e)} {
|
|
219
219
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
220
220
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
221
221
|
position: fixed;
|
|
@@ -228,7 +228,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
228
228
|
width: 350px;
|
|
229
229
|
padding: 24px;
|
|
230
230
|
}
|
|
231
|
-
${e=>
|
|
231
|
+
${e=>za(e.modalPosition)}
|
|
232
232
|
margin: 28px;
|
|
233
233
|
`,Va=Wo.div`
|
|
234
234
|
position: relative;
|
|
@@ -239,7 +239,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
239
239
|
right: 16px;
|
|
240
240
|
cursor: pointer;
|
|
241
241
|
z-index: 1501;
|
|
242
|
-
${e=>
|
|
242
|
+
${e=>E(e)} {
|
|
243
243
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
244
244
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
245
245
|
}
|
|
@@ -249,8 +249,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
249
249
|
::-webkit-scrollbar {
|
|
250
250
|
display: none;
|
|
251
251
|
}
|
|
252
|
-
`,zo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:
|
|
253
|
-
${e=>
|
|
252
|
+
`,zo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:l=!0})=>{let[p,d]=_a("");return br(()=>{let s=getComputedStyle(document.body).getPropertyValue("overflow");d(s)},[]),br(()=>{let s=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s)}},[e]),br(()=>{let s=document.body.style;return t?s.setProperty("overflow","hidden"):s.setProperty("overflow",p),()=>{s.setProperty("overflow",p)}},[t]),t?Ct.createElement(Wa,null,Ct.createElement(Ha,{appearance:n,className:a("cornerModalContainer",n),modalPosition:r},l&&Ct.createElement(ja,{className:a("cornerModalClose",n),onClick:()=>e()},Ct.createElement(Ae,null)),o&&Ct.createElement(Va,null,o),Ct.createElement(Ga,null,i))):Ct.createElement(Ct.Fragment,null)};import{useContext as Ka}from"react";function oe(){let{defaultAppearance:e}=Ka(X);function t(o){var n,r,l;let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((n=i.styleOverrides)!=null?n:{},(r=o.styleOverrides)!=null?r:{}),theme:Object.assign(i.theme,(l=o.theme)!=null?l:{})}:i}return{mergeAppearanceWithDefault:t}}import Et,{useContext as fp,useEffect as Gi,useState as Or}from"react";import Ko from"styled-components";import jo,{useEffect as Li,useState as Fr}from"react";import kr from"styled-components";import Ho from"styled-components";var Ei=Ho.label`
|
|
253
|
+
${e=>E(e)} {
|
|
254
254
|
font-size: 12px;
|
|
255
255
|
line-height: 18px;
|
|
256
256
|
margin-bottom: 5px;
|
|
@@ -260,14 +260,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
260
260
|
letter-spacing: 0.24px;
|
|
261
261
|
}
|
|
262
262
|
display: flex;
|
|
263
|
-
`,Ai=
|
|
264
|
-
${e=>
|
|
263
|
+
`,Ai=Ho.label`
|
|
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
|
+
`,Oi=Ho.span`
|
|
271
271
|
font-weight: 400;
|
|
272
272
|
font-size: 14px;
|
|
273
273
|
line-height: 22px;
|
|
@@ -275,17 +275,17 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
275
275
|
display: flex;
|
|
276
276
|
margin-right: 5px;
|
|
277
277
|
margin-top: 10px;
|
|
278
|
-
`,Ho
|
|
278
|
+
`,Vo=Ho.div`
|
|
279
279
|
display: flex;
|
|
280
280
|
align-items: flex-start;
|
|
281
281
|
justify-content: left;
|
|
282
282
|
margin-bottom: 10px;
|
|
283
|
-
`;import
|
|
283
|
+
`;import wr from"react";var at={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 yt({title:e,required:t,appearance:o=at}){return e?wr.createElement(Vo,{className:a("formLabelWrapper",o)},t?wr.createElement(Oi,{className:a("formLabelRequired",o),appearance:o},"*"):null,wr.createElement(Ei,{className:a("formLabel",o)},e)):null}import Ni from"react";function Kt({title:e,appearance:t}){return e?Ni.createElement(Vo,null,Ni.createElement(Ai,{className:a("formSubLabel",t)},e)):null}import{z as Tr}from"zod";function Ii(e,t){var o,i,n,r,l,p,d;try{if(t){if(t.type=="number"){let s=Tr.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=Tr.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 Tr.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 qa=kr.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex-direction: column;
|
|
286
286
|
width: 100%;
|
|
287
|
-
`,kr
|
|
288
|
-
${e=>
|
|
287
|
+
`,Pr=kr.input`
|
|
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}};
|
|
291
291
|
font-size: 14px;
|
|
@@ -300,8 +300,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
300
300
|
box-sizing: border-box;
|
|
301
301
|
padding: 0 10px;
|
|
302
302
|
margin-bottom: 10px;
|
|
303
|
-
`,Ya=
|
|
304
|
-
${e=>
|
|
303
|
+
`,Ya=kr.textarea`
|
|
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}};
|
|
307
307
|
font-size: 14px;
|
|
@@ -317,14 +317,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
317
317
|
box-sizing: border-box;
|
|
318
318
|
margin-bottom: 10px;
|
|
319
319
|
resize: none;
|
|
320
|
-
`;function
|
|
320
|
+
`;function vr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[l,p]=Fr((n==null?void 0:n.text)||""),[d,s]=Fr(!1),[m,c]=Fr(!1),f=Pr;Li(()=>{l===""&&!d&&(s(!0),S(""))},[]),Li(()=>{if(m){S(l);return}},[m]);function S(b){var v;if(p(b),o({text:b}),r.required===!0&&b.trim()===""){i([{id:r.id,message:`${(v=r.title)!=null?v:"Field"} is required`,hidden:!m}]);return}let x=Ii(b,r.validation);if(x&&(b.trim()!==""||r.required===!0)){i([{id:r.id,message:x,hidden:!m}]);return}i([])}r.multiline&&(f=Ya);function w(){var b;switch((b=r==null?void 0:r.validation)==null?void 0:b.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return jo.createElement(qa,null,jo.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),jo.createElement(f,{className:a("inputComponent",t.appearance),value:l,onChange:b=>{S(b.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:w(),onBlur:()=>{c(!0)}}),jo.createElement(Kt,{title:r.subtitle,appearance:t.appearance}))}import Re,{useEffect as $i,useState as Mi}from"react";import Di from"styled-components";var Br="",Ja=Di.div`
|
|
321
321
|
display: flex;
|
|
322
322
|
flex-direction: column;
|
|
323
323
|
width: 100%;
|
|
324
324
|
-webkit-appearance: none;
|
|
325
325
|
appearance: none;
|
|
326
326
|
`,Xa=Di.select`
|
|
327
|
-
${e=>
|
|
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}};
|
|
330
330
|
font-size: 14px;
|
|
@@ -344,16 +344,16 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=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 Ui({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,f,
|
|
347
|
+
`;function Ui({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,f,S,w,b,x,v,k;let r=e,[l,p]=Mi(!1),[d,s]=Mi(!1);return $i(()=>{var B,L,C,u;if(!((B=i==null?void 0:i.choice)!=null&&B[0])&&!l){if(p(!0),r.requireSelection){o({choice:[Br]});return}if(r.defaultValue&&((L=r.props.options)!=null&&L.find(N=>N.id===r.defaultValue))){let N=(C=r.props.options)==null?void 0:C.find(F=>F.id===r.defaultValue);o({choice:[N.id]})}else o({choice:[((u=r.props.options)==null?void 0:u[0].id)||""]})}},[]),$i(()=>{var B;d&&(r.requireSelection&&((B=i==null?void 0:i.choice)==null?void 0:B[0])===Br?n([{message:"Please select an option",id:r.id}]):n([]))},[(m=i==null?void 0:i.choice)==null?void 0:m[0],d]),Re.createElement(Ja,null,Re.createElement(yt,{title:r.title,required:!1,appearance:t.appearance}),Re.createElement(Xa,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:B=>{s(!0),o({choice:[B.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&Re.createElement("option",{key:"null-value",value:Br,disabled:!0},(f=r.placeholder)!=null?f:"Select an option"),(S=r.props.options)==null?void 0:S.map(B=>Re.createElement("option",{key:B.id,value:B.id},B.title))),((b=(w=r.props.options)==null?void 0:w.find(B=>{var L;return B.id===((L=i==null?void 0:i.choice)==null?void 0:L[0])}))==null?void 0:b.isOpenEnded)&&Re.createElement(Re.Fragment,null,Re.createElement(yt,{title:(k=(v=(x=r.props.options)==null?void 0:x.find(B=>{var L;return B.id===((L=i==null?void 0:i.choice)==null?void 0:L[0])}))==null?void 0:v.openEndedLabel)!=null?k:"Please specify",required:!1,appearance:t.appearance}),Re.createElement(Pr,{type:"text",placeholder:"Enter your answer here",onChange:B=>{o({choice:[B.target.value]})},appearance:t.appearance})),Re.createElement(Kt,{title:r.subtitle,appearance:t.appearance}))}import bo,{useEffect as Er,useState as Wi}from"react";import zi from"styled-components";import So from"react";import yo from"react";var _i=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return yo.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Qa=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:l})=>yo.createElement("svg",{style:l,className:r,width:t,height:t,overflow:"visible"},yo.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},yo.createElement(_i,{color:n,size:t}),yo.createElement(_i,{color:e,percentage:Math.max(o,.1),size:t})),i),qt=Qa;import Za from"styled-components";var Ra=({color:e="#FFFFFF"})=>So.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},So.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),ep={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},tp={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},op={border:"1px solid #000000",color:"#FFFFFF"},rp={border:"1px solid #C5CBD3"},ip={color:"#FFFFFF"},np={border:"1px solid #C5CBD3"},sp=e=>e==="square"?ep:tp,lp=(e,t)=>e==="square"?t?op:rp:t?ip:np,ap=Za.div`
|
|
348
348
|
${e=>Pe(e)}
|
|
349
|
-
`,pt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=at,style:r,className:
|
|
349
|
+
`,pt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=at,style:r,className:l})=>{let p=sp(t),d=lp(t,e);return e===!0?p=V(T(T({},p),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=T(T({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?So.createElement(qt,{fillColor:o,percentage:i,size:22}):So.createElement(ap,{styleOverrides:p,style:r,role:"checkbox",className:Te(a("checkIconContainer",n),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",l)},e&&So.createElement(Ra,{color:"#FFFFFF"}))};var pp=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
|
-
`,dp=
|
|
356
|
-
${e=>
|
|
355
|
+
`,dp=zi.button`
|
|
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}};
|
|
359
359
|
font-size: 14px;
|
|
@@ -377,8 +377,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
377
377
|
height: 48px;
|
|
378
378
|
padding: 0 18px;
|
|
379
379
|
margin-bottom: 10px;
|
|
380
|
-
`;function Hi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[
|
|
381
|
-
${e=>
|
|
380
|
+
`;function Hi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[l,p]=Wi((i==null?void 0:i.choice)||[]),[d,s]=Wi(!1);return Er(()=>{l.length==0&&!d&&(s(!0),o({choice:[]}))},[]),Er(()=>{o({choice:l})},[l]),Er(()=>{r.required&&(l.length<r.props.minChoices||l.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[l]),bo.createElement(pp,null,bo.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>bo.createElement(dp,{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(f=>f!==c.id));return}l.length<r.props.maxChoices?p([...l,c.id]):l.length==1&&r.props.maxChoices==1&&p([c.id])}},c.title,bo.createElement(pt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:l.includes(c.id),appearance:t.appearance}))),bo.createElement(Kt,{title:r.subtitle,appearance:t.appearance}))}import Go from"react";import Vi from"styled-components";import cp from"dompurify";function de(e){return{__html:cp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var mp=Vi.h1`
|
|
381
|
+
${e=>E(e)} {
|
|
382
382
|
font-style: normal;
|
|
383
383
|
font-weight: 700;
|
|
384
384
|
font-size: ${e=>e.size=="small"?"15px":"18px"};
|
|
@@ -390,7 +390,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
390
390
|
color: ${e=>e.appearance.theme.colorText};
|
|
391
391
|
}
|
|
392
392
|
`,up=Vi.h2`
|
|
393
|
-
${e=>
|
|
393
|
+
${e=>E(e)} {
|
|
394
394
|
font-style: normal;
|
|
395
395
|
font-weight: 400;
|
|
396
396
|
font-size: 14px;
|
|
@@ -398,38 +398,38 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
398
398
|
letter-spacing: 0.28px;
|
|
399
399
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
400
400
|
}
|
|
401
|
-
`;function
|
|
401
|
+
`;function Oe({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n="",ariaPrefix:r=""}){return Go.createElement(Go.Fragment,null,Go.createElement(mp,{appearance:e,id:r?`frigade${r}Title`:"frigadeTitle",className:a(`${n}${n?Co(i):i}Title`,e),dangerouslySetInnerHTML:de(t),size:i}),o&&Go.createElement(up,{id:r?`frigade${r}Subtitle`:"frigadeSubtitle",appearance:e,className:a(`${n}${n?Co(i):i}Subtitle`,e),dangerouslySetInnerHTML:de(o),size:i}))}import*as Ar from"react";var ji=e=>Ar.createElement("svg",T({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Ar.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 gp=Ko.div`
|
|
402
402
|
display: flex;
|
|
403
403
|
flex-direction: column;
|
|
404
404
|
justify-content: flex-end;
|
|
405
405
|
overflow: visible;
|
|
406
406
|
padding-top: 14px;
|
|
407
|
-
`,hp=
|
|
407
|
+
`,hp=Ko.div`
|
|
408
408
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
409
409
|
font-size: 12px;
|
|
410
410
|
margin-bottom: 12px;
|
|
411
411
|
display: flex;
|
|
412
412
|
align-items: center;
|
|
413
|
-
`,xp=
|
|
413
|
+
`,xp=Ko.div`
|
|
414
414
|
margin-right: 4px;
|
|
415
415
|
display: inline-flex;
|
|
416
|
-
`,Cp=
|
|
416
|
+
`,Cp=Ko.div`
|
|
417
417
|
padding-left: 1px;
|
|
418
418
|
padding-right: 1px;
|
|
419
|
-
`,yp={text:
|
|
419
|
+
`,yp={text:vr,multipleChoice:Ui,multipleChoiceList:Hi},Nr="frigade-multiInputStepTypeData";function Ki({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:l,prefillData:p}){var C;let d=t.props,[s,m]=Or([]),[c,f]=Or([]),{userId:S}=ho(),[w,b]=Or(B()||(p?p[t.id]:null)||{}),{readonly:x}=fp(X),v=T(T({},yp),l);Gi(()=>{i(s.length===0)},[s,i]),Gi(()=>{n(w)},[w]);function k(u,N){b(F=>{let P=V(T({},F),{[u.id]:N});return typeof window!="undefined"&&window.localStorage&&!x&&window.localStorage.setItem(L(),JSON.stringify(P)),P})}function B(){if(typeof window!="undefined"&&window.localStorage){let u=window.localStorage.getItem(L());if(u)return JSON.parse(u)}return null}function L(){return`${Nr}-${e}-${t.id}-${S}`}return Et.createElement(Cp,{className:a("multiInput",r)},Et.createElement(Oe,{appearance:r,title:t.title,subtitle:t.subtitle}),Et.createElement(gp,{className:a("multiInputContainer",r)},(C=d==null?void 0:d.data)==null?void 0:C.map(u=>{let N=s.reverse().find(F=>F.id===u.id);return v[u.type]?Et.createElement("span",{key:u.id,"data-field-id":u.id,className:a("multiInputField",r)},v[u.type]({formInput:u,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:F=>{!c.includes(u.id)&&F&&(F==null?void 0:F.text)!==""&&f(P=>[...P,u.id]),k(u,F)},inputData:w[u.id],setFormValidationErrors:F=>{F.length===0&&s.length===0||m(P=>F.length===0?P.filter(I=>I.id!==u.id):[...P,...F])}}),N&&N.message&&c.includes(u.id)&&N.hidden!==!0&&Et.createElement(hp,{key:u.id,style:{overflow:"hidden"},appearance:r,className:a("multiInputValidationError",r)},Et.createElement(xp,{appearance:r,className:a("multiInputValidationErrorIcon",r)},Et.createElement(ji,null)),N.message)):null})))}import Yt from"styled-components";var qi=Yt.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
|
-
`,Yi=
|
|
424
|
+
`,Yi=Yt.div`
|
|
425
425
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
426
426
|
font-size: 12px;
|
|
427
|
-
`,Ji=
|
|
427
|
+
`,Ji=Yt.div`
|
|
428
428
|
display: flex;
|
|
429
429
|
gap: 12px;
|
|
430
430
|
width: 100%;
|
|
431
431
|
justify-content: flex-end;
|
|
432
|
-
`,Xi=
|
|
432
|
+
`,Xi=Yt.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 na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
437
437
|
flex-grow: 1;
|
|
438
438
|
flex-basis: 0;
|
|
439
439
|
position: relative;
|
|
440
|
-
`,Qi=
|
|
440
|
+
`,Qi=Yt.div`
|
|
441
441
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
442
442
|
position: relative;
|
|
443
443
|
overflow-y: auto;
|
|
444
|
-
`,Zi=
|
|
444
|
+
`,Zi=Yt.div`
|
|
445
445
|
display: flex;
|
|
446
446
|
align-self: stretch;
|
|
447
447
|
flex-grow: 1;
|
|
@@ -453,7 +453,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=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
|
|
456
|
+
`;import St from"react";import en from"react";import tn from"styled-components";import Sp from"styled-components";var Ri=Sp.div`
|
|
457
457
|
width: 24px;
|
|
458
458
|
height: 24px;
|
|
459
459
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
@@ -475,7 +475,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
475
475
|
justify-content: center;
|
|
476
476
|
align-content: center;
|
|
477
477
|
align-items: center;
|
|
478
|
-
${e=>
|
|
478
|
+
${e=>E(e)} {
|
|
479
479
|
display: flex;
|
|
480
480
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
481
481
|
width: ${e=>e.type==="full-width"?"100%":"auto"};
|
|
@@ -504,8 +504,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
504
504
|
opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
|
|
505
505
|
cursor: not-allowed;
|
|
506
506
|
}
|
|
507
|
-
`,
|
|
508
|
-
${e=>
|
|
507
|
+
`,qo=tn.div`
|
|
508
|
+
${e=>E(e)} {
|
|
509
509
|
display: flex;
|
|
510
510
|
flex-direction: row;
|
|
511
511
|
justify-content: flex-start;
|
|
@@ -515,14 +515,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
515
515
|
margin-right: 8px;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
|
-
`,re=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:
|
|
518
|
+
`,re=({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 f;function c(){let S=l?"buttonSecondary":"button";return s===""?S:`${s}${Co(S)}`}return en.createElement(bp,{tabindex:l?"0":"1",secondary:l,appearance:p,disabled:i||m,loading:(f=m==null?void 0:m.toString())!=null?f:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:a(c(),p)},m?en.createElement(Ri,{className:a("buttonLoader",p)}):t!=null?t:"Continue")};var on=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:l,onBack:p,allowBackNavigation:d,errorMessage:s,isSaving:m})=>{var S;let c=l.length>1&&r!=0&&d,f=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return St.createElement(St.Fragment,null,s!==null&&s!=null&&St.createElement(Yi,{appearance:o,className:a("formCTAError",o)},s),St.createElement(qi,{showBackButton:c,className:a("formCTAContainer",o)},c&&St.createElement(re,{title:(S=e.backButtonTitle)!=null?S:"Back",onClick:p,secondary:!0,withMargin:!1,type:f,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),St.createElement(Ji,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?St.createElement(re,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:f,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?St.createElement(re,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:f,appearance:o,loading:m}):null)))};import Ir from"react";import wp from"styled-components";var Tp=wp.div`
|
|
519
519
|
text-align: center;
|
|
520
|
-
`,rn=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=oe().mergeAppearanceWithDefault(i);return
|
|
520
|
+
`,rn=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=oe().mergeAppearanceWithDefault(i);return Ir.createElement(Tp,{className:o},Ir.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,l)=>Ir.createElement("rect",{key:l,x:16*l,y:0,width:8,height:8,rx:4,fill:t===l?n.colorPrimary:"#E6E6E6"}))))};import At from"react";import Jt from"styled-components";import{useContext as Fp}from"react";function me(){let e=Fp(X);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 kp=Jt.div`
|
|
521
521
|
display: flex;
|
|
522
522
|
flex-wrap: wrap;
|
|
523
523
|
align-content: center;
|
|
524
524
|
justify-content: center;
|
|
525
|
-
`,Pp=
|
|
525
|
+
`,Pp=Jt.div`
|
|
526
526
|
align-content: center;
|
|
527
527
|
align-items: center;
|
|
528
528
|
display: flex;
|
|
@@ -536,10 +536,10 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
536
536
|
flex-basis: 255px;
|
|
537
537
|
flex-grow: 0;
|
|
538
538
|
flex-shrink: 0;
|
|
539
|
-
`,vp=
|
|
539
|
+
`,vp=Jt.img`
|
|
540
540
|
width: 78px;
|
|
541
541
|
height: auto;
|
|
542
|
-
`,Bp=
|
|
542
|
+
`,Bp=Jt.button`
|
|
543
543
|
font-style: normal;
|
|
544
544
|
font-weight: 600;
|
|
545
545
|
font-size: 13px;
|
|
@@ -552,11 +552,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
552
552
|
border-radius: 100px;
|
|
553
553
|
padding: 8px 12px;
|
|
554
554
|
margin-top: 16px;
|
|
555
|
-
`,Ep=
|
|
555
|
+
`,Ep=Jt.h1`
|
|
556
556
|
font-weight: 700;
|
|
557
557
|
font-size: 28px;
|
|
558
558
|
line-height: 34px;
|
|
559
|
-
`,Ap=
|
|
559
|
+
`,Ap=Jt.h2`
|
|
560
560
|
font-style: normal;
|
|
561
561
|
font-weight: 400;
|
|
562
562
|
font-size: 16px;
|
|
@@ -565,7 +565,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
565
565
|
margin-top: 12px;
|
|
566
566
|
margin-bottom: 16px;
|
|
567
567
|
max-width: 70%;
|
|
568
|
-
`;function nn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=
|
|
568
|
+
`;function nn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=me();return At.createElement("div",null,At.createElement(Ep,null,e.title),At.createElement(Ap,null,e.subtitle),At.createElement(kp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>At.createElement(Pp,{key:r.title},At.createElement(vp,{src:r.imageUri}),At.createElement(Bp,{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 Qt,{useEffect as _p}from"react";import Jo from"styled-components";import Lr from"react";var Yo=({style:e,className:t})=>Lr.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},Lr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Lr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"}));import Ot,{useRef as Op,useState as Np}from"react";import Xt from"styled-components";var Ip=Xt.div`
|
|
569
569
|
display: flex;
|
|
570
570
|
align-items: center;
|
|
571
571
|
justify-content: flex-start;
|
|
@@ -573,7 +573,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
573
573
|
width: 100%;
|
|
574
574
|
height: 100%;
|
|
575
575
|
position: relative;
|
|
576
|
-
`,Lp=
|
|
576
|
+
`,Lp=Xt.div`
|
|
577
577
|
position: absolute;
|
|
578
578
|
display: flex;
|
|
579
579
|
align-items: center;
|
|
@@ -592,66 +592,66 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
592
592
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
593
593
|
border-radius: 50%;
|
|
594
594
|
}
|
|
595
|
-
`,$p=
|
|
595
|
+
`,$p=Xt.video`
|
|
596
596
|
width: 100%;
|
|
597
597
|
height: 100%;
|
|
598
598
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
599
|
-
`,Mp=
|
|
599
|
+
`,Mp=Xt.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
|
-
`,Dp=
|
|
604
|
+
`,Dp=Xt.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
|
-
}`,Up=
|
|
609
|
+
}`,Up=Xt.iframe`
|
|
610
610
|
width: 100%;
|
|
611
611
|
height: 100%;
|
|
612
612
|
min-height: 400px;
|
|
613
613
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
614
|
-
`;function
|
|
615
|
-
${e=>
|
|
614
|
+
`;function et({appearance:e,videoUri:t}){let o=Op(),[i,n]=Np(!1);if(t.includes("youtube")){let r=t.split("v=")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),Ot.createElement(Mp,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("youtubePlayer",e)})}if(t.includes("vimeo")){let r=t.split("vimeo.com/")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),Ot.createElement(Dp,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("vimeoPlayer",e)})}if(t.includes("wistia")){let r=t.split("wistia.com/medias/")[1],l=r.indexOf("&");return l!==-1&&(r=r.substring(0,l)),Ot.createElement(Up,{width:"100%",height:"100%",src:`https://fast.wistia.net/embed/iframe/${r}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("wistiaPlayer",e)})}return Ot.createElement(Ip,{className:a("videoPlayerWrapper",e),appearance:e},!i&&Ot.createElement(Lp,{onClick:()=>{n(!0),o.current.play()},appearance:e},Ot.createElement(Yo,null)),Ot.createElement($p,{appearance:e,controls:i,ref:o,play:i,src:t}))}var Wp=Jo.div`
|
|
615
|
+
${e=>E(e)} {
|
|
616
616
|
display: flex;
|
|
617
617
|
flex-direction: column;
|
|
618
618
|
justify-content: center;
|
|
619
619
|
}
|
|
620
|
-
`,
|
|
621
|
-
${e=>
|
|
620
|
+
`,zp=Jo.img`
|
|
621
|
+
${e=>E(e)} {
|
|
622
622
|
width: 100%;
|
|
623
623
|
height: auto;
|
|
624
624
|
max-height: 250px;
|
|
625
625
|
margin-bottom: 24px;
|
|
626
626
|
}
|
|
627
|
-
`,Hp=
|
|
628
|
-
${e=>
|
|
627
|
+
`,Hp=Jo.div`
|
|
628
|
+
${e=>E(e)} {
|
|
629
629
|
margin-bottom: 24px;
|
|
630
630
|
}
|
|
631
|
-
`,Vp=
|
|
632
|
-
${e=>
|
|
631
|
+
`,Vp=Jo.div`
|
|
632
|
+
${e=>E(e)} {
|
|
633
633
|
width: 100%;
|
|
634
634
|
height: auto;
|
|
635
635
|
max-height: 250px;
|
|
636
636
|
margin-bottom: 24px;
|
|
637
637
|
}
|
|
638
|
-
`;function sn({stepData:e,appearance:t,setCanContinue:o}){return
|
|
638
|
+
`;function sn({stepData:e,appearance:t,setCanContinue:o}){return _p(()=>{o(!0)},[]),Qt.createElement(Wp,{className:a("callToActionContainer",t)},Qt.createElement(Hp,{className:a("callToActionTextContainer",t)},Qt.createElement(Oe,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Qt.createElement(zp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Qt.createElement(Vp,{appearance:t,className:a("callToActionVideo",t)},Qt.createElement(et,{appearance:t,videoUri:e.videoUri})))}import dt,{useEffect as $r,useState as Mr}from"react";import bt from"styled-components";var ln=bt.div`
|
|
639
639
|
width: auto;
|
|
640
640
|
display: flex;
|
|
641
641
|
flex-direction: column;
|
|
642
642
|
justify-content: center;
|
|
643
643
|
align-items: center;
|
|
644
644
|
padding: 4px;
|
|
645
|
-
`,an=
|
|
645
|
+
`,an=bt.div`
|
|
646
646
|
width: 100%;
|
|
647
647
|
text-align: left;
|
|
648
|
-
`,pn=
|
|
648
|
+
`,pn=bt.h1`
|
|
649
649
|
font-style: normal;
|
|
650
650
|
font-weight: 700;
|
|
651
651
|
font-size: 32px;
|
|
652
652
|
line-height: 38px;
|
|
653
653
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
654
|
-
`,dn=
|
|
654
|
+
`,dn=bt.h1`
|
|
655
655
|
font-style: normal;
|
|
656
656
|
font-weight: 400;
|
|
657
657
|
font-size: 16px;
|
|
@@ -659,7 +659,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
659
659
|
margin-top: 16px;
|
|
660
660
|
margin-bottom: 16px;
|
|
661
661
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
662
|
-
`,cn=
|
|
662
|
+
`,cn=bt.div`
|
|
663
663
|
padding-top: 12px;
|
|
664
664
|
padding-bottom: 12px;
|
|
665
665
|
flex-direction: row;
|
|
@@ -670,17 +670,17 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
670
670
|
cursor: pointer;
|
|
671
671
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
672
672
|
width: 100%;
|
|
673
|
-
`,mn=
|
|
673
|
+
`,mn=bt.div`
|
|
674
674
|
padding-top: 10px;
|
|
675
675
|
padding-bottom: 10px;
|
|
676
676
|
flex-direction: row;
|
|
677
677
|
display: flex;
|
|
678
678
|
justify-content: flex-start;
|
|
679
|
-
`,un=
|
|
679
|
+
`,un=bt.img`
|
|
680
680
|
width: 42px;
|
|
681
681
|
height: 42px;
|
|
682
682
|
margin-right: 12px;
|
|
683
|
-
`,fn=
|
|
683
|
+
`,fn=bt.p`
|
|
684
684
|
font-style: normal;
|
|
685
685
|
font-weight: 500;
|
|
686
686
|
font-size: 17px;
|
|
@@ -688,8 +688,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
688
688
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
689
689
|
display: flex;
|
|
690
690
|
align-self: center;
|
|
691
|
-
`;var gn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,
|
|
692
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,p])=>`${$o(s)}: ${p};`).join(" ")} }`:`${$o(i)}: ${n};`).join(" ")} }`).join(" ")}`;function se({appearance:e}){if(!e||!e.styleOverrides)return bo.createElement(bo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?bo.createElement(bo.Fragment,null):bo.createElement(Kp,{inlineStyles:t})}import{useEffect as qp,useState as Yp}from"react";function Ge(e,t=!0){let[o,i]=Yp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:s,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:l,getFlow:m}=Q(),c=p(e);function f(){return D(this,null,function*(){!o&&!r&&s(e)===Ue&&l(m(e))===!1&&t&&(i(!0),yield n(e,c[d(e)].id))})}return qp(()=>{f()},[r,e,t]),{}}var Cn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:m,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:C=!1,modalPosition:w="center",repeatable:x=!1,onDismiss:g,showPagination:E=!1,allowBackNavigation:T=!1,validationHandler:P,showFrigadeBranding:B=!1,onFormDataChange:k,showFooter:u=!0,prefillData:L={},updateUrlOnPageChange:b=!1})=>{let{getFlow:F,getFlowSteps:$,isLoading:N,targetingLogicShouldHideFlow:O,getFlowStatus:V,getCurrentStepIndex:W,markFlowCompleted:J,markFlowNotStarted:R,markStepStarted:pe}=Q(),q=W(e),{mergeAppearanceWithDefault:Y}=oe(),[de,we]=Jp(null),{setOpenFlowState:ke,getOpenFlowState:Z,hasOpenModals:me}=Ne();Ge(e,i);let U=$(e);d=Y(d);let[ee,he]=i!==void 0&&n!==void 0?[i,n]:[Z(e,!0),H=>ke(e,H)],Ee=typeof window!="undefined"?window.location.hash:null;if(xn(()=>{var H;if(U&&U.length>0&&T){let z=typeof window!="undefined"&&((H=window==null?void 0:window.location)!=null&&H.hash)?window.location.hash.replace("#",""):"";if(U&&(U==null?void 0:U.length)>0){let M=-1;if(z){let _=z;M=U.findIndex(le=>le.id===_),de===z&&(M=-1)}M!==-1&&(we(z),pe(e,U[M].id))}}},[Ee]),xn(()=>{!N&&U&&U.length&&typeof window!="undefined"&&T&&(we(U[q].id),window.location.hash=U[q].id)},[N,q,U]),N)return null;let Ae=F(e);if(!Ae||O(Ae)||!U||i!==void 0&&i===!1||V(e)===te&&l&&!x||(o=="modal"||o=="corner-modal")&&me(e))return null;let Ce=()=>{he(!1),g&&g(),C===!0&&J(e)};if(w=="center"&&o==="modal"||o==="large-modal"){let H={padding:"24px"};return o==="large-modal"?(H.width="85%",H.height="90%",H.maxHeight="800px",H.minHeight="500px",H.padding="0"):H.width="400px",ot.createElement(Re,{appearance:d,onClose:Ce,visible:ee,style:H,dismissible:f,showFrigadeBranding:B},ot.createElement(se,{appearance:d}),ot.createElement(Xo,{appearance:d,steps:U,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:he,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:T,validationHandler:P,onFormDataChange:k,showFooter:u,prefillData:L,updateUrlOnPageChange:b,repeatable:x}))}return o==="modal"&&w!=="center"?ot.createElement(zo,{appearance:d,onClose:Ce,visible:ee,modalPosition:w},ot.createElement(se,{appearance:d}),ot.createElement(Xo,{appearance:d,steps:U,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:he,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:T,validationHandler:P,onFormDataChange:k,showFooter:u,prefillData:L,updateUrlOnPageChange:b,repeatable:x})):ot.createElement(ot.Fragment,null,ot.createElement(se,{appearance:d}),ot.createElement(Xo,{appearance:d,steps:U,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:n,setShowModal:he,onDismiss:g,showPagination:E,customFormElements:s,allowBackNavigation:T,validationHandler:P,onFormDataChange:k,showFooter:u,prefillData:L,updateUrlOnPageChange:b,repeatable:x}))},yn=Cn;import{useCallback as Mr,useContext as Xp,useEffect as Qp}from"react";function Dr(){let{organizationId:e,userId:t,setOrganizationId:o}=Xp(X),{mutateUserFlowState:i}=We(),{config:n,apiUrl:r}=Ze(),s=Ht(),{verifySDKInitiated:p}=Vt();function d(f,C){return`frigade-user-group-registered-${f}-${C}`}Qp(()=>{if(t&&e){if(t.startsWith(jt))return;let f=d(t,e);localStorage.getItem(f)||(s(`${r}userGroups`,j(S({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"))}},[t,e]);let l=Mr(f=>D(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let C={foreignUserId:t,foreignUserGroupId:e,properties:f};yield s(`${r}userGroups`,j(S({},n),{method:"POST",body:JSON.stringify(C)})),i()}),[e,t,n,i]),m=Mr((f,C)=>D(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let x={foreignUserId:t,foreignUserGroupId:e,events:[{event:f,properties:C}]};yield s(`${r}userGroups`,j(S({},n),{method:"POST",body:JSON.stringify(x)})),i()}),[e,t,n,i]),c=Mr((f,C)=>D(this,null,function*(){if(p())if(C){let w=d(t,f);localStorage.setItem(w,"true"),o(f);let x={foreignUserId:t,foreignUserGroupId:f,properties:C};yield s(`${r}userGroups`,j(S({},n),{method:"POST",body:JSON.stringify(x)})),i()}else o(f)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var Sn="frigade-xFrigade_guestUserId",To="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=fo(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=We(),{userId:n,setUserId:r}=go(),[s,p]=wo(n),{getFlowStatus:d}=Q(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:f}=Zp(X),[C,w]=wo([]),[x,g]=wo([]),{organizationId:E}=Dr(),[T,P]=wo(E),[B,k]=wo(!1);Qt(()=>{if(!o&&t)for(let F=0;F<t.length;F++){let $=t[F],N=l.find(O=>O.slug===($==null?void 0:$.flowId));if(N&&$&&$.shouldTrigger===!0&&N.type=="FORM"&&N.triggerType==="AUTOMATIC"&&!x.includes(N.slug)){setTimeout(()=>{u($.flowId)},500);break}}},[o,t]),Qt(()=>{f.length>0&&i()},[f]),Qt(()=>{B||(k(!0),i())},[o,k]);function u(F){let $=l.find(N=>N.slug===F);$&&$.triggerType==="AUTOMATIC"&&!x.includes($.slug)&&(g([...x,$.slug]),w([$]))}function L(){if(!n){let F=localStorage.getItem(To);if(F){r(F);return}let $=localStorage.getItem(Sn);if($){r($);return}c(!0);let N=jt+Rp();try{localStorage.setItem(Sn,N)}catch(O){console.log("Failed to save guest user id locally: Local storage unavailable",O)}r(O=>O||N)}}Qt(()=>{try{if(l){let F=[];l.forEach($=>{if($.data){let N=$.data.match(/"imageUri":"(.*?)"/g);N&&N.forEach(O=>{let V=O.replace('"imageUri":"',"").replace('"',"");if(F.includes(V))return;let W=new Image;W.src=V,F.push(V)})}})}}catch(F){}},[l]),Qt(()=>{if(n!==s&&(e([]),i()),p(n),n&&!n.startsWith(jt))try{localStorage.setItem(To,n)}catch(F){console.log("Failed to save user id locally: Local storage available",F)}n===null&&setTimeout(()=>{n===null&&L()},50)},[n,l,m]),Qt(()=>{E!=T&&(P(E),e([]),i())},[E,T,P]);function b(){return Nt.createElement(Nt.Fragment,null,C.map(F=>d(F.slug)!==Ue?null:Nt.createElement("span",{key:F.slug},Nt.createElement(yn,{flowId:F.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Nt.createElement(Nt.Fragment,null,Nt.createElement(b,null))};var wn={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function ed(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((s,p)=>{r[s]||(r[s]=p===n.length-1?i:{}),r=r[s]})}}),t}function td(e){if(!e)return;let t=ye({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=ed(t),n=td(o);return{overrides:i,css:n}}import gd from"styled-components";import{compose as hd,variant as kn}from"styled-system";import Fn from"react";import od,{ThemeProvider as rd,useTheme as id}from"styled-components";import{border as nd,color as sd,compose as ld,get as ad,shadow as pd,space as dd,system as cd,typography as md}from"styled-system";var ud={width:{property:"width",scale:"sizes",transform:(e,t)=>ad(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},fd=od("div")(({css:e})=>e,ld(nd,sd,pd,dd,md,cd(ud))),Fo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Le(r,["as","children","overrides"]);let s=id(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(fd,S(S({as:e},p),i),t);if(o!==void 0){let l=ye(s,o);return Fn.createElement(rd,{theme:l},d())}return d()};var ko={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},xd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=gd(Fo)(()=>({whiteSpace:"nowrap"}),hd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:xd})));import Cd from"styled-components";import{variant as yd,system as Sd}from"styled-system";var Qo={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var vn=Cd(Fo)(yd({scale:"components.Text",variants:"components.Text"}),Sd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",bd=20,wd=Object.fromEntries(Array.from(Array(bd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),Zt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},Ur={colors:j(S({},Zt),{neutral:{foreground:Zt.gray300},primary:{background:Zt.blue500,foreground:Zt.white,inverted:Zt.blue500},negative:{foreground:Zt.red500}}),fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:wd,components:{Button:ko,Text:Qo}};var An="https://api.frigade.com",X=Td({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:at,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:An,readonly:!1,debug:!1});function kd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Pd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var q,Y,de,we,ke;let[r,s]=Ke(t||null),[p,d]=Ke(o||null),[l,m]=Ke([]),[c,f]=Ke([]),[C,w]=Ke([]),[x,g]=Ke({}),[E,T]=Ke({}),[P,B]=Ke([]),[k,u]=Ke({}),[L,b]=Ke(!1),[F,$]=Ke(!1),[N,O]=Ke(!J(e)),V=(Z,me)=>{if(me==="_blank"){window.open(Z,"_blank");return}setTimeout(()=>{window.location.href=Z},50)},W={theme:S(S({},at.theme),(Y=(q=i==null?void 0:i.defaultAppearance)==null?void 0:q.theme)!=null?Y:{}),styleOverrides:S(S({},at.styleOverrides),(we=(de=i==null?void 0:i.defaultAppearance)==null?void 0:de.styleOverrides)!=null?we:{})};function J(Z){return!!(Z&&Z.length>10&&Z.substring(0,10)==="api_public")}Ro(()=>{t&&s(t)},[t]),Ro(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(To)&&window.localStorage.getItem(To)!==r&&kd()},[r]),Ro(()=>{o&&d(o)},[o]),Ro(()=>{if(J(e))O(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),O(!0);return}},[e,O]);let R={publicApiKey:e,userId:r,setUserId:s,setFlows:m,flows:l,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:C,setFlowResponses:w,userProperties:x,setUserProperties:g,openFlowStates:E,setOpenFlowStates:T,completedFlowsToKeepOpenDuringSession:P,setCompletedFlowsToKeepOpenDuringSession:B,customVariables:k,setCustomVariables:u,isNewGuestUser:L,setIsNewGuestUser:b,hasActiveFullPageFlow:F,setHasActiveFullPageFlow:$,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:V,defaultAppearance:W,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:O,apiUrl:i&&i.apiUrl?i.apiUrl:An,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1};if(N)return Zo.createElement(X.Provider,{value:R},n);let{overrides:pe}=Tn(W);return Zo.createElement(X.Provider,{value:R},Zo.createElement(Fd,{theme:ye(W.theme,Ur,pe!=null?pe:{},(ke=i==null?void 0:i.theme)!=null?ke:{})},n,Zo.createElement(bn,null)))};import gc from"react";import Se,{useEffect as ar,useState as il}from"react";import Xe,{useState as jd}from"react";import Lt from"styled-components";import or from"react";import Ot from"react";import On from"styled-components";var Nn=On.span`
|
|
691
|
+
`;var gn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,l]=Mr([]),[p,d]=Mr(!1),[s,m]=Mr(e.id);return $r(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),$r(()=>{s!==e.id&&(m(e.id),l([]))},[e]),$r(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),dt.createElement(ln,{className:a("selectListContainer",i)},dt.createElement(an,null,dt.createElement(pn,{className:a("selectListTitle",i)},e.title),dt.createElement(dn,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),n.options.map((c,f)=>{let S=r.includes(c.id);return dt.createElement(cn,{key:`select-item-${f}`,onClick:()=>{if(r.includes(c.id)){l(r.filter(w=>w!==c.id));return}r.length<n.maxChoices?l([...r,c.id]):r.length==1&&n.maxChoices==1&&l([c.id])},hideBottomBorder:f===n.options.length-1,className:a("selectListSelectItem",i)},dt.createElement(mn,{className:a("selectListItemImage",i)},c.imageUri&&dt.createElement(un,{src:c.imageUri,alt:`select-icon-${f}`}),dt.createElement(fn,{appearance:i,className:a("selectListSelectItemText",i)},c.title)),dt.createElement(pt,{appearance:i,value:S,primaryColor:i.theme.colorPrimary}))}))};import We,{useEffect as hn,useState as Xo}from"react";var jp=({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:f,onDismiss:S,showPagination:w=!1,customFormElements:b,allowBackNavigation:x,validationHandler:v,onFormDataChange:k,showFooter:B,prefillData:L,updateUrlOnPageChange:C,repeatable:u})=>{var Ce;let F=T(T({},{linkCollection:nn,multiInput:Ki,callToAction:sn,selectList:gn}),i),{primaryCTAClickSideEffects:P,secondaryCTAClickSideEffects:I}=me(),[O,A]=Xo(!1),[G,_]=Xo({}),[Q,Y]=Xo(!1),[se,J]=Xo(null),q=(Ce=t[o])!=null?Ce:null,{markStepCompleted:ae,markStepStarted:we,isLoading:Ne,updateCustomVariables:Z,markFlowCompleted:ce}=R();hn(()=>{Z(n)},[n,Ne]),hn(()=>{k&&k(G,U(),t[o],o)},[G]);function U(){var W;return{data:(W=G[t[o].id])!=null?W:{},stepId:t[o].id,customVariables:n}}function ee(H,W,$){let z=o+1<t.length?t[o+1]:null;return l&&l(H,$,z,G,U()),r?r(H,o,W,z):!0}function Ie(H,W){_($=>{let z={};return z[H.id]=W,T(T({},$),z)})}function ke(H){return H.selectedStep.imageUri?We.createElement(Zi,{image:H.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let xe=B&&We.createElement(on,{step:t[o],canContinue:O&&!Q,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>M(void 0,null,function*(){if(Y(!0),v){let $=yield v(t[o],o,t[o+1],G,U());if($!==!0){J(typeof $=="string"?$:null),Y(!1);return}else J(null)}let H=T({},U());yield ae(p,t[o].id,H),o+1<t.length&&!x&&(yield we(p,t[o+1].id));let W=ee(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),S&&S(),s&&W&&(c&&c(!1),f(!1)),yield ce(p),u&&(yield we(p,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(z=>{z.startsWith(Nr)&&window.localStorage.removeItem(z)}))),P(t[o]),Y(!1),typeof window!="undefined"&&!x&&C&&o+1<t.length){let $=new URL(window.location.href);$.searchParams.set("p",t[o+1].id),window.history.pushState({},"",$.toString())}}),onSecondaryClick:()=>{ee(t[o],"secondary",o),I(t[o])},onBack:()=>M(void 0,null,function*(){o-1>=0&&(Y(!0),yield we(p,t[o-1].id),Y(!1))}),steps:t,allowBackNavigation:x,errorMessage:se,isSaving:Q});return We.createElement(We.Fragment,null,We.createElement(Xi,{className:a("formContainer",e)},We.createElement(jp,{id:o,shouldWrap:d==="large-modal"},We.createElement(Qi,{key:q.id,type:d,className:a("formContent",e)},t.map(H=>{var $;let W=F[($=H.type)!=null?$:"multiInput"];return q.id!==H.id?null:typeof W!="function"?W:We.createElement(W,{key:H.id,stepData:H,canContinue:O,setCanContinue:A,onSaveData:z=>{Ie(H,z)},appearance:e,customFormElements:b,flowId:p,prefillData:L})}),w&&We.createElement(rn,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),xe)),d=="large-modal"&&We.createElement(ke,{selectedStep:t[o]})))};import wo from"react";import{createGlobalStyle as Gp}from"styled-components";var Kp=Gp`
|
|
692
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${xo}${t}.${xo}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([l,p])=>`${Mo(l)}: ${p};`).join(" ")} }`:`${Mo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ne({appearance:e}){if(!e||!e.styleOverrides)return wo.createElement(wo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?wo.createElement(wo.Fragment,null):wo.createElement(Kp,{inlineStyles:t})}import{useEffect as qp,useState as Yp}from"react";function Ge(e,t=!0){let[o,i]=Yp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:l,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:s,getFlow:m}=R(),c=p(e);function f(){return M(this,null,function*(){!o&&!r&&l(e)===Ue&&s(m(e))===!1&&t&&(i(!0),yield n(e,c[d(e)].id))})}return qp(()=>{f()},[r,e,t]),{}}var Cn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:l,onComplete:p,appearance:d,hideOnFlowCompletion:s=!0,onStepCompletion:m,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:S=!1,modalPosition:w="center",repeatable:b=!1,onDismiss:x,showPagination:v=!1,allowBackNavigation:k=!1,validationHandler:B,showFrigadeBranding:L=!1,onFormDataChange:C,showFooter:u=!0,prefillData:N={},updateUrlOnPageChange:F=!1})=>{let{getFlow:P,getFlowSteps:I,isLoading:O,targetingLogicShouldHideFlow:A,getFlowStatus:G,getCurrentStepIndex:_,markFlowCompleted:Q,markFlowNotStarted:Y,markStepStarted:se}=R(),J=_(e),{mergeAppearanceWithDefault:q}=oe(),[ae,we]=Jp(null),{setOpenFlowState:Ne,getOpenFlowState:Z,hasOpenModals:ce}=Ee();Ge(e,i);let U=I(e);d=q(d);let[ee,Ie]=i!==void 0&&n!==void 0?[i,n]:[Z(e,!0),H=>Ne(e,H)],ke=typeof window!="undefined"?window.location.hash:null;if(xn(()=>{var H;if(U&&U.length>0&&k){let W=typeof window!="undefined"&&((H=window==null?void 0:window.location)!=null&&H.hash)?window.location.hash.replace("#",""):"";if(U&&(U==null?void 0:U.length)>0){let $=-1;if(W){let z=W;$=U.findIndex(pe=>pe.id===z),ae===W&&($=-1)}$!==-1&&(we(W),se(e,U[$].id))}}},[ke]),xn(()=>{!O&&U&&U.length&&typeof window!="undefined"&&k&&(we(U[J].id),window.location.hash=U[J].id)},[O,J,U]),O)return null;let xe=P(e);if(!xe||A(xe)||!U||i!==void 0&&i===!1||G(e)===te&&s&&!b||(o=="modal"||o=="corner-modal")&&ce(e))return null;let Ce=()=>{Ie(!1),x&&x(),S===!0&&Q(e)};if(w=="center"&&o==="modal"||o==="large-modal"){let H={padding:"24px"};return o==="large-modal"?(H.width="85%",H.height="90%",H.maxHeight="800px",H.minHeight="500px",H.padding="0"):H.width="400px",tt.createElement(Ze,{appearance:d,onClose:Ce,visible:ee,style:H,dismissible:f,showFrigadeBranding:L},tt.createElement(ne,{appearance:d}),tt.createElement(Qo,{appearance:d,steps:U,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ie,onDismiss:x,showPagination:v,customFormElements:l,allowBackNavigation:k,validationHandler:B,onFormDataChange:C,showFooter:u,prefillData:N,updateUrlOnPageChange:F,repeatable:b}))}return o==="modal"&&w!=="center"?tt.createElement(zo,{appearance:d,onClose:Ce,visible:ee,modalPosition:w},tt.createElement(ne,{appearance:d}),tt.createElement(Qo,{appearance:d,steps:U,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ie,onDismiss:x,showPagination:v,customFormElements:l,allowBackNavigation:k,validationHandler:B,onFormDataChange:C,showFooter:u,prefillData:N,updateUrlOnPageChange:F,repeatable:b})):tt.createElement(tt.Fragment,null,tt.createElement(ne,{appearance:d}),tt.createElement(Qo,{appearance:d,steps:U,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Ie,onDismiss:x,showPagination:v,customFormElements:l,allowBackNavigation:k,validationHandler:B,onFormDataChange:C,showFooter:u,prefillData:N,updateUrlOnPageChange:F,repeatable:b}))},yn=Cn;import{useCallback as Dr,useContext as Xp,useEffect as Qp}from"react";function Ur(){let{organizationId:e,userId:t,setOrganizationId:o}=Xp(X),{mutateUserFlowState:i}=_e(),{config:n,apiUrl:r}=Qe(),l=Vt(),{verifySDKInitiated:p}=jt();function d(f,S){return`frigade-user-group-registered-${f}-${S}`}Qp(()=>{if(t&&e){if(t.startsWith(Gt))return;let f=d(t,e);localStorage.getItem(f)||(l(`${r}userGroups`,V(T({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"))}},[t,e]);let s=Dr(f=>M(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,properties:f};yield l(`${r}userGroups`,V(T({},n),{method:"POST",body:JSON.stringify(S)})),i()}),[e,t,n,i]),m=Dr((f,S)=>M(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let b={foreignUserId:t,foreignUserGroupId:e,events:[{event:f,properties:S}]};yield l(`${r}userGroups`,V(T({},n),{method:"POST",body:JSON.stringify(b)})),i()}),[e,t,n,i]),c=Dr((f,S)=>M(this,null,function*(){if(p())if(S){let w=d(t,f);localStorage.setItem(w,"true"),o(f);let b={foreignUserId:t,foreignUserGroupId:f,properties:S};yield l(`${r}userGroups`,V(T({},n),{method:"POST",body:JSON.stringify(b)})),i()}else o(f)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:m}}var Sn="frigade-xFrigade_guestUserId",Fo="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=go(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=_e(),{userId:n,setUserId:r}=ho(),[l,p]=To(n),{getFlowStatus:d}=R(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:f}=Zp(X),[S,w]=To([]),[b,x]=To([]),{organizationId:v}=Ur(),[k,B]=To(v),[L,C]=To(!1);Zt(()=>{if(!o&&t)for(let P=0;P<t.length;P++){let I=t[P],O=s.find(A=>A.slug===(I==null?void 0:I.flowId));if(O&&I&&I.shouldTrigger===!0&&O.type=="FORM"&&O.triggerType==="AUTOMATIC"&&!b.includes(O.slug)){setTimeout(()=>{u(I.flowId)},500);break}}},[o,t]),Zt(()=>{f.length>0&&i()},[f]),Zt(()=>{L||(C(!0),i())},[o,C]);function u(P){let I=s.find(O=>O.slug===P);I&&I.triggerType==="AUTOMATIC"&&!b.includes(I.slug)&&(x([...b,I.slug]),w([I]))}function N(){if(!n){let P=localStorage.getItem(Fo);if(P){r(P);return}let I=localStorage.getItem(Sn);if(I){r(I);return}c(!0);let O=Gt+Rp();try{localStorage.setItem(Sn,O)}catch(A){console.log("Failed to save guest user id locally: Local storage unavailable",A)}r(A=>A||O)}}Zt(()=>{try{if(s){let P=[];s.forEach(I=>{if(I.data){let O=I.data.match(/"imageUri":"(.*?)"/g);O&&O.forEach(A=>{let G=A.replace('"imageUri":"',"").replace('"',"");if(P.includes(G))return;let _=new Image;_.src=G,P.push(G)})}})}}catch(P){}},[s]),Zt(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Gt))try{localStorage.setItem(Fo,n)}catch(P){console.log("Failed to save user id locally: Local storage available",P)}n===null&&setTimeout(()=>{n===null&&N()},50)},[n,s,m]),Zt(()=>{v!=k&&(B(v),e([]),i())},[v,k,B]);function F(){return Nt.createElement(Nt.Fragment,null,S.map(P=>d(P.slug)!==Ue?null:Nt.createElement("span",{key:P.slug},Nt.createElement(yn,{flowId:P.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Nt.createElement(Nt.Fragment,null,Nt.createElement(F,null))};var wn={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function ed(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l]})}}),t}function td(e){if(!e)return;let t=ye({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=ed(t),n=td(o);return{overrides:i,css:n}}import gd from"styled-components";import{compose as hd,variant as kn}from"styled-system";import Fn from"react";import od,{ThemeProvider as rd,useTheme as id}from"styled-components";import{border as nd,color as sd,compose as ld,get as ad,shadow as pd,space as dd,system as cd,typography as md}from"styled-system";var ud={width:{property:"width",scale:"sizes",transform:(e,t)=>ad(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},fd=od("div")(({css:e})=>e,ld(nd,sd,pd,dd,md,cd(ud))),ko=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Le(r,["as","children","overrides"]);let l=id(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(fd,T(T({as:e},p),i),t);if(o!==void 0){let s=ye(l,o);return Fn.createElement(rd,{theme:s},d())}return d()};var Po={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},xd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=gd(ko)(()=>({whiteSpace:"nowrap"}),hd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:xd})));import Cd from"styled-components";import{variant as yd,system as Sd}from"styled-system";var Zo={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var vn=Cd(ko)(yd({scale:"components.Text",variants:"components.Text"}),Sd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",bd=20,wd=Object.fromEntries(Array.from(Array(bd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),Rt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},_r={colors:V(T({},Rt),{neutral:{foreground:Rt.gray300},primary:{background:Rt.blue500,foreground:Rt.white,inverted:Rt.blue500},negative:{foreground:Rt.red500}}),fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:wd,components:{Button:Po,Text:Zo}};var An="https://api.frigade.com",X=Td({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:at,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:An,readonly:!1,debug:!1});function kd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var Pd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var J,q,ae,we,Ne;let[r,l]=Ke(t||null),[p,d]=Ke(o||null),[s,m]=Ke([]),[c,f]=Ke([]),[S,w]=Ke([]),[b,x]=Ke({}),[v,k]=Ke({}),[B,L]=Ke([]),[C,u]=Ke({}),[N,F]=Ke(!1),[P,I]=Ke(!1),[O,A]=Ke(!Q(e)),G=(Z,ce)=>{if(ce==="_blank"){window.open(Z,"_blank");return}setTimeout(()=>{window.location.href=Z},50)},_={theme:T(T({},at.theme),(q=(J=i==null?void 0:i.defaultAppearance)==null?void 0:J.theme)!=null?q:{}),styleOverrides:T(T({},at.styleOverrides),(we=(ae=i==null?void 0:i.defaultAppearance)==null?void 0:ae.styleOverrides)!=null?we:{})};function Q(Z){return!!(Z&&Z.length>10&&Z.substring(0,10)==="api_public")}er(()=>{t&&l(t)},[t]),er(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(Fo)&&window.localStorage.getItem(Fo)!==r&&kd()},[r]),er(()=>{o&&d(o)},[o]),er(()=>{if(Q(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]);let Y={publicApiKey:e,userId:r,setUserId:l,setFlows:m,flows:s,failedFlowResponses:c,setFailedFlowResponses:f,flowResponses:S,setFlowResponses:w,userProperties:b,setUserProperties:x,openFlowStates:v,setOpenFlowStates:k,completedFlowsToKeepOpenDuringSession:B,setCompletedFlowsToKeepOpenDuringSession:L,customVariables:C,setCustomVariables:u,isNewGuestUser:N,setIsNewGuestUser:F,hasActiveFullPageFlow:P,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:G,defaultAppearance:_,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:A,apiUrl:i&&i.apiUrl?i.apiUrl:An,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0};if(O)return Ro.createElement(X.Provider,{value:Y},n);let{overrides:se}=Tn(_);return Ro.createElement(X.Provider,{value:Y},Ro.createElement(Fd,{theme:ye(_.theme,_r,se!=null?se:{},(Ne=i==null?void 0:i.theme)!=null?Ne:{})},n,Ro.createElement(bn,null)))};import gc from"react";import Se,{useEffect as pr,useState as il}from"react";import Ye,{useState as jd}from"react";import $t from"styled-components";import rr from"react";import It from"react";import Nn from"styled-components";var On=Nn.span`
|
|
693
693
|
font-weight: 600;
|
|
694
694
|
font-size: 14px;
|
|
695
695
|
font-style: normal;
|
|
@@ -701,7 +701,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
701
701
|
margin-left: 32px;
|
|
702
702
|
padding-right: 12px;
|
|
703
703
|
${e=>Pe(e)}
|
|
704
|
-
`,vd=
|
|
704
|
+
`,vd=Nn.div`
|
|
705
705
|
flex-direction: row;
|
|
706
706
|
justify-content: space-between;
|
|
707
707
|
display: flex;
|
|
@@ -710,11 +710,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
710
710
|
padding-right: 8px;
|
|
711
711
|
width: 100%;
|
|
712
712
|
${e=>Pe(e)}
|
|
713
|
-
`,
|
|
713
|
+
`,tr=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:l="round",appearance:p})=>It.createElement(It.Fragment,null,It.createElement(vd,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:T({},n)},i==="left"&&e&&It.createElement(On,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),It.createElement(pt,{appearance:p,value:t,type:l,primaryColor:r}),i==="right"&&e&&It.createElement(On,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),It.createElement(ne,{appearance:p}));import vo from"styled-components";var In=vo.div`
|
|
714
714
|
font-weight: 700;
|
|
715
715
|
font-size: 18px;
|
|
716
716
|
line-height: 22px;
|
|
717
|
-
`,Ln=
|
|
717
|
+
`,Ln=vo.p`
|
|
718
718
|
font-weight: 600;
|
|
719
719
|
font-size: 16px;
|
|
720
720
|
line-height: 24px;
|
|
@@ -722,7 +722,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
722
722
|
letter-spacing: 0.32px;
|
|
723
723
|
font-style: normal;
|
|
724
724
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
725
|
-
`,$n=
|
|
725
|
+
`,$n=vo.p`
|
|
726
726
|
font-weight: 400;
|
|
727
727
|
font-size: 14px;
|
|
728
728
|
font-style: normal;
|
|
@@ -731,26 +731,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
731
731
|
letter-spacing: 0.28px;
|
|
732
732
|
margin: 8px 0px 0px 0px;
|
|
733
733
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
734
|
-
`,
|
|
734
|
+
`,or=vo.div`
|
|
735
735
|
width: 6px;
|
|
736
736
|
position: absolute;
|
|
737
737
|
left: 0;
|
|
738
738
|
height: 100%;
|
|
739
739
|
border-top-right-radius: 4px;
|
|
740
740
|
border-bottom-right-radius: 4px;
|
|
741
|
-
`,Mn=
|
|
741
|
+
`,Mn=vo.div`
|
|
742
742
|
flex-direction: row;
|
|
743
743
|
justify-content: flex-start;
|
|
744
744
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
745
745
|
padding-right: 16px;
|
|
746
|
-
`;var Dn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:
|
|
746
|
+
`;var Dn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:l})=>{var p,d,s,m,c;return rr.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&rr.createElement(or,{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}}),rr.createElement(Mn,{className:a("checklistStepItem",l),key:`hero-checklist-step-${t}`,appearance:l,role:"listitem"},rr.createElement(tr,{value:e.complete,labelPosition:"left",label:(s=e.stepName)!=null?s:e.title,style:n,primaryColor:(c=(m=l==null?void 0:l.theme)==null?void 0:m.colorPrimary)!=null?c:i,appearance:l})))};import Lt from"react";import Wr from"styled-components";import ir from"styled-components";var mC=ir.h1`
|
|
747
747
|
display: flex;
|
|
748
748
|
margin: 0;
|
|
749
749
|
font-size: 18px;
|
|
750
|
-
`,uC=
|
|
750
|
+
`,uC=ir.h2`
|
|
751
751
|
font-size: 15px;
|
|
752
752
|
color: #4d4d4d;
|
|
753
|
-
`,Un=
|
|
753
|
+
`,Un=ir.div`
|
|
754
754
|
position: absolute;
|
|
755
755
|
left: 0;
|
|
756
756
|
top: 0;
|
|
@@ -759,7 +759,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
759
759
|
border-radius: 20px;
|
|
760
760
|
background-color: ${e=>e.theme.colorPrimary};
|
|
761
761
|
transition: width 0.5s;
|
|
762
|
-
`,
|
|
762
|
+
`,_n=ir.div`
|
|
763
763
|
position: relative;
|
|
764
764
|
left: 0;
|
|
765
765
|
top: 0;
|
|
@@ -788,14 +788,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
788
788
|
padding-right: ${e=>e.padding};
|
|
789
789
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
790
790
|
${e=>Pe(e)}
|
|
791
|
-
`;var
|
|
791
|
+
`;var ze=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:l})=>{var f;if(t===0)return Lt.createElement(Lt.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(f=l==null?void 0:l.theme)==null?void 0:f.colorText});let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",s=Math.round(e/t*100),m=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${s}% complete`),i==="top"&&(m="0px"),Lt.createElement(Bd,{className:a("progressBarContainer",l),textLocation:i,styleOverrides:n},Lt.createElement(Ad,{className:a("progressBarStepText",l),styleOverrides:V(T({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:l,padding:m,textLocation:i},c),Lt.createElement(Ed,{textLocation:i,className:a("progressBar",l)},Lt.createElement(Un,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:l,className:a("progressBarFill",l)}),Lt.createElement(_n,{className:a("progressBarBackground",l),barHeight:d,appearance:l})))};import Bo from"react";import Nd from"styled-components";import sr from"react";import nr from"react";var eo=({stepData:e,appearance:t})=>nr.createElement(nr.Fragment,null,nr.createElement(Ln,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:de(e.title)}),nr.createElement($n,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:de(e.subtitle)}));import zr from"react";var to=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return zr.createElement(qo,{className:a("ctaContainer",t)},zr.createElement(re,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&zr.createElement(re,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var oo=({stepData:e,appearance:t})=>sr.createElement(sr.Fragment,null,sr.createElement(eo,{stepData:e,appearance:t}),sr.createElement(to,{stepData:e,appearance:t}));import Od from"react";function Wn(e){return Od.createElement(et,{appearance:e.appearance,videoUri:e.videoUri})}var Hr="default",Id=Nd.img`
|
|
792
792
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
793
793
|
width: 100%;
|
|
794
794
|
height: auto;
|
|
795
795
|
min-height: 200px;
|
|
796
|
-
`,
|
|
796
|
+
`,zn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return Bo.createElement("div",null,o)}return Bo.createElement(In,{className:a("checklistStepContent",t)},e.imageUri?Bo.createElement(Id,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle,appearance:t}):null,e.videoUri?Bo.createElement(Wn,{videoUri:e.videoUri,appearance:t}):null,Bo.createElement(oo,{stepData:e,appearance:t}))};import He,{useRef as Ld,useState as $d}from"react";import ro from"styled-components";var Hn=ro.div`
|
|
797
797
|
display: block;
|
|
798
|
-
`,Md=
|
|
798
|
+
`,Md=ro.div`
|
|
799
799
|
display: flex;
|
|
800
800
|
flex-direction: row;
|
|
801
801
|
flex-wrap: wrap;
|
|
@@ -805,20 +805,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
805
805
|
align-content: center;
|
|
806
806
|
margin-top: 24px;
|
|
807
807
|
margin-bottom: 24px;
|
|
808
|
-
`,Dd=
|
|
808
|
+
`,Dd=ro.div`
|
|
809
809
|
display: flex;
|
|
810
810
|
align-items: center;
|
|
811
811
|
justify-content: flex-start;
|
|
812
812
|
flex-direction: column;
|
|
813
813
|
margin-right: 16px;
|
|
814
|
-
`,Ud=
|
|
814
|
+
`,Ud=ro.video`
|
|
815
815
|
width: 200px;
|
|
816
816
|
height: 120px;
|
|
817
|
-
`,
|
|
817
|
+
`,_d=ro.div`
|
|
818
818
|
font-size: 14px;
|
|
819
819
|
line-height: 20px;
|
|
820
820
|
text-align: center;
|
|
821
|
-
`,
|
|
821
|
+
`,Wd=ro.div`
|
|
822
822
|
position: absolute;
|
|
823
823
|
width: 200px;
|
|
824
824
|
height: 120px;
|
|
@@ -838,9 +838,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
838
838
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
839
839
|
border-radius: 50%;
|
|
840
840
|
}
|
|
841
|
-
`,Vn="videoCarousel",jn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return He.createElement(Hn,null,He.createElement(
|
|
841
|
+
`,Vn="videoCarousel",jn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return He.createElement(Hn,null,He.createElement(oo,{stepData:e,appearance:t}));function o({video:r}){let l=Ld(),[p,d]=$d(!1);return He.createElement(Dd,null,!p&&He.createElement(Wd,{onClick:()=>{d(!0),l.current.play()},appearance:t},He.createElement(Yo,null)),He.createElement(Ud,{controls:p,ref:l,play:p,src:r.uri}),He.createElement(_d,null,r.title))}let i=e.props;return i.videos?He.createElement(Hn,null,He.createElement(eo,{stepData:e,appearance:t}),He.createElement(Md,null,i.videos.map((r,l)=>He.createElement("span",{key:`${r.uri}-${l}`},He.createElement(o,{video:r})))),He.createElement(to,{stepData:e,appearance:t})):null};import ct from"react";import lr from"styled-components";var Gn=lr.div`
|
|
842
842
|
display: block;
|
|
843
|
-
`,
|
|
843
|
+
`,zd=lr.pre`
|
|
844
844
|
display: block;
|
|
845
845
|
background-color: #2a2a2a;
|
|
846
846
|
color: #f8f8f8;
|
|
@@ -856,14 +856,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
856
856
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
857
857
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
858
858
|
margin-bottom: 24px;
|
|
859
|
-
`,Hd=
|
|
859
|
+
`,Hd=lr.div`
|
|
860
860
|
font-size: 15px;
|
|
861
861
|
line-height: 20px;
|
|
862
862
|
margin-bottom: 12px;
|
|
863
863
|
margin-top: 12px;
|
|
864
|
-
`,Vd=
|
|
864
|
+
`,Vd=lr.div`
|
|
865
865
|
margin-top: 24px;
|
|
866
|
-
`,Kn="codeSnippet",qn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return ct.createElement(Gn,null,ct.createElement(
|
|
866
|
+
`,Kn="codeSnippet",qn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return ct.createElement(Gn,null,ct.createElement(oo,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?ct.createElement(Gn,{className:a("codeSnippetContainer",t)},ct.createElement(eo,{stepData:e,appearance:t}),ct.createElement(Vd,null,o.codeSnippets.map((n,r)=>ct.createElement("div",{key:r},n.title?ct.createElement(Hd,{dangerouslySetInnerHTML:de(n.title)}):null,n.code?ct.createElement(zd,null,n.code):null))),ct.createElement(to,{stepData:e,appearance:t})):null};var Gd=$t.div`
|
|
867
867
|
display: flex;
|
|
868
868
|
flex-direction: row;
|
|
869
869
|
overflow: hidden;
|
|
@@ -871,14 +871,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
871
871
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
872
872
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
873
873
|
${e=>Pe(e)}
|
|
874
|
-
`,Kd
|
|
874
|
+
`,Kd=$t.h1`
|
|
875
875
|
font-size: 18px;
|
|
876
876
|
font-style: normal;
|
|
877
877
|
font-weight: 700;
|
|
878
878
|
line-height: 24px;
|
|
879
879
|
letter-spacing: 0.36px;
|
|
880
880
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
881
|
-
`,qd
|
|
881
|
+
`,qd=$t.h2`
|
|
882
882
|
font-size: 14px;
|
|
883
883
|
font-style: normal;
|
|
884
884
|
font-weight: 400;
|
|
@@ -886,22 +886,22 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
886
886
|
letter-spacing: 0.28px;
|
|
887
887
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
888
888
|
margin: 10px 0px 0px 0px;
|
|
889
|
-
`,Yn
|
|
889
|
+
`,Yn=$t.div``,Yd=$t.div`
|
|
890
890
|
list-style: none;
|
|
891
891
|
padding: 0;
|
|
892
892
|
margin: 0;
|
|
893
893
|
cursor: pointer;
|
|
894
894
|
min-width: 300px;
|
|
895
|
-
`,Jd
|
|
895
|
+
`,Jd=$t.div`
|
|
896
896
|
width: 1px;
|
|
897
897
|
margin-right: 40px;
|
|
898
898
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
899
|
-
`,Xd
|
|
899
|
+
`,Xd=$t.div`
|
|
900
900
|
flex: 2;
|
|
901
901
|
padding: 40px 40px 40px 0px;
|
|
902
|
-
`,Qd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:
|
|
902
|
+
`,Qd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:l="",customStepTypes:p=new Map,appearance:d,type:s})=>{let{mergeAppearanceWithDefault:m}=oe();d=m(d);let c={[Hr]:zn,[Vn]:jn,[Kn]:qn},f=T(T({},c),p),[S,w]=jd(0),b=n!=null?n:S,x=r!=null?r:w,v=o.filter(B=>B.complete===!0).length,k=()=>{var B;return!((B=o[b])!=null&&B.type)||!f[o[b].type]?f[Hr]({stepData:o[b],appearance:d}):typeof f[o[b].type]!="function"?f[o[b].type]:f[o[b].type]({stepData:o[b],appearance:d})};return Ye.createElement(Gd,{type:s,styleOverrides:i,className:l,appearance:d},Ye.createElement(Yn,{style:{flex:1}},Ye.createElement(Yn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},Ye.createElement(Kd,{className:a("checklistTitle",d),appearance:d},e),Ye.createElement(qd,{className:a("checklistSubtitle",d),appearance:d},t),Ye.createElement(ze,{total:o.length,count:v,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Ye.createElement(Yd,{className:a("checklistStepsContainer",d)},o.map((B,L)=>Ye.createElement(Dn,{data:B,index:L,key:L,listLength:o.length,isSelected:L===b,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{x(L)},appearance:d})))),Ye.createElement(Jd,{appearance:d,className:a("checklistDivider",d)}),Ye.createElement(Xd,null,Ye.createElement(k,null)))},Vr=Qd;import j,{useState as oc}from"react";import Jn from"react";import Zd from"styled-components";var Rd=Zd.svg`
|
|
903
903
|
transition: 'transform 0.35s ease-in-out';
|
|
904
|
-
`,
|
|
904
|
+
`,io=({style:e,className:t})=>Jn.createElement(Rd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Jn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import be from"styled-components";var jr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Xn=be.div`
|
|
905
905
|
max-height: 350px;
|
|
906
906
|
padding-bottom: 40px;
|
|
907
907
|
`,Qn=be.div`
|
|
@@ -923,7 +923,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
923
923
|
padding-left: 1px;
|
|
924
924
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
925
925
|
`,es=be.div`
|
|
926
|
-
${e=>
|
|
926
|
+
${e=>E(e)} {
|
|
927
927
|
border: 1px solid #fafafa;
|
|
928
928
|
}
|
|
929
929
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
@@ -937,7 +937,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
937
937
|
flex-direction: row;
|
|
938
938
|
justify-content: space-between;
|
|
939
939
|
`,os=be.p`
|
|
940
|
-
${e=>
|
|
940
|
+
${e=>E(e)} {
|
|
941
941
|
font-weight: 400;
|
|
942
942
|
font-size: 10px;
|
|
943
943
|
line-height: 12px;
|
|
@@ -951,7 +951,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
951
951
|
`,is=be.div`
|
|
952
952
|
flex: 1;
|
|
953
953
|
`,ns=be.div`
|
|
954
|
-
${e=>
|
|
954
|
+
${e=>E(e)} {
|
|
955
955
|
display: flex;
|
|
956
956
|
justify-content: center;
|
|
957
957
|
align-content: center;
|
|
@@ -961,7 +961,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
961
961
|
padding-right: 8px;
|
|
962
962
|
}
|
|
963
963
|
`,ss=be.p`
|
|
964
|
-
${e=>
|
|
964
|
+
${e=>E(e)} {
|
|
965
965
|
font-style: normal;
|
|
966
966
|
font-weight: 600;
|
|
967
967
|
font-size: 22px;
|
|
@@ -973,7 +973,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
973
973
|
margin-bottom: 16px;
|
|
974
974
|
}
|
|
975
975
|
`,ls=be.p`
|
|
976
|
-
${e=>
|
|
976
|
+
${e=>E(e)} {
|
|
977
977
|
font-weight: 400;
|
|
978
978
|
font-size: 14px;
|
|
979
979
|
line-height: 18px;
|
|
@@ -982,14 +982,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
982
982
|
margin-bottom: 8px;
|
|
983
983
|
}
|
|
984
984
|
`,as=be.div`
|
|
985
|
-
${e=>
|
|
985
|
+
${e=>E(e)} {
|
|
986
986
|
display: flex;
|
|
987
987
|
flex-direction: row;
|
|
988
988
|
justify-content: center;
|
|
989
989
|
gap: 8px;
|
|
990
990
|
}
|
|
991
991
|
`,ps=be.div`
|
|
992
|
-
${e=>
|
|
992
|
+
${e=>E(e)} {
|
|
993
993
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
994
994
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
995
995
|
:hover {
|
|
@@ -1009,7 +1009,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1009
1009
|
position: relative;
|
|
1010
1010
|
cursor: pointer;
|
|
1011
1011
|
`,ds=be.p`
|
|
1012
|
-
${e=>
|
|
1012
|
+
${e=>E(e)} {
|
|
1013
1013
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1014
1014
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
1015
1015
|
}
|
|
@@ -1052,7 +1052,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1052
1052
|
overflow: hidden;
|
|
1053
1053
|
row-gap: 10px;
|
|
1054
1054
|
`,xs=mt.div`
|
|
1055
|
-
${e=>
|
|
1055
|
+
${e=>E(e)} {
|
|
1056
1056
|
color: #595959;
|
|
1057
1057
|
}
|
|
1058
1058
|
text-transform: uppercase;
|
|
@@ -1062,7 +1062,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1062
1062
|
letter-spacing: 0.09em;
|
|
1063
1063
|
margin-bottom: 12px;
|
|
1064
1064
|
`,Cs=mt.div`
|
|
1065
|
-
${e=>
|
|
1065
|
+
${e=>E(e)} {
|
|
1066
1066
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1067
1067
|
background: #ffffff;
|
|
1068
1068
|
border: 1px solid #fafafa;
|
|
@@ -1075,7 +1075,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1075
1075
|
max-width: 150px;
|
|
1076
1076
|
min-width: 200px;
|
|
1077
1077
|
`,ys=mt.div`
|
|
1078
|
-
${e=>
|
|
1078
|
+
${e=>E(e)} {
|
|
1079
1079
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1080
1080
|
}
|
|
1081
1081
|
width: 40px;
|
|
@@ -1093,7 +1093,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1093
1093
|
width: 20px;
|
|
1094
1094
|
height: 20px;
|
|
1095
1095
|
`,bs=mt.div`
|
|
1096
|
-
${e=>
|
|
1096
|
+
${e=>E(e)} {
|
|
1097
1097
|
color: #434343;
|
|
1098
1098
|
}
|
|
1099
1099
|
font-weight: 600;
|
|
@@ -1102,7 +1102,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1102
1102
|
margin-top: 12px;
|
|
1103
1103
|
margin-bottom: 8px;
|
|
1104
1104
|
`,ws=mt.div`
|
|
1105
|
-
${e=>
|
|
1105
|
+
${e=>E(e)} {
|
|
1106
1106
|
color: #8c8c8c;
|
|
1107
1107
|
}
|
|
1108
1108
|
font-weight: 400;
|
|
@@ -1114,7 +1114,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1114
1114
|
line-height: 14px;
|
|
1115
1115
|
font-weight: 400;
|
|
1116
1116
|
cursor: pointer;
|
|
1117
|
-
`;var tc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:
|
|
1117
|
+
`;var tc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:l}=me();return ut.createElement(gs,{style:t,className:a("guideContainer",n)},ut.createElement(xs,{className:a("guideTitle",n)},o),ut.createElement(hs,{className:a("guideItemContainer",n)},e.map((p,d)=>{var s;return ut.createElement(Cs,{key:`guide-${(s=p.id)!=null?s:d}`,className:a("guideItem",n)},p.icon&&ut.createElement(ys,{className:a("guideIcon",n)},ut.createElement(Ss,null,p.icon)),ut.createElement(bs,{className:a("guideItemTitle",n),dangerouslySetInnerHTML:de(p.title)}),ut.createElement(ws,{className:a("guideItemSubtitle",n),dangerouslySetInnerHTML:de(p.subtitle)}),ut.createElement(Ts,{className:a("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&l(p),r&&r(p)}},p.primaryButtonTitle))})))},Eo=tc;var rc=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:l,setSelectedStep:p,customStepTypes:d,appearance:s,guideData:m,guideTitle:c,onGuideButtonClick:f})=>{let S=({stepData:u,handleSecondaryCTAClick:N,handleCTAClick:F})=>u?j.createElement(ns,{className:a("checklistStepContainer",s),"data-testid":"checklistStepContainer"},j.createElement(ss,{appearance:s,className:a("checklistStepTitle",s),dangerouslySetInnerHTML:de(u.title)}),j.createElement(ls,{appearance:s,className:a("checklistStepSubtitle",s),dangerouslySetInnerHTML:de(u.subtitle)}),j.createElement(as,{className:a("checklistCTAContainer",s)},u.secondaryButtonTitle&&j.createElement(re,{title:u.secondaryButtonTitle,onClick:N,appearance:s,secondary:!0}),j.createElement(re,{title:u.primaryButtonTitle,onClick:F,appearance:s}))):j.createElement(j.Fragment,null),b=T(T({},{default:u=>{var I;if((I=e[k])!=null&&I.StepContent){let O=e[k].StepContent;return j.createElement("div",null,O)}let N=e[k];return j.createElement(S,{stepData:u,handleCTAClick:()=>{N.handlePrimaryButtonClick&&N.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{N.handleSecondaryButtonClick&&N.handleSecondaryButtonClick()}})}}),d),[x,v]=oc(0),k=l!=null?l:x,B=p!=null?p:v,L=()=>{var u;return e?!((u=e[k])!=null&&u.type)||!b[e[k].type]?b.default(e[k]):typeof b[e[k].type]!="function"?b[e[k].type]:b[e[k].type]({stepData:e[k],primaryColor:s.theme.colorPrimary}):j.createElement(j.Fragment,null)},C=e.filter(u=>u.complete).length;return n?(s.theme.modalContainer||(s.theme.borderRadius&&(jr.borderRadius=s.theme.borderRadius+"px"),s.theme.modalContainer=jr),j.createElement(Ze,{onClose:r,visible:n,appearance:s},j.createElement(us,null,j.createElement(Qn,null,j.createElement(Zn,{appearance:s,className:a("checklistTitle",s)},t),j.createElement(Rn,{appearance:s,className:a("checklistSubtitle",s)},o)),j.createElement(Xn,null,e&&e.length>0&&j.createElement(es,{className:a("stepsContainer",s)},j.createElement(ts,null,j.createElement("div",{style:{flex:3}},j.createElement(os,{className:a("stepsTitle",s)},i)),j.createElement(ms,null,j.createElement(ze,{style:{width:"100%"},count:C,total:e.length,appearance:s}))),j.createElement(rs,null,j.createElement(is,{className:a("checklistStepListContainer",s),appearance:s},e.map((u,N)=>{var P;let F=k===N;return j.createElement(ps,{selected:F,className:a(`checklistStepListItem${F?"Selected":""}`,s),key:`checklist-guide-step-${(P=u.id)!=null?P:N}`,disabled:u.blocked,onClick:()=>{u.blocked||B(N)},title:u.blocked?"Finish remaining steps to continue":void 0},F&&j.createElement(or,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklist-step-selected",style:{backgroundColor:s.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),j.createElement(ds,{selected:F,className:a(`checklistStepListStepName${F?"Selected":""}`,s)},u.stepName),j.createElement(cs,null,j.createElement(pt,{value:u.complete,type:"round",primaryColor:s.theme.colorPrimary,progress:u.progress,appearance:s}),j.createElement(fs,null,j.createElement(io,{style:{marginLeft:"10px"},color:s.theme.colorBackgroundSecondary}))))})),j.createElement(L,null))),m&&m.length>0&&j.createElement(Eo,{steps:m,title:c,primaryColor:s.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:s,onButtonClick:u=>(f&&f(u),!0)}))))):j.createElement(j.Fragment,null)},Gr=rc;import Me,{useEffect as ar,useState as ic}from"react";import Fe from"react";import ft from"styled-components";var Fs=ft.div`
|
|
1118
1118
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1119
1119
|
border: 1px solid;
|
|
1120
1120
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1160,12 +1160,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1160
1160
|
font-weight: 400;
|
|
1161
1161
|
font-size: 14px;
|
|
1162
1162
|
line-height: 22px;
|
|
1163
|
-
`,
|
|
1163
|
+
`,Os=ft.div`
|
|
1164
1164
|
display: flex;
|
|
1165
1165
|
flex-direction: row;
|
|
1166
1166
|
justify-content: flex-start;
|
|
1167
1167
|
align-items: center;
|
|
1168
|
-
`;var
|
|
1168
|
+
`;var Ns=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:l})=>{var c,f;let p=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.35s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.7s ease-out"};function s(){var S;return Fe.createElement(Fe.Fragment,null,e.imageUri||e.videoUri?Fe.createElement(ks,{className:a("stepMediaContainer",r)},e.imageUri?Fe.createElement(Ps,{className:a("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Fe.createElement(et,{appearance:r,videoUri:e.videoUri}):null):null,Fe.createElement(As,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:de(e.subtitle)}),Fe.createElement(qo,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?Fe.createElement(re,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,Fe.createElement(re,{title:(S=e.primaryButtonTitle)!=null?S:"Continue",onClick:()=>i(),appearance:r})))}function m(){if(!l)return null;let S=l[e.type];return S?typeof S!="function"?S:S(e,r):null}return Fe.createElement(Fs,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},Fe.createElement(vs,{className:a("stepHeader",r)},Fe.createElement(Os,null,Fe.createElement(tr,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),Fe.createElement(Bs,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:de(e.title),onClick:()=>o()})),Fe.createElement(Es,{className:a("stepChevronContainer",r),onClick:()=>o(),appearance:r},Fe.createElement(io,{style:V(T({},p),{transition:"transform 0.2s ease-in-out"})}))),Fe.createElement("div",{key:e.id,style:T({},d)},(f=m())!=null?f:s()))};import no from"styled-components";var k0=no.div`
|
|
1169
1169
|
background: #ffffff;
|
|
1170
1170
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1171
1171
|
border-radius: 6px;
|
|
@@ -1179,26 +1179,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1179
1179
|
|
|
1180
1180
|
max-width: 800px;
|
|
1181
1181
|
min-width: 350px;
|
|
1182
|
-
`,Is=
|
|
1182
|
+
`,Is=no.div`
|
|
1183
1183
|
display: flex;
|
|
1184
1184
|
flex-direction: column;
|
|
1185
|
-
`,Ls=
|
|
1185
|
+
`,Ls=no.h1`
|
|
1186
1186
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1187
1187
|
font-style: normal;
|
|
1188
1188
|
font-weight: 700;
|
|
1189
1189
|
font-size: 20px;
|
|
1190
1190
|
line-height: 24px;
|
|
1191
1191
|
margin-bottom: 8px;
|
|
1192
|
-
`,$s=
|
|
1192
|
+
`,$s=no.h2`
|
|
1193
1193
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1194
1194
|
font-weight: 400;
|
|
1195
1195
|
font-size: 14px;
|
|
1196
1196
|
line-height: 23px;
|
|
1197
1197
|
margin: 2px 0 0 0;
|
|
1198
|
-
`,Ms=
|
|
1198
|
+
`,Ms=no.div`
|
|
1199
1199
|
display: block;
|
|
1200
1200
|
width: 100%;
|
|
1201
|
-
`,Ds=
|
|
1201
|
+
`,Ds=no.div`
|
|
1202
1202
|
display: flex;
|
|
1203
1203
|
width: 100%;
|
|
1204
1204
|
flex-direction: column;
|
|
@@ -1206,23 +1206,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1206
1206
|
padding: 24px;
|
|
1207
1207
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1208
1208
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1209
|
-
`;var nc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:
|
|
1209
|
+
`;var nc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:l=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:s,appearance:m,type:c,className:f,customStepTypes:S,style:w})=>{let b=o.filter(C=>C.complete).length,[x,v]=ic(Array(o.length).fill(!0));ar(()=>{let C=[...x];if(r){for(let u=0;u<o.length;u++)if(!o[u].complete){C[u]=!1;break}v(C)}},[]),ar(()=>{r&&k(d)},[d]),ar(()=>{p&&x[d]&&k(d)},[d]),ar(()=>{},[o]);let k=C=>{let u=[...x];if(l)for(let N=0;N<x.length;++N)N!=C&&u[C]&&(u[N]=!0);u[C]=!x[C],v(u)};if(!n&&c=="modal")return Me.createElement(Me.Fragment,null);let B=Me.createElement(Me.Fragment,null,Me.createElement(Is,null,Me.createElement(Ls,{appearance:m,className:a("checklistTitle",m),dangerouslySetInnerHTML:de(e)}),Me.createElement($s,{appearance:m,className:a("checklistSubtitle",m),dangerouslySetInnerHTML:de(t)})),Me.createElement(ze,{display:"percent",count:b,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),L=Me.createElement(Ms,{className:Te(a("checklistContainer",m),f)},o.map((C,u)=>{var F;let N=x[u];return Me.createElement(Ns,{appearance:m,stepData:C,collapsed:N,key:`modal-checklist-${(F=C.id)!=null?F:u}`,onClick:()=>{d==u?k(u):s(u)},onPrimaryButtonClick:()=>{p&&u<o.length-1&&s(u+1),C.handlePrimaryButtonClick&&C.handlePrimaryButtonClick()},onSecondaryButtonClick:()=>{C.handleSecondaryButtonClick&&C.handleSecondaryButtonClick()},customStepTypes:S})}));return c==="inline"?Me.createElement(Ds,{appearance:m,className:Te(a("checklistInlineContainer",m),f),style:w},B,L):Me.createElement(Me.Fragment,null,Me.createElement(Ze,{onClose:i,visible:n,appearance:m,style:{maxWidth:"600px"},headerContent:B},L))},Kr=nc;import fe,{useEffect as qr,useRef as uc,useState as Mt}from"react";import{useEffect as sc,useState as lc}from"react";var Us=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=lc(t),n=null,r=()=>{n!==null?clearTimeout(n):l(),n=setTimeout(()=>{l()},16)},l=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,s])=>{if(!window)return[d,!1];let m=window.matchMedia(s);return m.addEventListener("change",r),[d,m.matches]}));i(p)};return sc(()=>{l()},[]),o};import so from"react";import he,{css as _s,keyframes as Ws}from"styled-components";var zs=_s`
|
|
1210
1210
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1211
|
-
`,ac=
|
|
1211
|
+
`,ac=_s`
|
|
1212
1212
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
1213
|
-
`,pc=
|
|
1213
|
+
`,pc=Ws`
|
|
1214
1214
|
from {
|
|
1215
1215
|
opacity: 0;
|
|
1216
1216
|
} to {
|
|
1217
1217
|
opacity: 1;
|
|
1218
1218
|
}
|
|
1219
|
-
`,dc=
|
|
1219
|
+
`,dc=Ws`
|
|
1220
1220
|
from {
|
|
1221
1221
|
opacity: 1;
|
|
1222
1222
|
} to {
|
|
1223
1223
|
opacity: 0;
|
|
1224
1224
|
}
|
|
1225
|
-
`,Hs=
|
|
1225
|
+
`,Hs=he.div`
|
|
1226
1226
|
margin: 0 -20px;
|
|
1227
1227
|
overflow-x: auto;
|
|
1228
1228
|
padding-left: 20px;
|
|
@@ -1239,13 +1239,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1239
1239
|
::-webkit-scrollbar {
|
|
1240
1240
|
display: none;
|
|
1241
1241
|
}
|
|
1242
|
-
`,Vs=
|
|
1242
|
+
`,Vs=he.div`
|
|
1243
1243
|
display: flex;
|
|
1244
1244
|
flex-flow: row nowrap;
|
|
1245
1245
|
gap: 0 16px;
|
|
1246
1246
|
scroll-snap-align: center;
|
|
1247
1247
|
scroll-snap-stop: always;
|
|
1248
|
-
`,js=
|
|
1248
|
+
`,js=he.div`
|
|
1249
1249
|
animation: ${e=>e.reversed?dc:pc} 0.25s ease-out;
|
|
1250
1250
|
background: linear-gradient(
|
|
1251
1251
|
to right,
|
|
@@ -1255,8 +1255,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1255
1255
|
position: absolute;
|
|
1256
1256
|
width: 64px;
|
|
1257
1257
|
z-index: 10;
|
|
1258
|
-
`,Gs=
|
|
1259
|
-
${
|
|
1258
|
+
`,Gs=he.button`
|
|
1259
|
+
${zs}
|
|
1260
1260
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1261
1261
|
align-items: center;
|
|
1262
1262
|
border-radius: 50%;
|
|
@@ -1267,11 +1267,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1267
1267
|
justify-content: center;
|
|
1268
1268
|
position: absolute;
|
|
1269
1269
|
width: 48px;
|
|
1270
|
-
`,Ks=
|
|
1270
|
+
`,Ks=he.div`
|
|
1271
1271
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1272
1272
|
padding: 20px;
|
|
1273
|
-
`,qs=
|
|
1274
|
-
${
|
|
1273
|
+
`,qs=he(Ks)`
|
|
1274
|
+
${zs}
|
|
1275
1275
|
background: ${({theme:e})=>e.colorBackground};
|
|
1276
1276
|
position: relative;
|
|
1277
1277
|
|
|
@@ -1283,72 +1283,72 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1283
1283
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1284
1284
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1285
1285
|
}
|
|
1286
|
-
`,Ys=
|
|
1286
|
+
`,Ys=he.img`
|
|
1287
1287
|
border-radius: 50%;
|
|
1288
1288
|
height: 40px;
|
|
1289
1289
|
margin-bottom: 12px;
|
|
1290
1290
|
width: 40px;
|
|
1291
|
-
`,Js=
|
|
1292
|
-
${e=>
|
|
1291
|
+
`,Js=he(Ks)`
|
|
1292
|
+
${e=>E(e)} {
|
|
1293
1293
|
${ac}
|
|
1294
1294
|
|
|
1295
1295
|
background: ${({theme:e})=>e.colorBackground};
|
|
1296
1296
|
}
|
|
1297
|
-
`,H0=
|
|
1297
|
+
`,H0=he.div`
|
|
1298
1298
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1299
1299
|
display: flex;
|
|
1300
1300
|
flex-flow: row nowrap;
|
|
1301
1301
|
align-items: center;
|
|
1302
|
-
`,V0=
|
|
1302
|
+
`,V0=he.div`
|
|
1303
1303
|
white-space: nowrap;
|
|
1304
|
-
`,Xs=
|
|
1304
|
+
`,Xs=he.div`
|
|
1305
1305
|
background: #d8fed8;
|
|
1306
1306
|
border-radius: 6px;
|
|
1307
1307
|
float: right;
|
|
1308
1308
|
margin-bottom: 12px;
|
|
1309
1309
|
padding: 4px 10px;
|
|
1310
|
-
`,cc=
|
|
1310
|
+
`,cc=he.p`
|
|
1311
1311
|
font-weight: bold;
|
|
1312
1312
|
font-size: 18px;
|
|
1313
1313
|
line-height: 22px;
|
|
1314
1314
|
letter-spacing: calc(18px * -0.01);
|
|
1315
1315
|
margin: 0;
|
|
1316
|
-
`,Qs=
|
|
1316
|
+
`,Qs=he(cc)`
|
|
1317
1317
|
margin-bottom: 4px;
|
|
1318
|
-
`,Zs=
|
|
1318
|
+
`,Zs=he.div`
|
|
1319
1319
|
display: flex;
|
|
1320
1320
|
flex-flow: row nowrap;
|
|
1321
1321
|
align-items: center;
|
|
1322
1322
|
min-width: 50%;
|
|
1323
|
-
`,mc=
|
|
1323
|
+
`,mc=he.p`
|
|
1324
1324
|
font-weight: bold;
|
|
1325
1325
|
font-size: 16px;
|
|
1326
1326
|
line-height: 20px;
|
|
1327
1327
|
letter-spacing: calc(16px * -0.01);
|
|
1328
1328
|
margin: 0;
|
|
1329
|
-
`,Rs=
|
|
1329
|
+
`,Rs=he(mc)`
|
|
1330
1330
|
margin-bottom: 4px;
|
|
1331
1331
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1332
1332
|
`}
|
|
1333
|
-
`,
|
|
1333
|
+
`,wt=he.p`
|
|
1334
1334
|
color: ${({theme:e})=>e.colorText};
|
|
1335
1335
|
font-weight: normal;
|
|
1336
1336
|
font-size: 14px;
|
|
1337
1337
|
line-height: 22px;
|
|
1338
1338
|
margin: 0;
|
|
1339
|
-
`,el=
|
|
1339
|
+
`,el=he.p`
|
|
1340
1340
|
color: ${({theme:e})=>e.colorText};
|
|
1341
1341
|
font-weight: 600;
|
|
1342
1342
|
font-size: 12px;
|
|
1343
1343
|
line-height: 16px;
|
|
1344
1344
|
margin: 0;
|
|
1345
|
-
`;
|
|
1345
|
+
`;wt.Loud=he(wt)`
|
|
1346
1346
|
font-weight: 600;
|
|
1347
|
-
`;
|
|
1347
|
+
`;wt.Quiet=he(wt)`
|
|
1348
1348
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1349
1349
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1350
1350
|
`}
|
|
1351
|
-
`;var tl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=oe(),{primaryCTAClickSideEffects:n}=
|
|
1351
|
+
`;var tl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=oe(),{primaryCTAClickSideEffects:n}=me();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 so.createElement(qs,{className:a("carouselCard",o),onClick:s?null:c,style:t,blocked:s,complete:d},r&&so.createElement(Ys,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||s?.4:1}}),d&&so.createElement(Xs,{className:a("carouselCompletedPill",o)},so.createElement(el,{style:{color:"#108E0B"}},"Complete")),p&&so.createElement(Rs,{blocked:s,complete:d,className:a("carouselCardTitle",o)},p),l&&so.createElement(wt.Quiet,{blocked:s,complete:d,className:a("carouselCardSubtitle",o)},l))};var fc=()=>fe.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fe.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),fe.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),fe.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),ol=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=Mt(!1),[r,l]=Mt(!1);qr(()=>{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?fe.createElement(js,{style:d,reversed:r,onAnimationEnd:r?p:null},fe.createElement(Gs,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},fe.createElement(fc,null))):null},rl=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=uc(null),[r,l]=Mt(!1),[p,d]=Mt(!1),[s,m]=Mt(null),[c,f]=Mt([]),[S,w]=Mt(0),{isSmall:b}=Us(),x=b?1:3,{getFlowMetadata:v,getFlowSteps:k,getNumberOfStepsCompleted:B,updateCustomVariables:L,isLoading:C}=R();qr(()=>{L(o)},[o,C]),qr(()=>{if(C)return;let O=v(e),A=B(e),G=k(e);m(O),(O.data!==null||O.steps!==null)&&(f(G.sort((_,Q)=>Number(_.complete)-Number(Q.complete))),d(G.length>x),w(A))},[C]);let u=[];for(let O=0;O<c.length;O+=x)u.push(c.slice(O,O+x));let N=O=>{let A=O.target,G=A.scrollWidth-A.clientWidth,_=Math.ceil(A.scrollLeft);_>0&&r===!1&&l(!0),_===0&&r===!0&&l(!1),_<G&&p===!1&&d(!0),_===G&&p===!0&&d(!1)},F=(O=!0)=>{let A=O?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*A,behavior:"smooth"})},P=null,I=O=>{P!==null?clearTimeout(P):N(O),P=setTimeout(()=>{N(O)},16)};return C?null:fe.createElement(Js,{className:Te(a("carouselContainer",t),i)},fe.createElement("div",{style:{display:"flex",justifyContent:b?"center":"space-between",marginBottom:20,flexWrap:b?"wrap":"nowrap",gap:b?16:20}},fe.createElement("div",null,fe.createElement(Qs,{className:a("carouselTitle",t)},s==null?void 0:s.title),fe.createElement(wt.Quiet,{className:a("carouselSubtitle",t)},s==null?void 0:s.subtitle)),fe.createElement(Zs,{className:a("progressWrapper",t)},fe.createElement(ze,{count:S,total:c.length,appearance:t}))),fe.createElement("div",{style:{position:"relative"}},fe.createElement(ol,{show:r,onClick:()=>F(!1)}),fe.createElement(ol,{side:"right",show:p,onClick:F}),fe.createElement(Hs,{ref:n,onScroll:I},u.map((O,A)=>fe.createElement(Vs,{key:A,style:{flex:`0 0 calc(100% - ${c.length>x?36:0}px)`}},O.map((G,_)=>fe.createElement(tl,{key:_,stepData:G,style:{flex:c.length>x?`0 1 calc(100% / ${x} - 16px * 2 / ${x})`:1},appearance:t})))))),fe.createElement(ne,{appearance:t}))};var Yr=L=>{var C=L,{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:f,hideOnFlowCompletion:S,setVisible:w,customStepTypes:b,checklistStyle:x="default",autoExpandFirstIncompleteStep:v,autoExpandNextStep:k}=C,B=Le(C,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:u,getFlowSteps:N,markStepCompleted:F,getStepStatus:P,getNumberOfStepsCompleted:I,isLoading:O,targetingLogicShouldHideFlow:A,updateCustomVariables:G,getFlowMetadata:_,isStepBlocked:Q,getFlowStatus:Y,hasActiveFullPageFlow:se,setHasActiveFullPageFlow:J,markStepStarted:q,getCurrentStepIndex:ae}=R(),{primaryCTAClickSideEffects:we,secondaryCTAClickSideEffects:Ne}=me(),{getOpenFlowState:Z,setOpenFlowState:ce}=Ee(),[U,ee]=il(n||0),[Ie,ke]=il(!1),xe=d===void 0?Z(e):d,Ce=l==="modal",{mergeAppearanceWithDefault:H}=oe();Ge(e,d);let W=N(e),$=ae(e);if(f=H(f),pr(()=>{G(s)},[s,O]),pr(()=>{d!==void 0&&(Ce&&d===!0?J(!0):Ce&&d===!1&&J(!1))},[d,w,se]),pr(()=>{!O&&W&&W[U]&&P(e,W[U].id)&&P(e,W[U].id)!==$e&&q(e,W[U].id)},[U]),pr(()=>{U!==$&&ee($)},[$]),O)return null;let z=u(e);if(!z||A(z)||!W||S===!0&&Y(e)===te)return null;let pe=_(e);if(pe!=null&&pe.title&&(t=pe.title),pe!=null&&pe.subtitle&&(o=pe.subtitle),!Ie&&n===void 0&&I(e)>0){let h=W.findIndex(D=>D.complete===!1);ee(h>-1?h:W.length-1),ke(!0)}function je(){if(U+1>=W.length){Ce&&ce(e,!1);return}Q(e,W[U+1].id)||ee(U+1)}function it(h,D,ge){let De=U+1<W.length?W[U+1]:null;c&&c(h,U,D,De)===!0&&Ce&&Xe(),m&&m(h,ge,De),!m&&!c&&(h.primaryButtonUri||h.secondaryButtonUri)&&Ce&&Xe()}function kt(){return W.map((h,D)=>V(T({},h),{handleSecondaryButtonClick:()=>{je(),Ne(h),h.skippable===!0&&F(e,h.id,{skipped:!0}),it(h,"secondary",D)},handlePrimaryButtonClick:()=>{(!h.completionCriteria&&(h.autoMarkCompleted||h.autoMarkCompleted===void 0)||h.completionCriteria&&h.autoMarkCompleted===!0)&&(F(e,h.id),je()),it(h,"primary",D),we(h),P(e,h.id)===$e&&je()}}))}function Je(){return Se.createElement(ne,{appearance:f})}let nt={steps:kt(),title:t,subtitle:o,primaryColor:f.theme.colorPrimary,appearance:f,customStepTypes:b,type:l,className:r,autoExpandFirstIncompleteStep:v,autoExpandNextStep:k};function Xe(){ce(e,!1),p&&p(),w&&w(!1)}function Wt(){return Se.createElement(Se.Fragment,null,Se.createElement(Je,null),Se.createElement(rl,{flowId:e,appearance:f,customVariables:s,className:r}))}function zt(){return Se.createElement(Se.Fragment,null,Se.createElement(Je,null),Se.createElement(Kr,T({visible:xe,onClose:()=>{Xe()},selectedStep:U,setSelectedStep:ee,autoExpandNextStep:!0,appearance:f},nt)))}function g(){var ge;let h=B.guideFlowId,D;return h&&u(h)&&(D=N(h)),Se.createElement(Se.Fragment,null,Se.createElement(Je,null),Se.createElement(Gr,T({visible:xe,stepsTitle:pe.stepsTitle?pe.stepsTitle:"Your quick start guide",onClose:()=>{Xe()},selectedStep:U,setSelectedStep:ee,guideData:D,guideTitle:(ge=B.guideTitle)!=null?ge:"Guide",appearance:f,title:t,subtitle:o,onGuideButtonClick:De=>{it(De,"link",0)},customStepTypes:b},nt)))}function y(){let h=Se.createElement(Vr,T({flowId:e,style:i,selectedStep:U,setSelectedStep:ee,appearance:f,type:l},nt));return Ce?Se.createElement(Ze,{onClose:()=>{Xe()},visible:xe,appearance:f,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},Se.createElement(Je,null),h):Se.createElement(Se.Fragment,null,Se.createElement(Je,null),h)}switch(x){case"condensed":return zt();case"with-guide":return g();case"default":return y();case"carousel":return Wt();default:return y()}};var hc=e=>gc.createElement(Yr,T({type:"inline"},e));import Ft,{useEffect as xc}from"react";import ot from"react";import dr from"styled-components";var nl=dr.div`
|
|
1352
1352
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1353
1353
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1354
1354
|
padding: 10px 12px 10px 12px;
|
|
@@ -1360,27 +1360,27 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1360
1360
|
&:hover {
|
|
1361
1361
|
filter: brightness(.99);
|
|
1362
1362
|
}
|
|
1363
|
-
`,sl=
|
|
1363
|
+
`,sl=dr.div`
|
|
1364
1364
|
display: flex;
|
|
1365
1365
|
flex-direction: row;
|
|
1366
1366
|
justify-content: space-between;
|
|
1367
1367
|
align-items: center;
|
|
1368
1368
|
margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
|
|
1369
1369
|
flex-grow: 2;
|
|
1370
|
-
`,ll=
|
|
1370
|
+
`,ll=dr.div`
|
|
1371
1371
|
text-overflow: ellipsis;
|
|
1372
1372
|
font-weight: 600;
|
|
1373
1373
|
font-size: 14px;
|
|
1374
1374
|
line-height: 16px;
|
|
1375
1375
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1376
1376
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1377
|
-
`,al=
|
|
1377
|
+
`,al=dr.div`
|
|
1378
1378
|
width: 20px;
|
|
1379
1379
|
margin-right: 8px;
|
|
1380
1380
|
display: flex;
|
|
1381
1381
|
height: 100%;
|
|
1382
1382
|
align-items: center;
|
|
1383
|
-
`;var pl=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:
|
|
1383
|
+
`;var pl=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:l,type:p="default"})=>ot.createElement(ot.Fragment,null,ot.createElement(ne,{appearance:l}),ot.createElement(nl,{onClick:()=>i!==void 0&&i(),styleOverrides:T(T({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:Te(r!=null?r:"",a("progressBadgeContainer",l)),appearance:l},p=="condensed"&&o&&o!==0&&ot.createElement(al,{className:a("progressRingContainer",l)},ot.createElement(qt,{size:19,percentage:t/o,fillColor:l.theme.colorPrimary,bgColor:l.theme.colorBackgroundSecondary})),ot.createElement(sl,{type:p,className:a("badgeTitleContainer",l)},ot.createElement(ll,{type:p,appearance:l,className:a("badgeTitle",l)},e),i!==void 0&&ot.createElement(io,{className:a("badgeChevron",l),color:l.theme.colorPrimary})),p=="default"&&o&&o!==0&&ot.createElement(ze,{display:"compact",count:t,total:o,bgColor:l.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:l,textStyle:{color:"#818898"}})));import Tt from"react";import Ao from"styled-components";var dl=Ao.div`
|
|
1384
1384
|
display: flex;
|
|
1385
1385
|
flex-direction: row;
|
|
1386
1386
|
width: 100%;
|
|
@@ -1390,25 +1390,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1390
1390
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1391
1391
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1392
1392
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1393
|
-
`,cl=
|
|
1394
|
-
${e=>
|
|
1393
|
+
`,cl=Ao.div`
|
|
1394
|
+
${e=>E(e)} {
|
|
1395
1395
|
display: flex;
|
|
1396
1396
|
justify-content: center;
|
|
1397
1397
|
align-items: center;
|
|
1398
1398
|
margin-right: 16px;
|
|
1399
1399
|
}
|
|
1400
|
-
`,ml=
|
|
1400
|
+
`,ml=Ao.div`
|
|
1401
1401
|
display: flex;
|
|
1402
1402
|
flex-direction: column;
|
|
1403
1403
|
flex: 1;
|
|
1404
1404
|
margin-top: 0;
|
|
1405
|
-
`,ul=
|
|
1405
|
+
`,ul=Ao.div`
|
|
1406
1406
|
display: flex;
|
|
1407
1407
|
flex-direction: column;
|
|
1408
1408
|
justify-content: center;
|
|
1409
1409
|
margin-left: 16px;
|
|
1410
1410
|
min-width: 200px;
|
|
1411
|
-
`,GS=
|
|
1411
|
+
`,GS=Ao.div`
|
|
1412
1412
|
display: flex;
|
|
1413
1413
|
justify-content: center;
|
|
1414
1414
|
align-items: flex-end;
|
|
@@ -1417,7 +1417,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1417
1417
|
:hover {
|
|
1418
1418
|
opacity: 0.8;
|
|
1419
1419
|
}
|
|
1420
|
-
`;var fl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:
|
|
1420
|
+
`;var fl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:l,style:p})=>Tt.createElement(Tt.Fragment,null,Tt.createElement(dl,{appearance:i,className:Te(a("fullWidthProgressBadgeContainer",i),l!=null?l:""),style:p},o&&Tt.createElement(cl,{className:a("fullWidthProgressBadgeIcon",i)},o),Tt.createElement(ml,null,Tt.createElement(Oe,{size:"small",appearance:i,title:e,subtitle:t})),Tt.createElement(ul,{className:a("fullWidthProgressBadgeProgressContainer",i)},Tt.createElement(ze,{count:n,total:r,display:"percent",textLocation:"top"}))));var Cc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:l,customVariables:p,hideOnFlowCompletion:d,appearance:s,type:m="default"})=>{let{getFlow:c,getFlowSteps:f,getFlowStatus:S,getNumberOfStepsCompleted:w,isLoading:b,targetingLogicShouldHideFlow:x,updateCustomVariables:v}=R(),{mergeAppearanceWithDefault:k}=oe();s=k(s);let{setOpenFlowState:B,getOpenFlowState:L}=Ee();if(xc(()=>{v(p)},[p,b]),b)return null;let C=c(e);if(!C||x(C)||d===!0&&S(e)===te)return null;let u=f(e),N=w(e);return m==="full-width"?Ft.createElement(Ft.Fragment,null,Ft.createElement(ne,{appearance:s}),Ft.createElement(fl,{title:t,subtitle:o,count:N,total:u.length,style:n,className:l,appearance:s,icon:i,onClick:()=>{}})):Ft.createElement(Ft.Fragment,null,Ft.createElement(ne,{appearance:s}),Ft.createElement(pl,{count:N,total:u.length,title:t,style:n,onClick:()=>{B(e,!0),r&&r()},type:m,className:l,appearance:s}))};import yc from"react";var Sc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Le(r,["flowId","style","appearance"]);let{getFlow:l,targetingLogicShouldHideFlow:p,getFlowSteps:d}=R(),{mergeAppearanceWithDefault:s}=oe();o=s(o);let m=l(e);if(!m||p(m))return null;let c=d(e);return yc.createElement(Eo,T({steps:c,style:t,appearance:o},i))};import Dt,{useContext as Ic,useEffect as Lc}from"react";import K,{useEffect as Oo,useLayoutEffect as xl,useRef as Pc,useState as lo}from"react";import No from"styled-components";import{useCallback as bc,useEffect as wc,useState as Tc}from"react";var Jr=(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 gl(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,n]=Tc(o),r=bc(()=>{e&&n(e.getBoundingClientRect())},[e]);return wc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as Fc,useState as kc}from"react";function hl(){let{debug:e}=Fc(X),[t,o]=kc([]);function i(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.log(r)))}function n(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:i,logErrorIfDebugMode:n}}var Cl=300,yl=100,vc=500,ao=12,Bc=No.div`
|
|
1421
1421
|
width: 100%;
|
|
1422
1422
|
height: 100%;
|
|
1423
1423
|
border-radius: 9999px;
|
|
@@ -1441,8 +1441,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1441
1441
|
}
|
|
1442
1442
|
}
|
|
1443
1443
|
`,Ec=No.div`
|
|
1444
|
-
width: ${
|
|
1445
|
-
height: ${
|
|
1444
|
+
width: ${ao}px;
|
|
1445
|
+
height: ${ao}px;
|
|
1446
1446
|
border-radius: 100px;
|
|
1447
1447
|
background-color: ${e=>e.primaryColor};
|
|
1448
1448
|
z-index: 20;
|
|
@@ -1455,11 +1455,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1455
1455
|
justify-content: center;
|
|
1456
1456
|
align-items: center;
|
|
1457
1457
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1458
|
-
`,
|
|
1459
|
-
width: ${
|
|
1460
|
-
height: ${
|
|
1461
|
-
`,
|
|
1462
|
-
${e=>
|
|
1458
|
+
`,Oc=No(Sl)`
|
|
1459
|
+
width: ${ao+12}px;
|
|
1460
|
+
height: ${ao+12}px;
|
|
1461
|
+
`,Nc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:l={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:s=0,customStepTypes:m,appearance:c,dismissible:f=!1,showHighlightOnly:S,showStepCount:w=!0,completedStepsCount:b=0,showFrigadeBranding:x=!1,cssPosition:v="absolute",onViewTooltip:k,className:B})=>{var kt,Je,nt,Xe,Wt,zt,g,y,h,D,ge,De,ht,Pt,ue,co,mo,ii,ni;let{logErrorIfDebugMode:L}=hl(),[C,u]=lo(),[N,F]=lo(new Date),P=Pc(null),[I,O]=lo(document.querySelector(e[s].selector)),A=gl(I,N),[G,_]=lo(),[Q,Y]=lo(!S),se=(Je=(kt=e[s])==null?void 0:kt.props)!=null&&Je.position?e[s].props.position:v,J=(Wt=(Xe=(nt=e[s])==null?void 0:nt.props)==null?void 0:Xe.zIndex)!=null?Wt:90,q=(zt=C==null?void 0:C.width)!=null?zt:Cl,ae=(g=C==null?void 0:C.height)!=null?g:yl,[we,Ne]=lo(new Date().getTime());l=(D=(h=(y=e[s])==null?void 0:y.props)==null?void 0:h.offset)!=null?D:l;let Z=window.location.pathname.split("/").pop();xl(()=>{P.current&&u({width:P.current.clientWidth,height:P.current.clientHeight})},[s,N,se]),Oo(()=>{S||Y(!0)},[s]),Oo(()=>{p&&Q&&k(s)},[Q]);let ce=()=>{let le=document.querySelector(e[s].selector);if(!le){_(void 0),O(null),L(`FrigadeTour: Could not find element with selector "${e[s].selector}" for step ${e[s].id}`);return}G&&G===JSON.stringify(le==null?void 0:le.getBoundingClientRect())||(O(le),F(new Date),le&&_(JSON.stringify(le.getBoundingClientRect())))};if(Oo(()=>{let le=new MutationObserver(ce);return le.observe(document.body,{subtree:!0,childList:!0}),()=>le.disconnect()},[ce]),Oo(()=>{let le=new MutationObserver(ce);return le.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>le.disconnect()},[ce]),Oo(()=>{let le=setInterval(()=>{ce()},10);return()=>clearInterval(le)},[ce]),xl(()=>{setTimeout(()=>{ce()},vc),ce()},[s,Z]),I===null||!p)return null;let U=i==="auto"?"right":i,ee=Jr(A,U,q,l,se),Ie=A.right+q>(window.innerWidth||document.documentElement.clientWidth),ke=A.bottom+yl>(window.innerHeight||document.documentElement.clientHeight);Ie&&i==="auto"&&(ee=Jr(A,"left",q,l,se),U="left"),(De=(ge=e[s])==null?void 0:ge.props)!=null&&De.tooltipPosition&&((Pt=(ht=e[s])==null?void 0:ht.props)==null?void 0:Pt.tooltipPosition)!=="auto"&&(((co=(ue=e[s])==null?void 0:ue.props)==null?void 0:co.tooltipPosition)==="left"||((ii=(mo=e[s])==null?void 0:mo.props)==null?void 0:ii.tooltipPosition)==="right")&&(U=e[s].props.tooltipPosition);let xe=()=>{let le=()=>{if(e[s].handlePrimaryButtonClick&&(e[s].handlePrimaryButtonClick(),Y(!1),setTimeout(()=>{ce()},30)),b===e.length-1)return o()},xt=()=>{e[s].handleSecondaryButtonClick&&(e[s].handleSecondaryButtonClick(),S&&!e[s].secondaryButtonUri&&Y(!1))};return K.createElement(K.Fragment,null,w&&e.length>1&&K.createElement(wi,null,K.createElement(Fi,{role:"status",className:a("tooltipStepCounter",c)},s+1," of ",e.length)),(e[s].primaryButtonTitle||e[s].secondaryButtonTitle)&&K.createElement(Ti,{showStepCount:w,className:a("tooltipCTAContainer",c)},e[s].secondaryButtonTitle&&K.createElement(re,{title:e[s].secondaryButtonTitle,appearance:c,onClick:xt,size:"small",withMargin:!1,secondary:!0}),e[s].primaryButtonTitle&&K.createElement(re,{title:e[s].primaryButtonTitle,appearance:c,onClick:le,withMargin:!1,size:"small"})))},Ce=()=>K.createElement(K.Fragment,null,f&&K.createElement(xi,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[s].imageUri||!!e[s].videoUri},K.createElement(Ae,null)),e[s].imageUri&&K.createElement(Ci,{dismissible:f,appearance:c,role:"img","aria-label":e[s].title,src:e[s].imageUri,className:a("tooltipImageContainer",c)}),e[s].videoUri&&!e[s].imageUri&&K.createElement(yi,{dismissible:f,appearance:c,role:"video","aria-label":e[s].title,className:a("tooltipVideoContainer",c)},K.createElement(et,{appearance:c,videoUri:e[s].videoUri})),K.createElement(bi,{className:a("tooltipContentContainer",c)},K.createElement(Oe,{appearance:c,title:e[s].title,subtitle:e[s].subtitle,size:"small",ariaPrefix:`Tooltip${e[s].id}`}),K.createElement(Si,{className:a("tooltipFooter",c)},K.createElement(xe,null)))),W=T(T({},{default:le=>{var xt;if((xt=e[s])!=null&&xt.StepContent){let ia=e[s].StepContent;return K.createElement("div",null,ia)}return K.createElement(Ce,null)}}),m),$=()=>{var le;return e?!((le=e[s])!=null&&le.type)||!W[e[s].type]?W.default(e[s]):W[e[s].type]({stepData:e[s],primaryColor:r}):K.createElement(K.Fragment,null)};if(e[s].complete===!0||ee.x==0&&ee.y==0&&new Date().getTime()-we<100)return null;let z={top:(ee==null?void 0:ee.y)-ao,left:(ni=U=="left"?A.x+l.x:(ee==null?void 0:ee.x)-ao)!=null?ni:0,cursor:S?"pointer":"default",position:se},pe=()=>{let xt=z.left+(U=="left"?-q:24);return Math.min(Math.max(xt,20),window.innerWidth-q-20)},je=()=>{if(se==="fixed")return z.top;let le=z.top+ae,xt=20;return le>window.innerHeight-xt?z.top+-ae:z.top},it=()=>{S&&(F(new Date),Y(!Q))};return K.createElement(Ac,{className:B},K.createElement(Oc,{style:z,zIndex:J,className:a("tourHighlightContainer",c)},n&&e[s].showHighlight!==!1&&v!=="static"&&K.createElement(K.Fragment,null,K.createElement(Ec,{style:{position:se},onClick:it,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),K.createElement(Bc,{style:{position:"absolute"},onClick:it,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),K.createElement(Sl,{style:V(T({},z),{left:pe(),top:je()}),zIndex:J+1,className:a("tooltipContainerWrapper",c)},Q&&K.createElement(K.Fragment,null,K.createElement(Do,{ref:P,role:"dialog","aria-labelledby":`frigadeTooltip${e[s].id}Title`,"aria-describedby":`frigadeTooltip${e[s].id}Subtitle`,layoutId:"tooltip-container",tabIndex:0,style:T({position:"relative",width:"max-content",right:0,top:v!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:Cl,zIndex:J+10},K.createElement($,null)),x&&K.createElement(Pi,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:J+10},K.createElement(Uo,{appearance:c})))))},Xr=Nc;import{Portal as $c}from"react-portal";var Mc=x=>{var v=x,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:l,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:s=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:f=!1,cssPosition:S="absolute",className:w}=v,b=Le(v,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition","className"]);let{getFlow:k,getFlowSteps:B,isLoading:L,targetingLogicShouldHideFlow:C,markStepCompleted:u,markStepStarted:N,markFlowCompleted:F,updateCustomVariables:P,getCurrentStepIndex:I,getStepStatus:O,isStepBlocked:A,getFlowStatus:G,getNumberOfStepsCompleted:_}=R(),{isLoadingUserFlowStateData:Q}=_e(),{primaryCTAClickSideEffects:Y,secondaryCTAClickSideEffects:se}=me(),{hasOpenModals:J}=Ee(),q=I(e),{openFlowStates:ae}=Ic(X),{mergeAppearanceWithDefault:we}=oe();if(o=we(o),Lc(()=>{P(t)},[t,L]),Q)return null;let Ne=k(e);if(!Ne||C(Ne)||G(e)==te||J())return null;let Z=B(e);if(Object.keys(ae).length>0){let $=Object.keys(ae).find(z=>ae[z]===!0);if($!==void 0&&$!==e)return Dt.createElement(Dt.Fragment,null)}function ce($){return M(this,null,function*(){if(yield u(e,$.id),Z.map(z=>O(e,z.id)).every(z=>z===$e)){yield F(e);return}!s&&q+1<Z.length&&!r&&A(e,Z[q+1].id)})}function U($,z,pe){let je=q+1<Z.length?Z[q+1]:null;n&&n($,q,z,je),i&&i($,pe,je)}function ee(){return Z.map($=>V(T({},$),{handleSecondaryButtonClick:()=>M(this,null,function*(){se($),$.skippable===!0&&(yield u(e,$.id,{skipped:!0})),U($,"secondary",q)}),handlePrimaryButtonClick:()=>M(this,null,function*(){(!$.completionCriteria&&($.autoMarkCompleted||$.autoMarkCompleted===void 0)||$.completionCriteria&&$.autoMarkCompleted===!0)&&(yield ce($)),U($,"primary",q),Y($)})}))}function Ie($){return M(this,null,function*(){l&&l(),m==="complete-flow"?yield F(e):yield u(e,$.id)})}function ke(){c&&c()}function xe($){return M(this,null,function*(){yield N(e,Z[$].id)})}let Ce=!document.querySelector(Z[q].selector);function H(){let $=Z.findIndex(z=>!!document.querySelector(z.selector));return Z.map((z,pe)=>Ce&&!r&&pe!==$&&f||!r&&pe!==q?null:Dt.createElement(Xr,T({key:z.id,appearance:o,steps:ee(),selectedStep:pe,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Ie(z),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:_(e),onComplete:ke,cssPosition:S,onViewTooltip:xe,className:w},b)))}function W(){return Dt.createElement(Dt.Fragment,null,Dt.createElement(ne,{appearance:o}),H())}return S==="static"?W():Dt.createElement($c,null,W())};import Ve,{useEffect as Dc,useRef as Uc,useState as _c}from"react";import{Portal as Wc}from"react-portal";import Ut from"styled-components";var bl=Ut.button`
|
|
1462
|
+
${e=>E(e)} {
|
|
1463
1463
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1464
1464
|
|
|
1465
1465
|
display: flex;
|
|
@@ -1476,17 +1476,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1476
1476
|
opacity: 0.8;
|
|
1477
1477
|
}
|
|
1478
1478
|
}
|
|
1479
|
-
`,wl=
|
|
1480
|
-
${e=>
|
|
1479
|
+
`,wl=Ut.span`
|
|
1480
|
+
${e=>E(e)} {
|
|
1481
1481
|
font-size: 12px;
|
|
1482
1482
|
display: inline-block;
|
|
1483
1483
|
}
|
|
1484
|
-
`,Tl=
|
|
1485
|
-
${e=>
|
|
1484
|
+
`,Tl=Ut.span`
|
|
1485
|
+
${e=>E(e)} {
|
|
1486
1486
|
font-size: 12px;
|
|
1487
1487
|
display: inline-block;
|
|
1488
1488
|
}
|
|
1489
|
-
`,Fl=
|
|
1489
|
+
`,Fl=Ut.div`
|
|
1490
1490
|
position: fixed;
|
|
1491
1491
|
right: 0;
|
|
1492
1492
|
bottom: 0;
|
|
@@ -1496,8 +1496,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1496
1496
|
flex-direction: column;
|
|
1497
1497
|
align-items: flex-end;
|
|
1498
1498
|
z-index: 50;
|
|
1499
|
-
`,kl=
|
|
1500
|
-
${e=>
|
|
1499
|
+
`,kl=Ut.button`
|
|
1500
|
+
${e=>E(e)} {
|
|
1501
1501
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1502
1502
|
background-color: #ffffff;
|
|
1503
1503
|
border: 1px solid #f5f5f5;
|
|
@@ -1512,8 +1512,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1512
1512
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1513
1513
|
border-radius: 45px;
|
|
1514
1514
|
cursor: pointer;
|
|
1515
|
-
`,Pl=
|
|
1516
|
-
${e=>
|
|
1515
|
+
`,Pl=Ut.div`
|
|
1516
|
+
${e=>E(e)} {
|
|
1517
1517
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1518
1518
|
background: #ffffff;
|
|
1519
1519
|
}
|
|
@@ -1529,8 +1529,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1529
1529
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1530
1530
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1531
1531
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1532
|
-
`,vl=
|
|
1533
|
-
${e=>
|
|
1532
|
+
`,vl=Ut.button`
|
|
1533
|
+
${e=>E(e)} {
|
|
1534
1534
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1535
1535
|
color: #434343;
|
|
1536
1536
|
:hover {
|
|
@@ -1546,8 +1546,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1546
1546
|
font-size: 14px;
|
|
1547
1547
|
|
|
1548
1548
|
padding: 8px 12px;
|
|
1549
|
-
`;import Bl from"react";var El=({style:e,className:t})=>Bl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Bl.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 Al from"react";var
|
|
1550
|
-
${e=>
|
|
1549
|
+
`;import Bl from"react";var El=({style:e,className:t})=>Bl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Bl.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 Al from"react";var Ol=({style:e,className:t})=>Al.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"},Al.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:f,targetingLogicShouldHideFlow:S}=R(),{primaryCTAClickSideEffects:w}=me(),b=Uc(null),[x,v]=_c(!1),{mergeAppearanceWithDefault:k}=oe();l=k(l),Dc(()=>(document.addEventListener("click",B,!1),()=>{document.removeEventListener("click",B,!1)}),[]);let B=F=>{b.current&&!b.current.contains(F.target)&&v(!1)};if(f)return null;let L=p(e);if(!L||S(L))return null;let C=d(e);if(!C||!i)return null;function u(F,P){!F.completionCriteria&&(F.autoMarkCompleted||F.autoMarkCompleted===void 0)&&s(e,F.id),w(F),o&&o(F,P),v(!1)}function N(){return x&&Ve.createElement(Pl,{className:a("floatingWidgetMenu",l),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},C.map((F,P)=>Ve.createElement(vl,{className:a("floatingWidgetMenuItem",l),key:P,onClick:()=>u(F,P)},F.title)))}return n=="inline"?Ve.createElement("span",{ref:b},Ve.createElement(bl,{style:t,onClick:()=>{v(!x)},className:a("supportButton",l)},Ve.createElement(Tl,{className:a("supportIconContainer",l)},Ve.createElement(Ol,{className:a("supportIcon",l),style:{width:"18px",height:"18px"}})),Ve.createElement(wl,{className:a("supportButtonTitle",l)},r)),Ve.createElement(N,null)):Ve.createElement(Wc,null,Ve.createElement(Fl,{style:t,ref:b},Ve.createElement(N,null),Ve.createElement(kl,{onClick:()=>{v(!x)},whileHover:{scale:1.1},className:a("floatingWidgetButton",l)},Ve.createElement(El,{className:a("floatingWidgetButtonIcon",l),style:{display:"flex",width:"20px",height:"20px"}}))))};import rt,{useEffect as Hc}from"react";import cr from"styled-components";var Nl=cr.div`
|
|
1550
|
+
${e=>E(e)} {
|
|
1551
1551
|
display: flex;
|
|
1552
1552
|
flex-direction: column;
|
|
1553
1553
|
width: 100%;
|
|
@@ -1561,18 +1561,18 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1561
1561
|
border-radius: 12px;
|
|
1562
1562
|
position: relative;
|
|
1563
1563
|
}
|
|
1564
|
-
`,Il=
|
|
1564
|
+
`,Il=cr.div`
|
|
1565
1565
|
display: flex;
|
|
1566
1566
|
flex-direction: column;
|
|
1567
1567
|
flex: 1;
|
|
1568
|
-
`,Ll=
|
|
1568
|
+
`,Ll=cr.div`
|
|
1569
1569
|
display: flex;
|
|
1570
1570
|
flex-direction: column;
|
|
1571
1571
|
justify-content: center;
|
|
1572
1572
|
align-items: flex-start;
|
|
1573
1573
|
margin-top: 16px;
|
|
1574
|
-
`,$l=
|
|
1575
|
-
${e=>
|
|
1574
|
+
`,$l=cr.div`
|
|
1575
|
+
${e=>E(e)} {
|
|
1576
1576
|
position: absolute;
|
|
1577
1577
|
top: 16px;
|
|
1578
1578
|
right: 16px;
|
|
@@ -1582,9 +1582,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1582
1582
|
opacity: 0.8;
|
|
1583
1583
|
}
|
|
1584
1584
|
}
|
|
1585
|
-
`;var Vc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:
|
|
1585
|
+
`;var Vc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:S,getFlowSteps:w,getFlowStatus:b,getCurrentStepIndex:x}=R(),{primaryCTAClickSideEffects:v}=me(),{mergeAppearanceWithDefault:k}=oe();if(Ge(e),n=k(n),Hc(()=>{S(o)},[o,c]),c)return null;let B=d(e);if(!B||f(B)||b(e)===te)return null;let C=w(e)[x(e)];return rt.createElement(rt.Fragment,null,rt.createElement(ne,{appearance:n}),rt.createElement(Nl,{appearance:n,className:Te(a("embeddedTipContainer",n),r),style:l},(p===!0||C.dismissible)&&rt.createElement($l,{onClick:()=>M(void 0,null,function*(){yield s(e),t&&t()}),className:a("embeddedTipDismissButton",n)},rt.createElement(Ae,null)),rt.createElement(Il,null,rt.createElement(Oe,{size:"small",appearance:n,title:C.title,subtitle:C.subtitle})),C.primaryButtonTitle&&rt.createElement(Ll,{className:a("embeddedTipCallToActionContainer",n)},rt.createElement(re,{classPrefix:"embeddedTip",title:C.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>M(void 0,null,function*(){C.handlePrimaryButtonClick(),v(C),!(i&&i(C,x(e),"primary")===!1)&&(yield m(e,C.id),yield s(e))})}))))};import ve,{useEffect as jc}from"react";import po from"styled-components";var Ml=po.div`
|
|
1586
1586
|
// use the :not annotation
|
|
1587
|
-
${e=>
|
|
1587
|
+
${e=>E(e)} {
|
|
1588
1588
|
display: flex;
|
|
1589
1589
|
flex-direction: ${e=>e.type==="square"?"column":"row"};
|
|
1590
1590
|
width: 100%;
|
|
@@ -1594,24 +1594,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1594
1594
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1595
1595
|
border-radius: 12px;
|
|
1596
1596
|
}
|
|
1597
|
-
`,Dl=
|
|
1598
|
-
${e=>
|
|
1597
|
+
`,Dl=po.div`
|
|
1598
|
+
${e=>E(e)} {
|
|
1599
1599
|
display: flex;
|
|
1600
1600
|
width: 46px;
|
|
1601
1601
|
height: 46px;
|
|
1602
1602
|
}
|
|
1603
|
-
`,Ul=
|
|
1603
|
+
`,Ul=po.div`
|
|
1604
1604
|
display: flex;
|
|
1605
1605
|
flex-direction: column;
|
|
1606
1606
|
flex: 1;
|
|
1607
1607
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1608
1608
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1609
|
-
`,
|
|
1609
|
+
`,_l=po.div`
|
|
1610
1610
|
display: flex;
|
|
1611
1611
|
flex-direction: column;
|
|
1612
1612
|
justify-content: center;
|
|
1613
1613
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1614
|
-
`,
|
|
1614
|
+
`,Qr=po.div`
|
|
1615
1615
|
display: flex;
|
|
1616
1616
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1617
1617
|
align-items: flex-end;
|
|
@@ -1619,12 +1619,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1619
1619
|
:hover {
|
|
1620
1620
|
opacity: 0.8;
|
|
1621
1621
|
}
|
|
1622
|
-
`,
|
|
1622
|
+
`,Zr=po.div`
|
|
1623
1623
|
display: flex;
|
|
1624
1624
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1625
1625
|
align-items: flex-end;
|
|
1626
1626
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1627
|
-
`;import
|
|
1627
|
+
`;import Rr from"react";var Wl=({style:e,className:t})=>Rr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Rr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Rr.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var Gc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:l,type:p="full-width",icon:d})=>{let{getFlow:s,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:f,updateCustomVariables:S,getFlowMetadata:w,getFlowStatus:b,getFlowSteps:x,getCurrentStepIndex:v}=R(),{primaryCTAClickSideEffects:k}=me(),{mergeAppearanceWithDefault:B}=oe();if(Ge(e),l=B(l),jc(()=>{S(n)},[n,c]),c)return null;let L=s(e);if(!L||f(L)||b(e)===te)return null;let C=x(e),u=C.length>0?C[v(e)]:w(e);return u!=null&&u.title&&(t=u.title),u!=null&&u.subtitle&&(o=u.subtitle),ve.createElement(ve.Fragment,null,ve.createElement(ne,{appearance:l}),ve.createElement(Ml,{type:p,appearance:l,className:a("bannerContainer",l)},p!="square"&&ve.createElement(Dl,{className:a("bannerIconContainer",l)},d||ve.createElement(Wl,null)),p==="square"&&u.dismissible&&ve.createElement(Zr,{type:p,className:a("bannerDismissButtonContainer",l)},ve.createElement(Qr,{type:p,onClick:()=>M(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",l)},ve.createElement(Ae,null))),ve.createElement(Ul,{type:p},ve.createElement(Oe,{appearance:l,title:t,subtitle:o,classPrefix:"banner"})),(u==null?void 0:u.primaryButtonTitle)&&ve.createElement(_l,{type:p,className:a("bannerCallToActionContainer",l)},ve.createElement(re,{title:u==null?void 0:u.primaryButtonTitle,appearance:l,onClick:()=>{k(u),r&&r(u,0,"primary")},classPrefix:"banner"})),p!=="square"&&u.dismissible&&ve.createElement(Zr,{type:p,className:a("bannerDismissButtonContainer",l)},ve.createElement(Qr,{type:p,onClick:()=>M(void 0,null,function*(){yield m(e),i&&i()}),className:a("bannerDismissButton",l)},ve.createElement(Ae,null)))))};import ie,{useEffect as Kc}from"react";import{Portal as qc}from"react-portal";import gt from"styled-components";var zl=gt.div`
|
|
1628
1628
|
display: flex;
|
|
1629
1629
|
flex-direction: column;
|
|
1630
1630
|
width: 100%;
|
|
@@ -1667,7 +1667,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1667
1667
|
display: flex;
|
|
1668
1668
|
justify-content: center;
|
|
1669
1669
|
align-items: center;
|
|
1670
|
-
`,
|
|
1670
|
+
`,ei=gt.div`
|
|
1671
1671
|
display: flex;
|
|
1672
1672
|
justify-content: space-between;
|
|
1673
1673
|
margin-top: 16px;
|
|
@@ -1676,14 +1676,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1676
1676
|
display: flex;
|
|
1677
1677
|
justify-content: space-between;
|
|
1678
1678
|
margin-top: 8px;
|
|
1679
|
-
`,
|
|
1679
|
+
`,ti=gt.div`
|
|
1680
1680
|
font-size: 12px;
|
|
1681
1681
|
line-height: 18px;
|
|
1682
1682
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1683
1683
|
font-style: normal;
|
|
1684
1684
|
font-weight: 400;
|
|
1685
1685
|
letter-spacing: 0.24px;
|
|
1686
|
-
`,
|
|
1686
|
+
`,oi=gt.div`
|
|
1687
1687
|
display: flex;
|
|
1688
1688
|
flex-direction: column;
|
|
1689
1689
|
flex: 1;
|
|
@@ -1694,7 +1694,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1694
1694
|
align-items: flex-start;
|
|
1695
1695
|
margin-top: 16px;
|
|
1696
1696
|
`,jl=gt.textarea`
|
|
1697
|
-
${e=>
|
|
1697
|
+
${e=>E(e)} {
|
|
1698
1698
|
color: ${e=>e.appearance.theme.colorText};
|
|
1699
1699
|
margin-top: 16px;
|
|
1700
1700
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
@@ -1707,7 +1707,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1707
1707
|
resize: none;
|
|
1708
1708
|
}
|
|
1709
1709
|
`,Gl=gt.div`
|
|
1710
|
-
${e=>
|
|
1710
|
+
${e=>E(e)} {
|
|
1711
1711
|
position: absolute;
|
|
1712
1712
|
top: 16px;
|
|
1713
1713
|
right: 16px;
|
|
@@ -1717,8 +1717,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1717
1717
|
opacity: 0.8;
|
|
1718
1718
|
}
|
|
1719
1719
|
}
|
|
1720
|
-
`;var Yc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:
|
|
1721
|
-
${e=>
|
|
1720
|
+
`;var Yc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:s,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:S,updateCustomVariables:w,getFlowSteps:b,getFlowStatus:x,getFlowMetadata:v}=R(),{primaryCTAClickSideEffects:k}=me(),{mergeAppearanceWithDefault:B}=oe(),[L,C]=ie.useState(null),[u,N]=ie.useState(""),F=v(e),{hasOpenModals:P,setKeepCompletedFlowOpenDuringSession:I,shouldKeepCompletedFlowOpenDuringSession:O}=Ee();if(Ge(e),n=B(n),Kc(()=>{w(o)},[o,f]),f)return null;let A=d(e);if(!A||S(A)||x(e)===te||c(e)===1&&!O(e)||P())return null;let _=b(e)[c(e)];function Q(){var J,q;return ie.createElement(ie.Fragment,null,ie.createElement(oi,null,ie.createElement(Oe,{size:"large",appearance:n,title:_.title,subtitle:_.subtitle})),ie.createElement(ei,{className:a("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(ae=>ie.createElement(Hl,{className:a("npsNumberButton",n),selected:L===ae+1,key:ae,onClick:()=>M(this,null,function*(){I(e),C(ae+1),yield m(e,_.id,{score:ae+1})}),appearance:n},ae+1))),ie.createElement(Vl,{appearance:n},ie.createElement(ti,{appearance:n},(J=F==null?void 0:F.negativeLabel)!=null?J:"Not likely at all"),ie.createElement(ti,{appearance:n},(q=F==null?void 0:F.positiveLabel)!=null?q:"Extremely likely")))}function Y(){var J;return ie.createElement(ie.Fragment,null,ie.createElement(oi,null,ie.createElement(Oe,{appearance:n,title:(J=_.title)!=null?J:"Why did you choose this score?",size:"large"})),ie.createElement(jl,{appearance:n,value:u,onChange:q=>{N(q.target.value)},placeholder:"Add your optional feedback here..."}),ie.createElement(ei,{appearance:n,className:a("npsNumberButtonContainer",n)},ie.createElement(re,{size:"large",withMargin:!1,onClick:()=>M(this,null,function*(){yield s(e),i&&i(_,1,"primary")}),appearance:n,title:_.secondaryButtonTitle||"Skip",secondary:!0}),ie.createElement(re,{size:"large",withMargin:!1,onClick:()=>M(this,null,function*(){yield m(e,_.id,{feedbackText:u}),yield s(e),i&&i(_,1,"primary")}),appearance:n,title:_.primaryButtonTitle||"Submit"})))}function se(){return c(e)>=2?null:ie.createElement(ie.Fragment,null,ie.createElement(ne,{appearance:n}),ie.createElement(zl,{appearance:n,className:Te(a("npsSurveyContainer",n),r),style:l,type:p},ie.createElement(Gl,{onClick:()=>M(this,null,function*(){yield s(e),t&&t()}),className:a("npsSurveyDismissButton",n)},ie.createElement(Ae,null)),c(e)==0&&Q(),c(e)==1&&Y()))}return p==="inline"?se():ie.createElement(qc,null,se())};import Be,{useEffect as Qc}from"react";import _t from"styled-components";var Kl=_t.div`
|
|
1721
|
+
${e=>E(e)} {
|
|
1722
1722
|
display: flex;
|
|
1723
1723
|
flex-direction: column;
|
|
1724
1724
|
width: 100%;
|
|
@@ -1728,22 +1728,22 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1728
1728
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1729
1729
|
position: relative;
|
|
1730
1730
|
}
|
|
1731
|
-
`,ql=
|
|
1731
|
+
`,ql=_t.div`
|
|
1732
1732
|
display: flex;
|
|
1733
1733
|
flex-direction: column;
|
|
1734
1734
|
flex: 1;
|
|
1735
|
-
`,Yl=
|
|
1735
|
+
`,Yl=_t.div`
|
|
1736
1736
|
display: flex;
|
|
1737
1737
|
flex-direction: row;
|
|
1738
1738
|
justify-content: center;
|
|
1739
1739
|
align-items: stretch;
|
|
1740
1740
|
gap: 16px;
|
|
1741
1741
|
margin-top: 8px;
|
|
1742
|
-
`,Jl=
|
|
1742
|
+
`,Jl=_t.div`
|
|
1743
1743
|
margin-top: 16px;
|
|
1744
1744
|
margin-bottom: 16px;
|
|
1745
|
-
`,Xl=
|
|
1746
|
-
${e=>
|
|
1745
|
+
`,Xl=_t.div`
|
|
1746
|
+
${e=>E(e)} {
|
|
1747
1747
|
position: absolute;
|
|
1748
1748
|
top: -16px;
|
|
1749
1749
|
right: -16px;
|
|
@@ -1753,8 +1753,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1753
1753
|
opacity: 0.8;
|
|
1754
1754
|
}
|
|
1755
1755
|
}
|
|
1756
|
-
`,Ql=
|
|
1757
|
-
${e=>
|
|
1756
|
+
`,Ql=_t.h1`
|
|
1757
|
+
${e=>E(e)} {
|
|
1758
1758
|
font-style: normal;
|
|
1759
1759
|
justify-content: center;
|
|
1760
1760
|
text-align: center;
|
|
@@ -1767,8 +1767,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1767
1767
|
color: ${e=>e.appearance.theme.colorText};
|
|
1768
1768
|
margin-bottom: 8px;
|
|
1769
1769
|
}
|
|
1770
|
-
`,Zl=
|
|
1771
|
-
${e=>
|
|
1770
|
+
`,Zl=_t.h2`
|
|
1771
|
+
${e=>E(e)} {
|
|
1772
1772
|
font-style: normal;
|
|
1773
1773
|
justify-content: center;
|
|
1774
1774
|
text-align: center;
|
|
@@ -1784,5 +1784,5 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ho}${t}.${ho}${t} { ${Object.entries(o).map
|
|
|
1784
1784
|
height: 100%;
|
|
1785
1785
|
min-height: 200px;
|
|
1786
1786
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1787
|
-
`;function ea({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Rl.createElement(
|
|
1787
|
+
`;function ea({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Rl.createElement(et,{appearance:t,videoUri:e.videoUri}):e.imageUri?Rl.createElement(Xc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Zc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:s,markFlowCompleted:m,markStepCompleted:c,isLoading:f,targetingLogicShouldHideFlow:S,updateCustomVariables:w,getFlowSteps:b,getFlowStatus:x,getCurrentStepIndex:v}=R(),{primaryCTAClickSideEffects:k,secondaryCTAClickSideEffects:B}=me(),{mergeAppearanceWithDefault:L}=oe(),{setOpenFlowState:C,getOpenFlowState:u,hasOpenModals:N}=Ee();Ge(e);let[F,P]=[u(e,!0),Y=>C(e,Y)];if(n=L(n),Qc(()=>{w(o)},[o,f]),f)return null;let I=s(e);if(!I||S(I)||x(e)===te||N())return null;let A=b(e)[v(e)],G=()=>{P(!1),t&&t(),m(e)};function _(){return Be.createElement(Be.Fragment,null,Be.createElement(ne,{appearance:n}),Be.createElement(Kl,{appearance:n,className:Te(a("announcementContainer",n),r),style:l},(p===!0||A.dismissible)&&d=="inline"&&Be.createElement(Xl,{onClick:()=>M(this,null,function*(){yield m(e),t&&t()}),className:a("announcementDismissButton",n)},Be.createElement(Ae,null)),Be.createElement(ql,null,Be.createElement(Ql,{appearance:n,className:a("announcementTitle",n),dangerouslySetInnerHTML:de(A.title)}),A.subtitle&&Be.createElement(Zl,{appearance:n,className:a("announcementSubtitle",n),dangerouslySetInnerHTML:de(A.subtitle)})),(A.imageUri||A.videoUri)&&Be.createElement(Jl,{className:a("announcementMediaContainer",n)},Be.createElement(ea,{appearance:n,stepData:A})),(A.primaryButtonTitle||A.secondaryButtonTitle)&&Be.createElement(Yl,{className:a("announcementCTAContainer",n)},A.secondaryButtonTitle&&Be.createElement(re,{classPrefix:"announcement",title:A.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){A.handleSecondaryButtonClick(),B(A),i&&i(A,v(e),"secondary")}),secondary:!0}),A.primaryButtonTitle&&Be.createElement(re,{classPrefix:"announcement",title:A.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>M(this,null,function*(){A.handlePrimaryButtonClick(),k(A),!(i&&i(A,v(e),"primary")===!1)&&(yield c(e,A.id),yield m(e))})}))))}let Q={padding:"24px",maxWidth:"400px"};return d==="inline"?_():d!=="center"?Be.createElement(zo,{modalPosition:d,onClose:G,visible:F,dismissible:p,appearance:n},_()):Be.createElement(Ze,{appearance:n,onClose:G,visible:F,style:Q,dismissible:p},_())};import*as mr from"react";import ta from"react";var oa=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Le(r,["as","children","variant"]);return ta.createElement(vn,T({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},Rc=Object.fromEntries(Object.keys(Zo).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>ta.createElement(oa,V(T({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),ri=Object.assign(oa,Rc);var ra=l=>{var p=l,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=p,r=Le(p,["as","className","size","title","variant"]);var d;return mr.createElement(Pn,T({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),mr.createElement(ri,{color:(d=Po[n])==null?void 0:d.color,fontWeight:"semibold"},i))},em=Object.fromEntries(Object.keys(Po).map(e=>{let t=o=>mr.createElement(ra,V(T({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),tm=Object.assign(ra,em);export{ko as Box,tm as Button,pt as CheckBox,gr as FlowType,yt as FormLabel,vr as FormTextField,Zc as FrigadeAnnouncement,Gc as FrigadeBanner,Yr as FrigadeChecklist,at as FrigadeDefaultAppearance,Vc as FrigadeEmbeddedTip,Cn as FrigadeForm,Sc as FrigadeGuide,hc as FrigadeHeroChecklist,Yc as FrigadeNPSSurvey,Cc as FrigadeProgressBadge,Pd as FrigadeProvider,zc as FrigadeSupportWidget,Mc as FrigadeTour,ze as ProgressBar,qt as ProgressRing,ri as Text,_r as tokens,Ee as useFlowOpens,go as useFlowResponses,R as useFlows,Ur as useOrganization,ho as useUser,_e as useUserFlowStates};
|
|
1788
1788
|
//# sourceMappingURL=index.mjs.map
|