@frigade/react 2.0.0-alpha.28 → 2.0.0-alpha.29
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 +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -37,22 +37,22 @@ var Xe__default = /*#__PURE__*/_interopDefault(Xe);
|
|
|
37
37
|
var rt__default = /*#__PURE__*/_interopDefault(rt);
|
|
38
38
|
var S__namespace = /*#__PURE__*/_interopNamespace(S);
|
|
39
39
|
|
|
40
|
-
var je=Object.defineProperty;var _e=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var te=(e,t)=>{for(var o in t)je(e,o,{get:t[o],enumerable:!0});};var oe={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var re={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",inherit:"inherit",red500:"#c00000"};var ne={md:"10px",lg:"20px",round:"50%"};var a=e=>`var(--fr-colors-${e})`,ie={neutral:{background:a("white"),border:a("gray500"),foreground:a("black"),surface:a("gray700"),active:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},focus:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},hover:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")}},primary:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500"),active:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")},focus:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500")},hover:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")}},secondary:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900"),active:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")},focus:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900")},hover:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")}}};var se={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Ue="px",Ne=e=>typeof e=="number"?`${4*e}${Ue}`:e,Je=[-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"],ae=Object.fromEntries(Je.map(e=>[e,Ne(e)]));var le={fontFamilies:{default:"TT Interphases Pro, sans-serif"},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 z={...oe,colors:{...re,...ie},...le,radii:ne,shadows:se,space:ae};function A(e,t="",o="."){return Object.keys(e).reduce((n,r)=>{let i=`${t.length?`${t}${o}`:""}${r}`,l=e[r];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(n,A(l,i,o)):n[i]=l,n},{})}function K(e){return A(e,"--fr","-")}function pe(e,t="--fr"){let o={};return Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&r!==null&&!Array.isArray(r)?o[n]=pe(r,`${t}-${n}`):o[n]=`var(${t}-${n})`;}),o}var de=K(z),d=pe(z);var Ge=new Set(["alt","size","src"]),qe=Xe__default.default.all.filter(e=>e.indexOf("-")!=0&&!Ge.has(e)).map(e=>[e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()),null]),Ye=Object.fromEntries(qe),j=A(d.colors),Qe={color:j,backgroundColor:j,borderColor:j,border:d.borders,borderRadius:d.radii,borderWidth:d.borderWidths,boxShadow:d.shadows,fontFamily:d.fontFamilies,fontSize:d.fontSizes,fontWeight:d.fontWeights,gap:d.space,lineHeight:d.lineHeights,margin:d.space,marginBottom:d.space,marginLeft:d.space,marginRight:d.space,marginTop:d.space,padding:d.space,paddingBottom:d.space,paddingLeft:d.space,paddingRight:d.space,paddingTop:d.space},ce={...Ye,...Qe},ue={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"]};function Ze(e){return Array.isArray(e)?new Map(e.map(t=>[t,t])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):["string","number"].includes(typeof e)?new Map([e,e]):new Map}var me=new Map(Object.entries(ce).map(([e,t])=>[e,Ze(t)])),et=new Map(Object.entries(ue).map(([e,t])=>[e,new Set(t)])),tt=new Set(["height","width"]),ot=new Set(["canvas","embed","iframe","img","input","object","video"]);function fe(e,t="div"){let o=Object.assign({},e),n={};return Object.entries(o).forEach(([r,s])=>{let i=et.get(r);i!=null&&(i.forEach(l=>{o[l]=s;}),delete o[r]);}),Object.entries(o).forEach(([r,s])=>{let i=me.get(r);if(i!=null){if(typeof s=="string"&&s.indexOf(" ")>-1){let l=s.split(" ");n[r]=l.map(p=>i.get(p.toString())??p).join(" ");}else i.has(s.toString())?n[r]=i.get(s.toString()):n[r]=s;(typeof t!="string"||!ot.has(t)||!tt.has(r))&&delete o[r];}}),Object.keys(o).forEach(r=>{let s=r.substring(1);r.indexOf("_")===0&&me.has(s)&&(o[s]=o[r],delete o[r]);}),{cssFromProps:n,unmatchedProps:o}}function nt(){if(typeof window>"u"){let{JSDOM:e}=_e("jsdom");return new e("<!DOCTYPE html>").window}return window}function ge(e){return e?{__html:rt__default.default(nt()).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"]})}:{__html:""}}function st(e){return e&&`fr-${e}`}function he(e){return e&&(Array.isArray(e)?e.map(t=>he(t)).join(" "):st(e))}function at({as:e,children:t,className:o,css:n,part:r,...s},i){let l=e??"div",{cssFromProps:p,unmatchedProps:u}=fe(s,l),f=he(r),R=o||f?clsx.clsx(o,f):void 0,M=[{boxSizing:"border-box"},p,n];return typeof t=="string"?jsxRuntime.jsx(l,{className:R,css:M,...u,ref:i,dangerouslySetInnerHTML:ge(t)}):jsxRuntime.jsx(l,{className:R,css:M,...u,ref:i,children:t})}var c=N__namespace.forwardRef(at);var _={};te(_,{Body1:()=>ft,Body2:()=>gt,Caption:()=>xt,Display1:()=>lt,Display2:()=>pt,H1:()=>dt,H2:()=>ct,H3:()=>ut,H4:()=>mt});var C={color:"neutral.foreground",fontFamily:"default",margin:"0"},lt={...C,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},pt={...C,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},dt={...C,fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"},ct={...C,fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"},ut={...C,fontSize:"xl",fontWeight:"bold",lineHeight:"lg"},mt={...C,fontSize:"lg",fontWeight:"bold",lineHeight:"md"},ft={...C,fontSize:"md",fontWeight:"regular",lineHeight:"md"},gt={...C,fontSize:"sm",fontWeight:"regular",lineHeight:"md"},xt={...C,fontSize:"xs",fontWeight:"regular",lineHeight:"sm"};function Pe({as:e="span",children:t,variant:o="Body1",...n}){return jsxRuntime.jsx(c,{as:e,..._[o],...n,children:t})}var yt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],ht=Object.fromEntries(yt.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=n=>jsxRuntime.jsx(Pe,{as:t,...n,variant:e,children:n.children});return o.displayName=`Text.${e}`,[e,o]})),P=Object.assign(Pe,ht);var U={};te(U,{Link:()=>Tt,Plain:()=>St,Primary:()=>Pt,Secondary:()=>bt,base:()=>$});var $=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),Pt=({colors:e})=>[$,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],bt=({colors:e})=>[$,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],Tt=({colors:e})=>[$,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],St=({colors:e})=>[$,{backgroundColor:e.transparent,color:e.neutral.foreground}];function Te({as:e,children:t,part:o,title:n,variant:r="Primary",...s}){let i=r.toLocaleLowerCase();return jsxRuntime.jsxs(c,{as:e??"button",css:U[r],part:[`button-${i}`,o],...s,children:[t,n&&jsxRuntime.jsx(P.Body2,{fontWeight:"demibold",color:"inherit",children:n})]})}var Ct=["Primary","Secondary","Link","Plain"],wt=Object.fromEntries(Ct.map(e=>{let t=o=>jsxRuntime.jsx(Te,{...o,variant:e,children:o.children});return t.displayName=`Text.${e}`,[e,t]})),b=Object.assign(Te,wt);var Rt=N__namespace.forwardRef(({children:e,css:t,...o},n)=>jsxRuntime.jsx(c,{css:[{display:"flex",flexDirection:"row"},t],...o,ref:n,children:e})),vt=N__namespace.forwardRef(({children:e,css:t,...o},n)=>jsxRuntime.jsx(c,{css:[{display:"flex",flexDirection:"column"},t],...o,ref:n,children:e})),T={Column:vt,Row:Rt};var v=N__namespace.forwardRef(({as:e,children:t,...o},n)=>{let r=e??T.Column;return jsxRuntime.jsx(r,{backgroundColor:"neutral.background",borderRadius:"md",p:5,...o,ref:n,children:t})});function Be({part:e,src:t,...o}){return jsxRuntime.jsx(c,{as:"img",part:["image",e],src:t,...o})}function Dt(e){var t,o,n;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Re({part:e,src:t,...o}){let n=Dt(t);return jsxRuntime.jsx(c,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:n,...o})}function W({src:e,type:t,...o}){return jsxRuntime.jsx(t==="video"?Re:Be,{src:e,...o})}function x({children:e,...t}){return jsxRuntime.jsx(y__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsxs(y__namespace.Portal,{children:[jsxRuntime.jsx(y__namespace.Overlay,{style:{background:"rgb(0 0 0 / 0.5)",position:"fixed",inset:0}}),jsxRuntime.jsx(y__namespace.Content,{asChild:!0,onOpenAutoFocus:o=>o.preventDefault(),onPointerDownOutside:o=>o.preventDefault(),children:jsxRuntime.jsx(v,{boxShadow:"md",css:{left:"50%",maxWidth:430,top:"50%",transform:"translate(-50%, -50%)"},p:8,position:"fixed",textAlign:"center",...t,children:e})})]})})}x.Close=e=>jsxRuntime.jsx(y__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(b.Plain,{css:{top:"4px",right:"-4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});x.Subtitle=({children:e,...t})=>jsxRuntime.jsx(y__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(P.Body2,{part:"subtitle",mb:5,...t,children:e})});x.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx(W,{borderRadius:"md",src:e,...t});x.Primary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(b.Primary,{title:t,onClick:e,...o});x.ProgressDots=({current:e,total:t})=>{let o=[...Array(t)].map((n,r)=>jsxRuntime.jsx("circle",{r:4,cx:4+16*r,cy:"4px",fill:e===r?d.colors.blue500:d.colors.blue800},r));return jsxRuntime.jsx(c,{as:"svg",width:16*t-8,height:"8px",viewBox:`0 0 ${16*t-8} 8`,margin:"5 auto",children:o})};x.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(b.Secondary,{title:t,onClick:e,...o});x.Title=({children:e,...t})=>jsxRuntime.jsx(y__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(P.H3,{mb:1,part:"title",...t,children:e})});var w=N.createContext({apiKey:"",modals:[],setModals:()=>{},navigate:()=>{}});function zt({children:e,navigate:t,theme:o,...n}){let r=o?K(o):{},[s,i]=N.useState([]),l=N.useRef(new js.Frigade(n.apiKey,{apiKey:n.apiKey,apiUrl:n.apiUrl,userId:n.userId,groupId:n.groupId})),p=t??((u,f="_self")=>{window.open(u,f);});return jsxRuntime.jsxs(w.Provider,{value:{modals:s,setModals:i,navigate:p,...n,frigade:l.current},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...de,...r}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:d,children:e})]})}function F(e,t){let[o,n]=N.useState(),[r,s]=N.useState(""),{frigade:i}=N.useContext(w),l=p=>{p.id===e&&(t!=null&&t.variables&&p.applyVariables(t.variables),n(p),s(Math.random().toString()));};return N.useEffect(()=>((async()=>{let p=await i.getFlow(e);t!=null&&t.variables&&p.applyVariables(t.variables),n(p);})(),i.onStateChange(l),()=>{i.removeStateChangeHandler(l);}),[]),{flow:o}}function B(e,{onComplete:t,onDismiss:o}={}){let n=N.useRef(null);return N.useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&(async()=>await(t==null?void 0:t(e)))(),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:N.useCallback(async r=>{if(await(o==null?void 0:o(e,r))===!1)return r.preventDefault(),!1;await e.skip();},[e])}}function k(e,{onPrimary:t,onSecondary:o}={}){let{navigate:n}=N.useContext(w);return {handlePrimary:N.useCallback(async r=>{if(await(t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;await e.complete(),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);},[e]),handleSecondary:N.useCallback(async r=>{if(await(o==null?void 0:o(e,r))===!1)return r.preventDefault(),!1;await e.complete(),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);},[e])}}function Gt({flowId:e,onComplete:t,onDismiss:o,onPrimary:n,onSecondary:r,variables:s}){let{flow:i}=F(e,{variables:s}),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:p}=B(i,{onComplete:t,onDismiss:o}),{handlePrimary:u,handleSecondary:f}=k(l,{onPrimary:n,onSecondary:r});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxRuntime.jsxs(x,{children:[jsxRuntime.jsx(x.Close,{onClick:p}),jsxRuntime.jsx(x.Title,{children:l.title}),jsxRuntime.jsx(x.Subtitle,{children:l.subtitle}),jsxRuntime.jsx(x.Media,{src:l.imageUri,css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(x.ProgressDots,{current:i.getNumberOfCompletedSteps(),total:i.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(T.Row,{css:{"& > button":{flexGrow:1}},gap:3,children:[jsxRuntime.jsx(x.Secondary,{title:"Secondary",onClick:f}),jsxRuntime.jsx(x.Primary,{title:"Primary",onClick:u})]})]}))}function Yt({flowId:e,onComplete:t,onDismiss:o,onPrimary:n,onSecondary:r,...s}){let{flow:i}=F(e),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:p}=B(i,{onComplete:t,onDismiss:o}),{handlePrimary:u,handleSecondary:f}=k(l,{onPrimary:n,onSecondary:r});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxRuntime.jsxs(v,{as:T.Row,border:"md",borderColor:"gray900",justifyContent:"space-between",...s,children:[jsxRuntime.jsxs(T.Row,{gap:3,children:[jsxRuntime.jsx("img",{src:l.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(T.Column,{children:[jsxRuntime.jsx(P.H4,{mb:1,children:l.title}),jsxRuntime.jsx(P.Body2,{children:l.subtitle})]})]}),jsxRuntime.jsxs(T.Row,{alignItems:"center",gap:3,children:[jsxRuntime.jsx(b.Secondary,{title:l.secondaryButtonTitle,onClick:f}),jsxRuntime.jsx(b.Primary,{title:l.primaryButtonTitle,onClick:u}),jsxRuntime.jsx(b.Plain,{part:"banner-close",onClick:p,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})]})]}))}function J(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=N.useState(e),[n,r]=N.useState(null),s=N.useCallback(i=>{r(i);},[]);return N.useLayoutEffect(()=>{n&&o(n.getBoundingClientRect());},[n]),{node:n,rect:t,ref:s}}var to=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Me({style:e={},part:t="",...o}){return jsxRuntime.jsxs(c,{part:`dot-wrapper ${t}`,style:{height:"48px",position:"absolute",width:"48px",...e},...o,children:[jsxRuntime.jsx(c,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${to}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(c,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function Ee({props:e,alignAttr:t,sideAttr:o}){let n=o??"bottom",r={},s=()=>{if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return e.align??"after"},i="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};r[l[n]]=i;let p=s();return ["before","end"].includes(p)?["top","bottom"].includes(n)?r.right=i:r.bottom=i:["after","start"].includes(p)?["top","bottom"].includes(n)?r.left=i:r.top=i:["top","bottom"].includes(n)?r.left=`calc(50% + ${i})`:r.top=`calc(50% + ${i})`,r}var Ae={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function $e(e,t){let o=Object.fromEntries(Ae.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n=Object.fromEntries(Ae.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0));if(o.align=o.align??"after",o.side=o.side??"bottom",["before","after"].includes(o.align)){let r={after:"end",before:"start"},s=(R,M)=>["top","bottom"].includes(M)?R=="after"?"marginLeft":"marginRight":R=="after"?"marginTop":"marginBottom",i=o.alignOffset??0,l=o.style??{},p=o.side??"bottom",u=o.align;o.style={...l,[s(u,p)]:i};let f=["top","bottom"].includes(p)?t.width:t.height;o.alignOffset=(f+i)*-1,o.align=r[u];}return {contentProps:o,rootProps:n}}function m({anchor:e,children:t,className:o,spotlight:n=!1,style:r,...s}){let{node:i,rect:l,ref:p}=J(),{contentProps:u,rootProps:f}=$e(s,l),[R,M]=N.useState(u.align),[Y,Le]=N.useState(u.side);if(i!==null){let E=i.getAttribute("data-align"),ee=i.getAttribute("data-side");R!==E&&M(E),Y!==ee&&Le(ee);}let Q=N.useRef(null),[I,ze]=N.useState(null);if(N.useEffect(()=>{let E=document.querySelector(e);E!=null&&(Q.current=E,ze(Q));},[e]),I==null)return null;let V=I.current.getBoundingClientRect(),Z="0";typeof window<"u"&&(Z=window.getComputedStyle(I.current).borderRadius);let Ke=Ee({props:s,alignAttr:R,sideAttr:Y});return jsxRuntime.jsxs(S__namespace.Root,{defaultOpen:!0,...f,children:[jsxRuntime.jsx(S__namespace.Anchor,{virtualRef:I}),jsxRuntime.jsx(S__namespace.Portal,{children:jsxRuntime.jsxs("div",{className:o,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[n&&jsxRuntime.jsx(c,{part:"tooltip-spotlight",position:"absolute",css:{borderRadius:Z,boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:V.height,left:V.left,top:V.top,width:V.width}}),jsxRuntime.jsx(S__namespace.Content,{asChild:!0,...u,ref:p,children:jsxRuntime.jsxs(v,{boxShadow:"md",part:"tooltip-content",position:"relative",css:{maxWidth:"360px",...r},children:[jsxRuntime.jsx(Me,{style:Ke}),t]})})]})})]})}m.Close=e=>jsxRuntime.jsx(S__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(b.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});m.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx(W,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e,...t});m.Primary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(b.Primary,{title:t,onClick:e,...o});m.Progress=({children:e,...t})=>e==null?null:jsxRuntime.jsx(P.Body2,{fontWeight:"demibold",part:"progress",...t,children:e});m.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(b.Secondary,{title:t,onClick:e,...o});m.Subtitle=({children:e,...t})=>e==null?null:jsxRuntime.jsx(P.Body2,{part:"subtitle",...t,children:e});m.Title=({children:e,...t})=>e==null?null:jsxRuntime.jsx(P.Body1,{fontWeight:"bold",mb:1,part:"title",...t,children:e});function q(e){let{modals:t,setModals:o}=N.useContext(w),[n,r]=N.useState(!1);return N.useEffect(()=>(o([...t,e]),()=>o(t.filter(s=>s!==e))),[]),N.useEffect(()=>{let s=t[0]===e;s!==n&&r(s);},[t]),{isCurrentModal:n}}function Ve({step:e,flow:t,onDismiss:o,onPrimary:n,onSecondary:r,...s}){let{isCurrentModal:i}=q(`${t.id}-${e.id}`),{handleDismiss:l}=B(t,{onDismiss:o}),{handlePrimary:p,handleSecondary:u}=k(e,{onPrimary:n,onSecondary:r});return i?jsxRuntime.jsxs(m,{anchor:e.selector,onOpenAutoFocus:f=>f.preventDefault(),onPointerDownOutside:f=>f.preventDefault(),...s,children:[jsxRuntime.jsx(m.Close,{onClick:l}),jsxRuntime.jsx(m.Media,{src:e.videoUri??e.imageUri,type:e.videoUri?"video":"image"}),jsxRuntime.jsx(m.Title,{children:e.title}),jsxRuntime.jsx(m.Subtitle,{children:e.subtitle}),jsxRuntime.jsxs(T.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsxRuntime.jsx(m.Progress,{children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(m.Secondary,{marginLeft:"auto",title:e.secondaryButtonTitle,onClick:u}),jsxRuntime.jsx(m.Primary,{title:e.primaryButtonTitle,onClick:p})]})]},e.id):null}function lo({flowId:e,onComplete:t,variables:o,...n}){let{flow:r}=F(e,{variables:o});if(B(r,{onComplete:t}),r==null||r.isVisible===!1)return null;r.start();let s=r.getCurrentStep();return s==null||s.start(),jsxRuntime.jsx(Ve,{step:s,flow:r,...n})}function uo(){let{frigade:e}=N.useContext(w);return {frigade:e}}
|
|
40
|
+
var je=Object.defineProperty;var _e=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var te=(e,t)=>{for(var o in t)je(e,o,{get:t[o],enumerable:!0});};var oe={borders:{md:"1px solid"},borderWidths:{0:"0",md:"1px"}};var re={black:"#000000",gray100:"#14161A",gray200:"#181B20",gray300:"#1F2329",gray400:"#2E343D",gray500:"#4C5766",gray600:"#5A6472",gray700:"#C5CBD3",gray800:"#E2E5E9",gray900:"#F1F2F4",white:"#ffffff",blue400:"#015AC6",blue500:"#0171F8",blue800:"#DBECFF",blue900:"#F5F9FF",green400:"#009E37",green500:"#00D149",green800:"#DBFFE8",transparent:"#FFFFFF00",inherit:"inherit",red500:"#c00000"};var ne={md:"10px",lg:"20px",round:"50%"};var a=e=>`var(--fr-colors-${e})`,ie={neutral:{background:a("white"),border:a("gray500"),foreground:a("black"),surface:a("gray700"),active:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},focus:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")},hover:{background:a("white"),border:a("gray900"),foreground:a("black"),surface:a("gray700")}},primary:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500"),active:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")},focus:{background:a("blue500"),border:a("blue500"),foreground:a("white"),surface:a("blue500")},hover:{background:a("blue400"),border:a("blue400"),foreground:a("white"),surface:a("blue400")}},secondary:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900"),active:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")},focus:{background:a("gray900"),border:a("gray900"),foreground:a("black"),surface:a("gray900")},hover:{background:a("gray800"),border:a("gray800"),foreground:a("black"),surface:a("gray800")}}};var se={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Ue="px",Ne=e=>typeof e=="number"?`${4*e}${Ue}`:e,Je=[-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"],ae=Object.fromEntries(Je.map(e=>[e,Ne(e)]));var le={fontFamilies:{default:"TT Interphases Pro, sans-serif"},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 z={...oe,colors:{...re,...ie},...le,radii:ne,shadows:se,space:ae};function A(e,t="",o="."){return Object.keys(e).reduce((n,r)=>{let i=`${t.length?`${t}${o}`:""}${r}`,l=e[r];return typeof l=="object"&&l!==null&&!Array.isArray(l)?Object.assign(n,A(l,i,o)):n[i]=l,n},{})}function K(e){return A(e,"--fr","-")}function pe(e,t="--fr"){let o={};return Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&r!==null&&!Array.isArray(r)?o[n]=pe(r,`${t}-${n}`):o[n]=`var(${t}-${n})`;}),o}var de=K(z),d=pe(z);var Ge=new Set(["alt","size","src"]),qe=Xe__default.default.all.filter(e=>e.indexOf("-")!=0&&!Ge.has(e)).map(e=>[e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase()),null]),Ye=Object.fromEntries(qe),j=A(d.colors),Qe={color:j,backgroundColor:j,borderColor:j,border:d.borders,borderRadius:d.radii,borderWidth:d.borderWidths,boxShadow:d.shadows,fontFamily:d.fontFamilies,fontSize:d.fontSizes,fontWeight:d.fontWeights,gap:d.space,lineHeight:d.lineHeights,margin:d.space,marginBottom:d.space,marginLeft:d.space,marginRight:d.space,marginTop:d.space,padding:d.space,paddingBottom:d.space,paddingLeft:d.space,paddingRight:d.space,paddingTop:d.space},ce={...Ye,...Qe},ue={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"]};function Ze(e){return Array.isArray(e)?new Map(e.map(t=>[t,t])):typeof e=="object"&&e!==null?new Map(Object.entries(e)):["string","number"].includes(typeof e)?new Map([e,e]):new Map}var me=new Map(Object.entries(ce).map(([e,t])=>[e,Ze(t)])),et=new Map(Object.entries(ue).map(([e,t])=>[e,new Set(t)])),tt=new Set(["height","width"]),ot=new Set(["canvas","embed","iframe","img","input","object","video"]);function fe(e,t="div"){let o=Object.assign({},e),n={};return Object.entries(o).forEach(([r,s])=>{let i=et.get(r);i!=null&&(i.forEach(l=>{o[l]=s;}),delete o[r]);}),Object.entries(o).forEach(([r,s])=>{let i=me.get(r);if(i!=null){if(typeof s=="string"&&s.indexOf(" ")>-1){let l=s.split(" ");n[r]=l.map(p=>i.get(p.toString())??p).join(" ");}else i.has(s.toString())?n[r]=i.get(s.toString()):n[r]=s;(typeof t!="string"||!ot.has(t)||!tt.has(r))&&delete o[r];}}),Object.keys(o).forEach(r=>{let s=r.substring(1);r.indexOf("_")===0&&me.has(s)&&(o[s]=o[r],delete o[r]);}),{cssFromProps:n,unmatchedProps:o}}function nt(){if(typeof window>"u"){let{JSDOM:e}=_e("jsdom");return new e("<!DOCTYPE html>").window}return window}function ge(e){return e?{__html:rt__default.default(nt()).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"]})}:{__html:""}}function st(e){return e&&`fr-${e}`}function he(e){return e&&(Array.isArray(e)?e.map(t=>he(t)).join(" "):st(e))}function at({as:e,children:t,className:o,css:n,part:r,...s},i){let l=e??"div",{cssFromProps:p,unmatchedProps:c}=fe(s,l),f=he(r),R=o||f?clsx.clsx(o,f):void 0,E=[{boxSizing:"border-box"},p,n];return typeof t=="string"?jsxRuntime.jsx(l,{className:R,css:E,...c,ref:i,dangerouslySetInnerHTML:ge(t)}):jsxRuntime.jsx(l,{className:R,css:E,...c,ref:i,children:t})}var u=N__namespace.forwardRef(at);var _={};te(_,{Body1:()=>ft,Body2:()=>gt,Caption:()=>xt,Display1:()=>lt,Display2:()=>pt,H1:()=>dt,H2:()=>ct,H3:()=>ut,H4:()=>mt});var C={color:"neutral.foreground",fontFamily:"default",margin:"0"},lt={...C,fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"},pt={...C,fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"},dt={...C,fontSize:"3xl",fontWeight:"bold",lineHeight:"2xl"},ct={...C,fontSize:"2xl",fontWeight:"bold",lineHeight:"xl"},ut={...C,fontSize:"xl",fontWeight:"bold",lineHeight:"lg"},mt={...C,fontSize:"lg",fontWeight:"bold",lineHeight:"md"},ft={...C,fontSize:"md",fontWeight:"regular",lineHeight:"md"},gt={...C,fontSize:"sm",fontWeight:"regular",lineHeight:"md"},xt={...C,fontSize:"xs",fontWeight:"regular",lineHeight:"sm"};function Pe({as:e="span",children:t,variant:o="Body1",...n}){return jsxRuntime.jsx(u,{as:e,..._[o],...n,children:t})}var yt=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],ht=Object.fromEntries(yt.map(e=>{let t=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():void 0,o=n=>jsxRuntime.jsx(Pe,{as:t,...n,variant:e,children:n.children});return o.displayName=`Text.${e}`,[e,o]})),P=Object.assign(Pe,ht);var U={};te(U,{Link:()=>Tt,Plain:()=>St,Primary:()=>Pt,Secondary:()=>bt,base:()=>$});var $=({radii:e,space:t})=>({borderWidth:0,borderRadius:e.md,padding:`${t[2]} ${t[4]}`}),Pt=({colors:e})=>[$,{backgroundColor:e.primary.surface,color:e.primary.foreground,"&:hover":{backgroundColor:e.primary.hover.surface}}],bt=({colors:e})=>[$,{backgroundColor:e.secondary.surface,color:e.secondary.foreground,"&:hover":{backgroundColor:e.secondary.hover.surface}}],Tt=({colors:e})=>[$,{backgroundColor:e.transparent,color:e.primary.surface,"&:hover":{color:e.primary.hover.surface}}],St=({colors:e})=>[$,{backgroundColor:e.transparent,color:e.neutral.foreground}];function Te({as:e,children:t,part:o,title:n,variant:r="Primary",...s}){let i=r.toLocaleLowerCase();return jsxRuntime.jsxs(u,{as:e??"button",css:U[r],part:[`button-${i}`,o],...s,children:[t,n&&jsxRuntime.jsx(P.Body2,{fontWeight:"demibold",color:"inherit",children:n})]})}var Ct=["Primary","Secondary","Link","Plain"],wt=Object.fromEntries(Ct.map(e=>{let t=o=>jsxRuntime.jsx(Te,{...o,variant:e,children:o.children});return t.displayName=`Text.${e}`,[e,t]})),b=Object.assign(Te,wt);var Rt=N__namespace.forwardRef(({children:e,css:t,...o},n)=>jsxRuntime.jsx(u,{css:[{display:"flex",flexDirection:"row"},t],...o,ref:n,children:e})),vt=N__namespace.forwardRef(({children:e,css:t,...o},n)=>jsxRuntime.jsx(u,{css:[{display:"flex",flexDirection:"column"},t],...o,ref:n,children:e})),T={Column:vt,Row:Rt};var v=N__namespace.forwardRef(({as:e,children:t,...o},n)=>{let r=e??T.Column;return jsxRuntime.jsx(r,{backgroundColor:"neutral.background",borderRadius:"md",p:5,...o,ref:n,children:t})});function Be({part:e,src:t,...o}){return jsxRuntime.jsx(u,{as:"img",part:["image",e],src:t,...o})}function Dt(e){var t,o,n;if(e.includes("youtube"))return `https://www.youtube.com/embed/${(t=e.split("v=")[1])==null?void 0:t.split("&")[0]}`;if(e.includes("vimeo"))return `https://player.vimeo.com/video/${(o=e.split("vimeo.com/")[1])==null?void 0:o.split("&")[0]}`;if(e.includes("wistia"))return `https://fast.wistia.net/embed/iframe/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`;throw new Error("Could not map videoUri to a known provider (Youtube, Vimeo, Wistia).")}function Re({part:e,src:t,...o}){let n=Dt(t);return jsxRuntime.jsx(u,{allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"gray100",borderWidth:0,part:["video",e],src:n,...o})}function W({src:e,type:t,...o}){return jsxRuntime.jsx(t==="video"?Re:Be,{src:e,...o})}function x({children:e,...t}){return jsxRuntime.jsx(y__namespace.Root,{defaultOpen:!0,modal:!0,children:jsxRuntime.jsxs(y__namespace.Portal,{children:[jsxRuntime.jsx(y__namespace.Overlay,{style:{background:"rgb(0 0 0 / 0.5)",position:"fixed",inset:0}}),jsxRuntime.jsx(y__namespace.Content,{asChild:!0,onOpenAutoFocus:o=>o.preventDefault(),onPointerDownOutside:o=>o.preventDefault(),children:jsxRuntime.jsx(v,{boxShadow:"md",css:{left:"50%",maxWidth:430,top:"50%",transform:"translate(-50%, -50%)"},p:8,position:"fixed",textAlign:"center",...t,children:e})})]})})}x.Close=e=>jsxRuntime.jsx(y__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(b.Plain,{css:{top:"4px",right:"-4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});x.Subtitle=({children:e,...t})=>jsxRuntime.jsx(y__namespace.Description,{asChild:!0,children:jsxRuntime.jsx(P.Body2,{part:"subtitle",mb:5,...t,children:e})});x.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx(W,{borderRadius:"md",src:e,...t});x.Primary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(b.Primary,{title:t,onClick:e,...o});x.ProgressDots=({current:e,total:t})=>{let o=[...Array(t)].map((n,r)=>jsxRuntime.jsx("circle",{r:4,cx:4+16*r,cy:"4px",fill:e===r?d.colors.blue500:d.colors.blue800},r));return jsxRuntime.jsx(u,{as:"svg",width:16*t-8,height:"8px",viewBox:`0 0 ${16*t-8} 8`,margin:"5 auto",children:o})};x.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(b.Secondary,{title:t,onClick:e,...o});x.Title=({children:e,...t})=>jsxRuntime.jsx(y__namespace.Title,{asChild:!0,children:jsxRuntime.jsx(P.H3,{mb:1,part:"title",...t,children:e})});var w=N.createContext({apiKey:"",modals:[],setModals:()=>{},navigate:()=>{}});function Kt({children:e,navigate:t,theme:o,...n}){let r=o?K(o):{},[s,i]=N.useState([]),l=N.useRef(new js.Frigade(n.apiKey,{apiKey:n.apiKey,apiUrl:n.apiUrl,userId:n.userId,groupId:n.groupId})),p=t??((c,f="_self")=>{window.open(c,f);});return N.useEffect(()=>()=>{var c;(c=l.current)==null||c.destroy();},[]),jsxRuntime.jsxs(w.Provider,{value:{modals:s,setModals:i,navigate:p,...n,frigade:l.current},children:[jsxRuntime.jsx(react.Global,{styles:{":root":{...de,...r}}}),jsxRuntime.jsx(react.ThemeProvider,{theme:d,children:e})]})}function F(e,t){let[o,n]=N.useState(),[r,s]=N.useState(""),{frigade:i}=N.useContext(w),l=p=>{p.id===e&&(t!=null&&t.variables&&p.applyVariables(t.variables),n(p),s(Math.random().toString()));};return N.useEffect(()=>((async()=>{let p=await i.getFlow(e);if(!p||i.hasFailedToLoad()){n(void 0);return}t!=null&&t.variables&&p.applyVariables(t.variables),n(p);})(),i.onStateChange(l),()=>{i.removeStateChangeHandler(l);}),[]),{flow:o}}function B(e,{onComplete:t,onDismiss:o}={}){let n=N.useRef(null);return N.useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&(async()=>await(t==null?void 0:t(e)))(),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:N.useCallback(async r=>{if(await(o==null?void 0:o(e,r))===!1)return r.preventDefault(),!1;await e.skip();},[e])}}function k(e,{onPrimary:t,onSecondary:o}={}){let{navigate:n}=N.useContext(w);return {handlePrimary:N.useCallback(async r=>{if(await(t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;await e.complete(),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);},[e]),handleSecondary:N.useCallback(async r=>{if(await(o==null?void 0:o(e,r))===!1)return r.preventDefault(),!1;await e.complete(),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);},[e])}}function qt({flowId:e,onComplete:t,onDismiss:o,onPrimary:n,onSecondary:r,variables:s}){let{flow:i}=F(e,{variables:s}),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:p}=B(i,{onComplete:t,onDismiss:o}),{handlePrimary:c,handleSecondary:f}=k(l,{onPrimary:n,onSecondary:r});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxRuntime.jsxs(x,{children:[jsxRuntime.jsx(x.Close,{onClick:p}),jsxRuntime.jsx(x.Title,{children:l.title}),jsxRuntime.jsx(x.Subtitle,{children:l.subtitle}),jsxRuntime.jsx(x.Media,{src:l.imageUri,css:{aspectRatio:"1.5",objectFit:"cover",width:"100%"}}),jsxRuntime.jsx(x.ProgressDots,{current:i.getNumberOfCompletedSteps(),total:i.getNumberOfAvailableSteps()}),jsxRuntime.jsxs(T.Row,{css:{"& > button":{flexGrow:1}},gap:3,children:[jsxRuntime.jsx(x.Secondary,{title:"Secondary",onClick:f}),jsxRuntime.jsx(x.Primary,{title:"Primary",onClick:c})]})]}))}function Qt({flowId:e,onComplete:t,onDismiss:o,onPrimary:n,onSecondary:r,...s}){let{flow:i}=F(e),l=i==null?void 0:i.getCurrentStep(),{handleDismiss:p}=B(i,{onComplete:t,onDismiss:o}),{handlePrimary:c,handleSecondary:f}=k(l,{onPrimary:n,onSecondary:r});return i==null||i.isVisible===!1?null:(i.start(),l==null||l.start(),jsxRuntime.jsxs(v,{as:T.Row,border:"md",borderColor:"gray900",justifyContent:"space-between",...s,children:[jsxRuntime.jsxs(T.Row,{gap:3,children:[jsxRuntime.jsx("img",{src:l.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(T.Column,{children:[jsxRuntime.jsx(P.H4,{mb:1,children:l.title}),jsxRuntime.jsx(P.Body2,{children:l.subtitle})]})]}),jsxRuntime.jsxs(T.Row,{alignItems:"center",gap:3,children:[jsxRuntime.jsx(b.Secondary,{title:l.secondaryButtonTitle,onClick:f}),jsxRuntime.jsx(b.Primary,{title:l.primaryButtonTitle,onClick:c}),jsxRuntime.jsx(b.Plain,{part:"banner-close",onClick:p,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})]})]}))}function J(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[t,o]=N.useState(e),[n,r]=N.useState(null),s=N.useCallback(i=>{r(i);},[]);return N.useLayoutEffect(()=>{n&&o(n.getBoundingClientRect());},[n]),{node:n,rect:t,ref:s}}var oo=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function Ee({style:e={},part:t="",...o}){return jsxRuntime.jsxs(u,{part:`dot-wrapper ${t}`,style:{height:"48px",position:"absolute",width:"48px",...e},...o,children:[jsxRuntime.jsx(u,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${oo}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(u,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]})}function Me({props:e,alignAttr:t,sideAttr:o}){let n=o??"bottom",r={},s=()=>{if(["after","before"].includes(e.align)){if(t=="start")return "before";if(t=="end")return "after"}return e.align??"after"},i="-24px",l={top:"bottom",right:"left",bottom:"top",left:"right"};r[l[n]]=i;let p=s();return ["before","end"].includes(p)?["top","bottom"].includes(n)?r.right=i:r.bottom=i:["after","start"].includes(p)?["top","bottom"].includes(n)?r.left=i:r.top=i:["top","bottom"].includes(n)?r.left=`calc(50% + ${i})`:r.top=`calc(50% + ${i})`,r}var Ae={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function $e(e,t){let o=Object.fromEntries(Ae.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n=Object.fromEntries(Ae.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0));if(o.align=o.align??"after",o.side=o.side??"bottom",["before","after"].includes(o.align)){let r={after:"end",before:"start"},s=(R,E)=>["top","bottom"].includes(E)?R=="after"?"marginLeft":"marginRight":R=="after"?"marginTop":"marginBottom",i=o.alignOffset??0,l=o.style??{},p=o.side??"bottom",c=o.align;o.style={...l,[s(c,p)]:i};let f=["top","bottom"].includes(p)?t.width:t.height;o.alignOffset=(f+i)*-1,o.align=r[c];}return {contentProps:o,rootProps:n}}function m({anchor:e,children:t,className:o,spotlight:n=!1,style:r,...s}){let{node:i,rect:l,ref:p}=J(),{contentProps:c,rootProps:f}=$e(s,l),[R,E]=N.useState(c.align),[Y,Le]=N.useState(c.side);if(i!==null){let M=i.getAttribute("data-align"),ee=i.getAttribute("data-side");R!==M&&E(M),Y!==ee&&Le(ee);}let Q=N.useRef(null),[I,ze]=N.useState(null);if(N.useEffect(()=>{let M=document.querySelector(e);M!=null&&(Q.current=M,ze(Q));},[e]),I==null)return null;let V=I.current.getBoundingClientRect(),Z="0";typeof window<"u"&&(Z=window.getComputedStyle(I.current).borderRadius);let Ke=Me({props:s,alignAttr:R,sideAttr:Y});return jsxRuntime.jsxs(S__namespace.Root,{defaultOpen:!0,...f,children:[jsxRuntime.jsx(S__namespace.Anchor,{virtualRef:I}),jsxRuntime.jsx(S__namespace.Portal,{children:jsxRuntime.jsxs("div",{className:o,css:{bottom:0,left:0,position:"absolute",right:0,top:0,zIndex:9999},children:[n&&jsxRuntime.jsx(u,{part:"tooltip-spotlight",position:"absolute",css:{borderRadius:Z,boxShadow:"0 0 0 2000px rgb(0 0 0 / 0.5)",height:V.height,left:V.left,top:V.top,width:V.width}}),jsxRuntime.jsx(S__namespace.Content,{asChild:!0,...c,ref:p,children:jsxRuntime.jsxs(v,{boxShadow:"md",part:"tooltip-content",position:"relative",css:{maxWidth:"360px",...r},children:[jsxRuntime.jsx(Ee,{style:Ke}),t]})})]})})]})}m.Close=e=>jsxRuntime.jsx(S__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(b.Plain,{css:{top:"12px",right:"4px"},part:"close",position:"absolute",...e,children:jsxRuntime.jsx(solid.XMarkIcon,{height:"24",fill:"currentColor"})})});m.Media=({src:e,...t})=>e==null?null:jsxRuntime.jsx(W,{borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2"},margin:"-5 -5 5",src:e,...t});m.Primary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(b.Primary,{title:t,onClick:e,...o});m.Progress=({children:e,...t})=>e==null?null:jsxRuntime.jsx(P.Body2,{fontWeight:"demibold",part:"progress",...t,children:e});m.Secondary=({onClick:e,title:t,...o})=>t==null?null:jsxRuntime.jsx(b.Secondary,{title:t,onClick:e,...o});m.Subtitle=({children:e,...t})=>e==null?null:jsxRuntime.jsx(P.Body2,{part:"subtitle",...t,children:e});m.Title=({children:e,...t})=>e==null?null:jsxRuntime.jsx(P.Body1,{fontWeight:"bold",mb:1,part:"title",...t,children:e});function q(e){let{modals:t,setModals:o}=N.useContext(w),[n,r]=N.useState(!1);return N.useEffect(()=>(o([...t,e]),()=>o(t.filter(s=>s!==e))),[]),N.useEffect(()=>{let s=t[0]===e;s!==n&&r(s);},[t]),{isCurrentModal:n}}function Ve({step:e,flow:t,onDismiss:o,onPrimary:n,onSecondary:r,...s}){let{isCurrentModal:i}=q(`${t.id}-${e.id}`),{handleDismiss:l}=B(t,{onDismiss:o}),{handlePrimary:p,handleSecondary:c}=k(e,{onPrimary:n,onSecondary:r});return i?jsxRuntime.jsxs(m,{anchor:e.selector,onOpenAutoFocus:f=>f.preventDefault(),onPointerDownOutside:f=>f.preventDefault(),...s,children:[jsxRuntime.jsx(m.Close,{onClick:l}),jsxRuntime.jsx(m.Media,{src:e.videoUri??e.imageUri,type:e.videoUri?"video":"image"}),jsxRuntime.jsx(m.Title,{children:e.title}),jsxRuntime.jsx(m.Subtitle,{children:e.subtitle}),jsxRuntime.jsxs(T.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",pt:4,children:[jsxRuntime.jsx(m.Progress,{children:`${t.getNumberOfCompletedSteps()+1}/${t.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx(m.Secondary,{marginLeft:"auto",title:e.secondaryButtonTitle,onClick:c}),jsxRuntime.jsx(m.Primary,{title:e.primaryButtonTitle,onClick:p})]})]},e.id):null}function po({flowId:e,onComplete:t,variables:o,...n}){let{flow:r}=F(e,{variables:o});if(B(r,{onComplete:t}),r==null||r.isVisible===!1)return null;r.start();let s=r.getCurrentStep();return s==null||s.start(),jsxRuntime.jsx(Ve,{step:s,flow:r,...n})}function mo(){let{frigade:e}=N.useContext(w);return {frigade:e}}
|
|
41
41
|
|
|
42
|
-
exports.Announcement =
|
|
43
|
-
exports.Banner =
|
|
44
|
-
exports.Box =
|
|
42
|
+
exports.Announcement = qt;
|
|
43
|
+
exports.Banner = Qt;
|
|
44
|
+
exports.Box = u;
|
|
45
45
|
exports.Button = b;
|
|
46
46
|
exports.Card = v;
|
|
47
47
|
exports.Flex = T;
|
|
48
|
-
exports.Provider =
|
|
48
|
+
exports.Provider = Kt;
|
|
49
49
|
exports.Text = P;
|
|
50
50
|
exports.Tooltip = m;
|
|
51
|
-
exports.Tour =
|
|
51
|
+
exports.Tour = po;
|
|
52
52
|
exports.useBoundingClientRect = J;
|
|
53
53
|
exports.useFlow = F;
|
|
54
54
|
exports.useFlowHandlers = B;
|
|
55
|
-
exports.useFrigade =
|
|
55
|
+
exports.useFrigade = mo;
|
|
56
56
|
exports.useModal = q;
|
|
57
57
|
exports.useStepHandlers = k;
|
|
58
58
|
//# sourceMappingURL=out.js.map
|