Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@flows/react-components

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flows/react-components - npm Package Compare versions

Comparing version
1.2.1
to
1.2.2
+2
dist/chunk-NC7W7N7K.mjs
"use client"
var K=Object.defineProperty,z=Object.defineProperties;var J=Object.getOwnPropertyDescriptors;var T=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var O=(t,e,o)=>e in t?K(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,m=(t,e)=>{for(var o in e||(e={}))k.call(e,o)&&O(t,o,e[o]);if(T)for(var o of T(e))D.call(e,o)&&O(t,o,e[o]);return t},I=(t,e)=>z(t,J(e));var _=(t,e)=>{var o={};for(var n in t)k.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&T)for(var n of T(t))e.indexOf(n)<0&&D.call(t,n)&&(o[n]=t[n]);return o};import j from"classnames";import{jsx as tt}from"react/jsx-runtime";var It=n=>{var s=n,{className:t,variant:e}=s,o=_(s,["className","variant"]);return tt("button",m({type:"button",className:j("flows_button",`flows_button_${e}`,t)},o))};import st from"classnames";import{jsx as L}from"react/jsx-runtime";function y(t){return L("svg",I(m({height:16,viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"},t),{children:L("path",{d:"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"})}))}import et from"classnames";import{jsx as ot}from"react/jsx-runtime";var c=n=>{var s=n,{className:t,variant:e}=s,o=_(s,["className","variant"]);return ot("p",m({className:et("flows_text",`flows_text_${e}`,t)},o))};import nt from"classnames";import{jsx as lt}from"react/jsx-runtime";var w=o=>{var n=o,{className:t}=n,e=_(n,["className"]);return lt("button",m({type:"button",className:nt("flows_iconButton",t)},e))};import{Fragment as rt,jsx as d,jsxs as B}from"react/jsx-runtime";var te=t=>B(rt,{children:[t.overlay?d("div",{className:st("flows_modal_overlay",t.onClose&&"flows_modal_clickable"),onClick:t.onClose,"aria-hidden":"true"}):null,d("div",{className:"flows_modal_wrapper",children:B("div",{className:"flows_modal_modal",children:[d(c,{variant:"title",children:t.title}),d(c,{variant:"body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?d("div",{className:"flows_modal_footer",children:t.buttons}):null,t.onClose?d(w,{"aria-label":"Close",className:"flows_modal_close",onClick:t.onClose,children:d(y,{})}):null]})})]});import{useCallback as ft,useEffect as P,useMemo as ut,useRef as S,useState as dt}from"react";import{useFloating as pt,shift as gt,offset as _t,arrow as yt,flip as wt,autoUpdate as bt}from"@floating-ui/react-dom";import U from"classnames";var at="#22262d",it="#fff",M="%cFlows%c",$=`color:${it};background:${at};padding:2px 4px;border-radius:4px`,R={error:(t,...e)=>{console.error(`${M} ${t}`,$,"",...e)},warn:(t,...e)=>{console.warn(`${M} ${t}`,$,"",...e)}};import{useState as ct,useEffect as mt}from"react";function A(t){let[e,o]=ct(t?document.querySelector(t):null);return mt(()=>{if(!t){o(null);return}let n=()=>{let r=document.querySelector(t);o(i=>i!==r?r:i)};n();let s=new MutationObserver(r=>{r.some(a=>a.addedNodes.length>0||a.removedNodes.length>0)&&n()});return s.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{s.disconnect()}},[t]),e}import{jsx as f,jsxs as H}from"react/jsx-runtime";var vt=4,G=6,Ct=vt+G,Nt=8,ht=8,Et=(t,e,o)=>bt(t,e,o,{animationFrame:!0}),pe=t=>{var g,C;let e=S(null),o=S(null),n=S(null),s=A(t.targetElement),{refs:r,middlewareData:i,placement:a,x:N,y:F}=pt({placement:t.placement,elements:{reference:s},whileElementsMounted:Et,middleware:[wt({fallbackPlacements:["top","bottom","left","right"]}),gt({crossAxis:!0,padding:Nt}),yt({element:o,padding:ht}),_t(Ct)]}),[p,u]=dt(!1);P(()=>{s||u(!1)},[s]),P(()=>{if(p)return;let l=r.floating.current;if(!l)return;window.getComputedStyle(l).animationName!=="none"||u(!0)},[p,r.floating]);let h=ft(()=>{u(!0)},[]),E=ut(()=>a.includes("top")?"bottom":a.includes("bottom")?"top":a.includes("left")?"right":"left",[a]);if(P(()=>{t.targetElement||R.error("Cannot render Tooltip without target element")},[t.targetElement]),!s)return null;r.floating.current&&(r.floating.current.style.left=`${N}px`,r.floating.current.style.top=`${F}px`);let v=(g=i.arrow)==null?void 0:g.x,x=(C=i.arrow)==null?void 0:C.y;if([o,e].forEach(l=>{l.current&&(l.current.style.left=v!=null?`${v}px`:"",l.current.style.top=x!=null?`${x}px`:"",l.current.style.right="",l.current.style.bottom="",l.current.style[E]=`${-G}px`)}),n.current){let l=s.getBoundingClientRect();n.current.style.top=`${l.top}px`,n.current.style.left=`${l.left}px`,n.current.style.width=`${l.width}px`,n.current.style.height=`${l.height}px`}return H("div",{className:"flows_tooltip_root",children:[t.overlay?f("div",{className:"flows_tooltip_overlay",ref:n}):null,H("div",{className:"flows_tooltip_tooltip",ref:r.setFloating,"data-open":p?"true":"false",onAnimationEnd:h,children:[f(c,{className:"flows_tooltip_title",variant:"title",children:t.title}),f(c,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?f("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?f(w,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:f(y,{})}):null,f("div",{className:U("flows_tooltip_arrow","flows_tooltip_arrow-bottom"),ref:o}),f("div",{className:U("flows_tooltip_arrow","flows_tooltip_arrow-top"),ref:e})]})]})};import{flip as xt,offset as Tt,shift as Rt,useFloating as Y,autoUpdate as At}from"@floating-ui/react-dom";import{useCallback as q,useEffect as X,useState as Q}from"react";import{Fragment as Ot,jsx as b,jsxs as W}from"react/jsx-runtime";var Ft=300,Pt=8,St=4,V=(t,e,o)=>At(t,e,o,{animationFrame:!0}),Ee=t=>{var h,E;let[e,o]=Q(!1),n=q(()=>{o(!0)},[]),s=A(t.targetElement),r=Y({placement:t.placement,elements:{reference:s},whileElementsMounted:V,transform:!1}),i=r.refs.floating,a=Y({placement:"bottom",elements:{reference:r.refs.floating.current},whileElementsMounted:V,transform:!1,middleware:[xt({fallbackPlacements:["top","bottom","left","right"]}),Rt({crossAxis:!0,padding:Pt}),Tt(St)]}),N=a.refs.floating,[F,p]=Q(!1),u=q(()=>{p(!0),setTimeout(()=>{o(!1),p(!1)},Ft)},[]);return X(()=>{let v=x=>{let g=x.target,C=N.current,l=i.current;if(!C||!g.isConnected)return;!C.contains(g)&&!(l!=null&&l.contains(g))&&u()};return window.addEventListener("click",v),()=>{window.removeEventListener("click",v)}},[u,i,N]),X(()=>{t.targetElement||R.error("Cannot render Hint without target element")},[t.targetElement]),s?W(Ot,{children:[b("button",{ref:r.refs.setFloating,style:{left:r.x+((h=t.offsetX)!=null?h:0),top:r.y+((E=t.offsetY)!=null?E:0)},"aria-label":"Open hint",type:"button",className:"flows_hint_hotspot",onClick:e?u:n}),e?W("div",{className:"flows_tooltip_tooltip flows_hint_tooltip","data-open":F?"false":"true",ref:a.refs.setFloating,style:{left:a.x,top:a.y},children:[b(c,{className:"flows_tooltip_title",variant:"title",children:t.title}),b(c,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?b("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?b(w,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:b(y,{})}):null]}):null]}):null};export{It as a,te as b,pe as c,Ee as d};
+1
-1
"use client"
"use strict";var ct=Object.create;var B=Object.defineProperty,mt=Object.defineProperties,ut=Object.getOwnPropertyDescriptor,ft=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertyNames,k=Object.getOwnPropertySymbols,pt=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var X=(t,e,o)=>e in t?B(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,b=(t,e)=>{for(var o in e||(e={}))I.call(e,o)&&X(t,o,e[o]);if(k)for(var o of k(e))q.call(e,o)&&X(t,o,e[o]);return t},Q=(t,e)=>mt(t,ft(e));var h=(t,e)=>{var o={};for(var n in t)I.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&k)for(var n of k(t))e.indexOf(n)<0&&q.call(t,n)&&(o[n]=t[n]);return o};var yt=(t,e)=>{for(var o in e)B(t,o,{get:e[o],enumerable:!0})},V=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of dt(e))!I.call(t,l)&&l!==o&&B(t,l,{get:()=>e[l],enumerable:!(n=ut(e,l))||n.enumerable});return t};var F=(t,e,o)=>(o=t!=null?ct(pt(t)):{},V(e||!t||!t.__esModule?B(o,"default",{value:t,enumerable:!0}):o,t)),gt=t=>V(B({},"__esModule",{value:!0}),t);var Rt={};yt(Rt,{Hint:()=>Ft,Modal:()=>bt,Tooltip:()=>xt});module.exports=gt(Rt);var W=F(require("classnames"));var Z=require("react/jsx-runtime"),N=n=>{var l=n,{className:t,variant:e}=l,o=h(l,["className","variant"]);return(0,Z.jsx)("button",b({type:"button",className:(0,W.default)("flows_button",`flows_button_${e}`,t)},o))};var tt=F(require("classnames"));var $=require("react/jsx-runtime");function E(t){return(0,$.jsx)("svg",Q(b({height:16,viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"},t),{children:(0,$.jsx)("path",{d:"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"})}))}var K=F(require("classnames"));var z=require("react/jsx-runtime"),y=n=>{var l=n,{className:t,variant:e}=l,o=h(l,["className","variant"]);return(0,z.jsx)("p",b({className:(0,K.default)("flows_text",`flows_text_${e}`,t)},o))};var J=F(require("classnames"));var j=require("react/jsx-runtime"),x=o=>{var n=o,{className:t}=n,e=h(n,["className"]);return(0,j.jsx)("button",b({type:"button",className:(0,J.default)("flows_iconButton",t)},e))};var s=require("react/jsx-runtime"),et=t=>(0,s.jsxs)(s.Fragment,{children:[t.overlay?(0,s.jsx)("div",{className:(0,tt.default)("flows_modal_overlay",t.onClose&&"flows_modal_clickable"),onClick:t.onClose,"aria-hidden":"true"}):null,(0,s.jsx)("div",{className:"flows_modal_wrapper",children:(0,s.jsxs)("div",{className:"flows_modal_modal",children:[(0,s.jsx)(y,{variant:"title",children:t.title}),(0,s.jsx)(y,{variant:"body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,s.jsx)("div",{className:"flows_modal_footer",children:t.buttons}):null,t.onClose?(0,s.jsx)(x,{"aria-label":"Close",className:"flows_modal_close",onClick:t.onClose,children:(0,s.jsx)(E,{})}):null]})})]});var H=require("react/jsx-runtime"),bt=t=>{let e=[];return t.continueText&&e.push((0,H.jsx)(N,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),(0,H.jsx)(et,{title:t.title,body:t.body,buttons:e.length?e:void 0,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.close:void 0})};var f=require("react"),m=require("@floating-ui/react-dom"),U=F(require("classnames"));var vt="#22262d",Ct="#fff",ot="%cFlows%c",nt=`color:${Ct};background:${vt};padding:2px 4px;border-radius:4px`,S={error:(t,...e)=>{console.error(`${ot} ${t}`,nt,"",...e)},warn:(t,...e)=>{console.warn(`${ot} ${t}`,nt,"",...e)}};var M=require("react");function L(t){let[e,o]=(0,M.useState)(t?document.querySelector(t):null);return(0,M.useEffect)(()=>{if(!t){o(null);return}let n=()=>{let r=document.querySelector(t);o(p=>p!==r?r:p)};n();let l=new MutationObserver(r=>{r.some(a=>a.addedNodes.length>0||a.removedNodes.length>0)&&n()});return l.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{l.disconnect()}},[t]),e}var c=require("react/jsx-runtime"),wt=4,lt=6,_t=wt+lt,ht=8,Nt=8,Et=(t,e,o)=>(0,m.autoUpdate)(t,e,o,{animationFrame:!0}),it=t=>{var O,w;let e=(0,f.useRef)(null),o=(0,f.useRef)(null),n=(0,f.useRef)(null),l=L(t.targetElement),{refs:r,middlewareData:p,placement:a,x:R,y:D}=(0,m.useFloating)({placement:t.placement,elements:{reference:l},whileElementsMounted:Et,middleware:[(0,m.flip)({fallbackPlacements:["top","bottom","left","right"]}),(0,m.shift)({crossAxis:!0,padding:ht}),(0,m.arrow)({element:o,padding:Nt}),(0,m.offset)(_t)]}),[v,C]=(0,f.useState)(!1);(0,f.useEffect)(()=>{if(v)return;let i=r.floating.current;if(!i)return;let _=()=>{C(!0)};if(!(window.getComputedStyle(i).animationName!=="none")){C(!0);return}return i.addEventListener("animationend",_),()=>{i.removeEventListener("animationend",_)}},[v,r.floating]);let A=(0,f.useMemo)(()=>a.includes("top")?"bottom":a.includes("bottom")?"top":a.includes("left")?"right":"left",[a]);if((0,f.useEffect)(()=>{t.targetElement||S.error("Cannot render Tooltip without target element")},[t.targetElement]),!l)return null;r.floating.current&&(r.floating.current.style.left=`${R}px`,r.floating.current.style.top=`${D}px`);let T=(O=p.arrow)==null?void 0:O.x,P=(w=p.arrow)==null?void 0:w.y;if([o,e].forEach(i=>{i.current&&(i.current.style.left=T!=null?`${T}px`:"",i.current.style.top=P!=null?`${P}px`:"",i.current.style.right="",i.current.style.bottom="",i.current.style[A]=`${-lt}px`)}),n.current){let i=l.getBoundingClientRect();n.current.style.top=`${i.top}px`,n.current.style.left=`${i.left}px`,n.current.style.width=`${i.width}px`,n.current.style.height=`${i.height}px`}return(0,c.jsxs)("div",{className:"flows_tooltip_root",children:[t.overlay?(0,c.jsx)("div",{className:"flows_tooltip_overlay",ref:n}):null,(0,c.jsxs)("div",{className:"flows_tooltip_tooltip",ref:r.setFloating,"data-open":v?"true":"false",children:[(0,c.jsx)(y,{className:"flows_tooltip_title",variant:"title",children:t.title}),(0,c.jsx)(y,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,c.jsx)("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?(0,c.jsx)(x,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:(0,c.jsx)(E,{})}):null,(0,c.jsx)("div",{className:(0,U.default)("flows_tooltip_arrow","flows_tooltip_arrow-bottom"),ref:o}),(0,c.jsx)("div",{className:(0,U.default)("flows_tooltip_arrow","flows_tooltip_arrow-top"),ref:e})]})]})};var G=require("react/jsx-runtime"),xt=t=>{let e=[];return t.continueText&&e.push((0,G.jsx)(N,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),(0,G.jsx)(it,{title:t.title,body:t.body,targetElement:t.targetElement,placement:t.placement,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.close:void 0,buttons:e.length?e:void 0})};var d=require("@floating-ui/react-dom");var g=require("react");var u=require("react/jsx-runtime"),Tt=300,Pt=8,Bt=4,rt=(t,e,o)=>(0,d.autoUpdate)(t,e,o,{animationFrame:!0}),st=t=>{var A,T;let[e,o]=(0,g.useState)(!1),n=(0,g.useCallback)(()=>{o(!0)},[]),l=L(t.targetElement),r=(0,d.useFloating)({placement:t.placement,elements:{reference:l},whileElementsMounted:rt,transform:!1}),p=r.refs.floating,a=(0,d.useFloating)({placement:"bottom",elements:{reference:r.refs.floating.current},whileElementsMounted:rt,transform:!1,middleware:[(0,d.flip)({fallbackPlacements:["top","bottom","left","right"]}),(0,d.shift)({crossAxis:!0,padding:Pt}),(0,d.offset)(Bt)]}),R=a.refs.floating,[D,v]=(0,g.useState)(!1),C=(0,g.useCallback)(()=>{v(!0),setTimeout(()=>{o(!1),v(!1)},Tt)},[]);return(0,g.useEffect)(()=>{let P=O=>{let w=O.target,i=R.current,_=p.current;if(!i||!w.isConnected)return;!i.contains(w)&&!(_!=null&&_.contains(w))&&C()};return window.addEventListener("click",P),()=>{window.removeEventListener("click",P)}},[C,p,R]),(0,g.useEffect)(()=>{t.targetElement||S.error("Cannot render Hint without target element")},[t.targetElement]),l?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("button",{ref:r.refs.setFloating,style:{left:r.x+((A=t.offsetX)!=null?A:0),top:r.y+((T=t.offsetY)!=null?T:0)},"aria-label":"Open hint",type:"button",className:"flows_hint_hotspot",onClick:e?C:n}),e?(0,u.jsxs)("div",{className:"flows_tooltip_tooltip flows_hint_tooltip","data-open":D?"false":"true",ref:a.refs.setFloating,style:{left:a.x,top:a.y},children:[(0,u.jsx)(y,{className:"flows_tooltip_title",variant:"title",children:t.title}),(0,u.jsx)(y,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,u.jsx)("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?(0,u.jsx)(x,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:(0,u.jsx)(E,{})}):null]}):null]}):null};var Y=require("react/jsx-runtime"),Ft=t=>{let e=[];return t.continueText&&e.push((0,Y.jsx)(N,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),(0,Y.jsx)(st,{title:t.title,body:t.body,targetElement:t.targetElement,offsetX:t.offsetX,offsetY:t.offsetY,placement:t.placement,onClose:t.showCloseButton?t.close:void 0,buttons:e.length?e:void 0})};
"use strict";var ct=Object.create;var P=Object.defineProperty,mt=Object.defineProperties,ut=Object.getOwnPropertyDescriptor,ft=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertyNames,O=Object.getOwnPropertySymbols,pt=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var X=(t,e,o)=>e in t?P(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,b=(t,e)=>{for(var o in e||(e={}))L.call(e,o)&&X(t,o,e[o]);if(O)for(var o of O(e))q.call(e,o)&&X(t,o,e[o]);return t},Q=(t,e)=>mt(t,ft(e));var _=(t,e)=>{var o={};for(var n in t)L.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&O)for(var n of O(t))e.indexOf(n)<0&&q.call(t,n)&&(o[n]=t[n]);return o};var yt=(t,e)=>{for(var o in e)P(t,o,{get:e[o],enumerable:!0})},V=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of dt(e))!L.call(t,l)&&l!==o&&P(t,l,{get:()=>e[l],enumerable:!(n=ut(e,l))||n.enumerable});return t};var B=(t,e,o)=>(o=t!=null?ct(pt(t)):{},V(e||!t||!t.__esModule?P(o,"default",{value:t,enumerable:!0}):o,t)),gt=t=>V(P({},"__esModule",{value:!0}),t);var Rt={};yt(Rt,{Hint:()=>Ft,Modal:()=>bt,Tooltip:()=>xt});module.exports=gt(Rt);var W=B(require("classnames"));var Z=require("react/jsx-runtime"),h=n=>{var l=n,{className:t,variant:e}=l,o=_(l,["className","variant"]);return(0,Z.jsx)("button",b({type:"button",className:(0,W.default)("flows_button",`flows_button_${e}`,t)},o))};var tt=B(require("classnames"));var $=require("react/jsx-runtime");function N(t){return(0,$.jsx)("svg",Q(b({height:16,viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"},t),{children:(0,$.jsx)("path",{d:"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"})}))}var K=B(require("classnames"));var z=require("react/jsx-runtime"),y=n=>{var l=n,{className:t,variant:e}=l,o=_(l,["className","variant"]);return(0,z.jsx)("p",b({className:(0,K.default)("flows_text",`flows_text_${e}`,t)},o))};var J=B(require("classnames"));var j=require("react/jsx-runtime"),E=o=>{var n=o,{className:t}=n,e=_(n,["className"]);return(0,j.jsx)("button",b({type:"button",className:(0,J.default)("flows_iconButton",t)},e))};var a=require("react/jsx-runtime"),et=t=>(0,a.jsxs)(a.Fragment,{children:[t.overlay?(0,a.jsx)("div",{className:(0,tt.default)("flows_modal_overlay",t.onClose&&"flows_modal_clickable"),onClick:t.onClose,"aria-hidden":"true"}):null,(0,a.jsx)("div",{className:"flows_modal_wrapper",children:(0,a.jsxs)("div",{className:"flows_modal_modal",children:[(0,a.jsx)(y,{variant:"title",children:t.title}),(0,a.jsx)(y,{variant:"body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,a.jsx)("div",{className:"flows_modal_footer",children:t.buttons}):null,t.onClose?(0,a.jsx)(E,{"aria-label":"Close",className:"flows_modal_close",onClick:t.onClose,children:(0,a.jsx)(N,{})}):null]})})]});var H=require("react/jsx-runtime"),bt=t=>{let e=[];return t.continueText&&e.push((0,H.jsx)(h,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),(0,H.jsx)(et,{title:t.title,body:t.body,buttons:e.length?e:void 0,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.close:void 0})};var s=require("react"),u=require("@floating-ui/react-dom"),U=B(require("classnames"));var Ct="#22262d",vt="#fff",ot="%cFlows%c",nt=`color:${vt};background:${Ct};padding:2px 4px;border-radius:4px`,S={error:(t,...e)=>{console.error(`${ot} ${t}`,nt,"",...e)},warn:(t,...e)=>{console.warn(`${ot} ${t}`,nt,"",...e)}};var M=require("react");function D(t){let[e,o]=(0,M.useState)(t?document.querySelector(t):null);return(0,M.useEffect)(()=>{if(!t){o(null);return}let n=()=>{let r=document.querySelector(t);o(p=>p!==r?r:p)};n();let l=new MutationObserver(r=>{r.some(c=>c.addedNodes.length>0||c.removedNodes.length>0)&&n()});return l.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{l.disconnect()}},[t]),e}var m=require("react/jsx-runtime"),wt=4,lt=6,_t=wt+lt,ht=8,Nt=8,Et=(t,e,o)=>(0,u.autoUpdate)(t,e,o,{animationFrame:!0}),it=t=>{var w,T;let e=(0,s.useRef)(null),o=(0,s.useRef)(null),n=(0,s.useRef)(null),l=D(t.targetElement),{refs:r,middlewareData:p,placement:c,x:F,y:I}=(0,u.useFloating)({placement:t.placement,elements:{reference:l},whileElementsMounted:Et,middleware:[(0,u.flip)({fallbackPlacements:["top","bottom","left","right"]}),(0,u.shift)({crossAxis:!0,padding:ht}),(0,u.arrow)({element:o,padding:Nt}),(0,u.offset)(_t)]}),[v,C]=(0,s.useState)(!1);(0,s.useEffect)(()=>{l||C(!1)},[l]),(0,s.useEffect)(()=>{if(v)return;let i=r.floating.current;if(!i)return;window.getComputedStyle(i).animationName!=="none"||C(!0)},[v,r.floating]);let R=(0,s.useCallback)(()=>{C(!0)},[]),A=(0,s.useMemo)(()=>c.includes("top")?"bottom":c.includes("bottom")?"top":c.includes("left")?"right":"left",[c]);if((0,s.useEffect)(()=>{t.targetElement||S.error("Cannot render Tooltip without target element")},[t.targetElement]),!l)return null;r.floating.current&&(r.floating.current.style.left=`${F}px`,r.floating.current.style.top=`${I}px`);let x=(w=p.arrow)==null?void 0:w.x,k=(T=p.arrow)==null?void 0:T.y;if([o,e].forEach(i=>{i.current&&(i.current.style.left=x!=null?`${x}px`:"",i.current.style.top=k!=null?`${k}px`:"",i.current.style.right="",i.current.style.bottom="",i.current.style[A]=`${-lt}px`)}),n.current){let i=l.getBoundingClientRect();n.current.style.top=`${i.top}px`,n.current.style.left=`${i.left}px`,n.current.style.width=`${i.width}px`,n.current.style.height=`${i.height}px`}return(0,m.jsxs)("div",{className:"flows_tooltip_root",children:[t.overlay?(0,m.jsx)("div",{className:"flows_tooltip_overlay",ref:n}):null,(0,m.jsxs)("div",{className:"flows_tooltip_tooltip",ref:r.setFloating,"data-open":v?"true":"false",onAnimationEnd:R,children:[(0,m.jsx)(y,{className:"flows_tooltip_title",variant:"title",children:t.title}),(0,m.jsx)(y,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,m.jsx)("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?(0,m.jsx)(E,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:(0,m.jsx)(N,{})}):null,(0,m.jsx)("div",{className:(0,U.default)("flows_tooltip_arrow","flows_tooltip_arrow-bottom"),ref:o}),(0,m.jsx)("div",{className:(0,U.default)("flows_tooltip_arrow","flows_tooltip_arrow-top"),ref:e})]})]})};var G=require("react/jsx-runtime"),xt=t=>{let e=[];return t.continueText&&e.push((0,G.jsx)(h,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),(0,G.jsx)(it,{title:t.title,body:t.body,targetElement:t.targetElement,placement:t.placement,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.close:void 0,buttons:e.length?e:void 0})};var d=require("@floating-ui/react-dom");var g=require("react");var f=require("react/jsx-runtime"),Tt=300,Pt=8,Bt=4,rt=(t,e,o)=>(0,d.autoUpdate)(t,e,o,{animationFrame:!0}),st=t=>{var R,A;let[e,o]=(0,g.useState)(!1),n=(0,g.useCallback)(()=>{o(!0)},[]),l=D(t.targetElement),r=(0,d.useFloating)({placement:t.placement,elements:{reference:l},whileElementsMounted:rt,transform:!1}),p=r.refs.floating,c=(0,d.useFloating)({placement:"bottom",elements:{reference:r.refs.floating.current},whileElementsMounted:rt,transform:!1,middleware:[(0,d.flip)({fallbackPlacements:["top","bottom","left","right"]}),(0,d.shift)({crossAxis:!0,padding:Pt}),(0,d.offset)(Bt)]}),F=c.refs.floating,[I,v]=(0,g.useState)(!1),C=(0,g.useCallback)(()=>{v(!0),setTimeout(()=>{o(!1),v(!1)},Tt)},[]);return(0,g.useEffect)(()=>{let x=k=>{let w=k.target,T=F.current,i=p.current;if(!T||!w.isConnected)return;!T.contains(w)&&!(i!=null&&i.contains(w))&&C()};return window.addEventListener("click",x),()=>{window.removeEventListener("click",x)}},[C,p,F]),(0,g.useEffect)(()=>{t.targetElement||S.error("Cannot render Hint without target element")},[t.targetElement]),l?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{ref:r.refs.setFloating,style:{left:r.x+((R=t.offsetX)!=null?R:0),top:r.y+((A=t.offsetY)!=null?A:0)},"aria-label":"Open hint",type:"button",className:"flows_hint_hotspot",onClick:e?C:n}),e?(0,f.jsxs)("div",{className:"flows_tooltip_tooltip flows_hint_tooltip","data-open":I?"false":"true",ref:c.refs.setFloating,style:{left:c.x,top:c.y},children:[(0,f.jsx)(y,{className:"flows_tooltip_title",variant:"title",children:t.title}),(0,f.jsx)(y,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,f.jsx)("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?(0,f.jsx)(E,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:(0,f.jsx)(N,{})}):null]}):null]}):null};var Y=require("react/jsx-runtime"),Ft=t=>{let e=[];return t.continueText&&e.push((0,Y.jsx)(h,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),(0,Y.jsx)(st,{title:t.title,body:t.body,targetElement:t.targetElement,offsetX:t.offsetX,offsetY:t.offsetY,placement:t.placement,onClose:t.showCloseButton?t.close:void 0,buttons:e.length?e:void 0})};
"use client"
import{a as e,b as n,c as i,d as l}from"./chunk-QBVKPA4P.mjs";import{jsx as r}from"react/jsx-runtime";var f=t=>{let o=[];return t.continueText&&o.push(r(e,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),r(n,{title:t.title,body:t.body,buttons:o.length?o:void 0,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.close:void 0})};import{jsx as m}from"react/jsx-runtime";var g=t=>{let o=[];return t.continueText&&o.push(m(e,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),m(i,{title:t.title,body:t.body,targetElement:t.targetElement,placement:t.placement,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.close:void 0,buttons:o.length?o:void 0})};import{jsx as s}from"react/jsx-runtime";var x=t=>{let o=[];return t.continueText&&o.push(s(e,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),s(l,{title:t.title,body:t.body,targetElement:t.targetElement,offsetX:t.offsetX,offsetY:t.offsetY,placement:t.placement,onClose:t.showCloseButton?t.close:void 0,buttons:o.length?o:void 0})};export{x as Hint,f as Modal,g as Tooltip};
import{a as e,b as n,c as i,d as l}from"./chunk-NC7W7N7K.mjs";import{jsx as r}from"react/jsx-runtime";var f=t=>{let o=[];return t.continueText&&o.push(r(e,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),r(n,{title:t.title,body:t.body,buttons:o.length?o:void 0,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.close:void 0})};import{jsx as m}from"react/jsx-runtime";var g=t=>{let o=[];return t.continueText&&o.push(m(e,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),m(i,{title:t.title,body:t.body,targetElement:t.targetElement,placement:t.placement,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.close:void 0,buttons:o.length?o:void 0})};import{jsx as s}from"react/jsx-runtime";var x=t=>{let o=[];return t.continueText&&o.push(s(e,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),s(l,{title:t.title,body:t.body,targetElement:t.targetElement,offsetX:t.offsetX,offsetY:t.offsetY,placement:t.placement,onClose:t.showCloseButton?t.close:void 0,buttons:o.length?o:void 0})};export{x as Hint,f as Modal,g as Tooltip};
"use client"
"use strict";var ct=Object.create;var k=Object.defineProperty,mt=Object.defineProperties,ut=Object.getOwnPropertyDescriptor,dt=Object.getOwnPropertyDescriptors,ft=Object.getOwnPropertyNames,M=Object.getOwnPropertySymbols,yt=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var X=(t,e,o)=>e in t?k(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,w=(t,e)=>{for(var o in e||(e={}))U.call(e,o)&&X(t,o,e[o]);if(M)for(var o of M(e))q.call(e,o)&&X(t,o,e[o]);return t},Q=(t,e)=>mt(t,dt(e));var N=(t,e)=>{var o={};for(var n in t)U.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&M)for(var n of M(t))e.indexOf(n)<0&&q.call(t,n)&&(o[n]=t[n]);return o};var gt=(t,e)=>{for(var o in e)k(t,o,{get:e[o],enumerable:!0})},V=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of ft(e))!U.call(t,l)&&l!==o&&k(t,l,{get:()=>e[l],enumerable:!(n=ut(e,l))||n.enumerable});return t};var R=(t,e,o)=>(o=t!=null?ct(yt(t)):{},V(e||!t||!t.__esModule?k(o,"default",{value:t,enumerable:!0}):o,t)),pt=t=>V(k({},"__esModule",{value:!0}),t);var kt={};gt(kt,{Hint:()=>ht,Modal:()=>Tt,Tooltip:()=>Ft});module.exports=pt(kt);var d=require("@floating-ui/react-dom");var vt="#22262d",bt="#fff",W="%cFlows%c",Z=`color:${bt};background:${vt};padding:2px 4px;border-radius:4px`,L={error:(t,...e)=>{console.error(`${W} ${t}`,Z,"",...e)},warn:(t,...e)=>{console.warn(`${W} ${t}`,Z,"",...e)}};var b=require("react");var D=require("react");function I(t){let[e,o]=(0,D.useState)(t?document.querySelector(t):null);return(0,D.useEffect)(()=>{if(!t){o(null);return}let n=()=>{let r=document.querySelector(t);o(p=>p!==r?r:p)};n();let l=new MutationObserver(r=>{r.some(s=>s.addedNodes.length>0||s.removedNodes.length>0)&&n()});return l.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{l.disconnect()}},[t]),e}var G=require("react/jsx-runtime");function E(t){return(0,G.jsx)("svg",Q(w({height:16,viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"},t),{children:(0,G.jsx)("path",{d:"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"})}))}var K=R(require("classnames"));var z=require("react/jsx-runtime"),v=n=>{var l=n,{className:t,variant:e}=l,o=N(l,["className","variant"]);return(0,z.jsx)("p",w({className:(0,K.default)("flows_text",`flows_text_${e}`,t)},o))};var J=R(require("classnames"));var j=require("react/jsx-runtime"),P=o=>{var n=o,{className:t}=n,e=N(n,["className"]);return(0,j.jsx)("button",w({type:"button",className:(0,J.default)("flows_iconButton",t)},e))};var c=require("react/jsx-runtime"),Ct=300,wt=8,_t=4,tt=(t,e,o)=>(0,d.autoUpdate)(t,e,o,{animationFrame:!0}),et=t=>{var A,B;let[e,o]=(0,b.useState)(!1),n=(0,b.useCallback)(()=>{o(!0)},[]),l=I(t.targetElement),r=(0,d.useFloating)({placement:t.placement,elements:{reference:l},whileElementsMounted:tt,transform:!1}),p=r.refs.floating,s=(0,d.useFloating)({placement:"bottom",elements:{reference:r.refs.floating.current},whileElementsMounted:tt,transform:!1,middleware:[(0,d.flip)({fallbackPlacements:["top","bottom","left","right"]}),(0,d.shift)({crossAxis:!0,padding:wt}),(0,d.offset)(_t)]}),O=s.refs.floating,[H,_]=(0,b.useState)(!1),h=(0,b.useCallback)(()=>{_(!0),setTimeout(()=>{o(!1),_(!1)},Ct)},[]);return(0,b.useEffect)(()=>{let F=S=>{let T=S.target,i=O.current,x=p.current;if(!i||!T.isConnected)return;!i.contains(T)&&!(x!=null&&x.contains(T))&&h()};return window.addEventListener("click",F),()=>{window.removeEventListener("click",F)}},[h,p,O]),(0,b.useEffect)(()=>{t.targetElement||L.error("Cannot render Hint without target element")},[t.targetElement]),l?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("button",{ref:r.refs.setFloating,style:{left:r.x+((A=t.offsetX)!=null?A:0),top:r.y+((B=t.offsetY)!=null?B:0)},"aria-label":"Open hint",type:"button",className:"flows_hint_hotspot",onClick:e?h:n}),e?(0,c.jsxs)("div",{className:"flows_tooltip_tooltip flows_hint_tooltip","data-open":H?"false":"true",ref:s.refs.setFloating,style:{left:s.x,top:s.y},children:[(0,c.jsx)(v,{className:"flows_tooltip_title",variant:"title",children:t.title}),(0,c.jsx)(v,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,c.jsx)("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?(0,c.jsx)(P,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:(0,c.jsx)(E,{})}):null]}):null]}):null};var ot=R(require("classnames"));var nt=require("react/jsx-runtime"),C=n=>{var l=n,{className:t,variant:e}=l,o=N(l,["className","variant"]);return(0,nt.jsx)("button",w({type:"button",className:(0,ot.default)("flows_button",`flows_button_${e}`,t)},o))};var y=require("react/jsx-runtime"),ht=t=>{let e=t.previous&&t.previousText&&(0,y.jsx)(C,{variant:"secondary",onClick:t.previous,children:t.previousText}),o=t.continueText&&(0,y.jsx)(C,{variant:"primary",onClick:t.continue,children:t.continueText}),n=o||e?(0,y.jsxs)(y.Fragment,{children:[e!=null?e:(0,y.jsx)("div",{"aria-hidden":!0}),o!=null?o:(0,y.jsx)("div",{"aria-hidden":!0})]}):null;return(0,y.jsx)(et,{title:t.title,body:t.body,targetElement:t.targetElement,offsetX:t.offsetX,offsetY:t.offsetY,placement:t.placement,onClose:t.showCloseButton?t.cancel:void 0,buttons:n},t.__flows.id)};var lt=R(require("classnames"));var a=require("react/jsx-runtime"),it=t=>(0,a.jsxs)(a.Fragment,{children:[t.overlay?(0,a.jsx)("div",{className:(0,lt.default)("flows_modal_overlay",t.onClose&&"flows_modal_clickable"),onClick:t.onClose,"aria-hidden":"true"}):null,(0,a.jsx)("div",{className:"flows_modal_wrapper",children:(0,a.jsxs)("div",{className:"flows_modal_modal",children:[(0,a.jsx)(v,{variant:"title",children:t.title}),(0,a.jsx)(v,{variant:"body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,a.jsx)("div",{className:"flows_modal_footer",children:t.buttons}):null,t.onClose?(0,a.jsx)(P,{"aria-label":"Close",className:"flows_modal_close",onClick:t.onClose,children:(0,a.jsx)(E,{})}):null]})})]});var $=require("react/jsx-runtime"),Tt=t=>{let e=[];return t.previous&&t.previousText&&e.push((0,$.jsx)(C,{variant:"secondary",onClick:t.previous,children:t.previousText},"previous")),t.continueText&&e.push((0,$.jsx)(C,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),(0,$.jsx)(it,{title:t.title,body:t.body,overlay:!t.hideOverlay,buttons:e.length?e:void 0,onClose:t.showCloseButton?t.cancel:void 0})};var f=require("react"),u=require("@floating-ui/react-dom"),Y=R(require("classnames"));var m=require("react/jsx-runtime"),xt=4,rt=6,Nt=xt+rt,Et=8,Pt=8,Bt=(t,e,o)=>(0,u.autoUpdate)(t,e,o,{animationFrame:!0}),at=t=>{var S,T;let e=(0,f.useRef)(null),o=(0,f.useRef)(null),n=(0,f.useRef)(null),l=I(t.targetElement),{refs:r,middlewareData:p,placement:s,x:O,y:H}=(0,u.useFloating)({placement:t.placement,elements:{reference:l},whileElementsMounted:Bt,middleware:[(0,u.flip)({fallbackPlacements:["top","bottom","left","right"]}),(0,u.shift)({crossAxis:!0,padding:Et}),(0,u.arrow)({element:o,padding:Pt}),(0,u.offset)(Nt)]}),[_,h]=(0,f.useState)(!1);(0,f.useEffect)(()=>{if(_)return;let i=r.floating.current;if(!i)return;let x=()=>{h(!0)};if(!(window.getComputedStyle(i).animationName!=="none")){h(!0);return}return i.addEventListener("animationend",x),()=>{i.removeEventListener("animationend",x)}},[_,r.floating]);let A=(0,f.useMemo)(()=>s.includes("top")?"bottom":s.includes("bottom")?"top":s.includes("left")?"right":"left",[s]);if((0,f.useEffect)(()=>{t.targetElement||L.error("Cannot render Tooltip without target element")},[t.targetElement]),!l)return null;r.floating.current&&(r.floating.current.style.left=`${O}px`,r.floating.current.style.top=`${H}px`);let B=(S=p.arrow)==null?void 0:S.x,F=(T=p.arrow)==null?void 0:T.y;if([o,e].forEach(i=>{i.current&&(i.current.style.left=B!=null?`${B}px`:"",i.current.style.top=F!=null?`${F}px`:"",i.current.style.right="",i.current.style.bottom="",i.current.style[A]=`${-rt}px`)}),n.current){let i=l.getBoundingClientRect();n.current.style.top=`${i.top}px`,n.current.style.left=`${i.left}px`,n.current.style.width=`${i.width}px`,n.current.style.height=`${i.height}px`}return(0,m.jsxs)("div",{className:"flows_tooltip_root",children:[t.overlay?(0,m.jsx)("div",{className:"flows_tooltip_overlay",ref:n}):null,(0,m.jsxs)("div",{className:"flows_tooltip_tooltip",ref:r.setFloating,"data-open":_?"true":"false",children:[(0,m.jsx)(v,{className:"flows_tooltip_title",variant:"title",children:t.title}),(0,m.jsx)(v,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,m.jsx)("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?(0,m.jsx)(P,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:(0,m.jsx)(E,{})}):null,(0,m.jsx)("div",{className:(0,Y.default)("flows_tooltip_arrow","flows_tooltip_arrow-bottom"),ref:o}),(0,m.jsx)("div",{className:(0,Y.default)("flows_tooltip_arrow","flows_tooltip_arrow-top"),ref:e})]})]})};var g=require("react/jsx-runtime"),Ft=t=>{let e=t.previous&&t.previousText&&(0,g.jsx)(C,{variant:"secondary",onClick:t.previous,children:t.previousText}),o=t.continueText&&(0,g.jsx)(C,{variant:"primary",onClick:t.continue,children:t.continueText}),n=o||e?(0,g.jsxs)(g.Fragment,{children:[e!=null?e:(0,g.jsx)("div",{"aria-hidden":!0}),o!=null?o:(0,g.jsx)("div",{"aria-hidden":!0})]}):null;return(0,g.jsx)(at,{title:t.title,body:t.body,targetElement:t.targetElement,placement:t.placement,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.cancel:void 0,buttons:n})};
"use strict";var ct=Object.create;var F=Object.defineProperty,mt=Object.defineProperties,ut=Object.getOwnPropertyDescriptor,ft=Object.getOwnPropertyDescriptors,dt=Object.getOwnPropertyNames,M=Object.getOwnPropertySymbols,yt=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var X=(t,e,o)=>e in t?F(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,w=(t,e)=>{for(var o in e||(e={}))U.call(e,o)&&X(t,o,e[o]);if(M)for(var o of M(e))q.call(e,o)&&X(t,o,e[o]);return t},Q=(t,e)=>mt(t,ft(e));var x=(t,e)=>{var o={};for(var n in t)U.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&M)for(var n of M(t))e.indexOf(n)<0&&q.call(t,n)&&(o[n]=t[n]);return o};var gt=(t,e)=>{for(var o in e)F(t,o,{get:e[o],enumerable:!0})},V=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of dt(e))!U.call(t,l)&&l!==o&&F(t,l,{get:()=>e[l],enumerable:!(n=ut(e,l))||n.enumerable});return t};var k=(t,e,o)=>(o=t!=null?ct(yt(t)):{},V(e||!t||!t.__esModule?F(o,"default",{value:t,enumerable:!0}):o,t)),pt=t=>V(F({},"__esModule",{value:!0}),t);var kt={};gt(kt,{Hint:()=>ht,Modal:()=>Tt,Tooltip:()=>Ft});module.exports=pt(kt);var d=require("@floating-ui/react-dom");var vt="#22262d",bt="#fff",W="%cFlows%c",Z=`color:${bt};background:${vt};padding:2px 4px;border-radius:4px`,D={error:(t,...e)=>{console.error(`${W} ${t}`,Z,"",...e)},warn:(t,...e)=>{console.warn(`${W} ${t}`,Z,"",...e)}};var b=require("react");var I=require("react");function L(t){let[e,o]=(0,I.useState)(t?document.querySelector(t):null);return(0,I.useEffect)(()=>{if(!t){o(null);return}let n=()=>{let r=document.querySelector(t);o(p=>p!==r?r:p)};n();let l=new MutationObserver(r=>{r.some(c=>c.addedNodes.length>0||c.removedNodes.length>0)&&n()});return l.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{l.disconnect()}},[t]),e}var G=require("react/jsx-runtime");function N(t){return(0,G.jsx)("svg",Q(w({height:16,viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"},t),{children:(0,G.jsx)("path",{d:"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"})}))}var K=k(require("classnames"));var z=require("react/jsx-runtime"),v=n=>{var l=n,{className:t,variant:e}=l,o=x(l,["className","variant"]);return(0,z.jsx)("p",w({className:(0,K.default)("flows_text",`flows_text_${e}`,t)},o))};var J=k(require("classnames"));var j=require("react/jsx-runtime"),E=o=>{var n=o,{className:t}=n,e=x(n,["className"]);return(0,j.jsx)("button",w({type:"button",className:(0,J.default)("flows_iconButton",t)},e))};var m=require("react/jsx-runtime"),Ct=300,wt=8,_t=4,tt=(t,e,o)=>(0,d.autoUpdate)(t,e,o,{animationFrame:!0}),et=t=>{var A,O;let[e,o]=(0,b.useState)(!1),n=(0,b.useCallback)(()=>{o(!0)},[]),l=L(t.targetElement),r=(0,d.useFloating)({placement:t.placement,elements:{reference:l},whileElementsMounted:tt,transform:!1}),p=r.refs.floating,c=(0,d.useFloating)({placement:"bottom",elements:{reference:r.refs.floating.current},whileElementsMounted:tt,transform:!1,middleware:[(0,d.flip)({fallbackPlacements:["top","bottom","left","right"]}),(0,d.shift)({crossAxis:!0,padding:wt}),(0,d.offset)(_t)]}),R=c.refs.floating,[H,h]=(0,b.useState)(!1),_=(0,b.useCallback)(()=>{h(!0),setTimeout(()=>{o(!1),h(!1)},Ct)},[]);return(0,b.useEffect)(()=>{let P=S=>{let T=S.target,B=R.current,i=p.current;if(!B||!T.isConnected)return;!B.contains(T)&&!(i!=null&&i.contains(T))&&_()};return window.addEventListener("click",P),()=>{window.removeEventListener("click",P)}},[_,p,R]),(0,b.useEffect)(()=>{t.targetElement||D.error("Cannot render Hint without target element")},[t.targetElement]),l?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("button",{ref:r.refs.setFloating,style:{left:r.x+((A=t.offsetX)!=null?A:0),top:r.y+((O=t.offsetY)!=null?O:0)},"aria-label":"Open hint",type:"button",className:"flows_hint_hotspot",onClick:e?_:n}),e?(0,m.jsxs)("div",{className:"flows_tooltip_tooltip flows_hint_tooltip","data-open":H?"false":"true",ref:c.refs.setFloating,style:{left:c.x,top:c.y},children:[(0,m.jsx)(v,{className:"flows_tooltip_title",variant:"title",children:t.title}),(0,m.jsx)(v,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,m.jsx)("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?(0,m.jsx)(E,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:(0,m.jsx)(N,{})}):null]}):null]}):null};var ot=k(require("classnames"));var nt=require("react/jsx-runtime"),C=n=>{var l=n,{className:t,variant:e}=l,o=x(l,["className","variant"]);return(0,nt.jsx)("button",w({type:"button",className:(0,ot.default)("flows_button",`flows_button_${e}`,t)},o))};var y=require("react/jsx-runtime"),ht=t=>{let e=t.previous&&t.previousText&&(0,y.jsx)(C,{variant:"secondary",onClick:t.previous,children:t.previousText}),o=t.continueText&&(0,y.jsx)(C,{variant:"primary",onClick:t.continue,children:t.continueText}),n=o||e?(0,y.jsxs)(y.Fragment,{children:[e!=null?e:(0,y.jsx)("div",{"aria-hidden":!0}),o!=null?o:(0,y.jsx)("div",{"aria-hidden":!0})]}):null;return(0,y.jsx)(et,{title:t.title,body:t.body,targetElement:t.targetElement,offsetX:t.offsetX,offsetY:t.offsetY,placement:t.placement,onClose:t.showCloseButton?t.cancel:void 0,buttons:n},t.__flows.id)};var lt=k(require("classnames"));var s=require("react/jsx-runtime"),it=t=>(0,s.jsxs)(s.Fragment,{children:[t.overlay?(0,s.jsx)("div",{className:(0,lt.default)("flows_modal_overlay",t.onClose&&"flows_modal_clickable"),onClick:t.onClose,"aria-hidden":"true"}):null,(0,s.jsx)("div",{className:"flows_modal_wrapper",children:(0,s.jsxs)("div",{className:"flows_modal_modal",children:[(0,s.jsx)(v,{variant:"title",children:t.title}),(0,s.jsx)(v,{variant:"body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,s.jsx)("div",{className:"flows_modal_footer",children:t.buttons}):null,t.onClose?(0,s.jsx)(E,{"aria-label":"Close",className:"flows_modal_close",onClick:t.onClose,children:(0,s.jsx)(N,{})}):null]})})]});var $=require("react/jsx-runtime"),Tt=t=>{let e=[];return t.previous&&t.previousText&&e.push((0,$.jsx)(C,{variant:"secondary",onClick:t.previous,children:t.previousText},"previous")),t.continueText&&e.push((0,$.jsx)(C,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),(0,$.jsx)(it,{title:t.title,body:t.body,overlay:!t.hideOverlay,buttons:e.length?e:void 0,onClose:t.showCloseButton?t.cancel:void 0})};var a=require("react"),f=require("@floating-ui/react-dom"),Y=k(require("classnames"));var u=require("react/jsx-runtime"),xt=4,rt=6,Nt=xt+rt,Et=8,Pt=8,Bt=(t,e,o)=>(0,f.autoUpdate)(t,e,o,{animationFrame:!0}),at=t=>{var T,B;let e=(0,a.useRef)(null),o=(0,a.useRef)(null),n=(0,a.useRef)(null),l=L(t.targetElement),{refs:r,middlewareData:p,placement:c,x:R,y:H}=(0,f.useFloating)({placement:t.placement,elements:{reference:l},whileElementsMounted:Bt,middleware:[(0,f.flip)({fallbackPlacements:["top","bottom","left","right"]}),(0,f.shift)({crossAxis:!0,padding:Et}),(0,f.arrow)({element:o,padding:Pt}),(0,f.offset)(Nt)]}),[h,_]=(0,a.useState)(!1);(0,a.useEffect)(()=>{l||_(!1)},[l]),(0,a.useEffect)(()=>{if(h)return;let i=r.floating.current;if(!i)return;window.getComputedStyle(i).animationName!=="none"||_(!0)},[h,r.floating]);let A=(0,a.useCallback)(()=>{_(!0)},[]),O=(0,a.useMemo)(()=>c.includes("top")?"bottom":c.includes("bottom")?"top":c.includes("left")?"right":"left",[c]);if((0,a.useEffect)(()=>{t.targetElement||D.error("Cannot render Tooltip without target element")},[t.targetElement]),!l)return null;r.floating.current&&(r.floating.current.style.left=`${R}px`,r.floating.current.style.top=`${H}px`);let P=(T=p.arrow)==null?void 0:T.x,S=(B=p.arrow)==null?void 0:B.y;if([o,e].forEach(i=>{i.current&&(i.current.style.left=P!=null?`${P}px`:"",i.current.style.top=S!=null?`${S}px`:"",i.current.style.right="",i.current.style.bottom="",i.current.style[O]=`${-rt}px`)}),n.current){let i=l.getBoundingClientRect();n.current.style.top=`${i.top}px`,n.current.style.left=`${i.left}px`,n.current.style.width=`${i.width}px`,n.current.style.height=`${i.height}px`}return(0,u.jsxs)("div",{className:"flows_tooltip_root",children:[t.overlay?(0,u.jsx)("div",{className:"flows_tooltip_overlay",ref:n}):null,(0,u.jsxs)("div",{className:"flows_tooltip_tooltip",ref:r.setFloating,"data-open":h?"true":"false",onAnimationEnd:A,children:[(0,u.jsx)(v,{className:"flows_tooltip_title",variant:"title",children:t.title}),(0,u.jsx)(v,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?(0,u.jsx)("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?(0,u.jsx)(E,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:(0,u.jsx)(N,{})}):null,(0,u.jsx)("div",{className:(0,Y.default)("flows_tooltip_arrow","flows_tooltip_arrow-bottom"),ref:o}),(0,u.jsx)("div",{className:(0,Y.default)("flows_tooltip_arrow","flows_tooltip_arrow-top"),ref:e})]})]})};var g=require("react/jsx-runtime"),Ft=t=>{let e=t.previous&&t.previousText&&(0,g.jsx)(C,{variant:"secondary",onClick:t.previous,children:t.previousText}),o=t.continueText&&(0,g.jsx)(C,{variant:"primary",onClick:t.continue,children:t.continueText}),n=o||e?(0,g.jsxs)(g.Fragment,{children:[e!=null?e:(0,g.jsx)("div",{"aria-hidden":!0}),o!=null?o:(0,g.jsx)("div",{"aria-hidden":!0})]}):null;return(0,g.jsx)(at,{title:t.title,body:t.body,targetElement:t.targetElement,placement:t.placement,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.cancel:void 0,buttons:n})};
"use client"
import{a as n,b as u,c as m,d as s}from"./chunk-QBVKPA4P.mjs";import{Fragment as d,jsx as i,jsxs as c}from"react/jsx-runtime";var C=t=>{let e=t.previous&&t.previousText&&i(n,{variant:"secondary",onClick:t.previous,children:t.previousText}),o=t.continueText&&i(n,{variant:"primary",onClick:t.continue,children:t.continueText}),l=o||e?c(d,{children:[e!=null?e:i("div",{"aria-hidden":!0}),o!=null?o:i("div",{"aria-hidden":!0})]}):null;return i(s,{title:t.title,body:t.body,targetElement:t.targetElement,offsetX:t.offsetX,offsetY:t.offsetY,placement:t.placement,onClose:t.showCloseButton?t.cancel:void 0,buttons:l},t.__flows.id)};import{jsx as a}from"react/jsx-runtime";var B=t=>{let e=[];return t.previous&&t.previousText&&e.push(a(n,{variant:"secondary",onClick:t.previous,children:t.previousText},"previous")),t.continueText&&e.push(a(n,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),a(u,{title:t.title,body:t.body,overlay:!t.hideOverlay,buttons:e.length?e:void 0,onClose:t.showCloseButton?t.cancel:void 0})};import{Fragment as y,jsx as r,jsxs as f}from"react/jsx-runtime";var F=t=>{let e=t.previous&&t.previousText&&r(n,{variant:"secondary",onClick:t.previous,children:t.previousText}),o=t.continueText&&r(n,{variant:"primary",onClick:t.continue,children:t.continueText}),l=o||e?f(y,{children:[e!=null?e:r("div",{"aria-hidden":!0}),o!=null?o:r("div",{"aria-hidden":!0})]}):null;return r(m,{title:t.title,body:t.body,targetElement:t.targetElement,placement:t.placement,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.cancel:void 0,buttons:l})};export{C as Hint,B as Modal,F as Tooltip};
import{a as n,b as u,c as m,d as s}from"./chunk-NC7W7N7K.mjs";import{Fragment as d,jsx as i,jsxs as c}from"react/jsx-runtime";var C=t=>{let e=t.previous&&t.previousText&&i(n,{variant:"secondary",onClick:t.previous,children:t.previousText}),o=t.continueText&&i(n,{variant:"primary",onClick:t.continue,children:t.continueText}),l=o||e?c(d,{children:[e!=null?e:i("div",{"aria-hidden":!0}),o!=null?o:i("div",{"aria-hidden":!0})]}):null;return i(s,{title:t.title,body:t.body,targetElement:t.targetElement,offsetX:t.offsetX,offsetY:t.offsetY,placement:t.placement,onClose:t.showCloseButton?t.cancel:void 0,buttons:l},t.__flows.id)};import{jsx as a}from"react/jsx-runtime";var B=t=>{let e=[];return t.previous&&t.previousText&&e.push(a(n,{variant:"secondary",onClick:t.previous,children:t.previousText},"previous")),t.continueText&&e.push(a(n,{variant:"primary",onClick:t.continue,children:t.continueText},"continue")),a(u,{title:t.title,body:t.body,overlay:!t.hideOverlay,buttons:e.length?e:void 0,onClose:t.showCloseButton?t.cancel:void 0})};import{Fragment as y,jsx as r,jsxs as f}from"react/jsx-runtime";var F=t=>{let e=t.previous&&t.previousText&&r(n,{variant:"secondary",onClick:t.previous,children:t.previousText}),o=t.continueText&&r(n,{variant:"primary",onClick:t.continue,children:t.continueText}),l=o||e?f(y,{children:[e!=null?e:r("div",{"aria-hidden":!0}),o!=null?o:r("div",{"aria-hidden":!0})]}):null;return r(m,{title:t.title,body:t.body,targetElement:t.targetElement,placement:t.placement,overlay:!t.hideOverlay,onClose:t.showCloseButton?t.cancel:void 0,buttons:l})};export{C as Hint,B as Modal,F as Tooltip};
{
"name": "@flows/react-components",
"version": "1.2.1",
"version": "1.2.2",
"description": "Built-in components for Flows React SDK",

@@ -30,10 +30,10 @@ "keywords": [

"devDependencies": {
"@types/jest": "^29.5.14",
"@types/node": "^20",
"@types/react": "^19",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"ts-jest": "^29.3.0",
"tsup": "^8.4.0",
"typescript": "^5.8.3",
"@types/jest": "^30.0.0",
"@types/node": "^22.17.2",
"@types/react": "^19.1.10",
"jest": "^30.0.5",
"jest-environment-jsdom": "^30.0.5",
"ts-jest": "^29.4.1",
"tsup": "^8.5.0",
"typescript": "^5.9.2",
"@flows/shared": "1.0.0",

@@ -46,3 +46,3 @@ "@flows/styles": "1.0.0"

"dependencies": {
"@floating-ui/react-dom": "^2.1.2",
"@floating-ui/react-dom": "^2.1.5",
"classnames": "^2.5.1"

@@ -49,0 +49,0 @@ },

"use client"
var K=Object.defineProperty,z=Object.defineProperties;var J=Object.getOwnPropertyDescriptors;var T=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable;var S=(t,e,o)=>e in t?K(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,m=(t,e)=>{for(var o in e||(e={}))O.call(e,o)&&S(t,o,e[o]);if(T)for(var o of T(e))L.call(e,o)&&S(t,o,e[o]);return t},k=(t,e)=>z(t,J(e));var y=(t,e)=>{var o={};for(var n in t)O.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&T)for(var n of T(t))e.indexOf(n)<0&&L.call(t,n)&&(o[n]=t[n]);return o};import j from"classnames";import{jsx as tt}from"react/jsx-runtime";var kt=n=>{var s=n,{className:t,variant:e}=s,o=y(s,["className","variant"]);return tt("button",m({type:"button",className:j("flows_button",`flows_button_${e}`,t)},o))};import rt from"classnames";import{jsx as D}from"react/jsx-runtime";function w(t){return D("svg",k(m({height:16,viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",fill:"currentColor"},t),{children:D("path",{d:"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"})}))}import et from"classnames";import{jsx as ot}from"react/jsx-runtime";var c=n=>{var s=n,{className:t,variant:e}=s,o=y(s,["className","variant"]);return ot("p",m({className:et("flows_text",`flows_text_${e}`,t)},o))};import nt from"classnames";import{jsx as lt}from"react/jsx-runtime";var v=o=>{var n=o,{className:t}=n,e=y(n,["className"]);return lt("button",m({type:"button",className:nt("flows_iconButton",t)},e))};import{Fragment as st,jsx as u,jsxs as I}from"react/jsx-runtime";var jt=t=>I(st,{children:[t.overlay?u("div",{className:rt("flows_modal_overlay",t.onClose&&"flows_modal_clickable"),onClick:t.onClose,"aria-hidden":"true"}):null,u("div",{className:"flows_modal_wrapper",children:I("div",{className:"flows_modal_modal",children:[u(c,{variant:"title",children:t.title}),u(c,{variant:"body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?u("div",{className:"flows_modal_footer",children:t.buttons}):null,t.onClose?u(v,{"aria-label":"Close",className:"flows_modal_close",onClick:t.onClose,children:u(w,{})}):null]})})]});import{useEffect as $,useMemo as ft,useRef as P,useState as ut}from"react";import{useFloating as dt,shift as pt,offset as gt,arrow as _t,flip as yt,autoUpdate as wt}from"@floating-ui/react-dom";import U from"classnames";var at="#22262d",it="#fff",B="%cFlows%c",M=`color:${it};background:${at};padding:2px 4px;border-radius:4px`,R={error:(t,...e)=>{console.error(`${B} ${t}`,M,"",...e)},warn:(t,...e)=>{console.warn(`${B} ${t}`,M,"",...e)}};import{useState as ct,useEffect as mt}from"react";function A(t){let[e,o]=ct(t?document.querySelector(t):null);return mt(()=>{if(!t){o(null);return}let n=()=>{let r=document.querySelector(t);o(i=>i!==r?r:i)};n();let s=new MutationObserver(r=>{r.some(a=>a.addedNodes.length>0||a.removedNodes.length>0)&&n()});return s.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{s.disconnect()}},[t]),e}import{jsx as f,jsxs as H}from"react/jsx-runtime";var vt=4,G=6,bt=vt+G,Ct=8,Nt=8,ht=(t,e,o)=>wt(t,e,o,{animationFrame:!0}),de=t=>{var x,g;let e=P(null),o=P(null),n=P(null),s=A(t.targetElement),{refs:r,middlewareData:i,placement:a,x:h,y:F}=dt({placement:t.placement,elements:{reference:s},whileElementsMounted:ht,middleware:[yt({fallbackPlacements:["top","bottom","left","right"]}),pt({crossAxis:!0,padding:Ct}),_t({element:o,padding:Nt}),gt(bt)]}),[d,p]=ut(!1);$(()=>{if(d)return;let l=r.floating.current;if(!l)return;let _=()=>{p(!0)};if(!(window.getComputedStyle(l).animationName!=="none")){p(!0);return}return l.addEventListener("animationend",_),()=>{l.removeEventListener("animationend",_)}},[d,r.floating]);let E=ft(()=>a.includes("top")?"bottom":a.includes("bottom")?"top":a.includes("left")?"right":"left",[a]);if($(()=>{t.targetElement||R.error("Cannot render Tooltip without target element")},[t.targetElement]),!s)return null;r.floating.current&&(r.floating.current.style.left=`${h}px`,r.floating.current.style.top=`${F}px`);let C=(x=i.arrow)==null?void 0:x.x,N=(g=i.arrow)==null?void 0:g.y;if([o,e].forEach(l=>{l.current&&(l.current.style.left=C!=null?`${C}px`:"",l.current.style.top=N!=null?`${N}px`:"",l.current.style.right="",l.current.style.bottom="",l.current.style[E]=`${-G}px`)}),n.current){let l=s.getBoundingClientRect();n.current.style.top=`${l.top}px`,n.current.style.left=`${l.left}px`,n.current.style.width=`${l.width}px`,n.current.style.height=`${l.height}px`}return H("div",{className:"flows_tooltip_root",children:[t.overlay?f("div",{className:"flows_tooltip_overlay",ref:n}):null,H("div",{className:"flows_tooltip_tooltip",ref:r.setFloating,"data-open":d?"true":"false",children:[f(c,{className:"flows_tooltip_title",variant:"title",children:t.title}),f(c,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?f("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?f(v,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:f(w,{})}):null,f("div",{className:U("flows_tooltip_arrow","flows_tooltip_arrow-bottom"),ref:o}),f("div",{className:U("flows_tooltip_arrow","flows_tooltip_arrow-top"),ref:e})]})]})};import{flip as Et,offset as xt,shift as Tt,useFloating as Y,autoUpdate as Rt}from"@floating-ui/react-dom";import{useCallback as q,useEffect as X,useState as Q}from"react";import{Fragment as St,jsx as b,jsxs as W}from"react/jsx-runtime";var At=300,Ft=8,Pt=4,V=(t,e,o)=>Rt(t,e,o,{animationFrame:!0}),he=t=>{var E,C;let[e,o]=Q(!1),n=q(()=>{o(!0)},[]),s=A(t.targetElement),r=Y({placement:t.placement,elements:{reference:s},whileElementsMounted:V,transform:!1}),i=r.refs.floating,a=Y({placement:"bottom",elements:{reference:r.refs.floating.current},whileElementsMounted:V,transform:!1,middleware:[Et({fallbackPlacements:["top","bottom","left","right"]}),Tt({crossAxis:!0,padding:Ft}),xt(Pt)]}),h=a.refs.floating,[F,d]=Q(!1),p=q(()=>{d(!0),setTimeout(()=>{o(!1),d(!1)},At)},[]);return X(()=>{let N=x=>{let g=x.target,l=h.current,_=i.current;if(!l||!g.isConnected)return;!l.contains(g)&&!(_!=null&&_.contains(g))&&p()};return window.addEventListener("click",N),()=>{window.removeEventListener("click",N)}},[p,i,h]),X(()=>{t.targetElement||R.error("Cannot render Hint without target element")},[t.targetElement]),s?W(St,{children:[b("button",{ref:r.refs.setFloating,style:{left:r.x+((E=t.offsetX)!=null?E:0),top:r.y+((C=t.offsetY)!=null?C:0)},"aria-label":"Open hint",type:"button",className:"flows_hint_hotspot",onClick:e?p:n}),e?W("div",{className:"flows_tooltip_tooltip flows_hint_tooltip","data-open":F?"false":"true",ref:a.refs.setFloating,style:{left:a.x,top:a.y},children:[b(c,{className:"flows_tooltip_title",variant:"title",children:t.title}),b(c,{variant:"body",className:"flows_tooltip_body",dangerouslySetInnerHTML:{__html:t.body}}),t.buttons?b("div",{className:"flows_tooltip_footer",children:t.buttons}):null,t.onClose?b(v,{"aria-label":"Close",className:"flows_tooltip_close",onClick:t.onClose,children:b(w,{})}):null]}):null]}):null};export{kt as a,jt as b,de as c,he as d};