userflow.js-self-hosted 0.1.1011632 → 0.1.1011696
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/DebuggerUI.js +1 -1
- package/debugger.css +4 -0
- package/hash.txt +1 -1
- package/package.json +1 -1
- package/userflow.js +1 -1
- package/vendor.absinthe.socket.js +1 -1
package/DebuggerUI.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["flow-condition-types.js","userflow.js","vendor.core-js.js","vendor.absinthe.socket.js","vendor.jumpn.utils-composite.js","vendor.babel-runtime.js","vendor.jumpn.utils-array.js","vendor.flow-static-land.js","vendor.jumpn.utils-graphql.js","vendor.zen-observable.js","vendor.phoenix.js","vendor.uuid.js","vendor.date-fns.js","roots.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{R as e,r as i}from"./vendor.react.js";import{r as je}from"./vendor.react-dom.js";import{u as te,U as Kt}from"./client-context.js";import{d as tt,W as q,a as oe,b as M,S as jt,c as Ee,e as Xt,f as ut,g as Zt,_ as Qt,h as Jt}from"./userflow.js";import{F as en}from"./Frame.js";import{S as tn}from"./logomark.js";import{f as nn,a as nt,b as rn,c as yt,d as an,e as sn,g as rt,h as on,i as ln,j as cn,k as un,l as Q,m as fe,n as dn,o as mn,p as Ct,q as K,r as pn,s as Nt,t as at,u as fn,v as gn,w as J,x as Y,y as hn,z as En,A as vn,B as bn,C as wn,D as _n,E as yn,F as Cn,G as xt,H as Nn,I as xn,J as Sn,K as Tn,L as Be,M as Dn}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{f as Fn,a as In}from"./vendor.fortawesome.pro-solid-svg-icons.js";import{D as v}from"./stylesheets.js";import{o as b}from"./vendor.obj-str.js";import{F as L,a as z,B as le,E as ie,b as We,A as he,c as qe,d as dt,e as $e,f as B,g as _,h as we,i as de,j as ve}from"./index.js";import{F as ee}from"./vendor.fortawesome.react-fontawesome.js";import"./vendor.absinthe.socket.js";import{m as St}from"./vendor.memoize-one.js";import{n as mt}from"./vendor.numeral.js";import{B as kn}from"./vendor.bignumber.js.js";import{D as On}from"./vendor.react-day-picker.js";import{f as Ce,p as Tt,a as Ln,i as Mn}from"./vendor.date-fns.js";import{_ as Ae,l as Dt}from"./vendor.lodash.js";import{c as An}from"./roots.js";import"./vendor.isomorphic-fetch.js";import{u as Ft}from"./vendor.apollo.client.js";import"./vendor.object-assign.js";import"./vendor.scheduler.js";import"./vendor.i18next.js";import"./vendor.react-i18next.js";import"./vendor.babel.runtime.js";import"./vendor.core-js.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";import"./vendor.jumpn.utils-composite.js";import"./vendor.babel-runtime.js";import"./vendor.jumpn.utils-array.js";import"./vendor.flow-static-land.js";import"./vendor.jumpn.utils-graphql.js";import"./vendor.zen-observable.js";import"./flow-condition-types.js";import"./vendor.fortawesome.fontawesome-svg-core.js";import"./vendor.whatwg-fetch.js";import"./vendor.ts-invariant.js";import"./vendor.wry.equality.js";import"./vendor.graphql.js";import"./vendor.optimism.js";import"./vendor.wry.trie.js";import"./vendor.wry.context.js";import"./vendor.fast-json-stable-stringify.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="2814d8d1-a0d1-4059-bd85-513168e0c4cc",t._sentryDebugIdIdentifier="sentry-dbid-2814d8d1-a0d1-4059-bd85-513168e0c4cc")}catch{}})();const Rn=new URL("debugger.css",import.meta.url).href;let pt=!1;const _e=[];function ft(t){_e.push(t),pt||(pt=!0,window.addEventListener("keydown",n=>{if(n.key==="Escape"){const r=_e[_e.length-1];r&&(r(),n.stopImmediatePropagation())}}))}function gt(t){const n=_e.indexOf(t);n>=0&&_e.splice(n,1)}const V=[];let st=0;typeof window<"u"&&window.document.documentElement.addEventListener("mousedown",()=>st++,{capture:!0});function Pn(t){const n={cmp:t,zIndex:It(),mountMouseDownCounter:st};V.push(n),V.length===1&&document.documentElement.addEventListener("click",kt,{capture:!0})}function Un(t){const n=V.findIndex(r=>r.cmp===t);V.splice(n,1),V.length===0&&document.documentElement.removeEventListener("click",kt,{capture:!0})}function Vn(t){const n=V.find(r=>r.cmp===t);return n?n.zIndex:It()}function It(){const t=V[V.length-1];return t?t.zIndex+100:1e3}function Hn(t,n){const r=t.rootRef.current;return!!r&&r.contains(n)}function kt(t){const n=t.target;if(n.closest("#userflow-ui, #notifications"))return;const r=V.findIndex(a=>Hn(a.cmp,n));for(let a=V.length-1;a>r;a--){const s=V[a];s&&s.mountMouseDownCounter<st&&s.cmp.closeLayer(t)}}const Xe=8,Bn=Xe*2,Wn=8,ht=50,me=8,Et=24,qn=8;class Pe extends e.PureComponent{constructor(){super(...arguments),this.rootRef=e.createRef(),this.notchRef=e.createRef(),this.bodyRef=e.createRef(),this.state={},this.onAnimationFrame=()=>{this.reposition(),this.requestAnimationFrame()},this.onClick=n=>{n.stopPropagation(),this.props.onClick&&this.props.onClick(n)},this.closeLayer=n=>{if(this.props.ignoreTargetClick){const r=this.props.target,a=n.target;if(r&&a&&r.contains(a))return}this.fireOnDismiss({reason:"outside-click",event:n})},this.onEscape=()=>this.fireOnDismiss({reason:"escape"})}get el(){return this.rootRef.current}componentDidMount(){Pn(this),this.props.onDismiss&&ft(this.onEscape),window.addEventListener("userflow:hideAllPopovers",this.closeLayer),this.requestAnimationFrame(),this.reposition()}componentWillUnmount(){Un(this),gt(this.onEscape),window.removeEventListener("userflow:hideAllPopovers",this.closeLayer),window.cancelAnimationFrame(this.raf)}componentDidUpdate(n){const{props:r}=this;this.reposition(),!n.onDismiss&&r.onDismiss?ft(this.onEscape):n.onDismiss&&!r.onDismiss&>(this.onEscape)}render(){const{props:n}=this,r=this.state,a=["popover"];n.className&&a.push(n.className),a.push(`popover--placement-${r.actualPlacement}`);const s=e.createElement("div",{className:a.join(" "),ref:this.rootRef,onMouseDown:n.onMouseDown,onMouseEnter:n.onMouseEnter,onClick:this.onClick,style:{zIndex:Vn(this)}},e.createElement("div",{className:"popover__body",ref:this.bodyRef},n.children),!n.noNotch&&this.renderNotch());return je.createPortal(s,(n.document||document).body)}renderNotch(){const n=Xe,r=n*2;return e.createElement("div",{ref:this.notchRef,className:"popover__notch"},e.createElement("svg",{viewBox:`0 0 ${r} ${n}`},e.createElement("polygon",{className:"popover__notch-border",points:`${r/2},0 ${r},${n} 0,${n}`}),e.createElement("polygon",{className:"popover__notch-fill",points:`${r/2},1 ${r},${n+1} 0,${n+1}`})))}requestAnimationFrame(){this.raf=window.requestAnimationFrame(this.onAnimationFrame)}reposition(){const{props:n}=this,r=n.target,a=this.rootRef.current,s=this.notchRef.current,o=n.placement||"bottom",l=Te(o),c=!!n.forceDimension,m=n.horizontalAlign,E=n.verticalAlign,h=!!n.noNotch,p=document.documentElement.clientWidth,u=document.documentElement.clientHeight,g=r?.getBoundingClientRect(),C=g?.left,d=g?.top,w=g?.width,y=g?.height;let x=n.width;n.matchWidth&&(x=w);let T=n.minWidth;n.matchMinWidth&&w!=null&&(T=Math.max(w,T||0)),(this.lastPopoverCssWidth!==x||this.lastPopoverMinWidth!==T)&&(a.style.width=x==null?"":Math.round(x)+"px",a.style.minWidth=T==null?"":Math.round(T)+"px");const A=a.getBoundingClientRect(),D=A?.width,I=A?.height,ge=parseInt((window.getComputedStyle(a).borderTopLeftRadius||"").replace(/px/,""),10),j=window.scrollX,ne=window.scrollY;if(this.lastPlacement===o&&this.lastForceDimension===c&&this.lastHorizontalAlign===m&&this.lastVerticalAlign===E&&this.lastNoNotch===h&&this.lastViewportWidth===p&&this.lastViewportHeight===u&&this.lastTargetX===C&&this.lastTargetY===d&&this.lastTargetWidth===w&&this.lastTargetHeight===y&&this.lastPopoverCssWidth===x&&this.lastPopoverMinWidth===T&&this.lastPopoverWidth===D&&this.lastPopoverHeight===I&&this.lastPopoverBorderRadius===ge&&this.lastScrollX===j&&this.lastScrollY===ne)return;let $,R=null;if(C!=null&&d!=null&&w!=null&&y!=null){$=!0;const H=h?0:Wn,xe=vt(C,w,D,p,m||"left"),Se=vt(d,y,I,u,E||"top");let re=[{placement:"top",x:xe,y:d-I-H,fits:I<d-H-me},{placement:"bottom",x:xe,y:d+y+H,fits:I<u-(d+y)-H-me},{placement:"left",x:C-D-H,y:Se,fits:D<=C-H-me},{placement:"right",x:C+w+H,y:Se,fits:D<=p-(C+w)-H-me}];c&&(re=re.filter(k=>Te(k.placement)===l)),re.sort((k,F)=>{const O=Te(k.placement),f=Te(F.placement);return k.fits!==F.fits?k.fits?-1:1:k.placement===o?-1:F.placement===o?1:O!==f?O===l?-1:1:k.placement==="bottom"||k.placement==="right"?-1:1});const ae=re[0];let X=ae.x,Z=ae.y;if(R=ae.placement,X+=j,Z+=ne,X=Math.round(X),Z=Math.round(Z),a.style.transform=`translate3d(${X}px, ${Z}px, 0px)`,!h&&s){const k=Math.max(qn,ge);let F,O;if(R==="left"||R==="right"){const f=d+y/2-Xe/2;y<=ht||E==="center"?O=f:O=Math.min(d,f),O+=-Z+ne,O=Math.max(k,Math.min(I-k,O))}else{const f=C+w/2-Bn/2;w<=ht||m==="center"?F=f:F=Math.min(C,f),F+=-X+j,F=Math.max(k,Math.min(D-k,F))}F=F&&Math.round(F),O=O&&Math.round(O),s.style.left=F==null?"":F+"px",s.style.top=O==null?"":O+"px"}}else $=!1,a.style.transform="translate3d(-999999px, -999999px, 0px)";$&&!this.lastVisible&&n.onShow&&n.onShow(),R!==this.lastActualPlacement&&(this.setState({actualPlacement:R}),n.onPlacementChange&&n.onPlacementChange(R)),this.lastVisible=$,this.lastPlacement=o,this.lastActualPlacement=R,this.lastForceDimension=c,this.lastHorizontalAlign=m,this.lastVerticalAlign=E,this.lastNoNotch=h,this.lastViewportWidth=p,this.lastViewportHeight=u,this.lastTargetX=C,this.lastTargetY=d,this.lastTargetWidth=w,this.lastTargetHeight=y,this.lastPopoverCssWidth=x,this.lastPopoverMinWidth=T,this.lastPopoverWidth=D,this.lastPopoverHeight=I,this.lastPopoverBorderRadius=ge,this.lastScrollX=j,this.lastScrollY=ne}fireOnDismiss(n){const{onDismiss:r}=this.props;r&&r(n),!this.props.noTargetRefocus&&n.reason==="escape"&&this.props.target&&this.props.target.focus()}}function Te(t){return t==="left"||t==="right"?"x":"y"}function vt(t,n,r,a,s){let o;return s==="center"?o=t+n/2-r/2:o=t,o=Math.max(o,me),o=Math.min(o,a-r-me),o=Math.max(o,t+Et-r),o=Math.min(o,t+n-Et),o}const $n=250,Gn=250;let zn=0;class Yn{constructor(){this.currentId=null,this.subscribers=new Set}showDelayed(n){window.clearTimeout(this.changeTimeout),this.currentId?this.updateCurrentId(n):this.changeTimeout=window.setTimeout(()=>{this.updateCurrentId(n)},$n)}hideDelayed(n){window.clearTimeout(this.changeTimeout),n===this.currentId&&(this.changeTimeout=window.setTimeout(()=>{this.updateCurrentId(null)},Gn))}hide(n){window.clearTimeout(this.changeTimeout),n===this.currentId&&this.updateCurrentId(null)}updateCurrentId(n){this.currentId=n,this.subscribers.forEach(r=>r(n))}subscribe(n){return this.subscribers.add(n),()=>{this.subscribers.delete(n)}}}const Kn=i.createContext(new Yn),jn=t=>{const n=i.useRef(null),[r]=i.useState(()=>++zn),a=i.useContext(Kn),[s,o]=i.useState(a.currentId);i.useEffect(()=>a.subscribe(o),[a]);const{tip:l,maxWidth:c,children:m,Tag:E,...h}=t,p=E||"div";let u=null;return s===r&&n.current&&(u=e.createElement(Pe,{className:"tooltipped__popover",target:n.current,placement:"top",horizontalAlign:"center",verticalAlign:"center",onMouseEnter:()=>a.hide(r),document:n.current.ownerDocument||void 0},e.createElement("div",{style:{maxWidth:c||300}},typeof l=="function"?l():l))),e.createElement(e.Fragment,null,e.createElement(p,{ref:n,...h,onMouseEnter:l?()=>a.showDelayed(r):void 0,onMouseLeave:l?()=>a.hideDelayed(r):void 0,onMouseDown:l?()=>a.hide(r):void 0},m),u)},Xn=({tip:t,icon:n})=>e.createElement(jn,{className:"help-tip",tip:t},e.createElement(ee,{icon:n||nn}));class Za extends e.PureComponent{constructor(){super(...arguments),this.memoizedStyle=St((n,r)=>(n=n||{},r&&(n.width=`${r}px`),n))}render(){const{props:n}=this,r=["form-group"],a=!!n.error&&n.error!==!0;a&&r.push("form-group--invalid"),n.className&&r.push(n.className);let s=null;return n.label&&(s=e.createElement("label",{className:b({label:!0,"mr-8":!!n.tip,[`text-${n.align}`]:!!n.align}),htmlFor:n.labelFor},n.label,n.required&&e.createElement(e.Fragment,null," ",e.createElement("span",{className:"text-red"},"*")))),n.tip&&(s=e.createElement("div",{className:"d-flex"},s,e.createElement(Xn,{tip:n.tip}))),e.createElement("div",{className:r.join(" "),style:this.memoizedStyle(n.style,n.width)},s,n.children,a&&e.createElement("div",{className:"error-tooltip"+(n.align?` text-${n.align}`:"")},n.error))}}function Zn(t,n){return t&&(t.includes.some(r=>r!="")||t.excludes.some(r=>r!=""))?!0:"Enter at least one URL pattern"}class Qn extends e.PureComponent{constructor(n){super(n),this.root=e.createRef(),this.valueMirror=e.createRef(),this.placeholderMirror=e.createRef(),this.state={width:n.minWidth||200}}componentDidMount(){this.resize()}componentDidUpdate(n){const{props:r}=this;(r.value!==n.value||r.placeholder!==n.placeholder||r.className!==n.className||r.minWidth!==n.minWidth)&&this.resize()}render(){const{children:n}=this.props,r="input-grow__mirror "+(this.props.className||"");return e.createElement("div",{ref:this.root,className:"input-grow"},e.createElement("div",{ref:this.valueMirror,className:r},this.props.value),this.props.placeholder&&e.createElement("div",{ref:this.placeholderMirror,className:r},this.props.placeholder),n)}resize(){const n=this.root.current,r=this.valueMirror.current;if(!n||!r)return;let a=r.offsetWidth;this.props.minWidth&&(a=Math.max(this.props.minWidth,a)),this.props.maxWidth&&(a=Math.min(this.props.maxWidth,a)),this.placeholderMirror.current&&(a=Math.max(this.placeholderMirror.current.offsetWidth,a)),a=Math.ceil(a)+1,this.props.useFlexBasis?(n.style.flexGrow="0",n.style.flexShrink="1",n.style.flexBasis=a+"px"):n.style.width=a+"px"}}class Ot extends e.PureComponent{constructor(n){super(n),this.onChange=r=>{const a=r.target.value,{onChange:s}=this.props,o=this.parseInputValue(a);this.setState({inputValue:a}),s&&s(o)},this.onBlur=r=>{this.setState({inputValue:this.formatInputValue(this.props.value)}),this.props.onBlur&&this.props.onBlur(r)},this.onKeyDown=r=>{const{arrowsIncrement:a,value:s,onChange:o,onKeyDown:l}=this.props;a&&o&&(r.key==="ArrowUp"?(r.preventDefault(),o(s==null?1:s+1)):r.key==="ArrowDown"&&(r.preventDefault(),o(s==null?-1:s-1))),l&&l(r)},this.state={inputValue:this.formatInputValue(n.value)}}formatInputValue(n){if(n==null)return"";const r=this.props.format||"0,0";return mt(n).format(r)}parseInputValue(n){const r=this.props.format||"0,0";if(n==="")return null;let a=mt(n).value();if(a==null)return null;let s=null;if(r==="0"||r==="0,0")s=0;else{const o=r.match(/\.(0+)$/);if(o)s=o[1].length;else{const l=r.match(/\.\[(0+)\]$/);l&&(s=l[1].length)}}return s!=null&&(a=new kn(a).decimalPlaces(s).toNumber()),a}componentDidUpdate(){const{value:n}=this.props,r=this.parseInputValue(this.state.inputValue);n!=r&&this.setState({inputValue:this.formatInputValue(n)})}render(){const{props:n}=this,r=this.state,a=`number-input ${n.className||""}`;let s=e.createElement("input",{ref:n.inputRef,"data-testid":n.testid,type:"text",className:a,value:r.inputValue,onChange:this.onChange,onBlur:this.onBlur,onKeyDown:this.onKeyDown,disabled:n.disabled,placeholder:n.placeholder,...n.htmlAttributes});return n.grow&&(s=e.createElement(Qn,{className:a,value:r.inputValue,placeholder:n.placeholder?n.placeholder:"0"},s)),s}}const Jn=[],er=({disabled:t,disableAfter:n,disableBefore:r,inputClassName:a,inputRef:s,name:o,onBlur:l,onChange:c,onEnter:m,onFocus:E,placeholder:h,time:p,value:u})=>{const g=i.useRef(null),C=i.useRef(null),[d,w]=i.useState(null),[y,x]=i.useState(0),[T,A]=i.useState(p?pe(u):De(u)),[D,I]=i.useState(!1),[ge,j]=i.useState(!1),ne=f=>{w(f),s&&(s.current=f)};i.useEffect(()=>{d!==document.activeElement&&A(p?pe(u):De(u))},[d,u,p]);const $=f=>{c&&c(f)},R=f=>{A(p?pe(f):De(f)),$(f)},H=f=>{p&&(u?(f.setHours(u.getHours()),f.setMinutes(u.getMinutes())):(f.setHours(12),f.setMinutes(0)),f.setSeconds(0),f.setMilliseconds(0)),R(f),p||I(!1)},xe=f=>{const N=u?new Date(u.valueOf()):new Date;N.setHours(f),N.setSeconds(0),N.setMilliseconds(0),u||N.setMinutes(0),R(N)},Se=f=>{const N=u?new Date(u.valueOf()):new Date;N.setMinutes(f),N.setSeconds(0),N.setMilliseconds(0),T||N.setHours(12),R(N)},re=f=>{const{value:N}=f.target;A(N);const se=rr(N);se?(x(y+1),$(se)):$(null)},ae=f=>{f.preventDefault(),j(!0);const N=()=>{j(!1),document.body.removeEventListener("mouseup",N)};document.body.addEventListener("mouseup",N)},X=()=>{t||(D?I(!1):(d?.focus({preventScroll:!0}),I(!0)))},Z=f=>{switch(f.key){case"Enter":D?I(!1):m&&m();break;case"Escape":D&&(f.preventDefault(),f.stopPropagation(),I(!1));break}},k=f=>{A(p?pe(u):De(u)),ge||I(!1),l&&l(f)};i.useEffect(()=>{!p||!u||!D||(C.current?.querySelector(`[data-date-input-hour="${u.getHours()}"]`)?.scrollIntoView({block:"nearest"}),C.current?.querySelector(`[data-date-input-minute="${u.getMinutes()}"]`)?.scrollIntoView({block:"nearest"}))},[p,u,D]);const F=f=>{const N=[],se=f?.getHours();for(let P=0;P<24;P++){let U;if(At){let He=P%12;He===0&&(He=12),U=`${He} ${P<12?" am":" pm"}`}else U=P.toString().padStart(2,"0");N.push(e.createElement("div",{key:P,className:b({"date-input__time-btn":!0,"date-input__time-btn--selected":P===se}),onClick:()=>xe(P),"data-date-input-hour":P},U))}return N},O=f=>{const N=[],se=f?.getMinutes(),P=5;for(let U=0;U<60;U+=P)N.push(e.createElement("div",{key:U,className:b({"date-input__time-btn":!0,"date-input__time-btn--selected":U===se}),onClick:()=>Se(U),"data-date-input-minute":U},U.toString().padStart(2,"0")));return N};return e.createElement(e.Fragment,null,e.createElement("div",{ref:g,className:b({"input-group":!0,"input-group--disabled":!!t})},e.createElement("input",{type:"text",className:a,name:o,value:T,onChange:re,onFocus:E,onBlur:k,onKeyDown:Z,onMouseDown:()=>I(!0),placeholder:h,disabled:t,ref:ne}),e.createElement("div",{className:"input-group__append input-group__trigger",onClick:X,onMouseDown:ae},e.createElement(ee,{icon:p?nt:rn}))),D&&g.current?e.createElement(Pe,{target:g.current,onMouseDown:ae},e.createElement("div",{ref:C,className:"d-flex"},e.createElement(On,{selectedDays:u||Jn,initialMonth:u||void 0,onDayClick:H,key:y,disabledDays:[...r?[{before:r}]:[],...n?[{after:n}]:[]]}),p&&e.createElement("div",{className:"date-input__time"},e.createElement("div",{className:"date-input__time-caption"},"Time"),e.createElement("div",{className:"date-input__time-main-container"},e.createElement("div",{className:"date-input__time-scroll-container"},F(u)),e.createElement("div",{className:"date-input__time-scroll-container"},O(u))))),p&&e.createElement("div",{className:"date-input__time-footer"},e.createElement("small",null,`Time is set in your local timezone (${Intl.DateTimeFormat().resolvedOptions().timeZone.replace(/_/g," ")})`))):null)},tr=["yyyy-MM-dd","yyyy/MM/dd","MM-dd yyyy","MM/dd yyyy","MM-dd-yyyy","MM/dd/yyyy","MM-dd","MM/dd","dd MMM yyyy","dd MMMM yyyy","MMM dd yyyy","MMMM dd yyyy","dd MMM","dd MMMM","MMM dd","MMMM dd"],nr=["hh:mmaaa","hh.mmaaa","hh:mm aaa","hh.mm aaa","HH:mm","HH.mm","hhaaa","hh aaa","HH"],Ze=[];for(const t of tr){for(const n of nr)Ze.push(t+" "+n);Ze.push(t)}function rr(t){if(!t)return null;const n=t.replace(/[,]/g," ").replace(/\s{2,}/g," ").replace(/^[.:\s]+/g,"").replace(/[.:\s]+$/g,"");for(const r of Ze){const a=Tt(n,r,new Date);if(Mn(a))return a}return null}const Lt="d MMM yyyy";function De(t){return t==null?"":Ce(t,Lt)}function pe(t){if(t==null)return"";const n=At?t.getMinutes()===0?"h aaa":"h:mm aaa":"HH:mm";return Ce(t,Lt+", "+n)}function ar(t){return t==null?null:Ce(t,"yyyy-MM-dd")}function Mt(t){if(!t)return null;const n=Tt(t,"yyyy-MM-dd",new Date);return isNaN(n.valueOf())?null:n}function bt(t){if(!t)return null;const n=Ln(t);return isNaN(n.valueOf())?null:n}const At=Intl.DateTimeFormat(Intl.DateTimeFormat().resolvedOptions().locale,{hour:"numeric"}).resolvedOptions().hourCycle==="h12";function Ue(){const[t,n]=i.useState(!1),r=i.useRef(null),a=i.useCallback(()=>n(!0),[]),s=i.useCallback(()=>n(!1),[]),o=i.useCallback(()=>n(!0),[]),l=i.useCallback(()=>n(!1),[]);return{ref:r,hovered:t,eventHandlers:{onPointerEnter:a,onPointerLeave:s,onFocus:o,onBlur:l}}}const sr={prefix:"far",iconName:"custom-hand-pointer-slash",icon:[641,512,[],"???","M185.554191,59.5126699 C189.248662,26.0794907 217.382589,0 251.429,0 C287.979,0 317.715,30.056 317.715,67 L317.715,140.634 C338.128,137.776 359.183,144.576 374.31,160.263 C401.503,147.416 434.689,154.593 454.182,179.361 C497.375,162.727 544,195.156 544,242 L544,326 C544,330.296189 543.590626,334.580726 542.780274,338.796073 L495.999,302.221942 L495.999,242 C495.999,216.84 459.428,216.879 459.428,242 C459.428,250.836 452.265,258 443.428,258 L439.435556,258 L420.622383,243.291649 C420.588346,242.865584 420.571,242.434817 420.571,242 L420.571,221 C420.571,197.943344 389.858993,196.049429 384.724023,215.225903 L269.713,125.308981 L269.713,67 C269.713,41.84 233.142,41.88 233.142,67 L233.142,96.717359 L185.554191,59.5126699 Z M162.172457,223.995642 L233.142,279.479508 L233.142,308.493 C233.142,324.063 213.106,330.402 204.111,317.776 L176.985,279.697 C162.585,259.485 133.185,282.08 147.591,302.303 L257.303,456.303 C260.737,461.122 266.231,464 272,464 L450.285,464 C455.041109,464 459.427079,462.119816 462.713129,458.957818 L500.616335,488.590478 C488.331086,503.061811 470.146238,512 450.286,512 L272,512 C250.741,512 230.632,501.59 218.209,484.154 L108.51,330.153 C87.267,300.334 93.705,258.796 123.06,237.001 C134.952446,228.171597 148.664261,223.998532 162.172457,223.995642 Z M272.143,309.970422 L306.143,336.551563 L306.143,400 C306.143,408.837 299.875,416 292.143,416 L286.143,416 C278.41,416 272.143,408.837 272.143,400 L272.143,309.970422 Z M347.571,368.939901 L381.571,395.521042 L381.571,400 C381.571,408.837 375.303,416 367.571,416 L361.571,416 C353.839,416 347.571,408.837 347.571,400 L347.571,368.939901 Z M633.994211,471.020009 C640.904211,476.540009 642.014211,486.610009 636.494211,493.510009 L626.494211,506 C620.964211,512.890009 610.904211,514.010009 604.004211,508.490009 L6.00421069,40.9800088 C-0.895789309,35.4600088 -2.01578931,25.3900088 3.51421069,18.4900088 L13.5142107,6 C19.0342107,-0.899991212 29.1042107,-2.00999121 36.0042107,3.51000879 L633.994211,471.020009 Z"]},or={[L.ANNOUNCEMENT]:"announcement",[L.ASSISTANT]:"AI assistant",[L.BANNER]:"banner",[L.CHECKLIST]:"checklist",[L.FLOW]:"flow",[L.EMBED]:"embed",[L.LAUNCHER]:"launcher",[L.RESOURCE_CENTER]:"resource center",[L.TRACKER]:"event tracker"};function Rt(t,{title:n,plural:r}={}){let a=or[t];return n&&(a=Ae.upperFirst(a)),r&&(a+="s"),a}function wt(t){switch(t){case B.USER:return rt;case B.GROUP:return sn;case B.GROUP_MEMBERSHIP:return an;case B.EVENT:return yt}}function lr(t){const n=t.split("/");if(n.length===1)return[B.USER,t];switch(n[0]){case"group":return[B.GROUP,n[1]];case"group_membership":return[B.GROUP_MEMBERSHIP,n[1]];case"event":return[B.EVENT,n[1]]}return console.warn("parseAttributeDefinitionFqn: Invalid attribute definition FQN",t),[B.USER,t]}z.SECOND,z.MINUTE,z.HOUR,z.DAY;function Qe(t,n){switch(t){case z.DAY:return n===1?"day":"days";case z.HOUR:return n===1?"hour":"hours";case z.MINUTE:return n===1?"minute":"minutes";case z.SECOND:return n===1?"second":"seconds"}}le.BODY_FIRST,le.BODY_LAST,le.ELEMENT_FIRST,le.ELEMENT_LAST,le.ELEMENT_BEFORE,le.ELEMENT_AFTER;ie.BODY_FIRST,ie.BODY_LAST,ie.ELEMENT_FIRST,ie.ELEMENT_LAST,ie.ELEMENT_BEFORE,ie.ELEMENT_AFTER;We.START,We.CENTER,We.SPACE_BETWEEN;he.SILENT,he.BADGE,he.POPOUT,he.MODAL,he.TOAST;qe.NONE,qe.LIKE,qe.SCALE;dt.DAILY,dt.WEEKLY;$e.START,$e.CENTER,$e.SPACE_BETWEEN;e.createContext(null);const ir=e.createContext(null);function cr(){const t=i.useContext(ir);if(!t)throw new Error("useCompanyData: Data was not set");return t}function ur(){return cr().company}const dr={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"FlowForSelect"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Flow"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}}]},mr={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListFlowsForSelect"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"companyId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"types"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowType"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"company"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"companyId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"flows"},arguments:[{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"Variable",name:{kind:"Name",value:"types"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"FlowForSelect"}}]}}]}}]}},...dr.definitions]};class Je extends e.PureComponent{constructor(n){super(n),this.rootRef=e.createRef(),this.optionsElRef=e.createRef(),this.input=null,this.popoverRef=e.createRef(),this.isMouseDown=!1,this.isCreateOpen=!1,this.setInput=r=>{this.input=r;const{inputRef:a}=this.props;a&&(typeof a=="function"?a(r):a.current=r)},this.onInputChange=r=>{r.stopPropagation();const{value:a}=r.target;a!==""&&this.openPopover();const s=this.memoizedFilterOptions(this.props.options,a);this.setState({inputValue:a,q:a,highlightedIndex:s.length>0?0:-1,createHighlighted:s.length===0}),a===""&&!this.props.noEmpty&&this.triggerOnChange(null),this.props.onSearchChange&&this.props.onSearchChange(a)},this.onPopoverPlacementChange=r=>this.setState({popoverPlacement:r}),this.onMouseDown=r=>{r.preventDefault(),this.isMouseDown=!0;const a=()=>{this.isMouseDown=!1,this.props.document?.removeEventListener("mouseup",a),document.body.removeEventListener("mouseup",a)};this.props.document?.addEventListener("mouseup",a),document.body.addEventListener("mouseup",a)},this.onFocus=r=>{this.input&&!this.props.noSearch&&this.input.select(),this.props.onFocus&&this.props.onFocus(r)},this.onBlur=r=>{this.isMouseDown||this.closePopover(),this.props.onBlur&&!this.isCreateOpen&&this.props.onBlur(r)},this.onTriggerClick=()=>{this.props.readOnly||this.props.disabled||(this.state.popoverOpen?this.closePopover():(this.input&&this.input.focus(),this.openPopover()))},this.onKeyDown=r=>{const{popoverOpen:a,highlightedIndex:s,createHighlighted:o}=this.state,l=this.getFilteredOptions(),c=l.length-1;switch(r.key){case"ArrowUp":r.preventDefault(),a&&(o?this.setState({highlightedIndex:c,createHighlighted:!1}):s>0&&this.setState({highlightedIndex:s-1}));break;case"ArrowDown":r.preventDefault(),a?this.props.onCreate&&(s===c||o)?this.setState({highlightedIndex:-1,createHighlighted:!0}):s<c&&this.setState({highlightedIndex:s+1}):this.props.noOpenOnDown||this.openPopover();break;case"Enter":if(a)if(r.preventDefault(),o)this.fireOnCreate();else{const m=l[s];(m||!this.props.noEmpty)&&this.selectOption(m)}else this.props.onEnter?this.props.onEnter():this.openPopover();break;case"Tab":a&&this.selectOption(l[s]);break;case"Escape":a&&(r.preventDefault(),r.stopPropagation(),this.setState({popoverOpen:!1}));break}},this.selectOption=r=>{r===this.props.value?this.setState({popoverOpen:!1,inputValue:this.renderOptionText(r),q:""}):(this.setState({popoverOpen:!1,inputValue:"",q:""}),this.triggerOnChange(r))},this.highlightOption=r=>{this.setState({highlightedIndex:r,createHighlighted:!1})},this.highlightCreate=()=>{this.setState({highlightedIndex:-1,createHighlighted:!0})},this.fireOnCreate=()=>{const{onCreate:r}=this.props;if(r){this.isCreateOpen=!0;const a={q:Ae.upperFirst(this.state.q),callback:s=>{this.isCreateOpen=!1,s!=null&&this.selectOption(s),this.input&&this.input.focus()}};r(a),this.closePopover()}},this.openPopover=()=>{if(!this.state.popoverOpen){const r=this.getFilteredOptions();let a=0,s=!1;if(r.length===0)a=-1,s=!0;else{const{value:o}=this.props,l=r.findIndex(c=>c===o);l!==-1&&(a=l)}this.setState({popoverOpen:!0,highlightedIndex:a,createHighlighted:s})}},this.memoizedFilterOptions=St((r,a)=>(r=r||[],a?r.filter(s=>this.filter(s,a)):r)),this.state={inputValue:this.renderOptionText(n.value==null?null:n.value),q:"",popoverOpen:!1,popoverPlacement:null,highlightedIndex:-1,createHighlighted:!1}}componentDidUpdate(n,r){const{value:a}=this.props;if(a!==n.value){const s=this.renderOptionText(a??null);s!==this.state.inputValue&&this.setState({inputValue:s})}r.highlightedIndex!==this.state.highlightedIndex&&this.scrollHighlightedOptionIntoView()}render(){let n;const{props:r}=this,a=this.state,s=a.popoverPlacement==="top"?"above":"below";if(a.popoverOpen&&this.rootRef.current){const l=this.getFilteredOptions();let c;if(l.length>0){let m=null;c=l.reduce((E,h,p)=>{const u=this.getOptionGroup(h);u&&u!==m&&E.push(e.createElement("div",{key:"group:"+u,className:"combo-box__group-header"},u)),m=u;const g=["combo-box__option"];return p===a.highlightedIndex&&g.push("combo-box__option--highlighted"),E.push(e.createElement(pr,{key:this.getOptionKey(h,p),className:g.join(" "),option:h,idx:p,renderOptionText:r.renderOptionText,renderOptionItem:r.renderOptionItem,getOptionIcon:r.getOptionIcon,onClick:this.selectOption,onHover:this.highlightOption})),r.hasSeparatorAfter&&r.hasSeparatorAfter(h)&&E.push(e.createElement("div",{key:"sep-"+p,className:"combo-box__option-sep"})),E},[])}else r.loading?c=e.createElement("div",{className:"combo-box__no-results"},"Loading..."):c=e.createElement("div",{className:"combo-box__no-results"},"No matching ",r.nounPlural||"items");n=e.createElement(Pe,{ref:this.popoverRef,className:"combo-box-popover"+(r.popoverNotch?"":` combo-box-popover--${s}`),noNotch:!r.popoverNotch,target:this.rootRef.current,forceDimension:!0,matchWidth:!0,minWidth:r.popoverMinWidth,onMouseDown:this.onMouseDown,onPlacementChange:this.onPopoverPlacementChange,document:r.document},e.createElement("div",{ref:this.optionsElRef,className:b({"combo-box__options":!0,"combo-box__options--with-create":!!r.onCreate})},c),r.onCreate&&e.createElement("div",{key:"create",className:b({"combo-box__option":!0,"combo-box__option--create":!0,"combo-box__option--highlighted":a.createHighlighted}),onClick:this.fireOnCreate,onMouseMove:this.highlightCreate},e.createElement("div",{className:"combo-box__create-icon"},e.createElement(ee,{icon:on})),e.createElement("div",{className:"combo-box__create-text"},"Create"," ",a.q===""?"new"+(r.noun?` ${r.noun}`:""):e.createElement("b",null,Ae.upperFirst(a.inputValue)))))}const o=["input-group","combo-box"];return a.popoverOpen&&(o.push("combo-box--open"),r.popoverNotch||o.push(`combo-box--with-popover-${s}`)),r.disabled&&o.push("input-group--disabled"),r.noSearch&&o.push("combo-box--no-search"),r.className&&o.push(r.className),e.createElement(e.Fragment,null,e.createElement("div",{className:o.join(" "),style:{width:r.width?r.width+"px":void 0},ref:this.rootRef,onClick:r.readOnly||r.disabled?void 0:()=>{this.input?.focus(),this.openPopover()}},r.childrenBefore,r.value&&r.getOptionIcon&&e.createElement("div",{className:"combobox__input-icon"},Ut(r.value,r.getOptionIcon)),e.createElement("input",{type:"text",className:r.inputClassName,name:r.name,value:a.inputValue,onChange:this.onInputChange,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onMouseDown:this.openPopover,placeholder:r.placeholder,readOnly:r.readOnly||r.noSearch,disabled:r.disabled,autoComplete:"off",ref:this.setInput,...r.inputHtmlAttributes}),!r.noTrigger&&e.createElement("div",{"data-testid":r.triggerTestId||"combo-box-trigger",className:"input-group__append input-group__trigger",onClick:this.onTriggerClick,onMouseDown:this.onMouseDown},e.createElement(ee,{icon:ln})),r.childrenAfter),n)}scrollHighlightedOptionIntoView(){const n=this.optionsElRef.current;if(this.state.popoverOpen&&n){const r=n.querySelector(".combo-box__option--highlighted");if(r){const a=n.getBoundingClientRect(),s=r.getBoundingClientRect();s.top<a.top?n.scrollTop+=s.top-a.top:s.bottom>a.bottom&&(n.scrollTop+=s.bottom-a.bottom)}}}triggerOnChange(n){const{onChange:r}=this.props;r&&r(n)}closePopover(){this.setState({popoverOpen:!1,inputValue:this.renderOptionText(this.props.value==null?null:this.props.value),q:""})}renderOptionText(n){return n==null?"":Pt(n,this.props.renderOptionText)}getFilteredOptions(){return this.memoizedFilterOptions(this.props.options,this.state.q)}filter(n,r){return this.props.filter?this.props.filter(n,r):this.renderOptionText(n).toLowerCase().includes(r.toLowerCase())}getOptionKey(n,r){return n&&n.id||r}getOptionGroup(n){return this.props.getOptionGroup?this.props.getOptionGroup(n):n&&n.group||null}}class pr extends e.PureComponent{constructor(){super(...arguments),this.state={isOptionDisabled:!1},this.onClick=()=>{this.state.isOptionDisabled||this.props.onClick(this.props.option)},this.onHover=()=>{this.state.isOptionDisabled||this.props.onHover(this.props.idx)}}componentDidMount(){const n=this.props.option!==void 0&&typeof this.props.option=="object"&&this.props.option!==null&&"disabled"in this.props.option&&this.props.option.disabled===!0;this.setState({isOptionDisabled:n})}componentDidUpdate(){const n=this.props.option!==void 0&&typeof this.props.option=="object"&&this.props.option!==null&&"disabled"in this.props.option&&this.props.option.disabled===!0;this.setState({isOptionDisabled:n})}render(){const{isOptionDisabled:n}=this.state,{props:r}=this;return e.createElement("div",{className:b({[r.className]:!0,"combo-box__option--disabled":n}),onClick:this.onClick,onMouseMove:this.onHover},fr(r.option,r.renderOptionText,r.renderOptionItem,r.getOptionIcon))}}function Pt(t,n){return n?n(t):typeof t=="string"||typeof t=="number"?t:t?t.name:"?"}function fr(t,n,r,a){if(r)return r(t);{let s=Pt(t,n);return a?e.createElement("div",{className:"d-flex align-flex-start"},e.createElement("div",{className:"combobox__option-icon"},Ut(t,a)),e.createElement("div",{className:"flex-1"},s)):s}}function Ut(t,n){const r=n(t);return gr(r)?e.createElement(ee,{icon:r}):r}function gr(t){return An(t)&&"iconName"in t}function hr(t){if(typeof t!="string"&&t.graphQLErrors){const n=[];if(t.graphQLErrors.forEach(r=>{r.message&&n.push(r.message)}),n.length>0)return n.join(`
|
|
2
|
+
import{R as e,r as i}from"./vendor.react.js";import{r as je}from"./vendor.react-dom.js";import{u as te,U as Kt}from"./client-context.js";import{d as tt,W as q,a as oe,b as M,S as jt,c as Ee,e as Xt,f as ut,g as Zt,_ as Qt,h as Jt}from"./userflow.js";import{F as en}from"./Frame.js";import{S as tn}from"./logomark.js";import{f as nn,a as nt,b as rn,c as yt,d as an,e as sn,g as rt,h as on,i as ln,j as cn,k as un,l as Q,m as fe,n as dn,o as mn,p as Ct,q as K,r as pn,s as Nt,t as at,u as fn,v as gn,w as J,x as Y,y as hn,z as En,A as vn,B as bn,C as wn,D as _n,E as yn,F as Cn,G as xt,H as Nn,I as xn,J as Sn,K as Tn,L as Be,M as Dn}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{f as Fn,a as In}from"./vendor.fortawesome.pro-solid-svg-icons.js";import{D as v}from"./stylesheets.js";import{o as b}from"./vendor.obj-str.js";import{F as L,a as z,B as le,E as ie,b as We,A as he,c as qe,d as dt,e as $e,f as B,g as _,h as we,i as de,j as ve}from"./index.js";import{F as ee}from"./vendor.fortawesome.react-fontawesome.js";import"./vendor.absinthe.socket.js";import{m as St}from"./vendor.memoize-one.js";import{n as mt}from"./vendor.numeral.js";import{B as kn}from"./vendor.bignumber.js.js";import{D as On}from"./vendor.react-day-picker.js";import{f as Ce,p as Tt,a as Ln,i as Mn}from"./vendor.date-fns.js";import{_ as Ae,l as Dt}from"./vendor.lodash.js";import{c as An}from"./roots.js";import"./vendor.isomorphic-fetch.js";import{u as Ft}from"./vendor.apollo.client.js";import"./vendor.object-assign.js";import"./vendor.scheduler.js";import"./vendor.i18next.js";import"./vendor.react-i18next.js";import"./vendor.babel.runtime.js";import"./vendor.core-js.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";import"./vendor.jumpn.utils-composite.js";import"./vendor.babel-runtime.js";import"./vendor.jumpn.utils-array.js";import"./vendor.flow-static-land.js";import"./vendor.jumpn.utils-graphql.js";import"./vendor.zen-observable.js";import"./flow-condition-types.js";import"./vendor.fortawesome.fontawesome-svg-core.js";import"./vendor.whatwg-fetch.js";import"./vendor.ts-invariant.js";import"./vendor.wry.equality.js";import"./vendor.graphql.js";import"./vendor.optimism.js";import"./vendor.wry.trie.js";import"./vendor.wry.context.js";import"./vendor.fast-json-stable-stringify.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="e801eb9b-888f-40e0-b40e-d8bd432a3504",t._sentryDebugIdIdentifier="sentry-dbid-e801eb9b-888f-40e0-b40e-d8bd432a3504")}catch{}})();const Rn=new URL("debugger.css",import.meta.url).href;let pt=!1;const _e=[];function ft(t){_e.push(t),pt||(pt=!0,window.addEventListener("keydown",n=>{if(n.key==="Escape"){const r=_e[_e.length-1];r&&(r(),n.stopImmediatePropagation())}}))}function gt(t){const n=_e.indexOf(t);n>=0&&_e.splice(n,1)}const V=[];let st=0;typeof window<"u"&&window.document.documentElement.addEventListener("mousedown",()=>st++,{capture:!0});function Pn(t){const n={cmp:t,zIndex:It(),mountMouseDownCounter:st};V.push(n),V.length===1&&document.documentElement.addEventListener("click",kt,{capture:!0})}function Un(t){const n=V.findIndex(r=>r.cmp===t);V.splice(n,1),V.length===0&&document.documentElement.removeEventListener("click",kt,{capture:!0})}function Vn(t){const n=V.find(r=>r.cmp===t);return n?n.zIndex:It()}function It(){const t=V[V.length-1];return t?t.zIndex+100:1e3}function Hn(t,n){const r=t.rootRef.current;return!!r&&r.contains(n)}function kt(t){const n=t.target;if(n.closest("#userflow-ui, #notifications"))return;const r=V.findIndex(a=>Hn(a.cmp,n));for(let a=V.length-1;a>r;a--){const s=V[a];s&&s.mountMouseDownCounter<st&&s.cmp.closeLayer(t)}}const Xe=8,Bn=Xe*2,Wn=8,ht=50,me=8,Et=24,qn=8;class Pe extends e.PureComponent{constructor(){super(...arguments),this.rootRef=e.createRef(),this.notchRef=e.createRef(),this.bodyRef=e.createRef(),this.state={},this.onAnimationFrame=()=>{this.reposition(),this.requestAnimationFrame()},this.onClick=n=>{n.stopPropagation(),this.props.onClick&&this.props.onClick(n)},this.closeLayer=n=>{if(this.props.ignoreTargetClick){const r=this.props.target,a=n.target;if(r&&a&&r.contains(a))return}this.fireOnDismiss({reason:"outside-click",event:n})},this.onEscape=()=>this.fireOnDismiss({reason:"escape"})}get el(){return this.rootRef.current}componentDidMount(){Pn(this),this.props.onDismiss&&ft(this.onEscape),window.addEventListener("userflow:hideAllPopovers",this.closeLayer),this.requestAnimationFrame(),this.reposition()}componentWillUnmount(){Un(this),gt(this.onEscape),window.removeEventListener("userflow:hideAllPopovers",this.closeLayer),window.cancelAnimationFrame(this.raf)}componentDidUpdate(n){const{props:r}=this;this.reposition(),!n.onDismiss&&r.onDismiss?ft(this.onEscape):n.onDismiss&&!r.onDismiss&>(this.onEscape)}render(){const{props:n}=this,r=this.state,a=["popover"];n.className&&a.push(n.className),a.push(`popover--placement-${r.actualPlacement}`);const s=e.createElement("div",{className:a.join(" "),ref:this.rootRef,onMouseDown:n.onMouseDown,onMouseEnter:n.onMouseEnter,onClick:this.onClick,style:{zIndex:Vn(this)}},e.createElement("div",{className:"popover__body",ref:this.bodyRef},n.children),!n.noNotch&&this.renderNotch());return je.createPortal(s,(n.document||document).body)}renderNotch(){const n=Xe,r=n*2;return e.createElement("div",{ref:this.notchRef,className:"popover__notch"},e.createElement("svg",{viewBox:`0 0 ${r} ${n}`},e.createElement("polygon",{className:"popover__notch-border",points:`${r/2},0 ${r},${n} 0,${n}`}),e.createElement("polygon",{className:"popover__notch-fill",points:`${r/2},1 ${r},${n+1} 0,${n+1}`})))}requestAnimationFrame(){this.raf=window.requestAnimationFrame(this.onAnimationFrame)}reposition(){const{props:n}=this,r=n.target,a=this.rootRef.current,s=this.notchRef.current,o=n.placement||"bottom",l=Te(o),c=!!n.forceDimension,m=n.horizontalAlign,E=n.verticalAlign,h=!!n.noNotch,p=document.documentElement.clientWidth,u=document.documentElement.clientHeight,g=r?.getBoundingClientRect(),C=g?.left,d=g?.top,w=g?.width,y=g?.height;let x=n.width;n.matchWidth&&(x=w);let T=n.minWidth;n.matchMinWidth&&w!=null&&(T=Math.max(w,T||0)),(this.lastPopoverCssWidth!==x||this.lastPopoverMinWidth!==T)&&(a.style.width=x==null?"":Math.round(x)+"px",a.style.minWidth=T==null?"":Math.round(T)+"px");const A=a.getBoundingClientRect(),D=A?.width,I=A?.height,ge=parseInt((window.getComputedStyle(a).borderTopLeftRadius||"").replace(/px/,""),10),j=window.scrollX,ne=window.scrollY;if(this.lastPlacement===o&&this.lastForceDimension===c&&this.lastHorizontalAlign===m&&this.lastVerticalAlign===E&&this.lastNoNotch===h&&this.lastViewportWidth===p&&this.lastViewportHeight===u&&this.lastTargetX===C&&this.lastTargetY===d&&this.lastTargetWidth===w&&this.lastTargetHeight===y&&this.lastPopoverCssWidth===x&&this.lastPopoverMinWidth===T&&this.lastPopoverWidth===D&&this.lastPopoverHeight===I&&this.lastPopoverBorderRadius===ge&&this.lastScrollX===j&&this.lastScrollY===ne)return;let $,R=null;if(C!=null&&d!=null&&w!=null&&y!=null){$=!0;const H=h?0:Wn,xe=vt(C,w,D,p,m||"left"),Se=vt(d,y,I,u,E||"top");let re=[{placement:"top",x:xe,y:d-I-H,fits:I<d-H-me},{placement:"bottom",x:xe,y:d+y+H,fits:I<u-(d+y)-H-me},{placement:"left",x:C-D-H,y:Se,fits:D<=C-H-me},{placement:"right",x:C+w+H,y:Se,fits:D<=p-(C+w)-H-me}];c&&(re=re.filter(k=>Te(k.placement)===l)),re.sort((k,F)=>{const O=Te(k.placement),f=Te(F.placement);return k.fits!==F.fits?k.fits?-1:1:k.placement===o?-1:F.placement===o?1:O!==f?O===l?-1:1:k.placement==="bottom"||k.placement==="right"?-1:1});const ae=re[0];let X=ae.x,Z=ae.y;if(R=ae.placement,X+=j,Z+=ne,X=Math.round(X),Z=Math.round(Z),a.style.transform=`translate3d(${X}px, ${Z}px, 0px)`,!h&&s){const k=Math.max(qn,ge);let F,O;if(R==="left"||R==="right"){const f=d+y/2-Xe/2;y<=ht||E==="center"?O=f:O=Math.min(d,f),O+=-Z+ne,O=Math.max(k,Math.min(I-k,O))}else{const f=C+w/2-Bn/2;w<=ht||m==="center"?F=f:F=Math.min(C,f),F+=-X+j,F=Math.max(k,Math.min(D-k,F))}F=F&&Math.round(F),O=O&&Math.round(O),s.style.left=F==null?"":F+"px",s.style.top=O==null?"":O+"px"}}else $=!1,a.style.transform="translate3d(-999999px, -999999px, 0px)";$&&!this.lastVisible&&n.onShow&&n.onShow(),R!==this.lastActualPlacement&&(this.setState({actualPlacement:R}),n.onPlacementChange&&n.onPlacementChange(R)),this.lastVisible=$,this.lastPlacement=o,this.lastActualPlacement=R,this.lastForceDimension=c,this.lastHorizontalAlign=m,this.lastVerticalAlign=E,this.lastNoNotch=h,this.lastViewportWidth=p,this.lastViewportHeight=u,this.lastTargetX=C,this.lastTargetY=d,this.lastTargetWidth=w,this.lastTargetHeight=y,this.lastPopoverCssWidth=x,this.lastPopoverMinWidth=T,this.lastPopoverWidth=D,this.lastPopoverHeight=I,this.lastPopoverBorderRadius=ge,this.lastScrollX=j,this.lastScrollY=ne}fireOnDismiss(n){const{onDismiss:r}=this.props;r&&r(n),!this.props.noTargetRefocus&&n.reason==="escape"&&this.props.target&&this.props.target.focus()}}function Te(t){return t==="left"||t==="right"?"x":"y"}function vt(t,n,r,a,s){let o;return s==="center"?o=t+n/2-r/2:o=t,o=Math.max(o,me),o=Math.min(o,a-r-me),o=Math.max(o,t+Et-r),o=Math.min(o,t+n-Et),o}const $n=250,Gn=250;let zn=0;class Yn{constructor(){this.currentId=null,this.subscribers=new Set}showDelayed(n){window.clearTimeout(this.changeTimeout),this.currentId?this.updateCurrentId(n):this.changeTimeout=window.setTimeout(()=>{this.updateCurrentId(n)},$n)}hideDelayed(n){window.clearTimeout(this.changeTimeout),n===this.currentId&&(this.changeTimeout=window.setTimeout(()=>{this.updateCurrentId(null)},Gn))}hide(n){window.clearTimeout(this.changeTimeout),n===this.currentId&&this.updateCurrentId(null)}updateCurrentId(n){this.currentId=n,this.subscribers.forEach(r=>r(n))}subscribe(n){return this.subscribers.add(n),()=>{this.subscribers.delete(n)}}}const Kn=i.createContext(new Yn),jn=t=>{const n=i.useRef(null),[r]=i.useState(()=>++zn),a=i.useContext(Kn),[s,o]=i.useState(a.currentId);i.useEffect(()=>a.subscribe(o),[a]);const{tip:l,maxWidth:c,children:m,Tag:E,...h}=t,p=E||"div";let u=null;return s===r&&n.current&&(u=e.createElement(Pe,{className:"tooltipped__popover",target:n.current,placement:"top",horizontalAlign:"center",verticalAlign:"center",onMouseEnter:()=>a.hide(r),document:n.current.ownerDocument||void 0},e.createElement("div",{style:{maxWidth:c||300}},typeof l=="function"?l():l))),e.createElement(e.Fragment,null,e.createElement(p,{ref:n,...h,onMouseEnter:l?()=>a.showDelayed(r):void 0,onMouseLeave:l?()=>a.hideDelayed(r):void 0,onMouseDown:l?()=>a.hide(r):void 0},m),u)},Xn=({tip:t,icon:n})=>e.createElement(jn,{className:"help-tip",tip:t},e.createElement(ee,{icon:n||nn}));class Za extends e.PureComponent{constructor(){super(...arguments),this.memoizedStyle=St((n,r)=>(n=n||{},r&&(n.width=`${r}px`),n))}render(){const{props:n}=this,r=["form-group"],a=!!n.error&&n.error!==!0;a&&r.push("form-group--invalid"),n.className&&r.push(n.className);let s=null;return n.label&&(s=e.createElement("label",{className:b({label:!0,"mr-8":!!n.tip,[`text-${n.align}`]:!!n.align}),htmlFor:n.labelFor},n.label,n.required&&e.createElement(e.Fragment,null," ",e.createElement("span",{className:"text-red"},"*")))),n.tip&&(s=e.createElement("div",{className:"d-flex"},s,e.createElement(Xn,{tip:n.tip}))),e.createElement("div",{className:r.join(" "),style:this.memoizedStyle(n.style,n.width)},s,n.children,a&&e.createElement("div",{className:"error-tooltip"+(n.align?` text-${n.align}`:"")},n.error))}}function Zn(t,n){return t&&(t.includes.some(r=>r!="")||t.excludes.some(r=>r!=""))?!0:"Enter at least one URL pattern"}class Qn extends e.PureComponent{constructor(n){super(n),this.root=e.createRef(),this.valueMirror=e.createRef(),this.placeholderMirror=e.createRef(),this.state={width:n.minWidth||200}}componentDidMount(){this.resize()}componentDidUpdate(n){const{props:r}=this;(r.value!==n.value||r.placeholder!==n.placeholder||r.className!==n.className||r.minWidth!==n.minWidth)&&this.resize()}render(){const{children:n}=this.props,r="input-grow__mirror "+(this.props.className||"");return e.createElement("div",{ref:this.root,className:"input-grow"},e.createElement("div",{ref:this.valueMirror,className:r},this.props.value),this.props.placeholder&&e.createElement("div",{ref:this.placeholderMirror,className:r},this.props.placeholder),n)}resize(){const n=this.root.current,r=this.valueMirror.current;if(!n||!r)return;let a=r.offsetWidth;this.props.minWidth&&(a=Math.max(this.props.minWidth,a)),this.props.maxWidth&&(a=Math.min(this.props.maxWidth,a)),this.placeholderMirror.current&&(a=Math.max(this.placeholderMirror.current.offsetWidth,a)),a=Math.ceil(a)+1,this.props.useFlexBasis?(n.style.flexGrow="0",n.style.flexShrink="1",n.style.flexBasis=a+"px"):n.style.width=a+"px"}}class Ot extends e.PureComponent{constructor(n){super(n),this.onChange=r=>{const a=r.target.value,{onChange:s}=this.props,o=this.parseInputValue(a);this.setState({inputValue:a}),s&&s(o)},this.onBlur=r=>{this.setState({inputValue:this.formatInputValue(this.props.value)}),this.props.onBlur&&this.props.onBlur(r)},this.onKeyDown=r=>{const{arrowsIncrement:a,value:s,onChange:o,onKeyDown:l}=this.props;a&&o&&(r.key==="ArrowUp"?(r.preventDefault(),o(s==null?1:s+1)):r.key==="ArrowDown"&&(r.preventDefault(),o(s==null?-1:s-1))),l&&l(r)},this.state={inputValue:this.formatInputValue(n.value)}}formatInputValue(n){if(n==null)return"";const r=this.props.format||"0,0";return mt(n).format(r)}parseInputValue(n){const r=this.props.format||"0,0";if(n==="")return null;let a=mt(n).value();if(a==null)return null;let s=null;if(r==="0"||r==="0,0")s=0;else{const o=r.match(/\.(0+)$/);if(o)s=o[1].length;else{const l=r.match(/\.\[(0+)\]$/);l&&(s=l[1].length)}}return s!=null&&(a=new kn(a).decimalPlaces(s).toNumber()),a}componentDidUpdate(){const{value:n}=this.props,r=this.parseInputValue(this.state.inputValue);n!=r&&this.setState({inputValue:this.formatInputValue(n)})}render(){const{props:n}=this,r=this.state,a=`number-input ${n.className||""}`;let s=e.createElement("input",{ref:n.inputRef,"data-testid":n.testid,type:"text",className:a,value:r.inputValue,onChange:this.onChange,onBlur:this.onBlur,onKeyDown:this.onKeyDown,disabled:n.disabled,placeholder:n.placeholder,...n.htmlAttributes});return n.grow&&(s=e.createElement(Qn,{className:a,value:r.inputValue,placeholder:n.placeholder?n.placeholder:"0"},s)),s}}const Jn=[],er=({disabled:t,disableAfter:n,disableBefore:r,inputClassName:a,inputRef:s,name:o,onBlur:l,onChange:c,onEnter:m,onFocus:E,placeholder:h,time:p,value:u})=>{const g=i.useRef(null),C=i.useRef(null),[d,w]=i.useState(null),[y,x]=i.useState(0),[T,A]=i.useState(p?pe(u):De(u)),[D,I]=i.useState(!1),[ge,j]=i.useState(!1),ne=f=>{w(f),s&&(s.current=f)};i.useEffect(()=>{d!==document.activeElement&&A(p?pe(u):De(u))},[d,u,p]);const $=f=>{c&&c(f)},R=f=>{A(p?pe(f):De(f)),$(f)},H=f=>{p&&(u?(f.setHours(u.getHours()),f.setMinutes(u.getMinutes())):(f.setHours(12),f.setMinutes(0)),f.setSeconds(0),f.setMilliseconds(0)),R(f),p||I(!1)},xe=f=>{const N=u?new Date(u.valueOf()):new Date;N.setHours(f),N.setSeconds(0),N.setMilliseconds(0),u||N.setMinutes(0),R(N)},Se=f=>{const N=u?new Date(u.valueOf()):new Date;N.setMinutes(f),N.setSeconds(0),N.setMilliseconds(0),T||N.setHours(12),R(N)},re=f=>{const{value:N}=f.target;A(N);const se=rr(N);se?(x(y+1),$(se)):$(null)},ae=f=>{f.preventDefault(),j(!0);const N=()=>{j(!1),document.body.removeEventListener("mouseup",N)};document.body.addEventListener("mouseup",N)},X=()=>{t||(D?I(!1):(d?.focus({preventScroll:!0}),I(!0)))},Z=f=>{switch(f.key){case"Enter":D?I(!1):m&&m();break;case"Escape":D&&(f.preventDefault(),f.stopPropagation(),I(!1));break}},k=f=>{A(p?pe(u):De(u)),ge||I(!1),l&&l(f)};i.useEffect(()=>{!p||!u||!D||(C.current?.querySelector(`[data-date-input-hour="${u.getHours()}"]`)?.scrollIntoView({block:"nearest"}),C.current?.querySelector(`[data-date-input-minute="${u.getMinutes()}"]`)?.scrollIntoView({block:"nearest"}))},[p,u,D]);const F=f=>{const N=[],se=f?.getHours();for(let P=0;P<24;P++){let U;if(At){let He=P%12;He===0&&(He=12),U=`${He} ${P<12?" am":" pm"}`}else U=P.toString().padStart(2,"0");N.push(e.createElement("div",{key:P,className:b({"date-input__time-btn":!0,"date-input__time-btn--selected":P===se}),onClick:()=>xe(P),"data-date-input-hour":P},U))}return N},O=f=>{const N=[],se=f?.getMinutes(),P=5;for(let U=0;U<60;U+=P)N.push(e.createElement("div",{key:U,className:b({"date-input__time-btn":!0,"date-input__time-btn--selected":U===se}),onClick:()=>Se(U),"data-date-input-minute":U},U.toString().padStart(2,"0")));return N};return e.createElement(e.Fragment,null,e.createElement("div",{ref:g,className:b({"input-group":!0,"input-group--disabled":!!t})},e.createElement("input",{type:"text",className:a,name:o,value:T,onChange:re,onFocus:E,onBlur:k,onKeyDown:Z,onMouseDown:()=>I(!0),placeholder:h,disabled:t,ref:ne}),e.createElement("div",{className:"input-group__append input-group__trigger",onClick:X,onMouseDown:ae},e.createElement(ee,{icon:p?nt:rn}))),D&&g.current?e.createElement(Pe,{target:g.current,onMouseDown:ae},e.createElement("div",{ref:C,className:"d-flex"},e.createElement(On,{selectedDays:u||Jn,initialMonth:u||void 0,onDayClick:H,key:y,disabledDays:[...r?[{before:r}]:[],...n?[{after:n}]:[]]}),p&&e.createElement("div",{className:"date-input__time"},e.createElement("div",{className:"date-input__time-caption"},"Time"),e.createElement("div",{className:"date-input__time-main-container"},e.createElement("div",{className:"date-input__time-scroll-container"},F(u)),e.createElement("div",{className:"date-input__time-scroll-container"},O(u))))),p&&e.createElement("div",{className:"date-input__time-footer"},e.createElement("small",null,`Time is set in your local timezone (${Intl.DateTimeFormat().resolvedOptions().timeZone.replace(/_/g," ")})`))):null)},tr=["yyyy-MM-dd","yyyy/MM/dd","MM-dd yyyy","MM/dd yyyy","MM-dd-yyyy","MM/dd/yyyy","MM-dd","MM/dd","dd MMM yyyy","dd MMMM yyyy","MMM dd yyyy","MMMM dd yyyy","dd MMM","dd MMMM","MMM dd","MMMM dd"],nr=["hh:mmaaa","hh.mmaaa","hh:mm aaa","hh.mm aaa","HH:mm","HH.mm","hhaaa","hh aaa","HH"],Ze=[];for(const t of tr){for(const n of nr)Ze.push(t+" "+n);Ze.push(t)}function rr(t){if(!t)return null;const n=t.replace(/[,]/g," ").replace(/\s{2,}/g," ").replace(/^[.:\s]+/g,"").replace(/[.:\s]+$/g,"");for(const r of Ze){const a=Tt(n,r,new Date);if(Mn(a))return a}return null}const Lt="d MMM yyyy";function De(t){return t==null?"":Ce(t,Lt)}function pe(t){if(t==null)return"";const n=At?t.getMinutes()===0?"h aaa":"h:mm aaa":"HH:mm";return Ce(t,Lt+", "+n)}function ar(t){return t==null?null:Ce(t,"yyyy-MM-dd")}function Mt(t){if(!t)return null;const n=Tt(t,"yyyy-MM-dd",new Date);return isNaN(n.valueOf())?null:n}function bt(t){if(!t)return null;const n=Ln(t);return isNaN(n.valueOf())?null:n}const At=Intl.DateTimeFormat(Intl.DateTimeFormat().resolvedOptions().locale,{hour:"numeric"}).resolvedOptions().hourCycle==="h12";function Ue(){const[t,n]=i.useState(!1),r=i.useRef(null),a=i.useCallback(()=>n(!0),[]),s=i.useCallback(()=>n(!1),[]),o=i.useCallback(()=>n(!0),[]),l=i.useCallback(()=>n(!1),[]);return{ref:r,hovered:t,eventHandlers:{onPointerEnter:a,onPointerLeave:s,onFocus:o,onBlur:l}}}const sr={prefix:"far",iconName:"custom-hand-pointer-slash",icon:[641,512,[],"???","M185.554191,59.5126699 C189.248662,26.0794907 217.382589,0 251.429,0 C287.979,0 317.715,30.056 317.715,67 L317.715,140.634 C338.128,137.776 359.183,144.576 374.31,160.263 C401.503,147.416 434.689,154.593 454.182,179.361 C497.375,162.727 544,195.156 544,242 L544,326 C544,330.296189 543.590626,334.580726 542.780274,338.796073 L495.999,302.221942 L495.999,242 C495.999,216.84 459.428,216.879 459.428,242 C459.428,250.836 452.265,258 443.428,258 L439.435556,258 L420.622383,243.291649 C420.588346,242.865584 420.571,242.434817 420.571,242 L420.571,221 C420.571,197.943344 389.858993,196.049429 384.724023,215.225903 L269.713,125.308981 L269.713,67 C269.713,41.84 233.142,41.88 233.142,67 L233.142,96.717359 L185.554191,59.5126699 Z M162.172457,223.995642 L233.142,279.479508 L233.142,308.493 C233.142,324.063 213.106,330.402 204.111,317.776 L176.985,279.697 C162.585,259.485 133.185,282.08 147.591,302.303 L257.303,456.303 C260.737,461.122 266.231,464 272,464 L450.285,464 C455.041109,464 459.427079,462.119816 462.713129,458.957818 L500.616335,488.590478 C488.331086,503.061811 470.146238,512 450.286,512 L272,512 C250.741,512 230.632,501.59 218.209,484.154 L108.51,330.153 C87.267,300.334 93.705,258.796 123.06,237.001 C134.952446,228.171597 148.664261,223.998532 162.172457,223.995642 Z M272.143,309.970422 L306.143,336.551563 L306.143,400 C306.143,408.837 299.875,416 292.143,416 L286.143,416 C278.41,416 272.143,408.837 272.143,400 L272.143,309.970422 Z M347.571,368.939901 L381.571,395.521042 L381.571,400 C381.571,408.837 375.303,416 367.571,416 L361.571,416 C353.839,416 347.571,408.837 347.571,400 L347.571,368.939901 Z M633.994211,471.020009 C640.904211,476.540009 642.014211,486.610009 636.494211,493.510009 L626.494211,506 C620.964211,512.890009 610.904211,514.010009 604.004211,508.490009 L6.00421069,40.9800088 C-0.895789309,35.4600088 -2.01578931,25.3900088 3.51421069,18.4900088 L13.5142107,6 C19.0342107,-0.899991212 29.1042107,-2.00999121 36.0042107,3.51000879 L633.994211,471.020009 Z"]},or={[L.ANNOUNCEMENT]:"announcement",[L.ASSISTANT]:"AI assistant",[L.BANNER]:"banner",[L.CHECKLIST]:"checklist",[L.FLOW]:"flow",[L.EMBED]:"embed",[L.LAUNCHER]:"launcher",[L.RESOURCE_CENTER]:"resource center",[L.TRACKER]:"event tracker"};function Rt(t,{title:n,plural:r}={}){let a=or[t];return n&&(a=Ae.upperFirst(a)),r&&(a+="s"),a}function wt(t){switch(t){case B.USER:return rt;case B.GROUP:return sn;case B.GROUP_MEMBERSHIP:return an;case B.EVENT:return yt}}function lr(t){const n=t.split("/");if(n.length===1)return[B.USER,t];switch(n[0]){case"group":return[B.GROUP,n[1]];case"group_membership":return[B.GROUP_MEMBERSHIP,n[1]];case"event":return[B.EVENT,n[1]]}return console.warn("parseAttributeDefinitionFqn: Invalid attribute definition FQN",t),[B.USER,t]}z.SECOND,z.MINUTE,z.HOUR,z.DAY;function Qe(t,n){switch(t){case z.DAY:return n===1?"day":"days";case z.HOUR:return n===1?"hour":"hours";case z.MINUTE:return n===1?"minute":"minutes";case z.SECOND:return n===1?"second":"seconds"}}le.BODY_FIRST,le.BODY_LAST,le.ELEMENT_FIRST,le.ELEMENT_LAST,le.ELEMENT_BEFORE,le.ELEMENT_AFTER;ie.BODY_FIRST,ie.BODY_LAST,ie.ELEMENT_FIRST,ie.ELEMENT_LAST,ie.ELEMENT_BEFORE,ie.ELEMENT_AFTER;We.START,We.CENTER,We.SPACE_BETWEEN;he.SILENT,he.BADGE,he.POPOUT,he.MODAL,he.TOAST;qe.NONE,qe.LIKE,qe.SCALE;dt.DAILY,dt.WEEKLY;$e.START,$e.CENTER,$e.SPACE_BETWEEN;e.createContext(null);const ir=e.createContext(null);function cr(){const t=i.useContext(ir);if(!t)throw new Error("useCompanyData: Data was not set");return t}function ur(){return cr().company}const dr={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"FlowForSelect"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Flow"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}}]},mr={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListFlowsForSelect"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"companyId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"types"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"FlowType"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"company"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"companyId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"flows"},arguments:[{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"Variable",name:{kind:"Name",value:"types"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"FlowForSelect"}}]}}]}}]}},...dr.definitions]};class Je extends e.PureComponent{constructor(n){super(n),this.rootRef=e.createRef(),this.optionsElRef=e.createRef(),this.input=null,this.popoverRef=e.createRef(),this.isMouseDown=!1,this.isCreateOpen=!1,this.setInput=r=>{this.input=r;const{inputRef:a}=this.props;a&&(typeof a=="function"?a(r):a.current=r)},this.onInputChange=r=>{r.stopPropagation();const{value:a}=r.target;a!==""&&this.openPopover();const s=this.memoizedFilterOptions(this.props.options,a);this.setState({inputValue:a,q:a,highlightedIndex:s.length>0?0:-1,createHighlighted:s.length===0}),a===""&&!this.props.noEmpty&&this.triggerOnChange(null),this.props.onSearchChange&&this.props.onSearchChange(a)},this.onPopoverPlacementChange=r=>this.setState({popoverPlacement:r}),this.onMouseDown=r=>{r.preventDefault(),this.isMouseDown=!0;const a=()=>{this.isMouseDown=!1,this.props.document?.removeEventListener("mouseup",a),document.body.removeEventListener("mouseup",a)};this.props.document?.addEventListener("mouseup",a),document.body.addEventListener("mouseup",a)},this.onFocus=r=>{this.input&&!this.props.noSearch&&this.input.select(),this.props.onFocus&&this.props.onFocus(r)},this.onBlur=r=>{this.isMouseDown||this.closePopover(),this.props.onBlur&&!this.isCreateOpen&&this.props.onBlur(r)},this.onTriggerClick=()=>{this.props.readOnly||this.props.disabled||(this.state.popoverOpen?this.closePopover():(this.input&&this.input.focus(),this.openPopover()))},this.onKeyDown=r=>{const{popoverOpen:a,highlightedIndex:s,createHighlighted:o}=this.state,l=this.getFilteredOptions(),c=l.length-1;switch(r.key){case"ArrowUp":r.preventDefault(),a&&(o?this.setState({highlightedIndex:c,createHighlighted:!1}):s>0&&this.setState({highlightedIndex:s-1}));break;case"ArrowDown":r.preventDefault(),a?this.props.onCreate&&(s===c||o)?this.setState({highlightedIndex:-1,createHighlighted:!0}):s<c&&this.setState({highlightedIndex:s+1}):this.props.noOpenOnDown||this.openPopover();break;case"Enter":if(a)if(r.preventDefault(),o)this.fireOnCreate();else{const m=l[s];(m||!this.props.noEmpty)&&this.selectOption(m)}else this.props.onEnter?this.props.onEnter():this.openPopover();break;case"Tab":a&&this.selectOption(l[s]);break;case"Escape":a&&(r.preventDefault(),r.stopPropagation(),this.setState({popoverOpen:!1}));break}},this.selectOption=r=>{r===this.props.value?this.setState({popoverOpen:!1,inputValue:this.renderOptionText(r),q:""}):(this.setState({popoverOpen:!1,inputValue:"",q:""}),this.triggerOnChange(r))},this.highlightOption=r=>{this.setState({highlightedIndex:r,createHighlighted:!1})},this.highlightCreate=()=>{this.setState({highlightedIndex:-1,createHighlighted:!0})},this.fireOnCreate=()=>{const{onCreate:r}=this.props;if(r){this.isCreateOpen=!0;const a={q:Ae.upperFirst(this.state.q),callback:s=>{this.isCreateOpen=!1,s!=null&&this.selectOption(s),this.input&&this.input.focus()}};r(a),this.closePopover()}},this.openPopover=()=>{if(!this.state.popoverOpen){const r=this.getFilteredOptions();let a=0,s=!1;if(r.length===0)a=-1,s=!0;else{const{value:o}=this.props,l=r.findIndex(c=>c===o);l!==-1&&(a=l)}this.setState({popoverOpen:!0,highlightedIndex:a,createHighlighted:s})}},this.memoizedFilterOptions=St((r,a)=>(r=r||[],a?r.filter(s=>this.filter(s,a)):r)),this.state={inputValue:this.renderOptionText(n.value==null?null:n.value),q:"",popoverOpen:!1,popoverPlacement:null,highlightedIndex:-1,createHighlighted:!1}}componentDidUpdate(n,r){const{value:a}=this.props;if(a!==n.value){const s=this.renderOptionText(a??null);s!==this.state.inputValue&&this.setState({inputValue:s})}r.highlightedIndex!==this.state.highlightedIndex&&this.scrollHighlightedOptionIntoView()}render(){let n;const{props:r}=this,a=this.state,s=a.popoverPlacement==="top"?"above":"below";if(a.popoverOpen&&this.rootRef.current){const l=this.getFilteredOptions();let c;if(l.length>0){let m=null;c=l.reduce((E,h,p)=>{const u=this.getOptionGroup(h);u&&u!==m&&E.push(e.createElement("div",{key:"group:"+u,className:"combo-box__group-header"},u)),m=u;const g=["combo-box__option"];return p===a.highlightedIndex&&g.push("combo-box__option--highlighted"),E.push(e.createElement(pr,{key:this.getOptionKey(h,p),className:g.join(" "),option:h,idx:p,renderOptionText:r.renderOptionText,renderOptionItem:r.renderOptionItem,getOptionIcon:r.getOptionIcon,onClick:this.selectOption,onHover:this.highlightOption})),r.hasSeparatorAfter&&r.hasSeparatorAfter(h)&&E.push(e.createElement("div",{key:"sep-"+p,className:"combo-box__option-sep"})),E},[])}else r.loading?c=e.createElement("div",{className:"combo-box__no-results"},"Loading..."):c=e.createElement("div",{className:"combo-box__no-results"},"No matching ",r.nounPlural||"items");n=e.createElement(Pe,{ref:this.popoverRef,className:"combo-box-popover"+(r.popoverNotch?"":` combo-box-popover--${s}`),noNotch:!r.popoverNotch,target:this.rootRef.current,forceDimension:!0,matchWidth:!0,minWidth:r.popoverMinWidth,onMouseDown:this.onMouseDown,onPlacementChange:this.onPopoverPlacementChange,document:r.document},e.createElement("div",{ref:this.optionsElRef,className:b({"combo-box__options":!0,"combo-box__options--with-create":!!r.onCreate})},c),r.onCreate&&e.createElement("div",{key:"create",className:b({"combo-box__option":!0,"combo-box__option--create":!0,"combo-box__option--highlighted":a.createHighlighted}),onClick:this.fireOnCreate,onMouseMove:this.highlightCreate},e.createElement("div",{className:"combo-box__create-icon"},e.createElement(ee,{icon:on})),e.createElement("div",{className:"combo-box__create-text"},"Create"," ",a.q===""?"new"+(r.noun?` ${r.noun}`:""):e.createElement("b",null,Ae.upperFirst(a.inputValue)))))}const o=["input-group","combo-box"];return a.popoverOpen&&(o.push("combo-box--open"),r.popoverNotch||o.push(`combo-box--with-popover-${s}`)),r.disabled&&o.push("input-group--disabled"),r.noSearch&&o.push("combo-box--no-search"),r.className&&o.push(r.className),e.createElement(e.Fragment,null,e.createElement("div",{className:o.join(" "),style:{width:r.width?r.width+"px":void 0},ref:this.rootRef,onClick:r.readOnly||r.disabled?void 0:()=>{this.input?.focus(),this.openPopover()}},r.childrenBefore,r.value&&r.getOptionIcon&&e.createElement("div",{className:"combobox__input-icon"},Ut(r.value,r.getOptionIcon)),e.createElement("input",{type:"text",className:r.inputClassName,name:r.name,value:a.inputValue,onChange:this.onInputChange,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onMouseDown:this.openPopover,placeholder:r.placeholder,readOnly:r.readOnly||r.noSearch,disabled:r.disabled,autoComplete:"off",ref:this.setInput,...r.inputHtmlAttributes}),!r.noTrigger&&e.createElement("div",{"data-testid":r.triggerTestId||"combo-box-trigger",className:"input-group__append input-group__trigger",onClick:this.onTriggerClick,onMouseDown:this.onMouseDown},e.createElement(ee,{icon:ln})),r.childrenAfter),n)}scrollHighlightedOptionIntoView(){const n=this.optionsElRef.current;if(this.state.popoverOpen&&n){const r=n.querySelector(".combo-box__option--highlighted");if(r){const a=n.getBoundingClientRect(),s=r.getBoundingClientRect();s.top<a.top?n.scrollTop+=s.top-a.top:s.bottom>a.bottom&&(n.scrollTop+=s.bottom-a.bottom)}}}triggerOnChange(n){const{onChange:r}=this.props;r&&r(n)}closePopover(){this.setState({popoverOpen:!1,inputValue:this.renderOptionText(this.props.value==null?null:this.props.value),q:""})}renderOptionText(n){return n==null?"":Pt(n,this.props.renderOptionText)}getFilteredOptions(){return this.memoizedFilterOptions(this.props.options,this.state.q)}filter(n,r){return this.props.filter?this.props.filter(n,r):this.renderOptionText(n).toLowerCase().includes(r.toLowerCase())}getOptionKey(n,r){return n&&n.id||r}getOptionGroup(n){return this.props.getOptionGroup?this.props.getOptionGroup(n):n&&n.group||null}}class pr extends e.PureComponent{constructor(){super(...arguments),this.state={isOptionDisabled:!1},this.onClick=()=>{this.state.isOptionDisabled||this.props.onClick(this.props.option)},this.onHover=()=>{this.state.isOptionDisabled||this.props.onHover(this.props.idx)}}componentDidMount(){const n=this.props.option!==void 0&&typeof this.props.option=="object"&&this.props.option!==null&&"disabled"in this.props.option&&this.props.option.disabled===!0;this.setState({isOptionDisabled:n})}componentDidUpdate(){const n=this.props.option!==void 0&&typeof this.props.option=="object"&&this.props.option!==null&&"disabled"in this.props.option&&this.props.option.disabled===!0;this.setState({isOptionDisabled:n})}render(){const{isOptionDisabled:n}=this.state,{props:r}=this;return e.createElement("div",{className:b({[r.className]:!0,"combo-box__option--disabled":n}),onClick:this.onClick,onMouseMove:this.onHover},fr(r.option,r.renderOptionText,r.renderOptionItem,r.getOptionIcon))}}function Pt(t,n){return n?n(t):typeof t=="string"||typeof t=="number"?t:t?t.name:"?"}function fr(t,n,r,a){if(r)return r(t);{let s=Pt(t,n);return a?e.createElement("div",{className:"d-flex align-flex-start"},e.createElement("div",{className:"combobox__option-icon"},Ut(t,a)),e.createElement("div",{className:"flex-1"},s)):s}}function Ut(t,n){const r=n(t);return gr(r)?e.createElement(ee,{icon:r}):r}function gr(t){return An(t)&&"iconName"in t}function hr(t){if(typeof t!="string"&&t.graphQLErrors){const n=[];if(t.graphQLErrors.forEach(r=>{r.message&&n.push(r.message)}),n.length>0)return n.join(`
|
|
3
3
|
`)}return console.error("Unknown Apollo error:",t),"Sorry, an error occurred. Please try again or contact us."}const Er=({icon:t,noIcon:n,type:r,label:a,plain:s,banner:o,className:l,children:c})=>(r=r||"info",e.createElement("div",{className:b({alert:!0,[`alert--${r}`]:!0,"alert--plain":!!s,"alert--banner":!!o,[l||""]:!!l})},!n&&e.createElement("div",{className:"alert__icon"},e.createElement(ee,{icon:t||vr(r)})),e.createElement("div",{className:"alert__content"},a&&e.createElement("span",{className:"alert__label"},a),c)));function vr(t){switch(t){case"info":return fe;case"success":return Q;case"warning":return un;case"danger":return cn}}const Vt=({error:t})=>e.createElement(Er,{type:"danger"},hr(t)),br=t=>{const{value:n}=t,{valueId:r,types:a,...s}=t,o=ur(),{loading:l,data:c,error:m}=Ft(mr,{variables:{companyId:o.id,types:a}}),E=c&&c.company&&c.company.flows||void 0,h=i.useMemo(()=>n||!E?n:E.find(p=>p.id===r),[E,n,r]);return m?e.createElement(Vt,{error:m}):r&&!E?e.createElement(Je,{placeholder:"Loading...",disabled:!0}):e.createElement(Je,{...s,value:h,loading:l,options:E,placeholder:a&&a.length===1?`Select ${Rt(a[0])}...`:"Select content...",triggerTestId:"flow-select-trigger"})},wr={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"FlowSlim"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Flow"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"type"}}]}}]},_r={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetFlowSlim"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"flowId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"flow"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"flowId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"FlowSlim"}}]}}]}},...wr.definitions]};i.createContext(null);const be=({condition:t,updateCondition:n,readOnly:r})=>e.createElement("input",{"data-testid":"condition-value",type:"text",value:t.value||"",placeholder:"Enter value",onChange:a=>n({value:a.target.value},{snapshotGroup:"condition:value:"+t.stateKey}),onKeyDown:a=>a.key==="Enter"&&n({open:!1},{clean:!0}),disabled:r}),et=({condition:t,updateCondition:n,readOnly:r,field:a})=>{const s=a||"value",o=t[s];return e.createElement(Ot,{value:o?parseFloat(o):null,format:"0,0.[000000]",placeholder:"Enter number",onChange:l=>n({[s]:l==null?null:String(l),[`${s}Validated`]:void 0},{snapshotGroup:`condition:${s}:${t.stateKey}`}),onKeyDown:l=>l.key==="Enter"&&n({open:!1},{clean:!0}),disabled:r})};function ye(t){return parseInt(t,10)}const yr=({condition:t,updateCondition:n,readOnly:r})=>{const a=t.attributeName==="event/flow_id"?L.FLOW:t.attributeName==="event/checklist_id"?L.CHECKLIST:t.attributeName==="event/launcher_id"?L.LAUNCHER:t.attributeName==="event/banner_id"?L.BANNER:void 0;return e.createElement(br,{valueId:t.value,onChange:s=>n({value:s==null?null:s.id}),onEnter:()=>n({open:!1},{clean:!0}),disabled:r,types:a?[a]:void 0})},G=t=>{const{condition:n}=t;return n.dataType===we.NUMBER?e.createElement(et,{...t}):n.dataType===we.FLOW?e.createElement(yr,{...t}):e.createElement(be,{...t})},Fe=t=>{const{condition:n,updateCondition:r}=t,[a,s]=i.useState(n.values||[]),o=l=>{s(l),r({values:l.filter(c=>c!=="")},{snapshotGroup:"condition:values:"+n.stateKey})};return e.createElement("div",{className:"mdv-8"},Ae.range(0,Math.max(2,a.length+1)).map(l=>e.createElement("div",{key:l,className:"input-group"},e.createElement("input",{type:"text",value:a[l]||"",placeholder:l===0?"Enter value":"Add another value",onChange:c=>{const m=[...a.slice(0,l),c.target.value,...a.slice(l+1)];for(;m.length>0&&m[m.length-1]==="";)m.pop();o(m)}}),l<a.length&&e.createElement("div",{className:"input-group__trigger input-group__append",onClick:()=>o([...a.slice(0,l),...a.slice(l+1)])},e.createElement(ee,{icon:dn})))))},Ge=({condition:t,updateCondition:n,readOnly:r})=>e.createElement(er,{value:Mt(t.value||null),placeholder:"Enter date",onChange:a=>n({value:ar(a)},{snapshotGroup:"condition:value:"+t.stateKey}),onEnter:()=>n({open:!1},{clean:!0}),disabled:r}),ze=({condition:t,updateCondition:n,readOnly:r})=>e.createElement("div",{className:"input-group"},e.createElement(Ot,{value:t.value?ye(t.value):null,placeholder:"Enter number",onChange:a=>n({value:a==null?null:String(a)},{snapshotGroup:"condition:value:"+t.stateKey}),onKeyDown:a=>a.key==="Enter"&&n({open:!1},{clean:!0}),disabled:r}),e.createElement("div",{className:"input-group__append"},"days ago")),S=t=>t.value?t.value.length>255?"Must not be longer than 255 characters":!0:"Please enter a value",Cr=t=>t.value2?t.value&&ye(t.value2)<ye(t.value)?"Second value must be greater than or equal to first value":!0:"Please enter a second value",Ie=t=>(t.values?.length||0)>0?!0:"Please enter at least 1 value",Ye=t=>{const n=S(t);if(n!==!0)return n;if(!t.value)return"Please enter a value";const r=ye(t.value);return isNaN(r)?"Invalid number":r<-1e4||r>1e4?"Cannot be greater than 10,000":!0},Ke={[_.ABSOLUTE_EQ]:{name:"on",nameSuffix:"a specific date",validate:S,diffText:t=>`on ${ue(t.value)}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"on")," ",e.createElement("span",{className:"nowrap text-bold"},ue(t.value))),Form:Ge},[_.ABSOLUTE_GT]:{name:"after",nameSuffix:"a specific date",validate:S,diffText:t=>`after ${ue(t.value)}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"after")," ",e.createElement("span",{className:"nowrap text-bold"},ue(t.value))),Form:Ge},[_.ABSOLUTE_LT]:{name:"before",nameSuffix:"a specific date",validate:S,diffText:t=>`before ${ue(t.value)}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"before")," ",e.createElement("span",{className:"nowrap text-bold"},ue(t.value))),Form:Ge},[_.AND]:{name:"and",diffText:()=>"and",Preview:ke("Preview"),Form:ke("Form")},[_.BETWEEN]:{name:"is between",nameSuffix:"... and ...",validate:t=>({value:S(t),value2:Cr(t)}),diffText:t=>`is between ${t.value} and ${t.value2}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"is between")," ",e.createElement("b",null,t.value)," ",e.createElement("span",{className:"text-secondary"},"and")," ",e.createElement("b",null,t.value2)),Form:t=>e.createElement(e.Fragment,null,e.createElement("div",{className:"d-flex mdh-8 align-center"},e.createElement(et,{...t}),e.createElement("div",null,"and"),e.createElement(et,{...t,field:"value2"})),e.createElement("div",{className:"text-secondary mt-8 text-sm"},"Both are included"))},[_.CONTAINS]:{name:"contains",nameSuffix:"...",validate:S,diffText:t=>`contains ${t.value||""}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"contains")," ",e.createElement("b",null,t.value)),Form:be},[_.EMPTY]:{name:"is empty",diffText:()=>"is empty",Preview:()=>e.createElement("span",{className:"text-secondary"},"is empty"),Form:null},[_.ENDS_WITH]:{name:"ends with",nameSuffix:"...",validate:S,diffText:t=>`ends with ${t.value||""}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"ends with")," ",e.createElement("b",null,t.value)),Form:be},[_.EQ]:{name:"is",nameSuffix:"...",validate:t=>t.dataType===we.RANDOM_AB?t.value&&["A","B"].includes(t.value)?!0:"Select A or B":S(t),diffText:t=>`is ${t.value||""}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"is")," ",e.createElement("b",null,t.dataType===we.FLOW&&t.value?e.createElement(_t,{id:t.value}):t.value)),Form:G},[_.EXCLUDES_ALL]:{name:"does not include all of",nameSuffix:"...",validate:Ie,diffText:t=>Oe(t,"does not include","all of"),Preview:({condition:t})=>Le(t,"does not include","all of"),Form:Fe},[_.EXCLUDES_ANY]:{name:"does not include at least one of",nameSuffix:"...",validate:Ie,diffText:t=>Oe(t,"does not include","at least one of"),Preview:({condition:t})=>Le(t,"does not include","at least one of"),Form:Fe},[_.FALSE]:{name:"is false",diffText:()=>"is false",Preview:()=>e.createElement("span",{className:"text-secondary"},"is false"),Form:null},[_.GT]:{name:"is greater than",nameSuffix:"...",validate:S,diffText:t=>`is greater than ${t.value}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"is greater than")," ",e.createElement("b",null,t.value)),Form:G},[_.GTE]:{name:"is greater than or equal to",nameSuffix:"...",validate:S,diffText:t=>`is greater than or equal to ${t.value}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"is greater than or equal to")," ",e.createElement("b",null,t.value)),Form:G},[_.INCLUDES_ALL]:{name:"includes all of",nameSuffix:"...",validate:Ie,diffText:t=>Oe(t,"includes","all of"),Preview:({condition:t})=>Le(t,"includes","all of"),Form:Fe},[_.INCLUDES_ANY]:{name:"includes at least one of",nameSuffix:"...",validate:Ie,diffText:t=>Oe(t,"includes","at least one of"),Preview:({condition:t})=>Le(t,"includes","at least one of"),Form:Fe},[_.LT]:{name:"is less than",nameSuffix:"...",validate:S,diffText:t=>`is less than ${t.value}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"is less than")," ",e.createElement("b",null,t.value)),Form:G},[_.LTE]:{name:"is less than or equal to",nameSuffix:"...",validate:S,diffText:t=>`is less than or equal to ${t.value}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"is less than or equal to")," ",e.createElement("b",null,t.value)),Form:G},[_.NE]:{name:"is not",nameSuffix:"...",validate:S,diffText:t=>`is not ${t.value||""}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"is not")," ",e.createElement("b",null,t.dataType===we.FLOW&&t.value?e.createElement(_t,{id:t.value}):t.value)),Form:G},[_.NOT_CONTAINS]:{name:"does not contain",nameSuffix:"...",validate:S,diffText:t=>`does not contain ${t.value||""}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"does not contain")," ",e.createElement("b",null,t.value)),Form:be},[_.NOT_EMPTY]:{name:"has any value",diffText:()=>"has any value",Preview:()=>e.createElement("span",{className:"text-secondary"},"has any value"),Form:null},[_.NOT_REGEX]:{name:"does not match regular expression",nameSuffix:"...",validate:S,diffText:t=>`does not match ${t.value||""}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"does not match")," ",e.createElement("b",null,t.value)),Form:G},[_.OR]:{name:"or",diffText:()=>"or",Preview:ke("Preview"),Form:ke("Form")},[_.REGEX]:{name:"matches regular expression",nameSuffix:"...",validate:S,diffText:t=>`matches ${t.value||""}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"matches")," ",e.createElement("b",null,t.value)),Form:G},[_.RELATIVE_EQ]:{name:"exactly",nameSuffix:"... days ago",validate:Ye,diffText:t=>`exactly ${ce(t.value)} ago`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"exactly")," ",e.createElement("span",{className:"nowrap text-bold"},ce(t.value))," ",e.createElement("span",{className:"text-secondary"},"ago")),Form:ze},[_.RELATIVE_GT]:{name:"less than",nameSuffix:"... days ago",validate:Ye,diffText:t=>`less than ${ce(t.value)} ago`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"less than")," ",e.createElement("span",{className:"nowrap text-bold"},ce(t.value))," ",e.createElement("span",{className:"text-secondary"},"ago")),Form:ze},[_.RELATIVE_LT]:{name:"more than",nameSuffix:"... days ago",validate:Ye,diffText:t=>`more than ${ce(t.value)} ago`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"more than")," ",e.createElement("span",{className:"nowrap text-bold"},ce(t.value))," ",e.createElement("span",{className:"text-secondary"},"ago")),Form:ze},[_.STARTS_WITH]:{name:"starts with",nameSuffix:"...",validate:S,diffText:t=>`starts with ${t.value||""}`,Preview:({condition:t})=>e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"starts with")," ",e.createElement("b",null,t.value)),Form:be},[_.TRUE]:{name:"is true",diffText:()=>"is true",Preview:()=>e.createElement("span",{className:"text-secondary"},"is true"),Form:null},[_.URL]:{name:"matches URL pattern",nameSuffix:"...",validate:t=>Zn(t.urlPattern),diffText:t=>{const{urlPattern:n}=t;if(!n)return"matches MISSING PATTERN";const{includes:r,excludes:a}=n,s=[];return r.length>0&&s.push("matches "+r.join(", ")),a.length>0&&s.push("does not match "+a.join(", ")),s.join(" and ")},Preview:({condition:t})=>{const{urlPattern:n}=t;if(!n)return e.createElement("span",{className:"text-secondary"},"matches ...");const{includes:r,excludes:a}=n;return e.createElement(e.Fragment,null,r.length>0&&e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"matches")," ",r.map((s,o)=>e.createElement(e.Fragment,{key:o},o>0&&e.createElement("span",{className:"text-secondary"},", "),e.createElement("b",null,s)))),r.length>0&&a.length>0&&e.createElement("span",{className:"text-secondary"}," and "),a.length>0&&e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},"does not match")," ",a.map((s,o)=>e.createElement(e.Fragment,{key:o},o>0&&e.createElement("span",{className:"text-secondary"},", "),e.createElement("b",null,s)))))},Form:null}};function ce(t){if(!t)return"days";const n=ye(t);return isNaN(n)?"days":n+" "+(n===1?"day":"days")}function ue(t){if(!t)return"";const n=Mt(t);return n?Ce(n,"PP"):""}const _t=({id:t})=>{const{data:n,error:r}=Ft(_r,{variables:{flowId:t}});if(r)return e.createElement(Vt,{error:r});const a=n?.flow;return e.createElement(e.Fragment,null,a?e.createElement(e.Fragment,null,e.createElement("span",null,t)," (",a.name,")"):"Loading...")};function ke(t){return({condition:n})=>{throw new Error(`conditionOperators.${n.operator}.${t} is not supported`)}}function Oe(t,n,r){const a=t.values||[];return n+(a.length>1?" "+r:"")+" "+a.join(", ")}function Le(t,n,r){const a=t.values||[];return e.createElement(e.Fragment,null,e.createElement("span",{className:"text-secondary"},n+(a.length>1?" "+r:""))," ",a.map((s,o)=>e.createElement(e.Fragment,{key:o},o>0&&e.createElement("span",{className:"text-secondary"},", "),e.createElement("b",{key:o},s))))}const Ht=i.createContext(void 0),W=()=>i.useContext(Ht),Bt=i.createContext(null),ot=()=>i.useContext(Bt),Wt=i.createContext({debuggerClientConditions:new Map,meta:void 0,buildId:void 0}),Ne=()=>i.useContext(Wt),Me={verifySetup:{name:"Verify setup",icon:Q},checkAutoStart:{name:"Check auto-start",icon:mn},currentUser:{name:"Current user",icon:rt}},qt=i.createContext(void 0),Nr=({children:t})=>{const n=te(),[r,a]=i.useState(n.getSessionStorageState().debuggerApp?.selectedTab??"verifySetup");return i.useEffect(()=>{n.setSessionStorageState(s=>!s.debuggerApp||!s.debuggerApp.x?s:{...s,debuggerApp:{...s.debuggerApp,selectedTab:r}}),tt("Debugger Route changed to",r)},[r]),e.createElement(qt.Provider,{value:{debuggerRoute:r,setDebuggerRoute:a}},t)},lt=()=>{const t=i.useContext(qt);if(t===void 0)throw new Error("useDebuggerRouteHandler must be used within a DebuggerRouteProvider");return{debuggerRoute:t.debuggerRoute,setDebuggerRoute:t.setDebuggerRoute}},xr=t=>{const n=i.useRef(null),r=ot();return i.useEffect(()=>{const a=r?.current,s=o=>{n.current&&!n.current.contains(o.target)&&t(o)};return document.addEventListener("mousedown",s),a?.contentDocument?.addEventListener("mousedown",s),()=>{document.removeEventListener("mousedown",s),a?.contentDocument?.removeEventListener("mousedown",s)}},[t,r,n]),n},Sr=()=>e.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M18.4393 5.56066C18.158 5.27936 18 4.89782 18 4.5C18 4.10218 18.158 3.72064 18.4393 3.43934C18.7206 3.15804 19.1022 3 19.5 3C19.8978 3 20.2794 3.15804 20.5607 3.43934C20.842 3.72064 21 4.10218 21 4.5C21 4.89782 20.842 5.27936 20.5607 5.56066C20.2794 5.84196 19.8978 6 19.5 6C19.1022 6 18.7206 5.84196 18.4393 5.56066Z",fill:"#537388"}),e.createElement("path",{d:"M3.43934 5.56066C3.15804 5.27936 3 4.89782 3 4.5C3 4.10218 3.15804 3.72064 3.43934 3.43934C3.72064 3.15804 4.10218 3 4.5 3C4.89782 3 5.27936 3.15804 5.56066 3.43934C5.84196 3.72064 6 4.10218 6 4.5C6 4.89782 5.84196 5.27936 5.56066 5.56066C5.27936 5.84196 4.89782 6 4.5 6C4.10218 6 3.72064 5.84196 3.43934 5.56066Z",fill:"#537388"}),e.createElement("path",{d:"M10.9393 13.0607C10.658 12.7794 10.5 12.3978 10.5 12C10.5 11.6022 10.658 11.2206 10.9393 10.9393C11.2206 10.658 11.6022 10.5 12 10.5C12.3978 10.5 12.7794 10.658 13.0607 10.9393C13.342 11.2206 13.5 11.6022 13.5 12C13.5 12.3978 13.342 12.7794 13.0607 13.0607C12.7794 13.342 12.3978 13.5 12 13.5C11.6022 13.5 11.2206 13.342 10.9393 13.0607Z",fill:"#537388"}),e.createElement("path",{d:"M3.43934 20.5607C3.15804 20.2794 3 19.8978 3 19.5C3 19.1022 3.15804 18.7206 3.43934 18.4393C3.72064 18.158 4.10218 18 4.5 18C4.89782 18 5.27936 18.158 5.56066 18.4393C5.84196 18.7206 6 19.1022 6 19.5C6 19.8978 5.84196 20.2794 5.56066 20.5607C5.27936 20.842 4.89782 21 4.5 21C4.10218 21 3.72064 20.842 3.43934 20.5607Z",fill:"#537388"}),e.createElement("path",{d:"M3.43934 13.0607C3.15804 12.7794 3 12.3978 3 12C3 11.6022 3.15804 11.2206 3.43934 10.9393C3.72064 10.658 4.10218 10.5 4.5 10.5C4.89782 10.5 5.27936 10.658 5.56066 10.9393C5.84196 11.2206 6 11.6022 6 12C6 12.3978 5.84196 12.7794 5.56066 13.0607C5.27936 13.342 4.89782 13.5 4.5 13.5C4.10218 13.5 3.72064 13.342 3.43934 13.0607Z",fill:"#537388"}),e.createElement("path",{d:"M10.9393 5.56066C10.658 5.27936 10.5 4.89782 10.5 4.5C10.5 4.10218 10.658 3.72064 10.9393 3.43934C11.2206 3.15804 11.6022 3 12 3C12.3978 3 12.7794 3.15804 13.0607 3.43934C13.342 3.72064 13.5 4.10218 13.5 4.5C13.5 4.89782 13.342 5.27936 13.0607 5.56066C12.7794 5.84196 12.3978 6 12 6C11.6022 6 11.2206 5.84196 10.9393 5.56066Z",fill:"#537388"})),Tr={CLICK:Ct,DISABLED:K,MOUSEDOWN:pn,NOT_CLICK:sr,NOT_DISABLED:Q,NOT_PRESENT:Nt,PRESENT:at},Dr={COMPLETED:Q,NOT_COMPLETED:K,NOT_SEEN:Nt,ACTIVE:fn,NOT_ACTIVE:gn,SEEN:at},Fr={CLICK:"is clicked",DISABLED:"is disabled",MOUSEDOWN:"has mouse down on it",NOT_CLICK:"is not clicked",NOT_DISABLED:"is not disabled",NOT_PRESENT:"is not present",PRESENT:"is present"};function Ir(t){return Fr[t]}const kr={COMPLETED:"completed",NOT_COMPLETED:"not completed",NOT_SEEN:"not seen",ACTIVE:"is currently active",NOT_ACTIVE:"is not currently active",SEEN:"seen"};function Or(t){return kr[t]}function Lr(t,n){let r=(n||"").toLowerCase();return(t.eventTimeOperator===de.RELATIVE_BETWEEN?t.eventRelativeValue2:t.eventRelativeValue)!==1&&(r+="s"),t.eventTimeOperator!==de.RELATIVE_GT&&(r+=" ago"),r}function Mr(t){return(t.eventFrequencyOperator===ve.BETWEEN?t.eventFrequencyValue2:t.eventFrequencyValue)===1?"time":"times"}const Ar={CURRENT_USER:"by current user in any company",CURRENT_USER_CURRENT_GROUP:"by current user in current company",CURRENT_GROUP:"by any user in current company"};function Rr(t){return Ar[t]}function Pr(t){if(!t)return"";switch(t){case ve.BETWEEN:return"between";case ve.EQ:return"exactly";case ve.GTE:return"at least";case ve.LTE:return"at most"}}function Ur(t){if(!t)return"";switch(t){case de.ANY:return"at any point in time";case de.RELATIVE_BETWEEN:return"between";case de.RELATIVE_GT:return"in the last";case de.RELATIVE_LT:return"more than"}}const Vr={1:"Lowest",2:"Low",3:"Medium",4:"High",5:"Highest"};function Hr(t){return`${Vr[t]||String(t)} priority`}const it=t=>({"d-flex align-center":!0,"userflow-debugger-condition__item":!0,"userflow-debugger-condition__item__success":t===!0,"userflow-debugger-condition__item__danger":t===!1,"userflow-debugger-condition__item__intermediate":t===null}),ct=t=>t===!0?Y:t===!1?K:J,$t=(t,n)=>{const r=W();return i.useMemo(()=>{const o=(n?r?.hiddenCondition?.breakdown:r?.startCondition?.breakdown)?.find(l=>l.conditionId===t.id);return{classes:it(o?.match),icon:ct(o?.match)}},[t,r,n])},Re=t=>{const{condition:n,isHideCond:r}=t,{classes:a,icon:s}=$t(n,r),o=n.type;if(o===M.CLAUSE)return e.createElement(Wr,{...t});const l=zt[o];return e.createElement("div",{className:b(a)},e.createElement("span",{className:"d-flex gap-8 align-center userflow-debugger-condition__item__icon"},l.icon?e.createElement(v,{icon:l.icon({condition:n})}):null,e.createElement(l.Preview,{...t})),e.createElement(v,{dataAttrs:{"data-condition-status":"true"},icon:s}))},Br=()=>{const t=W(),[n,r]=i.useState(!1),a=i.useMemo(()=>t?.hiddenCondition?.breakdown.find(o=>o.conditionId===t?.hiddenCondition?.condition.id),[t?.hiddenCondition]);return t?.hiddenCondition?.condition?e.createElement("div",{role:"button",className:b({"d-flex gap-8 flex-column margin-8":!0,"userflow-debugger-condition__clause":!0,"userflow-debugger-hide-condition__clause__success":a?.match===!0,"userflow-debugger-hide-condition__clause__danger":a?.match===!1,"userflow-debugger-hide-condition__clause__expanded":n}),onClick:s=>{r(!n),s.stopPropagation()}},e.createElement("div",{className:"d-flex gap-8 justify-space-between align-center"},e.createElement("span",null,"Termporarily hide flow"," ",e.createElement("span",{className:"userflow-debugger-info-text"},"Click to ",n?"collapse":"expand")),e.createElement(v,{icon:fe})),n&&e.createElement(Re,{isRoot:!0,isHideCond:!0,condition:t?.hiddenCondition?.condition})):null},Wr=({condition:t,isRoot:n=!1,isHideCond:r=!1})=>{const[a,s]=i.useState(!1),{classes:o,icon:l}=$t(t,r);return n?e.createElement(e.Fragment,null,t.conditions.map((c,m)=>e.createElement(Re,{isHideCond:r,key:m,condition:c}))):e.createElement("div",{role:"button",className:b({"d-flex flex-column gap-8":!0,"userflow-debugger-condition__clause":a,...a?{"userflow-debugger-condition__item__success__expanded":o["userflow-debugger-condition__item__success"],"userflow-debugger-condition__item__danger__expanded":o["userflow-debugger-condition__item__danger"],"userflow-debugger-condition__item__intermediate__expanded":o["userflow-debugger-condition__item__intermediate"]}:o}),onClick:c=>{s(!a),c.stopPropagation()}},e.createElement("div",{className:"d-flex justify-space-between align-center w-full"},e.createElement("span",{className:"d-flex gap-8 align-center"},e.createElement(v,{icon:Cn})," ",e.createElement("strong",null,"Logic Group")," ",e.createElement("span",{className:"userflow-debugger-info-text"},"Click to ",a?"collapse":"expand")),!a&&e.createElement(v,{dataAttrs:{"data-condition-status":"true"},icon:l})),a&&e.createElement(e.Fragment,null,t.conditions.map((c,m)=>e.createElement("div",{key:m,className:b({"userflow-debugger-condition__clause__operator__wrapper":!0})},m>0&&e.createElement("div",{className:b({"userflow-debugger-condition__clause__operator":!0})},e.createElement(Gt,{condition:t})),e.createElement(Re,{isHideCond:r,condition:c})))))},Gt=({condition:t})=>{const n=t.operator;return n?e.createElement("span",{className:b({"userflow-debugger-condition__item__operator":!0,"userflow-debugger-condition__item__operator__and":n===Ee.AND,"userflow-debugger-condition__item__operator__or":n===Ee.OR})},n===Ee.AND&&"AND",n===Ee.OR&&"OR"):null},qr={[q.NONE]:K,[q.PENDING_SCHEDULE]:K,[q.SCHEDULED]:J,[q.FIRED]:Y},$r=e.memo(()=>{const t=W(),{waitTimer:n}=t||{},r=t?.startCondition?.condition.waitTime,{ref:a,hovered:s,eventHandlers:o}=Ue();return!r||!n||n===q.NONE?null:e.createElement("div",{ref:a,...o,className:b({"d-flex align-center":!0,"userflow-debugger-condition__item":!0,"userflow-debugger-condition__item__danger":n===q.PENDING_SCHEDULE,"userflow-debugger-condition__item__intermediate":n===q.SCHEDULED,"userflow-debugger-condition__item__success":n===q.FIRED})},e.createElement("span",{className:"d-flex gap-8 align-center"},e.createElement(v,{icon:hn}),e.createElement("span",null,"Wait ",e.createElement("strong",null,r)," seconds")),e.createElement(v,{dataAttrs:{"data-condition-status":"true"},icon:qr[n]}),e.createElement(Ve,{target:a,hovered:s&&n===q.PENDING_SCHEDULE},"Timer activates once all conditions are satisfied"))}),Gr=e.memo(()=>{const t=W(),[n,r]=i.useState(!1),{startFrequency:a,listFlowLatestVersion:s}=t||{startFrequency:{}};if(!a||!s?.startFrequency||s?.startFrequency===oe.NEVER)return null;const{currentFlowIntervalThrottle:o,frequency:l,frequencyUsage:c}=a,m=ct(l),E=it(l);if(s.startFrequency===oe.ONCE||s.startFrequency===oe.ONCE_PER_GROUP)return e.createElement("div",{className:b(E)},e.createElement("span",{className:"d-flex gap-8 align-center"},e.createElement(v,{icon:nt}),e.createElement("strong",null,"Once per user"," ",s.startFrequency===oe.ONCE_PER_GROUP&&"per company")),e.createElement(v,{dataAttrs:{"data-condition-status":"true"},icon:m}));if(s.startFrequency===oe.ALWAYS&&s.startIntervalValue&&s.startIntervalUnit)return e.createElement("div",{className:b({"d-flex align-center":!0,"userflow-debugger-condition__item":!0,"userflow-debugger-condition__item__success":o===!0,"userflow-debugger-condition__item__intermediate":o===!1})},e.createElement("span",null,"Every ",e.createElement("strong",null,s.startIntervalValue)," ",e.createElement("span",{className:"userflow-debugger-info-text"},Qe(s.startIntervalUnit,s.startIntervalValue)," ","apart")),e.createElement(v,{dataAttrs:{"data-condition-status":"true"},icon:o===!1?J:Y}));if(s.startFrequency===oe.MULTIPLE){const h=l===!0&&o===!0,p=l===!0&&o===!1,u=l===!1;return e.createElement("div",{className:b({"d-flex flex-column gap-8":!0,"userflow-debugger-condition__item":!0,"userflow-debugger-condition__clause":n,...n?{"userflow-debugger-condition-frequency__success__expanded":h,"userflow-debugger-condition-frequency__intermediate__expanded":p,"userflow-debugger-condition-frequency__danger__expanded":u}:{"userflow-debugger-condition-frequency__success":h,"userflow-debugger-condition-frequency__intermediate":p,"userflow-debugger-condition-frequency__danger":u}}),onClick:g=>{r(!n),g.stopPropagation()}},e.createElement("div",{className:"d-flex gap-8 justify-space-between"},e.createElement("div",{className:"d-flex gap-8 align-center"},e.createElement("strong",null,"Start multiple times")," ",e.createElement("span",{className:"userflow-debugger-info-text"},"Click to expand")),!n&&e.createElement(v,{dataAttrs:{"data-condition-status":"true"},icon:h?Y:p?J:K})),n&&e.createElement(e.Fragment,null,e.createElement("div",{className:b(E)},e.createElement("span",null,e.createElement("strong",null,s.startLimit)," ",e.createElement("span",{className:"userflow-debugger-info-text"},"(started ",c," times)")),e.createElement(v,{dataAttrs:{"data-condition-status":"true"},icon:m})),s.startIntervalUnit&&s.startIntervalValue&&e.createElement("div",{className:b({"d-flex align-center":!0,"userflow-debugger-condition__item":!0,"userflow-debugger-condition__item__success":o===!0,"userflow-debugger-condition__item__intermediate":o===!1})},e.createElement("span",null,e.createElement("strong",null,s.startIntervalValue)," ",e.createElement("span",{className:"userflow-debugger-info-text"},Qe(s.startIntervalUnit,s.startIntervalValue)," ","apart")),e.createElement(v,{dataAttrs:{"data-condition-status":"true"},icon:o===!1?J:Y}))))}return null}),zr=()=>{const t=W(),{priority:n}=t||{};return n?.priority?e.createElement("div",{className:b({"d-flex align-center":!0,"userflow-debugger-condition__item":!0,"userflow-debugger-condition__item__priority":!0})},e.createElement("span",null,e.createElement("strong",null,Hr(n?.priority))," ",e.createElement("span",{className:"userflow-debugger-info-text"},"Click to learn more")),e.createElement("a",{href:"https://docs.userflow.com/docs/trouble/debugger#start-flow-conditions-priority-settings",target:"_blank",rel:"noreferrer noopener"},e.createElement(v,{icon:xt}))):null},Yr=()=>{const t=W(),{startFrequency:n}=t||{},{onlyIfNotCompleted:r}=n||{};return r==null?null:e.createElement("div",{className:b({"d-flex align-center":!0,"userflow-debugger-condition__item":!0,"userflow-debugger-condition__item__success":r===!0,"userflow-debugger-condition__item__danger":r===!1})},"Only if not completed",e.createElement(v,{icon:r===!0?Y:K}))},Kr=()=>{const t=W(),{startFrequency:n}=t||{},{hovered:r,eventHandlers:a,ref:s}=Ue();return!n||n?.scopeByGroup===null||n.scopeByGroup===void 0||n.scopeByGroup===!0?null:e.createElement("div",{ref:s,...a,className:b({"d-flex align-center margin-8":!0,"userflow-debugger-condition__item":!0,"userflow-debugger-condition__item__danger":!0})},"Constrain to current company",e.createElement(v,{icon:ct(n.scopeByGroup)}),e.createElement(Ve,{target:s,hovered:r},"User is not associated with a company"))},jr=()=>{const t=W(),{startFrequency:n,listFlowLatestVersion:r}=t||{},{anyFlowIntervalThrottle:a}=n||{},{throttleUnit:s,throttleValue:o}=r||{};return a===null||s===null||o===null||s===void 0||o===void 0?null:e.createElement("div",{className:b({"d-flex align-center":!0,"userflow-debugger-condition__item":!0,"userflow-debugger-condition__item__success":a===!0,"userflow-debugger-condition__item__intermediate":a===!1})},e.createElement("span",null,"Atleast ",e.createElement("strong",null,r?.throttleValue)," ",Qe(s,o)," after any flow"),e.createElement(v,{dataAttrs:{"data-condition-status":"true"},icon:a===!0?Y:J}))},Xr=e.memo(()=>{const{hovered:t,eventHandlers:n,ref:r}=Ue(),a=W(),{snoozed:s}=a||{},o=i.useMemo(()=>{if(s?.until)return Ce(new Date(s.until),"MMM do, h:mm a")},[s?.until]);return s?e.createElement("div",{ref:r,...n,className:b({"d-flex align-center margin-8":!0,"userflow-debugger-condition__item":!0,"userflow-debugger-condition__item__intermediate":!0})},e.createElement("span",{className:"d-flex gap-8 align-center"},e.createElement(v,{icon:En}),e.createElement("span",null,"This flow is currently ",e.createElement("strong",null,"snoozed"))),e.createElement(v,{dataAttrs:{"data-condition-status":"true"},icon:J}),e.createElement(Ve,{target:r,hovered:t},"Snoozed until ",o)):null}),zt={[M.PAGE]:{icon:()=>vn,Preview:({condition:t})=>{const n=t.operator&&Ke[t.operator];return e.createElement("span",null,"URL"," ",e.createElement("strong",null,n&&e.createElement(n.Preview,{condition:t})))}},[M.ATTRIBUTE]:{icon:({condition:t})=>{if(!t||!t.attributeName)return wt(B.EVENT);const[n]=lr(t.attributeName);return wt(n)},Preview:({condition:t})=>{const n=t.operator&&Ke[t.operator];return e.createElement("span",null,e.createElement("strong",null,t.attributeDisplayName?t.attributeDisplayName:"Attribute")," ",e.createElement("span",{className:"userflow-debugger-info-text"},n&&e.createElement(n.Preview,{condition:t})))}},[M.SEGMENT]:{icon:()=>bn,Preview:({condition:t})=>{const{segment:n}=t;return e.createElement("span",null,e.createElement("strong",null,n?.subjectType===jt.GROUP?"Company":"User")," ",e.createElement("span",{className:"text-secondary"},t.operator===Ee.FALSE?"is not in":"is in")," ",e.createElement("strong",null,n?.name||"Segment"))}},[M.ELEMENT]:{icon:({condition:t})=>t.elementState?Tr[t.elementState]:wn,Preview:({condition:t})=>e.createElement("span",null,"Element"," ",t.elementState&&e.createElement("strong",null,Ir(t.elementState)))},[M.INPUT_VALUE]:{icon:()=>_n,Preview:({condition:t})=>{const n=t.operator&&Ke[t.operator];return e.createElement("span",null,"The value of input"," ",e.createElement("strong",null,n&&e.createElement(n.Preview,{condition:t})))}},[M.FILLED_IN_INPUT]:{icon:()=>yn,Preview:()=>e.createElement("span",null,"User fills an input")},[M.FLOW]:{icon:({condition:t})=>t.flowState?Dr[t.flowState]:at,Preview:({condition:t})=>e.createElement("span",null,t.flow?e.createElement(e.Fragment,null,Rt(t.flow.type,{title:!0})," ",e.createElement("strong",null,t.flow.name)):"Flow/checklist"," ",t.flowState&&Or(t.flowState))},[M.TIME]:{icon:()=>nt,Preview:({condition:t})=>{const n=t.value?bt(t.value):null,r=n&&e.createElement("strong",{style:{whiteSpace:"nowrap"}},pe(n)),a=t.value2?bt(t.value2):null,s=a&&e.createElement("strong",{style:{whiteSpace:"nowrap"}},pe(a));return r&&s?e.createElement("span",null,"Current time is between ",r," and ",s):r?e.createElement(e.Fragment,null,"Current time is after ",r):s?e.createElement(e.Fragment,null,"Current time is before ",s):e.createElement(e.Fragment,null,"Current time is ...")}},[M.EVENT]:{icon:()=>yt,Preview:({condition:t})=>{const{ref:n,hovered:r,eventHandlers:a}=Ue();return e.createElement("div",{ref:n,...a},e.createElement("strong",null,t.eventDisplayName?t.eventDisplayName:"Event")," ",e.createElement("span",{className:"userflow-debugger-info-text"},Pr(t.eventFrequencyOperator))," ",e.createElement("strong",null,t.eventFrequencyValue),t.eventFrequencyOperator===Xt.BETWEEN&&e.createElement(e.Fragment,null," ",e.createElement("span",{className:"userflow-debugger-info-text"},"and")," ",e.createElement("strong",null,t.eventFrequencyValue2))," ",e.createElement("span",{className:"userflow-debugger-info-text"},Mr(t),","," ",Ur(t.eventTimeOperator)),t.eventTimeOperator!==ut.ANY&&e.createElement(e.Fragment,null," ",e.createElement("strong",null,t.eventRelativeValue),t.eventTimeOperator===ut.RELATIVE_BETWEEN&&e.createElement(e.Fragment,null," ",e.createElement("span",{className:"userflow-debugger-info-text"},"and")," ",e.createElement("strong",null,t.eventRelativeValue2))," ",e.createElement("span",{className:"userflow-debugger-info-text"},Lr(t,t.eventRelativeUnit))),t.eventActor&&t.eventActor!==Zt.CURRENT_USER?e.createElement(e.Fragment,null," ",e.createElement("strong",null,Rr(t.eventActor))):"",t.whereCondition&&r&&e.createElement(Ve,{hovered:!0,target:n},"Where ",e.createElement("br",null),e.createElement(Yt,{condition:t.whereCondition})))}},[M.ALWAYS_TRUE]:{icon:()=>Y,Preview:()=>e.createElement("span",null,"Water is wet")},[M.CHECKLIST_TASK_CLICKED]:{icon:()=>Ct,Preview:()=>e.createElement("span",null,"Task is clicked")}},Yt=t=>e.createElement("div",null,t.condition.conditions.map((n,r)=>e.createElement("div",{key:n.id}," ",r===0?null:e.createElement("span",{className:"userflow-debugger-info-text"},t.condition.operator?.toLowerCase())," ",n.type==="ATTRIBUTE"&&zt.ATTRIBUTE.Preview({condition:n,isRoot:!0,isHideCond:!1}),n.type==="CLAUSE"&&e.createElement(e.Fragment,null,"(",e.createElement(Yt,{condition:n}),")")))),Ve=({hovered:t,children:n,target:r})=>{const a=ot();return t?e.createElement(Pe,{className:"userflow-debugger-popover",target:r.current,placement:"top",horizontalAlign:"center",verticalAlign:"center",document:a?.current?.contentDocument||void 0},n):null},Zr=({selectedFlow:t,setSelectedFlow:n,flows:r,debugAutoStartCondition:a})=>{const s=te(),o=ot();i.useEffect(()=>{if(!t)return;a(t.latestVersion);const c=()=>{a(t.latestVersion)};return s.on("private:checkSessionsAck",c),document.addEventListener("visibilitychange",c),()=>{s.off("private:checkSessionsAck",c),document.removeEventListener("visibilitychange",c)}},[t]);const l=i.useCallback(c=>{!c||t?.latestVersion?.id===c.latestVersion.id||n(c)},[t]);return e.createElement(e.Fragment,null,e.createElement("div",{className:"d-flex align-center justify-space-between"},e.createElement("div",{className:"d-flex justify-space-between align-center"},"Select Flow"),e.createElement(Je,{className:"userflow-debugger__flow__selector",value:t,options:r,placeholder:"Select flow",document:o?.current?.contentDocument||void 0,onChange:l,renderOptionItem:c=>c.name})),e.createElement(Qr,{selectedFlow:t,selectedFlowVersionsId:t?.latestVersion?.id}))},Qr=({selectedFlowVersionsId:t,selectedFlow:n})=>{const r=te(),[a,s]=i.useState(!1),o=W(),l=o?.activeFlow?.id===n?.id;return i.useEffect(()=>(s(!1),r.on("private:setFlowSession",c=>{s(c===t)}),()=>{r.off("private:setFlowSession",()=>s(!1))}),[t]),i.useEffect(()=>{l||s(!1)},[l]),o?.activeFlow===null?null:e.createElement(e.Fragment,null,o?.locale?.match===!1&&e.createElement("div",{className:b(it(!1))},e.createElement("span",{className:"d-flex gap-8 align-center"},e.createElement(v,{icon:K}),e.createElement("span",null,"The flow will not auto start ",e.createElement("br",null)," ",e.createElement("b",null,"User locale (",o?.locale?.code,") is not enabled.")))),a?e.createElement("div",{className:b({"d-flex align-center fade-in":!0,"userflow-debugger-condition__item":!0,"userflow-debugger-condition__flow__status":!0})},e.createElement("span",{className:"d-flex align-center gap-8"},e.createElement(v,{icon:fe}),e.createElement("span",null,"This flow ",e.createElement("strong",null,"just")," started"))):null,l&&!a&&e.createElement("div",{className:b({"userflow-debugger-condition__item":!0,"userflow-debugger-condition__flow__status":!0})},e.createElement("span",{className:"d-flex align-center gap-8"},e.createElement(v,{icon:fe}),e.createElement("span",null,"This flow is currently active"))),!l&&e.createElement("div",{className:b({"userflow-debugger-condition__item":!0,"userflow-debugger-condition__flow__status":!0})},e.createElement("span",{className:"d-flex gap-8 align-center"},e.createElement(v,{icon:fe,size:16}),e.createElement("span",null,"Another flow is currently active"))))},Jr=({close:t})=>{const n=te(),r=i.useRef(null),[a,s]=i.useState(()=>{const d=n.getSessionStorageState(),w=d?.debuggerApp?.x,y=d?.debuggerApp?.y||100;return{x:w??(document.body.clientWidth?Number(document.body.clientWidth)-500:100),y}}),[o,l]=i.useState(!1),c=i.useRef(null),{meta:m}=Ne(),{debuggerRoute:E}=lt(),[h,p]=i.useState(!1),u=i.useRef(null),g=i.useRef({mouseX:0,mouseY:0,elementX:0,elementY:0});i.useEffect(()=>{a&&n.setSessionStorageState(d=>({...d,debuggerApp:{...d.debuggerApp,x:a.x,y:a.y}}))},[a]),i.useEffect(()=>{if(!o)return;const d=y=>{const x=y.clientX-g.current.mouseX,T=y.clientY-g.current.mouseY,A=g.current.elementX+x,D=g.current.elementY+T;u.current||(u.current=requestAnimationFrame(()=>{s({x:A,y:D}),u.current=null}))},w=()=>{l(!1)};return document.addEventListener("mousemove",d),document.addEventListener("mouseup",w),()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",w),u.current&&(cancelAnimationFrame(u.current),u.current=null)}},[o,a]),i.useEffect(()=>{const d=()=>{s(w=>{const y=document.body.clientWidth-500,x=document.body.clientHeight-100,T=Math.min(w.x,y),A=Math.min(w.y,x);return{x:T,y:A}})};return window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}},[]);const C=d=>{r.current&&(l(!0),d.preventDefault())};return e.createElement("div",{ref:r,style:{left:"0",top:"0",position:"absolute",transform:`translate3d(${a.x}px, ${a.y}px, 0)`,zIndex:1234620}},e.createElement("div",{onMouseDown:C,style:{height:"50px",cursor:"move",userSelect:"none",position:"absolute",width:"50px"}}),e.createElement(en,{title:"Debugger",stylesheet:Rn,style:{borderRadius:"8px",width:"400px",height:E==="checkAutoStart"?"600px":"500px"},elRef:c,onStylesheetsLoad:p},e.createElement(Bt.Provider,{value:c},e.createElement("div",{className:"d-flex flex-column userflow-debugger-app",style:{visibility:h?"visible":"hidden"}},e.createElement("div",{className:"d-flex justify-space-between userflow-debugger-app__header"},e.createElement(Sr,null),e.createElement("div",{className:"d-flex align-center userflow-debugger-app__title"},e.createElement(tn,null),e.createElement("span",null,"Userflow debugger")),e.createElement("button",{role:"button",className:"userflow-debugger-app__close",onClick:()=>{n.getSessionStorageState().debuggerApp&&n.setSessionStorageState(d=>({...d,debuggerApp:null})),t()}},e.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M12.1836 4.49609L8.90234 7.77734L12.1562 11.0312C12.4297 11.2773 12.4297 11.6875 12.1562 11.9336C11.9102 12.207 11.5 12.207 11.2539 11.9336L7.97266 8.67969L4.71875 11.9336C4.47266 12.207 4.0625 12.207 3.81641 11.9336C3.54297 11.6875 3.54297 11.2773 3.81641 11.0039L7.07031 7.75L3.81641 4.49609C3.54297 4.25 3.54297 3.83984 3.81641 3.56641C4.0625 3.32031 4.47266 3.32031 4.74609 3.56641L8 6.84766L11.2539 3.59375C11.5 3.32031 11.9102 3.32031 12.1836 3.59375C12.4297 3.83984 12.4297 4.25 12.1836 4.49609Z",fill:"white"})))),e.createElement(ea,null),E==="verifySetup"&&e.createElement(ta,null),m?.endUser?.debuggerEnabled&&E==="checkAutoStart"&&e.createElement(na,null),E==="currentUser"&&e.createElement(ra,null)))))},ea=()=>{const t=te(),{meta:n}=Ne(),[r,a]=i.useState(!1),{debuggerRoute:s,setDebuggerRoute:o}=lt(),l=t.isIdentified(),c=xr(()=>a(!1));return i.useEffect(()=>{n&&n?.endUser.debuggerEnabled===!1&&s==="checkAutoStart"&&o("verifySetup")},[n]),l?e.createElement("div",{ref:c},e.createElement("div",{className:"d-flex align-center justify-space-between userflow-debugger-menu",onClick:()=>a(!r)},e.createElement("div",{className:b({"d-flex align-center":!0,"userflow-debugger-menu__title":!0,"userflow-debugger-menu__title--open":r})},e.createElement(v,{icon:Me[s].icon}),e.createElement("span",null,Me[s].name)),e.createElement("button",{className:"userflow-debugger-menu__toggle"},e.createElement(v,{icon:Nn}))),r&&e.createElement("ul",{className:"userflow-debugger-menu__list"},Object.keys(Me).map(m=>{if(!n?.endUser?.debuggerEnabled&&m==="checkAutoStart")return null;const E=Me[m];return e.createElement("li",{key:m,className:"d-flex align-center userflow-debugger-app__item",onClick:()=>{o&&o(m),a(!1)}},e.createElement(v,{icon:E.icon}),E.name)}))):null},ta=()=>{const{meta:t,buildId:n}=Ne(),r=te(),[a,s]=i.useState(!!r.clientToken),o=i.useMemo(()=>t?r.isIdentified():!1,[r,t]),{setDebuggerRoute:l}=lt();i.useEffect(()=>{const h=()=>{s(!!r.clientToken)};return r.on("private:initialised",h),()=>{r.off("private:initialised",h)}},[]);const c=i.useMemo(()=>{let h=Be;const p={"d-flex flex-column gap-8":!0,"userflow-debugger-installation__step":!0};return a?(h=Q,p["userflow-debugger-installation__step__success"]=!0):(h=Dn,p["userflow-debugger-installation__step__danger"]=!0),{icon:h,classes:p}},[a]),m=i.useMemo(()=>{let h=Be;const p={"d-flex flex-column gap-8":!0,"userflow-debugger-installation__step":!0};return!a&&!o&&(h=Be,p["userflow-debugger-installation__step__failed"]=!0),a&&!o&&(h=fe,p["userflow-debugger-installation__step__warning"]=!0),a&&o&&(h=Q,p["userflow-debugger-installation__step__success"]=!0),{icon:h,classes:p}},[a,o]),E=()=>o?t?.endUser.debuggerEnabled?e.createElement(e.Fragment,null,e.createElement("span",{className:"userflow-debugger-details"},t?.env.company.name),e.createElement("span",{className:"userflow-debugger-details"},t?.env.name)):e.createElement("div",{className:"userflow-debugger-details__access__denied"},"The"," ",e.createElement("button",{onClick:()=>l("currentUser")},"currently signed-in user")," ","does not have debugger access"):e.createElement(e.Fragment,null,e.createElement("span",{className:"userflow-debugger-details"},"Unknown company"),e.createElement("span",{className:"userflow-debugger-details"},"Unknown environment"));return e.createElement("div",{className:"space-evenly userflow-debugger-app__content"},e.createElement("div",{className:"userflow-debugger-installation__steps"},e.createElement("div",{className:b({"d-flex gap-8 flex-column":!0,"userflow-debugger-installation__step":!0,"userflow-debugger-installation__step__success":!0})},e.createElement(v,{icon:Q,size:32}),"Userflow ",e.createElement("br",null),"installed"),e.createElement("div",{className:b(c.classes)},e.createElement(v,{icon:c.icon,size:32}),"Userflow ",e.createElement("br",null)," ",a?"":"not"," initialized"),e.createElement("div",{className:b(m.classes)},e.createElement(v,{icon:m.icon,size:32}),"User ",e.createElement("br",null)," ",o&&a?"":"not"," ","identified")),!a&&!o&&e.createElement("div",{className:b({"d-flex gap-8 flex-column":!0,"userflow-debugger-installation__not__initialized":!0})},"Remember to initialize Userflow by calling",e.createElement("div",null,"userflow.init('YOUR_USERFLOW_TOKEN')")),a&&e.createElement("div",{className:"d-flex gap-8 flex-column userflow-debugger-details__wrapper"},e.createElement("div",{className:"userflow-debugger-details__env__details"},e.createElement("div",{className:"d-flex gap-8 flex-column space-evenly"},e.createElement(v,{size:20,icon:xn}),e.createElement(v,{size:20,icon:Sn})),e.createElement("div",{className:"d-flex flex-column align-flex-start gap-8"},E())),e.createElement("div",{className:"d-flex gap-8 align-center"},e.createElement(v,{size:20,icon:Tn}),e.createElement("span",{className:"userflow-debugger-details"},r.getInitToken())),e.createElement("div",{className:"d-flex gap-8 align-center"},e.createElement(v,{size:20,icon:rt}),e.createElement("span",{className:"userflow-debugger-details"},o?r.getIdentifiedUser()?.externalId:"User not identified"))),e.createElement("div",{className:"userflow-debugger-installation__version"},e.createElement("a",{href:"https://docs.userflow.com/docs/dev/userflow-js-installation",target:"_blank",rel:"noreferrer"},"Visit the Userflow Developer Docs for help")," ",e.createElement("br",null),"Userflow.js version 0.1.",n))},na=()=>{const t=te(),{debuggerClientConditions:n}=Ne(),[r,a]=i.useState(void 0),[s,o]=i.useState([]),[l,c]=i.useState(),m=i.useMemo(()=>{if(l?.startCondition?.match===!1||l?.hiddenCondition?.match===!1||l?.locale?.match===!1)return!1;const g=l?.startFrequency;return!(g&&(g.onlyIfNotCompleted===!1||g.scopeByGroup===!1||g.frequency===!1))},[l]);i.useEffect(()=>(u().then(g=>{if(g?.length&&(o(g),!r)){const C=t.getSessionStorageState()?.debuggerApp?.selectedFlowVersionId,d=g.find(w=>w.latestVersion.id===C);h(d??g[0])}}),document.addEventListener("visibilitychange",u),()=>{document.removeEventListener("visibilitychange",u)}),[]),i.useEffect(()=>{r&&p(r.latestVersion)},[r]);const E=Dt.debounce(async g=>{const C=[];for(const[y,x]of n.entries())C.push({conditionId:y,isTrue:x.isTrue});const d={kind:"DebugFlowAutostartCondition",flowVersionId:g.id,clientConditions:C},w=await t.send(d);c({...w,listFlowLatestVersion:g}),w.latestVersion?.id&&g.id!==w.latestVersion?.id&&(u().then(y=>{if(!y)return;o(y);const x=y?.find(T=>T.latestVersion.id===w.latestVersion?.id);x&&h(x)}),E(w.latestVersion))},300),h=g=>{a(g);const C=t.getSessionStorageState().debuggerApp;C&&C?.x&&t.setSessionStorageState(d=>({...d,debuggerApp:{...C,selectedFlowVersionId:g.latestVersion.id}}))},p=async g=>{n.forEach(d=>{d.untrack?.()}),n.clear();const{conditionTypes:C}=await Qt(async()=>{const{conditionTypes:d}=await import("./flow-condition-types.js").then(w=>w.f);return{conditionTypes:d}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]));for(const d of g.clientConditions){n.set(d.id,{condition:d,isTrue:null});const w=C[d.type];if(!w){console.error(`Unknown condition type ${d.type}`);continue}const y=n.get(d.id);y&&(y.untrack=w.track({sessionData:new Jt([]),condition:d,callback:x=>{y.isTrue!==x&&(y.isTrue=x,E(g))}}))}},u=async()=>{try{return(await t.send({kind:"ListFlows",hasAutostartCondition:!0},{handlesRejection:!0})).flows?.filter(d=>d.type==="FLOW")}catch(g){g.code==="debugger_access_denied"&&tt("Access defined for List Flows");return}};return e.createElement("div",{className:"userflow-debugger-app__content"},e.createElement(Ht.Provider,{value:l},e.createElement(Zr,{flows:s,selectedFlow:r,setSelectedFlow:h,debugAutoStartCondition:E}),e.createElement("div",{className:"d-flex flex-column gap-8 userflow-debugger-app__wrapper"},l?.startCondition?.condition&&e.createElement("div",null,e.createElement("div",{className:b({"d-flex gap-8 align-center":!0,"userflow-debugger-app__wrapper__passing":m,"userflow-debugger-app__wrapper__failed":!m})},e.createElement(v,{icon:m?Fn:In}),e.createElement("strong",null,"Auto-start conditions")),e.createElement("span",null,"These are"," ",e.createElement(Gt,{condition:l.startCondition.condition}),e.createElement("b",null,"-conditions"),", meaning"," ",l.startCondition.condition.type==="CLAUSE"&&l.startCondition.condition.operator==="AND"&&e.createElement(e.Fragment,null,"all conditions must pass for the flow to start."),l.startCondition?.condition.type==="CLAUSE"&&l.startCondition.condition.operator==="OR"&&e.createElement(e.Fragment,null,"only one condition must pass for the flow to start."))),l?.startCondition?.condition&&e.createElement(Re,{isRoot:!0,isHideCond:!1,condition:l.startCondition.condition}),e.createElement($r,null),e.createElement(Gr,null),e.createElement(Yr,null),e.createElement(jr,null),e.createElement(zr,null),e.createElement(Br,null),e.createElement(Kr,null),e.createElement(Xr,null))))},ra=e.memo(()=>{const{meta:t,buildId:n}=Ne();if(!t)return null;const r="https://app.userflow.com/app/"+t.env.company.slug+"/settings/debugger?external_id="+t.endUser.externalId;return e.createElement("div",{className:"d-flex flex-column space-evenly flex-1"},e.createElement("div",{className:"d-flex flex-column gap-8"},e.createElement("div",{className:"d-flex flex-column"},t.endUser.avatarUrl?e.createElement("img",{src:t.endUser.avatarUrl,className:"userflow-debugger-user__image"}):e.createElement("div",{className:"userflow-debugger-user__image"}),e.createElement("span",{className:"userflow-debugger-user__name"},t.endUser?.name||"Unknown name"),e.createElement("span",{className:"userflow-debugger-user__email"},t?.endUser?.email||"Unknown email address"),(!t.endUser.email||!t.endUser.name)&&e.createElement("span",{className:"userflow-debugger__external__id"},t.endUser.externalId)),!t.endUser.debuggerEnabled&&e.createElement(e.Fragment,null,e.createElement("div",{className:"userflow-debugger-user__info"},"This user doesn't have access to the Userflow debugger. You can grant access through the debugger settings in Userflow."),e.createElement("a",{className:"userflow-debugger-user__button",href:r,target:"_blank",rel:"noreferrer"},"Grant access in Userflow ",e.createElement(v,{icon:xt})))),e.createElement("div",{className:"userflow-debugger-installation__version"},e.createElement("a",{href:"https://docs.userflow.com/docs/dev/userflow-js-installation",target:"_blank",rel:"noreferrer"},"Visit the Userflow Developer Docs for help")," ",e.createElement("br",null),"Userflow.js version 0.1.",n))});class Qa{constructor(n,r){this.client=n,this.buildId=r,this.debuggerClientConditions=new Map}mount(){if(this.container)throw new Error("UI has already been mounted");this.container=document.createElement("div"),this.container.id="userflow-debugger-ui",document.body.appendChild(this.container),je.render(e.createElement(aa,{client:this.client,debuggerClientConditions:this.debuggerClientConditions,buildId:this.buildId,unmount:()=>this.unmount()}),this.container)}unmount(){this.container&&(je.unmountComponentAtNode(this.container),document.body.contains(this.container)&&document.body.removeChild(this.container),this.client.unMountDebugger(),delete this.container)}}const aa=({client:t,debuggerClientConditions:n,buildId:r,unmount:a})=>{const[s,o]=i.useState(void 0),l=Dt.debounce(async()=>{try{const c=await t.send({kind:"GetCurrentEndUser"},{handlesRejection:!0});o(c)}catch(c){c.code==="debugger_access_denied"&&tt("debugger access denied"),o(void 0)}},300);return i.useEffect(()=>(l(),document.addEventListener("visibilitychange",l),t.on("private:identified",l),()=>{document.removeEventListener("visibilitychange",l),t.off("private:identified",l)}),[]),e.createElement(Kt.Provider,{value:t},e.createElement(Wt.Provider,{value:{meta:s,debuggerClientConditions:n,buildId:r}},e.createElement(Nr,null,e.createElement(Jr,{close:a}))))};export{Qa as DebuggerUI};
|
|
4
4
|
//# sourceMappingURL=DebuggerUI.js.map
|
package/debugger.css
CHANGED
|
@@ -831,6 +831,7 @@ button {
|
|
|
831
831
|
font-size: 14px;
|
|
832
832
|
outline: none;
|
|
833
833
|
color: #fff;
|
|
834
|
+
text-overflow: ellipsis;
|
|
834
835
|
}
|
|
835
836
|
.userflow-debugger__flow__selector svg {
|
|
836
837
|
width: 16px;
|
|
@@ -845,6 +846,9 @@ button {
|
|
|
845
846
|
height: 32px;
|
|
846
847
|
padding: 4px 8px;
|
|
847
848
|
font-size: 14px;
|
|
849
|
+
overflow: hidden;
|
|
850
|
+
white-space: nowrap;
|
|
851
|
+
text-overflow: ellipsis;
|
|
848
852
|
}
|
|
849
853
|
.combo-box__option--highlighted {
|
|
850
854
|
background-color: #0c196e;
|
package/hash.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
e074e3c08ce9764d1bb117a593416fc4b858ca17
|
package/package.json
CHANGED
package/userflow.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["ResourceCenterApp.js","vendor.react.js","vendor.absinthe.socket.js","vendor.jumpn.utils-composite.js","vendor.babel-runtime.js","vendor.jumpn.utils-array.js","vendor.flow-static-land.js","vendor.core-js.js","vendor.jumpn.utils-graphql.js","vendor.zen-observable.js","vendor.object-assign.js","client-context.js","vendor.i18next.js","vendor.react-i18next.js","vendor.babel.runtime.js","flow-host.styl.js","use-selector-element-monitoring.js","flow-condition-types.js","vendor.date-fns.js","roots.js","stylesheets.js","vendor.fortawesome.pro-regular-svg-icons.js","vendor.fortawesome.pro-solid-svg-icons.js","vendor.obj-str.js","Frame.js","vendor.react-dom.js","vendor.scheduler.js","use-window-resize.js","logomark.js","ChecklistUI.js","FlowChrome.js","use-element-rect.js","vendor.bignumber.js.js","index.js","BannerApp.js","vendor.phoenix.js","vendor.uuid.js","implicit-tracking.js","DebuggerUI.js","vendor.fortawesome.react-fontawesome.js","vendor.fortawesome.fontawesome-svg-core.js","vendor.memoize-one.js","vendor.numeral.js","vendor.react-day-picker.js","vendor.lodash.js","vendor.isomorphic-fetch.js","vendor.whatwg-fetch.js","vendor.apollo.client.js","vendor.ts-invariant.js","vendor.wry.equality.js","vendor.graphql.js","vendor.optimism.js","vendor.wry.trie.js","vendor.wry.context.js","vendor.fast-json-stable-stringify.js","ui.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import"./vendor.core-js.js";import"./vendor.absinthe.socket.js";import{S as j}from"./vendor.phoenix.js";import{v as p}from"./vendor.uuid.js";import"./vendor.jumpn.utils-composite.js";import"./vendor.babel-runtime.js";import"./vendor.jumpn.utils-array.js";import"./vendor.flow-static-land.js";import"./vendor.jumpn.utils-graphql.js";import"./vendor.zen-observable.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="09bc9f5f-47a6-4109-b7f0-af4bb18bf647",t._sentryDebugIdIdentifier="sentry-dbid-09bc9f5f-47a6-4109-b7f0-af4bb18bf647")}catch{}})();const Y="modulepreload",z=function(t){return new URL("./",import.meta.url).toString()+t},v={},g=function(e,s,i){let n=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),h=a?.nonce||a?.getAttribute("nonce");n=Promise.allSettled(s.map(c=>{if(c=z(c),c in v)return;v[c]=!0;const l=c.endsWith(".css"),T=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${T}`))return;const E=document.createElement("link");if(E.rel=l?"stylesheet":Y,l||(E.as="script"),E.crossOrigin="",E.href=c,h&&E.setAttribute("nonce",h),document.head.appendChild(E),l)return new Promise((K,F)=>{E.addEventListener("load",K),E.addEventListener("error",()=>F(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(a){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=a,window.dispatchEvent(h),!h.defaultPrevented)throw a}return n.then(a=>{for(const h of a||[])h.status==="rejected"&&r(h.reason);return e().catch(r)})};class u extends Error{constructor(e,s,i){super(e),Object.setPrototypeOf(this,u.prototype),this.name="UserflowError",this.code=s,this.humanMessage=i}}class B{constructor(e){this.type=e,this.testState={}}formatKey(e){return`userflow:${e}`}isSupported(){if(typeof window>"u")return!1;try{return window[this.type]!=null}catch{return!1}}getItem(e){return e=this.formatKey(e),this.isSupported()?window[this.type].getItem(e):null}setItem(e,s){e=this.formatKey(e);{if(!this.isSupported())return;window[this.type].setItem(e,s)}}removeItem(e){return e=this.formatKey(e),this.isSupported()?window[this.type].removeItem(e):void 0}clear(){return this.isSupported()?window[this.type].clear():void 0}}const I=new B("localStorage"),f=new B("sessionStorage");function at(t){window.location.href=t}function x(){return window.location.href}function N(t){window.postMessage(t,window.origin)}function G(t){const e=i=>{if(i.source!==window||i.origin!==window.origin)return;const n=i.data;!n||typeof n!="object"||typeof n.kind!="string"||!n.kind.startsWith("userflow:")||t(n)===!0&&s()};window.addEventListener("message",e);const s=()=>window.removeEventListener("message",e);return s}function J(t){return new Promise(e=>{G(s=>{const i=t(s);return i?(e(i),!0):!1})})}const A=new Set;let O=!1;function X(t){return Q(),A.add(t),()=>{H(t)}}function H(t){A.delete(t)}function w(){A.forEach(t=>t())}function Q(){if(O)return;O=!0;const{history:t}=window,e=s=>{const i=t[s];t[s]=(...n)=>{const r=i.apply(t,n);return w(),r}};window.__userflowStatePatched?(window.addEventListener("userflow:pushstate",()=>{w()}),window.addEventListener("userflow:replacestate",()=>{w()})):(e("pushState"),e("replaceState")),window.addEventListener("popstate",()=>{w()})}class Z{destroy(){this.unregisterOnMessage&&this.unregisterOnMessage()}postBuilderMessage(e){N({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:e})}onBuilderMessage(e){return this.unregisterOnMessage=G(e),!1}async captureScreenshot(e,s,i,n){return N({kind:"userflow:crxScreenshot",x:e,y:s,width:i,height:n,devicePixelRatio:window.devicePixelRatio}),(await J(a=>a.kind==="userflow:crxScreenshotResult"?a:null)).imageDataUrl}}var C=(t=>(t.ACTION="ACTION",t.LAUNCHER_DEACTIVATED="LAUNCHER_DEACTIVATED",t.REPLACED="REPLACED",t.SNOOZED="SNOOZED",t.TOOLTIP_TARGET_MISSING="TOOLTIP_TARGET_MISSING",t.USERFLOWJS="USERFLOWJS",t.USER_CLOSED="USER_CLOSED",t))(C||{}),m=(t=>(t.ACTION="ACTION",t.DRAFT="DRAFT",t.LINK="LINK",t.LAUNCHER_SEEN="LAUNCHER_SEEN",t.RESOURCE_CENTER="RESOURCE_CENTER",t.USERFLOWJS="USERFLOWJS",t))(m||{}),q=(t=>(t.LIKE="LIKE",t.DISLIKE="DISLIKE",t))(q||{}),S=(t=>(t.STRING="STRING",t.BOOLEAN="BOOLEAN",t.NUMBER="NUMBER",t.DATETIME="DATETIME",t.LIST="LIST",t.RANDOM_AB="RANDOM_AB",t.RANDOM_NUMBER="RANDOM_NUMBER",t.CHECKLIST_TASK="CHECKLIST_TASK",t.FLOW="FLOW",t.FLOW_SESSION="FLOW_SESSION",t.FLOW_STEP="FLOW_STEP",t.FLOW_VERSION="FLOW_VERSION",t))(S||{}),k=(t=>(t.FLOW="FLOW",t.BANNER="BANNER",t.EMBED="EMBED",t.CHECKLIST="CHECKLIST",t.LAUNCHER="LAUNCHER",t.RESOURCE_CENTER="RESOURCE_CENTER",t))(k||{}),ee=(t=>(t.ALWAYS_TRUE="ALWAYS_TRUE",t.ATTRIBUTE="ATTRIBUTE",t.CHECKLIST_TASK_CLICKED="CHECKLIST_TASK_CLICKED",t.CLAUSE="CLAUSE",t.ELEMENT="ELEMENT",t.EVENT="EVENT",t.FILLED_IN_INPUT="FILLED_IN_INPUT",t.FLOW="FLOW",t.INPUT_VALUE="INPUT_VALUE",t.PAGE="PAGE",t.SEGMENT="SEGMENT",t.TIME="TIME",t))(ee||{}),te=(t=>(t.AUTO="AUTO",t.MANUAL="MANUAL",t))(te||{}),se=(t=>(t.INPUT="INPUT",t))(se||{}),ie=(t=>(t.ABSOLUTE_EQ="ABSOLUTE_EQ",t.ABSOLUTE_GT="ABSOLUTE_GT",t.ABSOLUTE_LT="ABSOLUTE_LT",t.AND="AND",t.BETWEEN="BETWEEN",t.CONTAINS="CONTAINS",t.EMPTY="EMPTY",t.ENDS_WITH="ENDS_WITH",t.EQ="EQ",t.EXCLUDES_ALL="EXCLUDES_ALL",t.EXCLUDES_ANY="EXCLUDES_ANY",t.FALSE="FALSE",t.GT="GT",t.GTE="GTE",t.INCLUDES_ALL="INCLUDES_ALL",t.INCLUDES_ANY="INCLUDES_ANY",t.LT="LT",t.LTE="LTE",t.NE="NE",t.NOT_CONTAINS="NOT_CONTAINS",t.NOT_EMPTY="NOT_EMPTY",t.NOT_REGEX="NOT_REGEX",t.OR="OR",t.REGEX="REGEX",t.RELATIVE_EQ="RELATIVE_EQ",t.RELATIVE_GT="RELATIVE_GT",t.RELATIVE_LT="RELATIVE_LT",t.STARTS_WITH="STARTS_WITH",t.TRUE="TRUE",t.URL="URL",t))(ie||{}),ne=(t=>(t.CLICK="CLICK",t.DISABLED="DISABLED",t.MOUSEDOWN="MOUSEDOWN",t.NOT_CLICK="NOT_CLICK",t.NOT_DISABLED="NOT_DISABLED",t.NOT_PRESENT="NOT_PRESENT",t.PRESENT="PRESENT",t))(ne||{}),re=(t=>(t.END_USER="END_USER",t.GROUP="GROUP",t))(re||{}),oe=(t=>(t.BETWEEN="BETWEEN",t.EQ="EQ",t.GTE="GTE",t.LTE="LTE",t))(oe||{}),ae=(t=>(t.ANY="ANY",t.RELATIVE_BETWEEN="RELATIVE_BETWEEN",t.RELATIVE_GT="RELATIVE_GT",t.RELATIVE_LT="RELATIVE_LT",t))(ae||{}),ce=(t=>(t.CURRENT_USER="CURRENT_USER",t.CURRENT_USER_CURRENT_GROUP="CURRENT_USER_CURRENT_GROUP",t.CURRENT_GROUP="CURRENT_GROUP",t))(ce||{}),le=(t=>(t.ASSET="ASSET",t.CARTOON="CARTOON",t.NONE="NONE",t.URL="URL",t))(le||{}),ue=(t=>(t.INSIDE="INSIDE",t.OUTSIDE="OUTSIDE",t))(ue||{}),he=(t=>(t.TOP_LEFT="TOP_LEFT",t.TOP_CENTER="TOP_CENTER",t.TOP_RIGHT="TOP_RIGHT",t.BOTTOM_RIGHT="BOTTOM_RIGHT",t.BOTTOM_CENTER="BOTTOM_CENTER",t.BOTTOM_LEFT="BOTTOM_LEFT",t.CENTER="CENTER",t))(he||{}),de=(t=>(t.GOOGLE="GOOGLE",t.STANDARD="STANDARD",t))(de||{}),fe=(t=>(t.DISMISS_FIRST_MENU_AFTER="DISMISS_FIRST_MENU_AFTER",t.DISMISS="DISMISS",t))(fe||{}),Ee=(t=>(t.DISMISS="DISMISS",t.NONE="NONE",t))(Ee||{}),Se=(t=>(t.TOP="TOP",t.BOTTOM="BOTTOM",t))(Se||{}),Te=(t=>(t.DEFAULT="DEFAULT",t.PLAINTEXT="PLAINTEXT",t.CUSTOM="CUSTOM",t))(Te||{}),ge=(t=>(t.CHECKLIST_OVERRIDE="CHECKLIST_OVERRIDE",t.RESOURCE_CENTER_ONLY="RESOURCE_CENTER_ONLY",t.NONE="NONE",t))(ge||{}),Ie=(t=>(t.BUBBLE="BUBBLE",t.END="END",t.ERROR="ERROR",t.FLAG="FLAG",t))(Ie||{}),we=(t=>(t.MANUAL="MANUAL",t.NONE="NONE",t.SYNTHETIC="SYNTHETIC",t))(we||{}),Ce=(t=>(t.BUBBLE="BUBBLE",t.HIDDEN="HIDDEN",t.MODAL="MODAL",t.TOOLTIP="TOOLTIP",t))(Ce||{}),ke=(t=>(t.ABOVE="ABOVE",t.BELOW="BELOW",t.LEFT="LEFT",t.RIGHT="RIGHT",t))(ke||{}),me=(t=>(t.CLOSE_FLOW="CLOSE_FLOW",t.EVAL_JS="EVAL_JS",t.GO_TO_STEP="GO_TO_STEP",t.NAVIGATE="NAVIGATE",t.SET_ATTRIBUTE="SET_ATTRIBUTE",t.SNOOZE="SNOOZE",t.START_FLOW="START_FLOW",t))(me||{}),pe=(t=>(t.NEW_TAB="NEW_TAB",t.SAME_TAB="SAME_TAB",t))(pe||{}),Ue=(t=>(t.SET="SET",t.SET_DATETIME="SET_DATETIME",t.SET_DATETIME_ONCE="SET_DATETIME_ONCE",t.SET_ONCE="SET_ONCE",t.ADD="ADD",t.SUBTRACT="SUBTRACT",t.APPEND="APPEND",t.PREPEND="PREPEND",t.REMOVE="REMOVE",t.UNSET="UNSET",t))(Ue||{}),Le=(t=>(t.MULTILINE_TEXT="MULTILINE_TEXT",t.MULTIPLE_CHOICE="MULTIPLE_CHOICE",t.NPS="NPS",t.SCALE="SCALE",t.STARS="STARS",t.TEXT="TEXT",t))(Le||{}),_=(t=>(t.ACTION="ACTION",t.ANNOUNCEMENTS="ANNOUNCEMENTS",t.ASSISTANT="ASSISTANT",t.CHECKLIST="CHECKLIST",t.CONTACT="CONTACT",t.DIVIDER="DIVIDER",t.FLOWS="FLOWS",t.KNOWLEDGE_BASE="KNOWLEDGE_BASE",t.MESSAGE="MESSAGE",t.SUBPAGE="SUBPAGE",t))(_||{}),Ne=(t=>(t.CRISP="CRISP",t.CUSTOM="CUSTOM",t.FRESHCHAT="FRESHCHAT",t.HELPSCOUT="HELPSCOUT",t.HUBSPOT="HUBSPOT",t.INTERCOM="INTERCOM",t.ZENDESK="ZENDESK",t.ZENDESK_MESSENGER="ZENDESK_MESSENGER",t))(Ne||{}),_e=(t=>(t.BUTTON="BUTTON",t.INPUT="INPUT",t))(_e||{}),Ae=(t=>(t.EMAIL="EMAIL",t.PHONE="PHONE",t.CHAT="CHAT",t))(Ae||{}),Re=(t=>(t.SILENT="SILENT",t.BADGE="BADGE",t.POPOUT="POPOUT",t.MODAL="MODAL",t.TOAST="TOAST",t))(Re||{}),ve=(t=>(t.LAUNCHER_CLICK="LAUNCHER_CLICK",t.LAUNCHER_HOVER="LAUNCHER_HOVER",t.TARGET_CLICK="TARGET_CLICK",t.TARGET_HOVER="TARGET_HOVER",t.LAUNCHER_TARGET_CLICK="LAUNCHER_TARGET_CLICK",t.LAUNCHER_TARGET_HOVER="LAUNCHER_TARGET_HOVER",t))(ve||{}),W=(t=>(t.ACTIVATE="ACTIVATE",t.DEACTIVATE="DEACTIVATE",t.NEVER="NEVER",t))(W||{}),Oe=(t=>(t.AUTO="AUTO",t.TOP="TOP",t.RIGHT="RIGHT",t.BOTTOM="BOTTOM",t.LEFT="LEFT",t))(Oe||{}),be=(t=>(t.START="START",t.CENTER="CENTER",t.END="END",t))(be||{}),ye=(t=>(t.PERCENT="PERCENT",t.PX="PX",t))(ye||{}),De=(t=>(t.BEACON="BEACON",t.BUTTON="BUTTON",t.HIDDEN="HIDDEN",t.ICON="ICON",t))(De||{}),Me=(t=>(t.LAUNCHER="LAUNCHER",t.TARGET="TARGET",t))(Me||{}),Pe=(t=>(t.BODY_FIRST="BODY_FIRST",t.BODY_LAST="BODY_LAST",t.ELEMENT_FIRST="ELEMENT_FIRST",t.ELEMENT_LAST="ELEMENT_LAST",t.ELEMENT_BEFORE="ELEMENT_BEFORE",t.ELEMENT_AFTER="ELEMENT_AFTER",t))(Pe||{}),Be=(t=>(t.BODY_FIRST="BODY_FIRST",t.BODY_LAST="BODY_LAST",t.ELEMENT_FIRST="ELEMENT_FIRST",t.ELEMENT_LAST="ELEMENT_LAST",t.ELEMENT_BEFORE="ELEMENT_BEFORE",t.ELEMENT_AFTER="ELEMENT_AFTER",t))(Be||{}),xe=(t=>(t.ALWAYS="ALWAYS",t.MULTIPLE="MULTIPLE",t.NEVER="NEVER",t.ONCE="ONCE",t.ONCE_PER_GROUP="ONCE_PER_GROUP",t))(xe||{}),Ge=(t=>(t.NONE="NONE",t.PENDING_SCHEDULE="PENDING_SCHEDULE",t.SCHEDULED="SCHEDULED",t.FIRED="FIRED",t))(Ge||{}),He=(t=>(t.NONE="NONE",t.LIKE="LIKE",t.SCALE="SCALE",t))(He||{});function We(){return{customInputs:[],customNavigate:null,urlFilter:null,linkUrlDecorator:null,customScrollIntoView:null,scrollPadding:null,inferenceAttributeNames:["data-for","data-id","data-testid","data-test-id","for","id","name","placeholder","role"],inferenceAttributeFilters:{id:[t=>!t.match(/\d$/)],"data-id":[t=>!t.match(/\d$/)]},inferenceClassNameFilters:[t=>!t.startsWith("css-")],baseZIndex:1234500,evalJsDisabled:!1}}const d=We();function b(t){return Array.isArray(t)||(t=t?[t]:[]),t=t.map(e=>typeof e=="string"?new RegExp(e):e),t}function ct(t,e){return t.every(s=>typeof s=="function"?s(e):s instanceof RegExp?s.test(e):!0)}function Ve(){let t=x();if(d.urlFilter){if(t=d.urlFilter(t),typeof t!="string")throw new u("Userflow.js: URL filter returned non-string value. Please check your userflow.setUrlFilter() implementation.");try{new URL(t)}catch(e){throw new u(`Userflow.js: URL filter returned an invalid URL. Please check your userflow.setUrlFilter() implementation.
|
|
3
3
|
Returned URL: `+t+`
|
|
4
|
-
Error message: `+e.message)}}return t}let V="";try{V=localStorage.getItem("debug")||""}catch{}const $=V.split(",").some(t=>t==="*"||t.startsWith("userflow:*")),o=R("log");o.group=R("group");o.groupCollapsed=R("groupCollapsed");o.groupEnd=function(){$&&console.groupEnd()};let U;function R(t){return function(e,...s){if($){const i=performance.now(),n=U?Math.round(i-U):0;U=i,console[t](`%cuserflow %c${e} %c+${n}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}const $e=()=>g(()=>import("./ResourceCenterApp.js").then(t=>t.R),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]));function Ke(t){const s=t.version.checklist.tasks.length;return Math.max(0,s-t.taskCompletions.length)}class y{constructor(e){this.observers=new Set,this._value=e}get value(){return this._value}update(e){if(e!==this._value){this._value=e;for(const s of this.observers)s()}}observe(e){return this.observers.add(e),()=>this.observers.delete(e)}}const D=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit"],Fe=()=>g(()=>import("./BannerApp.js"),__vite__mapDeps([34,1,2,3,4,5,6,7,8,9,10,11,12,13,14,23,20,21,22,17,18,19,16,15,25,26,24,31,27,35,36])),L="
|
|
4
|
+
Error message: `+e.message)}}return t}let V="";try{V=localStorage.getItem("debug")||""}catch{}const $=V.split(",").some(t=>t==="*"||t.startsWith("userflow:*")),o=R("log");o.group=R("group");o.groupCollapsed=R("groupCollapsed");o.groupEnd=function(){$&&console.groupEnd()};let U;function R(t){return function(e,...s){if($){const i=performance.now(),n=U?Math.round(i-U):0;U=i,console[t](`%cuserflow %c${e} %c+${n}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}const $e=()=>g(()=>import("./ResourceCenterApp.js").then(t=>t.R),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]));function Ke(t){const s=t.version.checklist.tasks.length;return Math.max(0,s-t.taskCompletions.length)}class y{constructor(e){this.observers=new Set,this._value=e}get value(){return this._value}update(e){if(e!==this._value){this._value=e;for(const s of this.observers)s()}}observe(e){return this.observers.add(e),()=>this.observers.delete(e)}}const D=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit"],Fe=()=>g(()=>import("./BannerApp.js"),__vite__mapDeps([34,1,2,3,4,5,6,7,8,9,10,11,12,13,14,23,20,21,22,17,18,19,16,15,25,26,24,31,27,35,36])),L="1011696",je=import.meta.url,M=50,Ye=5*60*1e3,P="userflowClientState";class ze{constructor(){this.clientToken=null,this.externalId=null,this.signature=null,this.groupId=null,this.groupSignature=null,this._socketStatus="disconnected",this.socket=null,this.channel=null,this.logrocketAppId=null,this.debounceInactiveDisconnectTimeout=void 0,this.inBatch=!1,this.endBatchTimeout=void 0,this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=0,this.clientClock=1,this.serverClock=1,this.flowSession=null,this.flowSessionClock=0,this.checklistSession=null,this.checklistExpanded=!1,this.checklistExpandPending=!1,this.checklistSessionClock=0,this.bannerSession=null,this.resourceCenterSession=null,this.resourceCenterOpen=!1,this.resourceCenterLauncherHidden=!1,this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.embedSessions=[],this.notificationIdCounter=0,this.sessionStorageState=null,this.clientContext=null,this.flushUrlChangeTimeout=void 0,this.onFirstIdentifyRun=!1,this.onFirstIdentifyTimeout=void 0,this.firstIdentifyCallback=null,this.ui=null,this.debuggerUI=null,this.unackedTasks=new Set,this.clientConditions=new Map,this.trackers=new Map,this.conditionWaitTimers=new Map,this.listeners=new Map,this.targetEnv=null,this.idempotencyKeysSeen=new Set,this.testUserIdentified=!1,this.cspIssueReported=!1,this.uiDisabled=!1,this.audio=null,this.audioReady=!1,this.pageTrackingDisabled=!1,this.refCounter=1,this.implicitTrackingQueue=[],this.onBuilderMessage=e=>(this.handleBuilderMessage(e),!1),this.handleBuilderMessage=async e=>{o(`builder ${e.kind} message received`,e);const s="idempotencyKey"in e&&typeof e.idempotencyKey=="string"?e.idempotencyKey:null;if(s&&this.idempotencyKeysSeen.has(s))return;const i=()=>{s&&this.idempotencyKeysSeen.add(s)};switch(e.kind){case"userflow:selectElement":{i(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(n=>({...n,isTargetTab:!0,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:e.elementType}}));return}case"userflow:selectElementCancel":{this.setSessionStorageState(n=>({...n,activeApp:null,elementSelection:null}));return}case"userflow:startFlowWithToken":{i(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(n=>({...n,isTargetTab:!0,activeApp:null,testStartConditionToken:void 0})),f.setItem("previewFlowId",e.flowId),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),e.testStartCondition?this.setSessionStorageState(n=>({...n,activeApp:"startConditionTesting",testStartConditionToken:e.token})):this.onceIdentified(()=>{if(this.startFlowWithToken(e.token),e.isResourceCenter){const n=()=>{const r=this.resourceCenterSession;r&&r.draftMode&&r.flow.id===e.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",n))};this.on("resourceCenterChanged",n),n()}});return}case"userflow:testTracker":{i(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(n=>({...n,isTargetTab:!0})),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),this.setSessionStorageState(n=>({...n,activeApp:"trackerTesting",trackerTesting:{trackerName:e.trackerName,token:e.token,events:0}}));return}case"userflow:testTrackerCancel":{this.setSessionStorageState(n=>({...n,activeApp:null,trackerTesting:null}));return}}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout(()=>this.flushUrlChange(),M))},this.onUserActivity=()=>this.ensureConnected(),this.remountIfNecessary=()=>{!this.ui?.container||document.contains(this.ui.container)||(o("remounting UI because container was missing"),this.remount())},o("constructor, build="+L),X(this.onUrlChange),this.setTargetEnv(new Z),this.checkTestUserAtBoot(),this.toggleUI(),this.checkDebuggerSession();for(const e of D)document.addEventListener(e,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){o("destroy"),this.reset(),H(this.onUrlChange),this.destroyTargetEnv();for(const e of D)document.removeEventListener(e,this.remountIfNecessary)}setTargetEnv(e){this.destroyTargetEnv(),this.targetEnv=e,e.onBuilderMessage(this.onBuilderMessage)}destroyTargetEnv(){this.targetEnv&&(this.targetEnv.destroy(),this.targetEnv=null)}getTargetEnv(){if(!this.targetEnv)throw new u("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(e){const s=e(this.getSessionStorageState());f.setItem(P,JSON.stringify(s)),this.sessionStorageState=s,this.toggleUI()}getSessionStorageState(){let e=this.sessionStorageState;if(!e){const s=f.getItem(P);if(s)try{e=JSON.parse(s)}catch(i){console.error("Userflow.js: Parse ElementSelectionState error:",i)}e||(e={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null}),this.sessionStorageState=e}return e}checkTestUserAtBoot(){const e=this.getSessionStorageState().testUser;e&&(o("checkTestUserAtBoot identifying test user"),this.identifyTestUser(e))}async identifyTestUser(e){this.setSessionStorageState(n=>({...n,testUser:e})),this.reset(),this.init(e.clientToken),this.testUserIdentified=!0,this.externalId=e.id;const s=[this.identify(e.id,{name:e.name,email:e.email,signed_up_at:{set_once:new Date().toISOString(),data_type:"datetime"}},{signature:e.signature})],{group:i}=e;i&&(this.groupId=i.id,s.push(this.group(i.id,{name:i.name},{signature:i.signature}))),await Promise.all(s)}resetTestUser(){this.setSessionStorageState(e=>({...e,testUser:null}))}init(e){if(o("init",e),!e)throw new u("userflow.init() was called but missing Userflow.js Token");if(this.clientToken!==e){if(this.testUserIdentified){o("init() ignoring new token since a test user has been identified");return}this.clientToken&&(o("init() resetting due to new client token"),this.reset()),this.clientToken=e,this.emit("private:initialised")}}ensureInit(){if(!this.clientToken)throw new u("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new u("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new u("You must call userflow.group() first");return this.groupId}ensureConnected(){if(!this.clientToken||!this.externalId||(this.debounceInactiveDisconnect(),this.socket))return;this._socketStatus="connecting",o("connecting to socket");let e=d.serverEndpoint||"e.userflow.com";new URL(je).hostname==="js.getuserflow.com"&&e==="e.userflow.com"&&(e="e.getuserflow.com");const s="wss://"+e+"/end-users/"+this.clientToken+"/socket";this.socket=new j(s,{reconnectAfterMs:i=>[100,500,1e3,5e3][i-1]||1e4,timeout:20*1e3}),this.socket.connect(),this.socket.onOpen(()=>{o("socket opened")}),this.socket.onClose(()=>{this.emit("private:disconnect")}),this.socket.onError(i=>{console.log("Userflow.js socket error",i),this.reportCspIssue()}),this.channel=this.socket.channel(`end_users:${this.externalId}`,()=>this.makeChannelJoinPayload()),this.channel.join().receive("ok",i=>{this.logrocketAppId=i.logrocketAppId,this.featureFlags=new Set(i.featureFlags),o("channel joined"),this._socketStatus!=="connected"&&(this._socketStatus="connected"),this.flushImplicitTrackingQueue(),this.featureFlagEnabled("cff_implicit_events")===!0&&this.startImplicitTracking()}).receive("error",i=>{["company_closed","invalid_client_token","invalid_user_external_id","incorrect_user_signature","rate_limit_exceeded","user_signature_required"].includes(i.code)?(console.error(`Userflow.js resetting due to: [${i.code}] ${i.message}`),this.reset(),this.clientToken=null):i.code==="invalid_protocol_version"?(console.error(`Userflow.js destroying due to: [${i.code}] ${i.message}`),this.destroy()):console.log("Userflow.js channel join error",i)}),this.channel.on("server_message",i=>this.handleServerMessage(i)),this.channel.on("server_error",i=>{console.log(`Userflow.js server error (${i.code}): ${i.message}`+(i.details&&i.details.length>0?`
|
|
5
5
|
Details:
|
|
6
6
|
`+i.details.map(n=>(n.path?`${n.path}: `:"")+n.message):""))}),this.channel.onClose(()=>{this.flushImplicitTrackingQueue(),this.implicitTracking?.stop()})}async startImplicitTracking(){await g(()=>import("./implicit-tracking.js"),__vite__mapDeps([37,19,2,3,4,5,6,7,8,9,36,35])).then(e=>this.implicitTracking=new e.ImplicitTracking(this)).catch(e=>o(`Implicit tracking failed to load ${e}`)),this.implicitTracking.start()}flushImplicitTrackingQueue(){this.featureFlagEnabled("cff_implicit_events")===!0&&this.implicitTrackingQueue.forEach(e=>{this.trackRawEvent({name:"page_viewed",attributes:e})}),this.implicitTrackingQueue=[]}makeChannelJoinPayload(){const e=this.buildClientContext();this.clientContext=e;const s={protocolVersion:2,userflowClientBuild:L,signature:this.signature,groupExternalId:this.groupId,groupSignature:this.groupSignature,flowSessionId:this.flowSession?.id||null,checklistSessionId:this.checklistSession?.id||null,bannerSessionId:this.bannerSession?.id||null,resourceCenterSessionId:this.resourceCenterSession?.id||null,launchers:this.launcherSessions.map(i=>({flowId:i.flow.id})),trackers:Array.from(this.trackers.values()).map(i=>({flowId:i.tracker.flowId})),hasDraftSession:this.hasDraftSession(),clientConditions:Array.from(this.clientConditions.values()).map(i=>({conditionId:i.condition.id,isTrue:i.isTrue})),previewFlowId:f.getItem("previewFlowId"),clientContext:e};return o("channel join payload",s),s}disconnect(){window.clearTimeout(this.debounceInactiveDisconnectTimeout),this.socket&&this.socket.disconnect(),this._socketStatus="disconnected",this.socket=null,this.channel=null}debounceInactiveDisconnect(){window.clearTimeout(this.debounceInactiveDisconnectTimeout),this.debounceInactiveDisconnectTimeout=window.setTimeout(()=>{if(this.hasDraftSession()||this.assistantMessageInProgress){this.debounceInactiveDisconnect();return}o("disconnecting from socket due to inactivity"),this.disconnect()},Ye)}hasDraftSession(){return!!this.flowSession?.draftMode||!!this.checklistSession?.draftMode||!!this.bannerSession?.draftMode||!!this.resourceCenterSession?.draftMode||this.launcherSessions.some(e=>e.draftMode)}async send(e,{batch:s,endBatch:i,handlesRejection:n}={}){return(!this.inBatch||!["ToggleClientCondition","UpdateClientContext"].includes(e.kind))&&this.checkPushRateLimit(),this.ensureConnected(),s&&!this.inBatch&&(this.inBatch=!0,this.sendRaw({kind:"BeginBatch"})),this.inBatch&&(window.clearTimeout(this.endBatchTimeout),i?this.endBatch():this.endBatchTimeout=window.setTimeout(()=>{this.endBatch()},M)),this.sendRaw(e,{handlesRejection:n})}async sendRaw(e,{handlesRejection:s}={}){return new Promise((i,n)=>{if(!this.channel){const c=`Userflow.js: send() should not be called if channel is not set. Message kind=${e.kind}`;if(s)throw Error(c);console.log(c,`
|
|
7
7
|
Client message:`,e);return}o(`push ${e.kind} message`,e);const r=this.clientClock,a=()=>{this.serverClock=r,this.channel?.off("phx_error",h)},h=this.channel.on("phx_error",c=>{a();const l=`Userflow.js send ${e.kind} got phx_error`;this._socketStatus==="connected"&&console.log(l,`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{h as Vn,m as Hr}from"./vendor.jumpn.utils-composite.js";import{r as Ur,e as Gr,g as Vr}from"./vendor.jumpn.utils-graphql.js";import{O as Jr}from"./vendor.zen-observable.js";import{r as Br,a as Jn,b as Wr}from"./vendor.jumpn.utils-array.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="24bd7f79-0faf-463b-bc83-215370606281",n._sentryDebugIdIdentifier="sentry-dbid-24bd7f79-0faf-463b-bc83-215370606281")}catch{}})();var Qr=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};Qr.SENTRY_RELEASE={id:"3c73c5939f5225144de71b1dbc691b2afedc69e6"};var Ku=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ee(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bn={exports:{}},Kr=Bn.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=Kr);var j=Bn.exports,Wn={exports:{}},zr=Wn.exports={version:"2.6.0"};typeof __e=="number"&&(__e=zr);var Re=Wn.exports,H={},M=function(n){return typeof n=="object"?n!==null:typeof n=="function"},Xr=M,qe=function(n){if(!Xr(n))throw TypeError(n+" is not an object!");return n},Me=function(n){try{return!!n()}catch{return!0}},U=!Me(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),de,nn;function Qn(){if(nn)return de;nn=1;var n=M,e=j.document,r=n(e)&&n(e.createElement);return de=function(t){return r?e.createElement(t):{}},de}var Yr=!U&&!Me(function(){return Object.defineProperty(Qn()("div"),"a",{get:function(){return 7}}).a!=7}),W=M,Zr=function(n,e){if(!W(n))return n;var r,t;if(e&&typeof(r=n.toString)=="function"&&!W(t=r.call(n))||typeof(r=n.valueOf)=="function"&&!W(t=r.call(n))||!e&&typeof(r=n.toString)=="function"&&!W(t=r.call(n)))return t;throw TypeError("Can't convert object to primitive value")},rn=qe,kr=Yr,et=Zr,nt=Object.defineProperty;H.f=U?Object.defineProperty:function(e,r,t){if(rn(e),r=et(r,!0),rn(t),kr)try{return nt(e,r,t)}catch{}if("get"in t||"set"in t)throw TypeError("Accessors not supported!");return"value"in t&&(e[r]=t.value),e};var Kn=function(n,e){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:e}},rt=H,tt=Kn,L=U?function(n,e,r){return rt.f(n,e,tt(1,r))}:function(n,e,r){return n[e]=r,n},zn={exports:{}},it={}.hasOwnProperty,ne=function(n,e){return it.call(n,e)},at=0,ut=Math.random(),Le=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++at+ut).toString(36))},ot=j,Q=L,tn=ne,fe=Le("src"),Ne="toString",De=Function[Ne],st=(""+De).split(Ne);Re.inspectSource=function(n){return De.call(n)};(zn.exports=function(n,e,r,t){var a=typeof r=="function";a&&(tn(r,"name")||Q(r,"name",e)),n[e]!==r&&(a&&(tn(r,fe)||Q(r,fe,n[e]?""+n[e]:st.join(String(e)))),n===ot?n[e]=r:t?n[e]?n[e]=r:Q(n,e,r):(delete n[e],Q(n,e,r)))})(Function.prototype,Ne,function(){return typeof this=="function"&&this[fe]||De.call(this)});var Fe=zn.exports,Xn=function(n){if(typeof n!="function")throw TypeError(n+" is not a function!");return n},ct=Xn,Yn=function(n,e,r){if(ct(n),e===void 0)return n;switch(r){case 1:return function(t){return n.call(e,t)};case 2:return function(t,a){return n.call(e,t,a)};case 3:return function(t,a,u){return n.call(e,t,a,u)}}return function(){return n.apply(e,arguments)}},q=j,Z=Re,dt=L,ft=Fe,an=Yn,ve="prototype",h=function(n,e,r){var t=n&h.F,a=n&h.G,u=n&h.S,o=n&h.P,s=n&h.B,d=a?q:u?q[e]||(q[e]={}):(q[e]||{})[ve],f=a?Z:Z[e]||(Z[e]={}),l=f[ve]||(f[ve]={}),c,b,v,R;a&&(r=e);for(c in r)b=!t&&d&&d[c]!==void 0,v=(b?d:r)[c],R=s&&b?an(v,q):o&&typeof v=="function"?an(Function.call,v):v,d&&ft(d,c,v,n&h.U),f[c]!=v&&dt(f,c,R),o&&l[c]!=v&&(l[c]=v)};q.core=Z;h.F=1;h.G=2;h.S=4;h.P=8;h.B=16;h.W=32;h.U=64;h.R=128;var I=h,vt={}.toString,He=function(n){return vt.call(n).slice(8,-1)},lt=He,Zn=Object("z").propertyIsEnumerable(0)?Object:function(n){return lt(n)=="String"?n.split(""):Object(n)},Ue=function(n){if(n==null)throw TypeError("Can't call method on "+n);return n},ht=Ue,kn=function(n){return Object(ht(n))},bt=Math.ceil,pt=Math.floor,er=function(n){return isNaN(n=+n)?0:(n>0?pt:bt)(n)},yt=er,_t=Math.min,nr=function(n){return n>0?_t(yt(n),9007199254740991):0},gt=He,Ot=Array.isArray||function(e){return gt(e)=="Array"},rr={exports:{}},tr={exports:{}},$t=Re,un=j,on="__core-js_shared__",sn=un[on]||(un[on]={});(tr.exports=function(n,e){return sn[n]||(sn[n]=e!==void 0?e:{})})("versions",[]).push({version:$t.version,mode:"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"});var ir=tr.exports,Ie=ir("wks"),mt=Le,Te=j.Symbol,cn=typeof Te=="function",Et=rr.exports=function(n){return Ie[n]||(Ie[n]=cn&&Te[n]||(cn?Te:mt)("Symbol."+n))};Et.store=Ie;var T=rr.exports,Ct=M,dn=Ot,St=T("species"),At=function(n){var e;return dn(n)&&(e=n.constructor,typeof e=="function"&&(e===Array||dn(e.prototype))&&(e=void 0),Ct(e)&&(e=e[St],e===null&&(e=void 0))),e===void 0?Array:e},It=At,Tt=function(n,e){return new(It(n))(e)},wt=Yn,jt=Zn,Pt=kn,xt=nr,Rt=Tt,Ge=function(n,e){var r=n==1,t=n==2,a=n==3,u=n==4,o=n==6,s=n==5||o,d=e||Rt;return function(f,l,c){for(var b=Pt(f),v=jt(b),R=wt(l,c,3),N=xt(v.length),p=0,A=r?d(f,N):t?d(f,0):void 0,_,g;N>p;p++)if((s||p in v)&&(_=v[p],g=R(_,p,b),n)){if(r)A[p]=g;else if(g)switch(n){case 3:return!0;case 5:return _;case 6:return p;case 2:A.push(_)}else if(u)return!1}return o?-1:a||u?u:A}},le,fn;function re(){if(fn)return le;fn=1;var n=T("unscopables"),e=Array.prototype;return e[n]==null&&L(e,n,{}),le=function(r){e[n][r]=!0},le}var he=I,qt=Ge(6),we="findIndex",ar=!0;we in[]&&Array(1)[we](function(){ar=!1});he(he.P+he.F*ar,"Array",{findIndex:function(e){return qt(this,e,arguments.length>1?arguments[1]:void 0)}});re()(we);var be=I,Mt=Ge(5),je="find",ur=!0;je in[]&&Array(1)[je](function(){ur=!1});be(be.P+be.F*ur,"Array",{find:function(e){return Mt(this,e,arguments.length>1?arguments[1]:void 0)}});re()(je);var Lt=H.f,vn=Function.prototype,Nt=/^\s*function ([^ (]*)/,ln="name";ln in vn||U&&Lt(vn,ln,{configurable:!0,get:function(){try{return(""+this).match(Nt)[1]}catch{return""}}});var Dt=function(n,e){return{value:e,done:!!n}},Ve={},Ft=Zn,Ht=Ue,Je=function(n){return Ft(Ht(n))},Ut=er,Gt=Math.max,Vt=Math.min,Jt=function(n,e){return n=Ut(n),n<0?Gt(n+e,0):Vt(n,e)},Bt=Je,Wt=nr,Qt=Jt,Be=function(n){return function(e,r,t){var a=Bt(e),u=Wt(a.length),o=Qt(t,u),s;if(n&&r!=r){for(;u>o;)if(s=a[o++],s!=s)return!0}else for(;u>o;o++)if((n||o in a)&&a[o]===r)return n||o||0;return!n&&-1}},hn=ir("keys"),Kt=Le,We=function(n){return hn[n]||(hn[n]=Kt(n))},bn=ne,zt=Je,Xt=Be(!1),Yt=We("IE_PROTO"),Zt=function(n,e){var r=zt(n),t=0,a=[],u;for(u in r)u!=Yt&&bn(r,u)&&a.push(u);for(;e.length>t;)bn(r,u=e[t++])&&(~Xt(a,u)||a.push(u));return a},or="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),kt=Zt,ei=or,sr=Object.keys||function(e){return kt(e,ei)},ni=H,ri=qe,ti=sr,ii=U?Object.defineProperties:function(e,r){ri(e);for(var t=ti(r),a=t.length,u=0,o;a>u;)ni.f(e,o=t[u++],r[o]);return e},pe,pn;function ai(){if(pn)return pe;pn=1;var n=j.document;return pe=n&&n.documentElement,pe}var ui=qe,oi=ii,yn=or,si=We("IE_PROTO"),ye=function(){},Pe="prototype",k=function(){var n=Qn()("iframe"),e=yn.length,r="<",t=">",a;for(n.style.display="none",ai().appendChild(n),n.src="javascript:",a=n.contentWindow.document,a.open(),a.write(r+"script"+t+"document.F=Object"+r+"/script"+t),a.close(),k=a.F;e--;)delete k[Pe][yn[e]];return k()},ci=Object.create||function(e,r){var t;return e!==null?(ye[Pe]=ui(e),t=new ye,ye[Pe]=null,t[si]=e):t=k(),r===void 0?t:oi(t,r)},di=H.f,fi=ne,_n=T("toStringTag"),cr=function(n,e,r){n&&!fi(n=r?n:n.prototype,_n)&&di(n,_n,{configurable:!0,value:e})},vi=ci,li=Kn,hi=cr,dr={};L(dr,T("iterator"),function(){return this});var bi=function(n,e,r){n.prototype=vi(dr,{next:li(1,r)}),hi(n,e+" Iterator")},pi=ne,yi=kn,gn=We("IE_PROTO"),_i=Object.prototype,gi=Object.getPrototypeOf||function(n){return n=yi(n),pi(n,gn)?n[gn]:typeof n.constructor=="function"&&n instanceof n.constructor?n.constructor.prototype:n instanceof Object?_i:null},_e=I,Oi=Fe,On=L,$n=Ve,$i=bi,mi=cr,Ei=gi,D=T("iterator"),ge=!([].keys&&"next"in[].keys()),Ci="@@iterator",mn="keys",K="values",En=function(){return this},Si=function(n,e,r,t,a,u,o){$i(r,e,t);var s=function(g){if(!ge&&g in c)return c[g];switch(g){case mn:return function(){return new r(this,g)};case K:return function(){return new r(this,g)}}return function(){return new r(this,g)}},d=e+" Iterator",f=a==K,l=!1,c=n.prototype,b=c[D]||c[Ci]||a&&c[a],v=b||s(a),R=a?f?s("entries"):v:void 0,N=e=="Array"&&c.entries||b,p,A,_;if(N&&(_=Ei(N.call(new n)),_!==Object.prototype&&_.next&&(mi(_,d,!0),typeof _[D]!="function"&&On(_,D,En))),f&&b&&b.name!==K&&(l=!0,v=function(){return b.call(this)}),(ge||l||!c[D])&&On(c,D,v),$n[e]=v,$n[d]=En,a)if(p={values:f?v:s(K),keys:u?v:s(mn),entries:R},o)for(A in p)A in c||Oi(c,A,p[A]);else _e(_e.P+_e.F*(ge||l),e,p);return p},Qe=re(),z=Dt,Cn=Ve,Ai=Je,Ii=Si(Array,"Array",function(n,e){this._t=Ai(n),this._i=0,this._k=e},function(){var n=this._t,e=this._k,r=this._i++;return!n||r>=n.length?(this._t=void 0,z(1)):e=="keys"?z(0,r):e=="values"?z(0,n[r]):z(0,[r,n[r]])},"values");Cn.Arguments=Cn.Array;Qe("keys");Qe("values");Qe("entries");var Sn=Ii,Ti=sr,wi=Fe,ji=j,An=L,fr=Ve,vr=T,In=vr("iterator"),Tn=vr("toStringTag"),wn=fr.Array,jn={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1};for(var Pn=Ti(jn),Oe=0;Oe<Pn.length;Oe++){var X=Pn[Oe],Pi=jn[X],xn=ji[X],w=xn&&xn.prototype,Y;if(w&&(w[In]||An(w,In,wn),w[Tn]||An(w,Tn,X),fr[X]=wn,Pi))for(Y in Sn)w[Y]||wi(w,Y,Sn[Y],!0)}var xi=Me,lr=function(n,e){return!!n&&xi(function(){e?n.call(null,function(){},1):n.call(null)})},$e=I,Ri=Ge(0),qi=lr([].forEach,!0);$e($e.P+$e.F*!qi,"Array",{forEach:function(e){return Ri(this,e,arguments[1])}});function Mi(n){if(Array.isArray(n)){for(var e=0,r=new Array(n.length);e<n.length;e++)r[e]=n[e];return r}}var Li=Mi;function Ni(n){if(Symbol.iterator in Object(n)||Object.prototype.toString.call(n)==="[object Arguments]")return Array.from(n)}var Di=Ni;function Fi(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var Hi=Fi,Ui=Li,Gi=Di,Vi=Hi;function Ji(n){return Ui(n)||Gi(n)||Vi()}var Bi=Ji;const F=ee(Bi);var Rn=I,Wi=Be(!0);Rn(Rn.P,"Array",{includes:function(e){return Wi(this,e,arguments.length>1?arguments[1]:void 0)}});re()("includes");var Qi=M,Ki=He,zi=T("match"),Xi=function(n){var e;return Qi(n)&&((e=n[zi])!==void 0?!!e:Ki(n)=="RegExp")},Yi=Xi,Zi=Ue,ki=function(n,e,r){if(Yi(e))throw TypeError("String#"+r+" doesn't accept regex!");return String(Zi(n))},me,qn;function ea(){if(qn)return me;qn=1;var n=T("match");return me=function(e){var r=/./;try{"/./"[e](r)}catch{try{return r[n]=!1,!"/./"[e](r)}catch{}}return!0},me}var Ee=I,na=ki,Mn="includes";Ee(Ee.P+Ee.F*ea()(Mn),"String",{includes:function(e){return!!~na(this,e,Mn).indexOf(e,arguments.length>1?arguments[1]:void 0)}});function ra(n,e,r){return e in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}var ta=ra,ia=ta;function aa(n){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{},t=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),t.forEach(function(a){ia(n,a,r[a])})}return n}var ua=aa;const O=ee(ua);function oa(n,e){if(n==null)return{};var r={},t=Object.keys(n),a,u;for(u=0;u<t.length;u++)a=t[u],!(e.indexOf(a)>=0)&&(r[a]=n[a]);return r}var sa=oa,ca=sa;function da(n,e){if(n==null)return{};var r=ca(n,e),t,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(n);for(a=0;a<u.length;a++)t=u[a],!(e.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}var fa=da;const te=ee(fa);var Ce=I,va=Be(!1),xe=[].indexOf,Ln=!!xe&&1/[1].indexOf(1,-0)<0;Ce(Ce.P+Ce.F*(Ln||!lr(xe)),"Array",{indexOf:function(e){return Ln?xe.apply(this,arguments)||0:va(this,e,arguments[1])}});var Se,Nn;function la(){return Nn||(Nn=1,Se=function(n,e,r){var t=r===void 0;switch(e.length){case 0:return t?n():n.call(r);case 1:return t?n(e[0]):n.call(r,e[0]);case 2:return t?n(e[0],e[1]):n.call(r,e[0],e[1]);case 3:return t?n(e[0],e[1],e[2]):n.call(r,e[0],e[1],e[2]);case 4:return t?n(e[0],e[1],e[2],e[3]):n.call(r,e[0],e[1],e[2],e[3])}return n.apply(r,e)}),Se}var Ae,Dn;function ha(){if(Dn)return Ae;Dn=1;var n=Xn,e=M,r=la(),t=[].slice,a={},u=function(o,s,d){if(!(s in a)){for(var f=[],l=0;l<s;l++)f[l]="a["+l+"]";a[s]=Function("F,a","return new F("+f.join(",")+")")}return a[s](o,d)};return Ae=Function.bind||function(s){var d=n(this),f=t.call(arguments,1),l=function(){var c=f.concat(t.call(arguments));return this instanceof l?u(d,c.length,c):r(d,c,s)};return e(d.prototype)&&(l.prototype=d.prototype),l},Ae}var Fn=I;Fn(Fn.P,"Function",{bind:ha()});function ba(n,e){if(n!==e)throw new TypeError("Cannot instantiate an arrow function")}var pa=ba;const i=ee(pa);var ya=void 0,Ke=function(e){var r=e.activeObservers,t=e.canceledObservers,a=te(e,["activeObservers","canceledObservers"]);return i(this,ya),O({},a,{isActive:!1,activeObservers:[],canceledObservers:F(r).concat(F(t))})}.bind(void 0),ze=void 0,_a=function(e,r){var t=this;return i(this,ze),function(a){return i(this,t),a[e]&&a[e](r)}.bind(this)}.bind(void 0),ga=function(e){var r=e.name;return i(this,ze),"on".concat(r)}.bind(void 0),Xe=function(e,r){return i(this,ze),e.forEach(_a(ga(r),r.payload))}.bind(void 0),Oa=void 0,hr=function(e,r){return i(this,Oa),Xe(e.canceledObservers,r),e}.bind(void 0),G={abort:"Abort",cancel:"Cancel",error:"Error",result:"Result",start:"Start"},V=void 0,$a=function(e){return i(this,V),{payload:e,name:G.start}}.bind(void 0),ma=function(e){return i(this,V),{payload:e,name:G.result}}.bind(void 0),ie=function(e){return i(this,V),{payload:e,name:G.error}}.bind(void 0),Ea=function(){return i(this,V),{name:G.cancel,payload:void 0}}.bind(void 0),Ca=function(e){return i(this,V),{payload:e,name:G.abort}}.bind(void 0),br=void 0,Sa=function(e){return i(this,br),O({},e,{canceledObservers:[]})}.bind(void 0),J=function(e){return i(this,br),e.canceledObservers.length>0?Sa(hr(e,Ea())):e}.bind(void 0),Aa=void 0,pr=function(e,r,t){return i(this,Aa),e.findIndex(Vn([r],t))}.bind(void 0),Ia=void 0,Ye=function(e){var r=this;return i(this,Ia),function(t){return i(this,r),Br(pr(t,"request",e.request),[e],t)}.bind(this)}.bind(void 0),Ta=void 0,B=function(e){var r=this;return i(this,Ta),function(t){return i(this,r),Jn(pr(t,"request",e.request),1,t)}.bind(this)}.bind(void 0),wa=void 0,E=function(e,r){return i(this,wa),e.notifiers=r(e.notifiers),e}.bind(void 0),ja=void 0,C=function(e,r){return i(this,ja),E(e,Ye(r)),r}.bind(void 0),$={canceled:"canceled",canceling:"canceling",pending:"pending",sent:"sent",sending:"sending"},yr=void 0,Pa=function(e){var r=e.activeObservers,t=e.canceledObservers;return i(this,yr),F(r).concat(F(t))}.bind(void 0),_r=function(e,r){return i(this,yr),Xe(Pa(e),r),e}.bind(void 0),xa=void 0,Ze=function(e,r,t){return i(this,xa),E(e,B(_r(r,Ca(t))))}.bind(void 0),Ra=void 0,ae=function(e,r,t){return i(this,Ra),e.find(Vn([r],t))}.bind(void 0),qa=void 0,ue=function(e,r){return i(this,qa),Xe(e.activeObservers,r),e}.bind(void 0),Ma=void 0,gr=function(e,r){return i(this,Ma),ue(e,ma(r))}.bind(void 0),La=void 0,Or=function(e){return i(this,La),ue(e,$a(e))}.bind(void 0),Na=void 0,$r=function(e){return i(this,Na),J(O({},e,{isActive:!0,requestStatus:$.pending,subscriptionId:void 0}))}.bind(void 0),Da=void 0,mr=function(e,r){return i(this,Da),e.receive("ok",r.onSucceed).receive("error",r.onError).receive("timeout",r.onTimeout)}.bind(void 0),ke=void 0,Fa=function(e,r){var t=this;return i(this,ke),function(a){var u=this;return i(this,t),function(){i(this,u);var o=ae(e.notifiers,"request",r);if(o){for(var s=arguments.length,d=new Array(s),f=0;f<s;f++)d[f]=arguments[f];a.apply(void 0,[e,o].concat(d))}}.bind(this)}.bind(this)}.bind(void 0),Ha=function(e,r,t){return i(this,ke),Hr(Fa(e,r),t)}.bind(void 0),Er=function(e,r,t,a){return i(this,ke),mr(e.channel.push(a.name,a.payload),Ha(e,r,t)),e}.bind(void 0),Cr={doc:"doc",unsubscribe:"unsubscribe"},Sr=void 0,Ua=function(e){return i(this,Sr),{payload:e,name:Cr.unsubscribe}}.bind(void 0),Ga=function(e){return i(this,Sr),{payload:e,name:Cr.doc}}.bind(void 0),P=void 0,Va=function(e,r,t){var a=r.request;return i(this,P),Er(e,a,t,Ga(Ur(a)))}.bind(void 0),Ja=function(e,r){return i(this,P),C(e,O({},r,{requestStatus:$.sending}))}.bind(void 0),Ar=function(e){return i(this,P),new Error("request: ".concat(e))}.bind(void 0),Ba=function(e,r){return i(this,P),ue(r,ie(Ar("timeout")))}.bind(void 0),Ir=function(e,r,t){return i(this,P),Ze(e,r,Ar(t))}.bind(void 0),Wa=function(e){return i(this,P),{onError:Ir,onSucceed:e,onTimeout:Ba}}.bind(void 0),Tr=function(e,r,t){return i(this,P),Va(e,Ja(e,r),Wa(t))}.bind(void 0),y=void 0,Qa=function(e,r){return i(this,y),E(e,B(J(r)))}.bind(void 0),Ka=function(e,r){return i(this,y),jr(e,C(e,$r(r)))}.bind(void 0),Hn=function(e){return i(this,y),new Error("unsubscribe: ".concat(e))}.bind(void 0),za={onError:function(e,r,t){return i(this,y),Ze(e,r,Hn(t))}.bind(void 0),onTimeout:function(e,r){return i(this,y),hr(r,ie(Hn("timeout")))}.bind(void 0),onSucceed:function(e,r){i(this,y),r.isActive?Ka(e,r):Qa(e,r)}.bind(void 0)},Xa=function(e,r){var t=r.request,a=r.subscriptionId;return i(this,y),Er(e,t,za,Ua({subscriptionId:a}))}.bind(void 0),wr=function(e,r){return i(this,y),Xa(e,C(e,O({},r,{requestStatus:$.canceling})))}.bind(void 0),Ya=function(e,r,t){var a=t.subscriptionId;i(this,y);var u=C(e,O({},r,{subscriptionId:a,requestStatus:$.sent}));u.isActive?Or(u):wr(e,u)}.bind(void 0),Za=function(e,r,t){i(this,y),t.errors?Ir(e,r,Gr(t.errors)):Ya(e,r,t)}.bind(void 0),jr=function(e,r){return i(this,y),Tr(e,r,Za)}.bind(void 0),ka=function(e,r){var t=r.payload;i(this,y);var a=ae(e.notifiers,"subscriptionId",t.subscriptionId);a&&gr(a,t.result)}.bind(void 0),eu="subscription:data",nu=function(e){return i(this,y),e.event===eu}.bind(void 0),S=void 0,ru=function(e,r){return i(this,S),E(e,Ye(J(Ke(r))))}.bind(void 0),tu=function(e,r){return i(this,S),r.requestStatus===$.sending?ru(e,r):e}.bind(void 0),Pr=function(e,r){return i(this,S),E(e,B(J(Ke(r))))}.bind(void 0),iu=function(e,r){return i(this,S),r.requestStatus===$.pending?Pr(e,r):tu(e,r)}.bind(void 0),au=function(e,r){return i(this,S),r.requestStatus===$.sent?wr(e,r):e}.bind(void 0),uu=function(e,r){return i(this,S),au(e,C(e,Ke(r)))}.bind(void 0),ou=function(e,r){return i(this,S),r.requestStatus===$.pending?Pr(e,r):uu(e,r)}.bind(void 0),su=function(e,r){return i(this,S),r.operationType==="subscription"?ou(e,r):iu(e,r)}.bind(void 0),cu=function(e,r){return i(this,S),r.isActive?su(e,r):e}.bind(void 0),oe=void 0,du=function(e,r){return i(this,oe),C(e,O({},r,{requestStatus:$.sent}))}.bind(void 0),fu=function(e,r,t){return i(this,oe),E(e,B(gr(du(e,r),t)))}.bind(void 0),vu=function(e,r){return i(this,oe),Tr(e,Or(r),fu)}.bind(void 0),xr=function(e,r){i(this,oe),r.operationType==="subscription"?jr(e,r):vu(e,r)}.bind(void 0),se=void 0,lu=function(e){return i(this,se),new Error("channel join: ".concat(e))}.bind(void 0),Un=function(e,r){var t=this;return i(this,se),e.notifiers.forEach(function(a){return i(this,t),ue(a,ie(lu(r)))}.bind(this))}.bind(void 0),hu=function(e){var r=this;return i(this,se),{onError:function(a){return i(this,r),Un(e,a)}.bind(this),onSucceed:function(){var a=this;return i(this,r),e.notifiers.forEach(function(u){return i(this,a),xr(e,u)}.bind(this))}.bind(this),onTimeout:function(){return i(this,r),Un(e,"timeout")}.bind(this)}}.bind(void 0),Rr=function(e){return i(this,se),mr(e.channel.join(),hu(e)),e.channelJoinCreated=!0,e}.bind(void 0),m=void 0,bu=function(e){var r=this;return i(this,m),function(t){i(this,r),nu(t)&&ka(e,t)}.bind(this)}.bind(void 0),qr=function(){return i(this,m),new Error("connection: close")}.bind(void 0),Mr=function(e){return i(this,m),_r(e,ie(qr()))}.bind(void 0),pu=function(e,r){return i(this,m),E(e,B(Mr(r)))}.bind(void 0),yu=function(e,r){i(this,m),r.operationType==="mutation"?Ze(e,r,qr()):C(e,$r(Mr(r)))}.bind(void 0),_u=function(e){var r=this;return i(this,m),function(t){i(this,r),t.isActive?yu(e,t):pu(e,t)}.bind(this)}.bind(void 0),gu=function(e){var r=this;return i(this,m),function(){return i(this,r),e.notifiers.forEach(_u(e))}.bind(this)}.bind(void 0),Ou=function(e){return i(this,m),!e.channelJoinCreated&&e.notifiers.length>0}.bind(void 0),$u=function(e){var r=this;return i(this,m),function(){i(this,r),Ou(e)&&Rr(e)}.bind(this)}.bind(void 0),mu="__absinthe__:control";(function(e){i(this,m);var r={phoenixSocket:e,channel:e.channel(mu),channelJoinCreated:!1,notifiers:[]};return e.onOpen($u(r)),e.onClose(gu(r)),e.onMessage(bu(r)),r}).bind(void 0);var Eu=void 0,Cu=function(e,r){var t=e.activeObservers,a=te(e,["activeObservers"]);return i(this,Eu),O({},a,{activeObservers:F(t).concat([r]),isActive:!0})}.bind(void 0),Su=void 0,Au=function(e,r,t){return i(this,Su),C(e,Cu(r,t))}.bind(void 0),Lr=void 0,Iu=function(e,r){return i(this,Lr),{operationType:r,request:e,activeObservers:[],canceledObservers:[],isActive:!0,requestStatus:$.pending,subscriptionId:void 0}}.bind(void 0),Tu=function(e){return i(this,Lr),Iu(e,Vr(e.operation))}.bind(void 0),wu=void 0,ju=function(e){return i(this,wu),e.isActive?e:O({},e,{isActive:!0})}.bind(void 0),x=void 0,Pu=function(e){i(this,x),e.phoenixSocket.isConnected()?Rr(e):e.phoenixSocket.connect()}.bind(void 0),xu=function(e,r){i(this,x);var t=Tu(r);return E(e,Wr([t])),e.channelJoinCreated?xr(e,t):Pu(e),t}.bind(void 0),Gn=function(e,r){return i(this,x),C(e,ju(r))}.bind(void 0),Ru=function(e,r){return i(this,x),r.requestStatus===$.sending?Gn(e,J(r)):Gn(e,r)}.bind(void 0),qu=function(e,r){return i(this,x),r.isActive?r:Ru(e,r)}.bind(void 0),Mu=function(e,r){i(this,x);var t=ae(e.notifiers,"request",r);return t&&qu(e,t)}.bind(void 0);(function(e,r){return i(this,x),Mu(e,r)||xu(e,r)}).bind(void 0);var ce=void 0,Lu=function(e,r,t,a){var u=this,o=r.request;return i(this,ce),function(){i(this,u);var s=ae(e.notifiers,"request",o);a(e,s,s?t:void 0)}.bind(this)}.bind(void 0),Nu=function(e,r){var t=this,a=e.operationType;return i(this,ce),function(u){i(this,t),r.next(u),a!=="subscription"&&r.complete()}.bind(this)}.bind(void 0),Du=function(e,r,t){return i(this,ce),O({},r,{onAbort:t.error.bind(t),onResult:Nu(e,t)})}.bind(void 0);(function(e,r){var t=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=a.unsubscribe,o=te(a,["unsubscribe"]);return i(this,ce),new Jr(function(s){i(this,t);var d=Du(r,o,s);return Au(e,r,d),u&&Lu(e,r,d,u)}.bind(this))}).bind(void 0);var Nr=void 0,Fu=function(e,r){return i(this,Nr),Jn(e.indexOf(r),1,e)}.bind(void 0),Hu=function(e,r){var t=e.activeObservers,a=te(e,["activeObservers"]);return i(this,Nr),O({},a,{activeObservers:Fu(t,r)})}.bind(void 0),Dr=void 0,Uu=function(e,r){if(i(this,Dr),e.activeObservers.includes(r))return e;throw new Error("Observer is not attached to notifier")}.bind(void 0),Gu=function(e,r,t){return i(this,Dr),E(e,Ye(Hu(Uu(r,t),t)))}.bind(void 0),Fr=void 0,Vu=function(e,r,t){return i(this,Fr),r.activeObservers.length===1?cu(e,r):Gu(e,r,t)}.bind(void 0);(function(e,r,t){return i(this,Fr),r.isActive?Vu(e,r,t):e}).bind(void 0);export{Ku as c,ee as g};
|
|
1
|
+
import{h as Vn,m as Hr}from"./vendor.jumpn.utils-composite.js";import{r as Ur,e as Gr,g as Vr}from"./vendor.jumpn.utils-graphql.js";import{O as Jr}from"./vendor.zen-observable.js";import{r as Br,a as Jn,b as Wr}from"./vendor.jumpn.utils-array.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="684048b0-9221-4231-9e7e-b380bfbedd27",n._sentryDebugIdIdentifier="sentry-dbid-684048b0-9221-4231-9e7e-b380bfbedd27")}catch{}})();var Qr=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};Qr.SENTRY_RELEASE={id:"8a658da76d92ed67918e04de50c577661e1cfdae"};var Ku=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ee(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bn={exports:{}},Kr=Bn.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=Kr);var j=Bn.exports,Wn={exports:{}},zr=Wn.exports={version:"2.6.0"};typeof __e=="number"&&(__e=zr);var Re=Wn.exports,H={},M=function(n){return typeof n=="object"?n!==null:typeof n=="function"},Xr=M,qe=function(n){if(!Xr(n))throw TypeError(n+" is not an object!");return n},Me=function(n){try{return!!n()}catch{return!0}},U=!Me(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),de,nn;function Qn(){if(nn)return de;nn=1;var n=M,e=j.document,r=n(e)&&n(e.createElement);return de=function(t){return r?e.createElement(t):{}},de}var Yr=!U&&!Me(function(){return Object.defineProperty(Qn()("div"),"a",{get:function(){return 7}}).a!=7}),W=M,Zr=function(n,e){if(!W(n))return n;var r,t;if(e&&typeof(r=n.toString)=="function"&&!W(t=r.call(n))||typeof(r=n.valueOf)=="function"&&!W(t=r.call(n))||!e&&typeof(r=n.toString)=="function"&&!W(t=r.call(n)))return t;throw TypeError("Can't convert object to primitive value")},rn=qe,kr=Yr,et=Zr,nt=Object.defineProperty;H.f=U?Object.defineProperty:function(e,r,t){if(rn(e),r=et(r,!0),rn(t),kr)try{return nt(e,r,t)}catch{}if("get"in t||"set"in t)throw TypeError("Accessors not supported!");return"value"in t&&(e[r]=t.value),e};var Kn=function(n,e){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:e}},rt=H,tt=Kn,L=U?function(n,e,r){return rt.f(n,e,tt(1,r))}:function(n,e,r){return n[e]=r,n},zn={exports:{}},it={}.hasOwnProperty,ne=function(n,e){return it.call(n,e)},at=0,ut=Math.random(),Le=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++at+ut).toString(36))},ot=j,Q=L,tn=ne,fe=Le("src"),Ne="toString",De=Function[Ne],st=(""+De).split(Ne);Re.inspectSource=function(n){return De.call(n)};(zn.exports=function(n,e,r,t){var a=typeof r=="function";a&&(tn(r,"name")||Q(r,"name",e)),n[e]!==r&&(a&&(tn(r,fe)||Q(r,fe,n[e]?""+n[e]:st.join(String(e)))),n===ot?n[e]=r:t?n[e]?n[e]=r:Q(n,e,r):(delete n[e],Q(n,e,r)))})(Function.prototype,Ne,function(){return typeof this=="function"&&this[fe]||De.call(this)});var Fe=zn.exports,Xn=function(n){if(typeof n!="function")throw TypeError(n+" is not a function!");return n},ct=Xn,Yn=function(n,e,r){if(ct(n),e===void 0)return n;switch(r){case 1:return function(t){return n.call(e,t)};case 2:return function(t,a){return n.call(e,t,a)};case 3:return function(t,a,u){return n.call(e,t,a,u)}}return function(){return n.apply(e,arguments)}},q=j,Z=Re,dt=L,ft=Fe,an=Yn,ve="prototype",h=function(n,e,r){var t=n&h.F,a=n&h.G,u=n&h.S,o=n&h.P,s=n&h.B,d=a?q:u?q[e]||(q[e]={}):(q[e]||{})[ve],f=a?Z:Z[e]||(Z[e]={}),l=f[ve]||(f[ve]={}),c,b,v,R;a&&(r=e);for(c in r)b=!t&&d&&d[c]!==void 0,v=(b?d:r)[c],R=s&&b?an(v,q):o&&typeof v=="function"?an(Function.call,v):v,d&&ft(d,c,v,n&h.U),f[c]!=v&&dt(f,c,R),o&&l[c]!=v&&(l[c]=v)};q.core=Z;h.F=1;h.G=2;h.S=4;h.P=8;h.B=16;h.W=32;h.U=64;h.R=128;var I=h,vt={}.toString,He=function(n){return vt.call(n).slice(8,-1)},lt=He,Zn=Object("z").propertyIsEnumerable(0)?Object:function(n){return lt(n)=="String"?n.split(""):Object(n)},Ue=function(n){if(n==null)throw TypeError("Can't call method on "+n);return n},ht=Ue,kn=function(n){return Object(ht(n))},bt=Math.ceil,pt=Math.floor,er=function(n){return isNaN(n=+n)?0:(n>0?pt:bt)(n)},yt=er,_t=Math.min,nr=function(n){return n>0?_t(yt(n),9007199254740991):0},gt=He,Ot=Array.isArray||function(e){return gt(e)=="Array"},rr={exports:{}},tr={exports:{}},$t=Re,un=j,on="__core-js_shared__",sn=un[on]||(un[on]={});(tr.exports=function(n,e){return sn[n]||(sn[n]=e!==void 0?e:{})})("versions",[]).push({version:$t.version,mode:"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"});var ir=tr.exports,Ie=ir("wks"),mt=Le,Te=j.Symbol,cn=typeof Te=="function",Et=rr.exports=function(n){return Ie[n]||(Ie[n]=cn&&Te[n]||(cn?Te:mt)("Symbol."+n))};Et.store=Ie;var T=rr.exports,Ct=M,dn=Ot,St=T("species"),At=function(n){var e;return dn(n)&&(e=n.constructor,typeof e=="function"&&(e===Array||dn(e.prototype))&&(e=void 0),Ct(e)&&(e=e[St],e===null&&(e=void 0))),e===void 0?Array:e},It=At,Tt=function(n,e){return new(It(n))(e)},wt=Yn,jt=Zn,Pt=kn,xt=nr,Rt=Tt,Ge=function(n,e){var r=n==1,t=n==2,a=n==3,u=n==4,o=n==6,s=n==5||o,d=e||Rt;return function(f,l,c){for(var b=Pt(f),v=jt(b),R=wt(l,c,3),N=xt(v.length),p=0,A=r?d(f,N):t?d(f,0):void 0,_,g;N>p;p++)if((s||p in v)&&(_=v[p],g=R(_,p,b),n)){if(r)A[p]=g;else if(g)switch(n){case 3:return!0;case 5:return _;case 6:return p;case 2:A.push(_)}else if(u)return!1}return o?-1:a||u?u:A}},le,fn;function re(){if(fn)return le;fn=1;var n=T("unscopables"),e=Array.prototype;return e[n]==null&&L(e,n,{}),le=function(r){e[n][r]=!0},le}var he=I,qt=Ge(6),we="findIndex",ar=!0;we in[]&&Array(1)[we](function(){ar=!1});he(he.P+he.F*ar,"Array",{findIndex:function(e){return qt(this,e,arguments.length>1?arguments[1]:void 0)}});re()(we);var be=I,Mt=Ge(5),je="find",ur=!0;je in[]&&Array(1)[je](function(){ur=!1});be(be.P+be.F*ur,"Array",{find:function(e){return Mt(this,e,arguments.length>1?arguments[1]:void 0)}});re()(je);var Lt=H.f,vn=Function.prototype,Nt=/^\s*function ([^ (]*)/,ln="name";ln in vn||U&&Lt(vn,ln,{configurable:!0,get:function(){try{return(""+this).match(Nt)[1]}catch{return""}}});var Dt=function(n,e){return{value:e,done:!!n}},Ve={},Ft=Zn,Ht=Ue,Je=function(n){return Ft(Ht(n))},Ut=er,Gt=Math.max,Vt=Math.min,Jt=function(n,e){return n=Ut(n),n<0?Gt(n+e,0):Vt(n,e)},Bt=Je,Wt=nr,Qt=Jt,Be=function(n){return function(e,r,t){var a=Bt(e),u=Wt(a.length),o=Qt(t,u),s;if(n&&r!=r){for(;u>o;)if(s=a[o++],s!=s)return!0}else for(;u>o;o++)if((n||o in a)&&a[o]===r)return n||o||0;return!n&&-1}},hn=ir("keys"),Kt=Le,We=function(n){return hn[n]||(hn[n]=Kt(n))},bn=ne,zt=Je,Xt=Be(!1),Yt=We("IE_PROTO"),Zt=function(n,e){var r=zt(n),t=0,a=[],u;for(u in r)u!=Yt&&bn(r,u)&&a.push(u);for(;e.length>t;)bn(r,u=e[t++])&&(~Xt(a,u)||a.push(u));return a},or="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),kt=Zt,ei=or,sr=Object.keys||function(e){return kt(e,ei)},ni=H,ri=qe,ti=sr,ii=U?Object.defineProperties:function(e,r){ri(e);for(var t=ti(r),a=t.length,u=0,o;a>u;)ni.f(e,o=t[u++],r[o]);return e},pe,pn;function ai(){if(pn)return pe;pn=1;var n=j.document;return pe=n&&n.documentElement,pe}var ui=qe,oi=ii,yn=or,si=We("IE_PROTO"),ye=function(){},Pe="prototype",k=function(){var n=Qn()("iframe"),e=yn.length,r="<",t=">",a;for(n.style.display="none",ai().appendChild(n),n.src="javascript:",a=n.contentWindow.document,a.open(),a.write(r+"script"+t+"document.F=Object"+r+"/script"+t),a.close(),k=a.F;e--;)delete k[Pe][yn[e]];return k()},ci=Object.create||function(e,r){var t;return e!==null?(ye[Pe]=ui(e),t=new ye,ye[Pe]=null,t[si]=e):t=k(),r===void 0?t:oi(t,r)},di=H.f,fi=ne,_n=T("toStringTag"),cr=function(n,e,r){n&&!fi(n=r?n:n.prototype,_n)&&di(n,_n,{configurable:!0,value:e})},vi=ci,li=Kn,hi=cr,dr={};L(dr,T("iterator"),function(){return this});var bi=function(n,e,r){n.prototype=vi(dr,{next:li(1,r)}),hi(n,e+" Iterator")},pi=ne,yi=kn,gn=We("IE_PROTO"),_i=Object.prototype,gi=Object.getPrototypeOf||function(n){return n=yi(n),pi(n,gn)?n[gn]:typeof n.constructor=="function"&&n instanceof n.constructor?n.constructor.prototype:n instanceof Object?_i:null},_e=I,Oi=Fe,On=L,$n=Ve,$i=bi,mi=cr,Ei=gi,D=T("iterator"),ge=!([].keys&&"next"in[].keys()),Ci="@@iterator",mn="keys",K="values",En=function(){return this},Si=function(n,e,r,t,a,u,o){$i(r,e,t);var s=function(g){if(!ge&&g in c)return c[g];switch(g){case mn:return function(){return new r(this,g)};case K:return function(){return new r(this,g)}}return function(){return new r(this,g)}},d=e+" Iterator",f=a==K,l=!1,c=n.prototype,b=c[D]||c[Ci]||a&&c[a],v=b||s(a),R=a?f?s("entries"):v:void 0,N=e=="Array"&&c.entries||b,p,A,_;if(N&&(_=Ei(N.call(new n)),_!==Object.prototype&&_.next&&(mi(_,d,!0),typeof _[D]!="function"&&On(_,D,En))),f&&b&&b.name!==K&&(l=!0,v=function(){return b.call(this)}),(ge||l||!c[D])&&On(c,D,v),$n[e]=v,$n[d]=En,a)if(p={values:f?v:s(K),keys:u?v:s(mn),entries:R},o)for(A in p)A in c||Oi(c,A,p[A]);else _e(_e.P+_e.F*(ge||l),e,p);return p},Qe=re(),z=Dt,Cn=Ve,Ai=Je,Ii=Si(Array,"Array",function(n,e){this._t=Ai(n),this._i=0,this._k=e},function(){var n=this._t,e=this._k,r=this._i++;return!n||r>=n.length?(this._t=void 0,z(1)):e=="keys"?z(0,r):e=="values"?z(0,n[r]):z(0,[r,n[r]])},"values");Cn.Arguments=Cn.Array;Qe("keys");Qe("values");Qe("entries");var Sn=Ii,Ti=sr,wi=Fe,ji=j,An=L,fr=Ve,vr=T,In=vr("iterator"),Tn=vr("toStringTag"),wn=fr.Array,jn={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1};for(var Pn=Ti(jn),Oe=0;Oe<Pn.length;Oe++){var X=Pn[Oe],Pi=jn[X],xn=ji[X],w=xn&&xn.prototype,Y;if(w&&(w[In]||An(w,In,wn),w[Tn]||An(w,Tn,X),fr[X]=wn,Pi))for(Y in Sn)w[Y]||wi(w,Y,Sn[Y],!0)}var xi=Me,lr=function(n,e){return!!n&&xi(function(){e?n.call(null,function(){},1):n.call(null)})},$e=I,Ri=Ge(0),qi=lr([].forEach,!0);$e($e.P+$e.F*!qi,"Array",{forEach:function(e){return Ri(this,e,arguments[1])}});function Mi(n){if(Array.isArray(n)){for(var e=0,r=new Array(n.length);e<n.length;e++)r[e]=n[e];return r}}var Li=Mi;function Ni(n){if(Symbol.iterator in Object(n)||Object.prototype.toString.call(n)==="[object Arguments]")return Array.from(n)}var Di=Ni;function Fi(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var Hi=Fi,Ui=Li,Gi=Di,Vi=Hi;function Ji(n){return Ui(n)||Gi(n)||Vi()}var Bi=Ji;const F=ee(Bi);var Rn=I,Wi=Be(!0);Rn(Rn.P,"Array",{includes:function(e){return Wi(this,e,arguments.length>1?arguments[1]:void 0)}});re()("includes");var Qi=M,Ki=He,zi=T("match"),Xi=function(n){var e;return Qi(n)&&((e=n[zi])!==void 0?!!e:Ki(n)=="RegExp")},Yi=Xi,Zi=Ue,ki=function(n,e,r){if(Yi(e))throw TypeError("String#"+r+" doesn't accept regex!");return String(Zi(n))},me,qn;function ea(){if(qn)return me;qn=1;var n=T("match");return me=function(e){var r=/./;try{"/./"[e](r)}catch{try{return r[n]=!1,!"/./"[e](r)}catch{}}return!0},me}var Ee=I,na=ki,Mn="includes";Ee(Ee.P+Ee.F*ea()(Mn),"String",{includes:function(e){return!!~na(this,e,Mn).indexOf(e,arguments.length>1?arguments[1]:void 0)}});function ra(n,e,r){return e in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}var ta=ra,ia=ta;function aa(n){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{},t=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable}))),t.forEach(function(a){ia(n,a,r[a])})}return n}var ua=aa;const O=ee(ua);function oa(n,e){if(n==null)return{};var r={},t=Object.keys(n),a,u;for(u=0;u<t.length;u++)a=t[u],!(e.indexOf(a)>=0)&&(r[a]=n[a]);return r}var sa=oa,ca=sa;function da(n,e){if(n==null)return{};var r=ca(n,e),t,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(n);for(a=0;a<u.length;a++)t=u[a],!(e.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}var fa=da;const te=ee(fa);var Ce=I,va=Be(!1),xe=[].indexOf,Ln=!!xe&&1/[1].indexOf(1,-0)<0;Ce(Ce.P+Ce.F*(Ln||!lr(xe)),"Array",{indexOf:function(e){return Ln?xe.apply(this,arguments)||0:va(this,e,arguments[1])}});var Se,Nn;function la(){return Nn||(Nn=1,Se=function(n,e,r){var t=r===void 0;switch(e.length){case 0:return t?n():n.call(r);case 1:return t?n(e[0]):n.call(r,e[0]);case 2:return t?n(e[0],e[1]):n.call(r,e[0],e[1]);case 3:return t?n(e[0],e[1],e[2]):n.call(r,e[0],e[1],e[2]);case 4:return t?n(e[0],e[1],e[2],e[3]):n.call(r,e[0],e[1],e[2],e[3])}return n.apply(r,e)}),Se}var Ae,Dn;function ha(){if(Dn)return Ae;Dn=1;var n=Xn,e=M,r=la(),t=[].slice,a={},u=function(o,s,d){if(!(s in a)){for(var f=[],l=0;l<s;l++)f[l]="a["+l+"]";a[s]=Function("F,a","return new F("+f.join(",")+")")}return a[s](o,d)};return Ae=Function.bind||function(s){var d=n(this),f=t.call(arguments,1),l=function(){var c=f.concat(t.call(arguments));return this instanceof l?u(d,c.length,c):r(d,c,s)};return e(d.prototype)&&(l.prototype=d.prototype),l},Ae}var Fn=I;Fn(Fn.P,"Function",{bind:ha()});function ba(n,e){if(n!==e)throw new TypeError("Cannot instantiate an arrow function")}var pa=ba;const i=ee(pa);var ya=void 0,Ke=function(e){var r=e.activeObservers,t=e.canceledObservers,a=te(e,["activeObservers","canceledObservers"]);return i(this,ya),O({},a,{isActive:!1,activeObservers:[],canceledObservers:F(r).concat(F(t))})}.bind(void 0),ze=void 0,_a=function(e,r){var t=this;return i(this,ze),function(a){return i(this,t),a[e]&&a[e](r)}.bind(this)}.bind(void 0),ga=function(e){var r=e.name;return i(this,ze),"on".concat(r)}.bind(void 0),Xe=function(e,r){return i(this,ze),e.forEach(_a(ga(r),r.payload))}.bind(void 0),Oa=void 0,hr=function(e,r){return i(this,Oa),Xe(e.canceledObservers,r),e}.bind(void 0),G={abort:"Abort",cancel:"Cancel",error:"Error",result:"Result",start:"Start"},V=void 0,$a=function(e){return i(this,V),{payload:e,name:G.start}}.bind(void 0),ma=function(e){return i(this,V),{payload:e,name:G.result}}.bind(void 0),ie=function(e){return i(this,V),{payload:e,name:G.error}}.bind(void 0),Ea=function(){return i(this,V),{name:G.cancel,payload:void 0}}.bind(void 0),Ca=function(e){return i(this,V),{payload:e,name:G.abort}}.bind(void 0),br=void 0,Sa=function(e){return i(this,br),O({},e,{canceledObservers:[]})}.bind(void 0),J=function(e){return i(this,br),e.canceledObservers.length>0?Sa(hr(e,Ea())):e}.bind(void 0),Aa=void 0,pr=function(e,r,t){return i(this,Aa),e.findIndex(Vn([r],t))}.bind(void 0),Ia=void 0,Ye=function(e){var r=this;return i(this,Ia),function(t){return i(this,r),Br(pr(t,"request",e.request),[e],t)}.bind(this)}.bind(void 0),Ta=void 0,B=function(e){var r=this;return i(this,Ta),function(t){return i(this,r),Jn(pr(t,"request",e.request),1,t)}.bind(this)}.bind(void 0),wa=void 0,E=function(e,r){return i(this,wa),e.notifiers=r(e.notifiers),e}.bind(void 0),ja=void 0,C=function(e,r){return i(this,ja),E(e,Ye(r)),r}.bind(void 0),$={canceled:"canceled",canceling:"canceling",pending:"pending",sent:"sent",sending:"sending"},yr=void 0,Pa=function(e){var r=e.activeObservers,t=e.canceledObservers;return i(this,yr),F(r).concat(F(t))}.bind(void 0),_r=function(e,r){return i(this,yr),Xe(Pa(e),r),e}.bind(void 0),xa=void 0,Ze=function(e,r,t){return i(this,xa),E(e,B(_r(r,Ca(t))))}.bind(void 0),Ra=void 0,ae=function(e,r,t){return i(this,Ra),e.find(Vn([r],t))}.bind(void 0),qa=void 0,ue=function(e,r){return i(this,qa),Xe(e.activeObservers,r),e}.bind(void 0),Ma=void 0,gr=function(e,r){return i(this,Ma),ue(e,ma(r))}.bind(void 0),La=void 0,Or=function(e){return i(this,La),ue(e,$a(e))}.bind(void 0),Na=void 0,$r=function(e){return i(this,Na),J(O({},e,{isActive:!0,requestStatus:$.pending,subscriptionId:void 0}))}.bind(void 0),Da=void 0,mr=function(e,r){return i(this,Da),e.receive("ok",r.onSucceed).receive("error",r.onError).receive("timeout",r.onTimeout)}.bind(void 0),ke=void 0,Fa=function(e,r){var t=this;return i(this,ke),function(a){var u=this;return i(this,t),function(){i(this,u);var o=ae(e.notifiers,"request",r);if(o){for(var s=arguments.length,d=new Array(s),f=0;f<s;f++)d[f]=arguments[f];a.apply(void 0,[e,o].concat(d))}}.bind(this)}.bind(this)}.bind(void 0),Ha=function(e,r,t){return i(this,ke),Hr(Fa(e,r),t)}.bind(void 0),Er=function(e,r,t,a){return i(this,ke),mr(e.channel.push(a.name,a.payload),Ha(e,r,t)),e}.bind(void 0),Cr={doc:"doc",unsubscribe:"unsubscribe"},Sr=void 0,Ua=function(e){return i(this,Sr),{payload:e,name:Cr.unsubscribe}}.bind(void 0),Ga=function(e){return i(this,Sr),{payload:e,name:Cr.doc}}.bind(void 0),P=void 0,Va=function(e,r,t){var a=r.request;return i(this,P),Er(e,a,t,Ga(Ur(a)))}.bind(void 0),Ja=function(e,r){return i(this,P),C(e,O({},r,{requestStatus:$.sending}))}.bind(void 0),Ar=function(e){return i(this,P),new Error("request: ".concat(e))}.bind(void 0),Ba=function(e,r){return i(this,P),ue(r,ie(Ar("timeout")))}.bind(void 0),Ir=function(e,r,t){return i(this,P),Ze(e,r,Ar(t))}.bind(void 0),Wa=function(e){return i(this,P),{onError:Ir,onSucceed:e,onTimeout:Ba}}.bind(void 0),Tr=function(e,r,t){return i(this,P),Va(e,Ja(e,r),Wa(t))}.bind(void 0),y=void 0,Qa=function(e,r){return i(this,y),E(e,B(J(r)))}.bind(void 0),Ka=function(e,r){return i(this,y),jr(e,C(e,$r(r)))}.bind(void 0),Hn=function(e){return i(this,y),new Error("unsubscribe: ".concat(e))}.bind(void 0),za={onError:function(e,r,t){return i(this,y),Ze(e,r,Hn(t))}.bind(void 0),onTimeout:function(e,r){return i(this,y),hr(r,ie(Hn("timeout")))}.bind(void 0),onSucceed:function(e,r){i(this,y),r.isActive?Ka(e,r):Qa(e,r)}.bind(void 0)},Xa=function(e,r){var t=r.request,a=r.subscriptionId;return i(this,y),Er(e,t,za,Ua({subscriptionId:a}))}.bind(void 0),wr=function(e,r){return i(this,y),Xa(e,C(e,O({},r,{requestStatus:$.canceling})))}.bind(void 0),Ya=function(e,r,t){var a=t.subscriptionId;i(this,y);var u=C(e,O({},r,{subscriptionId:a,requestStatus:$.sent}));u.isActive?Or(u):wr(e,u)}.bind(void 0),Za=function(e,r,t){i(this,y),t.errors?Ir(e,r,Gr(t.errors)):Ya(e,r,t)}.bind(void 0),jr=function(e,r){return i(this,y),Tr(e,r,Za)}.bind(void 0),ka=function(e,r){var t=r.payload;i(this,y);var a=ae(e.notifiers,"subscriptionId",t.subscriptionId);a&&gr(a,t.result)}.bind(void 0),eu="subscription:data",nu=function(e){return i(this,y),e.event===eu}.bind(void 0),S=void 0,ru=function(e,r){return i(this,S),E(e,Ye(J(Ke(r))))}.bind(void 0),tu=function(e,r){return i(this,S),r.requestStatus===$.sending?ru(e,r):e}.bind(void 0),Pr=function(e,r){return i(this,S),E(e,B(J(Ke(r))))}.bind(void 0),iu=function(e,r){return i(this,S),r.requestStatus===$.pending?Pr(e,r):tu(e,r)}.bind(void 0),au=function(e,r){return i(this,S),r.requestStatus===$.sent?wr(e,r):e}.bind(void 0),uu=function(e,r){return i(this,S),au(e,C(e,Ke(r)))}.bind(void 0),ou=function(e,r){return i(this,S),r.requestStatus===$.pending?Pr(e,r):uu(e,r)}.bind(void 0),su=function(e,r){return i(this,S),r.operationType==="subscription"?ou(e,r):iu(e,r)}.bind(void 0),cu=function(e,r){return i(this,S),r.isActive?su(e,r):e}.bind(void 0),oe=void 0,du=function(e,r){return i(this,oe),C(e,O({},r,{requestStatus:$.sent}))}.bind(void 0),fu=function(e,r,t){return i(this,oe),E(e,B(gr(du(e,r),t)))}.bind(void 0),vu=function(e,r){return i(this,oe),Tr(e,Or(r),fu)}.bind(void 0),xr=function(e,r){i(this,oe),r.operationType==="subscription"?jr(e,r):vu(e,r)}.bind(void 0),se=void 0,lu=function(e){return i(this,se),new Error("channel join: ".concat(e))}.bind(void 0),Un=function(e,r){var t=this;return i(this,se),e.notifiers.forEach(function(a){return i(this,t),ue(a,ie(lu(r)))}.bind(this))}.bind(void 0),hu=function(e){var r=this;return i(this,se),{onError:function(a){return i(this,r),Un(e,a)}.bind(this),onSucceed:function(){var a=this;return i(this,r),e.notifiers.forEach(function(u){return i(this,a),xr(e,u)}.bind(this))}.bind(this),onTimeout:function(){return i(this,r),Un(e,"timeout")}.bind(this)}}.bind(void 0),Rr=function(e){return i(this,se),mr(e.channel.join(),hu(e)),e.channelJoinCreated=!0,e}.bind(void 0),m=void 0,bu=function(e){var r=this;return i(this,m),function(t){i(this,r),nu(t)&&ka(e,t)}.bind(this)}.bind(void 0),qr=function(){return i(this,m),new Error("connection: close")}.bind(void 0),Mr=function(e){return i(this,m),_r(e,ie(qr()))}.bind(void 0),pu=function(e,r){return i(this,m),E(e,B(Mr(r)))}.bind(void 0),yu=function(e,r){i(this,m),r.operationType==="mutation"?Ze(e,r,qr()):C(e,$r(Mr(r)))}.bind(void 0),_u=function(e){var r=this;return i(this,m),function(t){i(this,r),t.isActive?yu(e,t):pu(e,t)}.bind(this)}.bind(void 0),gu=function(e){var r=this;return i(this,m),function(){return i(this,r),e.notifiers.forEach(_u(e))}.bind(this)}.bind(void 0),Ou=function(e){return i(this,m),!e.channelJoinCreated&&e.notifiers.length>0}.bind(void 0),$u=function(e){var r=this;return i(this,m),function(){i(this,r),Ou(e)&&Rr(e)}.bind(this)}.bind(void 0),mu="__absinthe__:control";(function(e){i(this,m);var r={phoenixSocket:e,channel:e.channel(mu),channelJoinCreated:!1,notifiers:[]};return e.onOpen($u(r)),e.onClose(gu(r)),e.onMessage(bu(r)),r}).bind(void 0);var Eu=void 0,Cu=function(e,r){var t=e.activeObservers,a=te(e,["activeObservers"]);return i(this,Eu),O({},a,{activeObservers:F(t).concat([r]),isActive:!0})}.bind(void 0),Su=void 0,Au=function(e,r,t){return i(this,Su),C(e,Cu(r,t))}.bind(void 0),Lr=void 0,Iu=function(e,r){return i(this,Lr),{operationType:r,request:e,activeObservers:[],canceledObservers:[],isActive:!0,requestStatus:$.pending,subscriptionId:void 0}}.bind(void 0),Tu=function(e){return i(this,Lr),Iu(e,Vr(e.operation))}.bind(void 0),wu=void 0,ju=function(e){return i(this,wu),e.isActive?e:O({},e,{isActive:!0})}.bind(void 0),x=void 0,Pu=function(e){i(this,x),e.phoenixSocket.isConnected()?Rr(e):e.phoenixSocket.connect()}.bind(void 0),xu=function(e,r){i(this,x);var t=Tu(r);return E(e,Wr([t])),e.channelJoinCreated?xr(e,t):Pu(e),t}.bind(void 0),Gn=function(e,r){return i(this,x),C(e,ju(r))}.bind(void 0),Ru=function(e,r){return i(this,x),r.requestStatus===$.sending?Gn(e,J(r)):Gn(e,r)}.bind(void 0),qu=function(e,r){return i(this,x),r.isActive?r:Ru(e,r)}.bind(void 0),Mu=function(e,r){i(this,x);var t=ae(e.notifiers,"request",r);return t&&qu(e,t)}.bind(void 0);(function(e,r){return i(this,x),Mu(e,r)||xu(e,r)}).bind(void 0);var ce=void 0,Lu=function(e,r,t,a){var u=this,o=r.request;return i(this,ce),function(){i(this,u);var s=ae(e.notifiers,"request",o);a(e,s,s?t:void 0)}.bind(this)}.bind(void 0),Nu=function(e,r){var t=this,a=e.operationType;return i(this,ce),function(u){i(this,t),r.next(u),a!=="subscription"&&r.complete()}.bind(this)}.bind(void 0),Du=function(e,r,t){return i(this,ce),O({},r,{onAbort:t.error.bind(t),onResult:Nu(e,t)})}.bind(void 0);(function(e,r){var t=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=a.unsubscribe,o=te(a,["unsubscribe"]);return i(this,ce),new Jr(function(s){i(this,t);var d=Du(r,o,s);return Au(e,r,d),u&&Lu(e,r,d,u)}.bind(this))}).bind(void 0);var Nr=void 0,Fu=function(e,r){return i(this,Nr),Jn(e.indexOf(r),1,e)}.bind(void 0),Hu=function(e,r){var t=e.activeObservers,a=te(e,["activeObservers"]);return i(this,Nr),O({},a,{activeObservers:Fu(t,r)})}.bind(void 0),Dr=void 0,Uu=function(e,r){if(i(this,Dr),e.activeObservers.includes(r))return e;throw new Error("Observer is not attached to notifier")}.bind(void 0),Gu=function(e,r,t){return i(this,Dr),E(e,Ye(Hu(Uu(r,t),t)))}.bind(void 0),Fr=void 0,Vu=function(e,r,t){return i(this,Fr),r.activeObservers.length===1?cu(e,r):Gu(e,r,t)}.bind(void 0);(function(e,r,t){return i(this,Fr),r.isActive?Vu(e,r,t):e}).bind(void 0);export{Ku as c,ee as g};
|
|
2
2
|
//# sourceMappingURL=vendor.absinthe.socket.js.map
|