@frigade/react 2.1.17 → 2.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,24 +1,34 @@
1
1
  'use client';
2
+ import { keyframes, Global, ThemeProvider } from '@emotion/react';
2
3
  import * as V from '@radix-ui/react-dialog';
3
4
  import { XMarkIcon } from '@heroicons/react/24/solid';
4
5
  import * as je from 'react';
5
6
  import { createContext, useState, useRef, useMemo, useEffect, useContext, useCallback, useLayoutEffect, Fragment as Fragment$1 } from 'react';
6
7
  import { clsx } from 'clsx';
7
- import Mt from 'known-css-properties';
8
- import _t from 'dompurify';
8
+ import At from 'known-css-properties';
9
+ import Ut from 'dompurify';
9
10
  import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
10
11
  import { Frigade } from '@frigade/js';
11
12
  import * as js from '@frigade/js';
12
13
  export { js as FrigadeJS };
13
- import { keyframes, Global, ThemeProvider } from '@emotion/react';
14
14
  import { ChevronDownIcon } from '@heroicons/react/24/outline';
15
15
  import * as me from '@radix-ui/react-collapsible';
16
16
  import { useForm, useController } from 'react-hook-form';
17
17
  import * as fe from '@radix-ui/react-radio-group';
18
- import * as L from '@radix-ui/react-select';
18
+ import * as $ from '@radix-ui/react-select';
19
19
  import * as X from '@radix-ui/react-popover';
20
20
 
