@frigade/react 2.1.3 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import * as ue from '@radix-ui/react-radio-group';
17
17
  import * as W from '@radix-ui/react-select';
18
18
  import * as J from '@radix-ui/react-popover';
19
19
 
20
- var ao=Object.defineProperty,wt=Object.defineProperties;var vt=Object.getOwnPropertyDescriptors;var Te=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(Te)for(var t of Te(o))lo.call(o,t)&&io(e,t,o[t]);return e},p=(e,o)=>wt(e,vt(o));var Bt=(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&&Te)for(var r of Te(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 we=[5,10,20,35,50,65,80,95,98],co=[...we],Ae=[...we];co[4]=40;Ae[4]=60;var Rt={blue:{h:213,s:100,l:we},gray:{h:220,s:10,l:we},green:{h:141,s:90,l:co},red:{h:9,s:90,l:Ae},yellow:{h:50,s:90,l:Ae}};var D={};for(let[e,{h:o,s:t,l:r}]of Object.entries(Rt))D[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%)"},D),{gray100:D.gray[100],gray200:D.gray[200],gray300:D.gray[300],gray400:D.gray[400],gray500:D.gray[500],gray600:D.gray[600],gray700:D.gray[700],gray800:D.gray[800],gray900:D.gray[900],blue400:D.blue[400],blue500:D.blue[500],blue800:D.blue[800],blue900:D.blue[900],green400:D.blue[400],green500:D.green[500],green800:D.green[800],red500:D.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 kt="px",Dt=e=>typeof e=="number"?`${4*e}${kt}`:e,Et=[-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(Et.map(e=>[e,Dt(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 ve=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 Le(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 $e=Le(ve),S=bo(ve);var It=new Set(["alt","size","src"]),Ht=Ot.all.filter(e=>e.indexOf("-")!=0&&!It.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Mt=Object.fromEntries(Ht),Ve=xe(S.colors),Wt={color:Ve,backgroundColor:Ve,borderColor:Ve,border:S.borders,borderRadius:S.radii,borderWidth:S.borderWidths,boxShadow:S.shadows,fontFamily:S.fontFamilies,fontSize:S.fontSizes,fontWeight:S.fontWeights,gap:S.space,lineHeight:S.lineHeights,margin:S.space,marginBottom:S.space,marginLeft:S.space,marginRight:S.space,marginTop:S.space,padding:S.space,paddingBottom:S.space,paddingLeft:S.space,paddingRight:S.space,paddingTop:S.space},ho=i(i({},Mt),Wt),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 At(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,At(o)])),Lt=new Map(Object.entries(Po).map(([e,o])=>[e,new Set(o)])),$t=new Set(["height","width"]),Vt=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=Lt.get(d);m!=null&&(m.forEach(x=>{let y=`${x}${c?":"+c:""}`;t[y]=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 x=s.split(" ");n(c)[d]=x.map(y=>{var b;return (b=m.get(y.toString()))!=null?b:y}).join(" ");}else m.has(s.toString())?n(c)[d]=m.get(s.toString()):n(c)[d]=s;(typeof o!="string"||!Vt.has(o)||!$t.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}=Bt("jsdom");return new e("<!DOCTYPE html>").window}return window}function wo(e){return e?{__html:Nt(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 _t(e){return e&&`fr-${e}`}function Ro(e){return e&&(Array.isArray(e)?e.map(o=>Ro(o)).join(" "):_t(e))}function jt(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:x,unmatchedProps:y}=To(a,m),b=Ro(n),f=t||b?clsx(t,b):void 0,F=[{boxSizing:"border-box"},x,r];return typeof o=="string"?jsx(m,p(i({className:f,css:F},y),{ref:s,dangerouslySetInnerHTML:wo(o)})):jsx(m,p(i({className:f,css:F},y),{ref:s,children:o}))}var g=ze.forwardRef(jt);var v={};q(v,{Link:()=>br,Plain:()=>hr,Primary:()=>yr,Secondary:()=>xr});var C={};q(C,{Body1:()=>lr,Body2:()=>pr,Caption:()=>dr,Display1:()=>tr,Display2:()=>rr,H1:()=>nr,H2:()=>ir,H3:()=>ar,H4:()=>sr});var Ne={};q(Ne,{Body1:()=>Qt,Body2:()=>Zt,Caption:()=>er,Display1:()=>Ut,Display2:()=>Gt,H1:()=>Xt,H2:()=>Jt,H3:()=>qt,H4:()=>Yt});var Y={color:"neutral.foreground",fontFamily:"default",margin:"0"},Ut=p(i({},Y),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Gt=p(i({},Y),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Xt=p(i({},Y),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Jt=p(i({},Y),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),qt=p(i({},Y),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Yt=p(i({},Y),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Qt=p(i({},Y),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Zt=p(i({},Y),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),er=p(i({},Y),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var or=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],Q=Object.fromEntries(or.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=ze.forwardRef((d,s)=>{var c=d,{as:r=o,children:n}=c,a=u(c,["as","children"]);return jsx(g,p(i(i({as:r},Ne[e]),a),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),tr=Q.Display1,rr=Q.Display2,nr=Q.H1,ir=Q.H2,ar=Q.H3,sr=Q.H4,lr=Q.Body1,pr=Q.Body2,dr=Q.Caption;var Ke={};q(Ke,{Link:()=>fr,Plain:()=>gr,Primary:()=>ur,Secondary:()=>mr});var Be={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},ur=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"}),mr=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"}),fr=p(i({},Be),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),gr=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 jsxs(g,p(i(i({as:e!=null?e:"button",part:[`button-${c}`,t]},Ke[n]),a),{children:[o,r&&jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:r})]}))}function yr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(Re,p(i({},o),{variant:"Primary",children:e}))}function xr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(Re,p(i({},o),{variant:"Secondary",children:e}))}function br(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(Re,p(i({},o),{variant:"Link",children:e}))}function hr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(Re,p(i({},o),{variant:"Plain",children:e}))}var P={};q(P,{Column:()=>Sr,Row:()=>Cr});var Cr=ze.forwardRef((e,o)=>jsx(g,p(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Sr=ze.forwardRef((e,o)=>jsx(g,p(i({display:"flex",flexDirection:"column"},e),{ref:o})));var A=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function Oo(n){var a=n,{children:e,navigate:o,theme:t}=a,r=u(a,["children","navigate","theme"]);let s=t?Le(t):{},[d,c]=useState(new Set),m=useMemo(()=>new 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]),x=o!=null?o:(b,f="_self")=>{window.open(b,f);};useEffect(()=>()=>{m.destroy();},[]);let y=d.size>0?d.values().next().value:null;return jsxs(A.Provider,{value:p(i({modals:d,setModals:c,currentModal:y,navigate:x},r),{frigade:m}),children:[jsx(Global,{styles:{":root":i(i({},$e),s)}}),jsx(ThemeProvider,{theme:S,children:e})]})}function re(e,o){let[t,r]=useState(),[,n]=useState(""),{frigade:a}=useContext(A),s=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 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]),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=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&M(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(n=>M(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function ie(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(A),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: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: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}=useContext(A),[a,s]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function 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 X(y){var b=y,{as:e,children:o,dismissible:t=!1,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:d,variables:c,forceMount:m}=b,x=u(b,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let{flow:f}=re(r,{variables:c}),[F,T]=useState(!1),w=f==null?void 0:f.getCurrentStep(),{handleDismiss:B}=ne(f,{onComplete:n,onDismiss:a}),{handlePrimary:O,handleSecondary:R}=ie(w,{onPrimary:s,onSecondary:d}),H=e&&typeof e=="function"&&(e.displayName==="Dialog"||e.displayName==="Modal"),{isCurrentModal:z,removeModal:V}=he(f,H);useEffect(()=>{!(f!=null&&f.isVisible)&&z&&V();},[f==null?void 0:f.isVisible,z]),useEffect(()=>{f==null||f.register(()=>{T(!0);});},[f]),useEffect(()=>()=>{f==null||f.unregister();},[f]);let me=m&&((f==null?void 0:f.isCompleted)||(f==null?void 0:f.isSkipped));if(!f||!me&&!z||!f.isVisible&&!me||!F)return null;(me||!f.isCompleted&&!f.isSkipped)&&w.start();let We=e===null?Fragment$1:e!=null?e:g;return jsx(We,p(i({},e===null?{}:x),{children:o({flow:f,handleDismiss:B,handlePrimary:O,handleSecondary:R,parentProps:i({dismissible:t,flowId:r,variables:c},x),step:w})}))}function Lo(e){return jsx(X,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,x,y;let s=(m=(c=a.primaryButton)==null?void 0:c.title)!=null?m:a.primaryButtonTitle,d=(y=(x=a.secondaryButton)==null?void 0:x.title)!=null?y:a.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(h.Header,{dismissible:n,handleDismiss:o,subtitle:a.subtitle,title:a.title}),jsx(h.Media,{src:a.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(h.Secondary,{title:d,onClick:r}),jsx(h.Primary,{title:s,onClick:t})]})]})}}))}function je(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);return jsx(g,i({as:"img",part:["image",e],src:o},t))}function _r(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=_r(o);return a?jsx(g,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")?jsx(g,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ae(r){var n=r,{src:e,type:o}=n,t=u(n,["src","type"]);return jsx(o==="video"?Ue:je,i({src:e},t))}var h=ze.forwardRef((n,r)=>{var a=n,{children:e,flowId:o}=a,t=u(a,["children","flowId"]);var d;if(o!=null)return jsx(Lo,i({flowId:o},t));let s=(d=t.as)!=null?d:P.Column;return jsx(s,p(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});h.Dismiss=e=>jsx(v.Plain,p(i({part:"dismiss",padding:0},e),{children:jsx(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 jsxs(P.Row,p(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsx(h.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsx(h.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(h.Subtitle,{color:"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: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:jsx(v.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:jsx(v.Secondary,i({title:o,onClick:e},t))};h.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null: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: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 k(n){var a=n,{children:e,className:o,modal:t=!0}=a,r=u(a,["children","className","modal"]);let{rootProps:s,contentProps:d,otherProps:x}=No(r),y=x,{zIndex:c}=y,m=u(y,["zIndex"]);return jsx(L.Root,p(i({defaultOpen:!0,modal:t},s),{children:jsx(L.Portal,{children:jsxs(g,{className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsx(L.Overlay,{asChild:!0,children:jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(L.Content,p(i({asChild:!0,onOpenAutoFocus:b=>b.preventDefault(),onPointerDownOutside:b=>b.preventDefault(),onInteractOutside:b=>b.preventDefault()},d),{children:jsx(h,p(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}k.Dismiss=e=>jsx(L.Close,{"aria-label":"Close",asChild:!0,children:jsx(v.Plain,p(i({part:"close",position:"absolute",right:"-4px",top:"4px"},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}))});k.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsx(L.Description,{asChild:!0,children:jsx(C.Body2,p(i({part:"subtitle"},o),{children:e}))})};k.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsx(ae,i({borderRadius:"md",src:e},o))};k.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsx(v.Primary,i({title:o,onClick:e},t))};k.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(g,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?S.colors.blue500:S.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};k.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsx(v.Secondary,i({title:o,onClick:e},t))};k.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsx(L.Title,{asChild:!0,children:jsx(C.H3,p(i({part:"title"},o),{children:e}))})};k.displayName="Dialog";var Ko=["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])=>Ko.some(d=>s===d))),a=Object.fromEntries(Object.entries(o).filter(([s])=>Ko.indexOf(s)===-1));return jsx(X,p(i({as:null,flowId:e},n),{children:({flow:s,handleDismiss:d,handlePrimary:c,handleSecondary:m,parentProps:{dismissible:x},step:y})=>{var T,w,B,O,R,H;let b=(T=y.props)!=null?T:{},f=(B=(w=y.primaryButton)==null?void 0:w.title)!=null?B:y.primaryButtonTitle,F=(R=(O=y.secondaryButton)==null?void 0:O.title)!=null?R:y.secondaryButtonTitle;return jsx(k,p(i({part:"announcement",textAlign:"center"},a),{onEscapeKeyDown:z=>{typeof o.onEscapeKeyDown=="function"&&o.onEscapeKeyDown(z),z.defaultPrevented||d(z);},children:jsxs(P.Column,p(i({gap:5,part:"announcement-step"},b),{children:[x&&jsx(k.Dismiss,{onClick:d}),jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsx(k.Title,{children:y.title}),jsx(k.Subtitle,{children:y.subtitle})]}),jsx(k.Media,{src:(H=y.videoUri)!=null?H:y.imageUri,type:y.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(k.ProgressDots,{current:s.getNumberOfCompletedSteps(),total:s.getNumberOfAvailableSteps()}),jsxs(P.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[F&&jsx(k.Secondary,{onClick:m,title:F}),f&&jsx(k.Primary,{onClick:c,title:f})]})]}))}))}}))}function Yr(r){var n=r,{dismissible:e,flowId:o}=n,t=u(n,["dismissible","flowId"]);return jsx(X,{as:null,flowId:o,children:({handleDismiss:a,handlePrimary:s,handleSecondary:d,step:c})=>{var b,f,F,T,w;let m=(b=c.props)!=null?b:{},x=(F=(f=c.primaryButton)==null?void 0:f.title)!=null?F:c.primaryButtonTitle,y=(w=(T=c.secondaryButton)==null?void 0:T.title)!=null?w:c.secondaryButtonTitle;return 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&&jsx(g,{as:"img",part:"image",src:c.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(h.Title,{part:"title",children:c.title}),jsx(h.Subtitle,{part:"subtitle",children:c.subtitle})]}),jsx(h.Secondary,{title:y,onClick:d}),jsx(h.Primary,{title:x,onClick:s}),e&&jsx(h.Dismiss,{onClick:a})]}))}})}var Qe={};q(Qe,{Collapsible:()=>Qo,CollapsibleStep:()=>Ce});var Ce={};q(Ce,{Content:()=>Je,Root:()=>qe,Trigger:()=>Ye});var Zr=keyframes`
20
+ var ao=Object.defineProperty,wt=Object.defineProperties;var vt=Object.getOwnPropertyDescriptors;var Te=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(Te)for(var t of Te(o))lo.call(o,t)&&io(e,t,o[t]);return e},p=(e,o)=>wt(e,vt(o));var Bt=(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&&Te)for(var r of Te(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 we=[5,10,20,35,50,65,80,95,98],co=[...we],Ae=[...we];co[4]=40;Ae[4]=60;var Rt={blue:{h:213,s:100,l:we},gray:{h:220,s:10,l:we},green:{h:141,s:90,l:co},red:{h:9,s:90,l:Ae},yellow:{h:50,s:90,l:Ae}};var D={};for(let[e,{h:o,s:t,l:r}]of Object.entries(Rt))D[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%)"},D),{gray100:D.gray[100],gray200:D.gray[200],gray300:D.gray[300],gray400:D.gray[400],gray500:D.gray[500],gray600:D.gray[600],gray700:D.gray[700],gray800:D.gray[800],gray900:D.gray[900],blue400:D.blue[400],blue500:D.blue[500],blue800:D.blue[800],blue900:D.blue[900],green400:D.blue[400],green500:D.green[500],green800:D.green[800],red500:D.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 kt="px",Dt=e=>typeof e=="number"?`${4*e}${kt}`:e,Et=[-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(Et.map(e=>[e,Dt(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 ve=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 Le(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 $e=Le(ve),S=bo(ve);var It=new Set(["alt","size","src"]),Ht=Ot.all.filter(e=>e.indexOf("-")!=0&&!It.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Mt=Object.fromEntries(Ht),Ve=xe(S.colors),Wt={color:Ve,backgroundColor:Ve,borderColor:Ve,border:S.borders,borderRadius:S.radii,borderWidth:S.borderWidths,boxShadow:S.shadows,fontFamily:S.fontFamilies,fontSize:S.fontSizes,fontWeight:S.fontWeights,gap:S.space,lineHeight:S.lineHeights,margin:S.space,marginBottom:S.space,marginLeft:S.space,marginRight:S.space,marginTop:S.space,padding:S.space,paddingBottom:S.space,paddingLeft:S.space,paddingRight:S.space,paddingTop:S.space},ho=i(i({},Mt),Wt),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 At(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,At(o)])),Lt=new Map(Object.entries(Po).map(([e,o])=>[e,new Set(o)])),$t=new Set(["height","width"]),Vt=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=Lt.get(d);m!=null&&(m.forEach(x=>{let y=`${x}${c?":"+c:""}`;t[y]=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 x=s.split(" ");n(c)[d]=x.map(y=>{var b;return (b=m.get(y.toString()))!=null?b:y}).join(" ");}else m.has(s.toString())?n(c)[d]=m.get(s.toString()):n(c)[d]=s;(typeof o!="string"||!Vt.has(o)||!$t.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}=Bt("jsdom");return new e("<!DOCTYPE html>").window}return window}function wo(e){return e?{__html:Nt(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 _t(e){return e&&`fr-${e}`}function Ro(e){return e&&(Array.isArray(e)?e.map(o=>Ro(o)).join(" "):_t(e))}function jt(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:x,unmatchedProps:y}=To(a,m),b=Ro(n),f=t||b?clsx(t,b):void 0,F=[{boxSizing:"border-box"},x,r];return typeof o=="string"?jsx(m,p(i({className:f,css:F},y),{ref:s,dangerouslySetInnerHTML:wo(o)})):jsx(m,p(i({className:f,css:F},y),{ref:s,children:o}))}var g=ze.forwardRef(jt);var v={};q(v,{Link:()=>br,Plain:()=>hr,Primary:()=>yr,Secondary:()=>xr});var C={};q(C,{Body1:()=>lr,Body2:()=>pr,Caption:()=>dr,Display1:()=>tr,Display2:()=>rr,H1:()=>nr,H2:()=>ir,H3:()=>ar,H4:()=>sr});var Ne={};q(Ne,{Body1:()=>Qt,Body2:()=>Zt,Caption:()=>er,Display1:()=>Ut,Display2:()=>Gt,H1:()=>Xt,H2:()=>Jt,H3:()=>qt,H4:()=>Yt});var Y={color:"neutral.foreground",fontFamily:"default",margin:"0"},Ut=p(i({},Y),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),Gt=p(i({},Y),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),Xt=p(i({},Y),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),Jt=p(i({},Y),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),qt=p(i({},Y),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),Yt=p(i({},Y),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),Qt=p(i({},Y),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),Zt=p(i({},Y),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),er=p(i({},Y),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var or=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],Q=Object.fromEntries(or.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=ze.forwardRef((d,s)=>{var c=d,{as:r=o,children:n}=c,a=u(c,["as","children"]);return jsx(g,p(i(i({as:r},Ne[e]),a),{ref:s,children:n}))});return t.displayName=`Text.${e}`,[e,t]})),tr=Q.Display1,rr=Q.Display2,nr=Q.H1,ir=Q.H2,ar=Q.H3,sr=Q.H4,lr=Q.Body1,pr=Q.Body2,dr=Q.Caption;var Ke={};q(Ke,{Link:()=>fr,Plain:()=>gr,Primary:()=>ur,Secondary:()=>mr});var Be={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4"},ur=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"}),mr=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"}),fr=p(i({},Be),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),gr=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 jsxs(g,p(i(i({as:e!=null?e:"button",part:[`button-${c}`,t]},Ke[n]),a),{children:[o,r&&jsx(C.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"demibold",part:"button-title",children:r})]}))}function yr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(Re,p(i({},o),{variant:"Primary",children:e}))}function xr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(Re,p(i({},o),{variant:"Secondary",children:e}))}function br(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(Re,p(i({},o),{variant:"Link",children:e}))}function hr(t){var r=t,{children:e}=r,o=u(r,["children"]);return jsx(Re,p(i({},o),{variant:"Plain",children:e}))}var P={};q(P,{Column:()=>Sr,Row:()=>Cr});var Cr=ze.forwardRef((e,o)=>jsx(g,p(i({display:"flex",flexDirection:"row"},e),{ref:o}))),Sr=ze.forwardRef((e,o)=>jsx(g,p(i({display:"flex",flexDirection:"column"},e),{ref:o})));var A=createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{}});function Oo(n){var a=n,{children:e,navigate:o,theme:t}=a,r=u(a,["children","navigate","theme"]);let s=t?Le(t):{},[d,c]=useState(new Set),m=useMemo(()=>new 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]),x=o!=null?o:(b,f="_self")=>{window.open(b,f);};useEffect(()=>()=>{m.destroy();},[]);let y=d.size>0?d.values().next().value:null;return jsxs(A.Provider,{value:p(i({modals:d,setModals:c,currentModal:y,navigate:x},r),{frigade:m}),children:[jsx(Global,{styles:{":root":i(i({},$e),s)}}),jsx(ThemeProvider,{theme:S,children:e})]})}function re(e,o){let[t,r]=useState(),[,n]=useState(""),{frigade:a}=useContext(A),s=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 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]),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=useRef(null);return useEffect(()=>{e!=null&&(e.isCompleted&&r.current===!1&&M(this,null,function*(){yield o==null?void 0:o(e);}),r.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:useCallback(n=>M(this,null,function*(){if((yield t==null?void 0:t(e,n))===!1)return n.preventDefault(),!1;e.skip();}),[e])}}function ie(e,{onPrimary:o,onSecondary:t}={}){let{navigate:r}=useContext(A),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(),e.flow.forward();},"step.reset":()=>e.reset(),"step.start":()=>e.start()};return {handlePrimary: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.flow.forward()),e.primaryButton.uri!=null&&r(e.primaryButton.uri,e.primaryButton.target);}else e.complete(s),e.flow.forward(),e.primaryButtonUri!=null&&r(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:useCallback((a,s)=>M(this,null,function*(){if((yield t==null?void 0:t(e,a))===!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}=useContext(A),[a,s]=useState(!1);useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!r.has(e.id)&&n(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==a&&s(c);},[e==null?void 0:e.id,t]);function 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 X(y){var b=y,{as:e,children:o,dismissible:t=!1,flowId:r,onComplete:n,onDismiss:a,onPrimary:s,onSecondary:d,variables:c,forceMount:m}=b,x=u(b,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let{flow:f}=re(r,{variables:c}),[F,T]=useState(!1),w=f==null?void 0:f.getCurrentStep(),{handleDismiss:B}=ne(f,{onComplete:n,onDismiss:a}),{handlePrimary:O,handleSecondary:R}=ie(w,{onPrimary:s,onSecondary:d}),H=e&&typeof e=="function"&&(e.displayName==="Dialog"||e.displayName==="Modal"),{isCurrentModal:z,removeModal:V}=he(f,H);useEffect(()=>{!(f!=null&&f.isVisible)&&z&&V();},[f==null?void 0:f.isVisible,z]),useEffect(()=>{f==null||f.register(()=>{T(!0);});},[f]),useEffect(()=>()=>{f==null||f.unregister();},[f]);let me=m&&((f==null?void 0:f.isCompleted)||(f==null?void 0:f.isSkipped));if(!f||!me&&!z||!f.isVisible&&!me||!F)return null;(me||!f.isCompleted&&!f.isSkipped)&&w.start();let We=e===null?Fragment$1:e!=null?e:g;return jsx(We,p(i({},e===null?{}:x),{children:o({flow:f,handleDismiss:B,handlePrimary:O,handleSecondary:R,parentProps:i({dismissible:t,flowId:r,variables:c},x),step:w})}))}function Lo(e){return jsx(X,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,x,y;let s=(m=(c=a.primaryButton)==null?void 0:c.title)!=null?m:a.primaryButtonTitle,d=(y=(x=a.secondaryButton)==null?void 0:x.title)!=null?y:a.secondaryButtonTitle;return jsxs(Fragment,{children:[jsx(h.Header,{dismissible:n,handleDismiss:o,subtitle:a.subtitle,title:a.title}),jsx(h.Media,{src:a.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxs(P.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsx(h.Secondary,{title:d,onClick:r}),jsx(h.Primary,{title:s,onClick:t})]})]})}}))}function je(r){var n=r,{part:e,src:o}=n,t=u(n,["part","src"]);return jsx(g,i({as:"img",part:["image",e],src:o},t))}function _r(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=_r(o);return a?jsx(g,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")?jsx(g,i({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ae(r){var n=r,{src:e,type:o}=n,t=u(n,["src","type"]);return jsx(o==="video"?Ue:je,i({src:e},t))}var h=ze.forwardRef((n,r)=>{var a=n,{children:e,flowId:o}=a,t=u(a,["children","flowId"]);var d;if(o!=null)return jsx(Lo,i({flowId:o},t));let s=(d=t.as)!=null?d:P.Column;return jsx(s,p(i({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:r,children:e}))});h.Dismiss=e=>jsx(v.Plain,p(i({part:"dismiss",padding:0},e),{children:jsx(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 jsxs(P.Row,p(i({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},n),{children:[jsx(h.Title,{maxWidth:"calc(100% - 32px)",children:r}),e&&jsx(h.Dismiss,{onClick:o,marginLeft:"auto"}),jsx(h.Subtitle,{color:"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: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:jsx(v.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:jsx(v.Secondary,i({title:o,onClick:e},t))};h.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return e==null?null: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: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 k(n){var a=n,{children:e,className:o,modal:t=!0}=a,r=u(a,["children","className","modal"]);let{rootProps:s,contentProps:d,otherProps:x}=No(r),y=x,{zIndex:c}=y,m=u(y,["zIndex"]);return jsx(L.Root,p(i({defaultOpen:!0,modal:t},s),{children:jsx(L.Portal,{children:jsxs(g,{className:o,display:"grid",inset:"0",padding:"6",part:"dialog-wrapper",pointerEvents:"none",position:"fixed",zIndex:c,children:[jsx(L.Overlay,{asChild:!0,children:jsx(g,{background:"rgb(0 0 0 / 0.5)",inset:"0",part:"dialog-overlay",position:"absolute"})}),jsx(L.Content,p(i({asChild:!0,onOpenAutoFocus:b=>b.preventDefault(),onPointerDownOutside:b=>b.preventDefault(),onInteractOutside:b=>b.preventDefault()},d),{children:jsx(h,p(i({alignSelf:"center",boxShadow:"md",justifySelf:"center",maxWidth:"430px",p:8,part:"dialog",pointerEvents:"auto",position:"relative"},m),{children:e}))}))]})})}))}k.Dismiss=e=>jsx(L.Close,{"aria-label":"Close",asChild:!0,children:jsx(v.Plain,p(i({part:"close",position:"absolute",right:"-4px",top:"4px"},e),{children:jsx(XMarkIcon,{height:"24",fill:"currentColor"})}))});k.Subtitle=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsx(L.Description,{asChild:!0,children:jsx(C.Body2,p(i({part:"subtitle"},o),{children:e}))})};k.Media=t=>{var r=t,{src:e}=r,o=u(r,["src"]);return e==null?null:jsx(ae,i({borderRadius:"md",src:e},o))};k.Primary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsx(v.Primary,i({title:o,onClick:e},t))};k.ProgressDots=({current:e,total:o})=>{if(o==1)return null;let t=[...Array(o)].map((r,n)=>jsx(g,{as:"circle",r:4,cx:4+16*n,cy:"4px",fill:e===n?S.colors.blue500:S.colors.blue800,part:e===n?"progress-dot-selected":"progress-dot"},n));return jsx(g,{as:"svg",height:"8px",marginInline:"auto",part:"progress",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8,children:t})};k.Secondary=r=>{var n=r,{onClick:e,title:o}=n,t=u(n,["onClick","title"]);return o==null?null:jsx(v.Secondary,i({title:o,onClick:e},t))};k.Title=t=>{var r=t,{children:e}=r,o=u(r,["children"]);return jsx(L.Title,{asChild:!0,children:jsx(C.H3,p(i({part:"title"},o),{children:e}))})};k.displayName="Dialog";var Ko=["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])=>Ko.some(d=>s===d))),a=Object.fromEntries(Object.entries(o).filter(([s])=>Ko.indexOf(s)===-1));return jsx(X,p(i({as:null,flowId:e},n),{children:({flow:s,handleDismiss:d,handlePrimary:c,handleSecondary:m,parentProps:{dismissible:x},step:y})=>{var T,w,B,O,R,H;let b=(T=y.props)!=null?T:{},f=(B=(w=y.primaryButton)==null?void 0:w.title)!=null?B:y.primaryButtonTitle,F=(R=(O=y.secondaryButton)==null?void 0:O.title)!=null?R:y.secondaryButtonTitle;return jsx(k,p(i({part:"announcement",textAlign:"center"},a),{onEscapeKeyDown:z=>{typeof o.onEscapeKeyDown=="function"&&o.onEscapeKeyDown(z),z.defaultPrevented||d(z);},children:jsxs(P.Column,p(i({gap:5,part:"announcement-step"},b),{children:[x&&jsx(k.Dismiss,{onClick:d}),jsxs(P.Column,{gap:1,part:"announcement-header",children:[jsx(k.Title,{children:y.title}),jsx(k.Subtitle,{children:y.subtitle})]}),jsx(k.Media,{src:(H=y.videoUri)!=null?H:y.imageUri,type:y.videoUri?"video":"image",css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsx(k.ProgressDots,{current:s.getCurrentStepIndex(),total:s.getNumberOfAvailableSteps()}),jsxs(P.Row,{css:{"& > button":{flexBasis:"50%",flexGrow:1}},gap:3,part:"announcement-footer",children:[F&&jsx(k.Secondary,{onClick:m,title:F}),f&&jsx(k.Primary,{onClick:c,title:f})]})]}))}))}}))}function Yr(r){var n=r,{dismissible:e,flowId:o}=n,t=u(n,["dismissible","flowId"]);return jsx(X,{as:null,flowId:o,children:({handleDismiss:a,handlePrimary:s,handleSecondary:d,step:c})=>{var b,f,F,T,w;let m=(b=c.props)!=null?b:{},x=(F=(f=c.primaryButton)==null?void 0:f.title)!=null?F:c.primaryButtonTitle,y=(w=(T=c.secondaryButton)==null?void 0:T.title)!=null?w:c.secondaryButtonTitle;return 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&&jsx(g,{as:"img",part:"image",src:c.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxs(P.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsx(h.Title,{part:"title",children:c.title}),jsx(h.Subtitle,{part:"subtitle",children:c.subtitle})]}),jsx(h.Secondary,{title:y,onClick:d}),jsx(h.Primary,{title:x,onClick:s}),e&&jsx(h.Dismiss,{onClick:a})]}))}})}var Qe={};q(Qe,{Collapsible:()=>Qo,CollapsibleStep:()=>Ce});var Ce={};q(Ce,{Content:()=>Je,Root:()=>qe,Trigger:()=>Ye});var Zr=keyframes`
21
21
  from {
22
22
  height: 0;
23
23
  opacity: 0;