@frigade/react 2.1.14 → 2.1.16
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 +18 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +16 -3
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var V = require('@radix-ui/react-dialog');
|
|
4
4
|
var solid = require('@heroicons/react/24/solid');
|
|
5
5
|
var _e = require('react');
|
|
6
6
|
var clsx = require('clsx');
|
|
@@ -13,7 +13,7 @@ var outline = require('@heroicons/react/24/outline');
|
|
|
13
13
|
var ue = require('@radix-ui/react-collapsible');
|
|
14
14
|
var reactHookForm = require('react-hook-form');
|
|
15
15
|
var me = require('@radix-ui/react-radio-group');
|
|
16
|
-
var
|
|
16
|
+
var $ = require('@radix-ui/react-select');
|
|
17
17
|
var X = require('@radix-ui/react-popover');
|
|
18
18
|
|
|
19
19
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -36,17 +36,17 @@ function _interopNamespace(e) {
|
|
|
36
36
|
return Object.freeze(n);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
var
|
|
39
|
+
var V__namespace = /*#__PURE__*/_interopNamespace(V);
|
|
40
40
|
var _e__namespace = /*#__PURE__*/_interopNamespace(_e);
|
|
41
41
|
var It__default = /*#__PURE__*/_interopDefault(It);
|
|
42
42
|
var Nt__default = /*#__PURE__*/_interopDefault(Nt);
|
|
43
43
|
var js__namespace = /*#__PURE__*/_interopNamespace(js);
|
|
44
44
|
var ue__namespace = /*#__PURE__*/_interopNamespace(ue);
|
|
45
45
|
var me__namespace = /*#__PURE__*/_interopNamespace(me);
|
|
46
|
-
var
|
|
46
|
+
var $__namespace = /*#__PURE__*/_interopNamespace($);
|
|
47
47
|
var X__namespace = /*#__PURE__*/_interopNamespace(X);
|
|
48
48
|
|
|
49
|
-
var ao=Object.defineProperty,vt=Object.defineProperties;var Bt=Object.getOwnPropertyDescriptors;var we=Object.getOwnPropertySymbols;var so=Object.prototype.hasOwnProperty,lo=Object.prototype.propertyIsEnumerable;var io=(e,o,t)=>o in e?ao(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,i=(e,o)=>{for(var t in o||(o={}))so.call(o,t)&&io(e,t,o[t]);if(we)for(var t of we(o))lo.call(o,t)&&io(e,t,o[t]);return e},p=(e,o)=>vt(e,Bt(o));var Rt=(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 u=(e,o)=>{var t={};for(var r in e)so.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&we)for(var r of we(e))o.indexOf(r)<0&&lo.call(e,r)&&(t[r]=e[r]);return t};var q=(e,o)=>{for(var t in o)ao(e,t,{get:o[t],enumerable:!0});};var M=(e,o,t)=>new Promise((r,n)=>{var a=c=>{try{d(t.next(c));}catch(m){n(m);}},s=c=>{try{d(t.throw(c));}catch(m){n(m);}},d=c=>c.done?r(c.value):Promise.resolve(c.value).then(a,s);d((t=t.apply(e,o)).next());});var po={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var ve=[5,10,20,35,50,65,80,95,98],co=[...ve],Le=[...ve];co[4]=40;Le[4]=60;var kt={blue:{h:213,s:100,l:ve},gray:{h:220,s:10,l:ve},green:{h:141,s:90,l:co},red:{h:9,s:90,l:Le},yellow:{h:50,s:90,l:Le}};var O={};for(let[e,{h:o,s:t,l:r}]of Object.entries(kt))O[e]=Object.fromEntries(r.map((n,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var uo=p(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},O),{gray100:O.gray[100],gray200:O.gray[200],gray300:O.gray[300],gray400:O.gray[400],gray500:O.gray[500],gray600:O.gray[600],gray700:O.gray[700],gray800:O.gray[800],gray900:O.gray[900],blue400:O.blue[400],blue500:O.blue[500],blue800:O.blue[800],blue900:O.blue[900],green400:O.blue[400],green500:O.green[500],green800:O.green[800],red500:O.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var mo={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,fo={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var go={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Dt="px",Et=e=>typeof e=="number"?`${4*e}${Dt}`:e,Ot=[-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"],yo=Object.fromEntries(Ot.map(e=>[e,Et(e)]));var xo={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 Be=p(i(p(i({},po),{colors:i(i({},uo),fo)}),xo),{radii:mo,shadows:go,space:yo});function xe(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,d=e[n];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(r,xe(d,s,t)):r[s]=d,r},{})}function $e(e){return xe(e,"--fr","-")}function bo(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=bo(n,`${o}-${r}`):t[r]=`var(${o}-${r})`;}),t}var Ve=$e(Be),w=bo(Be);var Ht=new Set(["alt","size","src"]),Mt=It__default.default.all.filter(e=>e.indexOf("-")!=0&&!Ht.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Wt=Object.fromEntries(Mt),ze=xe(w.colors),At={color:ze,backgroundColor:ze,borderColor:ze,border:w.borders,borderRadius:w.radii,borderWidth:w.borderWidths,boxShadow:w.shadows,fontFamily:w.fontFamilies,fontSize:w.fontSizes,fontWeight:w.fontWeights,gap:w.space,lineHeight:w.lineHeights,margin:w.space,marginBottom:w.space,marginLeft:w.space,marginRight:w.space,marginTop:w.space,padding:w.space,paddingBottom:w.space,paddingLeft:w.space,paddingRight:w.space,paddingTop:w.space},ho=i(i({},Wt),At),Po={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"]},Co=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Lt(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 So=new Map(Object.entries(ho).map(([e,o])=>[e,Lt(o)])),$t=new Map(Object.entries(Po).map(([e,o])=>[e,new Set(o)])),Vt=new Set(["height","width"]),zt=new Set(["canvas","embed","iframe","img","input","object","video"]);function Fo(e){let[o,t]=e.split(":");return [o,Co.has(t)?t:null]}function To(e,o="div"){let t=Object.assign({},e),r={};function n(a){if(a==null)return r;let d=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[d]==null&&(r[d]={}),r[d]}return Object.entries(t).forEach(([a,s])=>{let[d,c]=Fo(a),m=$t.get(d);m!=null&&(m.forEach(g=>{let f=`${g}${c?":"+c:""}`;t[f]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[d,c]=Fo(a),m=So.get(d);if(m!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let g=s.split(" ");n(c)[d]=g.map(f=>{var b;return (b=m.get(f.toString()))!=null?b:f}).join(" ");}else m.has(s.toString())?n(c)[d]=m.get(s.toString()):n(c)[d]=s;(typeof o!="string"||!zt.has(o)||!Vt.has(d))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&So.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:r,unmatchedProps:t}}function Kt(){if(typeof window=="undefined"){let{JSDOM:e}=Rt("jsdom");return new e("<!DOCTYPE html>").window}return window}function wo(e){return e?{__html:Nt__default.default(Kt()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function jt(e){return e&&`fr-${e}`}function Ro(e){return e&&(Array.isArray(e)?e.map(o=>Ro(o)).join(" "):jt(e))}function Ut(d,s){var c=d,{as:e,children:o,className:t,css:r={},part:n}=c,a=u(c,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:g,unmatchedProps:f}=To(a,m),b=Ro(n),S=t||b?clsx.clsx(t,b):void 0,F=[{boxSizing:"border-box"},g,r];return typeof o=="string"?jsxRuntime.jsx(m,p(i({className:S,css:F},f),{ref:s,dangerouslySetInnerHTML:wo(o)})):jsxRuntime.jsx(m,p(i({className:S,css:F},f),{ref:s,children:o}))}var y=_e__namespace.forwardRef(Ut);var k={};q(k,{Link:()=>hr,Plain:()=>Pr,Primary:()=>xr,Secondary:()=>br});var C={};q(C,{Body1:()=>pr,Body2:()=>dr,Caption:()=>cr,Display1:()=>rr,Display2:()=>nr,H1:()=>ir,H2:()=>ar,H3:()=>sr,H4:()=>lr});var Ne={};q(Ne,{Body1:()=>Zt,Body2:()=>er,Caption:()=>or,Display1:()=>Gt,Display2:()=>Jt,H1:()=>Xt,H2:()=>qt,H3:()=>Yt,H4:()=>Qt});var Y={color:"neutral.foreground",fontFamily:"default",margin:"0"},Gt=p(i({},Y),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Jt=p(i({},Y),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Xt=p(i({},Y),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),qt=p(i({},Y),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Yt=p(i({},Y),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Qt=p(i({},Y),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Zt=p(i({},Y),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),er=p(i({},Y),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),or=p(i({},Y),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var tr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],Q=Object.fromEntries(tr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=_e__namespace.forwardRef((d,s)=>{var c=d,{as:r=o,children:n}=c,a=u(c,["as","children"]);return jsxRuntime.jsx(y,p(i(i({as:r},Ne[e]),a),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),rr=Q.Display1,nr=Q.Display2,ir=Q.H1,ar=Q.H2,sr=Q.H3,lr=Q.H4,pr=Q.Body1,dr=Q.Body2,cr=Q.Caption;var Ke={};q(Ke,{Link:()=>gr,Plain:()=>yr,Primary:()=>mr,Secondary:()=>fr});var Re={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},mr=p(i({},Re),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),fr=p(i({},Re),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),gr=p(i({},Re),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),yr=p(i({},Re),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"});function ke(s){var d=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=d,a=u(d,["as","children","part","title","variant"]);let c=n.toLocaleLowerCase();return jsxRuntime.jsxs(y,p(i(i({as:e!=null?e:"button",part:[`button-${c}`,t]},Ke[n]),a),{children:[o,r&&jsxRuntime.jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:r})]}))}function xr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(ke,p(i({},o),{variant:"Primary",children:e}))}function br(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(ke,p(i({},o),{variant:"Secondary",children:e}))}function hr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(ke,p(i({},o),{variant:"Link",children:e}))}function Pr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(ke,p(i({},o),{variant:"Plain",children:e}))}var P={};q(P,{Column:()=>Fr,Row:()=>Sr});var Sr=_e__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,p(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Fr=_e__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,p(i({display:"flex",flexDirection:"column"},e),{ref:o})));var I=_e.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{}});function Ho(n){var a=n,{children:e,navigate:o,theme:t}=a,r=u(a,["children","navigate","theme"]);let s=t?$e(t):{},[d,c]=_e.useState(new Set),m=_e.useRef(new Map),g=_e.useRef(),[f,b]=_e.useState(!1),S=_e.useMemo(()=>new js.Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId,__readOnly:r.__readOnly,__flowConfigOverrides:r.__flowConfigOverrides}),[r.userId,r.groupId,r.apiKey]);function F(){let T=[...m.current.entries()].map(([v,D])=>[v,D.callback]);S.batchRegister(T),b(!0);}function x(T,v){if(g.current&&clearTimeout(g.current),f){m.current.has(T)||(S.getFlow(T).then(D=>D.register(v)),m.current.set(T,{callback:v}));return}m.current.has(T)||m.current.set(T,{callback:v}),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>F(),0);}let B=o!=null?o:(T,v="_self")=>{window.open(T,v);};_e.useEffect(()=>()=>{S.destroy();},[]);let R=d.size>0?d.values().next().value:null;return jsxRuntime.jsxs(I.Provider,{value:p(i({modals:d,setModals:c,currentModal:R,navigate:B},r),{frigade:S,registerComponent:x,hasInitialized:f}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i({},Ve),s)}}),jsxRuntime.jsx(react.ThemeProvider,{theme:w,children:e})]})}function ne(e,o){let[t,r]=_e.useState(),[,n]=_e.useState(""),{frigade:a}=_e.useContext(I),s=_e.useCallback(d=>{d.id===e&&(o!=null&&o.variables&&d.applyVariables(o.variables),r(d),n(Math.random().toString()));},[o==null?void 0:o.variables]);return _e.useEffect(()=>(M(this,null,function*(){let d=yield a.getFlow(e);if(!d||a.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&d.applyVariables(o.variables),r(d);}),a.onStateChange(s),()=>{a.removeStateChangeHandler(s);}),[s]),_e.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function ie(e,{onComplete:o,onDismiss:t}={}){let r=_e.useRef(null);return _e.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:_e.useCallback(n=>M(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function ae(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=_e.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.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:_e.useCallback((a,s)=>M(this,null,function*(){if((yield o==null?void 0:o(e,a))===!1)return a.preventDefault(),!1;if(e.primaryButton!=null){let c=e.primaryButton.action===!1?!1:n[e.primaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else e.complete(s),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:_e.useCallback((a,s)=>M(this,null,function*(){if((yield t==null?void 0:t(e,a))===!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 he(e,o=!0){let{currentModal:t,modals:r,setModals:n}=_e.useContext(I),[a,s]=_e.useState(!1);_e.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]),_e.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 d(){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:d}}function j(f){var b=f,{as:e,children:o,dismissible:t=!1,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:d,variables:c,forceMount:m}=b,g=u(b,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let[S,F]=_e.useState(!1),{flow:x}=ne(r,{variables:c}),{hasInitialized:B,registerComponent:R}=_e.useContext(I),T=x==null?void 0:x.getCurrentStep(),{handleDismiss:v}=ie(x,{onComplete:n,onDismiss:a}),{handlePrimary:D,handleSecondary:J}=ae(T,{onPrimary:s,onSecondary:d}),V=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:fe,removeModal:Ae}=he(x,V);_e.useEffect(()=>{!(x!=null&&x.isVisible)&&fe&&Ae();},[x==null?void 0:x.isVisible,fe]);let ee=m&&((x==null?void 0:x.isCompleted)||(x==null?void 0:x.isSkipped));if(!x||!ee&&!fe||(R(r,()=>{S||F(!0);}),!x.isVisible&&!ee)||!B||!S)return null;(ee||!x.isCompleted&&!x.isSkipped)&&T.start();let Te=e===null?_e.Fragment:e!=null?e:y;return jsxRuntime.jsx(Te,p(i({},e===null?{}:g),{children:o({flow:x,handleDismiss:v,handlePrimary:D,handleSecondary:J,parentProps:i({dismissible:t,flowId:r,variables:c},g),step:T})}))}function Vo(e){return jsxRuntime.jsx(j,p(i({as:h,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card"},e),{children:({handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a})=>{var c,m,g,f;let s=(m=(c=a.primaryButton)==null?void 0:c.title)!=null?m:a.primaryButtonTitle,d=(f=(g=a.secondaryButton)==null?void 0:g.title)!=null?f:a.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(h.Header,{dismissible:n,handleDismiss:o,subtitle:a.subtitle,title:a.title}),jsxRuntime.jsx(h.Media,{src:a.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(h.Secondary,{title:d,onClick:r}),jsxRuntime.jsx(h.Primary,{title:s,onClick:t})]})]})}}))}function je(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);return jsxRuntime.jsx(y,i({as:"img",part:["image",e],src:o},t))}function Ur(e){var o,t,r,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Ue(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);let a=Ur(o);return a?jsxRuntime.jsx(y,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.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 se(r){var n=r,{src:e,type:o}=n,t=u(n,["src","type"]);return jsxRuntime.jsx(o==="video"?Ue:je,i({src:e},t))}var h=_e__namespace.forwardRef((n,r)=>{var a=n,{children:e,flowId:o}=a,t=u(a,["children","flowId"]);var d;if(o!=null)return jsxRuntime.jsx(Vo,i({flowId:o},t));let s=(d=t.as)!=null?d:P.Column;return jsxRuntime.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}))});h.Dismiss=e=>jsxRuntime.jsx(k.Plain,p(i({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}));h.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=u(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(P.Row,p(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsxRuntime.jsx(h.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsxRuntime.jsx(h.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(h.Subtitle,{color:"gray500",flexBasis:"100%",children:t})]}))};h.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(se,i({borderRadius:"md",src:e},o))};h.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(k.Primary,i({title:o,onClick:e},t))};h.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(k.Secondary,i({title:o,onClick:e},t))};h.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,p(i({display:"block",part:"subtitle"},o),{children:e}))};h.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,p(i({display:"block",part:"title"},o),{children:e}))};var De={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Ko(e){let o=Object.fromEntries(De.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(De.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!De.content.some(a=>a===n)&&!De.root.some(a=>a===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}function E(n){var a=n,{children:e,className:o,modal:t=!0}=a,r=u(a,["children","className","modal"]);let{rootProps:s,contentProps:d,otherProps:g}=Ko(r),f=g,{zIndex:c}=f,m=u(f,["zIndex"]);return jsxRuntime.jsx(L__namespace.Root,p(i({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx(L__namespace.Portal,{children:jsxRuntime.jsxs(y,{className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsxRuntime.jsx(L__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(L__namespace.Content,p(i({asChild:!0,onOpenAutoFocus:b=>b.preventDefault(),onPointerDownOutside:b=>b.preventDefault(),onInteractOutside:b=>b.preventDefault()},d),{children:jsxRuntime.jsx(h,p(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}E.Dismiss=e=>jsxRuntime.jsx(L__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(k.Plain,p(i({part:"close",position:"absolute",right:"-4px",top:"4px"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});E.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(L__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(C.Body2,p(i({part:"subtitle"},o),{children:e}))})};E.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsxRuntime.jsx(se,i({borderRadius:"md",src:e},o))};E.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(k.Primary,i({title:o,onClick:e},t))};E.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?w.colors.blue500:w.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsxRuntime.jsx(y,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};E.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(k.Secondary,i({title:o,onClick:e},t))};E.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(L__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(C.H3,p(i({part:"title"},o),{children:e}))})};E.displayName="Dialog";var _o=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function Qr(t){var r=t,{flowId:e}=r,o=u(r,["flowId"]);let n=Object.fromEntries(Object.entries(o).filter(([s])=>_o.some(d=>s===d))),a=Object.fromEntries(Object.entries(o).filter(([s])=>_o.indexOf(s)===-1));return jsxRuntime.jsx(j,p(i({as:null,flowId:e},n),{children:({flow:s,handleDismiss:d,handlePrimary:c,handleSecondary:m,parentProps:{dismissible:g},step:f})=>{var x,B,R,T,v,D;let b=(x=f.props)!=null?x:{},S=(R=(B=f.primaryButton)==null?void 0:B.title)!=null?R:f.primaryButtonTitle,F=(v=(T=f.secondaryButton)==null?void 0:T.title)!=null?v:f.secondaryButtonTitle;return jsxRuntime.jsx(E,p(i({part:"announcement",textAlign:"center"},a),{onEscapeKeyDown:J=>{typeof o.onEscapeKeyDown=="function"&&o.onEscapeKeyDown(J),J.defaultPrevented||d(J);},children:jsxRuntime.jsxs(P.Column,p(i({gap:5,part:"announcement-step"},b),{children:[g&&jsxRuntime.jsx(E.Dismiss,{onClick:d}),jsxRuntime.jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(E.Title,{children:f.title}),jsxRuntime.jsx(E.Subtitle,{children:f.subtitle})]}),jsxRuntime.jsx(E.Media,{src:(D=f.videoUri)!=null?D:f.imageUri,type:f.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(E.ProgressDots,{current:s.getCurrentStepIndex(),total:s.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(P.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[F&&jsxRuntime.jsx(E.Secondary,{onClick:m,title:F}),S&&jsxRuntime.jsx(E.Primary,{onClick:c,title:S})]})]}))}))}}))}function Zr(r){var n=r,{dismissible:e,flowId:o}=n,t=u(n,["dismissible","flowId"]);return jsxRuntime.jsx(j,{as:null,flowId:o,children:({handleDismiss:a,handlePrimary:s,handleSecondary:d,step:c})=>{var b,S,F,x,B;let m=(b=c.props)!=null?b:{},g=(F=(S=c.primaryButton)==null?void 0:S.title)!=null?F:c.primaryButtonTitle,f=(B=(x=c.secondaryButton)==null?void 0:x.title)!=null?B:c.secondaryButtonTitle;return jsxRuntime.jsxs(h,p(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:"banner"},t),m),{children:[c.imageUri&&jsxRuntime.jsx(y,{as:"img",part:"image",src:c.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(h.Title,{part:"title",children:c.title}),jsxRuntime.jsx(h.Subtitle,{part:"subtitle",children:c.subtitle})]}),jsxRuntime.jsx(h.Secondary,{title:f,onClick:d}),jsxRuntime.jsx(h.Primary,{title:g,onClick:s}),e&&jsxRuntime.jsx(h.Dismiss,{onClick:a})]}))}})}var Qe={};q(Qe,{Collapsible:()=>et,CollapsibleStep:()=>Ce});var Ce={};q(Ce,{Content:()=>Xe,Root:()=>qe,Trigger:()=>Ye});var on=react.keyframes`
|
|
49
|
+
var io=Object.defineProperty,vt=Object.defineProperties;var Bt=Object.getOwnPropertyDescriptors;var Te=Object.getOwnPropertySymbols;var ao=Object.prototype.hasOwnProperty,so=Object.prototype.propertyIsEnumerable;var no=(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={}))ao.call(o,t)&&no(e,t,o[t]);if(Te)for(var t of Te(o))so.call(o,t)&&no(e,t,o[t]);return e},p=(e,o)=>vt(e,Bt(o));var Rt=(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 u=(e,o)=>{var t={};for(var r in e)ao.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(e!=null&&Te)for(var r of Te(e))o.indexOf(r)<0&&so.call(e,r)&&(t[r]=e[r]);return t};var q=(e,o)=>{for(var t in o)io(e,t,{get:o[t],enumerable:!0});};var A=(e,o,t)=>new Promise((r,n)=>{var a=c=>{try{d(t.next(c));}catch(m){n(m);}},s=c=>{try{d(t.throw(c));}catch(m){n(m);}},d=c=>c.done?r(c.value):Promise.resolve(c.value).then(a,s);d((t=t.apply(e,o)).next());});var lo={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var we=[5,10,20,35,50,65,80,95,98],po=[...we],Le=[...we];po[4]=40;Le[4]=60;var kt={blue:{h:213,s:100,l:we},gray:{h:220,s:10,l:we},green:{h:141,s:90,l:po},red:{h:9,s:90,l:Le},yellow:{h:50,s:90,l:Le}};var O={};for(let[e,{h:o,s:t,l:r}]of Object.entries(kt))O[e]=Object.fromEntries(r.map((n,a)=>[`${(a+1)*100}`,`hsl(${o} ${t}% ${n}%)`]));var co=p(i({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},O),{gray100:O.gray[100],gray200:O.gray[200],gray300:O.gray[300],gray400:O.gray[400],gray500:O.gray[500],gray600:O.gray[600],gray700:O.gray[700],gray800:O.gray[800],gray900:O.gray[900],blue400:O.blue[400],blue500:O.blue[500],blue800:O.blue[800],blue900:O.blue[900],green400:O.blue[400],green500:O.green[500],green800:O.green[800],red500:O.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var uo={md:"10px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,mo={negative:{100:l("red-100"),200:l("red-200"),300:l("red-300"),400:l("red-400"),500:l("red-500"),600:l("red-600"),700:l("red-700"),800:l("red-800"),900:l("red-900"),background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500"),active:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")},focus:{background:l("negative-500"),border:l("negative-500"),foreground:l("white"),surface:l("negative-500")},hover:{background:l("negative-400"),border:l("negative-400"),foreground:l("white"),surface:l("negative-400")}},neutral:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("neutral-800"),foreground:l("black"),surface:l("neutral-700"),active:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},focus:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")},hover:{background:l("white"),border:l("neutral-900"),foreground:l("black"),surface:l("neutral-700")}},positive:{100:l("green-100"),200:l("green-200"),300:l("green-300"),400:l("green-400"),500:l("green-500"),600:l("green-600"),700:l("green-700"),800:l("green-800"),900:l("green-900"),background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500"),active:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")},focus:{background:l("positive-500"),border:l("positive-500"),foreground:l("white"),surface:l("positive-500")},hover:{background:l("positive-400"),border:l("positive-400"),foreground:l("white"),surface:l("positive-400")}},primary:{100:l("blue-100"),200:l("blue-200"),300:l("blue-300"),400:l("blue-400"),500:l("blue-500"),600:l("blue-600"),700:l("blue-700"),800:l("blue-800"),900:l("blue-900"),background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500"),active:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")},focus:{background:l("primary-500"),border:l("primary-500"),foreground:l("white"),surface:l("primary-500")},hover:{background:l("primary-400"),border:l("primary-400"),foreground:l("white"),surface:l("primary-400")}},secondary:{100:l("gray-100"),200:l("gray-200"),300:l("gray-300"),400:l("gray-400"),500:l("gray-500"),600:l("gray-600"),700:l("gray-700"),800:l("gray-800"),900:l("gray-900"),background:l("white"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900"),active:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")},focus:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-900")},hover:{background:l("secondary-900"),border:l("secondary-800"),foreground:l("black"),surface:l("secondary-800")}}};var fo={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Dt="px",Et=e=>typeof e=="number"?`${4*e}${Dt}`:e,Ot=[-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"],go=Object.fromEntries(Ot.map(e=>[e,Et(e)]));var yo={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 ve=p(i(p(i({},lo),{colors:i(i({},co),mo)}),yo),{radii:uo,shadows:fo,space:go});function xe(e,o="",t="."){return Object.keys(e).reduce((r,n)=>{let s=`${o.length?`${o}${t}`:""}${n}`,d=e[n];return typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(r,xe(d,s,t)):r[s]=d,r},{})}function $e(e){return xe(e,"--fr","-")}function xo(e,o="--fr"){let t={};return Object.keys(e).forEach(r=>{let n=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)?t[r]=xo(n,`${o}-${r}`):t[r]=`var(${o}-${r})`;}),t}var Ve=$e(ve),F=xo(ve);var Ht=new Set(["alt","size","src"]),Mt=It__default.default.all.filter(e=>e.indexOf("-")!=0&&!Ht.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Wt=Object.fromEntries(Mt),ze=xe(F.colors),At={color:ze,backgroundColor:ze,borderColor:ze,border:F.borders,borderRadius:F.radii,borderWidth:F.borderWidths,boxShadow:F.shadows,fontFamily:F.fontFamilies,fontSize:F.fontSizes,fontWeight:F.fontWeights,gap:F.space,lineHeight:F.lineHeights,margin:F.space,marginBottom:F.space,marginLeft:F.space,marginRight:F.space,marginTop:F.space,padding:F.space,paddingBottom:F.space,paddingLeft:F.space,paddingRight:F.space,paddingTop:F.space},bo=i(i({},Wt),At),ho={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"]},Po=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function Lt(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 Co=new Map(Object.entries(bo).map(([e,o])=>[e,Lt(o)])),$t=new Map(Object.entries(ho).map(([e,o])=>[e,new Set(o)])),Vt=new Set(["height","width"]),zt=new Set(["canvas","embed","iframe","img","input","object","video"]);function So(e){let[o,t]=e.split(":");return [o,Po.has(t)?t:null]}function Fo(e,o="div"){let t=Object.assign({},e),r={};function n(a){if(a==null)return r;let d=`&:${a.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return r[d]==null&&(r[d]={}),r[d]}return Object.entries(t).forEach(([a,s])=>{let[d,c]=So(a),m=$t.get(d);m!=null&&(m.forEach(f=>{let x=`${f}${c?":"+c:""}`;t[x]=s;}),delete t[a]);}),Object.entries(t).forEach(([a,s])=>{let[d,c]=So(a),m=Co.get(d);if(m!=null){if(s==null)delete t[a];else if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");n(c)[d]=f.map(x=>{var b;return (b=m.get(x.toString()))!=null?b:x}).join(" ");}else m.has(s.toString())?n(c)[d]=m.get(s.toString()):n(c)[d]=s;(typeof o!="string"||!zt.has(o)||!Vt.has(d))&&delete t[a];}}),Object.keys(t).forEach(a=>{let s=a.substring(1);a.indexOf("_")===0&&Co.has(s)&&(t[s]=t[a],delete t[a]);}),{cssFromProps:r,unmatchedProps:t}}function Kt(){if(typeof window=="undefined"){let{JSDOM:e}=Rt("jsdom");return new e("<!DOCTYPE html>").window}return window}function To(e){return e?{__html:Nt__default.default(Kt()).sanitize(e,{ALLOWED_TAGS:["b","i","a","span","div","p","pre","u","br","img","code","li","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function jt(e){return e&&`fr-${e}`}function Bo(e){return e&&(Array.isArray(e)?e.map(o=>Bo(o)).join(" "):jt(e))}function Ut(d,s){var c=d,{as:e,children:o,className:t,css:r={},part:n}=c,a=u(c,["as","children","className","css","part"]);let m=e!=null?e:"div",{cssFromProps:f,unmatchedProps:x}=Fo(a,m),b=Bo(n),g=t||b?clsx.clsx(t,b):void 0,S=[{boxSizing:"border-box"},f,r];return typeof o=="string"?jsxRuntime.jsx(m,p(i({className:g,css:S},x),{ref:s,dangerouslySetInnerHTML:To(o)})):jsxRuntime.jsx(m,p(i({className:g,css:S},x),{ref:s,children:o}))}var y=_e__namespace.forwardRef(Ut);var k={};q(k,{Link:()=>hr,Plain:()=>Pr,Primary:()=>xr,Secondary:()=>br});var C={};q(C,{Body1:()=>pr,Body2:()=>dr,Caption:()=>cr,Display1:()=>rr,Display2:()=>nr,H1:()=>ir,H2:()=>ar,H3:()=>sr,H4:()=>lr});var Ne={};q(Ne,{Body1:()=>Zt,Body2:()=>er,Caption:()=>or,Display1:()=>Gt,Display2:()=>Jt,H1:()=>Xt,H2:()=>qt,H3:()=>Yt,H4:()=>Qt});var Y={color:"neutral.foreground",fontFamily:"default",margin:"0"},Gt=p(i({},Y),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Jt=p(i({},Y),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Xt=p(i({},Y),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),qt=p(i({},Y),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),Yt=p(i({},Y),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Qt=p(i({},Y),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Zt=p(i({},Y),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),er=p(i({},Y),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),or=p(i({},Y),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var tr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],Q=Object.fromEntries(tr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=_e__namespace.forwardRef((d,s)=>{var c=d,{as:r=o,children:n}=c,a=u(c,["as","children"]);return jsxRuntime.jsx(y,p(i(i({as:r},Ne[e]),a),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),rr=Q.Display1,nr=Q.Display2,ir=Q.H1,ar=Q.H2,sr=Q.H3,lr=Q.H4,pr=Q.Body1,dr=Q.Body2,cr=Q.Caption;var Ke={};q(Ke,{Link:()=>gr,Plain:()=>yr,Primary:()=>mr,Secondary:()=>fr});var Be={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},mr=p(i({},Be),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),fr=p(i({},Be),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),gr=p(i({},Be),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),yr=p(i({},Be),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"});function Re(s){var d=s,{as:e,children:o,part:t,title:r,variant:n="Primary"}=d,a=u(d,["as","children","part","title","variant"]);let c=n.toLocaleLowerCase();return jsxRuntime.jsxs(y,p(i(i({as:e!=null?e:"button",part:[`button-${c}`,t]},Ke[n]),a),{children:[o,r&&jsxRuntime.jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:r})]}))}function xr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(Re,p(i({},o),{variant:"Primary",children:e}))}function br(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(Re,p(i({},o),{variant:"Secondary",children:e}))}function hr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(Re,p(i({},o),{variant:"Link",children:e}))}function Pr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(Re,p(i({},o),{variant:"Plain",children:e}))}var P={};q(P,{Column:()=>Fr,Row:()=>Sr});var Sr=_e__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,p(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Fr=_e__namespace.forwardRef((e,o)=>jsxRuntime.jsx(y,p(i({display:"flex",flexDirection:"column"},e),{ref:o})));var I=_e.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},registeredComponents:new Map});function Io(n){var a=n,{children:e,navigate:o,theme:t}=a,r=u(a,["children","navigate","theme"]);let s=t?$e(t):{},[d,c]=_e.useState(new Set),m=_e.useRef(new Map),f=_e.useRef(),[x,b]=_e.useState(!1),g=_e.useMemo(()=>new js.Frigade(r.apiKey,{apiKey:r.apiKey,apiUrl:r.apiUrl,userId:r.userId,groupId:r.groupId,__readOnly:r.__readOnly,__flowConfigOverrides:r.__flowConfigOverrides}),[r.userId,r.groupId,r.apiKey]);function S(){let w=[...m.current.entries()].map(([R,D])=>[R,D.callback]);g.batchRegister(w),b(!0);}function T(w,R){if(f.current&&clearTimeout(f.current),x){m.current.has(w)||(g.getFlow(w).then(D=>D.register(R)),m.current.set(w,{callback:R}));return}m.current.has(w)||m.current.set(w,{callback:R}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>S(),0);}let v=o!=null?o:(w,R="_self")=>{window.open(w,R);};_e.useEffect(()=>()=>{g.destroy();},[]);let B=d.size>0?d.values().next().value:null;return jsxRuntime.jsxs(I.Provider,{value:p(i({modals:d,setModals:c,currentModal:B,navigate:v},r),{frigade:g,registerComponent:T,hasInitialized:x,registeredComponents:m.current}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":i(i({},Ve),s)}}),jsxRuntime.jsx(react.ThemeProvider,{theme:F,children:e})]})}function re(e,o){let[t,r]=_e.useState(),[,n]=_e.useState(""),{frigade:a}=_e.useContext(I),s=_e.useCallback(d=>{d.id===e&&(o!=null&&o.variables&&d.applyVariables(o.variables),r(d),n(Math.random().toString()));},[o==null?void 0:o.variables]);return _e.useEffect(()=>(A(this,null,function*(){let d=yield a.getFlow(e);if(!d||a.hasFailedToLoad()){r(void 0);return}o!=null&&o.variables&&d.applyVariables(o.variables),r(d);}),a.onStateChange(s),()=>{a.removeStateChangeHandler(s);}),[s]),_e.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function ne(e,{onComplete:o,onDismiss:t}={}){let r=_e.useRef(null);return _e.useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&A(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:_e.useCallback(n=>A(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function ie(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=_e.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.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary:_e.useCallback((a,s,d=!0)=>A(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&&e.complete(s,d),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else e.complete(s,d),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:_e.useCallback((a,s)=>A(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 he(e,o=!0){let{currentModal:t,modals:r,setModals:n}=_e.useContext(I),[a,s]=_e.useState(!1);_e.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]),_e.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 d(){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:d}}function U(x){var b=x,{as:e,children:o,dismissible:t=!1,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:d,variables:c,forceMount:m}=b,f=u(b,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let{flow:g}=re(r,{variables:c}),{hasInitialized:S,registerComponent:T,registeredComponents:v}=_e.useContext(I),B=g==null?void 0:g.getCurrentStep(),{handleDismiss:w}=ne(g,{onComplete:n,onDismiss:a}),{handlePrimary:R,handleSecondary:D}=ie(B,{onPrimary:s,onSecondary:d}),M=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:W,removeModal:We}=he(g,M);_e.useEffect(()=>{!(g!=null&&g.isVisible)&&W&&We();},[g==null?void 0:g.isVisible,W]);let fe=m&&((g==null?void 0:g.isCompleted)||(g==null?void 0:g.isSkipped));if(!g||!fe&&!W||(T(r),!g.isVisible&&!fe)||!S)return null;(fe||!g.isCompleted&&!g.isSkipped)&&B.start();let de=e===null?_e.Fragment:e!=null?e:y;return jsxRuntime.jsx(de,p(i({},e===null?{}:f),{children:o({flow:g,handleDismiss:w,handlePrimary:R,handleSecondary:D,parentProps:i({dismissible:t,flowId:r,variables:c},f),step:B})}))}function $o(e){return jsxRuntime.jsx(U,p(i({as:h,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:"card"},e),{children:({handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a})=>{var c,m,f,x;let s=(m=(c=a.primaryButton)==null?void 0:c.title)!=null?m:a.primaryButtonTitle,d=(x=(f=a.secondaryButton)==null?void 0:f.title)!=null?x:a.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(h.Header,{dismissible:n,handleDismiss:o,subtitle:a.subtitle,title:a.title}),jsxRuntime.jsx(h.Media,{src:a.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(h.Secondary,{title:d,onClick:r}),jsxRuntime.jsx(h.Primary,{title:s,onClick:t})]})]})}}))}function je(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);return jsxRuntime.jsx(y,i({as:"img",part:["image",e],src:o},t))}function jr(e){var o,t,r,n;return e.includes("youtube")?`https://www.youtube.com/embed/${(o=e.split("v=")[1])==null?void 0:o.split("&")[0]}`:e.includes("vimeo")?`https://player.vimeo.com/video/${(t=e.split("vimeo.com/")[1])==null?void 0:t.split("&")[0]}`:e.includes("wistia")?`https://fast.wistia.net/embed/iframe/${(r=e.split("wistia.com/medias/")[1])==null?void 0:r.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(n=e.split("loom.com/share/")[1])==null?void 0:n.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function Ue(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);let a=jr(o);return a?jsxRuntime.jsx(y,i({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:a},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.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 ae(r){var n=r,{src:e,type:o}=n,t=u(n,["src","type"]);return jsxRuntime.jsx(o==="video"?Ue:je,i({src:e},t))}var h=_e__namespace.forwardRef((n,r)=>{var a=n,{children:e,flowId:o}=a,t=u(a,["children","flowId"]);var d;if(o!=null)return jsxRuntime.jsx($o,i({flowId:o},t));let s=(d=t.as)!=null?d:P.Column;return jsxRuntime.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}))});h.Dismiss=e=>jsxRuntime.jsx(k.Plain,p(i({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}));h.Header=a=>{var s=a,{dismissible:e,handleDismiss:o,subtitle:t,title:r}=s,n=u(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(P.Row,p(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsxRuntime.jsx(h.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsxRuntime.jsx(h.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(h.Subtitle,{color:"gray500",flexBasis:"100%",children:t})]}))};h.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(ae,i({borderRadius:"md",src:e},o))};h.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(k.Primary,i({title:o,onClick:e},t))};h.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(k.Secondary,i({title:o,onClick:e},t))};h.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,p(i({display:"block",part:"subtitle"},o),{children:e}))};h.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,p(i({display:"block",part:"title"},o),{children:e}))};var ke={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function No(e){let o=Object.fromEntries(ke.content.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),t=Object.fromEntries(ke.root.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0)),r={};for(let n of Object.keys(e))!ke.content.some(a=>a===n)&&!ke.root.some(a=>a===n)&&(r[n]=e[n]);return {contentProps:o,otherProps:r,rootProps:t}}function E(n){var a=n,{children:e,className:o,modal:t=!0}=a,r=u(a,["children","className","modal"]);let{rootProps:s,contentProps:d,otherProps:f}=No(r),x=f,{zIndex:c}=x,m=u(x,["zIndex"]);return jsxRuntime.jsx(V__namespace.Root,p(i({defaultOpen:!0,modal:t},s),{children:jsxRuntime.jsx(V__namespace.Portal,{children:jsxRuntime.jsxs(y,{className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsxRuntime.jsx(V__namespace.Overlay,{asChild:!0,children:jsxRuntime.jsx(y,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsxRuntime.jsx(V__namespace.Content,p(i({asChild:!0,onOpenAutoFocus:b=>b.preventDefault(),onPointerDownOutside:b=>b.preventDefault(),onInteractOutside:b=>b.preventDefault()},d),{children:jsxRuntime.jsx(h,p(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}E.Dismiss=e=>jsxRuntime.jsx(V__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(k.Plain,p(i({part:"close",position:"absolute",right:"-4px",top:"4px"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});E.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(V__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(C.Body2,p(i({part:"subtitle"},o),{children:e}))})};E.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsxRuntime.jsx(ae,i({borderRadius:"md",src:e},o))};E.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(k.Primary,i({title:o,onClick:e},t))};E.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?F.colors.blue500:F.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsxRuntime.jsx(y,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};E.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(k.Secondary,i({title:o,onClick:e},t))};E.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsxRuntime.jsx(V__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(C.H3,p(i({part:"title"},o),{children:e}))})};E.displayName="Dialog";var Ko=["dismissible","flowId","forceMount","onComplete","onDismiss","onPrimary","onSecondary","variables"];function Yr(t){var r=t,{flowId:e}=r,o=u(r,["flowId"]);let n=Object.fromEntries(Object.entries(o).filter(([s])=>Ko.some(d=>s===d))),a=Object.fromEntries(Object.entries(o).filter(([s])=>Ko.indexOf(s)===-1));return jsxRuntime.jsx(U,p(i({as:null,flowId:e},n),{children:({flow:s,handleDismiss:d,handlePrimary:c,handleSecondary:m,parentProps:{dismissible:f},step:x})=>{var T,v,B,w,R,D;let b=(T=x.props)!=null?T:{},g=(B=(v=x.primaryButton)==null?void 0:v.title)!=null?B:x.primaryButtonTitle,S=(R=(w=x.secondaryButton)==null?void 0:w.title)!=null?R:x.secondaryButtonTitle;return jsxRuntime.jsx(E,p(i({part:"announcement",textAlign:"center"},a),{onEscapeKeyDown:M=>{typeof o.onEscapeKeyDown=="function"&&o.onEscapeKeyDown(M),M.defaultPrevented||d(M);},children:jsxRuntime.jsxs(P.Column,p(i({gap:5,part:"announcement-step"},b),{children:[f&&jsxRuntime.jsx(E.Dismiss,{onClick:d}),jsxRuntime.jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsxRuntime.jsx(E.Title,{children:x.title}),jsxRuntime.jsx(E.Subtitle,{children:x.subtitle})]}),jsxRuntime.jsx(E.Media,{src:(D=x.videoUri)!=null?D:x.imageUri,type:x.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(E.ProgressDots,{current:s.getCurrentStepIndex(),total:s.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(P.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[S&&jsxRuntime.jsx(E.Secondary,{onClick:m,title:S}),g&&jsxRuntime.jsx(E.Primary,{onClick:c,title:g})]})]}))}))}}))}function Qr(r){var n=r,{dismissible:e,flowId:o}=n,t=u(n,["dismissible","flowId"]);return jsxRuntime.jsx(U,{as:null,flowId:o,children:({handleDismiss:a,handlePrimary:s,handleSecondary:d,step:c})=>{var b,g,S,T,v;let m=(b=c.props)!=null?b:{},f=(S=(g=c.primaryButton)==null?void 0:g.title)!=null?S:c.primaryButtonTitle,x=(v=(T=c.secondaryButton)==null?void 0:T.title)!=null?v:c.secondaryButtonTitle;return jsxRuntime.jsxs(h,p(i(i({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:"banner"},t),m),{children:[c.imageUri&&jsxRuntime.jsx(y,{as:"img",part:"image",src:c.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(h.Title,{part:"title",children:c.title}),jsxRuntime.jsx(h.Subtitle,{part:"subtitle",children:c.subtitle})]}),jsxRuntime.jsx(h.Secondary,{title:x,onClick:d}),jsxRuntime.jsx(h.Primary,{title:f,onClick:s}),e&&jsxRuntime.jsx(h.Dismiss,{onClick:a})]}))}})}var Qe={};q(Qe,{Collapsible:()=>Zo,CollapsibleStep:()=>Ce});var Ce={};q(Ce,{Content:()=>Xe,Root:()=>qe,Trigger:()=>Ye});var en=react.keyframes`
|
|
50
50
|
from {
|
|
51
51
|
height: 0;
|
|
52
52
|
opacity: 0;
|
|
@@ -55,7 +55,7 @@ var ao=Object.defineProperty,vt=Object.defineProperties;var Bt=Object.getOwnProp
|
|
|
55
55
|
height: var(--radix-collapsible-content-height);
|
|
56
56
|
opacity: 1;
|
|
57
57
|
}
|
|
58
|
-
`,
|
|
58
|
+
`,on=react.keyframes`
|
|
59
59
|
from {
|
|
60
60
|
height: var(--radix-collapsible-content-height);
|
|
61
61
|
opacity: 1;
|
|
@@ -64,34 +64,34 @@ var ao=Object.defineProperty,vt=Object.defineProperties;var Bt=Object.getOwnProp
|
|
|
64
64
|
height: 0;
|
|
65
65
|
opacity: 0;
|
|
66
66
|
}
|
|
67
|
-
`,rn=()=>jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function nn({checked:e=!1}){return jsxRuntime.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&&jsxRuntime.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:jsxRuntime.jsx(rn,{})})})}function Xe({children:e}){return jsxRuntime.jsx(ue__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${on} 300ms ease-out`},'&[data-state="closed"]':{animation:`${tn} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(y,{}),e]})})}function qe(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=u(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(ue__namespace.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsxRuntime.jsx(h,p(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function Ye({isCompleted:e,title:o}){return jsxRuntime.jsx(ue__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(P.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(nn,{checked:e}),jsxRuntime.jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Oe={};q(Oe,{Bar:()=>Ee,Dots:()=>Xo,Segments:()=>Yo});function Ee(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsxRuntime.jsx(y,p(i({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function Xo(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,d)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*d,cy:"4px",fill:e-1===d?w.colors.blue500:w.colors.blue800},d));return jsxRuntime.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 Yo(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=[...Array(o)].map((s,d)=>jsxRuntime.jsx(y,{backgroundColor:e-1===d?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},d));return jsxRuntime.jsx(P.Row,p(i({gap:1,height:"10px"},t),{children:a}))}var Qo=_e.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Zo({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var b,S,F,x,B,R;let{$state:{blocked:a,completed:s},subtitle:d,title:c}=n,m=(S=(b=n.primaryButton)==null?void 0:b.title)!=null?S:n.primaryButtonTitle,g=(x=(F=n.secondaryButton)==null?void 0:F.title)!=null?x:n.secondaryButtonTitle,f=(B=n.props)!=null?B:{};return jsxRuntime.jsxs(qe,p(i({open:t,onOpenChange:r},f),{children:[jsxRuntime.jsx(Ye,{isCompleted:s,title:c}),jsxRuntime.jsxs(Xe,{children:[jsxRuntime.jsx(h.Media,{aspectRatio:2.5,objectFit:"cover",src:(R=n.videoUri)!=null?R:n.imageUri,type:n.videoUri?"video":"image"}),jsxRuntime.jsx(h.Subtitle,{color:"gray500",children:d}),jsxRuntime.jsxs(P.Row,{gap:3,children:[jsxRuntime.jsx(h.Secondary,{disabled:!!(s||a),title:g,onClick:o}),jsxRuntime.jsx(h.Primary,{disabled:!!(s||a),title:m,onClick:e})]})]})]}))}var pn={default:Zo};function dn(r){var n=r,{flow:e,step:o}=n,t=u(n,["flow","step"]);var x;let{onPrimary:a,onSecondary:s,openStepId:d,setOpenStepId:c,stepTypes:m}=_e.useContext(Qo),{handlePrimary:g,handleSecondary:f}=ae(o,{onPrimary:a,onSecondary:s}),b=(d!=null?d:e.getCurrentStep().id)===o.id,S=(x=m[o.type])!=null?x:Zo;function F(B){return M(this,null,function*(){c(B?o.id:""),B&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(S,p(i({flow:e,onOpenChange:F,open:b,step:o},t),{handlePrimary:g,handleSecondary:f}),o.id)}function et(s){var d=s,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,stepTypes:n={}}=d,a=u(d,["dismissible","flowId","onPrimary","onSecondary","stepTypes"]);let[c,m]=_e.useState(null),g=i(i({},pn),n);return jsxRuntime.jsx(Qo.Provider,{value:{openStepId:c,setOpenStepId:m,onPrimary:t,onSecondary:r,stepTypes:g},children:jsxRuntime.jsx(j,p(i({as:h,borderWidth:"md",flowId:o,part:"checklist"},a),{children:F=>{var x=F,{flow:f,handleDismiss:b}=x,S=u(x,["flow","handleDismiss"]);let R=Array.from(f.steps.entries()).filter(([,D])=>D.$state.visible===!0).map(([,D])=>jsxRuntime.jsx(dn,p(i({flow:f,handleDismiss:b},S),{step:D}),D.id)),T=f.getNumberOfCompletedSteps(),v=f.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(h.Header,{dismissible:e,handleDismiss:b,part:"checklist-header",subtitle:f.subtitle,title:f.title}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(C.Body2,{fontWeight:"demibold",children:[T,"/",v]}),jsxRuntime.jsx(Ee,{current:T,total:v,flexGrow:1})]})]}),R]})}}))})}var fn=new Set(["required","min","max","minLength","maxLength","pattern"]);function gn({fieldComponent:e,control:o,fieldData:t,submit:r}){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 n=Object.fromEntries(Object.entries(t).filter(([s])=>fn.has(s))),a=reactHookForm.useController({name:t.id,control:o,rules:n});return jsxRuntime.jsx(e,p(i({},a),{fieldData:t,submit:r}))}function tt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a}){var S,F,x,B,R,T;let{control:s,handleSubmit:d}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),c=[],m=(S=a.props)!=null?S:{};function g(v,D){t(D,v);}(F=a.fields)==null||F.forEach(v=>{e[v.type]!=null&&c.push(jsxRuntime.jsx(gn,{control:s,fieldComponent:e[v.type],fieldData:v,submit:d(g)},v.id));});let f=(B=(x=a.primaryButton)==null?void 0:x.title)!=null?B:a.primaryButtonTitle,b=(T=(R=a.secondaryButton)==null?void 0:R.title)!=null?T:a.secondaryButtonTitle;return jsxRuntime.jsxs(P.Column,p(i({gap:5,part:"form-step"},m),{children:[jsxRuntime.jsx(h.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),c,jsxRuntime.jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[b&&jsxRuntime.jsx(k.Secondary,{title:b,onClick:r}),jsxRuntime.jsx(k.Primary,{title:f!=null?f:"Submit",onClick:d(g)})]},"form-footer")]}))}function rt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(C.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function nt({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(C.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"bold",mb:"2",display:"block",children:[e,t&&" *"]})}var Fe={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function oe({children:e,field:o,fieldData:t,fieldState:r}){var m;let{id:n,label:a,placeholder:s}=t,{error:d}=r,c=p(i(i(i({id:n},o),s?{placeholder:s}:{}),Fe),{"aria-invalid":!!d,value:(m=o.value)!=null?m:""});return jsxRuntime.jsxs(y,{part:"field",children:[jsxRuntime.jsx(nt,{id:n,required:!!t.required,children:a}),e(c),jsxRuntime.jsx(rt,{error:d})]})}var hn=()=>jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Pn=_e__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.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:[jsxRuntime.jsx(C.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(me__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.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:jsxRuntime.jsx(y,{as:me__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(hn,{})})})})]}));function lt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:a,value:s})=>jsxRuntime.jsx(Pn,{value:s,label:a},s));return jsxRuntime.jsx(oe,p(i({},e),{children:()=>jsxRuntime.jsx(me__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(P.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Fn=_e__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(A__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(y,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(A__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(C.Body2,{part:"field-select-option-label",children:e})})})}));function ct(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,a=r.map(({label:s,value:d})=>jsxRuntime.jsx(Fn,{value:d,label:s},d));return jsxRuntime.jsx(oe,p(i({},e),{children:()=>jsxRuntime.jsxs(A__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(A__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(C.Body2,p(i({},Fe),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(A__namespace.Value,{placeholder:n!=null?n:"Select one"}),jsxRuntime.jsx(A__namespace.Icon,{children:jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(A__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(y,p(i({},Fe),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(A__namespace.Viewport,{children:a})}))})]})}))}function mt(e){return jsxRuntime.jsx(oe,p(i({},e),{children:o=>jsxRuntime.jsx(C.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function gt(e){return jsxRuntime.jsx(oe,p(i({},e),{children:o=>jsxRuntime.jsx(C.Body2,i({as:"textarea",part:"field-textarea"},o))}))}var Tn={radio:lt,select:ct,text:mt,textarea:gt};function Ze(r){var n=r,{fieldTypes:e={},flowId:o}=n,t=u(n,["fieldTypes","flowId"]);let a=Object.assign({},Tn,e);return jsxRuntime.jsx(j,p(i({flowId:o,part:"form"},t),{children:s=>jsxRuntime.jsx(tt,i({fieldTypes:a},s))}))}var eo={};q(eo,{NPS:()=>ht});function bt({field:e,submit:o}){let t=[...Array(11)].map((r,n)=>{let a=e.value===n?k.Primary:k.Secondary;return jsxRuntime.jsx(a,{borderWidth:"1px",onClick:()=>{e.onChange(n),o();},title:`${n}`,css:{".fr-button-title":{fontSize:"15px"}}},n)});return jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(P.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:t}),jsxRuntime.jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(C.Caption,{part:"field-nps-left-label",color:"gray600",children:"Not likely at all"}),jsxRuntime.jsx(C.Caption,{part:"field-nps-right-label",color:"gray600",children:"Extremely likely"})]})]})}function ht(n){var a=n,{as:e=E,flowId:o,fieldTypes:t}=a,r=u(a,["as","flowId","fieldTypes"]);let{flow:s}=ne(o);return jsxRuntime.jsx(Ze,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:bt},t),modal:!1,onEscapeKeyDown:d=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(d),d.defaultPrevented||s.skip();},css:p(i({},!s||s.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"620px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function He(){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]=_e.useState(e),[r,n]=_e.useState(null),a=_e.useCallback(s=>{n(s);},[]);return _e.useLayoutEffect(()=>{if(!r)return;let s=()=>{let d=r.getBoundingClientRect();t(d);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:a}}var kn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function St(r){var n=r,{style:e={},part:o=""}=n,t=u(n,["style","part"]);return jsxRuntime.jsxs(y,p(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${kn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function Ft({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",d={top:"bottom",right:"left",bottom:"top",left:"right"};n[d[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 Me={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Tt(e,o){var a,s,d,c,m;let t=Object.fromEntries(Me.content.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),r=Object.fromEntries(Me.root.map(g=>[g,e[g]]).filter(g=>g[1]!==void 0)),n={};for(let g of Object.keys(e))!Me.content.includes(g)&&!Me.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"},f=(R,T)=>["top","bottom"].includes(T)?R=="after"?"marginLeft":"marginRight":R=="after"?"marginTop":"marginBottom",b=(d=t.alignOffset)!=null?d:0,S=(c=t.style)!=null?c:{},F=(m=t.side)!=null?m:"bottom",x=t.align;t.style=p(i({},S),{[f(x,F)]:b});let B=["top","bottom"].includes(F)?o.width:o.height;t.alignOffset=(B+b)*-1,t.align=g[x];}return {contentProps:t,otherProps:n,rootProps:r}}function W(s){var d=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=d,a=u(d,["anchor","children","className","spotlight","style"]);let{node:c,rect:m,ref:g}=He(),{node:f,rect:b,ref:S}=He(),{contentProps:F,otherProps:x,rootProps:B}=Tt(a,m),[R,T]=_e.useState(F.align),[v,D]=_e.useState(F.side),[J,V]=_e.useState(0),[fe,Ae]=_e.useState(0);if(c!==null){let _=c.getAttribute("data-align"),te=c.getAttribute("data-side");R!==_&&T(_),v!==te&&D(te);}let ee=_e.useRef(null);if(_e.useEffect(()=>{let _=document.querySelector(e);_!=null?(S(_),ee.current=_):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),_e.useEffect(()=>{function _(ge){if(ge.matches(e))return ge;let ce=ge.querySelectorAll(e);return ce.length>0?ce[0]:null}let te=new MutationObserver(ge=>{for(let ce of ge)if(ce.type==="childList"){for(let ye of ce.addedNodes){if(ye.nodeType!==Node.ELEMENT_NODE)continue;let re=_(ye);if(re!=null){S(re),ee.current=re,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",re);break}}for(let ye of ce.removedNodes){if(ye.nodeType!==Node.ELEMENT_NODE)continue;let re=_(ye);if(re!=null){S(null),ee.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",re);break}}}});return te.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>te.disconnect()},[]),_e.useEffect(()=>{let{scrollX:_,scrollY:te}=window;V(b.left+_),Ae(b.top+te);},[b.left,b.top]),f==null)return null;let Te="0";typeof window!="undefined"&&(Te=window.getComputedStyle(f).borderRadius);let no=Ft({props:a,alignAttr:R,sideAttr:v});return jsxRuntime.jsxs(X__namespace.Root,p(i({defaultOpen:!0},B),{children:[jsxRuntime.jsx(X__namespace.Anchor,{virtualRef:ee}),jsxRuntime.jsx(X__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r&&jsxRuntime.jsx(y,i({boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:Te,height:b.height,left:J,top:fe,width:b.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsxRuntime.jsx(X__namespace.Content,p(i({asChild:!0},F),{ref:g,children:jsxRuntime.jsxs(h,p(i({boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:n},x),{children:[jsxRuntime.jsx(St,{style:no}),o]}))}))]})})]}))}W.Close=e=>jsxRuntime.jsx(X__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(k.Plain,p(i({css:{top:"12px",right:"4px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});W.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsxRuntime.jsx(se,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};W.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(k.Primary,i({title:o,onClick:e},t))};W.Progress=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,p(i({part:"progress"},o),{children:e}))};W.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(k.Secondary,i({title:o,onClick:e},t))};W.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,p(i({part:"subtitle"},o),{children:e}))};W.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,p(i({part:"title"},o),{children:e}))};function wt(c){var m=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:a,step:s}=m,d=u(m,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var B,R,T,v,D,J;let{handleDismiss:g}=ie(o,{onDismiss:t}),{handlePrimary:f,handleSecondary:b}=ae(s,{onPrimary:n,onSecondary:a}),S=(B=s.props)!=null?B:{},F=(T=(R=s.primaryButton)==null?void 0:R.title)!=null?T:s.primaryButtonTitle,x=(D=(v=s.secondaryButton)==null?void 0:v.title)!=null?D:s.secondaryButtonTitle;return jsxRuntime.jsxs(W,p(i(i({anchor:s.selector,onOpenAutoFocus:V=>V.preventDefault(),onPointerDownOutside:V=>V.preventDefault(),onInteractOutside:V=>V.preventDefault()},d),S),{onEscapeKeyDown:V=>{typeof r=="function"&&r(V),V.defaultPrevented||g(V);},children:[e&&jsxRuntime.jsx(W.Close,{onClick:g}),jsxRuntime.jsx(W.Media,{src:(J=s.videoUri)!=null?J:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(W.Title,{children:s.title}),jsxRuntime.jsx(W.Subtitle,{color:"gray500",children:s.subtitle})]}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx(W.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepIndex()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(W.Secondary,{title:x,onClick:b}),jsxRuntime.jsx(W.Primary,{title:F,onClick:f})]})]}),s.id)}function Wn(n){var a=n,{flowId:e,onComplete:o,variables:t}=a,r=u(a,["flowId","onComplete","variables"]);let{flow:s}=ne(e,{variables:t}),{hasInitialized:d,registerComponent:c}=_e.useContext(I);ie(s,{onComplete:o});let{isCurrentModal:m,removeModal:g}=he(s);if(_e.useEffect(()=>{!(s!=null&&s.isVisible)&&m&&g();},[s==null?void 0:s.isVisible,m]),s==null||s.isVisible===!1||!m||(c(e),!d))return null;let f=s.getCurrentStep();return f==null||f.start(),jsxRuntime.jsx(wt,i({step:f,flow:s},r))}function $n(){let{frigade:e}=_e.useContext(I);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function zn(){let{userId:e,frigade:o}=_e.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 Kn(){let{frigade:e}=_e.useContext(I);function o(n){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,n);})}function t(n,a){return M(this,null,function*(){yield e.track(n,a);})}function r(n,a){return M(this,null,function*(){yield e.group(n,a);})}return {groupId:e.config.groupId,setGroupId:r,addProperties:o,track:t}}
|
|
67
|
+
`,tn=()=>jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function rn({checked:e=!1}){return jsxRuntime.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&&jsxRuntime.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:jsxRuntime.jsx(tn,{})})})}function Xe({children:e}){return jsxRuntime.jsx(ue__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(P.Column,{css:{'&[data-state="open"]':{animation:`${en} 300ms ease-out`},'&[data-state="closed"]':{animation:`${on} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(y,{}),e]})})}function qe(a){var s=a,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:r=!1}=s,n=u(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(ue__namespace.Root,{asChild:!0,disabled:o,open:r,onOpenChange:t,children:jsxRuntime.jsx(h,p(i({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},n),{children:e}))})}function Ye({isCompleted:e,title:o}){return jsxRuntime.jsx(ue__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(P.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(rn,{checked:e}),jsxRuntime.jsx(C.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"gray100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var Ee={};q(Ee,{Bar:()=>De,Dots:()=>Jo,Segments:()=>qo});function De(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=o>0?Math.min(e/o,1):0,s=a===0?"10px":`${100*a}%`;return jsxRuntime.jsx(y,p(i({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function Jo(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);if(o==1)return null;let a=[...Array(o)].map((s,d)=>jsxRuntime.jsx(y,{as:"circle",r:4,cx:4+16*d,cy:"4px",fill:e-1===d?F.colors.blue500:F.colors.blue800},d));return jsxRuntime.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 qo(r){var n=r,{current:e,total:o}=n,t=u(n,["current","total"]);let a=[...Array(o)].map((s,d)=>jsxRuntime.jsx(y,{backgroundColor:e-1===d?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},d));return jsxRuntime.jsx(P.Row,p(i({gap:1,height:"10px"},t),{children:a}))}var Yo=_e.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function Qo({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:r,step:n}){var b,g,S,T,v,B;let{$state:{blocked:a,completed:s},subtitle:d,title:c}=n,m=(g=(b=n.primaryButton)==null?void 0:b.title)!=null?g:n.primaryButtonTitle,f=(T=(S=n.secondaryButton)==null?void 0:S.title)!=null?T:n.secondaryButtonTitle,x=(v=n.props)!=null?v:{};return jsxRuntime.jsxs(qe,p(i({open:t,onOpenChange:r},x),{children:[jsxRuntime.jsx(Ye,{isCompleted:s,title:c}),jsxRuntime.jsxs(Xe,{children:[jsxRuntime.jsx(h.Media,{aspectRatio:2.5,objectFit:"cover",src:(B=n.videoUri)!=null?B:n.imageUri,type:n.videoUri?"video":"image"}),jsxRuntime.jsx(h.Subtitle,{color:"gray500",children:d}),jsxRuntime.jsxs(P.Row,{gap:3,children:[jsxRuntime.jsx(h.Secondary,{disabled:!!(s||a),title:f,onClick:o}),jsxRuntime.jsx(h.Primary,{disabled:!!(s||a),title:m,onClick:e})]})]})]}))}var ln={default:Qo};function pn(r){var n=r,{flow:e,step:o}=n,t=u(n,["flow","step"]);var T;let{onPrimary:a,onSecondary:s,openStepId:d,setOpenStepId:c,stepTypes:m}=_e.useContext(Yo),{handlePrimary:f,handleSecondary:x}=ie(o,{onPrimary:a,onSecondary:s}),b=(d!=null?d:e.getCurrentStep().id)===o.id,g=(T=m[o.type])!=null?T:Qo;function S(v){return A(this,null,function*(){c(v?o.id:""),v&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(g,p(i({flow:e,onOpenChange:S,open:b,step:o},t),{handlePrimary:f,handleSecondary:x}),o.id)}function Zo(s){var d=s,{dismissible:e,flowId:o,onPrimary:t,onSecondary:r,stepTypes:n={}}=d,a=u(d,["dismissible","flowId","onPrimary","onSecondary","stepTypes"]);let[c,m]=_e.useState(null),f=i(i({},ln),n);return jsxRuntime.jsx(Yo.Provider,{value:{openStepId:c,setOpenStepId:m,onPrimary:t,onSecondary:r,stepTypes:f},children:jsxRuntime.jsx(U,p(i({as:h,borderWidth:"md",flowId:o,part:"checklist"},a),{children:S=>{var T=S,{flow:x,handleDismiss:b}=T,g=u(T,["flow","handleDismiss"]);let B=Array.from(x.steps.entries()).filter(([,D])=>D.$state.visible===!0).map(([,D])=>jsxRuntime.jsx(pn,p(i({flow:x,handleDismiss:b},g),{step:D}),D.id)),w=x.getNumberOfCompletedSteps(),R=x.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(h.Header,{dismissible:e,handleDismiss:b,part:"checklist-header",subtitle:x.subtitle,title:x.title}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(C.Body2,{fontWeight:"demibold",children:[w,"/",R]}),jsxRuntime.jsx(De,{current:w,total:R,flexGrow:1})]})]}),B]})}}))})}var fn=new Set(["required","min","max","minLength","maxLength","pattern"]);function gn({fieldComponent:e,control:o,fieldData:t,submit:r}){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 n=Object.fromEntries(Object.entries(t).filter(([s])=>fn.has(s))),a=reactHookForm.useController({name:t.id,control:o,rules:n});return jsxRuntime.jsx(e,p(i({},a),{fieldData:t,submit:r}))}function ot({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:r,parentProps:{dismissible:n},step:a}){var T,v,B,w,R,D;let{control:s,handleSubmit:d}=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),[c,m]=_e.useState(!1),f=[],x=(T=a.props)!=null?T:{};function b(M,W){m(!0),t(W,M,!1).then(()=>m(!1));}(v=a.fields)==null||v.forEach(M=>{e[M.type]!=null&&f.push(jsxRuntime.jsx(gn,{control:s,fieldComponent:e[M.type],fieldData:M,submit:d(b)},`${a.flow.id}-${M.id}`));});let g=(w=(B=a.primaryButton)==null?void 0:B.title)!=null?w:a.primaryButtonTitle,S=(D=(R=a.secondaryButton)==null?void 0:R.title)!=null?D:a.secondaryButtonTitle;return jsxRuntime.jsxs(P.Column,p(i({gap:5,part:"form-step"},x),{children:[jsxRuntime.jsx(h.Header,{dismissible:n,handleDismiss:o,part:"form-step-header",subtitle:a.subtitle,title:a.title}),f,jsxRuntime.jsxs(P.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[S&&jsxRuntime.jsx(k.Secondary,{title:S,onClick:r}),jsxRuntime.jsx(k.Primary,{title:g!=null?g:"Submit",onClick:d(b),disabled:c})]},"form-footer")]}))}function tt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(C.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function rt({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(C.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"bold",mb:"2",display:"block",children:[e,t&&" *"]})}var Fe={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function ee({children:e,field:o,fieldData:t,fieldState:r}){var m;let{id:n,label:a,placeholder:s}=t,{error:d}=r,c=p(i(i(i({id:n},o),s?{placeholder:s}:{}),Fe),{"aria-invalid":!!d,value:(m=o.value)!=null?m:""});return jsxRuntime.jsxs(y,{part:"field",children:[jsxRuntime.jsx(rt,{id:n,required:!!t.required,children:a}),e(c),jsxRuntime.jsx(tt,{error:d})]})}var hn=()=>jsxRuntime.jsx(y,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Pn=_e__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.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:[jsxRuntime.jsx(C.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(me__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.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:jsxRuntime.jsx(y,{as:me__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(hn,{})})})})]}));function st(e){let{field:{onChange:o,value:t},fieldData:{options:r=[]}}=e,n=r.map(({label:a,value:s})=>jsxRuntime.jsx(Pn,{value:s,label:a},s));return jsxRuntime.jsx(ee,p(i({},e),{children:()=>jsxRuntime.jsx(me__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(P.Column,{gap:2,part:"field-radio-group",children:n})})}))}var Fn=_e__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx($__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(y,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx($__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(C.Body2,{part:"field-select-option-label",children:e})})})}));function dt(e){let{field:{onChange:o,value:t},fieldData:{options:r=[],placeholder:n}}=e,a=r.map(({label:s,value:d})=>jsxRuntime.jsx(Fn,{value:d,label:s},d));return jsxRuntime.jsx(ee,p(i({},e),{children:()=>jsxRuntime.jsxs($__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx($__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(C.Body2,p(i({},Fe),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx($__namespace.Value,{placeholder:n!=null?n:"Select one"}),jsxRuntime.jsx($__namespace.Icon,{children:jsxRuntime.jsx(y,{as:outline.ChevronDownIcon,color:"gray100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx($__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(y,p(i({},Fe),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx($__namespace.Viewport,{children:a})}))})]})}))}function ut(e){return jsxRuntime.jsx(ee,p(i({},e),{children:o=>jsxRuntime.jsx(C.Body2,i({as:"input",part:"field-text",type:"text"},o))}))}function ft(e){return jsxRuntime.jsx(ee,p(i({},e),{children:o=>jsxRuntime.jsx(C.Body2,i({as:"textarea",part:"field-textarea"},o))}))}var Tn={radio:st,select:dt,text:ut,textarea:ft};function Ze(r){var n=r,{fieldTypes:e={},flowId:o}=n,t=u(n,["fieldTypes","flowId"]);let a=Object.assign({},Tn,e);return jsxRuntime.jsx(U,p(i({flowId:o,part:"form"},t),{children:s=>jsxRuntime.jsx(ot,i({fieldTypes:a},s))}))}var eo={};q(eo,{NPS:()=>bt});function xt({field:e,submit:o}){let t=[...Array(11)].map((r,n)=>{let a=e.value===n?k.Primary:k.Secondary;return jsxRuntime.jsx(a,{borderWidth:"1px",onClick:()=>{e.onChange(n),o();},title:`${n}`,css:{".fr-button-title":{fontSize:"15px"}}},n)});return jsxRuntime.jsxs(P.Column,{gap:2,children:[jsxRuntime.jsx(P.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:t}),jsxRuntime.jsxs(P.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(C.Caption,{part:"field-nps-left-label",color:"gray600",children:"Not likely at all"}),jsxRuntime.jsx(C.Caption,{part:"field-nps-right-label",color:"gray600",children:"Extremely likely"})]})]})}function bt(n){var a=n,{as:e=E,flowId:o,fieldTypes:t}=a,r=u(a,["as","flowId","fieldTypes"]);let{flow:s}=re(o);return jsxRuntime.jsx(Ze,i({alignSelf:"end",as:e,flowId:o,fieldTypes:i({nps:xt},t),modal:!1,onEscapeKeyDown:d=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(d),d.defaultPrevented||s.skip();},css:p(i({},!s||s.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"620px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function Ie(){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]=_e.useState(e),[r,n]=_e.useState(null),a=_e.useCallback(s=>{n(s);},[]);return _e.useLayoutEffect(()=>{if(!r)return;let s=()=>{let d=r.getBoundingClientRect();t(d);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[r]),{node:r,rect:o,ref:a}}var kn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Ct(r){var n=r,{style:e={},part:o=""}=n,t=u(n,["style","part"]);return jsxRuntime.jsxs(y,p(i({part:`dot-wrapper ${o}`,style:i({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${kn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(y,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function St({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",d={top:"bottom",right:"left",bottom:"top",left:"right"};n[d[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 He={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Ft(e,o){var a,s,d,c,m;let t=Object.fromEntries(He.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r=Object.fromEntries(He.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n={};for(let f of Object.keys(e))!He.content.includes(f)&&!He.root.includes(f)&&(n[f]=e[f]);if(t.align=(a=t.align)!=null?a:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},x=(B,w)=>["top","bottom"].includes(w)?B=="after"?"marginLeft":"marginRight":B=="after"?"marginTop":"marginBottom",b=(d=t.alignOffset)!=null?d:0,g=(c=t.style)!=null?c:{},S=(m=t.side)!=null?m:"bottom",T=t.align;t.style=p(i({},g),{[x(T,S)]:b});let v=["top","bottom"].includes(S)?o.width:o.height;t.alignOffset=(v+b)*-1,t.align=f[T];}return {contentProps:t,otherProps:n,rootProps:r}}function L(s){var d=s,{anchor:e,children:o,className:t,spotlight:r=!1,style:n}=d,a=u(d,["anchor","children","className","spotlight","style"]);let{node:c,rect:m,ref:f}=Ie(),{node:x,rect:b,ref:g}=Ie(),{contentProps:S,otherProps:T,rootProps:v}=Ft(a,m),[B,w]=_e.useState(S.align),[R,D]=_e.useState(S.side),[M,W]=_e.useState(0),[We,fe]=_e.useState(0);if(c!==null){let j=c.getAttribute("data-align"),oe=c.getAttribute("data-side");B!==j&&w(j),R!==oe&&D(oe);}let de=_e.useRef(null);if(_e.useEffect(()=>{let j=document.querySelector(e);j!=null?(g(j),de.current=j):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),_e.useEffect(()=>{function j(ge){if(ge.matches(e))return ge;let ce=ge.querySelectorAll(e);return ce.length>0?ce[0]:null}let oe=new MutationObserver(ge=>{for(let ce of ge)if(ce.type==="childList"){for(let ye of ce.addedNodes){if(ye.nodeType!==Node.ELEMENT_NODE)continue;let te=j(ye);if(te!=null){g(te),de.current=te,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",te);break}}for(let ye of ce.removedNodes){if(ye.nodeType!==Node.ELEMENT_NODE)continue;let te=j(ye);if(te!=null){g(null),de.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",te);break}}}});return oe.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>oe.disconnect()},[]),_e.useEffect(()=>{let{scrollX:j,scrollY:oe}=window;W(b.left+j),fe(b.top+oe);},[b.left,b.top]),x==null)return null;let Ae="0";typeof window!="undefined"&&(Ae=window.getComputedStyle(x).borderRadius);let wt=St({props:a,alignAttr:B,sideAttr:R});return jsxRuntime.jsxs(X__namespace.Root,p(i({defaultOpen:!0},v),{children:[jsxRuntime.jsx(X__namespace.Anchor,{virtualRef:de}),jsxRuntime.jsx(X__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[r&&jsxRuntime.jsx(y,i({boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:Ae,height:b.height,left:M,top:We,width:b.width}},a.zIndex!=null?{zIndex:a.zIndex}:{})),jsxRuntime.jsx(X__namespace.Content,p(i({asChild:!0},S),{ref:f,children:jsxRuntime.jsxs(h,p(i({boxShadow:"md",part:"tooltip",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},style:n},T),{children:[jsxRuntime.jsx(Ct,{style:wt}),o]}))}))]})})]}))}L.Close=e=>jsxRuntime.jsx(X__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(k.Plain,p(i({css:{top:"12px",right:"4px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})}))});L.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsxRuntime.jsx(ae,i({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};L.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(k.Primary,i({title:o,onClick:e},t))};L.Progress=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,p(i({part:"progress"},o),{children:e}))};L.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsxRuntime.jsx(k.Secondary,i({title:o,onClick:e},t))};L.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.Body2,p(i({part:"subtitle"},o),{children:e}))};L.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null:jsxRuntime.jsx(C.H4,p(i({part:"title"},o),{children:e}))};function Tt(c){var m=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:r,onPrimary:n,onSecondary:a,step:s}=m,d=u(m,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var v,B,w,R,D,M;let{handleDismiss:f}=ne(o,{onDismiss:t}),{handlePrimary:x,handleSecondary:b}=ie(s,{onPrimary:n,onSecondary:a}),g=(v=s.props)!=null?v:{},S=(w=(B=s.primaryButton)==null?void 0:B.title)!=null?w:s.primaryButtonTitle,T=(D=(R=s.secondaryButton)==null?void 0:R.title)!=null?D:s.secondaryButtonTitle;return jsxRuntime.jsxs(L,p(i(i({anchor:s.selector,onOpenAutoFocus:W=>W.preventDefault(),onPointerDownOutside:W=>W.preventDefault(),onInteractOutside:W=>W.preventDefault()},d),g),{onEscapeKeyDown:W=>{typeof r=="function"&&r(W),W.defaultPrevented||f(W);},children:[e&&jsxRuntime.jsx(L.Close,{onClick:f}),jsxRuntime.jsx(L.Media,{src:(M=s.videoUri)!=null?M:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(P.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx(L.Title,{children:s.title}),jsxRuntime.jsx(L.Subtitle,{color:"gray500",children:s.subtitle})]}),jsxRuntime.jsxs(P.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx(L.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepIndex()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(L.Secondary,{title:T,onClick:b}),jsxRuntime.jsx(L.Primary,{title:S,onClick:x})]})]}),s.id)}function Wn(n){var a=n,{flowId:e,onComplete:o,variables:t}=a,r=u(a,["flowId","onComplete","variables"]);let{flow:s}=re(e,{variables:t}),{hasInitialized:d,registerComponent:c,registeredComponents:m}=_e.useContext(I);ne(s,{onComplete:o});let{isCurrentModal:f,removeModal:x}=he(s);if(_e.useEffect(()=>{!(s!=null&&s.isVisible)&&f&&x();},[s==null?void 0:s.isVisible,f]),s==null||s.isVisible===!1||!f||(c(e),!d||!m.has(e)))return null;let b=s.getCurrentStep();return b==null||b.start(),jsxRuntime.jsx(Tt,i({step:b,flow:s},r))}function $n(){let{frigade:e}=_e.useContext(I);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function zn(){let{userId:e,frigade:o}=_e.useContext(I);function t(n){return A(this,null,function*(){yield o.identify(e,n);})}function r(n,a){return A(this,null,function*(){yield o.track(n,a);})}return {userId:e,addProperties:t,track:r}}function Kn(){let{frigade:e}=_e.useContext(I);function o(n){return A(this,null,function*(){if(!e.config.groupId){console.error("No Group ID is set. Cannot set properties without a Group ID.");return}yield e.group(e.config.groupId,n);})}function t(n,a){return A(this,null,function*(){yield e.track(n,a);})}function r(n,a){return A(this,null,function*(){yield e.group(n,a);})}return {groupId:e.config.groupId,setGroupId:r,addProperties:o,track:t}}
|
|
68
68
|
|
|
69
69
|
exports.FrigadeJS = js__namespace;
|
|
70
|
-
exports.Announcement =
|
|
71
|
-
exports.Banner =
|
|
70
|
+
exports.Announcement = Yr;
|
|
71
|
+
exports.Banner = Qr;
|
|
72
72
|
exports.Box = y;
|
|
73
73
|
exports.Button = k;
|
|
74
74
|
exports.Card = h;
|
|
75
75
|
exports.Checklist = Qe;
|
|
76
76
|
exports.Dialog = E;
|
|
77
77
|
exports.Flex = P;
|
|
78
|
-
exports.Flow =
|
|
78
|
+
exports.Flow = U;
|
|
79
79
|
exports.Form = Ze;
|
|
80
|
-
exports.Progress =
|
|
81
|
-
exports.Provider =
|
|
80
|
+
exports.Progress = Ee;
|
|
81
|
+
exports.Provider = Io;
|
|
82
82
|
exports.Survey = eo;
|
|
83
83
|
exports.Text = C;
|
|
84
|
-
exports.Tooltip =
|
|
84
|
+
exports.Tooltip = L;
|
|
85
85
|
exports.Tour = Wn;
|
|
86
86
|
exports.themeVariables = Ve;
|
|
87
|
-
exports.tokens =
|
|
88
|
-
exports.useBoundingClientRect =
|
|
89
|
-
exports.useFlow =
|
|
90
|
-
exports.useFlowHandlers =
|
|
87
|
+
exports.tokens = ve;
|
|
88
|
+
exports.useBoundingClientRect = Ie;
|
|
89
|
+
exports.useFlow = re;
|
|
90
|
+
exports.useFlowHandlers = ne;
|
|
91
91
|
exports.useFrigade = $n;
|
|
92
92
|
exports.useGroup = Kn;
|
|
93
93
|
exports.useModal = he;
|
|
94
|
-
exports.useStepHandlers =
|
|
94
|
+
exports.useStepHandlers = ie;
|
|
95
95
|
exports.useUser = zn;
|
|
96
96
|
//# sourceMappingURL=out.js.map
|
|
97
97
|
//# sourceMappingURL=index.cjs.map
|