@frigade/react 2.9.6 → 2.9.7-canary.1

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
@@ -5,33 +5,34 @@ import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
5
5
  import * as jo from 'react';
6
6
  import { createContext, useContext, useMemo, useCallback, useState, useEffect, useLayoutEffect, useRef, Fragment as Fragment$1 } from 'react';
7
7
  import { clsx } from 'clsx';
8
- import Mn from 'known-css-properties';
9
- import jn from 'dompurify';
8
+ import Ln from 'known-css-properties';
9
+ import Xn from 'dompurify';
10
10
  import { FlowType, Frigade } from '@frigade/js';
11
11
  import * as js from '@frigade/js';
12
12
  export { js as FrigadeJS };
13
- import Li from 'embla-carousel-react';
13
+ import Wi from 'embla-carousel-react';
14
14
  import * as Ve from '@radix-ui/react-collapsible';
15
- import { useFloating, autoUpdate, useFloatingNodeId, FloatingNode, FloatingTree, offset, flip, shift, useClick, useDismiss, useFocus, useRole, useTransitionStatus, useInteractions } from '@floating-ui/react';
15
+ import { useFloating, autoUpdate, offset, flip, shift, useClick, useDismiss, useFocus, useRole, useTransitionStatus, useInteractions, useFloatingNodeId, FloatingNode, FloatingTree } from '@floating-ui/react';
16
16
  import * as react from '@floating-ui/react';
17
17
  export { react as FloatingUI };
18
18
  import { RemoveScroll } from 'react-remove-scroll';
19
+ import ot from 'sizzle';
19
20
  import { useForm, FormProvider, useFormContext, useController } from 'react-hook-form';
20
21
  import * as _e from '@radix-ui/react-radio-group';
21
22
  import * as _ from '@radix-ui/react-select';
22
23
  import * as Ro from '@radix-ui/react-checkbox';
23
24
  import { createPortal } from 'react-dom';
24
- import * as sn from 'use-sync-external-store/shim/index.js';
25
+ import * as ln from 'use-sync-external-store/shim/index.js';
25
26
  import * as me from '@radix-ui/react-popover';
26
27
 
