@frigade/react 2.2.7 → 2.2.8

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.cjs CHANGED
@@ -10,7 +10,7 @@ var yr = require('dompurify');
10
10
  var jsxRuntime = require('@emotion/react/jsx-runtime');
11
11
  var js = require('@frigade/js');
12
12
  var outline = require('@heroicons/react/24/outline');
13
- var sn = require('embla-carousel-react');
13
+ var ln = require('embla-carousel-react');
14
14
  var be = require('@radix-ui/react-collapsible');
15
15
  var reactHookForm = require('react-hook-form');
16
16
  var Pe = require('@radix-ui/react-radio-group');
@@ -42,20 +42,20 @@ var ro__namespace = /*#__PURE__*/_interopNamespace(ro);
42
42
  var sr__default = /*#__PURE__*/_interopDefault(sr);
43
43
  var yr__default = /*#__PURE__*/_interopDefault(yr);
44
44
  var js__namespace = /*#__PURE__*/_interopNamespace(js);
45
- var sn__default = /*#__PURE__*/_interopDefault(sn);
45
+ var ln__default = /*#__PURE__*/_interopDefault(ln);
46
46
  var be__namespace = /*#__PURE__*/_interopNamespace(be);
47
47
  var Pe__namespace = /*#__PURE__*/_interopNamespace(Pe);
48
48
  var V__namespace = /*#__PURE__*/_interopNamespace(V);
49
49
  var Q__namespace = /*#__PURE__*/_interopNamespace(Q);
50
50
 
