@frigade/react 2.0.8 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as React$1 from 'react';
3
3
  import React__default, { CSSProperties, SyntheticEvent, ReactNode, ForwardRefExoticComponent, RefAttributes } from 'react';
4
4
  import * as _frigade_js from '@frigade/js';
5
5
  import { Flow, FlowStep } from '@frigade/js';
6
- export { Flow, Frigade } from '@frigade/js';
6
+ export { Flow, FlowType, Frigade } from '@frigade/js';
7
7
  import { EmotionJSX } from '@emotion/react/types/jsx-namespace';
8
8
  import * as Collapsible$1 from '@radix-ui/react-collapsible';
9
9
  import { ControllerFieldState, Message, ValidationRule } from 'react-hook-form';
@@ -1139,10 +1139,12 @@ interface FlowProps extends BoxProps {
1139
1139
  onDismiss?: FlowHandlerProp;
1140
1140
  /**
1141
1141
  * Handler for when primary button is clicked.
1142
+ * If this function a promise that evaluates to `false`, the step will not be automatically completed when clicked.
1142
1143
  */
1143
1144
  onPrimary?: StepHandlerProp;
1144
1145
  /**
1145
1146
  * Handler for when secondary button is clicked.
1147
+ * If this function a promise that evaluates to `false`, the step will not be automatically completed when clicked.
1146
1148
  */
1147
1149
  onSecondary?: StepHandlerProp;
1148
1150
  /**
@@ -1180,14 +1182,29 @@ interface CardComponent extends ForwardRefExoticComponent<Omit<FlowPropsWithoutC
1180
1182
  }
1181
1183
  declare const Card: CardComponent;
1182
1184
 
1183
- interface CollapsibleProps extends FlowPropsWithoutChildren {
1184
- stepTypes: Record<string, (props: FlowChildrenProps) => React.ReactNode>;
1185
- }
1186
1185
  interface CollapsibleStepProps extends FlowChildrenProps {
1187
1186
  onOpenChange: (isOpening: boolean) => void;
1188
1187
  open: boolean;
1189
1188
  }
1190
- declare function Collapsible({ flowId, stepTypes, ...props }: CollapsibleProps): _emotion_react_jsx_runtime.JSX.Element;
1189
+ type StepTypes = Record<string, (props: CollapsibleStepProps) => EmotionJSX.Element>;
1190
+ interface CollapsibleProps extends FlowPropsWithoutChildren {
1191
+ /**
1192
+ * Map of step types to their respective components.
1193
+ * Use this to build custom step components. The `type` defined on the step in the Flow YAML config should match the key in this object.
1194
+ * For instance, if you have a step with `type: 'custom'`, you should provide a component for it like so:
1195
+ * ```
1196
+ * <Checklist.Collapsible stepTypes={{ custom: CustomStepComponent }} />
1197
+ * ```
1198
+ * The corresponding YAML config would look like:
1199
+ * ```
1200
+ * steps:
1201
+ * - id: custom-step
1202
+ * type: custom
1203
+ * ```
1204
+ */
1205
+ stepTypes?: StepTypes;
1206
+ }
1207
+ declare function Collapsible({ dismissible, flowId, onPrimary, onSecondary, stepTypes, ...props }: CollapsibleProps): EmotionJSX.Element;
1191
1208
 
