@frigade/react 1.38.34 → 1.38.36

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.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- import * as Y from 'react';
3
- import Y__default, { createContext, useContext, useState, useEffect, useCallback, useRef, useMemo, useLayoutEffect } from 'react';
4
- import xe, { createGlobalStyle, css, keyframes, useTheme, ThemeProvider } from 'styled-components';
2
+ import * as q from 'react';
3
+ import q__default, { createContext, useContext, useState, useEffect, useCallback, useRef, useMemo, useLayoutEffect } from 'react';
4
+ import Ce, { createGlobalStyle, css, keyframes, useTheme, ThemeProvider } from 'styled-components';
5
5
  import xa from 'swr';
6
6
  import Ca from 'swr/immutable';
7
7
  import wo from 'core-js-pure/actual/structured-clone';
@@ -11,7 +11,7 @@ import { z } from 'zod';
11
11
  import mp from 'dompurify';
12
12
  import { compose, border, color, shadow, space, typography, system, variant, get } from 'styled-system';
13
13
 
14
- var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnPropertyDescriptors;var Ho=Object.getOwnPropertySymbols;var gi=Object.prototype.hasOwnProperty,hi=Object.prototype.propertyIsEnumerable;var fi=(e,t,o)=>t in e?la(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,w=(e,t)=>{for(var o in t||(t={}))gi.call(t,o)&&fi(e,o,t[o]);if(Ho)for(var o of Ho(t))hi.call(t,o)&&fi(e,o,t[o]);return e},j=(e,t)=>aa(e,pa(t));var xi=e=>typeof e=="symbol"?e:e+"",$e=(e,t)=>{var o={};for(var i in e)gi.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Ho)for(var i of Ho(e))t.indexOf(i)<0&&hi.call(e,i)&&(o[i]=e[i]);return o};var $=(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());});var Ci="1.38.34";var st="NOT_STARTED_STEP",de="COMPLETED_FLOW",Nt="SKIPPED_FLOW",Ot="STARTED_FLOW",Ue="NOT_STARTED_FLOW",_e="COMPLETED_STEP",So="STARTED_STEP";function Re(){let{publicApiKey:e,userId:t,apiUrl:o}=Y__default.useContext(ie);return {config:useMemo(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Ci,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:useMemo(()=>`${o}/v1/public/`,[o])}}var da="frigade-last-call-at-",ca="frigade-last-call-data-";function Kt(){let{shouldGracefullyDegrade:e,readonly:t}=Y__default.useContext(ie);return (o,i)=>$(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Gt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Gt();let n=da+o,r=ca+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 Gt()}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 Gt(p)}return l?l.ok?l:Gt(l.statusText):Gt()})}function Gt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function qt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=Y__default.useContext(ie);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return {verifySDKInitiated:o}}function ma(e){return new Promise(t=>setTimeout(t,e))}function bo(e,t,o,i={}){function n(r){let l=o-1;if(!l)throw r;return ma(t).then(()=>bo(e,t,l,i))}return fetch(e,i).catch(n)}function Ie(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=useContext(ie);function r(c,g=!1){var b;return (b=e[c])!=null?b:g}function l(c,g){t(b=>j(w({},b),{[c]:g}));}function p(c){t(g=>{let x=g,F=$e(x,[xi(c)]);return w({},F)});}function d(c){n.includes(c)||i(g=>[...g,c]);}function s(c){return n.includes(c)}function f(c){return Object.entries(e).some(([g,b])=>b&&g!=c)||o}return {getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:f,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}function Tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ue(...e){let t=e.shift(),o=e.length===1?e[0]:ue(...e);if(!Tr(t)||!Tr(o))throw new Error("deepmerge can only merge Objects");let i=wo(t);return Object.entries(o).forEach(([n,r])=>{Tr(r)?i[n]!==void 0?Object.assign(i,{[n]:ue(i[n],wo(r))}):Object.assign(i,{[n]:wo(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...wo(r)]}):Object.assign(i,{[n]:wo(r)}):Object.assign(i,{[n]:r});}),i}function Yt(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var ya="unknown";function ze(){let{config:e,apiUrl:t}=Re(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=useContext(ie),{resetOpenFlowState:d}=Ie(),[s,f]=useState(!1),c={data:r.map(I=>({flowId:I.id,flowState:de,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},g=I=>bo(I,100,2,e).then(B=>{if(B.ok)return B.json();throw new Error("Failed to fetch user flow states")}).catch(B=>(console.error(`Error fetching ${I}: ${B}. Will gracefully degrade and hide Frigade`),l(!0),c)),b=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:F,isLoading:x,mutate:h,error:P}=p?Ca(b,g):xa(b,g,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),S=F==null?void 0:F.data;useEffect(()=>{!s&&!x&&S&&f(!0);},[S,s,x]);function N(I){return $(this,null,function*(){if(S&&!p){let B=S.find(v=>v.flowId===I);B&&B.flowState!==de&&(B.flowState=de),yield h(Promise.resolve(ue(F,{data:S})),{optimisticData:ue(F,{data:S}),revalidate:!1,rollbackOnError:!1});}})}function U(I){return $(this,null,function*(){if(S&&!p){let B=S.find(v=>v.flowId===I);B&&B.flowState!==Nt&&(B.flowState=Nt),yield h(Promise.resolve(ue(F,{data:S})),{optimisticData:ue(F,{data:S}),revalidate:!1,rollbackOnError:!1});}})}function T(I,B,v){return $(this,null,function*(){var L,_,K;if(S){let z=S.find(J=>J.flowId===I);if(z){let J=r.find(R=>R.slug===I),G=Yt(J==null?void 0:J.data),O=(_=(L=G==null?void 0:G.steps)!=null?L:G==null?void 0:G.data)!=null?_:[],te=O.findIndex(R=>R.id===B),q=O&&O.length>te+1?O[te+1]:null;q&&((K=z.stepStates[q.id])!=null&&K.hidden||(z.lastStepId=q.id)),z.stepStates[B]=v,z.flowState=Ot;}p||(yield h(Promise.resolve(ue(F,{data:S})),{optimisticData:ue(F,{data:S}),revalidate:!1,rollbackOnError:!1}));}})}function u(I,B,v){return $(this,null,function*(){if(S){let L=S.find(_=>_.flowId===I);L&&(L.lastStepId=B,L.stepStates[B]=v,L.flowState=Ot),p||(yield h(ue(F,{data:S}),{optimisticData:ue(F,{data:S}),revalidate:!1,rollbackOnError:!1}));}})}function A(I){return $(this,null,function*(){if(S){let B=S.find(v=>v.flowId===I);B&&B.flowState!==Ue&&(B.flowState=Ue,B.lastStepId=ya,Object.keys(B.stepStates).forEach(v=>{B.stepStates[v].actionType=st,B.stepStates[v].createdAt=new Date().toISOString();}),yield h(ue(F,{data:S}),{optimisticData:ue(F,{data:S}),revalidate:!1,rollbackOnError:!1}),d(I));}})}function C(I,B,v){return $(this,null,function*(){if(S){let L=S.find(_=>_.flowId===I);L&&(L.stepStates[B]=v),yield h(Promise.resolve(ue(F,{data:S})),{optimisticData:ue(F,{data:S}),revalidate:!1,rollbackOnError:!1});}})}return {userFlowStatesData:S,isLoadingUserFlowStateData:!s,mutateUserFlowState:h,optimisticallyMarkFlowCompleted:N,optimisticallyMarkFlowSkipped:U,optimisticallyMarkFlowNotStarted:A,optimisticallyMarkStepCompleted:T,optimisticallyMarkStepNotStarted:C,optimisticallyMarkStepStarted:u,error:P}}function To(){let{config:e,apiUrl:t}=Re(),{userFlowStatesData:o,mutateUserFlowState:i}=ze(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=useContext(ie),[d,s]=useState(new Set),[f,c]=useState(new Set),g=Kt();function b(h){let P=JSON.stringify(h);if(d.has(P))return null;d.add(P),s(d),f.add(h),c(f);let S=l==null?void 0:l.find(N=>N.flowSlug===h.flowSlug&&N.stepId===h.stepId&&N.actionType===h.actionType&&N.createdAt===h.createdAt);return g(`${t}flowResponses`,j(w({},e),{method:"POST",body:P})).then(N=>{N.status!==200&&N.status!==201?(console.log("Failed to send flow response for step "+h.stepId+". Will retry again later."),r([...n,h])):S||p(U=>[...U!=null?U:[],h]);})}function F(h){return $(this,null,function*(){h.foreignUserId&&(h.actionType===Ot||h.actionType===Ue?yield b(h):h.actionType===de?yield b(h):h.actionType===So?yield b(h):h.actionType===_e?yield b(h):h.actionType===Nt?yield b(h):h.actionType===st&&(yield b(h)));})}function x(){let h=[];return o==null||o.forEach(P=>{if(P&&P.stepStates&&Object.keys(P.stepStates).length!==0)for(let S in P.stepStates){let N=P.stepStates[S];h.push({foreignUserId:P.foreignUserId,flowSlug:P.flowId,stepId:N.stepId,actionType:N.actionType,data:{},createdAt:new Date(N.createdAt),blocked:N.blocked,hidden:N.hidden});}}),[...h,...l]}return {addResponse:F,setFlowResponses:p,getFlowResponses:x}}var ba=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,bi=e=>{let t=ba.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=wa(i,"'","");r.startsWith("flow_")&&(o=r);}),o},wa=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};var Fr=(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))(Fr||{});function se(){let{config:e,apiUrl:t}=Re(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:f,setFlowResponses:c,setShouldGracefullyDegrade:g,shouldGracefullyDegrade:b,readonly:F,flowDataOverrides:x}=useContext(ie),h={data:[]},{verifySDKInitiated:P}=qt(),{addResponse:S,getFlowResponses:N}=To(),U=m=>bo(m,100,2,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${m} (${y.status}): ${y.statusText}. Will gracefully degrade and hide Frigade`),g(!0),h)).catch(y=>(console.log(`Error fetching ${m}: ${y}. Will gracefully degrade and hide Frigade`),g(!0),h)),{mutateUserFlowState:T,userFlowStatesData:u,isLoadingUserFlowStateData:A,optimisticallyMarkFlowCompleted:C,optimisticallyMarkFlowSkipped:I,optimisticallyMarkFlowNotStarted:B,optimisticallyMarkStepCompleted:v,optimisticallyMarkStepNotStarted:L,optimisticallyMarkStepStarted:_}=ze(),{data:K,error:z,isLoading:J}=xa(l?`${t}flows${F?"?readonly=true":""}`:null,U,{keepPreviousData:!0});useEffect(()=>{if(z){console.error(z);return}K&&K.data&&i(K.data);},[K,z]);function G(m){if(J)return null;let y=o.find(k=>k.slug===m);return !y&&o.length>0&&!A&&!J?(console.log(`Flow with id ${m} not found`),null):(y&&x&&x[m]&&(y.data=x[m]),(y==null?void 0:y.active)===!1&&!F?null:y)}function O(m){var W,Be,Et,At,It;if(!G(m))return [];let y=(W=G(m))==null?void 0:W.data;return y?(y=te(y),((It=(At=(Be=Yt(y))==null?void 0:Be.data)!=null?At:(Et=Yt(y))==null?void 0:Et.steps)!=null?It:[]).map(ge=>{let Co=Ke(ge);return j(w({handleSecondaryButtonClick:()=>{ge.skippable===!0&&D(m,ge.id,{skipped:!0});}},ge),{complete:V(m,ge.id)===_e||Co>=1,started:V(m,ge.id)===So||V(m,ge.id)===_e,currentlyActive:u==null?void 0:u.some(yo=>yo.flowId==m&&yo.lastStepId===ge.id),blocked:X(m,ge.id),hidden:oe(m,ge.id),handlePrimaryButtonClick:()=>{(!ge.completionCriteria&&(ge.autoMarkCompleted||ge.autoMarkCompleted===void 0)||ge.completionCriteria&&ge.autoMarkCompleted===!0)&&D(m,ge.id);},progress:Co})}).filter(ge=>ge.hidden!==!0)):[]}function te(m){return m.replaceAll(/\${(.*?)}/g,(y,k)=>p[k]===void 0?"":String(p[k]).replace(/[\u00A0-\u9999<>\&]/g,function(W){return "&#"+W.charCodeAt(0)+";"}).replaceAll(/[\\]/g,"\\\\").replaceAll(/[\"]/g,'\\"').replaceAll(/[\/]/g,"\\/").replaceAll(/[\b]/g,"\\b").replaceAll(/[\f]/g,"\\f").replaceAll(/[\n]/g,"\\n").replaceAll(/[\r]/g,"\\r").replaceAll(/[\t]/g,"\\t"))}function q(m){var k;if(!G(m))return [];let y=G(m).data;return y?(y=te(y),(k=JSON.parse(y))!=null?k:{}):[]}function R(m,y){d(k=>j(w({},k),{[m]:y}));}function Se(m){!A&&!J&&m&&JSON.stringify(p)!=JSON.stringify(w(w({},p),m))&&Object.keys(m).forEach(y=>{R(y,m[y]);});}let ke=useCallback((m,y,k)=>$(this,null,function*(){if(!P())return;let W={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:y,actionType:So,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};pe(W)&&(yield _(m,y,W),S(W));}),[n,r,u]),ee=useCallback((m,y,k)=>$(this,null,function*(){if(!P())return;let W={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:y,actionType:st,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};pe(W)&&(yield L(m,y,W),S(W));}),[n,r,u]),D=useCallback((m,y,k)=>$(this,null,function*(){if(!P())return;let W={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:y,actionType:_e,data:k!=null?k:{},createdAt:new Date,blocked:!1,hidden:!1};pe(W)&&(yield v(m,y,W),S(W));}),[n,r,u]),ne=useCallback((m,y)=>$(this,null,function*(){if(!P()||xt(m)===Ue)return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:Ue,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};yield B(m),pe(k)&&S(k);}),[n,r,u]),Pe=useCallback((m,y)=>$(this,null,function*(){if(!P())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:Ot,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};pe(k)&&S(k);}),[n,r,u]),Ge=useCallback((m,y)=>$(this,null,function*(){if(!P())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:de,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};pe(k)&&(yield C(m),S(k));}),[n,r,u]),ve=useCallback((m,y)=>$(this,null,function*(){if(!P())return;let k={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:m,stepId:"unknown",actionType:Nt,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};pe(k)&&(yield I(m),S(k));}),[n,r,u]);function pe(m){var y;if(u===void 0)return !1;if(u){let k=u.find(W=>W.flowId===m.flowSlug);if(m.actionType===st&&(!(k!=null&&k.stepStates[m.stepId])||k.stepStates[m.stepId].actionType===st))return !1;if(k&&((y=k.stepStates[m.stepId])==null?void 0:y.actionType)===m.actionType){if(m.actionType===_e&&(!m.data||JSON.stringify(m.data)===JSON.stringify({})))return !1;let W=Object.keys(k.stepStates).sort((Be,Et)=>{let At=new Date(k.stepStates[Be].createdAt),It=new Date(k.stepStates[Et].createdAt);return At.getTime()-It.getTime()});if(k.stepStates[W[W.length-1]].actionType===m.actionType&&m.stepId===W[W.length-1])return !1}if(k&&k.flowState===de&&m.actionType===de)return !1}return !0}function V(m,y){let k=M(m,y);return A?null:k?k.actionType:st}function X(m,y){let k=M(m,y);return k?k.blocked:!1}function oe(m,y){let k=M(m,y);return k?k.hidden:!1}function M(m,y){var W;if(A)return null;let k=u==null?void 0:u.find(Be=>Be.flowId===m);return !k||!k.stepStates[y]?null:(W=k.stepStates[y])!=null?W:null}function Z(m){var k,W;if(A||!u)return null;if(xt(m)===Ue)return (k=O(m)[0])!=null?k:null;let y=(W=u.find(Be=>Be.flowId===m))==null?void 0:W.lastStepId;return y?O(m).find(Be=>Be.id===y):null}function we(m){var W;let y=Z(m);if(!y)return 0;let k=(W=O(m).findIndex(Be=>Be.id===y.id))!=null?W:0;return V(m,y.id)===_e&&k<O(m).length-1?k+1:k}function Ke(m){if(!m.completionCriteria)return;let y=bi(m.completionCriteria);if(y===null)return;let k=Je(y),W=nt(y);return W===0?void 0:k/W}function xt(m){let y=u==null?void 0:u.find(k=>k.flowId===m);return y?y.flowState:null}function Je(m){let y=O(m);return y.length===0?0:y.filter(W=>V(m,W.id)===_e).length}function nt(m){return O(m).length}function Ze(m){let y=o.find(k=>k.slug===m);return y?(x&&x[m]&&(y.data=x[m]),Yt(y.data)):null}function vt(m){if(F)return !1;if(A||b)return !0;if(m!=null&&m.targetingLogic&&u){let y=u.find(k=>k.flowId===m.slug);if(y)return y.shouldTrigger===!1}return !!(m!=null&&m.targetingLogic&&n&&n.startsWith("guest_"))}function Vt(m){let y=G(m);return (y==null?void 0:y.active)===!1?!1:!vt(G(m))}function jt(){n&&T();}function Bt(){return o}return {getAllFlows:Bt,getFlow:G,getFlowData:Ze,isLoading:A||J,getStepStatus:V,getFlowSteps:O,getCurrentStepIndex:we,markStepStarted:ke,markStepCompleted:D,markFlowNotStarted:ne,markFlowStarted:Pe,markFlowCompleted:Ge,markFlowSkipped:ve,markStepNotStarted:ee,getFlowStatus:xt,getNumberOfStepsCompleted:Je,getNumberOfSteps:nt,targetingLogicShouldHideFlow:vt,setCustomVariable:R,updateCustomVariables:Se,customVariables:p,getStepOptionalProgress:Ke,getFlowMetadata:q,isStepBlocked:X,isStepHidden:oe,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:f,isFlowAvailableToUser:Vt,refresh:jt,isDegraded:b}}var Jt="guest_";function Fo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=useContext(ie),{config:r,apiUrl:l}=Re(),{mutateUserFlowState:p}=ze(),d=Kt(),{verifySDKInitiated:s}=qt();function f(x){return `frigade-user-registered-${x}`}useEffect(()=>{if(e&&!t){if(e.startsWith(Jt))return;let x=f(e);localStorage.getItem(x)||(d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(x,"true"));}},[e,n,t]);let c=useCallback(x=>$(this,null,function*(){if(!s())return;let h={foreignId:e,properties:x};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(h)})),i(P=>w(w({},P),x)),p();}),[e,r,n,p]),g=useCallback((x,h)=>$(this,null,function*(){if(!s())return;let S={foreignId:e,events:[{event:x,properties:h}]};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(S)})),p();}),[e,r,p]),b=useCallback((x,h)=>$(this,null,function*(){if(s())if(h&&Object.keys(h).length>0){let P=f(x);localStorage.setItem(P,"true"),o(x);let S={foreignId:x,properties:h};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(S)})),i(N=>w(w({},N),h)),p();}else o(x);}),[r,n,p]),F=useCallback(x=>$(this,null,function*(){if(!s())return;let h=typeof window!="undefined"?localStorage.getItem(Xt):null;if(!h)return;let P={foreignId:x,linkGuestId:h};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(P)})),p();}),[r,n,p]);return {userId:e,setUserId:o,setUserIdWithProperties:b,addPropertiesToUser:c,trackEventForUser:g,linkExistingGuestSessionToUser:F}}var wi="fr-",ko="cfr-";function a(e,t){let o=`${wi}${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+" "+ko+e}return o}function E(e){if(!e.className||e.className.indexOf(ko)!==-1)return "";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(wi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function jo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Ee(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${jo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Te(...e){return e.filter(Boolean).join(" ")}function Po(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Aa=xe.div`
14
+ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnPropertyDescriptors;var Ho=Object.getOwnPropertySymbols;var gi=Object.prototype.hasOwnProperty,hi=Object.prototype.propertyIsEnumerable;var fi=(e,t,o)=>t in e?la(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,w=(e,t)=>{for(var o in t||(t={}))gi.call(t,o)&&fi(e,o,t[o]);if(Ho)for(var o of Ho(t))hi.call(t,o)&&fi(e,o,t[o]);return e},j=(e,t)=>aa(e,pa(t));var xi=e=>typeof e=="symbol"?e:e+"",Me=(e,t)=>{var o={};for(var i in e)gi.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Ho)for(var i of Ho(e))t.indexOf(i)<0&&hi.call(e,i)&&(o[i]=e[i]);return o};var $=(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());});var Ci="1.38.36";var lt="NOT_STARTED_STEP",de="COMPLETED_FLOW",Ot="SKIPPED_FLOW",Lt="STARTED_FLOW",_e="NOT_STARTED_FLOW",ze="COMPLETED_STEP",So="STARTED_STEP";function et(){let{publicApiKey:e,userId:t,apiUrl:o}=q__default.useContext(se);return {config:useMemo(()=>({headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-Frigade-SDK-Version":Ci,"X-Frigade-SDK-Platform":"React"}}),[e,t]),apiUrl:useMemo(()=>`${o}/v1/public/`,[o])}}var da="frigade-last-call-at-",ca="frigade-last-call-data-";function qt(){let{shouldGracefullyDegrade:e,readonly:t}=q__default.useContext(se);return (o,i)=>$(this,null,function*(){if(t&&(i.method==="POST"||i.method==="PUT"||i.method==="DELETE"))return Kt();if(e)return console.log(`Skipping ${o} call to Frigade due to error`),Kt();let n=da+o,r=ca+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 Kt()}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 Kt(p)}return l?l.ok?l:Kt(l.statusText):Kt()})}function Kt(e){return e&&console.log("Call to Frigade failed",e),{json:()=>({})}}function Yt(){let{publicApiKey:e,shouldGracefullyDegrade:t}=q__default.useContext(se);function o(){return t?!1:e?!0:(console.error("Frigade hooks cannot be used outside the scope of FrigadeProvider"),!1)}return {verifySDKInitiated:o}}function ma(e){return new Promise(t=>setTimeout(t,e))}function bo(e,t,o,i={}){function n(r){let l=o-1;if(!l)throw r;return ma(t).then(()=>bo(e,t,l,i))}return fetch(e,i).catch(n)}function Ne(){let{openFlowStates:e,setOpenFlowStates:t,hasActiveFullPageFlow:o,setCompletedFlowsToKeepOpenDuringSession:i,completedFlowsToKeepOpenDuringSession:n}=useContext(se);function r(c,f=!1){var b;return (b=e[c])!=null?b:f}function l(c,f){t(b=>j(w({},b),{[c]:f}));}function p(c){t(f=>{let C=f,k=Me(C,[xi(c)]);return w({},k)});}function d(c){n.includes(c)||i(f=>[...f,c]);}function s(c){return n.includes(c)}function m(c){return Object.entries(e).some(([f,b])=>b&&f!=c)||o}return {getOpenFlowState:r,setOpenFlowState:l,resetOpenFlowState:p,hasOpenModals:m,setKeepCompletedFlowOpenDuringSession:d,shouldKeepCompletedFlowOpenDuringSession:s}}function Tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ue(...e){let t=e.shift(),o=e.length===1?e[0]:ue(...e);if(!Tr(t)||!Tr(o))throw new Error("deepmerge can only merge Objects");let i=wo(t);return Object.entries(o).forEach(([n,r])=>{Tr(r)?i[n]!==void 0?Object.assign(i,{[n]:ue(i[n],wo(r))}):Object.assign(i,{[n]:wo(r)}):Array.isArray(r)?i[n]!==void 0?Object.assign(i,{[n]:[...i[n],...wo(r)]}):Object.assign(i,{[n]:wo(r)}):Object.assign(i,{[n]:r});}),i}function Jt(e){try{return JSON.parse(e)}catch(t){return console.error("Failed to parse Frigade config.yml to JSON",t),null}}var ya="unknown";function We(){let{config:e,apiUrl:t}=et(),{publicApiKey:o,userId:i,organizationId:n,flows:r,setShouldGracefullyDegrade:l,readonly:p}=useContext(se),{resetOpenFlowState:d}=Ne(),[s,m]=useState(!1),c={data:r.map(I=>({flowId:I.id,flowState:de,lastStepId:null,userId:i,foreignUserId:i,stepStates:{},shouldTrigger:!1}))},f=I=>bo(I,100,2,e).then(E=>{if(E.ok)return E.json();throw new Error("Failed to fetch user flow states")}).catch(E=>(console.error(`Error fetching ${I}: ${E}. Will gracefully degrade and hide Frigade`),l(!0),c)),b=o&&r&&i?`${t}userFlowStates?foreignUserId=${encodeURIComponent(i)}${n?`&foreignUserGroupId=${encodeURIComponent(n)}`:""}`:null,{data:k,isLoading:C,mutate:x,error:B}=p?Ca(b,f):xa(b,f,{revalidateOnFocus:!0,revalidateIfStale:!0,keepPreviousData:!0,revalidateOnMount:!1,errorRetryInterval:1e4,errorRetryCount:3,onError:()=>c,onLoadingSlow:()=>c}),S=k==null?void 0:k.data;useEffect(()=>{!s&&!C&&S&&m(!0);},[S,s,C]);function N(I){return $(this,null,function*(){if(S&&!p){let E=S.find(v=>v.flowId===I);E&&E.flowState!==de&&(E.flowState=de),yield x(Promise.resolve(ue(k,{data:S})),{optimisticData:ue(k,{data:S}),revalidate:!1,rollbackOnError:!1});}})}function D(I){return $(this,null,function*(){if(S&&!p){let E=S.find(v=>v.flowId===I);E&&E.flowState!==Ot&&(E.flowState=Ot),yield x(Promise.resolve(ue(k,{data:S})),{optimisticData:ue(k,{data:S}),revalidate:!1,rollbackOnError:!1});}})}function F(I,E,v){return $(this,null,function*(){var L,U,R;if(S){let z=S.find(J=>J.flowId===I);if(z){let J=r.find(re=>re.slug===I),X=Jt(J==null?void 0:J.data),O=(U=(L=X==null?void 0:X.steps)!=null?L:X==null?void 0:X.data)!=null?U:[],Y=O.findIndex(re=>re.id===E),K=O&&O.length>Y+1?O[Y+1]:null;K&&((R=z.stepStates[K.id])!=null&&R.hidden||(z.lastStepId=K.id)),z.stepStates[E]=v,z.flowState=Lt;}p||(yield x(Promise.resolve(ue(k,{data:S})),{optimisticData:ue(k,{data:S}),revalidate:!1,rollbackOnError:!1}));}})}function g(I,E,v){return $(this,null,function*(){if(S){let L=S.find(U=>U.flowId===I);L&&(L.lastStepId=E,L.stepStates[E]=v,L.flowState=Lt),p||(yield x(ue(k,{data:S}),{optimisticData:ue(k,{data:S}),revalidate:!1,rollbackOnError:!1}));}})}function T(I){return $(this,null,function*(){if(S){let E=S.find(v=>v.flowId===I);E&&E.flowState!==_e&&(E.flowState=_e,E.lastStepId=ya,Object.keys(E.stepStates).forEach(v=>{E.stepStates[v].actionType=lt,E.stepStates[v].createdAt=new Date().toISOString();}),yield x(ue(k,{data:S}),{optimisticData:ue(k,{data:S}),revalidate:!1,rollbackOnError:!1}),d(I));}})}function h(I,E,v){return $(this,null,function*(){if(S){let L=S.find(U=>U.flowId===I);L&&(L.stepStates[E]=v),yield x(Promise.resolve(ue(k,{data:S})),{optimisticData:ue(k,{data:S}),revalidate:!1,rollbackOnError:!1});}})}return {userFlowStatesData:S,isLoadingUserFlowStateData:!s,mutateUserFlowState:x,optimisticallyMarkFlowCompleted:N,optimisticallyMarkFlowSkipped:D,optimisticallyMarkFlowNotStarted:T,optimisticallyMarkStepCompleted:F,optimisticallyMarkStepNotStarted:h,optimisticallyMarkStepStarted:g,error:B}}function To(){let{config:e,apiUrl:t}=et(),{userFlowStatesData:o,mutateUserFlowState:i}=We(),{failedFlowResponses:n,setFailedFlowResponses:r,flowResponses:l,setFlowResponses:p}=useContext(se),[d,s]=useState(new Set),[m,c]=useState(new Set),f=qt();function b(x){let B=JSON.stringify(x);if(d.has(B))return null;d.add(B),s(d),m.add(x),c(m);let S=l==null?void 0:l.find(N=>N.flowSlug===x.flowSlug&&N.stepId===x.stepId&&N.actionType===x.actionType&&N.createdAt===x.createdAt);return f(`${t}flowResponses`,j(w({},e),{method:"POST",body:B})).then(N=>{N.status!==200&&N.status!==201?(console.log("Failed to send flow response for step "+x.stepId+". Will retry again later."),r([...n,x])):S||p(D=>[...D!=null?D:[],x]);})}function k(x){return $(this,null,function*(){x.foreignUserId&&(x.actionType===Lt||x.actionType===_e?yield b(x):x.actionType===de?yield b(x):x.actionType===So?yield b(x):x.actionType===ze?yield b(x):x.actionType===Ot?yield b(x):x.actionType===lt&&(yield b(x)));})}function C(){let x=[];return o==null||o.forEach(B=>{if(B&&B.stepStates&&Object.keys(B.stepStates).length!==0)for(let S in B.stepStates){let N=B.stepStates[S];x.push({foreignUserId:B.foreignUserId,flowSlug:B.flowId,stepId:N.stepId,actionType:N.actionType,data:{},createdAt:new Date(N.createdAt),blocked:N.blocked,hidden:N.hidden});}}),[...x,...l]}return {addResponse:k,setFlowResponses:p,getFlowResponses:C}}var ba=/user.flow\(([^\)]+)\) == '?COMPLETED_FLOW'?/gm,bi=e=>{let t=ba.exec(e);if(t===null)return null;let o=null;return t.forEach((i,n)=>{let r=wa(i,"'","");r.startsWith("flow_")&&(o=r);}),o},wa=function(e,t,o){return e.replace(new RegExp(t,"g"),o)};var Fr=(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))(Fr||{});function le(){let{config:e,apiUrl:t}=et(),{flows:o,setFlows:i,userId:n,organizationId:r,publicApiKey:l,customVariables:p,setCustomVariables:d,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,setFlowResponses:c,setShouldGracefullyDegrade:f,shouldGracefullyDegrade:b,readonly:k,flowDataOverrides:C,debug:x}=useContext(se),B={data:[]},{verifySDKInitiated:S}=Yt(),{addResponse:N,getFlowResponses:D}=To(),F=u=>bo(u,100,2,e).then(y=>y.ok?y.json():(console.log(`Error fetching ${u} (${y.status}): ${y.statusText}. Will gracefully degrade and hide Frigade`),f(!0),B)).catch(y=>(console.log(`Error fetching ${u}: ${y}. Will gracefully degrade and hide Frigade`),f(!0),B)),{mutateUserFlowState:g,userFlowStatesData:T,isLoadingUserFlowStateData:h,optimisticallyMarkFlowCompleted:I,optimisticallyMarkFlowSkipped:E,optimisticallyMarkFlowNotStarted:v,optimisticallyMarkStepCompleted:L,optimisticallyMarkStepNotStarted:U,optimisticallyMarkStepStarted:R}=We(),{data:z,error:J,isLoading:X}=xa(l?`${t}flows${k?"?readonly=true":""}`:null,F,{keepPreviousData:!0});useEffect(()=>{if(J){console.error(J);return}z&&z.data&&i(z.data);},[z,J]);function O(u){if(X)return null;let y=o.find(P=>P.slug===u);return !y&&o.length>0&&!h&&!X?(x&&console.log(`Flow with id ${u} not found`),null):(y&&C&&C[u]&&(y.data=C[u]),(y==null?void 0:y.active)===!1&&!k?null:y)}function Y(u){var V,Ie,At,It,Nt;if(!O(u))return [];let y=(V=O(u))==null?void 0:V.data;return y?(y=K(y),((Nt=(It=(Ie=Jt(y))==null?void 0:Ie.data)!=null?It:(At=Jt(y))==null?void 0:At.steps)!=null?Nt:[]).map(ge=>{let yo=vt(ge);return j(w({handleSecondaryButtonClick:()=>{ge.skippable===!0&&ie(u,ge.id,{skipped:!0});}},ge),{complete:G(u,ge.id)===ze||yo>=1,started:G(u,ge.id)===So||G(u,ge.id)===ze,currentlyActive:T==null?void 0:T.some(te=>te.flowId==u&&te.lastStepId===ge.id),blocked:ne(u,ge.id),hidden:M(u,ge.id),handlePrimaryButtonClick:()=>{(!ge.completionCriteria&&(ge.autoMarkCompleted||ge.autoMarkCompleted===void 0)||ge.completionCriteria&&ge.autoMarkCompleted===!0)&&ie(u,ge.id);},progress:yo})}).filter(ge=>ge.hidden!==!0)):[]}function K(u){return u.replaceAll(/\${(.*?)}/g,(y,P)=>p[P]===void 0?"":String(p[P]).replace(/[\u00A0-\u9999<>\&]/g,function(V){return "&#"+V.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 re(u){var P;if(!O(u))return [];let y=O(u).data;return y?(y=K(y),(P=JSON.parse(y))!=null?P:{}):[]}function ye(u,y){d(P=>j(w({},P),{[u]:y}));}function Pe(u){!h&&!X&&u&&JSON.stringify(p)!=JSON.stringify(w(w({},p),u))&&Object.keys(u).forEach(y=>{ye(y,u[y]);});}let oe=useCallback((u,y,P)=>$(this,null,function*(){if(!S())return;let V={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:y,actionType:So,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};W(V)&&(yield R(u,y,V),N(V));}),[n,r,T]),_=useCallback((u,y,P)=>$(this,null,function*(){if(!S())return;let V={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:y,actionType:lt,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};W(V)&&(yield U(u,y,V),N(V));}),[n,r,T]),ie=useCallback((u,y,P)=>$(this,null,function*(){if(!S())return;let V={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:y,actionType:ze,data:P!=null?P:{},createdAt:new Date,blocked:!1,hidden:!1};W(V)&&(yield L(u,y,V),N(V));}),[n,r,T]),ve=useCallback((u,y)=>$(this,null,function*(){if(!S()||qe(u)===_e)return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:_e,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};yield v(u),W(P)&&N(P);}),[n,r,T]),Ke=useCallback((u,y)=>$(this,null,function*(){if(!S())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Lt,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};W(P)&&N(P);}),[n,r,T]),Be=useCallback((u,y)=>$(this,null,function*(){if(!S())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:de,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};W(P)&&(yield I(u),N(P));}),[n,r,T]),xe=useCallback((u,y)=>$(this,null,function*(){if(!S())return;let P={foreignUserId:n,foreignUserGroupId:r!=null?r:null,flowSlug:u,stepId:"unknown",actionType:Ot,data:y!=null?y:{},createdAt:new Date,blocked:!1,hidden:!1};W(P)&&(yield E(u),N(P));}),[n,r,T]);function W(u){var y;if(T===void 0)return !1;if(T){let P=T.find(V=>V.flowId===u.flowSlug);if(u.actionType===lt&&(!(P!=null&&P.stepStates[u.stepId])||P.stepStates[u.stepId].actionType===lt))return !1;if(P&&((y=P.stepStates[u.stepId])==null?void 0:y.actionType)===u.actionType){if(u.actionType===ze&&(!u.data||JSON.stringify(u.data)===JSON.stringify({})))return !1;let V=Object.keys(P.stepStates).sort((Ie,At)=>{let It=new Date(P.stepStates[Ie].createdAt),Nt=new Date(P.stepStates[At].createdAt);return It.getTime()-Nt.getTime()});if(P.stepStates[V[V.length-1]].actionType===u.actionType&&u.stepId===V[V.length-1])return !1}if(P&&P.flowState===de&&u.actionType===de)return !1}return !0}function G(u,y){let P=Q(u,y);return h?null:P?P.actionType:lt}function ne(u,y){let P=Q(u,y);return P?P.blocked:!1}function M(u,y){let P=Q(u,y);return P?P.hidden:!1}function Q(u,y){var V;if(h)return null;let P=T==null?void 0:T.find(Ie=>Ie.flowId===u);return !P||!P.stepStates[y]?null:(V=P.stepStates[y])!=null?V:null}function Te(u){var P,V;if(h||!T)return null;if(qe(u)===_e)return (P=Y(u)[0])!=null?P:null;let y=(V=T.find(Ie=>Ie.flowId===u))==null?void 0:V.lastStepId;return y?Y(u).find(Ie=>Ie.id===y):null}function Xe(u){var V;let y=Te(u);if(!y)return 0;let P=(V=Y(u).findIndex(Ie=>Ie.id===y.id))!=null?V:0;return G(u,y.id)===ze&&P<Y(u).length-1?P+1:P}function vt(u){if(!u.completionCriteria)return;let y=bi(u.completionCriteria);if(y===null)return;let P=st(y),V=Qe(y);return V===0?void 0:P/V}function qe(u){let y=T==null?void 0:T.find(P=>P.flowId===u);return y?y.flowState:null}function st(u){let y=Y(u);return y.length===0?0:y.filter(V=>G(u,V.id)===ze).length}function Qe(u){return Y(u).length}function jt(u){let y=o.find(P=>P.slug===u);return y?(C&&C[u]&&(y.data=C[u]),Jt(y.data)):null}function Bt(u){if(k)return !1;if(h||b)return !0;if(u!=null&&u.targetingLogic&&T){let y=T.find(P=>P.flowId===u.slug);if(y)return y.shouldTrigger===!1}return !!(u!=null&&u.targetingLogic&&n&&n.startsWith("guest_"))}function Gt(u){let y=O(u);return (y==null?void 0:y.active)===!1?!1:!Bt(O(u))}function Et(){n&&g();}function ee(){return o}return {getAllFlows:ee,getFlow:O,getFlowData:jt,isLoading:h||X,getStepStatus:G,getFlowSteps:Y,getCurrentStepIndex:Xe,markStepStarted:oe,markStepCompleted:ie,markFlowNotStarted:ve,markFlowStarted:Ke,markFlowCompleted:Be,markFlowSkipped:xe,markStepNotStarted:_,getFlowStatus:qe,getNumberOfStepsCompleted:st,getNumberOfSteps:Qe,targetingLogicShouldHideFlow:Bt,setCustomVariable:ye,updateCustomVariables:Pe,customVariables:p,getStepOptionalProgress:vt,getFlowMetadata:re,isStepBlocked:ne,isStepHidden:M,hasActiveFullPageFlow:s,setHasActiveFullPageFlow:m,isFlowAvailableToUser:Gt,refresh:Et,isDegraded:b}}var Xt="guest_";function Fo(){let{userId:e,organizationId:t,setUserId:o,setUserProperties:i,shouldGracefullyDegrade:n}=useContext(se),{config:r,apiUrl:l}=et(),{mutateUserFlowState:p}=We(),d=qt(),{verifySDKInitiated:s}=Yt();function m(C){return `frigade-user-registered-${C}`}useEffect(()=>{if(e&&!t){if(e.startsWith(Xt))return;let C=m(e);localStorage.getItem(C)||(d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify({foreignId:e})})),localStorage.setItem(C,"true"));}},[e,n,t]);let c=useCallback(C=>$(this,null,function*(){if(!s())return;let x={foreignId:e,properties:C};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(x)})),i(B=>w(w({},B),C)),p();}),[e,r,n,p]),f=useCallback((C,x)=>$(this,null,function*(){if(!s())return;let S={foreignId:e,events:[{event:C,properties:x}]};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(S)})),p();}),[e,r,p]),b=useCallback((C,x)=>$(this,null,function*(){if(s())if(x&&Object.keys(x).length>0){let B=m(C);localStorage.setItem(B,"true"),o(C);let S={foreignId:C,properties:x};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(S)})),i(N=>w(w({},N),x)),p();}else o(C);}),[r,n,p]),k=useCallback(C=>$(this,null,function*(){if(!s())return;let x=typeof window!="undefined"?localStorage.getItem(Qt):null;if(!x)return;let B={foreignId:C,linkGuestId:x};yield d(`${l}users`,j(w({},r),{method:"POST",body:JSON.stringify(B)})),p();}),[r,n,p]);return {userId:e,setUserId:o,setUserIdWithProperties:b,addPropertiesToUser:c,trackEventForUser:f,linkExistingGuestSessionToUser:k}}var wi="fr-",ko="cfr-";function a(e,t){let o=`${wi}${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+" "+ko+e}return o}function A(e){if(!e.className||e.className.indexOf(ko)!==-1)return "";let o=e.className.replace(/\s+/g," ").split(" ");return o.length==1&&o[0].startsWith(wi)?"":`:not(${o.map(i=>`.${i}`).join(", ")})`}function jo(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Ee(e){return e!=null&&e.styleOverrides?Object.keys(e.styleOverrides).map(t=>`${jo(t)}: ${e.styleOverrides[t]};`).join(" "):""}function Fe(...e){return e.filter(Boolean).join(" ")}function Po(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Aa=Ce.div`
15
15
  display: flex;
16
16
  justify-content: center;
17
17
  position: fixed;
@@ -19,7 +19,7 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
19
19
  left: 0;
20
20
  bottom: 0;
21
21
  right: 0;
22
- ${e=>E(e)} {
22
+ ${e=>A(e)} {
23
23
  background-color: rgba(0, 0, 0, 0.6);
24
24
  z-index: 1400;
25
25
  }
@@ -35,12 +35,12 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
35
35
  opacity: 1;
36
36
  }
37
37
  }
38
- `,Ti=({onClose:e,appearance:t})=>Y__default.createElement(Aa,{className:a("modalBackground",t),onClick:()=>e()});var Na=xe.div`
38
+ `,Ti=({onClose:e,appearance:t})=>q__default.createElement(Aa,{className:a("modalBackground",t),onClick:()=>e()});var Na=Ce.div`
39
39
  :hover {
40
40
  opacity: 0.8;
41
41
  }
42
- `,Ne=()=>Y__default.createElement(Na,null,Y__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},Y__default.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));function Oa({style:e,className:t}){return Y__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},Y__default.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"}),Y__default.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 Fi=Oa;var Go=xe.div`
43
- ${e=>E(e)} {
42
+ `,Oe=()=>q__default.createElement(Na,null,q__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},q__default.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 15L15 5M5 5l10 10"})));function Oa({style:e,className:t}){return q__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"54",height:"14",fill:"none",viewBox:"0 0 54 14",style:e,className:t},q__default.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"}),q__default.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 Fi=Oa;var Go=Ce.div`
43
+ ${e=>A(e)} {
44
44
  background: ${e=>e.appearance.theme.colorBackground};
45
45
  }
46
46
 
@@ -72,52 +72,52 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
72
72
  right: 12px;
73
73
  background-color: transparent;
74
74
  border: none;
75
- `,ki=xe.button`
76
- ${e=>E(e)} {
75
+ `,ki=Ce.button`
76
+ ${e=>A(e)} {
77
77
  ${e=>e.hasImage?La:$a};
78
78
  }
79
- `,Pi=xe.img`
80
- ${e=>E(e)} {
79
+ `,Pi=Ce.img`
80
+ ${e=>A(e)} {
81
81
  display: block;
82
82
  width: 100%;
83
83
  height: auto;
84
84
  min-height: 200px;
85
85
  object-fit: cover;
86
86
  }
87
- `,vi=xe.div`
88
- ${e=>E(e)} {
87
+ `,vi=Ce.div`
88
+ ${e=>A(e)} {
89
89
  display: block;
90
90
  width: 100%;
91
91
  height: auto;
92
92
  margin-top: ${e=>e.dismissible?"24px":"0px"};
93
93
  object-fit: cover;
94
94
  }
95
- `,Bi=xe.div`
95
+ `,Bi=Ce.div`
96
96
  display: flex;
97
97
  flex-direction: row;
98
98
  justify-content: space-between;
99
99
  align-content: center;
100
- `,Ei=xe.div`
100
+ `,Ei=Ce.div`
101
101
  padding: 22px 22px 12px;
102
- `,Ai=xe.div`
102
+ `,Ai=Ce.div`
103
103
  display: flex;
104
104
  flex: 1;
105
105
  flex-direction: column;
106
106
  justify-content: center;
107
- `,Ii=xe.div`
107
+ `,Ii=Ce.div`
108
108
  display: flex;
109
109
  flex: 2;
110
110
  flex-shrink: 1;
111
111
  gap: 8px;
112
112
  height: 64px;
113
- ${e=>E(e)} {
113
+ ${e=>A(e)} {
114
114
  flex-direction: row;
115
115
  justify-content: ${e=>e.showStepCount?"flex-end":"flex-start"};
116
116
  align-content: center;
117
117
  align-items: center;
118
118
  }
119
- `,Ni=xe.p`
120
- ${e=>E(e)} {
119
+ `,Ni=Ce.p`
120
+ ${e=>A(e)} {
121
121
  font-style: normal;
122
122
  font-weight: 600;
123
123
  font-size: 15px;
@@ -125,7 +125,7 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
125
125
  color: #808080;
126
126
  }
127
127
  margin: 0;
128
- `;var Oi=xe.div`
128
+ `;var Oi=Ce.div`
129
129
  background-color: ${e=>{var t;return (t=e.appearance)==null?void 0:t.theme.colorBackground}};
130
130
  position: absolute;
131
131
  bottom: -47px;
@@ -136,7 +136,7 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
136
136
  align-items: center;
137
137
  justify-content: center;
138
138
  border-radius: ${e=>{var t;return (t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
139
- `,Li=xe(Go)`
139
+ `,Li=Ce(Go)`
140
140
  background-color: ${e=>{var t;return (t=e.appearance)==null?void 0:t.theme.colorBackground}};
141
141
  position: absolute;
142
142
  bottom: -60px;
@@ -149,7 +149,7 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
149
149
  border-radius: ${e=>{var t;return (t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
150
150
  padding: 0;
151
151
  z-index: ${e=>e.zIndex};
152
- `,$i=xe.div`
152
+ `,$i=Ce.div`
153
153
  display: flex;
154
154
  justify-content: center;
155
155
  align-items: center;
@@ -158,8 +158,8 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
158
158
  font-size: 12px;
159
159
  line-height: 18px;
160
160
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
161
- `;function Ko({appearance:e}){return Y__default.createElement($i,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",Y__default.createElement(Fi,null))}var Ua=xe.div`
162
- ${e=>E(e)} {
161
+ `;function Ko({appearance:e}){return q__default.createElement($i,{className:a("poweredByFrigadeContainer",e),appearance:e},"Powered by \xA0",q__default.createElement(Fi,null))}var Ua=Ce.div`
162
+ ${e=>A(e)} {
163
163
  // Anything inside this block will be ignored if the user provides a custom class
164
164
  background-color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
165
165
  /* Mobile */
@@ -200,27 +200,27 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
200
200
  opacity: 1;
201
201
  }
202
202
  }
203
- `,_a=xe.div`
203
+ `,_a=Ce.div`
204
204
  position: relative;
205
205
  flex: 0 1 auto;
206
- `,za=xe.div`
206
+ `,za=Ce.div`
207
207
  position: absolute;
208
208
  top: 16px;
209
209
  right: 16px;
210
210
  cursor: pointer;
211
211
  z-index: 1501;
212
- ${e=>E(e)} {
212
+ ${e=>A(e)} {
213
213
  // Anything inside this block will be ignored if the user provides a custom class
214
214
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
215
215
  }
216
- `,Wa=xe.div`
216
+ `,Wa=Ce.div`
217
217
  overflow: scroll;
218
218
  flex: 1 1;
219
219
  display: flex;
220
220
  ::-webkit-scrollbar {
221
221
  display: none;
222
222
  }
223
- `,et=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:l=!0,showFrigadeBranding:p=!1})=>{let[d,s]=useState("");return useEffect(()=>{let f=getComputedStyle(document.body).getPropertyValue("overflow");s(f);},[]),useEffect(()=>{let f=c=>{c.key==="Escape"&&e();};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f);}},[e]),useEffect(()=>{let f=document.body.style;return t?f.setProperty("overflow","hidden"):f.setProperty("overflow",d),()=>{f.setProperty("overflow",d);}},[t]),t?Y__default.createElement(Portal,null,Y__default.createElement(Ti,{appearance:r,onClose:()=>{l&&e();}}),Y__default.createElement(Ua,{appearance:r,className:a("modalContainer",r),styleOverrides:i},l&&Y__default.createElement(za,{className:a("modalClose",r),onClick:()=>e(),appearance:r},Y__default.createElement(Ne,null)),o&&Y__default.createElement(_a,null,o),Y__default.createElement(Wa,null,n),p&&Y__default.createElement(Oi,{appearance:r,className:a("poweredByFrigadeRibbon",r)},Y__default.createElement(Ko,{appearance:r})))):Y__default.createElement(Y__default.Fragment,null)};function ja(e){switch(e){case"top-left":return `
223
+ `,tt=({onClose:e,visible:t,headerContent:o=null,style:i=null,children:n,appearance:r,dismissible:l=!0,showFrigadeBranding:p=!1})=>{let[d,s]=useState("");return useEffect(()=>{let m=getComputedStyle(document.body).getPropertyValue("overflow");s(m);},[]),useEffect(()=>{let m=c=>{c.key==="Escape"&&e();};return document.addEventListener("keydown",m),()=>{document.removeEventListener("keydown",m);}},[e]),useEffect(()=>{let m=document.body.style;return t?m.setProperty("overflow","hidden"):m.setProperty("overflow",d),()=>{m.setProperty("overflow",d);}},[t]),t?q__default.createElement(Portal,null,q__default.createElement(Ti,{appearance:r,onClose:()=>{l&&e();}}),q__default.createElement(Ua,{appearance:r,className:a("modalContainer",r),styleOverrides:i},l&&q__default.createElement(za,{className:a("modalClose",r),onClick:()=>e(),appearance:r},q__default.createElement(Oe,null)),o&&q__default.createElement(_a,null,o),q__default.createElement(Wa,{className:a("modalBody",r)},n),p&&q__default.createElement(Oi,{appearance:r,className:a("poweredByFrigadeRibbon",r)},q__default.createElement(Ko,{appearance:r})))):q__default.createElement(q__default.Fragment,null)};function ja(e){switch(e){case"top-left":return `
224
224
  top: 0;
225
225
  left: 0;
226
226
  `;case"top-right":return `
@@ -229,8 +229,8 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
229
229
  `;case"bottom-left":return `
230
230
  bottom: 0;
231
231
  left: 0;
232
- `}return "right: 0; bottom: 0;"}var Ga=xe.div`
233
- ${e=>E(e)} {
232
+ `}return "right: 0; bottom: 0;"}var Ga=Ce.div`
233
+ ${e=>A(e)} {
234
234
  // Anything inside this block will be ignored if the user provides a custom class
235
235
  background: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
236
236
  position: fixed;
@@ -245,27 +245,27 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
245
245
  }
246
246
  ${e=>ja(e.modalPosition)}
247
247
  margin: 28px;
248
- `,Ka=xe.div`
248
+ `,Ka=Ce.div`
249
249
  position: relative;
250
250
  flex: 1;
251
- `,qa=xe.div`
251
+ `,qa=Ce.div`
252
252
  position: absolute;
253
253
  top: 16px;
254
254
  right: 16px;
255
255
  cursor: pointer;
256
256
  z-index: 1501;
257
- ${e=>E(e)} {
257
+ ${e=>A(e)} {
258
258
  // Anything inside this block will be ignored if the user provides a custom class
259
259
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
260
260
  }
261
- `,Ya=xe.div`
261
+ `,Ya=Ce.div`
262
262
  overflow: scroll;
263
263
  flex: 5;
264
264
  ::-webkit-scrollbar {
265
265
  display: none;
266
266
  }
267
- `,Jo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:l=!0})=>{let[p,d]=useState("");return useEffect(()=>{let s=getComputedStyle(document.body).getPropertyValue("overflow");d(s);},[]),useEffect(()=>{let s=f=>{f.key==="Escape"&&e();};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s);}},[e]),useEffect(()=>{let s=document.body.style;return t?s.setProperty("overflow","hidden"):s.setProperty("overflow",p),()=>{s.setProperty("overflow",p);}},[t]),t?Y__default.createElement(Portal,null,Y__default.createElement(Ga,{appearance:n,className:a("cornerModalContainer",n),modalPosition:r},l&&Y__default.createElement(qa,{className:a("cornerModalClose",n),onClick:()=>e()},Y__default.createElement(Ne,null)),o&&Y__default.createElement(Ka,null,o),Y__default.createElement(Ya,null,i))):Y__default.createElement(Y__default.Fragment,null)};function ce(){let{defaultAppearance:e}=useContext(ie);function t(o){var n,r,l;let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((n=i.styleOverrides)!=null?n:{},(r=o.styleOverrides)!=null?r:{}),theme:Object.assign(i.theme,(l=o.theme)!=null?l:{})}:i}return {mergeAppearanceWithDefault:t}}var Di=xe.label`
268
- ${e=>E(e)} {
267
+ `,Jo=({onClose:e,visible:t,headerContent:o=null,children:i,appearance:n,modalPosition:r="bottom-right",dismissible:l=!0})=>{let[p,d]=useState("");return useEffect(()=>{let s=getComputedStyle(document.body).getPropertyValue("overflow");d(s);},[]),useEffect(()=>{let s=m=>{m.key==="Escape"&&e();};return document.addEventListener("keydown",s),()=>{document.removeEventListener("keydown",s);}},[e]),useEffect(()=>{let s=document.body.style;return t?s.setProperty("overflow","hidden"):s.setProperty("overflow",p),()=>{s.setProperty("overflow",p);}},[t]),t?q__default.createElement(Portal,null,q__default.createElement(Ga,{appearance:n,className:a("cornerModalContainer",n),modalPosition:r},l&&q__default.createElement(qa,{className:a("cornerModalClose",n),onClick:()=>e()},q__default.createElement(Oe,null)),o&&q__default.createElement(Ka,null,o),q__default.createElement(Ya,null,i))):q__default.createElement(q__default.Fragment,null)};function ce(){let{defaultAppearance:e}=useContext(se);function t(o){var n,r,l;let i=JSON.parse(JSON.stringify(e));return o?{styleOverrides:Object.assign((n=i.styleOverrides)!=null?n:{},(r=o.styleOverrides)!=null?r:{}),theme:Object.assign(i.theme,(l=o.theme)!=null?l:{})}:i}return {mergeAppearanceWithDefault:t}}var Di=Ce.label`
268
+ ${e=>A(e)} {
269
269
  font-size: 12px;
270
270
  line-height: 18px;
271
271
  margin-bottom: 5px;
@@ -275,14 +275,14 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
275
275
  letter-spacing: 0.24px;
276
276
  }
277
277
  display: flex;
278
- `,Ui=xe.label`
279
- ${e=>E(e)} {
278
+ `,Ui=Ce.label`
279
+ ${e=>A(e)} {
280
280
  font-size: 12px;
281
281
  line-height: 20px;
282
282
  margin-bottom: 5px;
283
283
  }
284
284
  display: flex;
285
- `,_i=xe.span`
285
+ `,_i=Ce.span`
286
286
  font-weight: 400;
287
287
  font-size: 14px;
288
288
  line-height: 22px;
@@ -290,17 +290,17 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
290
290
  display: flex;
291
291
  margin-right: 5px;
292
292
  margin-top: 10px;
293
- `,Qo=xe.div`
293
+ `,Qo=Ce.div`
294
294
  display: flex;
295
295
  align-items: flex-start;
296
296
  justify-content: left;
297
297
  margin-bottom: 10px;
298
- `;var at={theme:{colorPrimary:"#0171F8",colorSecondary:"#2E343D",colorText:"#0F1114",colorBackground:"#ffffff",colorBackgroundSecondary:"#d2d2d2",colorTextOnPrimaryBackground:"#ffffff",colorTextSecondary:"#2E343D",colorTextDisabled:"#5A6472",colorBorder:"#E5E5E5",colorTextError:"#c00000",colorTextSuccess:"#00D149",borderRadius:10}};function yt({title:e,required:t,appearance:o=at}){return e?Y__default.createElement(Qo,{className:a("formLabelWrapper",o)},t?Y__default.createElement(_i,{className:a("formLabelRequired",o),appearance:o},"*"):null,Y__default.createElement(Di,{className:a("formLabel",o)},e)):null}function Qt({title:e,appearance:t}){return e?Y__default.createElement(Qo,null,Y__default.createElement(Ui,{className:a("formSubLabel",t)},e)):null}function Wi(e,t){var o,i,n,r,l,p,d;try{if(t){if(t.type=="number"){let s=z.number();if(t.props)for(let f of t.props)f.requirement=="min"?s=s.min(Number(f.value),(o=f.message)!=null?o:"Value is too small"):f.requirement=="max"?s=s.max(Number(f.value),(i=f.message)!=null?i:"Value is too large"):f.requirement=="positive"?s=s.positive((n=f.message)!=null?n:"Value must be positive"):f.requirement=="negative"&&(s=s.nonpositive((r=f.message)!=null?r:"Value must be negative"));s.parse(Number(e));}if(t.type=="string"){let s=z.string();if(t.props)for(let f of t.props)f.requirement=="min"?s=s.min(Number(f.value),(l=f.message)!=null?l:"Value is too short"):f.requirement=="max"?s=s.max(Number(f.value),(p=f.message)!=null?p:"Value is too long"):f.requirement=="regex"&&(s=s.regex(new RegExp(String(f.value)),(d=f.message)!=null?d:"Value does not match requirements"));s.parse(e);}return}}catch(s){if(s instanceof z.ZodError)return s.issues&&s.issues.length>0?s.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,s);}return null}var Xa=xe.div`
298
+ `;var pt={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=pt}){return e?q__default.createElement(Qo,{className:a("formLabelWrapper",o)},t?q__default.createElement(_i,{className:a("formLabelRequired",o),appearance:o},"*"):null,q__default.createElement(Di,{className:a("formLabel",o)},e)):null}function Zt({title:e,appearance:t}){return e?q__default.createElement(Qo,null,q__default.createElement(Ui,{className:a("formSubLabel",t)},e)):null}function Wi(e,t){var o,i,n,r,l,p,d;try{if(t){if(t.type=="number"){let s=z.number();if(t.props)for(let m of t.props)m.requirement=="min"?s=s.min(Number(m.value),(o=m.message)!=null?o:"Value is too small"):m.requirement=="max"?s=s.max(Number(m.value),(i=m.message)!=null?i:"Value is too large"):m.requirement=="positive"?s=s.positive((n=m.message)!=null?n:"Value must be positive"):m.requirement=="negative"&&(s=s.nonpositive((r=m.message)!=null?r:"Value must be negative"));s.parse(Number(e));}if(t.type=="string"){let s=z.string();if(t.props)for(let m of t.props)m.requirement=="min"?s=s.min(Number(m.value),(l=m.message)!=null?l:"Value is too short"):m.requirement=="max"?s=s.max(Number(m.value),(p=m.message)!=null?p:"Value is too long"):m.requirement=="regex"&&(s=s.regex(new RegExp(String(m.value)),(d=m.message)!=null?d:"Value does not match requirements"));s.parse(e);}return}}catch(s){if(s instanceof z.ZodError)return s.issues&&s.issues.length>0?s.issues[0].message:null;console.error("Frigade Form validation failed for rule ",t,s);}return null}var Xa=Ce.div`
299
299
  display: flex;
300
300
  flex-direction: column;
301
301
  width: 100%;
302
- `,Lr=xe.input`
303
- ${e=>E(e)} {
302
+ `,Lr=Ce.input`
303
+ ${e=>A(e)} {
304
304
  // Anything inside this block will be ignored if the user provides a custom class
305
305
  border: 1px solid ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
306
306
  font-size: 14px;
@@ -315,8 +315,8 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
315
315
  box-sizing: border-box;
316
316
  padding: 0 10px;
317
317
  margin-bottom: 10px;
318
- `,Qa=xe.textarea`
319
- ${e=>E(e)} {
318
+ `,Qa=Ce.textarea`
319
+ ${e=>A(e)} {
320
320
  // Anything inside this block will be ignored if the user provides a custom class
321
321
  border: 1px solid ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
322
322
  font-size: 14px;
@@ -332,14 +332,14 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
332
332
  box-sizing: border-box;
333
333
  margin-bottom: 10px;
334
334
  resize: none;
335
- `;function $r({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[l,p]=useState((n==null?void 0:n.text)||""),[d,s]=useState(!1),[f,c]=useState(!1),g=Lr;useEffect(()=>{l===""&&!d&&(s(!0),b(""));},[]),useEffect(()=>{if(f){b(l);return}},[f]);function b(x){var P;if(p(x),o({text:x}),r.required===!0&&x.trim()===""){i([{id:r.id,message:`${(P=r.title)!=null?P:"Field"} is required`,hidden:!f}]);return}let h=Wi(x,r.validation);if(h&&(x.trim()!==""||r.required===!0)){i([{id:r.id,message:h,hidden:!f}]);return}i([]);}r.multiline&&(g=Qa);function F(){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 Y__default.createElement(Xa,null,Y__default.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),Y__default.createElement(g,{className:a("inputComponent",t.appearance),value:l,onChange:x=>{b(x.target.value);},appearance:t.appearance,placeholder:r.placeholder,type:F(),onBlur:()=>{c(!0);}}),Y__default.createElement(Qt,{title:r.subtitle,appearance:t.appearance}))}var Dr="",Za=xe.div`
335
+ `;function $r({formInput:e,customFormTypeProps:t,onSaveInputData:o,setFormValidationErrors:i,inputData:n}){let r=e,[l,p]=useState((n==null?void 0:n.text)||""),[d,s]=useState(!1),[m,c]=useState(!1),f=Lr;useEffect(()=>{l===""&&!d&&(s(!0),b(""));},[]),useEffect(()=>{if(m){b(l);return}},[m]);function b(C){var B;if(p(C),o({text:C}),r.required===!0&&C.trim()===""){i([{id:r.id,message:`${(B=r.title)!=null?B:"Field"} is required`,hidden:!m}]);return}let x=Wi(C,r.validation);if(x&&(C.trim()!==""||r.required===!0)){i([{id:r.id,message:x,hidden:!m}]);return}i([]);}r.multiline&&(f=Qa);function k(){var C;switch((C=r==null?void 0:r.validation)==null?void 0:C.type){case"email":return "email";case"number":return "number";case"password":return "password"}return null}return q__default.createElement(Xa,null,q__default.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),q__default.createElement(f,{className:a("inputComponent",t.appearance),value:l,onChange:C=>{b(C.target.value);},appearance:t.appearance,placeholder:r.placeholder,type:k(),onBlur:()=>{c(!0);}}),q__default.createElement(Zt,{title:r.subtitle,appearance:t.appearance}))}var Dr="",Za=Ce.div`
336
336
  display: flex;
337
337
  flex-direction: column;
338
338
  width: 100%;
339
339
  -webkit-appearance: none;
340
340
  appearance: none;
341
- `,Ra=xe.select`
342
- ${e=>E(e)} {
341
+ `,Ra=Ce.select`
342
+ ${e=>A(e)} {
343
343
  // Anything inside this block will be ignored if the user provides a custom class
344
344
  border: 1px solid ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
345
345
  font-size: 14px;
@@ -359,17 +359,17 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
359
359
  background-repeat: no-repeat;
360
360
  background-size: 1.5em 1.5em;
361
361
  -webkit-print-color-adjust: exact;
362
- `;function Ur({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var g,b,F,x,h,P,S,N,U;let r=e,[l,p]=useState(!1),[d,s]=useState(!1);useState("");return useEffect(()=>{var T,u,A,C,I;if(!((T=i==null?void 0:i.choice)!=null&&T[0])&&!l){if(p(!0),r.requireSelection){o({choice:[Dr]});return}if(r.defaultValue&&((u=r.props.options)!=null&&u.find(B=>B.id===r.defaultValue))){let B=(A=r.props.options)==null?void 0:A.find(v=>v.id===r.defaultValue);o({choice:[B.id],label:[B.title]});}else o({choice:[((C=r.props.options)==null?void 0:C[0].id)||""],label:[(I=r.props.options)==null?void 0:I[0].title]});}},[]),useEffect(()=>{var T;r.requireSelection&&((T=i==null?void 0:i.choice)==null?void 0:T[0])===Dr?n([{message:"Please select an option",id:r.id,hidden:!0}]):n([]);},[(g=i==null?void 0:i.choice)==null?void 0:g[0],d]),Y__default.createElement(Za,null,Y__default.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),Y__default.createElement(Ra,{value:(b=i==null?void 0:i.choice)==null?void 0:b[0],onChange:T=>{s(!0),o({choice:[T.target.value],label:[T.target.selectedOptions[0].text]});},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&Y__default.createElement("option",{key:"null-value",value:Dr,disabled:!0},(F=r.placeholder)!=null?F:"Select an option"),(x=r.props.options)==null?void 0:x.map(T=>Y__default.createElement("option",{key:T.id,value:T.id},T.title))),((P=(h=r.props.options)==null?void 0:h.find(T=>{var u;return T.id===((u=i==null?void 0:i.choice)==null?void 0:u[0])}))==null?void 0:P.isOpenEnded)&&Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(yt,{title:(U=(N=(S=r.props.options)==null?void 0:S.find(T=>{var u;return T.id===((u=i==null?void 0:i.choice)==null?void 0:u[0])}))==null?void 0:N.openEndedLabel)!=null?U:"Please specify",required:!1,appearance:t.appearance}),Y__default.createElement(Lr,{type:"text",placeholder:"Enter your answer here",onChange:T=>{var u,A;o({choice:[(A=(u=r.props.options)==null?void 0:u.find(C=>{var I;return C.id===((I=i==null?void 0:i.choice)==null?void 0:I[0])}))==null?void 0:A.id],label:[T.target.value],isOpenEnded:!0});},appearance:t.appearance})),Y__default.createElement(Qt,{title:r.subtitle,appearance:t.appearance}))}var Gi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return Y__default.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},ep=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:l})=>Y__default.createElement("svg",{style:l,className:r,width:t,height:t,overflow:"visible"},Y__default.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},Y__default.createElement(Gi,{color:n,size:t}),Y__default.createElement(Gi,{color:e,percentage:Math.max(o,.1),size:t})),i),Zt=ep;var op=({color:e="#FFFFFF"})=>Y__default.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Y__default.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),rp={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ip={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},np={border:"1px solid #000000",color:"#FFFFFF"},sp={border:"1px solid #C5CBD3"},lp={color:"#FFFFFF"},ap={border:"1px solid #C5CBD3"},pp=e=>e==="square"?rp:ip,dp=(e,t)=>e==="square"?t?np:sp:t?lp:ap,cp=xe.div`
362
+ `;function Ur({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var f,b,k,C,x,B,S,N,D;let r=e,[l,p]=useState(!1),[d,s]=useState(!1);useState("");return useEffect(()=>{var F,g,T,h,I;if(!((F=i==null?void 0:i.choice)!=null&&F[0])&&!l){if(p(!0),r.requireSelection){o({choice:[Dr]});return}if(r.defaultValue&&((g=r.props.options)!=null&&g.find(E=>E.id===r.defaultValue))){let E=(T=r.props.options)==null?void 0:T.find(v=>v.id===r.defaultValue);o({choice:[E.id],label:[E.title]});}else o({choice:[((h=r.props.options)==null?void 0:h[0].id)||""],label:[(I=r.props.options)==null?void 0:I[0].title]});}},[]),useEffect(()=>{var F;r.requireSelection&&((F=i==null?void 0:i.choice)==null?void 0:F[0])===Dr?n([{message:"Please select an option",id:r.id,hidden:!0}]):n([]);},[(f=i==null?void 0:i.choice)==null?void 0:f[0],d]),q__default.createElement(Za,null,q__default.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),q__default.createElement(Ra,{value:(b=i==null?void 0:i.choice)==null?void 0:b[0],onChange:F=>{s(!0),o({choice:[F.target.value],label:[F.target.selectedOptions[0].text]});},placeholder:r.placeholder,appearance:t.appearance,className:a("multipleChoiceSelect",t.appearance)},r.requireSelection&&q__default.createElement("option",{key:"null-value",value:Dr,disabled:!0},(k=r.placeholder)!=null?k:"Select an option"),(C=r.props.options)==null?void 0:C.map(F=>q__default.createElement("option",{key:F.id,value:F.id},F.title))),((B=(x=r.props.options)==null?void 0:x.find(F=>{var g;return F.id===((g=i==null?void 0:i.choice)==null?void 0:g[0])}))==null?void 0:B.isOpenEnded)&&q__default.createElement(q__default.Fragment,null,q__default.createElement(yt,{title:(D=(N=(S=r.props.options)==null?void 0:S.find(F=>{var g;return F.id===((g=i==null?void 0:i.choice)==null?void 0:g[0])}))==null?void 0:N.openEndedLabel)!=null?D:"Please specify",required:!1,appearance:t.appearance}),q__default.createElement(Lr,{type:"text",placeholder:"Enter your answer here",onChange:F=>{var g,T;o({choice:[(T=(g=r.props.options)==null?void 0:g.find(h=>{var I;return h.id===((I=i==null?void 0:i.choice)==null?void 0:I[0])}))==null?void 0:T.id],label:[F.target.value],isOpenEnded:!0});},appearance:t.appearance})),q__default.createElement(Zt,{title:r.subtitle,appearance:t.appearance}))}var Gi=({color:e,percentage:t,size:o})=>{let i=o*.5-2,n=2*Math.PI*i,r=(1-t)*n;return q__default.createElement("circle",{r:i,cx:o*.5,cy:o*.5,fill:"transparent",stroke:r!==n?e:"",strokeWidth:"3px",strokeDasharray:n,strokeDashoffset:t?r:0})},ep=({fillColor:e,size:t,percentage:o,children:i,bgColor:n="#D9D9D9",className:r,style:l})=>q__default.createElement("svg",{style:l,className:r,width:t,height:t,overflow:"visible"},q__default.createElement("g",{transform:`rotate(-90 ${`${t*.5} ${t*.5}`})`},q__default.createElement(Gi,{color:n,size:t}),q__default.createElement(Gi,{color:e,percentage:Math.max(o,.1),size:t})),i),Rt=ep;var op=({color:e="#FFFFFF"})=>q__default.createElement("svg",{width:10,height:8,viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},q__default.createElement("path",{d:"M1 4.34815L3.4618 7L3.4459 6.98287L9 1",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})),rp={width:"22px",height:"22px",borderRadius:"8px",display:"flex",justifyContent:"center",alignItems:"center"},ip={width:"22px",height:"22px",borderRadius:"40px",display:"flex",justifyContent:"center",alignItems:"center"},np={border:"1px solid #000000",color:"#FFFFFF"},sp={border:"1px solid #C5CBD3"},lp={color:"#FFFFFF"},ap={border:"1px solid #C5CBD3"},pp=e=>e==="square"?rp:ip,dp=(e,t)=>e==="square"?t?np:sp:t?lp:ap,cp=Ce.div`
363
363
  ${e=>Ee(e)}
364
364
  flex-shrink: 0;
365
- `,pt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=at,style:r,className:l})=>{let p=pp(t),d=dp(t,e);return e===!0?p=j(w(w({},p),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=w(w({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?Y__default.createElement(Zt,{fillColor:o,percentage:i,size:22}):Y__default.createElement(cp,{styleOverrides:p,style:r,role:"checkbox",className:Te(a("checkIconContainer",n),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",l)},e&&Y__default.createElement(op,{color:"#FFFFFF"}))};function H(e){return e?{__html:mp.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","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted"]})}:{__html:""}}var up=xe.div`
365
+ `,dt=({value:e,type:t="round",primaryColor:o="#000000",progress:i,appearance:n=pt,style:r,className:l})=>{let p=pp(t),d=dp(t,e);return e===!0?p=j(w(w({},p),d),{backgroundColor:n.theme.colorTextSuccess,borderColor:t==="square"?o:"none"}):p=w(w({},p),d),e!==!0&&t==="round"&&i!==void 0&&i!==1?q__default.createElement(Rt,{fillColor:o,percentage:i,size:22}):q__default.createElement(cp,{styleOverrides:p,style:r,role:"checkbox",className:Fe(a("checkIconContainer",n),a(e?"checkIconContainerChecked":"checkIconContainerUnchecked",n),e?"checkIconContainerChecked":"checkIconContainerUnchecked",l)},e&&q__default.createElement(op,{color:"#FFFFFF"}))};function H(e){return e?{__html:mp.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","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted"]})}:{__html:""}}var up=Ce.div`
366
366
  display: flex;
367
367
  flex-direction: column;
368
368
  width: 100%;
369
369
  -webkit-appearance: none;
370
370
  appearance: none;
371
- `,fp=xe.button`
372
- ${e=>E(e)} {
371
+ `,fp=Ce.button`
372
+ ${e=>A(e)} {
373
373
  // Anything inside this block will be ignored if the user provides a custom class
374
374
  border: 1px solid ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
375
375
  font-size: 14px;
@@ -393,8 +393,8 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
393
393
  line-height: 18px;
394
394
  padding: 18px;
395
395
  margin-bottom: 10px;
396
- `;function Yi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var f;let r=e,[l,p]=useState((i==null?void 0:i.choice)||[]),[d,s]=useState(!1);return useEffect(()=>{l.length==0&&!d&&(s(!0),o({choice:[]}));},[]),useEffect(()=>{o({choice:l});},[l]),useEffect(()=>{r.required&&(l.length<r.props.minChoices||l.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([]);},[l]),Y__default.createElement(up,null,Y__default.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),(f=r.props.options)==null?void 0:f.map(c=>Y__default.createElement(fp,{appearance:t.appearance,className:a(l.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":l.includes(c.id),onClick:()=>{if(l.includes(c.id)){p(l.filter(g=>g!==c.id));return}l.length<r.props.maxChoices?p([...l,c.id]):l.length==1&&r.props.maxChoices==1&&p([c.id]);}},Y__default.createElement("span",{dangerouslySetInnerHTML:H(c.title)}),Y__default.createElement(pt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:l.includes(c.id),appearance:t.appearance}))),Y__default.createElement(Qt,{title:r.subtitle,appearance:t.appearance}))}var gp=xe.h1`
397
- ${e=>E(e)} {
396
+ `;function Yi({formInput:e,customFormTypeProps:t,onSaveInputData:o,inputData:i,setFormValidationErrors:n}){var m;let r=e,[l,p]=useState((i==null?void 0:i.choice)||[]),[d,s]=useState(!1);return useEffect(()=>{l.length==0&&!d&&(s(!0),o({choice:[]}));},[]),useEffect(()=>{o({choice:l});},[l]),useEffect(()=>{r.required&&(l.length<r.props.minChoices||l.length>r.props.maxChoices)?n([{message:"",id:r.id}]):n([]);},[l]),q__default.createElement(up,null,q__default.createElement(yt,{title:r.title,required:r.required,appearance:t.appearance}),(m=r.props.options)==null?void 0:m.map(c=>q__default.createElement(fp,{appearance:t.appearance,className:a(l.includes(c.id)?"multipleChoiceListItemSelected":"multipleChoiceListItem",t.appearance),key:c.id,value:c.id,"data-selected":l.includes(c.id),onClick:()=>{if(l.includes(c.id)){p(l.filter(f=>f!==c.id));return}l.length<r.props.maxChoices?p([...l,c.id]):l.length==1&&r.props.maxChoices==1&&p([c.id]);}},q__default.createElement("span",{dangerouslySetInnerHTML:H(c.title)}),q__default.createElement(dt,{type:"round",primaryColor:t.appearance.theme.colorPrimary,value:l.includes(c.id),appearance:t.appearance}))),q__default.createElement(Zt,{title:r.subtitle,appearance:t.appearance}))}var gp=Ce.h1`
397
+ ${e=>A(e)} {
398
398
  font-style: normal;
399
399
  font-weight: 700;
400
400
  font-size: ${e=>e.size=="small"?"15px":"18px"};
@@ -405,8 +405,8 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
405
405
  margin-bottom: 4px;
406
406
  color: ${e=>e.appearance.theme.colorText};
407
407
  }
408
- `,hp=xe.h2`
409
- ${e=>E(e)} {
408
+ `,hp=Ce.h2`
409
+ ${e=>A(e)} {
410
410
  font-style: normal;
411
411
  font-weight: 400;
412
412
  font-size: 14px;
@@ -414,38 +414,38 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
414
414
  letter-spacing: 0.28px;
415
415
  color: ${e=>e.appearance.theme.colorTextSecondary};
416
416
  }
417
- `;function Oe({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n="",ariaPrefix:r=""}){return Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(gp,{appearance:e,id:r?`frigade${r}Title`:"frigadeTitle",className:a(`${n}${n?Po(i):i}Title`,e),dangerouslySetInnerHTML:H(t),size:i}),o&&Y__default.createElement(hp,{id:r?`frigade${r}Subtitle`:"frigadeSubtitle",appearance:e,className:a(`${n}${n?Po(i):i}Subtitle`,e),dangerouslySetInnerHTML:H(o),size:i}))}var Xi=e=>Y.createElement("svg",w({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),Y.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 Cp=xe.div`
417
+ `;function Le({appearance:e,title:t,subtitle:o,size:i="medium",classPrefix:n="",ariaPrefix:r=""}){return q__default.createElement(q__default.Fragment,null,q__default.createElement(gp,{appearance:e,id:r?`frigade${r}Title`:"frigadeTitle",className:a(`${n}${n?Po(i):i}Title`,e),dangerouslySetInnerHTML:H(t),size:i}),o&&q__default.createElement(hp,{id:r?`frigade${r}Subtitle`:"frigadeSubtitle",appearance:e,className:a(`${n}${n?Po(i):i}Subtitle`,e),dangerouslySetInnerHTML:H(o),size:i}))}var Xi=e=>q.createElement("svg",w({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,"aria-hidden":"true",viewBox:"0 0 16 16"},e),q.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 Cp=Ce.div`
418
418
  display: flex;
419
419
  flex-direction: column;
420
420
  justify-content: flex-end;
421
421
  overflow: visible;
422
422
  padding-top: 14px;
423
- `,yp=xe.div`
423
+ `,yp=Ce.div`
424
424
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextError}};
425
425
  font-size: 12px;
426
426
  margin-bottom: 12px;
427
427
  display: flex;
428
428
  align-items: center;
429
- `,Sp=xe.div`
429
+ `,Sp=Ce.div`
430
430
  margin-right: 4px;
431
431
  display: inline-flex;
432
- `,bp=xe.div`
432
+ `,bp=Ce.div`
433
433
  padding-left: 1px;
434
434
  padding-right: 1px;
435
- `,wp={text:$r,multipleChoice:Ur,multipleChoiceList:Yi},Hr="frigade-multiInputStepTypeData";function Zi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:l,prefillData:p}){var T;let d=t.props,[s,f]=useState([]),[c,g]=useState([]),{userId:b}=Fo(),[F,x]=useState(N()||(p?p[t.id]:null)||{}),{readonly:h}=useContext(ie),P=w(w({},wp),l);useEffect(()=>{i(s.length===0);},[s,i]),useEffect(()=>{n(F);},[F]);function S(u,A){x(C=>{let I=j(w({},C),{[u.id]:A});return typeof window!="undefined"&&window.localStorage&&!h&&window.localStorage.setItem(U(),JSON.stringify(I)),I});}function N(){if(typeof window!="undefined"&&window.localStorage){let u=window.localStorage.getItem(U());if(u)return JSON.parse(u)}return null}function U(){return `${Hr}-${e}-${t.id}-${b}`}return Y__default.createElement(bp,{className:a("multiInput",r)},Y__default.createElement(Oe,{appearance:r,title:t.title,subtitle:t.subtitle}),Y__default.createElement(Cp,{className:a("multiInputContainer",r)},(T=d==null?void 0:d.data)==null?void 0:T.map(u=>{let A=s.reverse().find(C=>C.id===u.id);return P[u.type]?Y__default.createElement("span",{key:u.id,"data-field-id":u.id,className:a("multiInputField",r)},P[u.type]({formInput:u,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:C=>{!c.includes(u.id)&&C&&(C==null?void 0:C.text)!==""&&g(I=>[...I,u.id]),S(u,C);},inputData:F[u.id],allInputData:F,setFormValidationErrors:C=>{C.length===0&&s.length===0||f(I=>C.length===0?I.filter(B=>B.id!==u.id):[...I,...C]);}}),A&&A.message&&c.includes(u.id)&&A.hidden!==!0&&Y__default.createElement(yp,{key:u.id,style:{overflow:"hidden"},appearance:r,className:a("multiInputValidationError",r)},Y__default.createElement(Sp,{appearance:r,className:a("multiInputValidationErrorIcon",r)},Y__default.createElement(Xi,null)),A.message)):null})))}var Ri=xe.div`
435
+ `,wp={text:$r,multipleChoice:Ur,multipleChoiceList:Yi},Hr="frigade-multiInputStepTypeData";function Zi({flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r,customFormElements:l,prefillData:p}){var F;let d=t.props,[s,m]=useState([]),[c,f]=useState([]),{userId:b}=Fo(),[k,C]=useState(N()||(p?p[t.id]:null)||{}),{readonly:x}=useContext(se),B=w(w({},wp),l);useEffect(()=>{i(s.length===0);},[s,i]),useEffect(()=>{n(k);},[k]);function S(g,T){C(h=>{let I=j(w({},h),{[g.id]:T});return typeof window!="undefined"&&window.localStorage&&!x&&window.localStorage.setItem(D(),JSON.stringify(I)),I});}function N(){if(typeof window!="undefined"&&window.localStorage){let g=window.localStorage.getItem(D());if(g)return JSON.parse(g)}return null}function D(){return `${Hr}-${e}-${t.id}-${b}`}return q__default.createElement(bp,{className:a("multiInput",r)},q__default.createElement(Le,{appearance:r,title:t.title,subtitle:t.subtitle}),q__default.createElement(Cp,{className:a("multiInputContainer",r)},(F=d==null?void 0:d.data)==null?void 0:F.map(g=>{let T=s.reverse().find(h=>h.id===g.id);return B[g.type]?q__default.createElement("span",{key:g.id,"data-field-id":g.id,className:a("multiInputField",r)},B[g.type]({formInput:g,customFormTypeProps:{flowId:e,stepData:t,canContinue:o,setCanContinue:i,onSaveData:n,appearance:r},onSaveInputData:h=>{!c.includes(g.id)&&h&&(h==null?void 0:h.text)!==""&&f(I=>[...I,g.id]),S(g,h);},inputData:k[g.id],allInputData:k,setFormValidationErrors:h=>{h.length===0&&s.length===0||m(I=>h.length===0?I.filter(E=>E.id!==g.id):[...I,...h]);}}),T&&T.message&&c.includes(g.id)&&T.hidden!==!0&&q__default.createElement(yp,{key:g.id,style:{overflow:"hidden"},appearance:r,className:a("multiInputValidationError",r)},q__default.createElement(Sp,{appearance:r,className:a("multiInputValidationErrorIcon",r)},q__default.createElement(Xi,null)),T.message)):null})))}var Ri=Ce.div`
436
436
  align-items: center;
437
437
  display: flex;
438
438
  justify-content: ${e=>e.showBackButton?"space-between":"flex-end"};
439
439
  padding-top: 14px;
440
- `,en=xe.div`
440
+ `,en=Ce.div`
441
441
  color: ${e=>e.appearance.theme.colorTextError};
442
442
  font-size: 12px;
443
- `,tn=xe.div`
443
+ `,tn=Ce.div`
444
444
  display: flex;
445
445
  gap: 12px;
446
446
  width: 100%;
447
447
  justify-content: flex-end;
448
- `,on=xe.div`
448
+ `,on=Ce.div`
449
449
  display: flex;
450
450
  // If type is set to large-modal, use padding 60px horizontal, 80px vertical
451
451
  // Otherwise, use 4px padding
@@ -453,11 +453,11 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
453
453
  flex-grow: 1;
454
454
  flex-basis: 0;
455
455
  position: relative;
456
- `,rn=xe.div`
456
+ `,rn=Ce.div`
457
457
  padding: ${e=>e.type==="large-modal"?"50px":"0px"};
458
458
  position: relative;
459
459
  overflow-y: auto;
460
- `,nn=xe.div`
460
+ `,nn=Ce.div`
461
461
  display: flex;
462
462
  align-self: stretch;
463
463
  flex-grow: 1;
@@ -469,7 +469,7 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
469
469
  background-position: center;
470
470
  border-top-right-radius: ${e=>e.appearance.theme.borderRadius}px;
471
471
  border-bottom-right-radius: ${e=>e.appearance.theme.borderRadius}px;
472
- `;var sn=xe.div`
472
+ `;var sn=Ce.div`
473
473
  width: 24px;
474
474
  height: 24px;
475
475
  border: 3px solid rgba(255, 255, 255, 0.25);
@@ -487,11 +487,11 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
487
487
  transform: rotate(360deg);
488
488
  }
489
489
  }
490
- `;var ln=xe.button`
490
+ `;var ln=Ce.button`
491
491
  justify-content: center;
492
492
  align-content: center;
493
493
  align-items: center;
494
- ${e=>E(e)} {
494
+ ${e=>A(e)} {
495
495
  display: flex;
496
496
  // Anything inside this block will be ignored if the user provides a custom class
497
497
  width: ${e=>e.type==="full-width"?"100%":"auto"};
@@ -520,8 +520,8 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
520
520
  opacity: ${e=>e.loading=="true"?"1.0":"0.3"};
521
521
  cursor: not-allowed;
522
522
  }
523
- `,tr=xe.div`
524
- ${e=>E(e)} {
523
+ `,tr=Ce.div`
524
+ ${e=>A(e)} {
525
525
  display: flex;
526
526
  flex-direction: row;
527
527
  justify-content: flex-start;
@@ -531,15 +531,15 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
531
531
  margin-right: 8px;
532
532
  }
533
533
  }
534
- `,le=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:l=!1,appearance:p,withMargin:d=!0,classPrefix:s="",loading:f=!1})=>{var b;function c(){let F=l?"buttonSecondary":"button";return s===""?F:`${s}${Po(F)}`}let g={tabindex:l?"0":"1",secondary:l,appearance:p,disabled:i||f,loading:(b=f==null?void 0:f.toString())!=null?b:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:a(c(),p)};return f?Y__default.createElement(ln,w({},g),Y__default.createElement(sn,{className:a("buttonLoader",p)})):Y__default.createElement(ln,j(w({},g),{dangerouslySetInnerHTML:H(t!=null?t:"Continue")}))};var pn=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:l,onBack:p,allowBackNavigation:d,errorMessage:s,isSaving:f})=>{var b;let c=l.length>1&&r!=0&&d,g=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return Y__default.createElement(Y__default.Fragment,null,s!==null&&s!=null&&Y__default.createElement(en,{appearance:o,className:a("formCTAError",o)},s),Y__default.createElement(Ri,{showBackButton:c,className:a("formCTAContainer",o)},c&&Y__default.createElement(le,{title:(b=e.backButtonTitle)!=null?b:"Back",onClick:p,secondary:!0,withMargin:!1,type:g,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),Y__default.createElement(tn,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?Y__default.createElement(le,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:g,appearance:o,disabled:f}):null," ",e.primaryButtonTitle?Y__default.createElement(le,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:g,appearance:o,loading:f}):null)))};var kp=xe.div`
534
+ `,ae=({onClick:e,title:t,style:o,disabled:i,type:n="inline",size:r="medium",secondary:l=!1,appearance:p,withMargin:d=!0,classPrefix:s="",loading:m=!1})=>{var b;function c(){let k=l?"buttonSecondary":"button";return s===""?k:`${s}${Po(k)}`}let f={tabindex:l?"0":"1",secondary:l,appearance:p,disabled:i||m,loading:(b=m==null?void 0:m.toString())!=null?b:"",onClick:e,styleOverrides:o,type:n,withMargin:d,size:r,className:a(c(),p)};return m?q__default.createElement(ln,w({},f),q__default.createElement(sn,{className:a("buttonLoader",p)})):q__default.createElement(ln,j(w({},f),{dangerouslySetInnerHTML:H(t!=null?t:"Continue")}))};var pn=({step:e,canContinue:t,appearance:o,onPrimaryClick:i,onSecondaryClick:n,selectedStep:r,steps:l,onBack:p,allowBackNavigation:d,errorMessage:s,isSaving:m})=>{var b;let c=l.length>1&&r!=0&&d,f=e.primaryButtonTitle&&e.secondaryButtonTitle||c?"inline":"full-width";return q__default.createElement(q__default.Fragment,null,s!==null&&s!=null&&q__default.createElement(en,{appearance:o,className:a("formCTAError",o)},s),q__default.createElement(Ri,{showBackButton:c,className:a("formCTAContainer",o)},c&&q__default.createElement(ae,{title:(b=e.backButtonTitle)!=null?b:"Back",onClick:p,secondary:!0,withMargin:!1,type:f,appearance:o,style:{width:"90px",maxWidth:"90px"},classPrefix:"back"}),q__default.createElement(tn,{className:a("ctaWrapper",o)},e.secondaryButtonTitle?q__default.createElement(ae,{title:e.secondaryButtonTitle,onClick:n,secondary:!0,withMargin:!1,type:f,appearance:o,disabled:m}):null," ",e.primaryButtonTitle?q__default.createElement(ae,{disabled:!t,withMargin:!1,title:e.primaryButtonTitle,onClick:i,type:f,appearance:o,loading:m}):null)))};var kp=Ce.div`
535
535
  text-align: center;
536
536
  color: #e6e6e6;
537
- `,or=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=ce().mergeAppearanceWithDefault(i);return Y__default.createElement(kp,{className:o},Y__default.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,l)=>Y__default.createElement("rect",{key:l,x:16*l,y:0,width:8,height:8,rx:4,fill:t===l?n.colorPrimary:"currentColor"}))))};function fe(){let e=useContext(ie);function t(n){i(n.primaryButtonUri,n.primaryButtonUriTarget);}function o(n){i(n.secondaryButtonUri,n.secondaryButtonUriTarget);}function i(n,r){if(!n)return;let l=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(l="_self"),e.navigate(n,l);}return {primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var vp=xe.div`
537
+ `,or=({stepCount:e=0,currentStep:t=0,className:o,appearance:i})=>{let{theme:n}=ce().mergeAppearanceWithDefault(i);return q__default.createElement(kp,{className:o},q__default.createElement("svg",{width:16*e-8,height:8,viewBox:`0 0 ${16*e-8} 8`,fill:"none"},Array(e).fill(null).map((r,l)=>q__default.createElement("rect",{key:l,x:16*l,y:0,width:8,height:8,rx:4,fill:t===l?n.colorPrimary:"currentColor"}))))};function fe(){let e=useContext(se);function t(n){i(n.primaryButtonUri,n.primaryButtonUriTarget);}function o(n){i(n.secondaryButtonUri,n.secondaryButtonUriTarget);}function i(n,r){if(!n)return;let l=n.startsWith("http")?"_blank":"_self";r&&r!=="_blank"&&(l="_self"),e.navigate(n,l);}return {primaryCTAClickSideEffects:t,secondaryCTAClickSideEffects:o,handleUrl:i}}var vp=Ce.div`
538
538
  display: flex;
539
539
  flex-wrap: wrap;
540
540
  align-content: center;
541
541
  justify-content: center;
542
- `,Bp=xe.div`
542
+ `,Bp=Ce.div`
543
543
  align-content: center;
544
544
  align-items: center;
545
545
  display: flex;
@@ -553,10 +553,10 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
553
553
  flex-basis: 255px;
554
554
  flex-grow: 0;
555
555
  flex-shrink: 0;
556
- `,Ep=xe.img`
556
+ `,Ep=Ce.img`
557
557
  width: 78px;
558
558
  height: auto;
559
- `,Ap=xe.button`
559
+ `,Ap=Ce.button`
560
560
  font-style: normal;
561
561
  font-weight: 600;
562
562
  font-size: 13px;
@@ -569,11 +569,11 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
569
569
  border-radius: 100px;
570
570
  padding: 8px 12px;
571
571
  margin-top: 16px;
572
- `,Ip=xe.h1`
572
+ `,Ip=Ce.h1`
573
573
  font-weight: 700;
574
574
  font-size: 28px;
575
575
  line-height: 34px;
576
- `,Np=xe.h2`
576
+ `,Np=Ce.h2`
577
577
  font-style: normal;
578
578
  font-weight: 400;
579
579
  font-size: 16px;
@@ -582,7 +582,7 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
582
582
  margin-top: 12px;
583
583
  margin-bottom: 16px;
584
584
  max-width: 70%;
585
- `;function dn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=fe();return Y__default.createElement("div",null,Y__default.createElement(Ip,{dangerouslySetInnerHTML:H(e.title)}),Y__default.createElement(Np,{dangerouslySetInnerHTML:H(e.subtitle)}),Y__default.createElement(vp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>Y__default.createElement(Bp,{key:r.title},Y__default.createElement(Ep,{src:r.imageUri}),Y__default.createElement(Ap,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var l;r.uri&&o(r.uri,(l=r.uriTarget)!=null?l:"_blank");}},r.title)))))}var rr=({style:e,className:t})=>Y__default.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},Y__default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Y__default.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"}));var $p=xe.div`
585
+ `;function dn({stepData:e,appearance:t}){var i,n;let{handleUrl:o}=fe();return q__default.createElement("div",null,q__default.createElement(Ip,{dangerouslySetInnerHTML:H(e.title)}),q__default.createElement(Np,{dangerouslySetInnerHTML:H(e.subtitle)}),q__default.createElement(vp,null,(n=(i=e.props)==null?void 0:i.links)==null?void 0:n.map(r=>q__default.createElement(Bp,{key:r.title},q__default.createElement(Ep,{src:r.imageUri}),q__default.createElement(Ap,{style:{borderColor:t.theme.colorPrimary,color:t.theme.colorPrimary},onClick:()=>{var l;r.uri&&o(r.uri,(l=r.uriTarget)!=null?l:"_blank");}},r.title)))))}var rr=({style:e,className:t})=>q__default.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},q__default.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),q__default.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"}));var $p=Ce.div`
586
586
  display: flex;
587
587
  align-items: center;
588
588
  justify-content: flex-start;
@@ -590,7 +590,7 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
590
590
  width: 100%;
591
591
  height: 100%;
592
592
  position: relative;
593
- `,Mp=xe.div`
593
+ `,Mp=Ce.div`
594
594
  position: absolute;
595
595
  display: flex;
596
596
  align-items: center;
@@ -609,66 +609,66 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
609
609
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
610
610
  border-radius: 50%;
611
611
  }
612
- `,Dp=xe.video`
612
+ `,Dp=Ce.video`
613
613
  width: 100%;
614
614
  height: 100%;
615
615
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
616
- `,Up=xe.iframe`
616
+ `,Up=Ce.iframe`
617
617
  width: 100%;
618
618
  height: 100%;
619
619
  min-height: 260px;
620
620
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
621
- `,_p=xe.iframe`
621
+ `,_p=Ce.iframe`
622
622
  width: 100%;
623
623
  height: 100%;
624
624
  min-height: 400px;
625
625
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
626
- `,zp=xe.iframe`
626
+ `,zp=Ce.iframe`
627
627
  width: 100%;
628
628
  height: 100%;
629
629
  min-height: 400px;
630
630
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
631
- `;function ot({appearance:e,videoUri:t,autoplay:o=!1,loop:i=!1,hideControls:n=!1}){let r=useRef(),[l,p]=useState(o);if(t.includes("youtube")){let d=t.split("v=")[1],s=d.indexOf("&");return s!==-1&&(d=d.substring(0,s)),Y__default.createElement(Up,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${d}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("youtubePlayer",e)})}if(t.includes("vimeo")){let d=t.split("vimeo.com/")[1],s=d.indexOf("&");return s!==-1&&(d=d.substring(0,s)),Y__default.createElement(_p,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${d}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("vimeoPlayer",e)})}if(t.includes("wistia")){let d=t.split("wistia.com/medias/")[1],s=d.indexOf("&");return s!==-1&&(d=d.substring(0,s)),Y__default.createElement(zp,{width:"100%",height:"100%",src:`https://fast.wistia.net/embed/iframe/${d}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("wistiaPlayer",e)})}return Y__default.createElement($p,{className:a("videoPlayerWrapper",e),appearance:e},!l&&Y__default.createElement(Mp,{onClick:()=>{p(!0),r.current.play();},appearance:e,className:a("playIconWrapper",e)},Y__default.createElement(rr,null)),Y__default.createElement(Dp,{appearance:e,controls:l&&!n,ref:r,play:l,src:t,autoPlay:o,muted:o,loop:i}))}var Hp=xe.div`
632
- ${e=>E(e)} {
631
+ `;function rt({appearance:e,videoUri:t,autoplay:o=!1,loop:i=!1,hideControls:n=!1}){let r=useRef(),[l,p]=useState(o);if(t.includes("youtube")){let d=t.split("v=")[1],s=d.indexOf("&");return s!==-1&&(d=d.substring(0,s)),q__default.createElement(Up,{width:"100%",height:"100%",src:`https://www.youtube.com/embed/${d}`,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("youtubePlayer",e)})}if(t.includes("vimeo")){let d=t.split("vimeo.com/")[1],s=d.indexOf("&");return s!==-1&&(d=d.substring(0,s)),q__default.createElement(_p,{width:"100%",height:"100%",src:`https://player.vimeo.com/video/${d}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("vimeoPlayer",e)})}if(t.includes("wistia")){let d=t.split("wistia.com/medias/")[1],s=d.indexOf("&");return s!==-1&&(d=d.substring(0,s)),q__default.createElement(zp,{width:"100%",height:"100%",src:`https://fast.wistia.net/embed/iframe/${d}`,frameBorder:"0",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,appearance:e,className:a("wistiaPlayer",e)})}return q__default.createElement($p,{className:a("videoPlayerWrapper",e),appearance:e},!l&&q__default.createElement(Mp,{onClick:()=>{p(!0),r.current.play();},appearance:e,className:a("playIconWrapper",e)},q__default.createElement(rr,null)),q__default.createElement(Dp,{appearance:e,controls:l&&!n,ref:r,play:l,src:t,autoPlay:o,muted:o,loop:i}))}var Hp=Ce.div`
632
+ ${e=>A(e)} {
633
633
  display: flex;
634
634
  flex-direction: column;
635
635
  justify-content: center;
636
636
  }
637
- `,Vp=xe.img`
638
- ${e=>E(e)} {
637
+ `,Vp=Ce.img`
638
+ ${e=>A(e)} {
639
639
  width: 100%;
640
640
  height: auto;
641
641
  max-height: 250px;
642
642
  margin-bottom: 24px;
643
643
  }
644
- `,jp=xe.div`
645
- ${e=>E(e)} {
644
+ `,jp=Ce.div`
645
+ ${e=>A(e)} {
646
646
  margin-bottom: 24px;
647
647
  }
648
- `,Gp=xe.div`
649
- ${e=>E(e)} {
648
+ `,Gp=Ce.div`
649
+ ${e=>A(e)} {
650
650
  width: 100%;
651
651
  height: auto;
652
652
  max-height: 250px;
653
653
  margin-bottom: 24px;
654
654
  }
655
- `;function cn({stepData:e,appearance:t,setCanContinue:o}){var i,n,r;return useEffect(()=>{o(!0);},[]),Y__default.createElement(Hp,{className:a("callToActionContainer",t)},Y__default.createElement(jp,{className:a("callToActionTextContainer",t)},Y__default.createElement(Oe,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&Y__default.createElement(Vp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&Y__default.createElement(Gp,{appearance:t,className:a("callToActionVideo",t)},Y__default.createElement(ot,{appearance:t,videoUri:e.videoUri,autoplay:(i=e.props)==null?void 0:i.autoplayVideo,loop:(n=e.props)==null?void 0:n.loopVideo,hideControls:(r=e.props)==null?void 0:r.hideVideoControls})))}var mn=xe.div`
655
+ `;function cn({stepData:e,appearance:t,setCanContinue:o}){var i,n,r;return useEffect(()=>{o(!0);},[]),q__default.createElement(Hp,{className:a("callToActionContainer",t)},q__default.createElement(jp,{className:a("callToActionTextContainer",t)},q__default.createElement(Le,{appearance:t,title:e.title,subtitle:e.subtitle})),e.imageUri&&q__default.createElement(Vp,{className:a("callToActionImage",t),src:e.imageUri}),!e.imageUri&&e.videoUri&&q__default.createElement(Gp,{appearance:t,className:a("callToActionVideo",t)},q__default.createElement(rt,{appearance:t,videoUri:e.videoUri,autoplay:(i=e.props)==null?void 0:i.autoplayVideo,loop:(n=e.props)==null?void 0:n.loopVideo,hideControls:(r=e.props)==null?void 0:r.hideVideoControls})))}var mn=Ce.div`
656
656
  width: auto;
657
657
  display: flex;
658
658
  flex-direction: column;
659
659
  justify-content: center;
660
660
  align-items: center;
661
661
  padding: 4px;
662
- `,un=xe.div`
662
+ `,un=Ce.div`
663
663
  width: 100%;
664
664
  text-align: left;
665
- `,fn=xe.h1`
665
+ `,fn=Ce.h1`
666
666
  font-style: normal;
667
667
  font-weight: 700;
668
668
  font-size: 32px;
669
669
  line-height: 38px;
670
670
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
671
- `,gn=xe.h1`
671
+ `,gn=Ce.h1`
672
672
  font-style: normal;
673
673
  font-weight: 400;
674
674
  font-size: 16px;
@@ -676,7 +676,7 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
676
676
  margin-top: 16px;
677
677
  margin-bottom: 16px;
678
678
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
679
- `,hn=xe.div`
679
+ `,hn=Ce.div`
680
680
  padding-top: 12px;
681
681
  padding-bottom: 12px;
682
682
  flex-direction: row;
@@ -687,17 +687,17 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
687
687
  cursor: pointer;
688
688
  border-bottom: ${e=>e.hideBottomBorder?"none":"1px solid #D8D8D8"};
689
689
  width: 100%;
690
- `,xn=xe.div`
690
+ `,xn=Ce.div`
691
691
  padding-top: 10px;
692
692
  padding-bottom: 10px;
693
693
  flex-direction: row;
694
694
  display: flex;
695
695
  justify-content: flex-start;
696
- `,Cn=xe.img`
696
+ `,Cn=Ce.img`
697
697
  width: 42px;
698
698
  height: 42px;
699
699
  margin-right: 12px;
700
- `,yn=xe.p`
700
+ `,yn=Ce.p`
701
701
  font-style: normal;
702
702
  font-weight: 500;
703
703
  font-size: 17px;
@@ -705,8 +705,8 @@ var la=Object.defineProperty,aa=Object.defineProperties;var pa=Object.getOwnProp
705
705
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
706
706
  display: flex;
707
707
  align-self: center;
708
- `;var Sn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,l]=useState([]),[p,d]=useState(!1),[s,f]=useState(e.id);return useEffect(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}));},[p]),useEffect(()=>{s!==e.id&&(f(e.id),l([]));},[e]),useEffect(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1);},[r]),Y__default.createElement(mn,{className:a("selectListContainer",i)},Y__default.createElement(un,null,Y__default.createElement(fn,{className:a("selectListTitle",i)},e.title),Y__default.createElement(gn,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),n.options.map((c,g)=>{let b=r.includes(c.id);return Y__default.createElement(hn,{key:`select-item-${g}`,onClick:()=>{if(r.includes(c.id)){l(r.filter(F=>F!==c.id));return}r.length<n.maxChoices?l([...r,c.id]):r.length==1&&n.maxChoices==1&&l([c.id]);},hideBottomBorder:g===n.options.length-1,className:a("selectListSelectItem",i)},Y__default.createElement(xn,{className:a("selectListItemImage",i)},c.imageUri&&Y__default.createElement(Cn,{src:c.imageUri,alt:`select-icon-${g}`}),Y__default.createElement(yn,{appearance:i,className:a("selectListSelectItemText",i)},c.title)),Y__default.createElement(pt,{appearance:i,value:b,primaryColor:i.theme.colorPrimary}))}))};var Kp=({children:e,id:t,shouldWrap:o=!1})=>Y__default.createElement(Y__default.Fragment,null,o?Y__default.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),sr=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:l,flowId:p,type:d,hideOnFlowCompletion:s,onComplete:f,setVisible:c,setShowModal:g,onDismiss:b,showPagination:F=!1,customFormElements:x,allowBackNavigation:h,validationHandler:P,onFormDataChange:S,showFooter:N,prefillData:U,updateUrlOnPageChange:T,repeatable:u})=>{var pe;let C=w(w({},{linkCollection:dn,multiInput:Zi,callToAction:cn,selectList:Sn}),i),{primaryCTAClickSideEffects:I,secondaryCTAClickSideEffects:B}=fe(),[v,L]=useState(!1),[_,K]=useState({}),[z,J]=useState(!1),[G,O]=useState(null),te=(pe=t[o])!=null?pe:null,{markStepCompleted:q,markStepStarted:R,isLoading:Se,updateCustomVariables:ke,markFlowCompleted:ee}=se();useEffect(()=>{ke(n);},[n,Se]),useEffect(()=>{S&&S(_,D(),t[o],o);},[_]);function D(){var X;return {data:(X=_[t[o].id])!=null?X:{},stepId:t[o].id,customVariables:n}}function ne(V,X,oe){let M=o+1<t.length?t[o+1]:null;return l&&l(V,oe,M,_,D()),r?r(V,o,X,M):!0}function Pe(V,X){K(oe=>{let M={};return M[V.id]=X,w(w({},oe),M)});}function Ge(V){return V.selectedStep.imageUri?Y__default.createElement(nn,{image:V.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let ve=N&&Y__default.createElement(pn,{step:t[o],canContinue:v&&!z,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>$(void 0,null,function*(){if(J(!0),P){let oe=yield P(t[o],o,t[o+1],_,D());if(oe!==!0){O(typeof oe=="string"?oe:null),J(!1);return}else O(null);}let V=w({},D());yield q(p,t[o].id,V),o+1<t.length&&!h&&(yield R(p,t[o+1].id));let X=ne(t[o],"primary",o);if(o+1>=t.length&&(f&&f(),b&&b(),s&&X&&(c&&c(!1),g(!1)),yield ee(p),u&&(yield R(p,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(M=>{M.startsWith(Hr)&&window.localStorage.removeItem(M);}))),I(t[o]),J(!1),typeof window!="undefined"&&!h&&T&&o+1<t.length){let oe=new URL(window.location.href);oe.searchParams.set("p",t[o+1].id),window.history.pushState({},"",oe.toString());}}),onSecondaryClick:()=>{ne(t[o],"secondary",o),B(t[o]);},onBack:()=>$(void 0,null,function*(){o-1>=0&&(J(!0),yield R(p,t[o-1].id),J(!1));}),steps:t,allowBackNavigation:h,errorMessage:G,isSaving:z});return Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(on,{className:a("formContainer",e)},Y__default.createElement(Kp,{id:o,shouldWrap:d==="large-modal"},Y__default.createElement(rn,{key:te.id,type:d,className:a("formContent",e)},t.map(V=>{var oe;let X=C[(oe=V.type)!=null?oe:"multiInput"];return te.id!==V.id?null:typeof X!="function"?X:Y__default.createElement(X,{key:V.id,stepData:V,canContinue:v,setCanContinue:L,onSaveData:M=>{Pe(V,M);},appearance:e,customFormElements:x,flowId:p,prefillData:U})}),F&&Y__default.createElement(or,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),ve)),d=="large-modal"&&Y__default.createElement(Ge,{selectedStep:t[o]})))};var Yp=createGlobalStyle`
709
- ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([l,p])=>`${jo(l)}: ${p};`).join(" ")} }`:`${jo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function ae({appearance:e}){if(!e||!e.styleOverrides)return Y__default.createElement(Y__default.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?Y__default.createElement(Y__default.Fragment,null):Y__default.createElement(Yp,{inlineStyles:t})}function qe(e,t=!0){let[o,i]=useState(!1),{markStepStarted:n,isLoading:r,getFlowStatus:l,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:s,getFlow:f}=se(),c=p(e);function g(){return $(this,null,function*(){!o&&!r&&l(e)===Ue&&s(f(e))===!1&&t&&c&&c.length>0&&(i(!0),yield n(e,c[d(e)].id));})}return useEffect(()=>{g();},[r,e,t]),{}}var Tn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:l,onComplete:p,appearance:d,hideOnFlowCompletion:s=!0,onStepCompletion:f,onButtonClick:c,dismissible:g=!0,endFlowOnDismiss:b=!1,modalPosition:F="center",repeatable:x=!1,onDismiss:h,showPagination:P=!1,allowBackNavigation:S=!1,validationHandler:N,showFrigadeBranding:U=!1,onFormDataChange:T,showFooter:u=!0,prefillData:A={},updateUrlOnPageChange:C=!1})=>{let{getFlow:I,getFlowSteps:B,isLoading:v,targetingLogicShouldHideFlow:L,getFlowStatus:_,getCurrentStepIndex:K,markFlowSkipped:z,markFlowNotStarted:J,markStepStarted:G}=se(),O=K(e),{mergeAppearanceWithDefault:te}=ce(),[q,R]=useState(null),{setOpenFlowState:Se,getOpenFlowState:ke,hasOpenModals:ee}=Ie();qe(e,i);let D=B(e);d=te(d);let[ne,Pe]=i!==void 0&&n!==void 0?[i,n]:[ke(e,!0),V=>Se(e,V)],Ge=typeof window!="undefined"?window.location.hash:null;if(useEffect(()=>{var V;if(D&&D.length>0&&S){let X=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 oe=-1;if(X){let M=X;oe=D.findIndex(Z=>Z.id===M),q===X&&(oe=-1);}oe!==-1&&(R(X),G(e,D[oe].id));}}},[Ge]),useEffect(()=>{!v&&D&&D.length&&typeof window!="undefined"&&S&&(R(D[O].id),window.location.hash=D[O].id);},[v,O,D]),v)return null;let ve=I(e);if(!ve||L(ve)||!D||i!==void 0&&i===!1||_(e)===de&&s&&!x||(o=="modal"||o=="corner-modal")&&ee(e))return null;let pe=()=>{Pe(!1),h&&h(),b===!0&&z(e);};if(F=="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",Y__default.createElement(et,{appearance:d,onClose:pe,visible:ne,style:V,dismissible:g,showFrigadeBranding:U},Y__default.createElement(ae,{appearance:d}),Y__default.createElement(sr,{appearance:d,steps:D,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Pe,onDismiss:h,showPagination:P,customFormElements:l,allowBackNavigation:S,validationHandler:N,onFormDataChange:T,showFooter:u,prefillData:A,updateUrlOnPageChange:C,repeatable:x}))}return o==="modal"&&F!=="center"?Y__default.createElement(Jo,{appearance:d,onClose:pe,visible:ne,modalPosition:F},Y__default.createElement(ae,{appearance:d}),Y__default.createElement(sr,{appearance:d,steps:D,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Pe,onDismiss:h,showPagination:P,customFormElements:l,allowBackNavigation:S,validationHandler:N,onFormDataChange:T,showFooter:u,prefillData:A,updateUrlOnPageChange:C,repeatable:x})):Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(ae,{appearance:d}),Y__default.createElement(sr,{appearance:d,steps:D,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:f,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:Pe,onDismiss:h,showPagination:P,customFormElements:l,allowBackNavigation:S,validationHandler:N,onFormDataChange:T,showFooter:u,prefillData:A,updateUrlOnPageChange:C,repeatable:x}))},Fn=Tn;function Jr(){let{organizationId:e,userId:t,setOrganizationId:o}=useContext(ie),{mutateUserFlowState:i}=ze(),{config:n,apiUrl:r}=Re(),l=Kt(),{verifySDKInitiated:p}=qt();function d(g,b){return `frigade-user-group-registered-${g}-${b}`}useEffect(()=>{if(t&&e){if(t.startsWith(Jt))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=useCallback(g=>$(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot add properties to organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let b={foreignUserId:t,foreignUserGroupId:e,properties:g};yield l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify(b)})),i();}),[e,t,n,i]),f=useCallback((g,b)=>$(this,null,function*(){if(!p())return;if(!e||!t){console.error("Cannot track event for organization: Organization ID and User ID must both be set.",{organizationIdInternal:e,userId:t});return}let x={foreignUserId:t,foreignUserGroupId:e,events:[{event:g,properties:b}]};yield l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify(x)})),i();}),[e,t,n,i]),c=useCallback((g,b)=>$(this,null,function*(){if(p())if(b){let F=d(t,g);localStorage.setItem(F,"true"),o(g);let x={foreignUserId:t,foreignUserGroupId:g,properties:b};yield l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify(x)})),i();}else o(g);}),[t,n,i]);return {organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:f}}var Xt="frigade-xFrigade_guestUserId",Io="frigade-xFrigade_userId",kn=({})=>{let{setFlowResponses:e}=To(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=ze(),{userId:n,setUserId:r}=Fo(),[l,p]=useState(n),{getFlowStatus:d}=se(),{flows:s,userProperties:f,setIsNewGuestUser:c,flowResponses:g,disableImagePreloading:b}=useContext(ie),[F,x]=useState([]),[h,P]=useState([]),{organizationId:S}=Jr(),[N,U]=useState(S),[T,u]=useState(!1);useEffect(()=>{if(!o&&t)for(let B=0;B<t.length;B++){let v=t[B],L=s.find(_=>_.slug===(v==null?void 0:v.flowId));if(L&&v&&v.shouldTrigger===!0&&L.type=="FORM"&&L.triggerType==="AUTOMATIC"&&!h.includes(L.slug)){setTimeout(()=>{A(v.flowId);},500);break}}},[o,t]),useEffect(()=>{g.length>0&&i();},[g]),useEffect(()=>{T||(u(!0),i());},[o,u]);function A(B){let v=s.find(L=>L.slug===B);v&&v.triggerType==="AUTOMATIC"&&!h.includes(v.slug)&&(P([...h,v.slug]),x([v]));}function C(){if(!n){let B=localStorage.getItem(Io);if(B){r(B);return}let v=localStorage.getItem(Xt);if(v){r(v);return}c(!0);let L=Jt+v4();try{localStorage.setItem(Xt,L);}catch(_){console.log("Failed to save guest user id locally: Local storage unavailable",_);}r(_=>_||L);}}useEffect(()=>{try{if(!b&&s){let B=[];s.forEach(v=>{if(v.data&&v.active){let L=v.data.match(/"imageUri":"(.*?)"/g);L&&L.forEach(_=>{let K=_.replace('"imageUri":"',"").replace('"',"");if(B.includes(K))return;let z=new Image;z.src=K,B.push(K);});}});}}catch(B){}},[s]),useEffect(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Jt))try{localStorage.setItem(Io,n);}catch(B){console.log("Failed to save user id locally: Local storage available",B);}n===null&&setTimeout(()=>{n===null&&C();},50);},[n,s,f]),useEffect(()=>{S!=N&&(U(S),e([]),i());},[S,N,U]);function I(){return Y__default.createElement(Y__default.Fragment,null,F.map(B=>d(B.slug)!==Ue?null:Y__default.createElement("span",{key:B.slug},Y__default.createElement(Fn,{flowId:B.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(I,null))};var Pn={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 od(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Pn[o]){let n=Pn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l];});}}),t}function rd(e){if(!e)return;let t=ue({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i];}),o}function vn(e){let{theme:t,styleOverrides:o}=e,i=od(t),n=rd(o);return {overrides:i,css:n}}var gd={width:{property:"width",scale:"sizes",transform:(e,t)=>get(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},hd=xe("div")(({css:e})=>e,compose(border,color,shadow,space,typography,system(gd))),No=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=$e(r,["as","children","overrides"]);let l=useTheme(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>Y__default.createElement(hd,w(w({as:e},p),i),t);if(o!==void 0){let s=ue(l,o);return Y__default.createElement(ThemeProvider,{theme:s},d())}return d()};var Oo={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"}},yd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},An=xe(No)(()=>({whiteSpace:"nowrap"}),compose(variant({scale:"components.Button",variants:"components.Button"}),variant({prop:"size",variants:yd})));var lr={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 In=xe(No)(variant({scale:"components.Text",variants:"components.Text"}),system({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Nn=4,On="px",Td=20,Fd=Object.fromEntries(Array.from(Array(Td+1),(e,t)=>t===0?[.5,`${.5*Nn}${On}`]:[t,`${t*Nn}${On}`])),no={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"},ar={colors:j(w({},no),{neutral:{foreground:no.gray300},primary:{background:no.blue500,foreground:no.white,inverted:no.blue500},negative:{foreground:no.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:Fd,components:{Button:Oo,Text:lr}};var $n="https://api.frigade.com",ie=createContext({publicApiKey:"",setUserId:()=>{},flows:[],setFlows:()=>{},failedFlowResponses:[],setFailedFlowResponses:()=>{},flowResponses:[],setFlowResponses:()=>{},userProperties:{},setUserProperties:()=>{},openFlowStates:{},setOpenFlowStates:()=>{},completedFlowsToKeepOpenDuringSession:[],setCompletedFlowsToKeepOpenDuringSession:()=>{},customVariables:{},setCustomVariables:()=>{},isNewGuestUser:!1,setIsNewGuestUser:()=>{},hasActiveFullPageFlow:!1,setHasActiveFullPageFlow:()=>{},organizationId:"",setOrganizationId:()=>{},navigate:()=>{},defaultAppearance:at,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:$n,readonly:!1,debug:!1,disableImagePreloading:!1});function Pd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e);});}var vd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var te,q,R,Se,ke,ee;let r=typeof window!="undefined"?localStorage.getItem(Xt):null,[l,p]=useState(t||r),[d,s]=useState(o||null),[f,c]=useState([]),[g,b]=useState([]),[F,x]=useState([]),[h,P]=useState({}),[S,N]=useState({}),[U,T]=useState([]),[u,A]=useState({}),[C,I]=useState(!1),[B,v]=useState(!1),[L,_]=useState(!J(e)),K=(D,ne)=>{if(ne==="_blank"){window.open(D,"_blank");return}setTimeout(()=>{window.location.href=D;},50);},z={theme:w(w({},at.theme),(q=(te=i==null?void 0:i.defaultAppearance)==null?void 0:te.theme)!=null?q:{}),styleOverrides:w(w({},at.styleOverrides),(Se=(R=i==null?void 0:i.defaultAppearance)==null?void 0:R.styleOverrides)!=null?Se:{})};function J(D){return !!(D&&D.length>10&&D.substring(0,10)==="api_public")}useEffect(()=>{t&&p(t);},[t]),useEffect(()=>{l&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(Io)&&window.localStorage.getItem(Io)!==l&&Pd();},[l]),useEffect(()=>{o&&s(o);},[o]),useEffect(()=>{if(J(e))_(!1);else {console.error("Frigade SDK failed to initialize. API key provided is either missing or invalid."),_(!0);return}},[e,_]);let G={publicApiKey:e,userId:l,setUserId:p,setFlows:c,flows:f,failedFlowResponses:g,setFailedFlowResponses:b,flowResponses:F,setFlowResponses:x,userProperties:h,setUserProperties:P,openFlowStates:S,setOpenFlowStates:N,completedFlowsToKeepOpenDuringSession:U,setCompletedFlowsToKeepOpenDuringSession:T,customVariables:u,setCustomVariables:A,isNewGuestUser:C,setIsNewGuestUser:I,hasActiveFullPageFlow:B,setHasActiveFullPageFlow:v,organizationId:d,setOrganizationId:s,navigate:i&&i.navigate?i.navigate:K,defaultAppearance:z,shouldGracefullyDegrade:L,setShouldGracefullyDegrade:_,apiUrl:i&&i.apiUrl?i.apiUrl:$n,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0,disableImagePreloading:i&&i.disableImagePreloading?i.disableImagePreloading:!1},{overrides:O}=vn(z);return L?Y__default.createElement(ie.Provider,{value:G},Y__default.createElement(ThemeProvider,{theme:ue(z.theme,ar,O!=null?O:{},(ke=i==null?void 0:i.theme)!=null?ke:{})},n)):Y__default.createElement(ie.Provider,{value:G},Y__default.createElement(ThemeProvider,{theme:ue(z.theme,ar,O!=null?O:{},(ee=i==null?void 0:i.theme)!=null?ee:{})},n,Y__default.createElement(kn,null)))};var Mn=xe.span`
708
+ `;var Sn=({stepData:e,setCanContinue:t,onSaveData:o,appearance:i})=>{let n=e.props,[r,l]=useState([]),[p,d]=useState(!1),[s,m]=useState(e.id);return useEffect(()=>{r.length==0&&!p&&(d(!0),o({choice:[]}));},[p]),useEffect(()=>{s!==e.id&&(m(e.id),l([]));},[e]),useEffect(()=>{o({choice:r}),r.length>=n.minChoices?t(!0):t(!1);},[r]),q__default.createElement(mn,{className:a("selectListContainer",i)},q__default.createElement(un,null,q__default.createElement(fn,{className:a("selectListTitle",i)},e.title),q__default.createElement(gn,{appearance:i,className:a("selectListSubtitle",i)},e.subtitle)),n.options.map((c,f)=>{let b=r.includes(c.id);return q__default.createElement(hn,{key:`select-item-${f}`,onClick:()=>{if(r.includes(c.id)){l(r.filter(k=>k!==c.id));return}r.length<n.maxChoices?l([...r,c.id]):r.length==1&&n.maxChoices==1&&l([c.id]);},hideBottomBorder:f===n.options.length-1,className:a("selectListSelectItem",i)},q__default.createElement(xn,{className:a("selectListItemImage",i)},c.imageUri&&q__default.createElement(Cn,{src:c.imageUri,alt:`select-icon-${f}`}),q__default.createElement(yn,{appearance:i,className:a("selectListSelectItemText",i)},c.title)),q__default.createElement(dt,{appearance:i,value:b,primaryColor:i.theme.colorPrimary}))}))};var Kp=({children:e,id:t,shouldWrap:o=!1})=>q__default.createElement(q__default.Fragment,null,o?q__default.createElement("div",{key:t,style:{width:"100%",height:"100%",position:"absolute",top:0,left:0,zIndex:1,overflowY:"auto"}},e):e),sr=({appearance:e,steps:t,selectedStep:o,customStepTypes:i,customVariables:n,onButtonClick:r,onStepCompletion:l,flowId:p,type:d,hideOnFlowCompletion:s,onComplete:m,setVisible:c,setShowModal:f,onDismiss:b,showPagination:k=!1,customFormElements:C,allowBackNavigation:x,validationHandler:B,onFormDataChange:S,showFooter:N,prefillData:D,updateUrlOnPageChange:F,repeatable:g})=>{var xe;let h=w(w({},{linkCollection:dn,multiInput:Zi,callToAction:cn,selectList:Sn}),i),{primaryCTAClickSideEffects:I,secondaryCTAClickSideEffects:E}=fe(),[v,L]=useState(!1),[U,R]=useState({}),[z,J]=useState(!1),[X,O]=useState(null),Y=(xe=t[o])!=null?xe:null,{markStepCompleted:K,markStepStarted:re,isLoading:ye,updateCustomVariables:Pe,markFlowCompleted:oe}=le();useEffect(()=>{Pe(n);},[n,ye]),useEffect(()=>{S&&S(U,_(),t[o],o);},[U]);function _(){var G;return {data:(G=U[t[o].id])!=null?G:{},stepId:t[o].id,customVariables:n}}function ie(W,G,ne){let M=o+1<t.length?t[o+1]:null;return l&&l(W,ne,M,U,_()),r?r(W,o,G,M):!0}function ve(W,G){R(ne=>{let M={};return M[W.id]=G,w(w({},ne),M)});}function Ke(W){return W.selectedStep.imageUri?q__default.createElement(nn,{image:W.selectedStep.imageUri,appearance:e,className:a("formContainerSidebarImage",e)}):null}let Be=N&&q__default.createElement(pn,{step:t[o],canContinue:v&&!z,formType:d,selectedStep:o,appearance:e,onPrimaryClick:()=>$(void 0,null,function*(){if(J(!0),B){let ne=yield B(t[o],o,t[o+1],U,_());if(ne!==!0){O(typeof ne=="string"?ne:null),J(!1);return}else O(null);}let W=w({},_());yield K(p,t[o].id,W),o+1<t.length&&!x&&(yield re(p,t[o+1].id));let G=ie(t[o],"primary",o);if(o+1>=t.length&&(m&&m(),b&&b(),s&&G&&(c&&c(!1),f(!1)),yield oe(p),g&&(yield re(p,t[0].id),typeof window!="undefined"&&window.localStorage&&Object.keys(window.localStorage).forEach(M=>{M.startsWith(Hr)&&window.localStorage.removeItem(M);}))),I(t[o]),J(!1),typeof window!="undefined"&&!x&&F&&o+1<t.length){let ne=new URL(window.location.href);ne.searchParams.set("p",t[o+1].id),window.history.pushState({},"",ne.toString());}}),onSecondaryClick:()=>{ie(t[o],"secondary",o),E(t[o]);},onBack:()=>$(void 0,null,function*(){o-1>=0&&(J(!0),yield re(p,t[o-1].id),J(!1));}),steps:t,allowBackNavigation:x,errorMessage:X,isSaving:z});return q__default.createElement(q__default.Fragment,null,q__default.createElement(on,{className:a("formContainer",e)},q__default.createElement(Kp,{id:o,shouldWrap:d==="large-modal"},q__default.createElement(rn,{key:Y.id,type:d,className:a("formContent",e)},t.map(W=>{var ne;let G=h[(ne=W.type)!=null?ne:"multiInput"];return Y.id!==W.id?null:typeof G!="function"?G:q__default.createElement(G,{key:W.id,stepData:W,canContinue:v,setCanContinue:L,onSaveData:M=>{ve(W,M);},appearance:e,customFormElements:C,flowId:p,prefillData:D})}),k&&q__default.createElement(or,{className:a("formPagination",e),appearance:e,stepCount:t.length,currentStep:o}),Be)),d=="large-modal"&&q__default.createElement(Ke,{selectedStep:t[o]})))};var Yp=createGlobalStyle`
709
+ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map(([i,n])=>typeof n=="object"?`${i} { ${Object.entries(n).map(([l,p])=>`${jo(l)}: ${p};`).join(" ")} }`:`${jo(i)}: ${n};`).join(" ")} }`).join(" ")}`;function pe({appearance:e}){if(!e||!e.styleOverrides)return q__default.createElement(q__default.Fragment,null);let t=Object.entries(e.styleOverrides).filter(([o,i])=>typeof i=="object");return t.length===0?q__default.createElement(q__default.Fragment,null):q__default.createElement(Yp,{inlineStyles:t})}function Ye(e,t=!0){let[o,i]=useState(!1),{markStepStarted:n,isLoading:r,getFlowStatus:l,getFlowSteps:p,getCurrentStepIndex:d,targetingLogicShouldHideFlow:s,getFlow:m}=le(),c=p(e);function f(){return $(this,null,function*(){!o&&!r&&l(e)===_e&&s(m(e))===!1&&t&&c&&c.length>0&&(i(!0),yield n(e,c[d(e)].id));})}return useEffect(()=>{f();},[r,e,t]),{}}var Tn=({flowId:e,customStepTypes:t={},type:o="inline",visible:i,setVisible:n,customVariables:r,customFormElements:l,onComplete:p,appearance:d,hideOnFlowCompletion:s=!0,onStepCompletion:m,onButtonClick:c,dismissible:f=!0,endFlowOnDismiss:b=!1,modalPosition:k="center",repeatable:C=!1,onDismiss:x,showPagination:B=!1,allowBackNavigation:S=!1,validationHandler:N,showFrigadeBranding:D=!1,onFormDataChange:F,showFooter:g=!0,prefillData:T={},updateUrlOnPageChange:h=!1})=>{let{getFlow:I,getFlowSteps:E,isLoading:v,targetingLogicShouldHideFlow:L,getFlowStatus:U,getCurrentStepIndex:R,markFlowSkipped:z,markFlowNotStarted:J,markStepStarted:X}=le(),O=R(e),{mergeAppearanceWithDefault:Y}=ce(),[K,re]=useState(null),{setOpenFlowState:ye,getOpenFlowState:Pe,hasOpenModals:oe}=Ne();Ye(e,i);let _=E(e);d=Y(d);let[ie,ve]=i!==void 0&&n!==void 0?[i,n]:[Pe(e,!0),W=>ye(e,W)],Ke=typeof window!="undefined"?window.location.hash:null;if(useEffect(()=>{var W;if(_&&_.length>0&&S){let G=typeof window!="undefined"&&((W=window==null?void 0:window.location)!=null&&W.hash)?window.location.hash.replace("#",""):"";if(_&&(_==null?void 0:_.length)>0){let ne=-1;if(G){let M=G;ne=_.findIndex(Q=>Q.id===M),K===G&&(ne=-1);}ne!==-1&&(re(G),X(e,_[ne].id));}}},[Ke]),useEffect(()=>{!v&&_&&_.length&&typeof window!="undefined"&&S&&(re(_[O].id),window.location.hash=_[O].id);},[v,O,_]),v)return null;let Be=I(e);if(!Be||L(Be)||!_||i!==void 0&&i===!1||U(e)===de&&s&&!C||(o=="modal"||o=="corner-modal")&&oe(e))return null;let xe=()=>{ve(!1),x&&x(),b===!0&&z(e);};if(k=="center"&&o==="modal"||o==="large-modal"){let W={padding:"24px"};return o==="large-modal"?(W.width="85%",W.height="90%",W.maxHeight="800px",W.minHeight="500px",W.padding="0"):W.width="400px",q__default.createElement(tt,{appearance:d,onClose:xe,visible:ie,style:W,dismissible:f,showFrigadeBranding:D},q__default.createElement(pe,{appearance:d}),q__default.createElement(sr,{appearance:d,steps:_,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:ve,onDismiss:x,showPagination:B,customFormElements:l,allowBackNavigation:S,validationHandler:N,onFormDataChange:F,showFooter:g,prefillData:T,updateUrlOnPageChange:h,repeatable:C}))}return o==="modal"&&k!=="center"?q__default.createElement(Jo,{appearance:d,onClose:xe,visible:ie,modalPosition:k},q__default.createElement(pe,{appearance:d}),q__default.createElement(sr,{appearance:d,steps:_,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:ve,onDismiss:x,showPagination:B,customFormElements:l,allowBackNavigation:S,validationHandler:N,onFormDataChange:F,showFooter:g,prefillData:T,updateUrlOnPageChange:h,repeatable:C})):q__default.createElement(q__default.Fragment,null,q__default.createElement(pe,{appearance:d}),q__default.createElement(sr,{appearance:d,steps:_,selectedStep:O,customStepTypes:t,customVariables:r,onButtonClick:c,onStepCompletion:m,flowId:e,type:o,hideOnFlowCompletion:s,onComplete:p,setVisible:n,setShowModal:ve,onDismiss:x,showPagination:B,customFormElements:l,allowBackNavigation:S,validationHandler:N,onFormDataChange:F,showFooter:g,prefillData:T,updateUrlOnPageChange:h,repeatable:C}))},Fn=Tn;function Jr(){let{organizationId:e,userId:t,setOrganizationId:o}=useContext(se),{mutateUserFlowState:i}=We(),{config:n,apiUrl:r}=et(),l=qt(),{verifySDKInitiated:p}=Yt();function d(f,b){return `frigade-user-group-registered-${f}-${b}`}useEffect(()=>{if(t&&e){if(t.startsWith(Xt))return;let f=d(t,e);localStorage.getItem(f)||(l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify({foreignUserId:t,foreignUserGroupId:e})})),localStorage.setItem(f,"true"));}},[t,e]);let s=useCallback(f=>$(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 b={foreignUserId:t,foreignUserGroupId:e,properties:f};yield l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify(b)})),i();}),[e,t,n,i]),m=useCallback((f,b)=>$(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:f,properties:b}]};yield l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify(C)})),i();}),[e,t,n,i]),c=useCallback((f,b)=>$(this,null,function*(){if(p())if(b){let k=d(t,f);localStorage.setItem(k,"true"),o(f);let C={foreignUserId:t,foreignUserGroupId:f,properties:b};yield l(`${r}userGroups`,j(w({},n),{method:"POST",body:JSON.stringify(C)})),i();}else o(f);}),[t,n,i]);return {organizationId:e,setOrganizationId:o,setOrganizationIdWithProperties:c,addPropertiesToOrganization:s,trackEventForOrganization:m}}var Qt="frigade-xFrigade_guestUserId",Io="frigade-xFrigade_userId",kn=({})=>{let{setFlowResponses:e}=To(),{userFlowStatesData:t,isLoadingUserFlowStateData:o,mutateUserFlowState:i}=We(),{userId:n,setUserId:r}=Fo(),[l,p]=useState(n),{getFlowStatus:d}=le(),{flows:s,userProperties:m,setIsNewGuestUser:c,flowResponses:f,disableImagePreloading:b}=useContext(se),[k,C]=useState([]),[x,B]=useState([]),{organizationId:S}=Jr(),[N,D]=useState(S),[F,g]=useState(!1);useEffect(()=>{if(!o&&t)for(let E=0;E<t.length;E++){let v=t[E],L=s.find(U=>U.slug===(v==null?void 0:v.flowId));if(L&&v&&v.shouldTrigger===!0&&L.type=="FORM"&&L.triggerType==="AUTOMATIC"&&!x.includes(L.slug)){setTimeout(()=>{T(v.flowId);},500);break}}},[o,t]),useEffect(()=>{f.length>0&&i();},[f]),useEffect(()=>{F||(g(!0),i());},[o,g]);function T(E){let v=s.find(L=>L.slug===E);v&&v.triggerType==="AUTOMATIC"&&!x.includes(v.slug)&&(B([...x,v.slug]),C([v]));}function h(){if(!n){let E=localStorage.getItem(Io);if(E){r(E);return}let v=localStorage.getItem(Qt);if(v){r(v);return}c(!0);let L=Xt+v4();try{localStorage.setItem(Qt,L);}catch(U){console.log("Failed to save guest user id locally: Local storage unavailable",U);}r(U=>U||L);}}useEffect(()=>{try{if(!b&&s){let E=[];s.forEach(v=>{if(v.data&&v.active){let L=v.data.match(/"imageUri":"(.*?)"/g);L&&L.forEach(U=>{let R=U.replace('"imageUri":"',"").replace('"',"");if(E.includes(R))return;let z=new Image;z.src=R,E.push(R);});}});}}catch(E){}},[s]),useEffect(()=>{if(n!==l&&(e([]),i()),p(n),n&&!n.startsWith(Xt))try{localStorage.setItem(Io,n);}catch(E){console.log("Failed to save user id locally: Local storage available",E);}n===null&&setTimeout(()=>{n===null&&h();},50);},[n,s,m]),useEffect(()=>{S!=N&&(D(S),e([]),i());},[S,N,D]);function I(){return q__default.createElement(q__default.Fragment,null,k.map(E=>d(E.slug)!==_e?null:q__default.createElement("span",{key:E.slug},q__default.createElement(Fn,{flowId:E.slug,type:"modal",modalPosition:"center",endFlowOnDismiss:!0}))))}return q__default.createElement(q__default.Fragment,null,q__default.createElement(I,null))};var Pn={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 od(e){if(!e)return;let t={};return Object.entries(e).forEach(([o,i])=>{if(Pn[o]){let n=Pn[o].split("."),r=t;n.forEach((l,p)=>{r[l]||(r[l]=p===n.length-1?i:{}),r=r[l];});}}),t}function rd(e){if(!e)return;let t=ue({},e),o={};return Object.keys(t).forEach(i=>{let n=`.fr-${i}`;o[n]=t[i];}),o}function vn(e){let{theme:t,styleOverrides:o}=e,i=od(t),n=rd(o);return {overrides:i,css:n}}var gd={width:{property:"width",scale:"sizes",transform:(e,t)=>get(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},hd=Ce("div")(({css:e})=>e,compose(border,color,shadow,space,typography,system(gd))),No=n=>{var r=n,{as:e,children:t,overrides:o}=r,i=Me(r,["as","children","overrides"]);let l=useTheme(),p={border:"none",boxSizing:"border-box",m:0,p:0},d=()=>q__default.createElement(hd,w(w({as:e},p),i),t);if(o!==void 0){let s=ue(l,o);return q__default.createElement(ThemeProvider,{theme:s},d())}return d()};var Oo={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"}},yd={sm:{paddingX:4,paddingY:1},md:{paddingX:6,paddingY:2}},An=Ce(No)(()=>({whiteSpace:"nowrap"}),compose(variant({scale:"components.Button",variants:"components.Button"}),variant({prop:"size",variants:yd})));var lr={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 In=Ce(No)(variant({scale:"components.Text",variants:"components.Text"}),system({fontWeight:{property:"fontWeight",scale:"fontWeights"}}));var Nn=4,On="px",Td=20,Fd=Object.fromEntries(Array.from(Array(Td+1),(e,t)=>t===0?[.5,`${.5*Nn}${On}`]:[t,`${t*Nn}${On}`])),so={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"},ar={colors:j(w({},so),{neutral:{foreground:so.gray300},primary:{background:so.blue500,foreground:so.white,inverted:so.blue500},negative:{foreground:so.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:Fd,components:{Button:Oo,Text:lr}};var $n="https://api.frigade.com",se=createContext({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:pt,shouldGracefullyDegrade:!1,setShouldGracefullyDegrade:()=>{},apiUrl:$n,readonly:!1,debug:!1,disableImagePreloading:!1});function Pd(){Object.keys(localStorage).forEach(e=>{e.startsWith("frigade-")&&localStorage.removeItem(e);});}var vd=({publicApiKey:e,userId:t,organizationId:o,config:i,children:n})=>{var Y,K,re,ye,Pe,oe;let r=typeof window!="undefined"?localStorage.getItem(Qt):null,[l,p]=useState(t||r),[d,s]=useState(o||null),[m,c]=useState([]),[f,b]=useState([]),[k,C]=useState([]),[x,B]=useState({}),[S,N]=useState({}),[D,F]=useState([]),[g,T]=useState({}),[h,I]=useState(!1),[E,v]=useState(!1),[L,U]=useState(!J(e)),R=(_,ie)=>{if(ie==="_blank"){window.open(_,"_blank");return}setTimeout(()=>{window.location.href=_;},50);},z={theme:w(w({},pt.theme),(K=(Y=i==null?void 0:i.defaultAppearance)==null?void 0:Y.theme)!=null?K:{}),styleOverrides:w(w({},pt.styleOverrides),(ye=(re=i==null?void 0:i.defaultAppearance)==null?void 0:re.styleOverrides)!=null?ye:{})};function J(_){return !!(_&&_.length>10&&_.substring(0,10)==="api_public")}useEffect(()=>{t&&p(t);},[t]),useEffect(()=>{l&&typeof window!="undefined"&&window.localStorage&&window.localStorage.getItem(Io)&&window.localStorage.getItem(Io)!==l&&Pd();},[l]),useEffect(()=>{o&&s(o);},[o]),useEffect(()=>{if(J(e))U(!1);else {console.error("Frigade SDK failed to initialize. API key provided is either missing or invalid."),U(!0);return}},[e,U]);let X={publicApiKey:e,userId:l,setUserId:p,setFlows:c,flows:m,failedFlowResponses:f,setFailedFlowResponses:b,flowResponses:k,setFlowResponses:C,userProperties:x,setUserProperties:B,openFlowStates:S,setOpenFlowStates:N,completedFlowsToKeepOpenDuringSession:D,setCompletedFlowsToKeepOpenDuringSession:F,customVariables:g,setCustomVariables:T,isNewGuestUser:h,setIsNewGuestUser:I,hasActiveFullPageFlow:E,setHasActiveFullPageFlow:v,organizationId:d,setOrganizationId:s,navigate:i&&i.navigate?i.navigate:R,defaultAppearance:z,shouldGracefullyDegrade:L,setShouldGracefullyDegrade:U,apiUrl:i&&i.apiUrl?i.apiUrl:$n,readonly:i&&i.readonly?i.readonly:!1,debug:i&&i.debug?i.debug:!1,flowDataOverrides:i&&i.__internal__?i.__internal__:void 0,disableImagePreloading:i&&i.disableImagePreloading?i.disableImagePreloading:!1},{overrides:O}=vn(z);return L?q__default.createElement(se.Provider,{value:X},q__default.createElement(ThemeProvider,{theme:ue(z.theme,ar,O!=null?O:{},(Pe=i==null?void 0:i.theme)!=null?Pe:{})},n)):q__default.createElement(se.Provider,{value:X},q__default.createElement(ThemeProvider,{theme:ue(z.theme,ar,O!=null?O:{},(oe=i==null?void 0:i.theme)!=null?oe:{})},n,q__default.createElement(kn,null)))};var Mn=Ce.span`
710
710
  font-weight: 600;
711
711
  font-size: 14px;
712
712
  font-style: normal;
@@ -718,7 +718,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
718
718
  margin-left: 32px;
719
719
  padding-right: 12px;
720
720
  ${e=>Ee(e)}
721
- `,Bd=xe.div`
721
+ `,Bd=Ce.div`
722
722
  flex-direction: row;
723
723
  justify-content: space-between;
724
724
  display: flex;
@@ -727,11 +727,11 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
727
727
  padding-right: 8px;
728
728
  width: 100%;
729
729
  ${e=>Ee(e)}
730
- `,dr=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:l="round",appearance:p})=>Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(Bd,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:w({},n)},i==="left"&&e&&Y__default.createElement(Mn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p,dangerouslySetInnerHTML:H(e)}),Y__default.createElement(pt,{appearance:p,value:t,type:l,primaryColor:r}),i==="right"&&e&&Y__default.createElement(Mn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p,dangerouslySetInnerHTML:H(e)})),Y__default.createElement(ae,{appearance:p}));var Un=xe.div`
730
+ `,dr=({label:e,value:t,labelStyle:o={},labelPosition:i="right",style:n,primaryColor:r="#000000",checkBoxType:l="round",appearance:p})=>q__default.createElement(q__default.Fragment,null,q__default.createElement(Bd,{className:a("checklistStepsContainer",p),appearance:p,styleOverrides:w({},n)},i==="left"&&e&&q__default.createElement(Mn,{className:a("checklistStepLabel",p),styleOverrides:o,appearnace:p,dangerouslySetInnerHTML:H(e)}),q__default.createElement(dt,{appearance:p,value:t,type:l,primaryColor:r}),i==="right"&&e&&q__default.createElement(Mn,{className:a("checklistStepLabel",p),styleOverrides:o,appearance:p,dangerouslySetInnerHTML:H(e)})),q__default.createElement(pe,{appearance:p}));var Un=Ce.div`
731
731
  font-weight: 700;
732
732
  font-size: 18px;
733
733
  line-height: 22px;
734
- `,_n=xe.p`
734
+ `,_n=Ce.p`
735
735
  font-weight: 600;
736
736
  font-size: 16px;
737
737
  line-height: 24px;
@@ -739,7 +739,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
739
739
  letter-spacing: 0.32px;
740
740
  font-style: normal;
741
741
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
742
- `,zn=xe.p`
742
+ `,zn=Ce.p`
743
743
  font-weight: 400;
744
744
  font-size: 14px;
745
745
  font-style: normal;
@@ -748,26 +748,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
748
748
  letter-spacing: 0.28px;
749
749
  margin: 8px 0px 0px 0px;
750
750
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
751
- `,cr=xe.div`
751
+ `,cr=Ce.div`
752
752
  width: 6px;
753
753
  position: absolute;
754
754
  left: 0;
755
755
  height: 100%;
756
756
  border-top-right-radius: 4px;
757
757
  border-bottom-right-radius: 4px;
758
- `,Wn=xe.div`
758
+ `,Wn=Ce.div`
759
759
  flex-direction: row;
760
760
  justify-content: flex-start;
761
761
  border-bottom: 1px solid ${e=>e.theme.colorBorder};
762
762
  padding-right: 16px;
763
- `;var Hn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:l})=>{var p,d,s,f,c;return Y__default.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r();}},o&&Y__default.createElement(cr,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(p=l==null?void 0:l.theme)==null?void 0:p.colorPrimary)!=null?d:i}}),Y__default.createElement(Wn,{className:a("checklistStepItem",l),key:`hero-checklist-step-${t}`,appearance:l,role:"listitem"},Y__default.createElement(dr,{value:e.complete,labelPosition:"left",label:(s=e.stepName)!=null?s:e.title,style:n,primaryColor:(c=(f=l==null?void 0:l.theme)==null?void 0:f.colorPrimary)!=null?c:i,appearance:l})))};xe.h1`
763
+ `;var Hn=({data:e,index:t,isSelected:o,primaryColor:i,style:n,onClick:r,appearance:l})=>{var p,d,s,m,c;return q__default.createElement("div",{style:{position:"relative",paddingLeft:"0px"},onClick:()=>{r();}},o&&q__default.createElement(cr,{className:a("checklistStepItemSelectedIndicator",l),layoutId:"checklis-step-selected",style:{backgroundColor:(d=(p=l==null?void 0:l.theme)==null?void 0:p.colorPrimary)!=null?d:i}}),q__default.createElement(Wn,{className:a("checklistStepItem",l),key:`hero-checklist-step-${t}`,appearance:l,role:"listitem"},q__default.createElement(dr,{value:e.complete,labelPosition:"left",label:(s=e.stepName)!=null?s:e.title,style:n,primaryColor:(c=(m=l==null?void 0:l.theme)==null?void 0:m.colorPrimary)!=null?c:i,appearance:l})))};Ce.h1`
764
764
  display: flex;
765
765
  margin: 0;
766
766
  font-size: 18px;
767
- `;xe.h2`
767
+ `;Ce.h2`
768
768
  font-size: 15px;
769
769
  color: #4d4d4d;
770
- `;var Vn=xe.div`
770
+ `;var Vn=Ce.div`
771
771
  position: absolute;
772
772
  left: 0;
773
773
  top: 0;
@@ -776,7 +776,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
776
776
  border-radius: 20px;
777
777
  background-color: ${e=>e.theme.colorPrimary};
778
778
  transition: width 0.5s;
779
- `,jn=xe.div`
779
+ `,jn=Ce.div`
780
780
  position: relative;
781
781
  left: 0;
782
782
  top: 0;
@@ -786,7 +786,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
786
786
  border-radius: 20px;
787
787
  background-color: ${e=>e.theme.colorPrimary};
788
788
  opacity: 0.12;
789
- `;var Ed=xe.div`
789
+ `;var Ed=Ce.div`
790
790
  display: flex;
791
791
  flex-direction: ${e=>e.textLocation=="top"?"column":"row"};
792
792
  justify-content: flex-start;
@@ -794,25 +794,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
794
794
  width: 100%;
795
795
 
796
796
  ${e=>Ee(e)}
797
- `,Ad=xe.div`
797
+ `,Ad=Ce.div`
798
798
  flex-grow: 1;
799
799
  position: relative;
800
800
  ${e=>e.textLocation=="top"?"width: 100%;":""}
801
- `,Id=xe.span`
801
+ `,Id=Ce.span`
802
802
  font-weight: 600;
803
803
  font-size: 14px;
804
804
  line-height: 18px;
805
805
  padding-right: ${e=>e.padding};
806
806
  margin-bottom: ${e=>e.textLocation=="top"?"8px":"0px"};
807
807
  ${e=>Ee(e)}
808
- `;var He=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:l})=>{var g;if(t===0)return Y__default.createElement(Y__default.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(g=l==null?void 0:l.theme)==null?void 0:g.colorText});let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",s=Math.round(e/t*100),f=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${s}% complete`),i==="top"&&(f="0px"),Y__default.createElement(Ed,{className:a("progressBarContainer",l),textLocation:i,styleOverrides:n},Y__default.createElement(Id,{className:a("progressBarStepText",l),styleOverrides:j(w({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:l,padding:f,textLocation:i},c),Y__default.createElement(Ad,{textLocation:i,className:a("progressBar",l)},Y__default.createElement(Vn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:l,className:a("progressBarFill",l)}),Y__default.createElement(jn,{className:a("progressBarBackground",l),barHeight:d,appearance:l})))};var so=({stepData:e,appearance:t})=>Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(_n,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:H(e.title)}),Y__default.createElement(zn,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:H(e.subtitle)}));var lo=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick();},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick();};return Y__default.createElement(tr,{className:a("ctaContainer",t)},Y__default.createElement(le,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&Y__default.createElement(le,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var ao=({stepData:e,appearance:t})=>Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(so,{stepData:e,appearance:t}),Y__default.createElement(lo,{stepData:e,appearance:t}));function Gn(e){return Y__default.createElement(ot,{appearance:e.appearance,videoUri:e.videoUri,autoplay:e.autoplay,loop:e.loop,hideControls:e.hideControls})}var Zr="default",Ld=xe.img`
808
+ `;var Ve=({count:e,total:t,display:o="count",textLocation:i="left",style:n={},textStyle:r={},appearance:l})=>{var f;if(t===0)return q__default.createElement(q__default.Fragment,null);Object.keys(r).length===0&&r.constructor===Object&&(r={color:(f=l==null?void 0:l.theme)==null?void 0:f.colorText});let p=e===0?"10px":`${e/t*100}%`,d=o==="compact"?"8px":"10px",s=Math.round(e/t*100),m=o==="compact"?"10px":"14px",c;return o==="count"||o==="compact"?c=`${e}/${t}`:o==="percent"&&(c=`${s}% complete`),i==="top"&&(m="0px"),q__default.createElement(Ed,{className:a("progressBarContainer",l),textLocation:i,styleOverrides:n},q__default.createElement(Id,{className:a("progressBarStepText",l),styleOverrides:j(w({},r),{fontSize:o==="compact"?12:14,fontWeight:600}),appearance:l,padding:m,textLocation:i},c),q__default.createElement(Ad,{textLocation:i,className:a("progressBar",l)},q__default.createElement(Vn,{style:{zIndex:o=="compact"?1:5},fgWidth:p,barHeight:d,appearance:l,className:a("progressBarFill",l)}),q__default.createElement(jn,{className:a("progressBarBackground",l),barHeight:d,appearance:l})))};var lo=({stepData:e,appearance:t})=>q__default.createElement(q__default.Fragment,null,q__default.createElement(_n,{appearance:t,className:a("checklistStepTitle",t),dangerouslySetInnerHTML:H(e.title)}),q__default.createElement(zn,{appearance:t,className:a("checklistStepSubtitle",t),dangerouslySetInnerHTML:H(e.subtitle)}));var ao=({stepData:e,appearance:t})=>{let o=()=>{e.handlePrimaryButtonClick&&e.handlePrimaryButtonClick();},i=()=>{e.handleSecondaryButtonClick&&e.handleSecondaryButtonClick();};return q__default.createElement(tr,{className:a("ctaContainer",t)},q__default.createElement(ae,{appearance:t,title:e.primaryButtonTitle,onClick:o}),e.secondaryButtonTitle&&q__default.createElement(ae,{appearance:t,secondary:!0,title:e.secondaryButtonTitle,onClick:i,style:{width:"auto",marginRight:"12px"}}))};var po=({stepData:e,appearance:t})=>q__default.createElement(q__default.Fragment,null,q__default.createElement(lo,{stepData:e,appearance:t}),q__default.createElement(ao,{stepData:e,appearance:t}));function Gn(e){return q__default.createElement(rt,{appearance:e.appearance,videoUri:e.videoUri,autoplay:e.autoplay,loop:e.loop,hideControls:e.hideControls})}var Zr="default",Ld=Ce.img`
809
809
  border-radius: ${e=>{var t;return (t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
810
810
  width: 100%;
811
811
  height: auto;
812
812
  min-height: 200px;
813
- `,Kn=({stepData:e,appearance:t})=>{var o,i,n;if(e!=null&&e.StepContent){let r=e.StepContent;return Y__default.createElement("div",null,r)}return Y__default.createElement(Un,{className:a("checklistStepContent",t)},e.imageUri?Y__default.createElement(Ld,{className:a("checklistStepImage",t),src:e.imageUri,appearance:t}):null,e.videoUri?Y__default.createElement(Gn,{videoUri:e.videoUri,appearance:t,autoplay:(o=e.props)==null?void 0:o.autoplayVideo,loop:(i=e.props)==null?void 0:i.loopVideo,hideControls:(n=e.props)==null?void 0:n.hideVideoControls}):null,Y__default.createElement(ao,{stepData:e,appearance:t}))};var qn=xe.div`
813
+ `,Kn=({stepData:e,appearance:t})=>{var o,i,n;if(e!=null&&e.StepContent){let r=e.StepContent;return q__default.createElement("div",null,r)}return q__default.createElement(Un,{className:a("checklistStepContent",t)},e.imageUri?q__default.createElement(Ld,{className:a("checklistStepImage",t),src:e.imageUri,appearance:t}):null,e.videoUri?q__default.createElement(Gn,{videoUri:e.videoUri,appearance:t,autoplay:(o=e.props)==null?void 0:o.autoplayVideo,loop:(i=e.props)==null?void 0:i.loopVideo,hideControls:(n=e.props)==null?void 0:n.hideVideoControls}):null,q__default.createElement(po,{stepData:e,appearance:t}))};var qn=Ce.div`
814
814
  display: block;
815
- `,Dd=xe.div`
815
+ `,Dd=Ce.div`
816
816
  display: flex;
817
817
  flex-direction: row;
818
818
  flex-wrap: wrap;
@@ -822,20 +822,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
822
822
  align-content: center;
823
823
  margin-top: 24px;
824
824
  margin-bottom: 24px;
825
- `,Ud=xe.div`
825
+ `,Ud=Ce.div`
826
826
  display: flex;
827
827
  align-items: center;
828
828
  justify-content: flex-start;
829
829
  flex-direction: column;
830
830
  margin-right: 16px;
831
- `,_d=xe.video`
831
+ `,_d=Ce.video`
832
832
  width: 200px;
833
833
  height: 120px;
834
- `,zd=xe.div`
834
+ `,zd=Ce.div`
835
835
  font-size: 14px;
836
836
  line-height: 20px;
837
837
  text-align: center;
838
- `,Wd=xe.div`
838
+ `,Wd=Ce.div`
839
839
  position: absolute;
840
840
  width: 200px;
841
841
  height: 120px;
@@ -855,9 +855,9 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
855
855
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
856
856
  border-radius: 50%;
857
857
  }
858
- `,Yn="videoCarousel",Jn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return Y__default.createElement(qn,null,Y__default.createElement(ao,{stepData:e,appearance:t}));function o({video:r}){let l=useRef(),[p,d]=useState(!1);return Y__default.createElement(Ud,null,!p&&Y__default.createElement(Wd,{onClick:()=>{d(!0),l.current.play();},appearance:t},Y__default.createElement(rr,null)),Y__default.createElement(_d,{controls:p,ref:l,play:p,src:r.uri}),Y__default.createElement(zd,null,r.title))}let i=e.props;return i.videos?Y__default.createElement(qn,null,Y__default.createElement(so,{stepData:e,appearance:t}),Y__default.createElement(Dd,null,i.videos.map((r,l)=>Y__default.createElement("span",{key:`${r.uri}-${l}`},Y__default.createElement(o,{video:r})))),Y__default.createElement(lo,{stepData:e,appearance:t})):null};var Xn=xe.div`
858
+ `,Yn="videoCarousel",Jn=({stepData:e,appearance:t})=>{var n;if(!((n=e.props)!=null&&n.videos))return q__default.createElement(qn,null,q__default.createElement(po,{stepData:e,appearance:t}));function o({video:r}){let l=useRef(),[p,d]=useState(!1);return q__default.createElement(Ud,null,!p&&q__default.createElement(Wd,{onClick:()=>{d(!0),l.current.play();},appearance:t},q__default.createElement(rr,null)),q__default.createElement(_d,{controls:p,ref:l,play:p,src:r.uri}),q__default.createElement(zd,null,r.title))}let i=e.props;return i.videos?q__default.createElement(qn,null,q__default.createElement(lo,{stepData:e,appearance:t}),q__default.createElement(Dd,null,i.videos.map((r,l)=>q__default.createElement("span",{key:`${r.uri}-${l}`},q__default.createElement(o,{video:r})))),q__default.createElement(ao,{stepData:e,appearance:t})):null};var Xn=Ce.div`
859
859
  display: block;
860
- `,Hd=xe.pre`
860
+ `,Hd=Ce.pre`
861
861
  display: block;
862
862
  background-color: #2a2a2a;
863
863
  color: #f8f8f8;
@@ -873,14 +873,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
873
873
  white-space: -o-pre-wrap; /* Opera 7 */
874
874
  word-wrap: break-word; /* Internet Explorer 5.5+ */
875
875
  margin-bottom: 24px;
876
- `,Vd=xe.div`
876
+ `,Vd=Ce.div`
877
877
  font-size: 15px;
878
878
  line-height: 20px;
879
879
  margin-bottom: 12px;
880
880
  margin-top: 12px;
881
- `,jd=xe.div`
881
+ `,jd=Ce.div`
882
882
  margin-top: 24px;
883
- `,Qn="codeSnippet",Zn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return Y__default.createElement(Xn,null,Y__default.createElement(ao,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?Y__default.createElement(Xn,{className:a("codeSnippetContainer",t)},Y__default.createElement(so,{stepData:e,appearance:t}),Y__default.createElement(jd,null,o.codeSnippets.map((n,r)=>Y__default.createElement("div",{key:r},n.title?Y__default.createElement(Vd,{dangerouslySetInnerHTML:H(n.title)}):null,n.code?Y__default.createElement(Hd,null,n.code):null))),Y__default.createElement(lo,{stepData:e,appearance:t})):null};var Kd=xe.div`
883
+ `,Qn="codeSnippet",Zn=({stepData:e,appearance:t})=>{var i;if(!((i=e.props)!=null&&i.codeSnippets))return q__default.createElement(Xn,null,q__default.createElement(po,{stepData:e,appearance:t}));let o=e.props;return o.codeSnippets?q__default.createElement(Xn,{className:a("codeSnippetContainer",t)},q__default.createElement(lo,{stepData:e,appearance:t}),q__default.createElement(jd,null,o.codeSnippets.map((n,r)=>q__default.createElement("div",{key:r},n.title?q__default.createElement(Vd,{dangerouslySetInnerHTML:H(n.title)}):null,n.code?q__default.createElement(Hd,null,n.code):null))),q__default.createElement(ao,{stepData:e,appearance:t})):null};var Kd=Ce.div`
884
884
  display: flex;
885
885
  flex-direction: row;
886
886
  overflow: hidden;
@@ -888,14 +888,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
888
888
  background: ${e=>{var t;return (t=e.appearance)==null?void 0:t.theme.colorBackground}};
889
889
  border-radius: ${e=>{var t;return (t=e.appearance)==null?void 0:t.theme.borderRadius}}px;
890
890
  ${e=>Ee(e)}
891
- `,qd=xe.h1`
891
+ `,qd=Ce.h1`
892
892
  font-size: 18px;
893
893
  font-style: normal;
894
894
  font-weight: 700;
895
895
  line-height: 24px;
896
896
  letter-spacing: 0.36px;
897
897
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
898
- `,Yd=xe.h2`
898
+ `,Yd=Ce.h2`
899
899
  font-size: 14px;
900
900
  font-style: normal;
901
901
  font-weight: 400;
@@ -903,49 +903,49 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
903
903
  letter-spacing: 0.28px;
904
904
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
905
905
  margin: 10px 0px 0px 0px;
906
- `,Jd=xe.div`
906
+ `,Jd=Ce.div`
907
907
  padding: 28px 0px 28px 28px;
908
908
  border-bottom: 1px solid ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
909
- `,Xd=xe.div`
909
+ `,Xd=Ce.div`
910
910
  flex: 1;
911
- `,Qd=xe.div`
911
+ `,Qd=Ce.div`
912
912
  list-style: none;
913
913
  padding: 0;
914
914
  margin: 0;
915
915
  cursor: pointer;
916
916
  min-width: 300px;
917
- `,Zd=xe.div`
917
+ `,Zd=Ce.div`
918
918
  width: 1px;
919
919
  margin-right: 40px;
920
920
  background: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
921
- `,Rd=xe.div`
921
+ `,Rd=Ce.div`
922
922
  flex: 2;
923
923
  padding: 40px 40px 40px 0px;
924
- `,ec=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:l="",customStepTypes:p=new Map,appearance:d,type:s})=>{let{mergeAppearanceWithDefault:f}=ce();d=f(d);let c={[Zr]:Kn,[Yn]:Jn,[Qn]:Zn},g=w(w({},c),p),[b,F]=useState(0),x=n!=null?n:b,h=r!=null?r:F,P=o.filter(N=>N.complete===!0).length,S=()=>{var N;return !((N=o[x])!=null&&N.type)||!g[o[x].type]?g[Zr]({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 Y__default.createElement(Kd,{type:s,styleOverrides:i,className:l,appearance:d},Y__default.createElement(Xd,{className:a("checklistHeaderContainer",d),appearance:d},Y__default.createElement(Jd,{className:a("checklistHeader",d),appearance:d},Y__default.createElement(qd,{className:a("checklistTitle",d),appearance:d,dangerouslySetInnerHTML:H(e)}),Y__default.createElement(Yd,{className:a("checklistSubtitle",d),appearance:d,dangerouslySetInnerHTML:H(t)}),Y__default.createElement(He,{total:o.length,count:P,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),Y__default.createElement(Qd,{className:a("checklistStepsContainer",d)},o.map((N,U)=>Y__default.createElement(Hn,{data:N,index:U,key:U,listLength:o.length,isSelected:U===x,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{h(U);},appearance:d})))),Y__default.createElement(Zd,{appearance:d,className:a("checklistDivider",d)}),Y__default.createElement(Rd,null,Y__default.createElement(S,null)))},Rr=ec;var oc=xe.svg`
924
+ `,ec=({title:e,subtitle:t,steps:o=[],style:i={},selectedStep:n,setSelectedStep:r,className:l="",customStepTypes:p=new Map,appearance:d,type:s})=>{let{mergeAppearanceWithDefault:m}=ce();d=m(d);let c={[Zr]:Kn,[Yn]:Jn,[Qn]:Zn},f=w(w({},c),p),[b,k]=useState(0),C=n!=null?n:b,x=r!=null?r:k,B=o.filter(N=>N.complete===!0).length,S=()=>{var N;return !((N=o[C])!=null&&N.type)||!f[o[C].type]?f[Zr]({stepData:o[C],appearance:d}):typeof f[o[C].type]!="function"?f[o[C].type]:f[o[C].type]({stepData:o[C],appearance:d})};return q__default.createElement(Kd,{type:s,styleOverrides:i,className:l,appearance:d},q__default.createElement(Xd,{className:a("checklistHeaderContainer",d),appearance:d},q__default.createElement(Jd,{className:a("checklistHeader",d),appearance:d},q__default.createElement(qd,{className:a("checklistTitle",d),appearance:d,dangerouslySetInnerHTML:H(e)}),q__default.createElement(Yd,{className:a("checklistSubtitle",d),appearance:d,dangerouslySetInnerHTML:H(t)}),q__default.createElement(Ve,{total:o.length,count:B,style:{marginTop:"24px",paddingRight:"40px"},appearance:d})),q__default.createElement(Qd,{className:a("checklistStepsContainer",d)},o.map((N,D)=>q__default.createElement(Hn,{data:N,index:D,key:D,listLength:o.length,isSelected:D===C,primaryColor:d.theme.colorPrimary,style:{justifyContent:"space-between"},onClick:()=>{x(D);},appearance:d})))),q__default.createElement(Zd,{appearance:d,className:a("checklistDivider",d)}),q__default.createElement(Rd,null,q__default.createElement(S,null)))},Rr=ec;var oc=Ce.svg`
925
925
  transition: 'transform 0.35s ease-in-out';
926
- `,co=({style:e,className:t})=>Y__default.createElement(oc,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},Y__default.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));var ei={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},es=xe.div`
926
+ `,mo=({style:e,className:t})=>q__default.createElement(oc,{width:"7",height:"10",viewBox:"0 0 9 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e,className:t},q__default.createElement("path",{d:"M1 13L7.5 7L0.999999 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}));var ei={boxShadow:"0px 6px 25px rgba(0, 0, 0, 0.06)",padding:"32px",maxHeight:"700px",msOverflowStyle:"none",scrollbarWidth:"none",paddingBottom:"12px",minHeight:"610px"},es=Ce.div`
927
927
  max-height: 350px;
928
928
  padding-bottom: 40px;
929
- `,ts=xe.div`
929
+ `,ts=Ce.div`
930
930
  display: flex;
931
931
  flex-direction: column;
932
932
  margin-top: 20px;
933
- `,os=xe.h1`
933
+ `,os=Ce.h1`
934
934
  font-style: normal;
935
935
  font-weight: 600;
936
936
  font-size: 30px;
937
937
  line-height: 36px;
938
938
  margin-bottom: 16px;
939
939
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
940
- `,rs=xe.h2`
940
+ `,rs=Ce.h2`
941
941
  font-weight: 400;
942
942
  font-size: 16px;
943
943
  line-height: 20px;
944
944
  margin-bottom: 16px;
945
945
  padding-left: 1px;
946
946
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
947
- `,is=xe.div`
948
- ${e=>E(e)} {
947
+ `,is=Ce.div`
948
+ ${e=>A(e)} {
949
949
  border: 1px solid #fafafa;
950
950
  }
951
951
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
@@ -954,12 +954,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
954
954
  flex-direction: column;
955
955
  min-height: 240px;
956
956
  overflow: hidden;
957
- `,ns=xe.div`
957
+ `,ns=Ce.div`
958
958
  display: flex;
959
959
  flex-direction: row;
960
960
  justify-content: space-between;
961
- `,ss=xe.p`
962
- ${e=>E(e)} {
961
+ `,ss=Ce.p`
962
+ ${e=>A(e)} {
963
963
  font-weight: 400;
964
964
  font-size: 10px;
965
965
  line-height: 12px;
@@ -967,13 +967,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
967
967
  color: #8c8c8c;
968
968
  margin: 20px;
969
969
  }
970
- `,ls=xe.div`
970
+ `,ls=Ce.div`
971
971
  display: flex;
972
972
  flex-direction: row;
973
- `,as=xe.div`
973
+ `,as=Ce.div`
974
974
  flex: 1;
975
- `,ps=xe.div`
976
- ${e=>E(e)} {
975
+ `,ps=Ce.div`
976
+ ${e=>A(e)} {
977
977
  display: flex;
978
978
  justify-content: center;
979
979
  align-content: center;
@@ -982,8 +982,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
982
982
  padding-left: 8px;
983
983
  padding-right: 8px;
984
984
  }
985
- `,ds=xe.p`
986
- ${e=>E(e)} {
985
+ `,ds=Ce.p`
986
+ ${e=>A(e)} {
987
987
  font-style: normal;
988
988
  font-weight: 600;
989
989
  font-size: 22px;
@@ -994,8 +994,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
994
994
  margin-top: 20px;
995
995
  margin-bottom: 16px;
996
996
  }
997
- `,cs=xe.p`
998
- ${e=>E(e)} {
997
+ `,cs=Ce.p`
998
+ ${e=>A(e)} {
999
999
  font-weight: 400;
1000
1000
  font-size: 14px;
1001
1001
  line-height: 18px;
@@ -1003,15 +1003,15 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1003
1003
  color: ${e=>e.appearance.theme.colorTextSecondary};
1004
1004
  margin-bottom: 8px;
1005
1005
  }
1006
- `,ms=xe.div`
1007
- ${e=>E(e)} {
1006
+ `,ms=Ce.div`
1007
+ ${e=>A(e)} {
1008
1008
  display: flex;
1009
1009
  flex-direction: row;
1010
1010
  justify-content: center;
1011
1011
  gap: 8px;
1012
1012
  }
1013
- `,us=xe.div`
1014
- ${e=>E(e)} {
1013
+ `,us=Ce.div`
1014
+ ${e=>A(e)} {
1015
1015
  // Anything inside this block will be ignored if the user provides a custom class
1016
1016
  background-color: ${e=>e.selected?"#FAFAFA":"#FFFFFF"};
1017
1017
  :hover {
@@ -1030,8 +1030,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1030
1030
  justify-content: space-between;
1031
1031
  position: relative;
1032
1032
  cursor: pointer;
1033
- `,fs=xe.p`
1034
- ${e=>E(e)} {
1033
+ `,fs=Ce.p`
1034
+ ${e=>A(e)} {
1035
1035
  // Anything inside this block will be ignored if the user provides a custom class
1036
1036
  color: ${e=>e.selected?"#434343":"#BFBFBF"};
1037
1037
  }
@@ -1039,12 +1039,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1039
1039
  font-size: 14px;
1040
1040
  line-height: 22px;
1041
1041
  margin: 0;
1042
- `,gs=xe.div`
1042
+ `,gs=Ce.div`
1043
1043
  display: flex;
1044
1044
  flex-direction: row;
1045
1045
  justify-content: flex-end;
1046
1046
  align-content: center;
1047
- `,hs=xe.div`
1047
+ `,hs=Ce.div`
1048
1048
  display: flex;
1049
1049
  flex: 1;
1050
1050
  flex-direction: row;
@@ -1052,14 +1052,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1052
1052
  align-content: center;
1053
1053
  align-items: center;
1054
1054
  margin-right: 20px;
1055
- `,xs=xe.div`
1055
+ `,xs=Ce.div`
1056
1056
  display: block;
1057
1057
  width: 100%;
1058
- `;var Cs=xe.div`
1058
+ `;var Cs=Ce.div`
1059
1059
  flex-direction: column;
1060
1060
  justify-content: center;
1061
1061
  display: flex;
1062
- `;var ys=xe.div`
1062
+ `;var ys=Ce.div`
1063
1063
  border: 1px solid #fafafa;
1064
1064
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.05);
1065
1065
  border-radius: 14px;
@@ -1067,14 +1067,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1067
1067
  display: flex;
1068
1068
  flex-direction: column;
1069
1069
  overflow: hidden;
1070
- `,Ss=xe.div`
1070
+ `,Ss=Ce.div`
1071
1071
  display: flex;
1072
1072
  flex-wrap: wrap;
1073
1073
  justify-content: space-between;
1074
1074
  overflow: hidden;
1075
1075
  row-gap: 10px;
1076
- `,bs=xe.div`
1077
- ${e=>E(e)} {
1076
+ `,bs=Ce.div`
1077
+ ${e=>A(e)} {
1078
1078
  color: #595959;
1079
1079
  }
1080
1080
  text-transform: uppercase;
@@ -1083,8 +1083,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1083
1083
  line-height: 12px;
1084
1084
  letter-spacing: 0.09em;
1085
1085
  margin-bottom: 12px;
1086
- `,ws=xe.div`
1087
- ${e=>E(e)} {
1086
+ `,ws=Ce.div`
1087
+ ${e=>A(e)} {
1088
1088
  // Anything inside this block will be ignored if the user provides a custom class
1089
1089
  background: #ffffff;
1090
1090
  border: 1px solid #fafafa;
@@ -1096,8 +1096,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1096
1096
 
1097
1097
  max-width: 150px;
1098
1098
  min-width: 200px;
1099
- `,Ts=xe.div`
1100
- ${e=>E(e)} {
1099
+ `,Ts=Ce.div`
1100
+ ${e=>A(e)} {
1101
1101
  background: radial-gradient(50% 50% at 50% 50%, #ffffff 0%, #f7f7f7 100%);
1102
1102
  }
1103
1103
  width: 40px;
@@ -1108,14 +1108,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1108
1108
  justify-content: center;
1109
1109
  align-content: center;
1110
1110
  align-items: center;
1111
- `,Fs=xe.div`
1111
+ `,Fs=Ce.div`
1112
1112
  font-weight: 600;
1113
1113
  font-size: 20px;
1114
1114
  line-height: 24px;
1115
1115
  width: 20px;
1116
1116
  height: 20px;
1117
- `,ks=xe.div`
1118
- ${e=>E(e)} {
1117
+ `,ks=Ce.div`
1118
+ ${e=>A(e)} {
1119
1119
  color: #434343;
1120
1120
  }
1121
1121
  font-weight: 600;
@@ -1123,20 +1123,20 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1123
1123
  line-height: 17px;
1124
1124
  margin-top: 12px;
1125
1125
  margin-bottom: 8px;
1126
- `,Ps=xe.div`
1127
- ${e=>E(e)} {
1126
+ `,Ps=Ce.div`
1127
+ ${e=>A(e)} {
1128
1128
  color: #8c8c8c;
1129
1129
  }
1130
1130
  font-weight: 400;
1131
1131
  font-size: 12px;
1132
1132
  line-height: 14px;
1133
- `,vs=xe.a`
1133
+ `,vs=Ce.a`
1134
1134
  color: ${e=>e.color};
1135
1135
  font-size: 12px;
1136
1136
  line-height: 14px;
1137
1137
  font-weight: 400;
1138
1138
  cursor: pointer;
1139
- `;var ic=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:l}=fe();return Y__default.createElement(ys,{style:t,className:a("guideContainer",n)},Y__default.createElement(bs,{className:a("guideTitle",n)},o),Y__default.createElement(Ss,{className:a("guideItemContainer",n)},e.map((p,d)=>{var s;return Y__default.createElement(ws,{key:`guide-${(s=p.id)!=null?s:d}`,className:a("guideItem",n)},p.icon&&Y__default.createElement(Ts,{className:a("guideIcon",n)},Y__default.createElement(Fs,null,p.icon)),Y__default.createElement(ks,{className:a("guideItemTitle",n),dangerouslySetInnerHTML:H(p.title)}),Y__default.createElement(Ps,{className:a("guideItemSubtitle",n),dangerouslySetInnerHTML:H(p.subtitle)}),Y__default.createElement(vs,{className:a("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&l(p),r&&r(p);}},p.primaryButtonTitle))})))},Do=ic;var sc=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:l,setSelectedStep:p,customStepTypes:d,appearance:s,guideData:f,guideTitle:c,onGuideButtonClick:g})=>{let b=({stepData:u,handleSecondaryCTAClick:A,handleCTAClick:C})=>u?Y__default.createElement(ps,{className:a("checklistStepContainer",s),"data-testid":"checklistStepContainer"},Y__default.createElement(ds,{appearance:s,className:a("checklistStepTitle",s),dangerouslySetInnerHTML:H(u.title)}),Y__default.createElement(cs,{appearance:s,className:a("checklistStepSubtitle",s),dangerouslySetInnerHTML:H(u.subtitle)}),Y__default.createElement(ms,{className:a("checklistCTAContainer",s)},u.secondaryButtonTitle&&Y__default.createElement(le,{title:u.secondaryButtonTitle,onClick:A,appearance:s,secondary:!0}),Y__default.createElement(le,{title:u.primaryButtonTitle,onClick:C,appearance:s}))):Y__default.createElement(Y__default.Fragment,null),x=w(w({},{default:u=>{var B;if((B=e[S])!=null&&B.StepContent){let v=e[S].StepContent;return Y__default.createElement("div",null,v)}let A=e[S];return Y__default.createElement(b,{stepData:u,handleCTAClick:()=>{A.handlePrimaryButtonClick&&A.handlePrimaryButtonClick();},handleSecondaryCTAClick:()=>{A.handleSecondaryButtonClick&&A.handleSecondaryButtonClick();}})}}),d),[h,P]=useState(0),S=l!=null?l:h,N=p!=null?p:P,U=()=>{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:s.theme.colorPrimary}):Y__default.createElement(Y__default.Fragment,null)},T=e.filter(u=>u.complete).length;return n?(s.theme.modalContainer||(s.theme.borderRadius&&(ei.borderRadius=s.theme.borderRadius+"px"),s.theme.modalContainer=ei),Y__default.createElement(et,{onClose:r,visible:n,appearance:s},Y__default.createElement(xs,null,Y__default.createElement(ts,null,Y__default.createElement(os,{appearance:s,className:a("checklistTitle",s)},t),Y__default.createElement(rs,{appearance:s,className:a("checklistSubtitle",s)},o)),Y__default.createElement(es,null,e&&e.length>0&&Y__default.createElement(is,{className:a("stepsContainer",s)},Y__default.createElement(ns,null,Y__default.createElement("div",{style:{flex:3}},Y__default.createElement(ss,{className:a("stepsTitle",s)},i)),Y__default.createElement(hs,null,Y__default.createElement(He,{style:{width:"100%"},count:T,total:e.length,appearance:s}))),Y__default.createElement(ls,null,Y__default.createElement(as,{className:a("checklistStepListContainer",s),appearance:s},e.map((u,A)=>{var I;let C=S===A;return Y__default.createElement(us,{selected:C,className:a(`checklistStepListItem${C?"Selected":""}`,s),key:`checklist-guide-step-${(I=u.id)!=null?I:A}`,disabled:u.blocked,onClick:()=>{u.blocked||N(A);},title:u.blocked?"Finish remaining steps to continue":void 0},C&&Y__default.createElement(cr,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklist-step-selected",style:{backgroundColor:s.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),Y__default.createElement(fs,{selected:C,className:a(`checklistStepListStepName${C?"Selected":""}`,s)},u.stepName),Y__default.createElement(gs,null,Y__default.createElement(pt,{value:u.complete,type:"round",primaryColor:s.theme.colorPrimary,progress:u.progress,appearance:s}),Y__default.createElement(Cs,null,Y__default.createElement(co,{style:{marginLeft:"10px"},color:s.theme.colorBackgroundSecondary}))))})),Y__default.createElement(U,null))),f&&f.length>0&&Y__default.createElement(Do,{steps:f,title:c,primaryColor:s.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:s,onButtonClick:u=>(g&&g(u),!0)}))))):Y__default.createElement(Y__default.Fragment,null)},ti=sc;var Bs=xe.div`
1139
+ `;var ic=({steps:e,style:t,title:o,primaryColor:i,appearance:n,onButtonClick:r})=>{let{primaryCTAClickSideEffects:l}=fe();return q__default.createElement(ys,{style:t,className:a("guideContainer",n)},q__default.createElement(bs,{className:a("guideTitle",n)},o),q__default.createElement(Ss,{className:a("guideItemContainer",n)},e.map((p,d)=>{var s;return q__default.createElement(ws,{key:`guide-${(s=p.id)!=null?s:d}`,className:a("guideItem",n)},p.icon&&q__default.createElement(Ts,{className:a("guideIcon",n)},q__default.createElement(Fs,null,p.icon)),q__default.createElement(ks,{className:a("guideItemTitle",n),dangerouslySetInnerHTML:H(p.title)}),q__default.createElement(Ps,{className:a("guideItemSubtitle",n),dangerouslySetInnerHTML:H(p.subtitle)}),q__default.createElement(vs,{className:a("guideItemLink",n),color:i,onClick:()=>{p.primaryButtonUri&&l(p),r&&r(p);}},p.primaryButtonTitle))})))},Do=ic;var sc=({steps:e,title:t,subtitle:o,stepsTitle:i,visible:n,onClose:r,selectedStep:l,setSelectedStep:p,customStepTypes:d,appearance:s,guideData:m,guideTitle:c,onGuideButtonClick:f})=>{let b=({stepData:g,handleSecondaryCTAClick:T,handleCTAClick:h})=>g?q__default.createElement(ps,{className:a("checklistStepContainer",s),"data-testid":"checklistStepContainer"},q__default.createElement(ds,{appearance:s,className:a("checklistStepTitle",s),dangerouslySetInnerHTML:H(g.title)}),q__default.createElement(cs,{appearance:s,className:a("checklistStepSubtitle",s),dangerouslySetInnerHTML:H(g.subtitle)}),q__default.createElement(ms,{className:a("checklistCTAContainer",s)},g.secondaryButtonTitle&&q__default.createElement(ae,{title:g.secondaryButtonTitle,onClick:T,appearance:s,secondary:!0}),q__default.createElement(ae,{title:g.primaryButtonTitle,onClick:h,appearance:s}))):q__default.createElement(q__default.Fragment,null),C=w(w({},{default:g=>{var E;if((E=e[S])!=null&&E.StepContent){let v=e[S].StepContent;return q__default.createElement("div",null,v)}let T=e[S];return q__default.createElement(b,{stepData:g,handleCTAClick:()=>{T.handlePrimaryButtonClick&&T.handlePrimaryButtonClick();},handleSecondaryCTAClick:()=>{T.handleSecondaryButtonClick&&T.handleSecondaryButtonClick();}})}}),d),[x,B]=useState(0),S=l!=null?l:x,N=p!=null?p:B,D=()=>{var g;return e?!((g=e[S])!=null&&g.type)||!C[e[S].type]?C.default(e[S]):typeof C[e[S].type]!="function"?C[e[S].type]:C[e[S].type]({stepData:e[S],primaryColor:s.theme.colorPrimary}):q__default.createElement(q__default.Fragment,null)},F=e.filter(g=>g.complete).length;return n?(s.theme.modalContainer||(s.theme.borderRadius&&(ei.borderRadius=s.theme.borderRadius+"px"),s.theme.modalContainer=ei),q__default.createElement(tt,{onClose:r,visible:n,appearance:s},q__default.createElement(xs,null,q__default.createElement(ts,null,q__default.createElement(os,{appearance:s,className:a("checklistTitle",s)},t),q__default.createElement(rs,{appearance:s,className:a("checklistSubtitle",s)},o)),q__default.createElement(es,null,e&&e.length>0&&q__default.createElement(is,{className:a("stepsContainer",s)},q__default.createElement(ns,null,q__default.createElement("div",{style:{flex:3}},q__default.createElement(ss,{className:a("stepsTitle",s)},i)),q__default.createElement(hs,null,q__default.createElement(Ve,{style:{width:"100%"},count:F,total:e.length,appearance:s}))),q__default.createElement(ls,null,q__default.createElement(as,{className:a("checklistStepListContainer",s),appearance:s},e.map((g,T)=>{var I;let h=S===T;return q__default.createElement(us,{selected:h,className:a(`checklistStepListItem${h?"Selected":""}`,s),key:`checklist-guide-step-${(I=g.id)!=null?I:T}`,disabled:g.blocked,onClick:()=>{g.blocked||N(T);},title:g.blocked?"Finish remaining steps to continue":void 0},h&&q__default.createElement(cr,{className:a("checklistStepItemSelectedIndicator",s),layoutId:"checklist-step-selected",style:{backgroundColor:s.theme.colorPrimary,borderRadius:0,height:"100%",top:"0%",width:"2px"}}),q__default.createElement(fs,{selected:h,className:a(`checklistStepListStepName${h?"Selected":""}`,s)},g.stepName),q__default.createElement(gs,null,q__default.createElement(dt,{value:g.complete,type:"round",primaryColor:s.theme.colorPrimary,progress:g.progress,appearance:s}),q__default.createElement(Cs,null,q__default.createElement(mo,{style:{marginLeft:"10px"},color:s.theme.colorBackgroundSecondary}))))})),q__default.createElement(D,null))),m&&m.length>0&&q__default.createElement(Do,{steps:m,title:c,primaryColor:s.theme.colorPrimary,style:{border:"none",boxShadow:"none"},appearance:s,onButtonClick:g=>(f&&f(g),!0)}))))):q__default.createElement(q__default.Fragment,null)},ti=sc;var Bs=Ce.div`
1140
1140
  background-color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1141
1141
  border: 1px solid;
1142
1142
  border-color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBorder}};
@@ -1148,14 +1148,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1148
1148
  display: flex;
1149
1149
  flex-direction: column;
1150
1150
  transition: max-height 0.25s;
1151
- `,Es=xe.div`
1151
+ `,Es=Ce.div`
1152
1152
  display: flex;
1153
1153
  margin-bottom: 20px;
1154
- `,As=xe.img`
1154
+ `,As=Ce.img`
1155
1155
  border-radius: 4px;
1156
1156
  max-height: 260px;
1157
1157
  min-height: 200px;
1158
- `,Is=xe.div`
1158
+ `,Is=Ce.div`
1159
1159
  display: flex;
1160
1160
  flex-direction: row;
1161
1161
  justify-content: space-between;
@@ -1164,7 +1164,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1164
1164
  :hover {
1165
1165
  opacity: 0.8;
1166
1166
  }
1167
- `,Ns=xe.p`
1167
+ `,Ns=Ce.p`
1168
1168
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1169
1169
  font-style: normal;
1170
1170
  font-weight: 500;
@@ -1175,23 +1175,23 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1175
1175
  :hover {
1176
1176
  opacity: 0.8;
1177
1177
  }
1178
- `,Os=xe.div`
1178
+ `,Os=Ce.div`
1179
1179
  cursor: pointer;
1180
1180
  color: ${e=>e.appearance.theme.colorTextSecondary};
1181
1181
  :hover {
1182
1182
  opacity: 0.8;
1183
1183
  }
1184
- `;xe.div``;var Ls=xe.p`
1184
+ `;Ce.div``;var Ls=Ce.p`
1185
1185
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1186
1186
  font-weight: 400;
1187
1187
  font-size: 14px;
1188
1188
  line-height: 22px;
1189
- `,$s=xe.div`
1189
+ `,$s=Ce.div`
1190
1190
  display: flex;
1191
1191
  flex-direction: row;
1192
1192
  justify-content: flex-start;
1193
1193
  align-items: center;
1194
- `;var Ms=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:l})=>{var c,g;let p=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.35s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.7s ease-out"};function s(){var b,F,x,h;return Y__default.createElement(Y__default.Fragment,null,e.imageUri||e.videoUri?Y__default.createElement(Es,{className:a("stepMediaContainer",r)},e.imageUri?Y__default.createElement(As,{className:a("stepImage",r),src:e.imageUri}):null,e.videoUri?Y__default.createElement(ot,{appearance:r,videoUri:e.videoUri,autoplay:(b=e.props)==null?void 0:b.autoplayVideo,loop:(F=e.props)==null?void 0:F.loopVideo,hideControls:(x=e.props)==null?void 0:x.hideVideoControls}):null):null,Y__default.createElement(Ls,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:H(e.subtitle)}),Y__default.createElement(tr,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?Y__default.createElement(le,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,Y__default.createElement(le,{title:(h=e.primaryButtonTitle)!=null?h:"Continue",onClick:()=>i(),appearance:r})))}function f(){if(!l)return null;let b=l[e.type];return b?typeof b!="function"?b:b(e,r):null}return Y__default.createElement(Bs,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},Y__default.createElement(Is,{className:a("stepHeader",r),onClick:()=>o()},Y__default.createElement($s,{className:a("stepHeaderContent",r)},Y__default.createElement(dr,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),Y__default.createElement(Ns,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:H(e.title)})),Y__default.createElement(Os,{className:a("stepChevronContainer",r),appearance:r},Y__default.createElement(co,{style:j(w({},p),{transition:"transform 0.2s ease-in-out"})}))),Y__default.createElement("div",{key:e.id,style:w({},d),className:a("stepContent",r)},(g=f())!=null?g:s()))};xe.div`
1194
+ `;var Ms=({stepData:e,collapsed:t,onClick:o,onPrimaryButtonClick:i,onSecondaryButtonClick:n,appearance:r,customStepTypes:l})=>{var c,f;let p=t?{}:{transform:"rotate(90deg)"},d=t?{overflow:"hidden",maxHeight:"0px",transition:"max-height 0.35s ease-out"}:{overflow:"hidden",maxHeight:"1000px",transition:"max-height 0.7s ease-out"};function s(){var b,k,C,x;return q__default.createElement(q__default.Fragment,null,e.imageUri||e.videoUri?q__default.createElement(Es,{className:a("stepMediaContainer",r)},e.imageUri?q__default.createElement(As,{className:a("stepImage",r),src:e.imageUri}):null,e.videoUri?q__default.createElement(rt,{appearance:r,videoUri:e.videoUri,autoplay:(b=e.props)==null?void 0:b.autoplayVideo,loop:(k=e.props)==null?void 0:k.loopVideo,hideControls:(C=e.props)==null?void 0:C.hideVideoControls}):null):null,q__default.createElement(Ls,{className:a("stepSubtitle",r),appearance:r,dangerouslySetInnerHTML:H(e.subtitle)}),q__default.createElement(tr,{className:a("checklistCTAContainer",r)},e.secondaryButtonTitle?q__default.createElement(ae,{secondary:!0,title:e.secondaryButtonTitle,onClick:()=>n(),appearance:r}):null,q__default.createElement(ae,{title:(x=e.primaryButtonTitle)!=null?x:"Continue",onClick:()=>i(),appearance:r})))}function m(){if(!l)return null;let b=l[e.type];return b?typeof b!="function"?b:b(e,r):null}return q__default.createElement(Bs,{"data-testid":`step-${e.id}`,className:a("checklistStepContainer",r),appearance:r},q__default.createElement(Is,{className:a("stepHeader",r),onClick:()=>o()},q__default.createElement($s,{className:a("stepHeaderContent",r)},q__default.createElement(dr,{value:e.complete,style:{width:"auto",borderTop:0},primaryColor:(c=r==null?void 0:r.theme)==null?void 0:c.colorPrimary,appearance:r}),q__default.createElement(Ns,{appearance:r,className:a("stepTitle",r),dangerouslySetInnerHTML:H(e.title)})),q__default.createElement(Os,{className:a("stepChevronContainer",r),appearance:r},q__default.createElement(mo,{style:j(w({},p),{transition:"transform 0.2s ease-in-out"})}))),q__default.createElement("div",{key:e.id,style:w({},d),className:a("stepContent",r)},(f=m())!=null?f:s()))};Ce.div`
1195
1195
  background: #ffffff;
1196
1196
  box-shadow: 0px 6px 25px rgba(0, 0, 0, 0.06);
1197
1197
  border-radius: 6px;
@@ -1205,26 +1205,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1205
1205
 
1206
1206
  max-width: 800px;
1207
1207
  min-width: 350px;
1208
- `;var Ds=xe.div`
1208
+ `;var Ds=Ce.div`
1209
1209
  display: flex;
1210
1210
  flex-direction: column;
1211
- `,Us=xe.h1`
1211
+ `,Us=Ce.h1`
1212
1212
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorText}};
1213
1213
  font-style: normal;
1214
1214
  font-weight: 700;
1215
1215
  font-size: 20px;
1216
1216
  line-height: 24px;
1217
1217
  margin-bottom: 8px;
1218
- `,_s=xe.h2`
1218
+ `,_s=Ce.h2`
1219
1219
  color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorTextSecondary}};
1220
1220
  font-weight: 400;
1221
1221
  font-size: 14px;
1222
1222
  line-height: 23px;
1223
1223
  margin: 2px 0 0 0;
1224
- `,zs=xe.div`
1224
+ `,zs=Ce.div`
1225
1225
  display: block;
1226
1226
  width: 100%;
1227
- `,Ws=xe.div`
1227
+ `,Ws=Ce.div`
1228
1228
  display: flex;
1229
1229
  width: 100%;
1230
1230
  flex-direction: column;
@@ -1232,7 +1232,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1232
1232
  padding: 24px;
1233
1233
  border-radius: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.borderRadius}}px;
1234
1234
  background-color: ${e=>{var t,o;return (o=(t=e.appearance)==null?void 0:t.theme)==null?void 0:o.colorBackground}};
1235
- `;var pc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:l=!0,autoExpandNextStep:p=!0,setSelectedStep:d,appearance:s,type:f,className:c,customStepTypes:g,style:b,onButtonClick:F})=>{let x=o.filter(T=>T.complete).length,[h,P]=useState(Array(o.length).fill(!0));useEffect(()=>{let T=[...h];if(r){for(let u=0;u<o.length;u++)if(!o[u].complete){T[u]=!1;break}P(T);}},[]);let S=T=>{let u=[...h];if(l)for(let A=0;A<h.length;++A)A!=T&&u[T]&&(u[A]=!0);u[T]=!h[T],P(u);};if(!n&&f=="modal")return Y__default.createElement(Y__default.Fragment,null);let N=Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(Ds,null,Y__default.createElement(Us,{appearance:s,className:a("checklistTitle",s),dangerouslySetInnerHTML:H(e)}),Y__default.createElement(_s,{appearance:s,className:a("checklistSubtitle",s),dangerouslySetInnerHTML:H(t)})),Y__default.createElement(He,{display:"percent",count:x,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:s})),U=Y__default.createElement(zs,{className:Te(a("checklistContainer",s),c)},o.map((T,u)=>{var C;let A=h[u];return Y__default.createElement(Ms,{appearance:s,stepData:T,collapsed:A,key:`modal-checklist-${(C=T.id)!=null?C:u}`,onClick:()=>{S(u),d(u),F&&F(o[u],u,h[u]?"expand":"collapse");},onPrimaryButtonClick:()=>{S(u),p&&u<o.length-1&&d(u+1),T.handlePrimaryButtonClick&&T.handlePrimaryButtonClick();},onSecondaryButtonClick:()=>{T.handleSecondaryButtonClick&&T.handleSecondaryButtonClick();},customStepTypes:g})}));return f==="inline"?Y__default.createElement(Ws,{appearance:s,className:Te(a("checklistInlineContainer",s),c),style:b},N,U):Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(et,{onClose:i,visible:n,appearance:s,style:{maxWidth:"600px"},headerContent:N},U))},oi=pc;var Hs=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=useState(t),n=null,r=()=>{n!==null?clearTimeout(n):l(),n=setTimeout(()=>{l();},16);},l=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,s])=>{if(!window)return [d,!1];let f=window.matchMedia(s);return f.addEventListener("change",r),[d,f.matches]}));i(p);};return useEffect(()=>{l();},[]),o};var Gs=css`
1235
+ `;var pc=({title:e,subtitle:t,steps:o,onClose:i,visible:n,autoExpandFirstIncompleteStep:r=!0,autoCollapse:l=!0,autoExpandNextStep:p=!0,setSelectedStep:d,appearance:s,type:m,className:c,customStepTypes:f,style:b,onButtonClick:k})=>{let C=o.filter(F=>F.complete).length,[x,B]=useState(Array(o.length).fill(!0));useEffect(()=>{let F=[...x];if(r){for(let g=0;g<o.length;g++)if(!o[g].complete){F[g]=!1;break}B(F);}},[]);let S=F=>{let g=[...x];if(l)for(let T=0;T<x.length;++T)T!=F&&g[F]&&(g[T]=!0);g[F]=!x[F],B(g);};if(!n&&m=="modal")return q__default.createElement(q__default.Fragment,null);let N=q__default.createElement(q__default.Fragment,null,q__default.createElement(Ds,null,q__default.createElement(Us,{appearance:s,className:a("checklistTitle",s),dangerouslySetInnerHTML:H(e)}),q__default.createElement(_s,{appearance:s,className:a("checklistSubtitle",s),dangerouslySetInnerHTML:H(t)})),q__default.createElement(Ve,{display:"percent",count:C,total:o.length,style:{margin:"14px 0px 8px 0px"},appearance:s})),D=q__default.createElement(zs,{className:Fe(a("checklistContainer",s),c)},o.map((F,g)=>{var h;let T=x[g];return q__default.createElement(Ms,{appearance:s,stepData:F,collapsed:T,key:`modal-checklist-${(h=F.id)!=null?h:g}`,onClick:()=>{S(g),d(g),k&&k(o[g],g,x[g]?"expand":"collapse");},onPrimaryButtonClick:()=>{S(g),p&&g<o.length-1&&d(g+1),F.handlePrimaryButtonClick&&F.handlePrimaryButtonClick();},onSecondaryButtonClick:()=>{F.handleSecondaryButtonClick&&F.handleSecondaryButtonClick();},customStepTypes:f})}));return m==="inline"?q__default.createElement(Ws,{appearance:s,className:Fe(a("checklistInlineContainer",s),c),style:b},N,D):q__default.createElement(q__default.Fragment,null,q__default.createElement(tt,{onClose:i,visible:n,appearance:s,style:{maxWidth:"600px"},headerContent:N},D))},oi=pc;var Hs=()=>{let e={isSmall:"(max-width: 480px)",isMedium:"(min-width: 481px) AND (max-width: 1023px)",isLarge:"(min-width: 1025px)"},t=Object.fromEntries(Object.entries(e).map(([p])=>[p,!1])),[o,i]=useState(t),n=null,r=()=>{n!==null?clearTimeout(n):l(),n=setTimeout(()=>{l();},16);},l=()=>{let p=Object.fromEntries(Object.entries(e).map(([d,s])=>{if(!window)return [d,!1];let m=window.matchMedia(s);return m.addEventListener("change",r),[d,m.matches]}));i(p);};return useEffect(()=>{l();},[]),o};var Gs=css`
1236
1236
  border: 1px solid ${({theme:e})=>e.colorBorder};
1237
1237
  `,mc=css`
1238
1238
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.06);
@@ -1248,7 +1248,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1248
1248
  } to {
1249
1249
  opacity: 0;
1250
1250
  }
1251
- `,Ks=xe.div`
1251
+ `,Ks=Ce.div`
1252
1252
  margin: 0 -20px;
1253
1253
  overflow-x: auto;
1254
1254
  padding-left: 20px;
@@ -1265,13 +1265,13 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1265
1265
  ::-webkit-scrollbar {
1266
1266
  display: none;
1267
1267
  }
1268
- `,qs=xe.div`
1268
+ `,qs=Ce.div`
1269
1269
  display: flex;
1270
1270
  flex-flow: row nowrap;
1271
1271
  gap: 0 16px;
1272
1272
  scroll-snap-align: center;
1273
1273
  scroll-snap-stop: always;
1274
- `,Ys=xe.div`
1274
+ `,Ys=Ce.div`
1275
1275
  animation: ${e=>e.reversed?fc:uc} 0.25s ease-out;
1276
1276
  background: linear-gradient(
1277
1277
  to right,
@@ -1281,7 +1281,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1281
1281
  position: absolute;
1282
1282
  width: 64px;
1283
1283
  z-index: 10;
1284
- `,Js=xe.button`
1284
+ `,Js=Ce.button`
1285
1285
  ${Gs}
1286
1286
  box-shadow: 0 3px 10px 0 rgba(0, 0, 0, 0.1);
1287
1287
  align-items: center;
@@ -1293,10 +1293,10 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1293
1293
  justify-content: center;
1294
1294
  position: absolute;
1295
1295
  width: 48px;
1296
- `,Xs=xe.div`
1296
+ `,Xs=Ce.div`
1297
1297
  border-radius: ${({theme:e})=>e.borderRadius}px;
1298
1298
  padding: 20px;
1299
- `,Qs=xe(Xs)`
1299
+ `,Qs=Ce(Xs)`
1300
1300
  ${Gs}
1301
1301
  background: ${({theme:e})=>e.colorBackground};
1302
1302
  position: relative;
@@ -1309,72 +1309,72 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1309
1309
  ${e=>e.blocked?"":`border: 1px solid ${e.theme.colorPrimary};`}
1310
1310
  ${e=>e.blocked?"cursor: default":"cursor: pointer"}
1311
1311
  }
1312
- `,Zs=xe.img`
1312
+ `,Zs=Ce.img`
1313
1313
  border-radius: 50%;
1314
1314
  height: 40px;
1315
1315
  margin-bottom: 12px;
1316
1316
  width: 40px;
1317
- `,Rs=xe(Xs)`
1318
- ${e=>E(e)} {
1317
+ `,Rs=Ce(Xs)`
1318
+ ${e=>A(e)} {
1319
1319
  ${mc}
1320
1320
 
1321
1321
  background: ${({theme:e})=>e.colorBackground};
1322
1322
  }
1323
- `;xe.div`
1323
+ `;Ce.div`
1324
1324
  color: ${({theme:e})=>e.colorPrimary};
1325
1325
  display: flex;
1326
1326
  flex-flow: row nowrap;
1327
1327
  align-items: center;
1328
- `;xe.div`
1328
+ `;Ce.div`
1329
1329
  white-space: nowrap;
1330
- `;var el=xe.div`
1330
+ `;var el=Ce.div`
1331
1331
  background: #d8fed8;
1332
1332
  border-radius: 6px;
1333
1333
  float: right;
1334
1334
  margin-bottom: 12px;
1335
1335
  padding: 4px 10px;
1336
- `,gc=xe.p`
1336
+ `,gc=Ce.p`
1337
1337
  font-weight: bold;
1338
1338
  font-size: 18px;
1339
1339
  line-height: 22px;
1340
1340
  letter-spacing: calc(18px * -0.01);
1341
1341
  margin: 0;
1342
- `,tl=xe(gc)`
1342
+ `,tl=Ce(gc)`
1343
1343
  margin-bottom: 4px;
1344
- `,ol=xe.div`
1344
+ `,ol=Ce.div`
1345
1345
  display: flex;
1346
1346
  flex-flow: row nowrap;
1347
1347
  align-items: center;
1348
1348
  min-width: 50%;
1349
- `,hc=xe.p`
1349
+ `,hc=Ce.p`
1350
1350
  font-weight: bold;
1351
1351
  font-size: 16px;
1352
1352
  line-height: 20px;
1353
1353
  letter-spacing: calc(16px * -0.01);
1354
1354
  margin: 0;
1355
- `,rl=xe(hc)`
1355
+ `,rl=Ce(hc)`
1356
1356
  margin-bottom: 4px;
1357
1357
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1358
1358
  `}
1359
- `,Tt=xe.p`
1359
+ `,Tt=Ce.p`
1360
1360
  color: ${({theme:e})=>e.colorText};
1361
1361
  font-weight: normal;
1362
1362
  font-size: 14px;
1363
1363
  line-height: 22px;
1364
1364
  margin: 0;
1365
- `,il=xe.p`
1365
+ `,il=Ce.p`
1366
1366
  color: ${({theme:e})=>e.colorText};
1367
1367
  font-weight: 600;
1368
1368
  font-size: 12px;
1369
1369
  line-height: 16px;
1370
1370
  margin: 0;
1371
- `;Tt.Loud=xe(Tt)`
1371
+ `;Tt.Loud=Ce(Tt)`
1372
1372
  font-weight: 600;
1373
- `;Tt.Quiet=xe(Tt)`
1373
+ `;Tt.Quiet=Ce(Tt)`
1374
1374
  color: ${({theme:e})=>e.colorTextSecondary};
1375
1375
  ${e=>e.blocked||e.complete?"opacity: 0.4;":`
1376
1376
  `}
1377
- `;var nl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ce(),{primaryCTAClickSideEffects:n}=fe();o=i(o);let {imageUri:r=null,subtitle:l=null,title:p=null,complete:d=!1,blocked:s=!1}=e;e.primaryButtonTitle||e.secondaryButtonTitle;let c=()=>{n(e);};return Y__default.createElement(Qs,{className:a("carouselCard",o),onClick:s?null:c,style:t,blocked:s,complete:d},r&&Y__default.createElement(Zs,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||s?.4:1}}),d&&Y__default.createElement(el,{className:a("carouselCompletedPill",o)},Y__default.createElement(il,{style:{color:"#108E0B"}},"Complete")),p&&Y__default.createElement(rl,{blocked:s,complete:d,className:a("carouselCardTitle",o),dangerouslySetInnerHTML:H(p)}),l&&Y__default.createElement(Tt.Quiet,{blocked:s,complete:d,className:a("carouselCardSubtitle",o),dangerouslySetInnerHTML:H(l)}))};var Cc=()=>Y__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Y__default.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),Y__default.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),Y__default.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),sl=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=useState(!1),[r,l]=useState(!1);useEffect(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&l(!0);},[t]);let p=()=>{n(!1),l(!1);},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?Y__default.createElement(Ys,{style:d,reversed:r,onAnimationEnd:r?p:null},Y__default.createElement(Js,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},Y__default.createElement(Cc,null))):null},ll=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=useRef(null),[r,l]=useState(!1),[p,d]=useState(!1),[s,f]=useState(null),[c,g]=useState([]),[b,F]=useState(0),{isSmall:x}=Hs(),h=x?1:3,{getFlowMetadata:P,getFlowSteps:S,getNumberOfStepsCompleted:N,updateCustomVariables:U,isLoading:T}=se();useEffect(()=>{U(o);},[o,T]),useEffect(()=>{if(T)return;let v=P(e),L=N(e),_=S(e);f(v),(v.data!==null||v.steps!==null)&&(g(_.sort((K,z)=>Number(K.complete)-Number(z.complete))),d(_.length>h),F(L));},[T]);let u=[];for(let v=0;v<c.length;v+=h)u.push(c.slice(v,v+h));let A=v=>{let L=v.target,_=L.scrollWidth-L.clientWidth,K=Math.ceil(L.scrollLeft);K>0&&r===!1&&l(!0),K===0&&r===!0&&l(!1),K<_&&p===!1&&d(!0),K===_&&p===!0&&d(!1);},C=(v=!0)=>{let L=v?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*L,behavior:"smooth"});},I=null,B=v=>{I!==null?clearTimeout(I):A(v),I=setTimeout(()=>{A(v);},16);};return T?null:Y__default.createElement(Rs,{className:Te(a("carouselContainer",t),i)},Y__default.createElement("div",{style:{display:"flex",justifyContent:x?"center":"space-between",marginBottom:20,flexWrap:x?"wrap":"nowrap",gap:x?16:20}},Y__default.createElement("div",null,Y__default.createElement(tl,{className:a("carouselTitle",t),dangerouslySetInnerHTML:H(s==null?void 0:s.title)}),Y__default.createElement(Tt.Quiet,{className:a("carouselSubtitle",t),dangerouslySetInnerHTML:H(s==null?void 0:s.subtitle)})),Y__default.createElement(ol,{className:a("progressWrapper",t)},Y__default.createElement(He,{count:b,total:c.length,appearance:t}))),Y__default.createElement("div",{style:{position:"relative"}},Y__default.createElement(sl,{show:r,onClick:()=>C(!1)}),Y__default.createElement(sl,{side:"right",show:p,onClick:C}),Y__default.createElement(Ks,{ref:n,onScroll:B},u.map((v,L)=>Y__default.createElement(qs,{key:L,style:{flex:`0 0 calc(100% - ${c.length>h?36:0}px)`}},v.map((_,K)=>Y__default.createElement(nl,{key:K,stepData:_,style:{flex:c.length>h?`0 1 calc(100% / ${h} - 16px * 2 / ${h})`:1},appearance:t})))))),Y__default.createElement(ae,{appearance:t}))};var ni=U=>{var T=U,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:l="inline",onDismiss:p,visible:d,customVariables:s,onStepCompletion:f,onButtonClick:c,appearance:g,hideOnFlowCompletion:b,setVisible:F,customStepTypes:x,checklistStyle:h="default",autoExpandFirstIncompleteStep:P,autoExpandNextStep:S}=T,N=$e(T,["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:C,getStepStatus:I,getNumberOfStepsCompleted:B,isLoading:v,targetingLogicShouldHideFlow:L,updateCustomVariables:_,getFlowMetadata:K,isStepBlocked:z,getFlowStatus:J,hasActiveFullPageFlow:G,setHasActiveFullPageFlow:O,markStepStarted:te,getCurrentStepIndex:q}=se(),{primaryCTAClickSideEffects:R,secondaryCTAClickSideEffects:Se}=fe(),{getOpenFlowState:ke,setOpenFlowState:ee}=Ie(),[D,ne]=useState(n||0),[Pe,Ge]=useState(!1),ve=d===void 0?ke(e):d,pe=l==="modal",{mergeAppearanceWithDefault:V}=ce();qe(e,d);let X=A(e),oe=q(e);if(g=V(g),useEffect(()=>{_(s);},[s,v]),useEffect(()=>{d!==void 0&&(pe&&d===!0?O(!0):pe&&d===!1&&O(!1));},[d,F,G]),useEffect(()=>{D!==oe&&ne(oe);},[oe]),v)return null;let M=u(e);if(!M||L(M)||!X||b===!0&&J(e)===de)return null;let Z=K(e);if(Z!=null&&Z.title&&(t=Z.title),Z!=null&&Z.subtitle&&(o=Z.subtitle),!Pe&&n===void 0&&B(e)>0){let m=X.findIndex(y=>y.complete===!1);ne(m>-1?m:X.length-1),Ge(!0);}function we(){if(D+1>=X.length){pe&&ee(e,!1);return}z(e,X[D+1].id)||ne(D+1);}function Ke(m,y,k){let W=D+1<X.length?X[D+1]:null;c&&c(m,D,y,W)===!0&&pe&&Ze(),f&&f(m,k,W),!f&&!c&&(m.primaryButtonUri||m.secondaryButtonUri)&&pe&&Ze();}function xt(){return X.map((m,y)=>j(w({},m),{handleSecondaryButtonClick:()=>{we(),Se(m),m.skippable===!0&&C(e,m.id,{skipped:!0}),Ke(m,"secondary",y);},handlePrimaryButtonClick:()=>{(!m.completionCriteria&&(m.autoMarkCompleted||m.autoMarkCompleted===void 0)||m.completionCriteria&&m.autoMarkCompleted===!0)&&(C(e,m.id),we()),Ke(m,"primary",y),R(m),I(e,m.id)===_e&&we();}}))}function Je(){return Y__default.createElement(ae,{appearance:g})}let nt={steps:xt(),title:t,subtitle:o,primaryColor:g.theme.colorPrimary,appearance:g,customStepTypes:x,type:l,className:r,autoExpandFirstIncompleteStep:P,autoExpandNextStep:S};function Ze(){ee(e,!1),p&&p(),F&&F(!1);}function vt(){return Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(Je,null),Y__default.createElement(ll,{flowId:e,appearance:g,customVariables:s,className:r}))}function Vt(){return Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(Je,null),Y__default.createElement(oi,w({visible:ve,onClose:()=>{Ze();},selectedStep:D,setSelectedStep:ne,autoExpandNextStep:!0,appearance:g,onButtonClick:c},nt)))}function jt(){var k;let m=N.guideFlowId,y;return m&&u(m)&&(y=A(m)),Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(Je,null),Y__default.createElement(ti,w({visible:ve,stepsTitle:Z.stepsTitle?Z.stepsTitle:"Your quick start guide",onClose:()=>{Ze();},selectedStep:D,setSelectedStep:ne,guideData:y,guideTitle:(k=N.guideTitle)!=null?k:"Guide",appearance:g,title:t,subtitle:o,onGuideButtonClick:W=>{Ke(W,"link",0);},customStepTypes:x},nt)))}function Bt(){let m=Y__default.createElement(Rr,w({flowId:e,style:i,selectedStep:D,setSelectedStep:ne,appearance:g,type:l},nt));return pe?Y__default.createElement(et,{onClose:()=>{Ze();},visible:ve,appearance:g,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},Y__default.createElement(Je,null),m):Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(Je,null),m)}switch(h){case"condensed":return Vt();case"with-guide":return jt();case"default":return Bt();case"carousel":return vt();default:return Bt()}};var Sc=e=>Y__default.createElement(ni,w({type:"inline"},e));var pl=xe.div`
1377
+ `;var nl=({stepData:e,style:t={},appearance:o})=>{let{mergeAppearanceWithDefault:i}=ce(),{primaryCTAClickSideEffects:n}=fe();o=i(o);let {imageUri:r=null,subtitle:l=null,title:p=null,complete:d=!1,blocked:s=!1}=e;e.primaryButtonTitle||e.secondaryButtonTitle;let c=()=>{n(e);};return q__default.createElement(Qs,{className:a("carouselCard",o),onClick:s?null:c,style:t,blocked:s,complete:d},r&&q__default.createElement(Zs,{className:a("carouselCardImage",o),src:r,alt:p,style:{opacity:d||s?.4:1}}),d&&q__default.createElement(el,{className:a("carouselCompletedPill",o)},q__default.createElement(il,{style:{color:"#108E0B"}},"Complete")),p&&q__default.createElement(rl,{blocked:s,complete:d,className:a("carouselCardTitle",o),dangerouslySetInnerHTML:H(p)}),l&&q__default.createElement(Tt.Quiet,{blocked:s,complete:d,className:a("carouselCardSubtitle",o),dangerouslySetInnerHTML:H(l)}))};var Cc=()=>q__default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},q__default.createElement("path",{d:"M14 6L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),q__default.createElement("path",{d:"M14 18L20 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),q__default.createElement("path",{d:"M4 12H20",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})),sl=({side:e="left",show:t=!1,onClick:o=()=>{}})=>{let[i,n]=useState(!1),[r,l]=useState(!1);useEffect(()=>{t===!0&&i===!1?n(!0):t===!1&&i===!0&&l(!0);},[t]);let p=()=>{n(!1),l(!1);},d=e=="left"?{top:0,bottom:0,left:-20,transform:"rotate(180deg)"}:{top:0,bottom:0,right:-20};return i?q__default.createElement(Ys,{style:d,reversed:r,onAnimationEnd:r?p:null},q__default.createElement(Js,{onClick:()=>o(),style:{right:16,top:"calc(50% - 24px)"}},q__default.createElement(Cc,null))):null},ll=({flowId:e,appearance:t,customVariables:o,className:i})=>{let n=useRef(null),[r,l]=useState(!1),[p,d]=useState(!1),[s,m]=useState(null),[c,f]=useState([]),[b,k]=useState(0),{isSmall:C}=Hs(),x=C?1:3,{getFlowMetadata:B,getFlowSteps:S,getNumberOfStepsCompleted:N,updateCustomVariables:D,isLoading:F}=le();useEffect(()=>{D(o);},[o,F]),useEffect(()=>{if(F)return;let v=B(e),L=N(e),U=S(e);m(v),(v.data!==null||v.steps!==null)&&(f(U.sort((R,z)=>Number(R.complete)-Number(z.complete))),d(U.length>x),k(L));},[F]);let g=[];for(let v=0;v<c.length;v+=x)g.push(c.slice(v,v+x));let T=v=>{let L=v.target,U=L.scrollWidth-L.clientWidth,R=Math.ceil(L.scrollLeft);R>0&&r===!1&&l(!0),R===0&&r===!0&&l(!1),R<U&&p===!1&&d(!0),R===U&&p===!0&&d(!1);},h=(v=!0)=>{let L=v?1:-1;n.current!==null&&n.current.scrollBy({left:n.current.clientWidth*L,behavior:"smooth"});},I=null,E=v=>{I!==null?clearTimeout(I):T(v),I=setTimeout(()=>{T(v);},16);};return F?null:q__default.createElement(Rs,{className:Fe(a("carouselContainer",t),i)},q__default.createElement("div",{style:{display:"flex",justifyContent:C?"center":"space-between",marginBottom:20,flexWrap:C?"wrap":"nowrap",gap:C?16:20}},q__default.createElement("div",null,q__default.createElement(tl,{className:a("carouselTitle",t),dangerouslySetInnerHTML:H(s==null?void 0:s.title)}),q__default.createElement(Tt.Quiet,{className:a("carouselSubtitle",t),dangerouslySetInnerHTML:H(s==null?void 0:s.subtitle)})),q__default.createElement(ol,{className:a("progressWrapper",t)},q__default.createElement(Ve,{count:b,total:c.length,appearance:t}))),q__default.createElement("div",{style:{position:"relative"}},q__default.createElement(sl,{show:r,onClick:()=>h(!1)}),q__default.createElement(sl,{side:"right",show:p,onClick:h}),q__default.createElement(Ks,{ref:n,onScroll:E},g.map((v,L)=>q__default.createElement(qs,{key:L,style:{flex:`0 0 calc(100% - ${c.length>x?36:0}px)`}},v.map((U,R)=>q__default.createElement(nl,{key:R,stepData:U,style:{flex:c.length>x?`0 1 calc(100% / ${x} - 16px * 2 / ${x})`:1},appearance:t})))))),q__default.createElement(pe,{appearance:t}))};var ni=D=>{var F=D,{flowId:e,title:t,subtitle:o,style:i,initialSelectedStep:n,className:r,type:l="inline",onDismiss:p,visible:d,customVariables:s,onStepCompletion:m,onButtonClick:c,appearance:f,hideOnFlowCompletion:b,setVisible:k,customStepTypes:C,checklistStyle:x="default",autoExpandFirstIncompleteStep:B,autoExpandNextStep:S}=F,N=Me(F,["flowId","title","subtitle","style","initialSelectedStep","className","type","onDismiss","visible","customVariables","onStepCompletion","onButtonClick","appearance","hideOnFlowCompletion","setVisible","customStepTypes","checklistStyle","autoExpandFirstIncompleteStep","autoExpandNextStep"]);let{getFlow:g,getFlowSteps:T,markStepCompleted:h,getStepStatus:I,getNumberOfStepsCompleted:E,isLoading:v,targetingLogicShouldHideFlow:L,updateCustomVariables:U,getFlowMetadata:R,isStepBlocked:z,getFlowStatus:J,hasActiveFullPageFlow:X,setHasActiveFullPageFlow:O,markStepStarted:Y,getCurrentStepIndex:K}=le(),{primaryCTAClickSideEffects:re,secondaryCTAClickSideEffects:ye}=fe(),{getOpenFlowState:Pe,setOpenFlowState:oe}=Ne(),[_,ie]=useState(n||0),[ve,Ke]=useState(!1),Be=d===void 0?Pe(e):d,xe=l==="modal",{mergeAppearanceWithDefault:W}=ce();Ye(e,d);let G=T(e),ne=K(e);if(f=W(f),useEffect(()=>{U(s);},[s,v]),useEffect(()=>{d!==void 0&&(xe&&d===!0?O(!0):xe&&d===!1&&O(!1));},[d,k,X]),useEffect(()=>{_!==ne&&ie(ne);},[ne]),v)return null;let M=g(e);if(!M||L(M)||!G||b===!0&&J(e)===de)return null;let Q=R(e);if(Q!=null&&Q.title&&(t=Q.title),Q!=null&&Q.subtitle&&(o=Q.subtitle),!ve&&n===void 0&&E(e)>0){let ee=G.findIndex(u=>u.complete===!1);ie(ee>-1?ee:G.length-1),Ke(!0);}function Te(){if(_+1>=G.length){xe&&oe(e,!1);return}z(e,G[_+1].id)||ie(_+1);}function Xe(ee,u,y){let P=_+1<G.length?G[_+1]:null;c&&c(ee,_,u,P)===!0&&xe&&Qe(),m&&m(ee,y,P),!m&&!c&&(ee.primaryButtonUri||ee.secondaryButtonUri)&&xe&&Qe();}function vt(){return G.map((ee,u)=>j(w({},ee),{handleSecondaryButtonClick:()=>{Te(),ye(ee),ee.skippable===!0&&h(e,ee.id,{skipped:!0}),Xe(ee,"secondary",u);},handlePrimaryButtonClick:()=>{(!ee.completionCriteria&&(ee.autoMarkCompleted||ee.autoMarkCompleted===void 0)||ee.completionCriteria&&ee.autoMarkCompleted===!0)&&(h(e,ee.id),Te()),Xe(ee,"primary",u),re(ee),I(e,ee.id)===ze&&Te();}}))}function qe(){return q__default.createElement(pe,{appearance:f})}let st={steps:vt(),title:t,subtitle:o,primaryColor:f.theme.colorPrimary,appearance:f,customStepTypes:C,type:l,className:r,autoExpandFirstIncompleteStep:B,autoExpandNextStep:S};function Qe(){oe(e,!1),p&&p(),k&&k(!1);}function jt(){return q__default.createElement(q__default.Fragment,null,q__default.createElement(qe,null),q__default.createElement(ll,{flowId:e,appearance:f,customVariables:s,className:r}))}function Bt(){return q__default.createElement(q__default.Fragment,null,q__default.createElement(qe,null),q__default.createElement(oi,w({visible:Be,onClose:()=>{Qe();},selectedStep:_,setSelectedStep:ie,autoExpandNextStep:!0,appearance:f,onButtonClick:c},st)))}function Gt(){var y;let ee=N.guideFlowId,u;return ee&&g(ee)&&(u=T(ee)),q__default.createElement(q__default.Fragment,null,q__default.createElement(qe,null),q__default.createElement(ti,w({visible:Be,stepsTitle:Q.stepsTitle?Q.stepsTitle:"Your quick start guide",onClose:()=>{Qe();},selectedStep:_,setSelectedStep:ie,guideData:u,guideTitle:(y=N.guideTitle)!=null?y:"Guide",appearance:f,title:t,subtitle:o,onGuideButtonClick:P=>{Xe(P,"link",0);},customStepTypes:C},st)))}function Et(){let ee=q__default.createElement(Rr,w({flowId:e,style:i,selectedStep:_,setSelectedStep:ie,appearance:f,type:l},st));return xe?q__default.createElement(tt,{onClose:()=>{Qe();},visible:Be,appearance:f,style:{paddingTop:"0px",padding:"12px",paddingLeft:0}},q__default.createElement(qe,null),ee):q__default.createElement(q__default.Fragment,null,q__default.createElement(qe,null),ee)}switch(x){case"condensed":return Bt();case"with-guide":return Gt();case"default":return Et();case"carousel":return jt();default:return Et()}};var Sc=e=>q__default.createElement(ni,w({type:"inline"},e));var pl=Ce.div`
1378
1378
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1379
1379
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
1380
1380
  padding: 10px 12px 10px 12px;
@@ -1386,27 +1386,27 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1386
1386
  &:hover {
1387
1387
  filter: brightness(.99);
1388
1388
  }
1389
- `,dl=xe.div`
1389
+ `,dl=Ce.div`
1390
1390
  display: flex;
1391
1391
  flex-direction: row;
1392
1392
  justify-content: space-between;
1393
1393
  align-items: center;
1394
1394
  margin-bottom: ${e=>e.type==="condensed"?"0":"6px"};
1395
1395
  flex-grow: 2;
1396
- `,cl=xe.div`
1396
+ `,cl=Ce.div`
1397
1397
  text-overflow: ellipsis;
1398
1398
  font-weight: 600;
1399
1399
  font-size: 14px;
1400
1400
  line-height: 16px;
1401
1401
  margin-right: ${e=>e.type==="condensed"?"8px":"0"};
1402
1402
  text-align: ${e=>e.type==="condensed"?"left":"right"};
1403
- `,ml=xe.div`
1403
+ `,ml=Ce.div`
1404
1404
  width: 20px;
1405
1405
  margin-right: 8px;
1406
1406
  display: flex;
1407
1407
  height: 100%;
1408
1408
  align-items: center;
1409
- `;var ul=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:l,type:p="default"})=>Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(ae,{appearance:l}),Y__default.createElement(pl,{onClick:()=>i!==void 0&&i(),styleOverrides:w(w({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:Te(r!=null?r:"",a("progressBadgeContainer",l)),appearance:l},p=="condensed"&&o&&o!==0&&Y__default.createElement(ml,{className:a("progressRingContainer",l)},Y__default.createElement(Zt,{size:19,percentage:t/o,fillColor:l.theme.colorPrimary,bgColor:l.theme.colorBackgroundSecondary})),Y__default.createElement(dl,{type:p,className:a("badgeTitleContainer",l)},Y__default.createElement(cl,{type:p,appearance:l,className:a("badgeTitle",l)},e),i!==void 0&&Y__default.createElement(co,{className:a("badgeChevron",l),color:l.theme.colorPrimary})),p=="default"&&o&&o!==0&&Y__default.createElement(He,{display:"compact",count:t,total:o,bgColor:l.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:l,textStyle:{color:"#818898"}})));var fl=xe.div`
1409
+ `;var ul=({title:e,count:t,total:o,onClick:i,style:n={},className:r,appearance:l,type:p="default"})=>q__default.createElement(q__default.Fragment,null,q__default.createElement(pe,{appearance:l}),q__default.createElement(pl,{onClick:()=>i!==void 0&&i(),styleOverrides:w(w({},p=="condensed"?{display:"flex",justifyContent:"space-between"}:{}),n),className:Fe(r!=null?r:"",a("progressBadgeContainer",l)),appearance:l},p=="condensed"&&o&&o!==0&&q__default.createElement(ml,{className:a("progressRingContainer",l)},q__default.createElement(Rt,{size:19,percentage:t/o,fillColor:l.theme.colorPrimary,bgColor:l.theme.colorBackgroundSecondary})),q__default.createElement(dl,{type:p,className:a("badgeTitleContainer",l)},q__default.createElement(cl,{type:p,appearance:l,className:a("badgeTitle",l)},e),i!==void 0&&q__default.createElement(mo,{className:a("badgeChevron",l),color:l.theme.colorPrimary})),p=="default"&&o&&o!==0&&q__default.createElement(Ve,{display:"compact",count:t,total:o,bgColor:l.theme.colorBackgroundSecondary,style:{width:"100%"},appearance:l,textStyle:{color:"#818898"}})));var fl=Ce.div`
1410
1410
  display: flex;
1411
1411
  flex-direction: row;
1412
1412
  width: 100%;
@@ -1416,25 +1416,25 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1416
1416
  background-color: ${e=>e.appearance.theme.colorBackground};
1417
1417
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1418
1418
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
1419
- `,gl=xe.div`
1420
- ${e=>E(e)} {
1419
+ `,gl=Ce.div`
1420
+ ${e=>A(e)} {
1421
1421
  display: flex;
1422
1422
  justify-content: center;
1423
1423
  align-items: center;
1424
1424
  margin-right: 16px;
1425
1425
  }
1426
- `,hl=xe.div`
1426
+ `,hl=Ce.div`
1427
1427
  display: flex;
1428
1428
  flex-direction: column;
1429
1429
  flex: 1;
1430
1430
  margin-top: 0;
1431
- `,xl=xe.div`
1431
+ `,xl=Ce.div`
1432
1432
  display: flex;
1433
1433
  flex-direction: column;
1434
1434
  justify-content: center;
1435
1435
  margin-left: 16px;
1436
1436
  min-width: 200px;
1437
- `;xe.div`
1437
+ `;Ce.div`
1438
1438
  display: flex;
1439
1439
  justify-content: center;
1440
1440
  align-items: flex-end;
@@ -1443,7 +1443,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1443
1443
  :hover {
1444
1444
  opacity: 0.8;
1445
1445
  }
1446
- `;var Cl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:l,style:p,onClick:d})=>Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(fl,{appearance:i,className:Te(a("fullWidthProgressBadgeContainer",i),l!=null?l:""),style:p,onClick:()=>d!==void 0&&d()},o&&Y__default.createElement(gl,{className:a("fullWidthProgressBadgeIcon",i)},o),Y__default.createElement(hl,null,Y__default.createElement(Oe,{size:"small",appearance:i,title:e,subtitle:t})),Y__default.createElement(xl,{className:a("fullWidthProgressBadgeProgressContainer",i)},Y__default.createElement(He,{count:n,total:r,display:"percent",textLocation:"top"}))));var wc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:l,customVariables:p,hideOnFlowCompletion:d,appearance:s,type:f="default"})=>{let{getFlow:c,getFlowSteps:g,getFlowStatus:b,getNumberOfStepsCompleted:F,isLoading:x,targetingLogicShouldHideFlow:h,updateCustomVariables:P}=se(),{mergeAppearanceWithDefault:S}=ce();s=S(s);let{setOpenFlowState:N,getOpenFlowState:U}=Ie();if(useEffect(()=>{P(p);},[p,x]),x)return null;let T=c(e);if(!T||h(T)||d===!0&&b(e)===de)return null;let u=g(e),A=F(e);return f==="full-width"?Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(ae,{appearance:s}),Y__default.createElement(Cl,{title:t,subtitle:o,count:A,total:u.length,style:n,className:l,appearance:s,icon:i,onClick:r})):Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(ae,{appearance:s}),Y__default.createElement(ul,{count:A,total:u.length,title:t,style:n,onClick:()=>{N(e,!0),r&&r();},type:f,className:l,appearance:s}))};var Fc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=$e(r,["flowId","style","appearance"]);let{getFlow:l,targetingLogicShouldHideFlow:p,getFlowSteps:d}=se(),{mergeAppearanceWithDefault:s}=ce();o=s(o);let f=l(e);if(!f||p(f))return null;let c=d(e);return Y__default.createElement(Do,w({steps:c,style:t,appearance:o},i))};var si=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,l=n=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+l,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+l,y:e.top-i.y+r}:{x:0,y:0}};function yl(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]=useState(o),r=useCallback(()=>{e&&n(e.getBoundingClientRect());},[e]);return useEffect(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}function Sl(){let{debug:e}=useContext(ie),[t,o]=useState([]);function i(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.log(r)));}function n(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.warn(r)));}return {logIfDebugMode:i,logErrorIfDebugMode:n}}var wl=300,Tl=100,Ic=500,ho=12,Nc=xe.div`
1446
+ `;var Cl=({title:e,subtitle:t,icon:o,appearance:i,count:n,total:r,className:l,style:p,onClick:d})=>q__default.createElement(q__default.Fragment,null,q__default.createElement(fl,{appearance:i,className:Fe(a("fullWidthProgressBadgeContainer",i),l!=null?l:""),style:p,onClick:()=>d!==void 0&&d()},o&&q__default.createElement(gl,{className:a("fullWidthProgressBadgeIcon",i)},o),q__default.createElement(hl,null,q__default.createElement(Le,{size:"small",appearance:i,title:e,subtitle:t})),q__default.createElement(xl,{className:a("fullWidthProgressBadgeProgressContainer",i)},q__default.createElement(Ve,{count:n,total:r,display:"percent",textLocation:"top"}))));var wc=({flowId:e,title:t,subtitle:o,icon:i,style:n,onClick:r,className:l,customVariables:p,hideOnFlowCompletion:d,appearance:s,type:m="default"})=>{let{getFlow:c,getFlowSteps:f,getFlowStatus:b,getNumberOfStepsCompleted:k,isLoading:C,targetingLogicShouldHideFlow:x,updateCustomVariables:B}=le(),{mergeAppearanceWithDefault:S}=ce();s=S(s);let{setOpenFlowState:N,getOpenFlowState:D}=Ne();if(useEffect(()=>{B(p);},[p,C]),C)return null;let F=c(e);if(!F||x(F)||d===!0&&b(e)===de)return null;let g=f(e),T=k(e);return m==="full-width"?q__default.createElement(q__default.Fragment,null,q__default.createElement(pe,{appearance:s}),q__default.createElement(Cl,{title:t,subtitle:o,count:T,total:g.length,style:n,className:l,appearance:s,icon:i,onClick:r})):q__default.createElement(q__default.Fragment,null,q__default.createElement(pe,{appearance:s}),q__default.createElement(ul,{count:T,total:g.length,title:t,style:n,onClick:()=>{N(e,!0),r&&r();},type:m,className:l,appearance:s}))};var Fc=n=>{var r=n,{flowId:e,style:t,appearance:o}=r,i=Me(r,["flowId","style","appearance"]);let{getFlow:l,targetingLogicShouldHideFlow:p,getFlowSteps:d}=le(),{mergeAppearanceWithDefault:s}=ce();o=s(o);let m=l(e);if(!m||p(m))return null;let c=d(e);return q__default.createElement(Do,w({steps:c,style:t,appearance:o},i))};var si=(e,t,o,i={x:20,y:20},n)=>{let r=n=="fixed"?0:window.scrollY,l=n=="fixed"?0:window.scrollX;return t==="left"?{x:e.left-o+i.x+l,y:e.top-i.y+r}:t==="right"?{x:e.left+e.width+i.x+l,y:e.top-i.y+r}:{x:0,y:0}};function yl(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]=useState(o),r=useCallback(()=>{e&&n(e.getBoundingClientRect());},[e]);return useEffect(()=>(r(),window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[e,t]),i}function Sl(){let{debug:e}=useContext(se),[t,o]=useState([]);function i(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.log(r)));}function n(r){e&&(t.find(l=>l===r)||(o([...t,r]),console.warn(r)));}return {logIfDebugMode:i,logErrorIfDebugMode:n}}var wl=300,Tl=100,Ic=500,xo=12,Nc=Ce.div`
1447
1447
  width: 100%;
1448
1448
  height: 100%;
1449
1449
  border-radius: 9999px;
@@ -1466,26 +1466,26 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1466
1466
  opacity: 0;
1467
1467
  }
1468
1468
  }
1469
- `,Oc=xe.div`
1470
- width: ${ho}px;
1471
- height: ${ho}px;
1469
+ `,Oc=Ce.div`
1470
+ width: ${xo}px;
1471
+ height: ${xo}px;
1472
1472
  border-radius: 100px;
1473
1473
  background-color: ${e=>e.primaryColor};
1474
1474
  z-index: 20;
1475
1475
  opacity: 1;
1476
- `,Lc=xe.div`
1476
+ `,Lc=Ce.div`
1477
1477
  pointer-events: all;
1478
- `,Fl=xe.div`
1478
+ `,Fl=Ce.div`
1479
1479
  display: flex;
1480
1480
  align-content: center;
1481
1481
  justify-content: center;
1482
1482
  align-items: center;
1483
1483
  z-index: ${e=>e.zIndex?e.zIndex:90};
1484
- `,$c=xe(Fl)`
1485
- width: ${ho+12}px;
1486
- height: ${ho+12}px;
1487
- `,Mc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:l={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:s=0,customStepTypes:f,appearance:c,dismissible:g=!1,showHighlightOnly:b,showStepCount:F=!0,completedStepsCount:x=0,showFrigadeBranding:h=!1,cssPosition:P="absolute",onViewTooltip:S,className:N})=>{var xt,Je,nt,Ze,vt,Vt,jt,Bt,m,y,k,W,Be,Et,At,It,ge,Co,yo;let{logErrorIfDebugMode:U}=Sl(),[T,u]=useState(),[A,C]=useState(new Date),I=useRef(null),[B,v]=useState(document.querySelector(e[s].selector)),L=yl(B,A),[_,K]=useState(),[z,J]=useState(!b),G=P!="static"?(Je=(xt=e[s])==null?void 0:xt.props)!=null&&Je.position?e[s].props.position:P:"static",O=(vt=(Ze=(nt=e[s])==null?void 0:nt.props)==null?void 0:Ze.zIndex)!=null?vt:90,te=(Vt=T==null?void 0:T.width)!=null?Vt:wl,q=(jt=T==null?void 0:T.height)!=null?jt:Tl,[R,Se]=useState(new Date().getTime());l=P!="static"?(y=(m=(Bt=e[s])==null?void 0:Bt.props)==null?void 0:m.offset)!=null?y:l:{x:0,y:0};let ke=window.location.pathname.split("/").pop();useLayoutEffect(()=>{I.current&&u({width:I.current.clientWidth,height:I.current.clientHeight});},[s,A,G]),useEffect(()=>{b||J(!0);},[s]),useEffect(()=>{p&&z&&S(s);},[z]);let ee=()=>{if(G==="static")return;let re=document.querySelector(e[s].selector);if(!re){K(void 0),v(null),U(`FrigadeTour: Could not find element with selector "${e[s].selector}" for step ${e[s].id}`);return}_&&_===JSON.stringify(re==null?void 0:re.getBoundingClientRect())||(v(re),C(new Date),re&&K(JSON.stringify(re.getBoundingClientRect())));};if(useEffect(()=>{let re=new MutationObserver(ee);return re.observe(document.body,{subtree:!0,childList:!0}),()=>re.disconnect()},[ee]),useEffect(()=>{let re=new MutationObserver(ee);return re.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>re.disconnect()},[ee]),useEffect(()=>{let re=setInterval(()=>{ee();},10);return ()=>clearInterval(re)},[ee]),useLayoutEffect(()=>{setTimeout(()=>{ee();},Ic),ee();},[s,ke]),useEffect(()=>{if(!p)return;let re=De=>{De.key==="Escape"&&t();};return document.addEventListener("keydown",re),()=>{document.removeEventListener("keydown",re);}},[]),B===null||!p)return null;let D=i==="auto"?"right":i,ne=si(L,D,te,l,G),Pe=L.right+te>(window.innerWidth||document.documentElement.clientWidth);L.bottom+Tl>(window.innerHeight||document.documentElement.clientHeight);Pe&&i==="auto"&&(ne=si(L,"left",te,l,G),D="left"),(W=(k=e[s])==null?void 0:k.props)!=null&&W.tooltipPosition&&((Et=(Be=e[s])==null?void 0:Be.props)==null?void 0:Et.tooltipPosition)!=="auto"&&(((It=(At=e[s])==null?void 0:At.props)==null?void 0:It.tooltipPosition)==="left"||((Co=(ge=e[s])==null?void 0:ge.props)==null?void 0:Co.tooltipPosition)==="right")&&(D=e[s].props.tooltipPosition);let ve=()=>{let re=()=>{if(e[s].handlePrimaryButtonClick&&(e[s].handlePrimaryButtonClick(),J(!1),setTimeout(()=>{ee();},30)),x===e.length-1)return o()},De=()=>{e[s].handleSecondaryButtonClick&&(e[s].handleSecondaryButtonClick(),b&&!e[s].secondaryButtonUri&&J(!1));};return Y__default.createElement(Y__default.Fragment,null,F&&e.length>1&&Y__default.createElement(Ai,null,Y__default.createElement(Ni,{role:"status",className:a("tooltipStepCounter",c)},s+1," of ",e.length)),(e[s].primaryButtonTitle||e[s].secondaryButtonTitle)&&Y__default.createElement(Ii,{showStepCount:F,className:a("tooltipCTAContainer",c)},e[s].secondaryButtonTitle&&Y__default.createElement(le,{title:e[s].secondaryButtonTitle,appearance:c,onClick:De,size:"small",withMargin:!1,secondary:!0}),e[s].primaryButtonTitle&&Y__default.createElement(le,{title:e[s].primaryButtonTitle,appearance:c,onClick:re,withMargin:!1,size:"small"})))},pe=()=>{var re,De,Wo;return Y__default.createElement(Y__default.Fragment,null,g&&Y__default.createElement(ki,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t();},className:a("tooltipClose",c),hasImage:!!e[s].imageUri||!!e[s].videoUri,"aria-label":"Close Tooltip",role:"button",tabIndex:0},Y__default.createElement(Ne,null)),e[s].imageUri&&Y__default.createElement(Pi,{dismissible:g,appearance:c,role:"img","aria-label":e[s].title,src:e[s].imageUri,className:a("tooltipImageContainer",c)}),e[s].videoUri&&!e[s].imageUri&&Y__default.createElement(vi,{dismissible:g,appearance:c,role:"video","aria-label":e[s].title,className:a("tooltipVideoContainer",c)},Y__default.createElement(ot,{appearance:c,videoUri:e[s].videoUri,autoplay:(re=e[s].props)==null?void 0:re.autoplayVideo,loop:(De=e[s].props)==null?void 0:De.loopVideo,hideControls:(Wo=e[s].props)==null?void 0:Wo.hideVideoControls})),Y__default.createElement(Ei,{className:a("tooltipContentContainer",c)},Y__default.createElement(Oe,{appearance:c,title:e[s].title,subtitle:e[s].subtitle,size:"small",ariaPrefix:`Tooltip${e[s].id}`}),Y__default.createElement(Bi,{className:a("tooltipFooter",c)},Y__default.createElement(ve,null))))},X=w(w({},{default:re=>{var De;if((De=e[s])!=null&&De.StepContent){let Wo=e[s].StepContent;return Y__default.createElement("div",null,Wo)}return Y__default.createElement(pe,null)}}),f),oe=()=>{var re;return e?!((re=e[s])!=null&&re.type)||!X[e[s].type]?X.default(e[s]):X[e[s].type]({stepData:e[s],primaryColor:r}):Y__default.createElement(Y__default.Fragment,null)};if(e[s].complete===!0||ne.x==0&&ne.y==0&&new Date().getTime()-R<100)return null;let M={top:(ne==null?void 0:ne.y)-ho,left:(yo=D=="left"?L.x+l.x:(ne==null?void 0:ne.x)-ho)!=null?yo:0,cursor:b?"pointer":"default",position:G},Z=()=>{let De=M.left+(D=="left"?-te:24);return Math.min(Math.max(De,20),window.innerWidth-te-20)},we=()=>{let re=M.top+q,De=20;return re>window.innerHeight-De?M.top+-q:M.top},Ke=()=>{b&&(C(new Date),J(!z));};return Y__default.createElement(Lc,{className:N},Y__default.createElement($c,{style:M,zIndex:O,className:a("tourHighlightContainer",c)},n&&e[s].showHighlight!==!1&&P!=="static"&&Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(Oc,{style:{position:G},onClick:Ke,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),Y__default.createElement(Nc,{style:{position:"absolute"},onClick:Ke,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),Y__default.createElement(Fl,{style:j(w({},M),{left:Z(),top:we()}),zIndex:O+1,className:a("tooltipContainerWrapper",c)},z&&Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(Go,{ref:I,role:"dialog","aria-labelledby":`frigadeTooltip${e[s].id}Title`,"aria-describedby":`frigadeTooltip${e[s].id}Subtitle`,layoutId:"tooltip-container",tabIndex:0,"aria-label":"Tooltip",style:w({position:"relative",width:"max-content",right:0,top:P!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:wl,zIndex:O+10},Y__default.createElement(oe,null)),h&&Y__default.createElement(Li,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:O+10},Y__default.createElement(Ko,{appearance:c})))))},zo=Mc;var zc=h=>{var P=h,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:l,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:s=!1,dismissBehavior:f="skip-flow",onComplete:c,skipIfNotFound:g=!1,cssPosition:b="absolute",className:F}=P,x=$e(P,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition","className"]);let{getFlow:S,getFlowSteps:N,isLoading:U,targetingLogicShouldHideFlow:T,markStepCompleted:u,markStepStarted:A,markFlowCompleted:C,markFlowSkipped:I,updateCustomVariables:B,getCurrentStepIndex:v,getStepStatus:L,isStepBlocked:_,getFlowStatus:K,getNumberOfStepsCompleted:z}=se(),{isLoadingUserFlowStateData:J}=ze(),{primaryCTAClickSideEffects:G,secondaryCTAClickSideEffects:O}=fe(),{hasOpenModals:te}=Ie(),q=v(e),{openFlowStates:R}=useContext(ie),{mergeAppearanceWithDefault:Se}=ce();if(o=Se(o),useEffect(()=>{B(t);},[t,U]),J)return null;let ke=S(e);if(!ke||T(ke)||K(e)==de||te())return null;let ee=N(e);if(Object.keys(R).length>0){let M=Object.keys(R).find(Z=>R[Z]===!0);if(M!==void 0&&M!==e)return Y__default.createElement(Y__default.Fragment,null)}function D(M){return $(this,null,function*(){if(yield u(e,M.id),ee.map(Z=>L(e,Z.id)).every(Z=>Z===_e)){yield C(e);return}!s&&q+1<ee.length&&!r&&_(e,ee[q+1].id);})}function ne(M,Z,we){let Ke=q+1<ee.length?ee[q+1]:null;n&&n(M,q,Z,Ke),i&&i(M,we,Ke);}function Pe(){return ee.map(M=>j(w({},M),{handleSecondaryButtonClick:()=>$(this,null,function*(){O(M),M.skippable===!0&&(yield u(e,M.id,{skipped:!0})),ne(M,"secondary",q);}),handlePrimaryButtonClick:()=>$(this,null,function*(){(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&(yield D(M)),ne(M,"primary",q),G(M);})}))}function Ge(M){return $(this,null,function*(){l&&l(),f==="skip-flow"?yield I(e):yield u(e,M.id);})}function ve(){c&&c();}function pe(M){return $(this,null,function*(){yield A(e,ee[M].id);})}let V=!document.querySelector(ee[q].selector);function X(){let M=ee.findIndex((Z,we)=>!!document.querySelector(Z.selector)&&we>=q);return ee.map((Z,we)=>r?Y__default.createElement(zo,w({key:Z.id,appearance:o,steps:Pe(),selectedStep:we,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Ge(Z),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:z(e),onComplete:ve,cssPosition:b,onViewTooltip:pe,className:F},x)):g&&V&&we===M?Y__default.createElement(zo,w({key:Z.id,appearance:o,steps:Pe(),selectedStep:we,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Ge(Z),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:z(e),onComplete:ve,cssPosition:b,onViewTooltip:pe,className:F},x)):we!=q?null:Y__default.createElement(zo,w({key:Z.id,appearance:o,steps:Pe(),selectedStep:we,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Ge(Z),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:z(e),onComplete:ve,cssPosition:b,onViewTooltip:pe,className:F},x)))}function oe(){return Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(ae,{appearance:o}),X())}return b==="static"?oe():Y__default.createElement(Portal,null,oe())};var kl=xe.button`
1488
- ${e=>E(e)} {
1484
+ `,$c=Ce(Fl)`
1485
+ width: ${xo+12}px;
1486
+ height: ${xo+12}px;
1487
+ `,Mc=({steps:e=[],onDismiss:t,onComplete:o=()=>{},tooltipPosition:i="auto",showHighlight:n=!0,primaryColor:r="#000000",offset:l={x:0,y:0},visible:p=!0,containerStyle:d={},selectedStep:s=0,customStepTypes:m,appearance:c,dismissible:f=!1,showHighlightOnly:b,showStepCount:k=!0,completedStepsCount:C=0,showFrigadeBranding:x=!1,cssPosition:B="absolute",onViewTooltip:S,className:N})=>{var vt,qe,st,Qe,jt,Bt,Gt,Et,ee,u,y,P,V,Ie,At,It,Nt,ge,yo;let{logErrorIfDebugMode:D}=Sl(),[F,g]=useState(),[T,h]=useState(new Date),I=useRef(null),[E,v]=useState(document.querySelector(e[s].selector)),L=yl(E,T),[U,R]=useState(),[z,J]=useState(!b),X=B!="static"?(qe=(vt=e[s])==null?void 0:vt.props)!=null&&qe.position?e[s].props.position:B:"static",O=(jt=(Qe=(st=e[s])==null?void 0:st.props)==null?void 0:Qe.zIndex)!=null?jt:90,Y=(Bt=F==null?void 0:F.width)!=null?Bt:wl,K=(Gt=F==null?void 0:F.height)!=null?Gt:Tl,[re,ye]=useState(new Date().getTime());l=B!="static"?(u=(ee=(Et=e[s])==null?void 0:Et.props)==null?void 0:ee.offset)!=null?u:l:{x:0,y:0};let Pe=window.location.pathname.split("/").pop();useLayoutEffect(()=>{I.current&&g({width:I.current.clientWidth,height:I.current.clientHeight});},[s,T,X]),useEffect(()=>{b||J(!0);},[s]),useEffect(()=>{p&&z&&S(s);},[z]);let oe=()=>{if(X==="static")return;let te=document.querySelector(e[s].selector);if(!te){R(void 0),v(null),D(`FrigadeTour: Could not find element with selector "${e[s].selector}" for step ${e[s].id}`);return}U&&U===JSON.stringify(te==null?void 0:te.getBoundingClientRect())||(v(te),h(new Date),te&&R(JSON.stringify(te.getBoundingClientRect())));};if(useEffect(()=>{let te=new MutationObserver(oe);return te.observe(document.body,{subtree:!0,childList:!0}),()=>te.disconnect()},[oe]),useEffect(()=>{let te=new MutationObserver(oe);return te.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]}),()=>te.disconnect()},[oe]),useEffect(()=>{let te=setInterval(()=>{oe();},10);return ()=>clearInterval(te)},[oe]),useLayoutEffect(()=>{setTimeout(()=>{oe();},Ic),oe();},[s,Pe]),useEffect(()=>{if(!p)return;let te=Ue=>{Ue.key==="Escape"&&t();};return document.addEventListener("keydown",te),()=>{document.removeEventListener("keydown",te);}},[]),E===null||!p)return null;let _=i==="auto"?"right":i,ie=si(L,_,Y,l,X),ve=L.right+Y>(window.innerWidth||document.documentElement.clientWidth);L.bottom+Tl>(window.innerHeight||document.documentElement.clientHeight);ve&&i==="auto"&&(ie=si(L,"left",Y,l,X),_="left"),(P=(y=e[s])==null?void 0:y.props)!=null&&P.tooltipPosition&&((Ie=(V=e[s])==null?void 0:V.props)==null?void 0:Ie.tooltipPosition)!=="auto"&&(((It=(At=e[s])==null?void 0:At.props)==null?void 0:It.tooltipPosition)==="left"||((ge=(Nt=e[s])==null?void 0:Nt.props)==null?void 0:ge.tooltipPosition)==="right")&&(_=e[s].props.tooltipPosition);let Be=()=>{let te=()=>{if(e[s].handlePrimaryButtonClick&&(e[s].handlePrimaryButtonClick(),J(!1),setTimeout(()=>{oe();},30)),C===e.length-1)return o()},Ue=()=>{e[s].handleSecondaryButtonClick&&(e[s].handleSecondaryButtonClick(),b&&!e[s].secondaryButtonUri&&J(!1));};return q__default.createElement(q__default.Fragment,null,k&&e.length>1&&q__default.createElement(Ai,null,q__default.createElement(Ni,{role:"status",className:a("tooltipStepCounter",c)},s+1," of ",e.length)),(e[s].primaryButtonTitle||e[s].secondaryButtonTitle)&&q__default.createElement(Ii,{showStepCount:k,className:a("tooltipCTAContainer",c)},e[s].secondaryButtonTitle&&q__default.createElement(ae,{title:e[s].secondaryButtonTitle,appearance:c,onClick:Ue,size:"small",withMargin:!1,secondary:!0}),e[s].primaryButtonTitle&&q__default.createElement(ae,{title:e[s].primaryButtonTitle,appearance:c,onClick:te,withMargin:!1,size:"small"})))},xe=()=>{var te,Ue,Wo;return q__default.createElement(q__default.Fragment,null,f&&q__default.createElement(ki,{"data-testid":"tooltip-dismiss",onClick:()=>{t&&t();},className:a("tooltipClose",c),hasImage:!!e[s].imageUri||!!e[s].videoUri,"aria-label":"Close Tooltip",role:"button",tabIndex:0},q__default.createElement(Oe,null)),e[s].imageUri&&q__default.createElement(Pi,{dismissible:f,appearance:c,role:"img","aria-label":e[s].title,src:e[s].imageUri,className:a("tooltipImageContainer",c)}),e[s].videoUri&&!e[s].imageUri&&q__default.createElement(vi,{dismissible:f,appearance:c,role:"video","aria-label":e[s].title,className:a("tooltipVideoContainer",c)},q__default.createElement(rt,{appearance:c,videoUri:e[s].videoUri,autoplay:(te=e[s].props)==null?void 0:te.autoplayVideo,loop:(Ue=e[s].props)==null?void 0:Ue.loopVideo,hideControls:(Wo=e[s].props)==null?void 0:Wo.hideVideoControls})),q__default.createElement(Ei,{className:a("tooltipContentContainer",c)},q__default.createElement(Le,{appearance:c,title:e[s].title,subtitle:e[s].subtitle,size:"small",ariaPrefix:`Tooltip${e[s].id}`}),q__default.createElement(Bi,{className:a("tooltipFooter",c)},q__default.createElement(Be,null))))},G=w(w({},{default:te=>{var Ue;if((Ue=e[s])!=null&&Ue.StepContent){let Wo=e[s].StepContent;return q__default.createElement("div",null,Wo)}return q__default.createElement(xe,null)}}),m),ne=()=>{var te;return e?!((te=e[s])!=null&&te.type)||!G[e[s].type]?G.default(e[s]):G[e[s].type]({stepData:e[s],primaryColor:r}):q__default.createElement(q__default.Fragment,null)};if(e[s].complete===!0||ie.x==0&&ie.y==0&&new Date().getTime()-re<100)return null;let M={top:(ie==null?void 0:ie.y)-xo,left:(yo=_=="left"?L.x+l.x:(ie==null?void 0:ie.x)-xo)!=null?yo:0,cursor:b?"pointer":"default",position:X},Q=()=>{let Ue=M.left+(_=="left"?-Y:24);return Math.min(Math.max(Ue,20),window.innerWidth-Y-20)},Te=()=>{let te=M.top+K,Ue=20;return te>window.innerHeight-Ue?M.top+-K:M.top},Xe=()=>{b&&(h(new Date),J(!z));};return q__default.createElement(Lc,{className:N},q__default.createElement($c,{style:M,zIndex:O,className:a("tourHighlightContainer",c)},n&&e[s].showHighlight!==!1&&B!=="static"&&q__default.createElement(q__default.Fragment,null,q__default.createElement(Oc,{style:{position:X},onClick:Xe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightInnerCircle",c)}),q__default.createElement(Nc,{style:{position:"absolute"},onClick:Xe,primaryColor:c.theme.colorPrimary,className:a("tourHighlightOuterCircle",c)}))),q__default.createElement(Fl,{style:j(w({},M),{left:Q(),top:Te()}),zIndex:O+1,className:a("tooltipContainerWrapper",c)},z&&q__default.createElement(q__default.Fragment,null,q__default.createElement(Go,{ref:I,role:"dialog","aria-labelledby":`frigadeTooltip${e[s].id}Title`,"aria-describedby":`frigadeTooltip${e[s].id}Subtitle`,layoutId:"tooltip-container",tabIndex:0,"aria-label":"Tooltip",style:w({position:"relative",width:"max-content",right:0,top:B!=="static"?12:0},d),appearance:c,className:a("tooltipContainer",c),maxWidth:wl,zIndex:O+10},q__default.createElement(ne,null)),x&&q__default.createElement(Li,{className:a("poweredByFrigadeTooltipRibbon",c),appearance:c,zIndex:O+10},q__default.createElement(Ko,{appearance:c})))))},zo=Mc;var zc=x=>{var B=x,{flowId:e,customVariables:t,appearance:o,onStepCompletion:i,onButtonClick:n,showTooltipsSimultaneously:r=!1,onDismiss:l,dismissible:p,tooltipPosition:d="auto",showHighlightOnly:s=!1,dismissBehavior:m="skip-flow",onComplete:c,skipIfNotFound:f=!1,cssPosition:b="absolute",className:k}=B,C=Me(B,["flowId","customVariables","appearance","onStepCompletion","onButtonClick","showTooltipsSimultaneously","onDismiss","dismissible","tooltipPosition","showHighlightOnly","dismissBehavior","onComplete","skipIfNotFound","cssPosition","className"]);let{getFlow:S,getFlowSteps:N,isLoading:D,targetingLogicShouldHideFlow:F,markStepCompleted:g,markStepStarted:T,markFlowCompleted:h,markFlowSkipped:I,updateCustomVariables:E,getCurrentStepIndex:v,getStepStatus:L,isStepBlocked:U,getFlowStatus:R,getNumberOfStepsCompleted:z}=le(),{isLoadingUserFlowStateData:J}=We(),{primaryCTAClickSideEffects:X,secondaryCTAClickSideEffects:O}=fe(),{hasOpenModals:Y}=Ne(),K=v(e),{openFlowStates:re}=useContext(se),{mergeAppearanceWithDefault:ye}=ce();if(o=ye(o),useEffect(()=>{E(t);},[t,D]),J)return null;let Pe=S(e);if(!Pe||F(Pe)||R(e)==de||Y())return null;let oe=N(e);if(Object.keys(re).length>0){let M=Object.keys(re).find(Q=>re[Q]===!0);if(M!==void 0&&M!==e)return q__default.createElement(q__default.Fragment,null)}function _(M){return $(this,null,function*(){if(yield g(e,M.id),oe.map(Q=>L(e,Q.id)).every(Q=>Q===ze)){yield h(e);return}!s&&K+1<oe.length&&!r&&U(e,oe[K+1].id);})}function ie(M,Q,Te){let Xe=K+1<oe.length?oe[K+1]:null;n&&n(M,K,Q,Xe),i&&i(M,Te,Xe);}function ve(){return oe.map(M=>j(w({},M),{handleSecondaryButtonClick:()=>$(this,null,function*(){O(M),M.skippable===!0&&(yield g(e,M.id,{skipped:!0})),ie(M,"secondary",K);}),handlePrimaryButtonClick:()=>$(this,null,function*(){(!M.completionCriteria&&(M.autoMarkCompleted||M.autoMarkCompleted===void 0)||M.completionCriteria&&M.autoMarkCompleted===!0)&&(yield _(M)),ie(M,"primary",K),X(M);})}))}function Ke(M){return $(this,null,function*(){l&&l(),m==="skip-flow"?yield I(e):yield g(e,M.id);})}function Be(){c&&c();}function xe(M){return $(this,null,function*(){yield T(e,oe[M].id);})}let W=!document.querySelector(oe[K].selector);function G(){let M=oe.findIndex((Q,Te)=>!!document.querySelector(Q.selector)&&Te>=K);return oe.map((Q,Te)=>r?q__default.createElement(zo,w({key:Q.id,appearance:o,steps:ve(),selectedStep:Te,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Ke(Q),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:z(e),onComplete:Be,cssPosition:b,onViewTooltip:xe,className:k},C)):f&&W&&Te===M?q__default.createElement(zo,w({key:Q.id,appearance:o,steps:ve(),selectedStep:Te,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Ke(Q),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:z(e),onComplete:Be,cssPosition:b,onViewTooltip:xe,className:k},C)):Te!=K?null:q__default.createElement(zo,w({key:Q.id,appearance:o,steps:ve(),selectedStep:Te,showTooltipsSimultaneously:r,dismissible:p,onDismiss:()=>Ke(Q),tooltipPosition:d,showHighlightOnly:s,completedStepsCount:z(e),onComplete:Be,cssPosition:b,onViewTooltip:xe,className:k},C)))}function ne(){return q__default.createElement(q__default.Fragment,null,q__default.createElement(pe,{appearance:o}),G())}return b==="static"?ne():q__default.createElement(Portal,null,ne())};var kl=Ce.button`
1488
+ ${e=>A(e)} {
1489
1489
  // Anything inside this block will be ignored if the user provides a custom class
1490
1490
 
1491
1491
  display: flex;
@@ -1502,17 +1502,17 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1502
1502
  opacity: 0.8;
1503
1503
  }
1504
1504
  }
1505
- `,Pl=xe.span`
1506
- ${e=>E(e)} {
1505
+ `,Pl=Ce.span`
1506
+ ${e=>A(e)} {
1507
1507
  font-size: 12px;
1508
1508
  display: inline-block;
1509
1509
  }
1510
- `,vl=xe.span`
1511
- ${e=>E(e)} {
1510
+ `,vl=Ce.span`
1511
+ ${e=>A(e)} {
1512
1512
  font-size: 12px;
1513
1513
  display: inline-block;
1514
1514
  }
1515
- `,Bl=xe.div`
1515
+ `,Bl=Ce.div`
1516
1516
  position: fixed;
1517
1517
  right: 0;
1518
1518
  bottom: 0;
@@ -1522,8 +1522,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1522
1522
  flex-direction: column;
1523
1523
  align-items: flex-end;
1524
1524
  z-index: 50;
1525
- `,El=xe.button`
1526
- ${e=>E(e)} {
1525
+ `,El=Ce.button`
1526
+ ${e=>A(e)} {
1527
1527
  // Anything inside this block will be ignored if the user provides a custom class
1528
1528
  background-color: #ffffff;
1529
1529
  border: 1px solid #f5f5f5;
@@ -1538,8 +1538,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1538
1538
  0px 3px 6px -4px rgba(0, 0, 0, 0.12);
1539
1539
  border-radius: 45px;
1540
1540
  cursor: pointer;
1541
- `,Al=xe.div`
1542
- ${e=>E(e)} {
1541
+ `,Al=Ce.div`
1542
+ ${e=>A(e)} {
1543
1543
  // Anything inside this block will be ignored if the user provides a custom class
1544
1544
  background: #ffffff;
1545
1545
  }
@@ -1555,8 +1555,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1555
1555
  position: ${e=>e.type=="inline"?"absolute":"relative"};
1556
1556
  top: ${e=>e.type=="inline"?"68px":0};
1557
1557
  margin-left: ${e=>e.type=="inline"?"-127px":0};
1558
- `,Il=xe.button`
1559
- ${e=>E(e)} {
1558
+ `,Il=Ce.button`
1559
+ ${e=>A(e)} {
1560
1560
  // Anything inside this block will be ignored if the user provides a custom class
1561
1561
  color: #434343;
1562
1562
  :hover {
@@ -1572,8 +1572,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1572
1572
  font-size: 14px;
1573
1573
 
1574
1574
  padding: 8px 12px;
1575
- `;var Ol=({style:e,className:t})=>Y__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},Y__default.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"}));var $l=({style:e,className:t})=>Y__default.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"},Y__default.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 Gc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:l})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:s,getStepStatus:f,getNumberOfStepsCompleted:c,isLoading:g,targetingLogicShouldHideFlow:b}=se(),{primaryCTAClickSideEffects:F}=fe(),x=useRef(null),[h,P]=useState(!1),{mergeAppearanceWithDefault:S}=ce();l=S(l),useEffect(()=>(document.addEventListener("click",N,!1),()=>{document.removeEventListener("click",N,!1);}),[]);let N=C=>{x.current&&!x.current.contains(C.target)&&P(!1);};if(g)return null;let U=p(e);if(!U||b(U))return null;let T=d(e);if(!T||!i)return null;function u(C,I){!C.completionCriteria&&(C.autoMarkCompleted||C.autoMarkCompleted===void 0)&&s(e,C.id),F(C),o&&o(C,I),P(!1);}function A(){return h&&Y__default.createElement(Al,{className:a("floatingWidgetMenu",l),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},T.map((C,I)=>Y__default.createElement(Il,{className:a("floatingWidgetMenuItem",l),key:I,onClick:()=>u(C,I)},C.title)))}return n=="inline"?Y__default.createElement("span",{ref:x},Y__default.createElement(ae,{appearance:l}),Y__default.createElement(kl,{style:t,onClick:()=>{P(!h);},className:a("supportButton",l)},Y__default.createElement(vl,{className:a("supportIconContainer",l)},Y__default.createElement($l,{className:a("supportIcon",l),style:{width:"18px",height:"18px"}})),Y__default.createElement(Pl,{className:a("supportButtonTitle",l)},r)),Y__default.createElement(A,null)):Y__default.createElement(Portal,null,Y__default.createElement(ae,{appearance:l}),Y__default.createElement(Bl,{style:t,ref:x},Y__default.createElement(A,null),Y__default.createElement(El,{onClick:()=>{P(!h);},whileHover:{scale:1.1},className:a("floatingWidgetButton",l)},Y__default.createElement(Ol,{className:a("floatingWidgetButtonIcon",l),style:{display:"flex",width:"20px",height:"20px"}}))))};var Ml=xe.div`
1576
- ${e=>E(e)} {
1575
+ `;var Ol=({style:e,className:t})=>q__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",fill:"none",viewBox:"0 0 18 18",style:e,className:t},q__default.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"}));var $l=({style:e,className:t})=>q__default.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"},q__default.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 Gc=({flowId:e,style:t,onStepCompletion:o,visible:i=!0,type:n="inline",title:r="Help",appearance:l})=>{let{getFlow:p,getFlowSteps:d,markStepCompleted:s,getStepStatus:m,getNumberOfStepsCompleted:c,isLoading:f,targetingLogicShouldHideFlow:b}=le(),{primaryCTAClickSideEffects:k}=fe(),C=useRef(null),[x,B]=useState(!1),{mergeAppearanceWithDefault:S}=ce();l=S(l),useEffect(()=>(document.addEventListener("click",N,!1),()=>{document.removeEventListener("click",N,!1);}),[]);let N=h=>{C.current&&!C.current.contains(h.target)&&B(!1);};if(f)return null;let D=p(e);if(!D||b(D))return null;let F=d(e);if(!F||!i)return null;function g(h,I){!h.completionCriteria&&(h.autoMarkCompleted||h.autoMarkCompleted===void 0)&&s(e,h.id),k(h),o&&o(h,I),B(!1);}function T(){return x&&q__default.createElement(Al,{className:a("floatingWidgetMenu",l),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.1},type:n},F.map((h,I)=>q__default.createElement(Il,{className:a("floatingWidgetMenuItem",l),key:I,onClick:()=>g(h,I)},h.title)))}return n=="inline"?q__default.createElement("span",{ref:C},q__default.createElement(pe,{appearance:l}),q__default.createElement(kl,{style:t,onClick:()=>{B(!x);},className:a("supportButton",l)},q__default.createElement(vl,{className:a("supportIconContainer",l)},q__default.createElement($l,{className:a("supportIcon",l),style:{width:"18px",height:"18px"}})),q__default.createElement(Pl,{className:a("supportButtonTitle",l)},r)),q__default.createElement(T,null)):q__default.createElement(Portal,null,q__default.createElement(pe,{appearance:l}),q__default.createElement(Bl,{style:t,ref:C},q__default.createElement(T,null),q__default.createElement(El,{onClick:()=>{B(!x);},whileHover:{scale:1.1},className:a("floatingWidgetButton",l)},q__default.createElement(Ol,{className:a("floatingWidgetButtonIcon",l),style:{display:"flex",width:"20px",height:"20px"}}))))};var Ml=Ce.div`
1576
+ ${e=>A(e)} {
1577
1577
  display: flex;
1578
1578
  flex-direction: column;
1579
1579
  width: 100%;
@@ -1587,19 +1587,19 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1587
1587
  border-radius: 12px;
1588
1588
  position: relative;
1589
1589
  }
1590
- `,Dl=xe.div`
1590
+ `,Dl=Ce.div`
1591
1591
  display: flex;
1592
1592
  flex-direction: column;
1593
1593
  flex: 1;
1594
- `,Ul=xe.div`
1594
+ `,Ul=Ce.div`
1595
1595
  display: flex;
1596
1596
  flex-direction: row;
1597
1597
  justify-content: flex-start;
1598
1598
  align-items: center;
1599
1599
  margin-top: 16px;
1600
1600
  gap: 12px;
1601
- `,_l=xe.div`
1602
- ${e=>E(e)} {
1601
+ `,_l=Ce.div`
1602
+ ${e=>A(e)} {
1603
1603
  position: absolute;
1604
1604
  top: 16px;
1605
1605
  right: 16px;
@@ -1609,8 +1609,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1609
1609
  opacity: 0.8;
1610
1610
  }
1611
1611
  }
1612
- `;var zl=xe.div`
1613
- ${e=>E(e)} {
1612
+ `;var zl=Ce.div`
1613
+ ${e=>A(e)} {
1614
1614
  display: flex;
1615
1615
  flex-direction: column;
1616
1616
  width: 100%;
@@ -1620,29 +1620,29 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1620
1620
  background-color: ${e=>e.appearance.theme.colorBackground};
1621
1621
  position: relative;
1622
1622
  }
1623
- `,Wl=xe.div`
1623
+ `,Wl=Ce.div`
1624
1624
  display: flex;
1625
1625
  flex-direction: column;
1626
1626
  flex: 1;
1627
- `,Hl=xe.div`
1627
+ `,Hl=Ce.div`
1628
1628
  display: flex;
1629
1629
  flex-direction: column;
1630
1630
  justify-content: center;
1631
1631
  align-items: center;
1632
1632
  margin-bottom: 12px;
1633
1633
  margin-top: 4px;
1634
- `,Vl=xe.div`
1634
+ `,Vl=Ce.div`
1635
1635
  display: flex;
1636
1636
  flex-direction: row;
1637
1637
  justify-content: center;
1638
1638
  align-items: stretch;
1639
1639
  gap: 16px;
1640
1640
  margin-top: 8px;
1641
- `,yr=xe.div`
1641
+ `,yr=Ce.div`
1642
1642
  margin-top: 16px;
1643
1643
  margin-bottom: 16px;
1644
- `,jl=xe.div`
1645
- ${e=>E(e)} {
1644
+ `,jl=Ce.div`
1645
+ ${e=>A(e)} {
1646
1646
  position: absolute;
1647
1647
  top: -16px;
1648
1648
  right: -16px;
@@ -1652,8 +1652,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1652
1652
  opacity: 0.8;
1653
1653
  }
1654
1654
  }
1655
- `,Gl=xe.h1`
1656
- ${e=>E(e)} {
1655
+ `,Gl=Ce.h1`
1656
+ ${e=>A(e)} {
1657
1657
  font-style: normal;
1658
1658
  justify-content: center;
1659
1659
  text-align: center;
@@ -1666,8 +1666,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1666
1666
  color: ${e=>e.appearance.theme.colorText};
1667
1667
  margin-bottom: 8px;
1668
1668
  }
1669
- `,Kl=xe.h2`
1670
- ${e=>E(e)} {
1669
+ `,Kl=Ce.h2`
1670
+ ${e=>A(e)} {
1671
1671
  font-style: normal;
1672
1672
  justify-content: center;
1673
1673
  text-align: center;
@@ -1678,14 +1678,14 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1678
1678
  letter-spacing: 0.28px;
1679
1679
  margin-bottom: 8px;
1680
1680
  }
1681
- `;var qc=xe.img`
1681
+ `;var qc=Ce.img`
1682
1682
  width: 100%;
1683
1683
  height: 100%;
1684
1684
  min-height: 200px;
1685
1685
  border-radius: ${e=>e.appearance.theme.borderRadius}px;
1686
- `;function Sr({stepData:e,appearance:t,classPrefix:o=""}){var i,n,r;return e.videoUri?Y__default.createElement(ot,{appearance:t,videoUri:e.videoUri,autoplay:(i=e.props)==null?void 0:i.autoplayVideo,loop:(n=e.props)==null?void 0:n.loopVideo,hideControls:(r=e.props)==null?void 0:r.hideVideoControls}):e.imageUri?Y__default.createElement(qc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Jc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p,onClick:d})=>{let{getFlow:s,markFlowCompleted:f,markFlowSkipped:c,markStepCompleted:g,isLoading:b,targetingLogicShouldHideFlow:F,updateCustomVariables:x,getFlowSteps:h,getFlowStatus:P,getCurrentStepIndex:S}=se(),{primaryCTAClickSideEffects:N,secondaryCTAClickSideEffects:U}=fe(),{mergeAppearanceWithDefault:T}=ce();if(qe(e),n=T(n),useEffect(()=>{x(o);},[o,b]),b)return null;let u=s(e);if(!u||F(u)||P(e)===de)return null;let C=h(e)[S(e)];return Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(ae,{appearance:n}),Y__default.createElement(Ml,{appearance:n,className:Te(a("embeddedTipContainer",n),r),style:l,onClick:d},(p===!0||C.dismissible)&&Y__default.createElement(_l,{onClick:()=>$(void 0,null,function*(){yield c(e),t&&t();}),className:a("embeddedTipDismissButton",n)},Y__default.createElement(Ne,null)),(C.imageUri||C.videoUri)&&Y__default.createElement(yr,{className:a("embeddedTipMediaContainer",n)},Y__default.createElement(Sr,{appearance:n,stepData:C})),Y__default.createElement(Dl,{className:a("embeddedTipTextContainer",n)},Y__default.createElement(Oe,{size:"small",appearance:n,title:C.title,subtitle:C.subtitle})),(C.primaryButtonTitle||C.secondaryButtonTitle)&&Y__default.createElement(Ul,{className:a("embeddedTipCallToActionContainer",n)},C.primaryButtonTitle&&Y__default.createElement(le,{classPrefix:"embeddedTip",title:C.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>$(void 0,null,function*(){C.handlePrimaryButtonClick(),N(C),!(i&&i(C,S(e),"primary")===!1)&&(yield g(e,C.id),yield f(e));})}),C.secondaryButtonTitle&&Y__default.createElement(le,{classPrefix:"embeddedTip",title:C.secondaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>$(void 0,null,function*(){C.handleSecondaryButtonClick(),U(C),i&&i(C,S(e),"secondary");}),secondary:!0}))))};var Yl=xe.div`
1686
+ `;function Sr({stepData:e,appearance:t,classPrefix:o=""}){var i,n,r;return e.videoUri?q__default.createElement(rt,{appearance:t,videoUri:e.videoUri,autoplay:(i=e.props)==null?void 0:i.autoplayVideo,loop:(n=e.props)==null?void 0:n.loopVideo,hideControls:(r=e.props)==null?void 0:r.hideVideoControls}):e.imageUri?q__default.createElement(qc,{className:a(`${o}image`,t),appearance:t,src:e.imageUri}):null}var Jc=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p,onClick:d})=>{let{getFlow:s,markFlowCompleted:m,markFlowSkipped:c,markStepCompleted:f,isLoading:b,targetingLogicShouldHideFlow:k,updateCustomVariables:C,getFlowSteps:x,getFlowStatus:B,getCurrentStepIndex:S}=le(),{primaryCTAClickSideEffects:N,secondaryCTAClickSideEffects:D}=fe(),{mergeAppearanceWithDefault:F}=ce();if(Ye(e),n=F(n),useEffect(()=>{C(o);},[o,b]),b)return null;let g=s(e);if(!g||k(g)||B(e)===de)return null;let h=x(e)[S(e)];return q__default.createElement(q__default.Fragment,null,q__default.createElement(pe,{appearance:n}),q__default.createElement(Ml,{appearance:n,className:Fe(a("embeddedTipContainer",n),r),style:l,onClick:d},(p===!0||h.dismissible)&&q__default.createElement(_l,{onClick:()=>$(void 0,null,function*(){yield c(e),t&&t();}),className:a("embeddedTipDismissButton",n)},q__default.createElement(Oe,null)),(h.imageUri||h.videoUri)&&q__default.createElement(yr,{className:a("embeddedTipMediaContainer",n)},q__default.createElement(Sr,{appearance:n,stepData:h})),q__default.createElement(Dl,{className:a("embeddedTipTextContainer",n)},q__default.createElement(Le,{size:"small",appearance:n,title:h.title,subtitle:h.subtitle})),(h.primaryButtonTitle||h.secondaryButtonTitle)&&q__default.createElement(Ul,{className:a("embeddedTipCallToActionContainer",n)},h.primaryButtonTitle&&q__default.createElement(ae,{classPrefix:"embeddedTip",title:h.primaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>$(void 0,null,function*(){h.handlePrimaryButtonClick(),N(h),!(i&&i(h,S(e),"primary")===!1)&&(yield f(e,h.id),yield m(e));})}),h.secondaryButtonTitle&&q__default.createElement(ae,{classPrefix:"embeddedTip",title:h.secondaryButtonTitle,appearance:n,withMargin:!1,size:"medium",type:"inline",onClick:()=>$(void 0,null,function*(){h.handleSecondaryButtonClick(),D(h),i&&i(h,S(e),"secondary");}),secondary:!0}))))};var Yl=Ce.div`
1687
1687
  // use the :not annotation
1688
- ${e=>E(e)} {
1688
+ ${e=>A(e)} {
1689
1689
  display: flex;
1690
1690
  flex-direction: ${e=>e.type==="square"?"column":"row"};
1691
1691
  width: 100%;
@@ -1695,24 +1695,24 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1695
1695
  background-color: ${e=>e.appearance.theme.colorBackground};
1696
1696
  border-radius: 12px;
1697
1697
  }
1698
- `,Jl=xe.div`
1699
- ${e=>E(e)} {
1698
+ `,Jl=Ce.div`
1699
+ ${e=>A(e)} {
1700
1700
  display: flex;
1701
1701
  width: 46px;
1702
1702
  height: 46px;
1703
1703
  }
1704
- `,Xl=xe.div`
1704
+ `,Xl=Ce.div`
1705
1705
  display: flex;
1706
1706
  flex-direction: column;
1707
1707
  flex: 1;
1708
1708
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1709
1709
  margin-top: ${e=>e.type==="square"?"12px":"0"};
1710
- `,Ql=xe.div`
1710
+ `,Ql=Ce.div`
1711
1711
  display: flex;
1712
1712
  flex-direction: column;
1713
1713
  justify-content: center;
1714
1714
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1715
- `,li=xe.div`
1715
+ `,li=Ce.div`
1716
1716
  display: flex;
1717
1717
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1718
1718
  align-items: flex-end;
@@ -1720,12 +1720,12 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1720
1720
  :hover {
1721
1721
  opacity: 0.8;
1722
1722
  }
1723
- `,ai=xe.div`
1723
+ `,ai=Ce.div`
1724
1724
  display: flex;
1725
1725
  justify-content: ${e=>e.type==="square"?"flex-end":"center"};
1726
1726
  align-items: flex-end;
1727
1727
  margin-left: ${e=>e.type==="square"?"0px":"16px"};
1728
- `;var Zl=({style:e,className:t})=>Y__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},Y__default.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),Y__default.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 Qc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:l,type:p="full-width",icon:d,onClick:s})=>{let{getFlow:f,markFlowCompleted:c,markFlowSkipped:g,isLoading:b,targetingLogicShouldHideFlow:F,updateCustomVariables:x,getFlowMetadata:h,getFlowStatus:P,getFlowSteps:S,getCurrentStepIndex:N}=se(),{primaryCTAClickSideEffects:U}=fe(),{mergeAppearanceWithDefault:T}=ce();if(qe(e),l=T(l),useEffect(()=>{x(n);},[n,b]),b)return null;let u=f(e);if(!u||F(u)||P(e)===de)return null;let A=S(e),C=A.length>0?A[N(e)]:h(e);return C!=null&&C.title&&(t=C.title),C!=null&&C.subtitle&&(o=C.subtitle),Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(ae,{appearance:l}),Y__default.createElement(Yl,{type:p,appearance:l,className:a("bannerContainer",l),onClick:s},p!="square"&&Y__default.createElement(Jl,{className:a("bannerIconContainer",l)},d||Y__default.createElement(Zl,null)),p==="square"&&C.dismissible&&Y__default.createElement(ai,{type:p,className:a("bannerDismissButtonContainer",l)},Y__default.createElement(li,{type:p,onClick:()=>$(void 0,null,function*(){yield g(e),i&&i();}),className:a("bannerDismissButton",l)},Y__default.createElement(Ne,null))),Y__default.createElement(Xl,{type:p,className:a("bannerTextContainer",l)},Y__default.createElement(Oe,{appearance:l,title:t,subtitle:o,classPrefix:"banner"})),(C==null?void 0:C.primaryButtonTitle)&&Y__default.createElement(Ql,{type:p,className:a("bannerCallToActionContainer",l)},Y__default.createElement(le,{title:C==null?void 0:C.primaryButtonTitle,appearance:l,onClick:()=>{U(C),r&&r(C,0,"primary");},classPrefix:"banner"})),p!=="square"&&C.dismissible&&Y__default.createElement(ai,{type:p,className:a("bannerDismissButtonContainer",l)},Y__default.createElement(li,{type:p,onClick:()=>$(void 0,null,function*(){yield g(e),i&&i();}),className:a("bannerDismissButton",l)},Y__default.createElement(Ne,null)))))};var Rl=xe.div`
1728
+ `;var Zl=({style:e,className:t})=>q__default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"46",height:"46",fill:"none",viewBox:"0 0 46 46",style:e,className:t},q__default.createElement("circle",{cx:"23",cy:"23",r:"23",fill:"#E6F1FF"}),q__default.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 Qc=({flowId:e,title:t,subtitle:o,onDismiss:i,customVariables:n,onButtonClick:r,appearance:l,type:p="full-width",icon:d,onClick:s})=>{let{getFlow:m,markFlowCompleted:c,markFlowSkipped:f,isLoading:b,targetingLogicShouldHideFlow:k,updateCustomVariables:C,getFlowMetadata:x,getFlowStatus:B,getFlowSteps:S,getCurrentStepIndex:N}=le(),{primaryCTAClickSideEffects:D}=fe(),{mergeAppearanceWithDefault:F}=ce();if(Ye(e),l=F(l),useEffect(()=>{C(n);},[n,b]),b)return null;let g=m(e);if(!g||k(g)||B(e)===de)return null;let T=S(e),h=T.length>0?T[N(e)]:x(e);return h!=null&&h.title&&(t=h.title),h!=null&&h.subtitle&&(o=h.subtitle),q__default.createElement(q__default.Fragment,null,q__default.createElement(pe,{appearance:l}),q__default.createElement(Yl,{type:p,appearance:l,className:a("bannerContainer",l),onClick:s},p!="square"&&q__default.createElement(Jl,{className:a("bannerIconContainer",l)},d||q__default.createElement(Zl,null)),p==="square"&&h.dismissible&&q__default.createElement(ai,{type:p,className:a("bannerDismissButtonContainer",l)},q__default.createElement(li,{type:p,onClick:()=>$(void 0,null,function*(){yield f(e),i&&i();}),className:a("bannerDismissButton",l)},q__default.createElement(Oe,null))),q__default.createElement(Xl,{type:p,className:a("bannerTextContainer",l)},q__default.createElement(Le,{appearance:l,title:t,subtitle:o,classPrefix:"banner"})),(h==null?void 0:h.primaryButtonTitle)&&q__default.createElement(Ql,{type:p,className:a("bannerCallToActionContainer",l)},q__default.createElement(ae,{title:h==null?void 0:h.primaryButtonTitle,appearance:l,onClick:()=>{D(h),r&&r(h,0,"primary");},classPrefix:"banner"})),p!=="square"&&h.dismissible&&q__default.createElement(ai,{type:p,className:a("bannerDismissButtonContainer",l)},q__default.createElement(li,{type:p,onClick:()=>$(void 0,null,function*(){yield f(e),i&&i();}),className:a("bannerDismissButton",l)},q__default.createElement(Oe,null)))))};var Rl=Ce.div`
1729
1729
  display: flex;
1730
1730
  flex-direction: column;
1731
1731
  width: 100%;
@@ -1747,7 +1747,7 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1747
1747
  border-width: 1px;
1748
1748
  border-color: ${t=>t.appearance.theme.colorBorder};
1749
1749
  border-radius: ${t=>t.appearance.theme.borderRadius}px;`:""}
1750
- `,ea=xe.button`
1750
+ `,ea=Ce.button`
1751
1751
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
1752
1752
  border-radius: 8px;
1753
1753
  // If selected make border color primary and text color color priamry
@@ -1768,34 +1768,34 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1768
1768
  display: flex;
1769
1769
  justify-content: center;
1770
1770
  align-items: center;
1771
- `,di=xe.div`
1771
+ `,di=Ce.div`
1772
1772
  display: flex;
1773
1773
  justify-content: space-between;
1774
1774
  margin-top: 16px;
1775
1775
  gap: 8px;
1776
- `,ta=xe.div`
1776
+ `,ta=Ce.div`
1777
1777
  display: flex;
1778
1778
  justify-content: space-between;
1779
1779
  margin-top: 8px;
1780
- `,ci=xe.div`
1780
+ `,ci=Ce.div`
1781
1781
  font-size: 12px;
1782
1782
  line-height: 18px;
1783
1783
  color: ${e=>e.appearance.theme.colorTextDisabled};
1784
1784
  font-style: normal;
1785
1785
  font-weight: 400;
1786
1786
  letter-spacing: 0.24px;
1787
- `,mi=xe.div`
1787
+ `,mi=Ce.div`
1788
1788
  display: flex;
1789
1789
  flex-direction: column;
1790
1790
  flex: 1;
1791
- `;xe.div`
1791
+ `;Ce.div`
1792
1792
  display: flex;
1793
1793
  flex-direction: column;
1794
1794
  justify-content: center;
1795
1795
  align-items: flex-start;
1796
1796
  margin-top: 16px;
1797
- `;var oa=xe.textarea`
1798
- ${e=>E(e)} {
1797
+ `;var oa=Ce.textarea`
1798
+ ${e=>A(e)} {
1799
1799
  color: ${e=>e.appearance.theme.colorText};
1800
1800
  margin-top: 16px;
1801
1801
  border: 1px solid ${e=>e.appearance.theme.colorBorder};
@@ -1807,8 +1807,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1807
1807
  height: 100px;
1808
1808
  resize: none;
1809
1809
  }
1810
- `,ra=xe.div`
1811
- ${e=>E(e)} {
1810
+ `,ra=Ce.div`
1811
+ ${e=>A(e)} {
1812
1812
  position: absolute;
1813
1813
  top: 16px;
1814
1814
  right: 16px;
@@ -1818,8 +1818,8 @@ ${e=>e.inlineStyles.map(([t,o])=>`.${ko}${t}.${ko}${t} { ${Object.entries(o).map
1818
1818
  opacity: 0.8;
1819
1819
  }
1820
1820
  }
1821
- `;var em=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,type:p="modal"})=>{let {getFlow:d,markFlowCompleted:s,markFlowSkipped:f,markStepCompleted:c,getNumberOfStepsCompleted:g,isLoading:b,targetingLogicShouldHideFlow:F,updateCustomVariables:x,getFlowSteps:h,getFlowStatus:P,getFlowMetadata:S}=se();fe();let {mergeAppearanceWithDefault:U}=ce(),[T,u]=Y__default.useState(null),[A,C]=Y__default.useState(""),I=S(e),{hasOpenModals:B,setKeepCompletedFlowOpenDuringSession:v,shouldKeepCompletedFlowOpenDuringSession:L}=Ie();if(qe(e),n=U(n),useEffect(()=>{x(o);},[o,b]),b)return null;let _=d(e);if(!_||F(_)||P(e)===de||g(e)===1&&!L(e)||B())return null;let z=h(e)[g(e)];function J(){var te,q;return Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(mi,null,Y__default.createElement(Oe,{size:"large",appearance:n,title:z.title,subtitle:z.subtitle})),Y__default.createElement(di,{className:a("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(R=>Y__default.createElement(ea,{className:a("npsNumberButton",n),selected:T===R+1,key:R,onClick:()=>$(this,null,function*(){v(e),u(R+1),yield c(e,z.id,{score:R+1});}),appearance:n},R+1))),Y__default.createElement(ta,{appearance:n},Y__default.createElement(ci,{appearance:n},(te=I==null?void 0:I.negativeLabel)!=null?te:"Not likely at all"),Y__default.createElement(ci,{appearance:n},(q=I==null?void 0:I.positiveLabel)!=null?q:"Extremely likely")))}function G(){var te;return Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(mi,null,Y__default.createElement(Oe,{appearance:n,title:(te=z.title)!=null?te:"Why did you choose this score?",size:"large"})),Y__default.createElement(oa,{appearance:n,value:A,onChange:q=>{C(q.target.value);},placeholder:"Add your optional feedback here..."}),Y__default.createElement(di,{appearance:n,className:a("npsNumberButtonContainer",n)},Y__default.createElement(le,{size:"large",withMargin:!1,onClick:()=>$(this,null,function*(){yield s(e),i&&i(z,1,"primary");}),appearance:n,title:z.secondaryButtonTitle||"Skip",secondary:!0}),Y__default.createElement(le,{size:"large",withMargin:!1,onClick:()=>$(this,null,function*(){yield c(e,z.id,{feedbackText:A}),yield s(e),i&&i(z,1,"primary");}),appearance:n,title:z.primaryButtonTitle||"Submit"})))}function O(){return g(e)>=2?null:Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(ae,{appearance:n}),Y__default.createElement(Rl,{appearance:n,className:Te(a("npsSurveyContainer",n),r),style:l,type:p},Y__default.createElement(ra,{onClick:()=>$(this,null,function*(){yield f(e),t&&t();}),className:a("npsSurveyDismissButton",n)},Y__default.createElement(Ne,null)),g(e)==0&&J(),g(e)==1&&G()))}return p==="inline"?O():Y__default.createElement(Portal,null,O())};var om=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p=!0,modalPosition:d="center",showPagination:s=!0,allowBackNavigation:f})=>{let{getFlow:c,markFlowCompleted:g,markFlowSkipped:b,markStepCompleted:F,markStepStarted:x,isLoading:h,targetingLogicShouldHideFlow:P,updateCustomVariables:S,getFlowSteps:N,getFlowStatus:U,getCurrentStepIndex:T}=se(),{primaryCTAClickSideEffects:u,secondaryCTAClickSideEffects:A}=fe(),{mergeAppearanceWithDefault:C}=ce(),{setOpenFlowState:I,getOpenFlowState:B,hasOpenModals:v}=Ie();qe(e);let[L,_]=[B(e,!0),Se=>I(e,Se)];if(n=C(n),useEffect(()=>{S(o);},[o,h]),h)return null;let K=c(e);if(!K||P(K)||U(e)===de||v())return null;let z=N(e),J=T(e),G=z.length,O=z[J];if(!O)return null;let te=()=>$(void 0,null,function*(){_(!1),yield b(e),t&&t();});function q(){var Se;return Y__default.createElement(Y__default.Fragment,null,Y__default.createElement(ae,{appearance:n}),Y__default.createElement(zl,{appearance:n,className:Te(a("announcementContainer",n),r),style:l},(p===!0||O.dismissible)&&d=="inline"&&Y__default.createElement(jl,{onClick:()=>$(this,null,function*(){yield b(e),t&&t();}),className:a("announcementDismissButton",n)},Y__default.createElement(Ne,null)),Y__default.createElement(Wl,{className:a("announcementTextContainer",n)},Y__default.createElement(Gl,{appearance:n,className:a("announcementTitle",n),dangerouslySetInnerHTML:H(O.title)}),O.subtitle&&Y__default.createElement(Kl,{appearance:n,className:a("announcementSubtitle",n),dangerouslySetInnerHTML:H(O.subtitle)})),(O.imageUri||O.videoUri)&&Y__default.createElement(yr,{className:a("announcementMediaContainer",n)},Y__default.createElement(Sr,{appearance:n,stepData:O})),s&&G>1&&Y__default.createElement(Hl,{className:a("announcementPaginationContainer",n)},Y__default.createElement(or,{className:a("announcementPagination",n),appearance:n,stepCount:G,currentStep:J})),(O.primaryButtonTitle||O.secondaryButtonTitle)&&Y__default.createElement(Vl,{allowBackNavigation:f,className:a("announcementCTAContainer",n)},f&&J>0&&Y__default.createElement(le,{classPrefix:"announcementBack",title:(Se=O.backButtonTitle)!=null?Se:"Back",appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>$(this,null,function*(){i&&i(O,T(e),"back"),yield x(e,z[J-1].id);}),secondary:!0}),O.secondaryButtonTitle&&Y__default.createElement(le,{classPrefix:"announcement",title:O.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>$(this,null,function*(){O.handleSecondaryButtonClick(),A(O),i&&i(O,T(e),"secondary");}),secondary:!0}),O.primaryButtonTitle&&Y__default.createElement(le,{classPrefix:"announcement",title:O.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>$(this,null,function*(){u(O),!(i&&i(O,T(e),"primary")===!1)&&(T(e)===G-1?(O.handlePrimaryButtonClick(),yield g(e)):O.handlePrimaryButtonClick());})}))))}let R={padding:"24px",maxWidth:"400px"};return d==="inline"?q():d!=="center"?Y__default.createElement(Jo,{modalPosition:d,onClose:te,visible:L,dismissible:p,appearance:n},q()):Y__default.createElement(et,{appearance:n,onClose:te,visible:L,style:R,dismissible:p},q())};var na=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=$e(r,["as","children","variant"]);return Y__default.createElement(In,w({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},rm=Object.fromEntries(Object.keys(lr).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>Y__default.createElement(na,j(w({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),ui=Object.assign(na,rm);var sa=l=>{var p=l,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=p,r=$e(p,["as","className","size","title","variant"]);var d;return Y.createElement(An,w({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),Y.createElement(ui,{color:(d=Oo[n])==null?void 0:d.color,fontWeight:"semibold"},i))},im=Object.fromEntries(Object.keys(Oo).map(e=>{let t=o=>Y.createElement(sa,j(w({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),nm=Object.assign(sa,im);String.prototype.replaceAll||(String.prototype.replaceAll=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object regexp]"?this.replace(e,t):this.replace(new RegExp(e,"g"),t)});
1821
+ `;var em=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,type:p="modal"})=>{let {getFlow:d,markFlowCompleted:s,markFlowSkipped:m,markStepCompleted:c,getNumberOfStepsCompleted:f,isLoading:b,targetingLogicShouldHideFlow:k,updateCustomVariables:C,getFlowSteps:x,getFlowStatus:B,getFlowMetadata:S}=le();fe();let {mergeAppearanceWithDefault:D}=ce(),[F,g]=q__default.useState(null),[T,h]=q__default.useState(""),I=S(e),{hasOpenModals:E,setKeepCompletedFlowOpenDuringSession:v,shouldKeepCompletedFlowOpenDuringSession:L}=Ne();if(Ye(e),n=D(n),useEffect(()=>{C(o);},[o,b]),b)return null;let U=d(e);if(!U||k(U)||B(e)===de||f(e)===1&&!L(e)||E())return null;let z=x(e)[f(e)];function J(){var Y,K;return q__default.createElement(q__default.Fragment,null,q__default.createElement(mi,null,q__default.createElement(Le,{size:"large",appearance:n,title:z.title,subtitle:z.subtitle})),q__default.createElement(di,{className:a("npsNumberButtonContainer",n),appearance:n},Array.from(Array(10).keys()).map(re=>q__default.createElement(ea,{className:a("npsNumberButton",n),selected:F===re+1,key:re,onClick:()=>$(this,null,function*(){v(e),g(re+1),yield c(e,z.id,{score:re+1});}),appearance:n},re+1))),q__default.createElement(ta,{appearance:n},q__default.createElement(ci,{appearance:n},(Y=I==null?void 0:I.negativeLabel)!=null?Y:"Not likely at all"),q__default.createElement(ci,{appearance:n},(K=I==null?void 0:I.positiveLabel)!=null?K:"Extremely likely")))}function X(){var Y;return q__default.createElement(q__default.Fragment,null,q__default.createElement(mi,null,q__default.createElement(Le,{appearance:n,title:(Y=z.title)!=null?Y:"Why did you choose this score?",size:"large"})),q__default.createElement(oa,{appearance:n,value:T,onChange:K=>{h(K.target.value);},placeholder:"Add your optional feedback here..."}),q__default.createElement(di,{appearance:n,className:a("npsNumberButtonContainer",n)},q__default.createElement(ae,{size:"large",withMargin:!1,onClick:()=>$(this,null,function*(){yield s(e),i&&i(z,1,"primary");}),appearance:n,title:z.secondaryButtonTitle||"Skip",secondary:!0}),q__default.createElement(ae,{size:"large",withMargin:!1,onClick:()=>$(this,null,function*(){yield c(e,z.id,{feedbackText:T}),yield s(e),i&&i(z,1,"primary");}),appearance:n,title:z.primaryButtonTitle||"Submit"})))}function O(){return f(e)>=2?null:q__default.createElement(q__default.Fragment,null,q__default.createElement(pe,{appearance:n}),q__default.createElement(Rl,{appearance:n,className:Fe(a("npsSurveyContainer",n),r),style:l,type:p},q__default.createElement(ra,{onClick:()=>$(this,null,function*(){yield m(e),t&&t();}),className:a("npsSurveyDismissButton",n)},q__default.createElement(Oe,null)),f(e)==0&&J(),f(e)==1&&X()))}return p==="inline"?O():q__default.createElement(Portal,null,O())};var om=({flowId:e,onDismiss:t,customVariables:o,onButtonClick:i,appearance:n,className:r,style:l,dismissible:p=!0,modalPosition:d="center",showPagination:s=!0,allowBackNavigation:m})=>{let{getFlow:c,markFlowCompleted:f,markFlowSkipped:b,markStepCompleted:k,markStepStarted:C,isLoading:x,targetingLogicShouldHideFlow:B,updateCustomVariables:S,getFlowSteps:N,getFlowStatus:D,getCurrentStepIndex:F}=le(),{primaryCTAClickSideEffects:g,secondaryCTAClickSideEffects:T}=fe(),{mergeAppearanceWithDefault:h}=ce(),{setOpenFlowState:I,getOpenFlowState:E,hasOpenModals:v}=Ne();Ye(e);let[L,U]=[E(e,!0),ye=>I(e,ye)];if(n=h(n),useEffect(()=>{S(o);},[o,x]),x)return null;let R=c(e);if(!R||B(R)||D(e)===de||v())return null;let z=N(e),J=F(e),X=z.length,O=z[J];if(!O)return null;let Y=()=>$(void 0,null,function*(){U(!1),yield b(e),t&&t();});function K(){var ye;return q__default.createElement(q__default.Fragment,null,q__default.createElement(pe,{appearance:n}),q__default.createElement(zl,{appearance:n,className:Fe(a("announcementContainer",n),r),style:l},(p===!0||O.dismissible)&&d=="inline"&&q__default.createElement(jl,{onClick:()=>$(this,null,function*(){yield b(e),t&&t();}),className:a("announcementDismissButton",n)},q__default.createElement(Oe,null)),q__default.createElement(Wl,{className:a("announcementTextContainer",n)},q__default.createElement(Gl,{appearance:n,className:a("announcementTitle",n),dangerouslySetInnerHTML:H(O.title)}),O.subtitle&&q__default.createElement(Kl,{appearance:n,className:a("announcementSubtitle",n),dangerouslySetInnerHTML:H(O.subtitle)})),(O.imageUri||O.videoUri)&&q__default.createElement(yr,{className:a("announcementMediaContainer",n)},q__default.createElement(Sr,{appearance:n,stepData:O})),s&&X>1&&q__default.createElement(Hl,{className:a("announcementPaginationContainer",n)},q__default.createElement(or,{className:a("announcementPagination",n),appearance:n,stepCount:X,currentStep:J})),(O.primaryButtonTitle||O.secondaryButtonTitle)&&q__default.createElement(Vl,{allowBackNavigation:m,className:a("announcementCTAContainer",n)},m&&J>0&&q__default.createElement(ae,{classPrefix:"announcementBack",title:(ye=O.backButtonTitle)!=null?ye:"Back",appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>$(this,null,function*(){i&&i(O,F(e),"back"),yield C(e,z[J-1].id);}),secondary:!0}),O.secondaryButtonTitle&&q__default.createElement(ae,{classPrefix:"announcement",title:O.secondaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>$(this,null,function*(){O.handleSecondaryButtonClick(),T(O),i&&i(O,F(e),"secondary");}),secondary:!0}),O.primaryButtonTitle&&q__default.createElement(ae,{classPrefix:"announcement",title:O.primaryButtonTitle,appearance:n,withMargin:!1,size:"small",type:"full-width",onClick:()=>$(this,null,function*(){g(O),!(i&&i(O,F(e),"primary")===!1)&&(F(e)===X-1?(O.handlePrimaryButtonClick(),yield f(e)):O.handlePrimaryButtonClick());})}))))}let re={padding:"24px",maxWidth:"400px"};return d==="inline"?K():d!=="center"?q__default.createElement(Jo,{modalPosition:d,onClose:Y,visible:L,dismissible:p,appearance:n},K()):q__default.createElement(tt,{appearance:n,onClose:Y,visible:L,style:re,dismissible:p},K())};var na=n=>{var r=n,{as:e="span",children:t,variant:o="Body1"}=r,i=Me(r,["as","children","variant"]);return q__default.createElement(In,w({color:"neutral.foreground",fontFamily:"default",forwardedAs:e,variant:o},i),t)},rm=Object.fromEntries(Object.keys(lr).map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=i=>q__default.createElement(na,j(w({as:t},i),{variant:e}),i.children);return o.displayName=`Text.${e}`,[e,o]})),ui=Object.assign(na,rm);var sa=l=>{var p=l,{as:e="button",className:t,size:o="md",title:i,variant:n="Primary"}=p,r=Me(p,["as","className","size","title","variant"]);var d;return q.createElement(An,w({className:`fr-button-${n.toLowerCase()}${t?` ${t}`:""}`,forwardedAs:e,variant:n,size:o,borderRadius:"md"},r),q.createElement(ui,{color:(d=Oo[n])==null?void 0:d.color,fontWeight:"semibold"},i))},im=Object.fromEntries(Object.keys(Oo).map(e=>{let t=o=>q.createElement(sa,j(w({},o),{variant:e}));return t.displayName=`Button.${e}`,[e,t]})),nm=Object.assign(sa,im);String.prototype.replaceAll||(String.prototype.replaceAll=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object regexp]"?this.replace(e,t):this.replace(new RegExp(e,"g"),t)});
1822
1822
 
1823
- export { No as Box, nm as Button, pt as CheckBox, Fr as FlowType, yt as FormLabel, $r as FormTextField, om as FrigadeAnnouncement, Qc as FrigadeBanner, ni as FrigadeChecklist, at as FrigadeDefaultAppearance, Jc as FrigadeEmbeddedTip, Tn as FrigadeForm, Fc as FrigadeGuide, Sc as FrigadeHeroChecklist, em as FrigadeNPSSurvey, wc as FrigadeProgressBadge, vd as FrigadeProvider, Gc as FrigadeSupportWidget, zc as FrigadeTour, Ur as MultipleChoice, He as ProgressBar, Zt as ProgressRing, ui as Text, ar as tokens, Ie as useFlowOpens, To as useFlowResponses, se as useFlows, Jr as useOrganization, Fo as useUser, ze as useUserFlowStates };
1823
+ export { No as Box, nm as Button, dt as CheckBox, Fr as FlowType, yt as FormLabel, $r as FormTextField, om as FrigadeAnnouncement, Qc as FrigadeBanner, ni as FrigadeChecklist, pt as FrigadeDefaultAppearance, Jc as FrigadeEmbeddedTip, Tn as FrigadeForm, Fc as FrigadeGuide, Sc as FrigadeHeroChecklist, em as FrigadeNPSSurvey, wc as FrigadeProgressBadge, vd as FrigadeProvider, Gc as FrigadeSupportWidget, zc as FrigadeTour, Ur as MultipleChoice, Ve as ProgressBar, Rt as ProgressRing, ui as Text, ar as tokens, Ne as useFlowOpens, To as useFlowResponses, le as useFlows, Jr as useOrganization, Fo as useUser, We as useUserFlowStates };
1824
1824
  //# sourceMappingURL=out.js.map
1825
1825
  //# sourceMappingURL=index.mjs.map