27
- var It=Object.defineProperty,En=Object.defineProperties;var In=Object.getOwnPropertyDescriptors;var ao=Object.getOwnPropertySymbols;var Dt=Object.prototype.hasOwnProperty,Ht=Object.prototype.propertyIsEnumerable;var Et=(e,o,t)=>o in e?It(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))Dt.call(o,t)&&Et(e,t,o[t]);if(ao)for(var t of ao(o))Ht.call(o,t)&&Et(e,t,o[t]);return e},p=(e,o)=>En(e,In(o));var Dn=(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 g=(e,o)=>{var t={};for(var r in e)Dt.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&ao)for(var r of ao(e))o.indexOf(r)<0&&Ht.call(e,r)&&(t[r]=e[r]);return t};var ue=(e,o)=>{for(var t in o)It(e,t,{get:o[t],enumerable:!0});};var V=(e,o,t)=>new Promise((r,n)=>{var a=d=>{try{l(t.next(d));}catch(u){n(u);}},s=d=>{try{l(t.throw(d));}catch(u){n(u);}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(a,s);l((t=t.apply(e,o)).next());});function Ie(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}))}var $t={borderWidths:{md:"1px"}};var so=[5,10,20,35,50,65,80,95,98],At=[...so],No=[...so];At[4]=40;No[4]=60;var Hn={blue:{h:213,s:100,l:so},gray:{h:220,s:10,l:so},green:{h:141,s:90,l:At},red:{h:9,s:90,l:No},yellow:{h:50,s:90,l:No}};var L={};for(let[e,{h:o,s:t,l:r}]of Object.entries(Hn))L[e]=Object.fromEntries(r.map((n,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Mt=p(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},L),{gray100:L.gray[100],gray200:L.gray[200],gray300:L.gray[300],gray400:L.gray[400],gray500:L.gray[500],gray600:L.gray[600],gray700:L.gray[700],gray800:L.gray[800],gray900:L.gray[900],blue400:L.blue[400],blue500:L.blue[500],blue800:L.blue[800],blue900:L.blue[900],green400:L.green[400],green500:L.green[500],green800:L.green[800],red500:L.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Lt={md:"8px",lg:"20px",round:"50%"};var m=e=>`var(--fr-colors-${e})`,Wt={negative:{100:m("red-100"),200:m("red-200"),300:m("red-300"),400:m("red-400"),500:m("red-500"),600:m("red-600"),700:m("red-700"),800:m("red-800"),900:m("red-900"),background:m("negative-500"),border:m("negative-500"),foreground:m("white"),surface:m("negative-500"),active:{background:m("negative-400"),border:m("negative-400"),foreground:m("white"),surface:m("negative-400")},focus:{background:m("negative-500"),border:m("negative-500"),foreground:m("white"),surface:m("negative-500")},hover:{background:m("negative-400"),border:m("negative-400"),foreground:m("white"),surface:m("negative-400")}},neutral:{100:m("gray-100"),200:m("gray-200"),300:m("gray-300"),400:m("gray-400"),500:m("gray-500"),600:m("gray-600"),700:m("gray-700"),800:m("gray-800"),900:m("gray-900"),background:m("white"),border:m("neutral-800"),foreground:m("black"),surface:m("neutral-700"),active:{background:m("white"),border:m("neutral-900"),foreground:m("black"),surface:m("neutral-700")},focus:{background:m("white"),border:m("neutral-900"),foreground:m("black"),surface:m("neutral-700")},hover:{background:m("neutral-900"),border:m("neutral-800"),foreground:m("black"),surface:m("neutral-700")}},positive:{100:m("green-100"),200:m("green-200"),300:m("green-300"),400:m("green-400"),500:m("green-500"),600:m("green-600"),700:m("green-700"),800:m("green-800"),900:m("green-900"),background:m("positive-500"),border:m("positive-500"),foreground:m("white"),surface:m("positive-500"),active:{background:m("positive-400"),border:m("positive-400"),foreground:m("white"),surface:m("positive-400")},focus:{background:m("positive-500"),border:m("positive-500"),foreground:m("white"),surface:m("positive-500")},hover:{background:m("positive-400"),border:m("positive-400"),foreground:m("white"),surface:m("positive-400")}},primary:{100:m("blue-100"),200:m("blue-200"),300:m("blue-300"),400:m("blue-400"),500:m("blue-500"),600:m("blue-600"),700:m("blue-700"),800:m("blue-800"),900:m("blue-900"),background:m("primary-500"),border:m("primary-500"),foreground:m("white"),surface:m("primary-500"),active:{background:m("primary-300"),border:m("primary-300"),foreground:m("white"),surface:m("primary-300")},focus:{background:m("primary-500"),border:m("primary-500"),foreground:m("white"),surface:m("primary-500")},hover:{background:m("primary-400"),border:m("primary-400"),foreground:m("white"),surface:m("primary-400")}},secondary:{100:m("gray-100"),200:m("gray-200"),300:m("gray-300"),400:m("gray-400"),500:m("gray-500"),600:m("gray-600"),700:m("gray-700"),800:m("gray-800"),900:m("gray-900"),background:m("white"),border:m("secondary-800"),foreground:m("black"),surface:m("secondary-900"),active:{background:m("secondary-900"),border:m("secondary-800"),foreground:m("black"),surface:m("secondary-800")},focus:{background:m("secondary-900"),border:m("secondary-800"),foreground:m("black"),surface:m("secondary-900")},hover:{background:m("secondary-900"),border:m("secondary-800"),foreground:m("black"),surface:m("secondary-800")}}};var Nt={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Vn="px",$n=e=>typeof e=="number"?`${4*e}${Vn}`:e,An=[-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"],_t=Object.fromEntries(An.map(e=>[e,$n(e)]));var Ut={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 lo=p(i(p(i({},$t),{colors:i(i({},Mt),Wt)}),Ut),{radii:Lt,shadows:Nt,space:_t});function Ke(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,Ke(l,s,t)):r[s]=l,r},{})}function _o(e){let o=Ke(e,"--fr","-");for(let[t,r]of Object.entries(o))if(t.indexOf(".")>-1){let n=t.replace(/\./g,"-");o[n]=r,delete o[t];}return o}function zt(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],a=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=zt(n,`${o}-${r}`):t[r]=`var(${o}-${a})`;}),t}var Uo=_o(lo),I=zt(lo);var Ln=new Set(["alt","size","src"]),Wn=Mn.all.filter(e=>e.indexOf("-")!=0&&!Ln.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Nn=Object.fromEntries(Wn),po=Ke(I.colors),_n={color:po,backgroundColor:po,borderColor:po,border:i(i({},I.borderWidths),po),borderRadius:I.radii,borderWidth:I.borderWidths,boxShadow:I.shadows,fontFamily:I.fontFamilies,fontSize:I.fontSizes,fontWeight:I.fontWeights,gap:I.space,lineHeight:I.lineHeights,margin:I.space,marginBottom:I.space,marginLeft:I.space,marginRight:I.space,marginTop:I.space,padding:I.space,paddingBottom:I.space,paddingLeft:I.space,paddingRight:I.space,paddingTop:I.space},Gt=i(i({},Nn),_n),Kt={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"]},jt=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Un(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 Xt=new Map(Object.entries(Gt).map(([e,o])=>[e,Un(o)])),zn=new Map(Object.entries(Kt).map(([e,o])=>[e,new Set(o)])),Gn=new Set(["height","width"]),Kn=new Set(["canvas","embed","iframe","img","input","object","video"]);function Jt(e){let[o,t]=e.split(":");return [o,jt.has(t)?t:null]}function qt(e,o="div"){let t=Object.assign({},e),r={};function n(a){if(a==null)return r;let l=`&:${a.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return r[l]==null&&(r[l]={}),r[l]}return Object.entries(t).forEach(([a,s])=>{let[l,d]=Jt(a),u=zn.get(l);u!=null&&(u.forEach(c=>{let f=`${c}${d?":"+d:""}`;t[f]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[l,d]=Jt(a),u=Xt.get(l);if(u!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let c=s.split(" ");n(d)[l]=c.map(f=>{var y;return (y=u.get(f.toString()))!=null?y:f}).join(" ");}else u.has(s.toString())?n(d)[l]=u.get(s.toString()):n(d)[l]=s;(typeof o!="string"||!Kn.has(o)||!Gn.has(l))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&Xt.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:r,unmatchedProps:t}}function Xn(){if(typeof window=="undefined"){let{JSDOM:e}=Dn("jsdom");return new e("<!DOCTYPE html>").window}return window}function Zt(e){return e?{__html:jn(Xn()).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","style"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function qn(e){return e&&`fr-${e}`}function er(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>er(o)).join(" "):qn(e))}function Zn(l,s){var d=l,{as:e,children:o,className:t,css:r={},part:n}=d,a=g(d,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:c,unmatchedProps:f}=qt(a,u),y=er(n),C=t||y?clsx(t,y):void 0,v=[{boxSizing:"border-box"},c,r];return typeof o=="string"?jsx(u,p(i({className:C,css:v},f),{ref:s,dangerouslySetInnerHTML:Zt(o)})):jsx(u,p(i({className:C,css:v},f),{ref:s,children:o}))}var x=jo.forwardRef(Zn);var D={};ue(D,{Link:()=>Ri,Plain:()=>Ti,Primary:()=>wi,Secondary:()=>Fi});var F={};ue(F,{Body1:()=>fi,Body2:()=>gi,Caption:()=>yi,Display1:()=>li,Display2:()=>pi,H1:()=>di,H2:()=>ci,H3:()=>ui,H4:()=>mi});var zo={};ue(zo,{Body1:()=>ni,Body2:()=>ii,Caption:()=>ai,Display1:()=>Yn,Display2:()=>Qn,H1:()=>ei,H2:()=>oi,H3:()=>ti,H4:()=>ri});var fe={color:"neutral.foreground",fontFamily:"default",margin:"0"},Yn=p(i({},fe),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Qn=p(i({},fe),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),ei=p(i({},fe),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),oi=p(i({},fe),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),ti=p(i({},fe),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),ri=p(i({},fe),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),ni=p(i({},fe),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),ii=p(i({},fe),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),ai=p(i({},fe),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var si=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],ge=Object.fromEntries(si.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=jo.forwardRef((l,s)=>{var d=l,{as:r=o,children:n}=d,a=g(d,["as","children"]);return jsx(x,p(i(i({as:r},zo[e]),a),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),li=ge.Display1,pi=ge.Display2,di=ge.H1,ci=ge.H2,ui=ge.H3,mi=ge.H4,fi=ge.Body1,gi=ge.Body2,yi=ge.Caption;var Ko={};ue(Ko,{Link:()=>Ci,Plain:()=>Si,Primary:()=>bi,Secondary:()=>Pi,loadingCSSStyle:()=>Go});var co={alignItems:"center",borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit","opacity:disabled":"0.6","pointerEvents:disabled":"none"},bi=p(i({},co),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:active":"primary.active.surface","backgroundColor:disabled":"primary.surface"}),Pi=p(i({},co),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:active":"secondary.active.surface","backgroundColor:disabled":"secondary.background"}),Ci=p(i({},co),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface","color:active":"primary.active.surface"}),Si=p(i({},co),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),vi=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),Go={position:"relative",color:"transparent","&:after":{content:'""',position:"absolute",width:"16px",height:"16px",top:0,left:0,right:0,bottom:0,margin:"auto",border:"4px solid transparent",borderTopColor:"var(--fr-colors-primary-foreground)",borderRadius:"50%",animation:vi+" 1s ease infinite"}};function uo(s){var l=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=l,a=g(l,["as","children","part","title","variant"]);var u;let d=n.toLocaleLowerCase();return jsxs(x,p(i(p(i({as:e!=null?e:"button",part:[`button-${d}`,t]},Ko[n]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?Go:{})}),a),{loading:void 0,children:[o,r&&jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function wi(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(uo,p(i({},o),{variant:"Primary",children:e}))}function Fi(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(uo,p(i({},o),{variant:"Secondary",children:e}))}function Ri(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(uo,p(i({},o),{variant:"Link",children:e}))}function Ti(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(uo,p(i({},o),{variant:"Plain",children:e}))}var R={};ue(R,{Column:()=>Oi,Row:()=>Bi});var Bi=jo.forwardRef((e,o)=>jsx(x,p(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Oi=jo.forwardRef((e,o)=>jsx(x,p(i({display:"flex",flexDirection:"column"},e),{ref:o})));function Xo(t){var r=t,{flowId:e}=r,o=g(r,["flowId"]);return jsx(W,p(i({as:null,flowId:e},o),{children:({handleDismiss:n,handlePrimary:a,handleSecondary:s,parentProps:{containerProps:l,dismissible:d},step:u})=>{var C,v,h,b;let c=(v=(C=u.primaryButton)==null?void 0:C.title)!=null?v:u.primaryButtonTitle,f=(b=(h=u.secondaryButton)==null?void 0:h.title)!=null?b:u.secondaryButtonTitle,y=u.$state.blocked;return jsxs(P,p(i({alignItems:"center","aria-label":"Banner",borderWidth:"md","data-step-id":u.id,display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:"banner",role:"complementary"},l),{children:[u.imageUri&&jsx(x,{as:"img",part:"image",src:u.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(R.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(P.Title,{part:"title",children:u.title}),jsx(P.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsx(P.Secondary,{disabled:y,title:f,onClick:s}),jsx(P.Primary,{disabled:y,title:c,onClick:a}),d&&jsx(P.Dismiss,{onClick:n})]}))}}))}var vo={};ue(vo,{Carousel:()=>br,Collapsible:()=>xo,CollapsibleStep:()=>Je,Floating:()=>Vr});var be={};ue(be,{Bar:()=>he,Dots:()=>ar,Fraction:()=>De,Ring:()=>mo,Segments:()=>fo});function he(r){var n=r,{current:e,total:o}=n,t=g(n,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsx(x,p(i({"aria-description":"Progress represented as a bar","aria-label":"Progress Bar","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,backgroundColor:"neutral.800",borderRadius:"md",height:"10px",part:"progress-bar",role:"meter"},t),{children:jsx(x,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function ar(r){var n=r,{current:e,total:o}=n,t=g(n,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,l)=>jsx(x,{as:"circle",cx:4+16*l,cy:"4px",fill:e-1===l?I.colors.blue500:I.colors.blue800,part:["progress-dot",e-1===l?"progress-dot-filled":null],r:4},l));return jsx(x,p(i({"aria-description":"Progress represented as dots","aria-label":"Progress Dots","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,as:"svg",height:"8px",part:"progress-dots",role:"meter",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function De(r){var n=r,{current:e,total:o}=n,t=g(n,["current","total"]);return jsx(F.Body2,p(i({"aria-description":"Progress represented as a fraction of a total","aria-label":"Progress Fraction","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,part:"progress-fraction",role:"meter"},t),{children:`${e}/${o}`}))}function mo(d){var u=d,{css:e,current:o,height:t="48px",showLabel:r=!1,strokeWidth:n="8px",total:a,width:s="48px"}=u,l=g(u,["css","current","height","showLabel","strokeWidth","total","width"]);if(a==1)return null;let c=a>0?Math.min(Math.round(o/a*100)/100,1):0;return jsxs(x,p(i({"aria-description":"Progress represented as a ring","aria-label":"Progress Ring","aria-valuemin":"0","aria-valuemax":a,"aria-valuenow":o,as:"svg",css:i({"--progress-percent":c,"--radius":`calc((min(${t}, ${s}) - ${n}) / 2)`,"--circumference":"calc(var(--radius) * pi * 2)","--dash-length":"calc(var(--circumference) * var(--progress-percent))","--gap-length":"calc(var(--circumference) - var(--dash-length))"},e),height:t,part:"progress-ring",position:"relative",role:"meter",width:s},l),{children:[jsx(x,{as:"circle",cx:"50%",cy:"50%",fill:"transparent",part:"progress-ring-track",r:"var(--radius)",stroke:I.colors.primary[800],strokeWidth:n}),jsx(x,{as:"circle",cx:"50%",cy:"50%",fill:"transparent",part:"progress-ring-filled",r:"var(--radius)",stroke:I.colors.primary.surface,strokeWidth:n,style:{strokeDasharray:"var(--dash-length) var(--gap-length)"},transform:"rotate(-90deg)",transformOrigin:"50% 50%",transition:"stroke-dasharray 0.2s ease-out"}),r&&jsx(F.Caption,{as:"text",dominantBaseline:"middle",fontWeight:"medium",textAnchor:"middle",_x:"50%",_y:"52%",children:c*100})]}))}function fo(r){var n=r,{current:e,total:o}=n,t=g(n,["current","total"]);let a=[...Array(o)].map((s,l)=>jsx(x,{backgroundColor:e-1>=l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%",minWidth:"10px",part:["progress-segment",e-1===l?"progress-segment-filled":null]},l));return jsx(R.Row,p(i({"aria-description":"Progress represented as a segmented bar","aria-label":"Progress Segments","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,gap:1,height:"10px",part:"progress-segments",role:"meter"},t),{children:a}))}function pr(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}))}function Di(){return jsx(x,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function go(r){var n=r,{checked:e=!1,size:o="22px"}=n,t=g(n,["checked","size"]);return jsx(x,p(i({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:o,width:o},t),{children:e&&jsx(x,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Di,{})})}))}function ae(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(A),n=useMemo(()=>e==null?{}:{"flow.back":a=>e.flow.back(a),"flow.complete":a=>e.flow.complete(a),"flow.forward":a=>e.flow.forward(a),"flow.restart":()=>e.flow.restart(),"flow.skip":a=>e.flow.skip(a),"flow.start":a=>e.flow.start(a),"step.complete":(a,s)=>e.complete(a,s),"step.skip":(a,s)=>e.skip(a,s),"step.reset":()=>e.reset(),"step.start":a=>e.start(a)},[e]);return {handlePrimary:useCallback((a,s,l=!0)=>V(this,null,function*(){if((yield o==null?void 0:o(e,a,s))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof u=="function"?yield u(s,l):u!==!1&&(yield e.complete(s,l)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,l),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[r,o,e,n]),handleSecondary:useCallback((a,s)=>V(this,null,function*(){if((yield t==null?void 0:t(e,a,s))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let d=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof d=="function"?d():d!==!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}),[r,t,e,n])}}function cr({onPrimary:e,onSecondary:o,step:t}){var u,c;let{handlePrimary:r,handleSecondary:n}=ae(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:s,skipped:l}=t.$state,d=s||l||!a?jsx(go,{checked:s||l,marginLeft:"auto"}):jsx(x,{as:pr,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(P,{borderWidth:1,containerType:"inline-size",css:{"@container (max-width: 600px)":{flexBasis:"85%"},"@container (min-width: 601px) and (max-width: 900px)":{flexBasis:"45%"},"@container (min-width: 1200px)":{flexBasis:"25%"}},"data-step-id":t.id,flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:a,opacity:a?.5:1,children:[jsxs(R.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(P.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),d]}),jsx(P.Title,{children:t.title}),jsx(P.Subtitle,{children:t.subtitle}),jsxs(R.Row,{css:{"@container (max-width: 200px)":{"& > button":{flexBasis:"50%",flexGrow:1},flexDirection:"column-reverse"}},gap:"2",marginTop:"auto",paddingTop:"3",part:"carousel-step-footer",children:[jsx(P.Secondary,{disabled:a,onClick:n,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(P.Primary,{disabled:a,onClick:r,title:(c=t.primaryButton)==null?void 0:c.title})]})]})}function mr(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z",clipRule:"evenodd"})}))}function gr(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 0 1-.75.75H5.612l4.158 3.96a.75.75 0 1 1-1.04 1.08l-5.5-5.25a.75.75 0 0 1 0-1.08l5.5-5.25a.75.75 0 1 1 1.04 1.08L5.612 9.25H16.25A.75.75 0 0 1 17 10Z",clipRule:"evenodd"})}))}var yr=keyframes`
28
+ var Dt=Object.defineProperty,In=Object.defineProperties;var Dn=Object.getOwnPropertyDescriptors;var so=Object.getOwnPropertySymbols;var Ht=Object.prototype.hasOwnProperty,Vt=Object.prototype.propertyIsEnumerable;var It=(e,o,t)=>o in e?Dt(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))Ht.call(o,t)&&It(e,t,o[t]);if(so)for(var t of so(o))Vt.call(o,t)&&It(e,t,o[t]);return e},p=(e,o)=>In(e,Dn(o));var Hn=(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 g=(e,o)=>{var t={};for(var r in e)Ht.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&so)for(var r of so(e))o.indexOf(r)<0&&Vt.call(e,r)&&(t[r]=e[r]);return t};var ue=(e,o)=>{for(var t in o)Dt(e,t,{get:o[t],enumerable:!0});};var V=(e,o,t)=>new Promise((r,n)=>{var a=d=>{try{l(t.next(d));}catch(u){n(u);}},s=d=>{try{l(t.throw(d));}catch(u){n(u);}},l=d=>d.done?r(d.value):Promise.resolve(d.value).then(a,s);l((t=t.apply(e,o)).next());});function Ie(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}))}var At={borderWidths:{md:"1px"}};var lo=[5,10,20,35,50,65,80,95,98],Mt=[...lo],No=[...lo];Mt[4]=40;No[4]=60;var Vn={blue:{h:213,s:100,l:lo},gray:{h:220,s:10,l:lo},green:{h:141,s:90,l:Mt},red:{h:9,s:90,l:No},yellow:{h:50,s:90,l:No}};var L={};for(let[e,{h:o,s:t,l:r}]of Object.entries(Vn))L[e]=Object.fromEntries(r.map((n,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Lt=p(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},L),{gray100:L.gray[100],gray200:L.gray[200],gray300:L.gray[300],gray400:L.gray[400],gray500:L.gray[500],gray600:L.gray[600],gray700:L.gray[700],gray800:L.gray[800],gray900:L.gray[900],blue400:L.blue[400],blue500:L.blue[500],blue800:L.blue[800],blue900:L.blue[900],green400:L.green[400],green500:L.green[500],green800:L.green[800],red500:L.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Wt={md:"8px",lg:"20px",round:"50%"};var m=e=>`var(--fr-colors-${e})`,Nt={negative:{100:m("red-100"),200:m("red-200"),300:m("red-300"),400:m("red-400"),500:m("red-500"),600:m("red-600"),700:m("red-700"),800:m("red-800"),900:m("red-900"),background:m("negative-500"),border:m("negative-500"),foreground:m("white"),surface:m("negative-500"),active:{background:m("negative-400"),border:m("negative-400"),foreground:m("white"),surface:m("negative-400")},focus:{background:m("negative-500"),border:m("negative-500"),foreground:m("white"),surface:m("negative-500")},hover:{background:m("negative-400"),border:m("negative-400"),foreground:m("white"),surface:m("negative-400")}},neutral:{100:m("gray-100"),200:m("gray-200"),300:m("gray-300"),400:m("gray-400"),500:m("gray-500"),600:m("gray-600"),700:m("gray-700"),800:m("gray-800"),900:m("gray-900"),background:m("white"),border:m("neutral-800"),foreground:m("black"),surface:m("neutral-700"),active:{background:m("white"),border:m("neutral-900"),foreground:m("black"),surface:m("neutral-700")},focus:{background:m("white"),border:m("neutral-900"),foreground:m("black"),surface:m("neutral-700")},hover:{background:m("neutral-900"),border:m("neutral-800"),foreground:m("black"),surface:m("neutral-700")}},positive:{100:m("green-100"),200:m("green-200"),300:m("green-300"),400:m("green-400"),500:m("green-500"),600:m("green-600"),700:m("green-700"),800:m("green-800"),900:m("green-900"),background:m("positive-500"),border:m("positive-500"),foreground:m("white"),surface:m("positive-500"),active:{background:m("positive-400"),border:m("positive-400"),foreground:m("white"),surface:m("positive-400")},focus:{background:m("positive-500"),border:m("positive-500"),foreground:m("white"),surface:m("positive-500")},hover:{background:m("positive-400"),border:m("positive-400"),foreground:m("white"),surface:m("positive-400")}},primary:{100:m("blue-100"),200:m("blue-200"),300:m("blue-300"),400:m("blue-400"),500:m("blue-500"),600:m("blue-600"),700:m("blue-700"),800:m("blue-800"),900:m("blue-900"),background:m("primary-500"),border:m("primary-500"),foreground:m("white"),surface:m("primary-500"),active:{background:m("primary-300"),border:m("primary-300"),foreground:m("white"),surface:m("primary-300")},focus:{background:m("primary-500"),border:m("primary-500"),foreground:m("white"),surface:m("primary-500")},hover:{background:m("primary-400"),border:m("primary-400"),foreground:m("white"),surface:m("primary-400")}},secondary:{100:m("gray-100"),200:m("gray-200"),300:m("gray-300"),400:m("gray-400"),500:m("gray-500"),600:m("gray-600"),700:m("gray-700"),800:m("gray-800"),900:m("gray-900"),background:m("white"),border:m("secondary-800"),foreground:m("black"),surface:m("secondary-900"),active:{background:m("secondary-900"),border:m("secondary-800"),foreground:m("black"),surface:m("secondary-800")},focus:{background:m("secondary-900"),border:m("secondary-800"),foreground:m("black"),surface:m("secondary-900")},hover:{background:m("secondary-900"),border:m("secondary-800"),foreground:m("black"),surface:m("secondary-800")}}};var _t={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var $n="px",An=e=>typeof e=="number"?`${4*e}${$n}`:e,Mn=[-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"],zt=Object.fromEntries(Mn.map(e=>[e,An(e)]));var Ut={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 po=p(i(p(i({},At),{colors:i(i({},Lt),Nt)}),Ut),{radii:Wt,shadows:_t,space:zt});function Ke(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,Ke(l,s,t)):r[s]=l,r},{})}function _o(e){let o=Ke(e,"--fr","-");for(let[t,r]of Object.entries(o))if(t.indexOf(".")>-1){let n=t.replace(/\./g,"-");o[n]=r,delete o[t];}return o}function Gt(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],a=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=Gt(n,`${o}-${r}`):t[r]=`var(${o}-${a})`;}),t}var zo=_o(po),I=Gt(po);var Wn=new Set(["alt","size","src"]),Nn=Ln.all.filter(e=>e.indexOf("-")!=0&&!Wn.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),_n=Object.fromEntries(Nn),co=Ke(I.colors),zn={color:co,backgroundColor:co,borderColor:co,border:i(i({},I.borderWidths),co),borderRadius:I.radii,borderWidth:I.borderWidths,boxShadow:I.shadows,fontFamily:I.fontFamilies,fontSize:I.fontSizes,fontWeight:I.fontWeights,gap:I.space,lineHeight:I.lineHeights,margin:I.space,marginBottom:I.space,marginLeft:I.space,marginRight:I.space,marginTop:I.space,padding:I.space,paddingBottom:I.space,paddingLeft:I.space,paddingRight:I.space,paddingTop:I.space},Kt=i(i({},_n),zn),jt={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"]},Xt=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Un(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 Jt=new Map(Object.entries(Kt).map(([e,o])=>[e,Un(o)])),Gn=new Map(Object.entries(jt).map(([e,o])=>[e,new Set(o)])),Kn=new Set(["height","width"]),jn=new Set(["canvas","embed","iframe","img","input","object","video"]);function qt(e){let[o,t]=e.split(":");return [o,Xt.has(t)?t:null]}function Zt(e,o="div"){let t=Object.assign({},e),r={};function n(a){if(a==null)return r;let l=`&:${a.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return r[l]==null&&(r[l]={}),r[l]}return Object.entries(t).forEach(([a,s])=>{let[l,d]=qt(a),u=Gn.get(l);u!=null&&(u.forEach(c=>{let f=`${c}${d?":"+d:""}`;t[f]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[l,d]=qt(a),u=Jt.get(l);if(u!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let c=s.split(" ");n(d)[l]=c.map(f=>{var y;return (y=u.get(f.toString()))!=null?y:f}).join(" ");}else u.has(s.toString())?n(d)[l]=u.get(s.toString()):n(d)[l]=s;(typeof o!="string"||!jn.has(o)||!Kn.has(l))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&Jt.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:r,unmatchedProps:t}}function Jn(){if(typeof window=="undefined"){let{JSDOM:e}=Hn("jsdom");return new e("<!DOCTYPE html>").window}return window}function Yt(e){return e?{__html:Xn(Jn()).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","style"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function Zn(e){return e&&`fr-${e}`}function or(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>or(o)).join(" "):Zn(e))}function Yn(l,s){var d=l,{as:e,children:o,className:t,css:r={},part:n}=d,a=g(d,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:c,unmatchedProps:f}=Zt(a,u),y=or(n),C=t||y?clsx(t,y):void 0,v=[{boxSizing:"border-box"},c,r];return typeof o=="string"?jsx(u,p(i({className:C,css:v},f),{ref:s,dangerouslySetInnerHTML:Yt(o)})):jsx(u,p(i({className:C,css:v},f),{ref:s,children:o}))}var x=jo.forwardRef(Yn);var D={};ue(D,{Link:()=>Ti,Plain:()=>ki,Primary:()=>Fi,Secondary:()=>Ri});var F={};ue(F,{Body1:()=>gi,Body2:()=>yi,Caption:()=>xi,Display1:()=>pi,Display2:()=>di,H1:()=>ci,H2:()=>ui,H3:()=>mi,H4:()=>fi});var Uo={};ue(Uo,{Body1:()=>ii,Body2:()=>ai,Caption:()=>si,Display1:()=>Qn,Display2:()=>ei,H1:()=>oi,H2:()=>ti,H3:()=>ri,H4:()=>ni});var fe={color:"neutral.foreground",fontFamily:"default",margin:"0"},Qn=p(i({},fe),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),ei=p(i({},fe),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),oi=p(i({},fe),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),ti=p(i({},fe),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),ri=p(i({},fe),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),ni=p(i({},fe),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),ii=p(i({},fe),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),ai=p(i({},fe),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),si=p(i({},fe),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var li=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],ge=Object.fromEntries(li.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=jo.forwardRef((l,s)=>{var d=l,{as:r=o,children:n}=d,a=g(d,["as","children"]);return jsx(x,p(i(i({as:r},Uo[e]),a),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),pi=ge.Display1,di=ge.Display2,ci=ge.H1,ui=ge.H2,mi=ge.H3,fi=ge.H4,gi=ge.Body1,yi=ge.Body2,xi=ge.Caption;var Ko={};ue(Ko,{Link:()=>Si,Plain:()=>vi,Primary:()=>Pi,Secondary:()=>Ci,loadingCSSStyle:()=>Go});var uo={alignItems:"center",borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit","opacity:disabled":"0.6","pointerEvents:disabled":"none"},Pi=p(i({},uo),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:active":"primary.active.surface","backgroundColor:disabled":"primary.surface"}),Ci=p(i({},uo),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:active":"secondary.active.surface","backgroundColor:disabled":"secondary.background"}),Si=p(i({},uo),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface","color:active":"primary.active.surface"}),vi=p(i({},uo),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),wi=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),Go={position:"relative",color:"transparent","&:after":{content:'""',position:"absolute",width:"16px",height:"16px",top:0,left:0,right:0,bottom:0,margin:"auto",border:"4px solid transparent",borderTopColor:"var(--fr-colors-primary-foreground)",borderRadius:"50%",animation:wi+" 1s ease infinite"}};function mo(s){var l=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=l,a=g(l,["as","children","part","title","variant"]);var u;let d=n.toLocaleLowerCase();return jsxs(x,p(i(p(i({as:e!=null?e:"button",part:[`button-${d}`,t]},Ko[n]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?Go:{})}),a),{loading:void 0,children:[o,r&&jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function Fi(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(mo,p(i({},o),{variant:"Primary",children:e}))}function Ri(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(mo,p(i({},o),{variant:"Secondary",children:e}))}function Ti(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(mo,p(i({},o),{variant:"Link",children:e}))}function ki(t){var r=t,{children:e}=r,o=g(r,["children"]);return jsx(mo,p(i({},o),{variant:"Plain",children:e}))}var R={};ue(R,{Column:()=>Ei,Row:()=>Oi});var Oi=jo.forwardRef((e,o)=>jsx(x,p(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Ei=jo.forwardRef((e,o)=>jsx(x,p(i({display:"flex",flexDirection:"column"},e),{ref:o})));function Xo(t){var r=t,{flowId:e}=r,o=g(r,["flowId"]);return jsx(W,p(i({as:null,flowId:e},o),{children:({handleDismiss:n,handlePrimary:a,handleSecondary:s,parentProps:{containerProps:l,dismissible:d},step:u})=>{var C,v,h,b;let c=(v=(C=u.primaryButton)==null?void 0:C.title)!=null?v:u.primaryButtonTitle,f=(b=(h=u.secondaryButton)==null?void 0:h.title)!=null?b:u.secondaryButtonTitle,y=u.$state.blocked;return jsxs(P,p(i({alignItems:"center","aria-label":"Banner",borderWidth:"md","data-step-id":u.id,display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:"banner",role:"complementary"},l),{children:[u.imageUri&&jsx(x,{as:"img",part:"image",src:u.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(R.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(P.Title,{part:"title",children:u.title}),jsx(P.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsx(P.Secondary,{disabled:y,title:f,onClick:s}),jsx(P.Primary,{disabled:y,title:c,onClick:a}),d&&jsx(P.Dismiss,{onClick:n})]}))}}))}var vo={};ue(vo,{Carousel:()=>Pr,Collapsible:()=>ho,CollapsibleStep:()=>Je,Floating:()=>$r});var be={};ue(be,{Bar:()=>he,Dots:()=>sr,Fraction:()=>De,Ring:()=>fo,Segments:()=>go});function he(r){var n=r,{current:e,total:o}=n,t=g(n,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsx(x,p(i({"aria-description":"Progress represented as a bar","aria-label":"Progress Bar","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,backgroundColor:"neutral.800",borderRadius:"md",height:"10px",part:"progress-bar",role:"meter"},t),{children:jsx(x,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function sr(r){var n=r,{current:e,total:o}=n,t=g(n,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,l)=>jsx(x,{as:"circle",cx:4+16*l,cy:"4px",fill:e-1===l?I.colors.blue500:I.colors.blue800,part:["progress-dot",e-1===l?"progress-dot-filled":null],r:4},l));return jsx(x,p(i({"aria-description":"Progress represented as dots","aria-label":"Progress Dots","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,as:"svg",height:"8px",part:"progress-dots",role:"meter",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function De(r){var n=r,{current:e,total:o}=n,t=g(n,["current","total"]);return jsx(F.Body2,p(i({"aria-description":"Progress represented as a fraction of a total","aria-label":"Progress Fraction","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,part:"progress-fraction",role:"meter"},t),{children:`${e}/${o}`}))}function fo(d){var u=d,{css:e,current:o,height:t="48px",showLabel:r=!1,strokeWidth:n="8px",total:a,width:s="48px"}=u,l=g(u,["css","current","height","showLabel","strokeWidth","total","width"]);if(a==1)return null;let c=a>0?Math.min(Math.round(o/a*100)/100,1):0;return jsxs(x,p(i({"aria-description":"Progress represented as a ring","aria-label":"Progress Ring","aria-valuemin":"0","aria-valuemax":a,"aria-valuenow":o,as:"svg",css:i({"--progress-percent":c,"--radius":`calc((min(${t}, ${s}) - ${n}) / 2)`,"--circumference":"calc(var(--radius) * pi * 2)","--dash-length":"calc(var(--circumference) * var(--progress-percent))","--gap-length":"calc(var(--circumference) - var(--dash-length))"},e),height:t,part:"progress-ring",position:"relative",role:"meter",width:s},l),{children:[jsx(x,{as:"circle",cx:"50%",cy:"50%",fill:"transparent",part:"progress-ring-track",r:"var(--radius)",stroke:I.colors.primary[800],strokeWidth:n}),jsx(x,{as:"circle",cx:"50%",cy:"50%",fill:"transparent",part:"progress-ring-filled",r:"var(--radius)",stroke:I.colors.primary.surface,strokeWidth:n,style:{strokeDasharray:"var(--dash-length) var(--gap-length)"},transform:"rotate(-90deg)",transformOrigin:"50% 50%",transition:"stroke-dasharray 0.2s ease-out"}),r&&jsx(F.Caption,{as:"text",dominantBaseline:"middle",fontWeight:"medium",textAnchor:"middle",_x:"50%",_y:"52%",children:c*100})]}))}function go(r){var n=r,{current:e,total:o}=n,t=g(n,["current","total"]);let a=[...Array(o)].map((s,l)=>jsx(x,{backgroundColor:e-1>=l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%",minWidth:"10px",part:["progress-segment",e-1===l?"progress-segment-filled":null]},l));return jsx(R.Row,p(i({"aria-description":"Progress represented as a segmented bar","aria-label":"Progress Segments","aria-valuemin":"0","aria-valuemax":o,"aria-valuenow":e,gap:1,height:"10px",part:"progress-segments",role:"meter"},t),{children:a}))}function dr(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}))}function Hi(){return jsx(x,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function yo(r){var n=r,{checked:e=!1,size:o="22px"}=n,t=g(n,["checked","size"]);return jsx(x,p(i({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:o,width:o},t),{children:e&&jsx(x,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Hi,{})})}))}function ae(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(A),n=useMemo(()=>e==null?{}:{"flow.back":a=>e.flow.back(a),"flow.complete":a=>e.flow.complete(a),"flow.forward":a=>e.flow.forward(a),"flow.restart":()=>e.flow.restart(),"flow.skip":a=>e.flow.skip(a),"flow.start":a=>e.flow.start(a),"step.complete":(a,s)=>e.complete(a,s),"step.skip":(a,s)=>e.skip(a,s),"step.reset":()=>e.reset(),"step.start":a=>e.start(a)},[e]);return {handlePrimary:useCallback((a,s,l=!0)=>V(this,null,function*(){if((yield o==null?void 0:o(e,a,s))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof u=="function"?yield u(s,l):u!==!1&&(yield e.complete(s,l)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,l),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[r,o,e,n]),handleSecondary:useCallback((a,s)=>V(this,null,function*(){if((yield t==null?void 0:t(e,a,s))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let d=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof d=="function"?d():d!==!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}),[r,t,e,n])}}function ur({onPrimary:e,onSecondary:o,step:t}){var u,c;let{handlePrimary:r,handleSecondary:n}=ae(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:s,skipped:l}=t.$state,d=s||l||!a?jsx(yo,{checked:s||l,marginLeft:"auto"}):jsx(x,{as:dr,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(P,{borderWidth:1,containerType:"inline-size",css:{"@container (max-width: 600px)":{flexBasis:"85%"},"@container (min-width: 601px) and (max-width: 900px)":{flexBasis:"45%"},"@container (min-width: 1200px)":{flexBasis:"25%"}},"data-step-id":t.id,flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:a,opacity:a?.5:1,children:[jsxs(R.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(P.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),d]}),jsx(P.Title,{children:t.title}),jsx(P.Subtitle,{children:t.subtitle}),jsxs(R.Row,{css:{"@container (max-width: 200px)":{"& > button":{flexBasis:"50%",flexGrow:1},flexDirection:"column-reverse"}},gap:"2",marginTop:"auto",paddingTop:"3",part:"carousel-step-footer",children:[jsx(P.Secondary,{disabled:a,onClick:n,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(P.Primary,{disabled:a,onClick:r,title:(c=t.primaryButton)==null?void 0:c.title})]})]})}function fr(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z",clipRule:"evenodd"})}))}function yr(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 0 1-.75.75H5.612l4.158 3.96a.75.75 0 1 1-1.04 1.08l-5.5-5.25a.75.75 0 0 1 0-1.08l5.5-5.25a.75.75 0 1 1 1.04 1.08L5.612 9.25H16.25A.75.75 0 0 1 17 10Z",clipRule:"evenodd"})}))}var xr=keyframes`
28
29
  from {
29
30
  opacity: 0;
30
31
  }
31
32
  to {
32
33
  opacity: 1;
33
34
  }
34
- `;function xr({flow:e,sort:o,onPrimary:t,onSecondary:r}){var h,b;let[n,a]=useState(),[s]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(b=(h=Array.from(e.steps.values()).find(S=>!S.$state.completed&&!S.$state.skipped))==null?void 0:h.order)!=null?b:0}),[l,d]=Li(s),[u,c]=useState(),[f,y]=useState();useLayoutEffect(()=>{d&&(u==null&&c(d.canScrollNext()),f==null&&y(d.canScrollPrev()),d.on("select",()=>{c(d.canScrollNext()),y(d.canScrollPrev());}));},[d,u,f]),useEffect(()=>{if(!n){let S=Array.from(e.steps.values()),B=S.filter(T=>T.$state.completed||T.$state.skipped).sort((T,k)=>T.order-k.order),O=S.filter(T=>!T.$state.completed&&!T.$state.skipped).sort((T,k)=>T.order-k.order);a(o==="completed-last"?[...O,...B].map(T=>T.id):S.map(T=>T.id));}},[e.steps,o,n]);let C=e.getNumberOfCompletedSteps(),v=e.getNumberOfAvailableSteps();return n?jsxs(Fragment,{children:[jsxs(R.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:I.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(R.Column,{part:"carousel-header-content",children:[jsx(F.H3,{children:e.title}),jsx(F.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(R.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(F.Body2,{fontWeight:"demibold",part:"progress-text",children:[C,"/",v]}),jsx(he,{current:C,total:v,minWidth:"200px"})]})]}),jsxs(x,{margin:`0 ${I.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:l,children:[jsx(R.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).filter(S=>S.$state.visible).sort((S,B)=>n.indexOf(S.id)-n.indexOf(B.id)).map(S=>jsx(cr,{onPrimary:t,onSecondary:r,step:S},S.id))}),f&&jsx(R.Column,{animation:`${yr} 300ms ease-out`,background:"linear-gradient(to right, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",left:"0",justifyContent:"center",paddingLeft:"3",part:"carousel-prev-wrapper",position:"absolute",top:"0",children:jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollPrev(),padding:"2",children:jsx(gr,{height:"24px",width:"24px"})})}),u&&jsx(R.Column,{animation:`${yr} 300ms ease-out`,background:"linear-gradient(to left, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",justifyContent:"center",paddingRight:"3",part:"carousel-next-wrapper",position:"absolute",right:"0",top:"0",children:jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollNext(),padding:"2",children:jsx(mr,{height:"24px",width:"24px"})})})]})]}):null}function br(o){var e=g(o,[]);return jsx(W,p(i({as:P,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(xr,i(i({},e),t))}))}var Je={};ue(Je,{Content:()=>Zo,Root:()=>Yo,Trigger:()=>Qo});function Cr(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6"},e),{children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})}))}var Ni=keyframes`
35
+ `;function hr({flow:e,sort:o,onPrimary:t,onSecondary:r}){var h,b;let[n,a]=useState(),[s]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(b=(h=Array.from(e.steps.values()).find(S=>!S.$state.completed&&!S.$state.skipped))==null?void 0:h.order)!=null?b:0}),[l,d]=Wi(s),[u,c]=useState(),[f,y]=useState();useLayoutEffect(()=>{d&&(u==null&&c(d.canScrollNext()),f==null&&y(d.canScrollPrev()),d.on("select",()=>{c(d.canScrollNext()),y(d.canScrollPrev());}));},[d,u,f]),useEffect(()=>{if(!n){let S=Array.from(e.steps.values()),B=S.filter(T=>T.$state.completed||T.$state.skipped).sort((T,k)=>T.order-k.order),O=S.filter(T=>!T.$state.completed&&!T.$state.skipped).sort((T,k)=>T.order-k.order);a(o==="completed-last"?[...O,...B].map(T=>T.id):S.map(T=>T.id));}},[e.steps,o,n]);let C=e.getNumberOfCompletedSteps(),v=e.getNumberOfAvailableSteps();return n?jsxs(Fragment,{children:[jsxs(R.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:I.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(R.Column,{part:"carousel-header-content",children:[jsx(F.H3,{children:e.title}),jsx(F.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(R.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(F.Body2,{fontWeight:"demibold",part:"progress-text",children:[C,"/",v]}),jsx(he,{current:C,total:v,minWidth:"200px"})]})]}),jsxs(x,{margin:`0 ${I.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:l,children:[jsx(R.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).filter(S=>S.$state.visible).sort((S,B)=>n.indexOf(S.id)-n.indexOf(B.id)).map(S=>jsx(ur,{onPrimary:t,onSecondary:r,step:S},S.id))}),f&&jsx(R.Column,{animation:`${xr} 300ms ease-out`,background:"linear-gradient(to right, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",left:"0",justifyContent:"center",paddingLeft:"3",part:"carousel-prev-wrapper",position:"absolute",top:"0",children:jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollPrev(),padding:"2",children:jsx(yr,{height:"24px",width:"24px"})})}),u&&jsx(R.Column,{animation:`${xr} 300ms ease-out`,background:"linear-gradient(to left, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",justifyContent:"center",paddingRight:"3",part:"carousel-next-wrapper",position:"absolute",right:"0",top:"0",children:jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollNext(),padding:"2",children:jsx(fr,{height:"24px",width:"24px"})})})]})]}):null}function Pr(o){var e=g(o,[]);return jsx(W,p(i({as:P,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(hr,i(i({},e),t))}))}var Je={};ue(Je,{Content:()=>Zo,Root:()=>Yo,Trigger:()=>Qo});function Sr(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6"},e),{children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})}))}var _i=keyframes`
35
36
  from {
36
37
  height: 0;
37
38
  opacity: 0;
@@ -40,7 +41,7 @@ var It=Object.defineProperty,En=Object.defineProperties;var In=Object.getOwnProp
40
41
  height: var(--radix-collapsible-content-height);
41
42
  opacity: 1;
42
43
  }
43
- `,_i=keyframes`
44
+ `,zi=keyframes`
44
45
  from {
45
46
  height: var(--radix-collapsible-content-height);
46
47
  opacity: 1;
@@ -49,14 +50,14 @@ var It=Object.defineProperty,En=Object.defineProperties;var In=Object.getOwnProp
49
50
  height: 0;
50
51
  opacity: 0;
51
52
  }
52
- `,Ui=()=>jsx(x,{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 zi({checked:e=!1}){return jsx(x,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",marginRight:"2",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsx(x,{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(Ui,{})})})}function Zo({children:e}){return jsx(Ve.Content,{asChild:!0,children:jsxs(R.Column,{css:{'&[data-state="open"]':{animation:`${Ni} 300ms ease-out`},'&[data-state="closed"]':{animation:`${_i} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(x,{part:"checklist-spacer"}),e]})})}function Yo(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=g(s,["children","disabled","onOpenChange","open"]);return jsx(Ve.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,part:"collapsible-step"},n),{children:e}))})}function Qo({isCompleted:e,isBlocked:o,title:t}){return jsx(Ve.Trigger,{asChild:!0,children:jsxs(R.Row,{alignItems:"center",justifyContent:"flex-start",margin:-5,padding:5,zIndex:1,opacity:o?.4:1,disabled:o,pointerEvents:o?"none":"auto",cursor:o?"not-allowed":"pointer",part:"collapsible-header",children:[jsx(zi,{checked:e}),jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t}),jsx(x,{as:Cr,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",marginLeft:"auto",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Gi=["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","src"];function re(e){let o={},t={};for(let[r,n]of Object.entries(e))Gi.some(a=>a===r)?o[r]=n:t[r]=n;return {otherProps:t,videoProps:o}}var wr=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Fr({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var h,b,S,B,O,T;let{$state:{blocked:a,completed:s,skipped:l},subtitle:d,title:u}=n,c=(b=(h=n.primaryButton)==null?void 0:h.title)!=null?b:n.primaryButtonTitle,f=(B=(S=n.secondaryButton)==null?void 0:S.title)!=null?B:n.secondaryButtonTitle,y=(O=n.props)!=null?O:{},C=!!a,{videoProps:v}=re(y);return jsxs(Yo,p(i({"data-step-id":n.id,open:t,onOpenChange:r},y),{children:[jsx(Qo,{isBlocked:n.$state.blocked,isCompleted:s||l,title:u}),jsxs(Zo,{children:[jsx(P.Media,i({aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(T=n.videoUri)!=null?T:n.imageUri,transform:"translate3d(0, 0, 1px)",type:n.videoUri?"video":"image"},v)),jsx(P.Subtitle,{color:"neutral.400",children:d}),jsxs(R.Row,{gap:3,part:"collapsible-footer",children:[jsx(P.Secondary,{title:f,onClick:o}),jsx(P.Primary,{disabled:C,title:c,onClick:e})]})]})]}))}var Ji={default:Fr};function qi(r){var n=r,{flow:e,step:o}=n,t=g(n,["flow","step"]);var h;let{onPrimary:a,onSecondary:s,openStepId:l,setOpenStepId:d,stepTypes:u}=useContext(wr),{handlePrimary:c,handleSecondary:f}=ae(o,{onPrimary:a,onSecondary:s}),y=(l!=null?l:e.getCurrentStep().id)===o.id,C=(h=u[o.type])!=null?h:Fr;function v(b){return V(this,null,function*(){d(b?o.id:""),b&&!o.$state.completed&&(yield o.start(),d(null));})}return jsx(C,p(i({flow:e,onOpenChange:v,open:y,step:o},t),{handlePrimary:c,handleSecondary:f}),o.id)}function xo(s){var l=s,{flowId:e,onPrimary:o,onSecondary:t,part:r,stepTypes:n={}}=l,a=g(l,["flowId","onPrimary","onSecondary","part","stepTypes"]);let[d,u]=useState(null),c=i(i({},Ji),n);return jsx(wr.Provider,{value:{openStepId:d,setOpenStepId:u,onPrimary:o,onSecondary:t,stepTypes:c},children:jsx(W,p(i({as:P,borderWidth:"md",flowId:e,part:["checklist",r]},a),{children:v=>{var h=v,{flow:f,handleDismiss:y}=h,C=g(h,["flow","handleDismiss"]);var k;let S=Array.from(f.steps.entries()).filter(([,w])=>w.$state.visible===!0).map(([,w])=>jsx(qi,p(i({flow:f,handleDismiss:y},C),{step:w}),w.id)),B=f.getNumberOfCompletedSteps(),O=f.getNumberOfAvailableSteps(),T=a.dismissible||!!((k=f==null?void 0:f.props)!=null&&k.dismissible);return jsxs(Fragment,{children:[jsxs(R.Column,{gap:2,part:"checklist-header",children:[jsx(P.Header,{dismissible:T,handleDismiss:y,subtitle:f.subtitle,title:f.title}),jsxs(R.Row,{alignItems:"center",gap:2,part:"checklist-progress",children:[jsxs(F.Body2,{fontWeight:"demibold",part:"progress-text",children:[B,"/",O]}),jsx(he,{current:B,total:O,flexGrow:1})]})]}),S]})}}))})}var Qe={};ue(Qe,{Content:()=>Me,Root:()=>Ae,Trigger:()=>Le});function ta(s,a){var l=s,{children:e,lockScroll:o=!0,part:t,opacity:r=.5}=l,n=g(l,["children","lockScroll","part","opacity"]);let d=keyframes`
53
+ `,Ui=()=>jsx(x,{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 Gi({checked:e=!1}){return jsx(x,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",marginRight:"2",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsx(x,{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(Ui,{})})})}function Zo({children:e}){return jsx(Ve.Content,{asChild:!0,children:jsxs(R.Column,{css:{'&[data-state="open"]':{animation:`${_i} 300ms ease-out`},'&[data-state="closed"]':{animation:`${zi} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(x,{part:"checklist-spacer"}),e]})})}function Yo(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=g(s,["children","disabled","onOpenChange","open"]);return jsx(Ve.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,part:"collapsible-step"},n),{children:e}))})}function Qo({isCompleted:e,isBlocked:o,title:t}){return jsx(Ve.Trigger,{asChild:!0,children:jsxs(R.Row,{alignItems:"center",justifyContent:"flex-start",margin:-5,padding:5,zIndex:1,opacity:o?.4:1,disabled:o,pointerEvents:o?"none":"auto",cursor:o?"not-allowed":"pointer",part:"collapsible-header",children:[jsx(Gi,{checked:e}),jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t}),jsx(x,{as:Sr,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",marginLeft:"auto",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Ki=["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","src"];function re(e){let o={},t={};for(let[r,n]of Object.entries(e))Ki.some(a=>a===r)?o[r]=n:t[r]=n;return {otherProps:t,videoProps:o}}var Fr=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Rr({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var h,b,S,B,O,T;let{$state:{blocked:a,completed:s,skipped:l},subtitle:d,title:u}=n,c=(b=(h=n.primaryButton)==null?void 0:h.title)!=null?b:n.primaryButtonTitle,f=(B=(S=n.secondaryButton)==null?void 0:S.title)!=null?B:n.secondaryButtonTitle,y=(O=n.props)!=null?O:{},C=!!a,{videoProps:v}=re(y);return jsxs(Yo,p(i({"data-step-id":n.id,open:t,onOpenChange:r},y),{children:[jsx(Qo,{isBlocked:n.$state.blocked,isCompleted:s||l,title:u}),jsxs(Zo,{children:[jsx(P.Media,i({aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(T=n.videoUri)!=null?T:n.imageUri,transform:"translate3d(0, 0, 1px)",type:n.videoUri?"video":"image"},v)),jsx(P.Subtitle,{color:"neutral.400",children:d}),jsxs(R.Row,{gap:3,part:"collapsible-footer",children:[jsx(P.Secondary,{title:f,onClick:o}),jsx(P.Primary,{disabled:C,title:c,onClick:e})]})]})]}))}var qi={default:Rr};function Zi(r){var n=r,{flow:e,step:o}=n,t=g(n,["flow","step"]);var h;let{onPrimary:a,onSecondary:s,openStepId:l,setOpenStepId:d,stepTypes:u}=useContext(Fr),{handlePrimary:c,handleSecondary:f}=ae(o,{onPrimary:a,onSecondary:s}),y=(l!=null?l:e.getCurrentStep().id)===o.id,C=(h=u[o.type])!=null?h:Rr;function v(b){return V(this,null,function*(){d(b?o.id:""),b&&!o.$state.completed&&(yield o.start(),d(null));})}return jsx(C,p(i({flow:e,onOpenChange:v,open:y,step:o},t),{handlePrimary:c,handleSecondary:f}),o.id)}function ho(s){var l=s,{flowId:e,onPrimary:o,onSecondary:t,part:r,stepTypes:n={}}=l,a=g(l,["flowId","onPrimary","onSecondary","part","stepTypes"]);let[d,u]=useState(null),c=i(i({},qi),n);return jsx(Fr.Provider,{value:{openStepId:d,setOpenStepId:u,onPrimary:o,onSecondary:t,stepTypes:c},children:jsx(W,p(i({as:P,borderWidth:"md",flowId:e,part:["checklist",r]},a),{children:v=>{var h=v,{flow:f,handleDismiss:y}=h,C=g(h,["flow","handleDismiss"]);var k;let S=Array.from(f.steps.entries()).filter(([,w])=>w.$state.visible===!0).map(([,w])=>jsx(Zi,p(i({flow:f,handleDismiss:y},C),{step:w}),w.id)),B=f.getNumberOfCompletedSteps(),O=f.getNumberOfAvailableSteps(),T=a.dismissible||!!((k=f==null?void 0:f.props)!=null&&k.dismissible);return jsxs(Fragment,{children:[jsxs(R.Column,{gap:2,part:"checklist-header",children:[jsx(P.Header,{dismissible:T,handleDismiss:y,subtitle:f.subtitle,title:f.title}),jsxs(R.Row,{alignItems:"center",gap:2,part:"checklist-progress",children:[jsxs(F.Body2,{fontWeight:"demibold",part:"progress-text",children:[B,"/",O]}),jsx(he,{current:B,total:O,flexGrow:1})]})]}),S]})}}))})}var eo={};ue(eo,{Content:()=>Me,Root:()=>Ae,Trigger:()=>Le});function ra(s,a){var l=s,{children:e,lockScroll:o=!0,part:t,opacity:r=.5}=l,n=g(l,["children","lockScroll","part","opacity"]);let d=keyframes`
53
54
  from {
54
55
  opacity: 0;
55
56
  }
56
57
  to {
57
58
  opacity: ${r}
58
59
  }
59
- `,[u,c]=useState(!1);return useEffect(()=>{if(!o){let f=()=>{u||(c(!0),window.removeEventListener("scroll",f));};return window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f);}}},[o,u]),!o&&u?jsx(Fragment,{children:e}):jsx(RemoveScroll,{forwardProps:!0,ref:a,enabled:o,children:jsx(x,p(i({animation:`${d} 300ms ease-out`,backgroundColor:"black",inset:"0",opacity:"0.5",part:["overlay",t],position:"fixed"},n),{children:e}))})}var $e=jo.forwardRef(ta);function la({maxX:e,maxY:o,radius:t,x1:r,x2:n,y1:a,y2:s}){return t>0?`path("${[`M${r+t},${a}`,`H${n-t}`,`A${t} ${t} 0,0,1 ${n} ${a+t}`,`V${s-t}`,`A${t} ${t} 0,0,1 ${n-t} ${s}`,`H${r+t}`,`A${t} ${t} 0,0,1 ${r} ${s-t}`,`V${o}`,`H${e}`,"V0","H0",`V${o}`,`H${r}`,`V${a+t}`,`A${t} ${t} 0,0,1 ${r+t} ${a}`,"Z"].join(" ")}")`:`path("M${r},${a} H${n} V${s} H${r} V${o} H${e} V0 H0 V${o} H${r} Z")`}function pa(e){if(!window||!("nodeType"in e))return 0;let o=Number(window.getComputedStyle(e).borderRadius.replace(/\D/g,""));return Number.isNaN(o)?0:o}function qe(a){var s=a,{anchor:e,lockScroll:o=!0,part:t,style:r={}}=s,n=g(s,["anchor","lockScroll","part","style"]);let[l,d]=useState({maxX:0,maxY:0,radius:0,x1:0,x2:0,y1:0,y2:0}),{refs:u}=useFloating({middleware:[{name:"clipPath",fn({elements:c,rects:f}){return d({maxX:c.floating.clientWidth,maxY:c.floating.clientHeight,radius:pa(c.reference),x1:f.reference.x,x2:f.reference.x+f.reference.width,y1:f.reference.y,y2:f.reference.y+f.reference.height}),{}}}],open:!0,placement:"top-center",transform:!1,whileElementsMounted:autoUpdate});return useEffect(()=>{try{let c=document.querySelector(e);c!=null?u.setReference(c):console.debug(`[frigade] Spotlight: No anchor found for selector: ${e}`);}catch(c){}},[e,u]),jsx($e,i({lockScroll:o,part:["spotlight",t],ref:u.setFloating,style:i({clipPath:la(l)},r)},n))}function Ze(e,o=!0){let[t,r]=useState(!1);useEffect(()=>{if(!t&&o&&e instanceof Element){let n=typeof o!="boolean"?o:{behavior:"smooth",block:"center"},a;window.addEventListener("scroll",function s(){clearTimeout(a),a=setTimeout(()=>{window.removeEventListener("scroll",s),r(!0);},100);},!0),e.scrollIntoView(n);}else o||r(!0);},[o,e,t]);}function kr(e,o){try{if(e.matches(o)&&Br(e))return e;let t=e.querySelectorAll(o);if(t.length>0&&Br(t[0]))return t[0]}catch(t){return null}}function Br(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Or(e){let[o,t]=useState(null);return useEffect(()=>{if(typeof e=="string")try{let r=document.querySelector(e);r!=null?(console.debug(`[frigade] Found anchor: ${e}`),t(r)):console.debug(`[frigade] No anchor found for selector: ${e}`);}catch(r){console.debug(`[frigade] Invalid selector for anchor: ${e}`);}},[e]),useEffect(()=>{if(typeof e!="string")return;let r=new MutationObserver(n=>{for(let a of n)if(a.type==="childList"){for(let s of a.addedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;let l=kr(s,e);if(l!=null){console.debug(`[frigade] Found anchor: ${e}`),t(l);break}}for(let s of a.removedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;if(kr(s,e)!=null){console.debug(`[frigade] Removed anchor: ${e}`),t(null);break}}}});return r.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>r.disconnect()},[e]),{anchorElement:o}}function Ra(e){switch(e){case"after":return "end";case"before":return "start";default:return e}}function ho({align:e,alignOffset:o,anchor:t,nodeId:r,onOpenChange:n=()=>{},open:a,side:s,sideOffset:l}){let d=`${s}-${Ra(e)}`;function u({rects:z}){let N={alignmentAxis:o,mainAxis:l};return ["after","before"].includes(e)&&(["bottom","top"].includes(s)?N.alignmentAxis=o-z.floating.width:N.alignmentAxis=o-z.floating.height),N}let H=useFloating({middleware:[offset(u,[e,o,s,l]),flip(),shift()],nodeId:r,onOpenChange:n,open:a,placement:d,whileElementsMounted:autoUpdate}),{context:c,floatingStyles:f,placement:y,refs:C}=H,v=g(H,["context","floatingStyles","placement","refs"]),h=useClick(c),b=useDismiss(c,{outsidePress:!1}),S=useFocus(c),B=useRole(c),O=useTransitionStatus(c),{getFloatingProps:T,getReferenceProps:k}=useInteractions([h,b,S,B]),{anchorElement:w}=Or(t);useEffect(()=>{w!=null&&C.setReference(w);},[t,w,C]);let E=y.split("-");return e==="before"?E[1]=E[1]==="end"?"after":"before":e==="after"&&(E[1]=E[1]==="start"?"before":"after"),i({context:c,getFloatingProps:T,getReferenceProps:k,floatingStyles:f,placement:E.join("-"),refs:C,status:O},v)}var Ye=createContext({floatingNodeId:null,isOpen:!1,setIsOpen:()=>{}});function Ae(C){var v=C,{align:e="center",alignOffset:o=0,anchor:t,autoScroll:r=!1,children:n,defaultOpen:a=!1,modal:s=!1,onOpenChange:l=()=>{},open:d,side:u="bottom",sideOffset:c=0,spotlight:f=!1}=v,y=g(v,["align","alignOffset","anchor","autoScroll","children","defaultOpen","modal","onOpenChange","open","side","sideOffset","spotlight"]);let[h,b]=useState(a),S=d!=null?d:h,B=useFloatingNodeId(),O=ho(i({align:e,alignOffset:o,anchor:t,nodeId:B,onOpenChange:k=>{l(k),d==null&&b(k);},open:S,side:u,sideOffset:c},y)),{refs:T}=O;return Ze(T.reference.current,r),jsxs(Ye.Provider,{value:{floating:O,floatingNodeId:B,isOpen:S,setIsOpen:b},children:[f&&S&&jsx(qe,{anchor:t}),s&&!f&&S&&jsx($e,{lockScroll:!0}),n]})}var ot={height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}};function bo(){let e="DOMRect"in globalThis?new DOMRect:ot,[o,t]=useState(e),[r,n]=useState(null),a=useCallback(s=>{n(s);},[]);return useLayoutEffect(()=>{if(!r)return;let s=()=>{let l=r.getBoundingClientRect();t(l);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:a}}function Po(e){let[o,t]=useState(!1),[r,n]=useState(ot),a=r.height>0&&r.width>0;return useEffect(()=>{if(e==null)return;let s=new IntersectionObserver(l=>{let d=l[0];n(d.boundingClientRect),t(d.isIntersecting);},{root:null});return s.observe(e),()=>{s.disconnect();}},[e]),{isVisible:o&&a}}function Me(a){var s=a,{children:e,css:o,part:t,style:r}=s,n=g(s,["children","css","part","style"]);let{floating:l,floatingNodeId:d}=useContext(Ye),{isVisible:u}=Po(l==null?void 0:l.refs.reference.current);if(l==null)return null;let{floatingStyles:c,getFloatingProps:f,placement:y,refs:C,status:v}=l;return C.reference.current==null||!u||(v==null?void 0:v.isMounted)===!1?null:jsx(FloatingNode,{id:d,children:jsx(x,p(i(i({autoFocus:!0,css:i({'&[data-status="unmounted"]':{display:"none"}},o),"data-placement":y,"data-status":v.status,part:["popover-content",t],ref:C.setFloating,style:i(i({},c),r)},f()),n),{children:jsx(x,{part:"popover-transition-container",children:e})}))})}function Le(r){var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);var d;let{floating:{getReferenceProps:a,refs:s},setIsOpen:l}=useContext(Ye);return jsx(x,p(i(i({ref:s==null?void 0:s.setReference,onClick:()=>l(u=>!u),part:["popover-trigger",o]},t),(d=a==null?void 0:a())!=null?d:{}),{children:e}))}var Co={'&[data-status="open"]':{opacity:1,zIndex:1},'&[data-status="close"]':{opacity:0,zIndex:0,'& [data-status="close"]':{display:"none"}},'&[data-status="initial"]':{opacity:.8},'&[data-status="open"], &[data-status="close"]':{transition:"transform 0.2s ease-out, opacity 0.2s ease-out"},'&[data-status="initial"] .fr-popover-transition-container':{transform:"scale(0.8)"},'&[data-status="close"] .fr-popover-transition-container':{transform:"scale(0.3)"},'&[data-status="open"] .fr-popover-transition-container':{transform:"scale(1)"},"& .fr-popover-transition-container":{transformOrigin:"left",transition:"transform 0.2s ease-out"}};function Hr({onPrimary:e,onSecondary:o,openStepId:t,setOpenStepId:r,step:n}){var b,S,B,O,T,k;let a=useRef(),{handlePrimary:s,handleSecondary:l}=ae(n,{onPrimary:e,onSecondary:o}),d=t===n.id;function u(...w){return V(this,null,function*(){(yield s(...w))&&r(null);})}function c(...w){return V(this,null,function*(){(yield l(...w))&&r(null);})}function f(){clearTimeout(a.current),d||(a.current=setTimeout(()=>r(n.id),300));}function y(){clearTimeout(a.current);}let C=(S=(b=n.primaryButton)==null?void 0:b.title)!=null?S:n.primaryButtonTitle,v=(O=(B=n.secondaryButton)==null?void 0:B.title)!=null?O:n.secondaryButtonTitle,{videoProps:h}=re((T=n.props)!=null?T:{});return jsxs(Ae,{align:"start",open:d,side:"right",sideOffset:8,children:[jsxs(Le,{as:R.Row,alignItems:"center",borderRadius:"md",gap:"2",justifyContent:"space-between",onPointerEnter:f,onPointerLeave:y,padding:"1 2",part:"floating-checklist-step-list-item",style:{backgroundColor:d?"var(--fr-colors-neutral-800)":"transparent"},userSelect:"none",children:[jsx(F.Body2,{part:"floating-checklist-step-title",children:n.title}),jsx(go,{checked:n.$state.completed||n.$state.skipped,size:"18px"})]}),jsx(Me,{css:Co,part:"floating-step",children:jsxs(P,{backgroundColor:"neutral.background",border:"md solid neutral.border",borderRadius:"md",gap:"3",minWidth:"400px",p:"2",children:[jsx(P.Media,i({src:(k=n.videoUri)!=null?k:n.imageUri,type:n.videoUri?"video":"image",css:{objectFit:"contain",width:"100%"}},h)),jsx(P.Header,{dismissible:!1,padding:"0 1",subtitle:n.subtitle}),jsxs(R.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(P.Secondary,{disabled:n.$state.blocked,onClick:c,padding:"1 2",title:v}),jsx(P.Primary,{disabled:n.$state.blocked,onClick:u,padding:"1 2",title:C})]})]})})]})}function Vr(s){var l=s,{children:e,flowId:o,onPrimary:t,onSecondary:r,part:n}=l,a=g(l,["children","flowId","onPrimary","onSecondary","part"]);let[d,u]=useState(null),c=useRef();function f(){clearTimeout(c.current);}function y(){clearTimeout(c.current),d!=null&&(c.current=setTimeout(()=>u(null),300));}function C(v){!v&&d!=null&&u(null);}return jsx(W,p(i({flowId:o,part:["floating-checklist",n]},a),{children:({flow:v})=>{let h=v.getNumberOfCompletedSteps(),b=v.getNumberOfAvailableSteps(),S=e!=null?e:jsxs(R.Row,{alignItems:"center",backgroundColor:"neutral.background",border:"md solid neutral.border",borderRadius:"md",cursor:"pointer",gap:"2",padding:"1 2",part:"floating-checklist-anchor",userSelect:"none",children:[jsx(F.Body2,{fontWeight:"medium",part:"floating-checklist-title",children:v.title}),jsx(mo,{current:h,height:"24px",strokeWidth:"4px",total:b,width:"24px"})]});return jsx(FloatingTree,{children:jsxs(Ae,{align:"start",onOpenChange:C,sideOffset:4,children:[jsx(Le,{display:"inline-block",children:S}),jsx(Me,{css:p(i({},Co),{'&[data-status="initial"]':{opacity:.3},"& .fr-popover-transition-container":{transformOrigin:"top left",transition:"transform 0.2s ease-out"},'&[data-placement^="top"] .fr-popover-transition-container':{transformOrigin:"bottom left"}}),children:jsxs(P,{backgroundColor:"neutral.background",border:"md solid neutral.border",borderRadius:"md",gap:"0",onPointerEnter:f,onPointerLeave:y,p:"0 1 1",part:"floating-checklist-step-list",children:[jsx(he,{borderRadius:"md md 0 0",clipPath:"border-box",css:{"& .fr-progress-bar-fill":{borderRadius:0}},current:h,height:"5px",total:b,flexGrow:1,margin:"0 -1 2"}),Array.from(v.steps.values()).map(B=>jsx(Hr,{onPrimary:t,onSecondary:r,openStepId:d,setOpenStepId:u,step:B},B.id))]})})]})})}}))}var Ja=new Set(["required","min","max","minLength","maxLength","pattern"]);function qa({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=useFormContext();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 a=Object.fromEntries(Object.entries(t).filter(([l])=>Ja.has(l))),s=useController({name:t.id,control:o,rules:a});return jsx(e,p(i({},s),{fieldData:t,formContext:n,submit:r}))}function Ar({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a}){var B,O,T,k;let{__readOnly:s}=useContext(A),l=useMemo(()=>{var w,E;return (E=(w=a.fields)==null?void 0:w.filter(H=>e[H.type]!=null&&H.id))!=null?E:[]},[a.fields,e]),d=useForm({delayError:2e3,mode:"onChange",defaultValues:l.reduce((w,E)=>{var H;return w[E.id]=(H=E.value)!=null?H:"",w},{})});useEffect(()=>{d.formState.isDirty||d.reset(l.reduce((w,E)=>{var H;return w[E.id]=(H=E.value)!=null?H:"",w},{}));},[l,d]),useEffect(()=>{Object.keys(d.formState.dirtyFields).some(w=>l.some(E=>E.id===w))&&d.trigger();},[l,d,a.id]);let[u,c]=useState(!1),f=[],{control:y,handleSubmit:C}=d;function v(w,E){c(!0),t(E,w,s===!0).then(()=>c(!1));}l.forEach(w=>{e[w.type]!=null&&f.push(jsx(qa,{control:y,fieldComponent:e[w.type],fieldData:w,submit:C(v)},`${a.flow.id}-${w.id}`));});let h=(O=(B=a.primaryButton)==null?void 0:B.title)!=null?O:a.primaryButtonTitle,b=(k=(T=a.secondaryButton)==null?void 0:T.title)!=null?k:a.secondaryButtonTitle,S=!!(a.$state.blocked||!d.formState.isValid);return useEffect(()=>{d.clearErrors();},[d,a]),jsxs(Fragment,{children:[jsx(P.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsx(FormProvider,p(i({},d),{children:f})),jsxs(R.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[b&&jsx(D.Secondary,{onClick:r,title:b}),jsx(D.Primary,{disabled:S||u,onClick:C(v),title:h!=null?h:"Submit",loading:u})]},`form-footer-${a.id}`)]})}function Mr({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 it({children:e,id:o,required:t=!1}){return jsxs(F.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(x,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var at={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},eo=p(i({},at),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),wo={alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",position:"absolute",top:"-1px",width:"calc(100% + 2px)",color:"primary.foreground"};function pe({children:e,field:o,fieldData:t,fieldState:r}){var c;let{id:n,label:a,placeholder:s,props:l}=t,{error:d}=r,u=i(p(i(i(i({id:n},o),s?{placeholder:s}:{}),eo),{"aria-invalid":!!d,value:(c=o.value)!=null?c:""}),l);return jsxs(x,{part:"field",children:[jsx(it,{id:n,required:!!t.required,children:a}),e(u),jsx(Mr,{error:d})]})}function Ne(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"})}))}var ts=jo.forwardRef(({label:e,value:o},t)=>jsxs(x,{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(_e.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(x,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(x,p(i({as:_e.Indicator},wo),{children:jsx(Ne,{height:"14",width:"14"})}))})})]}));function st(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:a,value:s})=>jsx(ts,{value:s,label:a},s));return jsx(pe,p(i({},e),{children:()=>jsx(_e.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(R.Column,{gap:2,part:"field-radio-group",children:n})})}))}function Fo(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}))}function zr(e){let{field:{onChange:o},fieldData:{options:t=[]}}=e,[r,n]=jo.useState([]);function a(s){let l=[];r.includes(s)?l=[...r.filter(d=>d!==s)]:l=[...r,s],n(l),o(l);}return jsx(pe,p(i({},e),{children:()=>jsx(R.Column,{gap:2,part:"field-select-multiple",children:t.map(({label:s,value:l})=>jsx(Ro.Root,{value:r.includes(l)?l:void 0,onCheckedChange:()=>a(l),asChild:!0,children:jsxs(x,{as:"button",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",justifyContent:"space-between",part:"field-check",px:4,py:2,children:[jsx(F.Body2,{part:"field-check-label",children:s}),jsx(x,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",id:l,padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(Ro.Indicator,{asChild:!0,children:jsx(x,p(i({},wo),{children:jsx(Ne,{height:"14",width:"14"})}))})})]})},l))})}))}var is=jo.forwardRef(({label:e,value:o},t)=>jsx(_.Item,{value:o,ref:t,asChild:!0,children:jsx(x,{"backgroundColor:hover":"neutral.900",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 lt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,a=r.map(({label:s,value:l})=>jsx(is,{value:l,label:s},l));return e.fieldData.multiple?jsx(zr,i({},e)):jsx(pe,p(i({},e),{children:()=>jsxs(_.Root,{value:t,onValueChange:o,children:[jsx(_.Trigger,{asChild:!0,children:jsxs(F.Body2,p(i({},eo),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(_.Value,{placeholder:n!=null?n:"Select one"}),jsx(_.Icon,{children:jsx(x,{as:Fo,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(_.Portal,{children:jsx(_.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(x,p(i({},eo),{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 pt(e){return jsx(pe,p(i({},e),{children:o=>jsx(F.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function dt(e){return jsx(pe,p(i({},e),{children:o=>jsx(F.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function Jr(e){let{field:{onChange:o,value:t},fieldData:{label:r,id:n=[]}}=e;return jsxs(x,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(Ro.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(x,p(i({},at),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:n,children:jsx(Ro.Indicator,{asChild:!0,children:jsx(x,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(Ne,{height:"14",fill:"currentColor"})})})}))}),jsx(F.Body2,{part:"field-checkbox-label",as:"label",htmlFor:n,children:r})]})}var ss={checkbox:Jr,radio:st,select:lt,text:pt,textarea:dt};function ze(n){var a=n,{fieldTypes:e={},flowId:o,part:t}=a,r=g(a,["fieldTypes","flowId","part"]);let s=Object.assign({},ss,e);return jsx(W,p(i({as:P,flowId:o,part:["form",t]},r),{children:l=>jsx(Ar,i({fieldTypes:s},l))}))}var Bo={};ue(Bo,{NPS:()=>to});function Yr({field:e,fieldData:o,submit:t,options:r,positiveLabel:n,negativeLabel:a}){var l,d;let s=r.map(u=>{let c=e.value===u.value?D.Primary:D.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(u.value),t();},title:u.label,css:{".fr-button-title":{fontSize:"15px"}}},u.value)});return jsxs(R.Column,{gap:2,children:[jsx(R.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:s}),jsxs(R.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(l=o.negativeLabel)!=null?l:a}),jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(d=o.positiveLabel)!=null?d:n})]})]})}function to(d){var u=d,{as:e=$,flowId:o,fieldTypes:t,part:r,options:n,positiveLabel:a,negativeLabel:s}=u,l=g(u,["as","flowId","fieldTypes","part","options","positiveLabel","negativeLabel"]);var C,v,h;let{flow:c}=Oe(o),f=(v=(C=c==null?void 0:c.props)==null?void 0:C.options)!=null?v:[...Array(11)].map((b,S)=>({label:`${S}`,value:`${S}`})),y=n||f;return jsx(ze,p(i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:b=>{var S,B,O,T,k,w;return jsx(Yr,p(i({},b),{options:y,positiveLabel:(O=(B=(S=c==null?void 0:c.props)==null?void 0:S.positiveLabel)!=null?B:a)!=null?O:"Extremely likely",negativeLabel:(w=(k=(T=c==null?void 0:c.props)==null?void 0:T.negativeLabel)!=null?k:s)!=null?w:"Not likely at all"}))}},t),modal:!1,onEscapeKeyDown:b=>{typeof l.onEscapeKeyDown=="function"&&l.onEscapeKeyDown(b),b.defaultPrevented||c.skip();},part:["nps",r]},l),{css:i({},i(p(i({},!c||c.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{".fr-card-header":{minWidth:y.length*51}}),{".fr-form":{padding:"20px","@media (max-width: 660px)":{minWidth:"100%"}},".fr-nps-field":{"@media (min-width: 660px)":{minWidth:"fit-content"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}},".fr-nps":{maxWidth:"min-content"}}),(h=l.css)!=null?h:{}))}))}function en(e,o,t){let[r,n]=useState(!1),a=useRef();return useEffect(()=>{a.current=typeof o=="string"?document.querySelector(o):o,n(!0);},[o]),r?createPortal(e,a.current,t):null}function ct({children:e,container:o="body"}){return en(e,o)}var gs=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function ut(n){var a=n,{clickable:e=!1,part:o="",style:t={}}=a,r=g(a,["clickable","part","style"]);let[s,l]=useState(!1);return useEffect(()=>{l(!0);},[]),jsxs(x,p(i({borderRadius:"24px",height:"24px",part:`ping-wrapper ${o}`,position:"relative",width:"24px",cursor:e?"pointer":void 0,style:i({opacity:s?1:0},t),transition:"opacity 0.2s ease-out"},r),{children:[jsx(x,{backgroundColor:"primary.surface",animation:`2s ease-out infinite ${gs}`,borderRadius:"24px",height:"48px",left:"-12px",part:"ping-pulse",pointerEvents:"none",position:"absolute",top:"-12px",transformOrigin:"center center",width:"48px"}),jsx(x,{backgroundColor:"primary.surface",borderRadius:"12px",height:"24px",left:"0",part:"ping",position:"absolute",top:"0",width:"24px","backgroundColor:hover":e?"primary.hover.surface":void 0})]}))}function tn({align:e,side:o}){let t={},r="-12px",n={top:"bottom",right:"left",bottom:"top",left:"right"};return t[n[o]]=r,["before","end"].includes(e)?["top","bottom"].includes(o)?t.right=r:t.bottom=r:["after","start"].includes(e)?["top","bottom"].includes(o)?t.left=r:t.top=r:["top","bottom"].includes(o)?t.left=`calc(50% + ${r})`:t.top=`calc(50% + ${r})`,t}function ft(B){var O=B,{align:e="center",alignOffset:o=0,anchor:t,autoScroll:r=!1,children:n,css:a={},defaultOpen:s=!0,lockScroll:l=!0,modal:d=!1,onMount:u,onOpenChange:c=()=>{},open:f,part:y,side:C="bottom",sideOffset:v=0,spotlight:h=!1,style:b={}}=O,S=g(O,["align","alignOffset","anchor","autoScroll","children","css","defaultOpen","lockScroll","modal","onMount","onOpenChange","open","part","side","sideOffset","spotlight","style"]);let[T,k]=useState(s),w=f!=null?f:T,{getFloatingProps:E,getReferenceProps:H,floatingStyles:z,placement:N,refs:G,status:ee}=ho({align:e,alignOffset:o,anchor:t,onOpenChange:j=>{c(j),f==null&&k(j);},open:w,side:C,sideOffset:v}),[ne,Z]=N.split("-"),oe=H(),{isVisible:de}=Po(G.reference.current),M=useRef(!1);if(Ze(G.reference.current,r),G.reference.current!==null&&de)M.current===!1&&(M.current=!0,u==null||u());else return M.current=!1,null;return jsxs(Fragment,{children:[h&&w&&jsx(qe,{anchor:t,lockScroll:l}),d&&!h&&w&&jsx($e,{lockScroll:l}),jsxs(x,p(i(i({css:i({'&[data-status="open"]':{transition:"transform 0.2s ease-out"}},a),"data-placement":N,"data-status":ee.status,part:["hint",y],ref:G.setFloating,style:i(i({},z),b)},E()),S),{children:[w&&n,jsx(ut,p(i({},oe),{position:"absolute",style:tn({align:Z,side:ne}),clickable:s===!1}))]}))]})}var Cs=keyframes`
60
+ `,[u,c]=useState(!1);return useEffect(()=>{if(!o){let f=()=>{u||(c(!0),window.removeEventListener("scroll",f));};return window.addEventListener("scroll",f),()=>{window.removeEventListener("scroll",f);}}},[o,u]),!o&&u?jsx(Fragment,{children:e}):jsx(RemoveScroll,{forwardProps:!0,ref:a,enabled:o,children:jsx(x,p(i({animation:`${d} 300ms ease-out`,backgroundColor:"black",inset:"0",opacity:"0.5",part:["overlay",t],position:"fixed"},n),{children:e}))})}var $e=jo.forwardRef(ra);function pa({maxX:e,maxY:o,radius:t,x1:r,x2:n,y1:a,y2:s}){return t>0?`path("${[`M${r+t},${a}`,`H${n-t}`,`A${t} ${t} 0,0,1 ${n} ${a+t}`,`V${s-t}`,`A${t} ${t} 0,0,1 ${n-t} ${s}`,`H${r+t}`,`A${t} ${t} 0,0,1 ${r} ${s-t}`,`V${o}`,`H${e}`,"V0","H0",`V${o}`,`H${r}`,`V${a+t}`,`A${t} ${t} 0,0,1 ${r+t} ${a}`,"Z"].join(" ")}")`:`path("M${r},${a} H${n} V${s} H${r} V${o} H${e} V0 H0 V${o} H${r} Z")`}function da(e){if(!window||!("nodeType"in e))return 0;let o=Number(window.getComputedStyle(e).borderRadius.replace(/\D/g,""));return Number.isNaN(o)?0:o}function qe(a){var s=a,{anchor:e,lockScroll:o=!0,part:t,style:r={}}=s,n=g(s,["anchor","lockScroll","part","style"]);let[l,d]=useState({maxX:0,maxY:0,radius:0,x1:0,x2:0,y1:0,y2:0}),{refs:u}=useFloating({middleware:[{name:"clipPath",fn({elements:c,rects:f}){return d({maxX:c.floating.clientWidth,maxY:c.floating.clientHeight,radius:da(c.reference),x1:f.reference.x,x2:f.reference.x+f.reference.width,y1:f.reference.y,y2:f.reference.y+f.reference.height}),{}}}],open:!0,placement:"top-center",transform:!1,whileElementsMounted:autoUpdate});return useEffect(()=>{try{let c=document.querySelector(e);c!=null?u.setReference(c):console.debug(`[frigade] Spotlight: No anchor found for selector: ${e}`);}catch(c){}},[e,u]),jsx($e,i({lockScroll:o,part:["spotlight",t],ref:u.setFloating,style:i({clipPath:pa(l)},r)},n))}function Ze(e,o=!0){let[t,r]=useState(!1);useEffect(()=>{if(!t&&o&&e instanceof Element){let n=typeof o!="boolean"?o:{behavior:"smooth",block:"center"},a;window.addEventListener("scroll",function s(){clearTimeout(a),a=setTimeout(()=>{window.removeEventListener("scroll",s),r(!0);},100);},!0),e.scrollIntoView(n);}else o||r(!0);},[o,e,t]);}function Br(e,o){try{if(ot.matchesSelector(e,o)&&Or(e))return e;let t=ot(o,e);if(t.length>0&&Or(t[0]))return t[0]}catch(t){return null}}function Or(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Er(e){let[o,t]=useState(null);return useEffect(()=>{if(typeof e=="string")try{let r=ot(e)[0];r!=null?(console.debug(`[frigade] Found anchor: ${e}`),t(r)):console.debug(`[frigade] No anchor found for selector: ${e}`);}catch(r){console.debug(`[frigade] Invalid selector for anchor: ${e}`);}},[e]),useEffect(()=>{if(typeof e!="string")return;let r=new MutationObserver(n=>{for(let a of n)if(a.type==="childList"){for(let s of a.addedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;let l=Br(s,e);if(l!=null){console.debug(`[frigade] Found anchor: ${e}`),t(l);break}}for(let s of a.removedNodes){if(s.nodeType!==Node.ELEMENT_NODE)continue;if(Br(s,e)!=null){console.debug(`[frigade] Removed anchor: ${e}`),t(null);break}}}});return r.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>r.disconnect()},[e]),{anchorElement:o}}function Ta(e){switch(e){case"after":return "end";case"before":return "start";default:return e}}function Ye({align:e,alignOffset:o,anchor:t,nodeId:r,onOpenChange:n=()=>{},open:a,side:s,sideOffset:l}){let d=`${s}-${Ta(e)}`;function u({rects:U}){let N={alignmentAxis:o,mainAxis:l};return ["after","before"].includes(e)&&(["bottom","top"].includes(s)?N.alignmentAxis=o-U.floating.width:N.alignmentAxis=o-U.floating.height),N}let H=useFloating({middleware:[offset(u,[e,o,s,l]),flip(),shift()],nodeId:r,onOpenChange:n,open:a,placement:d,whileElementsMounted:autoUpdate}),{context:c,floatingStyles:f,placement:y,refs:C}=H,v=g(H,["context","floatingStyles","placement","refs"]),h=useClick(c),b=useDismiss(c,{outsidePress:!1}),S=useFocus(c),B=useRole(c),O=useTransitionStatus(c),{getFloatingProps:T,getReferenceProps:k}=useInteractions([h,b,S,B]),{anchorElement:w}=Er(t);useEffect(()=>{w!=null&&C.setReference(w);},[t,w,C]);let E=y.split("-");return e==="before"?E[1]=E[1]==="end"?"after":"before":e==="after"&&(E[1]=E[1]==="start"?"before":"after"),i({context:c,getFloatingProps:T,getReferenceProps:k,floatingStyles:f,placement:E.join("-"),refs:C,status:O},v)}var Qe=createContext({floatingNodeId:null,isOpen:!1,setIsOpen:()=>{}});function Ae(C){var v=C,{align:e="center",alignOffset:o=0,anchor:t,autoScroll:r=!1,children:n,defaultOpen:a=!1,modal:s=!1,onOpenChange:l=()=>{},open:d,side:u="bottom",sideOffset:c=0,spotlight:f=!1}=v,y=g(v,["align","alignOffset","anchor","autoScroll","children","defaultOpen","modal","onOpenChange","open","side","sideOffset","spotlight"]);let[h,b]=useState(a),S=d!=null?d:h,B=useFloatingNodeId(),O=Ye(i({align:e,alignOffset:o,anchor:t,nodeId:B,onOpenChange:k=>{l(k),d==null&&b(k);},open:S,side:u,sideOffset:c},y)),{refs:T}=O;return Ze(T.reference.current,r),jsxs(Qe.Provider,{value:{floating:O,floatingNodeId:B,isOpen:S,setIsOpen:b},children:[f&&S&&jsx(qe,{anchor:t}),s&&!f&&S&&jsx($e,{lockScroll:!0}),n]})}var tt={height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}};function bo(){let e="DOMRect"in globalThis?new DOMRect:tt,[o,t]=useState(e),[r,n]=useState(null),a=useCallback(s=>{n(s);},[]);return useLayoutEffect(()=>{if(!r)return;let s=()=>{let l=r.getBoundingClientRect();t(l);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:a}}function Po(e){let[o,t]=useState(!1),[r,n]=useState(tt),a=r.height>0&&r.width>0;return useEffect(()=>{if(e==null)return;let s=new IntersectionObserver(l=>{let d=l[0];n(d.boundingClientRect),t(d.isIntersecting);},{root:null});return s.observe(e),()=>{s.disconnect();}},[e]),{isVisible:o&&a}}function Me(a){var s=a,{children:e,css:o,part:t,style:r}=s,n=g(s,["children","css","part","style"]);let{floating:l,floatingNodeId:d}=useContext(Qe),{isVisible:u}=Po(l==null?void 0:l.refs.reference.current);if(l==null)return null;let{floatingStyles:c,getFloatingProps:f,placement:y,refs:C,status:v}=l;return C.reference.current==null||!u||(v==null?void 0:v.isMounted)===!1?null:jsx(FloatingNode,{id:d,children:jsx(x,p(i(i({autoFocus:!0,css:i({'&[data-status="unmounted"]':{display:"none"}},o),"data-placement":y,"data-status":v.status,part:["popover-content",t],ref:C.setFloating,style:i(i({},c),r)},f()),n),{children:jsx(x,{part:"popover-transition-container",children:e})}))})}function Le(r){var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);var d;let{floating:{getReferenceProps:a,refs:s},setIsOpen:l}=useContext(Qe);return jsx(x,p(i(i({ref:s==null?void 0:s.setReference,onClick:()=>l(u=>!u),part:["popover-trigger",o]},t),(d=a==null?void 0:a())!=null?d:{}),{children:e}))}var Co={'&[data-status="open"]':{opacity:1,zIndex:1},'&[data-status="close"]':{opacity:0,zIndex:0,'& [data-status="close"]':{display:"none"}},'&[data-status="initial"]':{opacity:.8},'&[data-status="open"], &[data-status="close"]':{transition:"transform 0.2s ease-out, opacity 0.2s ease-out"},'&[data-status="initial"] .fr-popover-transition-container':{transform:"scale(0.8)"},'&[data-status="close"] .fr-popover-transition-container':{transform:"scale(0.3)"},'&[data-status="open"] .fr-popover-transition-container':{transform:"scale(1)"},"& .fr-popover-transition-container":{transformOrigin:"left",transition:"transform 0.2s ease-out"}};function Vr({onPrimary:e,onSecondary:o,openStepId:t,setOpenStepId:r,step:n}){var b,S,B,O,T,k;let a=useRef(),{handlePrimary:s,handleSecondary:l}=ae(n,{onPrimary:e,onSecondary:o}),d=t===n.id;function u(...w){return V(this,null,function*(){(yield s(...w))&&r(null);})}function c(...w){return V(this,null,function*(){(yield l(...w))&&r(null);})}function f(){clearTimeout(a.current),d||(a.current=setTimeout(()=>r(n.id),300));}function y(){clearTimeout(a.current);}let C=(S=(b=n.primaryButton)==null?void 0:b.title)!=null?S:n.primaryButtonTitle,v=(O=(B=n.secondaryButton)==null?void 0:B.title)!=null?O:n.secondaryButtonTitle,{videoProps:h}=re((T=n.props)!=null?T:{});return jsxs(Ae,{align:"start",open:d,side:"right",sideOffset:8,children:[jsxs(Le,{as:R.Row,alignItems:"center",borderRadius:"md",gap:"2",justifyContent:"space-between",onPointerEnter:f,onPointerLeave:y,padding:"1 2",part:"floating-checklist-step-list-item",style:{backgroundColor:d?"var(--fr-colors-neutral-800)":"transparent"},userSelect:"none",children:[jsx(F.Body2,{part:"floating-checklist-step-title",children:n.title}),jsx(yo,{checked:n.$state.completed||n.$state.skipped,size:"18px"})]}),jsx(Me,{css:Co,part:"floating-step",children:jsxs(P,{backgroundColor:"neutral.background",border:"md solid neutral.border",borderRadius:"md",gap:"3",minWidth:"400px",p:"2",children:[jsx(P.Media,i({src:(k=n.videoUri)!=null?k:n.imageUri,type:n.videoUri?"video":"image",css:{objectFit:"contain",width:"100%"}},h)),jsx(P.Header,{dismissible:!1,padding:"0 1",subtitle:n.subtitle}),jsxs(R.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(P.Secondary,{disabled:n.$state.blocked,onClick:c,padding:"1 2",title:v}),jsx(P.Primary,{disabled:n.$state.blocked,onClick:u,padding:"1 2",title:C})]})]})})]})}function $r(s){var l=s,{children:e,flowId:o,onPrimary:t,onSecondary:r,part:n}=l,a=g(l,["children","flowId","onPrimary","onSecondary","part"]);let[d,u]=useState(null),c=useRef();function f(){clearTimeout(c.current);}function y(){clearTimeout(c.current),d!=null&&(c.current=setTimeout(()=>u(null),300));}function C(v){!v&&d!=null&&u(null);}return jsx(W,p(i({flowId:o,part:["floating-checklist",n]},a),{children:({flow:v})=>{let h=v.getNumberOfCompletedSteps(),b=v.getNumberOfAvailableSteps(),S=e!=null?e:jsxs(R.Row,{alignItems:"center",backgroundColor:"neutral.background",border:"md solid neutral.border",borderRadius:"md",cursor:"pointer",gap:"2",padding:"1 2",part:"floating-checklist-anchor",userSelect:"none",children:[jsx(F.Body2,{fontWeight:"medium",part:"floating-checklist-title",children:v.title}),jsx(fo,{current:h,height:"24px",strokeWidth:"4px",total:b,width:"24px"})]});return jsx(FloatingTree,{children:jsxs(Ae,{align:"start",onOpenChange:C,sideOffset:4,children:[jsx(Le,{display:"inline-block",children:S}),jsx(Me,{css:p(i({},Co),{'&[data-status="initial"]':{opacity:.3},"& .fr-popover-transition-container":{transformOrigin:"top left",transition:"transform 0.2s ease-out"},'&[data-placement^="top"] .fr-popover-transition-container':{transformOrigin:"bottom left"}}),children:jsxs(P,{backgroundColor:"neutral.background",border:"md solid neutral.border",borderRadius:"md",gap:"0",onPointerEnter:f,onPointerLeave:y,p:"0 1 1",part:"floating-checklist-step-list",children:[jsx(he,{borderRadius:"md md 0 0",clipPath:"border-box",css:{"& .fr-progress-bar-fill":{borderRadius:0}},current:h,height:"5px",total:b,flexGrow:1,margin:"0 -1 2"}),Array.from(v.steps.values()).map(B=>jsx(Vr,{onPrimary:t,onSecondary:r,openStepId:d,setOpenStepId:u,step:B},B.id))]})})]})})}}))}var qa=new Set(["required","min","max","minLength","maxLength","pattern"]);function Za({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=useFormContext();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 a=Object.fromEntries(Object.entries(t).filter(([l])=>qa.has(l))),s=useController({name:t.id,control:o,rules:a});return jsx(e,p(i({},s),{fieldData:t,formContext:n,submit:r}))}function Mr({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a}){var B,O,T,k;let{__readOnly:s}=useContext(A),l=useMemo(()=>{var w,E;return (E=(w=a.fields)==null?void 0:w.filter(H=>e[H.type]!=null&&H.id))!=null?E:[]},[a.fields,e]),d=useForm({delayError:2e3,mode:"onChange",defaultValues:l.reduce((w,E)=>{var H;return w[E.id]=(H=E.value)!=null?H:"",w},{})});useEffect(()=>{d.formState.isDirty||d.reset(l.reduce((w,E)=>{var H;return w[E.id]=(H=E.value)!=null?H:"",w},{}));},[l,d]),useEffect(()=>{Object.keys(d.formState.dirtyFields).some(w=>l.some(E=>E.id===w))&&d.trigger();},[l,d,a.id]);let[u,c]=useState(!1),f=[],{control:y,handleSubmit:C}=d;function v(w,E){c(!0),t(E,w,s===!0).then(()=>c(!1));}l.forEach(w=>{e[w.type]!=null&&f.push(jsx(Za,{control:y,fieldComponent:e[w.type],fieldData:w,submit:C(v)},`${a.flow.id}-${w.id}`));});let h=(O=(B=a.primaryButton)==null?void 0:B.title)!=null?O:a.primaryButtonTitle,b=(k=(T=a.secondaryButton)==null?void 0:T.title)!=null?k:a.secondaryButtonTitle,S=!!(a.$state.blocked||!d.formState.isValid);return useEffect(()=>{d.clearErrors();},[d,a]),jsxs(Fragment,{children:[jsx(P.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsx(FormProvider,p(i({},d),{children:f})),jsxs(R.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[b&&jsx(D.Secondary,{onClick:r,title:b}),jsx(D.Primary,{disabled:S||u,onClick:C(v),title:h!=null?h:"Submit",loading:u})]},`form-footer-${a.id}`)]})}function Lr({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:"medium",mb:"2",display:"block",children:[e,jsx(x,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var st={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},oo=p(i({},st),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),wo={alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",position:"absolute",top:"-1px",width:"calc(100% + 2px)",color:"primary.foreground"};function pe({children:e,field:o,fieldData:t,fieldState:r}){var c;let{id:n,label:a,placeholder:s,props:l}=t,{error:d}=r,u=i(p(i(i(i({id:n},o),s?{placeholder:s}:{}),oo),{"aria-invalid":!!d,value:(c=o.value)!=null?c:""}),l);return jsxs(x,{part:"field",children:[jsx(at,{id:n,required:!!t.required,children:a}),e(u),jsx(Lr,{error:d})]})}function Ne(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"})}))}var rs=jo.forwardRef(({label:e,value:o},t)=>jsxs(x,{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(_e.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(x,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(x,p(i({as:_e.Indicator},wo),{children:jsx(Ne,{height:"14",width:"14"})}))})})]}));function lt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:a,value:s})=>jsx(rs,{value:s,label:a},s));return jsx(pe,p(i({},e),{children:()=>jsx(_e.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(R.Column,{gap:2,part:"field-radio-group",children:n})})}))}function Fo(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}))}function Gr(e){let{field:{onChange:o},fieldData:{options:t=[]}}=e,[r,n]=jo.useState([]);function a(s){let l=[];r.includes(s)?l=[...r.filter(d=>d!==s)]:l=[...r,s],n(l),o(l);}return jsx(pe,p(i({},e),{children:()=>jsx(R.Column,{gap:2,part:"field-select-multiple",children:t.map(({label:s,value:l})=>jsx(Ro.Root,{value:r.includes(l)?l:void 0,onCheckedChange:()=>a(l),asChild:!0,children:jsxs(x,{as:"button",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",justifyContent:"space-between",part:"field-check",px:4,py:2,children:[jsx(F.Body2,{part:"field-check-label",children:s}),jsx(x,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",id:l,padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(Ro.Indicator,{asChild:!0,children:jsx(x,p(i({},wo),{children:jsx(Ne,{height:"14",width:"14"})}))})})]})},l))})}))}var as=jo.forwardRef(({label:e,value:o},t)=>jsx(_.Item,{value:o,ref:t,asChild:!0,children:jsx(x,{"backgroundColor:hover":"neutral.900",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 pt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,a=r.map(({label:s,value:l})=>jsx(as,{value:l,label:s},l));return e.fieldData.multiple?jsx(Gr,i({},e)):jsx(pe,p(i({},e),{children:()=>jsxs(_.Root,{value:t,onValueChange:o,children:[jsx(_.Trigger,{asChild:!0,children:jsxs(F.Body2,p(i({},oo),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(_.Value,{placeholder:n!=null?n:"Select one"}),jsx(_.Icon,{children:jsx(x,{as:Fo,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(_.Portal,{children:jsx(_.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(x,p(i({},oo),{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 dt(e){return jsx(pe,p(i({},e),{children:o=>jsx(F.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function ct(e){return jsx(pe,p(i({},e),{children:o=>jsx(F.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function qr(e){let{field:{onChange:o,value:t},fieldData:{label:r,id:n=[]}}=e;return jsxs(x,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(Ro.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(x,p(i({},st),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:n,children:jsx(Ro.Indicator,{asChild:!0,children:jsx(x,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(Ne,{height:"14",fill:"currentColor"})})})}))}),jsx(F.Body2,{part:"field-checkbox-label",as:"label",htmlFor:n,children:r})]})}var ls={checkbox:qr,radio:lt,select:pt,text:dt,textarea:ct};function Ue(n){var a=n,{fieldTypes:e={},flowId:o,part:t}=a,r=g(a,["fieldTypes","flowId","part"]);let s=Object.assign({},ls,e);return jsx(W,p(i({as:P,flowId:o,part:["form",t]},r),{children:l=>jsx(Mr,i({fieldTypes:s},l))}))}var Bo={};ue(Bo,{NPS:()=>ro});function Qr({field:e,fieldData:o,submit:t,options:r,positiveLabel:n,negativeLabel:a}){var l,d;let s=r.map(u=>{let c=e.value===u.value?D.Primary:D.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(u.value),t();},title:u.label,css:{".fr-button-title":{fontSize:"15px"}}},u.value)});return jsxs(R.Column,{gap:2,children:[jsx(R.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:s}),jsxs(R.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(l=o.negativeLabel)!=null?l:a}),jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(d=o.positiveLabel)!=null?d:n})]})]})}function ro(d){var u=d,{as:e=$,flowId:o,fieldTypes:t,part:r,options:n,positiveLabel:a,negativeLabel:s}=u,l=g(u,["as","flowId","fieldTypes","part","options","positiveLabel","negativeLabel"]);var C,v,h;let{flow:c}=Oe(o),f=(v=(C=c==null?void 0:c.props)==null?void 0:C.options)!=null?v:[...Array(11)].map((b,S)=>({label:`${S}`,value:`${S}`})),y=n||f;return jsx(Ue,p(i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:b=>{var S,B,O,T,k,w;return jsx(Qr,p(i({},b),{options:y,positiveLabel:(O=(B=(S=c==null?void 0:c.props)==null?void 0:S.positiveLabel)!=null?B:a)!=null?O:"Extremely likely",negativeLabel:(w=(k=(T=c==null?void 0:c.props)==null?void 0:T.negativeLabel)!=null?k:s)!=null?w:"Not likely at all"}))}},t),modal:!1,onEscapeKeyDown:b=>{typeof l.onEscapeKeyDown=="function"&&l.onEscapeKeyDown(b),b.defaultPrevented||c.skip();},part:["nps",r]},l),{css:i({},i(p(i({},!c||c.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{".fr-card-header":{minWidth:y.length*51}}),{".fr-form":{padding:"20px","@media (max-width: 660px)":{minWidth:"100%"}},".fr-nps-field":{"@media (min-width: 660px)":{minWidth:"fit-content"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}},".fr-nps":{maxWidth:"min-content"}}),(h=l.css)!=null?h:{}))}))}function on(e,o,t){let[r,n]=useState(!1),a=useRef();return useEffect(()=>{a.current=typeof o=="string"?document.querySelector(o):o,n(!0);},[o]),r?createPortal(e,a.current,t):null}function ut({children:e,container:o="body"}){return on(e,o)}var ys=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function mt(n){var a=n,{clickable:e=!1,part:o="",style:t={}}=a,r=g(a,["clickable","part","style"]);let[s,l]=useState(!1);return useEffect(()=>{l(!0);},[]),jsxs(x,p(i({borderRadius:"24px",height:"24px",part:`ping-wrapper ${o}`,position:"relative",width:"24px",cursor:e?"pointer":void 0,style:i({opacity:s?1:0},t),transition:"opacity 0.2s ease-out"},r),{children:[jsx(x,{backgroundColor:"primary.surface",animation:`2s ease-out infinite ${ys}`,borderRadius:"24px",height:"48px",left:"-12px",part:"ping-pulse",pointerEvents:"none",position:"absolute",top:"-12px",transformOrigin:"center center",width:"48px"}),jsx(x,{backgroundColor:"primary.surface",borderRadius:"12px",height:"24px",left:"0",part:"ping",position:"absolute",top:"0",width:"24px","backgroundColor:hover":e?"primary.hover.surface":void 0})]}))}function rn({align:e,side:o}){let t={},r="-12px",n={top:"bottom",right:"left",bottom:"top",left:"right"};return t[n[o]]=r,["before","end"].includes(e)?["top","bottom"].includes(o)?t.right=r:t.bottom=r:["after","start"].includes(e)?["top","bottom"].includes(o)?t.left=r:t.top=r:["top","bottom"].includes(o)?t.left=`calc(50% + ${r})`:t.top=`calc(50% + ${r})`,t}function gt(B){var O=B,{align:e="center",alignOffset:o=0,anchor:t,autoScroll:r=!1,children:n,css:a={},defaultOpen:s=!0,lockScroll:l=!0,modal:d=!1,onMount:u,onOpenChange:c=()=>{},open:f,part:y,side:C="bottom",sideOffset:v=0,spotlight:h=!1,style:b={}}=O,S=g(O,["align","alignOffset","anchor","autoScroll","children","css","defaultOpen","lockScroll","modal","onMount","onOpenChange","open","part","side","sideOffset","spotlight","style"]);let[T,k]=useState(s),w=f!=null?f:T,{getFloatingProps:E,getReferenceProps:H,floatingStyles:U,placement:N,refs:G,status:ee}=Ye({align:e,alignOffset:o,anchor:t,onOpenChange:j=>{c(j),f==null&&k(j);},open:w,side:C,sideOffset:v}),[ne,Z]=N.split("-"),oe=H(),{isVisible:de}=Po(G.reference.current),M=useRef(!1);if(Ze(G.reference.current,r),G.reference.current!==null&&de)M.current===!1&&(M.current=!0,u==null||u());else return M.current=!1,null;return jsxs(Fragment,{children:[h&&w&&jsx(qe,{anchor:t,lockScroll:l}),d&&!h&&w&&jsx($e,{lockScroll:l}),jsxs(x,p(i(i({css:i({'&[data-status="open"]':{transition:"transform 0.2s ease-out"}},a),"data-placement":N,"data-status":ee.status,part:["hint",y],ref:G.setFloating,style:i(i({},U),b)},E()),S),{children:[w&&n,jsx(mt,p(i({},oe),{position:"absolute",style:rn({align:Z,side:ne}),clickable:s===!1}))]}))]})}var Ss=keyframes`
60
61
  from {
61
62
  opacity: 0;
62
63
  }
@@ -66,7 +67,7 @@ var It=Object.defineProperty,En=Object.defineProperties;var In=Object.getOwnProp
66
67
  to {
67
68
  opacity: 1;
68
69
  }
69
- `;function Oo(S){var B=S,{align:e,alignOffset:o,autoScroll:t,defaultOpen:r,dismissible:n,flow:a,handleDismiss:s,lockScroll:l,modal:d,onPrimary:u,onSecondary:c,part:f,side:y,sideOffset:C,spotlight:v,step:h}=B,b=g(B,["align","alignOffset","autoScroll","defaultOpen","dismissible","flow","handleDismiss","lockScroll","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var N,G,ee,ne,Z;let{handlePrimary:O,handleSecondary:T}=ae(h,{onPrimary:u,onSecondary:c}),{videoProps:k,otherProps:w}=re(b),E=(G=(N=h.primaryButton)==null?void 0:N.title)!=null?G:h.primaryButtonTitle,H=(ne=(ee=h.secondaryButton)==null?void 0:ee.title)!=null?ne:h.secondaryButtonTitle,z=!!h.$state.blocked;return jsx(ft,p(i({align:e,alignOffset:o,anchor:h.selector,autoScroll:t,"data-step-id":h.id,defaultOpen:r,lockScroll:l,modal:d,part:f,side:y,sideOffset:C,spotlight:v,onMount:()=>{r&&!z&&(h==null||h.start());}},w),{children:jsxs(P,{animation:`${Cs} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsx(P.Media,i({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(Z=h.videoUri)!=null?Z:h.imageUri,transform:"translate3d(0, 0, 1px)",type:h.videoUri?"video":"image"},k)),jsx(P.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:s,subtitle:h.subtitle,title:h.title}),jsxs(P.Footer,{children:[a.getNumberOfAvailableSteps()>1&&jsx(De,{current:a.getCurrentStepOrder()+1,marginRight:"auto",total:a.getNumberOfAvailableSteps()}),jsx(P.Secondary,{disabled:z,onClick:T,title:H}),jsx(P.Primary,{disabled:z,onClick:O,title:E})]})]})}))}function an(n){var a=n,{children:e,container:o,flowId:t}=a,r=g(a,["children","container","flowId"]);return jsx(ct,{container:o,children:jsx(x,p(i({"data-flow-id":t,part:"tour"},r),{children:e}))})}function Eo(r){var n=r,{as:e,flowId:o}=n,t=g(n,["as","flowId"]);let{onDismiss:a,onPrimary:s,onSecondary:l}=t;return jsx(W,p(i({as:null,flowId:o,autoStart:!1},t),{children:({flow:d,handleDismiss:u,parentProps:c,step:f})=>{var de;let oe=c.containerProps,{align:y="after",alignOffset:C=0,autoScroll:v=!1,container:h="body",defaultOpen:b,lockScroll:S=!0,modal:B,onOpenChange:O,open:T,part:k,sequential:w=!0,side:E="bottom",sideOffset:H=0,spotlight:z,zIndex:N=9999}=oe,G=g(oe,["align","alignOffset","autoScroll","container","defaultOpen","lockScroll","modal","onOpenChange","open","part","sequential","side","sideOffset","spotlight","zIndex"]),{dismissible:ee}=c,ne=i({align:y,alignOffset:C,autoScroll:v,dismissible:ee,flow:d,handleDismiss:u,modal:B,onPrimary:s,onSecondary:l,onOpenChange:O,open:T,part:k,side:E,sideOffset:H,spotlight:z,step:f,zIndex:N},(de=f.props)!=null?de:{});if(w)return jsx(an,p(i({as:e,container:h,flowId:o,part:"tour",zIndex:N},G),{children:jsx(Oo,i({defaultOpen:b!=null?b:!0,lockScroll:S},ne),f.id)}));let Z=Array.from(d.steps.values()).filter(M=>{let{blocked:K,completed:j,skipped:te,visible:ie}=M.$state;return !K&&!j&&!te&&ie}).map(M=>{var xe,ce,kt,Bt;function K(Ot){return V(this,null,function*(){return (yield a==null?void 0:a(d,Ot))===!1?(Ot.preventDefault(),!1):(M.skip(),!0)})}let j=z&&M.id===f.id,te=(ce=(xe=M.props)==null?void 0:xe.zIndex)!=null?ce:N,ie=i({align:y,alignOffset:C,dismissible:ee,flow:d,handleDismiss:K,onPrimary:s,onSecondary:l,onOpenChange:O,open:T,part:k,side:E,sideOffset:H,spotlight:z,zIndex:te},(kt=M.props)!=null?kt:{});return jsx(Oo,i({css:{"&:has([aria-expanded=true])":{zIndex:Number(te)+2},".fr-overlay":{zIndex:Number(te)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(Bt=b||j)!=null?Bt:!1,lockScroll:S,step:M},ie),`${M.id}-${j}`)});return jsx(an,p(i({as:e,container:h,flowId:o,part:"tour",zIndex:N},G),{children:Z}))}}))}var Io="useSyncExternalStore"in jo?jo.useSyncExternalStore:sn.useSyncExternalStore;function Do(){let{frigade:e}=useContext(A),[,o]=useState(!1),t=useRef(),r=useCallback(s=>{e==null||e.getCollections().then(()=>{s();});let l=()=>{clearTimeout(t.current),t.current=setTimeout(()=>{o(d=>!d),s();},0);};return e==null||e.on("flow.any",l),()=>{e==null||e.off("flow.any",l);}},[e]),n=()=>{let s;try{s=e==null?void 0:e.getCollectionsSync();}catch(l){}return s};return {collections:Io(r,n,n)}}function Ho(e){var l,d,u,c;let{frigade:o}=useContext(A),{collections:t}=Do(),r=t==null?void 0:t.get(e),a=(c=((u=(d=(l=t==null?void 0:t.get(e))==null?void 0:l.flows)==null?void 0:d.filter(f=>f.visible).map(f=>p(i({},f),{flow:o==null?void 0:o.getFlowSync(f.flowId)})))!=null?u:[]).find(({flow:f})=>f==null?void 0:f.isVisible))==null?void 0:c.flowId,{flow:s}=Oe(a);return useEffect(()=>{o==null||o.registerCollection(e);},[e,o]),{collection:r,currentFlow:s}}function yt(n){var a=n,{collectionId:e,part:o,variables:t={}}=a,r=g(a,["collectionId","part","variables"]);var u,c,f;let s={ANNOUNCEMENT:xt,BANNER:Xo,CARD:P,CHECKLIST:xo,EMBEDDED_TIP:P,FORM:ze,NPS_SURVEY:to,SURVEY:to,TOUR:Eo},{currentFlow:l}=Ho(e),d=(c=s[(u=l==null?void 0:l.rawData)==null?void 0:u.flowType])!=null?c:null;return l==null||d==null?null:((f=l==null?void 0:l.rawData)==null?void 0:f.flowType)===FlowType.FORM?jsx(x,p(i({part:["collection",o],"data-collection-id":e},r),{children:jsx(ze,{flowId:l.id,as:$,variables:t},l.id)})):jsx(x,p(i({part:["collection",o],"data-collection-id":e},r),{children:jsx(d,{flowId:l.id,variables:t},l.id)}))}function ln(){var t,r;let{collections:e}=Do(),o=(r=Array.from((t=e==null?void 0:e.entries())!=null?t:[]).find(n=>n[1].collectionType==="DEFAULT"))==null?void 0:r[0];return Ho(o),o==null?null:jsx(yt,{as:null,collectionId:o})}var A=createContext({apiKey:"",currentModal:null,setCurrentModal:()=>{},navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});var Se=(e,o="log")=>{let t=`__frigade_logged_${e}`;globalThis[t]||(globalThis[t]=!0,console[o](e));};function ht(){let e=useContext(A);(!e||!e.frigade)&&Se("useFrigade() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e;return {frigade:o,isLoading:!(o!=null&&o.isReady())}}function pn(){let{frigade:e}=ht();return useEffect(()=>{V(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[e]),null}var dn="2.9.6";function gn(l){var d=l,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n,themeSelector:a=":root"}=d,s=g(d,["children","css","defaultCollection","navigate","theme","themeSelector"]);let u=n?_o(n):{},c=useRef(new Map),f=useRef(),[y,C]=useState(!1),[v,h]=useState(null),b=useMemo(()=>(C(!1),f.current=void 0,new Frigade(s.apiKey,{apiKey:s.apiKey,apiUrl:s.apiUrl,userId:s.userId,groupId:s.groupId,userProperties:s.userProperties,groupProperties:s.groupProperties,generateGuestId:s.generateGuestId,syncOnWindowUpdates:s.syncOnWindowUpdates,__readOnly:s.__readOnly,__flowStateOverrides:s.__flowStateOverrides,__platformVersion:dn,__platformName:"React"})),[s.userId,s.groupId,s.apiKey]);useEffect(()=>{if(s.__flowStateOverrides){let k=b.getConfig();k.__flowStateOverrides=s.__flowStateOverrides,b.reload(k);}},[b,s.__flowStateOverrides]);function S(){let k=[...c.current.entries()].map(([w,E])=>[w,E.callback]);b.batchRegister(k),C(!0);}function B(k,w){if(f.current&&clearTimeout(f.current),y){c.current.has(k)?b.getFlow(k).then(E=>w(E.isVisible)):(b.getFlow(k).then(E=>E.register(w)),c.current.set(k,{callback:w}));return}c.current.has(k)||c.current.set(k,{callback:w}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>S(),0);}function O(k){c.current.has(k)&&b.getFlow(k).then(w=>{c.current.delete(k),w==null||w.unregister();});}let T=r!=null?r:(k,w="_self")=>{window.open(k,w);};return useEffect(()=>()=>{b.destroy();},[b]),jsxs(A.Provider,{value:p(i({currentModal:v,setCurrentModal:h,navigate:T},s),{frigade:b,registerComponent:B,unregisterComponent:O,hasInitialized:y,variables:s.variables||{}}),children:[jsx(Global,{styles:{[a]:i(i(i({},Uo),u),o)}}),jsxs(ThemeProvider,{theme:I,children:[t&&jsx(ln,{}),e]}),s.preloadImages!==!1&&jsx(pn,{})]})}function Oe(e,o){let t=useContext(A);(!t||!t.frigade)&&Se(`useFlow('${e}') must be used in a child of the Frigade Provider`,"warn");let{frigade:r,variables:n}=t!=null?t:{},[,a]=useState(!1),s=useCallback(d=>{r==null||r.getFlow(e).then(()=>{d();});let u=(c,f)=>{f.id===e&&setTimeout(()=>{a(y=>!y),d();},0);};return r==null||r.on("flow.any",u),()=>{r==null||r.off("flow.any",u);}},[e,r]),l=Io(s,()=>r==null?void 0:r.getFlowSync(e),()=>r==null?void 0:r.getFlowSync(e));return useEffect(()=>{l==null||l.applyVariables(i(i({},n),o==null?void 0:o.variables));},[o==null?void 0:o.variables,l,e,n]),{flow:l,isLoading:r!=null&&r.hasFailedToLoad()?!1:!l}}function Pt(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{if(e==null)return;function n(){return V(this,null,function*(){e.isCompleted&&r.current===!1&&(r.current=!0,yield o==null?void 0:o(e));})}return n(),r.current=e==null?void 0:e.isCompleted,()=>{n();}},[e,e==null?void 0:e.isCompleted,o]),{handleDismiss:useCallback(n=>V(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e,t])}}function hn(e,o=!0){let{currentModal:t,setCurrentModal:r}=useContext(A),n=useCallback(s=>{o&&(e!=null&&e.isVisible)&&r(s);},[o,e==null?void 0:e.isVisible,r]),a=useCallback(()=>{e!=null&&t===(e==null?void 0:e.id)&&r(null);},[t,e,r]);return useEffect(()=>(e!=null&&t===null&&e.isVisible&&n(e.id),a),[n,t,e,a]),useEffect(()=>{e!=null&&(!o||!e.isVisible)&&a();},[e,o,a]),e==null?{hasModalCollision:!1}:!o||!e.isVisible?{hasModalCollision:!1}:t===e.id?{hasModalCollision:!1}:t===null?{hasModalCollision:!1}:{hasModalCollision:!0}}function St(e){return typeof e=="function"&&e.displayName==="Dialog"}function W(c){var f=c,{as:e,autoStart:o=!0,children:t,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:l,variables:d}=f,u=g(f,["as","autoStart","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var ee,ne,Z,de;let{flow:y}=Oe(r,{variables:d}),C=y==null?void 0:y.getCurrentStep(),v=(ee=C==null?void 0:C.props)!=null?ee:{},{otherProps:h}=re(v),oe=i(i(i({},u),(ne=y==null?void 0:y.props)!=null?ne:{}),((Z=y==null?void 0:y.rawData)==null?void 0:Z.flowType)===FlowType.CHECKLIST?{}:h),{dismissible:b=!!St(e),forceMount:S=!1}=oe,B=g(oe,["dismissible","forceMount"]),{handleDismiss:O}=Pt(y,{onComplete:n,onDismiss:a}),{handlePrimary:T,handleSecondary:k}=ae(C,{onPrimary:s,onSecondary:l}),w=(B==null?void 0:B.modal)||St(e)||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((de=y==null?void 0:y.rawData)==null?void 0:de.flowType),{hasModalCollision:E}=hn(y,w);function H(M){if(b===!1){M.preventDefault();return}typeof u.onEscapeKeyDown=="function"&&u.onEscapeKeyDown(M),M.defaultPrevented||O(M);}let z=S&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||(!y.isVisible||E)&&!z)return null;(z||!y.isCompleted&&!y.isSkipped&&o)&&(C==null||C.start());let N=e===null?Fragment$1:e!=null?e:x,G=p(i({},B),{"data-flow-id":y.id});return St(e)&&(G.onEscapeKeyDown=H),jsx(N,p(i({},e===null?{}:G),{children:t({flow:y,handleDismiss:O,handlePrimary:T,handleSecondary:k,parentProps:{as:e,dismissible:b,flowId:r,variables:d,containerProps:G},step:C})}))}function Pn(t){var r=t,{part:e}=r,o=g(r,["part"]);return jsx(W,p(i({as:P,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:a,handleSecondary:s,parentProps:{dismissible:l},step:d})=>{var y,C,v,h,b,S;let u=(C=(y=d.primaryButton)==null?void 0:y.title)!=null?C:d.primaryButtonTitle,c=(h=(v=d.secondaryButton)==null?void 0:v.title)!=null?h:d.secondaryButtonTitle,{videoProps:f}=re((b=d.props)!=null?b:{});return jsxs(Fragment,{children:[jsx(P.Header,{dismissible:l,handleDismiss:n,subtitle:d.subtitle,title:d.title}),jsx(P.Media,i({src:(S=d.videoUri)!=null?S:d.imageUri,type:d.videoUri?"video":"image",css:{objectFit:"contain",width:"100%"}},f)),jsxs(R.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(P.Secondary,{title:c,onClick:s}),jsx(P.Primary,{title:u,onClick:a})]})]})}}))}function $o(r){var n=r,{part:e,src:o}=n,t=g(n,["part","src"]);return jsx(x,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Js(e){var o,t,r,n,a;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.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/${(a=e.split("loom.com/share/")[1])==null?void 0:a.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Ao(v){var h=v,{autoPlay:e,controls:o,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:a,loop:s,muted:l,playsInline:d,poster:u,preload:c,part:f,src:y}=h,C=g(h,["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","part","src"]);let b=Js(y);return b?jsx(x,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",f],src:b},C)):y!=null&&y.endsWith(".mp4")?jsx(x,i({as:"video",part:["video",f],src:y,autoPlay:e,controls:o!=null?o:!0,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:a,loop:s,muted:l!=null?l:e,playsInline:d,poster:u,preload:c},C)):(console.error(`Could not map videoUri ${y} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ve(r){var n=r,{src:e,type:o}=n,t=g(n,["src","type"]);return jsx(o==="video"?Ao:$o,i({src:e},t))}var P=jo.forwardRef((a,n)=>{var s=a,{children:e,flowId:o,part:t}=s,r=g(s,["children","flowId","part"]);var d;if(o!=null)return jsx(Pn,i({flowId:o},r));let l=(d=r.as)!=null?d:R.Column;return jsx(l,p(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},r),{ref:n,children:e}))});P.Dismiss=e=>jsx(D.Plain,p(i({"aria-label":"Dismiss",part:"dismiss",padding:0},e),{children:jsx(Ie,{height:"20",fill:"currentColor"})}));P.Footer=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return jsx(R.Row,p(i({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};P.Header=s=>{var l=s,{dismissible:e,handleDismiss:o,part:t,subtitle:r,title:n}=l,a=g(l,["dismissible","handleDismiss","part","subtitle","title"]);return !e&&(n==null||(n==null?void 0:n.length)===0)&&(r==null||(r==null?void 0:r.length)===0)?null:jsxs(R.Row,p(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},a),{children:[jsx(P.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsx(P.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(P.Subtitle,{color:"neutral.400",flexBasis:"100%",children:r})]}))};P.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(ve,i({borderRadius:"md",src:e},o))};P.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Primary,i({title:o,onClick:e},t))};P.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Secondary,i({title:o,onClick:e},t))};P.Subtitle=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsx(F.Body2,p(i({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};P.Title=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsx(F.H4,p(i({display:"block",part:["title",o]},t),{children:e}))};var Mo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function vn(e){let o=Object.fromEntries(Mo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(Mo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!Mo.content.some(a=>a===n)&&!Mo.root.some(a=>a===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var Qs=keyframes`
70
+ `;function Oo(S){var B=S,{align:e,alignOffset:o,autoScroll:t,defaultOpen:r,dismissible:n,flow:a,handleDismiss:s,lockScroll:l,modal:d,onPrimary:u,onSecondary:c,part:f,side:y,sideOffset:C,spotlight:v,step:h}=B,b=g(B,["align","alignOffset","autoScroll","defaultOpen","dismissible","flow","handleDismiss","lockScroll","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var N,G,ee,ne,Z;let{handlePrimary:O,handleSecondary:T}=ae(h,{onPrimary:u,onSecondary:c}),{videoProps:k,otherProps:w}=re(b),E=(G=(N=h.primaryButton)==null?void 0:N.title)!=null?G:h.primaryButtonTitle,H=(ne=(ee=h.secondaryButton)==null?void 0:ee.title)!=null?ne:h.secondaryButtonTitle,U=!!h.$state.blocked;return jsx(gt,p(i({align:e,alignOffset:o,anchor:h.selector,autoScroll:t,"data-step-id":h.id,defaultOpen:r,lockScroll:l,modal:d,part:f,side:y,sideOffset:C,spotlight:v,onMount:()=>{r&&!U&&(h==null||h.start());}},w),{children:jsxs(P,{animation:`${Ss} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsx(P.Media,i({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(Z=h.videoUri)!=null?Z:h.imageUri,transform:"translate3d(0, 0, 1px)",type:h.videoUri?"video":"image"},k)),jsx(P.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:s,subtitle:h.subtitle,title:h.title}),jsxs(P.Footer,{children:[a.getNumberOfAvailableSteps()>1&&jsx(De,{current:a.getCurrentStepOrder()+1,marginRight:"auto",total:a.getNumberOfAvailableSteps()}),jsx(P.Secondary,{disabled:U,onClick:T,title:H}),jsx(P.Primary,{disabled:U,onClick:O,title:E})]})]})}))}function sn(n){var a=n,{children:e,container:o,flowId:t}=a,r=g(a,["children","container","flowId"]);return jsx(ut,{container:o,children:jsx(x,p(i({"data-flow-id":t,part:"tour"},r),{children:e}))})}function Eo(r){var n=r,{as:e,flowId:o}=n,t=g(n,["as","flowId"]);let{onDismiss:a,onPrimary:s,onSecondary:l}=t;return jsx(W,p(i({as:null,flowId:o,autoStart:!1},t),{children:({flow:d,handleDismiss:u,parentProps:c,step:f})=>{var de;let oe=c.containerProps,{align:y="after",alignOffset:C=0,autoScroll:v=!1,container:h="body",defaultOpen:b,lockScroll:S=!0,modal:B,onOpenChange:O,open:T,part:k,sequential:w=!0,side:E="bottom",sideOffset:H=0,spotlight:U,zIndex:N=9999}=oe,G=g(oe,["align","alignOffset","autoScroll","container","defaultOpen","lockScroll","modal","onOpenChange","open","part","sequential","side","sideOffset","spotlight","zIndex"]),{dismissible:ee}=c,ne=i({align:y,alignOffset:C,autoScroll:v,dismissible:ee,flow:d,handleDismiss:u,modal:B,onPrimary:s,onSecondary:l,onOpenChange:O,open:T,part:k,side:E,sideOffset:H,spotlight:U,step:f,zIndex:N},(de=f.props)!=null?de:{});if(w)return jsx(sn,p(i({as:e,container:h,flowId:o,part:"tour",zIndex:N},G),{children:jsx(Oo,i({defaultOpen:b!=null?b:!0,lockScroll:S},ne),f.id)}));let Z=Array.from(d.steps.values()).filter(M=>{let{blocked:K,completed:j,skipped:te,visible:ie}=M.$state;return !K&&!j&&!te&&ie}).map(M=>{var xe,ce,Bt,Ot;function K(Et){return V(this,null,function*(){return (yield a==null?void 0:a(d,Et))===!1?(Et.preventDefault(),!1):(M.skip(),!0)})}let j=U&&M.id===f.id,te=(ce=(xe=M.props)==null?void 0:xe.zIndex)!=null?ce:N,ie=i({align:y,alignOffset:C,dismissible:ee,flow:d,handleDismiss:K,onPrimary:s,onSecondary:l,onOpenChange:O,open:T,part:k,side:E,sideOffset:H,spotlight:U,zIndex:te},(Bt=M.props)!=null?Bt:{});return jsx(Oo,i({css:{"&:has([aria-expanded=true])":{zIndex:Number(te)+2},".fr-overlay":{zIndex:Number(te)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(Ot=b||j)!=null?Ot:!1,lockScroll:S,step:M},ie),`${M.id}-${j}`)});return jsx(sn,p(i({as:e,container:h,flowId:o,part:"tour",zIndex:N},G),{children:Z}))}}))}var Io="useSyncExternalStore"in jo?jo.useSyncExternalStore:ln.useSyncExternalStore;function Do(){let{frigade:e}=useContext(A),[,o]=useState(!1),t=useRef(),r=useCallback(s=>{e==null||e.getCollections().then(()=>{s();});let l=()=>{clearTimeout(t.current),t.current=setTimeout(()=>{o(d=>!d),s();},0);};return e==null||e.on("flow.any",l),()=>{e==null||e.off("flow.any",l);}},[e]),n=()=>{let s;try{s=e==null?void 0:e.getCollectionsSync();}catch(l){}return s};return {collections:Io(r,n,n)}}function Ho(e){var l,d,u,c;let{frigade:o}=useContext(A),{collections:t}=Do(),r=t==null?void 0:t.get(e),a=(c=((u=(d=(l=t==null?void 0:t.get(e))==null?void 0:l.flows)==null?void 0:d.filter(f=>f.visible).map(f=>p(i({},f),{flow:o==null?void 0:o.getFlowSync(f.flowId)})))!=null?u:[]).find(({flow:f})=>f==null?void 0:f.isVisible))==null?void 0:c.flowId,{flow:s}=Oe(a);return useEffect(()=>{o==null||o.registerCollection(e);},[e,o]),{collection:r,currentFlow:s}}function xt(n){var a=n,{collectionId:e,part:o,variables:t={}}=a,r=g(a,["collectionId","part","variables"]);var u,c,f;let s={ANNOUNCEMENT:ht,BANNER:Xo,CARD:P,CHECKLIST:ho,EMBEDDED_TIP:P,FORM:Ue,NPS_SURVEY:ro,SURVEY:ro,TOUR:Eo},{currentFlow:l}=Ho(e),d=(c=s[(u=l==null?void 0:l.rawData)==null?void 0:u.flowType])!=null?c:null;return l==null||d==null?null:((f=l==null?void 0:l.rawData)==null?void 0:f.flowType)===FlowType.FORM?jsx(x,p(i({part:["collection",o],"data-collection-id":e},r),{children:jsx(Ue,{flowId:l.id,as:$,variables:t},l.id)})):jsx(x,p(i({part:["collection",o],"data-collection-id":e},r),{children:jsx(d,{flowId:l.id,variables:t},l.id)}))}function pn(){var t,r;let{collections:e}=Do(),o=(r=Array.from((t=e==null?void 0:e.entries())!=null?t:[]).find(n=>n[1].collectionType==="DEFAULT"))==null?void 0:r[0];return Ho(o),o==null?null:jsx(xt,{as:null,collectionId:o})}var A=createContext({apiKey:"",currentModal:null,setCurrentModal:()=>{},navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});var Se=(e,o="log")=>{let t=`__frigade_logged_${e}`;globalThis[t]||(globalThis[t]=!0,console[o](e));};function bt(){let e=useContext(A);(!e||!e.frigade)&&Se("useFrigade() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e;return {frigade:o,isLoading:!(o!=null&&o.isReady())}}function dn(){let{frigade:e}=bt();return useEffect(()=>{V(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[e]),null}var cn="2.9.6";function yn(l){var d=l,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n,themeSelector:a=":root"}=d,s=g(d,["children","css","defaultCollection","navigate","theme","themeSelector"]);let u=n?_o(n):{},c=useRef(new Map),f=useRef(),[y,C]=useState(!1),[v,h]=useState(null),b=useMemo(()=>(C(!1),f.current=void 0,new Frigade(s.apiKey,{apiKey:s.apiKey,apiUrl:s.apiUrl,userId:s.userId,groupId:s.groupId,userProperties:s.userProperties,groupProperties:s.groupProperties,generateGuestId:s.generateGuestId,syncOnWindowUpdates:s.syncOnWindowUpdates,__readOnly:s.__readOnly,__flowStateOverrides:s.__flowStateOverrides,__platformVersion:cn,__platformName:"React"})),[s.userId,s.groupId,s.apiKey]);useEffect(()=>{if(s.__flowStateOverrides){let k=b.getConfig();k.__flowStateOverrides=s.__flowStateOverrides,b.reload(k);}},[b,s.__flowStateOverrides]);function S(){let k=[...c.current.entries()].map(([w,E])=>[w,E.callback]);b.batchRegister(k),C(!0);}function B(k,w){if(f.current&&clearTimeout(f.current),y){c.current.has(k)?b.getFlow(k).then(E=>w(E.isVisible)):(b.getFlow(k).then(E=>E.register(w)),c.current.set(k,{callback:w}));return}c.current.has(k)||c.current.set(k,{callback:w}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>S(),0);}function O(k){c.current.has(k)&&b.getFlow(k).then(w=>{c.current.delete(k),w==null||w.unregister();});}let T=r!=null?r:(k,w="_self")=>{window.open(k,w);};return useEffect(()=>()=>{b.destroy();},[b]),jsxs(A.Provider,{value:p(i({currentModal:v,setCurrentModal:h,navigate:T},s),{frigade:b,registerComponent:B,unregisterComponent:O,hasInitialized:y,variables:s.variables||{}}),children:[jsx(Global,{styles:{[a]:i(i(i({},zo),u),o)}}),jsxs(ThemeProvider,{theme:I,children:[t&&jsx(pn,{}),e]}),s.preloadImages!==!1&&jsx(dn,{})]})}function Oe(e,o){let t=useContext(A);(!t||!t.frigade)&&Se(`useFlow('${e}') must be used in a child of the Frigade Provider`,"warn");let{frigade:r,variables:n}=t!=null?t:{},[,a]=useState(!1),s=useCallback(d=>{r==null||r.getFlow(e).then(()=>{d();});let u=(c,f)=>{f.id===e&&setTimeout(()=>{a(y=>!y),d();},0);};return r==null||r.on("flow.any",u),()=>{r==null||r.off("flow.any",u);}},[e,r]),l=Io(s,()=>r==null?void 0:r.getFlowSync(e),()=>r==null?void 0:r.getFlowSync(e));return useEffect(()=>{l==null||l.applyVariables(i(i({},n),o==null?void 0:o.variables));},[o==null?void 0:o.variables,l,e,n]),{flow:l,isLoading:r!=null&&r.hasFailedToLoad()?!1:!l}}function Ct(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{if(e==null)return;function n(){return V(this,null,function*(){e.isCompleted&&r.current===!1&&(r.current=!0,yield o==null?void 0:o(e));})}return n(),r.current=e==null?void 0:e.isCompleted,()=>{n();}},[e,e==null?void 0:e.isCompleted,o]),{handleDismiss:useCallback(n=>V(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e,t])}}function bn(e,o=!0){let{currentModal:t,setCurrentModal:r}=useContext(A),n=useCallback(s=>{o&&(e!=null&&e.isVisible)&&r(s);},[o,e==null?void 0:e.isVisible,r]),a=useCallback(()=>{e!=null&&t===(e==null?void 0:e.id)&&r(null);},[t,e,r]);return useEffect(()=>(e!=null&&t===null&&e.isVisible&&n(e.id),a),[n,t,e,a]),useEffect(()=>{e!=null&&(!o||!e.isVisible)&&a();},[e,o,a]),e==null?{hasModalCollision:!1}:!o||!e.isVisible?{hasModalCollision:!1}:t===e.id?{hasModalCollision:!1}:t===null?{hasModalCollision:!1}:{hasModalCollision:!0}}function vt(e){return typeof e=="function"&&e.displayName==="Dialog"}function W(c){var f=c,{as:e,autoStart:o=!0,children:t,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:l,variables:d}=f,u=g(f,["as","autoStart","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var ee,ne,Z,de;let{flow:y}=Oe(r,{variables:d}),C=y==null?void 0:y.getCurrentStep(),v=(ee=C==null?void 0:C.props)!=null?ee:{},{otherProps:h}=re(v),oe=i(i(i({},u),(ne=y==null?void 0:y.props)!=null?ne:{}),((Z=y==null?void 0:y.rawData)==null?void 0:Z.flowType)===FlowType.CHECKLIST?{}:h),{dismissible:b=!!vt(e),forceMount:S=!1}=oe,B=g(oe,["dismissible","forceMount"]),{handleDismiss:O}=Ct(y,{onComplete:n,onDismiss:a}),{handlePrimary:T,handleSecondary:k}=ae(C,{onPrimary:s,onSecondary:l}),w=(B==null?void 0:B.modal)||vt(e)||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((de=y==null?void 0:y.rawData)==null?void 0:de.flowType),{hasModalCollision:E}=bn(y,w);function H(M){if(b===!1){M.preventDefault();return}typeof u.onEscapeKeyDown=="function"&&u.onEscapeKeyDown(M),M.defaultPrevented||O(M);}let U=S&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||(!y.isVisible||E)&&!U)return null;(U||!y.isCompleted&&!y.isSkipped&&o)&&(C==null||C.start());let N=e===null?Fragment$1:e!=null?e:x,G=p(i({},B),{"data-flow-id":y.id});return vt(e)&&(G.onEscapeKeyDown=H),jsx(N,p(i({},e===null?{}:G),{children:t({flow:y,handleDismiss:O,handlePrimary:T,handleSecondary:k,parentProps:{as:e,dismissible:b,flowId:r,variables:d,containerProps:G},step:C})}))}function Cn(t){var r=t,{part:e}=r,o=g(r,["part"]);return jsx(W,p(i({as:P,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:a,handleSecondary:s,parentProps:{dismissible:l},step:d})=>{var y,C,v,h,b,S;let u=(C=(y=d.primaryButton)==null?void 0:y.title)!=null?C:d.primaryButtonTitle,c=(h=(v=d.secondaryButton)==null?void 0:v.title)!=null?h:d.secondaryButtonTitle,{videoProps:f}=re((b=d.props)!=null?b:{});return jsxs(Fragment,{children:[jsx(P.Header,{dismissible:l,handleDismiss:n,subtitle:d.subtitle,title:d.title}),jsx(P.Media,i({src:(S=d.videoUri)!=null?S:d.imageUri,type:d.videoUri?"video":"image",css:{objectFit:"contain",width:"100%"}},f)),jsxs(R.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(P.Secondary,{title:c,onClick:s}),jsx(P.Primary,{title:u,onClick:a})]})]})}}))}function $o(r){var n=r,{part:e,src:o}=n,t=g(n,["part","src"]);return jsx(x,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function qs(e){var o,t,r,n,a;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.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/${(a=e.split("loom.com/share/")[1])==null?void 0:a.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Ao(v){var h=v,{autoPlay:e,controls:o,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:a,loop:s,muted:l,playsInline:d,poster:u,preload:c,part:f,src:y}=h,C=g(h,["autoPlay","controls","controlsList","crossOrigin","disablePictureInPicture","disableRemotePlayback","loop","muted","playsInline","poster","preload","part","src"]);let b=qs(y);return b?jsx(x,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",f],src:b},C)):y!=null&&y.endsWith(".mp4")?jsx(x,i({as:"video",part:["video",f],src:y,autoPlay:e,controls:o!=null?o:!0,controlsList:t,crossOrigin:r,disablePictureInPicture:n,disableRemotePlayback:a,loop:s,muted:l!=null?l:e,playsInline:d,poster:u,preload:c},C)):(console.error(`Could not map videoUri ${y} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ve(r){var n=r,{src:e,type:o}=n,t=g(n,["src","type"]);return jsx(o==="video"?Ao:$o,i({src:e},t))}var P=jo.forwardRef((a,n)=>{var s=a,{children:e,flowId:o,part:t}=s,r=g(s,["children","flowId","part"]);var d;if(o!=null)return jsx(Cn,i({flowId:o},r));let l=(d=r.as)!=null?d:R.Column;return jsx(l,p(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},r),{ref:n,children:e}))});P.Dismiss=e=>jsx(D.Plain,p(i({"aria-label":"Dismiss",part:"dismiss",padding:0},e),{children:jsx(Ie,{height:"20",fill:"currentColor"})}));P.Footer=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return jsx(R.Row,p(i({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};P.Header=s=>{var l=s,{dismissible:e,handleDismiss:o,part:t,subtitle:r,title:n}=l,a=g(l,["dismissible","handleDismiss","part","subtitle","title"]);return !e&&(n==null||(n==null?void 0:n.length)===0)&&(r==null||(r==null?void 0:r.length)===0)?null:jsxs(R.Row,p(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},a),{children:[jsx(P.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsx(P.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(P.Subtitle,{color:"neutral.400",flexBasis:"100%",children:r})]}))};P.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(ve,i({borderRadius:"md",src:e},o))};P.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Primary,i({title:o,onClick:e},t))};P.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(D.Secondary,i({title:o,onClick:e},t))};P.Subtitle=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsx(F.Body2,p(i({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};P.Title=r=>{var n=r,{children:e,part:o}=n,t=g(n,["children","part"]);return e==null?null:jsx(F.H4,p(i({display:"block",part:["title",o]},t),{children:e}))};var Mo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function wn(e){let o=Object.fromEntries(Mo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(Mo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!Mo.content.some(a=>a===n)&&!Mo.root.some(a=>a===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var el=keyframes`
70
71
  from {
71
72
  opacity: 0;
72
73
  }
@@ -76,7 +77,7 @@ var It=Object.defineProperty,En=Object.defineProperties;var In=Object.getOwnProp
76
77
  to {
77
78
  opacity: 1;
78
79
  }
79
- `;function $(n){var a=n,{children:e,className:o,modal:t=!0}=a,r=g(a,["children","className","modal"]);let{rootProps:s,contentProps:l,otherProps:c}=vn(r),f=c,{zIndex:d}=f,u=g(f,["zIndex"]);return jsx(q.Root,p(i({defaultOpen:!0,modal:t},s),{children:jsx(q.Portal,{children:jsxs(x,{animation:`${Qs} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:d!=null?d:10,children:[t&&jsx(q.Overlay,{asChild:!0,children:jsx(x,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(q.Content,p(i({asChild:!0,onOpenAutoFocus:y=>y.preventDefault(),onPointerDownOutside:y=>y.preventDefault(),onInteractOutside:y=>y.preventDefault()},l),{children:jsx(P,p(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}$.Dismiss=e=>jsx(q.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,p(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Ie,{height:"20",fill:"currentColor"})}))});$.Subtitle=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return jsx(q.Description,{asChild:!0,children:jsx(F.Body2,p(i({part:"subtitle"},o),{children:e}))})};$.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null?null:jsx(ve,i({borderRadius:"md",src:e},o))};$.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(D.Primary,i({title:o,onClick:e},t))};$.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(x,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?I.colors.primary.surface:I.colors.neutral[700],part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(x,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};$.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(D.Secondary,i({title:o,onClick:e},t))};$.Title=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return jsx(q.Title,{asChild:!0,children:jsx(F.H4,p(i({part:"title"},o),{children:e}))})};$.displayName="Dialog";function xt(t){var r=t,{flowId:e}=r,o=g(r,["flowId"]);return jsx(W,p(i({as:null,flowId:e},o),{children:({flow:n,handleDismiss:a,handlePrimary:s,handleSecondary:l,parentProps:{containerProps:d,dismissible:u},step:c})=>{var h,b,S,B,O,T;let f=(b=(h=c.primaryButton)==null?void 0:h.title)!=null?b:c.primaryButtonTitle,y=(B=(S=c.secondaryButton)==null?void 0:S.title)!=null?B:c.secondaryButtonTitle,C=c.$state.blocked,{videoProps:v}=re((O=c.props)!=null?O:{});return jsxs($,p(i({"data-step-id":c.id,display:"flex",flexDirection:"column",gap:5,part:"announcement",textAlign:"center"},d),{children:[u&&jsx($.Dismiss,{onClick:a}),jsxs(R.Column,{gap:1,part:"announcement-header",children:[jsx($.Title,{children:c.title}),jsx($.Subtitle,{children:c.subtitle})]}),jsx($.Media,i({aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(T=c.videoUri)!=null?T:c.imageUri,transform:"translate3d(0, 0, 1px)",type:c.videoUri?"video":"image",width:"100%"},v)),jsx($.ProgressDots,{current:n.getCurrentStepIndex(),total:n.getNumberOfAvailableSteps()}),jsxs(R.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[y&&jsx($.Secondary,{disabled:C,onClick:l,title:y}),f&&jsx($.Primary,{disabled:C,onClick:s,title:f})]})]}))}}))}function wt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Lo(...e){let o=e.shift(),t=e.length===1?e[0]:Lo(...e);if(!wt(o)||!wt(t))throw new Error("deepmerge can only merge Objects");let r=structuredClone(o);return Object.entries(t).forEach(([n,a])=>{wt(a)?r[n]!==void 0?Object.assign(r,{[n]:Lo(r[n],structuredClone(a))}):Object.assign(r,{[n]:structuredClone(a)}):Array.isArray(a)?r[n]!==void 0?Object.assign(r,{[n]:[...r[n],...structuredClone(a)]}):Object.assign(r,{[n]:structuredClone(a)}):Object.assign(r,{[n]:a});}),r}function ol(...e){for(let o of e)if(o!=null&&o.length>0)return o;return null}function tl(t){var r=t,{title:e}=r,o=g(r,["title"]);return jsx(W,p(i({as:null},o),{children:({flow:n,parentProps:{containerProps:a},step:s})=>{var f,y,C;let l=ol(e,n.title,s.title),d=(f=n==null?void 0:n.getNumberOfCompletedSteps())!=null?f:0,u=(y=n==null?void 0:n.getNumberOfAvailableSteps())!=null?y:1,c=a.onClick!=null;return c&&(a.css=Lo({"&:hover":{backgroundColor:"var(--fr-colors-neutral-hover-background)"}},(C=a.css)!=null?C:{})),jsxs(P,p(i({"aria-label":"Progress Badge",borderWidth:"md",cursor:c?"pointer":"auto",gap:"1",p:"3",part:"progress-badge",role:"complementary"},a),{children:[jsxs(R.Row,{alignItems:"center",gap:"2",part:"progress-badge-header",children:[jsx(P.Title,{fontSize:"sm",lineHeight:"sm",children:l}),jsx(x,{as:Fo,height:"20px",marginLeft:"auto",marginRight:"-1",transform:"rotate(-90deg)",width:"20px"})]}),jsxs(R.Row,{alignItems:"center",gap:"2",part:"progress-badge-footer",children:[jsx(De,{current:d,fontSize:"xs",fontWeight:"medium",lineHeight:"xs",total:u}),jsx(fo,{current:d,flexGrow:"1",total:u})]})]}))}}))}var nl=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Fn(r){var n=r,{style:e={},part:o=""}=n,t=g(n,["style","part"]);return jsxs(x,p(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(x,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${nl}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(x,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Rn({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},a=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[r]]=s;let d=a();return ["before","end"].includes(d)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(d)?["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 Wo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["modal","onOpenChange"]};function Tn(e,o){var a,s,l,d,u;let t=Object.fromEntries(Wo.content.map(c=>[c,e[c]]).filter(c=>c[1]!==void 0)),r=Object.fromEntries(Wo.root.map(c=>[c,e[c]]).filter(c=>c[1]!==void 0)),n={};for(let c of Object.keys(e))!Wo.content.includes(c)&&!Wo.root.includes(c)&&(n[c]=e[c]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let c={after:"end",before:"start"},f=(S,B)=>["top","bottom"].includes(B)?S=="after"?"marginLeft":"marginRight":S=="after"?"marginTop":"marginBottom",y=(l=t.alignOffset)!=null?l:0,C=(d=t.style)!=null?d:{},v=(u=t.side)!=null?u:"bottom",h=t.align;t.style=p(i({},C),{[f(h,v)]:y});let b=["top","bottom"].includes(v)?o.width:o.height;t.alignOffset=(b+y)*-1,t.align=c[h];}return {contentProps:t,otherProps:n,rootProps:r}}var kn=keyframes`
80
+ `;function $(n){var a=n,{children:e,className:o,modal:t=!0}=a,r=g(a,["children","className","modal"]);let{rootProps:s,contentProps:l,otherProps:c}=wn(r),f=c,{zIndex:d}=f,u=g(f,["zIndex"]);return jsx(q.Root,p(i({defaultOpen:!0,modal:t},s),{children:jsx(q.Portal,{children:jsxs(x,{animation:`${el} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:d!=null?d:10,children:[t&&jsx(q.Overlay,{asChild:!0,children:jsx(x,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(q.Content,p(i({asChild:!0,onOpenAutoFocus:y=>y.preventDefault(),onPointerDownOutside:y=>y.preventDefault(),onInteractOutside:y=>y.preventDefault()},l),{children:jsx(P,p(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}$.Dismiss=e=>jsx(q.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,p(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Ie,{height:"20",fill:"currentColor"})}))});$.Subtitle=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return jsx(q.Description,{asChild:!0,children:jsx(F.Body2,p(i({part:"subtitle"},o),{children:e}))})};$.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null?null:jsx(ve,i({borderRadius:"md",src:e},o))};$.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(D.Primary,i({title:o,onClick:e},t))};$.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(x,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?I.colors.primary.surface:I.colors.neutral[700],part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(x,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};$.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(D.Secondary,i({title:o,onClick:e},t))};$.Title=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return jsx(q.Title,{asChild:!0,children:jsx(F.H4,p(i({part:"title"},o),{children:e}))})};$.displayName="Dialog";function ht(t){var r=t,{flowId:e}=r,o=g(r,["flowId"]);return jsx(W,p(i({as:null,flowId:e},o),{children:({flow:n,handleDismiss:a,handlePrimary:s,handleSecondary:l,parentProps:{containerProps:d,dismissible:u},step:c})=>{var h,b,S,B,O,T;let f=(b=(h=c.primaryButton)==null?void 0:h.title)!=null?b:c.primaryButtonTitle,y=(B=(S=c.secondaryButton)==null?void 0:S.title)!=null?B:c.secondaryButtonTitle,C=c.$state.blocked,{videoProps:v}=re((O=c.props)!=null?O:{});return jsxs($,p(i({"data-step-id":c.id,display:"flex",flexDirection:"column",gap:5,part:"announcement",textAlign:"center"},d),{children:[u&&jsx($.Dismiss,{onClick:a}),jsxs(R.Column,{gap:1,part:"announcement-header",children:[jsx($.Title,{children:c.title}),jsx($.Subtitle,{children:c.subtitle})]}),jsx($.Media,i({aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(T=c.videoUri)!=null?T:c.imageUri,transform:"translate3d(0, 0, 1px)",type:c.videoUri?"video":"image",width:"100%"},v)),jsx($.ProgressDots,{current:n.getCurrentStepIndex(),total:n.getNumberOfAvailableSteps()}),jsxs(R.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[y&&jsx($.Secondary,{disabled:C,onClick:l,title:y}),f&&jsx($.Primary,{disabled:C,onClick:s,title:f})]})]}))}}))}function Ft(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Lo(...e){let o=e.shift(),t=e.length===1?e[0]:Lo(...e);if(!Ft(o)||!Ft(t))throw new Error("deepmerge can only merge Objects");let r=structuredClone(o);return Object.entries(t).forEach(([n,a])=>{Ft(a)?r[n]!==void 0?Object.assign(r,{[n]:Lo(r[n],structuredClone(a))}):Object.assign(r,{[n]:structuredClone(a)}):Array.isArray(a)?r[n]!==void 0?Object.assign(r,{[n]:[...r[n],...structuredClone(a)]}):Object.assign(r,{[n]:structuredClone(a)}):Object.assign(r,{[n]:a});}),r}function tl(...e){for(let o of e)if(o!=null&&o.length>0)return o;return null}function rl(t){var r=t,{title:e}=r,o=g(r,["title"]);return jsx(W,p(i({as:null},o),{children:({flow:n,parentProps:{containerProps:a},step:s})=>{var f,y,C;let l=tl(e,n.title,s.title),d=(f=n==null?void 0:n.getNumberOfCompletedSteps())!=null?f:0,u=(y=n==null?void 0:n.getNumberOfAvailableSteps())!=null?y:1,c=a.onClick!=null;return c&&(a.css=Lo({"&:hover":{backgroundColor:"var(--fr-colors-neutral-hover-background)"}},(C=a.css)!=null?C:{})),jsxs(P,p(i({"aria-label":"Progress Badge",borderWidth:"md",cursor:c?"pointer":"auto",gap:"1",p:"3",part:"progress-badge",role:"complementary"},a),{children:[jsxs(R.Row,{alignItems:"center",gap:"2",part:"progress-badge-header",children:[jsx(P.Title,{fontSize:"sm",lineHeight:"sm",children:l}),jsx(x,{as:Fo,height:"20px",marginLeft:"auto",marginRight:"-1",transform:"rotate(-90deg)",width:"20px"})]}),jsxs(R.Row,{alignItems:"center",gap:"2",part:"progress-badge-footer",children:[jsx(De,{current:d,fontSize:"xs",fontWeight:"medium",lineHeight:"xs",total:u}),jsx(go,{current:d,flexGrow:"1",total:u})]})]}))}}))}var il=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Rn(r){var n=r,{style:e={},part:o=""}=n,t=g(n,["style","part"]);return jsxs(x,p(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(x,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${il}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(x,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Tn({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},a=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[r]]=s;let d=a();return ["before","end"].includes(d)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(d)?["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 Wo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["modal","onOpenChange"]};function kn(e,o){var a,s,l,d,u;let t=Object.fromEntries(Wo.content.map(c=>[c,e[c]]).filter(c=>c[1]!==void 0)),r=Object.fromEntries(Wo.root.map(c=>[c,e[c]]).filter(c=>c[1]!==void 0)),n={};for(let c of Object.keys(e))!Wo.content.includes(c)&&!Wo.root.includes(c)&&(n[c]=e[c]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let c={after:"end",before:"start"},f=(S,B)=>["top","bottom"].includes(B)?S=="after"?"marginLeft":"marginRight":S=="after"?"marginTop":"marginBottom",y=(l=t.alignOffset)!=null?l:0,C=(d=t.style)!=null?d:{},v=(u=t.side)!=null?u:"bottom",h=t.align;t.style=p(i({},C),{[f(h,v)]:y});let b=["top","bottom"].includes(v)?o.width:o.height;t.alignOffset=(b+y)*-1,t.align=c[h];}return {contentProps:t,otherProps:n,rootProps:r}}var Bn=keyframes`
80
81
  from {
81
82
  opacity: 0;
82
83
  }
@@ -86,8 +87,8 @@ var It=Object.defineProperty,En=Object.defineProperties;var In=Object.getOwnProp
86
87
  to {
87
88
  opacity: 1;
88
89
  }
89
- `;function Bn(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Fe(u){var c=u,{anchor:e,children:o,className:t,defaultOpen:r=!0,open:n,part:a,spotlight:s=!1,style:l={}}=c,d=g(c,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:f,rect:y,ref:C}=bo(),{node:v,rect:h,ref:b}=bo(),{contentProps:S,otherProps:B,rootProps:O}=Tn(d,y),[T,k]=useState(r),[w,E]=useState(S.align),[H,z]=useState(S.side),[N,G]=useState(0),[ee,ne]=useState(0);function Z(){return n!=null?(console.log("OVERRIDE: ",n),n):(console.log("INTERNAL: ",T),T)}if(f!==null){let K=f.getAttribute("data-align"),j=f.getAttribute("data-side");w!==K&&E(K),H!==j&&z(j);}let oe=useRef(null);if(useEffect(()=>{let K=document.querySelector(e);K!=null?(b(K),oe.current=K):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e,b]),useEffect(()=>{function K(te){if(te.matches(e))return Bn(te)?te:null;let ie=te.querySelectorAll(e);return ie.length>0&&Bn(ie[0])?ie[0]:null}let j=new MutationObserver(te=>{for(let ie of te)if(ie.type==="childList"){for(let xe of ie.addedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let ce=K(xe);if(ce!=null){b(ce),oe.current=ce,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",ce);break}}for(let xe of ie.removedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let ce=K(xe);if(ce!=null){b(null),oe.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",ce);break}}}});return j.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>j.disconnect()},[e,b]),useEffect(()=>{let{scrollX:K,scrollY:j}=window;G(h.left+K),ne(h.top+j);},[h.left,h.top]),v==null)return null;let de="0";typeof window!="undefined"&&(de=window.getComputedStyle(v).borderRadius);let M=Rn({props:d,alignAttr:w,sideAttr:H});return jsxs(me.Root,p(i({defaultOpen:!0},O),{children:[jsx(me.Anchor,{virtualRef:oe}),jsx(me.Portal,{children:jsxs(Fragment,{children:[s&&jsx(x,i({animation:`${kn} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:de,height:h.height,left:N,top:ee,width:h.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsx(me.Content,p(i({},S),{ref:C,children:jsxs(Fragment,{children:[Z()&&jsx(P,p(i({animation:`${kn} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",a],style:l},B),{children:o})),jsx(Fn,{onClick:()=>{k(()=>(typeof O.onOpenChange=="function"&&O.onOpenChange(!Z()),!Z()));},style:M})]})}),T)]})})]}))}Fe.Close=e=>jsx(me.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,p(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Ie,{height:"20",fill:"currentColor"})}))});Fe.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null?null:jsx(ve,i({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:e,transform:"translate3d(0, 0, 1px)"},o))};Fe.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(D.Primary,i({title:o,onClick:e},t))};Fe.Progress=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsx(F.Body2,p(i({part:"progress"},o),{children:e}))};Fe.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(D.Secondary,i({title:o,onClick:e},t))};Fe.Subtitle=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsx(F.Body2,p(i({part:"subtitle"},o),{children:e}))};Fe.Title=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsx(F.H4,p(i({part:"title"},o),{children:e}))};function pl(){let e=useContext(A);(!e||!e.frigade)&&Se("useUser() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e!=null?e:{},t=o==null?void 0:o.config.userId;function r(a){return V(this,null,function*(){yield o.identify(t,a);})}function n(a,s){return V(this,null,function*(){yield o.track(a,s);})}return {userId:t,addProperties:r,track:n,isLoading:!(o!=null&&o.isReady())}}function cl(){var s;let e=useContext(A);(!e||!e.frigade)&&Se("useGroup() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e!=null?e:{},t=(s=o==null?void 0:o.getConfig())==null?void 0:s.groupId;function r(l){return V(this,null,function*(){if(!o.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield o.group(o.config.groupId,l);})}function n(l,d){return V(this,null,function*(){yield o.track(l,d);})}function a(l,d){return V(this,null,function*(){yield o.group(l,d);})}return {groupId:t,setGroupId:a,addProperties:r,track:n,isLoading:!(o!=null&&o.isReady())}}
90
+ `;function On(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function Fe(u){var c=u,{anchor:e,children:o,className:t,defaultOpen:r=!0,open:n,part:a,spotlight:s=!1,style:l={}}=c,d=g(c,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:f,rect:y,ref:C}=bo(),{node:v,rect:h,ref:b}=bo(),{contentProps:S,otherProps:B,rootProps:O}=kn(d,y),[T,k]=useState(r),[w,E]=useState(S.align),[H,U]=useState(S.side),[N,G]=useState(0),[ee,ne]=useState(0);function Z(){return n!=null?(console.log("OVERRIDE: ",n),n):(console.log("INTERNAL: ",T),T)}if(f!==null){let K=f.getAttribute("data-align"),j=f.getAttribute("data-side");w!==K&&E(K),H!==j&&U(j);}let oe=useRef(null);if(useEffect(()=>{let K=document.querySelector(e);K!=null?(b(K),oe.current=K):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e,b]),useEffect(()=>{function K(te){if(te.matches(e))return On(te)?te:null;let ie=te.querySelectorAll(e);return ie.length>0&&On(ie[0])?ie[0]:null}let j=new MutationObserver(te=>{for(let ie of te)if(ie.type==="childList"){for(let xe of ie.addedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let ce=K(xe);if(ce!=null){b(ce),oe.current=ce,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",ce);break}}for(let xe of ie.removedNodes){if(xe.nodeType!==Node.ELEMENT_NODE)continue;let ce=K(xe);if(ce!=null){b(null),oe.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",ce);break}}}});return j.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>j.disconnect()},[e,b]),useEffect(()=>{let{scrollX:K,scrollY:j}=window;G(h.left+K),ne(h.top+j);},[h.left,h.top]),v==null)return null;let de="0";typeof window!="undefined"&&(de=window.getComputedStyle(v).borderRadius);let M=Tn({props:d,alignAttr:w,sideAttr:H});return jsxs(me.Root,p(i({defaultOpen:!0},O),{children:[jsx(me.Anchor,{virtualRef:oe}),jsx(me.Portal,{children:jsxs(Fragment,{children:[s&&jsx(x,i({animation:`${Bn} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:de,height:h.height,left:N,top:ee,width:h.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsx(me.Content,p(i({},S),{ref:C,children:jsxs(Fragment,{children:[Z()&&jsx(P,p(i({animation:`${Bn} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",a],style:l},B),{children:o})),jsx(Rn,{onClick:()=>{k(()=>(typeof O.onOpenChange=="function"&&O.onOpenChange(!Z()),!Z()));},style:M})]})}),T)]})})]}))}Fe.Close=e=>jsx(me.Close,{"aria-label":"Close",asChild:!0,children:jsx(D.Plain,p(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Ie,{height:"20",fill:"currentColor"})}))});Fe.Media=t=>{var r=t,{src:e}=r,o=g(r,["src"]);return e==null?null:jsx(ve,i({aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:e,transform:"translate3d(0, 0, 1px)"},o))};Fe.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(D.Primary,i({title:o,onClick:e},t))};Fe.Progress=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsx(F.Body2,p(i({part:"progress"},o),{children:e}))};Fe.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=g(n,["onClick","title"]);return o==null?null:jsx(D.Secondary,i({title:o,onClick:e},t))};Fe.Subtitle=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsx(F.Body2,p(i({part:"subtitle"},o),{children:e}))};Fe.Title=t=>{var r=t,{children:e}=r,o=g(r,["children"]);return e==null?null:jsx(F.H4,p(i({part:"title"},o),{children:e}))};function dl(){let e=useContext(A);(!e||!e.frigade)&&Se("useUser() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e!=null?e:{},t=o==null?void 0:o.config.userId;function r(a){return V(this,null,function*(){yield o.identify(t,a);})}function n(a,s){return V(this,null,function*(){yield o.track(a,s);})}return {userId:t,addProperties:r,track:n,isLoading:!(o!=null&&o.isReady())}}function ul(){var s;let e=useContext(A);(!e||!e.frigade)&&Se("useGroup() must be used in a child of the Frigade Provider","warn");let{frigade:o}=e!=null?e:{},t=(s=o==null?void 0:o.getConfig())==null?void 0:s.groupId;function r(l){return V(this,null,function*(){if(!o.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield o.group(o.config.groupId,l);})}function n(l,d){return V(this,null,function*(){yield o.track(l,d);})}function a(l,d){return V(this,null,function*(){yield o.group(l,d);})}return {groupId:t,setGroupId:a,addProperties:r,track:n,isLoading:!(o!=null&&o.isReady())}}
90
91
 
91
- export { xt as Announcement, Xo as Banner, pe as BaseField, x as Box, D as Button, P as Card, vo as Checklist, ct as ClientPortal, yt as Collection, $ as Dialog, R as Flex, W as Flow, ze as Form, ft as Hint, $o as Image, it as Label, ve as Media, ut as Ping, Qe as Popover, be as Progress, tl as ProgressBadge, gn as Provider, st as RadioField, lt as SelectField, qe as Spotlight, Bo as Survey, F as Text, pt as TextField, dt as TextareaField, Fe as Tooltip, Eo as Tour, Ao as Video, Uo as themeVariables, lo as tokens, Ze as useAutoScroll, bo as useBoundingClientRect, Oe as useFlow, Pt as useFlowHandlers, ht as useFrigade, cl as useGroup, ae as useStepHandlers, pl as useUser };
92
+ export { ht as Announcement, Xo as Banner, pe as BaseField, x as Box, D as Button, P as Card, vo as Checklist, ut as ClientPortal, xt as Collection, $ as Dialog, R as Flex, W as Flow, Ue as Form, gt as Hint, $o as Image, at as Label, ve as Media, mt as Ping, eo as Popover, be as Progress, rl as ProgressBadge, yn as Provider, lt as RadioField, pt as SelectField, qe as Spotlight, Bo as Survey, F as Text, dt as TextField, ct as TextareaField, Fe as Tooltip, Eo as Tour, Ao as Video, zo as themeVariables, po as tokens, Ze as useAutoScroll, bo as useBoundingClientRect, Ye as useFloating, Oe as useFlow, Ct as useFlowHandlers, bt as useFrigade, ul as useGroup, ae as useStepHandlers, dl as useUser };
92
93
  //# sourceMappingURL=out.js.map
93
94
  //# sourceMappingURL=index.js.map