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