@frigade/react 1.35.37 → 1.35.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +163 -160
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +168 -165
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnPropertyDescriptors;var ko=Object.getOwnPropertySymbols;var ri=Object.prototype.hasOwnProperty,ii=Object.prototype.propertyIsEnumerable;var oi=(e,t,o)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,T=(e,t)=>{for(var o in t||(t={}))ri.call(t,o)&&oi(e,o,t[o]);if(ko)for(var o of ko(t))ii.call(t,o)&&oi(e,o,t[o]);return e},H=(e,t)=>na(e,sa(t));var ni=e=>typeof e=="symbol"?e:e+"",Ie=(e,t)=>{var o={};for(var n in e)ri.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&ko)for(var n of ko(e))t.indexOf(n)<0&&ii.call(e,n)&&(o[n]=e[n]);return o};var $=(e,t,o)=>new Promise((n,i)=>{var r=d=>{try{p(o.next(d))}catch(s){i(s)}},l=d=>{try{p(o.throw(d))}catch(s){i(s)}},p=d=>d.done?n(d.value):Promise.resolve(d.value).then(r,l);p((o=o.apply(e,t)).next())});import vt,{createContext as hd,useEffect as Ko,useState as je}from"react";import{ThemeProvider as Cd}from"styled-components";import Pt,{useContext as Kp,useEffect as xo,useState as Vo}from"react";import{useCallback as Tt,useContext as ya,useEffect as Sa}from"react";import rr,{useMemo as li}from"react";var si="1.35.37 ";var He="NOT_STARTED_STEP",Q="COMPLETED_FLOW",Po="ABORTED_FLOW",wt="STARTED_FLOW",$e="NOT_STARTED_FLOW",Ge="COMPLETED_STEP",vo="STARTED_STEP";function Xe(){let{publicApiKey:e,userId:t,apiUrl:o}=rr.useContext(X);return{config:li(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":si,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:li(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function Ut(){let{shouldGracefullyDegrade:e,readonly:t}=rr.useContext(X);return(o,n)=>$(this,null,function*(){if(t&&(n.method==="POST"||n.method==="PUT"||n.method==="DELETE"))return Mt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Mt();let i=la+o,r=aa+o;if(window&&window.localStorage&&n&&n.body&&n.method==="POST"){let p=window.localStorage.getItem(i),d=window.localStorage.getItem(r);if(p&&d&&d==n.body){let s=new Date(p);if(new Date().getTime()-s.getTime()<1e3)return Mt()}window.localStorage.setItem(i,new Date().toISOString()),window.localStorage.setItem(r,n.body)}let l;try{l=yield fetch(o,n)}catch(p){return Mt(p)}return l?l.ok?l:Mt(l.statusText):Mt()})}function Mt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Wt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=rr.useContext(X);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as xa,useState as ai}from"react";import{useContext as da,useEffect as ca,useState as ma}from"react";import ua from"swr";import{useContext as pa}from"react";function ve(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:n,completedFlowsToKeepOpenDuringSession:i}=pa(X);function r(c,x=!1){var S;return(S=e[c])!=null?S:x}function l(c,x){t(S=>H(T({},S),{[c]:x}))}function p(c){t(x=>{let b=x,{[c]:S}=b,F=Ie(b,[ni(c)]);return T({},F)})}function d(c){i.includes(c)||n(x=>[...x,c])}function s(c){return i.includes(c)}function m(c){return Object.entries(e).some(([x,S])=>S&&x!=c)||o}return{getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}import fa from"swr/immutable";import io from"core-js-pure/actual/structured-clone";function ir(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ge(...e){let t=e.shift(),o=e.length===1?e[0]:ge(...e);if(!ir(t)||!ir(o))throw new Error("deepmerge can only merge Objects");let n=io(t);return Object.entries(o).forEach(([i,r])=>{ir(r)?n[i]!==void 0?Object.assign(n,{[i]:ge(n[i],io(r))}):Object.assign(n,{[i]:io(r)}):Array.isArray(r)?n[i]!==void 0?Object.assign(n,{[i]:[...n[i],...io(r)]}):Object.assign(n,{[i]:io(r)}):Object.assign(n,{[i]:r})}),n}var ga="unknown";function Me(){let{config:e,apiUrl:t}=Xe(),{publicApiKey:o,userId:n,organizationId:i,flows:r,setShouldGracefullyDegrade:l,readonly:p}=da(X),{resetOpenFlowState:d}=ve(),[s,m]=ma(!1),c={data:r.map(f=>({flowId:f.id,flowState:Q,lastStepId:null,userId:n,foreignUserId:n,stepStates:{},shouldTrigger:!1}))},x=f=>fetch(f,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${f}: ${P}. Will gracefully degrade and hide Frigade`),l(!0),c)),S=o&&r&&n?`${t}userFlowStates?foreignUserId=${encodeURIComponent(n)}${i?`&foreignUserGroupId=${encodeURIComponent(i)}`:""}`:null,{data:F,isLoading:b,mutate:g,error:B}=p?fa(S,x):ua(S,x,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),y=F==null?void 0:F.data;ca(()=>{!s&&!b&&y&&m(!0)},[y,s,b]);function E(f){return $(this,null,function*(){if(y&&!p){let P=y.find(N=>N.flowId===f);P&&P.flowState!==Q&&(P.flowState=Q),yield g(Promise.resolve(ge(F,{data:y})),{optimisticData:ge(F,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function A(f,P,N){return $(this,null,function*(){if(y){let L=y.find(O=>O.flowId===f);L&&(L.stepStates[P]=N,L.flowState=wt),yield g(Promise.resolve(ge(F,{data:y})),{optimisticData:ge(F,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function I(f,P,N){return $(this,null,function*(){if(y){let L=y.find(O=>O.flowId===f);L&&(L.lastStepId=P,L.stepStates[P]=N,L.flowState=wt),yield g(ge(F,{data:y}),{optimisticData:ge(F,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function h(f){return $(this,null,function*(){if(y){let P=y.find(N=>N.flowId===f);P&&P.flowState!==$e&&(P.flowState=$e,P.lastStepId=ga,Object.keys(P.stepStates).forEach(N=>{P.stepStates[N].actionType=He,P.stepStates[N].createdAt=new Date().toISOString()}),yield g(ge(F,{data:y}),{optimisticData:ge(F,{data:y}),revalidate:!1,rollbackOnError:!1}),d(f))}})}function w(f,P){return $(this,null,function*(){if(y){let N=y.find(L=>L.flowId===f);N&&N.stepStates[P]!==He&&(N.stepStates[P]=He),yield g(ge(F,{data:y}),{optimisticData:ge(F,{data:y}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:y,isLoadingUserFlowStateData:!s,mutateUserFlowState:g,optimisticallyMarkFlowCompleted:E,optimisticallyMarkFlowNotStarted:h,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:w,optimisticallyMarkStepStarted:I,error:B}}function no(){let{config:e,apiUrl:t}=Xe(),{userFlowStatesData:o,mutateUserFlowState:n}=Me(),{failedFlowResponses:i,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=xa(X),[d,s]=ai(new Set),[m,c]=ai(new Set),x=Ut();function S(g){let B=JSON.stringify(g);if(d.has(B))return null;d.add(B),s(d),m.add(g),c(m);let y=l==null?void 0:l.find(E=>E.flowSlug===g.flowSlug&&E.stepId===g.stepId&&E.actionType===g.actionType&&E.createdAt===g.createdAt);return x(`${t}flowResponses`,H(T({},e),{method:"POST",body:B})).then(E=>{E.status!==200&&E.status!==201?(console.log("Failed to send flow response for step "+g.stepId+". Will retry again later."),r([...i,g])):y||p(A=>[...A!=null?A:[],g])})}function F(g){return $(this,null,function*(){g.foreignUserId&&(g.actionType===wt||g.actionType===$e?yield S(g):g.actionType===Q?yield S(g):g.actionType===vo?yield S(g):g.actionType===Ge?yield S(g):g.actionType===Po?yield S(g):g.actionType===He&&(yield S(g)))})}function b(){let g=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let y in B.stepStates){let E=B.stepStates[y];g.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:E.stepId,actionType:E.actionType,data:{},createdAt:new Date(E.createdAt),blocked:E.blocked,hidden:E.hidden})}}),[...g,...l]}return{addResponse:F,setFlowResponses:p,getFlowResponses:b}}import ba from"swr";var ha=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,pi=e=>{let t=ha.exec(e);if(t===null)return null;let o=null;return t.forEach((n,i)=>{let r=Ca(n,"'","");r.startsWith("flow_")&&(o=r)}),o},Ca=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function nr(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var sr=(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))(sr||{});function ee(){let{config:e,apiUrl:t}=Xe(),{flows:o,setFlows:n,userId:i,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:x,readonly:S}=ya(X),F={data:[]},{verifySDKInitiated:b}=Wt(),{addResponse:g,getFlowResponses:B}=no(),y=C=>fetch(C,e).then(u=>u.ok?u.json():(console.log(`Error fetching ${C} (${u.status}): ${u.statusText}. Will gracefully degrade and hide Frigade`),x(!0),F)).catch(u=>(console.log(`Error fetching ${C}: ${u}. Will gracefully degrade and hide Frigade`),x(!0),F)),{mutateUserFlowState:E,userFlowStatesData:A,isLoadingUserFlowStateData:I,optimisticallyMarkFlowCompleted:h,optimisticallyMarkFlowNotStarted:w,optimisticallyMarkStepCompleted:f,optimisticallyMarkStepNotStarted:P,optimisticallyMarkStepStarted:N}=Me(),{data:L,error:O,isLoading:U}=ba(l?`${t}flows${S?"?readonly=true":""}`:null,y,{keepPreviousData:!0});Sa(()=>{if(O){console.error(O);return}L&&L.data&&n(L.data)},[L,O]);function W(C){if(U)return null;let u=o.find(k=>k.slug===C);return!u&&o.length>0&&!I&&!U?(console.log(`Flow with id ${C} not found`),null):(u==null?void 0:u.active)===!1&&!S?null:u}function V(C){var z,ue;if(!W(C))return[];let u=W(C).data;return u?(u=le(u),((ue=(z=nr(u))==null?void 0:z.data)!=null?ue:[]).map(fe=>{let ro=J(fe);return H(T({handleSecondaryButtonClick:()=>{fe.skippable===!0&&G(C,fe.id,{skipped:!0})}},fe),{complete:ce(C,fe.id)===Ge||ro>=1,blocked:Ae(C,fe.id),hidden:be(C,fe.id),handlePrimaryButtonClick:()=>{(!fe.completionCriteria&&(fe.autoMarkCompleted||fe.autoMarkCompleted===void 0)||fe.completionCriteria&&fe.autoMarkCompleted===!0)&&G(C,fe.id)},progress:ro})}).filter(fe=>fe.hidden!==!0)):[]}function le(C){return C.replaceAll(/\${(.*?)}/g,(u,k)=>p[k]===void 0?"":String(p[k]).replace(/[\u00A0-\u9999<>\&]/g,function(z){return"&#"+z.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function Z(C){var k;if(!W(C))return[];let u=W(C).data;return u?(u=le(u),(k=JSON.parse(u))!=null?k:{}):[]}function q(C,u){d(k=>H(T({},k),{[C]:u}))}function he(C){!I&&!U&&C&&JSON.stringify(p)!=JSON.stringify(T(T({},p),C))&&Object.keys(C).forEach(u=>{q(u,C[u])})}let Pe=Tt((C,u,k)=>$(this,null,function*(){if(!b())return;let z={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:u,actionType:vo,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};R(z)&&(yield N(C,u,z),g(z))}),[i,r,A]),Se=Tt((C,u,k)=>$(this,null,function*(){if(!b())return;let z={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:u,actionType:He,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};R(z)&&(yield P(C,u),g(z))}),[i,r,A]),G=Tt((C,u,k)=>$(this,null,function*(){if(!b())return;let z={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:u,actionType:Ge,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};R(z)&&(yield f(C,u,z),g(z))}),[i,r,A]),Y=Tt((C,u)=>$(this,null,function*(){if(!b()||Ce(C)===$e)return;let k={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:$e,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};yield w(C),R(k)&&g(k)}),[i,r,A]),te=Tt((C,u)=>$(this,null,function*(){if(!b())return;let k={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:wt,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};R(k)&&g(k)}),[i,r,A]),Ve=Tt((C,u)=>$(this,null,function*(){if(!b())return;let k={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:Q,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};R(k)&&(yield h(C),g(k))}),[i,r,A]),Le=Tt((C,u)=>$(this,null,function*(){if(!b())return;let k={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:Po,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};R(k)&&(yield h(C),g(k))}),[i,r,A]);function R(C){var u;if(!A&&C.actionType===He)return!1;if(A){let k=A.find(z=>z.flowId===C.flowSlug);if(C.actionType===He&&(!(k!=null&&k.stepStates[C.stepId])||k.stepStates[C.stepId].actionType===He)||k&&((u=k.stepStates[C.stepId])==null?void 0:u.actionType)===C.actionType||k&&k.flowState===Q&&C.actionType===Q)return!1}return!0}function ce(C,u){let k=M(C,u);return I?null:k?k.actionType:He}function Ae(C,u){let k=M(C,u);return k?k.blocked:!1}function be(C,u){let k=M(C,u);return k?k.hidden:!1}function M(C,u){var z;if(I)return null;let k=A==null?void 0:A.find(ue=>ue.flowId===C);return!k||!k.stepStates[u]?null:(z=k.stepStates[u])!=null?z:null}function D(C){var k,z;if(I||!A)return null;if(Ce(C)===$e)return(k=V(C)[0])!=null?k:null;let u=(z=A.find(ue=>ue.flowId===C))==null?void 0:z.lastStepId;return u?V(C).find(ue=>ue.id===u):null}function _(C){var z;let u=D(C);if(!u)return 0;let k=(z=V(C).findIndex(ue=>ue.id===u.id))!=null?z:0;return ce(C,u.id)===Ge&&k<V(C).length-1?k+1:k}function J(C){if(!C.completionCriteria)return;let u=pi(C.completionCriteria);if(u===null)return;let k=De(u),z=ot(u);return z===0?void 0:k/z}function Ce(C){let u=A==null?void 0:A.find(k=>k.flowId===C);return u?u.flowState:null}function De(C){let u=V(C);return u.length===0?0:u.filter(z=>ce(C,z.id)===Ge).length}function ot(C){return V(C).length}function Ye(C){let u=o.find(k=>k.slug===C);return u?nr(u.data):null}function bt(C){if(S)return!1;if(I)return!0;if(C!=null&&C.targetingLogic&&A){let u=A.find(k=>k.flowId===C.slug);if(u)return u.shouldTrigger===!1}return!!(C!=null&&C.targetingLogic&&i&&i.startsWith("guest_"))}function Dt(C){return!bt(W(C))}function $t(){i&&E()}return{getFlow:W,getFlowData:Ye,isLoading:I||U,getStepStatus:ce,getFlowSteps:V,getCurrentStepIndex:_,markStepStarted:Pe,markStepCompleted:G,markFlowNotStarted:Y,markFlowStarted:te,markFlowCompleted:Ve,markFlowAborted:Le,markStepNotStarted:Se,getFlowStatus:Ce,getNumberOfStepsCompleted:De,getNumberOfSteps:ot,targetingLogicShouldHideFlow:bt,setCustomVariable:q,updateCustomVariables:he,customVariables:p,getStepOptionalProgress:J,getFlowMetadata:Z,isStepBlocked:Ae,isStepHidden:be,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Dt,refresh:$t}}import{useCallback as lr,useContext as wa,useEffect as Ta}from"react";var zt="guest_";function so(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:n,shouldGracefullyDegrade:i}=wa(X),{config:r,apiUrl:l}=Xe(),{mutateUserFlowState:p}=Me(),d=Ut(),{verifySDKInitiated:s}=Wt();function m(F){return`frigade-user-registered-${F}`}Ta(()=>{if(e&&!t){if(e.startsWith(zt))return;let F=m(e);localStorage.getItem(F)||(d(`${l}users`,H(T({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(F,"true"))}},[e,i,t]);let c=lr(F=>$(this,null,function*(){if(!s())return;let b={foreignId:e,properties:F};yield d(`${l}users`,H(T({},r),{method:"POST",body:JSON.stringify(b)})),n(g=>T(T({},g),F)),p()}),[e,r,i,p]),x=lr((F,b)=>$(this,null,function*(){if(!s())return;let B={foreignId:e,events:[{event:F,properties:b}]};yield d(`${l}users`,H(T({},r),{method:"POST",body:JSON.stringify(B)})),p()}),[e,r,p]),S=lr((F,b)=>$(this,null,function*(){if(s())if(b){let g=m(F);localStorage.setItem(g,"true"),o(F);let B={foreignId:F,properties:b};yield d(`${l}users`,H(T({},r),{method:"POST",body:JSON.stringify(B)})),n(y=>T(T({},y),b)),p()}else o(F)}),[r,i,p]);return{userId:e,setUserId:o,setUserIdWithProperties:S,addPropertiesToUser:c,trackEventForUser:x}}import{v4 as qp}from"uuid";import Re,{useEffect as Br,useState as un}from"react";import Ke,{useEffect as cr,useState as Oa}from"react";import Io from"styled-components";import Fa from"react";import ka from"styled-components";var di="fr-",lo="cfr-";function a(e,t){let o=`${di}${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+" "+lo+e}return o}function v(e){if(!e.className||e.className.indexOf(lo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(di)?"":`:not(${o.map(n=>`.${n}`).join(", ")})`}function Bo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Oe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Bo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function we(...e){return e.filter(Boolean).join(" ")}function ao(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Pa=ka.div`
|
|
2
|
+
var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnPropertyDescriptors;var ko=Object.getOwnPropertySymbols;var ri=Object.prototype.hasOwnProperty,ii=Object.prototype.propertyIsEnumerable;var oi=(e,t,o)=>t in e?ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,T=(e,t)=>{for(var o in t||(t={}))ri.call(t,o)&&oi(e,o,t[o]);if(ko)for(var o of ko(t))ii.call(t,o)&&oi(e,o,t[o]);return e},H=(e,t)=>na(e,sa(t));var ni=e=>typeof e=="symbol"?e:e+"",Ie=(e,t)=>{var o={};for(var n in e)ri.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(e!=null&&ko)for(var n of ko(e))t.indexOf(n)<0&&ii.call(e,n)&&(o[n]=e[n]);return o};var $=(e,t,o)=>new Promise((n,i)=>{var r=d=>{try{p(o.next(d))}catch(l){i(l)}},s=d=>{try{p(o.throw(d))}catch(l){i(l)}},p=d=>d.done?n(d.value):Promise.resolve(d.value).then(r,s);p((o=o.apply(e,t)).next())});import vt,{createContext as hd,useEffect as Ko,useState as je}from"react";import{ThemeProvider as Cd}from"styled-components";import Pt,{useContext as Kp,useEffect as xo,useState as Vo}from"react";import{useCallback as Tt,useContext as ya,useEffect as Sa}from"react";import rr,{useMemo as li}from"react";var si="1.35.39 ";var He="NOT_STARTED_STEP",Q="COMPLETED_FLOW",Po="ABORTED_FLOW",wt="STARTED_FLOW",$e="NOT_STARTED_FLOW",Ge="COMPLETED_STEP",vo="STARTED_STEP";function Xe(){let{publicApiKey:e,userId:t,apiUrl:o}=rr.useContext(X);return{config:li(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":si,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:li(()=>`${o}/v1/public/`,[o])}}var la="frigade-last-call-at-",aa="frigade-last-call-data-";function Ut(){let{shouldGracefullyDegrade:e,readonly:t}=rr.useContext(X);return(o,n)=>$(this,null,function*(){if(t&&(n.method==="POST"||n.method==="PUT"||n.method==="DELETE"))return Mt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Mt();let i=la+o,r=aa+o;if(window&&window.localStorage&&n&&n.body&&n.method==="POST"){let p=window.localStorage.getItem(i),d=window.localStorage.getItem(r);if(p&&d&&d==n.body){let l=new Date(p);if(new Date().getTime()-l.getTime()<1e3)return Mt()}window.localStorage.setItem(i,new Date().toISOString()),window.localStorage.setItem(r,n.body)}let s;try{s=yield fetch(o,n)}catch(p){return Mt(p)}return s?s.ok?s:Mt(s.statusText):Mt()})}function Mt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Wt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=rr.useContext(X);function o(){return t?(console.error("Frigade hooks cannot be used when Frigade SDK has failed to initialize"),!1):e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as xa,useState as ai}from"react";import{useContext as da,useEffect as ca,useState as ma}from"react";import ua from"swr";import{useContext as pa}from"react";function Be(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:n,completedFlowsToKeepOpenDuringSession:i}=pa(X);function r(c,g=!1){var S;return(S=e[c])!=null?S:g}function s(c,g){t(S=>H(T({},S),{[c]:g}))}function p(c){t(g=>{let b=g,{[c]:S}=b,F=Ie(b,[ni(c)]);return T({},F)})}function d(c){i.includes(c)||n(g=>[...g,c])}function l(c){return i.includes(c)}function m(c){return Object.entries(e).some(([g,S])=>S&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import fa from"swr/immutable";import io from"core-js-pure/actual/structured-clone";function ir(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function he(...e){let t=e.shift(),o=e.length===1?e[0]:he(...e);if(!ir(t)||!ir(o))throw new Error("deepmerge can only merge Objects");let n=io(t);return Object.entries(o).forEach(([i,r])=>{ir(r)?n[i]!==void 0?Object.assign(n,{[i]:he(n[i],io(r))}):Object.assign(n,{[i]:io(r)}):Array.isArray(r)?n[i]!==void 0?Object.assign(n,{[i]:[...n[i],...io(r)]}):Object.assign(n,{[i]:io(r)}):Object.assign(n,{[i]:r})}),n}var ga="unknown";function Me(){let{config:e,apiUrl:t}=Xe(),{publicApiKey:o,userId:n,organizationId:i,flows:r,setShouldGracefullyDegrade:s,readonly:p}=da(X),{resetOpenFlowState:d}=Be(),[l,m]=ma(!1),c={data:r.map(f=>({flowId:f.id,flowState:Q,lastStepId:null,userId:n,foreignUserId:n,stepStates:{},shouldTrigger:!1}))},g=f=>fetch(f,e).then(P=>{if(P.ok)return P.json();throw new Error("Failed to fetch user flow states")}).catch(P=>(console.log(`Error fetching ${f}: ${P}. Will gracefully degrade and hide Frigade`),s(!0),c)),S=o&&r&&n?`${t}userFlowStates?foreignUserId=${encodeURIComponent(n)}${i?`&foreignUserGroupId=${encodeURIComponent(i)}`:""}`:null,{data:F,isLoading:b,mutate:x,error:v}=p?fa(S,g):ua(S,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!0,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),y=F==null?void 0:F.data;ca(()=>{!l&&!b&&y&&m(!0)},[y,l,b]);function E(f){return $(this,null,function*(){if(y&&!p){let P=y.find(N=>N.flowId===f);P&&P.flowState!==Q&&(P.flowState=Q),yield x(Promise.resolve(he(F,{data:y})),{optimisticData:he(F,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function A(f,P,N){return $(this,null,function*(){if(y){let L=y.find(I=>I.flowId===f);L&&(L.stepStates[P]=N,L.flowState=wt),yield x(Promise.resolve(he(F,{data:y})),{optimisticData:he(F,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function O(f,P,N){return $(this,null,function*(){if(y){let L=y.find(I=>I.flowId===f);L&&(L.lastStepId=P,L.stepStates[P]=N,L.flowState=wt),yield x(he(F,{data:y}),{optimisticData:he(F,{data:y}),revalidate:!1,rollbackOnError:!1})}})}function h(f){return $(this,null,function*(){if(y){let P=y.find(N=>N.flowId===f);P&&P.flowState!==$e&&(P.flowState=$e,P.lastStepId=ga,Object.keys(P.stepStates).forEach(N=>{P.stepStates[N].actionType=He,P.stepStates[N].createdAt=new Date().toISOString()}),yield x(he(F,{data:y}),{optimisticData:he(F,{data:y}),revalidate:!1,rollbackOnError:!1}),d(f))}})}function w(f,P){return $(this,null,function*(){if(y){let N=y.find(L=>L.flowId===f);N&&N.stepStates[P]!==He&&(N.stepStates[P]=He),yield x(he(F,{data:y}),{optimisticData:he(F,{data:y}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:y,isLoadingUserFlowStateData:!l,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:E,optimisticallyMarkFlowNotStarted:h,optimisticallyMarkStepCompleted:A,optimisticallyMarkStepNotStarted:w,optimisticallyMarkStepStarted:O,error:v}}function no(){let{config:e,apiUrl:t}=Xe(),{userFlowStatesData:o,mutateUserFlowState:n}=Me(),{failedFlowResponses:i,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:p}=xa(X),[d,l]=ai(new Set),[m,c]=ai(new Set),g=Ut();function S(x){let v=JSON.stringify(x);if(d.has(v))return null;d.add(v),l(d),m.add(x),c(m);let y=s==null?void 0:s.find(E=>E.flowSlug===x.flowSlug&&E.stepId===x.stepId&&E.actionType===x.actionType&&E.createdAt===x.createdAt);return g(`${t}flowResponses`,H(T({},e),{method:"POST",body:v})).then(E=>{E.status!==200&&E.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...i,x])):y||p(A=>[...A!=null?A:[],x])})}function F(x){return $(this,null,function*(){x.foreignUserId&&(x.actionType===wt||x.actionType===$e?yield S(x):x.actionType===Q?yield S(x):x.actionType===vo?yield S(x):x.actionType===Ge?yield S(x):x.actionType===Po?yield S(x):x.actionType===He&&(yield S(x)))})}function b(){let x=[];return o==null||o.forEach(v=>{if(v&&v.stepStates&&Object.keys(v.stepStates).length!==0)for(let y in v.stepStates){let E=v.stepStates[y];x.push({foreignUserId:v.foreignUserId,flowSlug:v.flowId,stepId:E.stepId,actionType:E.actionType,data:{},createdAt:new Date(E.createdAt),blocked:E.blocked,hidden:E.hidden})}}),[...x,...s]}return{addResponse:F,setFlowResponses:p,getFlowResponses:b}}import ba from"swr";var ha=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,pi=e=>{let t=ha.exec(e);if(t===null)return null;let o=null;return t.forEach((n,i)=>{let r=Ca(n,"'","");r.startsWith("flow_")&&(o=r)}),o},Ca=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function nr(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var sr=(l=>(l.CHECKLIST="CHECKLIST",l.FORM="FORM",l.TOUR="TOUR",l.SUPPORT="SUPPORT",l.CUSTOM="CUSTOM",l.BANNER="BANNER",l.EMBEDDED_TIP="EMBEDDED_TIP",l.NPS_SURVEY="NPS_SURVEY",l.ANNOUNCEMENT="ANNOUNCEMENT",l))(sr||{});function R(){let{config:e,apiUrl:t}=Xe(),{flows:o,setFlows:n,userId:i,organizationId:r,publicApiKey:s,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,readonly:S}=ya(X),F={data:[]},{verifySDKInitiated:b}=Wt(),{addResponse:x,getFlowResponses:v}=no(),y=C=>fetch(C,e).then(u=>u.ok?u.json():(console.log(`Error fetching ${C} (${u.status}): ${u.statusText}. Will gracefully degrade and hide Frigade`),g(!0),F)).catch(u=>(console.log(`Error fetching ${C}: ${u}. Will gracefully degrade and hide Frigade`),g(!0),F)),{mutateUserFlowState:E,userFlowStatesData:A,isLoadingUserFlowStateData:O,optimisticallyMarkFlowCompleted:h,optimisticallyMarkFlowNotStarted:w,optimisticallyMarkStepCompleted:f,optimisticallyMarkStepNotStarted:P,optimisticallyMarkStepStarted:N}=Me(),{data:L,error:I,isLoading:q}=ba(s?`${t}flows${S?"?readonly=true":""}`:null,y,{keepPreviousData:!0});Sa(()=>{if(I){console.error(I);return}L&&L.data&&n(L.data)},[L,I]);function M(C){if(q)return null;let u=o.find(k=>k.slug===C);return!u&&o.length>0&&!O&&!q?(console.log(`Flow with id ${C} not found`),null):(u==null?void 0:u.active)===!1&&!S?null:u}function V(C){var W,ge;if(!M(C))return[];let u=M(C).data;return u?(u=le(u),((ge=(W=nr(u))==null?void 0:W.data)!=null?ge:[]).map(xe=>{let ro=J(xe);return H(T({handleSecondaryButtonClick:()=>{xe.skippable===!0&&G(C,xe.id,{skipped:!0})}},xe),{complete:ue(C,xe.id)===Ge||ro>=1,blocked:Oe(C,xe.id),hidden:we(C,xe.id),handlePrimaryButtonClick:()=>{(!xe.completionCriteria&&(xe.autoMarkCompleted||xe.autoMarkCompleted===void 0)||xe.completionCriteria&&xe.autoMarkCompleted===!0)&&G(C,xe.id)},progress:ro})}).filter(xe=>xe.hidden!==!0)):[]}function le(C){return C.replaceAll(/\${(.*?)}/g,(u,k)=>p[k]===void 0?"":String(p[k]).replace(/[\u00A0-\u9999<>\&]/g,function(W){return"&#"+W.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function pe(C){var k;if(!M(C))return[];let u=M(C).data;return u?(u=le(u),(k=JSON.parse(u))!=null?k:{}):[]}function _(C,u){d(k=>H(T({},k),{[C]:u}))}function se(C){!O&&!q&&C&&JSON.stringify(p)!=JSON.stringify(T(T({},p),C))&&Object.keys(C).forEach(u=>{_(u,C[u])})}let de=Tt((C,u,k)=>$(this,null,function*(){if(!b())return;let W={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:u,actionType:vo,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};Z(W)&&(yield N(C,u,W),x(W))}),[i,r,A]),be=Tt((C,u,k)=>$(this,null,function*(){if(!b())return;let W={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:u,actionType:He,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};Z(W)&&(yield P(C,u),x(W))}),[i,r,A]),G=Tt((C,u,k)=>$(this,null,function*(){if(!b())return;let W={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:u,actionType:Ge,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};Z(W)&&(yield f(C,u,W),x(W))}),[i,r,A]),Y=Tt((C,u)=>$(this,null,function*(){if(!b()||ye(C)===$e)return;let k={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:$e,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};yield w(C),Z(k)&&x(k)}),[i,r,A]),ee=Tt((C,u)=>$(this,null,function*(){if(!b())return;let k={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:wt,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};Z(k)&&x(k)}),[i,r,A]),Ve=Tt((C,u)=>$(this,null,function*(){if(!b())return;let k={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:Q,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};Z(k)&&(yield h(C),x(k))}),[i,r,A]),Le=Tt((C,u)=>$(this,null,function*(){if(!b())return;let k={foreignUserId:i,foreignUserGroupId:r!=null?r:null,flowSlug:C,stepId:"unknown",actionType:Po,data:u!=null?u:{},createdAt:new Date,blocked:!1,hidden:!1};Z(k)&&(yield h(C),x(k))}),[i,r,A]);function Z(C){var u;if(!A&&C.actionType===He)return!1;if(A){let k=A.find(W=>W.flowId===C.flowSlug);if(C.actionType===He&&(!(k!=null&&k.stepStates[C.stepId])||k.stepStates[C.stepId].actionType===He)||k&&((u=k.stepStates[C.stepId])==null?void 0:u.actionType)===C.actionType||k&&k.flowState===Q&&C.actionType===Q)return!1}return!0}function ue(C,u){let k=U(C,u);return O?null:k?k.actionType:He}function Oe(C,u){let k=U(C,u);return k?k.blocked:!1}function we(C,u){let k=U(C,u);return k?k.hidden:!1}function U(C,u){var W;if(O)return null;let k=A==null?void 0:A.find(ge=>ge.flowId===C);return!k||!k.stepStates[u]?null:(W=k.stepStates[u])!=null?W:null}function D(C){var k,W;if(O||!A)return null;if(ye(C)===$e)return(k=V(C)[0])!=null?k:null;let u=(W=A.find(ge=>ge.flowId===C))==null?void 0:W.lastStepId;return u?V(C).find(ge=>ge.id===u):null}function z(C){var W;let u=D(C);if(!u)return 0;let k=(W=V(C).findIndex(ge=>ge.id===u.id))!=null?W:0;return ue(C,u.id)===Ge&&k<V(C).length-1?k+1:k}function J(C){if(!C.completionCriteria)return;let u=pi(C.completionCriteria);if(u===null)return;let k=De(u),W=ot(u);return W===0?void 0:k/W}function ye(C){let u=A==null?void 0:A.find(k=>k.flowId===C);return u?u.flowState:null}function De(C){let u=V(C);return u.length===0?0:u.filter(W=>ue(C,W.id)===Ge).length}function ot(C){return V(C).length}function Ye(C){let u=o.find(k=>k.slug===C);return u?nr(u.data):null}function bt(C){if(S)return!1;if(O)return!0;if(C!=null&&C.targetingLogic&&A){let u=A.find(k=>k.flowId===C.slug);if(u)return u.shouldTrigger===!1}return!!(C!=null&&C.targetingLogic&&i&&i.startsWith("guest_"))}function Dt(C){return!bt(M(C))}function $t(){i&&E()}return{getFlow:M,getFlowData:Ye,isLoading:O||q,getStepStatus:ue,getFlowSteps:V,getCurrentStepIndex:z,markStepStarted:de,markStepCompleted:G,markFlowNotStarted:Y,markFlowStarted:ee,markFlowCompleted:Ve,markFlowAborted:Le,markStepNotStarted:be,getFlowStatus:ye,getNumberOfStepsCompleted:De,getNumberOfSteps:ot,targetingLogicShouldHideFlow:bt,setCustomVariable:_,updateCustomVariables:se,customVariables:p,getStepOptionalProgress:J,getFlowMetadata:pe,isStepBlocked:Oe,isStepHidden:we,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Dt,refresh:$t}}import{useCallback as lr,useContext as wa,useEffect as Ta}from"react";var zt="guest_";function so(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:n,shouldGracefullyDegrade:i}=wa(X),{config:r,apiUrl:s}=Xe(),{mutateUserFlowState:p}=Me(),d=Ut(),{verifySDKInitiated:l}=Wt();function m(F){return`frigade-user-registered-${F}`}Ta(()=>{if(e&&!t){if(e.startsWith(zt))return;let F=m(e);localStorage.getItem(F)||(d(`${s}users`,H(T({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(F,"true"))}},[e,i,t]);let c=lr(F=>$(this,null,function*(){if(!l())return;let b={foreignId:e,properties:F};yield d(`${s}users`,H(T({},r),{method:"POST",body:JSON.stringify(b)})),n(x=>T(T({},x),F)),p()}),[e,r,i,p]),g=lr((F,b)=>$(this,null,function*(){if(!l())return;let v={foreignId:e,events:[{event:F,properties:b}]};yield d(`${s}users`,H(T({},r),{method:"POST",body:JSON.stringify(v)})),p()}),[e,r,p]),S=lr((F,b)=>$(this,null,function*(){if(l())if(b){let x=m(F);localStorage.setItem(x,"true"),o(F);let v={foreignId:F,properties:b};yield d(`${s}users`,H(T({},r),{method:"POST",body:JSON.stringify(v)})),n(y=>T(T({},y),b)),p()}else o(F)}),[r,i,p]);return{userId:e,setUserId:o,setUserIdWithProperties:S,addPropertiesToUser:c,trackEventForUser:g}}import{v4 as qp}from"uuid";import Re,{useEffect as Br,useState as un}from"react";import Ke,{useEffect as cr,useState as Ia}from"react";import Oo from"styled-components";import Fa from"react";import ka from"styled-components";var di="fr-",lo="cfr-";function a(e,t){let o=`${di}${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+" "+lo+e}return o}function B(e){if(!e.className||e.className.indexOf(lo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(di)?"":`:not(${o.map(n=>`.${n}`).join(", ")})`}function Bo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function ke(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${Bo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function ao(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Pa=ka.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -7,7 +7,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
7
7
|
left: 0;
|
|
8
8
|
bottom: 0;
|
|
9
9
|
right: 0;
|
|
10
|
-
${e=>
|
|
10
|
+
${e=>B(e)} {
|
|
11
11
|
background-color: rgba(0, 0, 0, 0.6);
|
|
12
12
|
z-index: 1400;
|
|
13
13
|
}
|
|
@@ -27,8 +27,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,
|
|
31
|
-
${e=>
|
|
30
|
+
`,Ee=()=>ar.createElement(Ba,null,ar.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},ar.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as Na}from"react-portal";import Fi from"react";import pr from"react";function Ea({style:e,className:t}){return pr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},pr.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"}),pr.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 mi=Ea;import dr from"styled-components";import rt from"styled-components";var Eo=rt.div`
|
|
31
|
+
${e=>B(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -51,18 +51,18 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
51
51
|
box-sizing: border-box;
|
|
52
52
|
:hover {
|
|
53
53
|
opacity: 0.8;
|
|
54
|
-
}`,
|
|
54
|
+
}`,Oa=`
|
|
55
55
|
display: block;
|
|
56
56
|
cursor: pointer;
|
|
57
57
|
position: absolute;
|
|
58
58
|
top: 12px;
|
|
59
59
|
right: 12px;
|
|
60
60
|
`,ui=rt.div`
|
|
61
|
-
${e=>
|
|
62
|
-
${e=>e.hasImage?Aa:
|
|
61
|
+
${e=>B(e)} {
|
|
62
|
+
${e=>e.hasImage?Aa:Oa};
|
|
63
63
|
}
|
|
64
64
|
`,fi=rt.img`
|
|
65
|
-
${e=>
|
|
65
|
+
${e=>B(e)} {
|
|
66
66
|
display: block;
|
|
67
67
|
width: 100%;
|
|
68
68
|
height: auto;
|
|
@@ -70,7 +70,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
70
70
|
object-fit: cover;
|
|
71
71
|
}
|
|
72
72
|
`,gi=rt.div`
|
|
73
|
-
${e=>
|
|
73
|
+
${e=>B(e)} {
|
|
74
74
|
display: block;
|
|
75
75
|
width: 100%;
|
|
76
76
|
height: auto;
|
|
@@ -95,14 +95,14 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
95
95
|
flex-shrink: 1;
|
|
96
96
|
gap: 8px;
|
|
97
97
|
height: 64px;
|
|
98
|
-
${e=>
|
|
98
|
+
${e=>B(e)} {
|
|
99
99
|
flex-direction: row;
|
|
100
100
|
justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
|
|
101
101
|
align-content: center;
|
|
102
102
|
align-items: center;
|
|
103
103
|
}
|
|
104
104
|
`,Si=rt.p`
|
|
105
|
-
${e=>
|
|
105
|
+
${e=>B(e)} {
|
|
106
106
|
font-style: normal;
|
|
107
107
|
font-weight: 600;
|
|
108
108
|
font-size: 15px;
|
|
@@ -143,8 +143,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
143
143
|
font-size: 12px;
|
|
144
144
|
line-height: 18px;
|
|
145
145
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
146
|
-
`;function Ao({appearance:e}){return Fi.createElement(Ti,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Fi.createElement(mi,null))}var La=
|
|
147
|
-
${e=>
|
|
146
|
+
`;function Ao({appearance:e}){return Fi.createElement(Ti,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Fi.createElement(mi,null))}var La=Oo.div`
|
|
147
|
+
${e=>B(e)} {
|
|
148
148
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
149
149
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
150
150
|
/* Mobile */
|
|
@@ -158,7 +158,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
158
158
|
width: ${e=>{var t;return(t=e.width)!=null?t:"1000px"}};
|
|
159
159
|
z-index: 1500;
|
|
160
160
|
border-radius: ${e=>{var t,o,n;return(n=(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius)!=null?n:8}}px;
|
|
161
|
-
${e=>
|
|
161
|
+
${e=>ke(e)}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
padding: 32px;
|
|
@@ -185,27 +185,27 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
185
185
|
opacity: 1;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`,Da=
|
|
188
|
+
`,Da=Oo.div`
|
|
189
189
|
position: relative;
|
|
190
190
|
flex: 0 1 auto;
|
|
191
|
-
`,$a=
|
|
191
|
+
`,$a=Oo.div`
|
|
192
192
|
position: absolute;
|
|
193
193
|
top: 16px;
|
|
194
194
|
right: 16px;
|
|
195
195
|
cursor: pointer;
|
|
196
196
|
z-index: 1501;
|
|
197
|
-
${e=>
|
|
197
|
+
${e=>B(e)} {
|
|
198
198
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
199
199
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
200
200
|
}
|
|
201
|
-
`,Ma=
|
|
201
|
+
`,Ma=Oo.div`
|
|
202
202
|
overflow: scroll;
|
|
203
203
|
flex: 1 1;
|
|
204
204
|
display: flex;
|
|
205
205
|
::-webkit-scrollbar {
|
|
206
206
|
display: none;
|
|
207
207
|
}
|
|
208
|
-
`,Je=({onClose:e,visible:t,headerContent:o=null,style:n=null,children:i,appearance:r,dismissible:
|
|
208
|
+
`,Je=({onClose:e,visible:t,headerContent:o=null,style:n=null,children:i,appearance:r,dismissible:s=!0,showFrigadeBranding:p=!1})=>{let[d,l]=Ia("");return cr(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");l(m)},[]),cr(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),cr(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?Ke.createElement(Na,null,Ke.createElement(ci,{appearance:r,onClose:()=>{s&&e()}}),Ke.createElement(La,{appearance:r,className:a("modalContainer",r),styleOverrides:n},s&&Ke.createElement($a,{className:a("modalClose",r),onClick:()=>e(),appearance:r},Ke.createElement(Ee,null)),o&&Ke.createElement(Da,null,o),Ke.createElement(Ma,null,i),p&&Ke.createElement(bi,{appearance:r,className:a("poweredByFrigadeRibbon",r)},Ke.createElement(Ao,{appearance:r})))):Ke.createElement(Ke.Fragment,null)};import ft,{useEffect as mr,useState as Ua}from"react";import Io from"styled-components";import{Portal as Wa}from"react-portal";function za(e){switch(e){case"top-left":return`
|
|
209
209
|
top: 0;
|
|
210
210
|
left: 0;
|
|
211
211
|
`;case"top-right":return`
|
|
@@ -214,8 +214,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
214
214
|
`;case"bottom-left":return`
|
|
215
215
|
bottom: 0;
|
|
216
216
|
left: 0;
|
|
217
|
-
`}return"right: 0; bottom: 0;"}var _a=
|
|
218
|
-
${e=>
|
|
217
|
+
`}return"right: 0; bottom: 0;"}var _a=Io.div`
|
|
218
|
+
${e=>B(e)} {
|
|
219
219
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
220
220
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
221
221
|
position: fixed;
|
|
@@ -230,27 +230,27 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
230
230
|
}
|
|
231
231
|
${e=>za(e.modalPosition)}
|
|
232
232
|
margin: 28px;
|
|
233
|
-
`,Ha=
|
|
233
|
+
`,Ha=Io.div`
|
|
234
234
|
position: relative;
|
|
235
235
|
flex: 1;
|
|
236
|
-
`,ja=
|
|
236
|
+
`,ja=Io.div`
|
|
237
237
|
position: absolute;
|
|
238
238
|
top: 16px;
|
|
239
239
|
right: 16px;
|
|
240
240
|
cursor: pointer;
|
|
241
241
|
z-index: 1501;
|
|
242
|
-
${e=>
|
|
242
|
+
${e=>B(e)} {
|
|
243
243
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
244
244
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
245
245
|
}
|
|
246
|
-
`,Va=
|
|
246
|
+
`,Va=Io.div`
|
|
247
247
|
overflow: scroll;
|
|
248
248
|
flex: 5;
|
|
249
249
|
::-webkit-scrollbar {
|
|
250
250
|
display: none;
|
|
251
251
|
}
|
|
252
|
-
`,No=({onClose:e,visible:t,headerContent:o=null,children:n,appearance:i,modalPosition:r="bottom-right",dismissible:
|
|
253
|
-
${e=>
|
|
252
|
+
`,No=({onClose:e,visible:t,headerContent:o=null,children:n,appearance:i,modalPosition:r="bottom-right",dismissible:s=!0})=>{let[p,d]=Ua("");return mr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");d(l)},[]),mr(()=>{let l=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),mr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",p),()=>{l.setProperty("overflow",p)}},[t]),t?ft.createElement(Wa,null,ft.createElement(_a,{appearance:i,className:a("cornerModalContainer",i),modalPosition:r},s&&ft.createElement(ja,{className:a("cornerModalClose",i),onClick:()=>e()},ft.createElement(Ee,null)),o&&ft.createElement(Ha,null,o),ft.createElement(Va,null,n))):ft.createElement(ft.Fragment,null)};import{useContext as Ga}from"react";function te(){let{defaultAppearance:e}=Ga(X);function t(o){var i,r,s;let n=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((i=n.styleOverrides)!=null?i:{},(r=o.styleOverrides)!=null?r:{}),theme:Object.assign(n.theme,(s=o.theme)!=null?s:{})}:n}return{mergeAppearanceWithDefault:t}}import Ft,{useContext as up,useEffect as _i,useState as wr}from"react";import Uo from"styled-components";import $o,{useEffect as Ai,useState as gr}from"react";import xr from"styled-components";import Lo from"styled-components";var ki=Lo.label`
|
|
253
|
+
${e=>B(e)} {
|
|
254
254
|
font-size: 12px;
|
|
255
255
|
line-height: 18px;
|
|
256
256
|
margin-bottom: 5px;
|
|
@@ -261,7 +261,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
261
261
|
}
|
|
262
262
|
display: flex;
|
|
263
263
|
`,Pi=Lo.label`
|
|
264
|
-
${e=>
|
|
264
|
+
${e=>B(e)} {
|
|
265
265
|
font-size: 12px;
|
|
266
266
|
line-height: 20px;
|
|
267
267
|
margin-bottom: 5px;
|
|
@@ -280,12 +280,12 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
280
280
|
align-items: flex-start;
|
|
281
281
|
justify-content: left;
|
|
282
282
|
margin-bottom: 10px;
|
|
283
|
-
`;import ur from"react";var it={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function gt({title:e,required:t,appearance:o=it}){return e?ur.createElement(Do,{className:a("formLabelWrapper",o)},t?ur.createElement(vi,{className:a("formLabelRequired",o),appearance:o},"*"):null,ur.createElement(ki,{className:a("formLabel",o)},e)):null}import Bi from"react";function _t({title:e,appearance:t}){return e?Bi.createElement(Do,null,Bi.createElement(Pi,{className:a("formSubLabel",t)},e)):null}import{z as fr}from"zod";function Ei(e,t){var o,n,i,r,
|
|
283
|
+
`;import ur from"react";var it={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function gt({title:e,required:t,appearance:o=it}){return e?ur.createElement(Do,{className:a("formLabelWrapper",o)},t?ur.createElement(vi,{className:a("formLabelRequired",o),appearance:o},"*"):null,ur.createElement(ki,{className:a("formLabel",o)},e)):null}import Bi from"react";function _t({title:e,appearance:t}){return e?Bi.createElement(Do,null,Bi.createElement(Pi,{className:a("formSubLabel",t)},e)):null}import{z as fr}from"zod";function Ei(e,t){var o,n,i,r,s,p,d;try{if(t){if(t.type=="number"){let l=fr.number();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(o=m.message)!=null?o:"Value is too small"):m.requirement=="max"?l=l.max(Number(m.value),(n=m.message)!=null?n:"Value is too large"):m.requirement=="positive"?l=l.positive((i=m.message)!=null?i:"Value must be positive"):m.requirement=="negative"&&(l=l.nonpositive((r=m.message)!=null?r:"Value must be negative"));l.parse(Number(e))}if(t.type=="string"){let l=fr.string();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(s=m.message)!=null?s:"Value is too short"):m.requirement=="max"?l=l.max(Number(m.value),(p=m.message)!=null?p:"Value is too long"):m.requirement=="regex"&&(l=l.regex(new RegExp(String(m.value)),(d=m.message)!=null?d:"Value does not match requirements"));l.parse(e)}return}}catch(l){if(l instanceof fr.ZodError)return l.issues&&l.issues.length>0?l.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,l)}return null}var Ka=xr.div`
|
|
284
284
|
display: flex;
|
|
285
285
|
flex-direction: column;
|
|
286
286
|
width: 100%;
|
|
287
287
|
`,hr=xr.input`
|
|
288
|
-
${e=>
|
|
288
|
+
${e=>B(e)} {
|
|
289
289
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
290
290
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
291
291
|
font-size: 14px;
|
|
@@ -301,7 +301,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
301
301
|
padding: 0 10px;
|
|
302
302
|
margin-bottom: 10px;
|
|
303
303
|
`,qa=xr.textarea`
|
|
304
|
-
${e=>
|
|
304
|
+
${e=>B(e)} {
|
|
305
305
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
306
306
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
307
307
|
font-size: 14px;
|
|
@@ -316,14 +316,14 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
316
316
|
min-height: 70px;
|
|
317
317
|
box-sizing: border-box;
|
|
318
318
|
margin-bottom: 10px;
|
|
319
|
-
`;function Cr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:n,inputData:i}){let r=e,[
|
|
319
|
+
`;function Cr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:n,inputData:i}){let r=e,[s,p]=gr((i==null?void 0:i.text)||""),[d,l]=gr(!1),[m,c]=gr(!1),g=hr;Ai(()=>{s===""&&!d&&(l(!0),S(""))},[]),Ai(()=>{if(m){S(s);return}},[m]);function S(b){var v;if(p(b),o({text:b}),r.required===!0&&b.trim()===""){n([{id:r.id,message:`${(v=r.title)!=null?v:"Field"} is required`,hidden:!m}]);return}let x=Ei(b,r.validation);if(x&&(b.trim()!==""||r.required===!0)){n([{id:r.id,message:x,hidden:!m}]);return}n([])}r.multiline&&(g=qa);function F(){var b;switch((b=r==null?void 0:r.validation)==null?void 0:b.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return $o.createElement(Ka,null,$o.createElement(gt,{title:r.title,required:r.required,appearance:t.appearance}),$o.createElement(g,{className:a("inputComponent",t.appearance),value:s,onChange:b=>{S(b.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:F(),onBlur:()=>{c(!0)}}),$o.createElement(_t,{title:r.subtitle,appearance:t.appearance}))}import Qe,{useEffect as Oi,useState as Ii}from"react";import Ni from"styled-components";var yr="",Ya=Ni.div`
|
|
320
320
|
display: flex;
|
|
321
321
|
flex-direction: column;
|
|
322
322
|
width: 100%;
|
|
323
323
|
-webkit-appearance: none;
|
|
324
324
|
appearance: none;
|
|
325
325
|
`,Xa=Ni.select`
|
|
326
|
-
${e=>
|
|
326
|
+
${e=>B(e)} {
|
|
327
327
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
328
328
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
329
329
|
font-size: 14px;
|
|
@@ -343,16 +343,16 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
343
343
|
background-repeat: no-repeat;
|
|
344
344
|
background-size: 1.5em 1.5em;
|
|
345
345
|
-webkit-print-color-adjust: exact;
|
|
346
|
-
`;function Li({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:i}){var m,c,
|
|
347
|
-
${e=>
|
|
348
|
-
`,nt=({value:e,type:t="round",primaryColor:o="#000000",progress:n,appearance:i=it,style:r,className:
|
|
346
|
+
`;function Li({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:i}){var m,c,g,S,F,b,x,v;let r=e,[s,p]=Ii(((m=n==null?void 0:n.choice)==null?void 0:m[0])||""),[d,l]=Ii(!1);return Oi(()=>{var y,E,A,O;if(s===""&&!d){if(l(!0),r.requireSelection){p(yr);return}if(r.defaultValue&&((y=r.props.options)!=null&&y.find(h=>h.id===r.defaultValue))){let h=(E=r.props.options)==null?void 0:E.find(w=>w.id===r.defaultValue);p(h.id),o({choice:[h.id]})}else p(((A=r.props.options)==null?void 0:A[0].id)||""),o({choice:[((O=r.props.options)==null?void 0:O[0].id)||""]})}},[]),Oi(()=>{r.requireSelection&&s===yr?i([{message:"Please select an option",id:r.id}]):i([])},[s]),Qe.createElement(Ya,null,Qe.createElement(gt,{title:r.title,required:!1,appearance:t.appearance}),Qe.createElement(Xa,{value:s,onChange:y=>{p(y.target.value),o({choice:[y.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&Qe.createElement("option",{key:"null-value",value:yr,disabled:!0},(c=r.placeholder)!=null?c:"Select an option"),(g=r.props.options)==null?void 0:g.map(y=>Qe.createElement("option",{key:y.id,value:y.id},y.title))),((F=(S=r.props.options)==null?void 0:S.find(y=>y.id===s))==null?void 0:F.isOpenEnded)&&Qe.createElement(Qe.Fragment,null,Qe.createElement(gt,{title:(v=(x=(b=r.props.options)==null?void 0:b.find(y=>y.id===s))==null?void 0:x.openEndedLabel)!=null?v:"Please specify",required:!1,appearance:t.appearance}),Qe.createElement(hr,{type:"text",placeholder:"Enter your answer here",onChange:y=>{o({choice:[y.target.value]})},appearance:t.appearance})),Qe.createElement(_t,{title:r.subtitle,appearance:t.appearance}))}import mo,{useEffect as Sr,useState as $i}from"react";import Mi from"styled-components";import co from"react";import po from"react";var Di=({color:e,percentage:t,size:o})=>{let n=o*.5-2,i=2*Math.PI*n,r=(1-t)*i;return po.createElement("circle",{r:n,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==i?e:"",strokeWidth:"3px",strokeDasharray:i,strokeDashoffset:t?r:0})},Ja=({fillColor:e,size:t,percentage:o,children:n,bgColor:i="#D9D9D9",className:r,style:s})=>po.createElement("svg",{style:s,className:r,width:t,height:t,overflow:"visible"},po.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},po.createElement(Di,{color:i,size:t}),po.createElement(Di,{color:e,percentage:o,size:t})),n),Ht=Ja;import Qa from"styled-components";var Za=({color:e="#FFFFFF"})=>co.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},co.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),Ra={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ep={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},tp={border:"1px solid #000000",color:"#FFFFFF"},op={border:"1px solid #C5CBD3"},rp={color:"#FFFFFF"},ip={border:"1px solid #C5CBD3"},np=e=>e==="square"?Ra:ep,sp=(e,t)=>e==="square"?t?tp:op:t?rp:ip,lp=Qa.div`
|
|
347
|
+
${e=>ke(e)}
|
|
348
|
+
`,nt=({value:e,type:t="round",primaryColor:o="#000000",progress:n,appearance:i=it,style:r,className:s})=>{let p=np(t),d=sp(t,e);return e===!0?p=H(T(T({},p),d),{backgroundColor:i.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=T(T({},p),d),e!==!0&&t==="round"&&n!==void 0&&n!==1?co.createElement(Ht,{fillColor:o,percentage:n,size:22}):co.createElement(lp,{styleOverrides:p,style:r,role:"checkbox",className:Te(a("checkIconContainer",i),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",i),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&co.createElement(Za,{color:"#FFFFFF"}))};var ap=Mi.div`
|
|
349
349
|
display: flex;
|
|
350
350
|
flex-direction: column;
|
|
351
351
|
width: 100%;
|
|
352
352
|
-webkit-appearance: none;
|
|
353
353
|
appearance: none;
|
|
354
354
|
`,pp=Mi.button`
|
|
355
|
-
${e=>
|
|
355
|
+
${e=>B(e)} {
|
|
356
356
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
357
357
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
358
358
|
font-size: 14px;
|
|
@@ -376,8 +376,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
376
376
|
height: 48px;
|
|
377
377
|
padding: 0 18px;
|
|
378
378
|
margin-bottom: 10px;
|
|
379
|
-
`;function Ui({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:i}){var m;let r=e,[
|
|
380
|
-
${e=>
|
|
379
|
+
`;function Ui({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:n,setFormValidationErrors:i}){var m;let r=e,[s,p]=$i((n==null?void 0:n.choice)||[]),[d,l]=$i(!1);return Sr(()=>{s.length==0&&!d&&(l(!0),o({choice:[]}))},[]),Sr(()=>{o({choice:s})},[s]),Sr(()=>{r.required&&(s.length<r.props.minChoices||s.length>r.props.maxChoices)?i([{message:"",id:r.id}]):i([])},[s]),mo.createElement(ap,null,mo.createElement(gt,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>mo.createElement(pp,{appearance:t.appearance,className:a(s.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":s.includes(c.id),onClick:()=>{if(s.includes(c.id)){p(s.filter(g=>g!==c.id));return}s.length<r.props.maxChoices?p([...s,c.id]):s.length==1&&r.props.maxChoices==1&&p([c.id])}},c.title,mo.createElement(nt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),mo.createElement(_t,{title:r.subtitle,appearance:t.appearance}))}import Mo from"react";import Wi from"styled-components";import dp from"dompurify";function ce(e){return{__html:dp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var cp=Wi.h1`
|
|
380
|
+
${e=>B(e)} {
|
|
381
381
|
font-style: normal;
|
|
382
382
|
font-weight: 700;
|
|
383
383
|
font-size: ${e=>e.size=="small"?"15px":"18px"};
|
|
@@ -389,7 +389,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
389
389
|
color: ${e=>e.appearance.theme.colorText};
|
|
390
390
|
}
|
|
391
391
|
`,mp=Wi.h2`
|
|
392
|
-
${e=>
|
|
392
|
+
${e=>B(e)} {
|
|
393
393
|
font-style: normal;
|
|
394
394
|
font-weight: 400;
|
|
395
395
|
font-size: 14px;
|
|
@@ -397,7 +397,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
397
397
|
letter-spacing: 0.28px;
|
|
398
398
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
399
399
|
}
|
|
400
|
-
`;function
|
|
400
|
+
`;function Ae({appearance:e,title:t,subtitle:o,size:n="medium",classPrefix:i=""}){return Mo.createElement(Mo.Fragment,null,Mo.createElement(cp,{appearance:e,className:a(`${i}${i?ao(n):n}Title`,e),dangerouslySetInnerHTML:ce(t),size:n}),o&&Mo.createElement(mp,{appearance:e,className:a(`${i}${i?ao(n):n}Subtitle`,e),dangerouslySetInnerHTML:ce(o),size:n}))}import*as br from"react";var zi=e=>br.createElement("svg",T({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),br.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));var fp=Uo.div`
|
|
401
401
|
display: flex;
|
|
402
402
|
flex-direction: column;
|
|
403
403
|
justify-content: flex-end;
|
|
@@ -415,7 +415,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
415
415
|
`,hp=Uo.div`
|
|
416
416
|
padding-left: 1px;
|
|
417
417
|
padding-right: 1px;
|
|
418
|
-
`,Cp={text:Cr,multipleChoice:Li,multipleChoiceList:Ui},Tr="frigade-multiInputStepTypeData";function Hi({flowId:e,stepData:t,canContinue:o,setCanContinue:n,onSaveData:i,appearance:r,customFormElements:
|
|
418
|
+
`,Cp={text:Cr,multipleChoice:Li,multipleChoiceList:Ui},Tr="frigade-multiInputStepTypeData";function Hi({flowId:e,stepData:t,canContinue:o,setCanContinue:n,onSaveData:i,appearance:r,customFormElements:s,prefillData:p}){var O;let d=t.props,[l,m]=wr([]),[c,g]=wr([]),{userId:S}=so(),[F,b]=wr(E()||(p?p[t.id]:null)||{}),{readonly:x}=up(X),v=T(T({},Cp),s);_i(()=>{n(l.length===0)},[l,n]),_i(()=>{i(F)},[F]);function y(h,w){b(f=>{let P=H(T({},f),{[h.id]:w});return window&&window.localStorage&&!x&&window.localStorage.setItem(A(),JSON.stringify(P)),P})}function E(){if(window&&window.localStorage){let h=window.localStorage.getItem(A());if(h)return JSON.parse(h)}return null}function A(){return`${Tr}-${e}-${t.id}-${S}`}return Ft.createElement(hp,{className:a("multiInput",r)},Ft.createElement(Ae,{appearance:r,title:t.title,subtitle:t.subtitle}),Ft.createElement(fp,{className:a("multiInputContainer",r)},(O=d.data)==null?void 0:O.map(h=>{let w=l.reverse().find(f=>f.id===h.id);return v[h.type]?Ft.createElement("span",{key:h.id,"data-field-id":h.id,className:a("multiInputField",r)},v[h.type]({formInput:h,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:n,onSaveData:i,appearance:r},onSaveInputData:f=>{!c.includes(h.id)&&f&&(f==null?void 0:f.text)!==""&&g(P=>[...P,h.id]),y(h,f)},inputData:F[h.id],setFormValidationErrors:f=>{m(P=>f.length===0?P.filter(N=>N.id!==h.id):[...P,...f])}}),w&&w.message&&c.includes(h.id)&&w.hidden!==!0&&Ft.createElement(gp,{key:h.id,style:{overflow:"hidden"},appearance:r,className:a("multiInputValidationError",r)},Ft.createElement(xp,{appearance:r,className:a("multiInputValidationErrorIcon",r)},Ft.createElement(zi,null)),w.message)):null})))}import jt from"styled-components";var ji=jt.div`
|
|
419
419
|
align-items: center;
|
|
420
420
|
display: flex;
|
|
421
421
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
@@ -474,7 +474,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
474
474
|
justify-content: center;
|
|
475
475
|
align-content: center;
|
|
476
476
|
align-items: center;
|
|
477
|
-
${e=>
|
|
477
|
+
${e=>B(e)} {
|
|
478
478
|
display: flex;
|
|
479
479
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
480
480
|
width: ${e=>e.type==="full-width"?"100%":"auto"};
|
|
@@ -489,7 +489,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
489
489
|
font-size: ${e=>e.size=="small"?"14px":"15px"};
|
|
490
490
|
line-height: 20px;
|
|
491
491
|
font-weight: 500;
|
|
492
|
-
${e=>
|
|
492
|
+
${e=>ke(e)}
|
|
493
493
|
}
|
|
494
494
|
|
|
495
495
|
font-family: inherit;
|
|
@@ -504,7 +504,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
504
504
|
cursor: not-allowed;
|
|
505
505
|
}
|
|
506
506
|
`,Wo=Qi.div`
|
|
507
|
-
${e=>
|
|
507
|
+
${e=>B(e)} {
|
|
508
508
|
display: flex;
|
|
509
509
|
flex-direction: row;
|
|
510
510
|
justify-content: flex-start;
|
|
@@ -514,9 +514,9 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
514
514
|
margin-right: 8px;
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
`,
|
|
517
|
+
`,oe=({onClick:e,title:t,style:o,disabled:n,type:i="inline",size:r="medium",secondary:s=!1,appearance:p,withMargin:d=!0,classPrefix:l="",loading:m=!1})=>{var g;function c(){let S=s?"buttonSecondary":"button";return l===""?S:`${l}${ao(S)}`}return Ji.createElement(Sp,{secondary:s,appearance:p,disabled:n||m,loading:(g=m==null?void 0:m.toString())!=null?g:"",onClick:e,styleOverrides:o,type:i,withMargin:d,size:r,className:a(c(),p)},m?Ji.createElement(Xi,{className:a("buttonLoader",p)}):t!=null?t:"Continue")};var Zi=({step:e,canContinue:t,appearance:o,onPrimaryClick:n,onSecondaryClick:i,selectedStep:r,steps:s,onBack:p,allowBackNavigation:d,errorMessage:l,isSaving:m})=>{var S;let c=s.length>1&&r!=0&&d,g=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return xt.createElement(xt.Fragment,null,l!==null&&l!=null&&xt.createElement(Vi,{appearance:o,className:a("formCTAError",o)},l),xt.createElement(ji,{showBackButton:c,className:a("formCTAContainer",o)},c&&xt.createElement(oe,{title:(S=e.backButtonTitle)!=null?S:"Back",onClick:p,secondary:!0,withMargin:!1,type:g,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),xt.createElement(Gi,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?xt.createElement(oe,{title:e.secondaryButtonTitle,onClick:i,secondary:!0,withMargin:!1,type:g,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?xt.createElement(oe,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:n,type:g,appearance:o,loading:m}):null)))};import Fr from"react";import bp from"styled-components";var wp=bp.div`
|
|
518
518
|
text-align: center;
|
|
519
|
-
`,Ri=({stepCount:e=0,currentStep:t=0,className:o,appearance:n})=>{let{theme:i}=
|
|
519
|
+
`,Ri=({stepCount:e=0,currentStep:t=0,className:o,appearance:n})=>{let{theme:i}=te().mergeAppearanceWithDefault(n);return Fr.createElement(wp,{className:o},Fr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,s)=>Fr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?i.colorPrimary:"#E6E6E6"}))))};import kt from"react";import Vt from"styled-components";import{useContext as Tp}from"react";function ae(){let e=Tp(X);function t(i){n(i.primaryButtonUri,i.primaryButtonUriTarget)}function o(i){n(i.secondaryButtonUri,i.secondaryButtonUriTarget)}function n(i,r){if(!i)return;let s=i.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(s="_self"),e.navigate(i,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:n}}var Fp=Vt.div`
|
|
520
520
|
display: flex;
|
|
521
521
|
flex-wrap: wrap;
|
|
522
522
|
align-content: center;
|
|
@@ -564,7 +564,7 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
564
564
|
margin-top: 12px;
|
|
565
565
|
margin-bottom: 16px;
|
|
566
566
|
max-width: 70%;
|
|
567
|
-
`;function en({stepData:e,appearance:t}){var n,i;let{handleUrl:o}=ae();return kt.createElement("div",null,kt.createElement(Bp,null,e.title),kt.createElement(Ep,null,e.subtitle),kt.createElement(Fp,null,(i=(n=e.props)==null?void 0:n.links)==null?void 0:i.map(r=>kt.createElement(kp,{key:r.title},kt.createElement(Pp,{src:r.imageUri}),kt.createElement(vp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var
|
|
567
|
+
`;function en({stepData:e,appearance:t}){var n,i;let{handleUrl:o}=ae();return kt.createElement("div",null,kt.createElement(Bp,null,e.title),kt.createElement(Ep,null,e.subtitle),kt.createElement(Fp,null,(i=(n=e.props)==null?void 0:n.links)==null?void 0:i.map(r=>kt.createElement(kp,{key:r.title},kt.createElement(Pp,{src:r.imageUri}),kt.createElement(vp,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var s;r.uri&&o(r.uri,(s=r.uriTarget)!=null?s:"_blank")}},r.title)))))}import Gt,{useEffect as $p}from"react";import Ho from"styled-components";import kr from"react";var zo=({style:e,className:t})=>kr.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},kr.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),kr.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 uo,{useRef as Ap,useState as Op}from"react";import _o from"styled-components";var Ip=_o.div`
|
|
568
568
|
display: flex;
|
|
569
569
|
align-items: center;
|
|
570
570
|
justify-content: flex-start;
|
|
@@ -600,31 +600,31 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
600
600
|
height: 100%;
|
|
601
601
|
min-height: 260px;
|
|
602
602
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
603
|
-
`;function Ze({appearance:e,videoUri:t}){let o=Ap(),[n,i]=
|
|
604
|
-
${e=>
|
|
603
|
+
`;function Ze({appearance:e,videoUri:t}){let o=Ap(),[n,i]=Op(!1);if(t.includes("youtube")){let r=t.split("v=")[1],s=r.indexOf("&");return s!==-1&&(r=r.substring(0,s)),uo.createElement(Dp,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${r}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e})}return uo.createElement(Ip,{className:a("videoPlayerWrapper",e),appearance:e},!n&&uo.createElement(Np,{onClick:()=>{i(!0),o.current.play()},appearance:e},uo.createElement(zo,null)),uo.createElement(Lp,{appearance:e,controls:n,ref:o,play:n,src:t}))}var Mp=Ho.div`
|
|
604
|
+
${e=>B(e)} {
|
|
605
605
|
display: flex;
|
|
606
606
|
flex-direction: column;
|
|
607
607
|
justify-content: center;
|
|
608
608
|
}
|
|
609
609
|
`,Up=Ho.img`
|
|
610
|
-
${e=>
|
|
610
|
+
${e=>B(e)} {
|
|
611
611
|
width: 100%;
|
|
612
612
|
height: auto;
|
|
613
613
|
max-height: 250px;
|
|
614
614
|
margin-bottom: 24px;
|
|
615
615
|
}
|
|
616
616
|
`,Wp=Ho.div`
|
|
617
|
-
${e=>
|
|
617
|
+
${e=>B(e)} {
|
|
618
618
|
margin-bottom: 24px;
|
|
619
619
|
}
|
|
620
620
|
`,zp=Ho.div`
|
|
621
|
-
${e=>
|
|
621
|
+
${e=>B(e)} {
|
|
622
622
|
width: 100%;
|
|
623
623
|
height: auto;
|
|
624
624
|
max-height: 250px;
|
|
625
625
|
margin-bottom: 24px;
|
|
626
626
|
}
|
|
627
|
-
`;function tn({stepData:e,appearance:t,setCanContinue:o}){return $p(()=>{o(!0)},[]),Gt.createElement(Mp,{className:a("callToActionContainer",t)},Gt.createElement(Wp,{className:a("callToActionTextContainer",t)},Gt.createElement(
|
|
627
|
+
`;function tn({stepData:e,appearance:t,setCanContinue:o}){return $p(()=>{o(!0)},[]),Gt.createElement(Mp,{className:a("callToActionContainer",t)},Gt.createElement(Wp,{className:a("callToActionTextContainer",t)},Gt.createElement(Ae,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Gt.createElement(Up,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Gt.createElement(zp,{appearance:t,className:a("callToActionVideo",t)},Gt.createElement(Ze,{appearance:t,videoUri:e.videoUri})))}import st,{useEffect as Pr,useState as vr}from"react";import ht from"styled-components";var on=ht.div`
|
|
628
628
|
width: auto;
|
|
629
629
|
display: flex;
|
|
630
630
|
flex-direction: column;
|
|
@@ -677,8 +677,8 @@ var ia=Object.defineProperty,na=Object.defineProperties;var sa=Object.getOwnProp
|
|
|
677
677
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
678
678
|
display: flex;
|
|
679
679
|
align-self: center;
|
|
680
|
-
`;var cn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:n})=>{let i=e.props,[r,
|
|
681
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map(([n,i])=>typeof i=="object"?`${n} { ${Object.entries(i).map(([l,p])=>`${Bo(l)}: ${p};`).join(" ")} }`:`${Bo(n)}: ${i};`).join(" ")} }`).join(" ")}`;function ne({appearance:e}){if(!e||!e.styleOverrides)return go.createElement(go.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,n])=>typeof n=="object");return t.length===0?go.createElement(go.Fragment,null):go.createElement(jp,{inlineStyles:t})}var fn=({flowId:e,customStepTypes:t={},type:o="inline",visible:n,setVisible:i,customVariables:r,customFormElements:l,onComplete:p,appearance:d,hideOnFlowCompletion:s=!0,onStepCompletion:m,onButtonClick:c,dismissible:x=!0,endFlowOnDismiss:S=!1,modalPosition:F="center",repeatable:b=!1,onDismiss:g,showPagination:B=!1,allowBackNavigation:y=!1,validationHandler:E,showFrigadeBranding:A=!1,onFormDataChange:I,showFooter:h=!0,prefillData:w={},updateUrlOnPageChange:f=!1})=>{var D;let{getFlow:P,getFlowSteps:N,isLoading:L,targetingLogicShouldHideFlow:O,getFlowStatus:U,getCurrentStepIndex:W,markFlowCompleted:V,markFlowNotStarted:le,markStepStarted:Z}=ee(),q=W(e),{mergeAppearanceWithDefault:he}=oe(),[Pe,Se]=un(!1),[G,Y]=un(!1),{setOpenFlowState:te,getOpenFlowState:Ve,hasOpenModals:Le}=ve(),R=N(e);d=he(d);let[ce,Ae]=n!==void 0&&i!==void 0?[n,i]:[Ve(e,!0),_=>te(e,_)];if(Br(()=>{!Pe&&!L&&(Se(!0),(U(e)===Q&&b||U(e)===$e)&&(U(e)===Q&&b&&le(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(J=>{J.startsWith(Tr)&&window.localStorage.removeItem(J)})),Se(!0))},[Pe,Se,L]),Br(()=>{window&&y&&!G&&(window.location.hash=R[q].id,Y(!0))},[y,G,Y]),Br(()=>{var _;if(window&&((_=window==null?void 0:window.location)!=null&&_.hash)&&window.location.hash.replace("#","")!==R[q].id){let J=window.location.hash.replace("#",""),Ce=R.findIndex(De=>De.id===J);Ce!==-1&&Ce!==q&&Z(e,R[Ce].id)}},[(D=window==null?void 0:window.location)==null?void 0:D.hash]),L)return null;let be=P(e);if(!be||O(be)||!R||n!==void 0&&n===!1||U(e)===Q&&s||(o=="modal"||o=="corner-modal")&&Le(e))return null;let M=()=>{Ae(!1),g&&g(),S===!0&&V(e)};if(F=="center"&&o==="modal"||o==="large-modal"){let _={padding:"24px"};return o==="large-modal"?(_.width="85%",_.height="90%",_.maxHeight="800px",_.minHeight="500px",_.padding="0"):_.width="400px",Re.createElement(Je,{appearance:d,onClose:M,visible:ce,style:_,dismissible:x,showFrigadeBranding:A},Re.createElement(ne,{appearance:d}),Re.createElement(jo,{appearance:d,steps:R,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:i,setShowModal:Ae,onDismiss:g,showPagination:B,customFormElements:l,allowBackNavigation:y,validationHandler:E,onFormDataChange:I,showFooter:h,prefillData:w,updateUrlOnPageChange:f}))}return o==="modal"&&F!=="center"?Re.createElement(No,{appearance:d,onClose:M,visible:ce,modalPosition:F},Re.createElement(ne,{appearance:d}),Re.createElement(jo,{appearance:d,steps:R,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:i,setShowModal:Ae,onDismiss:g,showPagination:B,customFormElements:l,allowBackNavigation:y,validationHandler:E,onFormDataChange:I,showFooter:h,prefillData:w,updateUrlOnPageChange:f})):Re.createElement(Re.Fragment,null,Re.createElement(ne,{appearance:d}),Re.createElement(jo,{appearance:d,steps:R,selectedStep:q,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:i,setShowModal:Ae,onDismiss:g,showPagination:B,customFormElements:l,allowBackNavigation:y,validationHandler:E,onFormDataChange:I,showFooter:h,prefillData:w,updateUrlOnPageChange:f}))},gn=fn;import{useCallback as Er,useContext as Vp,useEffect as Gp}from"react";function Ar(){let{organizationId:e,userId:t,setOrganizationId:o}=Vp(X),{mutateUserFlowState:n}=Me(),{config:i,apiUrl:r}=Xe(),l=Ut(),{verifySDKInitiated:p}=Wt();function d(x,S){return`frigade-user-group-registered-${x}-${S}`}Gp(()=>{if(t&&e){if(t.startsWith(zt))return;let x=d(t,e);localStorage.getItem(x)||(l(`${r}userGroups`,H(T({},i),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(x,"true"))}},[t,e]);let s=Er(x=>$(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,properties:x};yield l(`${r}userGroups`,H(T({},i),{method:"POST",body:JSON.stringify(S)})),n()}),[e,t,i,n]),m=Er((x,S)=>$(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let b={foreignUserId:t,foreignUserGroupId:e,events:[{event:x,properties:S}]};yield l(`${r}userGroups`,H(T({},i),{method:"POST",body:JSON.stringify(b)})),n()}),[e,t,i,n]),c=Er((x,S)=>$(this,null,function*(){if(p())if(S){let F=d(t,x);localStorage.setItem(F,"true"),o(x);let b={foreignUserId:t,foreignUserGroupId:x,properties:S};yield l(`${r}userGroups`,H(T({},i),{method:"POST",body:JSON.stringify(b)})),n()}else o(x)}),[t,i,n]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:m}}var xn="frigade-xFrigade_guestUserId",ho="frigade-xFrigade_userId",hn=({})=>{let{setFlowResponses:e}=no(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:n}=Me(),{userId:i,setUserId:r}=so(),[l,p]=Vo(i),{getFlowStatus:d}=ee(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:x}=Kp(X),[S,F]=Vo([]),[b,g]=Vo([]),{organizationId:B}=Ar(),[y,E]=Vo(B);xo(()=>{if(!o&&t)for(let w=0;w<t.length;w++){let f=t[w],P=s.find(N=>N.slug===(f==null?void 0:f.flowId));if(P&&f&&f.shouldTrigger===!0&&P.type=="FORM"&&P.triggerType==="AUTOMATIC"&&!b.includes(P.slug)){setTimeout(()=>{A(f.flowId)},500);break}}},[o,t]),xo(()=>{x.length>0&&n()},[x]);function A(w){let f=s.find(P=>P.slug===w);f&&f.triggerType==="AUTOMATIC"&&!b.includes(f.slug)&&(g([...b,f.slug]),F([f]))}function I(){if(!i){let w=localStorage.getItem(ho);if(w){r(w);return}let f=localStorage.getItem(xn);if(f){r(f);return}c(!0);let P=zt+qp();try{localStorage.setItem(xn,P)}catch(N){console.log("Failed to save guest user id locally: Local storage unavailable",N)}r(N=>N||P)}}xo(()=>{try{if(s){let w=[];s.forEach(f=>{if(f.data){let P=f.data.match(/"imageUri":"(.*?)"/g);P&&P.forEach(N=>{let L=N.replace('"imageUri":"',"").replace('"',"");if(w.includes(L))return;let O=new Image;O.src=L,w.push(L)})}})}}catch(w){}},[s]),xo(()=>{if(i!==l&&(e([]),n()),p(i),i&&!i.startsWith(zt))try{localStorage.setItem(ho,i)}catch(w){console.log("Failed to save user id locally: Local storage available",w)}i===null&&setTimeout(()=>{i===null&&I()},50)},[i,s,m]),xo(()=>{B!=y&&(E(B),e([]),n())},[B,y,E]);function h(){return Pt.createElement(Pt.Fragment,null,S.map(w=>d(w.slug)!==$e?null:Pt.createElement("span",{key:w.slug},Pt.createElement(gn,{flowId:w.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Pt.createElement(Pt.Fragment,null,Pt.createElement(h,null))};import{ErrorBoundary as yd}from"react-error-boundary";var Cn={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function Yp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,n])=>{if(Cn[o]){let i=Cn[o].split("."),r=t;i.forEach((l,p)=>{r[l]||(r[l]=p===i.length-1?n:{}),r=r[l]})}}),t}function Xp(e){if(!e)return;let t=ge({},e),o={};return Object.keys(t).forEach(n=>{let i=`.fr-${n}`;o[i]=t[n]}),o}function yn(e){let{theme:t,styleOverrides:o}=e,n=Yp(t),i=Xp(o);return{overrides:n,css:i}}import pd from"styled-components";import{compose as dd,variant as bn}from"styled-system";import Sn from"react";import Jp,{ThemeProvider as Qp,useTheme as Zp}from"styled-components";import{border as Rp,color as ed,compose as td,get as od,shadow as rd,space as id,system as nd,typography as sd}from"styled-system";var ld={width:{property:"width",scale:"sizes",transform:(e,t)=>od(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},ad=Jp("div")(({css:e})=>e,td(Rp,ed,rd,id,sd,nd(ld))),Co=i=>{var r=i,{as:e,children:t,overrides:o}=r,n=Ie(r,["as","children","overrides"]);let l=Zp(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Sn.createElement(ad,T(T({as:e},p),n),t);if(o!==void 0){let s=ge(l,o);return Sn.createElement(Qp,{theme:s},d())}return d()};var yo={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}},wn=pd(Co)(()=>({whiteSpace:"nowrap"}),dd(bn({scale:"components.Button",variants:"components.Button"}),bn({prop:"size",variants:cd})));import md from"styled-components";import{variant as ud,system as fd}from"styled-system";var Go={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var Tn=md(Co)(ud({scale:"components.Text",variants:"components.Text"}),fd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Fn=4,kn="px",gd=20,xd=Object.fromEntries(Array.from(Array(gd+1),(e,t)=>t===0?[.5,`${.5*Fn}${kn}`]:[t,`${t*Fn}${kn}`])),Kt={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},Ir={colors:H(T({},Kt),{neutral:{foreground:Kt.gray300},primary:{background:Kt.blue500,foreground:Kt.white,inverted:Kt.blue500},negative:{foreground:Kt.red500}}),fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:xd,components:{Button:yo,Text:Go}};var Pn="https://api.frigade.com",X=hd({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:it,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Pn,readonly:!1,debug:!1});function Sd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var bd=({publicApiKey:e,userId:t,organizationId:o,config:n,children:i})=>{var q,he,Pe,Se,G;let[r,l]=je(t||null),[p,d]=je(o||null),[s,m]=je([]),[c,x]=je([]),[S,F]=je([]),[b,g]=je({}),[B,y]=je({}),[E,A]=je([]),[I,h]=je({}),[w,f]=je(!1),[P,N]=je(!1),[L,O]=je(!V(e)),U=(Y,te)=>{if(te==="_blank"){window.open(Y,"_blank");return}setTimeout(()=>{window.location.href=Y},50)},W={theme:T(T({},it.theme),(he=(q=n==null?void 0:n.defaultAppearance)==null?void 0:q.theme)!=null?he:{}),styleOverrides:T(T({},it.styleOverrides),(Se=(Pe=n==null?void 0:n.defaultAppearance)==null?void 0:Pe.styleOverrides)!=null?Se:{})};function V(Y){return!!(Y&&Y.length>10&&Y.substring(0,10)==="api_public")}Ko(()=>{t&&l(t)},[t]),Ko(()=>{r&&window&&window.localStorage&&window.localStorage.getItem(ho)&&window.localStorage.getItem(ho)!==r&&Sd()},[r]),Ko(()=>{o&&d(o)},[o]),Ko(()=>{if(V(e))O(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),O(!0);return}},[e,O]);let le={publicApiKey:e,userId:r,setUserId:l,setFlows:m,flows:s,failedFlowResponses:c,setFailedFlowResponses:x,flowResponses:S,setFlowResponses:F,userProperties:b,setUserProperties:g,openFlowStates:B,setOpenFlowStates:y,completedFlowsToKeepOpenDuringSession:E,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:I,setCustomVariables:h,isNewGuestUser:w,setIsNewGuestUser:f,hasActiveFullPageFlow:P,setHasActiveFullPageFlow:N,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:U,defaultAppearance:W,shouldGracefullyDegrade:L,setShouldGracefullyDegrade:O,apiUrl:n&&n.apiUrl?n.apiUrl:Pn,readonly:n&&n.readonly?n.readonly:!1,debug:n&&n.debug?n.debug:!1};if(L)return vt.createElement(X.Provider,{value:le},i);let{overrides:Z}=yn(W);return vt.createElement(yd,{fallback:vt.createElement(vt.Fragment,null,i)},vt.createElement(X.Provider,{value:le},vt.createElement(Cd,{theme:ge(W.theme,Ir,Z!=null?Z:{},(G=n==null?void 0:n.theme)!=null?G:{})},i,vt.createElement(hn,null))))};import pc from"react";import xe,{useEffect as ol,useState as rl}from"react";import qe,{useState as Wd}from"react";import At from"styled-components";import Xo from"react";import Bt from"react";import Bn from"styled-components";var vn=Bn.span`
|
|
680
|
+
`;var cn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:n})=>{let i=e.props,[r,s]=vr([]),[p,d]=vr(!1),[l,m]=vr(e.id);return Pr(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}))},[p]),Pr(()=>{l!==e.id&&(m(e.id),s([]))},[e]),Pr(()=>{o({choice:r}),r.length>=i.minChoices?t(!0):t(!1)},[r]),st.createElement(on,{className:a("selectListContainer",n)},st.createElement(rn,null,st.createElement(nn,{className:a("selectListTitle",n)},e.title),st.createElement(sn,{appearance:n,className:a("selectListSubtitle",n)},e.subtitle)),i.options.map((c,g)=>{let S=r.includes(c.id);return st.createElement(ln,{key:`select-item-${g}`,onClick:()=>{if(r.includes(c.id)){s(r.filter(F=>F!==c.id));return}r.length<i.maxChoices?s([...r,c.id]):r.length==1&&i.maxChoices==1&&s([c.id])},hideBottomBorder:g===i.options.length-1,className:a("selectListSelectItem",n)},st.createElement(an,{className:a("selectListItemImage",n)},c.imageUri&&st.createElement(pn,{src:c.imageUri,alt:`select-icon-${g}`}),st.createElement(dn,{appearance:n,className:a("selectListSelectItemText",n)},c.title)),st.createElement(nt,{appearance:n,value:S,primaryColor:n.theme.colorPrimary}))}))};import Ue,{useEffect as mn,useState as fo}from"react";var _p=({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),jo=({appearance:e,steps:t,selectedStep:o,customStepTypes:n,customVariables:i,onButtonClick:r,onStepCompletion:s,flowId:p,type:d,hideOnFlowCompletion:l,onComplete:m,setVisible:c,setShowModal:g,onDismiss:S,showPagination:F=!1,customFormElements:b,allowBackNavigation:x,validationHandler:v,onFormDataChange:y,showFooter:E,prefillData:A,updateUrlOnPageChange:O})=>{var U;let w=T(T({},{linkCollection:en,multiInput:Hi,callToAction:tn,selectList:cn}),n),{primaryCTAClickSideEffects:f,secondaryCTAClickSideEffects:P}=ae(),[N,L]=fo(!1),[I,q]=fo({}),[M,V]=fo(!1),[le,pe]=fo(!1),[_,se]=fo(null),de=(U=t[o])!=null?U:null,{markStepCompleted:be,markStepStarted:G,isLoading:Y,updateCustomVariables:ee,markFlowCompleted:Ve}=R();mn(()=>{ee(i)},[i,Y]),mn(()=>{y&&y(I,Le(),t[o],o)},[I]);function Le(){var z;return{data:(z=I[t[o].id])!=null?z:{},stepId:t[o].id,customVariables:i}}function Z(D,z,J){let ye=o+1<t.length?t[o+1]:null;return s&&s(D,J,ye,I,Le()),r?r(D,o,z,ye):!0}function ue(D,z){q(J=>{let ye={};return ye[D.id]=z,T(T({},J),ye)})}function Oe(D){return D.selectedStep.imageUri?Ue.createElement(Yi,{image:D.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let we=E&&Ue.createElement(Zi,{step:t[o],canContinue:N&&!M,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>$(void 0,null,function*(){if(V(!0),v){let J=yield v(t[o],o,t[o+1],I,Le());if(J!==!0){se(typeof J=="string"?J:null),V(!1);return}else se(null)}let D=T({},Le());yield be(p,t[o].id,D),o+1<t.length&&(yield G(p,t[o+1].id));let z=Z(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),S&&S(),l&&z&&(c&&c(!1),g(!1)),yield Ve(p)),f(t[o]),V(!1),window&&x&&o+1<t.length&&(window.location.hash=t[o+1].id),window&&!x&&O&&o+1<t.length){let J=new URL(window.location.href);J.searchParams.set("p",t[o+1].id),window.history.pushState({},"",J.toString())}}),onSecondaryClick:()=>{Z(t[o],"secondary",o),P(t[o])},onBack:()=>$(void 0,null,function*(){o-1>=0&&(V(!0),yield G(p,t[o-1].id),V(!1))}),steps:t,allowBackNavigation:x,errorMessage:_,isSaving:M});return Ue.createElement(Ue.Fragment,null,Ue.createElement(Ki,{className:a("formContainer",e)},Ue.createElement(_p,{id:o,shouldWrap:d==="large-modal"},Ue.createElement(qi,{key:de.id,type:d,className:a("formContent",e)},t.map(D=>{let z=w[D.type];return de.id!==D.id?null:Ue.createElement(z,{key:D.id,stepData:D,canContinue:N,setCanContinue:L,onSaveData:J=>{ue(D,J)},appearance:e,customFormElements:b,flowId:p,prefillData:A})}),F&&Ue.createElement(Ri,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),we)),d=="large-modal"&&Ue.createElement(Oe,{selectedStep:t[o]})))};import go from"react";import{createGlobalStyle as Hp}from"styled-components";var jp=Hp`
|
|
681
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map(([n,i])=>typeof i=="object"?`${n} { ${Object.entries(i).map(([s,p])=>`${Bo(s)}: ${p};`).join(" ")} }`:`${Bo(n)}: ${i};`).join(" ")} }`).join(" ")}`;function ie({appearance:e}){if(!e||!e.styleOverrides)return go.createElement(go.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,n])=>typeof n=="object");return t.length===0?go.createElement(go.Fragment,null):go.createElement(jp,{inlineStyles:t})}var fn=({flowId:e,customStepTypes:t={},type:o="inline",visible:n,setVisible:i,customVariables:r,customFormElements:s,onComplete:p,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:m,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:S=!1,modalPosition:F="center",repeatable:b=!1,onDismiss:x,showPagination:v=!1,allowBackNavigation:y=!1,validationHandler:E,showFrigadeBranding:A=!1,onFormDataChange:O,showFooter:h=!0,prefillData:w={},updateUrlOnPageChange:f=!1})=>{var D;let{getFlow:P,getFlowSteps:N,isLoading:L,targetingLogicShouldHideFlow:I,getFlowStatus:q,getCurrentStepIndex:M,markFlowCompleted:V,markFlowNotStarted:le,markStepStarted:pe}=R(),_=M(e),{mergeAppearanceWithDefault:se}=te(),[de,be]=un(!1),[G,Y]=un(!1),{setOpenFlowState:ee,getOpenFlowState:Ve,hasOpenModals:Le}=Be(),Z=N(e);d=se(d);let[ue,Oe]=n!==void 0&&i!==void 0?[n,i]:[Ve(e,!0),z=>ee(e,z)];if(Br(()=>{!de&&!L&&(be(!0),(q(e)===Q&&b||q(e)===$e)&&(q(e)===Q&&b&&le(e),window&&window.localStorage&&Object.keys(window.localStorage).forEach(J=>{J.startsWith(Tr)&&window.localStorage.removeItem(J)})),be(!0))},[de,be,L]),Br(()=>{window&&y&&!G&&(window.location.hash=Z[_].id,Y(!0))},[y,G,Y]),Br(()=>{var z;if(window&&((z=window==null?void 0:window.location)!=null&&z.hash)&&window.location.hash.replace("#","")!==Z[_].id){let J=window.location.hash.replace("#",""),ye=Z.findIndex(De=>De.id===J);ye!==-1&&ye!==_&&pe(e,Z[ye].id)}},[(D=window==null?void 0:window.location)==null?void 0:D.hash]),L)return null;let we=P(e);if(!we||I(we)||!Z||n!==void 0&&n===!1||q(e)===Q&&l||(o=="modal"||o=="corner-modal")&&Le(e))return null;let U=()=>{Oe(!1),x&&x(),S===!0&&V(e)};if(F=="center"&&o==="modal"||o==="large-modal"){let z={padding:"24px"};return o==="large-modal"?(z.width="85%",z.height="90%",z.maxHeight="800px",z.minHeight="500px",z.padding="0"):z.width="400px",Re.createElement(Je,{appearance:d,onClose:U,visible:ue,style:z,dismissible:g,showFrigadeBranding:A},Re.createElement(ie,{appearance:d}),Re.createElement(jo,{appearance:d,steps:Z,selectedStep:_,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:i,setShowModal:Oe,onDismiss:x,showPagination:v,customFormElements:s,allowBackNavigation:y,validationHandler:E,onFormDataChange:O,showFooter:h,prefillData:w,updateUrlOnPageChange:f}))}return o==="modal"&&F!=="center"?Re.createElement(No,{appearance:d,onClose:U,visible:ue,modalPosition:F},Re.createElement(ie,{appearance:d}),Re.createElement(jo,{appearance:d,steps:Z,selectedStep:_,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:i,setShowModal:Oe,onDismiss:x,showPagination:v,customFormElements:s,allowBackNavigation:y,validationHandler:E,onFormDataChange:O,showFooter:h,prefillData:w,updateUrlOnPageChange:f})):Re.createElement(Re.Fragment,null,Re.createElement(ie,{appearance:d}),Re.createElement(jo,{appearance:d,steps:Z,selectedStep:_,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:p,setVisible:i,setShowModal:Oe,onDismiss:x,showPagination:v,customFormElements:s,allowBackNavigation:y,validationHandler:E,onFormDataChange:O,showFooter:h,prefillData:w,updateUrlOnPageChange:f}))},gn=fn;import{useCallback as Er,useContext as Vp,useEffect as Gp}from"react";function Ar(){let{organizationId:e,userId:t,setOrganizationId:o}=Vp(X),{mutateUserFlowState:n}=Me(),{config:i,apiUrl:r}=Xe(),s=Ut(),{verifySDKInitiated:p}=Wt();function d(g,S){return`frigade-user-group-registered-${g}-${S}`}Gp(()=>{if(t&&e){if(t.startsWith(zt))return;let g=d(t,e);localStorage.getItem(g)||(s(`${r}userGroups`,H(T({},i),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let l=Er(g=>$(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let S={foreignUserId:t,foreignUserGroupId:e,properties:g};yield s(`${r}userGroups`,H(T({},i),{method:"POST",body:JSON.stringify(S)})),n()}),[e,t,i,n]),m=Er((g,S)=>$(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let b={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:S}]};yield s(`${r}userGroups`,H(T({},i),{method:"POST",body:JSON.stringify(b)})),n()}),[e,t,i,n]),c=Er((g,S)=>$(this,null,function*(){if(p())if(S){let F=d(t,g);localStorage.setItem(F,"true"),o(g);let b={foreignUserId:t,foreignUserGroupId:g,properties:S};yield s(`${r}userGroups`,H(T({},i),{method:"POST",body:JSON.stringify(b)})),n()}else o(g)}),[t,i,n]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var xn="frigade-xFrigade_guestUserId",ho="frigade-xFrigade_userId",hn=({})=>{let{setFlowResponses:e}=no(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:n}=Me(),{userId:i,setUserId:r}=so(),[s,p]=Vo(i),{getFlowStatus:d}=R(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Kp(X),[S,F]=Vo([]),[b,x]=Vo([]),{organizationId:v}=Ar(),[y,E]=Vo(v);xo(()=>{if(!o&&t)for(let w=0;w<t.length;w++){let f=t[w],P=l.find(N=>N.slug===(f==null?void 0:f.flowId));if(P&&f&&f.shouldTrigger===!0&&P.type=="FORM"&&P.triggerType==="AUTOMATIC"&&!b.includes(P.slug)){setTimeout(()=>{A(f.flowId)},500);break}}},[o,t]),xo(()=>{g.length>0&&n()},[g]);function A(w){let f=l.find(P=>P.slug===w);f&&f.triggerType==="AUTOMATIC"&&!b.includes(f.slug)&&(x([...b,f.slug]),F([f]))}function O(){if(!i){let w=localStorage.getItem(ho);if(w){r(w);return}let f=localStorage.getItem(xn);if(f){r(f);return}c(!0);let P=zt+qp();try{localStorage.setItem(xn,P)}catch(N){console.log("Failed to save guest user id locally: Local storage unavailable",N)}r(N=>N||P)}}xo(()=>{try{if(l){let w=[];l.forEach(f=>{if(f.data){let P=f.data.match(/"imageUri":"(.*?)"/g);P&&P.forEach(N=>{let L=N.replace('"imageUri":"',"").replace('"',"");if(w.includes(L))return;let I=new Image;I.src=L,w.push(L)})}})}}catch(w){}},[l]),xo(()=>{if(i!==s&&(e([]),n()),p(i),i&&!i.startsWith(zt))try{localStorage.setItem(ho,i)}catch(w){console.log("Failed to save user id locally: Local storage available",w)}i===null&&setTimeout(()=>{i===null&&O()},50)},[i,l,m]),xo(()=>{v!=y&&(E(v),e([]),n())},[v,y,E]);function h(){return Pt.createElement(Pt.Fragment,null,S.map(w=>d(w.slug)!==$e?null:Pt.createElement("span",{key:w.slug},Pt.createElement(gn,{flowId:w.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Pt.createElement(Pt.Fragment,null,Pt.createElement(h,null))};import{ErrorBoundary as yd}from"react-error-boundary";var Cn={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function Yp(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,n])=>{if(Cn[o]){let i=Cn[o].split("."),r=t;i.forEach((s,p)=>{r[s]||(r[s]=p===i.length-1?n:{}),r=r[s]})}}),t}function Xp(e){if(!e)return;let t=he({},e),o={};return Object.keys(t).forEach(n=>{let i=`.fr-${n}`;o[i]=t[n]}),o}function yn(e){let{theme:t,styleOverrides:o}=e,n=Yp(t),i=Xp(o);return{overrides:n,css:i}}import pd from"styled-components";import{compose as dd,variant as bn}from"styled-system";import Sn from"react";import Jp,{ThemeProvider as Qp,useTheme as Zp}from"styled-components";import{border as Rp,color as ed,compose as td,get as od,shadow as rd,space as id,system as nd,typography as sd}from"styled-system";var ld={width:{property:"width",scale:"sizes",transform:(e,t)=>od(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},ad=Jp("div")(({css:e})=>e,td(Rp,ed,rd,id,sd,nd(ld))),Co=i=>{var r=i,{as:e,children:t,overrides:o}=r,n=Ie(r,["as","children","overrides"]);let s=Zp(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Sn.createElement(ad,T(T({as:e},p),n),t);if(o!==void 0){let l=he(s,o);return Sn.createElement(Qp,{theme:l},d())}return d()};var yo={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}},wn=pd(Co)(()=>({whiteSpace:"nowrap"}),dd(bn({scale:"components.Button",variants:"components.Button"}),bn({prop:"size",variants:cd})));import md from"styled-components";import{variant as ud,system as fd}from"styled-system";var Go={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var Tn=md(Co)(ud({scale:"components.Text",variants:"components.Text"}),fd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Fn=4,kn="px",gd=20,xd=Object.fromEntries(Array.from(Array(gd+1),(e,t)=>t===0?[.5,`${.5*Fn}${kn}`]:[t,`${t*Fn}${kn}`])),Kt={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:H(T({},Kt),{neutral:{foreground:Kt.gray300},primary:{background:Kt.blue500,foreground:Kt.white,inverted:Kt.blue500},negative:{foreground:Kt.red500}}),fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:xd,components:{Button:yo,Text:Go}};var Pn="https://api.frigade.com",X=hd({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:it,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Pn,readonly:!1,debug:!1});function Sd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var bd=({publicApiKey:e,userId:t,organizationId:o,config:n,children:i})=>{var _,se,de,be,G;let[r,s]=je(t||null),[p,d]=je(o||null),[l,m]=je([]),[c,g]=je([]),[S,F]=je([]),[b,x]=je({}),[v,y]=je({}),[E,A]=je([]),[O,h]=je({}),[w,f]=je(!1),[P,N]=je(!1),[L,I]=je(!V(e)),q=(Y,ee)=>{if(ee==="_blank"){window.open(Y,"_blank");return}setTimeout(()=>{window.location.href=Y},50)},M={theme:T(T({},it.theme),(se=(_=n==null?void 0:n.defaultAppearance)==null?void 0:_.theme)!=null?se:{}),styleOverrides:T(T({},it.styleOverrides),(be=(de=n==null?void 0:n.defaultAppearance)==null?void 0:de.styleOverrides)!=null?be:{})};function V(Y){return!!(Y&&Y.length>10&&Y.substring(0,10)==="api_public")}Ko(()=>{t&&s(t)},[t]),Ko(()=>{r&&window&&window.localStorage&&window.localStorage.getItem(ho)&&window.localStorage.getItem(ho)!==r&&Sd()},[r]),Ko(()=>{o&&d(o)},[o]),Ko(()=>{if(V(e))I(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),I(!0);return}},[e,I]);let le={publicApiKey:e,userId:r,setUserId:s,setFlows:m,flows:l,failedFlowResponses:c,setFailedFlowResponses:g,flowResponses:S,setFlowResponses:F,userProperties:b,setUserProperties:x,openFlowStates:v,setOpenFlowStates:y,completedFlowsToKeepOpenDuringSession:E,setCompletedFlowsToKeepOpenDuringSession:A,customVariables:O,setCustomVariables:h,isNewGuestUser:w,setIsNewGuestUser:f,hasActiveFullPageFlow:P,setHasActiveFullPageFlow:N,organizationId:p,setOrganizationId:d,navigate:n&&n.navigate?n.navigate:q,defaultAppearance:M,shouldGracefullyDegrade:L,setShouldGracefullyDegrade:I,apiUrl:n&&n.apiUrl?n.apiUrl:Pn,readonly:n&&n.readonly?n.readonly:!1,debug:n&&n.debug?n.debug:!1};if(L)return vt.createElement(X.Provider,{value:le},i);let{overrides:pe}=yn(M);return vt.createElement(yd,{fallback:vt.createElement(vt.Fragment,null,i)},vt.createElement(X.Provider,{value:le},vt.createElement(Cd,{theme:he(M.theme,Or,pe!=null?pe:{},(G=n==null?void 0:n.theme)!=null?G:{})},i,vt.createElement(hn,null))))};import pc from"react";import Ce,{useEffect as ol,useState as rl}from"react";import qe,{useState as Wd}from"react";import At from"styled-components";import Xo from"react";import Bt from"react";import Bn from"styled-components";var vn=Bn.span`
|
|
682
682
|
font-weight: 600;
|
|
683
683
|
font-size: 14px;
|
|
684
684
|
font-style: normal;
|
|
@@ -689,7 +689,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
689
689
|
vertical-align: middle;
|
|
690
690
|
margin-left: 32px;
|
|
691
691
|
padding-right: 12px;
|
|
692
|
-
${e=>
|
|
692
|
+
${e=>ke(e)}
|
|
693
693
|
`,wd=Bn.div`
|
|
694
694
|
flex-direction: row;
|
|
695
695
|
justify-content: space-between;
|
|
@@ -698,8 +698,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
698
698
|
padding-bottom: 20px;
|
|
699
699
|
padding-right: 8px;
|
|
700
700
|
width: 100%;
|
|
701
|
-
${e=>
|
|
702
|
-
`,qo=({label:e,value:t,labelStyle:o={},labelPosition:n="right",style:i,primaryColor:r="#000000",checkBoxType:
|
|
701
|
+
${e=>ke(e)}
|
|
702
|
+
`,qo=({label:e,value:t,labelStyle:o={},labelPosition:n="right",style:i,primaryColor:r="#000000",checkBoxType:s="round",appearance:p})=>Bt.createElement(Bt.Fragment,null,Bt.createElement(wd,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:T({},i)},n==="left"&&e&&Bt.createElement(vn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p},e),Bt.createElement(nt,{appearance:p,value:t,type:s,primaryColor:r}),n==="right"&&e&&Bt.createElement(vn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p},e)),Bt.createElement(ie,{appearance:p}));import So from"styled-components";var En=So.div`
|
|
703
703
|
font-weight: 700;
|
|
704
704
|
font-size: 18px;
|
|
705
705
|
line-height: 22px;
|
|
@@ -711,7 +711,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
711
711
|
letter-spacing: 0.32px;
|
|
712
712
|
font-style: normal;
|
|
713
713
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
714
|
-
`,
|
|
714
|
+
`,On=So.p`
|
|
715
715
|
font-weight: 400;
|
|
716
716
|
font-size: 14px;
|
|
717
717
|
font-style: normal;
|
|
@@ -727,12 +727,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
727
727
|
height: 100%;
|
|
728
728
|
border-top-right-radius: 4px;
|
|
729
729
|
border-bottom-right-radius: 4px;
|
|
730
|
-
`,
|
|
730
|
+
`,In=So.div`
|
|
731
731
|
flex-direction: row;
|
|
732
732
|
justify-content: flex-start;
|
|
733
733
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
734
734
|
padding-right: 16px;
|
|
735
|
-
`;var Nn=({data:e,index:t,isSelected:o,primaryColor:n,style:i,onClick:r,appearance:
|
|
735
|
+
`;var Nn=({data:e,index:t,isSelected:o,primaryColor:n,style:i,onClick:r,appearance:s})=>{var p,d,l,m,c;return Xo.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&Xo.createElement(Yo,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(p=s==null?void 0:s.theme)==null?void 0:p.colorPrimary)!=null?d:n}}),Xo.createElement(In,{className:a("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},Xo.createElement(qo,{value:e.complete,labelPosition:"left",label:(l=e.stepName)!=null?l:e.title,style:i,primaryColor:(c=(m=s==null?void 0:s.theme)==null?void 0:m.colorPrimary)!=null?c:n,appearance:s})))};import Et from"react";import Ir from"styled-components";import lt from"styled-components";var oC=lt.div`
|
|
736
736
|
background: #ffffff;
|
|
737
737
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
738
738
|
border-radius: 20px;
|
|
@@ -776,33 +776,32 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
776
776
|
border-radius: 20px;
|
|
777
777
|
background-color: ${e=>e.theme.colorPrimary};
|
|
778
778
|
opacity: 0.12;
|
|
779
|
-
`;var Td=
|
|
779
|
+
`;var Td=Ir.div`
|
|
780
780
|
display: flex;
|
|
781
781
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
782
782
|
justify-content: flex-start;
|
|
783
783
|
align-items: ${e=>e.textLocation=="top"?"flex-end":"center"};
|
|
784
784
|
width: 100%;
|
|
785
785
|
|
|
786
|
-
${e=>
|
|
787
|
-
`,Fd=
|
|
786
|
+
${e=>ke(e)}
|
|
787
|
+
`,Fd=Ir.div`
|
|
788
788
|
flex-grow: 1;
|
|
789
789
|
position: relative;
|
|
790
790
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
791
|
-
`,kd=
|
|
791
|
+
`,kd=Ir.span`
|
|
792
792
|
font-weight: 600;
|
|
793
793
|
font-size: 14px;
|
|
794
794
|
line-height: 18px;
|
|
795
795
|
padding-right: ${e=>e.padding};
|
|
796
|
-
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
797
796
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
798
|
-
${e=>
|
|
799
|
-
`;var We=({count:e,total:t,display:o="count",textLocation:n="left",style:i={},textStyle:r={},appearance:
|
|
797
|
+
${e=>ke(e)}
|
|
798
|
+
`;var We=({count:e,total:t,display:o="count",textLocation:n="left",style:i={},textStyle:r={},appearance:s})=>{var g;if(t===0)return Et.createElement(Et.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(g=s==null?void 0:s.theme)==null?void 0:g.colorText});let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",l=Math.round(e/t*100),m=o==="compact"?"5px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${l}% complete`),n==="top"&&(m="0px"),Et.createElement(Td,{className:a("progressBarContainer",s),textLocation:n,styleOverrides:i},Et.createElement(kd,{className:a("progressBarStepText",s),styleOverrides:H(T({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:s,padding:m,textLocation:n},c),Et.createElement(Fd,{textLocation:n,className:a("progressBar",s)},Et.createElement(Ln,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:s,className:a("progressBarFill",s)}),Et.createElement(Dn,{className:a("progressBarBackground",s),barHeight:d,appearance:s})))};import bo from"react";import vd from"styled-components";import Qo from"react";import Jo from"react";var qt=({stepData:e,appearance:t})=>Jo.createElement(Jo.Fragment,null,Jo.createElement(An,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:ce(e.title)}),Jo.createElement(On,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:ce(e.subtitle)}));import Nr from"react";var Yt=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},n=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return Nr.createElement(Wo,{className:a("ctaContainer",t)},Nr.createElement(oe,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Nr.createElement(oe,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:n,style:{width:"auto",marginRight:"12px"}}))};var Xt=({stepData:e,appearance:t})=>Qo.createElement(Qo.Fragment,null,Qo.createElement(qt,{stepData:e,appearance:t}),Qo.createElement(Yt,{stepData:e,appearance:t}));import Pd from"react";function $n(e){return Pd.createElement(Ze,{appearance:e.appearance,videoUri:e.videoUri})}var Lr="default",Bd=vd.img`
|
|
800
799
|
border-radius: 4px;
|
|
801
800
|
max-height: 260px;
|
|
802
801
|
min-height: 200px;
|
|
803
802
|
`,Mn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let o=e.StepContent;return bo.createElement("div",null,o)}return bo.createElement(En,{className:a("checklistStepContent",t)},e.imageUri?bo.createElement(Bd,{className:a("checklistStepImage",t),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?bo.createElement($n,{videoUri:e.videoUri,appearance:t}):null,bo.createElement(Xt,{stepData:e,appearance:t}))};import ze,{useRef as Ed,useState as Ad}from"react";import Jt from"styled-components";var Un=Jt.div`
|
|
804
803
|
display: block;
|
|
805
|
-
`,
|
|
804
|
+
`,Od=Jt.div`
|
|
806
805
|
display: flex;
|
|
807
806
|
flex-direction: row;
|
|
808
807
|
flex-wrap: wrap;
|
|
@@ -812,7 +811,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
812
811
|
align-content: center;
|
|
813
812
|
margin-top: 24px;
|
|
814
813
|
margin-bottom: 24px;
|
|
815
|
-
`,
|
|
814
|
+
`,Id=Jt.div`
|
|
816
815
|
display: flex;
|
|
817
816
|
align-items: center;
|
|
818
817
|
justify-content: flex-start;
|
|
@@ -845,7 +844,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
845
844
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
846
845
|
border-radius: 50%;
|
|
847
846
|
}
|
|
848
|
-
`,Wn="videoCarousel",zn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.videos))return ze.createElement(Un,null,ze.createElement(Xt,{stepData:e,appearance:t}));function o({video:r}){let
|
|
847
|
+
`,Wn="videoCarousel",zn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.videos))return ze.createElement(Un,null,ze.createElement(Xt,{stepData:e,appearance:t}));function o({video:r}){let s=Ed(),[p,d]=Ad(!1);return ze.createElement(Id,null,!p&&ze.createElement(Dd,{onClick:()=>{d(!0),s.current.play()},appearance:t},ze.createElement(zo,null)),ze.createElement(Nd,{controls:p,ref:s,play:p,src:r.uri}),ze.createElement(Ld,null,r.title))}let n=e.props;return n.videos?ze.createElement(Un,null,ze.createElement(qt,{stepData:e,appearance:t}),ze.createElement(Od,null,n.videos.map((r,s)=>ze.createElement("span",{key:`${r.uri}-${s}`},ze.createElement(o,{video:r})))),ze.createElement(Yt,{stepData:e,appearance:t})):null};import at from"react";import Zo from"styled-components";var _n=Zo.div`
|
|
849
848
|
display: block;
|
|
850
849
|
`,$d=Zo.pre`
|
|
851
850
|
display: block;
|
|
@@ -877,7 +876,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
877
876
|
min-width: ${e=>e.type!="modal"?"600px":"100%"};
|
|
878
877
|
background: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
879
878
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
880
|
-
${e=>
|
|
879
|
+
${e=>ke(e)}
|
|
881
880
|
`,_d=At.h1`
|
|
882
881
|
font-size: 18px;
|
|
883
882
|
font-style: normal;
|
|
@@ -906,31 +905,31 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
906
905
|
`,Gd=At.div`
|
|
907
906
|
flex: 2;
|
|
908
907
|
padding: 2rem 2rem 2rem 0rem;
|
|
909
|
-
`,Kd=({title:e,subtitle:t,steps:o=[],style:n={},selectedStep:i,setSelectedStep:r,className:
|
|
908
|
+
`,Kd=({title:e,subtitle:t,steps:o=[],style:n={},selectedStep:i,setSelectedStep:r,className:s="",customStepTypes:p=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:m}=te();d=m(d);let c={[Lr]:Mn,[Wn]:zn,[Hn]:jn},g=T(T({},c),p),[S,F]=Wd(0),b=i!=null?i:S,x=r!=null?r:F,v=o.filter(E=>E.complete===!0).length,y=()=>{var E;return!((E=o[b])!=null&&E.type)||!g[o[b].type]?g[Lr]({stepData:o[b],appearance:d}):g[o[b].type]({stepData:o[b],appearance:d})};return qe.createElement(zd,{type:l,styleOverrides:n,className:s,appearance:d},qe.createElement(Vn,{style:{flex:1}},qe.createElement(Vn,{style:{padding:"28px 0px 28px 28px",borderBottom:"1px solid #E5E5E5"}},qe.createElement(_d,{className:a("checklistTitle",d),appearance:d},e),qe.createElement(Hd,{className:a("checklistSubtitle",d),appearance:d},t),qe.createElement(We,{total:o.length,count:v,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),qe.createElement(jd,{className:a("checklistStepsContainer",d)},o.map((E,A)=>qe.createElement(Nn,{data:E,index:A,key:A,listLength:o.length,isSelected:A===b,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{x(A)},appearance:d})))),qe.createElement(Vd,{appearance:d,className:a("checklistDivider",d)}),qe.createElement(Gd,null,qe.createElement(y,null)))},Dr=Kd;import j,{useState as Qd}from"react";import Gn from"react";import qd from"styled-components";var Yd=qd.svg`
|
|
910
909
|
transition: 'transform 0.35s ease-in-out';
|
|
911
|
-
`,Qt=({style:e,className:t})=>Gn.createElement(Yd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Gn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import
|
|
910
|
+
`,Qt=({style:e,className:t})=>Gn.createElement(Yd,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Gn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import Se from"styled-components";var $r={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Kn=Se.div`
|
|
912
911
|
max-height: 350px;
|
|
913
912
|
padding-bottom: 40px;
|
|
914
|
-
`,qn=
|
|
913
|
+
`,qn=Se.div`
|
|
915
914
|
display: flex;
|
|
916
915
|
flex-direction: column;
|
|
917
916
|
margin-top: 20px;
|
|
918
|
-
`,Yn=
|
|
917
|
+
`,Yn=Se.h1`
|
|
919
918
|
font-style: normal;
|
|
920
919
|
font-weight: 600;
|
|
921
920
|
font-size: 30px;
|
|
922
921
|
line-height: 36px;
|
|
923
922
|
margin-bottom: 16px;
|
|
924
923
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
925
|
-
`,Xn=
|
|
924
|
+
`,Xn=Se.h2`
|
|
926
925
|
font-weight: 400;
|
|
927
926
|
font-size: 16px;
|
|
928
927
|
line-height: 20px;
|
|
929
928
|
margin-bottom: 16px;
|
|
930
929
|
padding-left: 1px;
|
|
931
930
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
932
|
-
`,Jn=
|
|
933
|
-
${e=>
|
|
931
|
+
`,Jn=Se.div`
|
|
932
|
+
${e=>B(e)} {
|
|
934
933
|
border: 1px solid #fafafa;
|
|
935
934
|
}
|
|
936
935
|
box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
|
|
@@ -939,12 +938,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
939
938
|
flex-direction: column;
|
|
940
939
|
min-height: 240px;
|
|
941
940
|
overflow: hidden;
|
|
942
|
-
`,Qn=
|
|
941
|
+
`,Qn=Se.div`
|
|
943
942
|
display: flex;
|
|
944
943
|
flex-direction: row;
|
|
945
944
|
justify-content: space-between;
|
|
946
|
-
`,Zn=
|
|
947
|
-
${e=>
|
|
945
|
+
`,Zn=Se.p`
|
|
946
|
+
${e=>B(e)} {
|
|
948
947
|
font-weight: 400;
|
|
949
948
|
font-size: 10px;
|
|
950
949
|
line-height: 12px;
|
|
@@ -952,13 +951,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
952
951
|
color: #8c8c8c;
|
|
953
952
|
margin: 20px;
|
|
954
953
|
}
|
|
955
|
-
`,Rn=
|
|
954
|
+
`,Rn=Se.div`
|
|
956
955
|
display: flex;
|
|
957
956
|
flex-direction: row;
|
|
958
|
-
`,es=
|
|
957
|
+
`,es=Se.div`
|
|
959
958
|
flex: 1;
|
|
960
|
-
`,ts=
|
|
961
|
-
${e=>
|
|
959
|
+
`,ts=Se.div`
|
|
960
|
+
${e=>B(e)} {
|
|
962
961
|
display: flex;
|
|
963
962
|
justify-content: center;
|
|
964
963
|
align-content: center;
|
|
@@ -967,8 +966,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
967
966
|
padding-left: 8px;
|
|
968
967
|
padding-right: 8px;
|
|
969
968
|
}
|
|
970
|
-
`,os=
|
|
971
|
-
${e=>
|
|
969
|
+
`,os=Se.p`
|
|
970
|
+
${e=>B(e)} {
|
|
972
971
|
font-style: normal;
|
|
973
972
|
font-weight: 600;
|
|
974
973
|
font-size: 22px;
|
|
@@ -979,8 +978,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
979
978
|
margin-top: 20px;
|
|
980
979
|
margin-bottom: 16px;
|
|
981
980
|
}
|
|
982
|
-
`,rs=
|
|
983
|
-
${e=>
|
|
981
|
+
`,rs=Se.p`
|
|
982
|
+
${e=>B(e)} {
|
|
984
983
|
font-weight: 400;
|
|
985
984
|
font-size: 14px;
|
|
986
985
|
line-height: 18px;
|
|
@@ -988,15 +987,15 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
988
987
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
989
988
|
margin-bottom: 8px;
|
|
990
989
|
}
|
|
991
|
-
`,is=
|
|
992
|
-
${e=>
|
|
990
|
+
`,is=Se.div`
|
|
991
|
+
${e=>B(e)} {
|
|
993
992
|
display: flex;
|
|
994
993
|
flex-direction: row;
|
|
995
994
|
justify-content: center;
|
|
996
995
|
gap: 8px;
|
|
997
996
|
}
|
|
998
|
-
`,ns=
|
|
999
|
-
${e=>
|
|
997
|
+
`,ns=Se.div`
|
|
998
|
+
${e=>B(e)} {
|
|
1000
999
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1001
1000
|
background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
|
|
1002
1001
|
:hover {
|
|
@@ -1015,8 +1014,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1015
1014
|
justify-content: space-between;
|
|
1016
1015
|
position: relative;
|
|
1017
1016
|
cursor: pointer;
|
|
1018
|
-
`,ss=
|
|
1019
|
-
${e=>
|
|
1017
|
+
`,ss=Se.p`
|
|
1018
|
+
${e=>B(e)} {
|
|
1020
1019
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1021
1020
|
color: ${e=>e.selected?"#434343":"#BFBFBF"};
|
|
1022
1021
|
}
|
|
@@ -1024,12 +1023,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1024
1023
|
font-size: 14px;
|
|
1025
1024
|
line-height: 22px;
|
|
1026
1025
|
margin: 0;
|
|
1027
|
-
`,ls=
|
|
1026
|
+
`,ls=Se.div`
|
|
1028
1027
|
display: flex;
|
|
1029
1028
|
flex-direction: row;
|
|
1030
1029
|
justify-content: flex-end;
|
|
1031
1030
|
align-content: center;
|
|
1032
|
-
`,as=
|
|
1031
|
+
`,as=Se.div`
|
|
1033
1032
|
display: flex;
|
|
1034
1033
|
flex: 1;
|
|
1035
1034
|
flex-direction: row;
|
|
@@ -1037,7 +1036,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1037
1036
|
align-content: center;
|
|
1038
1037
|
align-items: center;
|
|
1039
1038
|
margin-right: 20px;
|
|
1040
|
-
`,ps=
|
|
1039
|
+
`,ps=Se.div`
|
|
1041
1040
|
display: block;
|
|
1042
1041
|
width: 100%;
|
|
1043
1042
|
`;import Xd from"styled-components";var ds=Xd.div`
|
|
@@ -1059,7 +1058,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1059
1058
|
overflow: hidden;
|
|
1060
1059
|
row-gap: 10px;
|
|
1061
1060
|
`,us=pt.div`
|
|
1062
|
-
${e=>
|
|
1061
|
+
${e=>B(e)} {
|
|
1063
1062
|
color: #595959;
|
|
1064
1063
|
}
|
|
1065
1064
|
text-transform: uppercase;
|
|
@@ -1069,7 +1068,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1069
1068
|
letter-spacing: 0.09em;
|
|
1070
1069
|
margin-bottom: 12px;
|
|
1071
1070
|
`,fs=pt.div`
|
|
1072
|
-
${e=>
|
|
1071
|
+
${e=>B(e)} {
|
|
1073
1072
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1074
1073
|
background: #ffffff;
|
|
1075
1074
|
border: 1px solid #fafafa;
|
|
@@ -1082,7 +1081,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1082
1081
|
max-width: 150px;
|
|
1083
1082
|
min-width: 200px;
|
|
1084
1083
|
`,gs=pt.div`
|
|
1085
|
-
${e=>
|
|
1084
|
+
${e=>B(e)} {
|
|
1086
1085
|
background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
|
|
1087
1086
|
}
|
|
1088
1087
|
width: 40px;
|
|
@@ -1100,7 +1099,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1100
1099
|
width: 20px;
|
|
1101
1100
|
height: 20px;
|
|
1102
1101
|
`,hs=pt.div`
|
|
1103
|
-
${e=>
|
|
1102
|
+
${e=>B(e)} {
|
|
1104
1103
|
color: #434343;
|
|
1105
1104
|
}
|
|
1106
1105
|
font-weight: 600;
|
|
@@ -1109,7 +1108,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1109
1108
|
margin-top: 12px;
|
|
1110
1109
|
margin-bottom: 8px;
|
|
1111
1110
|
`,Cs=pt.div`
|
|
1112
|
-
${e=>
|
|
1111
|
+
${e=>B(e)} {
|
|
1113
1112
|
color: #8c8c8c;
|
|
1114
1113
|
}
|
|
1115
1114
|
font-weight: 400;
|
|
@@ -1121,7 +1120,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1121
1120
|
line-height: 14px;
|
|
1122
1121
|
font-weight: 400;
|
|
1123
1122
|
cursor: pointer;
|
|
1124
|
-
`;var Jd=({steps:e,style:t,title:o,primaryColor:n,appearance:i,onButtonClick:r})=>{let{primaryCTAClickSideEffects:
|
|
1123
|
+
`;var Jd=({steps:e,style:t,title:o,primaryColor:n,appearance:i,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=ae();return dt.createElement(cs,{style:t,className:a("guideContainer",i)},dt.createElement(us,{className:a("guideTitle",i)},o),dt.createElement(ms,{className:a("guideItemContainer",i)},e.map((p,d)=>{var l;return dt.createElement(fs,{key:`guide-${(l=p.id)!=null?l:d}`,className:a("guideItem",i)},p.icon&&dt.createElement(gs,{className:a("guideIcon",i)},dt.createElement(xs,null,p.icon)),dt.createElement(hs,{className:a("guideItemTitle",i),dangerouslySetInnerHTML:ce(p.title)}),dt.createElement(Cs,{className:a("guideItemSubtitle",i),dangerouslySetInnerHTML:ce(p.subtitle)}),dt.createElement(ys,{className:a("guideItemLink",i),color:n,onClick:()=>{p.primaryButtonUri&&s(p),r&&r(p)}},p.primaryButtonTitle))})))},wo=Jd;var Zd=({steps:e,title:t,subtitle:o,stepsTitle:n,visible:i,onClose:r,selectedStep:s,setSelectedStep:p,customStepTypes:d,appearance:l,guideData:m,guideTitle:c,onGuideButtonClick:g})=>{let S=({stepData:h,handleSecondaryCTAClick:w,handleCTAClick:f})=>h?j.createElement(ts,{className:a("checklistStepContainer",l),"data-testid":"checklistStepContainer"},j.createElement(os,{appearance:l,className:a("checklistStepTitle",l),dangerouslySetInnerHTML:ce(h.title)}),j.createElement(rs,{appearance:l,className:a("checklistStepSubtitle",l),dangerouslySetInnerHTML:ce(h.subtitle)}),j.createElement(is,{className:a("checklistCTAContainer",l)},h.secondaryButtonTitle&&j.createElement(oe,{title:h.secondaryButtonTitle,onClick:w,appearance:l,secondary:!0}),j.createElement(oe,{title:h.primaryButtonTitle,onClick:f,appearance:l}))):j.createElement(j.Fragment,null),b=T(T({},{default:h=>{var N;if((N=e[y])!=null&&N.StepContent){let L=e[y].StepContent;return j.createElement("div",null,L)}let w=e[y];return j.createElement(S,{stepData:h,handleCTAClick:()=>{w.handlePrimaryButtonClick&&w.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{w.handleSecondaryButtonClick&&w.handleSecondaryButtonClick()}})}}),d),[x,v]=Qd(0),y=s!=null?s:x,E=p!=null?p:v,A=()=>{var h;return e?!((h=e[y])!=null&&h.type)||!b[e[y].type]?b.default(e[y]):b[e[y].type]({stepData:e[y],primaryColor:l.theme.colorPrimary}):j.createElement(j.Fragment,null)},O=e.filter(h=>h.complete).length;return i?(l.theme.modalContainer||(l.theme.borderRadius&&($r.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=$r),j.createElement(Je,{onClose:r,visible:i,appearance:l},j.createElement(ps,null,j.createElement(qn,null,j.createElement(Yn,{appearance:l,className:a("checklistTitle",l)},t),j.createElement(Xn,{appearance:l,className:a("checklistSubtitle",l)},o)),j.createElement(Kn,null,e&&e.length>0&&j.createElement(Jn,{className:a("stepsContainer",l)},j.createElement(Qn,null,j.createElement("div",{style:{flex:3}},j.createElement(Zn,{className:a("stepsTitle",l)},n)),j.createElement(as,null,j.createElement(We,{style:{width:"100%"},count:O,total:e.length,appearance:l}))),j.createElement(Rn,null,j.createElement(es,{className:a("checklistStepListContainer",l),appearance:l},e.map((h,w)=>{var P;let f=y===w;return j.createElement(ns,{selected:f,className:a(`checklistStepListItem${f?"Selected":""}`,l),key:`checklist-guide-step-${(P=h.id)!=null?P:w}`,disabled:h.blocked,onClick:()=>{h.blocked||E(w)},title:h.blocked?"Finish remaining steps to continue":void 0},f&&j.createElement(Yo,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),j.createElement(ss,{selected:f,className:a(`checklistStepListStepName${f?"Selected":""}`,l)},h.stepName),j.createElement(ls,null,j.createElement(nt,{value:h.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:h.progress,appearance:l}),j.createElement(ds,null,j.createElement(Qt,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),j.createElement(A,null))),m&&m.length>0&&j.createElement(wo,{steps:m,title:c,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:h=>(g&&g(h),!0)}))))):j.createElement(j.Fragment,null)},Mr=Zd;import Ne,{useEffect as Ls,useState as Ds}from"react";import Fe from"react";import ct from"styled-components";var Ss=ct.div`
|
|
1125
1124
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1126
1125
|
border: 1px solid;
|
|
1127
1126
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1172,7 +1171,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1172
1171
|
flex-direction: row;
|
|
1173
1172
|
justify-content: flex-start;
|
|
1174
1173
|
align-items: center;
|
|
1175
|
-
`;var Bs=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:n,onSecondaryButtonClick:i,appearance:r,customStepTypes:
|
|
1174
|
+
`;var Bs=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:n,onSecondaryButtonClick:i,appearance:r,customStepTypes:s})=>{var c,g;let p=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.2s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.15s ease-in"};function l(){var S;return Fe.createElement(Fe.Fragment,null,e.imageUri||e.videoUri?Fe.createElement(bs,{className:a("stepMediaContainer",r)},e.imageUri?Fe.createElement(ws,{className:a("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Fe.createElement(Ze,{appearance:r,videoUri:e.videoUri}):null):null,Fe.createElement(Ps,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:ce(e.subtitle)}),Fe.createElement(Wo,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?Fe.createElement(oe,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>i(),appearance:r}):null,Fe.createElement(oe,{title:(S=e.primaryButtonTitle)!=null?S:"Continue",onClick:()=>n(),appearance:r})))}function m(){if(!s)return null;let S=s[e.type];return S?S(e,r):null}return Fe.createElement(Ss,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},Fe.createElement(Ts,{className:a("stepHeader",r)},Fe.createElement(vs,null,Fe.createElement(qo,{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(Fs,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:ce(e.title),onClick:()=>o()})),Fe.createElement(ks,{className:a("stepChevronContainer",r),onClick:()=>o(),appearance:r},Fe.createElement(Qt,{style:H(T({},p),{transition:"transform 0.2s ease-in-out"})}))),Fe.createElement("div",{key:e.id,style:T({},d)},(g=m())!=null?g:l()))};import Zt from"styled-components";var C0=Zt.div`
|
|
1176
1175
|
background: #ffffff;
|
|
1177
1176
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1178
1177
|
border-radius: 6px;
|
|
@@ -1196,13 +1195,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1196
1195
|
font-size: 20px;
|
|
1197
1196
|
line-height: 24px;
|
|
1198
1197
|
margin-bottom: 8px;
|
|
1199
|
-
`,
|
|
1198
|
+
`,Os=Zt.h2`
|
|
1200
1199
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1201
1200
|
font-weight: 400;
|
|
1202
1201
|
font-size: 14px;
|
|
1203
1202
|
line-height: 23px;
|
|
1204
1203
|
margin: 2px 0 0 0;
|
|
1205
|
-
`,
|
|
1204
|
+
`,Is=Zt.div`
|
|
1206
1205
|
display: block;
|
|
1207
1206
|
width: 100%;
|
|
1208
1207
|
`,Ns=Zt.div`
|
|
@@ -1213,7 +1212,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1213
1212
|
padding: 24px;
|
|
1214
1213
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1215
1214
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1216
|
-
`;var Rd=({title:e,subtitle:t,steps:o,onClose:n,visible:i,autoExpandFirstIncompleteStep:r=!0,autoCollapse:
|
|
1215
|
+
`;var Rd=({title:e,subtitle:t,steps:o,onClose:n,visible:i,autoExpandFirstIncompleteStep:r=!0,autoCollapse:s=!0,autoExpandNextStep:p=!0,selectedStep:d,setSelectedStep:l,appearance:m,type:c,className:g,customStepTypes:S,style:F})=>{let b=o.filter(w=>w.complete).length,[x,v]=Ds(Array(o.length).fill(!0)),[y,E]=Ds(!1);Ls(()=>{let w=[...x];if(r){for(let f=0;f<o.length;f++)if(!o[f].complete){w[f]=!1;break}v(w)}},[]),Ls(()=>{if(!y&&!r){E(!0);return}A(d)},[d]);let A=w=>{let f=[...x];if(s)for(let P=0;P<x.length;++P)P!==w&&(f[P]=!0);f[w]=!f[w],v(f)};if(!i&&c=="modal")return Ne.createElement(Ne.Fragment,null);let O=Ne.createElement(Ne.Fragment,null,Ne.createElement(Es,null,Ne.createElement(As,{appearance:m,className:a("checklistTitle",m),dangerouslySetInnerHTML:ce(e)}),Ne.createElement(Os,{appearance:m,className:a("checklistSubtitle",m),dangerouslySetInnerHTML:ce(t)})),Ne.createElement(We,{display:"percent",count:b,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),h=Ne.createElement(Is,{className:Te(a("checklistContainer",m),g)},o.map((w,f)=>{var N;let P=x[f];return Ne.createElement(Bs,{appearance:m,stepData:w,collapsed:P,key:`modal-checklist-${(N=w.id)!=null?N:f}`,onClick:()=>{if(d===f){A(f);return}l(f)},onPrimaryButtonClick:()=>{w.handlePrimaryButtonClick&&w.handlePrimaryButtonClick(),p&&!w.completionCriteria&&f<x.length-1&&x[f+1]&&l(f+1)},onSecondaryButtonClick:()=>{w.handleSecondaryButtonClick&&w.handleSecondaryButtonClick()},customStepTypes:S})}));return c==="inline"?Ne.createElement(Ns,{appearance:m,className:Te(a("checklistInlineContainer",m),g),style:F},O,h):Ne.createElement(Ne.Fragment,null,Ne.createElement(Je,{onClose:n,visible:i,appearance:m,style:{maxWidth:"600px"},headerContent:O},h))},Ur=Rd;import me,{useEffect as Wr,useRef as lc,useState as Ot}from"react";import{useEffect as ec,useState as tc}from"react";var $s=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,n]=tc(t),i=null,r=()=>{i!==null?clearTimeout(i):s(),i=setTimeout(()=>{s()},16)},s=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let m=window.matchMedia(l);return m.addEventListener("change",r),[d,m.matches]}));n(p)};return ec(()=>{s()},[]),o};import Rt from"react";import fe,{css as Ms,keyframes as Us}from"styled-components";var Ws=Ms`
|
|
1217
1216
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1218
1217
|
`,oc=Ms`
|
|
1219
1218
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
@@ -1229,7 +1228,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1229
1228
|
} to {
|
|
1230
1229
|
opacity: 0;
|
|
1231
1230
|
}
|
|
1232
|
-
`,zs=
|
|
1231
|
+
`,zs=fe.div`
|
|
1233
1232
|
margin: 0 -20px;
|
|
1234
1233
|
overflow-x: auto;
|
|
1235
1234
|
padding-left: 20px;
|
|
@@ -1246,13 +1245,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1246
1245
|
::-webkit-scrollbar {
|
|
1247
1246
|
display: none;
|
|
1248
1247
|
}
|
|
1249
|
-
`,_s=
|
|
1248
|
+
`,_s=fe.div`
|
|
1250
1249
|
display: flex;
|
|
1251
1250
|
flex-flow: row nowrap;
|
|
1252
1251
|
gap: 0 16px;
|
|
1253
1252
|
scroll-snap-align: center;
|
|
1254
1253
|
scroll-snap-stop: always;
|
|
1255
|
-
`,Hs=
|
|
1254
|
+
`,Hs=fe.div`
|
|
1256
1255
|
animation: ${e=>e.reversed?ic:rc} 0.25s ease-out;
|
|
1257
1256
|
background: linear-gradient(
|
|
1258
1257
|
to right,
|
|
@@ -1262,7 +1261,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1262
1261
|
position: absolute;
|
|
1263
1262
|
width: 64px;
|
|
1264
1263
|
z-index: 10;
|
|
1265
|
-
`,js=
|
|
1264
|
+
`,js=fe.button`
|
|
1266
1265
|
${Ws}
|
|
1267
1266
|
box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
|
|
1268
1267
|
align-items: center;
|
|
@@ -1274,10 +1273,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1274
1273
|
justify-content: center;
|
|
1275
1274
|
position: absolute;
|
|
1276
1275
|
width: 48px;
|
|
1277
|
-
`,Vs=
|
|
1276
|
+
`,Vs=fe.div`
|
|
1278
1277
|
border-radius: ${({theme:e})=>e.borderRadius}px;
|
|
1279
1278
|
padding: 20px;
|
|
1280
|
-
`,Gs=
|
|
1279
|
+
`,Gs=fe(Vs)`
|
|
1281
1280
|
${Ws}
|
|
1282
1281
|
background: ${({theme:e})=>e.colorBackground};
|
|
1283
1282
|
position: relative;
|
|
@@ -1290,100 +1289,104 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1290
1289
|
${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
|
|
1291
1290
|
${e=>e.blocked?"cursor: default":"cursor: pointer"}
|
|
1292
1291
|
}
|
|
1293
|
-
`,Ks=
|
|
1292
|
+
`,Ks=fe.img`
|
|
1294
1293
|
border-radius: 50%;
|
|
1295
1294
|
height: 40px;
|
|
1296
1295
|
margin-bottom: 12px;
|
|
1297
1296
|
width: 40px;
|
|
1298
|
-
`,qs=
|
|
1299
|
-
${e=>
|
|
1297
|
+
`,qs=fe(Vs)`
|
|
1298
|
+
${e=>B(e)} {
|
|
1300
1299
|
${oc}
|
|
1301
1300
|
|
|
1302
1301
|
background: ${({theme:e})=>e.colorBackground};
|
|
1303
1302
|
}
|
|
1304
|
-
`,D0=
|
|
1303
|
+
`,D0=fe.div`
|
|
1305
1304
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1306
1305
|
display: flex;
|
|
1307
1306
|
flex-flow: row nowrap;
|
|
1308
1307
|
align-items: center;
|
|
1309
|
-
`,$0=
|
|
1308
|
+
`,$0=fe.div`
|
|
1310
1309
|
white-space: nowrap;
|
|
1311
|
-
`,Ys=
|
|
1310
|
+
`,Ys=fe.div`
|
|
1312
1311
|
background: #d8fed8;
|
|
1313
1312
|
border-radius: 6px;
|
|
1314
1313
|
float: right;
|
|
1315
1314
|
margin-bottom: 12px;
|
|
1316
1315
|
padding: 4px 10px;
|
|
1317
|
-
`,nc=
|
|
1316
|
+
`,nc=fe.p`
|
|
1318
1317
|
font-weight: bold;
|
|
1319
1318
|
font-size: 18px;
|
|
1320
1319
|
line-height: 22px;
|
|
1321
1320
|
letter-spacing: calc(18px * -0.01);
|
|
1322
1321
|
margin: 0;
|
|
1323
|
-
`,Xs=
|
|
1322
|
+
`,Xs=fe(nc)`
|
|
1324
1323
|
margin-bottom: 4px;
|
|
1325
|
-
`,Js=
|
|
1324
|
+
`,Js=fe.div`
|
|
1326
1325
|
display: flex;
|
|
1327
1326
|
flex-flow: row nowrap;
|
|
1328
1327
|
align-items: center;
|
|
1329
1328
|
min-width: 50%;
|
|
1330
|
-
`,sc=
|
|
1329
|
+
`,sc=fe.p`
|
|
1331
1330
|
font-weight: bold;
|
|
1332
1331
|
font-size: 16px;
|
|
1333
1332
|
line-height: 20px;
|
|
1334
1333
|
letter-spacing: calc(16px * -0.01);
|
|
1335
1334
|
margin: 0;
|
|
1336
|
-
`,Qs=
|
|
1335
|
+
`,Qs=fe(sc)`
|
|
1337
1336
|
margin-bottom: 4px;
|
|
1338
1337
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1339
1338
|
`}
|
|
1340
|
-
`,Ct=
|
|
1339
|
+
`,Ct=fe.p`
|
|
1341
1340
|
color: ${({theme:e})=>e.colorText};
|
|
1342
1341
|
font-weight: normal;
|
|
1343
1342
|
font-size: 14px;
|
|
1344
1343
|
line-height: 22px;
|
|
1345
1344
|
margin: 0;
|
|
1346
|
-
`,Zs=
|
|
1345
|
+
`,Zs=fe.p`
|
|
1347
1346
|
color: ${({theme:e})=>e.colorText};
|
|
1348
1347
|
font-weight: 600;
|
|
1349
1348
|
font-size: 12px;
|
|
1350
1349
|
line-height: 16px;
|
|
1351
1350
|
margin: 0;
|
|
1352
|
-
`;Ct.Loud=
|
|
1351
|
+
`;Ct.Loud=fe(Ct)`
|
|
1353
1352
|
font-weight: 600;
|
|
1354
|
-
`;Ct.Quiet=
|
|
1353
|
+
`;Ct.Quiet=fe(Ct)`
|
|
1355
1354
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1356
1355
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1357
1356
|
`}
|
|
1358
|
-
`;var Rs=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:n}=
|
|
1357
|
+
`;var Rs=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:n}=te(),{primaryCTAClickSideEffects:i}=ae();o=n(o);let{imageUri:r=null,subtitle:s=null,title:p=null,complete:d=!1,blocked:l=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{i(e)};return Rt.createElement(Gs,{className:a("carouselCard",o),onClick:l?null:c,style:t,blocked:l,complete:d},r&&Rt.createElement(Ks,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||l?.4:1}}),d&&Rt.createElement(Ys,{className:a("carouselCompletedPill",o)},Rt.createElement(Zs,{style:{color:"#108E0B"}},"Complete")),p&&Rt.createElement(Qs,{blocked:l,complete:d,className:a("carouselCardTitle",o)},p),s&&Rt.createElement(Ct.Quiet,{blocked:l,complete:d,className:a("carouselCardSubtitle",o)},s))};var ac=()=>me.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},me.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),me.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),me.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),el=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[n,i]=Ot(!1),[r,s]=Ot(!1);Wr(()=>{t===!0&&n===!1?i(!0):t===!1&&n===!0&&s(!0)},[t]);let p=()=>{i(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return n?me.createElement(Hs,{style:d,reversed:r,onAnimationEnd:r?p:null},me.createElement(js,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},me.createElement(ac,null))):null},tl=({flowId:e,appearance:t,customVariables:o,className:n})=>{let i=lc(null),[r,s]=Ot(!1),[p,d]=Ot(!1),[l,m]=Ot(null),[c,g]=Ot([]),[S,F]=Ot(0),{isSmall:b}=$s(),x=b?1:3,{getFlowMetadata:v,getFlowSteps:y,getNumberOfStepsCompleted:E,updateCustomVariables:A,isLoading:O}=R();Wr(()=>{A(o)},[o,O]),Wr(()=>{if(O)return;let L=v(e),I=E(e),q=y(e);m(L),L.data!==null&&(g(q.sort((M,V)=>Number(M.complete)-Number(V.complete))),d(q.length>x),F(I))},[O]);let h=[];for(let L=0;L<c.length;L+=x)h.push(c.slice(L,L+x));let w=L=>{let I=L.target,q=I.scrollWidth-I.clientWidth,M=Math.ceil(I.scrollLeft);M>0&&r===!1&&s(!0),M===0&&r===!0&&s(!1),M<q&&p===!1&&d(!0),M===q&&p===!0&&d(!1)},f=(L=!0)=>{let I=L?1:-1;i.current!==null&&i.current.scrollBy({left:i.current.clientWidth*I,behavior:"smooth"})},P=null,N=L=>{P!==null?clearTimeout(P):w(L),P=setTimeout(()=>{w(L)},16)};return O?null:me.createElement(qs,{className:Te(a("carouselContainer",t),n)},me.createElement("div",{style:{display:"flex",justifyContent:b?"center":"space-between",marginBottom:20,flexWrap:b?"wrap":"nowrap",gap:b?16:20}},me.createElement("div",null,me.createElement(Xs,{className:a("carouselTitle",t)},l==null?void 0:l.title),me.createElement(Ct.Quiet,{className:a("carouselSubtitle",t)},l==null?void 0:l.subtitle)),me.createElement(Js,{className:a("progressWrapper",t)},me.createElement(We,{count:S,total:c.length,appearance:t}))),me.createElement("div",{style:{position:"relative"}},me.createElement(el,{show:r,onClick:()=>f(!1)}),me.createElement(el,{side:"right",show:p,onClick:f}),me.createElement(zs,{ref:i,onScroll:N},h.map((L,I)=>me.createElement(_s,{key:I,style:{flex:`0 0 calc(100% - ${c.length>x?36:0}px)`}},L.map((q,M)=>me.createElement(Rs,{key:M,stepData:q,style:{flex:c.length>x?`0 1 calc(100% / ${x} - 16px * 2 / ${x})`:1},appearance:t})))))),me.createElement(ie,{appearance:t}))};var zr=A=>{var O=A,{flowId:e,title:t,subtitle:o,style:n,initialSelectedStep:i,className:r,type:s="inline",onDismiss:p,visible:d,customVariables:l,onStepCompletion:m,onButtonClick:c,appearance:g,hideOnFlowCompletion:S,setVisible:F,customStepTypes:b,checklistStyle:x="default",autoExpandFirstIncompleteStep:v,autoExpandNextStep:y}=O,E=Ie(O,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:h,getFlowSteps:w,markStepCompleted:f,getStepStatus:P,getNumberOfStepsCompleted:N,isLoading:L,targetingLogicShouldHideFlow:I,updateCustomVariables:q,getFlowMetadata:M,isStepBlocked:V,getFlowStatus:le,hasActiveFullPageFlow:pe,setHasActiveFullPageFlow:_}=R(),{primaryCTAClickSideEffects:se,secondaryCTAClickSideEffects:de}=ae(),{getOpenFlowState:be,setOpenFlowState:G}=Be(),[Y,ee]=rl(i||0),[Ve,Le]=rl(!1),Z=d===void 0?be(e):d,ue=s==="modal",{mergeAppearanceWithDefault:Oe}=te();if(g=Oe(g),ol(()=>{q(l)},[l,L]),ol(()=>{d!==void 0&&(ue&&d===!0?_(!0):ue&&d===!1&&_(!1))},[d,F,pe]),L)return null;let we=h(e);if(!we||I(we))return null;let U=w(e);if(!U||S===!0&&le(e)===Q)return null;let D=M(e);if(D!=null&&D.title&&(t=D.title),D!=null&&D.subtitle&&(o=D.subtitle),!Ve&&i===void 0&&N(e)>0){let u=U.findIndex(k=>k.complete===!1);ee(u>-1?u:U.length-1),Le(!0)}function z(){if(Y+1>=U.length){ue&&G(e,!1);return}V(e,U[Y+1].id)||ee(Y+1)}function J(u,k,W){let ge=Y+1<U.length?U[Y+1]:null;c&&c(u,Y,k,ge)===!0&&ue&&Ye(),m&&m(u,W,ge),!m&&!c&&(u.primaryButtonUri||u.secondaryButtonUri)&&ue&&Ye()}function ye(){return U.map((u,k)=>H(T({},u),{handleSecondaryButtonClick:()=>{z(),de(u),u.skippable===!0&&f(e,u.id,{skipped:!0}),J(u,"secondary",k)},handlePrimaryButtonClick:()=>{(!u.completionCriteria&&(u.autoMarkCompleted||u.autoMarkCompleted===void 0)||u.completionCriteria&&u.autoMarkCompleted===!0)&&(f(e,u.id),z()),J(u,"primary",k),se(u),P(e,u.id)===Ge&&z()}}))}function De(){return Ce.createElement(ie,{appearance:g})}let ot={steps:ye(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:b,type:s,className:r,autoExpandFirstIncompleteStep:v,autoExpandNextStep:y};function Ye(){G(e,!1),p&&p(),F&&F(!1)}function bt(){return Ce.createElement(Ce.Fragment,null,Ce.createElement(De,null),Ce.createElement(tl,{flowId:e,appearance:g,customVariables:l,className:r}))}function Dt(){return Ce.createElement(Ce.Fragment,null,Ce.createElement(De,null),Ce.createElement(Ur,T({visible:Z,onClose:()=>{Ye()},selectedStep:Y,setSelectedStep:ee,autoExpandNextStep:!0,appearance:g},ot)))}function $t(){var W;let u=E.guideFlowId,k;return u&&h(u)&&(k=w(u)),Ce.createElement(Ce.Fragment,null,Ce.createElement(De,null),Ce.createElement(Mr,T({visible:Z,stepsTitle:D.stepsTitle?D.stepsTitle:"Your quick start guide",onClose:()=>{Ye()},selectedStep:Y,setSelectedStep:ee,guideData:k,guideTitle:(W=E.guideTitle)!=null?W:"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:ge=>{J(ge,"link",0)},customStepTypes:b},ot)))}function C(){let u=Ce.createElement(Dr,T({flowId:e,style:n,selectedStep:Y,setSelectedStep:ee,appearance:g,type:s},ot));return ue?Ce.createElement(Je,{onClose:()=>{Ye()},visible:Z,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},Ce.createElement(De,null),u):Ce.createElement(Ce.Fragment,null,Ce.createElement(De,null),u)}switch(x){case"condensed":return Dt();case"with-guide":return $t();case"default":return C();case"carousel":return bt();default:return C()}};var dc=e=>pc.createElement(zr,T({type:"inline"},e));import St,{useEffect as cc}from"react";import et from"react";import Ro from"styled-components";var il=Ro.div`
|
|
1359
1358
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1360
1359
|
border-radius: 8px;
|
|
1361
|
-
padding:
|
|
1360
|
+
padding: 10px 12px 10px 12px;
|
|
1362
1361
|
min-width: 160px;
|
|
1363
1362
|
cursor: pointer;
|
|
1364
1363
|
background-color: ${e=>e.appearance.theme.colorBackground}};
|
|
1364
|
+
${e=>ke(e)}
|
|
1365
|
+
|
|
1366
|
+
&:hover {
|
|
1367
|
+
filter: brightness(.99);
|
|
1368
|
+
}
|
|
1365
1369
|
`,nl=Ro.div`
|
|
1366
1370
|
display: flex;
|
|
1367
1371
|
flex-direction: row;
|
|
1368
1372
|
justify-content: space-between;
|
|
1369
1373
|
align-items: center;
|
|
1370
|
-
margin-bottom:
|
|
1374
|
+
margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
|
|
1371
1375
|
flex-grow: 2;
|
|
1372
1376
|
`,sl=Ro.div`
|
|
1373
1377
|
text-overflow: ellipsis;
|
|
1374
1378
|
font-weight: 600;
|
|
1375
|
-
font-size:
|
|
1376
|
-
line-height:
|
|
1379
|
+
font-size: 14px;
|
|
1380
|
+
line-height: 16px;
|
|
1377
1381
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1378
1382
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1379
|
-
color: ${e=>e.appearance.theme.colorPrimary};
|
|
1380
1383
|
`,ll=Ro.div`
|
|
1381
1384
|
width: 20px;
|
|
1382
1385
|
margin-right: 8px;
|
|
1383
1386
|
display: flex;
|
|
1384
1387
|
height: 100%;
|
|
1385
1388
|
align-items: center;
|
|
1386
|
-
`;var al=({title:e,count:t,total:o,onClick:n,style:i={},className:r,appearance:
|
|
1389
|
+
`;var al=({title:e,count:t,total:o,onClick:n,style:i={},className:r,appearance:s,type:p="default"})=>et.createElement(et.Fragment,null,et.createElement(ie,{appearance:s}),et.createElement(il,{onClick:()=>n!==void 0&&n(),styleOverrides:T(T({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),i),className:Te(r!=null?r:"",a("progressBadgeContainer",s)),appearance:s},p=="condensed"&&o&&o!==0&&et.createElement(ll,{className:a("progressRingContainer",s)},et.createElement(Ht,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),et.createElement(nl,{type:p,className:a("badgeTitleContainer",s)},et.createElement(sl,{type:p,appearance:s,className:a("badgeTitle",s)},e),n!==void 0&&et.createElement(Qt,{className:a("badgeChevron",s),color:s.theme.colorPrimary})),p=="default"&&o&&o!==0&&et.createElement(We,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s,textStyle:{color:"#818898"}})));import yt from"react";import To from"styled-components";var pl=To.div`
|
|
1387
1390
|
display: flex;
|
|
1388
1391
|
flex-direction: row;
|
|
1389
1392
|
width: 100%;
|
|
@@ -1395,7 +1398,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1395
1398
|
border-color: ${e=>e.appearance.theme.colorPrimary};
|
|
1396
1399
|
border-radius: 12px;
|
|
1397
1400
|
`,dl=To.div`
|
|
1398
|
-
${e=>
|
|
1401
|
+
${e=>B(e)} {
|
|
1399
1402
|
display: flex;
|
|
1400
1403
|
justify-content: center;
|
|
1401
1404
|
align-items: center;
|
|
@@ -1412,7 +1415,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1412
1415
|
justify-content: center;
|
|
1413
1416
|
margin-left: 16px;
|
|
1414
1417
|
min-width: 200px;
|
|
1415
|
-
|
|
1418
|
+
`,MS=To.div`
|
|
1416
1419
|
display: flex;
|
|
1417
1420
|
justify-content: center;
|
|
1418
1421
|
align-items: flex-end;
|
|
@@ -1421,7 +1424,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1421
1424
|
:hover {
|
|
1422
1425
|
opacity: 0.8;
|
|
1423
1426
|
}
|
|
1424
|
-
`;var ul=({title:e,subtitle:t,icon:o,appearance:n,count:i,total:r,className:
|
|
1427
|
+
`;var ul=({title:e,subtitle:t,icon:o,appearance:n,count:i,total:r,className:s,style:p})=>yt.createElement(yt.Fragment,null,yt.createElement(pl,{appearance:n,className:Te(a("fullWidthProgressBadgeContainer",n),s!=null?s:""),style:p},o&&yt.createElement(dl,{className:a("fullWidthProgressBadgeIcon",n)},o),yt.createElement(cl,null,yt.createElement(Ae,{size:"small",appearance:n,title:e,subtitle:t})),yt.createElement(ml,{className:a("fullWidthProgressBadgeProgressContainer",n)},yt.createElement(We,{count:i,total:r,display:"percent",textLocation:"top"}))));var mc=({flowId:e,title:t,subtitle:o,icon:n,style:i,onClick:r,className:s,customVariables:p,hideOnFlowCompletion:d,appearance:l,type:m="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:S,getNumberOfStepsCompleted:F,isLoading:b,targetingLogicShouldHideFlow:x,updateCustomVariables:v}=R(),{mergeAppearanceWithDefault:y}=te();l=y(l);let{setOpenFlowState:E,getOpenFlowState:A}=Be();if(cc(()=>{v(p)},[p,b]),b)return null;let O=c(e);if(!O||x(O)||d===!0&&S(e)===Q)return null;let h=g(e),w=F(e);return m==="full-width"?St.createElement(St.Fragment,null,St.createElement(ie,{appearance:l}),St.createElement(ul,{title:t,subtitle:o,count:w,total:h.length,style:i,className:s,appearance:l,icon:n,onClick:()=>{}})):St.createElement(St.Fragment,null,St.createElement(ie,{appearance:l}),St.createElement(al,{count:w,total:h.length,title:t,style:i,onClick:()=>{E(e,!0),r&&r()},type:m,className:s,appearance:l}))};import uc from"react";var fc=i=>{var r=i,{flowId:e,style:t,appearance:o}=r,n=Ie(r,["flowId","style","appearance"]);let{getFlow:s,targetingLogicShouldHideFlow:p,getFlowSteps:d}=R(),{mergeAppearanceWithDefault:l}=te();o=l(o);let m=s(e);if(!m||p(m))return null;let c=d(e);return uc.createElement(wo,T({steps:c,style:t,appearance:o},n))};import It,{useContext as vc,useEffect as Bc}from"react";import K,{useEffect as er,useLayoutEffect as xl,useRef as Sc,useState as eo}from"react";import Fo from"styled-components";import{useCallback as gc,useEffect as xc,useState as hc}from"react";var _r=(e,t,o,n={x:20,y:20},i)=>{let r=i=="fixed"?0:window.scrollY,s=i=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+n.x+s,y:e.top-n.y+r}:t==="right"?{x:e.left+e.width+n.x+s,y:e.top-n.y+r}:{x:0,y:0}};function fl(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[n,i]=hc(o),r=gc(()=>{e&&i(e.getBoundingClientRect())},[e]);return xc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),n}import{useContext as Cc,useState as yc}from"react";function gl(){let{debug:e}=Cc(X),[t,o]=yc([]);function n(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.log(r)))}function i(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:n,logErrorIfDebugMode:i}}var hl=300,Cl=100,bc=500,to=12,wc=Fo.div`
|
|
1425
1428
|
width: 100%;
|
|
1426
1429
|
height: 100%;
|
|
1427
1430
|
border-radius: 9999px;
|
|
@@ -1462,8 +1465,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1462
1465
|
`,kc=Fo(yl)`
|
|
1463
1466
|
width: ${to+12}px;
|
|
1464
1467
|
height: ${to+12}px;
|
|
1465
|
-
`,Pc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:n="auto",showHighlight:i=!0,primaryColor:r="#000000",offset:
|
|
1466
|
-
${e=>
|
|
1468
|
+
`,Pc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:n="auto",showHighlight:i=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:m,appearance:c,dismissible:g=!1,showHighlightOnly:S,showStepCount:F=!0,completedStepsCount:b=0,showFrigadeBranding:x=!1,cssPosition:v="absolute"})=>{var De,ot,Ye,bt,Dt,$t,C,u,k,W,ge,xe,ro,Jr,Qr,Zr,Rr,ei,ti;let{logErrorIfDebugMode:y}=gl(),[E,A]=eo(),[O,h]=eo(new Date),w=Sc(null),[f,P]=eo(document.querySelector(e[l].selector)),N=fl(f,O),[L,I]=eo(),[q,M]=eo(!S),V=(ot=(De=e[l])==null?void 0:De.props)!=null&&ot.position?e[l].props.position:v,le=(Dt=(bt=(Ye=e[l])==null?void 0:Ye.props)==null?void 0:bt.zIndex)!=null?Dt:90,pe=($t=E==null?void 0:E.width)!=null?$t:hl,_=(C=E==null?void 0:E.height)!=null?C:Cl,[se,de]=eo(new Date().getTime());s=(W=(k=(u=e[l])==null?void 0:u.props)==null?void 0:k.offset)!=null?W:s;let be=window.location.pathname.split("/").pop();xl(()=>{w.current&&A({width:w.current.clientWidth,height:w.current.clientHeight})},[l,O,V]),er(()=>{S||M(!0)},[l]);let G=()=>{let ne=document.querySelector(e[l].selector);if(!ne){I(void 0),P(null),y(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}L&&L===JSON.stringify(ne==null?void 0:ne.getBoundingClientRect())||(P(ne),h(new Date),ne&&I(JSON.stringify(ne.getBoundingClientRect())))};if(er(()=>{let ne=new MutationObserver(G);return ne.observe(document.body,{subtree:!0,childList:!0}),()=>ne.disconnect()},[G]),er(()=>{let ne=new MutationObserver(G);return ne.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>ne.disconnect()},[G]),er(()=>{let ne=setInterval(()=>{G()},10);return()=>clearInterval(ne)},[G]),xl(()=>{setTimeout(()=>{G()},bc),G()},[l,be]),f===null||!p||N.height===0&&N.width===0&&V!=="fixed"&&v!=="static")return null;let Y=n==="auto"?"right":n,ee=_r(N,Y,pe,s,V),Ve=N.right+pe>(window.innerWidth||document.documentElement.clientWidth),Le=N.bottom+Cl>(window.innerHeight||document.documentElement.clientHeight);Ve&&n==="auto"&&(ee=_r(N,"left",pe,s,V),Y="left"),(xe=(ge=e[l])==null?void 0:ge.props)!=null&&xe.tooltipPosition&&((Jr=(ro=e[l])==null?void 0:ro.props)==null?void 0:Jr.tooltipPosition)!=="auto"&&(((Zr=(Qr=e[l])==null?void 0:Qr.props)==null?void 0:Zr.tooltipPosition)==="left"||((ei=(Rr=e[l])==null?void 0:Rr.props)==null?void 0:ei.tooltipPosition)==="right")&&(Y=e[l].props.tooltipPosition);let Z=()=>{let ne=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),M(!1),setTimeout(()=>{G()},30)),b===e.length-1)return o()},ut=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),S&&!e[l].secondaryButtonUri&&M(!1))};return K.createElement(K.Fragment,null,F&&e.length>1&&K.createElement(Ci,null,K.createElement(Si,{className:a("tooltipStepCounter",c)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&K.createElement(yi,{showStepCount:F,className:a("tooltipCTAContainer",c)},e[l].secondaryButtonTitle&&K.createElement(oe,{title:e[l].secondaryButtonTitle,appearance:c,onClick:ut,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&K.createElement(oe,{title:e[l].primaryButtonTitle,appearance:c,onClick:ne,withMargin:!1,size:"small"})))},ue=()=>K.createElement(K.Fragment,null,g&&K.createElement(ui,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:a("tooltipClose",c),hasImage:!!e[l].imageUri||!!e[l].videoUri},K.createElement(Ee,null)),e[l].imageUri&&K.createElement(fi,{dismissible:g,appearance:c,src:e[l].imageUri,className:a("tooltipImageContainer",c)}),e[l].videoUri&&!e[l].imageUri&&K.createElement(gi,{dismissible:g,appearance:c,className:a("tooltipVideoContainer",c)},K.createElement(Ze,{appearance:c,videoUri:e[l].videoUri})),K.createElement(hi,{className:a("tooltipContentContainer",c)},K.createElement(Ae,{appearance:c,title:e[l].title,subtitle:e[l].subtitle,size:"small"}),K.createElement(xi,{className:a("tooltipFooter",c)},K.createElement(Z,null)))),we=T(T({},{default:ne=>{var ut;if((ut=e[l])!=null&&ut.StepContent){let ra=e[l].StepContent;return K.createElement("div",null,ra)}return K.createElement(ue,null)}}),m),U=()=>{var ne;return e?!((ne=e[l])!=null&&ne.type)||!we[e[l].type]?we.default(e[l]):we[e[l].type]({stepData:e[l],primaryColor:r}):K.createElement(K.Fragment,null)};if(e[l].complete===!0||ee.x==0&&ee.y==0&&new Date().getTime()-se<100)return null;let D={top:(ee==null?void 0:ee.y)-to,left:(ti=Y=="left"?N.x+s.x:(ee==null?void 0:ee.x)-to)!=null?ti:0,cursor:S?"pointer":"default",position:V},z=()=>{let ut=D.left+(Y=="left"?-pe:24);return Math.min(Math.max(ut,20),window.innerWidth-pe-20)},J=()=>{if(V==="fixed")return D.top;let ne=D.top+_,ut=20;return ne>window.innerHeight-ut?D.top+-_:D.top},ye=()=>{S&&(h(new Date),M(!q))};return K.createElement(Fc,null,K.createElement(kc,{style:D,zIndex:le,className:a("tourHighlightContainer",c)},i&&e[l].showHighlight!==!1&&v!=="static"&&K.createElement(K.Fragment,null,K.createElement(Tc,{style:{position:V},onClick:ye,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),K.createElement(wc,{style:{position:"absolute"},onClick:ye,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),K.createElement(yl,{style:H(T({},D),{left:z(),top:J()}),zIndex:le+1,className:a("tooltipContainerWrapper",c)},q&&K.createElement(K.Fragment,null,K.createElement(Eo,{ref:w,layoutId:"tooltip-container",style:T({position:"relative",width:"max-content",right:0,top:v!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:hl,zIndex:le+10},K.createElement(U,null)),x&&K.createElement(wi,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:le+10},K.createElement(Ao,{appearance:c})))))},Hr=Pc;import{Portal as Ec}from"react-portal";var Ac=b=>{var x=b,{flowId:e,customVariables:t,appearance:o,onStepCompletion:n,onButtonClick:i,showTooltipsSimultaneously:r=!1,onDismiss:s,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:g=!1,cssPosition:S="absolute"}=x,F=Ie(x,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition"]);let{getFlow:v,getFlowSteps:y,isLoading:E,targetingLogicShouldHideFlow:A,markStepCompleted:O,markStepStarted:h,markFlowCompleted:w,updateCustomVariables:f,getCurrentStepIndex:P,getStepStatus:N,isStepBlocked:L,getFlowStatus:I,getNumberOfStepsCompleted:q}=R(),{isLoadingUserFlowStateData:M}=Me(),{primaryCTAClickSideEffects:V,secondaryCTAClickSideEffects:le}=ae(),{hasOpenModals:pe}=Be(),_=P(e),{openFlowStates:se}=vc(X),{mergeAppearanceWithDefault:de}=te();if(o=de(o),Bc(()=>{f(t)},[t,E]),M)return null;let be=v(e);if(!be||A(be)||I(e)==Q||pe())return null;let G=y(e);if(Object.keys(se).length>0){let U=Object.keys(se).find(D=>se[D]===!0);if(U!==void 0&&U!==e)return It.createElement(It.Fragment,null)}function Y(U){return $(this,null,function*(){if(yield O(e,U.id),G.map(D=>N(e,D.id)).every(D=>D===Ge)){yield w(e);return}if(!l&&_+1<G.length&&!r){if(L(e,G[_+1].id))return;yield h(e,G[_+1].id)}})}function ee(U,D,z){let J=_+1<G.length?G[_+1]:null;i&&i(U,_,D,J),n&&n(U,z,J)}function Ve(){return G.map(U=>H(T({},U),{handleSecondaryButtonClick:()=>$(this,null,function*(){le(U),U.skippable===!0&&(yield O(e,U.id,{skipped:!0})),ee(U,"secondary",_)}),handlePrimaryButtonClick:()=>$(this,null,function*(){(!U.completionCriteria&&(U.autoMarkCompleted||U.autoMarkCompleted===void 0)||U.completionCriteria&&U.autoMarkCompleted===!0)&&(yield Y(U)),ee(U,"primary",_),V(U)})}))}function Le(U){return $(this,null,function*(){s&&s(),m==="complete-flow"?yield w(e):yield O(e,U.id)})}function Z(){c&&c()}let ue=!document.querySelector(G[_].selector);function Oe(){let U=G.findIndex(D=>!!document.querySelector(D.selector));return G.map((D,z)=>ue&&!r&&z!==U&&g||!r&&z!==_?null:It.createElement(Hr,T({key:D.id,appearance:o,steps:Ve(),selectedStep:z,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Le(D),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:q(e),onComplete:Z,cssPosition:S},F)))}function we(){return It.createElement(It.Fragment,null,It.createElement(ie,{appearance:o}),Oe())}return S==="static"?we():It.createElement(Ec,null,we())};import _e,{useEffect as Oc,useRef as Ic,useState as Nc}from"react";import{Portal as Lc}from"react-portal";import Nt from"styled-components";var Sl=Nt.button`
|
|
1469
|
+
${e=>B(e)} {
|
|
1467
1470
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1468
1471
|
|
|
1469
1472
|
display: flex;
|
|
@@ -1481,12 +1484,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1481
1484
|
}
|
|
1482
1485
|
}
|
|
1483
1486
|
`,bl=Nt.span`
|
|
1484
|
-
${e=>
|
|
1487
|
+
${e=>B(e)} {
|
|
1485
1488
|
font-size: 12px;
|
|
1486
1489
|
display: inline-block;
|
|
1487
1490
|
}
|
|
1488
1491
|
`,wl=Nt.span`
|
|
1489
|
-
${e=>
|
|
1492
|
+
${e=>B(e)} {
|
|
1490
1493
|
font-size: 12px;
|
|
1491
1494
|
display: inline-block;
|
|
1492
1495
|
}
|
|
@@ -1501,7 +1504,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1501
1504
|
align-items: flex-end;
|
|
1502
1505
|
z-index: 50;
|
|
1503
1506
|
`,Fl=Nt.button`
|
|
1504
|
-
${e=>
|
|
1507
|
+
${e=>B(e)} {
|
|
1505
1508
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1506
1509
|
background-color: #ffffff;
|
|
1507
1510
|
border: 1px solid #f5f5f5;
|
|
@@ -1517,7 +1520,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1517
1520
|
border-radius: 45px;
|
|
1518
1521
|
cursor: pointer;
|
|
1519
1522
|
`,kl=Nt.div`
|
|
1520
|
-
${e=>
|
|
1523
|
+
${e=>B(e)} {
|
|
1521
1524
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1522
1525
|
background: #ffffff;
|
|
1523
1526
|
}
|
|
@@ -1534,7 +1537,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1534
1537
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1535
1538
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1536
1539
|
`,Pl=Nt.button`
|
|
1537
|
-
${e=>
|
|
1540
|
+
${e=>B(e)} {
|
|
1538
1541
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1539
1542
|
color: #434343;
|
|
1540
1543
|
:hover {
|
|
@@ -1550,8 +1553,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1550
1553
|
font-size: 14px;
|
|
1551
1554
|
|
|
1552
1555
|
padding: 8px 12px;
|
|
1553
|
-
`;import vl from"react";var Bl=({style:e,className:t})=>vl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},vl.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import El from"react";var Al=({style:e,className:t})=>El.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},El.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Dc=({flowId:e,style:t,onStepCompletion:o,visible:n=!0,type:i="inline",title:r="Help",appearance:
|
|
1554
|
-
${e=>
|
|
1556
|
+
`;import vl from"react";var Bl=({style:e,className:t})=>vl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},vl.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import El from"react";var Al=({style:e,className:t})=>El.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},El.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Dc=({flowId:e,style:t,onStepCompletion:o,visible:n=!0,type:i="inline",title:r="Help",appearance:s})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:l,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:S}=R(),{primaryCTAClickSideEffects:F}=ae(),b=Ic(null),[x,v]=Nc(!1),{mergeAppearanceWithDefault:y}=te();s=y(s),Oc(()=>(document.addEventListener("click",E,!1),()=>{document.removeEventListener("click",E,!1)}),[]);let E=f=>{b.current&&!b.current.contains(f.target)&&v(!1)};if(g)return null;let A=p(e);if(!A||S(A))return null;let O=d(e);if(!O||!n)return null;function h(f,P){!f.completionCriteria&&(f.autoMarkCompleted||f.autoMarkCompleted===void 0)&&l(e,f.id),F(f),o&&o(f,P),v(!1)}function w(){return x&&_e.createElement(kl,{className:a("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:i},O.map((f,P)=>_e.createElement(Pl,{className:a("floatingWidgetMenuItem",s),key:P,onClick:()=>h(f,P)},f.title)))}return i=="inline"?_e.createElement("span",{ref:b},_e.createElement(Sl,{style:t,onClick:()=>{v(!x)},className:a("supportButton",s)},_e.createElement(wl,{className:a("supportIconContainer",s)},_e.createElement(Al,{className:a("supportIcon",s),style:{width:"18px",height:"18px"}})),_e.createElement(bl,{className:a("supportButtonTitle",s)},r)),_e.createElement(w,null)):_e.createElement(Lc,null,_e.createElement(Tl,{style:t,ref:b},_e.createElement(w,null),_e.createElement(Fl,{onClick:()=>{v(!x)},whileHover:{scale:1.1},className:a("floatingWidgetButton",s)},_e.createElement(Bl,{className:a("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import tt,{useEffect as $c}from"react";import tr from"styled-components";var Ol=tr.div`
|
|
1557
|
+
${e=>B(e)} {
|
|
1555
1558
|
display: flex;
|
|
1556
1559
|
flex-direction: column;
|
|
1557
1560
|
width: 100%;
|
|
@@ -1565,7 +1568,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1565
1568
|
border-radius: 12px;
|
|
1566
1569
|
position: relative;
|
|
1567
1570
|
}
|
|
1568
|
-
`,
|
|
1571
|
+
`,Il=tr.div`
|
|
1569
1572
|
display: flex;
|
|
1570
1573
|
flex-direction: column;
|
|
1571
1574
|
flex: 1;
|
|
@@ -1576,7 +1579,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1576
1579
|
align-items: flex-start;
|
|
1577
1580
|
margin-top: 16px;
|
|
1578
1581
|
`,Ll=tr.div`
|
|
1579
|
-
${e=>
|
|
1582
|
+
${e=>B(e)} {
|
|
1580
1583
|
position: absolute;
|
|
1581
1584
|
top: 16px;
|
|
1582
1585
|
right: 16px;
|
|
@@ -1586,9 +1589,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1586
1589
|
opacity: 0.8;
|
|
1587
1590
|
}
|
|
1588
1591
|
}
|
|
1589
|
-
`;var Mc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:i,className:r,style:
|
|
1592
|
+
`;var Mc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:i,className:r,style:s,dismissible:p})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:S,getFlowSteps:F,getFlowStatus:b,getCurrentStepIndex:x}=R(),{primaryCTAClickSideEffects:v}=ae(),{mergeAppearanceWithDefault:y}=te();if(i=y(i),$c(()=>{S(o)},[o,c]),c)return null;let E=d(e);if(!E||g(E)||b(e)===Q)return null;let O=F(e)[x(e)];return tt.createElement(tt.Fragment,null,tt.createElement(ie,{appearance:i}),tt.createElement(Ol,{appearance:i,className:Te(a("embeddedTipContainer",i),r),style:s},(p===!0||O.dismissible)&&tt.createElement(Ll,{onClick:()=>$(void 0,null,function*(){yield l(e),t&&t()}),className:a("embeddedTipDismissButton",i)},tt.createElement(Ee,null)),tt.createElement(Il,null,tt.createElement(Ae,{size:"small",appearance:i,title:O.title,subtitle:O.subtitle})),O.primaryButtonTitle&&tt.createElement(Nl,{className:a("embeddedTipCallToActionContainer",i)},tt.createElement(oe,{classPrefix:"embeddedTip",title:O.primaryButtonTitle,appearance:i,withMargin:!1,size:"medium",type:"inline",onClick:()=>$(void 0,null,function*(){O.handlePrimaryButtonClick(),v(O),!(n&&n(O,x(e),"primary")===!1)&&(yield m(e,O.id),yield l(e))})}))))};import Pe,{useEffect as Uc}from"react";import oo from"styled-components";var Dl=oo.div`
|
|
1590
1593
|
// use the :not annotation
|
|
1591
|
-
${e=>
|
|
1594
|
+
${e=>B(e)} {
|
|
1592
1595
|
display: flex;
|
|
1593
1596
|
flex-direction: ${e=>e.type==="square"?"column":"row"};
|
|
1594
1597
|
width: 100%;
|
|
@@ -1599,7 +1602,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1599
1602
|
border-radius: 12px;
|
|
1600
1603
|
}
|
|
1601
1604
|
`,$l=oo.div`
|
|
1602
|
-
${e=>
|
|
1605
|
+
${e=>B(e)} {
|
|
1603
1606
|
display: flex;
|
|
1604
1607
|
width: 46px;
|
|
1605
1608
|
height: 46px;
|
|
@@ -1628,7 +1631,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1628
1631
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1629
1632
|
align-items: flex-end;
|
|
1630
1633
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1631
|
-
`;import Gr from"react";var Wl=({style:e,className:t})=>Gr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Gr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Gr.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 Wc=({flowId:e,title:t,subtitle:o,onDismiss:n,customVariables:i,onButtonClick:r,appearance:
|
|
1634
|
+
`;import Gr from"react";var Wl=({style:e,className:t})=>Gr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Gr.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Gr.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 Wc=({flowId:e,title:t,subtitle:o,onDismiss:n,customVariables:i,onButtonClick:r,appearance:s,type:p="full-width",icon:d})=>{let{getFlow:l,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:S,getFlowMetadata:F,getFlowStatus:b,getFlowSteps:x,getCurrentStepIndex:v}=R(),{primaryCTAClickSideEffects:y}=ae(),{mergeAppearanceWithDefault:E}=te();if(s=E(s),Uc(()=>{S(i)},[i,c]),c)return null;let A=l(e);if(!A||g(A)||b(e)===Q)return null;let O=x(e),h=O.length>0?O[v(e)]:F(e);return h!=null&&h.title&&(t=h.title),h!=null&&h.subtitle&&(o=h.subtitle),Pe.createElement(Pe.Fragment,null,Pe.createElement(ie,{appearance:s}),Pe.createElement(Dl,{type:p,appearance:s,className:a("bannerContainer",s)},p!="square"&&Pe.createElement($l,{className:a("bannerIconContainer",s)},d||Pe.createElement(Wl,null)),p==="square"&&h.dismissible&&Pe.createElement(Vr,{type:p,className:a("bannerDismissButtonContainer",s)},Pe.createElement(jr,{type:p,onClick:()=>$(void 0,null,function*(){yield m(e),n&&n()}),className:a("bannerDismissButton",s)},Pe.createElement(Ee,null))),Pe.createElement(Ml,{type:p},Pe.createElement(Ae,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(h==null?void 0:h.primaryButtonTitle)&&Pe.createElement(Ul,{type:p,className:a("bannerCallToActionContainer",s)},Pe.createElement(oe,{title:h==null?void 0:h.primaryButtonTitle,appearance:s,onClick:()=>{y(h),r&&r(h,0,"primary")},classPrefix:"banner"})),p!=="square"&&h.dismissible&&Pe.createElement(Vr,{type:p,className:a("bannerDismissButtonContainer",s)},Pe.createElement(jr,{type:p,onClick:()=>$(void 0,null,function*(){yield m(e),n&&n()}),className:a("bannerDismissButton",s)},Pe.createElement(Ee,null)))))};import re,{useEffect as zc}from"react";import{Portal as _c}from"react-portal";import mt from"styled-components";var zl=mt.div`
|
|
1632
1635
|
display: flex;
|
|
1633
1636
|
flex-direction: column;
|
|
1634
1637
|
width: 100%;
|
|
@@ -1688,14 +1691,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1688
1691
|
display: flex;
|
|
1689
1692
|
flex-direction: column;
|
|
1690
1693
|
flex: 1;
|
|
1691
|
-
`,
|
|
1694
|
+
`,ow=mt.div`
|
|
1692
1695
|
display: flex;
|
|
1693
1696
|
flex-direction: column;
|
|
1694
1697
|
justify-content: center;
|
|
1695
1698
|
align-items: flex-start;
|
|
1696
1699
|
margin-top: 16px;
|
|
1697
1700
|
`,jl=mt.textarea`
|
|
1698
|
-
${e=>
|
|
1701
|
+
${e=>B(e)} {
|
|
1699
1702
|
margin-top: 16px;
|
|
1700
1703
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1701
1704
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
@@ -1706,7 +1709,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1706
1709
|
height: 100px;
|
|
1707
1710
|
}
|
|
1708
1711
|
`,Vl=mt.div`
|
|
1709
|
-
${e=>
|
|
1712
|
+
${e=>B(e)} {
|
|
1710
1713
|
position: absolute;
|
|
1711
1714
|
top: 16px;
|
|
1712
1715
|
right: 16px;
|
|
@@ -1716,8 +1719,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1716
1719
|
opacity: 0.8;
|
|
1717
1720
|
}
|
|
1718
1721
|
}
|
|
1719
|
-
`;var Hc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:i,className:r,style:
|
|
1720
|
-
${e=>
|
|
1722
|
+
`;var Hc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:i,className:r,style:s,type:p="modal"})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:S,updateCustomVariables:F,getFlowSteps:b,getFlowStatus:x,getFlowMetadata:v}=R(),{primaryCTAClickSideEffects:y}=ae(),{mergeAppearanceWithDefault:E}=te(),[A,O]=re.useState(null),[h,w]=re.useState(""),f=v(e),{hasOpenModals:P,setKeepCompletedFlowOpenDuringSession:N,shouldKeepCompletedFlowOpenDuringSession:L}=Be();if(i=E(i),zc(()=>{F(o)},[o,g]),g)return null;let I=d(e);if(!I||S(I)||x(e)===Q||c(e)===1&&!L(e)||P())return null;let M=b(e)[c(e)];function V(){var _,se;return re.createElement(re.Fragment,null,re.createElement(Yr,null,re.createElement(Ae,{size:"large",appearance:i,title:M.title,subtitle:M.subtitle})),re.createElement(Kr,{className:a("npsNumberButtonContainer",i),appearance:i},Array.from(Array(10).keys()).map(de=>re.createElement(_l,{className:a("npsNumberButton",i),selected:A===de+1,key:de,onClick:()=>$(this,null,function*(){N(e),O(de+1),yield m(e,M.id,{score:de+1})}),appearance:i},de+1))),re.createElement(Hl,{appearance:i},re.createElement(qr,{appearance:i},(_=f==null?void 0:f.negativeLabel)!=null?_:"Not likely at all"),re.createElement(qr,{appearance:i},(se=f==null?void 0:f.positiveLabel)!=null?se:"Extremely likely")))}function le(){var _;return re.createElement(re.Fragment,null,re.createElement(Yr,null,re.createElement(Ae,{appearance:i,title:(_=M.title)!=null?_:"Why did you choose this score?",size:"large"})),re.createElement(jl,{appearance:i,value:h,onChange:se=>{w(se.target.value)},placeHolder:"Add your optional fedback here..."}),re.createElement(Kr,{appearance:i,className:a("npsNumberButtonContainer",i)},re.createElement(oe,{size:"large",withMargin:!1,onClick:()=>$(this,null,function*(){yield l(e),n&&n(M,1,"primary")}),appearance:i,title:M.secondaryButtonTitle||"Skip",secondary:!0}),re.createElement(oe,{size:"large",withMargin:!1,onClick:()=>$(this,null,function*(){yield m(e,M.id,{feedbackText:h}),yield l(e),n&&n(M,1,"primary")}),appearance:i,title:M.primaryButtonTitle||"Submit"})))}function pe(){return c(e)>=2?null:re.createElement(re.Fragment,null,re.createElement(ie,{appearance:i}),re.createElement(zl,{appearance:i,className:Te(a("npsSurveyContainer",i),r),style:s,type:p},re.createElement(Vl,{onClick:()=>$(this,null,function*(){yield l(e),t&&t()}),className:a("npsSurveyDismissButton",i)},re.createElement(Ee,null)),c(e)==0&&V(),c(e)==1&&le()))}return p==="inline"?pe():re.createElement(_c,null,pe())};import ve,{useEffect as Gc}from"react";import Lt from"styled-components";var Gl=Lt.div`
|
|
1723
|
+
${e=>B(e)} {
|
|
1721
1724
|
display: flex;
|
|
1722
1725
|
flex-direction: column;
|
|
1723
1726
|
width: 100%;
|
|
@@ -1742,7 +1745,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1742
1745
|
margin-top: 16px;
|
|
1743
1746
|
margin-bottom: 16px;
|
|
1744
1747
|
`,Xl=Lt.div`
|
|
1745
|
-
${e=>
|
|
1748
|
+
${e=>B(e)} {
|
|
1746
1749
|
position: absolute;
|
|
1747
1750
|
top: -16px;
|
|
1748
1751
|
right: -16px;
|
|
@@ -1753,7 +1756,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1753
1756
|
}
|
|
1754
1757
|
}
|
|
1755
1758
|
`,Jl=Lt.h1`
|
|
1756
|
-
${e=>
|
|
1759
|
+
${e=>B(e)} {
|
|
1757
1760
|
font-style: normal;
|
|
1758
1761
|
justify-content: center;
|
|
1759
1762
|
text-align: center;
|
|
@@ -1767,7 +1770,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1767
1770
|
margin-bottom: 8px;
|
|
1768
1771
|
}
|
|
1769
1772
|
`,Ql=Lt.h2`
|
|
1770
|
-
${e=>
|
|
1773
|
+
${e=>B(e)} {
|
|
1771
1774
|
font-style: normal;
|
|
1772
1775
|
justify-content: center;
|
|
1773
1776
|
text-align: center;
|
|
@@ -1783,5 +1786,5 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${lo}${t}.${lo}${t} { ${Object.entries(o).map
|
|
|
1783
1786
|
height: 100%;
|
|
1784
1787
|
min-height: 200px;
|
|
1785
1788
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1786
|
-
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(Ze,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(Vc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Kc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:i,className:r,style:
|
|
1789
|
+
`;function Rl({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Zl.createElement(Ze,{appearance:t,videoUri:e.videoUri}):e.imageUri?Zl.createElement(Vc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Kc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:n,appearance:i,className:r,style:s,dismissible:p=!0,modalPosition:d="center"})=>{let{getFlow:l,markFlowCompleted:m,markStepCompleted:c,isLoading:g,targetingLogicShouldHideFlow:S,updateCustomVariables:F,getFlowSteps:b,getFlowStatus:x,getCurrentStepIndex:v}=R(),{primaryCTAClickSideEffects:y,secondaryCTAClickSideEffects:E}=ae(),{mergeAppearanceWithDefault:A}=te(),{setOpenFlowState:O,getOpenFlowState:h,hasOpenModals:w}=Be(),[f,P]=[h(e,!0),le=>O(e,le)];if(i=A(i),Gc(()=>{F(o)},[o,g]),g)return null;let N=l(e);if(!N||S(N)||x(e)===Q||w())return null;let I=b(e)[v(e)],q=()=>{P(!1),t&&t(),m(e)};function M(){return ve.createElement(ve.Fragment,null,ve.createElement(ie,{appearance:i}),ve.createElement(Gl,{appearance:i,className:Te(a("announcementContainer",i),r),style:s},(p===!0||I.dismissible)&&d=="inline"&&ve.createElement(Xl,{onClick:()=>$(this,null,function*(){yield m(e),t&&t()}),className:a("announcementDismissButton",i)},ve.createElement(Ee,null)),ve.createElement(Kl,null,ve.createElement(Jl,{appearance:i,className:a("announcementTitle",i),dangerouslySetInnerHTML:ce(I.title)}),I.subtitle&&ve.createElement(Ql,{appearance:i,className:a("announcementSubtitle",i),dangerouslySetInnerHTML:ce(I.subtitle)})),(I.imageUri||I.videoUri)&&ve.createElement(Yl,{className:a("announcementMediaContainer",i)},ve.createElement(Rl,{appearance:i,stepData:I})),(I.primaryButtonTitle||I.secondaryButtonTitle)&&ve.createElement(ql,{className:a("announcementCTAContainer",i)},I.secondaryButtonTitle&&ve.createElement(oe,{classPrefix:"announcement",title:I.secondaryButtonTitle,appearance:i,withMargin:!1,size:"small",type:"full-width",onClick:()=>$(this,null,function*(){I.handleSecondaryButtonClick(),E(I),n&&n(I,v(e),"secondary")}),secondary:!0}),I.primaryButtonTitle&&ve.createElement(oe,{classPrefix:"announcement",title:I.primaryButtonTitle,appearance:i,withMargin:!1,size:"small",type:"full-width",onClick:()=>$(this,null,function*(){I.handlePrimaryButtonClick(),y(I),!(n&&n(I,v(e),"primary")===!1)&&(yield c(e,I.id),yield m(e))})}))))}let V={padding:"24px",maxWidth:"400px"};return d==="inline"?M():d!=="center"?ve.createElement(No,{modalPosition:d,onClose:q,visible:f,dismissible:p,appearance:i},M()):ve.createElement(Je,{appearance:i,onClose:q,visible:f,style:V,dismissible:p},M())};import*as or from"react";import ea from"react";var ta=i=>{var r=i,{as:e="span",children:t,variant:o="Body1"}=r,n=Ie(r,["as","children","variant"]);return ea.createElement(Tn,T({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},n),t)},qc=Object.fromEntries(Object.keys(Go).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=n=>ea.createElement(ta,H(T({as:t},n),{variant:e}),n.children);return o.displayName=`Text.${e}`,[e,o]})),Xr=Object.assign(ta,qc);var oa=s=>{var p=s,{as:e="button",className:t,size:o="md",title:n,variant:i="Primary"}=p,r=Ie(p,["as","className","size","title","variant"]);var d;return or.createElement(wn,T({className:`fr-button-${i.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:i,size:o,borderRadius:"md"},r),or.createElement(Xr,{color:(d=yo[i])==null?void 0:d.color,fontWeight:"semibold"},n))},Yc=Object.fromEntries(Object.keys(yo).map(e=>{let t=o=>or.createElement(oa,H(T({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),Xc=Object.assign(oa,Yc);export{Co as Box,Xc as Button,nt as CheckBox,sr as FlowType,gt as FormLabel,Cr as FormTextField,Kc as FrigadeAnnouncement,Wc as FrigadeBanner,zr as FrigadeChecklist,it as FrigadeDefaultAppearance,Mc as FrigadeEmbeddedTip,fn as FrigadeForm,fc as FrigadeGuide,dc as FrigadeHeroChecklist,Hc as FrigadeNPSSurvey,mc as FrigadeProgressBadge,bd as FrigadeProvider,Dc as FrigadeSupportWidget,Ac as FrigadeTour,We as ProgressBar,Ht as ProgressRing,Xr as Text,Or as tokens,Be as useFlowOpens,no as useFlowResponses,R as useFlows,Ar as useOrganization,so as useUser,Me as useUserFlowStates};
|
|
1787
1790
|
//# sourceMappingURL=index.mjs.map
|