1192
1209
  declare function Content({ children }: {
1193
1210
  children: any;
@@ -1209,16 +1226,16 @@ declare namespace CollapsibleStep {
1209
1226
  };
1210
1227
  }
1211
1228
 
1212
- declare const index_Collapsible: typeof Collapsible;
1213
- type index_CollapsibleProps = CollapsibleProps;
1214
- declare const index_CollapsibleStep: typeof CollapsibleStep;
1215
- type index_CollapsibleStepProps = CollapsibleStepProps;
1216
- declare namespace index {
1229
+ declare const index$1_Collapsible: typeof Collapsible;
1230
+ type index$1_CollapsibleProps = CollapsibleProps;
1231
+ declare const index$1_CollapsibleStep: typeof CollapsibleStep;
1232
+ type index$1_CollapsibleStepProps = CollapsibleStepProps;
1233
+ declare namespace index$1 {
1217
1234
  export {
1218
- index_Collapsible as Collapsible,
1219
- index_CollapsibleProps as CollapsibleProps,
1220
- index_CollapsibleStep as CollapsibleStep,
1221
- index_CollapsibleStepProps as CollapsibleStepProps,
1235
+ index$1_Collapsible as Collapsible,
1236
+ index$1_CollapsibleProps as CollapsibleProps,
1237
+ index$1_CollapsibleStep as CollapsibleStep,
1238
+ index$1_CollapsibleStepProps as CollapsibleStepProps,
1222
1239
  };
1223
1240
  }
1224
1241
 
@@ -1268,14 +1285,57 @@ interface FormProps extends FlowPropsWithoutChildren {
1268
1285
  }
1269
1286
  declare function Form({ fieldTypes, flowId, ...props }: FormProps): _emotion_react_jsx_runtime.JSX.Element;
1270
1287
 
1288
+ interface ProgressProps extends BoxProps {
1289
+ current: number;
1290
+ total: number;
1291
+ }
1292
+
1293
+ declare function Bar({ current, total, ...props }: ProgressProps): _emotion_react_jsx_runtime.JSX.Element;
1294
+
1295
+ declare function Dots({ current, total, ...props }: ProgressProps): _emotion_react_jsx_runtime.JSX.Element;
1296
+
1297
+ declare function Segments({ current, total, ...props }: ProgressProps): _emotion_react_jsx_runtime.JSX.Element;
1298
+
1299
+ declare const index_Bar: typeof Bar;
1300
+ declare const index_Dots: typeof Dots;
1301
+ type index_ProgressProps = ProgressProps;
1302
+ declare const index_Segments: typeof Segments;
1303
+ declare namespace index {
1304
+ export {
1305
+ index_Bar as Bar,
1306
+ index_Dots as Dots,
1307
+ index_ProgressProps as ProgressProps,
1308
+ index_Segments as Segments,
1309
+ };
1310
+ }
1311
+
1271
1312
  type NavigateHandler = (url: string, target?: string) => void;
1272
1313
  interface ProviderProps {
1314
+ /**
1315
+ * Your public API key from the Frigade dashboard. Do not ever use your private API key here.
1316
+ */
1273
1317
  apiKey: string;
1318
+ /**
1319
+ * The URL prefix of the API to use. By default, Frigade will use the production API: https://api.frigade.com/v1/public
1320
+ */
1274
1321
  apiUrl?: string;
1275
1322
  children?: React.ReactNode;
1323
+ /**
1324
+ * A function to handle navigation. By default, Frigade will use `window.open` if not provided.
1325
+ * https://docs.frigade.com/v2/sdk/navigation
1326
+ */
1276
1327
  navigate?: NavigateHandler;
1328
+ /**
1329
+ * The global theme to use across components. See docs on styling: https://docs.frigade.com/v2/sdk/styling/theming
1330
+ */
1277
1331
  theme?: Theme;
1332
+ /**
1333
+ * The user ID of the user who is interacting with Frigade. If not provided, Frigade will generate a random guest ID and persist it in local storage.
1334
+ */
1278
1335
  userId?: string;
1336
+ /**
1337
+ * The group ID to use for this context (optional).
1338
+ */
1279
1339
  groupId?: string;
1280
1340
  /**
1281
1341
  * @ignore Internal use only.
@@ -1291,9 +1351,9 @@ interface ProviderProps {
1291
1351
  }
1292
1352
  declare function Provider({ children, navigate, theme, ...props }: ProviderProps): _emotion_react_jsx_runtime.JSX.Element;
1293
1353
 
1294
- interface MergedRadixPopoverProps extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>, Omit<Popover.PopoverContentProps, 'align' | 'asChild'> {
1354
+ interface MergedRadixPopoverProps extends Pick<Popover.PopoverProps, 'defaultOpen' | 'modal' | 'onOpenChange' | 'open'>, Omit<Popover.PopoverContentProps, 'align' | 'asChild' | 'color' | 'content' | 'translate'> {
1295
1355
  }
1296
- interface TooltipProps {
1356
+ interface TooltipProps extends BoxProps, MergedRadixPopoverProps {
1297
1357
  /**
1298
1358
  * How to align the Tooltip relative to the anchor.
1299
1359
  * Uses the same notation as the `align` property in [Radix Popover](https://www.radix-ui.com/primitives/docs/components/popover).
@@ -1307,9 +1367,13 @@ interface TooltipProps {
1307
1367
  * Whether to show a spotlight behind the anchor. This will darken the rest of the page and highlight the anchor.
1308
1368
  */
1309
1369
  spotlight?: boolean;
1370
+ /**
1371
+ * The Z-index of the tooltip. Defaults to auto.
1372
+ */
1373
+ zIndex?: number | string;
1310
1374
  style?: React__default.CSSProperties;
1311
1375
  }
1312
- declare function Tooltip({ anchor, children, className, spotlight, style, ...props }: TooltipProps & MergedRadixPopoverProps): _emotion_react_jsx_runtime.JSX.Element;
1376
+ declare function Tooltip({ anchor, children, className, spotlight, style, ...props }: TooltipProps): _emotion_react_jsx_runtime.JSX.Element;
1313
1377
  declare namespace Tooltip {
1314
1378
  var Close: (props: ButtonProps) => _emotion_react_jsx_runtime.JSX.Element;
1315
1379
  var Media: ({ src, ...props }: MediaProps) => _emotion_react_jsx_runtime.JSX.Element;
@@ -1359,4 +1423,4 @@ declare function useGroup(): {
1359
1423
  track: (eventName: string, properties?: Record<string, unknown>) => Promise<void>;
1360
1424
  };
1361
1425
 
1362
- export { Announcement, AnnouncementProps, Banner, Box, BoxProps, Button, ButtonProps, Card, index as Checklist, CollapsibleProps, CollapsibleStepProps, Flex, FlowConfig, Form, Provider, ProviderProps, Text, TextProps, Tooltip, TooltipProps, Tour, TourProps, themeVariables, useBoundingClientRect, useFlow, useFlowHandlers, useFrigade, useGroup, useModal, useStepHandlers, useUser };
1426
+ export { Announcement, AnnouncementProps, Banner, Box, BoxProps, Button, ButtonProps, Card, index$1 as Checklist, CollapsibleProps, CollapsibleStepProps, Flex, FlowConfig, Form, index as Progress, Provider, ProviderProps, Text, TextProps, Tooltip, TooltipProps, Tour, TourProps, themeVariables, useBoundingClientRect, useFlow, useFlowHandlers, useFrigade, useGroup, useModal, useStepHandlers, useUser };
package/dist/index.js CHANGED
@@ -1,24 +1,23 @@
1
1
  'use client';
2
- import * as T from '@radix-ui/react-dialog';
2
+ import * as w from '@radix-ui/react-dialog';
3
3
  import { XMarkIcon } from '@heroicons/react/24/solid';
4
- import * as ye from 'react';
4
+ import * as be from 'react';
5
5
  import { createContext, useState, useMemo, useEffect, useContext, useRef, useCallback, useLayoutEffect } from 'react';
6
6
  import { clsx } from 'clsx';
7
- import jt from 'known-css-properties';
8
- import Qt from 'dompurify';
7
+ import Zo from 'known-css-properties';
8
+ import lt from 'dompurify';
9
9
  import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
10
10
  import { keyframes, Global, ThemeProvider } from '@emotion/react';
11
11
  import { Frigade } from '@frigade/js';
12
- export { Flow, Frigade } from '@frigade/js';
13
- import { ChevronDownIcon } from '@heroicons/react/16/solid';
14
- import * as q from '@radix-ui/react-collapsible';
12
+ export { Flow, FlowType, Frigade } from '@frigade/js';
13
+ import { ChevronDownIcon } from '@heroicons/react/24/outline';
14
+ import * as Y from '@radix-ui/react-collapsible';
15
15
  import { useForm, useController } from 'react-hook-form';
16
- import * as Y from '@radix-ui/react-radio-group';
16
+ import * as Q from '@radix-ui/react-radio-group';
17
17
  import * as C from '@radix-ui/react-select';
18
- import { ChevronDownIcon as ChevronDownIcon$1 } from '@heroicons/react/24/outline';
19
- import * as M from '@radix-ui/react-popover';
18
+ import * as I from '@radix-ui/react-popover';
20
19
 
21
- var Lt=Object.defineProperty;var Vt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var X=(e,t)=>{for(var o in t)Lt(e,o,{get:t[o],enumerable:!0});};var Ee={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var De={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",inherit:"inherit",red500:"#c00000"};var Oe={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,Me={neutral:{background:l("white"),border:l("gray800"),foreground:l("black"),surface:l("gray700"),active:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")},focus:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")},hover:{background:l("white"),border:l("gray900"),foreground:l("black"),surface:l("gray700")}},primary:{background:l("blue500"),border:l("blue500"),foreground:l("white"),surface:l("blue500"),active:{background:l("blue400"),border:l("blue400"),foreground:l("white"),surface:l("blue400")},focus:{background:l("blue500"),border:l("blue500"),foreground:l("white"),surface:l("blue500")},hover:{background:l("blue400"),border:l("blue400"),foreground:l("white"),surface:l("blue400")}},secondary:{background:l("white"),border:l("gray800"),foreground:l("black"),surface:l("gray900"),active:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray800")},focus:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray900")},hover:{background:l("gray900"),border:l("gray800"),foreground:l("black"),surface:l("gray800")}}};var He={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var $t="px",_t=e=>typeof e=="number"?`${4*e}${$t}`:e,zt=[-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"],Ie=Object.fromEntries(zt.map(e=>[e,_t(e)]));var We={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 ce={...Ee,colors:{...De,...Me},...We,radii:Oe,shadows:He,space:Ie};function Q(e,t="",o="."){return Object.keys(e).reduce((n,r)=>{let s=`${t.length?`${t}${o}`:""}${r}`,a=e[r];return typeof a=="object"&&a!==null&&!Array.isArray(a)?Object.assign(n,Q(a,s,o)):n[s]=a,n},{})}function me(e){return Q(e,"--fr","-")}function Ae(e,t="--fr"){let o={};return Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&r!==null&&!Array.isArray(r)?o[n]=Ae(r,`${t}-${n}`):o[n]=`var(${t}-${n})`;}),o}var ue=me(ce),y=Ae(ce);var Kt=new Set(["alt","size","src"]),Nt=jt.all.filter(e=>e.indexOf("-")!=0&&!Kt.has(e)).map(e=>[e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()),null]),Ut=Object.fromEntries(Nt),fe=Q(y.colors),Gt={color:fe,backgroundColor:fe,borderColor:fe,border:y.borders,borderRadius:y.radii,borderWidth:y.borderWidths,boxShadow:y.shadows,fontFamily:y.fontFamilies,fontSize:y.fontSizes,fontWeight:y.fontWeights,gap:y.space,lineHeight:y.lineHeights,margin:y.space,marginBottom:y.space,marginLeft:y.space,marginRight:y.space,marginTop:y.space,padding:y.space,paddingBottom:y.space,paddingLeft:y.space,paddingRight:y.space,paddingTop:y.space},Le={...Ut,...Gt},Ve={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"]},$e=new Set(["active","focus","focusVisible","focusWithin","hover"]);function Jt(e){return Array.isArray(e)?new Map(e.map(t=>[t,t])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):typeof e=="string"||typeof e=="number"?new Map([[e,e]]):new Map}var _e=new Map(Object.entries(Le).map(([e,t])=>[e,Jt(t)])),Xt=new Map(Object.entries(Ve).map(([e,t])=>[e,new Set(t)])),qt=new Set(["height","width"]),Yt=new Set(["canvas","embed","iframe","img","input","object","video"]);function ze(e){let[t,o]=e.split(":");return [t,$e.has(o)?o:null]}function je(e,t="div"){let o=Object.assign({},e),n={};function r(i){if(i==null)return n;let a=`&:${i.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return n[a]==null&&(n[a]={}),n[a]}return Object.entries(o).forEach(([i,s])=>{let[a,d]=ze(i),m=Xt.get(a);m!=null&&(m.forEach(x=>{let u=`${x}${d?":"+d:""}`;o[u]=s;}),delete o[i]);}),Object.entries(o).forEach(([i,s])=>{let[a,d]=ze(i),m=_e.get(a);if(m!=null){if(typeof s=="string"&&s.indexOf(" ")>-1){let x=s.split(" ");r(d)[a]=x.map(u=>m.get(u.toString())??u).join(" ");}else m.has(s.toString())?r(d)[a]=m.get(s.toString()):r(d)[a]=s;(typeof t!="string"||!Yt.has(t)||!qt.has(a))&&delete o[i];}}),Object.keys(o).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&_e.has(s)&&(o[s]=o[i],delete o[i]);}),{cssFromProps:n,unmatchedProps:o}}function Zt(){if(typeof window>"u"){let{JSDOM:e}=Vt("jsdom");return new e("<!DOCTYPE html>").window}return window}function Ke(e){return e?{__html:Qt(Zt()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted"]})}:{__html:""}}function to(e){return e&&`fr-${e}`}function Ge(e){return e&&(Array.isArray(e)?e.map(t=>Ge(t)).join(" "):to(e))}function oo({as:e,children:t,className:o,css:n={},part:r,...i},s){let a=e??"div",{cssFromProps:d,unmatchedProps:m}=je(i,a),x=Ge(r),u=o||x?clsx(o,x):void 0,h=[{boxSizing:"border-box"},d,n];return typeof t=="string"?jsx(a,{className:u,css:h,...m,ref:s,dangerouslySetInnerHTML:Ke(t)}):jsx(a,{className:u,css:h,...m,ref:s,children:t})}var p=ye.forwardRef(oo);var f={};X(f,{Body1:()=>Po,Body2:()=>Co,Caption:()=>So,Display1:()=>fo,Display2:()=>go,H1:()=>xo,H2:()=>yo,H3:()=>ho,H4:()=>bo});var ge={};X(ge,{Body1:()=>po,Body2:()=>co,Caption:()=>mo,Display1:()=>ro,Display2:()=>no,H1:()=>io,H2:()=>ao,H3:()=>so,H4:()=>lo});var H={color:"neutral.foreground",fontFamily:"default",margin:"0"},ro={...H,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},no={...H,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},io={...H,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},ao={...H,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},so={...H,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},lo={...H,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},po={...H,fontSize:"md",fontWeight:"regular",lineHeight:"md"},co={...H,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},mo={...H,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var uo=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],I=Object.fromEntries(uo.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",o=ye.forwardRef(({as:n=t,children:r,...i},s)=>jsx(p,{as:n,...ge[e],...i,ref:s,children:r}));return o.displayName=`Text.${e}`,[e,o]})),fo=I.Display1,go=I.Display2,xo=I.H1,yo=I.H2,ho=I.H3,bo=I.H4,Po=I.Body1,Co=I.Body2,So=I.Caption;var xe={};X(xe,{Link:()=>Ro,Plain:()=>Bo,Primary:()=>To,Secondary:()=>wo});var ie={borderWidth:"0",borderRadius:"md",display:"flex",gap:"2",padding:"2 4"},To={...ie,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface"},wo={...ie,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background"},Ro={...ie,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},Bo={...ie,backgroundColor:"transparent",color:"neutral.foreground"};function Xe({as:e,children:t,part:o,title:n,variant:r="Primary",...i}){let s=r.toLocaleLowerCase();return jsxs(p,{as:e??"button",part:[`button-${s}`,o],...xe[r],...i,children:[t,n&&jsx(f.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:n})]})}var vo=["Primary","Secondary","Link","Plain"],ko=Object.fromEntries(vo.map(e=>{let t=o=>jsx(Xe,{...o,variant:e,children:o.children});return t.displayName=`Button.${e}`,[e,t]})),b=Object.assign(Xe,ko);var g={};X(g,{Column:()=>Oo,Row:()=>Do});var Do=ye.forwardRef((e,t)=>jsx(p,{display:"flex",flexDirection:"row",...e,ref:t})),Oo=ye.forwardRef((e,t)=>jsx(p,{display:"flex",flexDirection:"column",...e,ref:t}));var B=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function $o({children:e,navigate:t,theme:o,...n}){let r=o?me(o):{},[i,s]=useState(new Set),a=useMemo(()=>new Frigade(n.apiKey,{apiKey:n.apiKey,apiUrl:n.apiUrl,userId:n.userId,groupId:n.groupId,__readOnly:n.__readOnly,__flowConfigOverrides:n.__flowConfigOverrides}),[n.userId,n.groupId,n.apiKey]),d=t??((x,u="_self")=>{window.open(x,u);});useEffect(()=>()=>{a.destroy();},[]);let m=i.size>0?i.values().next().value:null;return jsxs(B.Provider,{value:{modals:i,setModals:s,currentModal:m,navigate:d,...n,frigade:a},children:[jsx(Global,{styles:{":root":{...ue,...r}}}),jsx(ThemeProvider,{theme:y,children:e})]})}function Z(e,t){let[o,n]=useState(),[,r]=useState(""),{frigade:i}=useContext(B),s=a=>{a.id===e&&(t!=null&&t.variables&&a.applyVariables(t.variables),n(a),r(Math.random().toString()));};return useEffect(()=>((async()=>{let a=await i.getFlow(e);if(!a||i.hasFailedToLoad()){n(void 0);return}t!=null&&t.variables&&a.applyVariables(t.variables),n(a);})(),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}),[]),{flow:o}}function _(e,{onComplete:t,onDismiss:o}={}){let n=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&(async()=>await(t==null?void 0:t(e)))(),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(async r=>{if(await(o==null?void 0:o(e,r))===!1)return r.preventDefault(),!1;await e.skip();},[e])}}function ee(e,{onPrimary:t,onSecondary:o}={}){let{navigate:n}=useContext(B);return {handlePrimary:useCallback(async(r,i)=>await(t==null?void 0:t(e,r))===!1?(r.preventDefault(),!1):(await e.complete(i),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:useCallback(async(r,i)=>await(o==null?void 0:o(e,r))===!1?(r.preventDefault(),!1):(await e.complete(i),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function te(e){let{currentModal:t,modals:o,setModals:n}=useContext(B),[r,i]=useState(!1);useEffect(()=>{e!=null&&e.isVisible&&e&&!o.has(e.id)&&n(a=>new Set(a).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let a=t===(e==null?void 0:e.id);(e==null?void 0:e.id)!=null&&a!==r&&i(a);},[e==null?void 0:e.id,t]);function s(){o.has(e==null?void 0:e.id)&&n(a=>{let d=new Set(a);return d.delete(e==null?void 0:e.id),d});}return {isCurrentModal:r,removeModal:s}}function D({as:e,children:t,container:o,dismissible:n=!1,flowId:r,onComplete:i,onDismiss:s,onPrimary:a,onSecondary:d,variables:m,...x}){let{flow:u}=Z(r,{variables:m}),h=u==null?void 0:u.getCurrentStep(),{handleDismiss:E}=_(u,{onComplete:i,onDismiss:s}),{handlePrimary:$,handleSecondary:G}=ee(h,{onPrimary:a,onSecondary:d}),{isCurrentModal:J,removeModal:de}=te(u);return useEffect(()=>{!(u!=null&&u.isVisible)&&J&&de();},[u==null?void 0:u.isVisible,J]),u==null||!u.isVisible||!J?null:(u.start(),h.start(),jsx(e??p,{position:"relative",...x,children:t({flow:u,handleDismiss:E,handlePrimary:$,handleSecondary:G,parentProps:{container:o,dismissible:n,flowId:r,variables:m,...x},step:h})}))}function ot(e){return jsx(D,{as:c,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:t,handlePrimary:o,handleSecondary:n,parentProps:{dismissible:r},step:i})=>jsxs(Fragment,{children:[jsxs(g.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsx(c.Title,{children:i.title}),r&&jsx(c.Dismiss,{onClick:t}),jsx(c.Subtitle,{flexBasis:"100%",children:i.subtitle})]}),jsx(c.Media,{src:i.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(g.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(c.Secondary,{title:i.secondaryButtonTitle,onClick:n}),jsx(c.Primary,{title:i.primaryButtonTitle??"Continue",onClick:o})]})]})})}function rt({part:e,src:t,...o}){return jsx(p,{as:"img",part:["image",e],src:t,...o})}function er(e){var t,o,n,r;return e.includes("youtube")?`https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(r=e.split("loom.com/share/")[1])==null?void 0:r.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function it({part:e,src:t,...o}){let n=er(t);return n?jsx(p,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:n,...o}):t!=null&&t.endsWith(".mp4")?jsx(p,{as:"video",controls:!0,part:["video",e],src:t,...o}):(console.error(`Could not map videoUri ${t} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function j({src:e,type:t,...o}){return jsx(t==="video"?it:rt,{src:e,...o})}var c=ye.forwardRef(({children:e,flowId:t,...o},n)=>{if(t!=null)return jsx(ot,{flowId:t,...o});let r=o.as??g.Column;return jsx(r,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...o,ref:n,children:e})});c.Dismiss=e=>jsx(b.Plain,{part:"dismiss",padding:0,...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})});c.Media=({src:e,...t})=>e==null?null:jsx(j,{borderRadius:"md",src:e,...t});c.Primary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Primary,{title:t,onClick:e,...o});c.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Secondary,{title:t,onClick:e,...o});c.Subtitle=({children:e,...t})=>e==null?null:jsx(f.Body2,{display:"block",part:"subtitle",...t,children:e});c.Title=({children:e,...t})=>e==null?null:jsx(f.Body1,{display:"block",fontWeight:"bold",part:"title",...t,children:e});function F({children:e,...t}){return jsx(T.Root,{defaultOpen:!0,modal:!0,children:jsx(T.Portal,{children:jsxs(p,{inset:"0",position:"fixed",zIndex:"9999",children:[jsx(T.Overlay,{asChild:!0,children:jsx(p,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsx(T.Content,{asChild:!0,onOpenAutoFocus:o=>o.preventDefault(),onPointerDownOutside:o=>o.preventDefault(),children:jsx(c,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...t,children:e})})]})})})}F.Dismiss=e=>jsx(T.Close,{"aria-label":"Close",asChild:!0,children:jsx(b.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});F.Subtitle=({children:e,...t})=>jsx(T.Description,{asChild:!0,children:jsx(f.Body2,{part:"subtitle",...t,children:e})});F.Media=({src:e,...t})=>e==null?null:jsx(j,{borderRadius:"md",src:e,...t});F.Primary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Primary,{title:t,onClick:e,...o});F.ProgressDots=({current:e,total:t})=>{if(t==1)return null;let o=[...Array(t)].map((n,r)=>jsx("circle",{r:4,cx:4+16*r,cy:"4px",fill:e===r?y.colors.blue500:y.colors.blue800},r));return jsx(p,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*t-8} 8`,width:16*t-8,children:o})};F.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Secondary,{title:t,onClick:e,...o});F.Title=({children:e,...t})=>jsx(T.Title,{asChild:!0,children:jsx(f.H3,{part:"title",...t,children:e})});function ir({flowId:e,...t}){return jsx(D,{as:F,dismissible:!0,flowId:e,...t,children:({flow:o,handleDismiss:n,handlePrimary:r,handleSecondary:i,parentProps:{dismissible:s},step:a})=>jsxs(Fragment,{children:[s&&jsx(F.Dismiss,{onClick:n}),jsxs(g.Column,{gap:1,part:"announcement-header",children:[jsx(F.Title,{children:a.title}),jsx(F.Subtitle,{children:a.subtitle})]}),jsx(F.Media,{src:a.videoUri??a.imageUri,type:a.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(F.ProgressDots,{current:o.getNumberOfCompletedSteps(),total:o.getNumberOfAvailableSteps()}),jsxs(g.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[a.secondaryButtonTitle&&jsx(F.Secondary,{onClick:i,title:a.secondaryButtonTitle}),a.primaryButtonTitle&&jsx(F.Primary,{onClick:r,title:a.primaryButtonTitle??"Continue"})]})]})})}function sr({flowId:e,...t}){return jsx(D,{as:c,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...t,children:({handleDismiss:o,handlePrimary:n,handleSecondary:r,step:i})=>jsxs(Fragment,{children:[jsxs(g.Row,{gap:3,children:[i.imageUri&&jsx("img",{src:i.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(g.Column,{children:[jsx(f.H4,{mb:1,children:i.title}),jsx(f.Body2,{color:"gray500",children:i.subtitle})]})]}),jsxs(g.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[i.secondaryButtonTitle&&jsx(b.Secondary,{title:i.secondaryButtonTitle,onClick:r}),jsx(b.Primary,{title:i.primaryButtonTitle,onClick:n}),t.dismissible&&jsx(c.Dismiss,{onClick:o})]})]})})}var dt={};X(dt,{Collapsible:()=>pt,CollapsibleStep:()=>se});var se={};X(se,{Content:()=>Ce,Root:()=>Se,Trigger:()=>Fe});var dr=keyframes`
20
+ var Jo=Object.defineProperty;var Xo=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(o,t)=>(typeof require<"u"?require:o)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var z=(e,o)=>{for(var t in o)Jo(e,t,{get:o[t],enumerable:!0});};var Ie={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var Me={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",inherit:"inherit",red500:"#c00000"};var He={md:"10px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,We={neutral:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray700"),active:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},focus:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")},hover:{background:p("white"),border:p("gray900"),foreground:p("black"),surface:p("gray700")}},primary:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500"),active:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")},focus:{background:p("blue500"),border:p("blue500"),foreground:p("white"),surface:p("blue500")},hover:{background:p("blue400"),border:p("blue400"),foreground:p("white"),surface:p("blue400")}},secondary:{background:p("white"),border:p("gray800"),foreground:p("black"),surface:p("gray900"),active:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")},focus:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray900")},hover:{background:p("gray900"),border:p("gray800"),foreground:p("black"),surface:p("gray800")}}};var Ae={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var qo="px",Yo=e=>typeof e=="number"?`${4*e}${qo}`:e,Qo=[-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"],Le=Object.fromEntries(Qo.map(e=>[e,Yo(e)]));var Ve={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 ue={...Ie,colors:{...Me,...We},...Ve,radii:He,shadows:Ae,space:Le};function ee(e,o="",t="."){return Object.keys(e).reduce((i,n)=>{let a=`${o.length?`${o}${t}`:""}${n}`,s=e[n];return typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(i,ee(s,a,t)):i[a]=s,i},{})}function fe(e){return ee(e,"--fr","-")}function $e(e,o="--fr"){let t={};return Object.keys(e).forEach(i=>{let n=e[i];typeof n=="object"&&n!==null&&!Array.isArray(n)?t[i]=$e(n,`${o}-${i}`):t[i]=`var(${o}-${i})`;}),t}var ge=fe(ue),y=$e(ue);var et=new Set(["alt","size","src"]),ot=Zo.all.filter(e=>e.indexOf("-")!=0&&!et.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),tt=Object.fromEntries(ot),xe=ee(y.colors),rt={color:xe,backgroundColor:xe,borderColor:xe,border:y.borders,borderRadius:y.radii,borderWidth:y.borderWidths,boxShadow:y.shadows,fontFamily:y.fontFamilies,fontSize:y.fontSizes,fontWeight:y.fontWeights,gap:y.space,lineHeight:y.lineHeights,margin:y.space,marginBottom:y.space,marginLeft:y.space,marginRight:y.space,marginTop:y.space,padding:y.space,paddingBottom:y.space,paddingLeft:y.space,paddingRight:y.space,paddingTop:y.space},_e={...tt,...rt},ze={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"]},je=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function nt(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 Ne=new Map(Object.entries(_e).map(([e,o])=>[e,nt(o)])),it=new Map(Object.entries(ze).map(([e,o])=>[e,new Set(o)])),st=new Set(["height","width"]),at=new Set(["canvas","embed","iframe","img","input","object","video"]);function Ke(e){let[o,t]=e.split(":");return [o,je.has(t)?t:null]}function Ue(e,o="div"){let t=Object.assign({},e),i={};function n(r){if(r==null)return i;let s=`&:${r.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return i[s]==null&&(i[s]={}),i[s]}return Object.entries(t).forEach(([r,a])=>{let[s,d]=Ke(r),m=it.get(s);m!=null&&(m.forEach(u=>{let f=`${u}${d?":"+d:""}`;t[f]=a;}),delete t[r]);}),Object.entries(t).forEach(([r,a])=>{let[s,d]=Ke(r),m=Ne.get(s);if(m!=null){if(typeof a=="string"&&a.indexOf(" ")>-1){let u=a.split(" ");n(d)[s]=u.map(f=>m.get(f.toString())??f).join(" ");}else m.has(a.toString())?n(d)[s]=m.get(a.toString()):n(d)[s]=a;(typeof o!="string"||!at.has(o)||!st.has(s))&&delete t[r];}}),Object.keys(t).forEach(r=>{let a=r.substring(1);r.indexOf("_")===0&&Ne.has(a)&&(t[a]=t[r],delete t[r]);}),{cssFromProps:i,unmatchedProps:t}}function pt(){if(typeof window>"u"){let{JSDOM:e}=Xo("jsdom");return new e("<!DOCTYPE html>").window}return window}function Ge(e){return e?{__html:lt(pt()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted"]})}:{__html:""}}function ct(e){return e&&`fr-${e}`}function qe(e){return e&&(Array.isArray(e)?e.map(o=>qe(o)).join(" "):ct(e))}function mt({as:e,children:o,className:t,css:i={},part:n,...r},a){let s=e??"div",{cssFromProps:d,unmatchedProps:m}=Ue(r,s),u=qe(n),f=t||u?clsx(t,u):void 0,h=[{boxSizing:"border-box"},d,i];return typeof o=="string"?jsx(s,{className:f,css:h,...m,ref:a,dangerouslySetInnerHTML:Ge(o)}):jsx(s,{className:f,css:h,...m,ref:a,children:o})}var l=be.forwardRef(mt);var g={};z(g,{Body1:()=>kt,Body2:()=>Dt,Caption:()=>Et,Display1:()=>Ft,Display2:()=>Tt,H1:()=>wt,H2:()=>Rt,H3:()=>Bt,H4:()=>vt});var ye={};z(ye,{Body1:()=>bt,Body2:()=>Pt,Caption:()=>Ct,Display1:()=>ut,Display2:()=>ft,H1:()=>gt,H2:()=>xt,H3:()=>yt,H4:()=>ht});var M={color:"neutral.foreground",fontFamily:"default",margin:"0"},ut={...M,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},ft={...M,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},gt={...M,fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"},xt={...M,fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"},yt={...M,fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"},ht={...M,fontSize:"md",fontWeight:"demibold",lineHeight:"md"},bt={...M,fontSize:"md",fontWeight:"regular",lineHeight:"md"},Pt={...M,fontSize:"sm",fontWeight:"regular",lineHeight:"sm"},Ct={...M,fontSize:"xs",fontWeight:"regular",lineHeight:"xs"};var St=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],H=Object.fromEntries(St.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=be.forwardRef(({as:i=o,children:n,...r},a)=>jsx(l,{as:i,...ye[e],...r,ref:a,children:n}));return t.displayName=`Text.${e}`,[e,t]})),Ft=H.Display1,Tt=H.Display2,wt=H.H1,Rt=H.H2,Bt=H.H3,vt=H.H4,kt=H.Body1,Dt=H.Body2,Et=H.Caption;var he={};z(he,{Link:()=>Ht,Plain:()=>Wt,Primary:()=>It,Secondary:()=>Mt});var se={borderWidth:"0",borderRadius:"md",display:"flex",gap:"2",padding:"2 4"},It={...se,backgroundColor:"primary.surface",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"},Mt={...se,backgroundColor:"secondary.background",borderColor:"secondary.border",borderStyle:"solid",borderWidth:"1px",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"},Ht={...se,backgroundColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"},Wt={...se,backgroundColor:"transparent",color:"neutral.foreground"};function Qe({as:e,children:o,part:t,title:i,variant:n="Primary",...r}){let a=n.toLocaleLowerCase();return jsxs(l,{as:e??"button",part:[`button-${a}`,t],...he[n],...r,children:[o,i&&jsx(g.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:i})]})}var At=["Primary","Secondary","Link","Plain"],Lt=Object.fromEntries(At.map(e=>{let o=t=>jsx(Qe,{...t,variant:e,children:t.children});return o.displayName=`Button.${e}`,[e,o]})),b=Object.assign(Qe,Lt);var x={};z(x,{Column:()=>_t,Row:()=>$t});var $t=be.forwardRef((e,o)=>jsx(l,{display:"flex",flexDirection:"row",...e,ref:o})),_t=be.forwardRef((e,o)=>jsx(l,{display:"flex",flexDirection:"column",...e,ref:o}));var v=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function Xt({children:e,navigate:o,theme:t,...i}){let n=t?fe(t):{},[r,a]=useState(new Set),s=useMemo(()=>new Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,__readOnly:i.__readOnly,__flowConfigOverrides:i.__flowConfigOverrides}),[i.userId,i.groupId,i.apiKey]),d=o??((u,f="_self")=>{window.open(u,f);});useEffect(()=>()=>{s.destroy();},[]);let m=r.size>0?r.values().next().value:null;return jsxs(v.Provider,{value:{modals:r,setModals:a,currentModal:m,navigate:d,...i,frigade:s},children:[jsx(Global,{styles:{":root":{...ge,...n}}}),jsx(ThemeProvider,{theme:y,children:e})]})}function oe(e,o){let[t,i]=useState(),[,n]=useState(""),{frigade:r}=useContext(v),a=s=>{s.id===e&&(o!=null&&o.variables&&s.applyVariables(o.variables),i(s),n(Math.random().toString()));};return useEffect(()=>((async()=>{let s=await r.getFlow(e);if(!s||r.hasFailedToLoad()){i(void 0);return}o!=null&&o.variables&&s.applyVariables(o.variables),i(s);})(),r.onStateChange(a),()=>{r.removeStateChangeHandler(a);}),[]),{flow:t}}function j(e,{onComplete:o,onDismiss:t}={}){let i=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&i.current===!1&&(async()=>await(o==null?void 0:o(e)))(),i.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(async n=>{if(await(t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;await e.skip();},[e])}}function N(e,{onPrimary:o,onSecondary:t}={}){let{navigate:i}=useContext(v);return {handlePrimary:useCallback(async(n,r)=>await(o==null?void 0:o(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.primaryButtonUri!=null&&i(e.primaryButtonUri,e.primaryButtonUriTarget),!0),[e]),handleSecondary:useCallback(async(n,r)=>await(t==null?void 0:t(e,n))===!1?(n.preventDefault(),!1):(await e.complete(r),e.secondaryButtonUri!=null&&i(e.secondaryButtonUri,e.secondaryButtonUriTarget),!0),[e])}}function te(e){let{currentModal:o,modals:t,setModals:i}=useContext(v),[n,r]=useState(!1);useEffect(()=>{e!=null&&e.isVisible&&e&&!t.has(e.id)&&i(s=>new Set(s).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let s=o===(e==null?void 0:e.id);(e==null?void 0:e.id)!=null&&s!==n&&r(s);},[e==null?void 0:e.id,o]);function a(){t.has(e==null?void 0:e.id)&&i(s=>{let d=new Set(s);return d.delete(e==null?void 0:e.id),d});}return {isCurrentModal:n,removeModal:a}}function O({as:e,children:o,container:t,dismissible:i=!1,flowId:n,onComplete:r,onDismiss:a,onPrimary:s,onSecondary:d,variables:m,...u}){let{flow:f}=oe(n,{variables:m}),h=f==null?void 0:f.getCurrentStep(),{handleDismiss:T}=j(f,{onComplete:r,onDismiss:a}),{handlePrimary:q,handleSecondary:_}=N(h,{onPrimary:s,onSecondary:d}),{isCurrentModal:Z,removeModal:ne}=te(f);return useEffect(()=>{!(f!=null&&f.isVisible)&&Z&&ne();},[f==null?void 0:f.isVisible,Z]),f==null||!f.isVisible||!Z?null:(f.start(),h.start(),jsx(e??l,{position:"relative",...u,children:o({flow:f,handleDismiss:T,handlePrimary:q,handleSecondary:_,parentProps:{container:t,dismissible:i,flowId:n,variables:m,...u},step:h})}))}function io(e){return jsx(O,{as:c,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card",...e,children:({handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:n},step:r})=>jsxs(Fragment,{children:[jsxs(x.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"card-header",children:[jsx(c.Title,{children:r.title}),n&&jsx(c.Dismiss,{onClick:o}),jsx(c.Subtitle,{flexBasis:"100%",children:r.subtitle})]}),jsx(c.Media,{src:r.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(x.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(c.Secondary,{title:r.secondaryButtonTitle,onClick:i}),jsx(c.Primary,{title:r.primaryButtonTitle??"Continue",onClick:t})]})]})})}function so({part:e,src:o,...t}){return jsx(l,{as:"img",part:["image",e],src:o,...t})}function pr(e){var o,t,i,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/${(i=e.split("wistia.com/medias/")[1])==null?void 0:i.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 lo({part:e,src:o,...t}){let i=pr(o);return i?jsx(l,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:i,...t}):o!=null&&o.endsWith(".mp4")?jsx(l,{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 U({src:e,type:o,...t}){return jsx(o==="video"?lo:so,{src:e,...t})}var c=be.forwardRef(({children:e,flowId:o,...t},i)=>{if(o!=null)return jsx(io,{flowId:o,...t});let n=t.as??x.Column;return jsx(n,{backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,...t,ref:i,children:e})});c.Dismiss=e=>jsx(b.Plain,{part:"dismiss",padding:0,...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})});c.Media=({src:e,...o})=>e==null?null:jsx(U,{borderRadius:"md",src:e,...o});c.Primary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Primary,{title:o,onClick:e,...t});c.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Secondary,{title:o,onClick:e,...t});c.Subtitle=({children:e,...o})=>e==null?null:jsx(g.Body2,{display:"block",part:"subtitle",...o,children:e});c.Title=({children:e,...o})=>e==null?null:jsx(g.Body1,{display:"block",fontWeight:"bold",part:"title",...o,children:e});function F({children:e,...o}){return jsx(w.Root,{defaultOpen:!0,modal:!0,children:jsx(w.Portal,{children:jsxs(l,{inset:"0",position:"fixed",zIndex:"9999",children:[jsx(w.Overlay,{asChild:!0,children:jsx(l,{background:"rgb(0 0 0 / 0.5)",part:"dialog-overlay",position:"fixed",inset:"0"})}),jsx(w.Content,{asChild:!0,onOpenAutoFocus:t=>t.preventDefault(),onPointerDownOutside:t=>t.preventDefault(),children:jsx(c,{boxShadow:"md",left:"50%",maxWidth:"430px",p:8,part:"dialog",position:"fixed",textAlign:"center",top:"50%",transform:"translate(-50%, -50%)",...o,children:e})})]})})})}F.Dismiss=e=>jsx(w.Close,{"aria-label":"Close",asChild:!0,children:jsx(b.Plain,{part:"close",position:"absolute",right:"-4px",top:"4px",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});F.Subtitle=({children:e,...o})=>jsx(w.Description,{asChild:!0,children:jsx(g.Body2,{part:"subtitle",...o,children:e})});F.Media=({src:e,...o})=>e==null?null:jsx(U,{borderRadius:"md",src:e,...o});F.Primary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Primary,{title:o,onClick:e,...t});F.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((i,n)=>jsx("circle",{r:4,cx:4+16*n,cy:"4px",fill:e===n?y.colors.blue500:y.colors.blue800},n));return jsx(l,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};F.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Secondary,{title:o,onClick:e,...t});F.Title=({children:e,...o})=>jsx(w.Title,{asChild:!0,children:jsx(g.H3,{part:"title",...o,children:e})});function fr({flowId:e,...o}){return jsx(O,{as:F,dismissible:!0,flowId:e,...o,children:({flow:t,handleDismiss:i,handlePrimary:n,handleSecondary:r,parentProps:{dismissible:a},step:s})=>jsxs(Fragment,{children:[a&&jsx(F.Dismiss,{onClick:i}),jsxs(x.Column,{gap:1,part:"announcement-header",children:[jsx(F.Title,{children:s.title}),jsx(F.Subtitle,{children:s.subtitle})]}),jsx(F.Media,{src:s.videoUri??s.imageUri,type:s.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(F.ProgressDots,{current:t.getNumberOfCompletedSteps(),total:t.getNumberOfAvailableSteps()}),jsxs(x.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[s.secondaryButtonTitle&&jsx(F.Secondary,{onClick:r,title:s.secondaryButtonTitle}),s.primaryButtonTitle&&jsx(F.Primary,{onClick:n,title:s.primaryButtonTitle??"Continue"})]})]})})}function xr({flowId:e,...o}){return jsx(O,{as:c,borderWidth:"md",display:"flex",flexDirection:"row",flowId:e,gap:3,justifyContent:"space-between",part:"banner",...o,children:({handleDismiss:t,handlePrimary:i,handleSecondary:n,step:r})=>jsxs(Fragment,{children:[jsxs(x.Row,{gap:3,children:[r.imageUri&&jsx("img",{src:r.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(x.Column,{children:[jsx(g.H4,{mb:1,children:r.title}),jsx(g.Body2,{color:"gray500",children:r.subtitle})]})]}),jsxs(x.Row,{alignItems:"center",gap:3,justifyContent:"center",children:[r.secondaryButtonTitle&&jsx(b.Secondary,{title:r.secondaryButtonTitle,onClick:n}),jsx(b.Primary,{title:r.primaryButtonTitle,onClick:i}),o.dismissible&&jsx(c.Dismiss,{onClick:t})]})]})})}var Po={};z(Po,{Collapsible:()=>bo,CollapsibleStep:()=>le});var le={};z(le,{Content:()=>Fe,Root:()=>Te,Trigger:()=>we});var br=keyframes`
22
21
  from {
23
22
  height: 0;
24
23
  opacity: 0;
@@ -27,7 +26,7 @@ var Lt=Object.defineProperty;var Vt=(e=>typeof require<"u"?require:typeof Proxy<
27
26
  height: var(--radix-collapsible-content-height);
28
27
  opacity: 1;
29
28
  }
30
- `,cr=keyframes`
29
+ `,Pr=keyframes`
31
30
  from {
32
31
  height: var(--radix-collapsible-content-height);
33
32
  opacity: 1;
@@ -36,8 +35,8 @@ var Lt=Object.defineProperty;var Vt=(e=>typeof require<"u"?require:typeof Proxy<
36
35
  height: 0;
37
36
  opacity: 0;
38
37
  }
39
- `,mr=()=>jsx(p,{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 ur({checked:e=!1}){return jsx(p,{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(p,{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(mr,{})})})}function Ce({children:e}){return jsx(q.Content,{asChild:!0,children:jsxs(g.Column,{css:{'&[data-state="open"]':{animation:`${dr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${cr} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsx(p,{}),e]})})}function Se({children:e,open:t=!1,onOpenChange:o=()=>{}}){return jsx(q.Root,{asChild:!0,open:t,onOpenChange:o,children:jsx(c,{borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,children:e})})}function Fe({isCompleted:e,title:t}){return jsx(q.Trigger,{asChild:!0,children:jsxs(g.Row,{alignItems:"center",justifyContent:"space-between",children:[jsxs(g.Row,{alignItems:"center",gap:2,children:[jsx(ur,{checked:e}),jsx(f.Body2,{fontWeight:"demibold",children:t})]}),jsx(p,{as:ChevronDownIcon,color:"gray100",display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}function lt({handlePrimary:e,handleSecondary:t,open:o,onOpenChange:n,step:r}){let{isCompleted:i,primaryButtonTitle:s,secondaryButtonTitle:a,subtitle:d,title:m}=r;return jsxs(Se,{open:o,onOpenChange:n,children:[jsx(Fe,{isCompleted:i,title:m}),jsxs(Ce,{children:[jsx(c.Media,{aspectRatio:2.5,objectFit:"cover",src:r.imageUri}),jsx(c.Subtitle,{color:"gray500",children:d}),jsxs(g.Row,{gap:3,children:[jsx(c.Secondary,{title:a,onClick:t}),jsx(c.Primary,{title:s,onClick:e})]})]})]})}var gr={default:lt};function xr({flow:e,step:t,stepTypes:o,...n}){var d;let[r,i]=useState(t.id),s={...gr,...o},a=Array.from((d=e.steps)==null?void 0:d.entries()).map(([,m])=>{let x=s[m.type]??lt;function u(h){var E,$,G;i(h?m.id:null),h&&!((E=e.steps.get(m.id))!=null&&E.isCompleted)&&((G=($=e.steps)==null?void 0:$.get(m.id))==null||G.start());}return jsx(x,{flow:e,onOpenChange:u,open:m.id===r,step:m,...n},m.id)});return jsxs(Fragment,{children:[jsxs(g.Column,{gap:2,children:[jsx(c.Title,{children:e.title}),jsx(c.Subtitle,{color:"gray500",children:e.subtitle})]}),a]})}function pt({flowId:e,stepTypes:t={},...o}){return jsx(D,{as:c,borderWidth:"md",flowId:e,part:"checklist",...o,children:n=>jsx(xr,{stepTypes:t,...n})})}var Pr=new Set(["required","min","max","minLength","maxLength","pattern"]);function Cr({fieldComponent:e,control:t,fieldData:o}){o.pattern!=null&&(typeof o.pattern=="string"?o.pattern=new RegExp(o.pattern.replace(/^\/|\/$/g,"")):typeof o.pattern=="object"&&typeof o.pattern.value=="string"&&(o.pattern.value=new RegExp(o.pattern.value.replace(/^\/|\/$/g,""))));let n=Object.fromEntries(Object.entries(o).filter(([i])=>Pr.has(i))),r=useController({name:o.id,control:t,rules:n});return jsx(e,{...r,fieldData:o})}function ct({fieldTypes:e,handleDismiss:t,handlePrimary:o,handleSecondary:n,parentProps:{dismissible:r},step:i}){var u;let{control:s,handleSubmit:a}=useForm({delayError:2e3,mode:"onChange"}),d=[];function m(h,E){o(E,h);}function x(h,E){n(E,h);}return (u=i.fields)==null||u.forEach(h=>{e[h.type]!=null&&d.push(jsx(Cr,{control:s,fieldComponent:e[h.type],fieldData:h},h.id));}),jsxs(g.Column,{gap:5,part:"form-step",children:[jsxs(g.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"form-step-header",children:[jsx(c.Title,{children:i.title}),r&&jsx(c.Dismiss,{onClick:t}),jsx(c.Subtitle,{flexBasis:"100%",children:i.subtitle})]}),d,jsxs(g.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[i.secondaryButtonTitle&&jsx(b.Secondary,{title:i.secondaryButtonTitle,onClick:a(x)}),jsx(b.Primary,{title:i.primaryButtonTitle??"Submit",onClick:a(m)})]},"form-footer")]})}function mt({error:e}){var t;return (t=e==null?void 0:e.message)!=null&&t.length?jsx(f.Caption,{color:"red500",display:"block",part:"field-error",textAlign:"end",children:e==null?void 0:e.message}):null}function ut({children:e,id:t,required:o=!1}){return jsxs(f.H4,{as:"label",htmlFor:t,part:"field-label",children:[e,o&&" *"]})}var re={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function V({children:e,field:t,fieldData:o,fieldState:n}){let{id:r,label:i,placeholder:s}=o,{error:a}=n,d={id:r,...t,...s?{placeholder:s}:{},...re,"aria-invalid":!!a,value:t.value??""};return jsxs(p,{part:"field",children:[jsx(ut,{id:r,required:!!o.required,children:i}),e(d),jsx(mt,{error:a})]})}var wr=()=>jsx(p,{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"})}),Rr=ye.forwardRef(({label:e,value:t},o)=>jsxs(p,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:t,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsx(f.Body2,{part:"field-radio-label",children:e}),jsx(Y.Item,{id:t,value:t,ref:o,asChild:!0,children:jsx(p,{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(p,{as:Y.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(wr,{})})})})]}));function yt(e){let{field:{onChange:t,value:o},fieldData:{options:n=[]}}=e,r=n.map(({label:i,value:s})=>jsx(Rr,{value:s,label:i},s));return jsx(V,{...e,children:()=>jsx(Y.Root,{value:o,onValueChange:t,asChild:!0,children:jsx(g.Column,{gap:2,part:"field-radio-group",children:r})})})}var kr=ye.forwardRef(({label:e,value:t},o)=>jsx(C.Item,{value:t,ref:o,asChild:!0,children:jsx(p,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(C.ItemText,{asChild:!0,children:jsx(f.Body2,{part:"field-select-option-label",children:e})})})}));function Pt(e){let{field:{onChange:t,value:o},fieldData:{options:n=[],placeholder:r}}=e,i=n.map(({label:s,value:a})=>jsx(kr,{value:a,label:s},a));return jsx(V,{...e,children:()=>jsxs(C.Root,{value:o,onValueChange:t,children:[jsx(C.Trigger,{asChild:!0,children:jsxs(f.Body2,{...re,alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(C.Value,{placeholder:r??"Select one"}),jsx(C.Icon,{children:jsx(p,{as:ChevronDownIcon$1,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]})}),jsx(C.Portal,{children:jsx(C.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(p,{...re,p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",children:jsx(C.Viewport,{children:i})})})})]})})}function St(e){return jsx(V,{...e,children:t=>jsx(f.Body2,{as:"input",part:"field-text",type:"text",...t})})}function Tt(e){return jsx(V,{...e,children:t=>jsx(f.Body2,{as:"textarea",part:"field-textarea",...t})})}var Er={radio:yt,select:Pt,text:St,textarea:Tt};function Dr({fieldTypes:e={},flowId:t,...o}){let n=Object.assign({},Er,e);return jsx(D,{flowId:t,part:"form",...o,children:r=>jsx(ct,{fieldTypes:n,...r})})}function le(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=useState(e),[n,r]=useState(null),i=useCallback(s=>{r(s);},[]);return useLayoutEffect(()=>{if(!n)return;let s=()=>{let a=n.getBoundingClientRect();o(a);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[n]),{node:n,rect:t,ref:i}}var Ir=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function vt({style:e={},part:t="",...o}){return jsxs(p,{part:`dot-wrapper ${t}`,style:{height:"48px",position:"absolute",width:"48px",...e},...o,children:[jsx(p,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Ir}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(p,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function kt({props:e,alignAttr:t,sideAttr:o}){let n=o??"bottom",r={},i=()=>{if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return e.align??"after"},s="-24px",a={top:"bottom",right:"left",bottom:"top",left:"right"};r[a[n]]=s;let d=i();return ["before","end"].includes(d)?["top","bottom"].includes(n)?r.right=s:r.bottom=s:["after","start"].includes(d)?["top","bottom"].includes(n)?r.left=s:r.top=s:["top","bottom"].includes(n)?r.left=`calc(50% + ${s})`:r.top=`calc(50% + ${s})`,r}var Et={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Dt(e,t){let o=Object.fromEntries(Et.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n=Object.fromEntries(Et.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0));if(o.align=o.align??"after",o.side=o.side??"bottom",["before","after"].includes(o.align)){let r={after:"end",before:"start"},i=(u,h)=>["top","bottom"].includes(h)?u=="after"?"marginLeft":"marginRight":u=="after"?"marginTop":"marginBottom",s=o.alignOffset??0,a=o.style??{},d=o.side??"bottom",m=o.align;o.style={...a,[i(m,d)]:s};let x=["top","bottom"].includes(d)?t.width:t.height;o.alignOffset=(x+s)*-1,o.align=r[m];}return {contentProps:o,rootProps:n}}function S({anchor:e,children:t,className:o,spotlight:n=!1,style:r,...i}){let{node:s,rect:a,ref:d}=le(),{node:m,rect:x,ref:u}=le(),{contentProps:h,rootProps:E}=Dt(i,a),[$,G]=useState(h.align),[J,de]=useState(h.side),[Be,Ht]=useState(0),[It,Wt]=useState(0);if(s!==null){let A=s.getAttribute("data-align"),ne=s.getAttribute("data-side");$!==A&&G(A),J!==ne&&de(ne);}let ve=useRef(null);if(useEffect(()=>{let A=document.querySelector(e);A!=null&&(u(A),ve.current=A);},[e]),useEffect(()=>{let{scrollX:A,scrollY:ne}=window;Ht(x.left+A),Wt(x.top+ne);},[x.left,x.top]),m==null)return null;let ke="0";typeof window<"u"&&(ke=window.getComputedStyle(m).borderRadius);let At=kt({props:i,alignAttr:$,sideAttr:J});return jsxs(M.Root,{defaultOpen:!0,...E,children:[jsx(M.Anchor,{virtualRef:ve}),jsx(M.Portal,{children:jsxs("div",{className:o,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999,pointerEvents:"none"},children:[n&&jsx(p,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:ke,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:x.height,left:Be,top:It,width:x.width}}),jsx(M.Content,{asChild:!0,...h,ref:d,children:jsxs(c,{boxShadow:"md",part:"tooltip",position:"relative",css:{maxWidth:"360px",pointerEvents:"auto",...r},children:[jsx(vt,{style:At}),t]})})]})})]})}S.Close=e=>jsx(M.Close,{"aria-label":"Close",asChild:!0,children:jsx(b.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});S.Media=({src:e,...t})=>e==null?null:jsx(j,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e,...t});S.Primary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Primary,{title:t,onClick:e,...o});S.Progress=({children:e,...t})=>e==null?null:jsx(f.H4,{part:"progress",...t,children:e});S.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsx(b.Secondary,{title:t,onClick:e,...o});S.Subtitle=({children:e,...t})=>e==null?null:jsx(f.Body2,{part:"subtitle",...t,children:e});S.Title=({children:e,...t})=>e==null?null:jsx(f.H4,{part:"title",...t,children:e});function Mt({dismissible:e=!0,flow:t,onDismiss:o,onPrimary:n,onSecondary:r,step:i,...s}){let{handleDismiss:a}=_(t,{onDismiss:o}),{handlePrimary:d,handleSecondary:m}=ee(i,{onPrimary:n,onSecondary:r});return jsxs(S,{anchor:i.selector,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),...s,children:[e&&jsx(S.Close,{onClick:a}),jsx(S.Media,{src:i.videoUri??i.imageUri,type:i.videoUri?"video":"image"}),jsxs(g.Column,{gap:1,part:"tooltip-header",children:[jsx(S.Title,{children:i.title}),jsx(S.Subtitle,{color:"gray500",children:i.subtitle})]}),jsxs(g.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[jsx(S.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsx(S.Secondary,{title:i.secondaryButtonTitle,onClick:m}),jsx(S.Primary,{title:i.primaryButtonTitle,onClick:d})]})]},i.id)}function $r({flowId:e,onComplete:t,variables:o,...n}){let{flow:r}=Z(e,{variables:o});_(r,{onComplete:t});let{isCurrentModal:i,removeModal:s}=te(r);if(useEffect(()=>{!(r!=null&&r.isVisible)&&i&&s();},[r==null?void 0:r.isVisible,i]),r==null||r.isVisible===!1||!i)return null;r.start();let a=r.getCurrentStep();return a==null||a.start(),jsx(Mt,{step:a,flow:r,...n})}function jr(){let{frigade:e}=useContext(B);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Nr(){let{userId:e,frigade:t}=useContext(B);async function o(r){await t.identify(e,r);}async function n(r,i){await t.track(r,i);}return {userId:e,addProperties:o,track:n}}function Gr(){let{groupId:e,frigade:t}=useContext(B);async function o(r){if(!e){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}await t.group(e,r);}async function n(r,i){await t.track(r,i);}return {groupId:e,addProperties:o,track:n}}
38
+ `,Cr=()=>jsx(l,{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 Sr({checked:e=!1}){return jsx(l,{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(l,{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(Cr,{})})})}function Fe({children:e}){return jsx(Y.Content,{asChild:!0,children:jsxs(x.Column,{css:{'&[data-state="open"]':{animation:`${br} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Pr} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsx(l,{}),e]})})}function Te({children:e,open:o=!1,onOpenChange:t=()=>{}}){return jsx(Y.Root,{asChild:!0,open:o,onOpenChange:t,children:jsx(c,{borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,children:e})})}function we({isCompleted:e,title:o}){return jsx(Y.Trigger,{asChild:!0,children:jsxs(x.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxs(x.Row,{alignItems:"center",gap:2,children:[jsx(Sr,{checked:e}),jsx(g.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsx(l,{as:ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Re={};z(Re,{Bar:()=>pe,Dots:()=>fo,Segments:()=>xo});function pe({current:e,total:o,...t}){let i=o>0?Math.min(e/o,1):0,n=i===0?"10px":`${100*i}%`;return jsx(l,{backgroundColor:"blue800",borderRadius:"md",height:"10px",...t,children:jsx(l,{backgroundColor:"primary.surface",borderRadius:"md",height:"100%",style:{width:n},transition:"width 300ms ease-out"})})}function fo({current:e,total:o,...t}){if(o==1)return null;let i=[...Array(o)].map((n,r)=>jsx(l,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e-1===r?y.colors.blue500:y.colors.blue800},r));return jsx(l,{as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,...t,children:i})}function xo({current:e,total:o,...t}){let i=[...Array(o)].map((n,r)=>jsx(l,{backgroundColor:e-1===r?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},r));return jsx(x.Row,{gap:1,height:"10px",...t,children:i})}var yo=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function ho({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:i,step:n}){let{isBlocked:r,isCompleted:a,primaryButtonTitle:s,secondaryButtonTitle:d,subtitle:m,title:u}=n;return jsxs(Te,{open:t,onOpenChange:i,children:[jsx(we,{isCompleted:a,title:u}),jsxs(Fe,{children:[jsx(c.Media,{aspectRatio:2.5,objectFit:"cover",src:n.imageUri}),jsx(c.Subtitle,{color:"gray500",children:m}),jsxs(x.Row,{gap:3,children:[jsx(c.Secondary,{disabled:!!(a||r),title:d,onClick:o}),jsx(c.Primary,{disabled:!!(a||r),title:s,onClick:e})]})]})]})}var Rr={default:ho};function Br({flow:e,step:o,...t}){let{onPrimary:i,onSecondary:n,openStepId:r,setOpenStepId:a,stepTypes:s}=useContext(yo),{handlePrimary:d,handleSecondary:m}=N(o,{onPrimary:i,onSecondary:n}),u=(r??e.getCurrentStep().id)===o.id,f=s[o.type]??ho;async function h(T){a(T?o.id:""),T&&!o.isCompleted&&await o.start();}return jsx(f,{flow:e,onOpenChange:h,open:u,step:o,...t,handlePrimary:d,handleSecondary:m},o.id)}function bo({dismissible:e,flowId:o,onPrimary:t,onSecondary:i,stepTypes:n={},...r}){let[a,s]=useState(null),d={...Rr,...n};return jsx(yo.Provider,{value:{openStepId:a,setOpenStepId:s,onPrimary:t,onSecondary:i,stepTypes:d},children:jsx(O,{as:c,borderWidth:"md",flowId:o,part:"checklist",...r,children:({flow:m,handleDismiss:u,...f})=>{let h=Array.from(m.steps.entries()).map(([,_])=>jsx(Br,{flow:m,handleDismiss:u,...f,step:_},_.id)),T=m.getNumberOfCompletedSteps(),q=m.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(x.Column,{gap:2,children:[jsxs(x.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"checklist-header",children:[jsx(c.Title,{children:m.title}),e&&jsx(c.Dismiss,{onClick:u}),jsx(c.Subtitle,{color:"gray500",flexBasis:"100%",children:m.subtitle})]}),jsxs(x.Row,{alignItems:"center",gap:2,children:[jsxs(g.Body2,{fontWeight:"demibold",children:[T,"/",q]}),jsx(pe,{current:T,total:q,flexGrow:1})]})]}),h]})}})})}var Er=new Set(["required","min","max","minLength","maxLength","pattern"]);function Or({fieldComponent:e,control:o,fieldData:t}){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 i=Object.fromEntries(Object.entries(t).filter(([r])=>Er.has(r))),n=useController({name:t.id,control:o,rules:i});return jsx(e,{...n,fieldData:t})}function Co({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:i,parentProps:{dismissible:n},step:r}){var f;let{control:a,handleSubmit:s}=useForm({delayError:2e3,mode:"onChange"}),d=[];function m(h,T){t(T,h);}function u(h,T){i(T,h);}return (f=r.fields)==null||f.forEach(h=>{e[h.type]!=null&&d.push(jsx(Or,{control:a,fieldComponent:e[h.type],fieldData:h},h.id));}),jsxs(x.Column,{gap:5,part:"form-step",children:[jsxs(x.Row,{alignItems:"center",flexWrap:"wrap",gap:1,justifyContent:"space-between",part:"form-step-header",children:[jsx(c.Title,{children:r.title}),n&&jsx(c.Dismiss,{onClick:o}),jsx(c.Subtitle,{flexBasis:"100%",children:r.subtitle})]}),d,jsxs(x.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[r.secondaryButtonTitle&&jsx(b.Secondary,{title:r.secondaryButtonTitle,onClick:s(u)}),jsx(b.Primary,{title:r.primaryButtonTitle??"Submit",onClick:s(m)})]},"form-footer")]})}function So({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(g.Caption,{color:"red500",display:"block",part:"field-error",textAlign:"end",children:e==null?void 0:e.message}):null}function Fo({children:e,id:o,required:t=!1}){return jsxs(g.H4,{as:"label",htmlFor:o,part:"field-label",children:[e,t&&" *"]})}var re={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function $({children:e,field:o,fieldData:t,fieldState:i}){let{id:n,label:r,placeholder:a}=t,{error:s}=i,d={id:n,...o,...a?{placeholder:a}:{},...re,"aria-invalid":!!s,value:o.value??""};return jsxs(l,{part:"field",children:[jsx(Fo,{id:n,required:!!t.required,children:r}),e(d),jsx(So,{error:s})]})}var Wr=()=>jsx(l,{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"})}),Ar=be.forwardRef(({label:e,value:o},t)=>jsxs(l,{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(g.Body2,{part:"field-radio-label",children:e}),jsx(Q.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(l,{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(l,{as:Q.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(Wr,{})})})})]}));function Bo(e){let{field:{onChange:o,value:t},fieldData:{options:i=[]}}=e,n=i.map(({label:r,value:a})=>jsx(Ar,{value:a,label:r},a));return jsx($,{...e,children:()=>jsx(Q.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(x.Column,{gap:2,part:"field-radio-group",children:n})})})}var $r=be.forwardRef(({label:e,value:o},t)=>jsx(C.Item,{value:o,ref:t,asChild:!0,children:jsx(l,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(C.ItemText,{asChild:!0,children:jsx(g.Body2,{part:"field-select-option-label",children:e})})})}));function Do(e){let{field:{onChange:o,value:t},fieldData:{options:i=[],placeholder:n}}=e,r=i.map(({label:a,value:s})=>jsx($r,{value:s,label:a},s));return jsx($,{...e,children:()=>jsxs(C.Root,{value:t,onValueChange:o,children:[jsx(C.Trigger,{asChild:!0,children:jsxs(g.Body2,{...re,alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(C.Value,{placeholder:n??"Select one"}),jsx(C.Icon,{children:jsx(l,{as:ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]})}),jsx(C.Portal,{children:jsx(C.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(l,{...re,p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",children:jsx(C.Viewport,{children:r})})})})]})})}function Oo(e){return jsx($,{...e,children:o=>jsx(g.Body2,{as:"input",part:"field-text",type:"text",...o})})}function Mo(e){return jsx($,{...e,children:o=>jsx(g.Body2,{as:"textarea",part:"field-textarea",...o})})}var _r={radio:Bo,select:Do,text:Oo,textarea:Mo};function zr({fieldTypes:e={},flowId:o,...t}){let i=Object.assign({},_r,e);return jsx(O,{flowId:o,part:"form",...t,children:n=>jsx(Co,{fieldTypes:i,...n})})}function de(){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),[i,n]=useState(null),r=useCallback(a=>{n(a);},[]);return useLayoutEffect(()=>{if(!i)return;let a=()=>{let s=i.getBoundingClientRect();t(s);};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[i]),{node:i,rect:o,ref:r}}var Ur=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Lo({style:e={},part:o="",...t}){return jsxs(l,{part:`dot-wrapper ${o}`,style:{height:"48px",position:"absolute",width:"48px",...e},...t,children:[jsx(l,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Ur}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(l,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function Vo({props:e,alignAttr:o,sideAttr:t}){let i=t??"bottom",n={},r=()=>{if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return e.align??"after"},a="-24px",s={top:"bottom",right:"left",bottom:"top",left:"right"};n[s[i]]=a;let d=r();return ["before","end"].includes(d)?["top","bottom"].includes(i)?n.right=a:n.bottom=a:["after","start"].includes(d)?["top","bottom"].includes(i)?n.left=a:n.top=a:["top","bottom"].includes(i)?n.left=`calc(50% + ${a})`:n.top=`calc(50% + ${a})`,n}var ce={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function $o(e,o){let t=Object.fromEntries(ce.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),i=Object.fromEntries(ce.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!ce.content.includes(r)&&!ce.root.includes(r)&&(n[r]=e[r]);if(t.align=t.align??"after",t.side=t.side??"bottom",["before","after"].includes(t.align)){let r={after:"end",before:"start"},a=(h,T)=>["top","bottom"].includes(T)?h=="after"?"marginLeft":"marginRight":h=="after"?"marginTop":"marginBottom",s=t.alignOffset??0,d=t.style??{},m=t.side??"bottom",u=t.align;t.style={...d,[a(u,m)]:s};let f=["top","bottom"].includes(m)?o.width:o.height;t.alignOffset=(f+s)*-1,t.align=r[u];}return {contentProps:t,otherProps:n,rootProps:i}}function S({anchor:e,children:o,className:t,spotlight:i=!1,style:n,...r}){let{node:a,rect:s,ref:d}=de(),{node:m,rect:u,ref:f}=de(),{contentProps:h,otherProps:T,rootProps:q}=$o(r,s),[_,Z]=useState(h.align),[ne,De]=useState(h.side),[jo,No]=useState(0),[Ko,Uo]=useState(0);if(a!==null){let A=a.getAttribute("data-align"),ie=a.getAttribute("data-side");_!==A&&Z(A),ne!==ie&&De(ie);}let Ee=useRef(null);if(useEffect(()=>{let A=document.querySelector(e);A!=null?(f(A),Ee.current=A):console.debug(`No anchor found for query: ${e}`);},[e]),useEffect(()=>{let{scrollX:A,scrollY:ie}=window;No(u.left+A),Uo(u.top+ie);},[u.left,u.top]),m==null)return null;let Oe="0";typeof window<"u"&&(Oe=window.getComputedStyle(m).borderRadius);let Go=Vo({props:r,alignAttr:_,sideAttr:ne});return jsxs(I.Root,{defaultOpen:!0,...q,children:[jsx(I.Anchor,{virtualRef:Ee}),jsx(I.Portal,{children:jsxs(Fragment,{children:[i&&jsx(l,{part:"tooltip-spotlight",position:"absolute",style:{borderRadius:Oe,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",height:u.height,left:jo,top:Ko,width:u.width}}),jsx(I.Content,{asChild:!0,...h,ref:d,children:jsxs(c,{boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:n,...T,children:[jsx(Lo,{style:Go}),o]})})]})})]})}S.Close=e=>jsx(I.Close,{"aria-label":"Close",asChild:!0,children:jsx(b.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})})});S.Media=({src:e,...o})=>e==null?null:jsx(U,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e,...o});S.Primary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Primary,{title:o,onClick:e,...t});S.Progress=({children:e,...o})=>e==null?null:jsx(g.H4,{part:"progress",...o,children:e});S.Secondary=({onClick:e,title:o,...t})=>o==null?null:jsx(b.Secondary,{title:o,onClick:e,...t});S.Subtitle=({children:e,...o})=>e==null?null:jsx(g.Body2,{part:"subtitle",...o,children:e});S.Title=({children:e,...o})=>e==null?null:jsx(g.H4,{part:"title",...o,children:e});function zo({dismissible:e=!0,flow:o,onDismiss:t,onPrimary:i,onSecondary:n,step:r,...a}){let{handleDismiss:s}=j(o,{onDismiss:t}),{handlePrimary:d,handleSecondary:m}=N(r,{onPrimary:i,onSecondary:n});return jsxs(S,{anchor:r.selector,onOpenAutoFocus:u=>u.preventDefault(),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),...a,children:[e&&jsx(S.Close,{onClick:s}),jsx(S.Media,{src:r.videoUri??r.imageUri,type:r.videoUri?"video":"image"}),jsxs(x.Column,{gap:1,part:"tooltip-header",children:[jsx(S.Title,{children:r.title}),jsx(S.Subtitle,{color:"gray500",children:r.subtitle})]}),jsxs(x.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[jsx(S.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getNumberOfCompletedSteps()+1}/${o.getNumberOfAvailableSteps()}`}),jsx(S.Secondary,{title:r.secondaryButtonTitle,onClick:m}),jsx(S.Primary,{title:r.primaryButtonTitle,onClick:d})]})]},r.id)}function Qr({flowId:e,onComplete:o,variables:t,...i}){let{flow:n}=oe(e,{variables:t});j(n,{onComplete:o});let{isCurrentModal:r,removeModal:a}=te(n);if(useEffect(()=>{!(n!=null&&n.isVisible)&&r&&a();},[n==null?void 0:n.isVisible,r]),n==null||n.isVisible===!1||!r)return null;n.start();let s=n.getCurrentStep();return s==null||s.start(),jsx(zo,{step:s,flow:n,...i})}function on(){let{frigade:e}=useContext(v);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function rn(){let{userId:e,frigade:o}=useContext(v);async function t(n){await o.identify(e,n);}async function i(n,r){await o.track(n,r);}return {userId:e,addProperties:t,track:i}}function sn(){let{groupId:e,frigade:o}=useContext(v);async function t(n){if(!e){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}await o.group(e,n);}async function i(n,r){await o.track(n,r);}return {groupId:e,addProperties:t,track:i}}
40
39
 
41
- export { ir as Announcement, sr as Banner, p as Box, b as Button, c as Card, dt as Checklist, g as Flex, Dr as Form, $o as Provider, f as Text, S as Tooltip, $r as Tour, ue as themeVariables, le as useBoundingClientRect, Z as useFlow, _ as useFlowHandlers, jr as useFrigade, Gr as useGroup, te as useModal, ee as useStepHandlers, Nr as useUser };
40
+ export { fr as Announcement, xr as Banner, l as Box, b as Button, c as Card, Po as Checklist, x as Flex, zr as Form, Re as Progress, Xt as Provider, g as Text, S as Tooltip, Qr as Tour, ge as themeVariables, de as useBoundingClientRect, oe as useFlow, j as useFlowHandlers, on as useFrigade, sn as useGroup, te as useModal, N as useStepHandlers, rn as useUser };
42
41
  //# sourceMappingURL=out.js.map
43
42
  //# sourceMappingURL=index.js.map