@frigade/react 2.2.0 → 2.2.2
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 +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -46,7 +46,7 @@ var ye__namespace = /*#__PURE__*/_interopNamespace(ye);
|
|
|
46
46
|
var N__namespace = /*#__PURE__*/_interopNamespace(N);
|
|
47
47
|
var Y__namespace = /*#__PURE__*/_interopNamespace(Y);
|
|
48
48
|
|
|
49
|
-
var Co=Object.defineProperty,zt=Object.defineProperties;var Kt=Object.getOwnPropertyDescriptors;var ke=Object.getOwnPropertySymbols;var So=Object.prototype.hasOwnProperty,Fo=Object.prototype.propertyIsEnumerable;var Po=(e,o,t)=>o in e?Co(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))So.call(o,t)&&Po(e,t,o[t]);if(ke)for(var t of ke(o))Fo.call(o,t)&&Po(e,t,o[t]);return e},d=(e,o)=>zt(e,Kt(o));var jt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var m=(e,o)=>{var t={};for(var n in e)So.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ke)for(var n of ke(e))o.indexOf(n)<0&&Fo.call(e,n)&&(t[n]=e[n]);return t};var Q=(e,o)=>{for(var t in o)Co(e,t,{get:o[t],enumerable:!0});};var M=(e,o,t)=>new Promise((n,r)=>{var i=c=>{try{p(t.next(c));}catch(u){r(u);}},s=c=>{try{p(t.throw(c));}catch(u){r(u);}},p=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,s);p((t=t.apply(e,o)).next());});var To={borderWidths:{md:"1px"}};var De=[5,10,20,35,50,65,80,95,98],wo=[...De],Ue=[...De];wo[4]=40;Ue[4]=60;var Ut={blue:{h:213,s:100,l:De},gray:{h:220,s:10,l:De},green:{h:141,s:90,l:wo},red:{h:9,s:90,l:Ue},yellow:{h:50,s:90,l:Ue}};var W={};for(let[e,{h:o,s:t,l:n}]of Object.entries(Ut))W[e]=Object.fromEntries(n.map((r,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var vo=d(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},W),{gray100:W.gray[100],gray200:W.gray[200],gray300:W.gray[300],gray400:W.gray[400],gray500:W.gray[500],gray600:W.gray[600],gray700:W.gray[700],gray800:W.gray[800],gray900:W.gray[900],blue400:W.blue[400],blue500:W.blue[500],blue800:W.blue[800],blue900:W.blue[900],green400:W.blue[400],green500:W.green[500],green800:W.green[800],red500:W.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Bo={md:"8px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,Ro={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 ko={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Gt="px",Jt=e=>typeof e=="number"?`${4*e}${Gt}`:e,Xt=[-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"],Do=Object.fromEntries(Xt.map(e=>[e,Jt(e)]));var Eo={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 Ee=d(a(d(a({},To),{colors:a(a({},vo),Ro)}),Eo),{radii:Bo,shadows:ko,space:Do});function Pe(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let s=`${o.length?`${o}${t}`:""}${r}`,p=e[r];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(n,Pe(p,s,t)):n[s]=p,n},{})}function Ge(e){let o=Pe(e,"--fr","-");for(let[t,n]of Object.entries(o))if(t.indexOf(".")>-1){let r=t.replace(/\./g,"-");o[r]=n,delete o[t];}return o}function Oo(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n],i=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=Oo(r,`${o}-${n}`):t[n]=`var(${o}-${i})`;}),t}var Je=Ge(Ee),w=Oo(Ee);var Yt=new Set(["alt","size","src"]),Qt=qt__default.default.all.filter(e=>e.indexOf("-")!=0&&!Yt.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Zt=Object.fromEntries(Qt),Oe=Pe(w.colors),er={color:Oe,backgroundColor:Oe,borderColor:Oe,border:a(a({},w.borderWidths),Oe),borderRadius:w.radii,borderWidth:w.borderWidths,boxShadow:w.shadows,fontFamily:w.fontFamilies,fontSize:w.fontSizes,fontWeight:w.fontWeights,gap:w.space,lineHeight:w.lineHeights,margin:w.space,marginBottom:w.space,marginLeft:w.space,marginRight:w.space,marginTop:w.space,padding:w.space,paddingBottom:w.space,paddingLeft:w.space,paddingRight:w.space,paddingTop:w.space},Io=a(a({},Zt),er),Ho={bg:["backgroundColor"],m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]},Mo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function or(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 Wo=new Map(Object.entries(Io).map(([e,o])=>[e,or(o)])),tr=new Map(Object.entries(Ho).map(([e,o])=>[e,new Set(o)])),rr=new Set(["height","width"]),nr=new Set(["canvas","embed","iframe","img","input","object","video"]);function Ao(e){let[o,t]=e.split(":");return [o,Mo.has(t)?t:null]}function Lo(e,o="div"){let t=Object.assign({},e),n={};function r(i){if(i==null)return n;let p=`&:${i.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return n[p]==null&&(n[p]={}),n[p]}return Object.entries(t).forEach(([i,s])=>{let[p,c]=Ao(i),u=tr.get(p);u!=null&&(u.forEach(f=>{let h=`${f}${c?":"+c:""}`;t[h]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[p,c]=Ao(i),u=Wo.get(p);if(u!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");r(c)[p]=f.map(h=>{var y;return (y=u.get(h.toString()))!=null?y:h}).join(" ");}else u.has(s.toString())?r(c)[p]=u.get(s.toString()):r(c)[p]=s;(typeof o!="string"||!nr.has(o)||!rr.has(p))&&delete t[i];}}),Object.keys(t).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&Wo.has(s)&&(t[s]=t[i],delete t[i]);}),{cssFromProps:n,unmatchedProps:t}}function ar(){if(typeof window=="undefined"){let{JSDOM:e}=jt("jsdom");return new e("<!DOCTYPE html>").window}return window}function $o(e){return e?{__html:ir__default.default(ar()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function lr(e){return e&&`fr-${e}`}function _o(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>_o(o)).join(" "):lr(e))}function pr(p,s){var c=p,{as:e,children:o,className:t,css:n={},part:r}=c,i=m(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:f,unmatchedProps:h}=Lo(i,u),y=_o(r),b=t||y?clsx.clsx(t,y):void 0,S=[{boxSizing:"border-box"},f,n];return typeof o=="string"?jsxRuntime.jsx(u,d(a({className:b,css:S},h),{ref:s,dangerouslySetInnerHTML:$o(o)})):jsxRuntime.jsx(u,d(a({className:b,css:S},h),{ref:s,children:o}))}var x=Qe__namespace.forwardRef(pr);var I={};Q(I,{Link:()=>Lr,Plain:()=>$r,Primary:()=>Wr,Secondary:()=>Ar});var F={};Q(F,{Body1:()=>vr,Body2:()=>Br,Caption:()=>Rr,Display1:()=>Pr,Display2:()=>Cr,H1:()=>Sr,H2:()=>Fr,H3:()=>Tr,H4:()=>wr});var Xe={};Q(Xe,{Body1:()=>yr,Body2:()=>xr,Caption:()=>br,Display1:()=>dr,Display2:()=>cr,H1:()=>ur,H2:()=>mr,H3:()=>fr,H4:()=>gr});var Z={color:"neutral.foreground",fontFamily:"default",margin:"0"},dr=d(a({},Z),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),cr=d(a({},Z),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),ur=d(a({},Z),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),mr=d(a({},Z),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),fr=d(a({},Z),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),gr=d(a({},Z),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),yr=d(a({},Z),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),xr=d(a({},Z),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),br=d(a({},Z),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var hr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],ee=Object.fromEntries(hr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Qe__namespace.forwardRef((p,s)=>{var c=p,{as:n=o,children:r}=c,i=m(c,["as","children"]);return jsxRuntime.jsx(x,d(a(a({as:n},Xe[e]),i),{ref:s,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),Pr=ee.Display1,Cr=ee.Display2,Sr=ee.H1,Fr=ee.H2,Tr=ee.H3,wr=ee.H4,vr=ee.Body1,Br=ee.Body2,Rr=ee.Caption;var Ye={};Q(Ye,{Link:()=>Ir,Plain:()=>Hr,Primary:()=>Er,Secondary:()=>Or,loadingCSSStyle:()=>qe});var Ie={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},Er=d(a({},Ie),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),Or=d(a({},Ie),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),Ir=d(a({},Ie),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Hr=d(a({},Ie),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Mr=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),qe={position:"relative",color:"transparent","&:after":{content:'""',position:"absolute",width:"16px",height:"16px",top:0,left:0,right:0,bottom:0,margin:"auto",border:"4px solid transparent",borderTopColor:"var(--fr-colors-primary-foreground)",borderRadius:"50%",animation:Mr+" 1s ease infinite"}};function He(s){var p=s,{as:e,children:o,part:t,title:n,variant:r="Primary"}=p,i=m(p,["as","children","part","title","variant"]);var u;let c=r.toLocaleLowerCase();return jsxRuntime.jsxs(x,d(a(d(a({as:e!=null?e:"button",part:[`button-${c}`,t]},Ye[r]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?qe:{})}),i),{loading:void 0,children:[o,n&&jsxRuntime.jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function Wr(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(He,d(a({},o),{variant:"Primary",children:e}))}function Ar(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(He,d(a({},o),{variant:"Secondary",children:e}))}function Lr(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(He,d(a({},o),{variant:"Link",children:e}))}function $r(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(He,d(a({},o),{variant:"Plain",children:e}))}var C={};Q(C,{Column:()=>_r,Row:()=>Nr});var Nr=Qe__namespace.forwardRef((e,o)=>jsxRuntime.jsx(x,d(a({display:"flex",flexDirection:"row"},e),{ref:o}))),_r=Qe__namespace.forwardRef((e,o)=>jsxRuntime.jsx(x,d(a({display:"flex",flexDirection:"column"},e),{ref:o})));function Ze(r){var i=r,{dismissible:e,flowId:o,part:t}=i,n=m(i,["dismissible","flowId","part"]);return jsxRuntime.jsx(J,d(a({as:null,flowId:o},n),{children:({handleDismiss:s,handlePrimary:p,handleSecondary:c,parentProps:{containerProps:u},step:f})=>{var g,v,D,B,O;let h=(g=f.props)!=null?g:{},y=(D=(v=f.primaryButton)==null?void 0:v.title)!=null?D:f.primaryButtonTitle,b=(O=(B=f.secondaryButton)==null?void 0:B.title)!=null?O:f.secondaryButtonTitle,S=!!f.$state.blocked;return jsxRuntime.jsxs(P,d(a(a({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),h),{children:[f.imageUri&&jsxRuntime.jsx(x,{as:"img",part:"image",src:f.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(C.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(P.Title,{part:"title",children:f.title}),jsxRuntime.jsx(P.Subtitle,{part:"subtitle",children:f.subtitle})]}),jsxRuntime.jsx(P.Secondary,{disabled:S,title:b,onClick:c}),jsxRuntime.jsx(P.Primary,{disabled:S,title:y,onClick:p}),e&&jsxRuntime.jsx(P.Dismiss,{onClick:s})]}))}}))}var Le={};Q(Le,{Collapsible:()=>Ae,CollapsibleStep:()=>Se});var Se={};Q(Se,{Content:()=>oo,Root:()=>to,Trigger:()=>ro});var Kr=react.keyframes`
|
|
49
|
+
var Co=Object.defineProperty,zt=Object.defineProperties;var Kt=Object.getOwnPropertyDescriptors;var ke=Object.getOwnPropertySymbols;var So=Object.prototype.hasOwnProperty,Fo=Object.prototype.propertyIsEnumerable;var Po=(e,o,t)=>o in e?Co(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,a=(e,o)=>{for(var t in o||(o={}))So.call(o,t)&&Po(e,t,o[t]);if(ke)for(var t of ke(o))Fo.call(o,t)&&Po(e,t,o[t]);return e},d=(e,o)=>zt(e,Kt(o));var Ut=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(o,t)=>(typeof require!="undefined"?require:o)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var m=(e,o)=>{var t={};for(var n in e)So.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&ke)for(var n of ke(e))o.indexOf(n)<0&&Fo.call(e,n)&&(t[n]=e[n]);return t};var Q=(e,o)=>{for(var t in o)Co(e,t,{get:o[t],enumerable:!0});};var M=(e,o,t)=>new Promise((n,r)=>{var i=c=>{try{p(t.next(c));}catch(u){r(u);}},s=c=>{try{p(t.throw(c));}catch(u){r(u);}},p=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,s);p((t=t.apply(e,o)).next());});var To={borderWidths:{md:"1px"}};var De=[5,10,20,35,50,65,80,95,98],wo=[...De],je=[...De];wo[4]=40;je[4]=60;var jt={blue:{h:213,s:100,l:De},gray:{h:220,s:10,l:De},green:{h:141,s:90,l:wo},red:{h:9,s:90,l:je},yellow:{h:50,s:90,l:je}};var W={};for(let[e,{h:o,s:t,l:n}]of Object.entries(jt))W[e]=Object.fromEntries(n.map((r,i)=>[`${(i+1)*100}`,`hsl(${o} ${t}% ${r}%)`]));var vo=d(a({black:"hsl(0 0% 0%)",white:"hsl(0 0% 100%)"},W),{gray100:W.gray[100],gray200:W.gray[200],gray300:W.gray[300],gray400:W.gray[400],gray500:W.gray[500],gray600:W.gray[600],gray700:W.gray[700],gray800:W.gray[800],gray900:W.gray[900],blue400:W.blue[400],blue500:W.blue[500],blue800:W.blue[800],blue900:W.blue[900],green400:W.blue[400],green500:W.green[500],green800:W.green[800],red500:W.red[500],transparent:"#FFFFFF00",inherit:"inherit"});var Bo={md:"8px",lg:"20px",round:"50%"};var l=e=>`var(--fr-colors-${e})`,Ro={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 ko={md:"0px 4px 20px rgba(0, 0, 0, 0.1)"};var Gt="px",Jt=e=>typeof e=="number"?`${4*e}${Gt}`:e,Xt=[-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"],Do=Object.fromEntries(Xt.map(e=>[e,Jt(e)]));var Eo={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 Ee=d(a(d(a({},To),{colors:a(a({},vo),Ro)}),Eo),{radii:Bo,shadows:ko,space:Do});function Pe(e,o="",t="."){return Object.keys(e).reduce((n,r)=>{let s=`${o.length?`${o}${t}`:""}${r}`,p=e[r];return typeof p=="object"&&p!==null&&!Array.isArray(p)?Object.assign(n,Pe(p,s,t)):n[s]=p,n},{})}function Ge(e){let o=Pe(e,"--fr","-");for(let[t,n]of Object.entries(o))if(t.indexOf(".")>-1){let r=t.replace(/\./g,"-");o[r]=n,delete o[t];}return o}function Oo(e,o="--fr"){let t={};return Object.keys(e).forEach(n=>{let r=e[n],i=n.replace(/\./g,"-");typeof r=="object"&&r!==null&&!Array.isArray(r)?t[n]=Oo(r,`${o}-${n}`):t[n]=`var(${o}-${i})`;}),t}var Je=Ge(Ee),w=Oo(Ee);var Yt=new Set(["alt","size","src"]),Qt=qt__default.default.all.filter(e=>e.indexOf("-")!=0&&!Yt.has(e)).map(e=>[e.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()),null]),Zt=Object.fromEntries(Qt),Oe=Pe(w.colors),er={color:Oe,backgroundColor:Oe,borderColor:Oe,border:a(a({},w.borderWidths),Oe),borderRadius:w.radii,borderWidth:w.borderWidths,boxShadow:w.shadows,fontFamily:w.fontFamilies,fontSize:w.fontSizes,fontWeight:w.fontWeights,gap:w.space,lineHeight:w.lineHeights,margin:w.space,marginBottom:w.space,marginLeft:w.space,marginRight:w.space,marginTop:w.space,padding:w.space,paddingBottom:w.space,paddingLeft:w.space,paddingRight:w.space,paddingTop:w.space},Io=a(a({},Zt),er),Ho={bg:["backgroundColor"],m:["margin"],mt:["marginTop"],mr:["marginRight"],mb:["marginBottom"],ml:["marginLeft"],mx:["marginLeft","marginRight"],my:["marginTop","marginBottom"],p:["padding"],pt:["paddingTop"],pr:["paddingRight"],pb:["paddingBottom"],pl:["paddingLeft"],px:["paddingLeft","paddingRight"],py:["paddingTop","paddingBottom"]},Mo=new Set(["active","disabled","focus","focusVisible","focusWithin","hover"]);function or(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 Wo=new Map(Object.entries(Io).map(([e,o])=>[e,or(o)])),tr=new Map(Object.entries(Ho).map(([e,o])=>[e,new Set(o)])),rr=new Set(["height","width"]),nr=new Set(["canvas","embed","iframe","img","input","object","video"]);function Ao(e){let[o,t]=e.split(":");return [o,Mo.has(t)?t:null]}function Lo(e,o="div"){let t=Object.assign({},e),n={};function r(i){if(i==null)return n;let p=`&:${i.replace(/[A-Z]/g,c=>`-${c.toLocaleLowerCase()}`)}`;return n[p]==null&&(n[p]={}),n[p]}return Object.entries(t).forEach(([i,s])=>{let[p,c]=Ao(i),u=tr.get(p);u!=null&&(u.forEach(f=>{let h=`${f}${c?":"+c:""}`;t[h]=s;}),delete t[i]);}),Object.entries(t).forEach(([i,s])=>{let[p,c]=Ao(i),u=Wo.get(p);if(u!=null){if(s==null)delete t[i];else if(typeof s=="string"&&s.indexOf(" ")>-1){let f=s.split(" ");r(c)[p]=f.map(h=>{var y;return (y=u.get(h.toString()))!=null?y:h}).join(" ");}else u.has(s.toString())?r(c)[p]=u.get(s.toString()):r(c)[p]=s;(typeof o!="string"||!nr.has(o)||!rr.has(p))&&delete t[i];}}),Object.keys(t).forEach(i=>{let s=i.substring(1);i.indexOf("_")===0&&Wo.has(s)&&(t[s]=t[i],delete t[i]);}),{cssFromProps:n,unmatchedProps:t}}function ar(){if(typeof window=="undefined"){let{JSDOM:e}=Ut("jsdom");return new e("<!DOCTYPE html>").window}return window}function $o(e){return e?{__html:ir__default.default(ar()).sanitize(e,{ALLOWED_TAGS:["b","strong","i","em","a","span","div","p","pre","s","u","br","img","code","li","ol","ul","table","tbody","thead","tr","td","th","h1","h2","h3","h4","video","p"],ALLOWED_ATTR:["style","class","target","id","href","alt","src","controls","autoplay","loop","muted","playsinline"]})}:{__html:""}}function lr(e){return e&&`fr-${e}`}function _o(e){return e&&(Array.isArray(e)?e.filter(o=>o!=null).map(o=>_o(o)).join(" "):lr(e))}function pr(p,s){var c=p,{as:e,children:o,className:t,css:n={},part:r}=c,i=m(c,["as","children","className","css","part"]);let u=e!=null?e:"div",{cssFromProps:f,unmatchedProps:h}=Lo(i,u),y=_o(r),b=t||y?clsx.clsx(t,y):void 0,S=[{boxSizing:"border-box"},f,n];return typeof o=="string"?jsxRuntime.jsx(u,d(a({className:b,css:S},h),{ref:s,dangerouslySetInnerHTML:$o(o)})):jsxRuntime.jsx(u,d(a({className:b,css:S},h),{ref:s,children:o}))}var x=Qe__namespace.forwardRef(pr);var I={};Q(I,{Link:()=>Lr,Plain:()=>$r,Primary:()=>Wr,Secondary:()=>Ar});var F={};Q(F,{Body1:()=>vr,Body2:()=>Br,Caption:()=>Rr,Display1:()=>Pr,Display2:()=>Cr,H1:()=>Sr,H2:()=>Fr,H3:()=>Tr,H4:()=>wr});var Xe={};Q(Xe,{Body1:()=>yr,Body2:()=>xr,Caption:()=>br,Display1:()=>dr,Display2:()=>cr,H1:()=>ur,H2:()=>mr,H3:()=>fr,H4:()=>gr});var Z={color:"neutral.foreground",fontFamily:"default",margin:"0"},dr=d(a({},Z),{fontSize:"5xl",fontWeight:"bold",lineHeight:"4xl"}),cr=d(a({},Z),{fontSize:"4xl",fontWeight:"bold",lineHeight:"3xl"}),ur=d(a({},Z),{fontSize:"3xl",fontWeight:"demibold",lineHeight:"2xl"}),mr=d(a({},Z),{fontSize:"2xl",fontWeight:"demibold",lineHeight:"xl"}),fr=d(a({},Z),{fontSize:"xl",fontWeight:"demibold",lineHeight:"lg"}),gr=d(a({},Z),{fontSize:"md",fontWeight:"demibold",lineHeight:"md"}),yr=d(a({},Z),{fontSize:"md",fontWeight:"regular",lineHeight:"md"}),xr=d(a({},Z),{fontSize:"sm",fontWeight:"regular",lineHeight:"sm"}),br=d(a({},Z),{fontSize:"xs",fontWeight:"regular",lineHeight:"xs"});var hr=["Display1","Display2","H1","H2","H3","H4","Body1","Body2","Caption"],ee=Object.fromEntries(hr.map(e=>{let o=["H1","H2","H3","H4"].includes(e)?e.toLowerCase():"span",t=Qe__namespace.forwardRef((p,s)=>{var c=p,{as:n=o,children:r}=c,i=m(c,["as","children"]);return jsxRuntime.jsx(x,d(a(a({as:n},Xe[e]),i),{ref:s,children:r}))});return t.displayName=`Text.${e}`,[e,t]})),Pr=ee.Display1,Cr=ee.Display2,Sr=ee.H1,Fr=ee.H2,Tr=ee.H3,wr=ee.H4,vr=ee.Body1,Br=ee.Body2,Rr=ee.Caption;var Ye={};Q(Ye,{Link:()=>Ir,Plain:()=>Hr,Primary:()=>Er,Secondary:()=>Or,loadingCSSStyle:()=>qe});var Ie={borderWidth:"md",borderRadius:"md",borderStyle:"solid",display:"flex",gap:"2",padding:"2 4",fontFamily:"inherit"},Er=d(a({},Ie),{backgroundColor:"primary.surface",borderColor:"primary.border",color:"primary.foreground","backgroundColor:hover":"primary.hover.surface","backgroundColor:disabled":"primary.surface","opacity:disabled":"0.7"}),Or=d(a({},Ie),{backgroundColor:"secondary.background",borderColor:"secondary.border",color:"secondary.foreground","backgroundColor:hover":"secondary.hover.background","backgroundColor:disabled":"secondary.background","opacity:disabled":"0.7"}),Ir=d(a({},Ie),{backgroundColor:"transparent",borderColor:"transparent",color:"primary.surface","color:hover":"primary.hover.surface"}),Hr=d(a({},Ie),{backgroundColor:"transparent",borderColor:"transparent",color:"neutral.foreground"}),Mr=react.keyframes({from:{transform:"rotate(0turn)"},to:{transform:"rotate(1turn)"}}),qe={position:"relative",color:"transparent","&:after":{content:'""',position:"absolute",width:"16px",height:"16px",top:0,left:0,right:0,bottom:0,margin:"auto",border:"4px solid transparent",borderTopColor:"var(--fr-colors-primary-foreground)",borderRadius:"50%",animation:Mr+" 1s ease infinite"}};function He(s){var p=s,{as:e,children:o,part:t,title:n,variant:r="Primary"}=p,i=m(p,["as","children","part","title","variant"]);var u;let c=r.toLocaleLowerCase();return jsxRuntime.jsxs(x,d(a(d(a({as:e!=null?e:"button",part:[`button-${c}`,t]},Ye[r]),{css:a(a({},(u=i.css)!=null?u:{}),i.loading?qe:{})}),i),{loading:void 0,children:[o,n&&jsxRuntime.jsx(F.Body2,{color:"inherit",css:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},flexGrow:"1",fontWeight:"medium",lineHeight:"20px",part:"button-title",textWrap:"nowrap",children:n})]}))}function Wr(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(He,d(a({},o),{variant:"Primary",children:e}))}function Ar(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(He,d(a({},o),{variant:"Secondary",children:e}))}function Lr(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(He,d(a({},o),{variant:"Link",children:e}))}function $r(t){var n=t,{children:e}=n,o=m(n,["children"]);return jsxRuntime.jsx(He,d(a({},o),{variant:"Plain",children:e}))}var C={};Q(C,{Column:()=>_r,Row:()=>Nr});var Nr=Qe__namespace.forwardRef((e,o)=>jsxRuntime.jsx(x,d(a({display:"flex",flexDirection:"row"},e),{ref:o}))),_r=Qe__namespace.forwardRef((e,o)=>jsxRuntime.jsx(x,d(a({display:"flex",flexDirection:"column"},e),{ref:o})));function Ze(r){var i=r,{dismissible:e,flowId:o,part:t}=i,n=m(i,["dismissible","flowId","part"]);return jsxRuntime.jsx(J,d(a({as:null,flowId:o},n),{children:({handleDismiss:s,handlePrimary:p,handleSecondary:c,parentProps:{containerProps:u},step:f})=>{var g,v,D,B,O;let h=(g=f.props)!=null?g:{},y=(D=(v=f.primaryButton)==null?void 0:v.title)!=null?D:f.primaryButtonTitle,b=(O=(B=f.secondaryButton)==null?void 0:B.title)!=null?O:f.secondaryButtonTitle,S=!!f.$state.blocked;return jsxRuntime.jsxs(P,d(a(a({alignItems:"center",borderWidth:"md",display:"flex",flexDirection:"row",gap:3,justifyContent:"flex-start",part:["banner",t]},u),h),{children:[f.imageUri&&jsxRuntime.jsx(x,{as:"img",part:"image",src:f.imageUri,style:{height:40,width:40,alignSelf:"center"}}),jsxRuntime.jsxs(C.Column,{marginInlineEnd:"auto",part:"banner-title-wrapper",children:[jsxRuntime.jsx(P.Title,{part:"title",children:f.title}),jsxRuntime.jsx(P.Subtitle,{part:"subtitle",children:f.subtitle})]}),jsxRuntime.jsx(P.Secondary,{disabled:S,title:b,onClick:c}),jsxRuntime.jsx(P.Primary,{disabled:S,title:y,onClick:p}),e&&jsxRuntime.jsx(P.Dismiss,{onClick:s})]}))}}))}var Le={};Q(Le,{Collapsible:()=>Ae,CollapsibleStep:()=>Se});var Se={};Q(Se,{Content:()=>oo,Root:()=>to,Trigger:()=>ro});var Kr=react.keyframes`
|
|
50
50
|
from {
|
|
51
51
|
height: 0;
|
|
52
52
|
opacity: 0;
|
|
@@ -55,7 +55,7 @@ var Co=Object.defineProperty,zt=Object.defineProperties;var Kt=Object.getOwnProp
|
|
|
55
55
|
height: var(--radix-collapsible-content-height);
|
|
56
56
|
opacity: 1;
|
|
57
57
|
}
|
|
58
|
-
`,
|
|
58
|
+
`,Ur=react.keyframes`
|
|
59
59
|
from {
|
|
60
60
|
height: var(--radix-collapsible-content-height);
|
|
61
61
|
opacity: 1;
|
|
@@ -64,7 +64,7 @@ var Co=Object.defineProperty,zt=Object.defineProperties;var Kt=Object.getOwnProp
|
|
|
64
64
|
height: 0;
|
|
65
65
|
opacity: 0;
|
|
66
66
|
}
|
|
67
|
-
`,Ur=()=>jsxRuntime.jsx(x,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Gr({checked:e=!1}){return jsxRuntime.jsx(x,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsxRuntime.jsx(x,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(Ur,{})})})}function oo({children:e}){return jsxRuntime.jsx(fe__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(C.Column,{css:{'&[data-state="open"]':{animation:`${Kr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${jr} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(x,{}),e]})})}function to(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=s,r=m(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(fe__namespace.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsxRuntime.jsx(P,d(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},r),{children:e}))})}function ro({isCompleted:e,title:o}){return jsxRuntime.jsx(fe__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(C.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(Gr,{checked:e}),jsxRuntime.jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(x,{as:outline.ChevronDownIcon,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var We={};Q(We,{Bar:()=>Me,Dots:()=>Xo,Segments:()=>Yo});function Me(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let i=o>0?Math.min(e/o,1):0,s=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(x,d(a({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(x,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function Xo(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,p)=>jsxRuntime.jsx(x,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?w.colors.blue500:w.colors.blue800},p));return jsxRuntime.jsx(x,d(a({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function Yo(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let i=[...Array(o)].map((s,p)=>jsxRuntime.jsx(x,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsxRuntime.jsx(C.Row,d(a({gap:1,height:"10px",part:"progress-segments"},t),{children:i}))}function se(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=Qe.useContext(E),r={"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:Qe.useCallback((i,s,p=!0)=>M(this,null,function*(){if((yield o==null?void 0:o(e,i,s))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(s,p)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,p),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:Qe.useCallback((i,s)=>M(this,null,function*(){if((yield t==null?void 0:t(e,i,s))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}var Zo=Qe.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function et({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var b,S,g,v,D,B;let{$state:{blocked:i,completed:s},subtitle:p,title:c}=r,u=(S=(b=r.primaryButton)==null?void 0:b.title)!=null?S:r.primaryButtonTitle,f=(v=(g=r.secondaryButton)==null?void 0:g.title)!=null?v:r.secondaryButtonTitle,h=(D=r.props)!=null?D:{},y=!!(s||i);return jsxRuntime.jsxs(to,d(a({open:t,onOpenChange:n},h),{children:[jsxRuntime.jsx(ro,{isCompleted:s,title:c}),jsxRuntime.jsxs(oo,{children:[jsxRuntime.jsx(P.Media,{aspectRatio:2.5,objectFit:"cover",src:(B=r.videoUri)!=null?B:r.imageUri,type:r.videoUri?"video":"image"}),jsxRuntime.jsx(P.Subtitle,{color:"neutral.400",children:p}),jsxRuntime.jsxs(C.Row,{gap:3,children:[jsxRuntime.jsx(P.Secondary,{disabled:y,title:f,onClick:o}),jsxRuntime.jsx(P.Primary,{disabled:y,title:u,onClick:e})]})]})]}))}var Qr={default:et};function Zr(n){var r=n,{flow:e,step:o}=r,t=m(r,["flow","step"]);var g;let{onPrimary:i,onSecondary:s,openStepId:p,setOpenStepId:c,stepTypes:u}=Qe.useContext(Zo),{handlePrimary:f,handleSecondary:h}=se(o,{onPrimary:i,onSecondary:s}),y=(p!=null?p:e.getCurrentStep().id)===o.id,b=(g=u[o.type])!=null?g:et;function S(v){return M(this,null,function*(){c(v?o.id:""),v&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(b,d(a({flow:e,onOpenChange:S,open:y,step:o},t),{handlePrimary:f,handleSecondary:h}),o.id)}function Ae(p){var c=p,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:i={}}=c,s=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,f]=Qe.useState(null),h=a(a({},Qr),i);return jsxRuntime.jsx(Zo.Provider,{value:{openStepId:u,setOpenStepId:f,onPrimary:t,onSecondary:n,stepTypes:h},children:jsxRuntime.jsx(J,d(a({as:P,borderWidth:"md",flowId:o,part:["checklist",r]},s),{children:g=>{var v=g,{flow:y,handleDismiss:b}=v,S=m(v,["flow","handleDismiss"]);let B=Array.from(y.steps.entries()).filter(([,T])=>T.$state.visible===!0).map(([,T])=>jsxRuntime.jsx(Zr,d(a({flow:y,handleDismiss:b},S),{step:T}),T.id)),O=y.getNumberOfCompletedSteps(),A=y.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(P.Header,{dismissible:e,handleDismiss:b,part:"checklist-header",subtitle:y.subtitle,title:y.title}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(F.Body2,{fontWeight:"demibold",children:[O,"/",A]}),jsxRuntime.jsx(Me,{current:O,total:A,flexGrow:1})]})]}),B]})}}))})}var ln=new Set(["required","min","max","minLength","maxLength","pattern"]);function pn({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=reactHookForm.useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let i=Object.fromEntries(Object.entries(t).filter(([p])=>ln.has(p))),s=reactHookForm.useController({name:t.id,control:o,rules:i});return jsxRuntime.jsx(e,d(a({},s),{fieldData:t,formContext:r,submit:n}))}function tt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:i}){var B,O,A,T,R,k;let{__readOnly:s}=Qe.useContext(E),p=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),[c,u]=Qe.useState(!1),f=[],{control:h,handleSubmit:y}=p,b=(B=i.props)!=null?B:{};function S(V,xe){u(!0),t(xe,V,s===!0).then(()=>u(!1));}(O=i.fields)==null||O.forEach(V=>{e[V.type]!=null&&f.push(jsxRuntime.jsx(pn,{control:h,fieldComponent:e[V.type],fieldData:V,submit:y(S)},`${i.flow.id}-${V.id}`));});let g=(T=(A=i.primaryButton)==null?void 0:A.title)!=null?T:i.primaryButtonTitle,v=(k=(R=i.secondaryButton)==null?void 0:R.title)!=null?k:i.secondaryButtonTitle,D=!!(i.$state.blocked||!p.formState.isValid);return jsxRuntime.jsxs(C.Column,d(a({gap:5,part:"form-step"},b),{children:[jsxRuntime.jsx(P.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsxRuntime.jsx(reactHookForm.FormProvider,d(a({},p),{children:f})),jsxRuntime.jsxs(C.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[v&&jsxRuntime.jsx(I.Secondary,{disabled:D,onClick:n,title:v}),jsxRuntime.jsx(I.Primary,{disabled:D||c,onClick:y(S),title:g!=null?g:"Submit",loading:c})]},"form-footer")]}))}function rt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function no({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(F.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(x,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Fe={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function oe({children:e,field:o,fieldData:t,fieldState:n}){var u;let{id:r,label:i,placeholder:s}=t,{error:p}=n,c=d(a(a(a({id:r},o),s?{placeholder:s}:{}),Fe),{"aria-invalid":!!p,value:(u=o.value)!=null?u:""});return jsxRuntime.jsxs(x,{part:"field",children:[jsxRuntime.jsx(no,{id:r,required:!!t.required,children:i}),e(c),jsxRuntime.jsx(rt,{error:p})]})}var fn=()=>jsxRuntime.jsx(x,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),gn=Qe__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(x,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsxRuntime.jsx(F.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(ye__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(x,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(x,{as:ye__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(fn,{})})})})]}));function io(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:i,value:s})=>jsxRuntime.jsx(gn,{value:s,label:i},s));return jsxRuntime.jsx(oe,d(a({},e),{children:()=>jsxRuntime.jsx(ye__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(C.Column,{gap:2,part:"field-radio-group",children:r})})}))}var bn=Qe__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(N__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(x,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(N__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function ao(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,i=n.map(({label:s,value:p})=>jsxRuntime.jsx(bn,{value:p,label:s},p));return jsxRuntime.jsx(oe,d(a({},e),{children:()=>jsxRuntime.jsxs(N__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(N__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(F.Body2,d(a({},Fe),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(N__namespace.Value,{placeholder:r!=null?r:"Select one"}),jsxRuntime.jsx(N__namespace.Icon,{children:jsxRuntime.jsx(x,{as:outline.ChevronDownIcon,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(N__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(x,d(a({},Fe),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(N__namespace.Viewport,{children:i})}))})]})}))}function so(e){return jsxRuntime.jsx(oe,d(a({},e),{children:o=>jsxRuntime.jsx(F.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function ct(e){return jsxRuntime.jsx(oe,d(a({},e),{children:o=>jsxRuntime.jsx(F.Body2,a({as:"textarea",part:"field-textarea"},o))}))}var hn={radio:io,select:ao,text:so,textarea:ct};function Te(r){var i=r,{fieldTypes:e={},flowId:o,part:t}=i,n=m(i,["fieldTypes","flowId","part"]);let s=Object.assign({},hn,e);return jsxRuntime.jsx(J,d(a({flowId:o,part:["form",t]},n),{children:p=>jsxRuntime.jsx(tt,a({fieldTypes:s},p))}))}var Ne={};Q(Ne,{NPS:()=>Ve});function ft({field:e,submit:o}){let t=[...Array(11)].map((n,r)=>{let i=e.value===r?I.Primary:I.Secondary;return jsxRuntime.jsx(i,{borderWidth:"1px",onClick:()=>{e.onChange(r),o();},title:`${r}`,css:{".fr-button-title":{fontSize:"15px"}}},r)});return jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(C.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:t}),jsxRuntime.jsxs(C.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:"Not likely at all"}),jsxRuntime.jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:"Extremely likely"})]})]})}function Ve(i){var s=i,{as:e=H,flowId:o,fieldTypes:t,part:n}=s,r=m(s,["as","flowId","fieldTypes","part"]);let{flow:p}=pe(o);return jsxRuntime.jsx(Te,a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:ft},t),modal:!1,onEscapeKeyDown:c=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(c),c.defaultPrevented||p.skip();},part:["nps",n],css:d(a({},!p||p.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function de(e,{onComplete:o,onDismiss:t}={}){let n=Qe.useRef(null);return Qe.useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&M(this,null,function*(){yield o==null?void 0:o(e);}),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:Qe.useCallback(r=>M(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}function _e(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=Qe.useState(e),[n,r]=Qe.useState(null),i=Qe.useCallback(s=>{r(s);},[]);return Qe.useLayoutEffect(()=>{if(!n)return;let s=()=>{let p=n.getBoundingClientRect();t(p);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[n]),{node:n,rect:o,ref:i}}var Bn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function xt(n){var r=n,{style:e={},part:o=""}=r,t=m(r,["style","part"]);return jsxRuntime.jsxs(x,d(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(x,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Bn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(x,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function lo(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);return jsxRuntime.jsx(x,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Dn(e){var o,t,n,r;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/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(r=e.split("loom.com/share/")[1])==null?void 0:r.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function po(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);let i=Dn(o);return i?jsxRuntime.jsx(x,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:i},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(x,a({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ce(n){var r=n,{src:e,type:o}=r,t=m(r,["src","type"]);return jsxRuntime.jsx(o==="video"?po:lo,a({src:e},t))}function ht({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},i=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};r[p[n]]=s;let c=i();return ["before","end"].includes(c)?["top","bottom"].includes(n)?r.right=s:r.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(n)?r.left=s:r.top=s:["top","bottom"].includes(n)?r.left=`calc(50% + ${s})`:r.top=`calc(50% + ${s})`,r}var ze={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Pt(e,o){var i,s,p,c,u;let t=Object.fromEntries(ze.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n=Object.fromEntries(ze.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r={};for(let f of Object.keys(e))!ze.content.includes(f)&&!ze.root.includes(f)&&(r[f]=e[f]);if(t.align=(i=t.align)!=null?i:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},h=(D,B)=>["top","bottom"].includes(B)?D=="after"?"marginLeft":"marginRight":D=="after"?"marginTop":"marginBottom",y=(p=t.alignOffset)!=null?p:0,b=(c=t.style)!=null?c:{},S=(u=t.side)!=null?u:"bottom",g=t.align;t.style=d(a({},b),{[h(g,S)]:y});let v=["top","bottom"].includes(S)?o.width:o.height;t.alignOffset=(v+y)*-1,t.align=f[g];}return {contentProps:t,otherProps:r,rootProps:n}}var Ct=react.keyframes`
|
|
67
|
+
`,jr=()=>jsxRuntime.jsx(x,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});function Gr({checked:e=!1}){return jsxRuntime.jsx(x,{backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"22px",width:"22px",children:e&&jsxRuntime.jsx(x,{alignItems:"center",bg:"green500",borderWidth:"md",borderStyle:"solid",borderColor:"green500",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(jr,{})})})}function oo({children:e}){return jsxRuntime.jsx(fe__namespace.Content,{asChild:!0,children:jsxRuntime.jsxs(C.Column,{css:{'&[data-state="open"]':{animation:`${Kr} 300ms ease-out`},'&[data-state="closed"]':{animation:`${Ur} 300ms ease-out`},overflow:"hidden"},gap:5,children:[jsxRuntime.jsx(x,{}),e]})})}function to(i){var s=i,{children:e,disabled:o=!1,onOpenChange:t=()=>{},open:n=!1}=s,r=m(s,["children","disabled","onOpenChange","open"]);return jsxRuntime.jsx(fe__namespace.Root,{asChild:!0,disabled:o,open:n,onOpenChange:t,children:jsxRuntime.jsx(P,d(a({borderWidth:"md",css:{'&[data-state="open"] .fr-collapsible-step-icon':{transform:"rotate(180deg)"}},gap:0},r),{children:e}))})}function ro({isCompleted:e,title:o}){return jsxRuntime.jsx(fe__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(C.Row,{alignItems:"center",justifyContent:"space-between",margin:-5,padding:5,zIndex:1,children:[jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsx(Gr,{checked:e}),jsxRuntime.jsx(F.Body2,{fontWeight:"demibold",userSelect:"none",children:o})]}),jsxRuntime.jsx(x,{as:outline.ChevronDownIcon,color:"neutral.100",css:{"& path":{vectorEffect:"non-scaling-stroke"}},display:"block",height:"16px",order:2,part:"collapsible-step-icon",width:"16px"})]})})}var We={};Q(We,{Bar:()=>Me,Dots:()=>Xo,Segments:()=>Yo});function Me(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let i=o>0?Math.min(e/o,1):0,s=i===0?"10px":`${100*i}%`;return jsxRuntime.jsx(x,d(a({part:"progress-bar",backgroundColor:"blue800",borderRadius:"md",height:"10px"},t),{children:jsxRuntime.jsx(x,{backgroundColor:"primary.surface",part:"progress-bar-fill",borderRadius:"md",height:"100%",style:{width:s},transition:"width 300ms ease-out"})}))}function Xo(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);if(o==1)return null;let i=[...Array(o)].map((s,p)=>jsxRuntime.jsx(x,{as:"circle",r:4,cx:4+16*p,cy:"4px",fill:e-1===p?w.colors.blue500:w.colors.blue800},p));return jsxRuntime.jsx(x,d(a({as:"svg",height:"8px",part:"progress-dots",viewBox:`0 0 ${16*o-8} 8`,width:16*o-8},t),{children:i}))}function Yo(n){var r=n,{current:e,total:o}=r,t=m(r,["current","total"]);let i=[...Array(o)].map((s,p)=>jsxRuntime.jsx(x,{backgroundColor:e-1===p?"primary.surface":"blue800",borderRadius:"md",flexGrow:1,height:"100%"},p));return jsxRuntime.jsx(C.Row,d(a({gap:1,height:"10px",part:"progress-segments"},t),{children:i}))}function se(e,{onPrimary:o,onSecondary:t}={}){let{navigate:n}=Qe.useContext(E),r={"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:Qe.useCallback((i,s,p=!0)=>M(this,null,function*(){if((yield o==null?void 0:o(e,i,s))===!1)return i.preventDefault(),!1;if(e.primaryButton!=null){let u=e.primaryButton.action===!1?!1:r[e.primaryButton.action];typeof u=="function"?u():u!==!1&&(yield e.complete(s,p)),e.primaryButton.uri!=null&&n(e.primaryButton.uri,e.primaryButton.target);}else yield e.complete(s,p),e.primaryButtonUri!=null&&n(e.primaryButtonUri,e.primaryButtonUriTarget);return !0}),[e]),handleSecondary:Qe.useCallback((i,s)=>M(this,null,function*(){if((yield t==null?void 0:t(e,i,s))===!1)return i.preventDefault(),!1;if(e.secondaryButton!=null){let c=e.secondaryButton.action===!1?!1:r[e.secondaryButton.action];typeof c=="function"?c():c!==!1&&e.complete(s),e.secondaryButton.uri!=null&&n(e.secondaryButton.uri,e.secondaryButton.target);}else e.complete(s),e.secondaryButtonUri!=null&&n(e.secondaryButtonUri,e.secondaryButtonUriTarget);return !0}),[e])}}var Zo=Qe.createContext({onPrimary:()=>{},onSecondary:()=>{},openStepId:null,setOpenStepId:()=>{},stepTypes:{}});function et({handlePrimary:e,handleSecondary:o,open:t,onOpenChange:n,step:r}){var b,S,g,v,D,B;let{$state:{blocked:i,completed:s},subtitle:p,title:c}=r,u=(S=(b=r.primaryButton)==null?void 0:b.title)!=null?S:r.primaryButtonTitle,f=(v=(g=r.secondaryButton)==null?void 0:g.title)!=null?v:r.secondaryButtonTitle,h=(D=r.props)!=null?D:{},y=!!(s||i);return jsxRuntime.jsxs(to,d(a({open:t,onOpenChange:n},h),{children:[jsxRuntime.jsx(ro,{isCompleted:s,title:c}),jsxRuntime.jsxs(oo,{children:[jsxRuntime.jsx(P.Media,{aspectRatio:2.5,objectFit:"cover",src:(B=r.videoUri)!=null?B:r.imageUri,type:r.videoUri?"video":"image"}),jsxRuntime.jsx(P.Subtitle,{color:"neutral.400",children:p}),jsxRuntime.jsxs(C.Row,{gap:3,children:[jsxRuntime.jsx(P.Secondary,{disabled:y,title:f,onClick:o}),jsxRuntime.jsx(P.Primary,{disabled:y,title:u,onClick:e})]})]})]}))}var Qr={default:et};function Zr(n){var r=n,{flow:e,step:o}=r,t=m(r,["flow","step"]);var g;let{onPrimary:i,onSecondary:s,openStepId:p,setOpenStepId:c,stepTypes:u}=Qe.useContext(Zo),{handlePrimary:f,handleSecondary:h}=se(o,{onPrimary:i,onSecondary:s}),y=(p!=null?p:e.getCurrentStep().id)===o.id,b=(g=u[o.type])!=null?g:et;function S(v){return M(this,null,function*(){c(v?o.id:""),v&&!o.$state.completed&&(yield o.start(),c(null));})}return jsxRuntime.jsx(b,d(a({flow:e,onOpenChange:S,open:y,step:o},t),{handlePrimary:f,handleSecondary:h}),o.id)}function Ae(p){var c=p,{dismissible:e,flowId:o,onPrimary:t,onSecondary:n,part:r,stepTypes:i={}}=c,s=m(c,["dismissible","flowId","onPrimary","onSecondary","part","stepTypes"]);let[u,f]=Qe.useState(null),h=a(a({},Qr),i);return jsxRuntime.jsx(Zo.Provider,{value:{openStepId:u,setOpenStepId:f,onPrimary:t,onSecondary:n,stepTypes:h},children:jsxRuntime.jsx(J,d(a({as:P,borderWidth:"md",flowId:o,part:["checklist",r]},s),{children:g=>{var v=g,{flow:y,handleDismiss:b}=v,S=m(v,["flow","handleDismiss"]);let B=Array.from(y.steps.entries()).filter(([,T])=>T.$state.visible===!0).map(([,T])=>jsxRuntime.jsx(Zr,d(a({flow:y,handleDismiss:b},S),{step:T}),T.id)),O=y.getNumberOfCompletedSteps(),A=y.getNumberOfAvailableSteps();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(P.Header,{dismissible:e,handleDismiss:b,part:"checklist-header",subtitle:y.subtitle,title:y.title}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:2,children:[jsxRuntime.jsxs(F.Body2,{fontWeight:"demibold",children:[O,"/",A]}),jsxRuntime.jsx(Me,{current:O,total:A,flexGrow:1})]})]}),B]})}}))})}var ln=new Set(["required","min","max","minLength","maxLength","pattern"]);function pn({fieldComponent:e,control:o,fieldData:t,submit:n}){let r=reactHookForm.useFormContext();t.pattern!=null&&(typeof t.pattern=="string"?t.pattern=new RegExp(t.pattern.replace(/^\/|\/$/g,"")):typeof t.pattern=="object"&&typeof t.pattern.value=="string"&&(t.pattern.value=new RegExp(t.pattern.value.replace(/^\/|\/$/g,""))));let i=Object.fromEntries(Object.entries(t).filter(([p])=>ln.has(p))),s=reactHookForm.useController({name:t.id,control:o,rules:i});return jsxRuntime.jsx(e,d(a({},s),{fieldData:t,formContext:r,submit:n}))}function tt({fieldTypes:e,handleDismiss:o,handlePrimary:t,handleSecondary:n,parentProps:{dismissible:r},step:i}){var B,O,A,T,R,k;let{__readOnly:s}=Qe.useContext(E),p=reactHookForm.useForm({delayError:2e3,mode:"onChange"}),[c,u]=Qe.useState(!1),f=[],{control:h,handleSubmit:y}=p,b=(B=i.props)!=null?B:{};function S(V,xe){u(!0),t(xe,V,s===!0).then(()=>u(!1));}(O=i.fields)==null||O.forEach(V=>{e[V.type]!=null&&f.push(jsxRuntime.jsx(pn,{control:h,fieldComponent:e[V.type],fieldData:V,submit:y(S)},`${i.flow.id}-${V.id}`));});let g=(T=(A=i.primaryButton)==null?void 0:A.title)!=null?T:i.primaryButtonTitle,v=(k=(R=i.secondaryButton)==null?void 0:R.title)!=null?k:i.secondaryButtonTitle,D=!!(i.$state.blocked||!p.formState.isValid);return jsxRuntime.jsxs(C.Column,d(a({gap:5,part:"form-step"},b),{children:[jsxRuntime.jsx(P.Header,{dismissible:r,handleDismiss:o,part:"form-step-header",subtitle:i.subtitle,title:i.title}),jsxRuntime.jsx(reactHookForm.FormProvider,d(a({},p),{children:f})),jsxRuntime.jsxs(C.Row,{part:"form-step-footer",justifyContent:"flex-end",gap:3,children:[v&&jsxRuntime.jsx(I.Secondary,{disabled:D,onClick:n,title:v}),jsxRuntime.jsx(I.Primary,{disabled:D||c,onClick:y(S),title:g!=null?g:"Submit",loading:c})]},"form-footer")]}))}function rt({error:e}){var o;return (o=e==null?void 0:e.message)!=null&&o.length?jsxRuntime.jsx(F.Caption,{color:"red500",display:"block",part:"field-error",mt:"1",textAlign:"end",children:e==null?void 0:e.message}):null}function no({children:e,id:o,required:t=!1}){return jsxRuntime.jsxs(F.Body2,{as:"label",htmlFor:o,part:"field-label",fontWeight:"medium",mb:"2",display:"block",children:[e,jsxRuntime.jsx(x,{part:"field-label-required",display:"inline",children:t&&"*"})]})}var Fe={px:"4",py:"2",backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",borderRadius:"md",display:"block",outline:"none",width:"100%"};function oe({children:e,field:o,fieldData:t,fieldState:n}){var u;let{id:r,label:i,placeholder:s}=t,{error:p}=n,c=d(a(a(a({id:r},o),s?{placeholder:s}:{}),Fe),{"aria-invalid":!!p,value:(u=o.value)!=null?u:""});return jsxRuntime.jsxs(x,{part:"field",children:[jsxRuntime.jsx(no,{id:r,required:!!t.required,children:i}),e(c),jsxRuntime.jsx(rt,{error:p})]})}var fn=()=>jsxRuntime.jsx(x,{as:"svg",color:"primary.foreground",width:"10px",height:"8px",viewBox:"0 0 10 8",fill:"none",children:jsxRuntime.jsx("path",{d:"M1 4.34664L3.4618 6.99729L3.4459 6.98017L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),gn=Qe__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsxs(x,{as:"label",backgroundColor:"neutral.background",borderColor:"neutral.border",borderRadius:"md",borderStyle:"solid",borderWidth:"md",display:"flex",htmlFor:o,justifyContent:"space-between",part:"field-radio",px:4,py:2,children:[jsxRuntime.jsx(F.Body2,{part:"field-radio-label",children:e}),jsxRuntime.jsx(ye__namespace.Item,{id:o,value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(x,{as:"button",backgroundColor:"inherit",borderWidth:"md",borderStyle:"solid",borderColor:"neutral.border",borderRadius:"100%",padding:"0",part:"field-radio-value",position:"relative",height:"24px",width:"24px",children:jsxRuntime.jsx(x,{as:ye__namespace.Indicator,alignItems:"center",bg:"primary.surface",borderWidth:"md",borderStyle:"solid",borderColor:"primary.border",borderRadius:"100%",display:"flex",height:"calc(100% + 2px)",justifyContent:"center",left:"-1px",part:"field-radio-indicator",position:"absolute",top:"-1px",width:"calc(100% + 2px)",children:jsxRuntime.jsx(fn,{})})})})]}));function io(e){let{field:{onChange:o,value:t},fieldData:{options:n=[]}}=e,r=n.map(({label:i,value:s})=>jsxRuntime.jsx(gn,{value:s,label:i},s));return jsxRuntime.jsx(oe,d(a({},e),{children:()=>jsxRuntime.jsx(ye__namespace.Root,{value:t,onValueChange:o,asChild:!0,children:jsxRuntime.jsx(C.Column,{gap:2,part:"field-radio-group",children:r})})}))}var bn=Qe__namespace.forwardRef(({label:e,value:o},t)=>jsxRuntime.jsx(N__namespace.Item,{value:o,ref:t,asChild:!0,children:jsxRuntime.jsx(x,{"backgroundColor:hover":"blue900",borderRadius:"md",outline:"none",part:"field-select-option",px:"3",py:"2",children:jsxRuntime.jsx(N__namespace.ItemText,{asChild:!0,children:jsxRuntime.jsx(F.Body2,{part:"field-select-option-label",children:e})})})}));function ao(e){let{field:{onChange:o,value:t},fieldData:{options:n=[],placeholder:r}}=e,i=n.map(({label:s,value:p})=>jsxRuntime.jsx(bn,{value:p,label:s},p));return jsxRuntime.jsx(oe,d(a({},e),{children:()=>jsxRuntime.jsxs(N__namespace.Root,{value:t,onValueChange:o,children:[jsxRuntime.jsx(N__namespace.Trigger,{asChild:!0,children:jsxRuntime.jsxs(F.Body2,d(a({},Fe),{alignItems:"center",display:"flex",justifyContent:"space-between",part:"field-select",children:[jsxRuntime.jsx(N__namespace.Value,{placeholder:r!=null?r:"Select one"}),jsxRuntime.jsx(N__namespace.Icon,{children:jsxRuntime.jsx(x,{as:outline.ChevronDownIcon,color:"neutral.100",display:"block",height:"24px",part:"field-select-icon",width:"24px"})})]}))}),jsxRuntime.jsx(N__namespace.Content,{position:"popper",sideOffset:4,asChild:!0,children:jsxRuntime.jsx(x,d(a({},Fe),{boxShadow:"md",maxHeight:"var(--radix-select-content-available-height)",p:"1",part:"field-select-options",width:"var(--radix-popper-anchor-width)",zIndex:"99999",children:jsxRuntime.jsx(N__namespace.Viewport,{children:i})}))})]})}))}function so(e){return jsxRuntime.jsx(oe,d(a({},e),{children:o=>jsxRuntime.jsx(F.Body2,a({as:"input",part:"field-text",type:"text"},o))}))}function ct(e){return jsxRuntime.jsx(oe,d(a({},e),{children:o=>jsxRuntime.jsx(F.Body2,a({as:"textarea",part:"field-textarea"},o))}))}var hn={radio:io,select:ao,text:so,textarea:ct};function Te(r){var i=r,{fieldTypes:e={},flowId:o,part:t}=i,n=m(i,["fieldTypes","flowId","part"]);let s=Object.assign({},hn,e);return jsxRuntime.jsx(J,d(a({flowId:o,part:["form",t]},n),{children:p=>jsxRuntime.jsx(tt,a({fieldTypes:s},p))}))}var Ne={};Q(Ne,{NPS:()=>Ve});function ft({field:e,submit:o}){let t=[...Array(11)].map((n,r)=>{let i=e.value===r?I.Primary:I.Secondary;return jsxRuntime.jsx(i,{borderWidth:"1px",onClick:()=>{e.onChange(r),o();},title:`${r}`,css:{".fr-button-title":{fontSize:"15px"}}},r)});return jsxRuntime.jsxs(C.Column,{gap:2,children:[jsxRuntime.jsx(C.Row,{gap:2,part:"field-nps",css:{"@media (min-width: 660px)":{flexWrap:"nowrap",justifyContent:"space-between"},flexWrap:"wrap",justifyContent:"center"},children:t}),jsxRuntime.jsxs(C.Row,{justifyContent:"space-between",part:"field-nps-label",children:[jsxRuntime.jsx(F.Caption,{part:"field-nps-left-label",color:"neutral.400",children:"Not likely at all"}),jsxRuntime.jsx(F.Caption,{part:"field-nps-right-label",color:"neutral.400",children:"Extremely likely"})]})]})}function Ve(i){var s=i,{as:e=H,flowId:o,fieldTypes:t,part:n}=s,r=m(s,["as","flowId","fieldTypes","part"]);let{flow:p}=pe(o);return jsxRuntime.jsx(Te,a({alignSelf:"end",as:e,flowId:o,fieldTypes:a({nps:ft},t),modal:!1,onEscapeKeyDown:c=>{typeof r.onEscapeKeyDown=="function"&&r.onEscapeKeyDown(c),c.defaultPrevented||p.skip();},part:["nps",n],css:d(a({},!p||p.getCurrentStepIndex()==0?{".fr-form-step-footer":{display:"none"}}:{}),{".fr-form":{padding:"20px","@media (min-width: 660px)":{minWidth:"600px"},minWidth:"100%"},".fr-form-step":{gap:"14px","@media (min-width: 660px)":{gap:"1"}}})},r))}function de(e,{onComplete:o,onDismiss:t}={}){let n=Qe.useRef(null);return Qe.useEffect(()=>{e!=null&&(e.isCompleted&&n.current===!1&&M(this,null,function*(){yield o==null?void 0:o(e);}),n.current=e==null?void 0:e.isCompleted);},[e==null?void 0:e.isCompleted]),{handleDismiss:Qe.useCallback(r=>M(this,null,function*(){if((yield t==null?void 0:t(e,r))===!1)return r.preventDefault(),!1;e.skip();}),[e])}}function _e(){let e="DOMRect"in globalThis?new DOMRect:{height:0,width:0,x:0,y:0,bottom:0,top:0,right:0,left:0,toJSON:()=>{}},[o,t]=Qe.useState(e),[n,r]=Qe.useState(null),i=Qe.useCallback(s=>{r(s);},[]);return Qe.useLayoutEffect(()=>{if(!n)return;let s=()=>{let p=n.getBoundingClientRect();t(p);};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[n]),{node:n,rect:o,ref:i}}var Bn=react.keyframes({"0%":{opacity:.5,transform:"scale(0.5)"},"50%":{opacity:0,transform:"scale(1)"},"100%":{opacity:0,transform:"scale(1)"}});function xt(n){var r=n,{style:e={},part:o=""}=r,t=m(r,["style","part"]);return jsxRuntime.jsxs(x,d(a({part:`dot-wrapper ${o}`,style:a({height:"48px",position:"absolute",width:"48px"},e)},t),{children:[jsxRuntime.jsx(x,{backgroundColor:"primary.surface",part:"dot-pulse",css:{animation:`2s ease-out infinite ${Bn}`,borderRadius:"24px",height:"48px",left:0,position:"absolute",top:0,transformOrigin:"center center",width:"48px"}}),jsxRuntime.jsx(x,{backgroundColor:"primary.surface",part:"dot",style:{borderRadius:"12px",height:"24px",left:"12px",position:"absolute",top:"12px",width:"24px"}})]}))}function lo(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);return jsxRuntime.jsx(x,a({as:"img",maxWidth:"unset",part:["image",e],src:o},t))}function Dn(e){var o,t,n,r;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/${(n=e.split("wistia.com/medias/")[1])==null?void 0:n.split("&")[0]}`:e.includes("loom")?`https://loom.com/embed/${(r=e.split("loom.com/share/")[1])==null?void 0:r.split("&")[0]}?hideEmbedTopBar=true&hide_title=true&hide_share=true&hide_owner=true`:null}function po(n){var r=n,{part:e,src:o}=r,t=m(r,["part","src"]);let i=Dn(o);return i?jsxRuntime.jsx(x,a({allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,as:"iframe",backgroundColor:"neutral.100",borderWidth:"0",part:["video",e],src:i},t)):o!=null&&o.endsWith(".mp4")?jsxRuntime.jsx(x,a({as:"video",controls:!0,part:["video",e],src:o},t)):(console.error(`Could not map videoUri ${o} to a known provider (Youtube, Vimeo, Wistia, Loom) or valid mp4 file.`),null)}function ce(n){var r=n,{src:e,type:o}=r,t=m(r,["src","type"]);return jsxRuntime.jsx(o==="video"?po:lo,a({src:e},t))}function ht({props:e,alignAttr:o,sideAttr:t}){let n=t!=null?t:"bottom",r={},i=()=>{var u;if(["after","before"].includes(e.align)){if(o=="start")return "before";if(o=="end")return "after"}return (u=e.align)!=null?u:"after"},s="-24px",p={top:"bottom",right:"left",bottom:"top",left:"right"};r[p[n]]=s;let c=i();return ["before","end"].includes(c)?["top","bottom"].includes(n)?r.right=s:r.bottom=s:["after","start"].includes(c)?["top","bottom"].includes(n)?r.left=s:r.top=s:["top","bottom"].includes(n)?r.left=`calc(50% + ${s})`:r.top=`calc(50% + ${s})`,r}var ze={content:["align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","forceMount","hideWhenDetached","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenAutoFocus","onPointerDownOutside","side","sideOffset","sticky"],root:["defaultOpen","modal","onOpenChange","open"]};function Pt(e,o){var i,s,p,c,u;let t=Object.fromEntries(ze.content.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),n=Object.fromEntries(ze.root.map(f=>[f,e[f]]).filter(f=>f[1]!==void 0)),r={};for(let f of Object.keys(e))!ze.content.includes(f)&&!ze.root.includes(f)&&(r[f]=e[f]);if(t.align=(i=t.align)!=null?i:"after",t.side=(s=t.side)!=null?s:"bottom",["before","after"].includes(t.align)){let f={after:"end",before:"start"},h=(D,B)=>["top","bottom"].includes(B)?D=="after"?"marginLeft":"marginRight":D=="after"?"marginTop":"marginBottom",y=(p=t.alignOffset)!=null?p:0,b=(c=t.style)!=null?c:{},S=(u=t.side)!=null?u:"bottom",g=t.align;t.style=d(a({},b),{[h(g,S)]:y});let v=["top","bottom"].includes(S)?o.width:o.height;t.alignOffset=(v+y)*-1,t.align=f[g];}return {contentProps:t,otherProps:r,rootProps:n}}var Ct=react.keyframes`
|
|
68
68
|
from {
|
|
69
69
|
opacity: 0;
|
|
70
70
|
}
|
|
@@ -74,7 +74,7 @@ var Co=Object.defineProperty,zt=Object.defineProperties;var Kt=Object.getOwnProp
|
|
|
74
74
|
to {
|
|
75
75
|
opacity: 1;
|
|
76
76
|
}
|
|
77
|
-
`;function $(s){var p=s,{anchor:e,children:o,className:t,spotlight:n=!1,style:r}=p,i=m(p,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:f}=_e(),{node:h,rect:y,ref:b}=_e(),xi=Pt(i,u),{contentProps:S,otherProps:_t}=xi,ho=_t,{part:g}=ho,v=m(ho,["part"]),{rootProps:D}=xi,[B,O]=Qe.useState(S.align),[A,T]=Qe.useState(S.side),[R,k]=Qe.useState(0),[V,xe]=Qe.useState(0);if(c!==null){let G=c.getAttribute("data-align"),ne=c.getAttribute("data-side");B!==G&&O(G),A!==ne&&T(ne);}let re=Qe.useRef(null);if(Qe.useEffect(()=>{let G=document.querySelector(e);G!=null?(b(G),re.current=G):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),Qe.useEffect(()=>{function G(be){if(be.matches(e))return be;let me=be.querySelectorAll(e);return me.length>0?me[0]:null}let ne=new MutationObserver(be=>{for(let me of be)if(me.type==="childList"){for(let he of me.addedNodes){if(he.nodeType!==Node.ELEMENT_NODE)continue;let ie=G(he);if(ie!=null){b(ie),re.current=ie,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",ie);break}}for(let he of me.removedNodes){if(he.nodeType!==Node.ELEMENT_NODE)continue;let ie=G(he);if(ie!=null){b(null),re.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",ie);break}}}});return ne.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ne.disconnect()},[]),Qe.useEffect(()=>{let{scrollX:G,scrollY:ne}=window;k(y.left+G),xe(y.top+ne);},[y.left,y.top]),h==null)return null;let Be="0";typeof window!="undefined"&&(Be=window.getComputedStyle(h).borderRadius);let Re=ht({props:i,alignAttr:B,sideAttr:A});return jsxRuntime.jsxs(Y__namespace.Root,d(a({defaultOpen:!0},D),{children:[jsxRuntime.jsx(Y__namespace.Anchor,{virtualRef:re}),jsxRuntime.jsx(Y__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx(x,a({animation:`${Ct} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:Be,height:y.height,left:R,top:V,width:y.width}},i.zIndex!=null?{zIndex:i.zIndex}:{})),jsxRuntime.jsx(Y__namespace.Content,d(a({asChild:!0},S),{ref:f,children:jsxRuntime.jsxs(P,d(a({animation:`${Ct} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},part:["tooltip",g],style:r},v),{children:[jsxRuntime.jsx(xt,{style:Re}),o]}))}))]})})]}))}$.Close=e=>jsxRuntime.jsx(Y__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(I.Plain,d(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});$.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsxRuntime.jsx(ce,a({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};$.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};$.Progress=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(a({part:"progress"},o),{children:e}))};$.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};$.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(a({part:"subtitle"},o),{children:e}))};$.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,d(a({part:"title"},o),{children:e}))};function St(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:n,onPrimary:r,onSecondary:i,step:s}=u,p=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var D,B,O,A,T,R;let{handleDismiss:f}=de(o,{onDismiss:t}),{handlePrimary:h,handleSecondary:y}=se(s,{onPrimary:r,onSecondary:i}),b=(D=s.props)!=null?D:{},S=(O=(B=s.primaryButton)==null?void 0:B.title)!=null?O:s.primaryButtonTitle,g=(T=(A=s.secondaryButton)==null?void 0:A.title)!=null?T:s.secondaryButtonTitle,v=!!s.$state.blocked;return jsxRuntime.jsxs($,d(a(a({anchor:s.selector,onOpenAutoFocus:k=>k.preventDefault(),onPointerDownOutside:k=>k.preventDefault(),onInteractOutside:k=>k.preventDefault()},p),b),{onEscapeKeyDown:k=>{typeof n=="function"&&n(k),k.defaultPrevented||f(k);},children:[e&&jsxRuntime.jsx($.Close,{onClick:f}),jsxRuntime.jsx($.Media,{src:(R=s.videoUri)!=null?R:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(C.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx($.Title,{children:s.title}),jsxRuntime.jsx($.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx($.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepIndex()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx($.Secondary,{disabled:v,onClick:y,title:g}),jsxRuntime.jsx($.Primary,{disabled:v,onClick:h,title:S})]})]}),s.id)}function we(e,o=!0){let{currentModal:t,modals:n,setModals:r}=Qe.useContext(E),[i,s]=Qe.useState(!1);Qe.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!n.has(e.id)&&r(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),Qe.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==i&&s(c);},[e==null?void 0:e.id,t]);function p(){o&&n.has(e==null?void 0:e.id)&&r(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:i||!o,removeModal:p}}function fo(i){var s=i,{flowId:e,onComplete:o,variables:t,part:n}=s,r=m(s,["flowId","onComplete","variables","part"]);let[p,c]=Qe.useState(!1),{flow:u}=pe(e,{variables:t}),{hasInitialized:f,registerComponent:h,unregisterComponent:y}=Qe.useContext(E);de(u,{onComplete:o});let{isCurrentModal:b,removeModal:S}=we(u);if(Qe.useEffect(()=>{!(u!=null&&u.isVisible)&&b&&S();},[u==null?void 0:u.isVisible,b]),Qe.useEffect(()=>()=>{y(e);},[]),u==null||u.isVisible===!1||!b||(h(e,()=>{p||c(!0);}),!f||!p))return null;let g=u.getCurrentStep();return g==null||g.start(),jsxRuntime.jsx(St,a({"data-flow-id":u.id,flow:u,part:["tour",n],step:g},r))}function wt(e){let[o,t]=Qe.useState(),{frigade:n}=Qe.useContext(E);return Qe.useEffect(()=>{M(this,null,function*(){let r=yield n.getCollection(e);if(!r||n.hasFailedToLoad()){t(void 0);return}t(r);});},[e]),{collection:o}}function go(n){var r=n,{collectionId:e,part:o}=r,t=m(r,["collectionId","part"]);var u,f,h;let i={ANNOUNCEMENT:yo,BANNER:Ze,CARD:P,CHECKLIST:Ae,EMBEDDED_TIP:P,FORM:Te,NPS_SURVEY:Ve,TOUR:fo},{collection:s}=wt(e),p=(u=s==null?void 0:s.flows.find(({flow:y})=>y.isVisible))==null?void 0:u.flow,c=(h=i[(f=p==null?void 0:p.rawData)==null?void 0:f.flowType])!=null?h:()=>null;return p==null||c==null?null:jsxRuntime.jsx(x,d(a({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(c,{flowId:p.id})}))}function xo(){let{frigade:e}=Qe.useContext(E);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Bt(){let[e,o]=Qe.useState(),{frigade:t}=xo();return Qe.useEffect(()=>{t.getCollections().then(n=>{n.forEach((r,i)=>{r.collectionType==="DEFAULT"&&o(i);});});},[]),e==null?null:jsxRuntime.jsx(go,{as:null,collectionId:e})}var E=Qe.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function It(s){var p=s,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=p,i=m(p,["children","css","defaultCollection","navigate","theme"]);let c=r?Ge(r):{},[u,f]=Qe.useState(new Set),h=Qe.useRef(new Map),y=Qe.useRef(),[b,S]=Qe.useState(!1),g=Qe.useMemo(()=>(S(!1),y.current=void 0,f(new Set),new js.Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides})),[i.userId,i.groupId,i.apiKey]);Qe.useEffect(()=>{if(i.__flowStateOverrides){let T=g.getConfig();T.__flowStateOverrides=i.__flowStateOverrides,g.reload(T);}},[i.__flowStateOverrides]);function v(){let T=[...h.current.entries()].map(([R,k])=>[R,k.callback]);g.batchRegister(T),S(!0);}function D(T,R){if(y.current&&clearTimeout(y.current),b){h.current.has(T)?g.getFlow(T).then(k=>R(k.isVisible)):(g.getFlow(T).then(k=>k.register(R)),h.current.set(T,{callback:R}));return}h.current.has(T)||h.current.set(T,{callback:R}),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>v(),0);}function B(T){h.current.has(T)&&g.getFlow(T).then(R=>{h.current.delete(T),R==null||R.unregister();});}let O=n!=null?n:(T,R="_self")=>{window.open(T,R);};Qe.useEffect(()=>()=>{g.destroy();},[]);let A=u.size>0?u.values().next().value:null;return jsxRuntime.jsxs(E.Provider,{value:d(a({modals:u,setModals:f,currentModal:A,navigate:O},i),{frigade:g,registerComponent:D,unregisterComponent:B,hasInitialized:b}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":a(a(a({},Je),c),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:w,children:[t&&jsxRuntime.jsx(Bt,{}),e]})]})}function pe(e,o){let[t,n]=Qe.useState(),[,r]=Qe.useState(""),{frigade:i}=Qe.useContext(E),s=Qe.useCallback(p=>{p.id===e&&(o!=null&&o.variables&&p.applyVariables(o.variables),setTimeout(()=>{n(p),r(Math.random().toString());},0));},[o==null?void 0:o.variables,i]);return Qe.useEffect(()=>{if(i!=null&&i.isReady())return M(this,null,function*(){let p=yield i.getFlow(e);if(!p||i.hasFailedToLoad()){n(void 0);return}o!=null&&o.variables&&p.applyVariables(o.variables),n(p);}),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}},[s,i]),Qe.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function J(h){var y=h,{as:e,children:o,dismissible:t=!1,flowId:n,onComplete:r,onDismiss:i,onPrimary:s,onSecondary:p,variables:c,forceMount:u}=y,f=m(y,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let[b,S]=Qe.useState(!1),{flow:g}=pe(n,{variables:c}),{hasInitialized:v,registerComponent:D,unregisterComponent:B}=Qe.useContext(E),O=g==null?void 0:g.getCurrentStep(),{handleDismiss:A}=de(g,{onComplete:r,onDismiss:i}),{handlePrimary:T,handleSecondary:R}=se(O,{onPrimary:s,onSecondary:p}),k=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:V,removeModal:xe}=we(g,k);Qe.useEffect(()=>{!(g!=null&&g.isVisible)&&V&&xe();},[g==null?void 0:g.isVisible,V]),Qe.useEffect(()=>()=>{B(n);},[]);let re=u&&((g==null?void 0:g.isCompleted)||(g==null?void 0:g.isSkipped));if(!g||!re&&!V||(D(n,()=>{b||S(!0);}),!g.isVisible&&!re)||!v||!b)return null;(re||!g.isCompleted&&!g.isSkipped)&&O.start();let Be=e===null?Qe.Fragment:e!=null?e:x,Re=d(a({},f),{"data-flow-id":g.id});return jsxRuntime.jsx(Be,d(a({},e===null?{}:Re),{children:o({flow:g,handleDismiss:A,handlePrimary:T,handleSecondary:R,parentProps:{dismissible:t,flowId:n,variables:c,containerProps:Re},step:O})}))}function Lt(t){var n=t,{part:e}=n,o=m(n,["part"]);return jsxRuntime.jsx(J,d(a({as:P,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:p},step:c})=>{var h,y,b,S;let u=(y=(h=c.primaryButton)==null?void 0:h.title)!=null?y:c.primaryButtonTitle,f=(S=(b=c.secondaryButton)==null?void 0:b.title)!=null?S:c.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P.Header,{dismissible:p,handleDismiss:r,subtitle:c.subtitle,title:c.title}),jsxRuntime.jsx(P.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(P.Secondary,{title:f,onClick:s}),jsxRuntime.jsx(P.Primary,{title:u,onClick:i})]})]})}}))}var P=Qe__namespace.forwardRef((r,n)=>{var i=r,{children:e,flowId:o}=i,t=m(i,["children","flowId"]);var p;if(o!=null)return jsxRuntime.jsx(Lt,a({flowId:o},t));let s=(p=t.as)!=null?p:C.Column;return jsxRuntime.jsx(s,d(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:n,children:e}))});P.Dismiss=e=>jsxRuntime.jsx(I.Plain,d(a({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}));P.Header=i=>{var s=i,{dismissible:e,handleDismiss:o,subtitle:t,title:n}=s,r=m(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(C.Row,d(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},r),{children:[jsxRuntime.jsx(P.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsxRuntime.jsx(P.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(P.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};P.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(ce,a({borderRadius:"md",src:e},o))};P.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};P.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};P.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(a({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};P.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,d(a({display:"block",part:"title"},o),{children:e}))};var je={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Vt(e){let o=Object.fromEntries(je.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(je.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!je.content.some(i=>i===r)&&!je.root.some(i=>i===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var di=react.keyframes`
|
|
77
|
+
`;function $(s){var p=s,{anchor:e,children:o,className:t,spotlight:n=!1,style:r}=p,i=m(p,["anchor","children","className","spotlight","style"]);let{node:c,rect:u,ref:f}=_e(),{node:h,rect:y,ref:b}=_e(),xi=Pt(i,u),{contentProps:S,otherProps:_t}=xi,ho=_t,{part:g}=ho,v=m(ho,["part"]),{rootProps:D}=xi,[B,O]=Qe.useState(S.align),[A,T]=Qe.useState(S.side),[R,k]=Qe.useState(0),[V,xe]=Qe.useState(0);if(c!==null){let G=c.getAttribute("data-align"),ne=c.getAttribute("data-side");B!==G&&O(G),A!==ne&&T(ne);}let re=Qe.useRef(null);if(Qe.useEffect(()=>{let G=document.querySelector(e);G!=null?(b(G),re.current=G):console.debug(`[frigade] Tooltip: No anchor found for query: ${e}`);},[e]),Qe.useEffect(()=>{function G(be){if(be.matches(e))return be;let me=be.querySelectorAll(e);return me.length>0?me[0]:null}let ne=new MutationObserver(be=>{for(let me of be)if(me.type==="childList"){for(let he of me.addedNodes){if(he.nodeType!==Node.ELEMENT_NODE)continue;let ie=G(he);if(ie!=null){b(ie),re.current=ie,console.debug("[frigade] Tooltip: MutationObserver added anchor: ",ie);break}}for(let he of me.removedNodes){if(he.nodeType!==Node.ELEMENT_NODE)continue;let ie=G(he);if(ie!=null){b(null),re.current=null,console.debug("[frigade] Tooltip: MutationObserver removed anchor: ",ie);break}}}});return ne.observe(document.querySelector("body"),{childList:!0,subtree:!0}),()=>ne.disconnect()},[]),Qe.useEffect(()=>{let{scrollX:G,scrollY:ne}=window;k(y.left+G),xe(y.top+ne);},[y.left,y.top]),h==null)return null;let Be="0";typeof window!="undefined"&&(Be=window.getComputedStyle(h).borderRadius);let Re=ht({props:i,alignAttr:B,sideAttr:A});return jsxRuntime.jsxs(Y__namespace.Root,d(a({defaultOpen:!0},D),{children:[jsxRuntime.jsx(Y__namespace.Anchor,{virtualRef:re}),jsxRuntime.jsx(Y__namespace.Portal,{children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx(x,a({animation:`${Ct} 300ms ease-out`,boxShadow:"0 0 0 20000px rgb(0 0 0 / 0.5)",part:"tooltip-spotlight",pointerEvents:"none",position:"absolute",style:{borderRadius:Be,height:y.height,left:R,top:V,width:y.width}},i.zIndex!=null?{zIndex:i.zIndex}:{})),jsxRuntime.jsx(Y__namespace.Content,d(a({asChild:!0},S),{ref:f,children:jsxRuntime.jsxs(P,d(a({animation:`${Ct} 300ms ease-out`,boxShadow:"md",position:"relative",className:t,css:{maxWidth:"360px",pointerEvents:"auto"},part:["tooltip",g],style:r},v),{children:[jsxRuntime.jsx(xt,{style:Re}),o]}))}))]})})]}))}$.Close=e=>jsxRuntime.jsx(Y__namespace.Close,{"aria-label":"Close",asChild:!0,children:jsxRuntime.jsx(I.Plain,d(a({css:{top:"0px",right:"-6px"},part:"close",position:"absolute"},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}))});$.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null?null:jsxRuntime.jsx(ce,a({borderRadius:"md md 0 0",borderWidth:"0",css:{aspectRatio:"2",objectFit:"cover"},margin:"-5 -5 0",src:e},o))};$.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};$.Progress=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(a({part:"progress"},o),{children:e}))};$.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};$.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(a({part:"subtitle"},o),{children:e}))};$.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,d(a({part:"title"},o),{children:e}))};function St(c){var u=c,{dismissible:e=!0,flow:o,onDismiss:t,onEscapeKeyDown:n,onPrimary:r,onSecondary:i,step:s}=u,p=m(u,["dismissible","flow","onDismiss","onEscapeKeyDown","onPrimary","onSecondary","step"]);var D,B,O,A,T,R;let{handleDismiss:f}=de(o,{onDismiss:t}),{handlePrimary:h,handleSecondary:y}=se(s,{onPrimary:r,onSecondary:i}),b=(D=s.props)!=null?D:{},S=(O=(B=s.primaryButton)==null?void 0:B.title)!=null?O:s.primaryButtonTitle,g=(T=(A=s.secondaryButton)==null?void 0:A.title)!=null?T:s.secondaryButtonTitle,v=!!s.$state.blocked;return jsxRuntime.jsxs($,d(a(a({anchor:s.selector,onOpenAutoFocus:k=>k.preventDefault(),onPointerDownOutside:k=>k.preventDefault(),onInteractOutside:k=>k.preventDefault()},p),b),{onEscapeKeyDown:k=>{typeof n=="function"&&n(k),k.defaultPrevented||f(k);},children:[e&&jsxRuntime.jsx($.Close,{onClick:f}),jsxRuntime.jsx($.Media,{src:(R=s.videoUri)!=null?R:s.imageUri,type:s.videoUri?"video":"image"}),jsxRuntime.jsxs(C.Column,{gap:1,part:"tooltip-header",children:[jsxRuntime.jsx($.Title,{children:s.title}),jsxRuntime.jsx($.Subtitle,{color:"neutral.400",children:s.subtitle})]}),jsxRuntime.jsxs(C.Row,{alignItems:"center",gap:3,justifyContent:"flex-end",part:"tooltip-footer",children:[o.getNumberOfAvailableSteps()>1&&jsxRuntime.jsx($.Progress,{marginRight:"auto",transform:"translateY(1px)",children:`${o.getCurrentStepIndex()+1}/${o.getNumberOfAvailableSteps()}`}),jsxRuntime.jsx($.Secondary,{disabled:v,onClick:y,title:g}),jsxRuntime.jsx($.Primary,{disabled:v,onClick:h,title:S})]})]}),s.id)}function we(e,o=!0){let{currentModal:t,modals:n,setModals:r}=Qe.useContext(E),[i,s]=Qe.useState(!1);Qe.useEffect(()=>{o&&(e!=null&&e.isVisible)&&e&&!n.has(e.id)&&r(c=>new Set(c).add(e.id));},[e==null?void 0:e.id,e==null?void 0:e.isVisible]),Qe.useEffect(()=>{let c=t===(e==null?void 0:e.id);o&&(e==null?void 0:e.id)!=null&&c!==i&&s(c);},[e==null?void 0:e.id,t]);function p(){o&&n.has(e==null?void 0:e.id)&&r(c=>{let u=new Set(c);return u.delete(e==null?void 0:e.id),u});}return {isCurrentModal:i||!o,removeModal:p}}function fo(i){var s=i,{flowId:e,onComplete:o,variables:t,part:n}=s,r=m(s,["flowId","onComplete","variables","part"]);let[p,c]=Qe.useState(!1),{flow:u}=pe(e,{variables:t}),{hasInitialized:f,registerComponent:h,unregisterComponent:y}=Qe.useContext(E);de(u,{onComplete:o});let{isCurrentModal:b,removeModal:S}=we(u);if(Qe.useEffect(()=>{!(u!=null&&u.isVisible)&&b&&S();},[u==null?void 0:u.isVisible,b]),Qe.useEffect(()=>()=>{y(e);},[]),u==null||u.isVisible===!1||!b||(h(e,()=>{p||c(!0);}),!f||!p))return null;let g=u.getCurrentStep();return g==null||g.start(),jsxRuntime.jsx(St,a({"data-flow-id":u.id,flow:u,part:["tour",n],step:g},r))}function wt(e){let[o,t]=Qe.useState(),{frigade:n}=Qe.useContext(E);return Qe.useEffect(()=>{M(this,null,function*(){let r=yield n.getCollection(e);if(!r||n.hasFailedToLoad()){t(void 0);return}t(r);});},[e]),{collection:o}}function go(n){var r=n,{collectionId:e,part:o}=r,t=m(r,["collectionId","part"]);var u,f,h;let i={ANNOUNCEMENT:yo,BANNER:Ze,CARD:P,CHECKLIST:Ae,EMBEDDED_TIP:P,FORM:Te,NPS_SURVEY:Ve,TOUR:fo},{collection:s}=wt(e),p=(u=s==null?void 0:s.flows.find(({flow:y})=>y.isVisible))==null?void 0:u.flow,c=(h=i[(f=p==null?void 0:p.rawData)==null?void 0:f.flowType])!=null?h:()=>null;return p==null||c==null?null:jsxRuntime.jsx(x,d(a({part:["collection",o],"data-collection-id":e},t),{children:jsxRuntime.jsx(c,{flowId:p.id})}))}function xo(){let{frigade:e}=Qe.useContext(E);return {frigade:e,isLoading:!(e!=null&&e.isReady())}}function Bt(){let[e,o]=Qe.useState(),{frigade:t}=xo();return Qe.useEffect(()=>{t.getCollections().then(n=>{n.forEach((r,i)=>{r.collectionType==="DEFAULT"&&o(i);});});},[]),e==null?null:jsxRuntime.jsx(go,{as:null,collectionId:e})}var E=Qe.createContext({apiKey:"",modals:new Set,setModals:()=>{},currentModal:null,navigate:()=>{},hasInitialized:!1,registerComponent:()=>{},unregisterComponent:()=>{}});function It(s){var p=s,{children:e,css:o={},defaultCollection:t=!0,navigate:n,theme:r}=p,i=m(p,["children","css","defaultCollection","navigate","theme"]);let c=r?Ge(r):{},[u,f]=Qe.useState(new Set),h=Qe.useRef(new Map),y=Qe.useRef(),[b,S]=Qe.useState(!1),g=Qe.useMemo(()=>(S(!1),y.current=void 0,f(new Set),new js.Frigade(i.apiKey,{apiKey:i.apiKey,apiUrl:i.apiUrl,userId:i.userId,groupId:i.groupId,userProperties:i.userProperties,groupProperties:i.groupProperties,generateGuestId:i.generateGuestId,syncOnWindowUpdates:i.syncOnWindowUpdates,__readOnly:i.__readOnly,__flowStateOverrides:i.__flowStateOverrides})),[i.userId,i.groupId,i.apiKey]);Qe.useEffect(()=>{if(i.__flowStateOverrides){let T=g.getConfig();T.__flowStateOverrides=i.__flowStateOverrides,g.reload(T);}},[i.__flowStateOverrides]);function v(){let T=[...h.current.entries()].map(([R,k])=>[R,k.callback]);g.batchRegister(T),S(!0);}function D(T,R){if(y.current&&clearTimeout(y.current),b){h.current.has(T)?g.getFlow(T).then(k=>R(k.isVisible)):(g.getFlow(T).then(k=>k.register(R)),h.current.set(T,{callback:R}));return}h.current.has(T)||h.current.set(T,{callback:R}),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>v(),0);}function B(T){h.current.has(T)&&g.getFlow(T).then(R=>{h.current.delete(T),R==null||R.unregister();});}let O=n!=null?n:(T,R="_self")=>{window.open(T,R);};Qe.useEffect(()=>()=>{g.destroy();},[]);let A=u.size>0?u.values().next().value:null;return jsxRuntime.jsxs(E.Provider,{value:d(a({modals:u,setModals:f,currentModal:A,navigate:O},i),{frigade:g,registerComponent:D,unregisterComponent:B,hasInitialized:b}),children:[jsxRuntime.jsx(react.Global,{styles:{":root":a(a(a({},Je),c),o)}}),jsxRuntime.jsxs(react.ThemeProvider,{theme:w,children:[t&&jsxRuntime.jsx(Bt,{}),e]})]})}function pe(e,o){let[t,n]=Qe.useState(),[,r]=Qe.useState(""),{frigade:i}=Qe.useContext(E),s=Qe.useCallback(p=>{p.id===e&&(o!=null&&o.variables&&p.applyVariables(o.variables),setTimeout(()=>{n(p),r(Math.random().toString());},0));},[o==null?void 0:o.variables,i]);return Qe.useEffect(()=>{if(i!=null&&i.isReady())return M(this,null,function*(){let p=yield i.getFlow(e);if(!p||i.hasFailedToLoad()){n(void 0);return}o!=null&&o.variables&&p.applyVariables(o.variables),n(p);}),i.onStateChange(s),()=>{i.removeStateChangeHandler(s);}},[s,i]),Qe.useEffect(()=>{!(o!=null&&o.variables)||!t||s(t);},[o==null?void 0:o.variables]),{flow:t}}function J(h){var y=h,{as:e,children:o,dismissible:t=!1,flowId:n,onComplete:r,onDismiss:i,onPrimary:s,onSecondary:p,variables:c,forceMount:u}=y,f=m(y,["as","children","dismissible","flowId","onComplete","onDismiss","onPrimary","onSecondary","variables","forceMount"]);let[b,S]=Qe.useState(!1),{flow:g}=pe(n,{variables:c}),{hasInitialized:v,registerComponent:D,unregisterComponent:B}=Qe.useContext(E),O=g==null?void 0:g.getCurrentStep(),{handleDismiss:A}=de(g,{onComplete:r,onDismiss:i}),{handlePrimary:T,handleSecondary:R}=se(O,{onPrimary:s,onSecondary:p}),k=e&&typeof e=="function"&&e.displayName==="Dialog",{isCurrentModal:V,removeModal:xe}=we(g,k);Qe.useEffect(()=>{!(g!=null&&g.isVisible)&&V&&xe();},[g==null?void 0:g.isVisible,V]),Qe.useEffect(()=>()=>{B(n);},[]);let re=u&&((g==null?void 0:g.isCompleted)||(g==null?void 0:g.isSkipped));if(!g||!re&&!V||(D(n,()=>{b||S(!0);}),!g.isVisible&&!re)||!v||!b)return null;(re||!g.isCompleted&&!g.isSkipped)&&O.start();let Be=e===null?Qe.Fragment:e!=null?e:x,Re=d(a({},f),{"data-flow-id":g.id});return jsxRuntime.jsx(Be,d(a({},e===null?{}:Re),{children:o({flow:g,handleDismiss:A,handlePrimary:T,handleSecondary:R,parentProps:{dismissible:t,flowId:n,variables:c,containerProps:Re},step:O})}))}function Lt(t){var n=t,{part:e}=n,o=m(n,["part"]);return jsxRuntime.jsx(J,d(a({as:P,gap:5,borderColor:"neutral.border",borderStyle:"solid",borderWidth:"md",part:["card",e]},o),{children:({handleDismiss:r,handlePrimary:i,handleSecondary:s,parentProps:{dismissible:p},step:c})=>{var h,y,b,S;let u=(y=(h=c.primaryButton)==null?void 0:h.title)!=null?y:c.primaryButtonTitle,f=(S=(b=c.secondaryButton)==null?void 0:b.title)!=null?S:c.secondaryButtonTitle;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(P.Header,{dismissible:p,handleDismiss:r,subtitle:c.subtitle,title:c.title}),jsxRuntime.jsx(P.Media,{src:c.imageUri,css:{objectFit:"contain",width:"100%"}}),jsxRuntime.jsxs(C.Row,{gap:3,justifyContent:"flex-end",part:"card-footer",children:[jsxRuntime.jsx(P.Secondary,{title:f,onClick:s}),jsxRuntime.jsx(P.Primary,{title:u,onClick:i})]})]})}}))}var P=Qe__namespace.forwardRef((r,n)=>{var i=r,{children:e,flowId:o}=i,t=m(i,["children","flowId"]);var p;if(o!=null)return jsxRuntime.jsx(Lt,a({flowId:o},t));let s=(p=t.as)!=null?p:C.Column;return jsxRuntime.jsx(s,d(a({backgroundColor:"neutral.background",borderColor:"neutral.border",borderStyle:"solid",borderRadius:"md",borderWidth:"0",gap:5,p:5},t),{ref:n,children:e}))});P.Dismiss=e=>jsxRuntime.jsx(I.Plain,d(a({part:"dismiss",padding:0},e),{children:jsxRuntime.jsx(solid.XMarkIcon,{height:"20",fill:"currentColor"})}));P.Header=i=>{var s=i,{dismissible:e,handleDismiss:o,subtitle:t,title:n}=s,r=m(s,["dismissible","handleDismiss","subtitle","title"]);return jsxRuntime.jsxs(C.Row,d(a({alignItems:"flex-start",flexWrap:"wrap",gap:1,part:"card-header"},r),{children:[jsxRuntime.jsx(P.Title,{maxWidth:"calc(100% - 32px)",children:n}),e&&jsxRuntime.jsx(P.Dismiss,{onClick:o,marginLeft:"auto"}),jsxRuntime.jsx(P.Subtitle,{color:"neutral.400",flexBasis:"100%",children:t})]}))};P.Media=t=>{var n=t,{src:e}=n,o=m(n,["src"]);return e==null||(e==null?void 0:e.length)===0?null:jsxRuntime.jsx(ce,a({borderRadius:"md",src:e},o))};P.Primary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(I.Primary,a({title:o,onClick:e},t))};P.Secondary=n=>{var r=n,{onClick:e,title:o}=r,t=m(r,["onClick","title"]);return o==null||(o==null?void 0:o.length)===0?null:jsxRuntime.jsx(I.Secondary,a({title:o,onClick:e},t))};P.Subtitle=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.Body2,d(a({display:"block",color:"neutral.400",part:"subtitle"},o),{children:e}))};P.Title=t=>{var n=t,{children:e}=n,o=m(n,["children"]);return e==null?null:jsxRuntime.jsx(F.H4,d(a({display:"block",part:"title"},o),{children:e}))};var Ue={content:["onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside"],root:["defaultOpen","modal","onOpenChange","open"]};function Vt(e){let o=Object.fromEntries(Ue.content.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),t=Object.fromEntries(Ue.root.map(r=>[r,e[r]]).filter(r=>r[1]!==void 0)),n={};for(let r of Object.keys(e))!Ue.content.some(i=>i===r)&&!Ue.root.some(i=>i===r)&&(n[r]=e[r]);return {contentProps:o,otherProps:n,rootProps:t}}var di=react.keyframes`
|
|
78
78
|
from {
|
|
79
79
|
opacity: 0;
|
|
80
80
|
}
|