@frigade/react 2.5.3 → 2.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1362,13 +1362,11 @@ interface FlowPropsWithoutChildren extends BoxPropsWithoutChildren {
1362
1362
  */
1363
1363
  modal?: boolean;
1364
1364
  /**
1365
- * Handler for when the Flow is completed.
1366
- * If this function a promise that evaluates to `false`, the Flow will not be marked as completed.
1365
+ * Handler for when the Flow is completed. This is event is fired immediately after the user completes the Flow.
1367
1366
  */
1368
1367
  onComplete?: FlowHandlerProp;
1369
1368
  /**
1370
- * Handler for when the Flow is dismissed.
1371
- * If this function a promise that evaluates to `false`, the Flow will not be marked as dismissed.
1369
+ * Handler for when the Flow is dismissed (skipped). This is event is fired immediately after the user dismisses the Flow.
1372
1370
  */
1373
1371
  onDismiss?: FlowHandlerProp;
1374
1372
  /**
package/dist/index.js CHANGED
@@ -21,14 +21,14 @@ import { useFloating, autoUpdate, offset, flip, shift, useClick, useDismiss, use
21
21
  import { createPortal } from 'react-dom';
22
22
  import * as re from '@radix-ui/react-popover';
23
23
 
24
- var qo=Object.defineProperty,_r=Object.defineProperties;var Ur=Object.getOwnPropertyDescriptors;var je=Object.getOwnPropertySymbols;var Zo=Object.prototype.hasOwnProperty,Yo=Object.prototype.propertyIsEnumerable;var Jo=(e,o,t)=>o in e?qo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))Zo.call(o,t)&&Jo(e,t,o[t]);if(je)for(var t of je(o))Yo.call(o,t)&&Jo(e,t,o[t]);return e},s=(e,o)=>_r(e,Ur(o));var Gr=(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 f=(e,o)=>{var t={};for(var n in e)Zo.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&je)for(var n of je(e))o.indexOf(n)<0&&Yo.call(e,n)&&(t[n]=e[n]);return t};var ie=(e,o)=>{for(var t in o)qo(e,t,{get:o[t],enumerable:!0});};var M=(e,o,t)=>new Promise((n,r)=>{var a=d=>{try{l(t.next(d));}catch(m){r(m);}},p=d=>{try{l(t.throw(d));}catch(m){r(m);}},l=d=>d.done?n(d.value):Promise.resolve(d.value).then(a,p);l((t=t.apply(e,o)).next());});function Fe(e){return jsx("svg",s(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 et={borderWidths:{md:"1px"}};var Xe=[5,10,20,35,50,65,80,95,98],ot=[...Xe],ho=[...Xe];ot[4]=40;ho[4]=60;var Kr={blue:{h:213,s:100,l:Xe},gray:{h:220,s:10,l:Xe},green:{h:141,s:90,l:ot},red:{h:9,s:90,l:ho},yellow:{h:50,s:90,l:ho}};var A={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Kr))A[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var tt=s(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},A),{gray100:A.gray[100],gray200:A.gray[200],gray300:A.gray[300],gray400:A.gray[400],gray500:A.gray[500],gray600:A.gray[600],gray700:A.gray[700],gray800:A.gray[800],gray900:A.gray[900],blue400:A.blue[400],blue500:A.blue[500],blue800:A.blue[800],blue900:A.blue[900],green400:A.blue[400],green500:A.green[500],green800:A.green[800],red500:A.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var rt={md:"8px",lg:"20px",round:"50%"};var c=e=>`var(--fr-colors-${e})`,nt={negative:{100:c("red-100"),200:c("red-200"),300:c("red-300"),400:c("red-400"),500:c("red-500"),600:c("red-600"),700:c("red-700"),800:c("red-800"),900:c("red-900"),background:c("negative-500"),border:c("negative-500"),foreground:c("white"),surface:c("negative-500"),active:{background:c("negative-400"),border:c("negative-400"),foreground:c("white"),surface:c("negative-400")},focus:{background:c("negative-500"),border:c("negative-500"),foreground:c("white"),surface:c("negative-500")},hover:{background:c("negative-400"),border:c("negative-400"),foreground:c("white"),surface:c("negative-400")}},neutral:{100:c("gray-100"),200:c("gray-200"),300:c("gray-300"),400:c("gray-400"),500:c("gray-500"),600:c("gray-600"),700:c("gray-700"),800:c("gray-800"),900:c("gray-900"),background:c("white"),border:c("neutral-800"),foreground:c("black"),surface:c("neutral-700"),active:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")},focus:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")},hover:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")}},positive:{100:c("green-100"),200:c("green-200"),300:c("green-300"),400:c("green-400"),500:c("green-500"),600:c("green-600"),700:c("green-700"),800:c("green-800"),900:c("green-900"),background:c("positive-500"),border:c("positive-500"),foreground:c("white"),surface:c("positive-500"),active:{background:c("positive-400"),border:c("positive-400"),foreground:c("white"),surface:c("positive-400")},focus:{background:c("positive-500"),border:c("positive-500"),foreground:c("white"),surface:c("positive-500")},hover:{background:c("positive-400"),border:c("positive-400"),foreground:c("white"),surface:c("positive-400")}},primary:{100:c("blue-100"),200:c("blue-200"),300:c("blue-300"),400:c("blue-400"),500:c("blue-500"),600:c("blue-600"),700:c("blue-700"),800:c("blue-800"),900:c("blue-900"),background:c("primary-500"),border:c("primary-500"),foreground:c("white"),surface:c("primary-500"),active:{background:c("primary-400"),border:c("primary-400"),foreground:c("white"),surface:c("primary-400")},focus:{background:c("primary-500"),border:c("primary-500"),foreground:c("white"),surface:c("primary-500")},hover:{background:c("primary-400"),border:c("primary-400"),foreground:c("white"),surface:c("primary-400")}},secondary:{100:c("gray-100"),200:c("gray-200"),300:c("gray-300"),400:c("gray-400"),500:c("gray-500"),600:c("gray-600"),700:c("gray-700"),800:c("gray-800"),900:c("gray-900"),background:c("white"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-900"),active:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-800")},focus:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-900")},hover:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-800")}}};var it={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var jr="px",Xr=e=>typeof e=="number"?`${4*e}${jr}`:e,Jr=[-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"],at=Object.fromEntries(Jr.map(e=>[e,Xr(e)]));var st={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 Je=s(i(s(i({},et),{colors:i(i({},tt),nt)}),st),{radii:rt,shadows:it,space:at});function Me(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let p=`${o.length?`${o}${t}`:""}${r}`,l=e[r];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(n,Me(l,p,t)):n[p]=l,n},{})}function bo(e){let o=Me(e,"--fr","-");for(let[t,n]of Object.entries(o))if(t.indexOf(".")>-1){let r=t.replace(/\./g,"-");o[r]=n,delete o[t];}return o}function lt(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n],a=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=lt(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var Po=bo(Je),D=lt(Je);var Zr=new Set(["alt","size","src"]),Yr=qr.all.filter(e=>e.indexOf("-")!=0&&!Zr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Qr=Object.fromEntries(Yr),qe=Me(D.colors),en={color:qe,backgroundColor:qe,borderColor:qe,border:i(i({},D.borderWidths),qe),borderRadius:D.radii,borderWidth:D.borderWidths,boxShadow:D.shadows,fontFamily:D.fontFamilies,fontSize:D.fontSizes,fontWeight:D.fontWeights,gap:D.space,lineHeight:D.lineHeights,margin:D.space,marginBottom:D.space,marginLeft:D.space,marginRight:D.space,marginTop:D.space,padding:D.space,paddingBottom:D.space,paddingLeft:D.space,paddingRight:D.space,paddingTop:D.space},pt=i(i({},Qr),en),dt={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"]},ct=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function on(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 mt=new Map(Object.entries(pt).map(([e,o])=>[e,on(o)])),tn=new Map(Object.entries(dt).map(([e,o])=>[e,new Set(o)])),rn=new Set(["height","width"]),nn=new Set(["canvas","embed","iframe","img","input","object","video"]);function ut(e){let[o,t]=e.split(":");return [o,ct.has(t)?t:null]}function ft(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let l=`&:${a.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return n[l]==null&&(n[l]={}),n[l]}return Object.entries(t).forEach(([a,p])=>{let[l,d]=ut(a),m=tn.get(l);m!=null&&(m.forEach(u=>{let y=`${u}${d?":"+d:""}`;t[y]=p;}),delete t[a]);}),Object.entries(t).forEach(([a,p])=>{let[l,d]=ut(a),m=mt.get(l);if(m!=null){if(p==null)delete t[a];else if(typeof p=="string"&&p.indexOf(" ")>-1){let u=p.split(" ");r(d)[l]=u.map(y=>{var h;return (h=m.get(y.toString()))!=null?h:y}).join(" ");}else m.has(p.toString())?r(d)[l]=m.get(p.toString()):r(d)[l]=p;(typeof o!="string"||!nn.has(o)||!rn.has(l))&&delete t[a];}}),Object.keys(t).forEach(a=>{let p=a.substring(1);a.indexOf("_")===0&&mt.has(p)&&(t[p]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function sn(){if(typeof window=="undefined"){let{JSDOM:e}=Gr("jsdom");return new e("<!DOCTYPE html>").window}return window}function gt(e){return e?{__html:an(sn()).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 pn(e){return e&&`fr-${e}`}function ht(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>ht(o)).join(" "):pn(e))}function dn(l,p){var d=l,{as:e,children:o,className:t,css:n={},part:r}=d,a=f(d,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:u,unmatchedProps:y}=ft(a,m),h=ht(r),x=t||h?clsx(t,h):void 0,R=[{boxSizing:"border-box"},u,n];return typeof o=="string"?jsx(m,s(i({className:x,css:R},y),{ref:p,dangerouslySetInnerHTML:gt(o)})):jsx(m,s(i({className:x,css:R},y),{ref:p,children:o}))}var g=Fo.forwardRef(dn);var O={};ie(O,{Link:()=>Vn,Plain:()=>Ln,Primary:()=>An,Secondary:()=>Wn});var F={};ie(F,{Body1:()=>Bn,Body2:()=>Tn,Caption:()=>kn,Display1:()=>Cn,Display2:()=>Sn,H1:()=>wn,H2:()=>Fn,H3:()=>vn,H4:()=>Rn});var Co={};ie(Co,{Body1:()=>xn,Body2:()=>hn,Caption:()=>bn,Display1:()=>cn,Display2:()=>mn,H1:()=>un,H2:()=>fn,H3:()=>gn,H4:()=>yn});var ae={color:"neutral.foreground",fontFamily:"default",margin:"0"},cn=s(i({},ae),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),mn=s(i({},ae),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),un=s(i({},ae),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),fn=s(i({},ae),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),gn=s(i({},ae),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),yn=s(i({},ae),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),xn=s(i({},ae),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),hn=s(i({},ae),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),bn=s(i({},ae),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Pn=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],se=Object.fromEntries(Pn.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Fo.forwardRef((l,p)=>{var d=l,{as:n=o,children:r}=d,a=f(d,["as","children"]);return jsx(g,s(i(i({as:n},Co[e]),a),{ref:p,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),Cn=se.Display1,Sn=se.Display2,wn=se.H1,Fn=se.H2,vn=se.H3,Rn=se.H4,Bn=se.Body1,Tn=se.Body2,kn=se.Caption;var wo={};ie(wo,{Link:()=>Hn,Plain:()=>$n,Primary:()=>On,Secondary:()=>In,loadingCSSStyle:()=>So});var Ze={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},On=s(i({},Ze),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:disabled":"primary.surface","backgroundColor:hover":"primary.hover.surface","opacity:disabled":"0.6","pointerEvents:disabled":"none"}),In=s(i({},Ze),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),Hn=s(i({},Ze),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),$n=s(i({},Ze),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Mn=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),So={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:Mn+" 1s ease infinite"}};function Ye(p){var l=p,{as:e,children:o,part:t,title:n,variant:r="Primary"}=l,a=f(l,["as","children","part","title","variant"]);var m;let d=r.toLocaleLowerCase();return jsxs(g,s(i(s(i({as:e!=null?e:"button",part:[`button-${d}`,t]},wo[r]),{css:i(i({},(m=a.css)!=null?m:{}),a.loading?So:{})}),a),{loading:void 0,children:[o,n&&jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function An(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Ye,s(i({},o),{variant:"Primary",children:e}))}function Wn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Ye,s(i({},o),{variant:"Secondary",children:e}))}function Vn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Ye,s(i({},o),{variant:"Link",children:e}))}function Ln(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Ye,s(i({},o),{variant:"Plain",children:e}))}var S={};ie(S,{Column:()=>_n,Row:()=>zn});var zn=Fo.forwardRef((e,o)=>jsx(g,s(i({display:"flex",flexDirection:"row"},e),{ref:o}))),_n=Fo.forwardRef((e,o)=>jsx(g,s(i({display:"flex",flexDirection:"column"},e),{ref:o})));function vo(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=f(a,["dismissible","flowId","part"]);return jsx(_,s(i({as:null,flowId:o},n),{children:({handleDismiss:p,handlePrimary:l,handleSecondary:d,parentProps:{containerProps:m},step:u})=>{var B,T,w,P,C;let y=(B=u.props)!=null?B:{},h=(w=(T=u.primaryButton)==null?void 0:T.title)!=null?w:u.primaryButtonTitle,x=(C=(P=u.secondaryButton)==null?void 0:P.title)!=null?C:u.secondaryButtonTitle,R=u.$state.blocked;return jsxs(b,s(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},m),y),{children:[u.imageUri&&jsx(g,{as:"img",part:"image",src:u.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(S.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(b.Title,{part:"title",children:u.title}),jsx(b.Subtitle,{part:"subtitle",children:u.subtitle})]}),jsx(b.Secondary,{disabled:R,title:x,onClick:d}),jsx(b.Primary,{disabled:R,title:h,onClick:l}),e&&jsx(b.Dismiss,{onClick:p})]}))}}))}var to={};ie(to,{Carousel:()=>Vt,Collapsible:()=>oo,CollapsibleStep:()=>Ve});var Re={};ie(Re,{Bar:()=>ve,Dots:()=>Ft,Fraction:()=>Qe,Segments:()=>Rt});function ve(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,p=a===0?"10px":`${100*a}%`;return jsx(g,s(i({part:"progress-bar",backgroundColor:"neutral.800",borderRadius:"md",height:"10px"},t),{children:jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:p},transition:"width 300ms ease-out"})}))}function Ft(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((p,l)=>jsx(g,{as:"circle",r:4,cx:4+16*l,cy:"4px",fill:e-1===l?D.colors.blue500:D.colors.blue800},l));return jsx(g,s(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function Qe(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);return jsx(F.Body2,s(i({part:"progress-fraction"},t),{children:`${e}/${o}`}))}function Rt(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=[...Array(o)].map((p,l)=>jsx(g,{backgroundColor:e-1===l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},l));return jsx(S.Row,s(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function Tt(e){return jsx("svg",s(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 Gn(){return jsx(g,{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 kt(t){var n=t,{checked:e=!1}=n,o=f(n,["checked"]);return jsx(g,s(i({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsx(g,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Gn,{})})}))}function le(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=useContext(z),r={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((a,p,l=!0)=>M(this,null,function*(){if((yield o==null?void 0:o(e,a,p))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let m=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof m=="function"?m():m!==!1&&(yield e.complete(p,l)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(p,l),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,p)=>M(this,null,function*(){if((yield t==null?void 0:t(e,a,p))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let d=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof d=="function"?d():d!==!1&&e.complete(p),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(p),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Dt({onPrimary:e,onSecondary:o,step:t}){var m,u;let{handlePrimary:n,handleSecondary:r}=le(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:p,skipped:l}=t.$state,d=p||l||!a?jsx(kt,{checked:p||l,marginLeft:"auto"}):jsx(g,{as:Tt,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(b,{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%"}},flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:a,opacity:a?.5:1,children:[jsxs(S.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),d]}),jsx(b.Title,{children:t.title}),jsx(b.Subtitle,{children:t.subtitle}),jsxs(S.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(b.Secondary,{disabled:a,onClick:r,title:(m=t.secondaryButton)==null?void 0:m.title}),jsx(b.Primary,{disabled:a,onClick:n,title:(u=t.primaryButton)==null?void 0:u.title})]})]})}function It(e){return jsx("svg",s(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 $t(e){return jsx("svg",s(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 Mt=keyframes`
24
+ var qo=Object.defineProperty,_r=Object.defineProperties;var Ur=Object.getOwnPropertyDescriptors;var je=Object.getOwnPropertySymbols;var Zo=Object.prototype.hasOwnProperty,Yo=Object.prototype.propertyIsEnumerable;var Jo=(e,o,t)=>o in e?qo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))Zo.call(o,t)&&Jo(e,t,o[t]);if(je)for(var t of je(o))Yo.call(o,t)&&Jo(e,t,o[t]);return e},s=(e,o)=>_r(e,Ur(o));var Gr=(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 f=(e,o)=>{var t={};for(var n in e)Zo.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&je)for(var n of je(e))o.indexOf(n)<0&&Yo.call(e,n)&&(t[n]=e[n]);return t};var ie=(e,o)=>{for(var t in o)qo(e,t,{get:o[t],enumerable:!0});};var A=(e,o,t)=>new Promise((n,r)=>{var a=d=>{try{l(t.next(d));}catch(u){r(u);}},p=d=>{try{l(t.throw(d));}catch(u){r(u);}},l=d=>d.done?n(d.value):Promise.resolve(d.value).then(a,p);l((t=t.apply(e,o)).next());});function Fe(e){return jsx("svg",s(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 et={borderWidths:{md:"1px"}};var Xe=[5,10,20,35,50,65,80,95,98],ot=[...Xe],ho=[...Xe];ot[4]=40;ho[4]=60;var Kr={blue:{h:213,s:100,l:Xe},gray:{h:220,s:10,l:Xe},green:{h:141,s:90,l:ot},red:{h:9,s:90,l:ho},yellow:{h:50,s:90,l:ho}};var W={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Kr))W[e]=Object.fromEntries(n.map((r,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var tt=s(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},W),{gray100:W.gray[100],gray200:W.gray[200],gray300:W.gray[300],gray400:W.gray[400],gray500:W.gray[500],gray600:W.gray[600],gray700:W.gray[700],gray800:W.gray[800],gray900:W.gray[900],blue400:W.blue[400],blue500:W.blue[500],blue800:W.blue[800],blue900:W.blue[900],green400:W.blue[400],green500:W.green[500],green800:W.green[800],red500:W.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var rt={md:"8px",lg:"20px",round:"50%"};var c=e=>`var(--fr-colors-${e})`,nt={negative:{100:c("red-100"),200:c("red-200"),300:c("red-300"),400:c("red-400"),500:c("red-500"),600:c("red-600"),700:c("red-700"),800:c("red-800"),900:c("red-900"),background:c("negative-500"),border:c("negative-500"),foreground:c("white"),surface:c("negative-500"),active:{background:c("negative-400"),border:c("negative-400"),foreground:c("white"),surface:c("negative-400")},focus:{background:c("negative-500"),border:c("negative-500"),foreground:c("white"),surface:c("negative-500")},hover:{background:c("negative-400"),border:c("negative-400"),foreground:c("white"),surface:c("negative-400")}},neutral:{100:c("gray-100"),200:c("gray-200"),300:c("gray-300"),400:c("gray-400"),500:c("gray-500"),600:c("gray-600"),700:c("gray-700"),800:c("gray-800"),900:c("gray-900"),background:c("white"),border:c("neutral-800"),foreground:c("black"),surface:c("neutral-700"),active:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")},focus:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")},hover:{background:c("white"),border:c("neutral-900"),foreground:c("black"),surface:c("neutral-700")}},positive:{100:c("green-100"),200:c("green-200"),300:c("green-300"),400:c("green-400"),500:c("green-500"),600:c("green-600"),700:c("green-700"),800:c("green-800"),900:c("green-900"),background:c("positive-500"),border:c("positive-500"),foreground:c("white"),surface:c("positive-500"),active:{background:c("positive-400"),border:c("positive-400"),foreground:c("white"),surface:c("positive-400")},focus:{background:c("positive-500"),border:c("positive-500"),foreground:c("white"),surface:c("positive-500")},hover:{background:c("positive-400"),border:c("positive-400"),foreground:c("white"),surface:c("positive-400")}},primary:{100:c("blue-100"),200:c("blue-200"),300:c("blue-300"),400:c("blue-400"),500:c("blue-500"),600:c("blue-600"),700:c("blue-700"),800:c("blue-800"),900:c("blue-900"),background:c("primary-500"),border:c("primary-500"),foreground:c("white"),surface:c("primary-500"),active:{background:c("primary-400"),border:c("primary-400"),foreground:c("white"),surface:c("primary-400")},focus:{background:c("primary-500"),border:c("primary-500"),foreground:c("white"),surface:c("primary-500")},hover:{background:c("primary-400"),border:c("primary-400"),foreground:c("white"),surface:c("primary-400")}},secondary:{100:c("gray-100"),200:c("gray-200"),300:c("gray-300"),400:c("gray-400"),500:c("gray-500"),600:c("gray-600"),700:c("gray-700"),800:c("gray-800"),900:c("gray-900"),background:c("white"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-900"),active:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-800")},focus:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-900")},hover:{background:c("secondary-900"),border:c("secondary-800"),foreground:c("black"),surface:c("secondary-800")}}};var it={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var jr="px",Xr=e=>typeof e=="number"?`${4*e}${jr}`:e,Jr=[-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"],at=Object.fromEntries(Jr.map(e=>[e,Xr(e)]));var st={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 Je=s(i(s(i({},et),{colors:i(i({},tt),nt)}),st),{radii:rt,shadows:it,space:at});function Me(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let p=`${o.length?`${o}${t}`:""}${r}`,l=e[r];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(n,Me(l,p,t)):n[p]=l,n},{})}function bo(e){let o=Me(e,"--fr","-");for(let[t,n]of Object.entries(o))if(t.indexOf(".")>-1){let r=t.replace(/\./g,"-");o[r]=n,delete o[t];}return o}function lt(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n],a=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=lt(r,`${o}-${n}`):t[n]=`var(${o}-${a})`;}),t}var Po=bo(Je),D=lt(Je);var Zr=new Set(["alt","size","src"]),Yr=qr.all.filter(e=>e.indexOf("-")!=0&&!Zr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Qr=Object.fromEntries(Yr),qe=Me(D.colors),en={color:qe,backgroundColor:qe,borderColor:qe,border:i(i({},D.borderWidths),qe),borderRadius:D.radii,borderWidth:D.borderWidths,boxShadow:D.shadows,fontFamily:D.fontFamilies,fontSize:D.fontSizes,fontWeight:D.fontWeights,gap:D.space,lineHeight:D.lineHeights,margin:D.space,marginBottom:D.space,marginLeft:D.space,marginRight:D.space,marginTop:D.space,padding:D.space,paddingBottom:D.space,paddingLeft:D.space,paddingRight:D.space,paddingTop:D.space},pt=i(i({},Qr),en),dt={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"]},ct=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function on(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 ut=new Map(Object.entries(pt).map(([e,o])=>[e,on(o)])),tn=new Map(Object.entries(dt).map(([e,o])=>[e,new Set(o)])),rn=new Set(["height","width"]),nn=new Set(["canvas","embed","iframe","img","input","object","video"]);function mt(e){let[o,t]=e.split(":");return [o,ct.has(t)?t:null]}function ft(e,o="div"){let t=Object.assign({},e),n={};function r(a){if(a==null)return n;let l=`&:${a.replace(/[A-Z]/g,d=>`-${d.toLocaleLowerCase()}`)}`;return n[l]==null&&(n[l]={}),n[l]}return Object.entries(t).forEach(([a,p])=>{let[l,d]=mt(a),u=tn.get(l);u!=null&&(u.forEach(m=>{let y=`${m}${d?":"+d:""}`;t[y]=p;}),delete t[a]);}),Object.entries(t).forEach(([a,p])=>{let[l,d]=mt(a),u=ut.get(l);if(u!=null){if(p==null)delete t[a];else if(typeof p=="string"&&p.indexOf(" ")>-1){let m=p.split(" ");r(d)[l]=m.map(y=>{var h;return (h=u.get(y.toString()))!=null?h:y}).join(" ");}else u.has(p.toString())?r(d)[l]=u.get(p.toString()):r(d)[l]=p;(typeof o!="string"||!nn.has(o)||!rn.has(l))&&delete t[a];}}),Object.keys(t).forEach(a=>{let p=a.substring(1);a.indexOf("_")===0&&ut.has(p)&&(t[p]=t[a],delete t[a]);}),{cssFromProps:n,unmatchedProps:t}}function sn(){if(typeof window=="undefined"){let{JSDOM:e}=Gr("jsdom");return new e("<!DOCTYPE html>").window}return window}function gt(e){return e?{__html:an(sn()).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 pn(e){return e&&`fr-${e}`}function ht(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>ht(o)).join(" "):pn(e))}function dn(l,p){var d=l,{as:e,children:o,className:t,css:n={},part:r}=d,a=f(d,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:m,unmatchedProps:y}=ft(a,u),h=ht(r),x=t||h?clsx(t,h):void 0,R=[{boxSizing:"border-box"},m,n];return typeof o=="string"?jsx(u,s(i({className:x,css:R},y),{ref:p,dangerouslySetInnerHTML:gt(o)})):jsx(u,s(i({className:x,css:R},y),{ref:p,children:o}))}var g=Fo.forwardRef(dn);var O={};ie(O,{Link:()=>Vn,Plain:()=>Ln,Primary:()=>An,Secondary:()=>Wn});var F={};ie(F,{Body1:()=>Bn,Body2:()=>Tn,Caption:()=>kn,Display1:()=>Cn,Display2:()=>Sn,H1:()=>wn,H2:()=>Fn,H3:()=>vn,H4:()=>Rn});var Co={};ie(Co,{Body1:()=>xn,Body2:()=>hn,Caption:()=>bn,Display1:()=>cn,Display2:()=>un,H1:()=>mn,H2:()=>fn,H3:()=>gn,H4:()=>yn});var ae={color:"neutral.foreground",fontFamily:"default",margin:"0"},cn=s(i({},ae),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),un=s(i({},ae),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),mn=s(i({},ae),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),fn=s(i({},ae),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),gn=s(i({},ae),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),yn=s(i({},ae),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),xn=s(i({},ae),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),hn=s(i({},ae),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),bn=s(i({},ae),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Pn=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],se=Object.fromEntries(Pn.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Fo.forwardRef((l,p)=>{var d=l,{as:n=o,children:r}=d,a=f(d,["as","children"]);return jsx(g,s(i(i({as:n},Co[e]),a),{ref:p,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),Cn=se.Display1,Sn=se.Display2,wn=se.H1,Fn=se.H2,vn=se.H3,Rn=se.H4,Bn=se.Body1,Tn=se.Body2,kn=se.Caption;var wo={};ie(wo,{Link:()=>Hn,Plain:()=>$n,Primary:()=>On,Secondary:()=>In,loadingCSSStyle:()=>So});var Ze={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},On=s(i({},Ze),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:disabled":"primary.surface","backgroundColor:hover":"primary.hover.surface","opacity:disabled":"0.6","pointerEvents:disabled":"none"}),In=s(i({},Ze),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),Hn=s(i({},Ze),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),$n=s(i({},Ze),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Mn=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),So={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:Mn+" 1s ease infinite"}};function Ye(p){var l=p,{as:e,children:o,part:t,title:n,variant:r="Primary"}=l,a=f(l,["as","children","part","title","variant"]);var u;let d=r.toLocaleLowerCase();return jsxs(g,s(i(s(i({as:e!=null?e:"button",part:[`button-${d}`,t]},wo[r]),{css:i(i({},(u=a.css)!=null?u:{}),a.loading?So:{})}),a),{loading:void 0,children:[o,n&&jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function An(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Ye,s(i({},o),{variant:"Primary",children:e}))}function Wn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Ye,s(i({},o),{variant:"Secondary",children:e}))}function Vn(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Ye,s(i({},o),{variant:"Link",children:e}))}function Ln(t){var n=t,{children:e}=n,o=f(n,["children"]);return jsx(Ye,s(i({},o),{variant:"Plain",children:e}))}var S={};ie(S,{Column:()=>_n,Row:()=>zn});var zn=Fo.forwardRef((e,o)=>jsx(g,s(i({display:"flex",flexDirection:"row"},e),{ref:o}))),_n=Fo.forwardRef((e,o)=>jsx(g,s(i({display:"flex",flexDirection:"column"},e),{ref:o})));function vo(r){var a=r,{dismissible:e,flowId:o,part:t}=a,n=f(a,["dismissible","flowId","part"]);return jsx(_,s(i({as:null,flowId:o},n),{children:({handleDismiss:p,handlePrimary:l,handleSecondary:d,parentProps:{containerProps:u},step:m})=>{var B,T,w,P,C;let y=(B=m.props)!=null?B:{},h=(w=(T=m.primaryButton)==null?void 0:T.title)!=null?w:m.primaryButtonTitle,x=(C=(P=m.secondaryButton)==null?void 0:P.title)!=null?C:m.secondaryButtonTitle,R=m.$state.blocked;return jsxs(b,s(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),y),{children:[m.imageUri&&jsx(g,{as:"img",part:"image",src:m.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(S.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(b.Title,{part:"title",children:m.title}),jsx(b.Subtitle,{part:"subtitle",children:m.subtitle})]}),jsx(b.Secondary,{disabled:R,title:x,onClick:d}),jsx(b.Primary,{disabled:R,title:h,onClick:l}),e&&jsx(b.Dismiss,{onClick:p})]}))}}))}var to={};ie(to,{Carousel:()=>Vt,Collapsible:()=>oo,CollapsibleStep:()=>Ve});var Re={};ie(Re,{Bar:()=>ve,Dots:()=>Ft,Fraction:()=>Qe,Segments:()=>Rt});function ve(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=o>0?Math.min(e/o,1):0,p=a===0?"10px":`${100*a}%`;return jsx(g,s(i({part:"progress-bar",backgroundColor:"neutral.800",borderRadius:"md",height:"10px"},t),{children:jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:p},transition:"width 300ms ease-out"})}))}function Ft(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((p,l)=>jsx(g,{as:"circle",r:4,cx:4+16*l,cy:"4px",fill:e-1===l?D.colors.blue500:D.colors.blue800},l));return jsx(g,s(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function Qe(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);return jsx(F.Body2,s(i({part:"progress-fraction"},t),{children:`${e}/${o}`}))}function Rt(n){var r=n,{current:e,total:o}=r,t=f(r,["current","total"]);let a=[...Array(o)].map((p,l)=>jsx(g,{backgroundColor:e-1===l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},l));return jsx(S.Row,s(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function Tt(e){return jsx("svg",s(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 Gn(){return jsx(g,{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 kt(t){var n=t,{checked:e=!1}=n,o=f(n,["checked"]);return jsx(g,s(i({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsx(g,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Gn,{})})}))}function le(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=useContext(z),r={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((a,p,l=!0)=>A(this,null,function*(){if((yield o==null?void 0:o(e,a,p))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(p,l)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(p,l),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,p)=>A(this,null,function*(){if((yield t==null?void 0:t(e,a,p))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let d=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof d=="function"?d():d!==!1&&e.complete(p),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(p),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function Dt({onPrimary:e,onSecondary:o,step:t}){var u,m;let{handlePrimary:n,handleSecondary:r}=le(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:p,skipped:l}=t.$state,d=p||l||!a?jsx(kt,{checked:p||l,marginLeft:"auto"}):jsx(g,{as:Tt,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(b,{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%"}},flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:a,opacity:a?.5:1,children:[jsxs(S.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),d]}),jsx(b.Title,{children:t.title}),jsx(b.Subtitle,{children:t.subtitle}),jsxs(S.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(b.Secondary,{disabled:a,onClick:r,title:(u=t.secondaryButton)==null?void 0:u.title}),jsx(b.Primary,{disabled:a,onClick:n,title:(m=t.primaryButton)==null?void 0:m.title})]})]})}function It(e){return jsx("svg",s(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 $t(e){return jsx("svg",s(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 Mt=keyframes`
25
25
  from {
26
26
  opacity: 0;
27
27
  }
28
28
  to {
29
29
  opacity: 1;
30
30
  }
31
- `;function At({flow:e,sort:o,onPrimary:t,onSecondary:n}){var B,T;let[r,a]=useState(),[p]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(T=(B=Array.from(e.steps.values()).find(w=>!w.$state.completed&&!w.$state.skipped))==null?void 0:B.order)!=null?T:0}),[l,d]=qn(p),[m,u]=useState(),[y,h]=useState();useLayoutEffect(()=>{d&&(m==null&&u(d.canScrollNext()),y==null&&h(d.canScrollPrev()),d.on("select",()=>{u(d.canScrollNext()),h(d.canScrollPrev());}));},[d]),useEffect(()=>{if(!r){let w=Array.from(e.steps.values()),P=w.filter(v=>v.$state.completed||v.$state.skipped).sort((v,E)=>v.order-E.order),C=w.filter(v=>!v.$state.completed&&!v.$state.skipped).sort((v,E)=>v.order-E.order);a(o==="completed-last"?[...C,...P].map(v=>v.id):w.map(v=>v.id));}},[]);let x=e.getNumberOfCompletedSteps(),R=e.getNumberOfAvailableSteps();return r?jsxs(Fragment,{children:[jsxs(S.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:D.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(S.Column,{part:"carousel-header-content",children:[jsx(F.H3,{children:e.title}),jsx(F.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(S.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(F.Body2,{fontWeight:"demibold",part:"progress-text",children:[x,"/",R]}),jsx(ve,{current:x,total:R,minWidth:"200px"})]})]}),jsxs(g,{margin:`0 ${D.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:l,children:[jsx(S.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).filter(w=>w.$state.visible).sort((w,P)=>r.indexOf(w.id)-r.indexOf(P.id)).map(w=>jsx(Dt,{onPrimary:t,onSecondary:n,step:w},w.id))}),y&&jsx(S.Column,{animation:`${Mt} 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(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollPrev(),padding:"2",children:jsx($t,{height:"24px",width:"24px"})})}),m&&jsx(S.Column,{animation:`${Mt} 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(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollNext(),padding:"2",children:jsx(It,{height:"24px",width:"24px"})})})]})]}):null}function Vt(o){var e=f(o,[]);return jsx(_,s(i({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(At,i(i({},e),t))}))}var Ve={};ie(Ve,{Content:()=>To,Root:()=>ko,Trigger:()=>Eo});function Nt(e){return jsx("svg",s(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 Yn=keyframes`
31
+ `;function At({flow:e,sort:o,onPrimary:t,onSecondary:n}){var B,T;let[r,a]=useState(),[p]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(T=(B=Array.from(e.steps.values()).find(w=>!w.$state.completed&&!w.$state.skipped))==null?void 0:B.order)!=null?T:0}),[l,d]=qn(p),[u,m]=useState(),[y,h]=useState();useLayoutEffect(()=>{d&&(u==null&&m(d.canScrollNext()),y==null&&h(d.canScrollPrev()),d.on("select",()=>{m(d.canScrollNext()),h(d.canScrollPrev());}));},[d]),useEffect(()=>{if(!r){let w=Array.from(e.steps.values()),P=w.filter(v=>v.$state.completed||v.$state.skipped).sort((v,E)=>v.order-E.order),C=w.filter(v=>!v.$state.completed&&!v.$state.skipped).sort((v,E)=>v.order-E.order);a(o==="completed-last"?[...C,...P].map(v=>v.id):w.map(v=>v.id));}},[]);let x=e.getNumberOfCompletedSteps(),R=e.getNumberOfAvailableSteps();return r?jsxs(Fragment,{children:[jsxs(S.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:D.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(S.Column,{part:"carousel-header-content",children:[jsx(F.H3,{children:e.title}),jsx(F.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(S.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(F.Body2,{fontWeight:"demibold",part:"progress-text",children:[x,"/",R]}),jsx(ve,{current:x,total:R,minWidth:"200px"})]})]}),jsxs(g,{margin:`0 ${D.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:l,children:[jsx(S.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).filter(w=>w.$state.visible).sort((w,P)=>r.indexOf(w.id)-r.indexOf(P.id)).map(w=>jsx(Dt,{onPrimary:t,onSecondary:n,step:w},w.id))}),y&&jsx(S.Column,{animation:`${Mt} 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(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollPrev(),padding:"2",children:jsx($t,{height:"24px",width:"24px"})})}),u&&jsx(S.Column,{animation:`${Mt} 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(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>d.scrollNext(),padding:"2",children:jsx(It,{height:"24px",width:"24px"})})})]})]}):null}function Vt(o){var e=f(o,[]);return jsx(_,s(i({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(At,i(i({},e),t))}))}var Ve={};ie(Ve,{Content:()=>To,Root:()=>ko,Trigger:()=>Eo});function Nt(e){return jsx("svg",s(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 Yn=keyframes`
32
32
  from {
33
33
  height: 0;
34
34
  opacity: 0;
@@ -46,7 +46,7 @@ var qo=Object.defineProperty,_r=Object.defineProperties;var Ur=Object.getOwnProp
46
46
  height: 0;
47
47
  opacity: 0;
48
48
  }
49
- `,ei=()=>jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function oi({checked:e=!1}){return jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsx(g,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(ei,{})})})}function To({children:e}){return jsx(Te.Content,{asChild:!0,children:jsxs(S.Column,{css:{'&[data-state="open"]':{animation:`${Yn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Qn} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(g,{}),e]})})}function ko(a){var p=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=p,r=f(p,["children","disabled","onOpenChange","open"]);return jsx(Te.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsx(b,s(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function Eo({isCompleted:e,isBlocked:o,title:t}){return jsx(Te.Trigger,{asChild:!0,children:jsxs(S.Row,{alignItems:"center",justifyContent:"space-between",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:[jsxs(S.Row,{alignItems:"center",gap:2,children:[jsx(oi,{checked:e}),jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(g,{as:Nt,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var _t=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Ut({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var R,B,T,w,P,C;let{$state:{blocked:a,completed:p,skipped:l},subtitle:d,title:m}=r,u=(B=(R=r.primaryButton)==null?void 0:R.title)!=null?B:r.primaryButtonTitle,y=(w=(T=r.secondaryButton)==null?void 0:T.title)!=null?w:r.secondaryButtonTitle,h=(P=r.props)!=null?P:{},x=!!a;return jsxs(ko,s(i({open:t,onOpenChange:n},h),{children:[jsx(Eo,{isBlocked:r.$state.blocked,isCompleted:p||l,title:m}),jsxs(To,{children:[jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(C=r.videoUri)!=null?C:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"}),jsx(b.Subtitle,{color:"neutral.400",children:d}),jsxs(S.Row,{gap:3,part:"collapsible-footer",children:[jsx(b.Secondary,{title:y,onClick:o}),jsx(b.Primary,{disabled:x,title:u,onClick:e})]})]})]}))}var ii={default:Ut};function ai(n){var r=n,{flow:e,step:o}=r,t=f(r,["flow","step"]);var B;let{onPrimary:a,onSecondary:p,openStepId:l,setOpenStepId:d,stepTypes:m}=useContext(_t),{handlePrimary:u,handleSecondary:y}=le(o,{onPrimary:a,onSecondary:p}),h=(l!=null?l:e.getCurrentStep().id)===o.id,x=(B=m[o.type])!=null?B:Ut;function R(T){return M(this,null,function*(){d(T?o.id:""),T&&!o.$state.completed&&(yield o.start(),d(null));})}return jsx(x,s(i({flow:e,onOpenChange:R,open:h,step:o},t),{handlePrimary:u,handleSecondary:y}),o.id)}function oo(l){var d=l,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=d,p=f(d,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[m,u]=useState(null),y=i(i({},ii),a);return jsx(_t.Provider,{value:{openStepId:m,setOpenStepId:u,onPrimary:t,onSecondary:n,stepTypes:y},children:jsx(_,s(i({as:b,borderWidth:"md",flowId:o,part:["checklist",r]},p),{children:B=>{var T=B,{flow:h,handleDismiss:x}=T,R=f(T,["flow","handleDismiss"]);let P=Array.from(h.steps.entries()).filter(([,E])=>E.$state.visible===!0).map(([,E])=>jsx(ai,s(i({flow:h,handleDismiss:x},R),{step:E}),E.id)),C=h.getNumberOfCompletedSteps(),v=h.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(S.Column,{gap:2,children:[jsx(b.Header,{dismissible:e,handleDismiss:x,part:"checklist-header",subtitle:h.subtitle,title:h.title}),jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxs(F.Body2,{fontWeight:"demibold",children:[C,"/",v]}),jsx(ve,{current:C,total:v,flexGrow:1})]})]}),P]})}}))})}var gi=new Set(["required","min","max","minLength","maxLength","pattern"]);function yi({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=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])=>gi.has(l))),p=useController({name:t.id,control:o,rules:a});return jsx(e,s(i({},p),{fieldData:t,formContext:r,submit:n}))}function jt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var C,v,E,$,N;let{__readOnly:p}=useContext(z),l=useMemo(()=>{var k;return (k=a.fields)==null?void 0:k.filter(I=>e[I.type]!=null&&I.id)},[a.fields,e]),d=useForm({delayError:2e3,mode:"onChange",defaultValues:l.reduce((k,I)=>{var W;return k[I.id]=(W=I.value)!=null?W:"",k},{})});useEffect(()=>{d.formState.isDirty||d.reset(l.reduce((k,I)=>{var W;return k[I.id]=(W=I.value)!=null?W:"",k},{}));},[l]);let[m,u]=useState(!1),y=[],{control:h,handleSubmit:x}=d,R=(C=a.props)!=null?C:{};function B(k,I){u(!0),t(I,k,p===!0).then(()=>u(!1));}l.forEach(k=>{e[k.type]!=null&&y.push(jsx(yi,{control:h,fieldComponent:e[k.type],fieldData:k,submit:x(B)},`${a.flow.id}-${k.id}`));});let T=(E=(v=a.primaryButton)==null?void 0:v.title)!=null?E:a.primaryButtonTitle,w=(N=($=a.secondaryButton)==null?void 0:$.title)!=null?N:a.secondaryButtonTitle,P=!!(a.$state.blocked||!d.formState.isValid);return useEffect(()=>{d.clearErrors();},[a]),jsxs(S.Column,s(i({gap:5,part:"form-step"},R),{children:[jsx(b.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsx(FormProvider,s(i({},d),{children:y})),jsxs(S.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[w&&jsx(O.Secondary,{onClick:n,title:w}),jsx(O.Primary,{disabled:P||m,onClick:x(B),title:T!=null?T:"Submit",loading:m})]},`form-footer-${a.id}`)]}))}function Xt({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 Do({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(g,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Oo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Le=s(i({},Oo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),ro={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 Y({children:e,field:o,fieldData:t,fieldState:n}){var m;let{id:r,label:a,placeholder:p}=t,{error:l}=n,d=s(i(i(i({id:r},o),p?{placeholder:p}:{}),Le),{"aria-invalid":!!l,value:(m=o.value)!=null?m:""});return jsxs(g,{part:"field",children:[jsx(Do,{id:r,required:!!t.required,children:a}),e(d),jsx(Xt,{error:l})]})}function Ee(e){return jsx("svg",s(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 Ci=Fo.forwardRef(({label:e,value:o},t)=>jsxs(g,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsx(F.Body2,{part:"field-radio-label",children:e}),jsx(De.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(g,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(g,s(i({as:De.Indicator},ro),{children:jsx(Ee,{height:"14",width:"14"})}))})})]}));function Io(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:p})=>jsx(Ci,{value:p,label:a},p));return jsx(Y,s(i({},e),{children:()=>jsx(De.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(S.Column,{gap:2,part:"field-radio-group",children:r})})}))}function Qt(e){return jsx("svg",s(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 or(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,a]=Fo.useState([]);function p(l){let d=[];r.includes(l)?d=[...r.filter(m=>m!==l)]:d=[...r,l],a(d),o(d);}return jsx(Y,s(i({},e),{children:()=>jsx(S.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:l,value:d})=>jsx(no.Root,{value:r.includes(d)?d:void 0,onCheckedChange:()=>p(d),asChild:!0,children:jsxs(g,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:d,justifyContent:"space-between",part:"field-check",px:4,py:2,children:[jsx(F.Body2,{part:"field-check-label",children:l}),jsx(g,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",id:d,padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(no.Indicator,{asChild:!0,children:jsx(g,s(i({},ro),{children:jsx(Ee,{height:"14",width:"14"})}))})})]})},d))})}))}var Fi=Fo.forwardRef(({label:e,value:o},t)=>jsx(V.Item,{value:o,ref:t,asChild:!0,children:jsx(g,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(V.ItemText,{asChild:!0,children:jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function Ho(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:p,value:l})=>jsx(Fi,{value:l,label:p},l));return e.fieldData.multiple?jsx(or,i({},e)):jsx(Y,s(i({},e),{children:()=>jsxs(V.Root,{value:t,onValueChange:o,children:[jsx(V.Trigger,{asChild:!0,children:jsxs(F.Body2,s(i({},Le),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(V.Value,{placeholder:r!=null?r:"Select one"}),jsx(V.Icon,{children:jsx(g,{as:Qt,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(V.Portal,{children:jsx(V.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(g,s(i({},Le),{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(V.Viewport,{children:a})}))})})]})}))}function $o(e){return jsx(Y,s(i({},e),{children:o=>jsx(F.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Mo(e){return jsx(Y,s(i({},e),{children:o=>jsx(F.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function ar(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxs(g,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(no.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(g,s(i({},Oo),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:a,children:jsx(no.Indicator,{asChild:!0,children:jsx(g,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(Ee,{height:"14",fill:"currentColor"})})})}))}),jsx(F.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var Ri={checkbox:ar,radio:Io,select:Ho,text:$o,textarea:Mo};function Ie(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=f(a,["fieldTypes","flowId","part"]);let p=Object.assign({},Ri,e);return jsx(_,s(i({flowId:o,part:["form",t]},n),{children:l=>jsx(jt,i({fieldTypes:p},l))}))}var so={};ie(so,{NPS:()=>ze});function pr({field:e,fieldData:o,submit:t}){var r,a;let n=[...Array(11)].map((p,l)=>{let d=e.value===l?O.Primary:O.Secondary;return jsx(d,{borderWidth:"1px",onClick:()=>{e.onChange(l),t();},title:`${l}`,css:{".fr-button-title":{fontSize:"15px"}}},l)});return jsxs(S.Column,{gap:2,children:[jsx(S.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxs(S.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function ze(a){var p=a,{as:e=H,flowId:o,fieldTypes:t,part:n}=p,r=f(p,["as","flowId","fieldTypes","part"]);let{flow:l}=Se(o);return jsx(Ie,s(i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:pr},t),modal:!1,onEscapeKeyDown:d=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(d),d.defaultPrevented||l.skip();},part:["nps",n]},r),{css:i({},i(s(i({},!l||l.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}}),r.css))}))}function ki(r,n){var a=r,{children:e,part:o}=a,t=f(a,["children","part"]);return jsx(RemoveScroll,{forwardProps:!0,ref:n,children:jsx(g,s(i({backgroundColor:"black",inset:"0",opacity:"0.5",part:["overlay",o],position:"absolute"},t),{children:e}))})}var lo=Fo.forwardRef(ki);var Di=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function ur(t){var n=t,{part:e=""}=n,o=f(n,["part"]);return jsxs(g,s(i({borderRadius:"24px",height:"24px",part:`ping-wrapper ${e}`,position:"relative",width:"24px"},o),{children:[jsx(g,{backgroundColor:"primary.surface",animation:`2s ease-out infinite ${Di}`,borderRadius:"24px",height:"48px",left:"-12px",part:"ping-pulse",pointerEvents:"none",position:"absolute",top:"-12px",transformOrigin:"center center",width:"48px"}),jsx(g,{backgroundColor:"primary.surface",borderRadius:"12px",height:"24px",left:"0",part:"ping",position:"absolute",top:"0",width:"24px"})]}))}function Ai({maxX:e,maxY:o,radius:t,x1:n,x2:r,y1:a,y2:p}){return t>0?`path("${[`M${n+t},${a}`,`H${r-t}`,`A${t} ${t} 0,0,1 ${r} ${a+t}`,`V${p-t}`,`A${t} ${t} 0,0,1 ${r-t} ${p}`,`H${n+t}`,`A${t} ${t} 0,0,1 ${n} ${p-t}`,`V${o}`,`H${e}`,"V0","H0",`V${o}`,`H${n}`,`V${a+t}`,`A${t} ${t} 0,0,1 ${n+t} ${a}`,"Z"].join(" ")}")`:`path("M${n},${a} H${r} V${p} H${n} V${o} H${e} V0 H0 V${o} H${n} Z")`}function Wi(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 Ao(r){var a=r,{anchor:e,part:o,style:t={}}=a,n=f(a,["anchor","part","style"]);let[p,l]=useState({maxX:0,maxY:0,radius:0,x1:0,x2:0,y1:0,y2:0}),{refs:d}=useFloating({middleware:[{name:"clipPath",fn({elements:m,rects:u}){return l({maxX:m.floating.clientWidth,maxY:m.floating.clientHeight,radius:Wi(m.reference),x1:u.reference.x,x2:u.reference.x+u.reference.width,y1:u.reference.y,y2:u.reference.y+u.reference.height}),{}}}],open:!0,placement:"top-center",transform:!1,whileElementsMounted:autoUpdate});return useEffect(()=>{let m=document.querySelector(e);m!=null?d.setReference(m):console.debug(`[frigade] Spotlight: No anchor found for selector: ${e}`);},[e]),jsx(lo,i({part:["spotlight",o],ref:d.setFloating,style:i({clipPath:Ai(p)},t)},n))}function fr({align:e,side:o}){let t={},n="-12px",r={top:"bottom",right:"left",bottom:"top",left:"right"};return t[r[o]]=n,["before","end"].includes(e)?["top","bottom"].includes(o)?t.right=n:t.bottom=n:["after","start"].includes(e)?["top","bottom"].includes(o)?t.left=n:t.top=n:["top","bottom"].includes(o)?t.left=`calc(50% + ${n})`:t.top=`calc(50% + ${n})`,t}function qi(e){switch(e){case"after":return "end";case"before":return "start";default:return e}}function gr({align:e,alignOffset:o,anchor:t,onOpenChange:n=()=>{},open:r,side:a,sideOffset:p}){let l=`${a}-${qi(e)}`;function d({rects:C}){let v={alignmentAxis:o,mainAxis:p};return ["after","before"].includes(e)&&(["bottom","top"].includes(a)?v.alignmentAxis=o-C.floating.width:v.alignmentAxis=o-C.floating.height),v}let{context:m,floatingStyles:u,placement:y,refs:h}=useFloating({middleware:[offset(d),flip(),shift()],onOpenChange:n,open:r,placement:l,whileElementsMounted:autoUpdate}),x=useClick(m),R=useDismiss(m,{outsidePress:!1}),B=useRole(m),{getFloatingProps:T,getReferenceProps:w}=useInteractions([x,R,B]);useEffect(()=>{let C=document.querySelector(t);C!=null?h.setReference(C):console.debug(`[frigade] Hint: No anchor found for selector: ${t}`);},[t]);let P=y.split("-");return e==="before"?P[1]=P[1]==="end"?"after":"before":e==="after"&&(P[1]=P[1]==="start"?"before":"after"),{context:m,getFloatingProps:T,getReferenceProps:w,floatingStyles:u,placement:P.join("-"),refs:h}}function Vo(R){var B=R,{align:e="center",alignOffset:o=0,anchor:t,children:n,defaultOpen:r=!0,modal:a=!1,onOpenChange:p=()=>{},open:l,part:d,side:m="bottom",sideOffset:u=0,spotlight:y=!1,style:h={}}=B,x=f(B,["align","alignOffset","anchor","children","defaultOpen","modal","onOpenChange","open","part","side","sideOffset","spotlight","style"]);let[T,w]=useState(r),P=l!=null?l:T,{getFloatingProps:C,getReferenceProps:v,floatingStyles:E,placement:$,refs:N}=gr({align:e,alignOffset:o,anchor:t,onOpenChange:he=>{p(he),l==null&&w(he);},open:P,side:m,sideOffset:u}),[k,I]=$.split("-"),W=v();return jsxs(Fragment,{children:[y&&P&&jsx(Ao,{anchor:t}),a&&!y&&P&&jsx(lo,{lockScroll:!0}),jsxs(g,s(i(i({part:["hint",d],ref:N.setFloating,style:i(i({},E),h)},C()),x),{children:[P&&n,jsx(ur,s(i({},W),{position:"absolute",style:fr({align:I,side:k})}))]}))]})}var ea=keyframes`
49
+ `,ei=()=>jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function oi({checked:e=!1}){return jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsx(g,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(ei,{})})})}function To({children:e}){return jsx(Te.Content,{asChild:!0,children:jsxs(S.Column,{css:{'&[data-state="open"]':{animation:`${Yn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Qn} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(g,{}),e]})})}function ko(a){var p=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=p,r=f(p,["children","disabled","onOpenChange","open"]);return jsx(Te.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsx(b,s(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},r),{children:e}))})}function Eo({isCompleted:e,isBlocked:o,title:t}){return jsx(Te.Trigger,{asChild:!0,children:jsxs(S.Row,{alignItems:"center",justifyContent:"space-between",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:[jsxs(S.Row,{alignItems:"center",gap:2,children:[jsx(oi,{checked:e}),jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(g,{as:Nt,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var _t=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Ut({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var R,B,T,w,P,C;let{$state:{blocked:a,completed:p,skipped:l},subtitle:d,title:u}=r,m=(B=(R=r.primaryButton)==null?void 0:R.title)!=null?B:r.primaryButtonTitle,y=(w=(T=r.secondaryButton)==null?void 0:T.title)!=null?w:r.secondaryButtonTitle,h=(P=r.props)!=null?P:{},x=!!a;return jsxs(ko,s(i({open:t,onOpenChange:n},h),{children:[jsx(Eo,{isBlocked:r.$state.blocked,isCompleted:p||l,title:u}),jsxs(To,{children:[jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",overflowClipMargin:"unset",src:(C=r.videoUri)!=null?C:r.imageUri,transform:"translate3d(0, 0, 1px)",type:r.videoUri?"video":"image"}),jsx(b.Subtitle,{color:"neutral.400",children:d}),jsxs(S.Row,{gap:3,part:"collapsible-footer",children:[jsx(b.Secondary,{title:y,onClick:o}),jsx(b.Primary,{disabled:x,title:m,onClick:e})]})]})]}))}var ii={default:Ut};function ai(n){var r=n,{flow:e,step:o}=r,t=f(r,["flow","step"]);var B;let{onPrimary:a,onSecondary:p,openStepId:l,setOpenStepId:d,stepTypes:u}=useContext(_t),{handlePrimary:m,handleSecondary:y}=le(o,{onPrimary:a,onSecondary:p}),h=(l!=null?l:e.getCurrentStep().id)===o.id,x=(B=u[o.type])!=null?B:Ut;function R(T){return A(this,null,function*(){d(T?o.id:""),T&&!o.$state.completed&&(yield o.start(),d(null));})}return jsx(x,s(i({flow:e,onOpenChange:R,open:h,step:o},t),{handlePrimary:m,handleSecondary:y}),o.id)}function oo(l){var d=l,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:a={}}=d,p=f(d,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,m]=useState(null),y=i(i({},ii),a);return jsx(_t.Provider,{value:{openStepId:u,setOpenStepId:m,onPrimary:t,onSecondary:n,stepTypes:y},children:jsx(_,s(i({as:b,borderWidth:"md",flowId:o,part:["checklist",r]},p),{children:B=>{var T=B,{flow:h,handleDismiss:x}=T,R=f(T,["flow","handleDismiss"]);let P=Array.from(h.steps.entries()).filter(([,E])=>E.$state.visible===!0).map(([,E])=>jsx(ai,s(i({flow:h,handleDismiss:x},R),{step:E}),E.id)),C=h.getNumberOfCompletedSteps(),v=h.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(S.Column,{gap:2,children:[jsx(b.Header,{dismissible:e,handleDismiss:x,part:"checklist-header",subtitle:h.subtitle,title:h.title}),jsxs(S.Row,{alignItems:"center",gap:2,children:[jsxs(F.Body2,{fontWeight:"demibold",children:[C,"/",v]}),jsx(ve,{current:C,total:v,flexGrow:1})]})]}),P]})}}))})}var gi=new Set(["required","min","max","minLength","maxLength","pattern"]);function yi({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=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])=>gi.has(l))),p=useController({name:t.id,control:o,rules:a});return jsx(e,s(i({},p),{fieldData:t,formContext:r,submit:n}))}function jt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:a}){var C,v,E,M,N;let{__readOnly:p}=useContext(z),l=useMemo(()=>{var k,I;return (I=(k=a.fields)==null?void 0:k.filter($=>e[$.type]!=null&&$.id))!=null?I:[]},[a.fields,e]),d=useForm({delayError:2e3,mode:"onChange",defaultValues:l.reduce((k,I)=>{var $;return k[I.id]=($=I.value)!=null?$:"",k},{})});useEffect(()=>{d.formState.isDirty||d.reset(l.reduce((k,I)=>{var $;return k[I.id]=($=I.value)!=null?$:"",k},{}));},[l]);let[u,m]=useState(!1),y=[],{control:h,handleSubmit:x}=d,R=(C=a.props)!=null?C:{};function B(k,I){m(!0),t(I,k,p===!0).then(()=>m(!1));}l.forEach(k=>{e[k.type]!=null&&y.push(jsx(yi,{control:h,fieldComponent:e[k.type],fieldData:k,submit:x(B)},`${a.flow.id}-${k.id}`));});let T=(E=(v=a.primaryButton)==null?void 0:v.title)!=null?E:a.primaryButtonTitle,w=(N=(M=a.secondaryButton)==null?void 0:M.title)!=null?N:a.secondaryButtonTitle,P=!!(a.$state.blocked||!d.formState.isValid);return useEffect(()=>{d.clearErrors();},[a]),jsxs(S.Column,s(i({gap:5,part:"form-step"},R),{children:[jsx(b.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsx(FormProvider,s(i({},d),{children:y})),jsxs(S.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[w&&jsx(O.Secondary,{onClick:n,title:w}),jsx(O.Primary,{disabled:P||u,onClick:x(B),title:T!=null?T:"Submit",loading:u})]},`form-footer-${a.id}`)]}))}function Xt({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 Do({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(g,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Oo={backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md"},Le=s(i({},Oo),{px:"4",py:"2",display:"block",outline:"none",width:"100%"}),ro={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 Y({children:e,field:o,fieldData:t,fieldState:n}){var u;let{id:r,label:a,placeholder:p}=t,{error:l}=n,d=s(i(i(i({id:r},o),p?{placeholder:p}:{}),Le),{"aria-invalid":!!l,value:(u=o.value)!=null?u:""});return jsxs(g,{part:"field",children:[jsx(Do,{id:r,required:!!t.required,children:a}),e(d),jsx(Xt,{error:l})]})}function Ee(e){return jsx("svg",s(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 Ci=Fo.forwardRef(({label:e,value:o},t)=>jsxs(g,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsx(F.Body2,{part:"field-radio-label",children:e}),jsx(De.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(g,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(g,s(i({as:De.Indicator},ro),{children:jsx(Ee,{height:"14",width:"14"})}))})})]}));function Io(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:a,value:p})=>jsx(Ci,{value:p,label:a},p));return jsx(Y,s(i({},e),{children:()=>jsx(De.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(S.Column,{gap:2,part:"field-radio-group",children:r})})}))}function Qt(e){return jsx("svg",s(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 or(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,[r,a]=Fo.useState([]);function p(l){let d=[];r.includes(l)?d=[...r.filter(u=>u!==l)]:d=[...r,l],a(d),o(d);}return jsx(Y,s(i({},e),{children:()=>jsx(S.Column,{gap:2,part:"field-select-multiple",children:n.map(({label:l,value:d})=>jsx(no.Root,{value:r.includes(d)?d:void 0,onCheckedChange:()=>p(d),asChild:!0,children:jsxs(g,{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:l}),jsx(g,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",flex:"0 0 auto",id:d,padding:"0",part:"field-check-value",position:"relative",height:"24px",width:"24px",children:jsx(no.Indicator,{asChild:!0,children:jsx(g,s(i({},ro),{children:jsx(Ee,{height:"14",width:"14"})}))})})]})},d))})}))}var Fi=Fo.forwardRef(({label:e,value:o},t)=>jsx(V.Item,{value:o,ref:t,asChild:!0,children:jsx(g,{"backgroundColor:hover":"neutral.900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(V.ItemText,{asChild:!0,children:jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function Ho(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,a=n.map(({label:p,value:l})=>jsx(Fi,{value:l,label:p},l));return e.fieldData.multiple?jsx(or,i({},e)):jsx(Y,s(i({},e),{children:()=>jsxs(V.Root,{value:t,onValueChange:o,children:[jsx(V.Trigger,{asChild:!0,children:jsxs(F.Body2,s(i({},Le),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(V.Value,{placeholder:r!=null?r:"Select one"}),jsx(V.Icon,{children:jsx(g,{as:Qt,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(V.Portal,{children:jsx(V.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(g,s(i({},Le),{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(V.Viewport,{children:a})}))})})]})}))}function $o(e){return jsx(Y,s(i({},e),{children:o=>jsx(F.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Mo(e){return jsx(Y,s(i({},e),{children:o=>jsx(F.Body2,i({as:"textarea",part:"field-textarea"},o))}))}function ar(e){let{field:{onChange:o,value:t},fieldData:{options:n,label:r,id:a=[]}}=e;return jsxs(g,{part:"field",display:"flex",gap:2,alignItems:"center",children:[jsx(no.Root,{defaultChecked:!0,onCheckedChange:o,value:t,checked:t===!0,asChild:!0,children:jsx(g,s(i({},Oo),{as:"button",width:"25px",minWidth:"25px",height:"25px",justifyContent:"center",alignItems:"center",display:"flex","backgroundColor:hover":"neutral.900",part:"field-checkbox",id:a,children:jsx(no.Indicator,{asChild:!0,children:jsx(g,{width:"20px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center",children:jsx(Ee,{height:"14",fill:"currentColor"})})})}))}),jsx(F.Body2,{part:"field-checkbox-label",as:"label",htmlFor:a,children:r})]})}var Ri={checkbox:ar,radio:Io,select:Ho,text:$o,textarea:Mo};function Ie(r){var a=r,{fieldTypes:e={},flowId:o,part:t}=a,n=f(a,["fieldTypes","flowId","part"]);let p=Object.assign({},Ri,e);return jsx(_,s(i({flowId:o,part:["form",t]},n),{children:l=>jsx(jt,i({fieldTypes:p},l))}))}var so={};ie(so,{NPS:()=>ze});function pr({field:e,fieldData:o,submit:t}){var r,a;let n=[...Array(11)].map((p,l)=>{let d=e.value===l?O.Primary:O.Secondary;return jsx(d,{borderWidth:"1px",onClick:()=>{e.onChange(l),t();},title:`${l}`,css:{".fr-button-title":{fontSize:"15px"}}},l)});return jsxs(S.Column,{gap:2,children:[jsx(S.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:n}),jsxs(S.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(r=o.negativeLabel)!=null?r:"Not likely at all"}),jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function ze(a){var p=a,{as:e=H,flowId:o,fieldTypes:t,part:n}=p,r=f(p,["as","flowId","fieldTypes","part"]);let{flow:l}=Se(o);return jsx(Ie,s(i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:pr},t),modal:!1,onEscapeKeyDown:d=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(d),d.defaultPrevented||l.skip();},part:["nps",n]},r),{css:i({},i(s(i({},!l||l.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}}),r.css))}))}function ki(r,n){var a=r,{children:e,part:o}=a,t=f(a,["children","part"]);return jsx(RemoveScroll,{forwardProps:!0,ref:n,children:jsx(g,s(i({backgroundColor:"black",inset:"0",opacity:"0.5",part:["overlay",o],position:"absolute"},t),{children:e}))})}var lo=Fo.forwardRef(ki);var Di=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function mr(t){var n=t,{part:e=""}=n,o=f(n,["part"]);return jsxs(g,s(i({borderRadius:"24px",height:"24px",part:`ping-wrapper ${e}`,position:"relative",width:"24px"},o),{children:[jsx(g,{backgroundColor:"primary.surface",animation:`2s ease-out infinite ${Di}`,borderRadius:"24px",height:"48px",left:"-12px",part:"ping-pulse",pointerEvents:"none",position:"absolute",top:"-12px",transformOrigin:"center center",width:"48px"}),jsx(g,{backgroundColor:"primary.surface",borderRadius:"12px",height:"24px",left:"0",part:"ping",position:"absolute",top:"0",width:"24px"})]}))}function Ai({maxX:e,maxY:o,radius:t,x1:n,x2:r,y1:a,y2:p}){return t>0?`path("${[`M${n+t},${a}`,`H${r-t}`,`A${t} ${t} 0,0,1 ${r} ${a+t}`,`V${p-t}`,`A${t} ${t} 0,0,1 ${r-t} ${p}`,`H${n+t}`,`A${t} ${t} 0,0,1 ${n} ${p-t}`,`V${o}`,`H${e}`,"V0","H0",`V${o}`,`H${n}`,`V${a+t}`,`A${t} ${t} 0,0,1 ${n+t} ${a}`,"Z"].join(" ")}")`:`path("M${n},${a} H${r} V${p} H${n} V${o} H${e} V0 H0 V${o} H${n} Z")`}function Wi(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 Ao(r){var a=r,{anchor:e,part:o,style:t={}}=a,n=f(a,["anchor","part","style"]);let[p,l]=useState({maxX:0,maxY:0,radius:0,x1:0,x2:0,y1:0,y2:0}),{refs:d}=useFloating({middleware:[{name:"clipPath",fn({elements:u,rects:m}){return l({maxX:u.floating.clientWidth,maxY:u.floating.clientHeight,radius:Wi(u.reference),x1:m.reference.x,x2:m.reference.x+m.reference.width,y1:m.reference.y,y2:m.reference.y+m.reference.height}),{}}}],open:!0,placement:"top-center",transform:!1,whileElementsMounted:autoUpdate});return useEffect(()=>{let u=document.querySelector(e);u!=null?d.setReference(u):console.debug(`[frigade] Spotlight: No anchor found for selector: ${e}`);},[e]),jsx(lo,i({part:["spotlight",o],ref:d.setFloating,style:i({clipPath:Ai(p)},t)},n))}function fr({align:e,side:o}){let t={},n="-12px",r={top:"bottom",right:"left",bottom:"top",left:"right"};return t[r[o]]=n,["before","end"].includes(e)?["top","bottom"].includes(o)?t.right=n:t.bottom=n:["after","start"].includes(e)?["top","bottom"].includes(o)?t.left=n:t.top=n:["top","bottom"].includes(o)?t.left=`calc(50% + ${n})`:t.top=`calc(50% + ${n})`,t}function qi(e){switch(e){case"after":return "end";case"before":return "start";default:return e}}function gr({align:e,alignOffset:o,anchor:t,onOpenChange:n=()=>{},open:r,side:a,sideOffset:p}){let l=`${a}-${qi(e)}`;function d({rects:C}){let v={alignmentAxis:o,mainAxis:p};return ["after","before"].includes(e)&&(["bottom","top"].includes(a)?v.alignmentAxis=o-C.floating.width:v.alignmentAxis=o-C.floating.height),v}let{context:u,floatingStyles:m,placement:y,refs:h}=useFloating({middleware:[offset(d),flip(),shift()],onOpenChange:n,open:r,placement:l,whileElementsMounted:autoUpdate}),x=useClick(u),R=useDismiss(u,{outsidePress:!1}),B=useRole(u),{getFloatingProps:T,getReferenceProps:w}=useInteractions([x,R,B]);useEffect(()=>{let C=document.querySelector(t);C!=null?h.setReference(C):console.debug(`[frigade] Hint: No anchor found for selector: ${t}`);},[t]);let P=y.split("-");return e==="before"?P[1]=P[1]==="end"?"after":"before":e==="after"&&(P[1]=P[1]==="start"?"before":"after"),{context:u,getFloatingProps:T,getReferenceProps:w,floatingStyles:m,placement:P.join("-"),refs:h}}function Vo(R){var B=R,{align:e="center",alignOffset:o=0,anchor:t,children:n,defaultOpen:r=!0,modal:a=!1,onOpenChange:p=()=>{},open:l,part:d,side:u="bottom",sideOffset:m=0,spotlight:y=!1,style:h={}}=B,x=f(B,["align","alignOffset","anchor","children","defaultOpen","modal","onOpenChange","open","part","side","sideOffset","spotlight","style"]);let[T,w]=useState(r),P=l!=null?l:T,{getFloatingProps:C,getReferenceProps:v,floatingStyles:E,placement:M,refs:N}=gr({align:e,alignOffset:o,anchor:t,onOpenChange:he=>{p(he),l==null&&w(he);},open:P,side:u,sideOffset:m}),[k,I]=M.split("-"),$=v();return jsxs(Fragment,{children:[y&&P&&jsx(Ao,{anchor:t}),a&&!y&&P&&jsx(lo,{lockScroll:!0}),jsxs(g,s(i(i({part:["hint",d],ref:N.setFloating,style:i(i({},E),h)},C()),x),{children:[P&&n,jsx(mr,s(i({},$),{position:"absolute",style:fr({align:I,side:k})}))]}))]})}var ea=keyframes`
50
50
  from {
51
51
  opacity: 0;
52
52
  }
@@ -56,7 +56,7 @@ var qo=Object.defineProperty,_r=Object.defineProperties;var Ur=Object.getOwnProp
56
56
  to {
57
57
  opacity: 1;
58
58
  }
59
- `;function po(B){var T=B,{align:e,alignOffset:o,defaultOpen:t,dismissible:n,flow:r,handleDismiss:a,modal:p,onPrimary:l,onSecondary:d,part:m,side:u,sideOffset:y,spotlight:h,step:x}=T,R=f(T,["align","alignOffset","defaultOpen","dismissible","flow","handleDismiss","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var $,N,k,I,W;let{handlePrimary:w,handleSecondary:P}=le(x,{onPrimary:l,onSecondary:d}),C=(N=($=x.primaryButton)==null?void 0:$.title)!=null?N:x.primaryButtonTitle,v=(I=(k=x.secondaryButton)==null?void 0:k.title)!=null?I:x.secondaryButtonTitle,E=!!x.$state.blocked;return jsx(Vo,s(i({align:e,alignOffset:o,anchor:x.selector,"data-step-id":x.id,defaultOpen:t,modal:p,part:m,side:u,sideOffset:y,spotlight:h},R),{children:jsxs(b,{animation:`${ea} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsx(b.Media,{aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:(W=x.videoUri)!=null?W:x.imageUri,transform:"translate3d(0, 0, 1px)",type:x.videoUri?"video":"image"}),jsx(b.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:a,subtitle:x.subtitle,title:x.title}),jsxs(b.Footer,{children:[r.getNumberOfAvailableSteps()>1&&jsx(Qe,{current:r.getCurrentStepOrder()+1,marginRight:"auto",total:r.getNumberOfAvailableSteps()}),jsx(b.Secondary,{disabled:E,onClick:P,title:v}),jsx(b.Primary,{disabled:E,onClick:w,title:C})]})]})}))}function hr(e,o,t){let[n,r]=useState(!1),a=useRef();return useEffect(()=>{a.current=typeof o=="string"?document.querySelector(o):o,r(!0);},[]),n?createPortal(e,a.current,t):null}function co(R){var B=R,{align:e="after",alignOffset:o=0,as:t,defaultOpen:n,dismissible:r=!1,flowId:a,modal:p,part:l,sequential:d=!0,side:m="bottom",sideOffset:u=0,spotlight:y,zIndex:h=9999}=B,x=f(B,["align","alignOffset","as","defaultOpen","dismissible","flowId","modal","part","sequential","side","sideOffset","spotlight","zIndex"]);let{onDismiss:T,onPrimary:w,onSecondary:P}=x;return hr(jsx(_,s(i({as:t,flowId:a,part:"tour"},x),{children:({flow:C,handleDismiss:v,parentProps:{containerProps:E},step:$})=>{var k,I,W,he;let N=i({align:e,alignOffset:o,dismissible:r,flow:C,handleDismiss:v,modal:p,onPrimary:w,onSecondary:P,part:l,side:m,sideOffset:u,spotlight:y,step:$,zIndex:(W=(I=(k=$.props)==null?void 0:k.zIndex)!=null?I:E==null?void 0:E.zIndex)!=null?W:h},(he=$.props)!=null?he:{});return d?jsx(po,i({defaultOpen:n!=null?n:!0},N)):Array.from(C.steps.values()).filter(Q=>{let{blocked:$e,completed:me,skipped:ee,visible:we}=Q.$state;return !$e&&!me&&!ee&&we}).map(Q=>{var Ke,K,oe,ne,te;function $e(ue){return M(this,null,function*(){return (yield T==null?void 0:T(C,ue))===!1?(ue.preventDefault(),!1):(Q.skip(),!0)})}let me=y&&Q.id===$.id,ee=(oe=(K=(Ke=Q.props)==null?void 0:Ke.zIndex)!=null?K:E==null?void 0:E.zIndex)!=null?oe:h,we=i({align:e,alignOffset:o,dismissible:r,flow:C,handleDismiss:$e,onPrimary:w,onSecondary:P,part:l,side:m,sideOffset:u,spotlight:y,zIndex:ee},(ne=Q.props)!=null?ne:{});return jsx(po,i({css:{"&:has([aria-expanded=true])":{zIndex:Number(ee)+2},".fr-overlay":{zIndex:Number(ee)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(te=n||me)!=null?te:!1,step:Q},we),`${Q.id}-${me}`)})}})),"body")}function br(e){var m,u,y;let{frigade:o}=useContext(z),[,t]=useState(!1),n,r=useCallback(h=>{o==null||o.getCollection(e).then(()=>{h();});let x=()=>{clearTimeout(n),n=setTimeout(()=>{t(R=>!R),h();},100);};return o==null||o.onStateChange(x),()=>{o==null||o.removeStateChangeHandler(x);}},[e]),a=useSyncExternalStore(r,()=>{let h;try{h=o==null?void 0:o.getCollectionSync(e);}catch(x){}return h},()=>{let h;try{h=o==null?void 0:o.getCollectionSync(e);}catch(x){}return h}),l=(y=((u=(m=a==null?void 0:a.flows)==null?void 0:m.map(h=>s(i({},h),{flow:o==null?void 0:o.getFlowSync(h.flowId)})))!=null?u:[]).find(({flow:h})=>h.isVisible))==null?void 0:y.flowId,{flow:d}=Se(l);return {collection:a,currentFlow:d}}function No(r){var a=r,{collectionId:e,part:o,variables:t={}}=a,n=f(a,["collectionId","part","variables"]);var m,u,y;let p={ANNOUNCEMENT:zo,BANNER:vo,CARD:b,CHECKLIST:oo,EMBEDDED_TIP:b,FORM:Ie,NPS_SURVEY:ze,SURVEY:ze,TOUR:co},{currentFlow:l}=br(e),d=(u=p[(m=l==null?void 0:l.rawData)==null?void 0:m.flowType])!=null?u:null;return l==null||d==null?null:((y=l==null?void 0:l.rawData)==null?void 0:y.flowType)===FlowType.FORM?jsx(g,s(i({part:["collection",o],"data-collection-id":e},n),{children:jsx(Ie,{flowId:l.id,as:H,variables:t},l.id)})):jsx(g,s(i({part:["collection",o],"data-collection-id":e},n),{children:jsx(d,{flowId:l.id,variables:t},l.id)}))}function _e(){let{frigade:e}=useContext(z);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Pr(){let[e,o]=useState(),{frigade:t}=_e();return useEffect(()=>{t.getCollections().then(n=>{n==null||n.forEach((r,a)=>{r.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsx(No,{as:null,collectionId:e})}var z=createContext({apiKey:"",navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});function Cr(){let{frigade:e}=_e();return useEffect(()=>{M(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}var Sr="2.5.3";function Rr(p){var l=p,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=l,a=f(l,["children","css","defaultCollection","navigate","theme"]);let d=r?bo(r):{},m=useRef(new Map),u=useRef(),[y,h]=useState(!1),x=useMemo(()=>(h(!1),u.current=void 0,new Frigade(a.apiKey,{apiKey:a.apiKey,apiUrl:a.apiUrl,userId:a.userId,groupId:a.groupId,userProperties:a.userProperties,groupProperties:a.groupProperties,generateGuestId:a.generateGuestId,syncOnWindowUpdates:a.syncOnWindowUpdates,__readOnly:a.__readOnly,__flowStateOverrides:a.__flowStateOverrides,__platformVersion:Sr,__platformName:"React"})),[a.userId,a.groupId,a.apiKey]);useEffect(()=>{if(a.__flowStateOverrides){let P=x.getConfig();P.__flowStateOverrides=a.__flowStateOverrides,x.reload(P);}},[a.__flowStateOverrides]);function R(){let P=[...m.current.entries()].map(([C,v])=>[C,v.callback]);x.batchRegister(P),h(!0);}function B(P,C){if(u.current&&clearTimeout(u.current),y){m.current.has(P)?x.getFlow(P).then(v=>C(v.isVisible)):(x.getFlow(P).then(v=>v.register(C)),m.current.set(P,{callback:C}));return}m.current.has(P)||m.current.set(P,{callback:C}),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>R(),0);}function T(P){m.current.has(P)&&x.getFlow(P).then(C=>{m.current.delete(P),C==null||C.unregister();});}let w=n!=null?n:(P,C="_self")=>{window.open(P,C);};return useEffect(()=>()=>{x.destroy();},[]),jsxs(z.Provider,{value:s(i({navigate:w},a),{frigade:x,registerComponent:B,unregisterComponent:T,hasInitialized:y,variables:a.variables||{}}),children:[jsx(Global,{styles:{":root":i(i(i({},Po),d),o)}}),jsxs(ThemeProvider,{theme:D,children:[t&&jsx(Pr,{}),e]}),a.preloadImages!==!1&&jsx(Cr,{})]})}function Se(e,o){let{frigade:t,variables:n}=useContext(z),[,r]=useState(!1),a=useCallback(l=>{t==null||t.getFlow(e).then(()=>{l();});let d=m=>{m.id===e&&setTimeout(()=>{r(u=>!u),l();},0);};return t==null||t.onStateChange(d),()=>{t==null||t.removeStateChangeHandler(d);}},[e]),p=useSyncExternalStore(a,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return p==null||p.applyVariables(i(i({},n),o==null?void 0:o.variables)),{flow:p,isLoading:t!=null&&t.hasFailedToLoad()?!1:!p}}function Uo(e,{onComplete:o,onDismiss:t}={}){let n=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&M(this,null,function*(){yield o==null?void 0:o(e);}),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(r=>M(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}var de=new Set;function Go(e,o=!0){let t=useCallback(()=>{de.has(e==null?void 0:e.id)&&de.delete(e==null?void 0:e.id);},[de,o]),n=useCallback(()=>{o&&(e!=null&&e.isVisible)&&!de.has(e.id)&&de.add(e.id);},[de,o]);useEffect(()=>()=>{t();},[]),e!=null&&e.isVisible?n():t();let r=de.size>0?de.values().next().value:null;return {isCurrentModal:o?r===(e==null?void 0:e.id)||de.size==0:!0}}function _(m){var u=m,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:p,variables:l}=u,d=f(u,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var k,W;let{flow:y}=Se(t,{variables:l}),I=i(i({},d),(k=y==null?void 0:y.props)!=null?k:{}),{dismissible:h=!1,forceMount:x=!1}=I,R=f(I,["dismissible","forceMount"]),B=y==null?void 0:y.getCurrentStep(),{handleDismiss:T}=Uo(y,{onComplete:n,onDismiss:r}),{handlePrimary:w,handleSecondary:P}=le(B,{onPrimary:a,onSecondary:p}),C=(R==null?void 0:R.modal)||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((W=y==null?void 0:y.rawData)==null?void 0:W.flowType),{isCurrentModal:v}=Go(y,C),E=x&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||!y.isVisible&&!E||!E&&!v)return null;(E||!y.isCompleted&&!y.isSkipped)&&B.start();let $=e===null?Fragment$1:e!=null?e:g,N=s(i({},R),{"data-flow-id":y.id});return jsx($,s(i({},e===null?{}:N),{children:o({flow:y,handleDismiss:T,handlePrimary:w,handleSecondary:P,parentProps:{dismissible:h,flowId:t,variables:l,containerProps:N},step:B})}))}function Er(t){var n=t,{part:e}=n,o=f(n,["part"]);return jsx(_,s(i({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:p,parentProps:{dismissible:l},step:d})=>{var y,h,x,R;let m=(h=(y=d.primaryButton)==null?void 0:y.title)!=null?h:d.primaryButtonTitle,u=(R=(x=d.secondaryButton)==null?void 0:x.title)!=null?R:d.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:l,handleDismiss:r,subtitle:d.subtitle,title:d.title}),jsx(b.Media,{src:d.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(S.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:u,onClick:p}),jsx(b.Primary,{title:m,onClick:a})]})]})}}))}function uo(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);return jsx(g,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Ia(e){var o,t,n,r,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/${(n=e.split("vimeo.com/")[1])==null?void 0:n.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(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 fo(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);let a=Ia(o);return a?jsx(g,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsx(g,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ye(n){var r=n,{src:e,type:o}=r,t=f(r,["src","type"]);return jsx(o==="video"?fo:uo,i({src:e},t))}var b=Fo.forwardRef((a,r)=>{var p=a,{children:e,flowId:o,part:t}=p,n=f(p,["children","flowId","part"]);var d;if(o!=null)return jsx(Er,i({flowId:o},n));let l=(d=n.as)!=null?d:S.Column;return jsx(l,s(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},n),{ref:r,children:e}))});b.Dismiss=e=>jsx(O.Plain,s(i({part:"dismiss",padding:0},e),{children:jsx(Fe,{height:"20",fill:"currentColor"})}));b.Footer=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return jsx(S.Row,s(i({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};b.Header=p=>{var l=p,{dismissible:e,handleDismiss:o,part:t,subtitle:n,title:r}=l,a=f(l,["dismissible","handleDismiss","part","subtitle","title"]);return jsxs(S.Row,s(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},a),{children:[jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:n})]}))};b.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(ye,i({borderRadius:"md",src:e},o))};b.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(O.Primary,i({title:o,onClick:e},t))};b.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(O.Secondary,i({title:o,onClick:e},t))};b.Subtitle=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsx(F.Body2,s(i({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};b.Title=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsx(F.H4,s(i({display:"block",part:["title",o]},t),{children:e}))};var go={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Ir(e){let o=Object.fromEntries(go.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(go.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!go.content.some(a=>a===r)&&!go.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var Aa=keyframes`
59
+ `;function po(B){var T=B,{align:e,alignOffset:o,defaultOpen:t,dismissible:n,flow:r,handleDismiss:a,modal:p,onPrimary:l,onSecondary:d,part:u,side:m,sideOffset:y,spotlight:h,step:x}=T,R=f(T,["align","alignOffset","defaultOpen","dismissible","flow","handleDismiss","modal","onPrimary","onSecondary","part","side","sideOffset","spotlight","step"]);var M,N,k,I,$;let{handlePrimary:w,handleSecondary:P}=le(x,{onPrimary:l,onSecondary:d}),C=(N=(M=x.primaryButton)==null?void 0:M.title)!=null?N:x.primaryButtonTitle,v=(I=(k=x.secondaryButton)==null?void 0:k.title)!=null?I:x.secondaryButtonTitle,E=!!x.$state.blocked;return jsx(Vo,s(i({align:e,alignOffset:o,anchor:x.selector,"data-step-id":x.id,defaultOpen:t,modal:p,part:u,side:m,sideOffset:y,spotlight:h},R),{children:jsxs(b,{animation:`${ea} 300ms ease-out`,boxShadow:"md",maxWidth:"min(360px, calc(100vw - 25px))",children:[jsx(b.Media,{aspectRatio:"2",borderRadius:"md md 0 0",borderWidth:"0",margin:"-5 -5 0",objectFit:"cover",overflowClipMargin:"unset",src:($=x.videoUri)!=null?$:x.imageUri,transform:"translate3d(0, 0, 1px)",type:x.videoUri?"video":"image"}),jsx(b.Header,{css:{".fr-dismiss":{position:"absolute",right:"12px",top:"12px"}},dismissible:n,handleDismiss:a,subtitle:x.subtitle,title:x.title}),jsxs(b.Footer,{children:[r.getNumberOfAvailableSteps()>1&&jsx(Qe,{current:r.getCurrentStepOrder()+1,marginRight:"auto",total:r.getNumberOfAvailableSteps()}),jsx(b.Secondary,{disabled:E,onClick:P,title:v}),jsx(b.Primary,{disabled:E,onClick:w,title:C})]})]})}))}function hr(e,o,t){let[n,r]=useState(!1),a=useRef();return useEffect(()=>{a.current=typeof o=="string"?document.querySelector(o):o,r(!0);},[]),n?createPortal(e,a.current,t):null}function co(R){var B=R,{align:e="after",alignOffset:o=0,as:t,defaultOpen:n,dismissible:r=!1,flowId:a,modal:p,part:l,sequential:d=!0,side:u="bottom",sideOffset:m=0,spotlight:y,zIndex:h=9999}=B,x=f(B,["align","alignOffset","as","defaultOpen","dismissible","flowId","modal","part","sequential","side","sideOffset","spotlight","zIndex"]);let{onDismiss:T,onPrimary:w,onSecondary:P}=x;return hr(jsx(_,s(i({as:t,flowId:a,part:"tour"},x),{children:({flow:C,handleDismiss:v,parentProps:{containerProps:E},step:M})=>{var k,I,$,he;let N=i({align:e,alignOffset:o,dismissible:r,flow:C,handleDismiss:v,modal:p,onPrimary:w,onSecondary:P,part:l,side:u,sideOffset:m,spotlight:y,step:M,zIndex:($=(I=(k=M.props)==null?void 0:k.zIndex)!=null?I:E==null?void 0:E.zIndex)!=null?$:h},(he=M.props)!=null?he:{});return d?jsx(po,i({defaultOpen:n!=null?n:!0},N)):Array.from(C.steps.values()).filter(Q=>{let{blocked:$e,completed:ue,skipped:ee,visible:we}=Q.$state;return !$e&&!ue&&!ee&&we}).map(Q=>{var Ke,K,oe,ne,te;function $e(me){return A(this,null,function*(){return (yield T==null?void 0:T(C,me))===!1?(me.preventDefault(),!1):(Q.skip(),!0)})}let ue=y&&Q.id===M.id,ee=(oe=(K=(Ke=Q.props)==null?void 0:Ke.zIndex)!=null?K:E==null?void 0:E.zIndex)!=null?oe:h,we=i({align:e,alignOffset:o,dismissible:r,flow:C,handleDismiss:$e,onPrimary:w,onSecondary:P,part:l,side:u,sideOffset:m,spotlight:y,zIndex:ee},(ne=Q.props)!=null?ne:{});return jsx(po,i({css:{"&:has([aria-expanded=true])":{zIndex:Number(ee)+2},".fr-overlay":{zIndex:Number(ee)+1},".fr-progress-fraction":{display:"none"}},defaultOpen:(te=n||ue)!=null?te:!1,step:Q},we),`${Q.id}-${ue}`)})}})),"body")}function br(e){var u,m,y;let{frigade:o}=useContext(z),[,t]=useState(!1),n,r=useCallback(h=>{o==null||o.getCollection(e).then(()=>{h();});let x=()=>{clearTimeout(n),n=setTimeout(()=>{t(R=>!R),h();},100);};return o==null||o.onStateChange(x),()=>{o==null||o.removeStateChangeHandler(x);}},[e]),a=useSyncExternalStore(r,()=>{let h;try{h=o==null?void 0:o.getCollectionSync(e);}catch(x){}return h},()=>{let h;try{h=o==null?void 0:o.getCollectionSync(e);}catch(x){}return h}),l=(y=((m=(u=a==null?void 0:a.flows)==null?void 0:u.filter(h=>h.visible).map(h=>s(i({},h),{flow:o==null?void 0:o.getFlowSync(h.flowId)})))!=null?m:[]).find(({flow:h})=>h.isVisible))==null?void 0:y.flowId,{flow:d}=Se(l);return {collection:a,currentFlow:d}}function No(r){var a=r,{collectionId:e,part:o,variables:t={}}=a,n=f(a,["collectionId","part","variables"]);var u,m,y;let p={ANNOUNCEMENT:zo,BANNER:vo,CARD:b,CHECKLIST:oo,EMBEDDED_TIP:b,FORM:Ie,NPS_SURVEY:ze,SURVEY:ze,TOUR:co},{currentFlow:l}=br(e),d=(m=p[(u=l==null?void 0:l.rawData)==null?void 0:u.flowType])!=null?m:null;return l==null||d==null?null:((y=l==null?void 0:l.rawData)==null?void 0:y.flowType)===FlowType.FORM?jsx(g,s(i({part:["collection",o],"data-collection-id":e},n),{children:jsx(Ie,{flowId:l.id,as:H,variables:t},l.id)})):jsx(g,s(i({part:["collection",o],"data-collection-id":e},n),{children:jsx(d,{flowId:l.id,variables:t},l.id)}))}function _e(){let{frigade:e}=useContext(z);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Pr(){let[e,o]=useState(),{frigade:t}=_e();return useEffect(()=>{t.getCollections().then(n=>{n==null||n.forEach((r,a)=>{r.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsx(No,{as:null,collectionId:e})}var z=createContext({apiKey:"",navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{},variables:{}});function Cr(){let{frigade:e}=_e();return useEffect(()=>{A(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(n=>{if(n.imageUri){let r=new Image;r.src=n.imageUri;}});});});},[]),null}var Sr="2.5.5";function Rr(p){var l=p,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=l,a=f(l,["children","css","defaultCollection","navigate","theme"]);let d=r?bo(r):{},u=useRef(new Map),m=useRef(),[y,h]=useState(!1),x=useMemo(()=>(h(!1),m.current=void 0,new Frigade(a.apiKey,{apiKey:a.apiKey,apiUrl:a.apiUrl,userId:a.userId,groupId:a.groupId,userProperties:a.userProperties,groupProperties:a.groupProperties,generateGuestId:a.generateGuestId,syncOnWindowUpdates:a.syncOnWindowUpdates,__readOnly:a.__readOnly,__flowStateOverrides:a.__flowStateOverrides,__platformVersion:Sr,__platformName:"React"})),[a.userId,a.groupId,a.apiKey]);useEffect(()=>{if(a.__flowStateOverrides){let P=x.getConfig();P.__flowStateOverrides=a.__flowStateOverrides,x.reload(P);}},[a.__flowStateOverrides]);function R(){let P=[...u.current.entries()].map(([C,v])=>[C,v.callback]);x.batchRegister(P),h(!0);}function B(P,C){if(m.current&&clearTimeout(m.current),y){u.current.has(P)?x.getFlow(P).then(v=>C(v.isVisible)):(x.getFlow(P).then(v=>v.register(C)),u.current.set(P,{callback:C}));return}u.current.has(P)||u.current.set(P,{callback:C}),m.current&&clearTimeout(m.current),m.current=setTimeout(()=>R(),0);}function T(P){u.current.has(P)&&x.getFlow(P).then(C=>{u.current.delete(P),C==null||C.unregister();});}let w=n!=null?n:(P,C="_self")=>{window.open(P,C);};return useEffect(()=>()=>{x.destroy();},[]),jsxs(z.Provider,{value:s(i({navigate:w},a),{frigade:x,registerComponent:B,unregisterComponent:T,hasInitialized:y,variables:a.variables||{}}),children:[jsx(Global,{styles:{":root":i(i(i({},Po),d),o)}}),jsxs(ThemeProvider,{theme:D,children:[t&&jsx(Pr,{}),e]}),a.preloadImages!==!1&&jsx(Cr,{})]})}function Se(e,o){let{frigade:t,variables:n}=useContext(z),[,r]=useState(!1),a=useCallback(l=>{t==null||t.getFlow(e).then(()=>{l();});let d=u=>{u.id===e&&setTimeout(()=>{r(m=>!m),l();},0);};return t==null||t.onStateChange(d),()=>{t==null||t.removeStateChangeHandler(d);}},[e]),p=useSyncExternalStore(a,()=>t==null?void 0:t.getFlowSync(e),()=>t==null?void 0:t.getFlowSync(e));return p==null||p.applyVariables(i(i({},n),o==null?void 0:o.variables)),{flow:p,isLoading:t!=null&&t.hasFailedToLoad()?!1:!p}}function Uo(e,{onComplete:o,onDismiss:t}={}){let n=useRef(null);return useEffect(()=>{if(e==null)return;function r(){return A(this,null,function*(){e.isCompleted&&n.current===!1&&(yield o==null?void 0:o(e));})}return r(),n.current=e==null?void 0:e.isCompleted,()=>{r();}},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(r=>A(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}var de=new Set;function Go(e,o=!0){let t=useCallback(()=>{de.has(e==null?void 0:e.id)&&de.delete(e==null?void 0:e.id);},[de,o]),n=useCallback(()=>{o&&(e!=null&&e.isVisible)&&!de.has(e.id)&&de.add(e.id);},[de,o]);useEffect(()=>()=>{t();},[]),e!=null&&e.isVisible?n():t();let r=de.size>0?de.values().next().value:null;return {isCurrentModal:o?r===(e==null?void 0:e.id)||de.size==0:!0}}function _(u){var m=u,{as:e,children:o,flowId:t,onComplete:n,onDismiss:r,onPrimary:a,onSecondary:p,variables:l}=m,d=f(m,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var k,$;let{flow:y}=Se(t,{variables:l}),I=i(i({},d),(k=y==null?void 0:y.props)!=null?k:{}),{dismissible:h=!1,forceMount:x=!1}=I,R=f(I,["dismissible","forceMount"]),B=y==null?void 0:y.getCurrentStep(),{handleDismiss:T}=Uo(y,{onComplete:n,onDismiss:r}),{handlePrimary:w,handleSecondary:P}=le(B,{onPrimary:a,onSecondary:p}),C=(R==null?void 0:R.modal)||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes(($=y==null?void 0:y.rawData)==null?void 0:$.flowType),{isCurrentModal:v}=Go(y,C),E=x&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||!y.isVisible&&!E||!E&&!v)return null;(E||!y.isCompleted&&!y.isSkipped)&&B.start();let M=e===null?Fragment$1:e!=null?e:g,N=s(i({},R),{"data-flow-id":y.id});return jsx(M,s(i({},e===null?{}:N),{children:o({flow:y,handleDismiss:T,handlePrimary:w,handleSecondary:P,parentProps:{dismissible:h,flowId:t,variables:l,containerProps:N},step:B})}))}function Er(t){var n=t,{part:e}=n,o=f(n,["part"]);return jsx(_,s(i({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:a,handleSecondary:p,parentProps:{dismissible:l},step:d})=>{var y,h,x,R;let u=(h=(y=d.primaryButton)==null?void 0:y.title)!=null?h:d.primaryButtonTitle,m=(R=(x=d.secondaryButton)==null?void 0:x.title)!=null?R:d.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:l,handleDismiss:r,subtitle:d.subtitle,title:d.title}),jsx(b.Media,{src:d.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(S.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:m,onClick:p}),jsx(b.Primary,{title:u,onClick:a})]})]})}}))}function mo(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);return jsx(g,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Ia(e){var o,t,n,r,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/${(n=e.split("vimeo.com/")[1])==null?void 0:n.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(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 fo(n){var r=n,{part:e,src:o}=r,t=f(r,["part","src"]);let a=Ia(o);return a?jsx(g,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsx(g,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ye(n){var r=n,{src:e,type:o}=r,t=f(r,["src","type"]);return jsx(o==="video"?fo:mo,i({src:e},t))}var b=Fo.forwardRef((a,r)=>{var p=a,{children:e,flowId:o,part:t}=p,n=f(p,["children","flowId","part"]);var d;if(o!=null)return jsx(Er,i({flowId:o},n));let l=(d=n.as)!=null?d:S.Column;return jsx(l,s(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5,part:["card",t]},n),{ref:r,children:e}))});b.Dismiss=e=>jsx(O.Plain,s(i({part:"dismiss",padding:0},e),{children:jsx(Fe,{height:"20",fill:"currentColor"})}));b.Footer=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return jsx(S.Row,s(i({alignItems:"center",gap:3,justifyContent:"flex-end",part:["card-footer",o]},t),{children:e}))};b.Header=p=>{var l=p,{dismissible:e,handleDismiss:o,part:t,subtitle:n,title:r}=l,a=f(l,["dismissible","handleDismiss","part","subtitle","title"]);return jsxs(S.Row,s(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:["card-header",t]},a),{children:[jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:n})]}))};b.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(ye,i({borderRadius:"md",src:e},o))};b.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(O.Primary,i({title:o,onClick:e},t))};b.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(O.Secondary,i({title:o,onClick:e},t))};b.Subtitle=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsx(F.Body2,s(i({display:"block",color:"neutral.400",part:["subtitle",o]},t),{children:e}))};b.Title=n=>{var r=n,{children:e,part:o}=r,t=f(r,["children","part"]);return e==null?null:jsx(F.H4,s(i({display:"block",part:["title",o]},t),{children:e}))};var go={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Ir(e){let o=Object.fromEntries(go.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(go.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!go.content.some(a=>a===r)&&!go.root.some(a=>a===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var Aa=keyframes`
60
60
  from {
61
61
  opacity: 0;
62
62
  }
@@ -66,7 +66,7 @@ var qo=Object.defineProperty,_r=Object.defineProperties;var Ur=Object.getOwnProp
66
66
  to {
67
67
  opacity: 1;
68
68
  }
69
- `;function H(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=f(a,["children","className","modal"]);let{rootProps:p,contentProps:l,otherProps:u}=Ir(n),y=u,{zIndex:d}=y,m=f(y,["zIndex"]);return jsx(j.Root,s(i({defaultOpen:!0,modal:t},p),{children:jsx(j.Portal,{children:jsxs(g,{animation:`${Aa} 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(j.Overlay,{asChild:!0,children:jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(j.Content,s(i({asChild:!0,onOpenAutoFocus:h=>h.preventDefault(),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault()},l),{children:jsx(b,s(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}H.Dismiss=e=>jsx(j.Close,{"aria-label":"Close",asChild:!0,children:jsx(O.Plain,s(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Fe,{height:"20",fill:"currentColor"})}))});H.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsx(j.Description,{asChild:!0,children:jsx(F.Body2,s(i({part:"subtitle"},o),{children:e}))})};H.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsx(ye,i({borderRadius:"md",src:e},o))};H.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(O.Primary,i({title:o,onClick:e},t))};H.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((n,r)=>jsx(g,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?D.colors.primary.surface:D.colors.neutral[700],part:e===r?"progress-dot-selected":"progress-dot"},r));return jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};H.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(O.Secondary,i({title:o,onClick:e},t))};H.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsx(j.Title,{asChild:!0,children:jsx(F.H4,s(i({part:"title"},o),{children:e}))})};H.displayName="Dialog";var Hr=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function zo(n){var r=n,{flowId:e,part:o}=r,t=f(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([l])=>Hr.some(d=>l===d))),p=Object.fromEntries(Object.entries(t).filter(([l])=>Hr.indexOf(l)===-1));return jsx(_,s(i({as:null,flowId:e},a),{children:({flow:l,handleDismiss:d,handlePrimary:m,handleSecondary:u,parentProps:{containerProps:y,dismissible:h},step:x})=>{var P,C,v,E,$,N;let R=(P=x.props)!=null?P:{},B=(v=(C=x.primaryButton)==null?void 0:C.title)!=null?v:x.primaryButtonTitle,T=($=(E=x.secondaryButton)==null?void 0:E.title)!=null?$:x.secondaryButtonTitle,w=x.$state.blocked;return jsx(H,s(i(i({part:["announcement",o],textAlign:"center"},y),p),{onEscapeKeyDown:k=>{if(t.dismissible===!1){k.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(k),k.defaultPrevented||d(k);},children:jsxs(S.Column,s(i({gap:5,part:"announcement-step"},R),{children:[h&&jsx(H.Dismiss,{onClick:d}),jsxs(S.Column,{gap:1,part:"announcement-header",children:[jsx(H.Title,{children:x.title}),jsx(H.Subtitle,{children:x.subtitle})]}),jsx(H.Media,{aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(N=x.videoUri)!=null?N:x.imageUri,transform:"translate3d(0, 0, 1px)",type:x.videoUri?"video":"image",width:"100%"}),jsx(H.ProgressDots,{current:l.getCurrentStepIndex(),total:l.getNumberOfAvailableSteps()}),jsxs(S.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[T&&jsx(H.Secondary,{disabled:w,onClick:u,title:T}),B&&jsx(H.Primary,{disabled:w,onClick:m,title:B})]})]}))}))}}))}function yo(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=useState(e),[n,r]=useState(null),a=useCallback(p=>{r(p);},[]);return useLayoutEffect(()=>{if(!n)return;let p=()=>{let l=n.getBoundingClientRect();t(l);};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[n]),{node:n,rect:o,ref:a}}var za=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Ar(n){var r=n,{style:e={},part:o=""}=r,t=f(r,["style","part"]);return jsxs(g,s(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${za}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Wr({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},a=()=>{var m;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (m=e.align)!=null?m:"after"},p="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};r[l[n]]=p;let d=a();return ["before","end"].includes(d)?["top","bottom"].includes(n)?r.right=p:r.bottom=p:["after","start"].includes(d)?["top","bottom"].includes(n)?r.left=p:r.top=p:["top","bottom"].includes(n)?r.left=`calc(50% + ${p})`:r.top=`calc(50% + ${p})`,r}var xo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["modal","onOpenChange"]};function Vr(e,o){var a,p,l,d,m;let t=Object.fromEntries(xo.content.map(u=>[u,e[u]]).filter(u=>u[1]!==void 0)),n=Object.fromEntries(xo.root.map(u=>[u,e[u]]).filter(u=>u[1]!==void 0)),r={};for(let u of Object.keys(e))!xo.content.includes(u)&&!xo.root.includes(u)&&(r[u]=e[u]);if(t.align=(a=t.align)!=null?a:"after",t.side=(p=t.side)!=null?p:"bottom",["before","after"].includes(t.align)){let u={after:"end",before:"start"},y=(w,P)=>["top","bottom"].includes(P)?w=="after"?"marginLeft":"marginRight":w=="after"?"marginTop":"marginBottom",h=(l=t.alignOffset)!=null?l:0,x=(d=t.style)!=null?d:{},R=(m=t.side)!=null?m:"bottom",B=t.align;t.style=s(i({},x),{[y(B,R)]:h});let T=["top","bottom"].includes(R)?o.width:o.height;t.alignOffset=(T+h)*-1,t.align=u[B];}return {contentProps:t,otherProps:r,rootProps:n}}var Lr=keyframes`
69
+ `;function H(r){var a=r,{children:e,className:o,modal:t=!0}=a,n=f(a,["children","className","modal"]);let{rootProps:p,contentProps:l,otherProps:m}=Ir(n),y=m,{zIndex:d}=y,u=f(y,["zIndex"]);return jsx(j.Root,s(i({defaultOpen:!0,modal:t},p),{children:jsx(j.Portal,{children:jsxs(g,{animation:`${Aa} 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(j.Overlay,{asChild:!0,children:jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(j.Content,s(i({asChild:!0,onOpenAutoFocus:h=>h.preventDefault(),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault()},l),{children:jsx(b,s(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxHeight:"100%",maxWidth:"430px",overflowY:"auto",padding:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}H.Dismiss=e=>jsx(j.Close,{"aria-label":"Close",asChild:!0,children:jsx(O.Plain,s(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(Fe,{height:"20",fill:"currentColor"})}))});H.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsx(j.Description,{asChild:!0,children:jsx(F.Body2,s(i({part:"subtitle"},o),{children:e}))})};H.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsx(ye,i({borderRadius:"md",src:e},o))};H.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(O.Primary,i({title:o,onClick:e},t))};H.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((n,r)=>jsx(g,{as:"circle",r:4,cx:4+16*r,cy:"4px",fill:e===r?D.colors.primary.surface:D.colors.neutral[700],part:e===r?"progress-dot-selected":"progress-dot"},r));return jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};H.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(O.Secondary,i({title:o,onClick:e},t))};H.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return jsx(j.Title,{asChild:!0,children:jsx(F.H4,s(i({part:"title"},o),{children:e}))})};H.displayName="Dialog";var Hr=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function zo(n){var r=n,{flowId:e,part:o}=r,t=f(r,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([l])=>Hr.some(d=>l===d))),p=Object.fromEntries(Object.entries(t).filter(([l])=>Hr.indexOf(l)===-1));return jsx(_,s(i({as:null,flowId:e},a),{children:({flow:l,handleDismiss:d,handlePrimary:u,handleSecondary:m,parentProps:{containerProps:y,dismissible:h},step:x})=>{var P,C,v,E,M,N;let R=(P=x.props)!=null?P:{},B=(v=(C=x.primaryButton)==null?void 0:C.title)!=null?v:x.primaryButtonTitle,T=(M=(E=x.secondaryButton)==null?void 0:E.title)!=null?M:x.secondaryButtonTitle,w=x.$state.blocked;return jsx(H,s(i(i({part:["announcement",o],textAlign:"center"},y),p),{onEscapeKeyDown:k=>{if(t.dismissible===!1){k.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(k),k.defaultPrevented||d(k);},children:jsxs(S.Column,s(i({gap:5,part:"announcement-step"},R),{children:[h&&jsx(H.Dismiss,{onClick:d}),jsxs(S.Column,{gap:1,part:"announcement-header",children:[jsx(H.Title,{children:x.title}),jsx(H.Subtitle,{children:x.subtitle})]}),jsx(H.Media,{aspectRatio:"1.5",objectFit:"cover",overflowClipMargin:"unset",src:(N=x.videoUri)!=null?N:x.imageUri,transform:"translate3d(0, 0, 1px)",type:x.videoUri?"video":"image",width:"100%"}),jsx(H.ProgressDots,{current:l.getCurrentStepIndex(),total:l.getNumberOfAvailableSteps()}),jsxs(S.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[T&&jsx(H.Secondary,{disabled:w,onClick:m,title:T}),B&&jsx(H.Primary,{disabled:w,onClick:u,title:B})]})]}))}))}}))}function yo(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=useState(e),[n,r]=useState(null),a=useCallback(p=>{r(p);},[]);return useLayoutEffect(()=>{if(!n)return;let p=()=>{let l=n.getBoundingClientRect();t(l);};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[n]),{node:n,rect:o,ref:a}}var za=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Ar(n){var r=n,{style:e={},part:o=""}=r,t=f(r,["style","part"]);return jsxs(g,s(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${za}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Wr({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},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"},p="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};r[l[n]]=p;let d=a();return ["before","end"].includes(d)?["top","bottom"].includes(n)?r.right=p:r.bottom=p:["after","start"].includes(d)?["top","bottom"].includes(n)?r.left=p:r.top=p:["top","bottom"].includes(n)?r.left=`calc(50% + ${p})`:r.top=`calc(50% + ${p})`,r}var xo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["modal","onOpenChange"]};function Vr(e,o){var a,p,l,d,u;let t=Object.fromEntries(xo.content.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),n=Object.fromEntries(xo.root.map(m=>[m,e[m]]).filter(m=>m[1]!==void 0)),r={};for(let m of Object.keys(e))!xo.content.includes(m)&&!xo.root.includes(m)&&(r[m]=e[m]);if(t.align=(a=t.align)!=null?a:"after",t.side=(p=t.side)!=null?p:"bottom",["before","after"].includes(t.align)){let m={after:"end",before:"start"},y=(w,P)=>["top","bottom"].includes(P)?w=="after"?"marginLeft":"marginRight":w=="after"?"marginTop":"marginBottom",h=(l=t.alignOffset)!=null?l:0,x=(d=t.style)!=null?d:{},R=(u=t.side)!=null?u:"bottom",B=t.align;t.style=s(i({},x),{[y(B,R)]:h});let T=["top","bottom"].includes(R)?o.width:o.height;t.alignOffset=(T+h)*-1,t.align=m[B];}return {contentProps:t,otherProps:r,rootProps:n}}var Lr=keyframes`
70
70
  from {
71
71
  opacity: 0;
72
72
  }
@@ -76,8 +76,8 @@ var qo=Object.defineProperty,_r=Object.defineProperties;var Ur=Object.getOwnProp
76
76
  to {
77
77
  opacity: 1;
78
78
  }
79
- `;function Nr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function xe(m){var u=m,{anchor:e,children:o,className:t,defaultOpen:n=!0,open:r,part:a,spotlight:p=!1,style:l={}}=u,d=f(u,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:y,rect:h,ref:x}=yo(),{node:R,rect:B,ref:T}=yo(),{contentProps:w,otherProps:P,rootProps:C}=Vr(d,h),[v,E]=useState(n),[$,N]=useState(w.align),[k,I]=useState(w.side),[W,he]=useState(0),[Q,$e]=useState(0);function me(){return r!=null?(console.log("OVERRIDE: ",r),r):(console.log("INTERNAL: ",v),v)}if(y!==null){let K=y.getAttribute("data-align"),oe=y.getAttribute("data-side");$!==K&&N(K),k!==oe&&I(oe);}let ee=useRef(null);if(useEffect(()=>{let K=document.querySelector(e);K!=null?(T(K),ee.current=K):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function K(ne){if(ne.matches(e))return Nr(ne)?ne:null;let te=ne.querySelectorAll(e);return te.length>0&&Nr(te[0])?te[0]:null}let oe=new MutationObserver(ne=>{for(let te of ne)if(te.type==="childList"){for(let ue of te.addedNodes){if(ue.nodeType!==Node.ELEMENT_NODE)continue;let fe=K(ue);if(fe!=null){T(fe),ee.current=fe,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",fe);break}}for(let ue of te.removedNodes){if(ue.nodeType!==Node.ELEMENT_NODE)continue;let fe=K(ue);if(fe!=null){T(null),ee.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",fe);break}}}});return oe.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>oe.disconnect()},[]),useEffect(()=>{let{scrollX:K,scrollY:oe}=window;he(B.left+K),$e(B.top+oe);},[B.left,B.top]),R==null)return null;let we="0";typeof window!="undefined"&&(we=window.getComputedStyle(R).borderRadius);let Ke=Wr({props:d,alignAttr:$,sideAttr:k});return jsxs(re.Root,s(i({defaultOpen:!0},C),{children:[jsx(re.Anchor,{virtualRef:ee}),jsx(re.Portal,{children:jsxs(Fragment,{children:[p&&jsx(g,i({animation:`${Lr} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:we,height:B.height,left:W,top:Q,width:B.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsx(re.Content,s(i({},w),{ref:x,children:jsxs(Fragment,{children:[me()&&jsx(b,s(i({animation:`${Lr} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",a],style:l},P),{children:o})),jsx(Ar,{onClick:()=>{E(()=>(typeof C.onOpenChange=="function"&&C.onOpenChange(!me()),!me()));},style:Ke})]})}),v)]})})]}))}xe.Close=e=>jsx(re.Close,{"aria-label":"Close",asChild:!0,children:jsx(O.Plain,s(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Fe,{height:"20",fill:"currentColor"})}))});xe.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsx(ye,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))};xe.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(O.Primary,i({title:o,onClick:e},t))};xe.Progress=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(F.Body2,s(i({part:"progress"},o),{children:e}))};xe.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(O.Secondary,i({title:o,onClick:e},t))};xe.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(F.Body2,s(i({part:"subtitle"},o),{children:e}))};xe.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(F.H4,s(i({part:"title"},o),{children:e}))};function ja(){let{userId:e,frigade:o}=useContext(z);function t(r){return M(this,null,function*(){yield o.identify(e,r);})}function n(r,a){return M(this,null,function*(){yield o.track(r,a);})}return {userId:e,addProperties:t,track:n}}function Ja(){var r;let{frigade:e}=useContext(z);function o(a){return M(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,a);})}function t(a,p){return M(this,null,function*(){yield e.track(a,p);})}function n(a,p){return M(this,null,function*(){yield e.group(a,p);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:o,track:t}}
79
+ `;function Nr(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function xe(u){var m=u,{anchor:e,children:o,className:t,defaultOpen:n=!0,open:r,part:a,spotlight:p=!1,style:l={}}=m,d=f(m,["anchor","children","className","defaultOpen","open","part","spotlight","style"]);let{node:y,rect:h,ref:x}=yo(),{node:R,rect:B,ref:T}=yo(),{contentProps:w,otherProps:P,rootProps:C}=Vr(d,h),[v,E]=useState(n),[M,N]=useState(w.align),[k,I]=useState(w.side),[$,he]=useState(0),[Q,$e]=useState(0);function ue(){return r!=null?(console.log("OVERRIDE: ",r),r):(console.log("INTERNAL: ",v),v)}if(y!==null){let K=y.getAttribute("data-align"),oe=y.getAttribute("data-side");M!==K&&N(K),k!==oe&&I(oe);}let ee=useRef(null);if(useEffect(()=>{let K=document.querySelector(e);K!=null?(T(K),ee.current=K):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function K(ne){if(ne.matches(e))return Nr(ne)?ne:null;let te=ne.querySelectorAll(e);return te.length>0&&Nr(te[0])?te[0]:null}let oe=new MutationObserver(ne=>{for(let te of ne)if(te.type==="childList"){for(let me of te.addedNodes){if(me.nodeType!==Node.ELEMENT_NODE)continue;let fe=K(me);if(fe!=null){T(fe),ee.current=fe,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",fe);break}}for(let me of te.removedNodes){if(me.nodeType!==Node.ELEMENT_NODE)continue;let fe=K(me);if(fe!=null){T(null),ee.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",fe);break}}}});return oe.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>oe.disconnect()},[]),useEffect(()=>{let{scrollX:K,scrollY:oe}=window;he(B.left+K),$e(B.top+oe);},[B.left,B.top]),R==null)return null;let we="0";typeof window!="undefined"&&(we=window.getComputedStyle(R).borderRadius);let Ke=Wr({props:d,alignAttr:M,sideAttr:k});return jsxs(re.Root,s(i({defaultOpen:!0},C),{children:[jsx(re.Anchor,{virtualRef:ee}),jsx(re.Portal,{children:jsxs(Fragment,{children:[p&&jsx(g,i({animation:`${Lr} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:we,height:B.height,left:$,top:Q,width:B.width}},d.zIndex!=null?{zIndex:d.zIndex}:{})),jsx(re.Content,s(i({},w),{ref:x,children:jsxs(Fragment,{children:[ue()&&jsx(b,s(i({animation:`${Lr} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",a],style:l},P),{children:o})),jsx(Ar,{onClick:()=>{E(()=>(typeof C.onOpenChange=="function"&&C.onOpenChange(!ue()),!ue()));},style:Ke})]})}),v)]})})]}))}xe.Close=e=>jsx(re.Close,{"aria-label":"Close",asChild:!0,children:jsx(O.Plain,s(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(Fe,{height:"20",fill:"currentColor"})}))});xe.Media=t=>{var n=t,{src:e}=n,o=f(n,["src"]);return e==null?null:jsx(ye,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))};xe.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(O.Primary,i({title:o,onClick:e},t))};xe.Progress=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(F.Body2,s(i({part:"progress"},o),{children:e}))};xe.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=f(r,["onClick","title"]);return o==null?null:jsx(O.Secondary,i({title:o,onClick:e},t))};xe.Subtitle=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(F.Body2,s(i({part:"subtitle"},o),{children:e}))};xe.Title=t=>{var n=t,{children:e}=n,o=f(n,["children"]);return e==null?null:jsx(F.H4,s(i({part:"title"},o),{children:e}))};function ja(){let{userId:e,frigade:o}=useContext(z);function t(r){return A(this,null,function*(){yield o.identify(e,r);})}function n(r,a){return A(this,null,function*(){yield o.track(r,a);})}return {userId:e,addProperties:t,track:n}}function Ja(){var r;let{frigade:e}=useContext(z);function o(a){return A(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,a);})}function t(a,p){return A(this,null,function*(){yield e.track(a,p);})}function n(a,p){return A(this,null,function*(){yield e.group(a,p);})}return {groupId:(r=e==null?void 0:e.config)==null?void 0:r.groupId,setGroupId:n,addProperties:o,track:t}}
80
80
 
81
- export { zo as Announcement, vo as Banner, Y as BaseField, g as Box, O as Button, b as Card, to as Checklist, No as Collection, H as Dialog, S as Flex, _ as Flow, Ie as Form, Vo as Hint, uo as Image, Do as Label, ye as Media, Re as Progress, Rr as Provider, Io as RadioField, Ho as SelectField, Ao as Spotlight, so as Survey, F as Text, $o as TextField, Mo as TextareaField, xe as Tooltip, co as Tour, fo as Video, Po as themeVariables, Je as tokens, yo as useBoundingClientRect, Se as useFlow, Uo as useFlowHandlers, _e as useFrigade, Ja as useGroup, Go as useModal, le as useStepHandlers, ja as useUser };
81
+ export { zo as Announcement, vo as Banner, Y as BaseField, g as Box, O as Button, b as Card, to as Checklist, No as Collection, H as Dialog, S as Flex, _ as Flow, Ie as Form, Vo as Hint, mo as Image, Do as Label, ye as Media, Re as Progress, Rr as Provider, Io as RadioField, Ho as SelectField, Ao as Spotlight, so as Survey, F as Text, $o as TextField, Mo as TextareaField, xe as Tooltip, co as Tour, fo as Video, Po as themeVariables, Je as tokens, yo as useBoundingClientRect, Se as useFlow, Uo as useFlowHandlers, _e as useFrigade, Ja as useGroup, Go as useModal, le as useStepHandlers, ja as useUser };
82
82
  //# sourceMappingURL=out.js.map
83
83
  //# sourceMappingURL=index.js.map