@frigade/react 2.4.5 → 2.4.7
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 +43 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.js +16 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ declare const tokens: {
|
|
|
44
44
|
};
|
|
45
45
|
space: {
|
|
46
46
|
0: string;
|
|
47
|
+
auto: string;
|
|
47
48
|
5: string;
|
|
48
49
|
10: string;
|
|
49
50
|
20: string;
|
|
@@ -86,7 +87,6 @@ declare const tokens: {
|
|
|
86
87
|
[-1]: string;
|
|
87
88
|
0.5: string;
|
|
88
89
|
[-0.5]: string;
|
|
89
|
-
auto: string;
|
|
90
90
|
};
|
|
91
91
|
fontFamilies: {
|
|
92
92
|
default: string;
|
|
@@ -228,6 +228,7 @@ declare const theme: DeepPartial<{
|
|
|
228
228
|
};
|
|
229
229
|
space: {
|
|
230
230
|
0: string;
|
|
231
|
+
auto: string;
|
|
231
232
|
5: string;
|
|
232
233
|
10: string;
|
|
233
234
|
20: string;
|
|
@@ -270,7 +271,6 @@ declare const theme: DeepPartial<{
|
|
|
270
271
|
[-1]: string;
|
|
271
272
|
0.5: string;
|
|
272
273
|
[-0.5]: string;
|
|
273
|
-
auto: string;
|
|
274
274
|
};
|
|
275
275
|
fontFamilies: {
|
|
276
276
|
default: string;
|
|
@@ -639,6 +639,7 @@ declare const themedStyleProps: {
|
|
|
639
639
|
}>;
|
|
640
640
|
readonly gap: DeepPartial<{
|
|
641
641
|
0: string;
|
|
642
|
+
auto: string;
|
|
642
643
|
5: string;
|
|
643
644
|
10: string;
|
|
644
645
|
20: string;
|
|
@@ -681,7 +682,6 @@ declare const themedStyleProps: {
|
|
|
681
682
|
[-1]: string;
|
|
682
683
|
0.5: string;
|
|
683
684
|
[-0.5]: string;
|
|
684
|
-
auto: string;
|
|
685
685
|
}>;
|
|
686
686
|
readonly lineHeight: DeepPartial<{
|
|
687
687
|
xs: string;
|
|
@@ -695,6 +695,7 @@ declare const themedStyleProps: {
|
|
|
695
695
|
}>;
|
|
696
696
|
readonly margin: DeepPartial<{
|
|
697
697
|
0: string;
|
|
698
|
+
auto: string;
|
|
698
699
|
5: string;
|
|
699
700
|
10: string;
|
|
700
701
|
20: string;
|
|
@@ -737,10 +738,10 @@ declare const themedStyleProps: {
|
|
|
737
738
|
[-1]: string;
|
|
738
739
|
0.5: string;
|
|
739
740
|
[-0.5]: string;
|
|
740
|
-
auto: string;
|
|
741
741
|
}>;
|
|
742
742
|
readonly marginBottom: DeepPartial<{
|
|
743
743
|
0: string;
|
|
744
|
+
auto: string;
|
|
744
745
|
5: string;
|
|
745
746
|
10: string;
|
|
746
747
|
20: string;
|
|
@@ -783,10 +784,10 @@ declare const themedStyleProps: {
|
|
|
783
784
|
[-1]: string;
|
|
784
785
|
0.5: string;
|
|
785
786
|
[-0.5]: string;
|
|
786
|
-
auto: string;
|
|
787
787
|
}>;
|
|
788
788
|
readonly marginLeft: DeepPartial<{
|
|
789
789
|
0: string;
|
|
790
|
+
auto: string;
|
|
790
791
|
5: string;
|
|
791
792
|
10: string;
|
|
792
793
|
20: string;
|
|
@@ -829,10 +830,10 @@ declare const themedStyleProps: {
|
|
|
829
830
|
[-1]: string;
|
|
830
831
|
0.5: string;
|
|
831
832
|
[-0.5]: string;
|
|
832
|
-
auto: string;
|
|
833
833
|
}>;
|
|
834
834
|
readonly marginRight: DeepPartial<{
|
|
835
835
|
0: string;
|
|
836
|
+
auto: string;
|
|
836
837
|
5: string;
|
|
837
838
|
10: string;
|
|
838
839
|
20: string;
|
|
@@ -875,10 +876,10 @@ declare const themedStyleProps: {
|
|
|
875
876
|
[-1]: string;
|
|
876
877
|
0.5: string;
|
|
877
878
|
[-0.5]: string;
|
|
878
|
-
auto: string;
|
|
879
879
|
}>;
|
|
880
880
|
readonly marginTop: DeepPartial<{
|
|
881
881
|
0: string;
|
|
882
|
+
auto: string;
|
|
882
883
|
5: string;
|
|
883
884
|
10: string;
|
|
884
885
|
20: string;
|
|
@@ -921,10 +922,10 @@ declare const themedStyleProps: {
|
|
|
921
922
|
[-1]: string;
|
|
922
923
|
0.5: string;
|
|
923
924
|
[-0.5]: string;
|
|
924
|
-
auto: string;
|
|
925
925
|
}>;
|
|
926
926
|
readonly padding: DeepPartial<{
|
|
927
927
|
0: string;
|
|
928
|
+
auto: string;
|
|
928
929
|
5: string;
|
|
929
930
|
10: string;
|
|
930
931
|
20: string;
|
|
@@ -967,10 +968,10 @@ declare const themedStyleProps: {
|
|
|
967
968
|
[-1]: string;
|
|
968
969
|
0.5: string;
|
|
969
970
|
[-0.5]: string;
|
|
970
|
-
auto: string;
|
|
971
971
|
}>;
|
|
972
972
|
readonly paddingBottom: DeepPartial<{
|
|
973
973
|
0: string;
|
|
974
|
+
auto: string;
|
|
974
975
|
5: string;
|
|
975
976
|
10: string;
|
|
976
977
|
20: string;
|
|
@@ -1013,10 +1014,10 @@ declare const themedStyleProps: {
|
|
|
1013
1014
|
[-1]: string;
|
|
1014
1015
|
0.5: string;
|
|
1015
1016
|
[-0.5]: string;
|
|
1016
|
-
auto: string;
|
|
1017
1017
|
}>;
|
|
1018
1018
|
readonly paddingLeft: DeepPartial<{
|
|
1019
1019
|
0: string;
|
|
1020
|
+
auto: string;
|
|
1020
1021
|
5: string;
|
|
1021
1022
|
10: string;
|
|
1022
1023
|
20: string;
|
|
@@ -1059,10 +1060,10 @@ declare const themedStyleProps: {
|
|
|
1059
1060
|
[-1]: string;
|
|
1060
1061
|
0.5: string;
|
|
1061
1062
|
[-0.5]: string;
|
|
1062
|
-
auto: string;
|
|
1063
1063
|
}>;
|
|
1064
1064
|
readonly paddingRight: DeepPartial<{
|
|
1065
1065
|
0: string;
|
|
1066
|
+
auto: string;
|
|
1066
1067
|
5: string;
|
|
1067
1068
|
10: string;
|
|
1068
1069
|
20: string;
|
|
@@ -1105,10 +1106,10 @@ declare const themedStyleProps: {
|
|
|
1105
1106
|
[-1]: string;
|
|
1106
1107
|
0.5: string;
|
|
1107
1108
|
[-0.5]: string;
|
|
1108
|
-
auto: string;
|
|
1109
1109
|
}>;
|
|
1110
1110
|
readonly paddingTop: DeepPartial<{
|
|
1111
1111
|
0: string;
|
|
1112
|
+
auto: string;
|
|
1112
1113
|
5: string;
|
|
1113
1114
|
10: string;
|
|
1114
1115
|
20: string;
|
|
@@ -1151,7 +1152,6 @@ declare const themedStyleProps: {
|
|
|
1151
1152
|
[-1]: string;
|
|
1152
1153
|
0.5: string;
|
|
1153
1154
|
[-0.5]: string;
|
|
1154
|
-
auto: string;
|
|
1155
1155
|
}>;
|
|
1156
1156
|
};
|
|
1157
1157
|
declare const stylePropShorthands: {
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { keyframes, Global, ThemeProvider } from '@emotion/react';
|
|
3
3
|
import * as K from '@radix-ui/react-dialog';
|
|
4
|
-
import {
|
|
5
|
-
import * as
|
|
4
|
+
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
5
|
+
import * as po from 'react';
|
|
6
6
|
import { createContext, useContext, useCallback, useState, useRef, useEffect, useLayoutEffect, useMemo, Fragment as Fragment$1 } from 'react';
|
|
7
7
|
import { clsx } from 'clsx';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
8
|
+
import vr from 'known-css-properties';
|
|
9
|
+
import Hr from 'dompurify';
|
|
11
10
|
import { Frigade, FlowType } from '@frigade/js';
|
|
12
11
|
import * as js from '@frigade/js';
|
|
13
12
|
export { js as FrigadeJS };
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import * as he from '@radix-ui/react-collapsible';
|
|
13
|
+
import Fn from 'embla-carousel-react';
|
|
14
|
+
import * as Pe from '@radix-ui/react-collapsible';
|
|
17
15
|
import { useForm, FormProvider, useFormContext, useController } from 'react-hook-form';
|
|
18
|
-
import * as
|
|
19
|
-
import * as
|
|
20
|
-
import * as
|
|
16
|
+
import * as Se from '@radix-ui/react-radio-group';
|
|
17
|
+
import * as A from '@radix-ui/react-select';
|
|
18
|
+
import * as Q from '@radix-ui/react-popover';
|
|
21
19
|
|
|
22
|
-
var Oo=Object.defineProperty,ar=Object.defineProperties;var sr=Object.getOwnPropertyDescriptors;var Le=Object.getOwnPropertySymbols;var Io=Object.prototype.hasOwnProperty,Ho=Object.prototype.propertyIsEnumerable;var Do=(e,o,t)=>o in e?Oo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))Io.call(o,t)&&Do(e,t,o[t]);if(Le)for(var t of Le(o))Ho.call(o,t)&&Do(e,t,o[t]);return e},d=(e,o)=>ar(e,sr(o));var lr=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,o)=>{var t={};for(var r in e)Io.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&Le)for(var r of Le(e))o.indexOf(r)<0&&Ho.call(e,r)&&(t[r]=e[r]);return t};var ee=(e,o)=>{for(var t in o)Oo(e,t,{get:o[t],enumerable:!0});};var W=(e,o,t)=>new Promise((r,n)=>{var i=c=>{try{l(t.next(c));}catch(m){n(m);}},s=c=>{try{l(t.throw(c));}catch(m){n(m);}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);l((t=t.apply(e,o)).next());});var Wo={borderWidths:{md:"1px"}};var $e=[5,10,20,35,50,65,80,95,98],Mo=[...$e],to=[...$e];Mo[4]=40;to[4]=60;var pr={blue:{h:213,s:100,l:$e},gray:{h:220,s:10,l:$e},green:{h:141,s:90,l:Mo},red:{h:9,s:90,l:to},yellow:{h:50,s:90,l:to}};var A={};for(let[e,{h:o,s:t,l:r}]of Object.entries(pr))A[e]=Object.fromEntries(r.map((n,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Ao=d(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},A),{gray100:A.gray[100],gray200:A.gray[200],gray300:A.gray[300],gray400:A.gray[400],gray500:A.gray[500],gray600:A.gray[600],gray700:A.gray[700],gray800:A.gray[800],gray900:A.gray[900],blue400:A.blue[400],blue500:A.blue[500],blue800:A.blue[800],blue900:A.blue[900],green400:A.blue[400],green500:A.green[500],green800:A.green[800],red500:A.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Lo={md:"8px",lg:"20px",round:"50%"};var p=e=>`var(--fr-colors-${e})`,$o={negative:{100:p("red-100"),200:p("red-200"),300:p("red-300"),400:p("red-400"),500:p("red-500"),600:p("red-600"),700:p("red-700"),800:p("red-800"),900:p("red-900"),background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500"),active:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")},focus:{background:p("negative-500"),border:p("negative-500"),foreground:p("white"),surface:p("negative-500")},hover:{background:p("negative-400"),border:p("negative-400"),foreground:p("white"),surface:p("negative-400")}},neutral:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("neutral-800"),foreground:p("black"),surface:p("neutral-700"),active:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},focus:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")},hover:{background:p("white"),border:p("neutral-900"),foreground:p("black"),surface:p("neutral-700")}},positive:{100:p("green-100"),200:p("green-200"),300:p("green-300"),400:p("green-400"),500:p("green-500"),600:p("green-600"),700:p("green-700"),800:p("green-800"),900:p("green-900"),background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500"),active:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")},focus:{background:p("positive-500"),border:p("positive-500"),foreground:p("white"),surface:p("positive-500")},hover:{background:p("positive-400"),border:p("positive-400"),foreground:p("white"),surface:p("positive-400")}},primary:{100:p("blue-100"),200:p("blue-200"),300:p("blue-300"),400:p("blue-400"),500:p("blue-500"),600:p("blue-600"),700:p("blue-700"),800:p("blue-800"),900:p("blue-900"),background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500"),active:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")},focus:{background:p("primary-500"),border:p("primary-500"),foreground:p("white"),surface:p("primary-500")},hover:{background:p("primary-400"),border:p("primary-400"),foreground:p("white"),surface:p("primary-400")}},secondary:{100:p("gray-100"),200:p("gray-200"),300:p("gray-300"),400:p("gray-400"),500:p("gray-500"),600:p("gray-600"),700:p("gray-700"),800:p("gray-800"),900:p("gray-900"),background:p("white"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900"),active:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")},focus:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-900")},hover:{background:p("secondary-900"),border:p("secondary-800"),foreground:p("black"),surface:p("secondary-800")}}};var No={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var dr="px",cr=e=>typeof e=="number"?`${4*e}${dr}`:e,ur=[-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"],Vo=Object.fromEntries(ur.map(e=>[e,cr(e)]));var _o={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 Ne=d(a(d(a({},Wo),{colors:a(a({},Ao),$o)}),_o),{radii:Lo,shadows:No,space:Vo});function ve(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,ve(l,s,t)):r[s]=l,r},{})}function ro(e){let o=ve(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 zo(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]=zo(n,`${o}-${r}`):t[r]=`var(${o}-${i})`;}),t}var no=ro(Ne),v=zo(Ne);var fr=new Set(["alt","size","src"]),gr=mr.all.filter(e=>e.indexOf("-")!=0&&!fr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),yr=Object.fromEntries(gr),Ve=ve(v.colors),xr={color:Ve,backgroundColor:Ve,borderColor:Ve,border:a(a({},v.borderWidths),Ve),borderRadius:v.radii,borderWidth:v.borderWidths,boxShadow:v.shadows,fontFamily:v.fontFamilies,fontSize:v.fontSizes,fontWeight:v.fontWeights,gap:v.space,lineHeight:v.lineHeights,margin:v.space,marginBottom:v.space,marginLeft:v.space,marginRight:v.space,marginTop:v.space,padding:v.space,paddingBottom:v.space,paddingLeft:v.space,paddingRight:v.space,paddingTop:v.space},Ko=a(a({},yr),xr),Uo={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"]},jo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function br(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 Go=new Map(Object.entries(Ko).map(([e,o])=>[e,br(o)])),hr=new Map(Object.entries(Uo).map(([e,o])=>[e,new Set(o)])),Pr=new Set(["height","width"]),Cr=new Set(["canvas","embed","iframe","img","input","object","video"]);function Jo(e){let[o,t]=e.split(":");return [o,jo.has(t)?t:null]}function Xo(e,o="div"){let t=Object.assign({},e),r={};function n(i){if(i==null)return r;let l=`&:${i.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[l]==null&&(r[l]={}),r[l]}return Object.entries(t).forEach(([i,s])=>{let[l,c]=Jo(i),m=hr.get(l);m!=null&&(m.forEach(g=>{let P=`${g}${c?":"+c:""}`;t[P]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[l,c]=Jo(i),m=Go.get(l);if(m!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");n(c)[l]=g.map(P=>{var x;return (x=m.get(P.toString()))!=null?x:P}).join(" ");}else m.has(s.toString())?n(c)[l]=m.get(s.toString()):n(c)[l]=s;(typeof o!="string"||!Cr.has(o)||!Pr.has(l))&&delete t[i];}}),Object.keys(t).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&Go.has(s)&&(t[s]=t[i],delete t[i]);}),{cssFromProps:r,unmatchedProps:t}}function Fr(){if(typeof window=="undefined"){let{JSDOM:e}=lr("jsdom");return new e("<!DOCTYPE html>").window}return window}function qo(e){return e?{__html:Sr(Fr()).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 Tr(e){return e&&`fr-${e}`}function Zo(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>Zo(o)).join(" "):Tr(e))}function vr(l,s){var c=l,{as:e,children:o,className:t,css:r={},part:n}=c,i=f(c,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:g,unmatchedProps:P}=Xo(i,m),x=Zo(n),u=t||x?clsx(t,x):void 0,w=[{boxSizing:"border-box"},g,r];return typeof o=="string"?jsx(m,d(a({className:u,css:w},P),{ref:s,dangerouslySetInnerHTML:qo(o)})):jsx(m,d(a({className:u,css:w},P),{ref:s,children:o}))}var y=lo.forwardRef(vr);var O={};ee(O,{Link:()=>on,Plain:()=>tn,Primary:()=>Zr,Secondary:()=>en});var F={};ee(F,{Body1:()=>zr,Body2:()=>Kr,Caption:()=>Ur,Display1:()=>Ar,Display2:()=>Lr,H1:()=>$r,H2:()=>Nr,H3:()=>Vr,H4:()=>_r});var io={};ee(io,{Body1:()=>Ir,Body2:()=>Hr,Caption:()=>Wr,Display1:()=>Br,Display2:()=>Rr,H1:()=>kr,H2:()=>Er,H3:()=>Dr,H4:()=>Or});var oe={color:"neutral.foreground",fontFamily:"default",margin:"0"},Br=d(a({},oe),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Rr=d(a({},oe),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),kr=d(a({},oe),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Er=d(a({},oe),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Dr=d(a({},oe),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Or=d(a({},oe),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Ir=d(a({},oe),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Hr=d(a({},oe),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),Wr=d(a({},oe),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Mr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],te=Object.fromEntries(Mr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=lo.forwardRef((l,s)=>{var c=l,{as:r=o,children:n}=c,i=f(c,["as","children"]);return jsx(y,d(a(a({as:r},io[e]),i),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Ar=te.Display1,Lr=te.Display2,$r=te.H1,Nr=te.H2,Vr=te.H3,_r=te.H4,zr=te.Body1,Kr=te.Body2,Ur=te.Caption;var so={};ee(so,{Link:()=>qr,Plain:()=>Yr,Primary:()=>Jr,Secondary:()=>Xr,loadingCSSStyle:()=>ao});var _e={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},Jr=d(a({},_e),{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"}),Xr=d(a({},_e),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),qr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Yr=d(a({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Qr=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),ao={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:Qr+" 1s ease infinite"}};function ze(s){var l=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=l,i=f(l,["as","children","part","title","variant"]);var m;let c=n.toLocaleLowerCase();return jsxs(y,d(a(d(a({as:e!=null?e:"button",part:[`button-${c}`,t]},so[n]),{css:a(a({},(m=i.css)!=null?m:{}),i.loading?ao:{})}),i),{loading:void 0,children:[o,r&&jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function Zr(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(ze,d(a({},o),{variant:"Primary",children:e}))}function en(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(ze,d(a({},o),{variant:"Secondary",children:e}))}function on(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(ze,d(a({},o),{variant:"Link",children:e}))}function tn(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(ze,d(a({},o),{variant:"Plain",children:e}))}var C={};ee(C,{Column:()=>an,Row:()=>nn});var nn=lo.forwardRef((e,o)=>jsx(y,d(a({display:"flex",flexDirection:"row"},e),{ref:o}))),an=lo.forwardRef((e,o)=>jsx(y,d(a({display:"flex",flexDirection:"column"},e),{ref:o})));function po(n){var i=n,{dismissible:e,flowId:o,part:t}=i,r=f(i,["dismissible","flowId","part"]);return jsx(U,d(a({as:null,flowId:o},r),{children:({handleDismiss:s,handlePrimary:l,handleSecondary:c,parentProps:{containerProps:m},step:g})=>{var S,B,E,T,k;let P=(S=g.props)!=null?S:{},x=(E=(B=g.primaryButton)==null?void 0:B.title)!=null?E:g.primaryButtonTitle,u=(k=(T=g.secondaryButton)==null?void 0:T.title)!=null?k:g.secondaryButtonTitle,w=g.$state.blocked;return jsxs(h,d(a(a({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},m),P),{children:[g.imageUri&&jsx(y,{as:"img",part:"image",src:g.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(C.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(h.Title,{part:"title",children:g.title}),jsx(h.Subtitle,{part:"subtitle",children:g.subtitle})]}),jsx(h.Secondary,{disabled:w,title:u,onClick:c}),jsx(h.Primary,{disabled:w,title:x,onClick:l}),e&&jsx(h.Dismiss,{onClick:s})]}))}}))}var je={};ee(je,{Carousel:()=>ft,Collapsible:()=>Ue,CollapsibleStep:()=>Ee});var Re={};ee(Re,{Bar:()=>xe,Dots:()=>it,Segments:()=>st});function xe(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=o>0?Math.min(e/o,1):0,s=i===0?"10px":`${100*i}%`;return jsx(y,d(a({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function it(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,l)=>jsx(y,{as:"circle",r:4,cx:4+16*l,cy:"4px",fill:e-1===l?v.colors.blue500:v.colors.blue800},l));return jsx(y,d(a({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function st(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let i=[...Array(o)].map((s,l)=>jsx(y,{backgroundColor:e-1===l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},l));return jsx(C.Row,d(a({gap:1,height:"10px",part:"progress-segments"},t),{children:i}))}function sn(){return jsx(y,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function lt(t){var r=t,{checked:e=!1}=r,o=f(r,["checked"]);return jsx(y,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&&jsx(y,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(sn,{})})}))}function re(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(I),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.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((i,s,l=!0)=>W(this,null,function*(){if((yield o==null?void 0:o(e,i,s))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let m=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof m=="function"?m():m!==!1&&(yield e.complete(s,l)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,l),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((i,s)=>W(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 dt({onPrimary:e,onSecondary:o,step:t}){var m,g;let{handlePrimary:r,handleSecondary:n}=re(t,{onPrimary:e,onSecondary:o}),{blocked:i,completed:s,skipped:l}=t.$state,c=s||l||!i?jsx(lt,{checked:s||l,marginLeft:"auto"}):jsx(y,{as:LockClosedIcon,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(h,{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:[jsxs(C.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(h.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),c]}),jsx(h.Title,{children:t.title}),jsx(h.Subtitle,{children:t.subtitle}),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:[jsx(h.Secondary,{disabled:i,onClick:n,title:(m=t.secondaryButton)==null?void 0:m.title}),jsx(h.Primary,{disabled:i,onClick:r,title:(g=t.primaryButton)==null?void 0:g.title})]})]})}var ct=keyframes`
|
|
20
|
+
var Io=Object.defineProperty,hr=Object.defineProperties;var br=Object.getOwnPropertyDescriptors;var Ve=Object.getOwnPropertySymbols;var Ho=Object.prototype.hasOwnProperty,Mo=Object.prototype.propertyIsEnumerable;var Oo=(e,o,t)=>o in e?Io(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))Ho.call(o,t)&&Oo(e,t,o[t]);if(Ve)for(var t of Ve(o))Mo.call(o,t)&&Oo(e,t,o[t]);return e},p=(e,o)=>hr(e,br(o));var Pr=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,o)=>{var t={};for(var r in e)Ho.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&Ve)for(var r of Ve(e))o.indexOf(r)<0&&Mo.call(e,r)&&(t[r]=e[r]);return t};var ee=(e,o)=>{for(var t in o)Io(e,t,{get:o[t],enumerable:!0});};var M=(e,o,t)=>new Promise((r,n)=>{var a=c=>{try{l(t.next(c));}catch(m){n(m);}},s=c=>{try{l(t.throw(c));}catch(m){n(m);}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(a,s);l((t=t.apply(e,o)).next());});function xe(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"})}))}var Lo={borderWidths:{md:"1px"}};var $e=[5,10,20,35,50,65,80,95,98],Ao=[...$e],ro=[...$e];Ao[4]=40;ro[4]=60;var Cr={blue:{h:213,s:100,l:$e},gray:{h:220,s:10,l:$e},green:{h:141,s:90,l:Ao},red:{h:9,s:90,l:ro},yellow:{h:50,s:90,l:ro}};var L={};for(let[e,{h:o,s:t,l:r}]of Object.entries(Cr))L[e]=Object.fromEntries(r.map((n,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var Vo=p(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},L),{gray100:L.gray[100],gray200:L.gray[200],gray300:L.gray[300],gray400:L.gray[400],gray500:L.gray[500],gray600:L.gray[600],gray700:L.gray[700],gray800:L.gray[800],gray900:L.gray[900],blue400:L.blue[400],blue500:L.blue[500],blue800:L.blue[800],blue900:L.blue[900],green400:L.blue[400],green500:L.green[500],green800:L.green[800],red500:L.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var $o={md:"8px",lg:"20px",round:"50%"};var d=e=>`var(--fr-colors-${e})`,No={negative:{100:d("red-100"),200:d("red-200"),300:d("red-300"),400:d("red-400"),500:d("red-500"),600:d("red-600"),700:d("red-700"),800:d("red-800"),900:d("red-900"),background:d("negative-500"),border:d("negative-500"),foreground:d("white"),surface:d("negative-500"),active:{background:d("negative-400"),border:d("negative-400"),foreground:d("white"),surface:d("negative-400")},focus:{background:d("negative-500"),border:d("negative-500"),foreground:d("white"),surface:d("negative-500")},hover:{background:d("negative-400"),border:d("negative-400"),foreground:d("white"),surface:d("negative-400")}},neutral:{100:d("gray-100"),200:d("gray-200"),300:d("gray-300"),400:d("gray-400"),500:d("gray-500"),600:d("gray-600"),700:d("gray-700"),800:d("gray-800"),900:d("gray-900"),background:d("white"),border:d("neutral-800"),foreground:d("black"),surface:d("neutral-700"),active:{background:d("white"),border:d("neutral-900"),foreground:d("black"),surface:d("neutral-700")},focus:{background:d("white"),border:d("neutral-900"),foreground:d("black"),surface:d("neutral-700")},hover:{background:d("white"),border:d("neutral-900"),foreground:d("black"),surface:d("neutral-700")}},positive:{100:d("green-100"),200:d("green-200"),300:d("green-300"),400:d("green-400"),500:d("green-500"),600:d("green-600"),700:d("green-700"),800:d("green-800"),900:d("green-900"),background:d("positive-500"),border:d("positive-500"),foreground:d("white"),surface:d("positive-500"),active:{background:d("positive-400"),border:d("positive-400"),foreground:d("white"),surface:d("positive-400")},focus:{background:d("positive-500"),border:d("positive-500"),foreground:d("white"),surface:d("positive-500")},hover:{background:d("positive-400"),border:d("positive-400"),foreground:d("white"),surface:d("positive-400")}},primary:{100:d("blue-100"),200:d("blue-200"),300:d("blue-300"),400:d("blue-400"),500:d("blue-500"),600:d("blue-600"),700:d("blue-700"),800:d("blue-800"),900:d("blue-900"),background:d("primary-500"),border:d("primary-500"),foreground:d("white"),surface:d("primary-500"),active:{background:d("primary-400"),border:d("primary-400"),foreground:d("white"),surface:d("primary-400")},focus:{background:d("primary-500"),border:d("primary-500"),foreground:d("white"),surface:d("primary-500")},hover:{background:d("primary-400"),border:d("primary-400"),foreground:d("white"),surface:d("primary-400")}},secondary:{100:d("gray-100"),200:d("gray-200"),300:d("gray-300"),400:d("gray-400"),500:d("gray-500"),600:d("gray-600"),700:d("gray-700"),800:d("gray-800"),900:d("gray-900"),background:d("white"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-900"),active:{background:d("secondary-900"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-800")},focus:{background:d("secondary-900"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-900")},hover:{background:d("secondary-900"),border:d("secondary-800"),foreground:d("black"),surface:d("secondary-800")}}};var zo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Sr="px",wr=e=>typeof e=="number"?`${4*e}${Sr}`:e,Fr=[-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"],_o=Object.fromEntries(Fr.map(e=>[e,wr(e)]));var Go={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 Ne=p(i(p(i({},Lo),{colors:i(i({},Vo),No)}),Go),{radii:$o,shadows:zo,space:_o});function Be(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,l=e[n];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(r,Be(l,s,t)):r[s]=l,r},{})}function no(e){let o=Be(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 Ko(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r],a=r.replace(/\./g,"-");typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=Ko(n,`${o}-${r}`):t[r]=`var(${o}-${a})`;}),t}var io=no(Ne),T=Ko(Ne);var Tr=new Set(["alt","size","src"]),Br=vr.all.filter(e=>e.indexOf("-")!=0&&!Tr.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Rr=Object.fromEntries(Br),ze=Be(T.colors),kr={color:ze,backgroundColor:ze,borderColor:ze,border:i(i({},T.borderWidths),ze),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},Uo=i(i({},Rr),kr),jo={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"]},Jo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Er(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 Xo=new Map(Object.entries(Uo).map(([e,o])=>[e,Er(o)])),Dr=new Map(Object.entries(jo).map(([e,o])=>[e,new Set(o)])),Or=new Set(["height","width"]),Ir=new Set(["canvas","embed","iframe","img","input","object","video"]);function qo(e){let[o,t]=e.split(":");return [o,Jo.has(t)?t:null]}function Zo(e,o="div"){let t=Object.assign({},e),r={};function n(a){if(a==null)return r;let l=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[l]==null&&(r[l]={}),r[l]}return Object.entries(t).forEach(([a,s])=>{let[l,c]=qo(a),m=Dr.get(l);m!=null&&(m.forEach(g=>{let P=`${g}${c?":"+c:""}`;t[P]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[l,c]=qo(a),m=Xo.get(l);if(m!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");n(c)[l]=g.map(P=>{var x;return (x=m.get(P.toString()))!=null?x:P}).join(" ");}else m.has(s.toString())?n(c)[l]=m.get(s.toString()):n(c)[l]=s;(typeof o!="string"||!Ir.has(o)||!Or.has(l))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&Xo.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:r,unmatchedProps:t}}function Mr(){if(typeof window=="undefined"){let{JSDOM:e}=Pr("jsdom");return new e("<!DOCTYPE html>").window}return window}function Yo(e){return e?{__html:Hr(Mr()).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 Lr(e){return e&&`fr-${e}`}function ot(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>ot(o)).join(" "):Lr(e))}function Ar(l,s){var c=l,{as:e,children:o,className:t,css:r={},part:n}=c,a=f(c,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:g,unmatchedProps:P}=Zo(a,m),x=ot(n),u=t||x?clsx(t,x):void 0,F=[{boxSizing:"border-box"},g,r];return typeof o=="string"?jsx(m,p(i({className:u,css:F},P),{ref:s,dangerouslySetInnerHTML:Yo(o)})):jsx(m,p(i({className:u,css:F},P),{ref:s,children:o}))}var y=po.forwardRef(Ar);var O={};ee(O,{Link:()=>fn,Plain:()=>gn,Primary:()=>un,Secondary:()=>mn});var w={};ee(w,{Body1:()=>on,Body2:()=>tn,Caption:()=>rn,Display1:()=>Xr,Display2:()=>qr,H1:()=>Zr,H2:()=>Yr,H3:()=>Qr,H4:()=>en});var ao={};ee(ao,{Body1:()=>Kr,Body2:()=>Ur,Caption:()=>jr,Display1:()=>Vr,Display2:()=>$r,H1:()=>Nr,H2:()=>zr,H3:()=>_r,H4:()=>Gr});var oe={color:"neutral.foreground",fontFamily:"default",margin:"0"},Vr=p(i({},oe),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),$r=p(i({},oe),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Nr=p(i({},oe),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),zr=p(i({},oe),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),_r=p(i({},oe),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Gr=p(i({},oe),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Kr=p(i({},oe),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Ur=p(i({},oe),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),jr=p(i({},oe),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var Jr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],te=Object.fromEntries(Jr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=po.forwardRef((l,s)=>{var c=l,{as:r=o,children:n}=c,a=f(c,["as","children"]);return jsx(y,p(i(i({as:r},ao[e]),a),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),Xr=te.Display1,qr=te.Display2,Zr=te.H1,Yr=te.H2,Qr=te.H3,en=te.H4,on=te.Body1,tn=te.Body2,rn=te.Caption;var lo={};ee(lo,{Link:()=>pn,Plain:()=>dn,Primary:()=>sn,Secondary:()=>ln,loadingCSSStyle:()=>so});var _e={borderWidth:"md",borderRadius:"md",borderStyle:"solid","cursor:disabled":"not-allowed",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},sn=p(i({},_e),{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"}),ln=p(i({},_e),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.6"}),pn=p(i({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),dn=p(i({},_e),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),cn=keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),so={position:"relative",color:"transparent","&:after":{content:'""',position:"absolute",width:"16px",height:"16px",top:0,left:0,right:0,bottom:0,margin:"auto",border:"4px solid transparent",borderTopColor:"var(--fr-colors-primary-foreground)",borderRadius:"50%",animation:cn+" 1s ease infinite"}};function Ge(s){var l=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=l,a=f(l,["as","children","part","title","variant"]);var m;let c=n.toLocaleLowerCase();return jsxs(y,p(i(p(i({as:e!=null?e:"button",part:[`button-${c}`,t]},lo[n]),{css:i(i({},(m=a.css)!=null?m:{}),a.loading?so:{})}),a),{loading:void 0,children:[o,r&&jsx(w.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:r})]}))}function un(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(Ge,p(i({},o),{variant:"Primary",children:e}))}function mn(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(Ge,p(i({},o),{variant:"Secondary",children:e}))}function fn(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(Ge,p(i({},o),{variant:"Link",children:e}))}function gn(t){var r=t,{children:e}=r,o=f(r,["children"]);return jsx(Ge,p(i({},o),{variant:"Plain",children:e}))}var C={};ee(C,{Column:()=>hn,Row:()=>xn});var xn=po.forwardRef((e,o)=>jsx(y,p(i({display:"flex",flexDirection:"row"},e),{ref:o}))),hn=po.forwardRef((e,o)=>jsx(y,p(i({display:"flex",flexDirection:"column"},e),{ref:o})));function co(n){var a=n,{dismissible:e,flowId:o,part:t}=a,r=f(a,["dismissible","flowId","part"]);return jsx(U,p(i({as:null,flowId:o},r),{children:({handleDismiss:s,handlePrimary:l,handleSecondary:c,parentProps:{containerProps:m},step:g})=>{var S,B,E,v,k;let P=(S=g.props)!=null?S:{},x=(E=(B=g.primaryButton)==null?void 0:B.title)!=null?E:g.primaryButtonTitle,u=(k=(v=g.secondaryButton)==null?void 0:v.title)!=null?k:g.secondaryButtonTitle,F=g.$state.blocked;return jsxs(b,p(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},m),P),{children:[g.imageUri&&jsx(y,{as:"img",part:"image",src:g.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(C.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(b.Title,{part:"title",children:g.title}),jsx(b.Subtitle,{part:"subtitle",children:g.subtitle})]}),jsx(b.Secondary,{disabled:F,title:u,onClick:c}),jsx(b.Primary,{disabled:F,title:x,onClick:l}),e&&jsx(b.Dismiss,{onClick:s})]}))}}))}var je={};ee(je,{Carousel:()=>St,Collapsible:()=>Ue,CollapsibleStep:()=>De});var ke={};ee(ke,{Bar:()=>he,Dots:()=>st,Segments:()=>pt});function he(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsx(y,p(i({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function st(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,l)=>jsx(y,{as:"circle",r:4,cx:4+16*l,cy:"4px",fill:e-1===l?T.colors.blue500:T.colors.blue800},l));return jsx(y,p(i({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:a}))}function pt(r){var n=r,{current:e,total:o}=n,t=f(n,["current","total"]);let a=[...Array(o)].map((s,l)=>jsx(y,{backgroundColor:e-1===l?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},l));return jsx(C.Row,p(i({gap:1,height:"10px",part:"progress-segments"},t),{children:a}))}function ct(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",className:"size-4"},e),{children:jsx("path",{fillRule:"evenodd",d:"M8 1a3.5 3.5 0 0 0-3.5 3.5V7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7V4.5A3.5 3.5 0 0 0 8 1Zm2 6V4.5a2 2 0 1 0-4 0V7h4Z",clipRule:"evenodd"})}))}function bn(){return jsx(y,{as:"svg",color:"primary.foreground",fill:"none",height:"8px",part:"check-icon",viewBox:"0 0 10 8",width:"10px",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ut(t){var r=t,{checked:e=!1}=r,o=f(r,["checked"]);return jsx(y,p(i({backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"check-indicator",position:"relative",height:"22px",width:"22px"},o),{children:e&&jsx(y,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"check-indicator-checked",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(bn,{})})}))}function re(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(I),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.skip":()=>e.skip(),"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:useCallback((a,s,l=!0)=>M(this,null,function*(){if((yield o==null?void 0:o(e,a,s))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let m=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof m=="function"?m():m!==!1&&(yield e.complete(s,l)),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,l),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,s)=>M(this,null,function*(){if((yield t==null?void 0:t(e,a,s))===!1)return a.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:n[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&r(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&r(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}function ft({onPrimary:e,onSecondary:o,step:t}){var m,g;let{handlePrimary:r,handleSecondary:n}=re(t,{onPrimary:e,onSecondary:o}),{blocked:a,completed:s,skipped:l}=t.$state,c=s||l||!a?jsx(ut,{checked:s||l,marginLeft:"auto"}):jsx(y,{as:ct,height:"22px",marginLeft:"auto",width:"22px"});return jsxs(b,{borderWidth:1,containerType:"inline-size",css:{"@container (max-width: 600px)":{flexBasis:"85%"},"@container (min-width: 601px) and (max-width: 900px)":{flexBasis:"45%"},"@container (min-width: 1200px)":{flexBasis:"25%"}},flex:"0 0 30%",gap:"2",p:"4",part:"carousel-step",userSelect:"none",disabled:a,opacity:a?.5:1,children:[jsxs(C.Row,{marginBottom:"2",part:"carousel-step-header",children:[t.iconUri&&jsx(b.Media,{borderRadius:"0",height:"24px",src:t.iconUri,width:"24px"}),c]}),jsx(b.Title,{children:t.title}),jsx(b.Subtitle,{children:t.subtitle}),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:[jsx(b.Secondary,{disabled:a,onClick:n,title:(m=t.secondaryButton)==null?void 0:m.title}),jsx(b.Primary,{disabled:a,onClick:r,title:(g=t.primaryButton)==null?void 0:g.title})]})]})}function yt(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M3 10a.75.75 0 0 1 .75-.75h10.638L10.23 5.29a.75.75 0 1 1 1.04-1.08l5.5 5.25a.75.75 0 0 1 0 1.08l-5.5 5.25a.75.75 0 1 1-1.04-1.08l4.158-3.96H3.75A.75.75 0 0 1 3 10Z",clipRule:"evenodd"})}))}function ht(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M17 10a.75.75 0 0 1-.75.75H5.612l4.158 3.96a.75.75 0 1 1-1.04 1.08l-5.5-5.25a.75.75 0 0 1 0-1.08l5.5-5.25a.75.75 0 1 1 1.04 1.08L5.612 9.25H16.25A.75.75 0 0 1 17 10Z",clipRule:"evenodd"})}))}var bt=keyframes`
|
|
23
21
|
from {
|
|
24
22
|
opacity: 0;
|
|
25
23
|
}
|
|
26
24
|
to {
|
|
27
25
|
opacity: 1;
|
|
28
26
|
}
|
|
29
|
-
`;function
|
|
27
|
+
`;function Pt({flow:e,sort:o,parentProps:{containerProps:t}}){var B,E;let[r,n]=useState(),[a]=useState({align:"start",container:".fr-carousel-content",skipSnaps:!0,slides:".fr-carousel-step",startIndex:o=="completed-last"?0:(E=(B=Array.from(e.steps.values()).find(v=>!v.$state.completed&&!v.$state.skipped))==null?void 0:B.order)!=null?E:0}),[s,l]=Fn(a),[c,m]=useState(),[g,P]=useState();useLayoutEffect(()=>{l&&(c==null&&m(l.canScrollNext()),g==null&&P(l.canScrollPrev()),l.on("select",()=>{m(l.canScrollNext()),P(l.canScrollPrev());}));},[l]),useEffect(()=>{if(!r){let v=Array.from(e.steps.values()),k=v.filter(h=>h.$state.completed||h.$state.skipped).sort((h,R)=>h.order-R.order),H=v.filter(h=>!h.$state.completed&&!h.$state.skipped).sort((h,R)=>h.order-R.order);n(o==="completed-last"?[...H,...k].map(h=>h.id):v.map(h=>h.id));}},[]);let x=e.getNumberOfCompletedSteps(),u=e.getNumberOfAvailableSteps(),{onPrimary:F,onSecondary:S}=t;return r?jsxs(Fragment,{children:[jsxs(C.Row,{css:{"@container (max-width: 750px)":{flexDirection:"column",gap:T.space[5]}},justifyContent:"space-between",part:"carousel-header",children:[jsxs(C.Column,{part:"carousel-header-content",children:[jsx(w.H3,{children:e.title}),jsx(w.Body2,{color:"neutral.400",children:e.subtitle})]}),jsxs(C.Row,{alignItems:"center",gap:2,part:"progress",children:[jsxs(w.Body2,{fontWeight:"demibold",part:"progress-text",children:[x,"/",u]}),jsx(he,{current:x,total:u,minWidth:"200px"})]})]}),jsxs(y,{margin:`0 ${T.space[-4]}`,overflow:"hidden",part:"carousel-wrapper",px:"4",position:"relative",ref:s,children:[jsx(C.Row,{gap:4,part:"carousel-content",children:Array.from(e.steps.values()).sort((v,k)=>r.indexOf(v.id)-r.indexOf(k.id)).map(v=>jsx(ft,{onPrimary:F,onSecondary:S,step:v},v.id))}),g&&jsx(C.Column,{animation:`${bt} 300ms ease-out`,background:"linear-gradient(to right, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",left:"0",justifyContent:"center",paddingLeft:"3",part:"carousel-prev-wrapper",position:"absolute",top:"0",children:jsx(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>l.scrollPrev(),padding:"2",children:jsx(ht,{height:"24px",width:"24px"})})}),c&&jsx(C.Column,{animation:`${bt} 300ms ease-out`,background:"linear-gradient(to left, rgba(255, 255, 255, 0.5), transparent 50%)",bottom:"0",justifyContent:"center",paddingRight:"3",part:"carousel-next-wrapper",position:"absolute",right:"0",top:"0",children:jsx(O.Plain,{border:"1px solid neutral.border",borderRadius:"100%",boxShadow:"md",backgroundColor:"neutral.background",color:"primary.surface",onClick:()=>l.scrollNext(),padding:"2",children:jsx(yt,{height:"24px",width:"24px"})})})]})]}):null}function St(o){var e=f(o,[]);return jsx(U,p(i({as:b,borderWidth:1,containerType:"inline-size",p:"4",part:"carousel"},e),{children:t=>jsx(Pt,i(i({},e),t))}))}var De={};ee(De,{Content:()=>fo,Root:()=>go,Trigger:()=>yo});function Ft(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"size-6"},e),{children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})}))}var Tn=keyframes`
|
|
30
28
|
from {
|
|
31
29
|
height: 0;
|
|
32
30
|
opacity: 0;
|
|
@@ -35,7 +33,7 @@ var Oo=Object.defineProperty,ar=Object.defineProperties;var sr=Object.getOwnProp
|
|
|
35
33
|
height: var(--radix-collapsible-content-height);
|
|
36
34
|
opacity: 1;
|
|
37
35
|
}
|
|
38
|
-
`,
|
|
36
|
+
`,Bn=keyframes`
|
|
39
37
|
from {
|
|
40
38
|
height: var(--radix-collapsible-content-height);
|
|
41
39
|
opacity: 1;
|
|
@@ -44,7 +42,7 @@ var Oo=Object.defineProperty,ar=Object.defineProperties;var sr=Object.getOwnProp
|
|
|
44
42
|
height: 0;
|
|
45
43
|
opacity: 0;
|
|
46
44
|
}
|
|
47
|
-
`,Pn=()=>jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Cn({checked:e=!1}){return jsx(y,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsx(y,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Pn,{})})})}function mo({children:e}){return jsx(he.Content,{asChild:!0,children:jsxs(C.Column,{css:{'&[data-state="open"]':{animation:`${bn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${hn} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(y,{}),e]})})}function fo(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=f(s,["children","disabled","onOpenChange","open"]);return jsx(he.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsx(h,d(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},n),{children:e}))})}function go({isCompleted:e,isBlocked:o,title:t}){return jsx(he.Trigger,{asChild:!0,children: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",part:"collapsible-header",children:[jsxs(C.Row,{alignItems:"center",gap:2,children:[jsx(Cn,{checked:e}),jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(y,{as:ChevronDownIcon,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var yt=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function xt({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var w,S,B,E,T,k;let{$state:{blocked:i,completed:s,skipped:l},subtitle:c,title:m}=n,g=(S=(w=n.primaryButton)==null?void 0:w.title)!=null?S:n.primaryButtonTitle,P=(E=(B=n.secondaryButton)==null?void 0:B.title)!=null?E:n.secondaryButtonTitle,x=(T=n.props)!=null?T:{},u=!!i;return jsxs(fo,d(a({open:t,onOpenChange:r},x),{children:[jsx(go,{isBlocked:n.$state.blocked,isCompleted:s||l,title:m}),jsxs(mo,{children:[jsx(h.Media,{aspectRatio:2.5,objectFit:"cover",src:(k=n.videoUri)!=null?k:n.imageUri,type:n.videoUri?"video":"image"}),jsx(h.Subtitle,{color:"neutral.400",children:c}),jsxs(C.Row,{gap:3,part:"collapsible-footer",children:[jsx(h.Secondary,{title:P,onClick:o}),jsx(h.Primary,{disabled:u,title:g,onClick:e})]})]})]}))}var Tn={default:xt};function vn(r){var n=r,{flow:e,step:o}=n,t=f(n,["flow","step"]);var S;let{onPrimary:i,onSecondary:s,openStepId:l,setOpenStepId:c,stepTypes:m}=useContext(yt),{handlePrimary:g,handleSecondary:P}=re(o,{onPrimary:i,onSecondary:s}),x=(l!=null?l:e.getCurrentStep().id)===o.id,u=(S=m[o.type])!=null?S:xt;function w(B){return W(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsx(u,d(a({flow:e,onOpenChange:w,open:x,step:o},t),{handlePrimary:g,handleSecondary:P}),o.id)}function Ue(l){var c=l,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,part:n,stepTypes:i={}}=c,s=f(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[m,g]=useState(null),P=a(a({},Tn),i);return jsx(yt.Provider,{value:{openStepId:m,setOpenStepId:g,onPrimary:t,onSecondary:r,stepTypes:P},children:jsx(U,d(a({as:h,borderWidth:"md",flowId:o,part:["checklist",n]},s),{children:S=>{var B=S,{flow:x,handleDismiss:u}=B,w=f(B,["flow","handleDismiss"]);let T=Array.from(x.steps.entries()).filter(([,b])=>b.$state.visible===!0).map(([,b])=>jsx(vn,d(a({flow:x,handleDismiss:u},w),{step:b}),b.id)),k=x.getNumberOfCompletedSteps(),H=x.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(C.Column,{gap:2,children:[jsx(h.Header,{dismissible:e,handleDismiss:u,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxs(F.Body2,{fontWeight:"demibold",children:[k,"/",H]}),jsx(xe,{current:k,total:H,flexGrow:1})]})]}),T]})}}))})}var Hn=new Set(["required","min","max","minLength","maxLength","pattern"]);function Wn({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let i=Object.fromEntries(Object.entries(t).filter(([l])=>Hn.has(l))),s=useController({name:t.id,control:o,rules:i});return jsx(e,d(a({},s),{fieldData:t,formContext:n,submit:r}))}function ht({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:i}){var T,k,H,b,R,D;let{__readOnly:s}=useContext(I),l=useForm({delayError:2e3,mode:"onChange"}),[c,m]=useState(!1),g=[],{control:P,handleSubmit:x}=l,u=(T=i.props)!=null?T:{};function w(V,Se){m(!0),t(Se,V,s===!0).then(()=>m(!1));}(k=i.fields)==null||k.forEach(V=>{e[V.type]!=null&&g.push(jsx(Wn,{control:P,fieldComponent:e[V.type],fieldData:V,submit:x(w)},`${i.flow.id}-${V.id}`));});let S=(b=(H=i.primaryButton)==null?void 0:H.title)!=null?b:i.primaryButtonTitle,B=(D=(R=i.secondaryButton)==null?void 0:R.title)!=null?D:i.secondaryButtonTitle,E=!!(i.$state.blocked||!l.formState.isValid);return jsxs(C.Column,d(a({gap:5,part:"form-step"},u),{children:[jsx(h.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsx(FormProvider,d(a({},l),{children:g})),jsxs(C.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsx(O.Secondary,{onClick:r,title:B}),jsx(O.Primary,{disabled:E||c,onClick:x(w),title:S!=null?S:"Submit",loading:c})]},"form-footer")]}))}function Pt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function yo({children:e,id:o,required:t=!1}){return jsxs(F.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(y,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var De={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function ne({children:e,field:o,fieldData:t,fieldState:r}){var m;let{id:n,label:i,placeholder:s}=t,{error:l}=r,c=d(a(a(a({id:n},o),s?{placeholder:s}:{}),De),{"aria-invalid":!!l,value:(m=o.value)!=null?m:""});return jsxs(y,{part:"field",children:[jsx(yo,{id:n,required:!!t.required,children:i}),e(c),jsx(Pt,{error:l})]})}var Nn=()=>jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Vn=lo.forwardRef(({label:e,value:o},t)=>jsxs(y,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsx(F.Body2,{part:"field-radio-label",children:e}),jsx(Ce.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(y,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(y,{as:Ce.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Nn,{})})})})]}));function xo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:i,value:s})=>jsx(Vn,{value:s,label:i},s));return jsx(ne,d(a({},e),{children:()=>jsx(Ce.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(C.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Kn=lo.forwardRef(({label:e,value:o},t)=>jsx(N.Item,{value:o,ref:t,asChild:!0,children:jsx(y,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(N.ItemText,{asChild:!0,children:jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function bo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,i=r.map(({label:s,value:l})=>jsx(Kn,{value:l,label:s},l));return jsx(ne,d(a({},e),{children:()=>jsxs(N.Root,{value:t,onValueChange:o,children:[jsx(N.Trigger,{asChild:!0,children:jsxs(F.Body2,d(a({},De),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(N.Value,{placeholder:n!=null?n:"Select one"}),jsx(N.Icon,{children:jsx(y,{as:ChevronDownIcon,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(N.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(y,d(a({},De),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsx(N.Viewport,{children:i})}))})]})}))}function ho(e){return jsx(ne,d(a({},e),{children:o=>jsx(F.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function Po(e){return jsx(ne,d(a({},e),{children:o=>jsx(F.Body2,a({as:"textarea",part:"field-textarea"},o))}))}var Un={radio:xo,select:bo,text:ho,textarea:Po};function Oe(n){var i=n,{fieldTypes:e={},flowId:o,part:t}=i,r=f(i,["fieldTypes","flowId","part"]);let s=Object.assign({},Un,e);return jsx(U,d(a({flowId:o,part:["form",t]},r),{children:l=>jsx(ht,a({fieldTypes:s},l))}))}var Xe={};ee(Xe,{NPS:()=>Je});function Et({field:e,fieldData:o,submit:t}){var n,i;let r=[...Array(11)].map((s,l)=>{let c=e.value===l?O.Primary:O.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(l),t();},title:`${l}`,css:{".fr-button-title":{fontSize:"15px"}}},l)});return jsxs(C.Column,{gap:2,children:[jsx(C.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:r}),jsxs(C.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(n=o.negativeLabel)!=null?n:"Not likely at all"}),jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(i=o.positiveLabel)!=null?i:"Extremely likely"})]})]})}function Je(i){var s=i,{as:e=M,flowId:o,fieldTypes:t,part:r}=s,n=f(s,["as","flowId","fieldTypes","part"]);let{flow:l}=ie(o);return jsx(Oe,a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:Et},t),modal:!1,onEscapeKeyDown:c=>{typeof n.onEscapeKeyDown=="function"&&n.onEscapeKeyDown(c),c.defaultPrevented||l.skip();},part:["nps",r],css:d(a({},!l||l.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},n))}function fe(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&W(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(n=>W(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function qe(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=useState(e),[r,n]=useState(null),i=useCallback(s=>{n(s);},[]);return useLayoutEffect(()=>{if(!r)return;let s=()=>{let l=r.getBoundingClientRect();t(l);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:i}}var Zn=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function It(r){var n=r,{style:e={},part:o=""}=n,t=f(n,["style","part"]);return jsxs(y,d(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Zn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Ye(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);return jsx(y,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function ti(e){var o,t,r,n,i;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(i=e.split("loom.com/share/")[1])==null?void 0:i.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Qe(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);let i=ti(o);return i?jsx(y,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")?jsx(y,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 le(r){var n=r,{src:e,type:o}=n,t=f(n,["src","type"]);return jsx(o==="video"?Qe:Ye,a({src:e},t))}function Wt({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},i=()=>{var m;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (m=e.align)!=null?m:"after"},s="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[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 Ze={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Mt(e,o){var i,s,l,c,m;let t=Object.fromEntries(Ze.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r=Object.fromEntries(Ze.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n={};for(let g of Object.keys(e))!Ze.content.includes(g)&&!Ze.root.includes(g)&&(n[g]=e[g]);if(t.align=(i=t.align)!=null?i:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let g={after:"end",before:"start"},P=(E,T)=>["top","bottom"].includes(T)?E=="after"?"marginLeft":"marginRight":E=="after"?"marginTop":"marginBottom",x=(l=t.alignOffset)!=null?l:0,u=(c=t.style)!=null?c:{},w=(m=t.side)!=null?m:"bottom",S=t.align;t.style=d(a({},u),{[P(S,w)]:x});let B=["top","bottom"].includes(w)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=g[S];}return {contentProps:t,otherProps:n,rootProps:r}}var At=keyframes`
|
|
45
|
+
`,Rn=()=>jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function kn({checked:e=!1}){return jsx(y,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsx(y,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Rn,{})})})}function fo({children:e}){return jsx(Pe.Content,{asChild:!0,children:jsxs(C.Column,{css:{'&[data-state="open"]':{animation:`${Tn} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Bn} 300ms ease-out`},overflow:"hidden"},gap:5,part:"collapsible-content",children:[jsx(y,{}),e]})})}function go(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=f(s,["children","disabled","onOpenChange","open"]);return jsx(Pe.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsx(b,p(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0,part:"collapsible-step"},n),{children:e}))})}function yo({isCompleted:e,isBlocked:o,title:t}){return jsx(Pe.Trigger,{asChild:!0,children: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",part:"collapsible-header",children:[jsxs(C.Row,{alignItems:"center",gap:2,children:[jsx(kn,{checked:e}),jsx(w.Body2,{fontWeight:"demibold",userSelect:"none",part:"collapsible-title",children:t})]}),jsx(y,{as:Ft,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Tt=createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Bt({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var F,S,B,E,v,k;let{$state:{blocked:a,completed:s,skipped:l},subtitle:c,title:m}=n,g=(S=(F=n.primaryButton)==null?void 0:F.title)!=null?S:n.primaryButtonTitle,P=(E=(B=n.secondaryButton)==null?void 0:B.title)!=null?E:n.secondaryButtonTitle,x=(v=n.props)!=null?v:{},u=!!a;return jsxs(go,p(i({open:t,onOpenChange:r},x),{children:[jsx(yo,{isBlocked:n.$state.blocked,isCompleted:s||l,title:m}),jsxs(fo,{children:[jsx(b.Media,{aspectRatio:2.5,objectFit:"cover",src:(k=n.videoUri)!=null?k:n.imageUri,type:n.videoUri?"video":"image"}),jsx(b.Subtitle,{color:"neutral.400",children:c}),jsxs(C.Row,{gap:3,part:"collapsible-footer",children:[jsx(b.Secondary,{title:P,onClick:o}),jsx(b.Primary,{disabled:u,title:g,onClick:e})]})]})]}))}var In={default:Bt};function Hn(r){var n=r,{flow:e,step:o}=n,t=f(n,["flow","step"]);var S;let{onPrimary:a,onSecondary:s,openStepId:l,setOpenStepId:c,stepTypes:m}=useContext(Tt),{handlePrimary:g,handleSecondary:P}=re(o,{onPrimary:a,onSecondary:s}),x=(l!=null?l:e.getCurrentStep().id)===o.id,u=(S=m[o.type])!=null?S:Bt;function F(B){return M(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsx(u,p(i({flow:e,onOpenChange:F,open:x,step:o},t),{handlePrimary:g,handleSecondary:P}),o.id)}function Ue(l){var c=l,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,part:n,stepTypes:a={}}=c,s=f(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[m,g]=useState(null),P=i(i({},In),a);return jsx(Tt.Provider,{value:{openStepId:m,setOpenStepId:g,onPrimary:t,onSecondary:r,stepTypes:P},children:jsx(U,p(i({as:b,borderWidth:"md",flowId:o,part:["checklist",n]},s),{children:S=>{var B=S,{flow:x,handleDismiss:u}=B,F=f(B,["flow","handleDismiss"]);let v=Array.from(x.steps.entries()).filter(([,h])=>h.$state.visible===!0).map(([,h])=>jsx(Hn,p(i({flow:x,handleDismiss:u},F),{step:h}),h.id)),k=x.getNumberOfCompletedSteps(),H=x.getNumberOfAvailableSteps();return jsxs(Fragment,{children:[jsxs(C.Column,{gap:2,children:[jsx(b.Header,{dismissible:e,handleDismiss:u,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxs(w.Body2,{fontWeight:"demibold",children:[k,"/",H]}),jsx(he,{current:k,total:H,flexGrow:1})]})]}),v]})}}))})}var zn=new Set(["required","min","max","minLength","maxLength","pattern"]);function _n({fieldComponent:e,control:o,fieldData:t,submit:r}){let n=useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let a=Object.fromEntries(Object.entries(t).filter(([l])=>zn.has(l))),s=useController({name:t.id,control:o,rules:a});return jsx(e,p(i({},s),{fieldData:t,formContext:n,submit:r}))}function kt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a}){var v,k,H,h,R,D;let{__readOnly:s}=useContext(I),l=useForm({delayError:2e3,mode:"onChange"}),[c,m]=useState(!1),g=[],{control:P,handleSubmit:x}=l,u=(v=a.props)!=null?v:{};function F(N,we){m(!0),t(we,N,s===!0).then(()=>m(!1));}(k=a.fields)==null||k.forEach(N=>{e[N.type]!=null&&g.push(jsx(_n,{control:P,fieldComponent:e[N.type],fieldData:N,submit:x(F)},`${a.flow.id}-${N.id}`));});let S=(h=(H=a.primaryButton)==null?void 0:H.title)!=null?h:a.primaryButtonTitle,B=(D=(R=a.secondaryButton)==null?void 0:R.title)!=null?D:a.secondaryButtonTitle,E=!!(a.$state.blocked||!l.formState.isValid);return jsxs(C.Column,p(i({gap:5,part:"form-step"},u),{children:[jsx(b.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),jsx(FormProvider,p(i({},l),{children:g})),jsxs(C.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[B&&jsx(O.Secondary,{onClick:r,title:B}),jsx(O.Primary,{disabled:E||c,onClick:x(F),title:S!=null?S:"Submit",loading:c})]},"form-footer")]}))}function Et({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsx(w.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function xo({children:e,id:o,required:t=!1}){return jsxs(w.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsx(y,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Oe={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function ne({children:e,field:o,fieldData:t,fieldState:r}){var m;let{id:n,label:a,placeholder:s}=t,{error:l}=r,c=p(i(i(i({id:n},o),s?{placeholder:s}:{}),Oe),{"aria-invalid":!!l,value:(m=o.value)!=null?m:""});return jsxs(y,{part:"field",children:[jsx(xo,{id:n,required:!!t.required,children:a}),e(c),jsx(Et,{error:l})]})}var Jn=()=>jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Xn=po.forwardRef(({label:e,value:o},t)=>jsxs(y,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsx(w.Body2,{part:"field-radio-label",children:e}),jsx(Se.Item,{id:o,value:o,ref:t,asChild:!0,children:jsx(y,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsx(y,{as:Se.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsx(Jn,{})})})})]}));function ho(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:a,value:s})=>jsx(Xn,{value:s,label:a},s));return jsx(ne,p(i({},e),{children:()=>jsx(Se.Root,{value:t,onValueChange:o,asChild:!0,children:jsx(C.Column,{gap:2,part:"field-radio-group",children:n})})}))}function Mt(e){return jsx("svg",p(i({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"size-5"},e),{children:jsx("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}))}var Zn=po.forwardRef(({label:e,value:o},t)=>jsx(A.Item,{value:o,ref:t,asChild:!0,children:jsx(y,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsx(A.ItemText,{asChild:!0,children:jsx(w.Body2,{part:"field-select-option-label",children:e})})})}));function bo(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,a=r.map(({label:s,value:l})=>jsx(Zn,{value:l,label:s},l));return jsx(ne,p(i({},e),{children:()=>jsxs(A.Root,{value:t,onValueChange:o,children:[jsx(A.Trigger,{asChild:!0,children:jsxs(w.Body2,p(i({},Oe),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsx(A.Value,{placeholder:n!=null?n:"Select one"}),jsx(A.Icon,{children:jsx(y,{as:Mt,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsx(A.Portal,{children:jsx(A.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsx(y,p(i({},Oe),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsx(A.Viewport,{children:a})}))})})]})}))}function Po(e){return jsx(ne,p(i({},e),{children:o=>jsx(w.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function Co(e){return jsx(ne,p(i({},e),{children:o=>jsx(w.Body2,i({as:"textarea",part:"field-textarea"},o))}))}var Yn={radio:ho,select:bo,text:Po,textarea:Co};function Ie(n){var a=n,{fieldTypes:e={},flowId:o,part:t}=a,r=f(a,["fieldTypes","flowId","part"]);let s=Object.assign({},Yn,e);return jsx(U,p(i({flowId:o,part:["form",t]},r),{children:l=>jsx(kt,i({fieldTypes:s},l))}))}var qe={};ee(qe,{NPS:()=>Xe});function zt({field:e,fieldData:o,submit:t}){var n,a;let r=[...Array(11)].map((s,l)=>{let c=e.value===l?O.Primary:O.Secondary;return jsx(c,{borderWidth:"1px",onClick:()=>{e.onChange(l),t();},title:`${l}`,css:{".fr-button-title":{fontSize:"15px"}}},l)});return jsxs(C.Column,{gap:2,children:[jsx(C.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:r}),jsxs(C.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsx(w.Caption,{part:"field-nps-left-label",color:"neutral.400",children:(n=o.negativeLabel)!=null?n:"Not likely at all"}),jsx(w.Caption,{part:"field-nps-right-label",color:"neutral.400",children:(a=o.positiveLabel)!=null?a:"Extremely likely"})]})]})}function Xe(a){var s=a,{as:e=W,flowId:o,fieldTypes:t,part:r}=s,n=f(s,["as","flowId","fieldTypes","part"]);let{flow:l}=ie(o);return jsx(Ie,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:zt},t),modal:!1,onEscapeKeyDown:c=>{typeof n.onEscapeKeyDown=="function"&&n.onEscapeKeyDown(c),c.defaultPrevented||l.skip();},part:["nps",r],css:p(i({},!l||l.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},n))}function fe(e,{onComplete:o,onDismiss:t}={}){let r=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&M(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(n=>M(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function Ze(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=useState(e),[r,n]=useState(null),a=useCallback(s=>{n(s);},[]);return useLayoutEffect(()=>{if(!r)return;let s=()=>{let l=r.getBoundingClientRect();t(l);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:a}}var ai=keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Kt(r){var n=r,{style:e={},part:o=""}=n,t=f(n,["style","part"]);return jsxs(y,p(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${ai}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Ye(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);return jsx(y,i({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function pi(e){var o,t,r,n,a;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("youtu.be")?`https://www.youtube.com/embed/${(t=e.split("youtu.be/")[1])==null?void 0:t.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(r=e.split("vimeo.com/")[1])==null?void 0:r.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(a=e.split("loom.com/share/")[1])==null?void 0:a.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Qe(r){var n=r,{part:e,src:o}=n,t=f(n,["part","src"]);let a=pi(o);return a?jsx(y,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsx(y,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function le(r){var n=r,{src:e,type:o}=n,t=f(n,["src","type"]);return jsx(o==="video"?Qe:Ye,i({src:e},t))}function jt({props:e,alignAttr:o,sideAttr:t}){let r=t!=null?t:"bottom",n={},a=()=>{var m;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (m=e.align)!=null?m:"after"},s="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};n[l[r]]=s;let c=a();return ["before","end"].includes(c)?["top","bottom"].includes(r)?n.right=s:n.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(r)?n.left=s:n.top=s:["top","bottom"].includes(r)?n.left=`calc(50% + ${s})`:n.top=`calc(50% + ${s})`,n}var eo={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Jt(e,o){var a,s,l,c,m;let t=Object.fromEntries(eo.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r=Object.fromEntries(eo.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n={};for(let g of Object.keys(e))!eo.content.includes(g)&&!eo.root.includes(g)&&(n[g]=e[g]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let g={after:"end",before:"start"},P=(E,v)=>["top","bottom"].includes(v)?E=="after"?"marginLeft":"marginRight":E=="after"?"marginTop":"marginBottom",x=(l=t.alignOffset)!=null?l:0,u=(c=t.style)!=null?c:{},F=(m=t.side)!=null?m:"bottom",S=t.align;t.style=p(i({},u),{[P(S,F)]:x});let B=["top","bottom"].includes(F)?o.width:o.height;t.alignOffset=(B+x)*-1,t.align=g[S];}return {contentProps:t,otherProps:n,rootProps:r}}var Xt=keyframes`
|
|
48
46
|
from {
|
|
49
47
|
opacity: 0;
|
|
50
48
|
}
|
|
@@ -54,7 +52,7 @@ var Oo=Object.defineProperty,ar=Object.defineProperties;var sr=Object.getOwnProp
|
|
|
54
52
|
to {
|
|
55
53
|
opacity: 1;
|
|
56
54
|
}
|
|
57
|
-
`;function Lt(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function $(s){var l=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=l,i=f(l,["anchor","children","className","spotlight","style"]);let{node:c,rect:m,ref:g}=qe(),{node:P,rect:x,ref:u}=qe(),Eo=Mt(i,m),{contentProps:w,otherProps:Ae}=Eo,we=Ae,{part:S}=we,B=f(we,["part"]),{rootProps:E}=Eo,[T,k]=useState(w.align),[H,b]=useState(w.side),[R,D]=useState(0),[V,Se]=useState(0);if(c!==null){let _=c.getAttribute("data-align"),Q=c.getAttribute("data-side");T!==_&&k(_),H!==Q&&b(Q);}let se=useRef(null);if(useEffect(()=>{let _=document.querySelector(e);_!=null?(u(_),se.current=_):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function _(ye){if(ye.matches(e))return Lt(ye)?ye:null;let pe=ye.querySelectorAll(e);return pe.length>0&&Lt(pe[0])?pe[0]:null}let Q=new MutationObserver(ye=>{for(let pe of ye)if(pe.type==="childList"){for(let Te of pe.addedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=_(Te);if(de!=null){u(de),se.current=de,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",de);break}}for(let Te of pe.removedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=_(Te);if(de!=null){u(null),se.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",de);break}}}});return Q.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>Q.disconnect()},[]),useEffect(()=>{let{scrollX:_,scrollY:Q}=window;D(x.left+_),Se(x.top+Q);},[x.left,x.top]),P==null)return null;let Me="0";typeof window!="undefined"&&(Me=window.getComputedStyle(P).borderRadius);let Fe=Wt({props:i,alignAttr:T,sideAttr:H});return jsxs(Z.Root,d(a({defaultOpen:!0},E),{children:[jsx(Z.Anchor,{virtualRef:se}),jsx(Z.Portal,{children:jsxs(Fragment,{children:[r&&jsx(y,a({animation:`${At} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:Me,height:x.height,left:R,top:V,width:x.width}},i.zIndex!=null?{zIndex:i.zIndex}:{})),jsx(Z.Content,d(a({asChild:!0},w),{ref:g,children:jsxs(h,d(a({animation:`${At} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",S],pointerEvents:"auto",style:n},B),{children:[jsx(It,{style:Fe}),o]}))}))]})})]}))}$.Close=e=>jsx(Z.Close,{"aria-label":"Close",asChild:!0,children:jsx(O.Plain,d(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(XMarkIcon,{height:"20",fill:"currentColor"})}))});$.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null?null:jsx(le,a({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};$.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsx(O.Primary,a({title:o,onClick:e},t))};$.Progress=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(F.Body2,d(a({part:"progress"},o),{children:e}))};$.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsx(O.Secondary,a({title:o,onClick:e},t))};$.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(F.Body2,d(a({part:"subtitle"},o),{children:e}))};$.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(F.H4,d(a({part:"title"},o),{children:e}))};function $t(c){var m=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:i,step:s}=m,l=f(m,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var E,T,k,H,b,R;let{handleDismiss:g}=fe(o,{onDismiss:t}),{handlePrimary:P,handleSecondary:x}=re(s,{onPrimary:n,onSecondary:i}),u=(E=s.props)!=null?E:{},w=(k=(T=s.primaryButton)==null?void 0:T.title)!=null?k:s.primaryButtonTitle,S=(b=(H=s.secondaryButton)==null?void 0:H.title)!=null?b:s.secondaryButtonTitle,B=s.$state.blocked;return jsxs($,d(a(a({anchor:s.selector,collisionPadding:12,onOpenAutoFocus:D=>D.preventDefault(),onPointerDownOutside:D=>D.preventDefault(),onInteractOutside:D=>D.preventDefault()},l),u),{onEscapeKeyDown:D=>{typeof r=="function"&&r(D),D.defaultPrevented||g(D);},children:[e&&jsx($.Close,{onClick:g}),jsx($.Media,{src:(R=s.videoUri)!=null?R:s.imageUri,type:s.videoUri?"video":"image"}),jsxs(C.Column,{gap:1,part:"tooltip-header",children:[jsx($.Title,{children:s.title}),jsx($.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxs(C.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsx($.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsx($.Secondary,{disabled:B,onClick:x,title:S}),jsx($.Primary,{disabled:B,onClick:P,title:w})]})]}),s.id)}function Ie(e,o=!0){let{currentModal:t,modals:r,setModals:n}=useContext(I),[i,s]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==i&&s(c);},[e==null?void 0:e.id,t]);function l(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let m=new Set(c);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:i||!o,removeModal:l}}function wo(i){var s=i,{flowId:e,onComplete:o,variables:t,part:r}=s,n=f(s,["flowId","onComplete","variables","part"]);let[l,c]=useState(!1),{flow:m}=ie(e,{variables:t}),{hasInitialized:g,registerComponent:P,unregisterComponent:x}=useContext(I);fe(m,{onComplete:o});let{isCurrentModal:u,removeModal:w}=Ie(m);if(useEffect(()=>{!(m!=null&&m.isVisible)&&u&&w();},[m==null?void 0:m.isVisible,u]),useEffect(()=>()=>{x(e);},[]),m==null||m.isVisible===!1||!u||(P(e,()=>{l||c(!0);}),!g||!l))return null;let S=m.getCurrentStep();return S==null||S.start(),jsx($t,a({"data-flow-id":m.id,flow:m,part:["tour",r],step:S},n))}function zt(e){let[o,t]=useState(),[r,n]=useState(),{flow:i}=ie(r),{frigade:s}=useContext(I);return useEffect(()=>{W(this,null,function*(){var m;let l=yield s.getCollection(e);if(!l||s.hasFailedToLoad()){t(void 0);return}let c=(m=l.flows.find(({flow:g})=>g.isVisible))==null?void 0:m.flow;c!=null&&c.id!==r&&n(c.id),t(l);});},[e,i==null?void 0:i.isVisible]),{collection:o,currentFlow:i}}function To(r){var n=r,{collectionId:e,part:o}=n,t=f(n,["collectionId","part"]);var c,m;let i={ANNOUNCEMENT:vo,BANNER:po,CARD:h,CHECKLIST:Ue,EMBEDDED_TIP:h,FORM:Oe,NPS_SURVEY:Je,TOUR:wo},{currentFlow:s}=zt(e),l=(m=i[(c=s==null?void 0:s.rawData)==null?void 0:c.flowType])!=null?m:null;return s==null||l==null?null:jsx(y,d(a({part:["collection",o],"data-collection-id":e},t),{children:jsx(l,{flowId:s.id},s.id)}))}function He(){let{frigade:e}=useContext(I);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Ut(){let[e,o]=useState(),{frigade:t}=He();return useEffect(()=>{t.getCollections().then(r=>{r==null||r.forEach((n,i)=>{n.collectionType==="DEFAULT"&&o(i);});});},[]),e==null?null:jsx(To,{as:null,collectionId:e})}var I=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function jt(){let{frigade:e}=He();return useEffect(()=>{W(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 Yt(s){var l=s,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=l,i=f(l,["children","css","defaultCollection","navigate","theme"]);let c=n?ro(n):{},[m,g]=useState(new Set),P=useRef(new Map),x=useRef(),[u,w]=useState(!1),S=useMemo(()=>(w(!1),x.current=void 0,g(new Set),new 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]);useEffect(()=>{if(i.__flowStateOverrides){let b=S.getConfig();b.__flowStateOverrides=i.__flowStateOverrides,S.reload(b);}},[i.__flowStateOverrides]);function B(){let b=[...P.current.entries()].map(([R,D])=>[R,D.callback]);S.batchRegister(b),w(!0);}function E(b,R){if(x.current&&clearTimeout(x.current),u){P.current.has(b)?S.getFlow(b).then(D=>R(D.isVisible)):(S.getFlow(b).then(D=>D.register(R)),P.current.set(b,{callback:R}));return}P.current.has(b)||P.current.set(b,{callback:R}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function T(b){P.current.has(b)&&S.getFlow(b).then(R=>{P.current.delete(b),R==null||R.unregister();});}let k=r!=null?r:(b,R="_self")=>{window.open(b,R);};useEffect(()=>()=>{S.destroy();},[]);let H=m.size>0?m.values().next().value:null;return jsxs(I.Provider,{value:d(a({modals:m,setModals:g,currentModal:H,navigate:k},i),{frigade:S,registerComponent:E,unregisterComponent:T,hasInitialized:u}),children:[jsx(Global,{styles:{":root":a(a(a({},no),c),o)}}),jsxs(ThemeProvider,{theme:v,children:[t&&jsx(Ut,{}),e]}),i.preloadImages!==!1&&jsx(jt,{})]})}function ie(e,o){let[t,r]=useState(),[,n]=useState(""),{frigade:i}=useContext(I),s=useCallback(l=>{l.id===e&&(o!=null&&o.variables&&l.applyVariables(o.variables),setTimeout(()=>{r(l),n(Math.random().toString());},0));},[o==null?void 0:o.variables,e,i]);return useEffect(()=>{if(!(!(i!=null&&i.isReady())||e==null))return W(this,null,function*(){let l=yield i.getFlow(e);if(!l||i.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&l.applyVariables(o.variables),r(l);}),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}},[e,i,s]),useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function U(m){var g=m,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:i,onSecondary:s,variables:l}=g,c=f(g,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var we,Q;let[P,x]=useState(!1),{flow:u}=ie(t,{variables:l}),_=a(a({},(we=u==null?void 0:u.props)!=null?we:{}),c),{dismissible:w=!1,forceMount:S=!1,modal:B=!1}=_,E=f(_,["dismissible","forceMount","modal"]),{hasInitialized:T,registerComponent:k,unregisterComponent:H}=useContext(I),b=u==null?void 0:u.getCurrentStep(),{handleDismiss:R}=fe(u,{onComplete:r,onDismiss:n}),{handlePrimary:D,handleSecondary:V}=re(b,{onPrimary:i,onSecondary:s}),Se=B||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((Q=u==null?void 0:u.rawData)==null?void 0:Q.flowType),{isCurrentModal:se,removeModal:Me}=Ie(u,Se);useEffect(()=>{!(u!=null&&u.isVisible)&&se&&Me();},[u==null?void 0:u.isVisible,se]),useEffect(()=>()=>{H(t);},[]),useEffect(()=>{(u!=null&&u.isCompleted||u!=null&&u.isSkipped)&&H(t);},[u==null?void 0:u.isCompleted,u==null?void 0:u.isSkipped]);let Fe=S&&((u==null?void 0:u.isCompleted)||(u==null?void 0:u.isSkipped));if(!u||!Fe&&!se||(k(t,()=>{P||x(!0);}),!u.isVisible&&!Fe)||!T||!P)return null;(Fe||!u.isCompleted&&!u.isSkipped)&&b.start();let Eo=e===null?Fragment$1:e!=null?e:y,Ae=d(a({},E),{"data-flow-id":u.id});return jsx(Eo,d(a({},e===null?{}:Ae),{children:o({flow:u,handleDismiss:R,handlePrimary:D,handleSecondary:V,parentProps:{dismissible:w,flowId:t,variables:l,containerProps:Ae},step:b})}))}function tr(t){var r=t,{part:e}=r,o=f(r,["part"]);return jsx(U,d(a({as:h,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:l},step:c})=>{var P,x,u,w;let m=(x=(P=c.primaryButton)==null?void 0:P.title)!=null?x:c.primaryButtonTitle,g=(w=(u=c.secondaryButton)==null?void 0:u.title)!=null?w:c.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(h.Header,{dismissible:l,handleDismiss:n,subtitle:c.subtitle,title:c.title}),jsx(h.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(h.Secondary,{title:g,onClick:s}),jsx(h.Primary,{title:m,onClick:i})]})]})}}))}var h=lo.forwardRef((n,r)=>{var i=n,{children:e,flowId:o}=i,t=f(i,["children","flowId"]);var l;if(o!=null)return jsx(tr,a({flowId:o},t));let s=(l=t.as)!=null?l:C.Column;return 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}))});h.Dismiss=e=>jsx(O.Plain,d(a({part:"dismiss",padding:0},e),{children:jsx(XMarkIcon,{height:"20",fill:"currentColor"})}));h.Header=i=>{var s=i,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=f(s,["dismissible","handleDismiss","subtitle","title"]);return jsxs(C.Row,d(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsx(h.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsx(h.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(h.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};h.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(le,a({borderRadius:"md",src:e},o))};h.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(O.Primary,a({title:o,onClick:e},t))};h.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(O.Secondary,a({title:o,onClick:e},t))};h.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(F.Body2,d(a({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};h.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(F.H4,d(a({display:"block",part:"title"},o),{children:e}))};var oo={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function nr(e){let o=Object.fromEntries(oo.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(oo.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!oo.content.some(i=>i===n)&&!oo.root.some(i=>i===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var Mi=keyframes`
|
|
55
|
+
`;function qt(e){return e instanceof HTMLElement?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!1}function $(s){var l=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=l,a=f(l,["anchor","children","className","spotlight","style"]);let{node:c,rect:m,ref:g}=Ze(),{node:P,rect:x,ref:u}=Ze(),Do=Jt(a,m),{contentProps:F,otherProps:Ae}=Do,ve=Ae,{part:S}=ve,B=f(ve,["part"]),{rootProps:E}=Do,[v,k]=useState(F.align),[H,h]=useState(F.side),[R,D]=useState(0),[N,we]=useState(0);if(c!==null){let z=c.getAttribute("data-align"),Y=c.getAttribute("data-side");v!==z&&k(z),H!==Y&&h(Y);}let se=useRef(null);if(useEffect(()=>{let z=document.querySelector(e);z!=null?(u(z),se.current=z):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),useEffect(()=>{function z(ye){if(ye.matches(e))return qt(ye)?ye:null;let pe=ye.querySelectorAll(e);return pe.length>0&&qt(pe[0])?pe[0]:null}let Y=new MutationObserver(ye=>{for(let pe of ye)if(pe.type==="childList"){for(let Te of pe.addedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=z(Te);if(de!=null){u(de),se.current=de,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",de);break}}for(let Te of pe.removedNodes){if(Te.nodeType!==Node.ELEMENT_NODE)continue;let de=z(Te);if(de!=null){u(null),se.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",de);break}}}});return Y.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>Y.disconnect()},[]),useEffect(()=>{let{scrollX:z,scrollY:Y}=window;D(x.left+z),we(x.top+Y);},[x.left,x.top]),P==null)return null;let Le="0";typeof window!="undefined"&&(Le=window.getComputedStyle(P).borderRadius);let Fe=jt({props:a,alignAttr:v,sideAttr:H});return jsxs(Q.Root,p(i({defaultOpen:!0},E),{children:[jsx(Q.Anchor,{virtualRef:se}),jsx(Q.Portal,{children:jsxs(Fragment,{children:[r&&jsx(y,i({animation:`${Xt} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:Le,height:x.height,left:R,top:N,width:x.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsx(Q.Content,p(i({asChild:!0},F),{ref:g,children:jsxs(b,p(i({animation:`${Xt} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,maxWidth:"min(360px, calc(100vw - 25px))",part:["tooltip",S],pointerEvents:"auto",style:n},B),{children:[jsx(Kt,{style:Fe}),o]}))}))]})})]}))}$.Close=e=>jsx(Q.Close,{"aria-label":"Close",asChild:!0,children:jsx(O.Plain,p(i({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsx(xe,{height:"20",fill:"currentColor"})}))});$.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null?null:jsx(le,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};$.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsx(O.Primary,i({title:o,onClick:e},t))};$.Progress=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(w.Body2,p(i({part:"progress"},o),{children:e}))};$.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsx(O.Secondary,i({title:o,onClick:e},t))};$.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(w.Body2,p(i({part:"subtitle"},o),{children:e}))};$.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(w.H4,p(i({part:"title"},o),{children:e}))};function Zt(c){var m=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:a,step:s}=m,l=f(m,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var E,v,k,H,h,R;let{handleDismiss:g}=fe(o,{onDismiss:t}),{handlePrimary:P,handleSecondary:x}=re(s,{onPrimary:n,onSecondary:a}),u=(E=s.props)!=null?E:{},F=(k=(v=s.primaryButton)==null?void 0:v.title)!=null?k:s.primaryButtonTitle,S=(h=(H=s.secondaryButton)==null?void 0:H.title)!=null?h:s.secondaryButtonTitle,B=s.$state.blocked;return jsxs($,p(i(i({anchor:s.selector,collisionPadding:12,onOpenAutoFocus:D=>D.preventDefault(),onPointerDownOutside:D=>D.preventDefault(),onInteractOutside:D=>D.preventDefault()},l),u),{onEscapeKeyDown:D=>{typeof r=="function"&&r(D),D.defaultPrevented||g(D);},children:[e&&jsx($.Close,{onClick:g}),jsx($.Media,{src:(R=s.videoUri)!=null?R:s.imageUri,type:s.videoUri?"video":"image"}),jsxs(C.Column,{gap:1,part:"tooltip-header",children:[jsx($.Title,{children:s.title}),jsx($.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxs(C.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsx($.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepOrder()+1}/${o.getNumberOfAvailableSteps()}`}),jsx($.Secondary,{disabled:B,onClick:x,title:S}),jsx($.Primary,{disabled:B,onClick:P,title:F})]})]}),s.id)}function He(e,o=!0){let{currentModal:t,modals:r,setModals:n}=useContext(I),[a,s]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function l(){o&&r.has(e==null?void 0:e.id)&&n(c=>{let m=new Set(c);return m.delete(e==null?void 0:e.id),m});}return {isCurrentModal:a||!o,removeModal:l}}function vo(a){var s=a,{flowId:e,onComplete:o,variables:t,part:r}=s,n=f(s,["flowId","onComplete","variables","part"]);let[l,c]=useState(!1),{flow:m}=ie(e,{variables:t}),{hasInitialized:g,registerComponent:P,unregisterComponent:x}=useContext(I);fe(m,{onComplete:o});let{isCurrentModal:u,removeModal:F}=He(m);if(useEffect(()=>{!(m!=null&&m.isVisible)&&u&&F();},[m==null?void 0:m.isVisible,u]),useEffect(()=>()=>{x(e);},[]),m==null||m.isVisible===!1||!u||(P(e,()=>{l||c(!0);}),!g||!l))return null;let S=m.getCurrentStep();return S==null||S.start(),jsx(Zt,i({"data-flow-id":m.id,flow:m,part:["tour",r],step:S},n))}function or(e){let[o,t]=useState(),[r,n]=useState(),{flow:a}=ie(r),{frigade:s}=useContext(I);return useEffect(()=>{M(this,null,function*(){var m;let l=yield s.getCollection(e);if(!l||s.hasFailedToLoad()){t(void 0);return}let c=(m=l.flows.find(({flow:g})=>g.isVisible))==null?void 0:m.flow;c!=null&&c.id!==r&&n(c.id),t(l);});},[e,a==null?void 0:a.isVisible]),{collection:o,currentFlow:a}}function To(r){var n=r,{collectionId:e,part:o}=n,t=f(n,["collectionId","part"]);var c,m;let a={ANNOUNCEMENT:Bo,BANNER:co,CARD:b,CHECKLIST:Ue,EMBEDDED_TIP:b,FORM:Ie,NPS_SURVEY:Xe,TOUR:vo},{currentFlow:s}=or(e),l=(m=a[(c=s==null?void 0:s.rawData)==null?void 0:c.flowType])!=null?m:null;return s==null||l==null?null:jsx(y,p(i({part:["collection",o],"data-collection-id":e},t),{children:jsx(l,{flowId:s.id},s.id)}))}function Me(){let{frigade:e}=useContext(I);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function rr(){let[e,o]=useState(),{frigade:t}=Me();return useEffect(()=>{t.getCollections().then(r=>{r==null||r.forEach((n,a)=>{n.collectionType==="DEFAULT"&&o(a);});});},[]),e==null?null:jsx(To,{as:null,collectionId:e})}var I=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function nr(){let{frigade:e}=Me();return useEffect(()=>{M(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 pr(s){var l=s,{children:e,css:o={},defaultCollection:t=!0,navigate:r,theme:n}=l,a=f(l,["children","css","defaultCollection","navigate","theme"]);let c=n?no(n):{},[m,g]=useState(new Set),P=useRef(new Map),x=useRef(),[u,F]=useState(!1),S=useMemo(()=>(F(!1),x.current=void 0,g(new Set),new Frigade(a.apiKey,{apiKey:a.apiKey,apiUrl:a.apiUrl,userId:a.userId,groupId:a.groupId,userProperties:a.userProperties,groupProperties:a.groupProperties,generateGuestId:a.generateGuestId,syncOnWindowUpdates:a.syncOnWindowUpdates,__readOnly:a.__readOnly,__flowStateOverrides:a.__flowStateOverrides})),[a.userId,a.groupId,a.apiKey]);useEffect(()=>{if(a.__flowStateOverrides){let h=S.getConfig();h.__flowStateOverrides=a.__flowStateOverrides,S.reload(h);}},[a.__flowStateOverrides]);function B(){let h=[...P.current.entries()].map(([R,D])=>[R,D.callback]);S.batchRegister(h),F(!0);}function E(h,R){if(x.current&&clearTimeout(x.current),u){P.current.has(h)?S.getFlow(h).then(D=>R(D.isVisible)):(S.getFlow(h).then(D=>D.register(R)),P.current.set(h,{callback:R}));return}P.current.has(h)||P.current.set(h,{callback:R}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>B(),0);}function v(h){P.current.has(h)&&S.getFlow(h).then(R=>{P.current.delete(h),R==null||R.unregister();});}let k=r!=null?r:(h,R="_self")=>{window.open(h,R);};useEffect(()=>()=>{S.destroy();},[]);let H=m.size>0?m.values().next().value:null;return jsxs(I.Provider,{value:p(i({modals:m,setModals:g,currentModal:H,navigate:k},a),{frigade:S,registerComponent:E,unregisterComponent:v,hasInitialized:u}),children:[jsx(Global,{styles:{":root":i(i(i({},io),c),o)}}),jsxs(ThemeProvider,{theme:T,children:[t&&jsx(rr,{}),e]}),a.preloadImages!==!1&&jsx(nr,{})]})}function ie(e,o){let[t,r]=useState(),[,n]=useState(""),{frigade:a}=useContext(I),s=useCallback(l=>{l.id===e&&(o!=null&&o.variables&&l.applyVariables(o.variables),setTimeout(()=>{r(l),n(Math.random().toString());},0));},[o==null?void 0:o.variables,e,a]);return useEffect(()=>{if(!(!(a!=null&&a.isReady())||e==null))return M(this,null,function*(){let l=yield a.getFlow(e);if(!l||a.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&l.applyVariables(o.variables),r(l);}),a.onStateChange(s),()=>{a.removeStateChangeHandler(s);}},[e,a,s]),useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function U(m){var g=m,{as:e,children:o,flowId:t,onComplete:r,onDismiss:n,onPrimary:a,onSecondary:s,variables:l}=g,c=f(g,["as","children","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables"]);var ve,Y;let[P,x]=useState(!1),{flow:u}=ie(t,{variables:l}),z=i(i({},(ve=u==null?void 0:u.props)!=null?ve:{}),c),{dismissible:F=!1,forceMount:S=!1,modal:B=!1}=z,E=f(z,["dismissible","forceMount","modal"]),{hasInitialized:v,registerComponent:k,unregisterComponent:H}=useContext(I),h=u==null?void 0:u.getCurrentStep(),{handleDismiss:R}=fe(u,{onComplete:r,onDismiss:n}),{handlePrimary:D,handleSecondary:N}=re(h,{onPrimary:a,onSecondary:s}),we=B||typeof e=="function"&&(e==null?void 0:e.displayName)==="Dialog"||[FlowType.ANNOUNCEMENT,FlowType.TOUR].includes((Y=u==null?void 0:u.rawData)==null?void 0:Y.flowType),{isCurrentModal:se,removeModal:Le}=He(u,we);useEffect(()=>{!(u!=null&&u.isVisible)&&se&&Le();},[u==null?void 0:u.isVisible,se]),useEffect(()=>()=>{H(t);},[]),useEffect(()=>{(u!=null&&u.isCompleted||u!=null&&u.isSkipped)&&H(t);},[u==null?void 0:u.isCompleted,u==null?void 0:u.isSkipped]);let Fe=S&&((u==null?void 0:u.isCompleted)||(u==null?void 0:u.isSkipped));if(!u||!Fe&&!se||(k(t,()=>{P||x(!0);}),!u.isVisible&&!Fe)||!v||!P)return null;(Fe||!u.isCompleted&&!u.isSkipped)&&h.start();let Do=e===null?Fragment$1:e!=null?e:y,Ae=p(i({},E),{"data-flow-id":u.id});return jsx(Do,p(i({},e===null?{}:Ae),{children:o({flow:u,handleDismiss:R,handlePrimary:D,handleSecondary:N,parentProps:{dismissible:F,flowId:t,variables:l,containerProps:Ae},step:h})}))}function fr(t){var r=t,{part:e}=r,o=f(r,["part"]);return jsx(U,p(i({as:b,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:n,handlePrimary:a,handleSecondary:s,parentProps:{dismissible:l},step:c})=>{var P,x,u,F;let m=(x=(P=c.primaryButton)==null?void 0:P.title)!=null?x:c.primaryButtonTitle,g=(F=(u=c.secondaryButton)==null?void 0:u.title)!=null?F:c.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(b.Header,{dismissible:l,handleDismiss:n,subtitle:c.subtitle,title:c.title}),jsx(b.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(b.Secondary,{title:g,onClick:s}),jsx(b.Primary,{title:m,onClick:a})]})]})}}))}var b=po.forwardRef((n,r)=>{var a=n,{children:e,flowId:o}=a,t=f(a,["children","flowId"]);var l;if(o!=null)return jsx(fr,i({flowId:o},t));let s=(l=t.as)!=null?l:C.Column;return jsx(s,p(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});b.Dismiss=e=>jsx(O.Plain,p(i({part:"dismiss",padding:0},e),{children:jsx(xe,{height:"20",fill:"currentColor"})}));b.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=f(s,["dismissible","handleDismiss","subtitle","title"]);return jsxs(C.Row,p(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsx(b.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsx(b.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(b.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};b.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsx(le,i({borderRadius:"md",src:e},o))};b.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(O.Primary,i({title:o,onClick:e},t))};b.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsx(O.Secondary,i({title:o,onClick:e},t))};b.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(w.Body2,p(i({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};b.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return e==null?null:jsx(w.H4,p(i({display:"block",part:"title"},o),{children:e}))};var to={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function yr(e){let o=Object.fromEntries(to.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(to.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!to.content.some(a=>a===n)&&!to.root.some(a=>a===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}var $i=keyframes`
|
|
58
56
|
from {
|
|
59
57
|
opacity: 0;
|
|
60
58
|
}
|
|
@@ -64,8 +62,8 @@ var Oo=Object.defineProperty,ar=Object.defineProperties;var sr=Object.getOwnProp
|
|
|
64
62
|
to {
|
|
65
63
|
opacity: 1;
|
|
66
64
|
}
|
|
67
|
-
`;function
|
|
65
|
+
`;function W(n){var a=n,{children:e,className:o,modal:t=!0}=a,r=f(a,["children","className","modal"]);let{rootProps:s,contentProps:l,otherProps:g}=yr(r),P=g,{zIndex:c}=P,m=f(P,["zIndex"]);return jsx(K.Root,p(i({defaultOpen:!0,modal:t},s),{children:jsx(K.Portal,{children:jsxs(y,{animation:`${$i} 300ms ease-out`,className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsx(K.Overlay,{asChild:!0,children:jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(K.Content,p(i({asChild:!0,onOpenAutoFocus:x=>x.preventDefault(),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault()},l),{children:jsx(b,p(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}W.Dismiss=e=>jsx(K.Close,{"aria-label":"Close",asChild:!0,children:jsx(O.Plain,p(i({part:"close",position:"absolute",right:"2px",top:"2px"},e),{children:jsx(xe,{height:"20",fill:"currentColor"})}))});W.Subtitle=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return jsx(K.Description,{asChild:!0,children:jsx(w.Body2,p(i({part:"subtitle"},o),{children:e}))})};W.Media=t=>{var r=t,{src:e}=r,o=f(r,["src"]);return e==null?null:jsx(le,i({borderRadius:"md",src:e},o))};W.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsx(O.Primary,i({title:o,onClick:e},t))};W.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(y,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?T.colors.blue500:T.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(y,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};W.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=f(n,["onClick","title"]);return o==null?null:jsx(O.Secondary,i({title:o,onClick:e},t))};W.Title=t=>{var r=t,{children:e}=r,o=f(r,["children"]);return jsx(K.Title,{asChild:!0,children:jsx(w.H4,p(i({part:"title"},o),{children:e}))})};W.displayName="Dialog";var xr=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function Bo(r){var n=r,{flowId:e,part:o}=n,t=f(n,["flowId","part"]);let a=Object.fromEntries(Object.entries(t).filter(([l])=>xr.some(c=>l===c))),s=Object.fromEntries(Object.entries(t).filter(([l])=>xr.indexOf(l)===-1));return jsx(U,p(i({as:null,flowId:e},a),{children:({flow:l,handleDismiss:c,handlePrimary:m,handleSecondary:g,parentProps:{containerProps:P,dismissible:x},step:u})=>{var v,k,H,h,R,D;let F=(v=u.props)!=null?v:{},S=(H=(k=u.primaryButton)==null?void 0:k.title)!=null?H:u.primaryButtonTitle,B=(R=(h=u.secondaryButton)==null?void 0:h.title)!=null?R:u.secondaryButtonTitle,E=u.$state.blocked;return jsx(W,p(i(i({part:["announcement",o],textAlign:"center"},P),s),{onEscapeKeyDown:N=>{if(t.dismissible===!1){N.preventDefault();return}typeof t.onEscapeKeyDown=="function"&&t.onEscapeKeyDown(N),N.defaultPrevented||c(N);},children:jsxs(C.Column,p(i({gap:5,part:"announcement-step"},F),{children:[x&&jsx(W.Dismiss,{onClick:c}),jsxs(C.Column,{gap:1,part:"announcement-header",children:[jsx(W.Title,{children:u.title}),jsx(W.Subtitle,{children:u.subtitle})]}),jsx(W.Media,{src:(D=u.videoUri)!=null?D:u.imageUri,type:u.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(W.ProgressDots,{current:l.getCurrentStepIndex(),total:l.getNumberOfAvailableSteps()}),jsxs(C.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[B&&jsx(W.Secondary,{disabled:E,onClick:g,title:B}),S&&jsx(W.Primary,{disabled:E,onClick:m,title:S})]})]}))}))}}))}function _i(){let{userId:e,frigade:o}=useContext(I);function t(n){return M(this,null,function*(){yield o.identify(e,n);})}function r(n,a){return M(this,null,function*(){yield o.track(n,a);})}return {userId:e,addProperties:t,track:r}}function Ki(){var n;let{frigade:e}=useContext(I);function o(a){return M(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,a);})}function t(a,s){return M(this,null,function*(){yield e.track(a,s);})}function r(a,s){return M(this,null,function*(){yield e.group(a,s);})}return {groupId:(n=e==null?void 0:e.config)==null?void 0:n.groupId,setGroupId:r,addProperties:o,track:t}}
|
|
68
66
|
|
|
69
|
-
export {
|
|
67
|
+
export { Bo as Announcement, co as Banner, ne as BaseField, y as Box, O as Button, b as Card, je as Checklist, To as Collection, W as Dialog, C as Flex, U as Flow, Ie as Form, Ye as Image, xo as Label, le as Media, ke as Progress, pr as Provider, ho as RadioField, bo as SelectField, qe as Survey, w as Text, Po as TextField, Co as TextareaField, $ as Tooltip, vo as Tour, Qe as Video, io as themeVariables, Ne as tokens, Ze as useBoundingClientRect, ie as useFlow, fe as useFlowHandlers, Me as useFrigade, Ki as useGroup, He as useModal, re as useStepHandlers, _i as useUser };
|
|
70
68
|
//# sourceMappingURL=out.js.map
|
|
71
69
|
//# sourceMappingURL=index.js.map
|