51
- var vo=Object.defineProperty,er=Object.defineProperties;var or=Object.getOwnPropertyDescriptors;var We=Object.getOwnPropertySymbols;var Ro=Object.prototype.hasOwnProperty,ko=Object.prototype.propertyIsEnumerable;var Bo=(e,o,t)=>o in e?vo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))Ro.call(o,t)&&Bo(e,t,o[t]);if(We)for(var t of We(o))ko.call(o,t)&&Bo(e,t,o[t]);return e},d=(e,o)=>er(e,or(o));var tr=(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 m=(e,o)=>{var t={};for(var r in e)Ro.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&We)for(var r of We(e))o.indexOf(r)<0&&ko.call(e,r)&&(t[r]=e[r]);return t};var Z=(e,o)=>{for(var t in o)vo(e,t,{get:o[t],enumerable:!0});};var H=(e,o,t)=>new Promise((r,n)=>{var i=c=>{try{p(t.next(c));}catch(u){n(u);}},s=c=>{try{p(t.throw(c));}catch(u){n(u);}},p=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);p((t=t.apply(e,o)).next());});var Do={borderWidths:{md:"1px"}};var Ae=[5,10,20,35,50,65,80,95,98],Eo=[...Ae],Ye=[...Ae];Eo[4]=40;Ye[4]=60;var rr={blue:{h:213,s:100,l:Ae},gray:{h:220,s:10,l:Ae},green:{h:141,s:90,l:Eo},red:{h:9,s:90,l:Ye},yellow:{h:50,s:90,l:Ye}};var W={};for(let[e,{h:o,s:t,l:r}]of Object.entries(rr))W[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Oo=d(a({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 Io={md:"8px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,Ho={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var Mo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var nr="px",ir=e=>typeof e=="number"?`${4*e}${nr}`:e,ar=[-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"],Wo=Object.fromEntries(ar.map(e=>[e,ir(e)]));var Ao={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 Le=d(a(d(a({},Do),{colors:a(a({},Oo),Ho)}),Ao),{radii:Io,shadows:Mo,space:Wo});function we(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,p=e[n];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(r,we(p,s,t)):r[s]=p,r},{})}function Qe(e){let o=we(e,"--fr","-");for(let[t,r]of Object.entries(o))if(t.indexOf(".")>-1){let n=t.replace(/\./g,"-");o[n]=r,delete o[t];}return o}function Lo(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],i=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=Lo(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var Ze=Qe(Le),T=Lo(Le);var lr=new Set(["alt","size","src"]),pr=sr__default.default.all.filter(e=>e.indexOf("-")!=0&&!lr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),dr=Object.fromEntries(pr),$e=we(T.colors),cr={color:$e,backgroundColor:$e,borderColor:$e,border:a(a({},T.borderWidths),$e),borderRadius:T.radii,borderWidth:T.borderWidths,boxShadow:T.shadows,fontFamily:T.fontFamilies,fontSize:T.fontSizes,fontWeight:T.fontWeights,gap:T.space,lineHeight:T.lineHeights,margin:T.space,marginBottom:T.space,marginLeft:T.space,marginRight:T.space,marginTop:T.space,padding:T.space,paddingBottom:T.space,paddingLeft:T.space,paddingRight:T.space,paddingTop:T.space},$o=a(a({},dr),cr),No={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"]},Vo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function ur(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 _o=new Map(Object.entries($o).map(([e,o])=>[e,ur(o)])),mr=new Map(Object.entries(No).map(([e,o])=>[e,new Set(o)])),fr=new Set(["height","width"]),gr=new Set(["canvas","embed","iframe","img","input","object","video"]);function zo(e){let[o,t]=e.split(":");return [o,Vo.has(t)?t:null]}function Ko(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let p=`&:${i.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[p]==null&&(r[p]={}),r[p]}return Object.entries(t).forEach(([i,s])=>{let[p,c]=zo(i),u=mr.get(p);u!=null&&(u.forEach(f=>{let P=`${f}${c?":"+c:""}`;t[P]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[p,c]=zo(i),u=_o.get(p);if(u!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");n(c)[p]=f.map(P=>{var x;return (x=u.get(P.toString()))!=null?x:P}).join(" ");}else u.has(s.toString())?n(c)[p]=u.get(s.toString()):n(c)[p]=s;(typeof o!="string"||!gr.has(o)||!fr.has(p))&&delete t[i];}}),Object.keys(t).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&_o.has(s)&&(t[s]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function xr(){if(typeof window=="undefined"){let{JSDOM:e}=tr("jsdom");return new e("<!DOCTYPE html>").window}return window}function Uo(e){return e?{__html:yr__default.default(xr()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function hr(e){return e&&`fr-${e}`}function Jo(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Jo(o)).join(" "):hr(e))}function Pr(p,s){var c=p,{as:e,children:o,className:t,css:r={},part:n}=c,i=m(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:f,unmatchedProps:P}=Ko(i,u),x=Jo(n),h=t||x?clsx.clsx(t,x):void 0,F=[{boxSizing:"border-box"},f,r];return typeof o=="string"?jsxRuntime.jsx(u,d(a({className:h,css:F},P),{ref:s,dangerouslySetInnerHTML:Uo(o)})):jsxRuntime.jsx(u,d(a({className:h,css:F},P),{ref:s,children:o}))}var g=ro__namespace.forwardRef(Pr);var D={};Z(D,{Link:()=>Xr,Plain:()=>qr,Primary:()=>Gr,Secondary:()=>Jr});var S={};Z(S,{Body1:()=>Ar,Body2:()=>Lr,Caption:()=>$r,Display1:()=>Er,Display2:()=>Or,H1:()=>Ir,H2:()=>Hr,H3:()=>Mr,H4:()=>Wr});var eo={};Z(eo,{Body1:()=>vr,Body2:()=>Rr,Caption:()=>kr,Display1:()=>Cr,Display2:()=>Sr,H1:()=>Fr,H2:()=>wr,H3:()=>Tr,H4:()=>Br});var ee={color:"neutral.foreground",fontFamily:"default",margin:"0"},Cr=d(a({},ee),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Sr=d(a({},ee),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Fr=d(a({},ee),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),wr=d(a({},ee),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Tr=d(a({},ee),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Br=d(a({},ee),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),vr=d(a({},ee),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Rr=d(a({},ee),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),kr=d(a({},ee),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Dr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],oe=Object.fromEntries(Dr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=ro__namespace.forwardRef((p,s)=>{var c=p,{as:r=o,children:n}=c,i=m(c,["as","children"]);return jsxRuntime.jsx(g,d(a(a({as:r},eo[e]),i),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Er=oe.Display1,Or=oe.Display2,Ir=oe.H1,Hr=oe.H2,Mr=oe.H3,Wr=oe.H4,Ar=oe.Body1,Lr=oe.Body2,$r=oe.Caption;var to={};Z(to,{Link:()=>Kr,Plain:()=>Ur,Primary:()=>_r,Secondary:()=>zr,loadingCSSStyle:()=>oo});var Ne={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},_r=d(a({},Ne),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),zr=d(a({},Ne),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),Kr=d(a({},Ne),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Ur=d(a({},Ne),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),jr=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),oo={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:jr+" 1s ease infinite"}};function Ve(s){var p=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=p,i=m(p,["as","children","part","title","variant"]);var u;let c=n.toLocaleLowerCase();return jsxRuntime.jsxs(g,d(a(d(a({as:e!=null?e:"button",part:[`button-${c}`,t]},to[n]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?oo:{})}),i),{loading:void 0,children:[o,r&&jsxRuntime.jsx(S.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function Gr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsxRuntime.jsx(Ve,d(a({},o),{variant:"Primary",children:e}))}function Jr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsxRuntime.jsx(Ve,d(a({},o),{variant:"Secondary",children:e}))}function Xr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsxRuntime.jsx(Ve,d(a({},o),{variant:"Link",children:e}))}function qr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsxRuntime.jsx(Ve,d(a({},o),{variant:"Plain",children:e}))}var C={};Z(C,{Column:()=>Zr,Row:()=>Qr});var Qr=ro__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,d(a({display:"flex",flexDirection:"row"},e),{ref:o}))),Zr=ro__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,d(a({display:"flex",flexDirection:"column"},e),{ref:o})));function no(n){var i=n,{dismissible:e,flowId:o,part:t}=i,r=m(i,["dismissible","flowId","part"]);return jsxRuntime.jsx(K,d(a({as:null,flowId:o},r),{children:({handleDismiss:s,handlePrimary:p,handleSecondary:c,parentProps:{containerProps:u},step:f})=>{var y,B,E,v,I;let P=(y=f.props)!=null?y:{},x=(E=(B=f.primaryButton)==null?void 0:B.title)!=null?E:f.primaryButtonTitle,h=(I=(v=f.secondaryButton)==null?void 0:v.title)!=null?I:f.secondaryButtonTitle,F=!!f.$state.blocked;return jsxRuntime.jsxs(b,d(a(a({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),P),{children:[f.imageUri&&jsxRuntime.jsx(g,{as:"img",part:"image",src:f.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(C.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(b.Title,{part:"title",children:f.title}),jsxRuntime.jsx(b.Subtitle,{part:"subtitle",children:f.subtitle})]}),jsxRuntime.jsx(b.Secondary,{disabled:F,title:h,onClick:c}),jsxRuntime.jsx(b.Primary,{disabled:F,title:x,onClick:p}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:s})]}))}}))}var ze={};Z(ze,{Carousel:()=>lt,Collapsible:()=>_e,CollapsibleStep:()=>Re});var Be={};Z(Be,{Bar:()=>ge,Dots:()=>et,Segments:()=>tt});function ge(r){var n=r,{current:e,total:o}=n,t=m(n,["current","total"]);let i=o>0?Math.min(e/o,1):0,s=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(g,d(a({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function et(r){var n=r,{current:e,total:o}=n,t=m(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,p)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?T.colors.blue500:T.colors.blue800},p));return jsxRuntime.jsx(g,d(a({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function tt(r){var n=r,{current:e,total:o}=n,t=m(n,["current","total"]);let i=[...Array(o)].map((s,p)=>jsxRuntime.jsx(g,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsxRuntime.jsx(C.Row,d(a({gap:1,height:"10px",part:"progress-segments"},t),{children:i}))}function en(){return jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function rt(t){var r=t,{checked:e=!1}=r,o=m(r,["checked"]);return jsxRuntime.jsx(g,d(a({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&&jsxRuntime.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:jsxRuntime.jsx(en,{})})}))}function te(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=ro.useContext(O),n={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:ro.useCallback((i,s,p=!0)=>H(this,null,function*(){if((yield o==null?void 0:o(e,i,s))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(s,p)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,p),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:ro.useCallback((i,s)=>H(this,null,function*(){if((yield t==null?void 0:t(e,i,s))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function it({onPrimary:e,onSecondary:o,step:t}){var s,p;let{handlePrimary:r,handleSecondary:n}=te(t,{onPrimary:e,onSecondary:o}),i=!!(t.$state.completed||t.$state.blocked);return jsxRuntime.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",children:[jsxRuntime.jsxs(C.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsxRuntime.jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),jsxRuntime.jsx(rt,{checked:t.$state.completed,marginLeft:"auto"})]}),jsxRuntime.jsx(b.Title,{children:t.title}),jsxRuntime.jsx(b.Subtitle,{children:t.subtitle}),jsxRuntime.jsxs(C.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:[jsxRuntime.jsx(b.Secondary,{disabled:i,onClick:n,title:(s=t.secondaryButton)==null?void 0:s.title}),jsxRuntime.jsx(b.Primary,{disabled:i,onClick:r,title:(p=t.primaryButton)==null?void 0:p.title})]})]})}var st=react.keyframes`
51
+ var vo=Object.defineProperty,er=Object.defineProperties;var or=Object.getOwnPropertyDescriptors;var We=Object.getOwnPropertySymbols;var Ro=Object.prototype.hasOwnProperty,ko=Object.prototype.propertyIsEnumerable;var Bo=(e,o,t)=>o in e?vo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))Ro.call(o,t)&&Bo(e,t,o[t]);if(We)for(var t of We(o))ko.call(o,t)&&Bo(e,t,o[t]);return e},d=(e,o)=>er(e,or(o));var tr=(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 m=(e,o)=>{var t={};for(var r in e)Ro.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&We)for(var r of We(e))o.indexOf(r)<0&&ko.call(e,r)&&(t[r]=e[r]);return t};var Z=(e,o)=>{for(var t in o)vo(e,t,{get:o[t],enumerable:!0});};var H=(e,o,t)=>new Promise((r,n)=>{var i=c=>{try{p(t.next(c));}catch(u){n(u);}},s=c=>{try{p(t.throw(c));}catch(u){n(u);}},p=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);p((t=t.apply(e,o)).next());});var Do={borderWidths:{md:"1px"}};var Le=[5,10,20,35,50,65,80,95,98],Eo=[...Le],Ye=[...Le];Eo[4]=40;Ye[4]=60;var rr={blue:{h:213,s:100,l:Le},gray:{h:220,s:10,l:Le},green:{h:141,s:90,l:Eo},red:{h:9,s:90,l:Ye},yellow:{h:50,s:90,l:Ye}};var W={};for(let[e,{h:o,s:t,l:r}]of Object.entries(rr))W[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Oo=d(a({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 Io={md:"8px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,Ho={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var Mo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var nr="px",ir=e=>typeof e=="number"?`${4*e}${nr}`:e,ar=[-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"],Wo=Object.fromEntries(ar.map(e=>[e,ir(e)]));var Lo={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 Ae=d(a(d(a({},Do),{colors:a(a({},Oo),Ho)}),Lo),{radii:Io,shadows:Mo,space:Wo});function we(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,p=e[n];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(r,we(p,s,t)):r[s]=p,r},{})}function Qe(e){let o=we(e,"--fr","-");for(let[t,r]of Object.entries(o))if(t.indexOf(".")>-1){let n=t.replace(/\./g,"-");o[n]=r,delete o[t];}return o}function Ao(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],i=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=Ao(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var Ze=Qe(Ae),T=Ao(Ae);var lr=new Set(["alt","size","src"]),pr=sr__default.default.all.filter(e=>e.indexOf("-")!=0&&!lr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),dr=Object.fromEntries(pr),$e=we(T.colors),cr={color:$e,backgroundColor:$e,borderColor:$e,border:a(a({},T.borderWidths),$e),borderRadius:T.radii,borderWidth:T.borderWidths,boxShadow:T.shadows,fontFamily:T.fontFamilies,fontSize:T.fontSizes,fontWeight:T.fontWeights,gap:T.space,lineHeight:T.lineHeights,margin:T.space,marginBottom:T.space,marginLeft:T.space,marginRight:T.space,marginTop:T.space,padding:T.space,paddingBottom:T.space,paddingLeft:T.space,paddingRight:T.space,paddingTop:T.space},$o=a(a({},dr),cr),No={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"]},Vo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function ur(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 _o=new Map(Object.entries($o).map(([e,o])=>[e,ur(o)])),mr=new Map(Object.entries(No).map(([e,o])=>[e,new Set(o)])),fr=new Set(["height","width"]),gr=new Set(["canvas","embed","iframe","img","input","object","video"]);function zo(e){let[o,t]=e.split(":");return [o,Vo.has(t)?t:null]}function Ko(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let p=`&:${i.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[p]==null&&(r[p]={}),r[p]}return Object.entries(t).forEach(([i,s])=>{let[p,c]=zo(i),u=mr.get(p);u!=null&&(u.forEach(f=>{let P=`${f}${c?":"+c:""}`;t[P]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[p,c]=zo(i),u=_o.get(p);if(u!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");n(c)[p]=f.map(P=>{var x;return (x=u.get(P.toString()))!=null?x:P}).join(" ");}else u.has(s.toString())?n(c)[p]=u.get(s.toString()):n(c)[p]=s;(typeof o!="string"||!gr.has(o)||!fr.has(p))&&delete t[i];}}),Object.keys(t).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&_o.has(s)&&(t[s]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function xr(){if(typeof window=="undefined"){let{JSDOM:e}=tr("jsdom");return new e("<!DOCTYPE html>").window}return window}function Uo(e){return e?{__html:yr__default.default(xr()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function hr(e){return e&&`fr-${e}`}function Jo(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Jo(o)).join(" "):hr(e))}function Pr(p,s){var c=p,{as:e,children:o,className:t,css:r={},part:n}=c,i=m(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:f,unmatchedProps:P}=Ko(i,u),x=Jo(n),h=t||x?clsx.clsx(t,x):void 0,F=[{boxSizing:"border-box"},f,r];return typeof o=="string"?jsxRuntime.jsx(u,d(a({className:h,css:F},P),{ref:s,dangerouslySetInnerHTML:Uo(o)})):jsxRuntime.jsx(u,d(a({className:h,css:F},P),{ref:s,children:o}))}var g=ro__namespace.forwardRef(Pr);var D={};Z(D,{Link:()=>Xr,Plain:()=>qr,Primary:()=>Gr,Secondary:()=>Jr});var S={};Z(S,{Body1:()=>Lr,Body2:()=>Ar,Caption:()=>$r,Display1:()=>Er,Display2:()=>Or,H1:()=>Ir,H2:()=>Hr,H3:()=>Mr,H4:()=>Wr});var eo={};Z(eo,{Body1:()=>vr,Body2:()=>Rr,Caption:()=>kr,Display1:()=>Cr,Display2:()=>Sr,H1:()=>Fr,H2:()=>wr,H3:()=>Tr,H4:()=>Br});var ee={color:"neutral.foreground",fontFamily:"default",margin:"0"},Cr=d(a({},ee),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Sr=d(a({},ee),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Fr=d(a({},ee),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),wr=d(a({},ee),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Tr=d(a({},ee),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Br=d(a({},ee),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),vr=d(a({},ee),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Rr=d(a({},ee),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),kr=d(a({},ee),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Dr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],oe=Object.fromEntries(Dr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=ro__namespace.forwardRef((p,s)=>{var c=p,{as:r=o,children:n}=c,i=m(c,["as","children"]);return jsxRuntime.jsx(g,d(a(a({as:r},eo[e]),i),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Er=oe.Display1,Or=oe.Display2,Ir=oe.H1,Hr=oe.H2,Mr=oe.H3,Wr=oe.H4,Lr=oe.Body1,Ar=oe.Body2,$r=oe.Caption;var to={};Z(to,{Link:()=>Kr,Plain:()=>Ur,Primary:()=>_r,Secondary:()=>zr,loadingCSSStyle:()=>oo});var Ne={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},_r=d(a({},Ne),{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"}),zr=d(a({},Ne),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),Kr=d(a({},Ne),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Ur=d(a({},Ne),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),jr=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),oo={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:jr+" 1s ease infinite"}};function Ve(s){var p=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=p,i=m(p,["as","children","part","title","variant"]);var u;let c=n.toLocaleLowerCase();return jsxRuntime.jsxs(g,d(a(d(a({as:e!=null?e:"button",part:[`button-${c}`,t]},to[n]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?oo:{})}),i),{loading:void 0,children:[o,r&&jsxRuntime.jsx(S.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function Gr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsxRuntime.jsx(Ve,d(a({},o),{variant:"Primary",children:e}))}function Jr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsxRuntime.jsx(Ve,d(a({},o),{variant:"Secondary",children:e}))}function Xr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsxRuntime.jsx(Ve,d(a({},o),{variant:"Link",children:e}))}function qr(t){var r=t,{children:e}=r,o=m(r,["children"]);return jsxRuntime.jsx(Ve,d(a({},o),{variant:"Plain",children:e}))}var C={};Z(C,{Column:()=>Zr,Row:()=>Qr});var Qr=ro__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,d(a({display:"flex",flexDirection:"row"},e),{ref:o}))),Zr=ro__namespace.forwardRef((e,o)=>jsxRuntime.jsx(g,d(a({display:"flex",flexDirection:"column"},e),{ref:o})));function no(n){var i=n,{dismissible:e,flowId:o,part:t}=i,r=m(i,["dismissible","flowId","part"]);return jsxRuntime.jsx(K,d(a({as:null,flowId:o},r),{children:({handleDismiss:s,handlePrimary:p,handleSecondary:c,parentProps:{containerProps:u},step:f})=>{var y,B,E,v,I;let P=(y=f.props)!=null?y:{},x=(E=(B=f.primaryButton)==null?void 0:B.title)!=null?E:f.primaryButtonTitle,h=(I=(v=f.secondaryButton)==null?void 0:v.title)!=null?I:f.secondaryButtonTitle,F=!!f.$state.blocked;return jsxRuntime.jsxs(b,d(a(a({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),P),{children:[f.imageUri&&jsxRuntime.jsx(g,{as:"img",part:"image",src:f.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(C.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(b.Title,{part:"title",children:f.title}),jsxRuntime.jsx(b.Subtitle,{part:"subtitle",children:f.subtitle})]}),jsxRuntime.jsx(b.Secondary,{disabled:F,title:h,onClick:c}),jsxRuntime.jsx(b.Primary,{disabled:F,title:x,onClick:p}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:s})]}))}}))}var ze={};Z(ze,{Carousel:()=>lt,Collapsible:()=>_e,CollapsibleStep:()=>Re});var Be={};Z(Be,{Bar:()=>ye,Dots:()=>et,Segments:()=>tt});function ye(r){var n=r,{current:e,total:o}=n,t=m(n,["current","total"]);let i=o>0?Math.min(e/o,1):0,s=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(g,d(a({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function et(r){var n=r,{current:e,total:o}=n,t=m(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,p)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?T.colors.blue500:T.colors.blue800},p));return jsxRuntime.jsx(g,d(a({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function tt(r){var n=r,{current:e,total:o}=n,t=m(n,["current","total"]);let i=[...Array(o)].map((s,p)=>jsxRuntime.jsx(g,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsxRuntime.jsx(C.Row,d(a({gap:1,height:"10px",part:"progress-segments"},t),{children:i}))}function en(){return jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function rt(t){var r=t,{checked:e=!1}=r,o=m(r,["checked"]);return jsxRuntime.jsx(g,d(a({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&&jsxRuntime.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:jsxRuntime.jsx(en,{})})}))}function te(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=ro.useContext(O),n={"flow.back":()=>e.flow.back(),"flow.complete":()=>e.flow.complete(),"flow.forward":()=>e.flow.forward(),"flow.restart":()=>e.flow.restart(),"flow.skip":()=>e.flow.skip(),"flow.start":()=>e.flow.start(),"step.complete":()=>e.complete(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:ro.useCallback((i,s,p=!0)=>H(this,null,function*(){if((yield o==null?void 0:o(e,i,s))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(s,p)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,p),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:ro.useCallback((i,s)=>H(this,null,function*(){if((yield t==null?void 0:t(e,i,s))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function it({onPrimary:e,onSecondary:o,step:t}){var c,u;let{handlePrimary:r,handleSecondary:n}=te(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:s}=t.$state,p=s||!i?jsxRuntime.jsx(rt,{checked:s,marginLeft:"auto"}):jsxRuntime.jsx(g,{as:outline.LockClosedIcon,height:"22px",marginLeft:"auto",width:"22px"});return jsxRuntime.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:i,opacity:i?.5:1,children:[jsxRuntime.jsxs(C.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsxRuntime.jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),p]}),jsxRuntime.jsx(b.Title,{children:t.title}),jsxRuntime.jsx(b.Subtitle,{children:t.subtitle}),jsxRuntime.jsxs(C.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:[jsxRuntime.jsx(b.Secondary,{disabled:s,onClick:n,title:(c=t.secondaryButton)==null?void 0:c.title}),jsxRuntime.jsx(b.Primary,{disabled:s||i,onClick:r,title:(u=t.primaryButton)==null?void 0:u.title})]})]})}var st=react.keyframes`
52
52
  from {
53
53
  opacity: 0;
54
54
  }
55
55
  to {
56
56
  opacity: 1;
57
57
  }
58
- `;function lt(o){var e=m(o,[]);let[t,r]=sn__default.default({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step"}),[n,i]=ro.useState(),[s,p]=ro.useState();return ro.useLayoutEffect(()=>{r&&(n==null&&i(r.canScrollNext()),s==null&&p(r.canScrollPrev()),r.on("select",()=>{i(r.canScrollNext()),p(r.canScrollPrev());}));},[r]),jsxRuntime.jsx(K,d(a({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:({flow:c})=>{let u=c.getNumberOfCompletedSteps(),f=c.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(C.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:T.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxRuntime.jsxs(C.Column,{part:"carousel-header-content",children:[jsxRuntime.jsx(S.H3,{children:c.title}),jsxRuntime.jsx(S.Body2,{color:"neutral.400",children:c.subtitle})]}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxRuntime.jsxs(S.Body2,{fontWeight:"demibold",part:"progress-text",children:[u,"/",f]}),jsxRuntime.jsx(ge,{current:u,total:f,minWidth:"200px"})]})]}),jsxRuntime.jsxs(g,{margin:`0 ${T.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:t,children:[jsxRuntime.jsx(C.Row,{gap:4,part:"carousel-content",children:Array.from(c.steps.values()).map(P=>jsxRuntime.jsx(it,{onPrimary:e.onPrimary,onSecondary:e.onSecondary,step:P},P.id))}),s&&jsxRuntime.jsx(C.Column,{animation:`${st} 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:jsxRuntime.jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>r.scrollPrev(),padding:"2",children:jsxRuntime.jsx(outline.ArrowLeftIcon,{height:"24px",width:"24px"})})}),n&&jsxRuntime.jsx(C.Column,{animation:`${st} 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:jsxRuntime.jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>r.scrollNext(),padding:"2",children:jsxRuntime.jsx(outline.ArrowRightIcon,{height:"24px",width:"24px"})})})]})]})}}))}var Re={};Z(Re,{Content:()=>so,Root:()=>lo,Trigger:()=>po});var dn=react.keyframes`
58
+ `;function lt(o){var e=m(o,[]);let[t,r]=ln__default.default({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step"}),[n,i]=ro.useState(),[s,p]=ro.useState();return ro.useLayoutEffect(()=>{r&&(n==null&&i(r.canScrollNext()),s==null&&p(r.canScrollPrev()),r.on("select",()=>{i(r.canScrollNext()),p(r.canScrollPrev());}));},[r]),jsxRuntime.jsx(K,d(a({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:({flow:c})=>{let u=c.getNumberOfCompletedSteps(),f=c.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(C.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:T.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxRuntime.jsxs(C.Column,{part:"carousel-header-content",children:[jsxRuntime.jsx(S.H3,{children:c.title}),jsxRuntime.jsx(S.Body2,{color:"neutral.400",children:c.subtitle})]}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxRuntime.jsxs(S.Body2,{fontWeight:"demibold",part:"progress-text",children:[u,"/",f]}),jsxRuntime.jsx(ye,{current:u,total:f,minWidth:"200px"})]})]}),jsxRuntime.jsxs(g,{margin:`0 ${T.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:t,children:[jsxRuntime.jsx(C.Row,{gap:4,part:"carousel-content",children:Array.from(c.steps.values()).map(P=>jsxRuntime.jsx(it,{onPrimary:e.onPrimary,onSecondary:e.onSecondary,step:P},P.id))}),s&&jsxRuntime.jsx(C.Column,{animation:`${st} 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:jsxRuntime.jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>r.scrollPrev(),padding:"2",children:jsxRuntime.jsx(outline.ArrowLeftIcon,{height:"24px",width:"24px"})})}),n&&jsxRuntime.jsx(C.Column,{animation:`${st} 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:jsxRuntime.jsx(D.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>r.scrollNext(),padding:"2",children:jsxRuntime.jsx(outline.ArrowRightIcon,{height:"24px",width:"24px"})})})]})]})}}))}var Re={};Z(Re,{Content:()=>so,Root:()=>lo,Trigger:()=>po});var cn=react.keyframes`
59
59
  from {
60
60
  height: 0;
61
61
  opacity: 0;
@@ -64,7 +64,7 @@ var vo=Object.defineProperty,er=Object.defineProperties;var or=Object.getOwnProp
64
64
  height: var(--radix-collapsible-content-height);
65
65
  opacity: 1;
66
66
  }
67
- `,cn=react.keyframes`
67
+ `,un=react.keyframes`
68
68
  from {
69
69
  height: var(--radix-collapsible-content-height);
70
70
  opacity: 1;
@@ -73,7 +73,7 @@ var vo=Object.defineProperty,er=Object.defineProperties;var or=Object.getOwnProp
73
73
  height: 0;
74
74
  opacity: 0;
75
75
  }
76
- `,un=()=>jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function mn({checked:e=!1}){return jsxRuntime.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&&jsxRuntime.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:jsxRuntime.jsx(un,{})})})}function so({children:e}){return jsxRuntime.jsx(be__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(C.Column,{css:{'&[data-state="open"]':{animation:`${dn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${cn} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(g,{}),e]})})}function lo(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=m(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(be__namespace.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsxRuntime.jsx(b,d(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function po({isCompleted:e,title:o}){return jsxRuntime.jsx(be__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(C.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(mn,{checked:e}),jsxRuntime.jsx(S.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(g,{as:outline.ChevronDownIcon,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var dt=ro.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function ct({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var h,F,y,B,E,v;let{$state:{blocked:i,completed:s},subtitle:p,title:c}=n,u=(F=(h=n.primaryButton)==null?void 0:h.title)!=null?F:n.primaryButtonTitle,f=(B=(y=n.secondaryButton)==null?void 0:y.title)!=null?B:n.secondaryButtonTitle,P=(E=n.props)!=null?E:{},x=!!(s||i);return jsxRuntime.jsxs(lo,d(a({open:t,onOpenChange:r},P),{children:[jsxRuntime.jsx(po,{isCompleted:s,title:c}),jsxRuntime.jsxs(so,{children:[jsxRuntime.jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",src:(v=n.videoUri)!=null?v:n.imageUri,type:n.videoUri?"video":"image"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",children:p}),jsxRuntime.jsxs(C.Row,{gap:3,children:[jsxRuntime.jsx(b.Secondary,{disabled:x,title:f,onClick:o}),jsxRuntime.jsx(b.Primary,{disabled:x,title:u,onClick:e})]})]})]}))}var xn={default:ct};function bn(r){var n=r,{flow:e,step:o}=n,t=m(n,["flow","step"]);var y;let{onPrimary:i,onSecondary:s,openStepId:p,setOpenStepId:c,stepTypes:u}=ro.useContext(dt),{handlePrimary:f,handleSecondary:P}=te(o,{onPrimary:i,onSecondary:s}),x=(p!=null?p:e.getCurrentStep().id)===o.id,h=(y=u[o.type])!=null?y:ct;function F(B){return H(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(h,d(a({flow:e,onOpenChange:F,open:x,step:o},t),{handlePrimary:f,handleSecondary:P}),o.id)}function _e(p){var c=p,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,part:n,stepTypes:i={}}=c,s=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,f]=ro.useState(null),P=a(a({},xn),i);return jsxRuntime.jsx(dt.Provider,{value:{openStepId:u,setOpenStepId:f,onPrimary:t,onSecondary:r,stepTypes:P},children:jsxRuntime.jsx(K,d(a({as:b,borderWidth:"md",flowId:o,part:["checklist",n]},s),{children:y=>{var B=y,{flow:x,handleDismiss:h}=B,F=m(B,["flow","handleDismiss"]);let v=Array.from(x.steps.entries()).filter(([,w])=>w.$state.visible===!0).map(([,w])=>jsxRuntime.jsx(bn,d(a({flow:x,handleDismiss:h},F),{step:w}),w.id)),I=x.getNumberOfCompletedSteps(),A=x.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(b.Header,{dismissible:e,handleDismiss:h,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(S.Body2,{fontWeight:"demibold",children:[I,"/",A]}),jsxRuntime.jsx(ge,{current:I,total:A,flexGrow:1})]})]}),v]})}}))})}var Bn=new Set(["required","min","max","minLength","maxLength","pattern"]);function vn({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=reactHookForm.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 i=Object.fromEntries(Object.entries(t).filter(([p])=>Bn.has(p))),s=reactHookForm.useController({name:t.id,control:o,rules:i});return jsxRuntime.jsx(e,d(a({},s),{fieldData:t,formContext:n,submit:r}))}function mt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var v,I,A,w,R,k;let{__readOnly:s}=ro.useContext(O),p=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),[c,u]=ro.useState(!1),f=[],{control:P,handleSubmit:x}=p,h=(v=i.props)!=null?v:{};function F($,Ce){u(!0),t(Ce,$,s===!0).then(()=>u(!1));}(I=i.fields)==null||I.forEach($=>{e[$.type]!=null&&f.push(jsxRuntime.jsx(vn,{control:P,fieldComponent:e[$.type],fieldData:$,submit:x(F)},`${i.flow.id}-${$.id}`));});let y=(w=(A=i.primaryButton)==null?void 0:A.title)!=null?w:i.primaryButtonTitle,B=(k=(R=i.secondaryButton)==null?void 0:R.title)!=null?k:i.secondaryButtonTitle,E=!!(i.$state.blocked||!p.formState.isValid);return jsxRuntime.jsxs(C.Column,d(a({gap:5,part:"form-step"},h),{children:[jsxRuntime.jsx(b.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsxRuntime.jsx(reactHookForm.FormProvider,d(a({},p),{children:f})),jsxRuntime.jsxs(C.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsxRuntime.jsx(D.Secondary,{disabled:E,onClick:r,title:B}),jsxRuntime.jsx(D.Primary,{disabled:E||c,onClick:x(F),title:y!=null?y:"Submit",loading:c})]},"form-footer")]}))}function ft({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(S.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function co({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(S.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(g,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var ke={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function re({children:e,field:o,fieldData:t,fieldState:r}){var u;let{id:n,label:i,placeholder:s}=t,{error:p}=r,c=d(a(a(a({id:n},o),s?{placeholder:s}:{}),ke),{"aria-invalid":!!p,value:(u=o.value)!=null?u:""});return jsxRuntime.jsxs(g,{part:"field",children:[jsxRuntime.jsx(co,{id:n,required:!!t.required,children:i}),e(c),jsxRuntime.jsx(ft,{error:p})]})}var On=()=>jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),In=ro__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.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:[jsxRuntime.jsx(S.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(Pe__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(g,{as:Pe__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(On,{})})})})]}));function uo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:s})=>jsxRuntime.jsx(In,{value:s,label:i},s));return jsxRuntime.jsx(re,d(a({},e),{children:()=>jsxRuntime.jsx(Pe__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(C.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Wn=ro__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(V__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(V__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(S.Body2,{part:"field-select-option-label",children:e})})})}));function mo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:s,value:p})=>jsxRuntime.jsx(Wn,{value:p,label:s},p));return jsxRuntime.jsx(re,d(a({},e),{children:()=>jsxRuntime.jsxs(V__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(V__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(S.Body2,d(a({},ke),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(V__namespace.Value,{placeholder:n!=null?n:"Select one"}),jsxRuntime.jsx(V__namespace.Icon,{children:jsxRuntime.jsx(g,{as:outline.ChevronDownIcon,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(V__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(g,d(a({},ke),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(V__namespace.Viewport,{children:i})}))})]})}))}function fo(e){return jsxRuntime.jsx(re,d(a({},e),{children:o=>jsxRuntime.jsx(S.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function St(e){return jsxRuntime.jsx(re,d(a({},e),{children:o=>jsxRuntime.jsx(S.Body2,a({as:"textarea",part:"field-textarea"},o))}))}var An={radio:uo,select:mo,text:fo,textarea:St};function De(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=m(i,["fieldTypes","flowId","part"]);let s=Object.assign({},An,e);return jsxRuntime.jsx(K,d(a({flowId:o,part:["form",t]},r),{children:p=>jsxRuntime.jsx(mt,a({fieldTypes:s},p))}))}var je={};Z(je,{NPS:()=>Ue});function Tt({field:e,fieldData:o,submit:t}){var n,i;let r=[...Array(11)].map((s,p)=>{let c=e.value===p?D.Primary:D.Secondary;return jsxRuntime.jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(p),t();},title:`${p}`,css:{".fr-button-title":{fontSize:"15px"}}},p)});return jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(C.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:r}),jsxRuntime.jsxs(C.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(S.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(n=o.negativeLabel)!=null?n:"Not likely at all"}),jsxRuntime.jsx(S.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(i=o.positiveLabel)!=null?i:"Extremely likely"})]})]})}function Ue(i){var s=i,{as:e=M,flowId:o,fieldTypes:t,part:r}=s,n=m(s,["as","flowId","fieldTypes","part"]);let{flow:p}=de(o);return jsxRuntime.jsx(De,a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:Tt},t),modal:!1,onEscapeKeyDown:c=>{typeof n.onEscapeKeyDown=="function"&&n.onEscapeKeyDown(c),c.defaultPrevented||p.skip();},part:["nps",r],css:d(a({},!p||p.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"}}})},n))}function ce(e,{onComplete:o,onDismiss:t}={}){let r=ro.useRef(null);return ro.useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&H(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:ro.useCallback(n=>H(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function Ge(){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]=ro.useState(e),[r,n]=ro.useState(null),i=ro.useCallback(s=>{n(s);},[]);return ro.useLayoutEffect(()=>{if(!r)return;let s=()=>{let p=r.getBoundingClientRect();t(p);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:i}}var Un=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Rt(r){var n=r,{style:e={},part:o=""}=n,t=m(n,["style","part"]);return jsxRuntime.jsxs(g,d(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Un}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function go(r){var n=r,{part:e,src:o}=n,t=m(n,["part","src"]);return jsxRuntime.jsx(g,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Jn(e){var o,t,r,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function yo(r){var n=r,{part:e,src:o}=n,t=m(n,["part","src"]);let i=Jn(o);return i?jsxRuntime.jsx(g,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:i},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(g,a({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 ue(r){var n=r,{src:e,type:o}=n,t=m(n,["src","type"]);return jsxRuntime.jsx(o==="video"?yo:go,a({src:e},t))}function Dt({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},i=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};n[p[r]]=s;let c=i();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var Je={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Et(e,o){var i,s,p,c,u;let t=Object.fromEntries(Je.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r=Object.fromEntries(Je.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n={};for(let f of Object.keys(e))!Je.content.includes(f)&&!Je.root.includes(f)&&(n[f]=e[f]);if(t.align=(i=t.align)!=null?i:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},P=(E,v)=>["top","bottom"].includes(v)?E=="after"?"marginLeft":"marginRight":E=="after"?"marginTop":"marginBottom",x=(p=t.alignOffset)!=null?p:0,h=(c=t.style)!=null?c:{},F=(u=t.side)!=null?u:"bottom",y=t.align;t.style=d(a({},h),{[P(y,F)]:x});let B=["top","bottom"].includes(F)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=f[y];}return {contentProps:t,otherProps:n,rootProps:r}}var Ot=react.keyframes`
76
+ `,mn=()=>jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function fn({checked:e=!1}){return jsxRuntime.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&&jsxRuntime.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:jsxRuntime.jsx(mn,{})})})}function so({children:e}){return jsxRuntime.jsx(be__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(C.Column,{css:{'&[data-state="open"]':{animation:`${cn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${un} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(g,{}),e]})})}function lo(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=m(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(be__namespace.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsxRuntime.jsx(b,d(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function po({isCompleted:e,isBlocked:o,title:t}){return jsxRuntime.jsx(be__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(C.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",children:[jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(fn,{checked:e}),jsxRuntime.jsx(S.Body2,{fontWeight:"demibold",userSelect:"none",children:t})]}),jsxRuntime.jsx(g,{as:outline.ChevronDownIcon,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var dt=ro.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function ct({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var h,F,y,B,E,v;let{$state:{blocked:i,completed:s},subtitle:p,title:c}=n,u=(F=(h=n.primaryButton)==null?void 0:h.title)!=null?F:n.primaryButtonTitle,f=(B=(y=n.secondaryButton)==null?void 0:y.title)!=null?B:n.secondaryButtonTitle,P=(E=n.props)!=null?E:{},x=!!(s||i);return jsxRuntime.jsxs(lo,d(a({open:t,onOpenChange:r},P),{children:[jsxRuntime.jsx(po,{isBlocked:n.$state.blocked,isCompleted:s,title:c}),jsxRuntime.jsxs(so,{children:[jsxRuntime.jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",src:(v=n.videoUri)!=null?v:n.imageUri,type:n.videoUri?"video":"image"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",children:p}),jsxRuntime.jsxs(C.Row,{gap:3,children:[jsxRuntime.jsx(b.Secondary,{disabled:x,title:f,onClick:o}),jsxRuntime.jsx(b.Primary,{disabled:x,title:u,onClick:e})]})]})]}))}var bn={default:ct};function hn(r){var n=r,{flow:e,step:o}=n,t=m(n,["flow","step"]);var y;let{onPrimary:i,onSecondary:s,openStepId:p,setOpenStepId:c,stepTypes:u}=ro.useContext(dt),{handlePrimary:f,handleSecondary:P}=te(o,{onPrimary:i,onSecondary:s}),x=(p!=null?p:e.getCurrentStep().id)===o.id,h=(y=u[o.type])!=null?y:ct;function F(B){return H(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(h,d(a({flow:e,onOpenChange:F,open:x,step:o},t),{handlePrimary:f,handleSecondary:P}),o.id)}function _e(p){var c=p,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,part:n,stepTypes:i={}}=c,s=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,f]=ro.useState(null),P=a(a({},bn),i);return jsxRuntime.jsx(dt.Provider,{value:{openStepId:u,setOpenStepId:f,onPrimary:t,onSecondary:r,stepTypes:P},children:jsxRuntime.jsx(K,d(a({as:b,borderWidth:"md",flowId:o,part:["checklist",n]},s),{children:y=>{var B=y,{flow:x,handleDismiss:h}=B,F=m(B,["flow","handleDismiss"]);let v=Array.from(x.steps.entries()).filter(([,w])=>w.$state.visible===!0).map(([,w])=>jsxRuntime.jsx(hn,d(a({flow:x,handleDismiss:h},F),{step:w}),w.id)),I=x.getNumberOfCompletedSteps(),L=x.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(b.Header,{dismissible:e,handleDismiss:h,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(S.Body2,{fontWeight:"demibold",children:[I,"/",L]}),jsxRuntime.jsx(ye,{current:I,total:L,flexGrow:1})]})]}),v]})}}))})}var vn=new Set(["required","min","max","minLength","maxLength","pattern"]);function Rn({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=reactHookForm.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 i=Object.fromEntries(Object.entries(t).filter(([p])=>vn.has(p))),s=reactHookForm.useController({name:t.id,control:o,rules:i});return jsxRuntime.jsx(e,d(a({},s),{fieldData:t,formContext:n,submit:r}))}function mt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var v,I,L,w,R,k;let{__readOnly:s}=ro.useContext(O),p=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),[c,u]=ro.useState(!1),f=[],{control:P,handleSubmit:x}=p,h=(v=i.props)!=null?v:{};function F($,Ce){u(!0),t(Ce,$,s===!0).then(()=>u(!1));}(I=i.fields)==null||I.forEach($=>{e[$.type]!=null&&f.push(jsxRuntime.jsx(Rn,{control:P,fieldComponent:e[$.type],fieldData:$,submit:x(F)},`${i.flow.id}-${$.id}`));});let y=(w=(L=i.primaryButton)==null?void 0:L.title)!=null?w:i.primaryButtonTitle,B=(k=(R=i.secondaryButton)==null?void 0:R.title)!=null?k:i.secondaryButtonTitle,E=!!(i.$state.blocked||!p.formState.isValid);return jsxRuntime.jsxs(C.Column,d(a({gap:5,part:"form-step"},h),{children:[jsxRuntime.jsx(b.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsxRuntime.jsx(reactHookForm.FormProvider,d(a({},p),{children:f})),jsxRuntime.jsxs(C.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsxRuntime.jsx(D.Secondary,{disabled:E,onClick:r,title:B}),jsxRuntime.jsx(D.Primary,{disabled:E||c,onClick:x(F),title:y!=null?y:"Submit",loading:c})]},"form-footer")]}))}function ft({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(S.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function co({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(S.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(g,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var ke={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function re({children:e,field:o,fieldData:t,fieldState:r}){var u;let{id:n,label:i,placeholder:s}=t,{error:p}=r,c=d(a(a(a({id:n},o),s?{placeholder:s}:{}),ke),{"aria-invalid":!!p,value:(u=o.value)!=null?u:""});return jsxRuntime.jsxs(g,{part:"field",children:[jsxRuntime.jsx(co,{id:n,required:!!t.required,children:i}),e(c),jsxRuntime.jsx(ft,{error:p})]})}var In=()=>jsxRuntime.jsx(g,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Hn=ro__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.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:[jsxRuntime.jsx(S.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(Pe__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(g,{as:Pe__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(In,{})})})})]}));function uo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:s})=>jsxRuntime.jsx(Hn,{value:s,label:i},s));return jsxRuntime.jsx(re,d(a({},e),{children:()=>jsxRuntime.jsx(Pe__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(C.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Ln=ro__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(V__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(g,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(V__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(S.Body2,{part:"field-select-option-label",children:e})})})}));function mo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:s,value:p})=>jsxRuntime.jsx(Ln,{value:p,label:s},p));return jsxRuntime.jsx(re,d(a({},e),{children:()=>jsxRuntime.jsxs(V__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(V__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(S.Body2,d(a({},ke),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(V__namespace.Value,{placeholder:n!=null?n:"Select one"}),jsxRuntime.jsx(V__namespace.Icon,{children:jsxRuntime.jsx(g,{as:outline.ChevronDownIcon,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(V__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(g,d(a({},ke),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(V__namespace.Viewport,{children:i})}))})]})}))}function fo(e){return jsxRuntime.jsx(re,d(a({},e),{children:o=>jsxRuntime.jsx(S.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function St(e){return jsxRuntime.jsx(re,d(a({},e),{children:o=>jsxRuntime.jsx(S.Body2,a({as:"textarea",part:"field-textarea"},o))}))}var An={radio:uo,select:mo,text:fo,textarea:St};function De(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=m(i,["fieldTypes","flowId","part"]);let s=Object.assign({},An,e);return jsxRuntime.jsx(K,d(a({flowId:o,part:["form",t]},r),{children:p=>jsxRuntime.jsx(mt,a({fieldTypes:s},p))}))}var je={};Z(je,{NPS:()=>Ue});function Tt({field:e,fieldData:o,submit:t}){var n,i;let r=[...Array(11)].map((s,p)=>{let c=e.value===p?D.Primary:D.Secondary;return jsxRuntime.jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(p),t();},title:`${p}`,css:{".fr-button-title":{fontSize:"15px"}}},p)});return jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(C.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:r}),jsxRuntime.jsxs(C.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(S.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(n=o.negativeLabel)!=null?n:"Not likely at all"}),jsxRuntime.jsx(S.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(i=o.positiveLabel)!=null?i:"Extremely likely"})]})]})}function Ue(i){var s=i,{as:e=M,flowId:o,fieldTypes:t,part:r}=s,n=m(s,["as","flowId","fieldTypes","part"]);let{flow:p}=ce(o);return jsxRuntime.jsx(De,a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:Tt},t),modal:!1,onEscapeKeyDown:c=>{typeof n.onEscapeKeyDown=="function"&&n.onEscapeKeyDown(c),c.defaultPrevented||p.skip();},part:["nps",r],css:d(a({},!p||p.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"}}})},n))}function ue(e,{onComplete:o,onDismiss:t}={}){let r=ro.useRef(null);return ro.useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&H(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:ro.useCallback(n=>H(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function Ge(){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]=ro.useState(e),[r,n]=ro.useState(null),i=ro.useCallback(s=>{n(s);},[]);return ro.useLayoutEffect(()=>{if(!r)return;let s=()=>{let p=r.getBoundingClientRect();t(p);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:i}}var jn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Rt(r){var n=r,{style:e={},part:o=""}=n,t=m(n,["style","part"]);return jsxRuntime.jsxs(g,d(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${jn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(g,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function go(r){var n=r,{part:e,src:o}=n,t=m(n,["part","src"]);return jsxRuntime.jsx(g,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Xn(e){var o,t,r,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function yo(r){var n=r,{part:e,src:o}=n,t=m(n,["part","src"]);let i=Xn(o);return i?jsxRuntime.jsx(g,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:i},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(g,a({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 me(r){var n=r,{src:e,type:o}=n,t=m(n,["src","type"]);return jsxRuntime.jsx(o==="video"?yo:go,a({src:e},t))}function Dt({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},i=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};n[p[r]]=s;let c=i();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var Je={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Et(e,o){var i,s,p,c,u;let t=Object.fromEntries(Je.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r=Object.fromEntries(Je.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n={};for(let f of Object.keys(e))!Je.content.includes(f)&&!Je.root.includes(f)&&(n[f]=e[f]);if(t.align=(i=t.align)!=null?i:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},P=(E,v)=>["top","bottom"].includes(v)?E=="after"?"marginLeft":"marginRight":E=="after"?"marginTop":"marginBottom",x=(p=t.alignOffset)!=null?p:0,h=(c=t.style)!=null?c:{},F=(u=t.side)!=null?u:"bottom",y=t.align;t.style=d(a({},h),{[P(y,F)]:x});let B=["top","bottom"].includes(F)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=f[y];}return {contentProps:t,otherProps:n,rootProps:r}}var Ot=react.keyframes`
77
77
  from {
78
78
  opacity: 0;
79
79
  }
@@ -83,7 +83,7 @@ var vo=Object.defineProperty,er=Object.defineProperties;var or=Object.getOwnProp
83
83
  to {
84
84
  opacity: 1;
85
85
  }
86
- `;function N(s){var p=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=p,i=m(p,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:f}=Ge(),{node:P,rect:x,ref:h}=Ge(),Li=Et(i,u),{contentProps:F,otherProps:Zt}=Li,To=Zt,{part:y}=To,B=m(To,["part"]),{rootProps:E}=Li,[v,I]=ro.useState(F.align),[A,w]=ro.useState(F.side),[R,k]=ro.useState(0),[$,Ce]=ro.useState(0);if(c!==null){let X=c.getAttribute("data-align"),ae=c.getAttribute("data-side");v!==X&&I(X),A!==ae&&w(ae);}let ie=ro.useRef(null);if(ro.useEffect(()=>{let X=document.querySelector(e);X!=null?(h(X),ie.current=X):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),ro.useEffect(()=>{function X(Se){if(Se.matches(e))return Se;let fe=Se.querySelectorAll(e);return fe.length>0?fe[0]:null}let ae=new MutationObserver(Se=>{for(let fe of Se)if(fe.type==="childList"){for(let Fe of fe.addedNodes){if(Fe.nodeType!==Node.ELEMENT_NODE)continue;let se=X(Fe);if(se!=null){h(se),ie.current=se,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",se);break}}for(let Fe of fe.removedNodes){if(Fe.nodeType!==Node.ELEMENT_NODE)continue;let se=X(Fe);if(se!=null){h(null),ie.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",se);break}}}});return ae.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ae.disconnect()},[]),ro.useEffect(()=>{let{scrollX:X,scrollY:ae}=window;k(x.left+X),Ce(x.top+ae);},[x.left,x.top]),P==null)return null;let He="0";typeof window!="undefined"&&(He=window.getComputedStyle(P).borderRadius);let Me=Dt({props:i,alignAttr:v,sideAttr:A});return jsxRuntime.jsxs(Q__namespace.Root,d(a({defaultOpen:!0},E),{children:[jsxRuntime.jsx(Q__namespace.Anchor,{virtualRef:ie}),jsxRuntime.jsx(Q__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r&&jsxRuntime.jsx(g,a({animation:`${Ot} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:He,height:x.height,left:R,top:$,width:x.width}},i.zIndex!=null?{zIndex:i.zIndex}:{})),jsxRuntime.jsx(Q__namespace.Content,d(a({asChild:!0},F),{ref:f,children:jsxRuntime.jsxs(b,d(a({animation:`${Ot} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},part:["tooltip",y],style:n},B),{children:[jsxRuntime.jsx(Rt,{style:Me}),o]}))}))]})})]}))}N.Close=e=>jsxRuntime.jsx(Q__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(D.Plain,d(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});N.Media=t=>{var r=t,{src:e}=r,o=m(r,["src"]);return e==null?null:jsxRuntime.jsx(ue,a({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};N.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Primary,a({title:o,onClick:e},t))};N.Progress=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsxRuntime.jsx(S.Body2,d(a({part:"progress"},o),{children:e}))};N.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Secondary,a({title:o,onClick:e},t))};N.Subtitle=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsxRuntime.jsx(S.Body2,d(a({part:"subtitle"},o),{children:e}))};N.Title=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsxRuntime.jsx(S.H4,d(a({part:"title"},o),{children:e}))};function It(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:i,step:s}=u,p=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var E,v,I,A,w,R;let{handleDismiss:f}=ce(o,{onDismiss:t}),{handlePrimary:P,handleSecondary:x}=te(s,{onPrimary:n,onSecondary:i}),h=(E=s.props)!=null?E:{},F=(I=(v=s.primaryButton)==null?void 0:v.title)!=null?I:s.primaryButtonTitle,y=(w=(A=s.secondaryButton)==null?void 0:A.title)!=null?w:s.secondaryButtonTitle,B=!!s.$state.blocked;return jsxRuntime.jsxs(N,d(a(a({anchor:s.selector,onOpenAutoFocus:k=>k.preventDefault(),onPointerDownOutside:k=>k.preventDefault(),onInteractOutside:k=>k.preventDefault()},p),h),{onEscapeKeyDown:k=>{typeof r=="function"&&r(k),k.defaultPrevented||f(k);},children:[e&&jsxRuntime.jsx(N.Close,{onClick:f}),jsxRuntime.jsx(N.Media,{src:(R=s.videoUri)!=null?R:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(C.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(N.Title,{children:s.title}),jsxRuntime.jsx(N.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx(N.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepIndex()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(N.Secondary,{disabled:B,onClick:x,title:y}),jsxRuntime.jsx(N.Primary,{disabled:B,onClick:P,title:F})]})]}),s.id)}function Ee(e,o=!0){let{currentModal:t,modals:r,setModals:n}=ro.useContext(O),[i,s]=ro.useState(!1);ro.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),ro.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==i&&s(c);},[e==null?void 0:e.id,t]);function p(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:i||!o,removeModal:p}}function Po(i){var s=i,{flowId:e,onComplete:o,variables:t,part:r}=s,n=m(s,["flowId","onComplete","variables","part"]);let[p,c]=ro.useState(!1),{flow:u}=de(e,{variables:t}),{hasInitialized:f,registerComponent:P,unregisterComponent:x}=ro.useContext(O);ce(u,{onComplete:o});let{isCurrentModal:h,removeModal:F}=Ee(u);if(ro.useEffect(()=>{!(u!=null&&u.isVisible)&&h&&F();},[u==null?void 0:u.isVisible,h]),ro.useEffect(()=>()=>{x(e);},[]),u==null||u.isVisible===!1||!h||(P(e,()=>{p||c(!0);}),!f||!p))return null;let y=u.getCurrentStep();return y==null||y.start(),jsxRuntime.jsx(It,a({"data-flow-id":u.id,flow:u,part:["tour",r],step:y},n))}function Wt(e){let[o,t]=ro.useState(),{frigade:r}=ro.useContext(O);return ro.useEffect(()=>{H(this,null,function*(){let n=yield r.getCollection(e);if(!n||r.hasFailedToLoad()){t(void 0);return}t(n);});},[e]),{collection:o}}function Co(r){var n=r,{collectionId:e,part:o}=n,t=m(n,["collectionId","part"]);var f,P;let i={ANNOUNCEMENT:So,BANNER:no,CARD:b,CHECKLIST:_e,EMBEDDED_TIP:b,FORM:De,NPS_SURVEY:Ue,TOUR:Po},[s,p]=ro.useState(),{collection:c}=Wt(e);ro.useEffect(()=>{var h;if(c==null)return;let x=(h=c.flows.find(({flow:F})=>F.isVisible))==null?void 0:h.flow;x!=null&&p(x);},[c]);let u=(P=i[(f=s==null?void 0:s.rawData)==null?void 0:f.flowType])!=null?P:()=>null;return s==null||u==null?null:jsxRuntime.jsx(g,d(a({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(u,{flowId:s.id})}))}function Oe(){let{frigade:e}=ro.useContext(O);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Lt(){let[e,o]=ro.useState(),{frigade:t}=Oe();return ro.useEffect(()=>{t.getCollections().then(r=>{r.forEach((n,i)=>{n.collectionType==="DEFAULT"&&o(i);});});},[]),e==null?null:jsxRuntime.jsx(Co,{as:null,collectionId:e})}var O=ro.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function $t(){let{frigade:e}=Oe();return ro.useEffect(()=>{H(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[]),null}function Kt(s){var p=s,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=p,i=m(p,["children","css","defaultCollection","navigate","theme"]);let c=n?Qe(n):{},[u,f]=ro.useState(new Set),P=ro.useRef(new Map),x=ro.useRef(),[h,F]=ro.useState(!1),y=ro.useMemo(()=>(F(!1),x.current=void 0,f(new Set),new js.Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides})),[i.userId,i.groupId,i.apiKey]);ro.useEffect(()=>{if(i.__flowStateOverrides){let w=y.getConfig();w.__flowStateOverrides=i.__flowStateOverrides,y.reload(w);}},[i.__flowStateOverrides]);function B(){let w=[...P.current.entries()].map(([R,k])=>[R,k.callback]);y.batchRegister(w),F(!0);}function E(w,R){if(x.current&&clearTimeout(x.current),h){P.current.has(w)?y.getFlow(w).then(k=>R(k.isVisible)):(y.getFlow(w).then(k=>k.register(R)),P.current.set(w,{callback:R}));return}P.current.has(w)||P.current.set(w,{callback:R}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function v(w){P.current.has(w)&&y.getFlow(w).then(R=>{P.current.delete(w),R==null||R.unregister();});}let I=r!=null?r:(w,R="_self")=>{window.open(w,R);};ro.useEffect(()=>()=>{y.destroy();},[]);let A=u.size>0?u.values().next().value:null;return jsxRuntime.jsxs(O.Provider,{value:d(a({modals:u,setModals:f,currentModal:A,navigate:I},i),{frigade:y,registerComponent:E,unregisterComponent:v,hasInitialized:h}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":a(a(a({},Ze),c),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:T,children:[t&&jsxRuntime.jsx(Lt,{}),e]}),i.preloadImages!==!1&&jsxRuntime.jsx($t,{})]})}function de(e,o){let[t,r]=ro.useState(),[,n]=ro.useState(""),{frigade:i}=ro.useContext(O),s=ro.useCallback(p=>{p.id===e&&(o!=null&&o.variables&&p.applyVariables(o.variables),setTimeout(()=>{r(p),n(Math.random().toString());},0));},[o==null?void 0:o.variables,i]);return ro.useEffect(()=>{if(i!=null&&i.isReady())return H(this,null,function*(){let p=yield i.getFlow(e);if(!p||i.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&p.applyVariables(o.variables),r(p);}),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}},[s,i]),ro.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function K(P){var x=P,{as:e,children:o,dismissible:t=!1,flowId:r,onComplete:n,onDismiss:i,onPrimary:s,onSecondary:p,variables:c,forceMount:u}=x,f=m(x,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let[h,F]=ro.useState(!1),{flow:y}=de(r,{variables:c}),{hasInitialized:B,registerComponent:E,unregisterComponent:v}=ro.useContext(O),I=y==null?void 0:y.getCurrentStep(),{handleDismiss:A}=ce(y,{onComplete:n,onDismiss:i}),{handlePrimary:w,handleSecondary:R}=te(I,{onPrimary:s,onSecondary:p}),k=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:$,removeModal:Ce}=Ee(y,k);ro.useEffect(()=>{!(y!=null&&y.isVisible)&&$&&Ce();},[y==null?void 0:y.isVisible,$]),ro.useEffect(()=>()=>{v(r);},[]);let ie=u&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||!ie&&!$||(E(r,()=>{h||F(!0);}),!y.isVisible&&!ie)||!B||!h)return null;(ie||!y.isCompleted&&!y.isSkipped)&&I.start();let He=e===null?ro.Fragment:e!=null?e:g,Me=d(a({},f),{"data-flow-id":y.id});return jsxRuntime.jsx(He,d(a({},e===null?{}:Me),{children:o({flow:y,handleDismiss:A,handlePrimary:w,handleSecondary:R,parentProps:{dismissible:t,flowId:r,variables:c,containerProps:Me},step:I})}))}function Xt(t){var r=t,{part:e}=r,o=m(r,["part"]);return jsxRuntime.jsx(K,d(a({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:p},step:c})=>{var P,x,h,F;let u=(x=(P=c.primaryButton)==null?void 0:P.title)!=null?x:c.primaryButtonTitle,f=(F=(h=c.secondaryButton)==null?void 0:h.title)!=null?F:c.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(b.Header,{dismissible:p,handleDismiss:n,subtitle:c.subtitle,title:c.title}),jsxRuntime.jsx(b.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(b.Secondary,{title:f,onClick:s}),jsxRuntime.jsx(b.Primary,{title:u,onClick:i})]})]})}}))}var b=ro__namespace.forwardRef((n,r)=>{var i=n,{children:e,flowId:o}=i,t=m(i,["children","flowId"]);var p;if(o!=null)return jsxRuntime.jsx(Xt,a({flowId:o},t));let s=(p=t.as)!=null?p:C.Column;return jsxRuntime.jsx(s,d(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});b.Dismiss=e=>jsxRuntime.jsx(D.Plain,d(a({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}));b.Header=i=>{var s=i,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=m(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(C.Row,d(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsxRuntime.jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};b.Media=t=>{var r=t,{src:e}=r,o=m(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(ue,a({borderRadius:"md",src:e},o))};b.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Primary,a({title:o,onClick:e},t))};b.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Secondary,a({title:o,onClick:e},t))};b.Subtitle=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsxRuntime.jsx(S.Body2,d(a({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};b.Title=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsxRuntime.jsx(S.H4,d(a({display:"block",part:"title"},o),{children:e}))};var qe={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Yt(e){let o=Object.fromEntries(qe.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(qe.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!qe.content.some(i=>i===n)&&!qe.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var Ei=react.keyframes`
86
+ `;function N(s){var p=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=p,i=m(p,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:f}=Ge(),{node:P,rect:x,ref:h}=Ge(),$i=Et(i,u),{contentProps:F,otherProps:Zt}=$i,To=Zt,{part:y}=To,B=m(To,["part"]),{rootProps:E}=$i,[v,I]=ro.useState(F.align),[L,w]=ro.useState(F.side),[R,k]=ro.useState(0),[$,Ce]=ro.useState(0);if(c!==null){let X=c.getAttribute("data-align"),ae=c.getAttribute("data-side");v!==X&&I(X),L!==ae&&w(ae);}let ie=ro.useRef(null);if(ro.useEffect(()=>{let X=document.querySelector(e);X!=null?(h(X),ie.current=X):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),ro.useEffect(()=>{function X(Se){if(Se.matches(e))return Se;let ge=Se.querySelectorAll(e);return ge.length>0?ge[0]:null}let ae=new MutationObserver(Se=>{for(let ge of Se)if(ge.type==="childList"){for(let Fe of ge.addedNodes){if(Fe.nodeType!==Node.ELEMENT_NODE)continue;let se=X(Fe);if(se!=null){h(se),ie.current=se,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",se);break}}for(let Fe of ge.removedNodes){if(Fe.nodeType!==Node.ELEMENT_NODE)continue;let se=X(Fe);if(se!=null){h(null),ie.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",se);break}}}});return ae.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ae.disconnect()},[]),ro.useEffect(()=>{let{scrollX:X,scrollY:ae}=window;k(x.left+X),Ce(x.top+ae);},[x.left,x.top]),P==null)return null;let He="0";typeof window!="undefined"&&(He=window.getComputedStyle(P).borderRadius);let Me=Dt({props:i,alignAttr:v,sideAttr:L});return jsxRuntime.jsxs(Q__namespace.Root,d(a({defaultOpen:!0},E),{children:[jsxRuntime.jsx(Q__namespace.Anchor,{virtualRef:ie}),jsxRuntime.jsx(Q__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r&&jsxRuntime.jsx(g,a({animation:`${Ot} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:He,height:x.height,left:R,top:$,width:x.width}},i.zIndex!=null?{zIndex:i.zIndex}:{})),jsxRuntime.jsx(Q__namespace.Content,d(a({asChild:!0},F),{ref:f,children:jsxRuntime.jsxs(b,d(a({animation:`${Ot} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},part:["tooltip",y],style:n},B),{children:[jsxRuntime.jsx(Rt,{style:Me}),o]}))}))]})})]}))}N.Close=e=>jsxRuntime.jsx(Q__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(D.Plain,d(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});N.Media=t=>{var r=t,{src:e}=r,o=m(r,["src"]);return e==null?null:jsxRuntime.jsx(me,a({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};N.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Primary,a({title:o,onClick:e},t))};N.Progress=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsxRuntime.jsx(S.Body2,d(a({part:"progress"},o),{children:e}))};N.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Secondary,a({title:o,onClick:e},t))};N.Subtitle=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsxRuntime.jsx(S.Body2,d(a({part:"subtitle"},o),{children:e}))};N.Title=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsxRuntime.jsx(S.H4,d(a({part:"title"},o),{children:e}))};function It(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:i,step:s}=u,p=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var E,v,I,L,w,R;let{handleDismiss:f}=ue(o,{onDismiss:t}),{handlePrimary:P,handleSecondary:x}=te(s,{onPrimary:n,onSecondary:i}),h=(E=s.props)!=null?E:{},F=(I=(v=s.primaryButton)==null?void 0:v.title)!=null?I:s.primaryButtonTitle,y=(w=(L=s.secondaryButton)==null?void 0:L.title)!=null?w:s.secondaryButtonTitle,B=!!s.$state.blocked;return jsxRuntime.jsxs(N,d(a(a({anchor:s.selector,onOpenAutoFocus:k=>k.preventDefault(),onPointerDownOutside:k=>k.preventDefault(),onInteractOutside:k=>k.preventDefault()},p),h),{onEscapeKeyDown:k=>{typeof r=="function"&&r(k),k.defaultPrevented||f(k);},children:[e&&jsxRuntime.jsx(N.Close,{onClick:f}),jsxRuntime.jsx(N.Media,{src:(R=s.videoUri)!=null?R:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(C.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(N.Title,{children:s.title}),jsxRuntime.jsx(N.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx(N.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepIndex()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(N.Secondary,{disabled:B,onClick:x,title:y}),jsxRuntime.jsx(N.Primary,{disabled:B,onClick:P,title:F})]})]}),s.id)}function Ee(e,o=!0){let{currentModal:t,modals:r,setModals:n}=ro.useContext(O),[i,s]=ro.useState(!1);ro.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),ro.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==i&&s(c);},[e==null?void 0:e.id,t]);function p(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:i||!o,removeModal:p}}function Po(i){var s=i,{flowId:e,onComplete:o,variables:t,part:r}=s,n=m(s,["flowId","onComplete","variables","part"]);let[p,c]=ro.useState(!1),{flow:u}=ce(e,{variables:t}),{hasInitialized:f,registerComponent:P,unregisterComponent:x}=ro.useContext(O);ue(u,{onComplete:o});let{isCurrentModal:h,removeModal:F}=Ee(u);if(ro.useEffect(()=>{!(u!=null&&u.isVisible)&&h&&F();},[u==null?void 0:u.isVisible,h]),ro.useEffect(()=>()=>{x(e);},[]),u==null||u.isVisible===!1||!h||(P(e,()=>{p||c(!0);}),!f||!p))return null;let y=u.getCurrentStep();return y==null||y.start(),jsxRuntime.jsx(It,a({"data-flow-id":u.id,flow:u,part:["tour",r],step:y},n))}function Wt(e){let[o,t]=ro.useState(),{frigade:r}=ro.useContext(O);return ro.useEffect(()=>{H(this,null,function*(){let n=yield r.getCollection(e);if(!n||r.hasFailedToLoad()){t(void 0);return}t(n);});},[e]),{collection:o}}function Co(r){var n=r,{collectionId:e,part:o}=n,t=m(n,["collectionId","part"]);var f,P;let i={ANNOUNCEMENT:So,BANNER:no,CARD:b,CHECKLIST:_e,EMBEDDED_TIP:b,FORM:De,NPS_SURVEY:Ue,TOUR:Po},[s,p]=ro.useState(),{collection:c}=Wt(e);ro.useEffect(()=>{var h;if(c==null)return;let x=(h=c.flows.find(({flow:F})=>F.isVisible))==null?void 0:h.flow;x!=null&&p(x);},[c]);let u=(P=i[(f=s==null?void 0:s.rawData)==null?void 0:f.flowType])!=null?P:()=>null;return s==null||u==null?null:jsxRuntime.jsx(g,d(a({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(u,{flowId:s.id})}))}function Oe(){let{frigade:e}=ro.useContext(O);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function At(){let[e,o]=ro.useState(),{frigade:t}=Oe();return ro.useEffect(()=>{t.getCollections().then(r=>{r==null||r.forEach((n,i)=>{n.collectionType==="DEFAULT"&&o(i);});});},[]),e==null?null:jsxRuntime.jsx(Co,{as:null,collectionId:e})}var O=ro.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function $t(){let{frigade:e}=Oe();return ro.useEffect(()=>{H(this,null,function*(){(yield e.getFlows()).forEach(t=>{t.steps.forEach(r=>{if(r.imageUri){let n=new Image;n.src=r.imageUri;}});});});},[]),null}function Kt(s){var p=s,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=p,i=m(p,["children","css","defaultCollection","navigate","theme"]);let c=n?Qe(n):{},[u,f]=ro.useState(new Set),P=ro.useRef(new Map),x=ro.useRef(),[h,F]=ro.useState(!1),y=ro.useMemo(()=>(F(!1),x.current=void 0,f(new Set),new js.Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides})),[i.userId,i.groupId,i.apiKey]);ro.useEffect(()=>{if(i.__flowStateOverrides){let w=y.getConfig();w.__flowStateOverrides=i.__flowStateOverrides,y.reload(w);}},[i.__flowStateOverrides]);function B(){let w=[...P.current.entries()].map(([R,k])=>[R,k.callback]);y.batchRegister(w),F(!0);}function E(w,R){if(x.current&&clearTimeout(x.current),h){P.current.has(w)?y.getFlow(w).then(k=>R(k.isVisible)):(y.getFlow(w).then(k=>k.register(R)),P.current.set(w,{callback:R}));return}P.current.has(w)||P.current.set(w,{callback:R}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function v(w){P.current.has(w)&&y.getFlow(w).then(R=>{P.current.delete(w),R==null||R.unregister();});}let I=r!=null?r:(w,R="_self")=>{window.open(w,R);};ro.useEffect(()=>()=>{y.destroy();},[]);let L=u.size>0?u.values().next().value:null;return jsxRuntime.jsxs(O.Provider,{value:d(a({modals:u,setModals:f,currentModal:L,navigate:I},i),{frigade:y,registerComponent:E,unregisterComponent:v,hasInitialized:h}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":a(a(a({},Ze),c),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:T,children:[t&&jsxRuntime.jsx(At,{}),e]}),i.preloadImages!==!1&&jsxRuntime.jsx($t,{})]})}function ce(e,o){let[t,r]=ro.useState(),[,n]=ro.useState(""),{frigade:i}=ro.useContext(O),s=ro.useCallback(p=>{p.id===e&&(o!=null&&o.variables&&p.applyVariables(o.variables),setTimeout(()=>{r(p),n(Math.random().toString());},0));},[o==null?void 0:o.variables,i]);return ro.useEffect(()=>{if(i!=null&&i.isReady())return H(this,null,function*(){let p=yield i.getFlow(e);if(!p||i.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&p.applyVariables(o.variables),r(p);}),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}},[s,i]),ro.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function K(P){var x=P,{as:e,children:o,dismissible:t=!1,flowId:r,onComplete:n,onDismiss:i,onPrimary:s,onSecondary:p,variables:c,forceMount:u}=x,f=m(x,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let[h,F]=ro.useState(!1),{flow:y}=ce(r,{variables:c}),{hasInitialized:B,registerComponent:E,unregisterComponent:v}=ro.useContext(O),I=y==null?void 0:y.getCurrentStep(),{handleDismiss:L}=ue(y,{onComplete:n,onDismiss:i}),{handlePrimary:w,handleSecondary:R}=te(I,{onPrimary:s,onSecondary:p}),k=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:$,removeModal:Ce}=Ee(y,k);ro.useEffect(()=>{!(y!=null&&y.isVisible)&&$&&Ce();},[y==null?void 0:y.isVisible,$]),ro.useEffect(()=>()=>{v(r);},[]);let ie=u&&((y==null?void 0:y.isCompleted)||(y==null?void 0:y.isSkipped));if(!y||!ie&&!$||(E(r,()=>{h||F(!0);}),!y.isVisible&&!ie)||!B||!h)return null;(ie||!y.isCompleted&&!y.isSkipped)&&I.start();let He=e===null?ro.Fragment:e!=null?e:g,Me=d(a({},f),{"data-flow-id":y.id});return jsxRuntime.jsx(He,d(a({},e===null?{}:Me),{children:o({flow:y,handleDismiss:L,handlePrimary:w,handleSecondary:R,parentProps:{dismissible:t,flowId:r,variables:c,containerProps:Me},step:I})}))}function Xt(t){var r=t,{part:e}=r,o=m(r,["part"]);return jsxRuntime.jsx(K,d(a({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:p},step:c})=>{var P,x,h,F;let u=(x=(P=c.primaryButton)==null?void 0:P.title)!=null?x:c.primaryButtonTitle,f=(F=(h=c.secondaryButton)==null?void 0:h.title)!=null?F:c.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(b.Header,{dismissible:p,handleDismiss:n,subtitle:c.subtitle,title:c.title}),jsxRuntime.jsx(b.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(b.Secondary,{title:f,onClick:s}),jsxRuntime.jsx(b.Primary,{title:u,onClick:i})]})]})}}))}var b=ro__namespace.forwardRef((n,r)=>{var i=n,{children:e,flowId:o}=i,t=m(i,["children","flowId"]);var p;if(o!=null)return jsxRuntime.jsx(Xt,a({flowId:o},t));let s=(p=t.as)!=null?p:C.Column;return jsxRuntime.jsx(s,d(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});b.Dismiss=e=>jsxRuntime.jsx(D.Plain,d(a({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}));b.Header=i=>{var s=i,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=m(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(C.Row,d(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsxRuntime.jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsxRuntime.jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};b.Media=t=>{var r=t,{src:e}=r,o=m(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(me,a({borderRadius:"md",src:e},o))};b.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Primary,a({title:o,onClick:e},t))};b.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(D.Secondary,a({title:o,onClick:e},t))};b.Subtitle=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsxRuntime.jsx(S.Body2,d(a({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};b.Title=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return e==null?null:jsxRuntime.jsx(S.H4,d(a({display:"block",part:"title"},o),{children:e}))};var qe={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Yt(e){let o=Object.fromEntries(qe.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(qe.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!qe.content.some(i=>i===n)&&!qe.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var Oi=react.keyframes`
87
87
  from {
88
88
  opacity: 0;
89
89
  }
@@ -93,7 +93,7 @@ var vo=Object.defineProperty,er=Object.defineProperties;var or=Object.getOwnProp
93
93
  to {
94
94
  opacity: 1;
95
95
  }
96
- `;function M(n){var i=n,{children:e,className:o,modal:t=!0}=i,r=m(i,["children","className","modal"]);let{rootProps:s,contentProps:p,otherProps:f}=Yt(r),P=f,{zIndex:c}=P,u=m(P,["zIndex"]);return jsxRuntime.jsx(z__namespace.Root,d(a({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx(z__namespace.Portal,{children:jsxRuntime.jsxs(g,{animation:`${Ei} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsxRuntime.jsx(z__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(z__namespace.Content,d(a({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},p),{children:jsxRuntime.jsx(b,d(a({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}M.Dismiss=e=>jsxRuntime.jsx(z__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(D.Plain,d(a({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});M.Subtitle=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return jsxRuntime.jsx(z__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(S.Body2,d(a({part:"subtitle"},o),{children:e}))})};M.Media=t=>{var r=t,{src:e}=r,o=m(r,["src"]);return e==null?null:jsxRuntime.jsx(ue,a({borderRadius:"md",src:e},o))};M.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Primary,a({title:o,onClick:e},t))};M.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?T.colors.blue500:T.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsxRuntime.jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};M.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Secondary,a({title:o,onClick:e},t))};M.Title=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return jsxRuntime.jsx(z__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(S.H4,d(a({part:"title"},o),{children:e}))})};M.displayName="Dialog";var Qt=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function So(r){var n=r,{flowId:e,part:o}=n,t=m(n,["flowId","part"]);let i=Object.fromEntries(Object.entries(t).filter(([p])=>Qt.some(c=>p===c))),s=Object.fromEntries(Object.entries(t).filter(([p])=>Qt.indexOf(p)===-1));return jsxRuntime.jsx(K,d(a({as:null,flowId:e},i),{children:({flow:p,handleDismiss:c,handlePrimary:u,handleSecondary:f,parentProps:{containerProps:P,dismissible:x},step:h})=>{var v,I,A,w,R,k;let F=(v=h.props)!=null?v:{},y=(A=(I=h.primaryButton)==null?void 0:I.title)!=null?A:h.primaryButtonTitle,B=(R=(w=h.secondaryButton)==null?void 0:w.title)!=null?R:h.secondaryButtonTitle,E=!!h.$state.blocked;return jsxRuntime.jsx(M,d(a(a({part:["announcement",o],textAlign:"center"},P),s),{onEscapeKeyDown:$=>{if(t.dismissible===!1){$.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown($),$.defaultPrevented||c($);},children:jsxRuntime.jsxs(C.Column,d(a({gap:5,part:"announcement-step"},F),{children:[x&&jsxRuntime.jsx(M.Dismiss,{onClick:c}),jsxRuntime.jsxs(C.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(M.Title,{children:h.title}),jsxRuntime.jsx(M.Subtitle,{children:h.subtitle})]}),jsxRuntime.jsx(M.Media,{src:(k=h.videoUri)!=null?k:h.imageUri,type:h.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(M.ProgressDots,{current:p.getCurrentStepIndex(),total:p.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(C.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsxRuntime.jsx(M.Secondary,{disabled:E,onClick:f,title:B}),y&&jsxRuntime.jsx(M.Primary,{disabled:E,onClick:u,title:y})]})]}))}))}}))}function Hi(){let{userId:e,frigade:o}=ro.useContext(O);function t(n){return H(this,null,function*(){yield o.identify(e,n);})}function r(n,i){return H(this,null,function*(){yield o.track(n,i);})}return {userId:e,addProperties:t,track:r}}function Wi(){var n;let{frigade:e}=ro.useContext(O);function o(i){return H(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,i);})}function t(i,s){return H(this,null,function*(){yield e.track(i,s);})}function r(i,s){return H(this,null,function*(){yield e.group(i,s);})}return {groupId:(n=e==null?void 0:e.config)==null?void 0:n.groupId,setGroupId:r,addProperties:o,track:t}}
96
+ `;function M(n){var i=n,{children:e,className:o,modal:t=!0}=i,r=m(i,["children","className","modal"]);let{rootProps:s,contentProps:p,otherProps:f}=Yt(r),P=f,{zIndex:c}=P,u=m(P,["zIndex"]);return jsxRuntime.jsx(z__namespace.Root,d(a({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx(z__namespace.Portal,{children:jsxRuntime.jsxs(g,{animation:`${Oi} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsxRuntime.jsx(z__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(z__namespace.Content,d(a({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},p),{children:jsxRuntime.jsx(b,d(a({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},u),{children:e}))}))]})})}))}M.Dismiss=e=>jsxRuntime.jsx(z__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(D.Plain,d(a({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});M.Subtitle=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return jsxRuntime.jsx(z__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(S.Body2,d(a({part:"subtitle"},o),{children:e}))})};M.Media=t=>{var r=t,{src:e}=r,o=m(r,["src"]);return e==null?null:jsxRuntime.jsx(me,a({borderRadius:"md",src:e},o))};M.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Primary,a({title:o,onClick:e},t))};M.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsxRuntime.jsx(g,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?T.colors.blue500:T.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsxRuntime.jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};M.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=m(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(D.Secondary,a({title:o,onClick:e},t))};M.Title=t=>{var r=t,{children:e}=r,o=m(r,["children"]);return jsxRuntime.jsx(z__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(S.H4,d(a({part:"title"},o),{children:e}))})};M.displayName="Dialog";var Qt=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function So(r){var n=r,{flowId:e,part:o}=n,t=m(n,["flowId","part"]);let i=Object.fromEntries(Object.entries(t).filter(([p])=>Qt.some(c=>p===c))),s=Object.fromEntries(Object.entries(t).filter(([p])=>Qt.indexOf(p)===-1));return jsxRuntime.jsx(K,d(a({as:null,flowId:e},i),{children:({flow:p,handleDismiss:c,handlePrimary:u,handleSecondary:f,parentProps:{containerProps:P,dismissible:x},step:h})=>{var v,I,L,w,R,k;let F=(v=h.props)!=null?v:{},y=(L=(I=h.primaryButton)==null?void 0:I.title)!=null?L:h.primaryButtonTitle,B=(R=(w=h.secondaryButton)==null?void 0:w.title)!=null?R:h.secondaryButtonTitle,E=!!h.$state.blocked;return jsxRuntime.jsx(M,d(a(a({part:["announcement",o],textAlign:"center"},P),s),{onEscapeKeyDown:$=>{if(t.dismissible===!1){$.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown($),$.defaultPrevented||c($);},children:jsxRuntime.jsxs(C.Column,d(a({gap:5,part:"announcement-step"},F),{children:[x&&jsxRuntime.jsx(M.Dismiss,{onClick:c}),jsxRuntime.jsxs(C.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(M.Title,{children:h.title}),jsxRuntime.jsx(M.Subtitle,{children:h.subtitle})]}),jsxRuntime.jsx(M.Media,{src:(k=h.videoUri)!=null?k:h.imageUri,type:h.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(M.ProgressDots,{current:p.getCurrentStepIndex(),total:p.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(C.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsxRuntime.jsx(M.Secondary,{disabled:E,onClick:f,title:B}),y&&jsxRuntime.jsx(M.Primary,{disabled:E,onClick:u,title:y})]})]}))}))}}))}function Mi(){let{userId:e,frigade:o}=ro.useContext(O);function t(n){return H(this,null,function*(){yield o.identify(e,n);})}function r(n,i){return H(this,null,function*(){yield o.track(n,i);})}return {userId:e,addProperties:t,track:r}}function Li(){var n;let{frigade:e}=ro.useContext(O);function o(i){return H(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,i);})}function t(i,s){return H(this,null,function*(){yield e.track(i,s);})}function r(i,s){return H(this,null,function*(){yield e.group(i,s);})}return {groupId:(n=e==null?void 0:e.config)==null?void 0:n.groupId,setGroupId:r,addProperties:o,track:t}}
97
97
 
98
98
  exports.FrigadeJS = js__namespace;
99
99
  exports.Announcement = So;
@@ -119,14 +119,14 @@ exports.TextField = fo;
119
119
  exports.Tooltip = N;
120
120
  exports.Tour = Po;
121
121
  exports.themeVariables = Ze;
122
- exports.tokens = Le;
122
+ exports.tokens = Ae;
123
123
  exports.useBoundingClientRect = Ge;
124
- exports.useFlow = de;
125
- exports.useFlowHandlers = ce;
124
+ exports.useFlow = ce;
125
+ exports.useFlowHandlers = ue;
126
126
  exports.useFrigade = Oe;
127
- exports.useGroup = Wi;
127
+ exports.useGroup = Li;
128
128
  exports.useModal = Ee;
129
129
  exports.useStepHandlers = te;
130
- exports.useUser = Hi;
130
+ exports.useUser = Mi;
131
131
  //# sourceMappingURL=out.js.map
132
132
  //# sourceMappingURL=index.cjs.map