21
- var ao=Object.defineProperty,Rt=Object.defineProperties;var kt=Object.getOwnPropertyDescriptors;var we=Object.getOwnPropertySymbols;var so=Object.prototype.hasOwnProperty,lo=Object.prototype.propertyIsEnumerable;var io=(e,o,t)=>o in e?ao(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))so.call(o,t)&&io(e,t,o[t]);if(we)for(var t of we(o))lo.call(o,t)&&io(e,t,o[t]);return e},p=(e,o)=>Rt(e,kt(o));var Dt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var u=(e,o)=>{var t={};for(var r in e)so.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&we)for(var r of we(e))o.indexOf(r)<0&&lo.call(e,r)&&(t[r]=e[r]);return t};var q=(e,o)=>{for(var t in o)ao(e,t,{get:o[t],enumerable:!0});};var W=(e,o,t)=>new Promise((r,n)=>{var a=c=>{try{d(t.next(c));}catch(m){n(m);}},s=c=>{try{d(t.throw(c));}catch(m){n(m);}},d=c=>c.done?r(c.value):Promise.resolve(c.value).then(a,s);d((t=t.apply(e,o)).next());});var po={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var ve=[5,10,20,35,50,65,80,95,98],co=[...ve],$e=[...ve];co[4]=40;$e[4]=60;var Et={blue:{h:213,s:100,l:ve},gray:{h:220,s:10,l:ve},green:{h:141,s:90,l:co},red:{h:9,s:90,l:$e},yellow:{h:50,s:90,l:$e}};var I={};for(let[e,{h:o,s:t,l:r}]of Object.entries(Et))I[e]=Object.fromEntries(r.map((n,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var uo=p(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},I),{gray100:I.gray[100],gray200:I.gray[200],gray300:I.gray[300],gray400:I.gray[400],gray500:I.gray[500],gray600:I.gray[600],gray700:I.gray[700],gray800:I.gray[800],gray900:I.gray[900],blue400:I.blue[400],blue500:I.blue[500],blue800:I.blue[800],blue900:I.blue[900],green400:I.blue[400],green500:I.green[500],green800:I.green[800],red500:I.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var mo={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,fo={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var go={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Ot="px",It=e=>typeof e=="number"?`${4*e}${Ot}`:e,Ht=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],yo=Object.fromEntries(Ht.map(e=>[e,It(e)]));var xo={fontFamilies:{default:"inherit"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var Be=p(i(p(i({},po),{colors:i(i({},uo),fo)}),xo),{radii:mo,shadows:go,space:yo});function he(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,d=e[n];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(r,he(d,s,t)):r[s]=d,r},{})}function Ve(e){return he(e,"--fr","-")}function ho(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=ho(n,`${o}-${r}`):t[r]=`var(${o}-${r})`;}),t}var ze=Ve(Be),w=ho(Be);var Wt=new Set(["alt","size","src"]),At=Mt.all.filter(e=>e.indexOf("-")!=0&&!Wt.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Lt=Object.fromEntries(At),Ne=he(w.colors),$t={color:Ne,backgroundColor:Ne,borderColor:Ne,border:w.borders,borderRadius:w.radii,borderWidth:w.borderWidths,boxShadow:w.shadows,fontFamily:w.fontFamilies,fontSize:w.fontSizes,fontWeight:w.fontWeights,gap:w.space,lineHeight:w.lineHeights,margin:w.space,marginBottom:w.space,marginLeft:w.space,marginRight:w.space,marginTop:w.space,padding:w.space,paddingBottom:w.space,paddingLeft:w.space,paddingRight:w.space,paddingTop:w.space},bo=i(i({},Lt),$t),Po={bg:["backgroundColor"],m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]},Co=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Vt(e){return Array.isArray(e)?new Map(e.map(o=>[o,o])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):typeof e=="string"||typeof e=="number"?new Map([[e,e]]):new Map}var So=new Map(Object.entries(bo).map(([e,o])=>[e,Vt(o)])),zt=new Map(Object.entries(Po).map(([e,o])=>[e,new Set(o)])),Nt=new Set(["height","width"]),Kt=new Set(["canvas","embed","iframe","img","input","object","video"]);function Fo(e){let[o,t]=e.split(":");return [o,Co.has(t)?t:null]}function To(e,o="div"){let t=Object.assign({},e),r={};function n(a){if(a==null)return r;let d=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[d]==null&&(r[d]={}),r[d]}return Object.entries(t).forEach(([a,s])=>{let[d,c]=Fo(a),m=zt.get(d);m!=null&&(m.forEach(f=>{let y=`${f}${c?":"+c:""}`;t[y]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[d,c]=Fo(a),m=So.get(d);if(m!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");n(c)[d]=f.map(y=>{var h;return (h=m.get(y.toString()))!=null?h:y}).join(" ");}else m.has(s.toString())?n(c)[d]=m.get(s.toString()):n(c)[d]=s;(typeof o!="string"||!Kt.has(o)||!Nt.has(d))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&So.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:r,unmatchedProps:t}}function jt(){if(typeof window=="undefined"){let{JSDOM:e}=Dt("jsdom");return new e("<!DOCTYPE html>").window}return window}function wo(e){return e?{__html:_t(jt()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function Gt(e){return e&&`fr-${e}`}function Ro(e){return e&&(Array.isArray(e)?e.map(o=>Ro(o)).join(" "):Gt(e))}function Jt(d,s){var c=d,{as:e,children:o,className:t,css:r={},part:n}=c,a=u(c,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:f,unmatchedProps:y}=To(a,m),h=Ro(n),P=t||h?clsx(t,h):void 0,F=[{boxSizing:"border-box"},f,r];return typeof o=="string"?jsx(m,p(i({className:P,css:F},y),{ref:s,dangerouslySetInnerHTML:wo(o)})):jsx(m,p(i({className:P,css:F},y),{ref:s,children:o}))}var g=je.forwardRef(Jt);var k={};q(k,{Link:()=>Cr,Plain:()=>Sr,Primary:()=>br,Secondary:()=>Pr});var S={};q(S,{Body1:()=>cr,Body2:()=>ur,Caption:()=>mr,Display1:()=>ir,Display2:()=>ar,H1:()=>sr,H2:()=>lr,H3:()=>pr,H4:()=>dr});var Ke={};q(Ke,{Body1:()=>or,Body2:()=>tr,Caption:()=>rr,Display1:()=>Xt,Display2:()=>qt,H1:()=>Yt,H2:()=>Qt,H3:()=>Zt,H4:()=>er});var Y={color:"neutral.foreground",fontFamily:"default",margin:"0"},Xt=p(i({},Y),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),qt=p(i({},Y),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Yt=p(i({},Y),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Qt=p(i({},Y),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Zt=p(i({},Y),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),er=p(i({},Y),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),or=p(i({},Y),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),tr=p(i({},Y),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),rr=p(i({},Y),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var nr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],Q=Object.fromEntries(nr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=je.forwardRef((d,s)=>{var c=d,{as:r=o,children:n}=c,a=u(c,["as","children"]);return jsx(g,p(i(i({as:r},Ke[e]),a),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),ir=Q.Display1,ar=Q.Display2,sr=Q.H1,lr=Q.H2,pr=Q.H3,dr=Q.H4,cr=Q.Body1,ur=Q.Body2,mr=Q.Caption;var _e={};q(_e,{Link:()=>xr,Plain:()=>hr,Primary:()=>gr,Secondary:()=>yr});var Re={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},gr=p(i({},Re),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),yr=p(i({},Re),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),xr=p(i({},Re),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),hr=p(i({},Re),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"});function ke(s){var d=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=d,a=u(d,["as","children","part","title","variant"]);let c=n.toLocaleLowerCase();return jsxs(g,p(i(i({as:e!=null?e:"button",part:[`button-${c}`,t]},_e[n]),a),{children:[o,r&&jsx(S.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:r})]}))}function br(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(ke,p(i({},o),{variant:"Primary",children:e}))}function Pr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(ke,p(i({},o),{variant:"Secondary",children:e}))}function Cr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(ke,p(i({},o),{variant:"Link",children:e}))}function Sr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(ke,p(i({},o),{variant:"Plain",children:e}))}var C={};q(C,{Column:()=>wr,Row:()=>Tr});var Tr=je.forwardRef((e,o)=>jsx(g,p(i({display:"flex",flexDirection:"row"},e),{ref:o}))),wr=je.forwardRef((e,o)=>jsx(g,p(i({display:"flex",flexDirection:"column"},e),{ref:o})));var H=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function Ho(n){var a=n,{children:e,navigate:o,theme:t}=a,r=u(a,["children","navigate","theme"]);let s=t?Ve(t):{},[d,c]=useState(new Set),m=useRef(new Map),f=useRef(),[y,h]=useState(!1),P=useMemo(()=>new Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId,__readOnly:r.__readOnly,__flowStateOverrides:r.__flowStateOverrides}),[r.userId,r.groupId,r.apiKey]);function F(){let T=[...m.current.entries()].map(([v,D])=>[v,D.callback]);P.batchRegister(T),h(!0);}function x(T,v){if(f.current&&clearTimeout(f.current),y){m.current.has(T)||(P.getFlow(T).then(D=>D.register(v)),m.current.set(T,{callback:v}));return}m.current.has(T)||m.current.set(T,{callback:v}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>F(),0);}function B(T){m.current.has(T)&&P.getFlow(T).then(v=>{m.current.delete(T),v.unregister();});}let R=o!=null?o:(T,v="_self")=>{window.open(T,v);};useEffect(()=>()=>{P.destroy();},[]);let O=d.size>0?d.values().next().value:null;return jsxs(H.Provider,{value:p(i({modals:d,setModals:c,currentModal:O,navigate:R},r),{frigade:P,registerComponent:x,unregisterComponent:B,hasInitialized:y}),children:[jsx(Global,{styles:{":root":i(i({},ze),s)}}),jsx(ThemeProvider,{theme:w,children:e})]})}function re(e,o){let[t,r]=useState(),[,n]=useState(""),{frigade:a}=useContext(H),s=useCallback(d=>{d.id===e&&(o!=null&&o.variables&&d.applyVariables(o.variables),r(d),n(Math.random().toString()));},[o==null?void 0:o.variables]);return useEffect(()=>(W(this,null,function*(){let d=yield a.getFlow(e);if(!d||a.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&d.applyVariables(o.variables),r(d);}),a.onStateChange(s),()=>{a.removeStateChangeHandler(s);}),[s]),useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function ne(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&W(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(n=>W(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function ie(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(H),n={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((a,s,d=!0)=>W(this,null,function*(){if((yield o==null?void 0:o(e,a,s))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let m=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof m=="function"?m():m!==!1&&e.complete(s,d),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else e.complete(s,d),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,s)=>W(this,null,function*(){if((yield t==null?void 0:t(e,a,s))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Pe(e,o=!0){let{currentModal:t,modals:r,setModals:n}=useContext(H),[a,s]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function d(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let m=new Set(c);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:a||!o,removeModal:d}}function U(y){var h=y,{as:e,children:o,dismissible:t=!1,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:d,variables:c,forceMount:m}=h,f=u(h,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let[P,F]=useState(!1),{flow:x}=re(r,{variables:c}),{hasInitialized:B,registerComponent:R,unregisterComponent:O}=useContext(H),T=x==null?void 0:x.getCurrentStep(),{handleDismiss:v}=ne(x,{onComplete:n,onDismiss:a}),{handlePrimary:D,handleSecondary:$}=ie(T,{onPrimary:s,onSecondary:d}),Ae=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:ge,removeModal:de}=Pe(x,Ae);useEffect(()=>{!(x!=null&&x.isVisible)&&ge&&de();},[x==null?void 0:x.isVisible,ge]),useEffect(()=>()=>{O(r);},[]);let ce=m&&((x==null?void 0:x.isCompleted)||(x==null?void 0:x.isSkipped));if(!x||!ce&&!ge||(R(r,()=>{P||F(!0);}),!x.isVisible&&!ce)||!B||!P)return null;(ce||!x.isCompleted&&!x.isSkipped)&&T.start();let Le=e===null?Fragment$1:e!=null?e:g;return jsx(Le,p(i({},e===null?{}:f),{children:o({flow:x,handleDismiss:v,handlePrimary:D,handleSecondary:$,parentProps:i({dismissible:t,flowId:r,variables:c},f),step:T})}))}function zo(e){return jsx(U,p(i({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card"},e),{children:({handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a})=>{var c,m,f,y;let s=(m=(c=a.primaryButton)==null?void 0:c.title)!=null?m:a.primaryButtonTitle,d=(y=(f=a.secondaryButton)==null?void 0:f.title)!=null?y:a.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:n,handleDismiss:o,subtitle:a.subtitle,title:a.title}),jsx(b.Media,{src:a.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:d,onClick:r}),jsx(b.Primary,{title:s,onClick:t})]})]})}}))}function Ue(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);return jsx(g,i({as:"img",part:["image",e],src:o},t))}function Gr(e){var o,t,r,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Ge(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);let a=Gr(o);return a?jsx(g,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsx(g,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ae(r){var n=r,{src:e,type:o}=n,t=u(n,["src","type"]);return jsx(o==="video"?Ge:Ue,i({src:e},t))}var b=je.forwardRef((n,r)=>{var a=n,{children:e,flowId:o}=a,t=u(a,["children","flowId"]);var d;if(o!=null)return jsx(zo,i({flowId:o},t));let s=(d=t.as)!=null?d:C.Column;return jsx(s,p(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});b.Dismiss=e=>jsx(k.Plain,p(i({part:"dismiss",padding:0},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}));b.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=u(s,["dismissible","handleDismiss","subtitle","title"]);return jsxs(C.Row,p(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(b.Subtitle,{color:"gray500",flexBasis:"100%",children:t})]}))};b.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(ae,i({borderRadius:"md",src:e},o))};b.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(k.Primary,i({title:o,onClick:e},t))};b.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(k.Secondary,i({title:o,onClick:e},t))};b.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsx(S.Body2,p(i({display:"block",part:"subtitle"},o),{children:e}))};b.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsx(S.H4,p(i({display:"block",part:"title"},o),{children:e}))};var De={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function _o(e){let o=Object.fromEntries(De.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(De.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!De.content.some(a=>a===n)&&!De.root.some(a=>a===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}function E(n){var a=n,{children:e,className:o,modal:t=!0}=a,r=u(a,["children","className","modal"]);let{rootProps:s,contentProps:d,otherProps:f}=_o(r),y=f,{zIndex:c}=y,m=u(y,["zIndex"]);return jsx(V.Root,p(i({defaultOpen:!0,modal:t},s),{children:jsx(V.Portal,{children:jsxs(g,{className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsx(V.Overlay,{asChild:!0,children:jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(V.Content,p(i({asChild:!0,onOpenAutoFocus:h=>h.preventDefault(),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault()},d),{children:jsx(b,p(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}E.Dismiss=e=>jsx(V.Close,{"aria-label":"Close",asChild:!0,children:jsx(k.Plain,p(i({part:"close",position:"absolute",right:"-4px",top:"4px"},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}))});E.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsx(V.Description,{asChild:!0,children:jsx(S.Body2,p(i({part:"subtitle"},o),{children:e}))})};E.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsx(ae,i({borderRadius:"md",src:e},o))};E.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsx(k.Primary,i({title:o,onClick:e},t))};E.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(g,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?w.colors.blue500:w.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};E.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsx(k.Secondary,i({title:o,onClick:e},t))};E.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsx(V.Title,{asChild:!0,children:jsx(S.H3,p(i({part:"title"},o),{children:e}))})};E.displayName="Dialog";var jo=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function Zr(t){var r=t,{flowId:e}=r,o=u(r,["flowId"]);let n=Object.fromEntries(Object.entries(o).filter(([s])=>jo.some(d=>s===d))),a=Object.fromEntries(Object.entries(o).filter(([s])=>jo.indexOf(s)===-1));return jsx(U,p(i({as:null,flowId:e},n),{children:({flow:s,handleDismiss:d,handlePrimary:c,handleSecondary:m,parentProps:{dismissible:f},step:y})=>{var x,B,R,O,T,v;let h=(x=y.props)!=null?x:{},P=(R=(B=y.primaryButton)==null?void 0:B.title)!=null?R:y.primaryButtonTitle,F=(T=(O=y.secondaryButton)==null?void 0:O.title)!=null?T:y.secondaryButtonTitle;return jsx(E,p(i({part:"announcement",textAlign:"center"},a),{onEscapeKeyDown:D=>{typeof o.onEscapeKeyDown=="function"&&o.onEscapeKeyDown(D),D.defaultPrevented||d(D);},children:jsxs(C.Column,p(i({gap:5,part:"announcement-step"},h),{children:[f&&jsx(E.Dismiss,{onClick:d}),jsxs(C.Column,{gap:1,part:"announcement-header",children:[jsx(E.Title,{children:y.title}),jsx(E.Subtitle,{children:y.subtitle})]}),jsx(E.Media,{src:(v=y.videoUri)!=null?v:y.imageUri,type:y.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(E.ProgressDots,{current:s.getCurrentStepIndex(),total:s.getNumberOfAvailableSteps()}),jsxs(C.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[F&&jsx(E.Secondary,{onClick:m,title:F}),P&&jsx(E.Primary,{onClick:c,title:P})]})]}))}))}}))}function en(r){var n=r,{dismissible:e,flowId:o}=n,t=u(n,["dismissible","flowId"]);return jsx(U,{as:null,flowId:o,children:({handleDismiss:a,handlePrimary:s,handleSecondary:d,step:c})=>{var h,P,F,x,B;let m=(h=c.props)!=null?h:{},f=(F=(P=c.primaryButton)==null?void 0:P.title)!=null?F:c.primaryButtonTitle,y=(B=(x=c.secondaryButton)==null?void 0:x.title)!=null?B:c.secondaryButtonTitle;return jsxs(b,p(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:"banner"},t),m),{children:[c.imageUri&&jsx(g,{as:"img",part:"image",src:c.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(C.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(b.Title,{part:"title",children:c.title}),jsx(b.Subtitle,{part:"subtitle",children:c.subtitle})]}),jsx(b.Secondary,{title:y,onClick:d}),jsx(b.Primary,{title:f,onClick:s}),e&&jsx(b.Dismiss,{onClick:a})]}))}})}var Ze={};q(Ze,{Collapsible:()=>ot,CollapsibleStep:()=>Se});var Se={};q(Se,{Content:()=>qe,Root:()=>Ye,Trigger:()=>Qe});var tn=keyframes`
21
+ var ao=Object.defineProperty,Dt=Object.defineProperties;var Et=Object.getOwnPropertyDescriptors;var ve=Object.getOwnPropertySymbols;var so=Object.prototype.hasOwnProperty,lo=Object.prototype.propertyIsEnumerable;var io=(e,o,t)=>o in e?ao(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))so.call(o,t)&&io(e,t,o[t]);if(ve)for(var t of ve(o))lo.call(o,t)&&io(e,t,o[t]);return e},p=(e,o)=>Dt(e,Et(o));var Ot=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var u=(e,o)=>{var t={};for(var r in e)so.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&ve)for(var r of ve(e))o.indexOf(r)<0&&lo.call(e,r)&&(t[r]=e[r]);return t};var q=(e,o)=>{for(var t in o)ao(e,t,{get:o[t],enumerable:!0});};var A=(e,o,t)=>new Promise((r,n)=>{var a=c=>{try{d(t.next(c));}catch(m){n(m);}},s=c=>{try{d(t.throw(c));}catch(m){n(m);}},d=c=>c.done?r(c.value):Promise.resolve(c.value).then(a,s);d((t=t.apply(e,o)).next());});var po={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var Be=[5,10,20,35,50,65,80,95,98],co=[...Be],$e=[...Be];co[4]=40;$e[4]=60;var It={blue:{h:213,s:100,l:Be},gray:{h:220,s:10,l:Be},green:{h:141,s:90,l:co},red:{h:9,s:90,l:$e},yellow:{h:50,s:90,l:$e}};var H={};for(let[e,{h:o,s:t,l:r}]of Object.entries(It))H[e]=Object.fromEntries(r.map((n,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var uo=p(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},H),{gray100:H.gray[100],gray200:H.gray[200],gray300:H.gray[300],gray400:H.gray[400],gray500:H.gray[500],gray600:H.gray[600],gray700:H.gray[700],gray800:H.gray[800],gray900:H.gray[900],blue400:H.blue[400],blue500:H.blue[500],blue800:H.blue[800],blue900:H.blue[900],green400:H.blue[400],green500:H.green[500],green800:H.green[800],red500:H.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var mo={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,fo={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var go={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Ht="px",Mt=e=>typeof e=="number"?`${4*e}${Ht}`:e,Wt=[-20,-19,-18,-17,-16,-15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,-.5,0,.5,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,"auto"],yo=Object.fromEntries(Wt.map(e=>[e,Mt(e)]));var xo={fontFamilies:{default:"inherit"},fontSizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px"},fontWeights:{thin:"100",extralight:"200",light:"300",regular:"400",medium:"500",demibold:"600",bold:"700",extrabold:"800",black:"900"},letterSpacings:{md:"0.02em"},lineHeights:{xs:"18px",sm:"22px",md:"24px",lg:"26px",xl:"30px","2xl":"38px","3xl":"46px","4xl":"60px"}};var Re=p(i(p(i({},po),{colors:i(i({},uo),fo)}),xo),{radii:mo,shadows:go,space:yo});function be(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,d=e[n];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(r,be(d,s,t)):r[s]=d,r},{})}function Ve(e){return be(e,"--fr","-")}function ho(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=ho(n,`${o}-${r}`):t[r]=`var(${o}-${r})`;}),t}var _e=Ve(Re),w=ho(Re);var Lt=new Set(["alt","size","src"]),$t=At.all.filter(e=>e.indexOf("-")!=0&&!Lt.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Vt=Object.fromEntries($t),ze=be(w.colors),_t={color:ze,backgroundColor:ze,borderColor:ze,border:w.borders,borderRadius:w.radii,borderWidth:w.borderWidths,boxShadow:w.shadows,fontFamily:w.fontFamilies,fontSize:w.fontSizes,fontWeight:w.fontWeights,gap:w.space,lineHeight:w.lineHeights,margin:w.space,marginBottom:w.space,marginLeft:w.space,marginRight:w.space,marginTop:w.space,padding:w.space,paddingBottom:w.space,paddingLeft:w.space,paddingRight:w.space,paddingTop:w.space},bo=i(i({},Vt),_t),Po={bg:["backgroundColor"],m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]},Co=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function zt(e){return Array.isArray(e)?new Map(e.map(o=>[o,o])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):typeof e=="string"||typeof e=="number"?new Map([[e,e]]):new Map}var So=new Map(Object.entries(bo).map(([e,o])=>[e,zt(o)])),Nt=new Map(Object.entries(Po).map(([e,o])=>[e,new Set(o)])),Kt=new Set(["height","width"]),jt=new Set(["canvas","embed","iframe","img","input","object","video"]);function Fo(e){let[o,t]=e.split(":");return [o,Co.has(t)?t:null]}function To(e,o="div"){let t=Object.assign({},e),r={};function n(a){if(a==null)return r;let d=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[d]==null&&(r[d]={}),r[d]}return Object.entries(t).forEach(([a,s])=>{let[d,c]=Fo(a),m=Nt.get(d);m!=null&&(m.forEach(f=>{let g=`${f}${c?":"+c:""}`;t[g]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[d,c]=Fo(a),m=So.get(d);if(m!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");n(c)[d]=f.map(g=>{var h;return (h=m.get(g.toString()))!=null?h:g}).join(" ");}else m.has(s.toString())?n(c)[d]=m.get(s.toString()):n(c)[d]=s;(typeof o!="string"||!jt.has(o)||!Kt.has(d))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&So.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:r,unmatchedProps:t}}function Gt(){if(typeof window=="undefined"){let{JSDOM:e}=Ot("jsdom");return new e("<!DOCTYPE html>").window}return window}function wo(e){return e?{__html:Ut(Gt()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function Xt(e){return e&&`fr-${e}`}function Ro(e){return e&&(Array.isArray(e)?e.map(o=>Ro(o)).join(" "):Xt(e))}function qt(d,s){var c=d,{as:e,children:o,className:t,css:r={},part:n}=c,a=u(c,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:f,unmatchedProps:g}=To(a,m),h=Ro(n),b=t||h?clsx(t,h):void 0,S=[{boxSizing:"border-box"},f,r];return typeof o=="string"?jsx(m,p(i({className:b,css:S},g),{ref:s,dangerouslySetInnerHTML:wo(o)})):jsx(m,p(i({className:b,css:S},g),{ref:s,children:o}))}var y=je.forwardRef(qt);var k={};q(k,{Link:()=>Fr,Plain:()=>Tr,Primary:()=>Cr,Secondary:()=>Sr});var F={};q(F,{Body1:()=>mr,Body2:()=>fr,Caption:()=>gr,Display1:()=>sr,Display2:()=>lr,H1:()=>pr,H2:()=>dr,H3:()=>cr,H4:()=>ur});var Ne={};q(Ne,{Body1:()=>rr,Body2:()=>nr,Caption:()=>ir,Display1:()=>Yt,Display2:()=>Qt,H1:()=>Zt,H2:()=>er,H3:()=>or,H4:()=>tr});var Y={color:"neutral.foreground",fontFamily:"default",margin:"0"},Yt=p(i({},Y),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Qt=p(i({},Y),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Zt=p(i({},Y),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),er=p(i({},Y),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),or=p(i({},Y),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),tr=p(i({},Y),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),rr=p(i({},Y),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),nr=p(i({},Y),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),ir=p(i({},Y),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var ar=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],Q=Object.fromEntries(ar.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=je.forwardRef((d,s)=>{var c=d,{as:r=o,children:n}=c,a=u(c,["as","children"]);return jsx(y,p(i(i({as:r},Ne[e]),a),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),sr=Q.Display1,lr=Q.Display2,pr=Q.H1,dr=Q.H2,cr=Q.H3,ur=Q.H4,mr=Q.Body1,fr=Q.Body2,gr=Q.Caption;var Ke={};q(Ke,{Link:()=>br,Plain:()=>Pr,Primary:()=>xr,Secondary:()=>hr});var ke={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},xr=p(i({},ke),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),hr=p(i({},ke),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),br=p(i({},ke),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Pr=p(i({},ke),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"});function De(s){var d=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=d,a=u(d,["as","children","part","title","variant"]);let c=n.toLocaleLowerCase();return jsxs(y,p(i(i({as:e!=null?e:"button",part:[`button-${c}`,t]},Ke[n]),a),{children:[o,r&&jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:r})]}))}function Cr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(De,p(i({},o),{variant:"Primary",children:e}))}function Sr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(De,p(i({},o),{variant:"Secondary",children:e}))}function Fr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(De,p(i({},o),{variant:"Link",children:e}))}function Tr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(De,p(i({},o),{variant:"Plain",children:e}))}var C={};q(C,{Column:()=>Br,Row:()=>vr});var vr=je.forwardRef((e,o)=>jsx(y,p(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Br=je.forwardRef((e,o)=>jsx(y,p(i({display:"flex",flexDirection:"column"},e),{ref:o})));var D=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function Mo(n){var a=n,{children:e,navigate:o,theme:t}=a,r=u(a,["children","navigate","theme"]);let s=t?Ve(t):{},[d,c]=useState(new Set),m=useRef(new Map),f=useRef(),[g,h]=useState(!1),b=useMemo(()=>new Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId,__readOnly:r.__readOnly,__flowStateOverrides:r.__flowStateOverrides}),[r.userId,r.groupId,r.apiKey]);useEffect(()=>{if(r.__flowStateOverrides){let T=b.getConfig();T.__flowStateOverrides=r.__flowStateOverrides,b.reload(T);}},[r.__flowStateOverrides]);function S(){let T=[...m.current.entries()].map(([v,W])=>[v,W.callback]);b.batchRegister(T),h(!0);}function x(T,v){if(f.current&&clearTimeout(f.current),g){m.current.has(T)||(b.getFlow(T).then(W=>W.register(v)),m.current.set(T,{callback:v}));return}m.current.has(T)||m.current.set(T,{callback:v}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>S(),0);}function B(T){m.current.has(T)&&b.getFlow(T).then(v=>{m.current.delete(T),v.unregister();});}let R=o!=null?o:(T,v="_self")=>{window.open(T,v);};useEffect(()=>()=>{b.destroy();},[]);let I=d.size>0?d.values().next().value:null;return jsxs(D.Provider,{value:p(i({modals:d,setModals:c,currentModal:I,navigate:R},r),{frigade:b,registerComponent:x,unregisterComponent:B,hasInitialized:g}),children:[jsx(Global,{styles:{":root":i(i({},_e),s)}}),jsx(ThemeProvider,{theme:w,children:e})]})}function re(e,o){let[t,r]=useState(),[,n]=useState(""),{frigade:a}=useContext(D),s=useCallback(d=>{d.id===e&&(o!=null&&o.variables&&d.applyVariables(o.variables),r(d),n(Math.random().toString()));},[o==null?void 0:o.variables]);return useEffect(()=>(A(this,null,function*(){let d=yield a.getFlow(e);if(!d||a.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&d.applyVariables(o.variables),r(d);}),a.onStateChange(s),()=>{a.removeStateChangeHandler(s);}),[s]),useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function ne(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&A(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(n=>A(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function ie(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(D),n={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((a,s,d=!0)=>A(this,null,function*(){if((yield o==null?void 0:o(e,a,s))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let m=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof m=="function"?m():m!==!1&&e.complete(s,d),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else e.complete(s,d),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,s)=>A(this,null,function*(){if((yield t==null?void 0:t(e,a,s))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Ce(e,o=!0){let{currentModal:t,modals:r,setModals:n}=useContext(D),[a,s]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function d(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let m=new Set(c);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:a||!o,removeModal:d}}function U(g){var h=g,{as:e,children:o,dismissible:t=!1,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:d,variables:c,forceMount:m}=h,f=u(h,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let[b,S]=useState(!1),{flow:x}=re(r,{variables:c}),{hasInitialized:B,registerComponent:R,unregisterComponent:I}=useContext(D),T=x==null?void 0:x.getCurrentStep(),{handleDismiss:v}=ne(x,{onComplete:n,onDismiss:a}),{handlePrimary:W,handleSecondary:E}=ie(T,{onPrimary:s,onSecondary:d}),ge=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:ye,removeModal:de}=Ce(x,ge);useEffect(()=>{!(x!=null&&x.isVisible)&&ye&&de();},[x==null?void 0:x.isVisible,ye]),useEffect(()=>()=>{I(r);},[]);let ce=m&&((x==null?void 0:x.isCompleted)||(x==null?void 0:x.isSkipped));if(!x||!ce&&!ye||(R(r,()=>{b||S(!0);}),!x.isVisible&&!ce)||!B||!b)return null;(ce||!x.isCompleted&&!x.isSkipped)&&T.start();let Le=e===null?Fragment$1:e!=null?e:y;return jsx(Le,p(i({},e===null?{}:f),{children:o({flow:x,handleDismiss:v,handlePrimary:W,handleSecondary:E,parentProps:i({dismissible:t,flowId:r,variables:c},f),step:T})}))}function zo(e){return jsx(U,p(i({as:P,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card"},e),{children:({handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a})=>{var c,m,f,g;let s=(m=(c=a.primaryButton)==null?void 0:c.title)!=null?m:a.primaryButtonTitle,d=(g=(f=a.secondaryButton)==null?void 0:f.title)!=null?g:a.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(P.Header,{dismissible:n,handleDismiss:o,subtitle:a.subtitle,title:a.title}),jsx(P.Media,{src:a.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(P.Secondary,{title:d,onClick:r}),jsx(P.Primary,{title:s,onClick:t})]})]})}}))}function Ue(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);return jsx(y,i({as:"img",part:["image",e],src:o},t))}function Jr(e){var o,t,r,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Ge(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);let a=Jr(o);return a?jsx(y,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsx(y,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ae(r){var n=r,{src:e,type:o}=n,t=u(n,["src","type"]);return jsx(o==="video"?Ge:Ue,i({src:e},t))}var P=je.forwardRef((n,r)=>{var a=n,{children:e,flowId:o}=a,t=u(a,["children","flowId"]);var d;if(o!=null)return jsx(zo,i({flowId:o},t));let s=(d=t.as)!=null?d:C.Column;return jsx(s,p(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});P.Dismiss=e=>jsx(k.Plain,p(i({part:"dismiss",padding:0},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}));P.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=u(s,["dismissible","handleDismiss","subtitle","title"]);return jsxs(C.Row,p(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsx(P.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsx(P.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(P.Subtitle,{color:"gray500",flexBasis:"100%",children:t})]}))};P.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(ae,i({borderRadius:"md",src:e},o))};P.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(k.Primary,i({title:o,onClick:e},t))};P.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(k.Secondary,i({title:o,onClick:e},t))};P.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsx(F.Body2,p(i({display:"block",part:"subtitle"},o),{children:e}))};P.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsx(F.H4,p(i({display:"block",part:"title"},o),{children:e}))};var Ee={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function jo(e){let o=Object.fromEntries(Ee.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(Ee.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!Ee.content.some(a=>a===n)&&!Ee.root.some(a=>a===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var en=keyframes`
22
+ from {
23
+ opacity: 0;
24
+ }
25
+ 25% {
26
+ opacity: 0;
27
+ }
28
+ to {
29
+ opacity: 1;
30
+ }
31
+ `;function O(n){var a=n,{children:e,className:o,modal:t=!0}=a,r=u(a,["children","className","modal"]);let{rootProps:s,contentProps:d,otherProps:f}=jo(r),g=f,{zIndex:c}=g,m=u(g,["zIndex"]);return jsx(V.Root,p(i({defaultOpen:!0,modal:t},s),{children:jsx(V.Portal,{children:jsxs(y,{animation:`${en} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsx(V.Overlay,{asChild:!0,children:jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(V.Content,p(i({asChild:!0,onOpenAutoFocus:h=>h.preventDefault(),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault()},d),{children:jsx(P,p(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}O.Dismiss=e=>jsx(V.Close,{"aria-label":"Close",asChild:!0,children:jsx(k.Plain,p(i({part:"close",position:"absolute",right:"-4px",top:"4px"},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}))});O.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsx(V.Description,{asChild:!0,children:jsx(F.Body2,p(i({part:"subtitle"},o),{children:e}))})};O.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsx(ae,i({borderRadius:"md",src:e},o))};O.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsx(k.Primary,i({title:o,onClick:e},t))};O.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(y,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?w.colors.blue500:w.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(y,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};O.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsx(k.Secondary,i({title:o,onClick:e},t))};O.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsx(V.Title,{asChild:!0,children:jsx(F.H3,p(i({part:"title"},o),{children:e}))})};O.displayName="Dialog";var Uo=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function tn(t){var r=t,{flowId:e}=r,o=u(r,["flowId"]);let n=Object.fromEntries(Object.entries(o).filter(([s])=>Uo.some(d=>s===d))),a=Object.fromEntries(Object.entries(o).filter(([s])=>Uo.indexOf(s)===-1));return jsx(U,p(i({as:null,flowId:e},n),{children:({flow:s,handleDismiss:d,handlePrimary:c,handleSecondary:m,parentProps:{dismissible:f},step:g})=>{var x,B,R,I,T,v;let h=(x=g.props)!=null?x:{},b=(R=(B=g.primaryButton)==null?void 0:B.title)!=null?R:g.primaryButtonTitle,S=(T=(I=g.secondaryButton)==null?void 0:I.title)!=null?T:g.secondaryButtonTitle;return jsx(O,p(i({part:"announcement",textAlign:"center"},a),{onEscapeKeyDown:W=>{typeof o.onEscapeKeyDown=="function"&&o.onEscapeKeyDown(W),W.defaultPrevented||d(W);},children:jsxs(C.Column,p(i({gap:5,part:"announcement-step"},h),{children:[f&&jsx(O.Dismiss,{onClick:d}),jsxs(C.Column,{gap:1,part:"announcement-header",children:[jsx(O.Title,{children:g.title}),jsx(O.Subtitle,{children:g.subtitle})]}),jsx(O.Media,{src:(v=g.videoUri)!=null?v:g.imageUri,type:g.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(O.ProgressDots,{current:s.getCurrentStepIndex(),total:s.getNumberOfAvailableSteps()}),jsxs(C.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[S&&jsx(O.Secondary,{onClick:m,title:S}),b&&jsx(O.Primary,{onClick:c,title:b})]})]}))}))}}))}function rn(r){var n=r,{dismissible:e,flowId:o}=n,t=u(n,["dismissible","flowId"]);return jsx(U,{as:null,flowId:o,children:({handleDismiss:a,handlePrimary:s,handleSecondary:d,step:c})=>{var h,b,S,x,B;let m=(h=c.props)!=null?h:{},f=(S=(b=c.primaryButton)==null?void 0:b.title)!=null?S:c.primaryButtonTitle,g=(B=(x=c.secondaryButton)==null?void 0:x.title)!=null?B:c.secondaryButtonTitle;return jsxs(P,p(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:"banner"},t),m),{children:[c.imageUri&&jsx(y,{as:"img",part:"image",src:c.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(C.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(P.Title,{part:"title",children:c.title}),jsx(P.Subtitle,{part:"subtitle",children:c.subtitle})]}),jsx(P.Secondary,{title:g,onClick:d}),jsx(P.Primary,{title:f,onClick:s}),e&&jsx(P.Dismiss,{onClick:a})]}))}})}var Ze={};q(Ze,{Collapsible:()=>tt,CollapsibleStep:()=>Fe});var Fe={};q(Fe,{Content:()=>qe,Root:()=>Ye,Trigger:()=>Qe});var an=keyframes`
22
32
  from {
23
33
  height: 0;
24
34
  opacity: 0;
@@ -27,7 +37,7 @@ var ao=Object.defineProperty,Rt=Object.defineProperties;var kt=Object.getOwnProp
27
37
  height: var(--radix-collapsible-content-height);
28
38
  opacity: 1;
29
39
  }
30
- `,rn=keyframes`
40
+ `,sn=keyframes`
31
41
  from {
32
42
  height: var(--radix-collapsible-content-height);
33
43
  opacity: 1;
@@ -36,8 +46,18 @@ var ao=Object.defineProperty,Rt=Object.defineProperties;var kt=Object.getOwnProp
36
46
  height: 0;
37
47
  opacity: 0;
38
48
  }
39
- `,nn=()=>jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function an({checked:e=!1}){return jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsx(g,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(nn,{})})})}function qe({children:e}){return jsx(me.Content,{asChild:!0,children:jsxs(C.Column,{css:{'&[data-state="open"]':{animation:`${tn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${rn} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsx(g,{}),e]})})}function Ye(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=u(s,["children","disabled","onOpenChange","open"]);return jsx(me.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsx(b,p(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function Qe({isCompleted:e,title:o}){return jsx(me.Trigger,{asChild:!0,children:jsxs(C.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxs(C.Row,{alignItems:"center",gap:2,children:[jsx(an,{checked:e}),jsx(S.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsx(g,{as:ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Oe={};q(Oe,{Bar:()=>Ee,Dots:()=>qo,Segments:()=>Qo});function Ee(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsx(g,p(i({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function qo(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,d)=>jsx(g,{as:"circle",r:4,cx:4+16*d,cy:"4px",fill:e-1===d?w.colors.blue500:w.colors.blue800},d));return jsx(g,p(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function Qo(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=[...Array(o)].map((s,d)=>jsx(g,{backgroundColor:e-1===d?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},d));return jsx(C.Row,p(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}var Zo=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function et({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var h,P,F,x,B,R;let{$state:{blocked:a,completed:s},subtitle:d,title:c}=n,m=(P=(h=n.primaryButton)==null?void 0:h.title)!=null?P:n.primaryButtonTitle,f=(x=(F=n.secondaryButton)==null?void 0:F.title)!=null?x:n.secondaryButtonTitle,y=(B=n.props)!=null?B:{};return jsxs(Ye,p(i({open:t,onOpenChange:r},y),{children:[jsx(Qe,{isCompleted:s,title:c}),jsxs(qe,{children:[jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",src:(R=n.videoUri)!=null?R:n.imageUri,type:n.videoUri?"video":"image"}),jsx(b.Subtitle,{color:"gray500",children:d}),jsxs(C.Row,{gap:3,children:[jsx(b.Secondary,{disabled:!!(s||a),title:f,onClick:o}),jsx(b.Primary,{disabled:!!(s||a),title:m,onClick:e})]})]})]}))}var dn={default:et};function cn(r){var n=r,{flow:e,step:o}=n,t=u(n,["flow","step"]);var x;let{onPrimary:a,onSecondary:s,openStepId:d,setOpenStepId:c,stepTypes:m}=useContext(Zo),{handlePrimary:f,handleSecondary:y}=ie(o,{onPrimary:a,onSecondary:s}),h=(d!=null?d:e.getCurrentStep().id)===o.id,P=(x=m[o.type])!=null?x:et;function F(B){return W(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsx(P,p(i({flow:e,onOpenChange:F,open:h,step:o},t),{handlePrimary:f,handleSecondary:y}),o.id)}function ot(s){var d=s,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,stepTypes:n={}}=d,a=u(d,["dismissible","flowId","onPrimary","onSecondary","stepTypes"]);let[c,m]=useState(null),f=i(i({},dn),n);return jsx(Zo.Provider,{value:{openStepId:c,setOpenStepId:m,onPrimary:t,onSecondary:r,stepTypes:f},children:jsx(U,p(i({as:b,borderWidth:"md",flowId:o,part:"checklist"},a),{children:F=>{var x=F,{flow:y,handleDismiss:h}=x,P=u(x,["flow","handleDismiss"]);let R=Array.from(y.steps.entries()).filter(([,v])=>v.$state.visible===!0).map(([,v])=>jsx(cn,p(i({flow:y,handleDismiss:h},P),{step:v}),v.id)),O=y.getNumberOfCompletedSteps(),T=y.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(C.Column,{gap:2,children:[jsx(b.Header,{dismissible:e,handleDismiss:h,part:"checklist-header",subtitle:y.subtitle,title:y.title}),jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxs(S.Body2,{fontWeight:"demibold",children:[O,"/",T]}),jsx(Ee,{current:O,total:T,flexGrow:1})]})]}),R]})}}))})}var yn=new Set(["required","min","max","minLength","maxLength","pattern"]);function xn({fieldComponent:e,control:o,fieldData:t,submit:r}){t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let n=Object.fromEntries(Object.entries(t).filter(([s])=>yn.has(s))),a=useController({name:t.id,control:o,rules:n});return jsx(e,p(i({},a),{fieldData:t,submit:r}))}function rt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a}){var x,B,R,O,T,v;let{control:s,handleSubmit:d}=useForm({delayError:2e3,mode:"onChange"}),[c,m]=useState(!1),f=[],y=(x=a.props)!=null?x:{};function h(D,$){m(!0),t($,D,!1).then(()=>m(!1));}(B=a.fields)==null||B.forEach(D=>{e[D.type]!=null&&f.push(jsx(xn,{control:s,fieldComponent:e[D.type],fieldData:D,submit:d(h)},`${a.flow.id}-${D.id}`));});let P=(O=(R=a.primaryButton)==null?void 0:R.title)!=null?O:a.primaryButtonTitle,F=(v=(T=a.secondaryButton)==null?void 0:T.title)!=null?v:a.secondaryButtonTitle;return jsxs(C.Column,p(i({gap:5,part:"form-step"},y),{children:[jsx(b.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),f,jsxs(C.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[F&&jsx(k.Secondary,{title:F,onClick:r}),jsx(k.Primary,{title:P!=null?P:"Submit",onClick:d(h),disabled:c})]},"form-footer")]}))}function nt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(S.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function it({children:e,id:o,required:t=!1}){return jsxs(S.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"bold",mb:"2",display:"block",children:[e,t&&" *"]})}var Te={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function ee({children:e,field:o,fieldData:t,fieldState:r}){var m;let{id:n,label:a,placeholder:s}=t,{error:d}=r,c=p(i(i(i({id:n},o),s?{placeholder:s}:{}),Te),{"aria-invalid":!!d,value:(m=o.value)!=null?m:""});return jsxs(g,{part:"field",children:[jsx(it,{id:n,required:!!t.required,children:a}),e(c),jsx(nt,{error:d})]})}var Cn=()=>jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Sn=je.forwardRef(({label:e,value:o},t)=>jsxs(g,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsx(S.Body2,{part:"field-radio-label",children:e}),jsx(fe.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(g,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(g,{as:fe.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Cn,{})})})})]}));function pt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:a,value:s})=>jsx(Sn,{value:s,label:a},s));return jsx(ee,p(i({},e),{children:()=>jsx(fe.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(C.Column,{gap:2,part:"field-radio-group",children:n})})}))}var wn=je.forwardRef(({label:e,value:o},t)=>jsx(L.Item,{value:o,ref:t,asChild:!0,children:jsx(g,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(L.ItemText,{asChild:!0,children:jsx(S.Body2,{part:"field-select-option-label",children:e})})})}));function ut(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,a=r.map(({label:s,value:d})=>jsx(wn,{value:d,label:s},d));return jsx(ee,p(i({},e),{children:()=>jsxs(L.Root,{value:t,onValueChange:o,children:[jsx(L.Trigger,{asChild:!0,children:jsxs(S.Body2,p(i({},Te),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(L.Value,{placeholder:n!=null?n:"Select one"}),jsx(L.Icon,{children:jsx(g,{as:ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(L.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(g,p(i({},Te),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsx(L.Viewport,{children:a})}))})]})}))}function ft(e){return jsx(ee,p(i({},e),{children:o=>jsx(S.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function yt(e){return jsx(ee,p(i({},e),{children:o=>jsx(S.Body2,i({as:"textarea",part:"field-textarea"},o))}))}var vn={radio:pt,select:ut,text:ft,textarea:yt};function eo(r){var n=r,{fieldTypes:e={},flowId:o}=n,t=u(n,["fieldTypes","flowId"]);let a=Object.assign({},vn,e);return jsx(U,p(i({flowId:o,part:"form"},t),{children:s=>jsx(rt,i({fieldTypes:a},s))}))}var oo={};q(oo,{NPS:()=>Pt});function bt({field:e,submit:o}){let t=[...Array(11)].map((r,n)=>{let a=e.value===n?k.Primary:k.Secondary;return jsx(a,{borderWidth:"1px",onClick:()=>{e.onChange(n),o();},title:`${n}`,css:{".fr-button-title":{fontSize:"15px"}}},n)});return jsxs(C.Column,{gap:2,children:[jsx(C.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:t}),jsxs(C.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(S.Caption,{part:"field-nps-left-label",color:"gray600",children:"Not likely at all"}),jsx(S.Caption,{part:"field-nps-right-label",color:"gray600",children:"Extremely likely"})]})]})}function Pt(n){var a=n,{as:e=E,flowId:o,fieldTypes:t}=a,r=u(a,["as","flowId","fieldTypes"]);let{flow:s}=re(o);return jsx(eo,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:bt},t),modal:!1,onEscapeKeyDown:d=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(d),d.defaultPrevented||s.skip();},css:p(i({},!s||s.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"620px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function He(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=useState(e),[r,n]=useState(null),a=useCallback(s=>{n(s);},[]);return useLayoutEffect(()=>{if(!r)return;let s=()=>{let d=r.getBoundingClientRect();t(d);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:a}}var En=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Ft(r){var n=r,{style:e={},part:o=""}=n,t=u(n,["style","part"]);return jsxs(g,p(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${En}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Tt({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},a=()=>{var m;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (m=e.align)!=null?m:"after"},s="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};n[d[r]]=s;let c=a();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var Me={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function wt(e,o){var a,s,d,c,m;let t=Object.fromEntries(Me.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r=Object.fromEntries(Me.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n={};for(let f of Object.keys(e))!Me.content.includes(f)&&!Me.root.includes(f)&&(n[f]=e[f]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},y=(R,O)=>["top","bottom"].includes(O)?R=="after"?"marginLeft":"marginRight":R=="after"?"marginTop":"marginBottom",h=(d=t.alignOffset)!=null?d:0,P=(c=t.style)!=null?c:{},F=(m=t.side)!=null?m:"bottom",x=t.align;t.style=p(i({},P),{[y(x,F)]:h});let B=["top","bottom"].includes(F)?o.width:o.height;t.alignOffset=(B+h)*-1,t.align=f[x];}return {contentProps:t,otherProps:n,rootProps:r}}function A(s){var d=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=d,a=u(d,["anchor","children","className","spotlight","style"]);let{node:c,rect:m,ref:f}=He(),{node:y,rect:h,ref:P}=He(),{contentProps:F,otherProps:x,rootProps:B}=wt(a,m),[R,O]=useState(F.align),[T,v]=useState(F.side),[D,$]=useState(0),[Ae,ge]=useState(0);if(c!==null){let _=c.getAttribute("data-align"),oe=c.getAttribute("data-side");R!==_&&O(_),T!==oe&&v(oe);}let de=useRef(null);if(useEffect(()=>{let _=document.querySelector(e);_!=null?(P(_),de.current=_):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function _(ye){if(ye.matches(e))return ye;let ue=ye.querySelectorAll(e);return ue.length>0?ue[0]:null}let oe=new MutationObserver(ye=>{for(let ue of ye)if(ue.type==="childList"){for(let xe of ue.addedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let te=_(xe);if(te!=null){P(te),de.current=te,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",te);break}}for(let xe of ue.removedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let te=_(xe);if(te!=null){P(null),de.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",te);break}}}});return oe.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>oe.disconnect()},[]),useEffect(()=>{let{scrollX:_,scrollY:oe}=window;$(h.left+_),ge(h.top+oe);},[h.left,h.top]),y==null)return null;let ce="0";typeof window!="undefined"&&(ce=window.getComputedStyle(y).borderRadius);let Le=Tt({props:a,alignAttr:R,sideAttr:T});return jsxs(X.Root,p(i({defaultOpen:!0},B),{children:[jsx(X.Anchor,{virtualRef:de}),jsx(X.Portal,{children:jsxs(Fragment,{children:[r&&jsx(g,i({boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:ce,height:h.height,left:D,top:Ae,width:h.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsx(X.Content,p(i({asChild:!0},F),{ref:f,children:jsxs(b,p(i({boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:n},x),{children:[jsx(Ft,{style:Le}),o]}))}))]})})]}))}A.Close=e=>jsx(X.Close,{"aria-label":"Close",asChild:!0,children:jsx(k.Plain,p(i({css:{top:"12px",right:"4px"},part:"close",position:"absolute"},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}))});A.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsx(ae,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};A.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsx(k.Primary,i({title:o,onClick:e},t))};A.Progress=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsx(S.H4,p(i({part:"progress"},o),{children:e}))};A.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsx(k.Secondary,i({title:o,onClick:e},t))};A.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsx(S.Body2,p(i({part:"subtitle"},o),{children:e}))};A.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsx(S.H4,p(i({part:"title"},o),{children:e}))};function vt(c){var m=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:a,step:s}=m,d=u(m,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var B,R,O,T,v,D;let{handleDismiss:f}=ne(o,{onDismiss:t}),{handlePrimary:y,handleSecondary:h}=ie(s,{onPrimary:n,onSecondary:a}),P=(B=s.props)!=null?B:{},F=(O=(R=s.primaryButton)==null?void 0:R.title)!=null?O:s.primaryButtonTitle,x=(v=(T=s.secondaryButton)==null?void 0:T.title)!=null?v:s.secondaryButtonTitle;return jsxs(A,p(i(i({anchor:s.selector,onOpenAutoFocus:$=>$.preventDefault(),onPointerDownOutside:$=>$.preventDefault(),onInteractOutside:$=>$.preventDefault()},d),P),{onEscapeKeyDown:$=>{typeof r=="function"&&r($),$.defaultPrevented||f($);},children:[e&&jsx(A.Close,{onClick:f}),jsx(A.Media,{src:(D=s.videoUri)!=null?D:s.imageUri,type:s.videoUri?"video":"image"}),jsxs(C.Column,{gap:1,part:"tooltip-header",children:[jsx(A.Title,{children:s.title}),jsx(A.Subtitle,{color:"gray500",children:s.subtitle})]}),jsxs(C.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsx(A.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepIndex()+1}/${o.getNumberOfAvailableSteps()}`}),jsx(A.Secondary,{title:x,onClick:h}),jsx(A.Primary,{title:F,onClick:y})]})]}),s.id)}function Ln(n){var a=n,{flowId:e,onComplete:o,variables:t}=a,r=u(a,["flowId","onComplete","variables"]);let[s,d]=useState(!1),{flow:c}=re(e,{variables:t}),{hasInitialized:m,registerComponent:f,unregisterComponent:y}=useContext(H);ne(c,{onComplete:o});let{isCurrentModal:h,removeModal:P}=Pe(c);if(useEffect(()=>{!(c!=null&&c.isVisible)&&h&&P();},[c==null?void 0:c.isVisible,h]),useEffect(()=>()=>{y(e);},[]),c==null||c.isVisible===!1||!h||(f(e,()=>{s||d(!0);}),!m||!s))return null;let F=c.getCurrentStep();return F==null||F.start(),jsx(vt,i({step:F,flow:c},r))}function zn(){let{frigade:e}=useContext(H);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Kn(){let{userId:e,frigade:o}=useContext(H);function t(n){return W(this,null,function*(){yield o.identify(e,n);})}function r(n,a){return W(this,null,function*(){yield o.track(n,a);})}return {userId:e,addProperties:t,track:r}}function jn(){let{frigade:e}=useContext(H);function o(n){return W(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,n);})}function t(n,a){return W(this,null,function*(){yield e.track(n,a);})}function r(n,a){return W(this,null,function*(){yield e.group(n,a);})}return {groupId:e.config.groupId,setGroupId:r,addProperties:o,track:t}}
49
+ `,ln=()=>jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function pn({checked:e=!1}){return jsx(y,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsx(y,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(ln,{})})})}function qe({children:e}){return jsx(me.Content,{asChild:!0,children:jsxs(C.Column,{css:{'&[data-state="open"]':{animation:`${an} 300ms ease-out`},'&[data-state="closed"]':{animation:`${sn} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsx(y,{}),e]})})}function Ye(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=u(s,["children","disabled","onOpenChange","open"]);return jsx(me.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsx(P,p(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function Qe({isCompleted:e,title:o}){return jsx(me.Trigger,{asChild:!0,children:jsxs(C.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxs(C.Row,{alignItems:"center",gap:2,children:[jsx(pn,{checked:e}),jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsx(y,{as:ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Ie={};q(Ie,{Bar:()=>Oe,Dots:()=>Yo,Segments:()=>Zo});function Oe(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsx(y,p(i({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function Yo(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,d)=>jsx(y,{as:"circle",r:4,cx:4+16*d,cy:"4px",fill:e-1===d?w.colors.blue500:w.colors.blue800},d));return jsx(y,p(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function Zo(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=[...Array(o)].map((s,d)=>jsx(y,{backgroundColor:e-1===d?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},d));return jsx(C.Row,p(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}var et=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function ot({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var h,b,S,x,B,R;let{$state:{blocked:a,completed:s},subtitle:d,title:c}=n,m=(b=(h=n.primaryButton)==null?void 0:h.title)!=null?b:n.primaryButtonTitle,f=(x=(S=n.secondaryButton)==null?void 0:S.title)!=null?x:n.secondaryButtonTitle,g=(B=n.props)!=null?B:{};return jsxs(Ye,p(i({open:t,onOpenChange:r},g),{children:[jsx(Qe,{isCompleted:s,title:c}),jsxs(qe,{children:[jsx(P.Media,{aspectRatio:2.5,objectFit:"cover",src:(R=n.videoUri)!=null?R:n.imageUri,type:n.videoUri?"video":"image"}),jsx(P.Subtitle,{color:"gray500",children:d}),jsxs(C.Row,{gap:3,children:[jsx(P.Secondary,{disabled:!!(s||a),title:f,onClick:o}),jsx(P.Primary,{disabled:!!(s||a),title:m,onClick:e})]})]})]}))}var mn={default:ot};function fn(r){var n=r,{flow:e,step:o}=n,t=u(n,["flow","step"]);var x;let{onPrimary:a,onSecondary:s,openStepId:d,setOpenStepId:c,stepTypes:m}=useContext(et),{handlePrimary:f,handleSecondary:g}=ie(o,{onPrimary:a,onSecondary:s}),h=(d!=null?d:e.getCurrentStep().id)===o.id,b=(x=m[o.type])!=null?x:ot;function S(B){return A(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsx(b,p(i({flow:e,onOpenChange:S,open:h,step:o},t),{handlePrimary:f,handleSecondary:g}),o.id)}function tt(s){var d=s,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,stepTypes:n={}}=d,a=u(d,["dismissible","flowId","onPrimary","onSecondary","stepTypes"]);let[c,m]=useState(null),f=i(i({},mn),n);return jsx(et.Provider,{value:{openStepId:c,setOpenStepId:m,onPrimary:t,onSecondary:r,stepTypes:f},children:jsx(U,p(i({as:P,borderWidth:"md",flowId:o,part:"checklist"},a),{children:S=>{var x=S,{flow:g,handleDismiss:h}=x,b=u(x,["flow","handleDismiss"]);let R=Array.from(g.steps.entries()).filter(([,v])=>v.$state.visible===!0).map(([,v])=>jsx(fn,p(i({flow:g,handleDismiss:h},b),{step:v}),v.id)),I=g.getNumberOfCompletedSteps(),T=g.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(C.Column,{gap:2,children:[jsx(P.Header,{dismissible:e,handleDismiss:h,part:"checklist-header",subtitle:g.subtitle,title:g.title}),jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxs(F.Body2,{fontWeight:"demibold",children:[I,"/",T]}),jsx(Oe,{current:I,total:T,flexGrow:1})]})]}),R]})}}))})}var Pn=new Set(["required","min","max","minLength","maxLength","pattern"]);function Cn({fieldComponent:e,control:o,fieldData:t,submit:r}){t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let n=Object.fromEntries(Object.entries(t).filter(([s])=>Pn.has(s))),a=useController({name:t.id,control:o,rules:n});return jsx(e,p(i({},a),{fieldData:t,submit:r}))}function nt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a}){var B,R,I,T,v,W;let{__readOnly:s}=useContext(D),{control:d,handleSubmit:c}=useForm({delayError:2e3,mode:"onChange"}),[m,f]=useState(!1),g=[],h=(B=a.props)!=null?B:{};function b(E,ge){f(!0),t(ge,E,s===!0).then(()=>f(!1));}(R=a.fields)==null||R.forEach(E=>{e[E.type]!=null&&g.push(jsx(Cn,{control:d,fieldComponent:e[E.type],fieldData:E,submit:c(b)},`${a.flow.id}-${E.id}`));});let S=(T=(I=a.primaryButton)==null?void 0:I.title)!=null?T:a.primaryButtonTitle,x=(W=(v=a.secondaryButton)==null?void 0:v.title)!=null?W:a.secondaryButtonTitle;return jsxs(C.Column,p(i({gap:5,part:"form-step"},h),{children:[jsx(P.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),g,jsxs(C.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[x&&jsx(k.Secondary,{title:x,onClick:r}),jsx(k.Primary,{title:S!=null?S:"Submit",onClick:c(b),disabled:m})]},"form-footer")]}))}function it({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function at({children:e,id:o,required:t=!1}){return jsxs(F.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"bold",mb:"2",display:"block",children:[e,t&&" *"]})}var we={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function ee({children:e,field:o,fieldData:t,fieldState:r}){var m;let{id:n,label:a,placeholder:s}=t,{error:d}=r,c=p(i(i(i({id:n},o),s?{placeholder:s}:{}),we),{"aria-invalid":!!d,value:(m=o.value)!=null?m:""});return jsxs(y,{part:"field",children:[jsx(at,{id:n,required:!!t.required,children:a}),e(c),jsx(it,{error:d})]})}var wn=()=>jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),vn=je.forwardRef(({label:e,value:o},t)=>jsxs(y,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsx(F.Body2,{part:"field-radio-label",children:e}),jsx(fe.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(y,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(y,{as:fe.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(wn,{})})})})]}));function dt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:a,value:s})=>jsx(vn,{value:s,label:a},s));return jsx(ee,p(i({},e),{children:()=>jsx(fe.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(C.Column,{gap:2,part:"field-radio-group",children:n})})}))}var kn=je.forwardRef(({label:e,value:o},t)=>jsx($.Item,{value:o,ref:t,asChild:!0,children:jsx(y,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx($.ItemText,{asChild:!0,children:jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function mt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,a=r.map(({label:s,value:d})=>jsx(kn,{value:d,label:s},d));return jsx(ee,p(i({},e),{children:()=>jsxs($.Root,{value:t,onValueChange:o,children:[jsx($.Trigger,{asChild:!0,children:jsxs(F.Body2,p(i({},we),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx($.Value,{placeholder:n!=null?n:"Select one"}),jsx($.Icon,{children:jsx(y,{as:ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx($.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(y,p(i({},we),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsx($.Viewport,{children:a})}))})]})}))}function gt(e){return jsx(ee,p(i({},e),{children:o=>jsx(F.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function xt(e){return jsx(ee,p(i({},e),{children:o=>jsx(F.Body2,i({as:"textarea",part:"field-textarea"},o))}))}var Dn={radio:dt,select:mt,text:gt,textarea:xt};function eo(r){var n=r,{fieldTypes:e={},flowId:o}=n,t=u(n,["fieldTypes","flowId"]);let a=Object.assign({},Dn,e);return jsx(U,p(i({flowId:o,part:"form"},t),{children:s=>jsx(nt,i({fieldTypes:a},s))}))}var oo={};q(oo,{NPS:()=>Ct});function Pt({field:e,submit:o}){let t=[...Array(11)].map((r,n)=>{let a=e.value===n?k.Primary:k.Secondary;return jsx(a,{borderWidth:"1px",onClick:()=>{e.onChange(n),o();},title:`${n}`,css:{".fr-button-title":{fontSize:"15px"}}},n)});return jsxs(C.Column,{gap:2,children:[jsx(C.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:t}),jsxs(C.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(F.Caption,{part:"field-nps-left-label",color:"gray600",children:"Not likely at all"}),jsx(F.Caption,{part:"field-nps-right-label",color:"gray600",children:"Extremely likely"})]})]})}function Ct(n){var a=n,{as:e=O,flowId:o,fieldTypes:t}=a,r=u(a,["as","flowId","fieldTypes"]);let{flow:s}=re(o);return jsx(eo,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:Pt},t),modal:!1,onEscapeKeyDown:d=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(d),d.defaultPrevented||s.skip();},css:p(i({},!s||s.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"620px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function Me(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=useState(e),[r,n]=useState(null),a=useCallback(s=>{n(s);},[]);return useLayoutEffect(()=>{if(!r)return;let s=()=>{let d=r.getBoundingClientRect();t(d);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:a}}var Mn=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Tt(r){var n=r,{style:e={},part:o=""}=n,t=u(n,["style","part"]);return jsxs(y,p(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Mn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function wt({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},a=()=>{var m;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (m=e.align)!=null?m:"after"},s="-24px",d={top:"bottom",right:"left",bottom:"top",left:"right"};n[d[r]]=s;let c=a();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var We={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function vt(e,o){var a,s,d,c,m;let t=Object.fromEntries(We.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r=Object.fromEntries(We.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n={};for(let f of Object.keys(e))!We.content.includes(f)&&!We.root.includes(f)&&(n[f]=e[f]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},g=(R,I)=>["top","bottom"].includes(I)?R=="after"?"marginLeft":"marginRight":R=="after"?"marginTop":"marginBottom",h=(d=t.alignOffset)!=null?d:0,b=(c=t.style)!=null?c:{},S=(m=t.side)!=null?m:"bottom",x=t.align;t.style=p(i({},b),{[g(x,S)]:h});let B=["top","bottom"].includes(S)?o.width:o.height;t.alignOffset=(B+h)*-1,t.align=f[x];}return {contentProps:t,otherProps:n,rootProps:r}}var Bt=keyframes`
50
+ from {
51
+ opacity: 0;
52
+ }
53
+ 25% {
54
+ opacity: 0;
55
+ }
56
+ to {
57
+ opacity: 1;
58
+ }
59
+ `;function L(s){var d=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=d,a=u(d,["anchor","children","className","spotlight","style"]);let{node:c,rect:m,ref:f}=Me(),{node:g,rect:h,ref:b}=Me(),{contentProps:S,otherProps:x,rootProps:B}=vt(a,m),[R,I]=useState(S.align),[T,v]=useState(S.side),[W,E]=useState(0),[ge,ye]=useState(0);if(c!==null){let K=c.getAttribute("data-align"),oe=c.getAttribute("data-side");R!==K&&I(K),T!==oe&&v(oe);}let de=useRef(null);if(useEffect(()=>{let K=document.querySelector(e);K!=null?(b(K),de.current=K):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function K(xe){if(xe.matches(e))return xe;let ue=xe.querySelectorAll(e);return ue.length>0?ue[0]:null}let oe=new MutationObserver(xe=>{for(let ue of xe)if(ue.type==="childList"){for(let he of ue.addedNodes){if(he.nodeType!==Node.ELEMENT_NODE)continue;let te=K(he);if(te!=null){b(te),de.current=te,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",te);break}}for(let he of ue.removedNodes){if(he.nodeType!==Node.ELEMENT_NODE)continue;let te=K(he);if(te!=null){b(null),de.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",te);break}}}});return oe.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>oe.disconnect()},[]),useEffect(()=>{let{scrollX:K,scrollY:oe}=window;E(h.left+K),ye(h.top+oe);},[h.left,h.top]),g==null)return null;let ce="0";typeof window!="undefined"&&(ce=window.getComputedStyle(g).borderRadius);let Le=wt({props:a,alignAttr:R,sideAttr:T});return jsxs(X.Root,p(i({defaultOpen:!0},B),{children:[jsx(X.Anchor,{virtualRef:de}),jsx(X.Portal,{children:jsxs(Fragment,{children:[r&&jsx(y,i({animation:`${Bt} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:ce,height:h.height,left:W,top:ge,width:h.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsx(X.Content,p(i({asChild:!0},S),{ref:f,children:jsxs(P,p(i({animation:`${Bt} 300ms ease-out`,boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:n},x),{children:[jsx(Tt,{style:Le}),o]}))}))]})})]}))}L.Close=e=>jsx(X.Close,{"aria-label":"Close",asChild:!0,children:jsx(k.Plain,p(i({css:{top:"12px",right:"4px"},part:"close",position:"absolute"},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}))});L.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsx(ae,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};L.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsx(k.Primary,i({title:o,onClick:e},t))};L.Progress=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsx(F.H4,p(i({part:"progress"},o),{children:e}))};L.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsx(k.Secondary,i({title:o,onClick:e},t))};L.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsx(F.Body2,p(i({part:"subtitle"},o),{children:e}))};L.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsx(F.H4,p(i({part:"title"},o),{children:e}))};function Rt(c){var m=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:a,step:s}=m,d=u(m,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var B,R,I,T,v,W;let{handleDismiss:f}=ne(o,{onDismiss:t}),{handlePrimary:g,handleSecondary:h}=ie(s,{onPrimary:n,onSecondary:a}),b=(B=s.props)!=null?B:{},S=(I=(R=s.primaryButton)==null?void 0:R.title)!=null?I:s.primaryButtonTitle,x=(v=(T=s.secondaryButton)==null?void 0:T.title)!=null?v:s.secondaryButtonTitle;return jsxs(L,p(i(i({anchor:s.selector,onOpenAutoFocus:E=>E.preventDefault(),onPointerDownOutside:E=>E.preventDefault(),onInteractOutside:E=>E.preventDefault()},d),b),{onEscapeKeyDown:E=>{typeof r=="function"&&r(E),E.defaultPrevented||f(E);},children:[e&&jsx(L.Close,{onClick:f}),jsx(L.Media,{src:(W=s.videoUri)!=null?W:s.imageUri,type:s.videoUri?"video":"image"}),jsxs(C.Column,{gap:1,part:"tooltip-header",children:[jsx(L.Title,{children:s.title}),jsx(L.Subtitle,{color:"gray500",children:s.subtitle})]}),jsxs(C.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsx(L.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepIndex()+1}/${o.getNumberOfAvailableSteps()}`}),jsx(L.Secondary,{title:x,onClick:h}),jsx(L.Primary,{title:S,onClick:g})]})]}),s.id)}function Nn(n){var a=n,{flowId:e,onComplete:o,variables:t}=a,r=u(a,["flowId","onComplete","variables"]);let[s,d]=useState(!1),{flow:c}=re(e,{variables:t}),{hasInitialized:m,registerComponent:f,unregisterComponent:g}=useContext(D);ne(c,{onComplete:o});let{isCurrentModal:h,removeModal:b}=Ce(c);if(useEffect(()=>{!(c!=null&&c.isVisible)&&h&&b();},[c==null?void 0:c.isVisible,h]),useEffect(()=>()=>{g(e);},[]),c==null||c.isVisible===!1||!h||(f(e,()=>{s||d(!0);}),!m||!s))return null;let S=c.getCurrentStep();return S==null||S.start(),jsx(Rt,i({step:S,flow:c},r))}function Un(){let{frigade:e}=useContext(D);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Jn(){let{userId:e,frigade:o}=useContext(D);function t(n){return A(this,null,function*(){yield o.identify(e,n);})}function r(n,a){return A(this,null,function*(){yield o.track(n,a);})}return {userId:e,addProperties:t,track:r}}function qn(){let{frigade:e}=useContext(D);function o(n){return A(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,n);})}function t(n,a){return A(this,null,function*(){yield e.track(n,a);})}function r(n,a){return A(this,null,function*(){yield e.group(n,a);})}return {groupId:e.config.groupId,setGroupId:r,addProperties:o,track:t}}
40
60
 
41
- export { Zr as Announcement, en as Banner, g as Box, k as Button, b as Card, Ze as Checklist, E as Dialog, C as Flex, U as Flow, eo as Form, Oe as Progress, Ho as Provider, oo as Survey, S as Text, A as Tooltip, Ln as Tour, ze as themeVariables, Be as tokens, He as useBoundingClientRect, re as useFlow, ne as useFlowHandlers, zn as useFrigade, jn as useGroup, Pe as useModal, ie as useStepHandlers, Kn as useUser };
61
+ export { tn as Announcement, rn as Banner, y as Box, k as Button, P as Card, Ze as Checklist, O as Dialog, C as Flex, U as Flow, eo as Form, Ie as Progress, Mo as Provider, oo as Survey, F as Text, L as Tooltip, Nn as Tour, _e as themeVariables, Re as tokens, Me as useBoundingClientRect, re as useFlow, ne as useFlowHandlers, Un as useFrigade, qn as useGroup, Ce as useModal, ie as useStepHandlers, Jn as useUser };
42
62
  //# sourceMappingURL=out.js.map
43
63
  //# sourceMappingURL=index.js.map