@frigade/react 1.37.19 → 1.37.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -1
- package/dist/index.js +91 -90
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +167 -166
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnPropertyDescriptors;var Mo=Object.getOwnPropertySymbols;var li=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable;var si=(e,t,o)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,w=(e,t)=>{for(var o in t||(t={}))li.call(t,o)&&si(e,o,t[o]);if(Mo)for(var o of Mo(t))ai.call(t,o)&&si(e,o,t[o]);return e},j=(e,t)=>sa(e,la(t));var pi=e=>typeof e=="symbol"?e:e+"",Le=(e,t)=>{var o={};for(var i in e)li.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Mo)for(var i of Mo(e))t.indexOf(i)<0&&ai.call(e,i)&&(o[i]=e[i]);return o};var M=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{p(o.next(d))}catch(s){n(s)}},l=d=>{try{p(o.throw(d))}catch(s){n(s)}},p=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,l);p((o=o.apply(e,t)).next())});import Eo,{createContext as Td,useEffect as rr,useState as je}from"react";import{ThemeProvider as An}from"styled-components";import Lt,{useContext as Zp,useEffect as Rt,useState as ko}from"react";import{useCallback as At,useContext as Sa,useEffect as ba}from"react";import hr,{useMemo as ci}from"react";var di="1.37.19";var nt="NOT_STARTED_STEP",ne="COMPLETED_FLOW",Do="ABORTED_FLOW",Et="STARTED_FLOW",De="NOT_STARTED_FLOW",$e="COMPLETED_STEP",go="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=hr.useContext(Q);return{config:ci(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":di,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:ci(()=>`${o}/v1/public/`,[o])}}var aa="frigade-last-call-at-",pa="frigade-last-call-data-";function jt(){let{shouldGracefullyDegrade:e,readonly:t}=hr.useContext(Q);return(o,i)=>M(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Vt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Vt();let n=aa+o,r=pa+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let p=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(p&&d&&d==i.body){let s=new Date(p);if(new Date().getTime()-s.getTime()<1e3)return Vt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let l;try{l=yield fetch(o,i)}catch(p){return Vt(p)}return l?l.ok?l:Vt(l.statusText):Vt()})}function Vt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Gt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=hr.useContext(Q);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as xa,useState as mi}from"react";import{useContext as ca,useEffect as ma,useState as ua}from"react";import fa from"swr";import{useContext as da}from"react";function Ee(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=da(Q);function r(c,g=!1){var y;return(y=e[c])!=null?y:g}function l(c,g){t(y=>j(w({},y),{[c]:g}))}function p(c){t(g=>{let C=g,{[c]:y}=C,S=Le(C,[pi(c)]);return w({},S)})}function d(c){n.includes(c)||i(g=>[...g,c])}function s(c){return n.includes(c)}function m(c){return Object.entries(e).some(([g,y])=>y&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}import ga from"swr/immutable";import ho from"core-js-pure/actual/structured-clone";function xr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ce(...e){let t=e.shift(),o=e.length===1?e[0]:Ce(...e);if(!xr(t)||!xr(o))throw new Error("deepmerge can only merge Objects");let i=ho(t);return Object.entries(o).forEach(([n,r])=>{xr(r)?i[n]!==void 0?Object.assign(i,{[n]:Ce(i[n],ho(r))}):Object.assign(i,{[n]:ho(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...ho(r)]}):Object.assign(i,{[n]:ho(r)}):Object.assign(i,{[n]:r})}),i}var ha="unknown";function Ue(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=ca(Q),{resetOpenFlowState:d}=Ee(),[s,m]=ua(!1),c={data:r.map(T=>({flowId:T.id,flowState:ne,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=T=>fetch(T,e).then(k=>{if(k.ok)return k.json();throw new Error("Failed to fetch user flow states")}).catch(k=>(console.log(`Error fetching ${T}: ${k}. Will gracefully degrade and hide Frigade`),l(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:S,isLoading:C,mutate:x,error:P}=p?ga(y,g):fa(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),b=S==null?void 0:S.data;ma(()=>{!s&&!C&&b&&m(!0)},[b,s,C]);function v(T){return M(this,null,function*(){if(b&&!p){let k=b.find(I=>I.flowId===T);k&&k.flowState!==ne&&(k.flowState=ne),yield x(Promise.resolve(Ce(S,{data:b})),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function $(T,k,I){return M(this,null,function*(){if(b){let N=b.find(A=>A.flowId===T);N&&(N.stepStates[k]=I,N.flowState=Et),yield x(Promise.resolve(Ce(S,{data:b})),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function B(T,k,I){return M(this,null,function*(){if(b){let N=b.find(A=>A.flowId===T);N&&(N.lastStepId=k,N.stepStates[k]=I,N.flowState=Et),yield x(Ce(S,{data:b}),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1})}})}function u(T){return M(this,null,function*(){if(b){let k=b.find(I=>I.flowId===T);k&&k.flowState!==De&&(k.flowState=De,k.lastStepId=ha,Object.keys(k.stepStates).forEach(I=>{k.stepStates[I].actionType=nt,k.stepStates[I].createdAt=new Date().toISOString()}),yield x(Ce(S,{data:b}),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1}),d(T))}})}function O(T,k,I){return M(this,null,function*(){if(b){let N=b.find(A=>A.flowId===T);N&&(N.stepStates[k]=I),yield x(Promise.resolve(Ce(S,{data:b})),{optimisticData:Ce(S,{data:b}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:b,isLoadingUserFlowStateData:!s,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:v,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:$,optimisticallyMarkStepNotStarted:O,optimisticallyMarkStepStarted:B,error:P}}function xo(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=Ue(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=xa(Q),[d,s]=mi(new Set),[m,c]=mi(new Set),g=jt();function y(x){let P=JSON.stringify(x);if(d.has(P))return null;d.add(P),s(d),m.add(x),c(m);let b=l==null?void 0:l.find(v=>v.flowSlug===x.flowSlug&&v.stepId===x.stepId&&v.actionType===x.actionType&&v.createdAt===x.createdAt);return g(`${t}flowResponses`,j(w({},e),{method:"POST",body:P})).then(v=>{v.status!==200&&v.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):b||p($=>[...$!=null?$:[],x])})}function S(x){return M(this,null,function*(){x.foreignUserId&&(x.actionType===Et||x.actionType===De?yield y(x):x.actionType===ne?yield y(x):x.actionType===go?yield y(x):x.actionType===$e?yield y(x):x.actionType===Do?yield y(x):x.actionType===nt&&(yield y(x)))})}function C(){let x=[];return o==null||o.forEach(P=>{if(P&&P.stepStates&&Object.keys(P.stepStates).length!==0)for(let b in P.stepStates){let v=P.stepStates[b];x.push({foreignUserId:P.foreignUserId,flowSlug:P.flowId,stepId:v.stepId,actionType:v.actionType,data:{},createdAt:new Date(v.createdAt),blocked:v.blocked,hidden:v.hidden})}}),[...x,...l]}return{addResponse:S,setFlowResponses:p,getFlowResponses:C}}import wa from"swr";var Ca=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,ui=e=>{let t=Ca.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=ya(i,"'","");r.startsWith("flow_")&&(o=r)}),o},ya=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function Uo(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var Cr=(s=>(s.CHECKLIST="CHECKLIST",s.FORM="FORM",s.TOUR="TOUR",s.SUPPORT="SUPPORT",s.CUSTOM="CUSTOM",s.BANNER="BANNER",s.EMBEDDED_TIP="EMBEDDED_TIP",s.NPS_SURVEY="NPS_SURVEY",s.ANNOUNCEMENT="ANNOUNCEMENT",s))(Cr||{});function R(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:y,readonly:S,flowDataOverrides:C}=Sa(Q),x={data:[]},{verifySDKInitiated:P}=Gt(),{addResponse:b,getFlowResponses:v}=xo(),$=h=>fetch(h,e).then(f=>f.ok?f.json():(console.log(`Error fetching ${h} (${f.status}): ${f.statusText}. Will gracefully degrade and hide Frigade`),g(!0),x)).catch(f=>(console.log(`Error fetching ${h}: ${f}. Will gracefully degrade and hide Frigade`),g(!0),x)),{mutateUserFlowState:B,userFlowStatesData:u,isLoadingUserFlowStateData:O,optimisticallyMarkFlowCompleted:T,optimisticallyMarkFlowNotStarted:k,optimisticallyMarkStepCompleted:I,optimisticallyMarkStepNotStarted:N,optimisticallyMarkStepStarted:A}=Ue(),{data:H,error:U,isLoading:oe}=wa(l?`${t}flows${S?"?readonly=true":""}`:null,$,{keepPreviousData:!0});ba(()=>{if(U){console.error(U);return}H&&H.data&&i(H.data)},[H,U]);function X(h){if(oe)return null;let f=o.find(F=>F.slug===h);return!f&&o.length>0&&!O&&!oe?(console.log(`Flow with id ${h} not found`),null):(f&&C&&C[h]&&(f.data=C[h]),(f==null?void 0:f.active)===!1&&!S?null:f)}function q(h){var _,ge,xt,vt,Bt;if(!X(h))return[];let f=(_=X(h))==null?void 0:_.data;return f?(f=J(f),((Bt=(vt=(ge=Uo(f))==null?void 0:ge.data)!=null?vt:(xt=Uo(f))==null?void 0:xt.steps)!=null?Bt:[]).map(he=>{let uo=Ge(he);return j(w({handleSecondaryButtonClick:()=>{he.skippable===!0&&Z(h,he.id,{skipped:!0})}},he),{complete:me(h,he.id)===$e||uo>=1,started:me(h,he.id)===go||me(h,he.id)===$e,currentlyActive:u==null?void 0:u.some(fo=>fo.flowId==h&&fo.lastStepId===he.id),blocked:V(h,he.id),hidden:z(h,he.id),handlePrimaryButtonClick:()=>{(!he.completionCriteria&&(he.autoMarkCompleted||he.autoMarkCompleted===void 0)||he.completionCriteria&&he.autoMarkCompleted===!0)&&Z(h,he.id)},progress:uo})}).filter(he=>he.hidden!==!0)):[]}function J(h){return h.replaceAll(/\${(.*?)}/g,(f,F)=>p[F]===void 0?"":String(p[F]).replace(/[\u00A0-\u9999<>\&]/g,function(_){return"&#"+_.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function Y(h){var F;if(!X(h))return[];let f=X(h).data;return f?(f=J(f),(F=JSON.parse(f))!=null?F:{}):[]}function de(h,f){d(F=>j(w({},F),{[h]:f}))}function we(h){!O&&!oe&&h&&JSON.stringify(p)!=JSON.stringify(w(w({},p),h))&&Object.keys(h).forEach(f=>{de(f,h[f])})}let Ie=At((h,f,F)=>M(this,null,function*(){if(!P())return;let _={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:go,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};ue(_)&&(yield A(h,f,_),b(_))}),[n,r,u]),ce=At((h,f,F)=>M(this,null,function*(){if(!P())return;let _={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:nt,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};ue(_)&&(yield N(h,f,_),b(_))}),[n,r,u]),Z=At((h,f,F)=>M(this,null,function*(){if(!P())return;let _={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:$e,data:F!=null?F:{},createdAt:new Date,blocked:!1,hidden:!1};ue(_)&&(yield I(h,f,_),b(_))}),[n,r,u]),D=At((h,f)=>M(this,null,function*(){if(!P()||Xe(h)===De)return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:De,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};yield k(h),ue(F)&&b(F)}),[n,r,u]),ee=At((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Et,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(F)&&b(F)}),[n,r,u]),ke=At((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:ne,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(F)&&(yield T(h),b(F))}),[n,r,u]),He=At((h,f)=>M(this,null,function*(){if(!P())return;let F={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Do,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(F)&&(yield T(h),b(F))}),[n,r,u]);function ue(h){var f;if(u===void 0)return!1;if(u){let F=u.find(_=>_.flowId===h.flowSlug);if(h.actionType===nt&&(!(F!=null&&F.stepStates[h.stepId])||F.stepStates[h.stepId].actionType===nt))return!1;if(F&&((f=F.stepStates[h.stepId])==null?void 0:f.actionType)===h.actionType){if(h.actionType===$e&&(!h.data||JSON.stringify(h.data)===JSON.stringify({})))return!1;let _=Object.keys(F.stepStates).sort((ge,xt)=>{let vt=new Date(F.stepStates[ge].createdAt),Bt=new Date(F.stepStates[xt].createdAt);return vt.getTime()-Bt.getTime()});if(F.stepStates[_[_.length-1]].actionType===h.actionType&&h.stepId===_[_.length-1])return!1}if(F&&F.flowState===ne&&h.actionType===ne)return!1}return!0}function me(h,f){let F=L(h,f);return O?null:F?F.actionType:nt}function V(h,f){let F=L(h,f);return F?F.blocked:!1}function z(h,f){let F=L(h,f);return F?F.hidden:!1}function L(h,f){var _;if(O)return null;let F=u==null?void 0:u.find(ge=>ge.flowId===h);return!F||!F.stepStates[f]?null:(_=F.stepStates[f])!=null?_:null}function W(h){var F,_;if(O||!u)return null;if(Xe(h)===De)return(F=q(h)[0])!=null?F:null;let f=(_=u.find(ge=>ge.flowId===h))==null?void 0:_.lastStepId;return f?q(h).find(ge=>ge.id===f):null}function ie(h){var _;let f=W(h);if(!f)return 0;let F=(_=q(h).findIndex(ge=>ge.id===f.id))!=null?_:0;return me(h,f.id)===$e&&F<q(h).length-1?F+1:F}function Ge(h){if(!h.completionCriteria)return;let f=ui(h.completionCriteria);if(f===null)return;let F=Pt(f),_=Ke(f);return _===0?void 0:F/_}function Xe(h){let f=u==null?void 0:u.find(F=>F.flowId===h);return f?f.flowState:null}function Pt(h){let f=q(h);return f.length===0?0:f.filter(_=>me(h,_.id)===$e).length}function Ke(h){return q(h).length}function ht(h){let f=o.find(F=>F.slug===h);return f?(C&&C[h]&&(f.data=C[h]),Uo(f.data)):null}function qe(h){if(S)return!1;if(O||y)return!0;if(h!=null&&h.targetingLogic&&u){let f=u.find(F=>F.flowId===h.slug);if(f)return f.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function Wt(h){return!qe(X(h))}function zt(){n&&B()}function Ht(){return o}return{getAllFlows:Ht,getFlow:X,getFlowData:ht,isLoading:O||oe,getStepStatus:me,getFlowSteps:q,getCurrentStepIndex:ie,markStepStarted:Ie,markStepCompleted:Z,markFlowNotStarted:D,markFlowStarted:ee,markFlowCompleted:ke,markFlowAborted:He,markStepNotStarted:ce,getFlowStatus:Xe,getNumberOfStepsCompleted:Pt,getNumberOfSteps:Ke,targetingLogicShouldHideFlow:qe,setCustomVariable:de,updateCustomVariables:we,customVariables:p,getStepOptionalProgress:Ge,getFlowMetadata:Y,isStepBlocked:V,isStepHidden:z,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Wt,refresh:zt}}import{useCallback as yr,useContext as Ta,useEffect as Fa}from"react";var Kt="guest_";function Co(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Ta(Q),{config:r,apiUrl:l}=Ze(),{mutateUserFlowState:p}=Ue(),d=jt(),{verifySDKInitiated:s}=Gt();function m(S){return`frigade-user-registered-${S}`}Fa(()=>{if(e&&!t){if(e.startsWith(Kt))return;let S=m(e);localStorage.getItem(S)||(d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(S,"true"))}},[e,n,t]);let c=yr(S=>M(this,null,function*(){if(!s())return;let C={foreignId:e,properties:S};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(C)})),i(x=>w(w({},x),S)),p()}),[e,r,n,p]),g=yr((S,C)=>M(this,null,function*(){if(!s())return;let P={foreignId:e,events:[{event:S,properties:C}]};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(P)})),p()}),[e,r,p]),y=yr((S,C)=>M(this,null,function*(){if(s())if(C){let x=m(S);localStorage.setItem(x,"true"),o(S);let P={foreignId:S,properties:C};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(P)})),i(b=>w(w({},b),C)),p()}else o(S)}),[r,n,p]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g}}import{v4 as Rp}from"uuid";import ot,{useEffect as xn,useState as Jp}from"react";import Ye,{useEffect as Tr,useState as Ia}from"react";import Ho from"styled-components";import ka from"react";import Pa from"styled-components";var fi="fr-",yo="cfr-";function a(e,t){let o=`${fi}${e}`;if(!t)return o;if(t.styleOverrides&&t.styleOverrides[e]){if(typeof t.styleOverrides[e]=="string")return o+" "+t.styleOverrides[e];if(typeof t.styleOverrides[e]=="object")return o+" "+yo+e}return o}function E(e){if(!e.className||e.className.indexOf(yo)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(fi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function _o(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Pe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${_o(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function So(e){return e.charAt(0).toUpperCase()+e.slice(1)}var va=Pa.div`
|
|
2
|
+
var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnPropertyDescriptors;var Do=Object.getOwnPropertySymbols;var ai=Object.prototype.hasOwnProperty,pi=Object.prototype.propertyIsEnumerable;var li=(e,t,o)=>t in e?na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,b=(e,t)=>{for(var o in t||(t={}))ai.call(t,o)&&li(e,o,t[o]);if(Do)for(var o of Do(t))pi.call(t,o)&&li(e,o,t[o]);return e},V=(e,t)=>sa(e,la(t));var di=e=>typeof e=="symbol"?e:e+"",Le=(e,t)=>{var o={};for(var i in e)ai.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Do)for(var i of Do(e))t.indexOf(i)<0&&pi.call(e,i)&&(o[i]=e[i]);return o};var D=(e,t,o)=>new Promise((i,n)=>{var r=d=>{try{a(o.next(d))}catch(l){n(l)}},s=d=>{try{a(o.throw(d))}catch(l){n(l)}},a=d=>d.done?i(d.value):Promise.resolve(d.value).then(r,s);a((o=o.apply(e,t)).next())});import Ao,{createContext as Td,useEffect as nr,useState as je}from"react";import{ThemeProvider as An}from"styled-components";import $t,{useContext as Zp,useEffect as eo,useState as Po}from"react";import{useCallback as At,useContext as Sa,useEffect as ba}from"react";import Cr,{useMemo as mi}from"react";var ci="1.37.21";var nt="NOT_STARTED_STEP",ie="COMPLETED_FLOW",Uo="SKIPPED_FLOW",Et="STARTED_FLOW",De="NOT_STARTED_FLOW",$e="COMPLETED_STEP",ho="STARTED_STEP";function Ze(){let{publicApiKey:e,userId:t,apiUrl:o}=Cr.useContext(Z);return{config:mi(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":ci,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:mi(()=>`${o}/v1/public/`,[o])}}var aa="frigade-last-call-at-",pa="frigade-last-call-data-";function Gt(){let{shouldGracefullyDegrade:e,readonly:t}=Cr.useContext(Z);return(o,i)=>D(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return jt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),jt();let n=aa+o,r=pa+o;if(typeof window!="undefined"&&window.localStorage&&i&&i.body&&i.method==="POST"){let a=window.localStorage.getItem(n),d=window.localStorage.getItem(r);if(a&&d&&d==i.body){let l=new Date(a);if(new Date().getTime()-l.getTime()<1e3)return jt()}typeof window!="undefined"&&(window.localStorage.setItem(n,new Date().toISOString()),window.localStorage.setItem(r,i.body))}let s;try{s=yield fetch(o,i)}catch(a){return jt(a)}return s?s.ok?s:jt(s.statusText):jt()})}function jt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Kt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Cr.useContext(Z);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return{verifySDKInitiated:o}}import{useContext as xa,useState as ui}from"react";import{useContext as ca,useEffect as ma,useState as ua}from"react";import fa from"swr";import{useContext as da}from"react";function Ee(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=da(Z);function r(c,g=!1){var y;return(y=e[c])!=null?y:g}function s(c,g){t(y=>V(b({},y),{[c]:g}))}function a(c){t(g=>{let x=g,{[c]:y}=x,v=Le(x,[di(c)]);return b({},v)})}function d(c){n.includes(c)||i(g=>[...g,c])}function l(c){return n.includes(c)}function m(c){return Object.entries(e).some(([g,y])=>y&&g!=c)||o}return{getOpenFlowState:r,setOpenFlowState:s,resetOpenFlowState:a,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:l}}import ga from"swr/immutable";import xo from"core-js-pure/actual/structured-clone";function yr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ce(...e){let t=e.shift(),o=e.length===1?e[0]:Ce(...e);if(!yr(t)||!yr(o))throw new Error("deepmerge can only merge Objects");let i=xo(t);return Object.entries(o).forEach(([n,r])=>{yr(r)?i[n]!==void 0?Object.assign(i,{[n]:Ce(i[n],xo(r))}):Object.assign(i,{[n]:xo(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...xo(r)]}):Object.assign(i,{[n]:xo(r)}):Object.assign(i,{[n]:r})}),i}var ha="unknown";function Ue(){let{config:e,apiUrl:t}=Ze(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:s,readonly:a}=ca(Z),{resetOpenFlowState:d}=Ee(),[l,m]=ua(!1),c={data:r.map(w=>({flowId:w.id,flowState:ie,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=w=>fetch(w,e).then(k=>{if(k.ok)return k.json();throw new Error("Failed to fetch user flow states")}).catch(k=>(console.log(`Error fetching ${w}: ${k}. Will gracefully degrade and hide Frigade`),s(!0),c)),y=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:v,isLoading:x,mutate:C,error:F}=a?ga(y,g):fa(y,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),S=v==null?void 0:v.data;ma(()=>{!l&&!x&&S&&m(!0)},[S,l,x]);function P(w){return D(this,null,function*(){if(S&&!a){let k=S.find(I=>I.flowId===w);k&&k.flowState!==ie&&(k.flowState=ie),yield C(Promise.resolve(Ce(v,{data:S})),{optimisticData:Ce(v,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function $(w,k,I){return D(this,null,function*(){if(S){let N=S.find(O=>O.flowId===w);N&&(N.stepStates[k]=I,N.flowState=Et),yield C(Promise.resolve(Ce(v,{data:S})),{optimisticData:Ce(v,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function B(w,k,I){return D(this,null,function*(){if(S){let N=S.find(O=>O.flowId===w);N&&(N.lastStepId=k,N.stepStates[k]=I,N.flowState=Et),yield C(Ce(v,{data:S}),{optimisticData:Ce(v,{data:S}),revalidate:!1,rollbackOnError:!1})}})}function u(w){return D(this,null,function*(){if(S){let k=S.find(I=>I.flowId===w);k&&k.flowState!==De&&(k.flowState=De,k.lastStepId=ha,Object.keys(k.stepStates).forEach(I=>{k.stepStates[I].actionType=nt,k.stepStates[I].createdAt=new Date().toISOString()}),yield C(Ce(v,{data:S}),{optimisticData:Ce(v,{data:S}),revalidate:!1,rollbackOnError:!1}),d(w))}})}function A(w,k,I){return D(this,null,function*(){if(S){let N=S.find(O=>O.flowId===w);N&&(N.stepStates[k]=I),yield C(Promise.resolve(Ce(v,{data:S})),{optimisticData:Ce(v,{data:S}),revalidate:!1,rollbackOnError:!1})}})}return{userFlowStatesData:S,isLoadingUserFlowStateData:!l,mutateUserFlowState:C,optimisticallyMarkFlowCompleted:P,optimisticallyMarkFlowNotStarted:u,optimisticallyMarkStepCompleted:$,optimisticallyMarkStepNotStarted:A,optimisticallyMarkStepStarted:B,error:F}}function Co(){let{config:e,apiUrl:t}=Ze(),{userFlowStatesData:o,mutateUserFlowState:i}=Ue(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:s,setFlowResponses:a}=xa(Z),[d,l]=ui(new Set),[m,c]=ui(new Set),g=Gt();function y(C){let F=JSON.stringify(C);if(d.has(F))return null;d.add(F),l(d),m.add(C),c(m);let S=s==null?void 0:s.find(P=>P.flowSlug===C.flowSlug&&P.stepId===C.stepId&&P.actionType===C.actionType&&P.createdAt===C.createdAt);return g(`${t}flowResponses`,V(b({},e),{method:"POST",body:F})).then(P=>{P.status!==200&&P.status!==201?(console.log("Failed to send flow response for step "+C.stepId+". Will retry again later."),r([...n,C])):S||a($=>[...$!=null?$:[],C])})}function v(C){return D(this,null,function*(){C.foreignUserId&&(C.actionType===Et||C.actionType===De?yield y(C):C.actionType===ie?yield y(C):C.actionType===ho?yield y(C):C.actionType===$e?yield y(C):C.actionType===Uo?yield y(C):C.actionType===nt&&(yield y(C)))})}function x(){let C=[];return o==null||o.forEach(F=>{if(F&&F.stepStates&&Object.keys(F.stepStates).length!==0)for(let S in F.stepStates){let P=F.stepStates[S];C.push({foreignUserId:F.foreignUserId,flowSlug:F.flowId,stepId:P.stepId,actionType:P.actionType,data:{},createdAt:new Date(P.createdAt),blocked:P.blocked,hidden:P.hidden})}}),[...C,...s]}return{addResponse:v,setFlowResponses:a,getFlowResponses:x}}import wa from"swr";var Ca=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,fi=e=>{let t=Ca.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=ya(i,"'","");r.startsWith("flow_")&&(o=r)}),o},ya=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};function _o(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var 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 te(){let{config:e,apiUrl:t}=Ze(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:s,customVariables:a,setCustomVariables:d,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:y,readonly:v,flowDataOverrides:x}=Sa(Z),C={data:[]},{verifySDKInitiated:F}=Kt(),{addResponse:S,getFlowResponses:P}=Co(),$=h=>fetch(h,e).then(f=>f.ok?f.json():(console.log(`Error fetching ${h} (${f.status}): ${f.statusText}. Will gracefully degrade and hide Frigade`),g(!0),C)).catch(f=>(console.log(`Error fetching ${h}: ${f}. Will gracefully degrade and hide Frigade`),g(!0),C)),{mutateUserFlowState:B,userFlowStatesData:u,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:w,optimisticallyMarkFlowNotStarted:k,optimisticallyMarkStepCompleted:I,optimisticallyMarkStepNotStarted:N,optimisticallyMarkStepStarted:O}=Ue(),{data:H,error:_,isLoading:R}=wa(s?`${t}flows${v?"?readonly=true":""}`:null,$,{keepPreviousData:!0});ba(()=>{if(_){console.error(_);return}H&&H.data&&i(H.data)},[H,_]);function J(h){if(R)return null;let f=o.find(T=>T.slug===h);return!f&&o.length>0&&!A&&!R?(console.log(`Flow with id ${h} not found`),null):(f&&x&&x[h]&&(f.data=x[h]),(f==null?void 0:f.active)===!1&&!v?null:f)}function ee(h){var U,ge,xt,vt,Bt;if(!J(h))return[];let f=(U=J(h))==null?void 0:U.data;return f?(f=K(f),((Bt=(vt=(ge=_o(f))==null?void 0:ge.data)!=null?vt:(xt=_o(f))==null?void 0:xt.steps)!=null?Bt:[]).map(he=>{let fo=Ge(he);return V(b({handleSecondaryButtonClick:()=>{he.skippable===!0&&pe(h,he.id,{skipped:!0})}},he),{complete:me(h,he.id)===$e||fo>=1,started:me(h,he.id)===ho||me(h,he.id)===$e,currentlyActive:u==null?void 0:u.some(go=>go.flowId==h&&go.lastStepId===he.id),blocked:j(h,he.id),hidden:z(h,he.id),handlePrimaryButtonClick:()=>{(!he.completionCriteria&&(he.autoMarkCompleted||he.autoMarkCompleted===void 0)||he.completionCriteria&&he.autoMarkCompleted===!0)&&pe(h,he.id)},progress:fo})}).filter(he=>he.hidden!==!0)):[]}function K(h){return h.replaceAll(/\${(.*?)}/g,(f,T)=>a[T]===void 0?"":String(a[T]).replace(/[\u00A0-\u9999<>\&]/g,function(U){return"&#"+U.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function Y(h){var T;if(!J(h))return[];let f=J(h).data;return f?(f=K(f),(T=JSON.parse(f))!=null?T:{}):[]}function de(h,f){d(T=>V(b({},T),{[h]:f}))}function we(h){!A&&!R&&h&&JSON.stringify(a)!=JSON.stringify(b(b({},a),h))&&Object.keys(h).forEach(f=>{de(f,h[f])})}let Ie=At((h,f,T)=>D(this,null,function*(){if(!F())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:ho,data:T!=null?T:{},createdAt:new Date,blocked:!1,hidden:!1};ue(U)&&(yield O(h,f,U),S(U))}),[n,r,u]),ce=At((h,f,T)=>D(this,null,function*(){if(!F())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:nt,data:T!=null?T:{},createdAt:new Date,blocked:!1,hidden:!1};ue(U)&&(yield N(h,f,U),S(U))}),[n,r,u]),pe=At((h,f,T)=>D(this,null,function*(){if(!F())return;let U={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:f,actionType:$e,data:T!=null?T:{},createdAt:new Date,blocked:!1,hidden:!1};ue(U)&&(yield I(h,f,U),S(U))}),[n,r,u]),M=At((h,f)=>D(this,null,function*(){if(!F()||Xe(h)===De)return;let T={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:De,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};yield k(h),ue(T)&&S(T)}),[n,r,u]),X=At((h,f)=>D(this,null,function*(){if(!F())return;let T={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Et,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(T)&&S(T)}),[n,r,u]),ke=At((h,f)=>D(this,null,function*(){if(!F())return;let T={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:ie,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(T)&&(yield w(h),S(T))}),[n,r,u]),He=At((h,f)=>D(this,null,function*(){if(!F())return;let T={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:h,stepId:"unknown",actionType:Uo,data:f!=null?f:{},createdAt:new Date,blocked:!1,hidden:!1};ue(T)&&(yield w(h),S(T))}),[n,r,u]);function ue(h){var f;if(u===void 0)return!1;if(u){let T=u.find(U=>U.flowId===h.flowSlug);if(h.actionType===nt&&(!(T!=null&&T.stepStates[h.stepId])||T.stepStates[h.stepId].actionType===nt))return!1;if(T&&((f=T.stepStates[h.stepId])==null?void 0:f.actionType)===h.actionType){if(h.actionType===$e&&(!h.data||JSON.stringify(h.data)===JSON.stringify({})))return!1;let U=Object.keys(T.stepStates).sort((ge,xt)=>{let vt=new Date(T.stepStates[ge].createdAt),Bt=new Date(T.stepStates[xt].createdAt);return vt.getTime()-Bt.getTime()});if(T.stepStates[U[U.length-1]].actionType===h.actionType&&h.stepId===U[U.length-1])return!1}if(T&&T.flowState===ie&&h.actionType===ie)return!1}return!0}function me(h,f){let T=L(h,f);return A?null:T?T.actionType:nt}function j(h,f){let T=L(h,f);return T?T.blocked:!1}function z(h,f){let T=L(h,f);return T?T.hidden:!1}function L(h,f){var U;if(A)return null;let T=u==null?void 0:u.find(ge=>ge.flowId===h);return!T||!T.stepStates[f]?null:(U=T.stepStates[f])!=null?U:null}function W(h){var T,U;if(A||!u)return null;if(Xe(h)===De)return(T=ee(h)[0])!=null?T:null;let f=(U=u.find(ge=>ge.flowId===h))==null?void 0:U.lastStepId;return f?ee(h).find(ge=>ge.id===f):null}function re(h){var U;let f=W(h);if(!f)return 0;let T=(U=ee(h).findIndex(ge=>ge.id===f.id))!=null?U:0;return me(h,f.id)===$e&&T<ee(h).length-1?T+1:T}function Ge(h){if(!h.completionCriteria)return;let f=fi(h.completionCriteria);if(f===null)return;let T=Pt(f),U=Ke(f);return U===0?void 0:T/U}function Xe(h){let f=u==null?void 0:u.find(T=>T.flowId===h);return f?f.flowState:null}function Pt(h){let f=ee(h);return f.length===0?0:f.filter(U=>me(h,U.id)===$e).length}function Ke(h){return ee(h).length}function ht(h){let f=o.find(T=>T.slug===h);return f?(x&&x[h]&&(f.data=x[h]),_o(f.data)):null}function qe(h){if(v)return!1;if(A||y)return!0;if(h!=null&&h.targetingLogic&&u){let f=u.find(T=>T.flowId===h.slug);if(f)return f.shouldTrigger===!1}return!!(h!=null&&h.targetingLogic&&n&&n.startsWith("guest_"))}function zt(h){return!qe(J(h))}function Ht(){n&&B()}function Vt(){return o}return{getAllFlows:Vt,getFlow:J,getFlowData:ht,isLoading:A||R,getStepStatus:me,getFlowSteps:ee,getCurrentStepIndex:re,markStepStarted:Ie,markStepCompleted:pe,markFlowNotStarted:M,markFlowStarted:X,markFlowCompleted:ke,markFlowAborted:He,markStepNotStarted:ce,getFlowStatus:Xe,getNumberOfStepsCompleted:Pt,getNumberOfSteps:Ke,targetingLogicShouldHideFlow:qe,setCustomVariable:de,updateCustomVariables:we,customVariables:a,getStepOptionalProgress:Ge,getFlowMetadata:Y,isStepBlocked:j,isStepHidden:z,hasActiveFullPageFlow:l,setHasActiveFullPageFlow:m,isFlowAvailableToUser:zt,refresh:Ht}}import{useCallback as Wo,useContext as Ta,useEffect as Fa}from"react";var qt="guest_";function yo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=Ta(Z),{config:r,apiUrl:s}=Ze(),{mutateUserFlowState:a}=Ue(),d=Gt(),{verifySDKInitiated:l}=Kt();function m(x){return`frigade-user-registered-${x}`}Fa(()=>{if(e&&!t){if(e.startsWith(qt))return;let x=m(e);localStorage.getItem(x)||(d(`${s}users`,V(b({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(x,"true"))}},[e,n,t]);let c=Wo(x=>D(this,null,function*(){if(!l())return;let C={foreignId:e,properties:x};yield d(`${s}users`,V(b({},r),{method:"POST",body:JSON.stringify(C)})),i(F=>b(b({},F),x)),a()}),[e,r,n,a]),g=Wo((x,C)=>D(this,null,function*(){if(!l())return;let S={foreignId:e,events:[{event:x,properties:C}]};yield d(`${s}users`,V(b({},r),{method:"POST",body:JSON.stringify(S)})),a()}),[e,r,a]),y=Wo((x,C)=>D(this,null,function*(){if(l())if(C&&Object.keys(C).length>0){let F=m(x);localStorage.setItem(F,"true"),o(x);let S={foreignId:x,properties:C};yield d(`${s}users`,V(b({},r),{method:"POST",body:JSON.stringify(S)})),i(P=>b(b({},P),C)),a()}else o(x)}),[r,n,a]),v=Wo(x=>D(this,null,function*(){if(!l())return;let C=typeof window!="undefined"?localStorage.getItem(Nt):null;if(console.log("id",localStorage.getItem(Nt)),!C)return;let F={foreignId:x,linkGuestId:C};yield d(`${s}users`,V(b({},r),{method:"POST",body:JSON.stringify(F)})),a()}),[r,n,a]);return{userId:e,setUserId:o,setUserIdWithProperties:y,addPropertiesToUser:c,trackEventForUser:g,linkExistingGuestSessionToUser:v}}import{v4 as Rp}from"uuid";import ot,{useEffect as Cn,useState as Jp}from"react";import Ye,{useEffect as Fr,useState as Ia}from"react";import jo from"styled-components";import ka from"react";import Pa from"styled-components";var gi="fr-",So="cfr-";function p(e,t){let o=`${gi}${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+" "+So+e}return o}function E(e){if(!e.className||e.className.indexOf(So)!==-1)return"";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(gi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function zo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Pe(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${zo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function bo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var va=Pa.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
justify-content: center;
|
|
5
5
|
position: fixed;
|
|
@@ -23,11 +23,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
23
23
|
opacity: 1;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,hi=({onClose:e,appearance:t})=>ka.createElement(va,{className:p("modalBackground",t),onClick:()=>e()});import br from"react";import Ba from"styled-components";var Ea=Ba.div`
|
|
27
27
|
:hover {
|
|
28
28
|
opacity: 0.8;
|
|
29
29
|
}
|
|
30
|
-
`,Ae=()=>
|
|
30
|
+
`,Ae=()=>br.createElement(Ea,null,br.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},br.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));import{Portal as La}from"react-portal";import Ei from"react";import wr from"react";function Aa({style:e,className:t}){return wr.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},wr.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"}),wr.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 xi=Aa;import Tr from"styled-components";import st from"styled-components";var Ho=st.div`
|
|
31
31
|
${e=>E(e)} {
|
|
32
32
|
background: ${e=>e.appearance.theme.colorBackground};
|
|
33
33
|
}
|
|
@@ -38,7 +38,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
38
38
|
min-width: 300px;
|
|
39
39
|
z-index: ${e=>e.zIndex};
|
|
40
40
|
overflow: hidden;
|
|
41
|
-
`,
|
|
41
|
+
`,Na=`
|
|
42
42
|
display: block;
|
|
43
43
|
cursor: pointer;
|
|
44
44
|
position: absolute;
|
|
@@ -46,12 +46,13 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
46
46
|
color: #ffffff;
|
|
47
47
|
padding: 4px;
|
|
48
48
|
border-radius: 100px;
|
|
49
|
+
border-width: 0px;
|
|
49
50
|
top: 12px;
|
|
50
51
|
right: 12px;
|
|
51
52
|
box-sizing: border-box;
|
|
52
53
|
:hover {
|
|
53
54
|
opacity: 0.8;
|
|
54
|
-
}`,
|
|
55
|
+
}`,Oa=`
|
|
55
56
|
display: block;
|
|
56
57
|
cursor: pointer;
|
|
57
58
|
position: absolute;
|
|
@@ -59,11 +60,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
59
60
|
right: 12px;
|
|
60
61
|
background-color: transparent;
|
|
61
62
|
border: none;
|
|
62
|
-
`,
|
|
63
|
+
`,Ci=st.button`
|
|
63
64
|
${e=>E(e)} {
|
|
64
|
-
${e=>e.hasImage?Oa
|
|
65
|
+
${e=>e.hasImage?Na:Oa};
|
|
65
66
|
}
|
|
66
|
-
`,
|
|
67
|
+
`,yi=st.img`
|
|
67
68
|
${e=>E(e)} {
|
|
68
69
|
display: block;
|
|
69
70
|
width: 100%;
|
|
@@ -71,7 +72,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
71
72
|
min-height: 200px;
|
|
72
73
|
object-fit: cover;
|
|
73
74
|
}
|
|
74
|
-
`,
|
|
75
|
+
`,Si=st.div`
|
|
75
76
|
${e=>E(e)} {
|
|
76
77
|
display: block;
|
|
77
78
|
width: 100%;
|
|
@@ -79,19 +80,19 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
79
80
|
margin-top: ${e=>e.dismissible?"24px":"0px"};
|
|
80
81
|
object-fit: cover;
|
|
81
82
|
}
|
|
82
|
-
`,
|
|
83
|
+
`,bi=st.div`
|
|
83
84
|
display: flex;
|
|
84
85
|
flex-direction: row;
|
|
85
86
|
justify-content: space-between;
|
|
86
87
|
align-content: center;
|
|
87
|
-
`,bi=st.div`
|
|
88
|
-
padding: 22px 22px 12px;
|
|
89
88
|
`,wi=st.div`
|
|
89
|
+
padding: 22px 22px 12px;
|
|
90
|
+
`,Ti=st.div`
|
|
90
91
|
display: flex;
|
|
91
92
|
flex: 1;
|
|
92
93
|
flex-direction: column;
|
|
93
94
|
justify-content: center;
|
|
94
|
-
`,
|
|
95
|
+
`,Fi=st.div`
|
|
95
96
|
display: flex;
|
|
96
97
|
flex: 2;
|
|
97
98
|
flex-shrink: 1;
|
|
@@ -103,7 +104,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
103
104
|
align-content: center;
|
|
104
105
|
align-items: center;
|
|
105
106
|
}
|
|
106
|
-
`,
|
|
107
|
+
`,ki=st.p`
|
|
107
108
|
${e=>E(e)} {
|
|
108
109
|
font-style: normal;
|
|
109
110
|
font-weight: 600;
|
|
@@ -112,7 +113,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
112
113
|
color: #808080;
|
|
113
114
|
}
|
|
114
115
|
margin: 0;
|
|
115
|
-
`;var
|
|
116
|
+
`;var Pi=Tr.div`
|
|
116
117
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
117
118
|
position: absolute;
|
|
118
119
|
bottom: -47px;
|
|
@@ -123,7 +124,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
123
124
|
align-items: center;
|
|
124
125
|
justify-content: center;
|
|
125
126
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
126
|
-
`,
|
|
127
|
+
`,vi=Tr(Ho)`
|
|
127
128
|
background-color: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.colorBackground}};
|
|
128
129
|
position: absolute;
|
|
129
130
|
bottom: -60px;
|
|
@@ -136,7 +137,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
136
137
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
137
138
|
padding: 0;
|
|
138
139
|
z-index: ${e=>e.zIndex};
|
|
139
|
-
`,
|
|
140
|
+
`,Bi=Tr.div`
|
|
140
141
|
display: flex;
|
|
141
142
|
justify-content: center;
|
|
142
143
|
align-items: center;
|
|
@@ -145,7 +146,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
145
146
|
font-size: 12px;
|
|
146
147
|
line-height: 18px;
|
|
147
148
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
148
|
-
`;function
|
|
149
|
+
`;function Vo({appearance:e}){return Ei.createElement(Bi,{className:p("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Ei.createElement(xi,null))}var $a=jo.div`
|
|
149
150
|
${e=>E(e)} {
|
|
150
151
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
151
152
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -187,10 +188,10 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
187
188
|
opacity: 1;
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
|
-
`,Ma=
|
|
191
|
+
`,Ma=jo.div`
|
|
191
192
|
position: relative;
|
|
192
193
|
flex: 0 1 auto;
|
|
193
|
-
`,Da=
|
|
194
|
+
`,Da=jo.div`
|
|
194
195
|
position: absolute;
|
|
195
196
|
top: 16px;
|
|
196
197
|
right: 16px;
|
|
@@ -200,14 +201,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
200
201
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
201
202
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
202
203
|
}
|
|
203
|
-
`,Ua=
|
|
204
|
+
`,Ua=jo.div`
|
|
204
205
|
overflow: scroll;
|
|
205
206
|
flex: 1 1;
|
|
206
207
|
display: flex;
|
|
207
208
|
::-webkit-scrollbar {
|
|
208
209
|
display: none;
|
|
209
210
|
}
|
|
210
|
-
`,Re=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:
|
|
211
|
+
`,Re=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:s=!0,showFrigadeBranding:a=!1})=>{let[d,l]=Ia("");return Fr(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");l(m)},[]),Fr(()=>{let m=c=>{c.key==="Escape"&&e()};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m)}},[e]),Fr(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d)}},[t]),t?Ye.createElement(La,null,Ye.createElement(hi,{appearance:r,onClose:()=>{s&&e()}}),Ye.createElement($a,{appearance:r,className:p("modalContainer",r),styleOverrides:i},s&&Ye.createElement(Da,{className:p("modalClose",r),onClick:()=>e(),appearance:r},Ye.createElement(Ae,null)),o&&Ye.createElement(Ma,null,o),Ye.createElement(Ua,null,n),a&&Ye.createElement(Pi,{appearance:r,className:p("poweredByFrigadeRibbon",r)},Ye.createElement(Vo,{appearance:r})))):Ye.createElement(Ye.Fragment,null)};import Ct,{useEffect as kr,useState as _a}from"react";import Go from"styled-components";import{Portal as Wa}from"react-portal";function za(e){switch(e){case"top-left":return`
|
|
211
212
|
top: 0;
|
|
212
213
|
left: 0;
|
|
213
214
|
`;case"top-right":return`
|
|
@@ -216,7 +217,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
216
217
|
`;case"bottom-left":return`
|
|
217
218
|
bottom: 0;
|
|
218
219
|
left: 0;
|
|
219
|
-
`}return"right: 0; bottom: 0;"}var Ha=
|
|
220
|
+
`}return"right: 0; bottom: 0;"}var Ha=Go.div`
|
|
220
221
|
${e=>E(e)} {
|
|
221
222
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
222
223
|
background: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
@@ -232,10 +233,10 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
232
233
|
}
|
|
233
234
|
${e=>za(e.modalPosition)}
|
|
234
235
|
margin: 28px;
|
|
235
|
-
`,Va=
|
|
236
|
+
`,Va=Go.div`
|
|
236
237
|
position: relative;
|
|
237
238
|
flex: 1;
|
|
238
|
-
`,ja=
|
|
239
|
+
`,ja=Go.div`
|
|
239
240
|
position: absolute;
|
|
240
241
|
top: 16px;
|
|
241
242
|
right: 16px;
|
|
@@ -245,13 +246,13 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
245
246
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
246
247
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
247
248
|
}
|
|
248
|
-
`,Ga=
|
|
249
|
+
`,Ga=Go.div`
|
|
249
250
|
overflow: scroll;
|
|
250
251
|
flex: 5;
|
|
251
252
|
::-webkit-scrollbar {
|
|
252
253
|
display: none;
|
|
253
254
|
}
|
|
254
|
-
`,
|
|
255
|
+
`,Ko=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:s=!0})=>{let[a,d]=_a("");return kr(()=>{let l=getComputedStyle(document.body).getPropertyValue("overflow");d(l)},[]),kr(()=>{let l=m=>{m.key==="Escape"&&e()};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l)}},[e]),kr(()=>{let l=document.body.style;return t?l.setProperty("overflow","hidden"):l.setProperty("overflow",a),()=>{l.setProperty("overflow",a)}},[t]),t?Ct.createElement(Wa,null,Ct.createElement(Ha,{appearance:n,className:p("cornerModalContainer",n),modalPosition:r},s&&Ct.createElement(ja,{className:p("cornerModalClose",n),onClick:()=>e()},Ct.createElement(Ae,null)),o&&Ct.createElement(Va,null,o),Ct.createElement(Ga,null,i))):Ct.createElement(Ct.Fragment,null)};import{useContext as Ka}from"react";function ne(){let{defaultAppearance:e}=Ka(Z);function t(o){var n,r,s;let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((n=i.styleOverrides)!=null?n:{},(r=o.styleOverrides)!=null?r:{}),theme:Object.assign(i.theme,(s=o.theme)!=null?s:{})}:i}return{mergeAppearanceWithDefault:t}}import Ot,{useContext as fp,useEffect as Ki,useState as $r}from"react";import Qo from"styled-components";import Jo,{useEffect as $i,useState as Br}from"react";import Er from"styled-components";import qo from"styled-components";var Ai=qo.label`
|
|
255
256
|
${e=>E(e)} {
|
|
256
257
|
font-size: 12px;
|
|
257
258
|
line-height: 18px;
|
|
@@ -262,14 +263,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
262
263
|
letter-spacing: 0.24px;
|
|
263
264
|
}
|
|
264
265
|
display: flex;
|
|
265
|
-
`,
|
|
266
|
+
`,Ni=qo.label`
|
|
266
267
|
${e=>E(e)} {
|
|
267
268
|
font-size: 12px;
|
|
268
269
|
line-height: 20px;
|
|
269
270
|
margin-bottom: 5px;
|
|
270
271
|
}
|
|
271
272
|
display: flex;
|
|
272
|
-
`,Oi=
|
|
273
|
+
`,Oi=qo.span`
|
|
273
274
|
font-weight: 400;
|
|
274
275
|
font-size: 14px;
|
|
275
276
|
line-height: 22px;
|
|
@@ -277,16 +278,16 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
277
278
|
display: flex;
|
|
278
279
|
margin-right: 5px;
|
|
279
280
|
margin-top: 10px;
|
|
280
|
-
`,
|
|
281
|
+
`,Yo=qo.div`
|
|
281
282
|
display: flex;
|
|
282
283
|
align-items: flex-start;
|
|
283
284
|
justify-content: left;
|
|
284
285
|
margin-bottom: 10px;
|
|
285
|
-
`;import
|
|
286
|
+
`;import Pr from"react";var lt={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function yt({title:e,required:t,appearance:o=lt}){return e?Pr.createElement(Yo,{className:p("formLabelWrapper",o)},t?Pr.createElement(Oi,{className:p("formLabelRequired",o),appearance:o},"*"):null,Pr.createElement(Ai,{className:p("formLabel",o)},e)):null}import Ii from"react";function Yt({title:e,appearance:t}){return e?Ii.createElement(Yo,null,Ii.createElement(Ni,{className:p("formSubLabel",t)},e)):null}import{z as vr}from"zod";function Li(e,t){var o,i,n,r,s,a,d;try{if(t){if(t.type=="number"){let l=vr.number();if(t.props)for(let m of t.props)m.requirement=="min"?l=l.min(Number(m.value),(o=m.message)!=null?o:"Value is too small"):m.requirement=="max"?l=l.max(Number(m.value),(i=m.message)!=null?i:"Value is too large"):m.requirement=="positive"?l=l.positive((n=m.message)!=null?n:"Value must be positive"):m.requirement=="negative"&&(l=l.nonpositive((r=m.message)!=null?r:"Value must be negative"));l.parse(Number(e))}if(t.type=="string"){let l=vr.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),(a=m.message)!=null?a:"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 vr.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 qa=Er.div`
|
|
286
287
|
display: flex;
|
|
287
288
|
flex-direction: column;
|
|
288
289
|
width: 100%;
|
|
289
|
-
`,Er
|
|
290
|
+
`,Ar=Er.input`
|
|
290
291
|
${e=>E(e)} {
|
|
291
292
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
292
293
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -302,7 +303,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
302
303
|
box-sizing: border-box;
|
|
303
304
|
padding: 0 10px;
|
|
304
305
|
margin-bottom: 10px;
|
|
305
|
-
`,Ya=
|
|
306
|
+
`,Ya=Er.textarea`
|
|
306
307
|
${e=>E(e)} {
|
|
307
308
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
308
309
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -319,13 +320,13 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
319
320
|
box-sizing: border-box;
|
|
320
321
|
margin-bottom: 10px;
|
|
321
322
|
resize: none;
|
|
322
|
-
`;function
|
|
323
|
+
`;function Nr({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[s,a]=Br((n==null?void 0:n.text)||""),[d,l]=Br(!1),[m,c]=Br(!1),g=Ar;$i(()=>{s===""&&!d&&(l(!0),y(""))},[]),$i(()=>{if(m){y(s);return}},[m]);function y(x){var F;if(a(x),o({text:x}),r.required===!0&&x.trim()===""){i([{id:r.id,message:`${(F=r.title)!=null?F:"Field"} is required`,hidden:!m}]);return}let C=Li(x,r.validation);if(C&&(x.trim()!==""||r.required===!0)){i([{id:r.id,message:C,hidden:!m}]);return}i([])}r.multiline&&(g=Ya);function v(){var x;switch((x=r==null?void 0:r.validation)==null?void 0:x.type){case"email":return"email";case"number":return"number";case"password":return"password"}return null}return Jo.createElement(qa,null,Jo.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),Jo.createElement(g,{className:p("inputComponent",t.appearance),value:s,onChange:x=>{y(x.target.value)},appearance:t.appearance,placeholder:r.placeholder,type:v(),onBlur:()=>{c(!0)}}),Jo.createElement(Yt,{title:r.subtitle,appearance:t.appearance}))}import et,{useEffect as Mi,useState as Di}from"react";import Ui from"styled-components";var Or="",Ja=Ui.div`
|
|
323
324
|
display: flex;
|
|
324
325
|
flex-direction: column;
|
|
325
326
|
width: 100%;
|
|
326
327
|
-webkit-appearance: none;
|
|
327
328
|
appearance: none;
|
|
328
|
-
`,Xa=
|
|
329
|
+
`,Xa=Ui.select`
|
|
329
330
|
${e=>E(e)} {
|
|
330
331
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
331
332
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -346,15 +347,15 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
346
347
|
background-repeat: no-repeat;
|
|
347
348
|
background-size: 1.5em 1.5em;
|
|
348
349
|
-webkit-print-color-adjust: exact;
|
|
349
|
-
`;function
|
|
350
|
+
`;function _i({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m,c,g,y,v,x,C,F,S;let r=e,[s,a]=Di(!1),[d,l]=Di(!1);return Mi(()=>{var P,$,B,u;if(!((P=i==null?void 0:i.choice)!=null&&P[0])&&!s){if(a(!0),r.requireSelection){o({choice:[Or]});return}if(r.defaultValue&&(($=r.props.options)!=null&&$.find(A=>A.id===r.defaultValue))){let A=(B=r.props.options)==null?void 0:B.find(w=>w.id===r.defaultValue);o({choice:[A.id]})}else o({choice:[((u=r.props.options)==null?void 0:u[0].id)||""]})}},[]),Mi(()=>{var P;d&&(r.requireSelection&&((P=i==null?void 0:i.choice)==null?void 0:P[0])===Or?n([{message:"Please select an option",id:r.id}]):n([]))},[(m=i==null?void 0:i.choice)==null?void 0:m[0],d]),et.createElement(Ja,null,et.createElement(yt,{title:r.title,required:!1,appearance:t.appearance}),et.createElement(Xa,{value:(c=i==null?void 0:i.choice)==null?void 0:c[0],onChange:P=>{l(!0),o({choice:[P.target.value]})},placeholder:r.placeholder,appearance:t.appearance,className:p("multipleChoiceSelect",t.appearance)},r.requireSelection&&et.createElement("option",{key:"null-value",value:Or,disabled:!0},(g=r.placeholder)!=null?g:"Select an option"),(y=r.props.options)==null?void 0:y.map(P=>et.createElement("option",{key:P.id,value:P.id},P.title))),((x=(v=r.props.options)==null?void 0:v.find(P=>{var $;return P.id===(($=i==null?void 0:i.choice)==null?void 0:$[0])}))==null?void 0:x.isOpenEnded)&&et.createElement(et.Fragment,null,et.createElement(yt,{title:(S=(F=(C=r.props.options)==null?void 0:C.find(P=>{var $;return P.id===(($=i==null?void 0:i.choice)==null?void 0:$[0])}))==null?void 0:F.openEndedLabel)!=null?S:"Please specify",required:!1,appearance:t.appearance}),et.createElement(Ar,{type:"text",placeholder:"Enter your answer here",onChange:P=>{o({choice:[P.target.value]})},appearance:t.appearance})),et.createElement(Yt,{title:r.subtitle,appearance:t.appearance}))}import Fo,{useEffect as Ir,useState as zi}from"react";import Hi from"styled-components";import To from"react";import wo from"react";var Wi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return wo.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},Qa=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:s})=>wo.createElement("svg",{style:s,className:r,width:t,height:t,overflow:"visible"},wo.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},wo.createElement(Wi,{color:n,size:t}),wo.createElement(Wi,{color:e,percentage:Math.max(o,.1),size:t})),i),Jt=Qa;import Za from"styled-components";var Ra=({color:e="#FFFFFF"})=>To.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},To.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),ep={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},tp={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},op={border:"1px solid #000000",color:"#FFFFFF"},rp={border:"1px solid #C5CBD3"},ip={color:"#FFFFFF"},np={border:"1px solid #C5CBD3"},sp=e=>e==="square"?ep:tp,lp=(e,t)=>e==="square"?t?op:rp:t?ip:np,ap=Za.div`
|
|
350
351
|
${e=>Pe(e)}
|
|
351
|
-
`,at=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=lt,style:r,className:
|
|
352
|
+
`,at=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=lt,style:r,className:s})=>{let a=sp(t),d=lp(t,e);return e===!0?a=V(b(b({},a),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):a=b(b({},a),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?To.createElement(Jt,{fillColor:o,percentage:i,size:22}):To.createElement(ap,{styleOverrides:a,style:r,role:"checkbox",className:Te(p("checkIconContainer",n),p(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",s)},e&&To.createElement(Ra,{color:"#FFFFFF"}))};var pp=Hi.div`
|
|
352
353
|
display: flex;
|
|
353
354
|
flex-direction: column;
|
|
354
355
|
width: 100%;
|
|
355
356
|
-webkit-appearance: none;
|
|
356
357
|
appearance: none;
|
|
357
|
-
`,dp=
|
|
358
|
+
`,dp=Hi.button`
|
|
358
359
|
${e=>E(e)} {
|
|
359
360
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
360
361
|
border: 1px solid ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -379,7 +380,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
379
380
|
height: 48px;
|
|
380
381
|
padding: 0 18px;
|
|
381
382
|
margin-bottom: 10px;
|
|
382
|
-
`;function
|
|
383
|
+
`;function Vi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[s,a]=zi((i==null?void 0:i.choice)||[]),[d,l]=zi(!1);return Ir(()=>{s.length==0&&!d&&(l(!0),o({choice:[]}))},[]),Ir(()=>{o({choice:s})},[s]),Ir(()=>{r.required&&(s.length<r.props.minChoices||s.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([])},[s]),Fo.createElement(pp,null,Fo.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>Fo.createElement(dp,{appearance:t.appearance,className:p(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)){a(s.filter(g=>g!==c.id));return}s.length<r.props.maxChoices?a([...s,c.id]):s.length==1&&r.props.maxChoices==1&&a([c.id])}},c.title,Fo.createElement(at,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:s.includes(c.id),appearance:t.appearance}))),Fo.createElement(Yt,{title:r.subtitle,appearance:t.appearance}))}import Xo from"react";import ji from"styled-components";import cp from"dompurify";function se(e){return{__html:cp.sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4"],ALLOWED_ATTR:["style","class","target","id","href","alt","src"]})}}var mp=ji.h1`
|
|
383
384
|
${e=>E(e)} {
|
|
384
385
|
font-style: normal;
|
|
385
386
|
font-weight: 700;
|
|
@@ -391,7 +392,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
391
392
|
margin-bottom: 4px;
|
|
392
393
|
color: ${e=>e.appearance.theme.colorText};
|
|
393
394
|
}
|
|
394
|
-
`,up=
|
|
395
|
+
`,up=ji.h2`
|
|
395
396
|
${e=>E(e)} {
|
|
396
397
|
font-style: normal;
|
|
397
398
|
font-weight: 400;
|
|
@@ -400,38 +401,38 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
400
401
|
letter-spacing: 0.28px;
|
|
401
402
|
color: ${e=>e.appearance.theme.colorTextSecondary};
|
|
402
403
|
}
|
|
403
|
-
`;function
|
|
404
|
+
`;function Ne({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n="",ariaPrefix:r=""}){return Xo.createElement(Xo.Fragment,null,Xo.createElement(mp,{appearance:e,id:r?`frigade${r}Title`:"frigadeTitle",className:p(`${n}${n?bo(i):i}Title`,e),dangerouslySetInnerHTML:se(t),size:i}),o&&Xo.createElement(up,{id:r?`frigade${r}Subtitle`:"frigadeSubtitle",appearance:e,className:p(`${n}${n?bo(i):i}Subtitle`,e),dangerouslySetInnerHTML:se(o),size:i}))}import*as Lr from"react";var Gi=e=>Lr.createElement("svg",b({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Lr.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.115 1.308 5.635 11.269A2.365 2.365 0 0 1 13.634 16H2.365A2.365 2.365 0 0 1 .25 12.577L5.884 1.308a2.365 2.365 0 0 1 4.231 0zM8 10.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zM8 9c.552 0 1-.32 1-.714V4.714C9 4.32 8.552 4 8 4s-1 .32-1 .714v3.572C7 8.68 7.448 9 8 9z"}));var gp=Qo.div`
|
|
404
405
|
display: flex;
|
|
405
406
|
flex-direction: column;
|
|
406
407
|
justify-content: flex-end;
|
|
407
408
|
overflow: visible;
|
|
408
409
|
padding-top: 14px;
|
|
409
|
-
`,hp=
|
|
410
|
+
`,hp=Qo.div`
|
|
410
411
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
|
|
411
412
|
font-size: 12px;
|
|
412
413
|
margin-bottom: 12px;
|
|
413
414
|
display: flex;
|
|
414
415
|
align-items: center;
|
|
415
|
-
`,xp=
|
|
416
|
+
`,xp=Qo.div`
|
|
416
417
|
margin-right: 4px;
|
|
417
418
|
display: inline-flex;
|
|
418
|
-
`,Cp=
|
|
419
|
+
`,Cp=Qo.div`
|
|
419
420
|
padding-left: 1px;
|
|
420
421
|
padding-right: 1px;
|
|
421
|
-
`,yp={text:
|
|
422
|
+
`,yp={text:Nr,multipleChoice:_i,multipleChoiceList:Vi},Mr="frigade-multiInputStepTypeData";function qi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:s,prefillData:a}){var B;let d=t.props,[l,m]=$r([]),[c,g]=$r([]),{userId:y}=yo(),[v,x]=$r(P()||(a?a[t.id]:null)||{}),{readonly:C}=fp(Z),F=b(b({},yp),s);Ki(()=>{i(l.length===0)},[l,i]),Ki(()=>{n(v)},[v]);function S(u,A){x(w=>{let k=V(b({},w),{[u.id]:A});return typeof window!="undefined"&&window.localStorage&&!C&&window.localStorage.setItem($(),JSON.stringify(k)),k})}function P(){if(typeof window!="undefined"&&window.localStorage){let u=window.localStorage.getItem($());if(u)return JSON.parse(u)}return null}function $(){return`${Mr}-${e}-${t.id}-${y}`}return Ot.createElement(Cp,{className:p("multiInput",r)},Ot.createElement(Ne,{appearance:r,title:t.title,subtitle:t.subtitle}),Ot.createElement(gp,{className:p("multiInputContainer",r)},(B=d==null?void 0:d.data)==null?void 0:B.map(u=>{let A=l.reverse().find(w=>w.id===u.id);return F[u.type]?Ot.createElement("span",{key:u.id,"data-field-id":u.id,className:p("multiInputField",r)},F[u.type]({formInput:u,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:w=>{!c.includes(u.id)&&w&&(w==null?void 0:w.text)!==""&&g(k=>[...k,u.id]),S(u,w)},inputData:v[u.id],setFormValidationErrors:w=>{w.length===0&&l.length===0||m(k=>w.length===0?k.filter(I=>I.id!==u.id):[...k,...w])}}),A&&A.message&&c.includes(u.id)&&A.hidden!==!0&&Ot.createElement(hp,{key:u.id,style:{overflow:"hidden"},appearance:r,className:p("multiInputValidationError",r)},Ot.createElement(xp,{appearance:r,className:p("multiInputValidationErrorIcon",r)},Ot.createElement(Gi,null)),A.message)):null})))}import Xt from"styled-components";var Yi=Xt.div`
|
|
422
423
|
align-items: center;
|
|
423
424
|
display: flex;
|
|
424
425
|
justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
|
|
425
426
|
padding-top: 14px;
|
|
426
|
-
`,
|
|
427
|
+
`,Ji=Xt.div`
|
|
427
428
|
color: ${e=>e.appearance.theme.colorTextError};
|
|
428
429
|
font-size: 12px;
|
|
429
|
-
`,
|
|
430
|
+
`,Xi=Xt.div`
|
|
430
431
|
display: flex;
|
|
431
432
|
gap: 12px;
|
|
432
433
|
width: 100%;
|
|
433
434
|
justify-content: flex-end;
|
|
434
|
-
`,
|
|
435
|
+
`,Qi=Xt.div`
|
|
435
436
|
display: flex;
|
|
436
437
|
// If type is set to large-modal, use padding 60px horizontal, 80px vertical
|
|
437
438
|
// Otherwise, use 4px padding
|
|
@@ -439,11 +440,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
439
440
|
flex-grow: 1;
|
|
440
441
|
flex-basis: 0;
|
|
441
442
|
position: relative;
|
|
442
|
-
`,
|
|
443
|
+
`,Zi=Xt.div`
|
|
443
444
|
padding: ${e=>e.type==="large-modal"?"50px":"0px"};
|
|
444
445
|
position: relative;
|
|
445
446
|
overflow-y: auto;
|
|
446
|
-
`,
|
|
447
|
+
`,Ri=Xt.div`
|
|
447
448
|
display: flex;
|
|
448
449
|
align-self: stretch;
|
|
449
450
|
flex-grow: 1;
|
|
@@ -455,7 +456,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
455
456
|
background-position: center;
|
|
456
457
|
border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
457
458
|
border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
458
|
-
`;import St from"react";import
|
|
459
|
+
`;import St from"react";import tn from"react";import on from"styled-components";import Sp from"styled-components";var en=Sp.div`
|
|
459
460
|
width: 24px;
|
|
460
461
|
height: 24px;
|
|
461
462
|
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
@@ -473,7 +474,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
473
474
|
transform: rotate(360deg);
|
|
474
475
|
}
|
|
475
476
|
}
|
|
476
|
-
`;var bp=
|
|
477
|
+
`;var bp=on.button`
|
|
477
478
|
justify-content: center;
|
|
478
479
|
align-content: center;
|
|
479
480
|
align-items: center;
|
|
@@ -506,7 +507,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
506
507
|
opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
|
|
507
508
|
cursor: not-allowed;
|
|
508
509
|
}
|
|
509
|
-
`,
|
|
510
|
+
`,Zo=on.div`
|
|
510
511
|
${e=>E(e)} {
|
|
511
512
|
display: flex;
|
|
512
513
|
flex-direction: row;
|
|
@@ -517,14 +518,14 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
517
518
|
margin-right: 8px;
|
|
518
519
|
}
|
|
519
520
|
}
|
|
520
|
-
`,
|
|
521
|
+
`,le=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:s=!1,appearance:a,withMargin:d=!0,classPrefix:l="",loading:m=!1,autoFocus:c=!1})=>{var y;function g(){let v=s?"buttonSecondary":"button";return l===""?v:`${l}${bo(v)}`}return tn.createElement(bp,{tabindex:s?"0":"1",secondary:s,appearance:a,disabled:i||m,loading:(y=m==null?void 0:m.toString())!=null?y:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:p(g(),a),autoFocus:c},m?tn.createElement(en,{className:p("buttonLoader",a)}):t!=null?t:"Continue")};var rn=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:s,onBack:a,allowBackNavigation:d,errorMessage:l,isSaving:m})=>{var y;let c=s.length>1&&r!=0&&d,g=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return St.createElement(St.Fragment,null,l!==null&&l!=null&&St.createElement(Ji,{appearance:o,className:p("formCTAError",o)},l),St.createElement(Yi,{showBackButton:c,className:p("formCTAContainer",o)},c&&St.createElement(le,{title:(y=e.backButtonTitle)!=null?y:"Back",onClick:a,secondary:!0,withMargin:!1,type:g,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),St.createElement(Xi,{className:p("ctaWrapper",o)},e.secondaryButtonTitle?St.createElement(le,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:g,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?St.createElement(le,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:g,appearance:o,loading:m}):null)))};import Dr from"react";import wp from"styled-components";var Tp=wp.div`
|
|
521
522
|
text-align: center;
|
|
522
|
-
`,
|
|
523
|
+
`,nn=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=ne().mergeAppearanceWithDefault(i);return Dr.createElement(Tp,{className:o},Dr.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,s)=>Dr.createElement("rect",{key:s,x:16*s,y:0,width:8,height:8,rx:4,fill:t===s?n.colorPrimary:"#E6E6E6"}))))};import It from"react";import Qt from"styled-components";import{useContext as Fp}from"react";function fe(){let e=Fp(Z);function t(n){i(n.primaryButtonUri,n.primaryButtonUriTarget)}function o(n){i(n.secondaryButtonUri,n.secondaryButtonUriTarget)}function i(n,r){if(!n)return;let s=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(s="_self"),e.navigate(n,s)}return{primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var kp=Qt.div`
|
|
523
524
|
display: flex;
|
|
524
525
|
flex-wrap: wrap;
|
|
525
526
|
align-content: center;
|
|
526
527
|
justify-content: center;
|
|
527
|
-
`,Pp=
|
|
528
|
+
`,Pp=Qt.div`
|
|
528
529
|
align-content: center;
|
|
529
530
|
align-items: center;
|
|
530
531
|
display: flex;
|
|
@@ -538,10 +539,10 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
538
539
|
flex-basis: 255px;
|
|
539
540
|
flex-grow: 0;
|
|
540
541
|
flex-shrink: 0;
|
|
541
|
-
`,vp=
|
|
542
|
+
`,vp=Qt.img`
|
|
542
543
|
width: 78px;
|
|
543
544
|
height: auto;
|
|
544
|
-
`,Bp=
|
|
545
|
+
`,Bp=Qt.button`
|
|
545
546
|
font-style: normal;
|
|
546
547
|
font-weight: 600;
|
|
547
548
|
font-size: 13px;
|
|
@@ -554,11 +555,11 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
554
555
|
border-radius: 100px;
|
|
555
556
|
padding: 8px 12px;
|
|
556
557
|
margin-top: 16px;
|
|
557
|
-
`,Ep=
|
|
558
|
+
`,Ep=Qt.h1`
|
|
558
559
|
font-weight: 700;
|
|
559
560
|
font-size: 28px;
|
|
560
561
|
line-height: 34px;
|
|
561
|
-
`,Ap=
|
|
562
|
+
`,Ap=Qt.h2`
|
|
562
563
|
font-style: normal;
|
|
563
564
|
font-weight: 400;
|
|
564
565
|
font-size: 16px;
|
|
@@ -567,7 +568,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
567
568
|
margin-top: 12px;
|
|
568
569
|
margin-bottom: 16px;
|
|
569
570
|
max-width: 70%;
|
|
570
|
-
`;function
|
|
571
|
+
`;function sn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=fe();return It.createElement("div",null,It.createElement(Ep,{dangerouslySetInnerHTML:se(e.title)}),It.createElement(Ap,{dangerouslySetInnerHTML:se(e.subtitle)}),It.createElement(kp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>It.createElement(Pp,{key:r.title},It.createElement(vp,{src:r.imageUri}),It.createElement(Bp,{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 Rt,{useEffect as _p}from"react";import er from"styled-components";import Ur from"react";var Ro=({style:e,className:t})=>Ur.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},Ur.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Ur.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 Lt,{useRef as Np,useState as Op}from"react";import Zt from"styled-components";var Ip=Zt.div`
|
|
571
572
|
display: flex;
|
|
572
573
|
align-items: center;
|
|
573
574
|
justify-content: flex-start;
|
|
@@ -575,7 +576,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
575
576
|
width: 100%;
|
|
576
577
|
height: 100%;
|
|
577
578
|
position: relative;
|
|
578
|
-
`,Lp=
|
|
579
|
+
`,Lp=Zt.div`
|
|
579
580
|
position: absolute;
|
|
580
581
|
display: flex;
|
|
581
582
|
align-items: center;
|
|
@@ -594,66 +595,66 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
594
595
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
595
596
|
border-radius: 50%;
|
|
596
597
|
}
|
|
597
|
-
`,$p=
|
|
598
|
+
`,$p=Zt.video`
|
|
598
599
|
width: 100%;
|
|
599
600
|
height: 100%;
|
|
600
601
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
601
|
-
`,Mp=
|
|
602
|
+
`,Mp=Zt.iframe`
|
|
602
603
|
width: 100%;
|
|
603
604
|
height: 100%;
|
|
604
605
|
min-height: 260px;
|
|
605
606
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
606
|
-
`,Dp=
|
|
607
|
+
`,Dp=Zt.iframe`
|
|
607
608
|
width: 100%;
|
|
608
609
|
height: 100%;
|
|
609
610
|
min-height: 400px;
|
|
610
611
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
611
|
-
}`,Up=
|
|
612
|
+
}`,Up=Zt.iframe`
|
|
612
613
|
width: 100%;
|
|
613
614
|
height: 100%;
|
|
614
615
|
min-height: 400px;
|
|
615
616
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
616
|
-
`;function tt({appearance:e,videoUri:t}){let
|
|
617
|
+
`;function tt({appearance:e,videoUri:t,autoplay:o=!1}){let i=Np(),[n,r]=Op(o);if(t.includes("youtube")){let s=t.split("v=")[1],a=s.indexOf("&");return a!==-1&&(s=s.substring(0,a)),Lt.createElement(Mp,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${s}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e,className:p("youtubePlayer",e)})}if(t.includes("vimeo")){let s=t.split("vimeo.com/")[1],a=s.indexOf("&");return a!==-1&&(s=s.substring(0,a)),Lt.createElement(Dp,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${s}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:p("vimeoPlayer",e)})}if(t.includes("wistia")){let s=t.split("wistia.com/medias/")[1],a=s.indexOf("&");return a!==-1&&(s=s.substring(0,a)),Lt.createElement(Up,{width:"100%",height:"100%",src:`https://fast.wistia.net/embed/iframe/${s}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:p("wistiaPlayer",e)})}return Lt.createElement(Ip,{className:p("videoPlayerWrapper",e),appearance:e},!n&&Lt.createElement(Lp,{onClick:()=>{r(!0),i.current.play()},appearance:e},Lt.createElement(Ro,null)),Lt.createElement($p,{appearance:e,controls:n,ref:i,play:n,src:t,autoplay:o,muted:o}))}var Wp=er.div`
|
|
617
618
|
${e=>E(e)} {
|
|
618
619
|
display: flex;
|
|
619
620
|
flex-direction: column;
|
|
620
621
|
justify-content: center;
|
|
621
622
|
}
|
|
622
|
-
`,zp=
|
|
623
|
+
`,zp=er.img`
|
|
623
624
|
${e=>E(e)} {
|
|
624
625
|
width: 100%;
|
|
625
626
|
height: auto;
|
|
626
627
|
max-height: 250px;
|
|
627
628
|
margin-bottom: 24px;
|
|
628
629
|
}
|
|
629
|
-
`,Hp=
|
|
630
|
+
`,Hp=er.div`
|
|
630
631
|
${e=>E(e)} {
|
|
631
632
|
margin-bottom: 24px;
|
|
632
633
|
}
|
|
633
|
-
`,Vp=
|
|
634
|
+
`,Vp=er.div`
|
|
634
635
|
${e=>E(e)} {
|
|
635
636
|
width: 100%;
|
|
636
637
|
height: auto;
|
|
637
638
|
max-height: 250px;
|
|
638
639
|
margin-bottom: 24px;
|
|
639
640
|
}
|
|
640
|
-
`;function
|
|
641
|
+
`;function ln({stepData:e,appearance:t,setCanContinue:o}){return _p(()=>{o(!0)},[]),Rt.createElement(Wp,{className:p("callToActionContainer",t)},Rt.createElement(Hp,{className:p("callToActionTextContainer",t)},Rt.createElement(Ne,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Rt.createElement(zp,{className:p("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Rt.createElement(Vp,{appearance:t,className:p("callToActionVideo",t)},Rt.createElement(tt,{appearance:t,videoUri:e.videoUri})))}import pt,{useEffect as _r,useState as Wr}from"react";import bt from"styled-components";var an=bt.div`
|
|
641
642
|
width: auto;
|
|
642
643
|
display: flex;
|
|
643
644
|
flex-direction: column;
|
|
644
645
|
justify-content: center;
|
|
645
646
|
align-items: center;
|
|
646
647
|
padding: 4px;
|
|
647
|
-
`,
|
|
648
|
+
`,pn=bt.div`
|
|
648
649
|
width: 100%;
|
|
649
650
|
text-align: left;
|
|
650
|
-
`,
|
|
651
|
+
`,dn=bt.h1`
|
|
651
652
|
font-style: normal;
|
|
652
653
|
font-weight: 700;
|
|
653
654
|
font-size: 32px;
|
|
654
655
|
line-height: 38px;
|
|
655
656
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
656
|
-
`,
|
|
657
|
+
`,cn=bt.h1`
|
|
657
658
|
font-style: normal;
|
|
658
659
|
font-weight: 400;
|
|
659
660
|
font-size: 16px;
|
|
@@ -661,7 +662,7 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
661
662
|
margin-top: 16px;
|
|
662
663
|
margin-bottom: 16px;
|
|
663
664
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
664
|
-
`,
|
|
665
|
+
`,mn=bt.div`
|
|
665
666
|
padding-top: 12px;
|
|
666
667
|
padding-bottom: 12px;
|
|
667
668
|
flex-direction: row;
|
|
@@ -672,17 +673,17 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
672
673
|
cursor: pointer;
|
|
673
674
|
border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
|
|
674
675
|
width: 100%;
|
|
675
|
-
`,
|
|
676
|
+
`,un=bt.div`
|
|
676
677
|
padding-top: 10px;
|
|
677
678
|
padding-bottom: 10px;
|
|
678
679
|
flex-direction: row;
|
|
679
680
|
display: flex;
|
|
680
681
|
justify-content: flex-start;
|
|
681
|
-
`,
|
|
682
|
+
`,fn=bt.img`
|
|
682
683
|
width: 42px;
|
|
683
684
|
height: 42px;
|
|
684
685
|
margin-right: 12px;
|
|
685
|
-
`,
|
|
686
|
+
`,gn=bt.p`
|
|
686
687
|
font-style: normal;
|
|
687
688
|
font-weight: 500;
|
|
688
689
|
font-size: 17px;
|
|
@@ -690,8 +691,8 @@ var na=Object.defineProperty,sa=Object.defineProperties;var la=Object.getOwnProp
|
|
|
690
691
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
691
692
|
display: flex;
|
|
692
693
|
align-self: center;
|
|
693
|
-
`;var
|
|
694
|
-
${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([l,p])=>`${_o(l)}: ${p};`).join(" ")} }`:`${_o(i)}: ${n};`).join(" ")} }`).join(" ")}`;function te({appearance:e}){if(!e||!e.styleOverrides)return Fo.createElement(Fo.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?Fo.createElement(Fo.Fragment,null):Fo.createElement(Kp,{inlineStyles:t})}import{useEffect as qp,useState as Yp}from"react";function Ve(e,t=!0){let[o,i]=Yp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:l,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:s,getFlow:m}=R(),c=p(e);function g(){return M(this,null,function*(){!o&&!r&&l(e)===De&&s(m(e))===!1&&t&&c&&c.length>0&&(i(!0),yield n(e,c[d(e)].id))})}return qp(()=>{g()},[r,e,t]),{}}var Cn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:l,onComplete:p,appearance:d,hideOnFlowCompletion:s=!0,onStepCompletion:m,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:y=!1,modalPosition:S="center",repeatable:C=!1,onDismiss:x,showPagination:P=!1,allowBackNavigation:b=!1,validationHandler:v,showFrigadeBranding:$=!1,onFormDataChange:B,showFooter:u=!0,prefillData:O={},updateUrlOnPageChange:T=!1})=>{let{getFlow:k,getFlowSteps:I,isLoading:N,targetingLogicShouldHideFlow:A,getFlowStatus:H,getCurrentStepIndex:U,markFlowCompleted:oe,markFlowNotStarted:X,markStepStarted:q}=R(),J=U(e),{mergeAppearanceWithDefault:Y}=se(),[de,we]=Jp(null),{setOpenFlowState:Ie,getOpenFlowState:ce,hasOpenModals:Z}=Ee();Ve(e,i);let D=I(e);d=Y(d);let[ee,ke]=i!==void 0&&n!==void 0?[i,n]:[ce(e,!0),V=>Ie(e,V)],He=typeof window!="undefined"?window.location.hash:null;if(xn(()=>{var V;if(D&&D.length>0&&b){let z=typeof window!="undefined"&&((V=window==null?void 0:window.location)!=null&&V.hash)?window.location.hash.replace("#",""):"";if(D&&(D==null?void 0:D.length)>0){let L=-1;if(z){let W=z;L=D.findIndex(ie=>ie.id===W),de===z&&(L=-1)}L!==-1&&(we(z),q(e,D[L].id))}}},[He]),xn(()=>{!N&&D&&D.length&&typeof window!="undefined"&&b&&(we(D[J].id),window.location.hash=D[J].id)},[N,J,D]),N)return null;let ue=k(e);if(!ue||A(ue)||!D||i!==void 0&&i===!1||H(e)===ne&&s&&!C||(o=="modal"||o=="corner-modal")&&Z(e))return null;let me=()=>{ke(!1),x&&x(),y===!0&&oe(e)};if(S=="center"&&o==="modal"||o==="large-modal"){let V={padding:"24px"};return o==="large-modal"?(V.width="85%",V.height="90%",V.maxHeight="800px",V.minHeight="500px",V.padding="0"):V.width="400px",ot.createElement(Re,{appearance:d,onClose:me,visible:ee,style:V,dismissible:g,showFrigadeBranding:$},ot.createElement(te,{appearance:d}),ot.createElement(er,{appearance:d,steps:D,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:ke,onDismiss:x,showPagination:P,customFormElements:l,allowBackNavigation:b,validationHandler:v,onFormDataChange:B,showFooter:u,prefillData:O,updateUrlOnPageChange:T,repeatable:C}))}return o==="modal"&&S!=="center"?ot.createElement(jo,{appearance:d,onClose:me,visible:ee,modalPosition:S},ot.createElement(te,{appearance:d}),ot.createElement(er,{appearance:d,steps:D,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:ke,onDismiss:x,showPagination:P,customFormElements:l,allowBackNavigation:b,validationHandler:v,onFormDataChange:B,showFooter:u,prefillData:O,updateUrlOnPageChange:T,repeatable:C})):ot.createElement(ot.Fragment,null,ot.createElement(te,{appearance:d}),ot.createElement(er,{appearance:d,steps:D,selectedStep:J,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:ke,onDismiss:x,showPagination:P,customFormElements:l,allowBackNavigation:b,validationHandler:v,onFormDataChange:B,showFooter:u,prefillData:O,updateUrlOnPageChange:T,repeatable:C}))},yn=Cn;import{useCallback as Wr,useContext as Xp,useEffect as Qp}from"react";function zr(){let{organizationId:e,userId:t,setOrganizationId:o}=Xp(Q),{mutateUserFlowState:i}=Ue(),{config:n,apiUrl:r}=Ze(),l=jt(),{verifySDKInitiated:p}=Gt();function d(g,y){return`frigade-user-group-registered-${g}-${y}`}Qp(()=>{if(t&&e){if(t.startsWith(Kt))return;let g=d(t,e);localStorage.getItem(g)||(l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let s=Wr(g=>M(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let y={foreignUserId:t,foreignUserGroupId:e,properties:g};yield l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=Wr((g,y)=>M(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let C={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:y}]};yield l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify(C)})),i()}),[e,t,n,i]),c=Wr((g,y)=>M(this,null,function*(){if(p())if(y){let S=d(t,g);localStorage.setItem(S,"true"),o(g);let C={foreignUserId:t,foreignUserGroupId:g,properties:y};yield l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify(C)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:m}}var Sn="frigade-xFrigade_guestUserId",Po="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=xo(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ue(),{userId:n,setUserId:r}=Co(),[l,p]=ko(n),{getFlowStatus:d}=R(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Zp(Q),[y,S]=ko([]),[C,x]=ko([]),{organizationId:P}=zr(),[b,v]=ko(P),[$,B]=ko(!1);Rt(()=>{if(!o&&t)for(let k=0;k<t.length;k++){let I=t[k],N=s.find(A=>A.slug===(I==null?void 0:I.flowId));if(N&&I&&I.shouldTrigger===!0&&N.type=="FORM"&&N.triggerType==="AUTOMATIC"&&!C.includes(N.slug)){setTimeout(()=>{u(I.flowId)},500);break}}},[o,t]),Rt(()=>{g.length>0&&i()},[g]),Rt(()=>{$||(B(!0),i())},[o,B]);function u(k){let I=s.find(N=>N.slug===k);I&&I.triggerType==="AUTOMATIC"&&!C.includes(I.slug)&&(x([...C,I.slug]),S([I]))}function O(){if(!n){let k=localStorage.getItem(Po);if(k){r(k);return}let I=localStorage.getItem(Sn);if(I){r(I);return}c(!0);let N=Kt+Rp();try{localStorage.setItem(Sn,N)}catch(A){console.log("Failed to save guest user id locally: Local storage unavailable",A)}r(A=>A||N)}}Rt(()=>{try{if(s){let k=[];s.forEach(I=>{if(I.data){let N=I.data.match(/"imageUri":"(.*?)"/g);N&&N.forEach(A=>{let H=A.replace('"imageUri":"',"").replace('"',"");if(k.includes(H))return;let U=new Image;U.src=H,k.push(H)})}})}}catch(k){}},[s]),Rt(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Kt))try{localStorage.setItem(Po,n)}catch(k){console.log("Failed to save user id locally: Local storage available",k)}n===null&&setTimeout(()=>{n===null&&O()},50)},[n,s,m]),Rt(()=>{P!=b&&(v(P),e([]),i())},[P,b,v]);function T(){return Lt.createElement(Lt.Fragment,null,y.map(k=>d(k.slug)!==De?null:Lt.createElement("span",{key:k.slug},Lt.createElement(yn,{flowId:k.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Lt.createElement(Lt.Fragment,null,Lt.createElement(T,null))};var wn={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function ed(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l]})}}),t}function td(e){if(!e)return;let t=Ce({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=ed(t),n=td(o);return{overrides:i,css:n}}import gd from"styled-components";import{compose as hd,variant as kn}from"styled-system";import Fn from"react";import od,{ThemeProvider as rd,useTheme as id}from"styled-components";import{border as nd,color as sd,compose as ld,get as ad,shadow as pd,space as dd,system as cd,typography as md}from"styled-system";var ud={width:{property:"width",scale:"sizes",transform:(e,t)=>ad(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},fd=od("div")(({css:e})=>e,ld(nd,sd,pd,dd,md,cd(ud))),vo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Le(r,["as","children","overrides"]);let l=id(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(fd,w(w({as:e},p),i),t);if(o!==void 0){let s=Ce(l,o);return Fn.createElement(rd,{theme:s},d())}return d()};var Bo={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},xd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=gd(vo)(()=>({whiteSpace:"nowrap"}),hd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:xd})));import Cd from"styled-components";import{variant as yd,system as Sd}from"styled-system";var tr={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var vn=Cd(vo)(yd({scale:"components.Text",variants:"components.Text"}),Sd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",bd=20,wd=Object.fromEntries(Array.from(Array(bd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),eo={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",red500:"#c00000"},or={colors:j(w({},eo),{neutral:{foreground:eo.gray300},primary:{background:eo.blue500,foreground:eo.white,inverted:eo.blue500},negative:{foreground:eo.red500}}),fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:wd,components:{Button:Bo,Text:tr}};var On="https://api.frigade.com",Q=Td({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:lt,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:On,readonly:!1,debug:!1});function Fd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var kd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var J,Y,de,we,Ie,ce;let[r,l]=je(t||null),[p,d]=je(o||null),[s,m]=je([]),[c,g]=je([]),[y,S]=je([]),[C,x]=je({}),[P,b]=je({}),[v,$]=je([]),[B,u]=je({}),[O,T]=je(!1),[k,I]=je(!1),[N,A]=je(!oe(e)),H=(Z,D)=>{if(D==="_blank"){window.open(Z,"_blank");return}setTimeout(()=>{window.location.href=Z},50)},U={theme:w(w({},lt.theme),(Y=(J=i==null?void 0:i.defaultAppearance)==null?void 0:J.theme)!=null?Y:{}),styleOverrides:w(w({},lt.styleOverrides),(we=(de=i==null?void 0:i.defaultAppearance)==null?void 0:de.styleOverrides)!=null?we:{})};function oe(Z){return!!(Z&&Z.length>10&&Z.substring(0,10)==="api_public")}rr(()=>{t&&l(t)},[t]),rr(()=>{r&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(Po)&&window.localStorage.getItem(Po)!==r&&Fd()},[r]),rr(()=>{o&&d(o)},[o]),rr(()=>{if(oe(e))A(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),A(!0);return}},[e,A]);let X={publicApiKey:e,userId:r,setUserId:l,setFlows:m,flows:s,failedFlowResponses:c,setFailedFlowResponses:g,flowResponses:y,setFlowResponses:S,userProperties:C,setUserProperties:x,openFlowStates:P,setOpenFlowStates:b,completedFlowsToKeepOpenDuringSession:v,setCompletedFlowsToKeepOpenDuringSession:$,customVariables:B,setCustomVariables:u,isNewGuestUser:O,setIsNewGuestUser:T,hasActiveFullPageFlow:k,setHasActiveFullPageFlow:I,organizationId:p,setOrganizationId:d,navigate:i&&i.navigate?i.navigate:H,defaultAppearance:U,shouldGracefullyDegrade:N,setShouldGracefullyDegrade:A,apiUrl:i&&i.apiUrl?i.apiUrl:On,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0},{overrides:q}=Tn(U);return N?Eo.createElement(Q.Provider,{value:X},Eo.createElement(An,{theme:Ce(U.theme,or,q!=null?q:{},(Ie=i==null?void 0:i.theme)!=null?Ie:{})},n)):Eo.createElement(Q.Provider,{value:X},Eo.createElement(An,{theme:Ce(U.theme,or,q!=null?q:{},(ce=i==null?void 0:i.theme)!=null?ce:{})},n,Eo.createElement(bn,null)))};import hc from"react";import Se,{useEffect as mr,useState as il}from"react";import Je,{useState as Vd}from"react";import wt from"styled-components";import sr from"react";import $t from"react";import In from"styled-components";var Nn=In.span`
|
|
694
|
+
`;var hn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,s]=Wr([]),[a,d]=Wr(!1),[l,m]=Wr(e.id);return _r(()=>{r.length==0&&!a&&(d(!0),o({choice:[]}))},[a]),_r(()=>{l!==e.id&&(m(e.id),s([]))},[e]),_r(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1)},[r]),pt.createElement(an,{className:p("selectListContainer",i)},pt.createElement(pn,null,pt.createElement(dn,{className:p("selectListTitle",i)},e.title),pt.createElement(cn,{appearance:i,className:p("selectListSubtitle",i)},e.subtitle)),n.options.map((c,g)=>{let y=r.includes(c.id);return pt.createElement(mn,{key:`select-item-${g}`,onClick:()=>{if(r.includes(c.id)){s(r.filter(v=>v!==c.id));return}r.length<n.maxChoices?s([...r,c.id]):r.length==1&&n.maxChoices==1&&s([c.id])},hideBottomBorder:g===n.options.length-1,className:p("selectListSelectItem",i)},pt.createElement(un,{className:p("selectListItemImage",i)},c.imageUri&&pt.createElement(fn,{src:c.imageUri,alt:`select-icon-${g}`}),pt.createElement(gn,{appearance:i,className:p("selectListSelectItemText",i)},c.title)),pt.createElement(at,{appearance:i,value:y,primaryColor:i.theme.colorPrimary}))}))};import _e,{useEffect as xn,useState as tr}from"react";var jp=({children:e,id:t,shouldWrap:o=!1})=>_e.createElement(_e.Fragment,null,o?_e.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),or=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:s,flowId:a,type:d,hideOnFlowCompletion:l,onComplete:m,setVisible:c,setShowModal:g,onDismiss:y,showPagination:v=!1,customFormElements:x,allowBackNavigation:C,validationHandler:F,onFormDataChange:S,showFooter:P,prefillData:$,updateUrlOnPageChange:B,repeatable:u})=>{var me;let w=b(b({},{linkCollection:sn,multiInput:qi,callToAction:ln,selectList:hn}),i),{primaryCTAClickSideEffects:k,secondaryCTAClickSideEffects:I}=fe(),[N,O]=tr(!1),[H,_]=tr({}),[R,J]=tr(!1),[ee,K]=tr(null),Y=(me=t[o])!=null?me:null,{markStepCompleted:de,markStepStarted:we,isLoading:Ie,updateCustomVariables:ce,markFlowCompleted:pe}=te();xn(()=>{ce(n)},[n,Ie]),xn(()=>{S&&S(H,M(),t[o],o)},[H]);function M(){var z;return{data:(z=H[t[o].id])!=null?z:{},stepId:t[o].id,customVariables:n}}function X(j,z,L){let W=o+1<t.length?t[o+1]:null;return s&&s(j,L,W,H,M()),r?r(j,o,z,W):!0}function ke(j,z){_(L=>{let W={};return W[j.id]=z,b(b({},L),W)})}function He(j){return j.selectedStep.imageUri?_e.createElement(Ri,{image:j.selectedStep.imageUri,appearance:e,className:p("formContainerSidebarImage",e)}):null}let ue=P&&_e.createElement(rn,{step:t[o],canContinue:N&&!R,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>D(void 0,null,function*(){if(J(!0),F){let L=yield F(t[o],o,t[o+1],H,M());if(L!==!0){K(typeof L=="string"?L:null),J(!1);return}else K(null)}let j=b({},M());yield de(a,t[o].id,j),o+1<t.length&&!C&&(yield we(a,t[o+1].id));let z=X(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),y&&y(),l&&z&&(c&&c(!1),g(!1)),yield pe(a),u&&(yield we(a,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(W=>{W.startsWith(Mr)&&window.localStorage.removeItem(W)}))),k(t[o]),J(!1),typeof window!="undefined"&&!C&&B&&o+1<t.length){let L=new URL(window.location.href);L.searchParams.set("p",t[o+1].id),window.history.pushState({},"",L.toString())}}),onSecondaryClick:()=>{X(t[o],"secondary",o),I(t[o])},onBack:()=>D(void 0,null,function*(){o-1>=0&&(J(!0),yield we(a,t[o-1].id),J(!1))}),steps:t,allowBackNavigation:C,errorMessage:ee,isSaving:R});return _e.createElement(_e.Fragment,null,_e.createElement(Qi,{className:p("formContainer",e)},_e.createElement(jp,{id:o,shouldWrap:d==="large-modal"},_e.createElement(Zi,{key:Y.id,type:d,className:p("formContent",e)},t.map(j=>{var L;let z=w[(L=j.type)!=null?L:"multiInput"];return Y.id!==j.id?null:typeof z!="function"?z:_e.createElement(z,{key:j.id,stepData:j,canContinue:N,setCanContinue:O,onSaveData:W=>{ke(j,W)},appearance:e,customFormElements:x,flowId:a,prefillData:$})}),v&&_e.createElement(nn,{className:p("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),ue)),d=="large-modal"&&_e.createElement(He,{selectedStep:t[o]})))};import ko from"react";import{createGlobalStyle as Gp}from"styled-components";var Kp=Gp`
|
|
695
|
+
${e=>e.inlineStyles.map(([t,o])=>`.${So}${t}.${So}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([s,a])=>`${zo(s)}: ${a};`).join(" ")} }`:`${zo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function oe({appearance:e}){if(!e||!e.styleOverrides)return ko.createElement(ko.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?ko.createElement(ko.Fragment,null):ko.createElement(Kp,{inlineStyles:t})}import{useEffect as qp,useState as Yp}from"react";function Ve(e,t=!0){let[o,i]=Yp(!1),{markStepStarted:n,isLoading:r,getFlowStatus:s,getFlowSteps:a,getCurrentStepIndex:d,targetingLogicShouldHideFlow:l,getFlow:m}=te(),c=a(e);function g(){return D(this,null,function*(){!o&&!r&&s(e)===De&&l(m(e))===!1&&t&&c&&c.length>0&&(i(!0),yield n(e,c[d(e)].id))})}return qp(()=>{g()},[r,e,t]),{}}var yn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:s,onComplete:a,appearance:d,hideOnFlowCompletion:l=!0,onStepCompletion:m,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:y=!1,modalPosition:v="center",repeatable:x=!1,onDismiss:C,showPagination:F=!1,allowBackNavigation:S=!1,validationHandler:P,showFrigadeBranding:$=!1,onFormDataChange:B,showFooter:u=!0,prefillData:A={},updateUrlOnPageChange:w=!1})=>{let{getFlow:k,getFlowSteps:I,isLoading:N,targetingLogicShouldHideFlow:O,getFlowStatus:H,getCurrentStepIndex:_,markFlowCompleted:R,markFlowNotStarted:J,markStepStarted:ee}=te(),K=_(e),{mergeAppearanceWithDefault:Y}=ne(),[de,we]=Jp(null),{setOpenFlowState:Ie,getOpenFlowState:ce,hasOpenModals:pe}=Ee();Ve(e,i);let M=I(e);d=Y(d);let[X,ke]=i!==void 0&&n!==void 0?[i,n]:[ce(e,!0),j=>Ie(e,j)],He=typeof window!="undefined"?window.location.hash:null;if(Cn(()=>{var j;if(M&&M.length>0&&S){let z=typeof window!="undefined"&&((j=window==null?void 0:window.location)!=null&&j.hash)?window.location.hash.replace("#",""):"";if(M&&(M==null?void 0:M.length)>0){let L=-1;if(z){let W=z;L=M.findIndex(re=>re.id===W),de===z&&(L=-1)}L!==-1&&(we(z),ee(e,M[L].id))}}},[He]),Cn(()=>{!N&&M&&M.length&&typeof window!="undefined"&&S&&(we(M[K].id),window.location.hash=M[K].id)},[N,K,M]),N)return null;let ue=k(e);if(!ue||O(ue)||!M||i!==void 0&&i===!1||H(e)===ie&&l&&!x||(o=="modal"||o=="corner-modal")&&pe(e))return null;let me=()=>{ke(!1),C&&C(),y===!0&&R(e)};if(v=="center"&&o==="modal"||o==="large-modal"){let j={padding:"24px"};return o==="large-modal"?(j.width="85%",j.height="90%",j.maxHeight="800px",j.minHeight="500px",j.padding="0"):j.width="400px",ot.createElement(Re,{appearance:d,onClose:me,visible:X,style:j,dismissible:g,showFrigadeBranding:$},ot.createElement(oe,{appearance:d}),ot.createElement(or,{appearance:d,steps:M,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:ke,onDismiss:C,showPagination:F,customFormElements:s,allowBackNavigation:S,validationHandler:P,onFormDataChange:B,showFooter:u,prefillData:A,updateUrlOnPageChange:w,repeatable:x}))}return o==="modal"&&v!=="center"?ot.createElement(Ko,{appearance:d,onClose:me,visible:X,modalPosition:v},ot.createElement(oe,{appearance:d}),ot.createElement(or,{appearance:d,steps:M,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:ke,onDismiss:C,showPagination:F,customFormElements:s,allowBackNavigation:S,validationHandler:P,onFormDataChange:B,showFooter:u,prefillData:A,updateUrlOnPageChange:w,repeatable:x})):ot.createElement(ot.Fragment,null,ot.createElement(oe,{appearance:d}),ot.createElement(or,{appearance:d,steps:M,selectedStep:K,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:l,onComplete:a,setVisible:n,setShowModal:ke,onDismiss:C,showPagination:F,customFormElements:s,allowBackNavigation:S,validationHandler:P,onFormDataChange:B,showFooter:u,prefillData:A,updateUrlOnPageChange:w,repeatable:x}))},Sn=yn;import{useCallback as zr,useContext as Xp,useEffect as Qp}from"react";function Hr(){let{organizationId:e,userId:t,setOrganizationId:o}=Xp(Z),{mutateUserFlowState:i}=Ue(),{config:n,apiUrl:r}=Ze(),s=Gt(),{verifySDKInitiated:a}=Kt();function d(g,y){return`frigade-user-group-registered-${g}-${y}`}Qp(()=>{if(t&&e){if(t.startsWith(qt))return;let g=d(t,e);localStorage.getItem(g)||(s(`${r}userGroups`,V(b({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(g,"true"))}},[t,e]);let l=zr(g=>D(this,null,function*(){if(!a())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let y={foreignUserId:t,foreignUserGroupId:e,properties:g};yield s(`${r}userGroups`,V(b({},n),{method:"POST",body:JSON.stringify(y)})),i()}),[e,t,n,i]),m=zr((g,y)=>D(this,null,function*(){if(!a())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let x={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:y}]};yield s(`${r}userGroups`,V(b({},n),{method:"POST",body:JSON.stringify(x)})),i()}),[e,t,n,i]),c=zr((g,y)=>D(this,null,function*(){if(a())if(y){let v=d(t,g);localStorage.setItem(v,"true"),o(g);let x={foreignUserId:t,foreignUserGroupId:g,properties:y};yield s(`${r}userGroups`,V(b({},n),{method:"POST",body:JSON.stringify(x)})),i()}else o(g)}),[t,n,i]);return{organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:l,trackEventForOrganization:m}}var Nt="frigade-xFrigade_guestUserId",vo="frigade-xFrigade_userId",bn=({})=>{let{setFlowResponses:e}=Co(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=Ue(),{userId:n,setUserId:r}=yo(),[s,a]=Po(n),{getFlowStatus:d}=te(),{flows:l,userProperties:m,setIsNewGuestUser:c,flowResponses:g}=Zp(Z),[y,v]=Po([]),[x,C]=Po([]),{organizationId:F}=Hr(),[S,P]=Po(F),[$,B]=Po(!1);eo(()=>{if(!o&&t)for(let k=0;k<t.length;k++){let I=t[k],N=l.find(O=>O.slug===(I==null?void 0:I.flowId));if(N&&I&&I.shouldTrigger===!0&&N.type=="FORM"&&N.triggerType==="AUTOMATIC"&&!x.includes(N.slug)){setTimeout(()=>{u(I.flowId)},500);break}}},[o,t]),eo(()=>{g.length>0&&i()},[g]),eo(()=>{$||(B(!0),i())},[o,B]);function u(k){let I=l.find(N=>N.slug===k);I&&I.triggerType==="AUTOMATIC"&&!x.includes(I.slug)&&(C([...x,I.slug]),v([I]))}function A(){if(!n){let k=localStorage.getItem(vo);if(k){r(k);return}let I=localStorage.getItem(Nt);if(I){r(I);return}c(!0);let N=qt+Rp();try{localStorage.setItem(Nt,N)}catch(O){console.log("Failed to save guest user id locally: Local storage unavailable",O)}r(O=>O||N)}}eo(()=>{try{if(l){let k=[];l.forEach(I=>{if(I.data){let N=I.data.match(/"imageUri":"(.*?)"/g);N&&N.forEach(O=>{let H=O.replace('"imageUri":"',"").replace('"',"");if(k.includes(H))return;let _=new Image;_.src=H,k.push(H)})}})}}catch(k){}},[l]),eo(()=>{if(n!==s&&(e([]),i()),a(n),n&&!n.startsWith(qt))try{localStorage.setItem(vo,n)}catch(k){console.log("Failed to save user id locally: Local storage available",k)}n===null&&setTimeout(()=>{n===null&&A()},50)},[n,l,m]),eo(()=>{F!=S&&(P(F),e([]),i())},[F,S,P]);function w(){return $t.createElement($t.Fragment,null,y.map(k=>d(k.slug)!==De?null:$t.createElement("span",{key:k.slug},$t.createElement(Sn,{flowId:k.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return $t.createElement($t.Fragment,null,$t.createElement(w,null))};var wn={colorPrimary:"colors.primary.background",colorText:"colors.neutral.foreground",colorBackground:"colors.neutral.background",colorBackgroundSecondary:"colors.secondary.background",colorTextOnPrimaryBackground:"colors.primary.foreground",colorTextSecondary:"colors.secondary.foreground",colorTextDisabled:"colors.gray700",colorBorder:"colors.gray800",colorTextError:"colors.negative.foreground",borderRadius:"radii.lg"};function ed(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(wn[o]){let n=wn[o].split("."),r=t;n.forEach((s,a)=>{r[s]||(r[s]=a===n.length-1?i:{}),r=r[s]})}}),t}function td(e){if(!e)return;let t=Ce({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i]}),o}function Tn(e){let{theme:t,styleOverrides:o}=e,i=ed(t),n=td(o);return{overrides:i,css:n}}import gd from"styled-components";import{compose as hd,variant as kn}from"styled-system";import Fn from"react";import od,{ThemeProvider as rd,useTheme as id}from"styled-components";import{border as nd,color as sd,compose as ld,get as ad,shadow as pd,space as dd,system as cd,typography as md}from"styled-system";var ud={width:{property:"width",scale:"sizes",transform:(e,t)=>ad(t,e,!(typeof e=="number"&&!isNaN(e))||e>1?e:e*100+"%")},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0},fd=od("div")(({css:e})=>e,ld(nd,sd,pd,dd,md,cd(ud))),Bo=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Le(r,["as","children","overrides"]);let s=id(),a={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Fn.createElement(fd,b(b({as:e},a),i),t);if(o!==void 0){let l=Ce(s,o);return Fn.createElement(rd,{theme:l},d())}return d()};var Eo={Primary:{backgroundColor:"primary.background",color:"primary.foreground","&:hover":{backgroundColor:"blue400"}},Secondary:{backgroundColor:"white",border:"1px solid",borderColor:"gray800",color:"neutral.foreground","&:hover":{backgroundColor:"blue900"}},Link:{backgroundColor:"transparent",color:"primary.inverted"},Plain:{backgroundColor:"transparent",color:"neutral.foreground"}},xd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},Pn=gd(Bo)(()=>({whiteSpace:"nowrap"}),hd(kn({scale:"components.Button",variants:"components.Button"}),kn({prop:"size",variants:xd})));import Cd from"styled-components";import{variant as yd,system as Sd}from"styled-system";var rr={Display1:{fontSize:"5xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"4xl"},Display2:{fontSize:"4xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"3xl"},H1:{fontSize:"3xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"2xl"},H2:{fontSize:"2xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"xl"},H3:{fontSize:"xl",fontWeight:"bold",letterSpacing:"md",lineHeight:"lg"},H4:{fontSize:"lg",fontWeight:"bold",letterSpacing:"md",lineHeight:"md"},Body1:{fontSize:"md",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Body2:{fontSize:"sm",fontWeight:"regular",letterSpacing:"md",lineHeight:"md"},Caption:{fontSize:"xs",fontWeight:"regular",letterSpacing:"md",lineHeight:"sm"}};var vn=Cd(Bo)(yd({scale:"components.Text",variants:"components.Text"}),Sd({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Bn=4,En="px",bd=20,wd=Object.fromEntries(Array.from(Array(bd+1),(e,t)=>t===0?[.5,`${.5*Bn}${En}`]:[t,`${t*Bn}${En}`])),to={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:V(b({},to),{neutral:{foreground:to.gray300},primary:{background:to.blue500,foreground:to.white,inverted:to.blue500},negative:{foreground:to.red500}}),fonts:{default:"TT Interphases Pro, sans-serif"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{regular:400,semibold:500,bold:700},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"},radii:{md:"8px",lg:"20px",round:"50%"},shadows:{md:"0px 4px 20px rgba(0, 0, 0, 0.06)"},space:wd,components:{Button:Eo,Text:rr}};var Nn="https://api.frigade.com",Z=Td({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:lt,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:Nn,readonly:!1,debug:!1});function Fd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e)})}var kd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var Y,de,we,Ie,ce,pe;let r=typeof window!="undefined"?localStorage.getItem(Nt):null,[s,a]=je(t||r),[d,l]=je(o||null),[m,c]=je([]),[g,y]=je([]),[v,x]=je([]),[C,F]=je({}),[S,P]=je({}),[$,B]=je([]),[u,A]=je({}),[w,k]=je(!1),[I,N]=je(!1),[O,H]=je(!J(e)),_=(M,X)=>{if(X==="_blank"){window.open(M,"_blank");return}setTimeout(()=>{window.location.href=M},50)},R={theme:b(b({},lt.theme),(de=(Y=i==null?void 0:i.defaultAppearance)==null?void 0:Y.theme)!=null?de:{}),styleOverrides:b(b({},lt.styleOverrides),(Ie=(we=i==null?void 0:i.defaultAppearance)==null?void 0:we.styleOverrides)!=null?Ie:{})};function J(M){return!!(M&&M.length>10&&M.substring(0,10)==="api_public")}nr(()=>{t&&a(t)},[t]),nr(()=>{s&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(vo)&&window.localStorage.getItem(vo)!==s&&Fd()},[s]),nr(()=>{o&&l(o)},[o]),nr(()=>{if(J(e))H(!1);else{console.error("Frigade SDK failed to initialize. API key provided is either missing or valid."),H(!0);return}},[e,H]);let ee={publicApiKey:e,userId:s,setUserId:a,setFlows:c,flows:m,failedFlowResponses:g,setFailedFlowResponses:y,flowResponses:v,setFlowResponses:x,userProperties:C,setUserProperties:F,openFlowStates:S,setOpenFlowStates:P,completedFlowsToKeepOpenDuringSession:$,setCompletedFlowsToKeepOpenDuringSession:B,customVariables:u,setCustomVariables:A,isNewGuestUser:w,setIsNewGuestUser:k,hasActiveFullPageFlow:I,setHasActiveFullPageFlow:N,organizationId:d,setOrganizationId:l,navigate:i&&i.navigate?i.navigate:_,defaultAppearance:R,shouldGracefullyDegrade:O,setShouldGracefullyDegrade:H,apiUrl:i&&i.apiUrl?i.apiUrl:Nn,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0},{overrides:K}=Tn(R);return O?Ao.createElement(Z.Provider,{value:ee},Ao.createElement(An,{theme:Ce(R.theme,ir,K!=null?K:{},(ce=i==null?void 0:i.theme)!=null?ce:{})},n)):Ao.createElement(Z.Provider,{value:ee},Ao.createElement(An,{theme:Ce(R.theme,ir,K!=null?K:{},(pe=i==null?void 0:i.theme)!=null?pe:{})},n,Ao.createElement(bn,null)))};import hc from"react";import Se,{useEffect as fr,useState as il}from"react";import Je,{useState as Vd}from"react";import wt from"styled-components";import ar from"react";import Mt from"react";import In from"styled-components";var On=In.span`
|
|
695
696
|
font-weight: 600;
|
|
696
697
|
font-size: 14px;
|
|
697
698
|
font-style: normal;
|
|
@@ -712,11 +713,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
712
713
|
padding-right: 8px;
|
|
713
714
|
width: 100%;
|
|
714
715
|
${e=>Pe(e)}
|
|
715
|
-
`,
|
|
716
|
+
`,sr=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:s="round",appearance:a})=>Mt.createElement(Mt.Fragment,null,Mt.createElement(Pd,{className:p("checklistStepsContainer",a),appearance:a,styleOverrides:b({},n)},i==="left"&&e&&Mt.createElement(On,{className:p("checklistStepLabel",a),styleOverrides:o,appearnace:a},e),Mt.createElement(at,{appearance:a,value:t,type:s,primaryColor:r}),i==="right"&&e&&Mt.createElement(On,{className:p("checklistStepLabel",a),styleOverrides:o,appearance:a},e)),Mt.createElement(oe,{appearance:a}));import No from"styled-components";var Ln=No.div`
|
|
716
717
|
font-weight: 700;
|
|
717
718
|
font-size: 18px;
|
|
718
719
|
line-height: 22px;
|
|
719
|
-
`,$n=
|
|
720
|
+
`,$n=No.p`
|
|
720
721
|
font-weight: 600;
|
|
721
722
|
font-size: 16px;
|
|
722
723
|
line-height: 24px;
|
|
@@ -724,7 +725,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
724
725
|
letter-spacing: 0.32px;
|
|
725
726
|
font-style: normal;
|
|
726
727
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
727
|
-
`,Mn=
|
|
728
|
+
`,Mn=No.p`
|
|
728
729
|
font-weight: 400;
|
|
729
730
|
font-size: 14px;
|
|
730
731
|
font-style: normal;
|
|
@@ -733,26 +734,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
733
734
|
letter-spacing: 0.28px;
|
|
734
735
|
margin: 8px 0px 0px 0px;
|
|
735
736
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
736
|
-
`,
|
|
737
|
+
`,lr=No.div`
|
|
737
738
|
width: 6px;
|
|
738
739
|
position: absolute;
|
|
739
740
|
left: 0;
|
|
740
741
|
height: 100%;
|
|
741
742
|
border-top-right-radius: 4px;
|
|
742
743
|
border-bottom-right-radius: 4px;
|
|
743
|
-
`,Dn=
|
|
744
|
+
`,Dn=No.div`
|
|
744
745
|
flex-direction: row;
|
|
745
746
|
justify-content: flex-start;
|
|
746
747
|
border-bottom: 1px solid ${e=>e.theme.colorBorder};
|
|
747
748
|
padding-right: 16px;
|
|
748
|
-
`;var Un=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:
|
|
749
|
+
`;var Un=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:s})=>{var a,d,l,m,c;return ar.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r()}},o&&ar.createElement(lr,{className:p("checklistStepItemSelectedIndicator",s),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(a=s==null?void 0:s.theme)==null?void 0:a.colorPrimary)!=null?d:i}}),ar.createElement(Dn,{className:p("checklistStepItem",s),key:`hero-checklist-step-${t}`,appearance:s,role:"listitem"},ar.createElement(sr,{value:e.complete,labelPosition:"left",label:(l=e.stepName)!=null?l:e.title,style:n,primaryColor:(c=(m=s==null?void 0:s.theme)==null?void 0:m.colorPrimary)!=null?c:i,appearance:s})))};import Dt from"react";import Vr from"styled-components";import pr from"styled-components";var gC=pr.h1`
|
|
749
750
|
display: flex;
|
|
750
751
|
margin: 0;
|
|
751
752
|
font-size: 18px;
|
|
752
|
-
`,
|
|
753
|
+
`,hC=pr.h2`
|
|
753
754
|
font-size: 15px;
|
|
754
755
|
color: #4d4d4d;
|
|
755
|
-
`,_n=
|
|
756
|
+
`,_n=pr.div`
|
|
756
757
|
position: absolute;
|
|
757
758
|
left: 0;
|
|
758
759
|
top: 0;
|
|
@@ -761,7 +762,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
761
762
|
border-radius: 20px;
|
|
762
763
|
background-color: ${e=>e.theme.colorPrimary};
|
|
763
764
|
transition: width 0.5s;
|
|
764
|
-
`,Wn=
|
|
765
|
+
`,Wn=pr.div`
|
|
765
766
|
position: relative;
|
|
766
767
|
left: 0;
|
|
767
768
|
top: 0;
|
|
@@ -771,7 +772,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
771
772
|
border-radius: 20px;
|
|
772
773
|
background-color: ${e=>e.theme.colorPrimary};
|
|
773
774
|
opacity: 0.12;
|
|
774
|
-
`;var vd=
|
|
775
|
+
`;var vd=Vr.div`
|
|
775
776
|
display: flex;
|
|
776
777
|
flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
|
|
777
778
|
justify-content: flex-start;
|
|
@@ -779,25 +780,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
779
780
|
width: 100%;
|
|
780
781
|
|
|
781
782
|
${e=>Pe(e)}
|
|
782
|
-
`,Bd=
|
|
783
|
+
`,Bd=Vr.div`
|
|
783
784
|
flex-grow: 1;
|
|
784
785
|
position: relative;
|
|
785
786
|
${e=>e.textLocation=="top"?"width: 100%;":""}
|
|
786
|
-
`,Ed=
|
|
787
|
+
`,Ed=Vr.span`
|
|
787
788
|
font-weight: 600;
|
|
788
789
|
font-size: 14px;
|
|
789
790
|
line-height: 18px;
|
|
790
791
|
padding-right: ${e=>e.padding};
|
|
791
792
|
margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
|
|
792
793
|
${e=>Pe(e)}
|
|
793
|
-
`;var We=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:
|
|
794
|
+
`;var We=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:s})=>{var g;if(t===0)return Dt.createElement(Dt.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 a=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",l=Math.round(e/t*100),m=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${l}% complete`),i==="top"&&(m="0px"),Dt.createElement(vd,{className:p("progressBarContainer",s),textLocation:i,styleOverrides:n},Dt.createElement(Ed,{className:p("progressBarStepText",s),styleOverrides:V(b({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:s,padding:m,textLocation:i},c),Dt.createElement(Bd,{textLocation:i,className:p("progressBar",s)},Dt.createElement(_n,{style:{zIndex:o=="compact"?1:5},fgWidth:a,barHeight:d,appearance:s,className:p("progressBarFill",s)}),Dt.createElement(Wn,{className:p("progressBarBackground",s),barHeight:d,appearance:s})))};import Oo from"react";import Nd from"styled-components";import cr from"react";import dr from"react";var oo=({stepData:e,appearance:t})=>dr.createElement(dr.Fragment,null,dr.createElement($n,{appearance:t,className:p("checklistStepTitle",t),dangerouslySetInnerHTML:se(e.title)}),dr.createElement(Mn,{appearance:t,className:p("checklistStepSubtitle",t),dangerouslySetInnerHTML:se(e.subtitle)}));import jr from"react";var ro=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick()},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick()};return jr.createElement(Zo,{className:p("ctaContainer",t)},jr.createElement(le,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&jr.createElement(le,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var io=({stepData:e,appearance:t})=>cr.createElement(cr.Fragment,null,cr.createElement(oo,{stepData:e,appearance:t}),cr.createElement(ro,{stepData:e,appearance:t}));import Ad from"react";function zn(e){return Ad.createElement(tt,{appearance:e.appearance,videoUri:e.videoUri,autoplay:e.autoplay})}var Gr="default",Od=Nd.img`
|
|
794
795
|
border-radius: ${e=>{var t;return(t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
|
|
795
796
|
width: 100%;
|
|
796
797
|
height: auto;
|
|
797
798
|
min-height: 200px;
|
|
798
|
-
`,Hn=({stepData:e,appearance:t})=>{if(e!=null&&e.StepContent){let
|
|
799
|
+
`,Hn=({stepData:e,appearance:t})=>{var o;if(e!=null&&e.StepContent){let i=e.StepContent;return Oo.createElement("div",null,i)}return Oo.createElement(Ln,{className:p("checklistStepContent",t)},e.imageUri?Oo.createElement(Od,{className:p("checklistStepImage",t),src:e.imageUri,style:e.imageStyle,appearance:t}):null,e.videoUri?Oo.createElement(zn,{videoUri:e.videoUri,appearance:t,autoplay:(o=e.props)==null?void 0:o.autoplayVideo}):null,Oo.createElement(io,{stepData:e,appearance:t}))};import ze,{useRef as Id,useState as Ld}from"react";import no from"styled-components";var Vn=no.div`
|
|
799
800
|
display: block;
|
|
800
|
-
`,$d=
|
|
801
|
+
`,$d=no.div`
|
|
801
802
|
display: flex;
|
|
802
803
|
flex-direction: row;
|
|
803
804
|
flex-wrap: wrap;
|
|
@@ -807,20 +808,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
807
808
|
align-content: center;
|
|
808
809
|
margin-top: 24px;
|
|
809
810
|
margin-bottom: 24px;
|
|
810
|
-
`,Md=
|
|
811
|
+
`,Md=no.div`
|
|
811
812
|
display: flex;
|
|
812
813
|
align-items: center;
|
|
813
814
|
justify-content: flex-start;
|
|
814
815
|
flex-direction: column;
|
|
815
816
|
margin-right: 16px;
|
|
816
|
-
`,Dd=
|
|
817
|
+
`,Dd=no.video`
|
|
817
818
|
width: 200px;
|
|
818
819
|
height: 120px;
|
|
819
|
-
`,Ud=
|
|
820
|
+
`,Ud=no.div`
|
|
820
821
|
font-size: 14px;
|
|
821
822
|
line-height: 20px;
|
|
822
823
|
text-align: center;
|
|
823
|
-
`,_d=
|
|
824
|
+
`,_d=no.div`
|
|
824
825
|
position: absolute;
|
|
825
826
|
width: 200px;
|
|
826
827
|
height: 120px;
|
|
@@ -840,9 +841,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
840
841
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
841
842
|
border-radius: 50%;
|
|
842
843
|
}
|
|
843
|
-
`,jn="videoCarousel",Gn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return ze.createElement(Vn,null,ze.createElement(
|
|
844
|
+
`,jn="videoCarousel",Gn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return ze.createElement(Vn,null,ze.createElement(io,{stepData:e,appearance:t}));function o({video:r}){let s=Id(),[a,d]=Ld(!1);return ze.createElement(Md,null,!a&&ze.createElement(_d,{onClick:()=>{d(!0),s.current.play()},appearance:t},ze.createElement(Ro,null)),ze.createElement(Dd,{controls:a,ref:s,play:a,src:r.uri}),ze.createElement(Ud,null,r.title))}let i=e.props;return i.videos?ze.createElement(Vn,null,ze.createElement(oo,{stepData:e,appearance:t}),ze.createElement($d,null,i.videos.map((r,s)=>ze.createElement("span",{key:`${r.uri}-${s}`},ze.createElement(o,{video:r})))),ze.createElement(ro,{stepData:e,appearance:t})):null};import dt from"react";import mr from"styled-components";var Kn=mr.div`
|
|
844
845
|
display: block;
|
|
845
|
-
`,Wd=
|
|
846
|
+
`,Wd=mr.pre`
|
|
846
847
|
display: block;
|
|
847
848
|
background-color: #2a2a2a;
|
|
848
849
|
color: #f8f8f8;
|
|
@@ -858,14 +859,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
858
859
|
white-space: -o-pre-wrap; /* Opera 7 */
|
|
859
860
|
word-wrap: break-word; /* Internet Explorer 5.5+ */
|
|
860
861
|
margin-bottom: 24px;
|
|
861
|
-
`,zd=
|
|
862
|
+
`,zd=mr.div`
|
|
862
863
|
font-size: 15px;
|
|
863
864
|
line-height: 20px;
|
|
864
865
|
margin-bottom: 12px;
|
|
865
866
|
margin-top: 12px;
|
|
866
|
-
`,Hd=
|
|
867
|
+
`,Hd=mr.div`
|
|
867
868
|
margin-top: 24px;
|
|
868
|
-
`,qn="codeSnippet",Yn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return dt.createElement(Kn,null,dt.createElement(
|
|
869
|
+
`,qn="codeSnippet",Yn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return dt.createElement(Kn,null,dt.createElement(io,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?dt.createElement(Kn,{className:p("codeSnippetContainer",t)},dt.createElement(oo,{stepData:e,appearance:t}),dt.createElement(Hd,null,o.codeSnippets.map((n,r)=>dt.createElement("div",{key:r},n.title?dt.createElement(zd,{dangerouslySetInnerHTML:se(n.title)}):null,n.code?dt.createElement(Wd,null,n.code):null))),dt.createElement(ro,{stepData:e,appearance:t})):null};var jd=wt.div`
|
|
869
870
|
display: flex;
|
|
870
871
|
flex-direction: row;
|
|
871
872
|
overflow: hidden;
|
|
@@ -906,9 +907,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
906
907
|
`,Qd=wt.div`
|
|
907
908
|
flex: 2;
|
|
908
909
|
padding: 40px 40px 40px 0px;
|
|
909
|
-
`,Zd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:
|
|
910
|
+
`,Zd=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:s="",customStepTypes:a=new Map,appearance:d,type:l})=>{let{mergeAppearanceWithDefault:m}=ne();d=m(d);let c={[Gr]:Hn,[jn]:Gn,[qn]:Yn},g=b(b({},c),a),[y,v]=Vd(0),x=n!=null?n:y,C=r!=null?r:v,F=o.filter(P=>P.complete===!0).length,S=()=>{var P;return!((P=o[x])!=null&&P.type)||!g[o[x].type]?g[Gr]({stepData:o[x],appearance:d}):typeof g[o[x].type]!="function"?g[o[x].type]:g[o[x].type]({stepData:o[x],appearance:d})};return Je.createElement(jd,{type:l,styleOverrides:i,className:s,appearance:d},Je.createElement(Yd,{className:p("checklistHeaderContainer",d),appearance:d},Je.createElement(qd,{className:p("checklistHeader",d),appearance:d},Je.createElement(Gd,{className:p("checklistTitle",d),appearance:d},e),Je.createElement(Kd,{className:p("checklistSubtitle",d),appearance:d},t),Je.createElement(We,{total:o.length,count:F,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Je.createElement(Jd,{className:p("checklistStepsContainer",d)},o.map((P,$)=>Je.createElement(Un,{data:P,index:$,key:$,listLength:o.length,isSelected:$===x,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{C($)},appearance:d})))),Je.createElement(Xd,{appearance:d,className:p("checklistDivider",d)}),Je.createElement(Qd,null,Je.createElement(S,null)))},Kr=Zd;import G,{useState as rc}from"react";import Jn from"react";import Rd from"styled-components";var ec=Rd.svg`
|
|
910
911
|
transition: 'transform 0.35s ease-in-out';
|
|
911
|
-
`,
|
|
912
|
+
`,so=({style:e,className:t})=>Jn.createElement(ec,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Jn.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));import be from"styled-components";var qr={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},Xn=be.div`
|
|
912
913
|
max-height: 350px;
|
|
913
914
|
padding-bottom: 40px;
|
|
914
915
|
`,Qn=be.div`
|
|
@@ -1121,7 +1122,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1121
1122
|
line-height: 14px;
|
|
1122
1123
|
font-weight: 400;
|
|
1123
1124
|
cursor: pointer;
|
|
1124
|
-
`;var oc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:
|
|
1125
|
+
`;var oc=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:s}=fe();return mt.createElement(gs,{style:t,className:p("guideContainer",n)},mt.createElement(xs,{className:p("guideTitle",n)},o),mt.createElement(hs,{className:p("guideItemContainer",n)},e.map((a,d)=>{var l;return mt.createElement(Cs,{key:`guide-${(l=a.id)!=null?l:d}`,className:p("guideItem",n)},a.icon&&mt.createElement(ys,{className:p("guideIcon",n)},mt.createElement(Ss,null,a.icon)),mt.createElement(bs,{className:p("guideItemTitle",n),dangerouslySetInnerHTML:se(a.title)}),mt.createElement(ws,{className:p("guideItemSubtitle",n),dangerouslySetInnerHTML:se(a.subtitle)}),mt.createElement(Ts,{className:p("guideItemLink",n),color:i,onClick:()=>{a.primaryButtonUri&&s(a),r&&r(a)}},a.primaryButtonTitle))})))},Io=oc;var ic=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:s,setSelectedStep:a,customStepTypes:d,appearance:l,guideData:m,guideTitle:c,onGuideButtonClick:g})=>{let y=({stepData:u,handleSecondaryCTAClick:A,handleCTAClick:w})=>u?G.createElement(ns,{className:p("checklistStepContainer",l),"data-testid":"checklistStepContainer"},G.createElement(ss,{appearance:l,className:p("checklistStepTitle",l),dangerouslySetInnerHTML:se(u.title)}),G.createElement(ls,{appearance:l,className:p("checklistStepSubtitle",l),dangerouslySetInnerHTML:se(u.subtitle)}),G.createElement(as,{className:p("checklistCTAContainer",l)},u.secondaryButtonTitle&&G.createElement(le,{title:u.secondaryButtonTitle,onClick:A,appearance:l,secondary:!0}),G.createElement(le,{title:u.primaryButtonTitle,onClick:w,appearance:l}))):G.createElement(G.Fragment,null),x=b(b({},{default:u=>{var I;if((I=e[S])!=null&&I.StepContent){let N=e[S].StepContent;return G.createElement("div",null,N)}let A=e[S];return G.createElement(y,{stepData:u,handleCTAClick:()=>{A.handlePrimaryButtonClick&&A.handlePrimaryButtonClick()},handleSecondaryCTAClick:()=>{A.handleSecondaryButtonClick&&A.handleSecondaryButtonClick()}})}}),d),[C,F]=rc(0),S=s!=null?s:C,P=a!=null?a:F,$=()=>{var u;return e?!((u=e[S])!=null&&u.type)||!x[e[S].type]?x.default(e[S]):typeof x[e[S].type]!="function"?x[e[S].type]:x[e[S].type]({stepData:e[S],primaryColor:l.theme.colorPrimary}):G.createElement(G.Fragment,null)},B=e.filter(u=>u.complete).length;return n?(l.theme.modalContainer||(l.theme.borderRadius&&(qr.borderRadius=l.theme.borderRadius+"px"),l.theme.modalContainer=qr),G.createElement(Re,{onClose:r,visible:n,appearance:l},G.createElement(us,null,G.createElement(Qn,null,G.createElement(Zn,{appearance:l,className:p("checklistTitle",l)},t),G.createElement(Rn,{appearance:l,className:p("checklistSubtitle",l)},o)),G.createElement(Xn,null,e&&e.length>0&&G.createElement(es,{className:p("stepsContainer",l)},G.createElement(ts,null,G.createElement("div",{style:{flex:3}},G.createElement(os,{className:p("stepsTitle",l)},i)),G.createElement(ms,null,G.createElement(We,{style:{width:"100%"},count:B,total:e.length,appearance:l}))),G.createElement(rs,null,G.createElement(is,{className:p("checklistStepListContainer",l),appearance:l},e.map((u,A)=>{var k;let w=S===A;return G.createElement(ps,{selected:w,className:p(`checklistStepListItem${w?"Selected":""}`,l),key:`checklist-guide-step-${(k=u.id)!=null?k:A}`,disabled:u.blocked,onClick:()=>{u.blocked||P(A)},title:u.blocked?"Finish remaining steps to continue":void 0},w&&G.createElement(lr,{className:p("checklistStepItemSelectedIndicator",l),layoutId:"checklist-step-selected",style:{backgroundColor:l.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),G.createElement(ds,{selected:w,className:p(`checklistStepListStepName${w?"Selected":""}`,l)},u.stepName),G.createElement(cs,null,G.createElement(at,{value:u.complete,type:"round",primaryColor:l.theme.colorPrimary,progress:u.progress,appearance:l}),G.createElement(fs,null,G.createElement(so,{style:{marginLeft:"10px"},color:l.theme.colorBackgroundSecondary}))))})),G.createElement($,null))),m&&m.length>0&&G.createElement(Io,{steps:m,title:c,primaryColor:l.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:l,onButtonClick:u=>(g&&g(u),!0)}))))):G.createElement(G.Fragment,null)},Yr=ic;import Me,{useEffect as ur,useState as nc}from"react";import Fe from"react";import ut from"styled-components";var Fs=ut.div`
|
|
1125
1126
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1126
1127
|
border: 1px solid;
|
|
1127
1128
|
border-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
|
|
@@ -1166,17 +1167,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1166
1167
|
:hover {
|
|
1167
1168
|
opacity: 0.8;
|
|
1168
1169
|
}
|
|
1169
|
-
`,
|
|
1170
|
+
`,f0=ut.div``,As=ut.p`
|
|
1170
1171
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1171
1172
|
font-weight: 400;
|
|
1172
1173
|
font-size: 14px;
|
|
1173
1174
|
line-height: 22px;
|
|
1174
|
-
`,
|
|
1175
|
+
`,Ns=ut.div`
|
|
1175
1176
|
display: flex;
|
|
1176
1177
|
flex-direction: row;
|
|
1177
1178
|
justify-content: flex-start;
|
|
1178
1179
|
align-items: center;
|
|
1179
|
-
`;var
|
|
1180
|
+
`;var Os=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:s})=>{var c,g;let a=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.35s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.7s ease-out"};function l(){var y,v;return Fe.createElement(Fe.Fragment,null,e.imageUri||e.videoUri?Fe.createElement(ks,{className:p("stepMediaContainer",r)},e.imageUri?Fe.createElement(Ps,{className:p("stepImage",r),src:e.imageUri,style:e.imageStyle}):null,e.videoUri?Fe.createElement(tt,{appearance:r,videoUri:e.videoUri,autoplay:(y=e.props)==null?void 0:y.autoplayVideo}):null):null,Fe.createElement(As,{className:p("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:se(e.subtitle)}),Fe.createElement(Zo,{className:p("checklistCTAContainer",r)},e.secondaryButtonTitle?Fe.createElement(le,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,Fe.createElement(le,{title:(v=e.primaryButtonTitle)!=null?v:"Continue",onClick:()=>i(),appearance:r})))}function m(){if(!s)return null;let y=s[e.type];return y?typeof y!="function"?y:y(e,r):null}return Fe.createElement(Fs,{"data-testid":`step-${e.id}`,className:p("checklistStepContainer",r),appearance:r},Fe.createElement(vs,{className:p("stepHeader",r),onClick:()=>o()},Fe.createElement(Ns,null,Fe.createElement(sr,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),Fe.createElement(Bs,{appearance:r,className:p("stepTitle",r),dangerouslySetInnerHTML:se(e.title)})),Fe.createElement(Es,{className:p("stepChevronContainer",r),appearance:r},Fe.createElement(so,{style:V(b({},a),{transition:"transform 0.2s ease-in-out"})}))),Fe.createElement("div",{key:e.id,style:b({},d)},(g=m())!=null?g:l()))};import lo from"styled-components";var B0=lo.div`
|
|
1180
1181
|
background: #ffffff;
|
|
1181
1182
|
box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
|
|
1182
1183
|
border-radius: 6px;
|
|
@@ -1190,26 +1191,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1190
1191
|
|
|
1191
1192
|
max-width: 800px;
|
|
1192
1193
|
min-width: 350px;
|
|
1193
|
-
`,Is=
|
|
1194
|
+
`,Is=lo.div`
|
|
1194
1195
|
display: flex;
|
|
1195
1196
|
flex-direction: column;
|
|
1196
|
-
`,Ls=
|
|
1197
|
+
`,Ls=lo.h1`
|
|
1197
1198
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
|
|
1198
1199
|
font-style: normal;
|
|
1199
1200
|
font-weight: 700;
|
|
1200
1201
|
font-size: 20px;
|
|
1201
1202
|
line-height: 24px;
|
|
1202
1203
|
margin-bottom: 8px;
|
|
1203
|
-
`,$s=
|
|
1204
|
+
`,$s=lo.h2`
|
|
1204
1205
|
color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
|
|
1205
1206
|
font-weight: 400;
|
|
1206
1207
|
font-size: 14px;
|
|
1207
1208
|
line-height: 23px;
|
|
1208
1209
|
margin: 2px 0 0 0;
|
|
1209
|
-
`,Ms=
|
|
1210
|
+
`,Ms=lo.div`
|
|
1210
1211
|
display: block;
|
|
1211
1212
|
width: 100%;
|
|
1212
|
-
`,Ds=
|
|
1213
|
+
`,Ds=lo.div`
|
|
1213
1214
|
display: flex;
|
|
1214
1215
|
width: 100%;
|
|
1215
1216
|
flex-direction: column;
|
|
@@ -1217,7 +1218,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1217
1218
|
padding: 24px;
|
|
1218
1219
|
border-radius: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
|
|
1219
1220
|
background-color: ${e=>{var t,o;return(o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
|
|
1220
|
-
`;var sc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:
|
|
1221
|
+
`;var sc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:s=!0,autoExpandNextStep:a=!0,selectedStep:d,setSelectedStep:l,appearance:m,type:c,className:g,customStepTypes:y,style:v})=>{let x=o.filter(B=>B.complete).length,[C,F]=nc(Array(o.length).fill(!0));ur(()=>{let B=[...C];if(r){for(let u=0;u<o.length;u++)if(!o[u].complete){B[u]=!1;break}F(B)}},[]),ur(()=>{r&&S(d)},[d]),ur(()=>{a&&C[d]&&S(d)},[d]),ur(()=>{},[o]);let S=B=>{let u=[...C];if(s)for(let A=0;A<C.length;++A)A!=B&&u[B]&&(u[A]=!0);u[B]=!C[B],F(u)};if(!n&&c=="modal")return Me.createElement(Me.Fragment,null);let P=Me.createElement(Me.Fragment,null,Me.createElement(Is,null,Me.createElement(Ls,{appearance:m,className:p("checklistTitle",m),dangerouslySetInnerHTML:se(e)}),Me.createElement($s,{appearance:m,className:p("checklistSubtitle",m),dangerouslySetInnerHTML:se(t)})),Me.createElement(We,{display:"percent",count:x,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:m})),$=Me.createElement(Ms,{className:Te(p("checklistContainer",m),g)},o.map((B,u)=>{var w;let A=C[u];return Me.createElement(Os,{appearance:m,stepData:B,collapsed:A,key:`modal-checklist-${(w=B.id)!=null?w:u}`,onClick:()=>{d==u?S(u):l(u)},onPrimaryButtonClick:()=>{a&&u<o.length-1&&l(u+1),B.handlePrimaryButtonClick&&B.handlePrimaryButtonClick()},onSecondaryButtonClick:()=>{B.handleSecondaryButtonClick&&B.handleSecondaryButtonClick()},customStepTypes:y})}));return c==="inline"?Me.createElement(Ds,{appearance:m,className:Te(p("checklistInlineContainer",m),g),style:v},P,$):Me.createElement(Me.Fragment,null,Me.createElement(Re,{onClose:i,visible:n,appearance:m,style:{maxWidth:"600px"},headerContent:P},$))},Jr=sc;import xe,{useEffect as Xr,useRef as fc,useState as Ut}from"react";import{useEffect as lc,useState as ac}from"react";var Us=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([a])=>[a,!1])),[o,i]=ac(t),n=null,r=()=>{n!==null?clearTimeout(n):s(),n=setTimeout(()=>{s()},16)},s=()=>{let a=Object.fromEntries(Object.entries(e).map(([d,l])=>{if(!window)return[d,!1];let m=window.matchMedia(l);return m.addEventListener("change",r),[d,m.matches]}));i(a)};return lc(()=>{s()},[]),o};import ao from"react";import ye,{css as _s,keyframes as Ws}from"styled-components";var zs=_s`
|
|
1221
1222
|
border: 1px solid ${({theme:e})=>e.colorBorder};
|
|
1222
1223
|
`,pc=_s`
|
|
1223
1224
|
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
|
|
@@ -1305,12 +1306,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1305
1306
|
|
|
1306
1307
|
background: ${({theme:e})=>e.colorBackground};
|
|
1307
1308
|
}
|
|
1308
|
-
`,
|
|
1309
|
+
`,G0=ye.div`
|
|
1309
1310
|
color: ${({theme:e})=>e.colorPrimary};
|
|
1310
1311
|
display: flex;
|
|
1311
1312
|
flex-flow: row nowrap;
|
|
1312
1313
|
align-items: center;
|
|
1313
|
-
`,
|
|
1314
|
+
`,K0=ye.div`
|
|
1314
1315
|
white-space: nowrap;
|
|
1315
1316
|
`,Xs=ye.div`
|
|
1316
1317
|
background: #d8fed8;
|
|
@@ -1359,7 +1360,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1359
1360
|
color: ${({theme:e})=>e.colorTextSecondary};
|
|
1360
1361
|
${e=>e.blocked||e.complete?"opacity: 0.4;":`
|
|
1361
1362
|
`}
|
|
1362
|
-
`;var tl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=
|
|
1363
|
+
`;var tl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ne(),{primaryCTAClickSideEffects:n}=fe();o=i(o);let{imageUri:r=null,subtitle:s=null,title:a=null,complete:d=!1,blocked:l=!1}=e,m=e.primaryButtonTitle||e.secondaryButtonTitle,c=()=>{n(e)};return ao.createElement(qs,{className:p("carouselCard",o),onClick:l?null:c,style:t,blocked:l,complete:d},r&&ao.createElement(Ys,{className:p("carouselCardImage",o),src:r,alt:a,style:{opacity:d||l?.4:1}}),d&&ao.createElement(Xs,{className:p("carouselCompletedPill",o)},ao.createElement(el,{style:{color:"#108E0B"}},"Complete")),a&&ao.createElement(Rs,{blocked:l,complete:d,className:p("carouselCardTitle",o)},a),s&&ao.createElement(Tt.Quiet,{blocked:l,complete:d,className:p("carouselCardSubtitle",o)},s))};var gc=()=>xe.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xe.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),xe.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),xe.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),ol=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=Ut(!1),[r,s]=Ut(!1);Xr(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&s(!0)},[t]);let a=()=>{n(!1),s(!1)},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?xe.createElement(js,{style:d,reversed:r,onAnimationEnd:r?a:null},xe.createElement(Gs,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},xe.createElement(gc,null))):null},rl=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=fc(null),[r,s]=Ut(!1),[a,d]=Ut(!1),[l,m]=Ut(null),[c,g]=Ut([]),[y,v]=Ut(0),{isSmall:x}=Us(),C=x?1:3,{getFlowMetadata:F,getFlowSteps:S,getNumberOfStepsCompleted:P,updateCustomVariables:$,isLoading:B}=te();Xr(()=>{$(o)},[o,B]),Xr(()=>{if(B)return;let N=F(e),O=P(e),H=S(e);m(N),(N.data!==null||N.steps!==null)&&(g(H.sort((_,R)=>Number(_.complete)-Number(R.complete))),d(H.length>C),v(O))},[B]);let u=[];for(let N=0;N<c.length;N+=C)u.push(c.slice(N,N+C));let A=N=>{let O=N.target,H=O.scrollWidth-O.clientWidth,_=Math.ceil(O.scrollLeft);_>0&&r===!1&&s(!0),_===0&&r===!0&&s(!1),_<H&&a===!1&&d(!0),_===H&&a===!0&&d(!1)},w=(N=!0)=>{let O=N?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*O,behavior:"smooth"})},k=null,I=N=>{k!==null?clearTimeout(k):A(N),k=setTimeout(()=>{A(N)},16)};return B?null:xe.createElement(Js,{className:Te(p("carouselContainer",t),i)},xe.createElement("div",{style:{display:"flex",justifyContent:x?"center":"space-between",marginBottom:20,flexWrap:x?"wrap":"nowrap",gap:x?16:20}},xe.createElement("div",null,xe.createElement(Qs,{className:p("carouselTitle",t)},l==null?void 0:l.title),xe.createElement(Tt.Quiet,{className:p("carouselSubtitle",t)},l==null?void 0:l.subtitle)),xe.createElement(Zs,{className:p("progressWrapper",t)},xe.createElement(We,{count:y,total:c.length,appearance:t}))),xe.createElement("div",{style:{position:"relative"}},xe.createElement(ol,{show:r,onClick:()=>w(!1)}),xe.createElement(ol,{side:"right",show:a,onClick:w}),xe.createElement(Hs,{ref:n,onScroll:I},u.map((N,O)=>xe.createElement(Vs,{key:O,style:{flex:`0 0 calc(100% - ${c.length>C?36:0}px)`}},N.map((H,_)=>xe.createElement(tl,{key:_,stepData:H,style:{flex:c.length>C?`0 1 calc(100% / ${C} - 16px * 2 / ${C})`:1},appearance:t})))))),xe.createElement(oe,{appearance:t}))};var Qr=$=>{var B=$,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:s="inline",onDismiss:a,visible:d,customVariables:l,onStepCompletion:m,onButtonClick:c,appearance:g,hideOnFlowCompletion:y,setVisible:v,customStepTypes:x,checklistStyle:C="default",autoExpandFirstIncompleteStep:F,autoExpandNextStep:S}=B,P=Le(B,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:u,getFlowSteps:A,markStepCompleted:w,getStepStatus:k,getNumberOfStepsCompleted:I,isLoading:N,targetingLogicShouldHideFlow:O,updateCustomVariables:H,getFlowMetadata:_,isStepBlocked:R,getFlowStatus:J,hasActiveFullPageFlow:ee,setHasActiveFullPageFlow:K,markStepStarted:Y,getCurrentStepIndex:de}=te(),{primaryCTAClickSideEffects:we,secondaryCTAClickSideEffects:Ie}=fe(),{getOpenFlowState:ce,setOpenFlowState:pe}=Ee(),[M,X]=il(n||0),[ke,He]=il(!1),ue=d===void 0?ce(e):d,me=s==="modal",{mergeAppearanceWithDefault:j}=ne();Ve(e,d);let z=A(e),L=de(e);if(g=j(g),fr(()=>{H(l)},[l,N]),fr(()=>{d!==void 0&&(me&&d===!0?K(!0):me&&d===!1&&K(!1))},[d,v,ee]),fr(()=>{!N&&z&&z[M]&&k(e,z[M].id)&&k(e,z[M].id)!==$e&&Y(e,z[M].id)},[M]),fr(()=>{M!==L&&X(L)},[L]),N)return null;let W=u(e);if(!W||O(W)||!z||y===!0&&J(e)===ie)return null;let re=_(e);if(re!=null&&re.title&&(t=re.title),re!=null&&re.subtitle&&(o=re.subtitle),!ke&&n===void 0&&I(e)>0){let f=z.findIndex(T=>T.complete===!1);X(f>-1?f:z.length-1),He(!0)}function Ge(){if(M+1>=z.length){me&&pe(e,!1);return}R(e,z[M+1].id)||X(M+1)}function Xe(f,T,U){let ge=M+1<z.length?z[M+1]:null;c&&c(f,M,T,ge)===!0&&me&&qe(),m&&m(f,U,ge),!m&&!c&&(f.primaryButtonUri||f.secondaryButtonUri)&&me&&qe()}function Pt(){return z.map((f,T)=>V(b({},f),{handleSecondaryButtonClick:()=>{Ge(),Ie(f),f.skippable===!0&&w(e,f.id,{skipped:!0}),Xe(f,"secondary",T)},handlePrimaryButtonClick:()=>{(!f.completionCriteria&&(f.autoMarkCompleted||f.autoMarkCompleted===void 0)||f.completionCriteria&&f.autoMarkCompleted===!0)&&(w(e,f.id),Ge()),Xe(f,"primary",T),we(f),k(e,f.id)===$e&&Ge()}}))}function Ke(){return Se.createElement(oe,{appearance:g})}let ht={steps:Pt(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:x,type:s,className:r,autoExpandFirstIncompleteStep:F,autoExpandNextStep:S};function qe(){pe(e,!1),a&&a(),v&&v(!1)}function zt(){return Se.createElement(Se.Fragment,null,Se.createElement(Ke,null),Se.createElement(rl,{flowId:e,appearance:g,customVariables:l,className:r}))}function Ht(){return Se.createElement(Se.Fragment,null,Se.createElement(Ke,null),Se.createElement(Jr,b({visible:ue,onClose:()=>{qe()},selectedStep:M,setSelectedStep:X,autoExpandNextStep:!0,appearance:g},ht)))}function Vt(){var U;let f=P.guideFlowId,T;return f&&u(f)&&(T=A(f)),Se.createElement(Se.Fragment,null,Se.createElement(Ke,null),Se.createElement(Yr,b({visible:ue,stepsTitle:re.stepsTitle?re.stepsTitle:"Your quick start guide",onClose:()=>{qe()},selectedStep:M,setSelectedStep:X,guideData:T,guideTitle:(U=P.guideTitle)!=null?U:"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:ge=>{Xe(ge,"link",0)},customStepTypes:x},ht)))}function h(){let f=Se.createElement(Kr,b({flowId:e,style:i,selectedStep:M,setSelectedStep:X,appearance:g,type:s},ht));return me?Se.createElement(Re,{onClose:()=>{qe()},visible:ue,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},Se.createElement(Ke,null),f):Se.createElement(Se.Fragment,null,Se.createElement(Ke,null),f)}switch(C){case"condensed":return Ht();case"with-guide":return Vt();case"default":return h();case"carousel":return zt();default:return h()}};var xc=e=>hc.createElement(Qr,b({type:"inline"},e));import kt,{useEffect as Cc}from"react";import rt from"react";import gr from"styled-components";var nl=gr.div`
|
|
1363
1364
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1364
1365
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1365
1366
|
padding: 10px 12px 10px 12px;
|
|
@@ -1371,27 +1372,27 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1371
1372
|
&:hover {
|
|
1372
1373
|
filter: brightness(.99);
|
|
1373
1374
|
}
|
|
1374
|
-
`,sl=
|
|
1375
|
+
`,sl=gr.div`
|
|
1375
1376
|
display: flex;
|
|
1376
1377
|
flex-direction: row;
|
|
1377
1378
|
justify-content: space-between;
|
|
1378
1379
|
align-items: center;
|
|
1379
1380
|
margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
|
|
1380
1381
|
flex-grow: 2;
|
|
1381
|
-
`,ll=
|
|
1382
|
+
`,ll=gr.div`
|
|
1382
1383
|
text-overflow: ellipsis;
|
|
1383
1384
|
font-weight: 600;
|
|
1384
1385
|
font-size: 14px;
|
|
1385
1386
|
line-height: 16px;
|
|
1386
1387
|
margin-right: ${e=>e.type==="condensed"?"8px":"0"};
|
|
1387
1388
|
text-align: ${e=>e.type==="condensed"?"left":"right"};
|
|
1388
|
-
`,al=
|
|
1389
|
+
`,al=gr.div`
|
|
1389
1390
|
width: 20px;
|
|
1390
1391
|
margin-right: 8px;
|
|
1391
1392
|
display: flex;
|
|
1392
1393
|
height: 100%;
|
|
1393
1394
|
align-items: center;
|
|
1394
|
-
`;var pl=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:
|
|
1395
|
+
`;var pl=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:s,type:a="default"})=>rt.createElement(rt.Fragment,null,rt.createElement(oe,{appearance:s}),rt.createElement(nl,{onClick:()=>i!==void 0&&i(),styleOverrides:b(b({},a=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:Te(r!=null?r:"",p("progressBadgeContainer",s)),appearance:s},a=="condensed"&&o&&o!==0&&rt.createElement(al,{className:p("progressRingContainer",s)},rt.createElement(Jt,{size:19,percentage:t/o,fillColor:s.theme.colorPrimary,bgColor:s.theme.colorBackgroundSecondary})),rt.createElement(sl,{type:a,className:p("badgeTitleContainer",s)},rt.createElement(ll,{type:a,appearance:s,className:p("badgeTitle",s)},e),i!==void 0&&rt.createElement(so,{className:p("badgeChevron",s),color:s.theme.colorPrimary})),a=="default"&&o&&o!==0&&rt.createElement(We,{display:"compact",count:t,total:o,bgColor:s.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:s,textStyle:{color:"#818898"}})));import Ft from"react";import Lo from"styled-components";var dl=Lo.div`
|
|
1395
1396
|
display: flex;
|
|
1396
1397
|
flex-direction: row;
|
|
1397
1398
|
width: 100%;
|
|
@@ -1401,25 +1402,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1401
1402
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1402
1403
|
border: 1px solid ${e=>e.appearance.theme.colorBorder};
|
|
1403
1404
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1404
|
-
`,cl=
|
|
1405
|
+
`,cl=Lo.div`
|
|
1405
1406
|
${e=>E(e)} {
|
|
1406
1407
|
display: flex;
|
|
1407
1408
|
justify-content: center;
|
|
1408
1409
|
align-items: center;
|
|
1409
1410
|
margin-right: 16px;
|
|
1410
1411
|
}
|
|
1411
|
-
`,ml=
|
|
1412
|
+
`,ml=Lo.div`
|
|
1412
1413
|
display: flex;
|
|
1413
1414
|
flex-direction: column;
|
|
1414
1415
|
flex: 1;
|
|
1415
1416
|
margin-top: 0;
|
|
1416
|
-
`,ul=
|
|
1417
|
+
`,ul=Lo.div`
|
|
1417
1418
|
display: flex;
|
|
1418
1419
|
flex-direction: column;
|
|
1419
1420
|
justify-content: center;
|
|
1420
1421
|
margin-left: 16px;
|
|
1421
1422
|
min-width: 200px;
|
|
1422
|
-
`,
|
|
1423
|
+
`,YS=Lo.div`
|
|
1423
1424
|
display: flex;
|
|
1424
1425
|
justify-content: center;
|
|
1425
1426
|
align-items: flex-end;
|
|
@@ -1428,7 +1429,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1428
1429
|
:hover {
|
|
1429
1430
|
opacity: 0.8;
|
|
1430
1431
|
}
|
|
1431
|
-
`;var fl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:
|
|
1432
|
+
`;var fl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:s,style:a})=>Ft.createElement(Ft.Fragment,null,Ft.createElement(dl,{appearance:i,className:Te(p("fullWidthProgressBadgeContainer",i),s!=null?s:""),style:a},o&&Ft.createElement(cl,{className:p("fullWidthProgressBadgeIcon",i)},o),Ft.createElement(ml,null,Ft.createElement(Ne,{size:"small",appearance:i,title:e,subtitle:t})),Ft.createElement(ul,{className:p("fullWidthProgressBadgeProgressContainer",i)},Ft.createElement(We,{count:n,total:r,display:"percent",textLocation:"top"}))));var yc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:s,customVariables:a,hideOnFlowCompletion:d,appearance:l,type:m="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:y,getNumberOfStepsCompleted:v,isLoading:x,targetingLogicShouldHideFlow:C,updateCustomVariables:F}=te(),{mergeAppearanceWithDefault:S}=ne();l=S(l);let{setOpenFlowState:P,getOpenFlowState:$}=Ee();if(Cc(()=>{F(a)},[a,x]),x)return null;let B=c(e);if(!B||C(B)||d===!0&&y(e)===ie)return null;let u=g(e),A=v(e);return m==="full-width"?kt.createElement(kt.Fragment,null,kt.createElement(oe,{appearance:l}),kt.createElement(fl,{title:t,subtitle:o,count:A,total:u.length,style:n,className:s,appearance:l,icon:i,onClick:()=>{}})):kt.createElement(kt.Fragment,null,kt.createElement(oe,{appearance:l}),kt.createElement(pl,{count:A,total:u.length,title:t,style:n,onClick:()=>{P(e,!0),r&&r()},type:m,className:s,appearance:l}))};import Sc from"react";var bc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Le(r,["flowId","style","appearance"]);let{getFlow:s,targetingLogicShouldHideFlow:a,getFlowSteps:d}=te(),{mergeAppearanceWithDefault:l}=ne();o=l(o);let m=s(e);if(!m||a(m))return null;let c=d(e);return Sc.createElement(Io,b({steps:c,style:t,appearance:o},i))};import ft,{useContext as Lc,useEffect as $c}from"react";import q,{useEffect as po,useLayoutEffect as xl,useRef as vc,useState as co}from"react";import $o from"styled-components";import{useCallback as wc,useEffect as Tc,useState as Fc}from"react";var Zr=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,s=n=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+s,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+s,y:e.top-i.y+r}:{x:0,y:0}};function gl(e,t){let o="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[i,n]=Fc(o),r=wc(()=>{e&&n(e.getBoundingClientRect())},[e]);return Tc(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}import{useContext as kc,useState as Pc}from"react";function hl(){let{debug:e}=kc(Z),[t,o]=Pc([]);function i(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.log(r)))}function n(r){e&&(t.find(s=>s===r)||(o([...t,r]),console.warn(r)))}return{logIfDebugMode:i,logErrorIfDebugMode:n}}var Cl=300,yl=100,Bc=500,mo=12,Ec=$o.div`
|
|
1432
1433
|
width: 100%;
|
|
1433
1434
|
height: 100%;
|
|
1434
1435
|
border-radius: 9999px;
|
|
@@ -1451,25 +1452,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1451
1452
|
opacity: 0;
|
|
1452
1453
|
}
|
|
1453
1454
|
}
|
|
1454
|
-
`,Ac
|
|
1455
|
-
width: ${
|
|
1456
|
-
height: ${
|
|
1455
|
+
`,Ac=$o.div`
|
|
1456
|
+
width: ${mo}px;
|
|
1457
|
+
height: ${mo}px;
|
|
1457
1458
|
border-radius: 100px;
|
|
1458
1459
|
background-color: ${e=>e.primaryColor};
|
|
1459
1460
|
z-index: 20;
|
|
1460
1461
|
opacity: 1;
|
|
1461
|
-
`,
|
|
1462
|
+
`,Nc=$o.div`
|
|
1462
1463
|
pointer-events: all;
|
|
1463
|
-
`,Sl
|
|
1464
|
+
`,Sl=$o.div`
|
|
1464
1465
|
display: flex;
|
|
1465
1466
|
align-content: center;
|
|
1466
1467
|
justify-content: center;
|
|
1467
1468
|
align-items: center;
|
|
1468
1469
|
z-index: ${e=>e.zIndex?e.zIndex:90};
|
|
1469
|
-
`,
|
|
1470
|
-
width: ${
|
|
1471
|
-
height: ${
|
|
1472
|
-
`,Ic=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:
|
|
1470
|
+
`,Oc=$o(Sl)`
|
|
1471
|
+
width: ${mo+12}px;
|
|
1472
|
+
height: ${mo+12}px;
|
|
1473
|
+
`,Ic=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:s={x:0,y:0},visible:a=!0,containerStyle:d={},selectedStep:l=0,customStepTypes:m,appearance:c,dismissible:g=!1,showHighlightOnly:y,showStepCount:v=!0,completedStepsCount:x=0,showFrigadeBranding:C=!1,cssPosition:F="absolute",onViewTooltip:S,className:P})=>{var Pt,Ke,ht,qe,zt,Ht,Vt,h,f,T,U,ge,xt,vt,Bt,he,fo,go,si;let{logErrorIfDebugMode:$}=hl(),[B,u]=co(),[A,w]=co(new Date),k=vc(null),[I,N]=co(document.querySelector(e[l].selector)),O=gl(I,A),[H,_]=co(),[R,J]=co(!y),ee=(Ke=(Pt=e[l])==null?void 0:Pt.props)!=null&&Ke.position?e[l].props.position:F,K=(zt=(qe=(ht=e[l])==null?void 0:ht.props)==null?void 0:qe.zIndex)!=null?zt:90,Y=(Ht=B==null?void 0:B.width)!=null?Ht:Cl,de=(Vt=B==null?void 0:B.height)!=null?Vt:yl,[we,Ie]=co(new Date().getTime());s=(T=(f=(h=e[l])==null?void 0:h.props)==null?void 0:f.offset)!=null?T:s;let ce=window.location.pathname.split("/").pop();xl(()=>{k.current&&u({width:k.current.clientWidth,height:k.current.clientHeight})},[l,A,ee]),po(()=>{y||J(!0)},[l]),po(()=>{a&&R&&S(l)},[R]);let pe=()=>{if(ee==="static")return;let Q=document.querySelector(e[l].selector);if(!Q){_(void 0),N(null),$(`FrigadeTour: Could not find element with selector "${e[l].selector}" for step ${e[l].id}`);return}H&&H===JSON.stringify(Q==null?void 0:Q.getBoundingClientRect())||(N(Q),w(new Date),Q&&_(JSON.stringify(Q.getBoundingClientRect())))};if(po(()=>{let Q=new MutationObserver(pe);return Q.observe(document.body,{subtree:!0,childList:!0}),()=>Q.disconnect()},[pe]),po(()=>{let Q=new MutationObserver(pe);return Q.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>Q.disconnect()},[pe]),po(()=>{let Q=setInterval(()=>{pe()},10);return()=>clearInterval(Q)},[pe]),xl(()=>{setTimeout(()=>{pe()},Bc),pe()},[l,ce]),po(()=>{if(!a)return;let Q=Qe=>{Qe.key==="Escape"&&t()};return document.addEventListener("keydown",Q),()=>{document.removeEventListener("keydown",Q)}},[]),I===null||!a)return null;let M=i==="auto"?"right":i,X=Zr(O,M,Y,s,ee),ke=O.right+Y>(window.innerWidth||document.documentElement.clientWidth),He=O.bottom+yl>(window.innerHeight||document.documentElement.clientHeight);ke&&i==="auto"&&(X=Zr(O,"left",Y,s,ee),M="left"),(ge=(U=e[l])==null?void 0:U.props)!=null&&ge.tooltipPosition&&((vt=(xt=e[l])==null?void 0:xt.props)==null?void 0:vt.tooltipPosition)!=="auto"&&(((he=(Bt=e[l])==null?void 0:Bt.props)==null?void 0:he.tooltipPosition)==="left"||((go=(fo=e[l])==null?void 0:fo.props)==null?void 0:go.tooltipPosition)==="right")&&(M=e[l].props.tooltipPosition);let ue=()=>{let Q=()=>{if(e[l].handlePrimaryButtonClick&&(e[l].handlePrimaryButtonClick(),J(!1),setTimeout(()=>{pe()},30)),x===e.length-1)return o()},Qe=()=>{e[l].handleSecondaryButtonClick&&(e[l].handleSecondaryButtonClick(),y&&!e[l].secondaryButtonUri&&J(!1))};return q.createElement(q.Fragment,null,v&&e.length>1&&q.createElement(Ti,null,q.createElement(ki,{role:"status",className:p("tooltipStepCounter",c)},l+1," of ",e.length)),(e[l].primaryButtonTitle||e[l].secondaryButtonTitle)&&q.createElement(Fi,{showStepCount:v,className:p("tooltipCTAContainer",c)},e[l].secondaryButtonTitle&&q.createElement(le,{title:e[l].secondaryButtonTitle,appearance:c,onClick:Qe,size:"small",withMargin:!1,secondary:!0}),e[l].primaryButtonTitle&&q.createElement(le,{title:e[l].primaryButtonTitle,appearance:c,onClick:Q,autoFocus:!0,withMargin:!1,size:"small"})))},me=()=>{var Q;return q.createElement(q.Fragment,null,g&&q.createElement(Ci,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t()},className:p("tooltipClose",c),hasImage:!!e[l].imageUri||!!e[l].videoUri,"aria-label":"Close Tooltip",role:"button",tabIndex:0},q.createElement(Ae,null)),e[l].imageUri&&q.createElement(yi,{dismissible:g,appearance:c,role:"img","aria-label":e[l].title,src:e[l].imageUri,className:p("tooltipImageContainer",c)}),e[l].videoUri&&!e[l].imageUri&&q.createElement(Si,{dismissible:g,appearance:c,role:"video","aria-label":e[l].title,className:p("tooltipVideoContainer",c)},q.createElement(tt,{appearance:c,videoUri:e[l].videoUri,autoplay:(Q=e[l].props)==null?void 0:Q.autoplayVideo})),q.createElement(wi,{className:p("tooltipContentContainer",c)},q.createElement(Ne,{appearance:c,title:e[l].title,subtitle:e[l].subtitle,size:"small",ariaPrefix:`Tooltip${e[l].id}`}),q.createElement(bi,{className:p("tooltipFooter",c)},q.createElement(ue,null))))},z=b(b({},{default:Q=>{var Qe;if((Qe=e[l])!=null&&Qe.StepContent){let ia=e[l].StepContent;return q.createElement("div",null,ia)}return q.createElement(me,null)}}),m),L=()=>{var Q;return e?!((Q=e[l])!=null&&Q.type)||!z[e[l].type]?z.default(e[l]):z[e[l].type]({stepData:e[l],primaryColor:r}):q.createElement(q.Fragment,null)};if(e[l].complete===!0||X.x==0&&X.y==0&&new Date().getTime()-we<100)return null;let W={top:(X==null?void 0:X.y)-mo,left:(si=M=="left"?O.x+s.x:(X==null?void 0:X.x)-mo)!=null?si:0,cursor:y?"pointer":"default",position:ee},re=()=>{let Qe=W.left+(M=="left"?-Y:24);return Math.min(Math.max(Qe,20),window.innerWidth-Y-20)},Ge=()=>{if(ee==="fixed")return W.top;let Q=W.top+de,Qe=20;return Q>window.innerHeight-Qe?W.top+-de:W.top},Xe=()=>{y&&(w(new Date),J(!R))};return q.createElement(Nc,{className:P},q.createElement(Oc,{style:W,zIndex:K,className:p("tourHighlightContainer",c)},n&&e[l].showHighlight!==!1&&F!=="static"&&q.createElement(q.Fragment,null,q.createElement(Ac,{style:{position:ee},onClick:Xe,primaryColor:c.theme.colorPrimary,className:p("tourHighlightInnerCircle",c)}),q.createElement(Ec,{style:{position:"absolute"},onClick:Xe,primaryColor:c.theme.colorPrimary,className:p("tourHighlightOuterCircle",c)}))),q.createElement(Sl,{style:V(b({},W),{left:re(),top:Ge()}),zIndex:K+1,className:p("tooltipContainerWrapper",c)},R&&q.createElement(q.Fragment,null,q.createElement(Ho,{ref:k,role:"dialog","aria-labelledby":`frigadeTooltip${e[l].id}Title`,"aria-describedby":`frigadeTooltip${e[l].id}Subtitle`,layoutId:"tooltip-container",tabIndex:0,"aria-label":"Tooltip",style:b({position:"relative",width:"max-content",right:0,top:F!=="static"?12:0},d),appearance:c,className:p("tooltipContainer",c),maxWidth:Cl,zIndex:K+10},q.createElement(L,null)),C&&q.createElement(vi,{className:p("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:K+10},q.createElement(Vo,{appearance:c})))))},Mo=Ic;import{Portal as Mc}from"react-portal";var Dc=C=>{var F=C,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:s,dismissible:a,tooltipPosition:d="auto",showHighlightOnly:l=!1,dismissBehavior:m="complete-flow",onComplete:c,skipIfNotFound:g=!1,cssPosition:y="absolute",className:v}=F,x=Le(F,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition","className"]);let{getFlow:S,getFlowSteps:P,isLoading:$,targetingLogicShouldHideFlow:B,markStepCompleted:u,markStepStarted:A,markFlowCompleted:w,updateCustomVariables:k,getCurrentStepIndex:I,getStepStatus:N,isStepBlocked:O,getFlowStatus:H,getNumberOfStepsCompleted:_}=te(),{isLoadingUserFlowStateData:R}=Ue(),{primaryCTAClickSideEffects:J,secondaryCTAClickSideEffects:ee}=fe(),{hasOpenModals:K}=Ee(),Y=I(e),{openFlowStates:de}=Lc(Z),{mergeAppearanceWithDefault:we}=ne();if(o=we(o),$c(()=>{k(t)},[t,$]),R)return null;let Ie=S(e);if(!Ie||B(Ie)||H(e)==ie||K())return null;let ce=P(e);if(Object.keys(de).length>0){let L=Object.keys(de).find(W=>de[W]===!0);if(L!==void 0&&L!==e)return ft.createElement(ft.Fragment,null)}function pe(L){return D(this,null,function*(){if(yield u(e,L.id),ce.map(W=>N(e,W.id)).every(W=>W===$e)){yield w(e);return}!l&&Y+1<ce.length&&!r&&O(e,ce[Y+1].id)})}function M(L,W,re){let Ge=Y+1<ce.length?ce[Y+1]:null;n&&n(L,Y,W,Ge),i&&i(L,re,Ge)}function X(){return ce.map(L=>V(b({},L),{handleSecondaryButtonClick:()=>D(this,null,function*(){ee(L),L.skippable===!0&&(yield u(e,L.id,{skipped:!0})),M(L,"secondary",Y)}),handlePrimaryButtonClick:()=>D(this,null,function*(){(!L.completionCriteria&&(L.autoMarkCompleted||L.autoMarkCompleted===void 0)||L.completionCriteria&&L.autoMarkCompleted===!0)&&(yield pe(L)),M(L,"primary",Y),J(L)})}))}function ke(L){return D(this,null,function*(){s&&s(),m==="complete-flow"?yield w(e):yield u(e,L.id)})}function He(){c&&c()}function ue(L){return D(this,null,function*(){yield A(e,ce[L].id)})}let me=!document.querySelector(ce[Y].selector);function j(){let L=ce.findIndex((W,re)=>!!document.querySelector(W.selector)&&re>=Y);return ce.map((W,re)=>r?ft.createElement(Mo,b({key:W.id,appearance:o,steps:X(),selectedStep:re,showTooltipsSimultaneously:r,dismissible:a,onDismiss:()=>ke(W),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:_(e),onComplete:He,cssPosition:y,onViewTooltip:ue,className:v},x)):g&&me&&re===L?ft.createElement(Mo,b({key:W.id,appearance:o,steps:X(),selectedStep:re,showTooltipsSimultaneously:r,dismissible:a,onDismiss:()=>ke(W),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:_(e),onComplete:He,cssPosition:y,onViewTooltip:ue,className:v},x)):re!=Y?null:ft.createElement(Mo,b({key:W.id,appearance:o,steps:X(),selectedStep:re,showTooltipsSimultaneously:r,dismissible:a,onDismiss:()=>ke(W),tooltipPosition:d,showHighlightOnly:l,completedStepsCount:_(e),onComplete:He,cssPosition:y,onViewTooltip:ue,className:v},x)))}function z(){return ft.createElement(ft.Fragment,null,ft.createElement(oe,{appearance:o}),j())}return y==="static"?z():ft.createElement(Mc,null,z())};import Oe,{useEffect as Uc,useRef as _c,useState as Wc}from"react";import{Portal as zc}from"react-portal";import _t from"styled-components";var bl=_t.button`
|
|
1473
1474
|
${e=>E(e)} {
|
|
1474
1475
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1475
1476
|
|
|
@@ -1487,17 +1488,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1487
1488
|
opacity: 0.8;
|
|
1488
1489
|
}
|
|
1489
1490
|
}
|
|
1490
|
-
`,wl=
|
|
1491
|
+
`,wl=_t.span`
|
|
1491
1492
|
${e=>E(e)} {
|
|
1492
1493
|
font-size: 12px;
|
|
1493
1494
|
display: inline-block;
|
|
1494
1495
|
}
|
|
1495
|
-
`,Tl=
|
|
1496
|
+
`,Tl=_t.span`
|
|
1496
1497
|
${e=>E(e)} {
|
|
1497
1498
|
font-size: 12px;
|
|
1498
1499
|
display: inline-block;
|
|
1499
1500
|
}
|
|
1500
|
-
`,Fl=
|
|
1501
|
+
`,Fl=_t.div`
|
|
1501
1502
|
position: fixed;
|
|
1502
1503
|
right: 0;
|
|
1503
1504
|
bottom: 0;
|
|
@@ -1507,7 +1508,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1507
1508
|
flex-direction: column;
|
|
1508
1509
|
align-items: flex-end;
|
|
1509
1510
|
z-index: 50;
|
|
1510
|
-
`,kl=
|
|
1511
|
+
`,kl=_t.button`
|
|
1511
1512
|
${e=>E(e)} {
|
|
1512
1513
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1513
1514
|
background-color: #ffffff;
|
|
@@ -1523,7 +1524,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1523
1524
|
0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
1524
1525
|
border-radius: 45px;
|
|
1525
1526
|
cursor: pointer;
|
|
1526
|
-
`,Pl=
|
|
1527
|
+
`,Pl=_t.div`
|
|
1527
1528
|
${e=>E(e)} {
|
|
1528
1529
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1529
1530
|
background: #ffffff;
|
|
@@ -1540,7 +1541,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1540
1541
|
position: ${e=>e.type=="inline"?"absolute":"relative"};
|
|
1541
1542
|
top: ${e=>e.type=="inline"?"68px":0};
|
|
1542
1543
|
margin-left: ${e=>e.type=="inline"?"-127px":0};
|
|
1543
|
-
`,vl=
|
|
1544
|
+
`,vl=_t.button`
|
|
1544
1545
|
${e=>E(e)} {
|
|
1545
1546
|
// Anything inside this block will be ignored if the user provides a custom class
|
|
1546
1547
|
color: #434343;
|
|
@@ -1557,7 +1558,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1557
1558
|
font-size: 14px;
|
|
1558
1559
|
|
|
1559
1560
|
padding: 8px 12px;
|
|
1560
|
-
`;import Bl from"react";var El=({style:e,className:t})=>Bl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Bl.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import Al from"react";var
|
|
1561
|
+
`;import Bl from"react";var El=({style:e,className:t})=>Bl.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Bl.createElement("path",{fill:"currentColor",d:"M13.43 4.938a4.494 4.494 0 00-1.043-1.435A4.955 4.955 0 009 2.197c-1.276 0-2.48.464-3.387 1.305A4.502 4.502 0 004.57 4.938a4.242 4.242 0 00-.386 1.773v.475c0 .109.087.197.196.197h.95a.197.197 0 00.197-.197V6.71c0-1.749 1.557-3.17 3.473-3.17s3.473 1.421 3.473 3.17c0 .718-.254 1.393-.738 1.955a3.537 3.537 0 01-1.9 1.125 1.928 1.928 0 00-1.085.682c-.271.343-.42.768-.42 1.206v.552c0 .109.088.197.197.197h.95a.197.197 0 00.196-.197v-.552c0-.276.192-.519.457-.578a4.904 4.904 0 002.625-1.56c.335-.392.597-.828.778-1.3a4.256 4.256 0 00-.103-3.303zM9 13.834a.985.985 0 10.001 1.97.985.985 0 00-.001-1.97z"}));import Al from"react";var Nl=({style:e,className:t})=>Al.createElement("svg",{style:e,className:t,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor"},Al.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"}));var Hc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:s})=>{let{getFlow:a,getFlowSteps:d,markStepCompleted:l,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y}=te(),{primaryCTAClickSideEffects:v}=fe(),x=_c(null),[C,F]=Wc(!1),{mergeAppearanceWithDefault:S}=ne();s=S(s),Uc(()=>(document.addEventListener("click",P,!1),()=>{document.removeEventListener("click",P,!1)}),[]);let P=w=>{x.current&&!x.current.contains(w.target)&&F(!1)};if(g)return null;let $=a(e);if(!$||y($))return null;let B=d(e);if(!B||!i)return null;function u(w,k){!w.completionCriteria&&(w.autoMarkCompleted||w.autoMarkCompleted===void 0)&&l(e,w.id),v(w),o&&o(w,k),F(!1)}function A(){return C&&Oe.createElement(Pl,{className:p("floatingWidgetMenu",s),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},B.map((w,k)=>Oe.createElement(vl,{className:p("floatingWidgetMenuItem",s),key:k,onClick:()=>u(w,k)},w.title)))}return n=="inline"?Oe.createElement("span",{ref:x},Oe.createElement(oe,{appearance:s}),Oe.createElement(bl,{style:t,onClick:()=>{F(!C)},className:p("supportButton",s)},Oe.createElement(Tl,{className:p("supportIconContainer",s)},Oe.createElement(Nl,{className:p("supportIcon",s),style:{width:"18px",height:"18px"}})),Oe.createElement(wl,{className:p("supportButtonTitle",s)},r)),Oe.createElement(A,null)):Oe.createElement(zc,null,Oe.createElement(oe,{appearance:s}),Oe.createElement(Fl,{style:t,ref:x},Oe.createElement(A,null),Oe.createElement(kl,{onClick:()=>{F(!C)},whileHover:{scale:1.1},className:p("floatingWidgetButton",s)},Oe.createElement(El,{className:p("floatingWidgetButtonIcon",s),style:{display:"flex",width:"20px",height:"20px"}}))))};import it,{useEffect as Vc}from"react";import hr from"styled-components";var Ol=hr.div`
|
|
1561
1562
|
${e=>E(e)} {
|
|
1562
1563
|
display: flex;
|
|
1563
1564
|
flex-direction: column;
|
|
@@ -1572,17 +1573,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1572
1573
|
border-radius: 12px;
|
|
1573
1574
|
position: relative;
|
|
1574
1575
|
}
|
|
1575
|
-
`,Il=
|
|
1576
|
+
`,Il=hr.div`
|
|
1576
1577
|
display: flex;
|
|
1577
1578
|
flex-direction: column;
|
|
1578
1579
|
flex: 1;
|
|
1579
|
-
`,Ll=
|
|
1580
|
+
`,Ll=hr.div`
|
|
1580
1581
|
display: flex;
|
|
1581
1582
|
flex-direction: column;
|
|
1582
1583
|
justify-content: center;
|
|
1583
1584
|
align-items: flex-start;
|
|
1584
1585
|
margin-top: 16px;
|
|
1585
|
-
`,$l=
|
|
1586
|
+
`,$l=hr.div`
|
|
1586
1587
|
${e=>E(e)} {
|
|
1587
1588
|
position: absolute;
|
|
1588
1589
|
top: 16px;
|
|
@@ -1593,7 +1594,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1593
1594
|
opacity: 0.8;
|
|
1594
1595
|
}
|
|
1595
1596
|
}
|
|
1596
|
-
`;var jc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:
|
|
1597
|
+
`;var jc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:a})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowSteps:v,getFlowStatus:x,getCurrentStepIndex:C}=te(),{primaryCTAClickSideEffects:F}=fe(),{mergeAppearanceWithDefault:S}=ne();if(Ve(e),n=S(n),Vc(()=>{y(o)},[o,c]),c)return null;let P=d(e);if(!P||g(P)||x(e)===ie)return null;let B=v(e)[C(e)];return it.createElement(it.Fragment,null,it.createElement(oe,{appearance:n}),it.createElement(Ol,{appearance:n,className:Te(p("embeddedTipContainer",n),r),style:s},(a===!0||B.dismissible)&&it.createElement($l,{onClick:()=>D(void 0,null,function*(){yield l(e),t&&t()}),className:p("embeddedTipDismissButton",n)},it.createElement(Ae,null)),it.createElement(Il,null,it.createElement(Ne,{size:"small",appearance:n,title:B.title,subtitle:B.subtitle})),B.primaryButtonTitle&&it.createElement(Ll,{className:p("embeddedTipCallToActionContainer",n)},it.createElement(le,{classPrefix:"embeddedTip",title:B.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>D(void 0,null,function*(){B.handlePrimaryButtonClick(),F(B),!(i&&i(B,C(e),"primary")===!1)&&(yield m(e,B.id),yield l(e))})}))))};import ve,{useEffect as Gc}from"react";import uo from"styled-components";var Ml=uo.div`
|
|
1597
1598
|
// use the :not annotation
|
|
1598
1599
|
${e=>E(e)} {
|
|
1599
1600
|
display: flex;
|
|
@@ -1605,24 +1606,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1605
1606
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1606
1607
|
border-radius: 12px;
|
|
1607
1608
|
}
|
|
1608
|
-
`,Dl=
|
|
1609
|
+
`,Dl=uo.div`
|
|
1609
1610
|
${e=>E(e)} {
|
|
1610
1611
|
display: flex;
|
|
1611
1612
|
width: 46px;
|
|
1612
1613
|
height: 46px;
|
|
1613
1614
|
}
|
|
1614
|
-
`,Ul=
|
|
1615
|
+
`,Ul=uo.div`
|
|
1615
1616
|
display: flex;
|
|
1616
1617
|
flex-direction: column;
|
|
1617
1618
|
flex: 1;
|
|
1618
1619
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1619
1620
|
margin-top: ${e=>e.type==="square"?"12px":"0"};
|
|
1620
|
-
`,_l=
|
|
1621
|
+
`,_l=uo.div`
|
|
1621
1622
|
display: flex;
|
|
1622
1623
|
flex-direction: column;
|
|
1623
1624
|
justify-content: center;
|
|
1624
1625
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1625
|
-
`,
|
|
1626
|
+
`,Rr=uo.div`
|
|
1626
1627
|
display: flex;
|
|
1627
1628
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1628
1629
|
align-items: flex-end;
|
|
@@ -1630,12 +1631,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1630
1631
|
:hover {
|
|
1631
1632
|
opacity: 0.8;
|
|
1632
1633
|
}
|
|
1633
|
-
`,
|
|
1634
|
+
`,ei=uo.div`
|
|
1634
1635
|
display: flex;
|
|
1635
1636
|
justify-content: ${e=>e.type==="square"?"flex-end":"center"};
|
|
1636
1637
|
align-items: flex-end;
|
|
1637
1638
|
margin-left: ${e=>e.type==="square"?"0px":"16px"};
|
|
1638
|
-
`;import
|
|
1639
|
+
`;import ti from"react";var Wl=({style:e,className:t})=>ti.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},ti.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),ti.createElement("path",{stroke:"#0171F8",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M32 18.5l-2.25-1.313M32 18.5v2.25m0-2.25l-2.25 1.313M14 18.5l2.25-1.313M14 18.5l2.25 1.313M14 18.5v2.25m9 3l2.25-1.313M23 23.75l-2.25-1.313M23 23.75V26m0 6.75l2.25-1.313M23 32.75V30.5m0 2.25l-2.25-1.313m0-16.875L23 13.25l2.25 1.313M32 25.25v2.25l-2.25 1.313m-13.5 0L14 27.5v-2.25"}));var Kc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:s,type:a="full-width",icon:d})=>{let{getFlow:l,markFlowCompleted:m,isLoading:c,targetingLogicShouldHideFlow:g,updateCustomVariables:y,getFlowMetadata:v,getFlowStatus:x,getFlowSteps:C,getCurrentStepIndex:F}=te(),{primaryCTAClickSideEffects:S}=fe(),{mergeAppearanceWithDefault:P}=ne();if(Ve(e),s=P(s),Gc(()=>{y(n)},[n,c]),c)return null;let $=l(e);if(!$||g($)||x(e)===ie)return null;let B=C(e),u=B.length>0?B[F(e)]:v(e);return u!=null&&u.title&&(t=u.title),u!=null&&u.subtitle&&(o=u.subtitle),ve.createElement(ve.Fragment,null,ve.createElement(oe,{appearance:s}),ve.createElement(Ml,{type:a,appearance:s,className:p("bannerContainer",s)},a!="square"&&ve.createElement(Dl,{className:p("bannerIconContainer",s)},d||ve.createElement(Wl,null)),a==="square"&&u.dismissible&&ve.createElement(ei,{type:a,className:p("bannerDismissButtonContainer",s)},ve.createElement(Rr,{type:a,onClick:()=>D(void 0,null,function*(){yield m(e),i&&i()}),className:p("bannerDismissButton",s)},ve.createElement(Ae,null))),ve.createElement(Ul,{type:a},ve.createElement(Ne,{appearance:s,title:t,subtitle:o,classPrefix:"banner"})),(u==null?void 0:u.primaryButtonTitle)&&ve.createElement(_l,{type:a,className:p("bannerCallToActionContainer",s)},ve.createElement(le,{title:u==null?void 0:u.primaryButtonTitle,appearance:s,onClick:()=>{S(u),r&&r(u,0,"primary")},classPrefix:"banner"})),a!=="square"&&u.dismissible&&ve.createElement(ei,{type:a,className:p("bannerDismissButtonContainer",s)},ve.createElement(Rr,{type:a,onClick:()=>D(void 0,null,function*(){yield m(e),i&&i()}),className:p("bannerDismissButton",s)},ve.createElement(Ae,null)))))};import ae,{useEffect as qc}from"react";import{Portal as Yc}from"react-portal";import gt from"styled-components";var zl=gt.div`
|
|
1639
1640
|
display: flex;
|
|
1640
1641
|
flex-direction: column;
|
|
1641
1642
|
width: 100%;
|
|
@@ -1678,7 +1679,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1678
1679
|
display: flex;
|
|
1679
1680
|
justify-content: center;
|
|
1680
1681
|
align-items: center;
|
|
1681
|
-
`,
|
|
1682
|
+
`,oi=gt.div`
|
|
1682
1683
|
display: flex;
|
|
1683
1684
|
justify-content: space-between;
|
|
1684
1685
|
margin-top: 16px;
|
|
@@ -1687,18 +1688,18 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1687
1688
|
display: flex;
|
|
1688
1689
|
justify-content: space-between;
|
|
1689
1690
|
margin-top: 8px;
|
|
1690
|
-
`,
|
|
1691
|
+
`,ri=gt.div`
|
|
1691
1692
|
font-size: 12px;
|
|
1692
1693
|
line-height: 18px;
|
|
1693
1694
|
color: ${e=>e.appearance.theme.colorTextDisabled};
|
|
1694
1695
|
font-style: normal;
|
|
1695
1696
|
font-weight: 400;
|
|
1696
1697
|
letter-spacing: 0.24px;
|
|
1697
|
-
`,
|
|
1698
|
+
`,ii=gt.div`
|
|
1698
1699
|
display: flex;
|
|
1699
1700
|
flex-direction: column;
|
|
1700
1701
|
flex: 1;
|
|
1701
|
-
`,
|
|
1702
|
+
`,hw=gt.div`
|
|
1702
1703
|
display: flex;
|
|
1703
1704
|
flex-direction: column;
|
|
1704
1705
|
justify-content: center;
|
|
@@ -1728,7 +1729,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1728
1729
|
opacity: 0.8;
|
|
1729
1730
|
}
|
|
1730
1731
|
}
|
|
1731
|
-
`;var Jc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:
|
|
1732
|
+
`;var Jc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,type:a="modal"})=>{let{getFlow:d,markFlowCompleted:l,markStepCompleted:m,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:v,getFlowSteps:x,getFlowStatus:C,getFlowMetadata:F}=te(),{primaryCTAClickSideEffects:S}=fe(),{mergeAppearanceWithDefault:P}=ne(),[$,B]=ae.useState(null),[u,A]=ae.useState(""),w=F(e),{hasOpenModals:k,setKeepCompletedFlowOpenDuringSession:I,shouldKeepCompletedFlowOpenDuringSession:N}=Ee();if(Ve(e),n=P(n),qc(()=>{v(o)},[o,g]),g)return null;let O=d(e);if(!O||y(O)||C(e)===ie||c(e)===1&&!N(e)||k())return null;let _=x(e)[c(e)];function R(){var K,Y;return ae.createElement(ae.Fragment,null,ae.createElement(ii,null,ae.createElement(Ne,{size:"large",appearance:n,title:_.title,subtitle:_.subtitle})),ae.createElement(oi,{className:p("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(de=>ae.createElement(Hl,{className:p("npsNumberButton",n),selected:$===de+1,key:de,onClick:()=>D(this,null,function*(){I(e),B(de+1),yield m(e,_.id,{score:de+1})}),appearance:n},de+1))),ae.createElement(Vl,{appearance:n},ae.createElement(ri,{appearance:n},(K=w==null?void 0:w.negativeLabel)!=null?K:"Not likely at all"),ae.createElement(ri,{appearance:n},(Y=w==null?void 0:w.positiveLabel)!=null?Y:"Extremely likely")))}function J(){var K;return ae.createElement(ae.Fragment,null,ae.createElement(ii,null,ae.createElement(Ne,{appearance:n,title:(K=_.title)!=null?K:"Why did you choose this score?",size:"large"})),ae.createElement(jl,{appearance:n,value:u,onChange:Y=>{A(Y.target.value)},placeholder:"Add your optional feedback here..."}),ae.createElement(oi,{appearance:n,className:p("npsNumberButtonContainer",n)},ae.createElement(le,{size:"large",withMargin:!1,onClick:()=>D(this,null,function*(){yield l(e),i&&i(_,1,"primary")}),appearance:n,title:_.secondaryButtonTitle||"Skip",secondary:!0}),ae.createElement(le,{size:"large",withMargin:!1,onClick:()=>D(this,null,function*(){yield m(e,_.id,{feedbackText:u}),yield l(e),i&&i(_,1,"primary")}),appearance:n,title:_.primaryButtonTitle||"Submit"})))}function ee(){return c(e)>=2?null:ae.createElement(ae.Fragment,null,ae.createElement(oe,{appearance:n}),ae.createElement(zl,{appearance:n,className:Te(p("npsSurveyContainer",n),r),style:s,type:a},ae.createElement(Gl,{onClick:()=>D(this,null,function*(){yield l(e),t&&t()}),className:p("npsSurveyDismissButton",n)},ae.createElement(Ae,null)),c(e)==0&&R(),c(e)==1&&J()))}return a==="inline"?ee():ae.createElement(Yc,null,ee())};import Be,{useEffect as Zc}from"react";import Wt from"styled-components";var Kl=Wt.div`
|
|
1732
1733
|
${e=>E(e)} {
|
|
1733
1734
|
display: flex;
|
|
1734
1735
|
flex-direction: column;
|
|
@@ -1739,21 +1740,21 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1739
1740
|
background-color: ${e=>e.appearance.theme.colorBackground};
|
|
1740
1741
|
position: relative;
|
|
1741
1742
|
}
|
|
1742
|
-
`,ql=
|
|
1743
|
+
`,ql=Wt.div`
|
|
1743
1744
|
display: flex;
|
|
1744
1745
|
flex-direction: column;
|
|
1745
1746
|
flex: 1;
|
|
1746
|
-
`,Yl=
|
|
1747
|
+
`,Yl=Wt.div`
|
|
1747
1748
|
display: flex;
|
|
1748
1749
|
flex-direction: row;
|
|
1749
1750
|
justify-content: center;
|
|
1750
1751
|
align-items: stretch;
|
|
1751
1752
|
gap: 16px;
|
|
1752
1753
|
margin-top: 8px;
|
|
1753
|
-
`,Jl=
|
|
1754
|
+
`,Jl=Wt.div`
|
|
1754
1755
|
margin-top: 16px;
|
|
1755
1756
|
margin-bottom: 16px;
|
|
1756
|
-
`,Xl=
|
|
1757
|
+
`,Xl=Wt.div`
|
|
1757
1758
|
${e=>E(e)} {
|
|
1758
1759
|
position: absolute;
|
|
1759
1760
|
top: -16px;
|
|
@@ -1764,7 +1765,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1764
1765
|
opacity: 0.8;
|
|
1765
1766
|
}
|
|
1766
1767
|
}
|
|
1767
|
-
`,Ql=
|
|
1768
|
+
`,Ql=Wt.h1`
|
|
1768
1769
|
${e=>E(e)} {
|
|
1769
1770
|
font-style: normal;
|
|
1770
1771
|
justify-content: center;
|
|
@@ -1778,7 +1779,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1778
1779
|
color: ${e=>e.appearance.theme.colorText};
|
|
1779
1780
|
margin-bottom: 8px;
|
|
1780
1781
|
}
|
|
1781
|
-
`,Zl=
|
|
1782
|
+
`,Zl=Wt.h2`
|
|
1782
1783
|
${e=>E(e)} {
|
|
1783
1784
|
font-style: normal;
|
|
1784
1785
|
justify-content: center;
|
|
@@ -1795,5 +1796,5 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${yo}${t}.${yo}${t} { ${Object.entries(o).map
|
|
|
1795
1796
|
height: 100%;
|
|
1796
1797
|
min-height: 200px;
|
|
1797
1798
|
border-radius: ${e=>e.appearance.theme.borderRadius}px;
|
|
1798
|
-
`;function ea({stepData:e,appearance:t,classPrefix:o=""}){return e.videoUri?Rl.createElement(tt,{appearance:t,videoUri:e.videoUri}):e.imageUri?Rl.createElement(Qc,{className:
|
|
1799
|
+
`;function ea({stepData:e,appearance:t,classPrefix:o=""}){var i;return e.videoUri?Rl.createElement(tt,{appearance:t,videoUri:e.videoUri,autoplay:(i=e.props)==null?void 0:i.autoplayVideo}):e.imageUri?Rl.createElement(Qc,{className:p(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Rc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:s,dismissible:a=!0,modalPosition:d="center"})=>{let{getFlow:l,markFlowCompleted:m,markStepCompleted:c,isLoading:g,targetingLogicShouldHideFlow:y,updateCustomVariables:v,getFlowSteps:x,getFlowStatus:C,getCurrentStepIndex:F}=te(),{primaryCTAClickSideEffects:S,secondaryCTAClickSideEffects:P}=fe(),{mergeAppearanceWithDefault:$}=ne(),{setOpenFlowState:B,getOpenFlowState:u,hasOpenModals:A}=Ee();Ve(e);let[w,k]=[u(e,!0),J=>B(e,J)];if(n=$(n),Zc(()=>{v(o)},[o,g]),g)return null;let I=l(e);if(!I||y(I)||C(e)===ie||A())return null;let O=x(e)[F(e)],H=()=>{k(!1),t&&t(),m(e)};function _(){return Be.createElement(Be.Fragment,null,Be.createElement(oe,{appearance:n}),Be.createElement(Kl,{appearance:n,className:Te(p("announcementContainer",n),r),style:s},(a===!0||O.dismissible)&&d=="inline"&&Be.createElement(Xl,{onClick:()=>D(this,null,function*(){yield m(e),t&&t()}),className:p("announcementDismissButton",n)},Be.createElement(Ae,null)),Be.createElement(ql,null,Be.createElement(Ql,{appearance:n,className:p("announcementTitle",n),dangerouslySetInnerHTML:se(O.title)}),O.subtitle&&Be.createElement(Zl,{appearance:n,className:p("announcementSubtitle",n),dangerouslySetInnerHTML:se(O.subtitle)})),(O.imageUri||O.videoUri)&&Be.createElement(Jl,{className:p("announcementMediaContainer",n)},Be.createElement(ea,{appearance:n,stepData:O})),(O.primaryButtonTitle||O.secondaryButtonTitle)&&Be.createElement(Yl,{className:p("announcementCTAContainer",n)},O.secondaryButtonTitle&&Be.createElement(le,{classPrefix:"announcement",title:O.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>D(this,null,function*(){O.handleSecondaryButtonClick(),P(O),i&&i(O,F(e),"secondary")}),secondary:!0}),O.primaryButtonTitle&&Be.createElement(le,{classPrefix:"announcement",title:O.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>D(this,null,function*(){O.handlePrimaryButtonClick(),S(O),!(i&&i(O,F(e),"primary")===!1)&&(yield c(e,O.id),yield m(e))})}))))}let R={padding:"24px",maxWidth:"400px"};return d==="inline"?_():d!=="center"?Be.createElement(Ko,{modalPosition:d,onClose:H,visible:w,dismissible:a,appearance:n},_()):Be.createElement(Re,{appearance:n,onClose:H,visible:w,style:R,dismissible:a},_())};import*as xr from"react";import ta from"react";var oa=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Le(r,["as","children","variant"]);return ta.createElement(vn,b({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},em=Object.fromEntries(Object.keys(rr).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>ta.createElement(oa,V(b({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),ni=Object.assign(oa,em);var ra=s=>{var a=s,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=a,r=Le(a,["as","className","size","title","variant"]);var d;return xr.createElement(Pn,b({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),xr.createElement(ni,{color:(d=Eo[n])==null?void 0:d.color,fontWeight:"semibold"},i))},tm=Object.fromEntries(Object.keys(Eo).map(e=>{let t=o=>xr.createElement(ra,V(b({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),om=Object.assign(ra,tm);export{Bo as Box,om as Button,at as CheckBox,Sr as FlowType,yt as FormLabel,Nr as FormTextField,Rc as FrigadeAnnouncement,Kc as FrigadeBanner,Qr as FrigadeChecklist,lt as FrigadeDefaultAppearance,jc as FrigadeEmbeddedTip,yn as FrigadeForm,bc as FrigadeGuide,xc as FrigadeHeroChecklist,Jc as FrigadeNPSSurvey,yc as FrigadeProgressBadge,kd as FrigadeProvider,Hc as FrigadeSupportWidget,Dc as FrigadeTour,We as ProgressBar,Jt as ProgressRing,ni as Text,ir as tokens,Ee as useFlowOpens,Co as useFlowResponses,te as useFlows,Hr as useOrganization,yo as useUser,Ue as useUserFlowStates};
|
|
1799
1800
|
//# sourceMappingURL=index.mjs.map
|