userflow.js-self-hosted 0.1.1016342 → 0.1.1016382
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/hash.txt +1 -1
- package/package.json +1 -1
- package/stylesheets.js +1 -1
- package/use-selector-element-monitoring.js +3 -3
- package/userflow.js +1 -1
- package/vendor.core-js.js +1 -1
package/hash.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
8f421b14e705ff33199c731893161455fb779081
|
package/package.json
CHANGED
package/stylesheets.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as p,R as y}from"./vendor.react.js";import{V as $,W as R,R as P,P as D,X as z,z as U,Y as O,Z as q,x as _,_ as j,$ as N,a0 as K,Q as V,i as G,a1 as Y,a2 as Q,a3 as X,b as Z,a4 as J}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{e as oo,g as ro,h as to,i as no,j as eo,k as lo,l as ao,m as uo,n as co,o as io}from"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.core-js.js";import{j as so,$ as fo,I as go,l as Co,a4 as H}from"./userflow.js";import{c as bo}from"./flow-condition-types.js";import{a as Bo}from"./client-context.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="07329807-319a-4a77-a411-fc43fddedda6",o._sentryDebugIdIdentifier="sentry-dbid-07329807-319a-4a77-a411-fc43fddedda6")}catch{}})();function po(o){const[t]=p.useState(()=>new so(o));return t.update(o),t}const Ro=({icon:o,size:t,dataAttrs:n})=>{t=t||16;const e=typeof o=="string"&&A[o]?A[o]:o;if(typeof e=="string")return y.createElement("img",{...n,"aria-hidden":"true",src:e,width:t,height:t,style:{objectFit:"contain"}});{const l=e.icon[0],a=e.icon[1],c=e.icon[4];return y.createElement("svg",{"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:`0 0 ${l} ${a}`,...n},y.createElement("path",{fill:"currentColor",d:String(c)}))}},A={"regular/calendar-day":$,"regular/comment-alt":R,"regular/comments-alt":P,"regular/envelope":D,"regular/exclamation-triangle":z,"regular/external-link":U,"regular/file-alt":O,"regular/graduation-cap":q,"regular/info-circle":_,"regular/lightbulb":j,"regular/megaphone":N,"regular/pencil":K,"regular/phone":V,"regular/play-circle":G,"regular/question-circle":Y,"regular/shoe-prints":Q,"solid/shoe-prints":oo,"solid/file-invoice":ro,"solid/receipt":to,"solid/university":no,"solid/users":eo,"solid/stars":lo,"regular/tasks":X,"regular/user":Z,"regular/users":J,"solid/exclamation-triangle":ao,"solid/info-circle":uo,"solid/play-circle":co,"solid/question-circle":io};function ko(o,t,n){if(!o.document.fonts)return n(),()=>{};let e=!1;const l=()=>{const i=o.document.fonts.load(`100px ${t}`,"BESbswy");if(!i){c(),n();return}i.then(u=>{e||(u.length>=1?(c(),n()):window.setTimeout(l,25))},u=>{console.log("Userflow.js: observeFont error:"),console.log(u),n()})};l();const a=window.setTimeout(()=>{console.warn(`Userflow.js: Timed out waiting for font family ${t} to load. Will continue anyway.`),n()},2e3),c=()=>{e=!0,window.clearTimeout(a)};return c}function k(o){return o?o.match(/^#[0-9a-f]{6}$/i)?[parseInt(o.substring(1,3),16),parseInt(o.substring(3,5),16),parseInt(o.substring(5,7),16)]:o.match(/^#[0-9a-f]{3}$/i)?[parseInt(o.substring(1,2).repeat(2),16),parseInt(o.substring(2,3).repeat(2),16),parseInt(o.substring(3,4).repeat(2),16)]:[0,0,0]:[0,0,0]}function v([o,t,n]){return"#"+o.toString(16).padStart(2,"0")+t.toString(16).padStart(2,"0")+n.toString(16).padStart(2,"0")}function B(o){const t=k(o);return t?t.join(", "):"0, 0, 0"}function x(o){return v(k(o))}function wo([o,t,n]){return[Math.round(255-o),Math.round(255-t),Math.round(255-n)]}function F(o,t,n){return[Math.max(0,Math.min(255,Math.round(o[0]+(t[0]-o[0])*n))),Math.max(0,Math.min(255,Math.round(o[1]+(t[1]-o[1])*n))),Math.max(0,Math.min(255,Math.round(o[2]+(t[2]-o[2])*n)))]}function h(o,t,n){const e=k(o),l=k(t);return!e||!l?o:v(F(e,l,n))}function S([o,t,n]){o/=255,t/=255,n/=255;const e=Math.max(o,t,n),l=Math.min(o,t,n);let a,c,i=(e+l)/2;if(e==l)a=c=0;else{const u=e-l;switch(c=i>.5?u/(2-e-l):u/(e+l),e){case o:a=(t-n)/u+(t<n?6:0);break;case t:a=(n-o)/u+2;break;default:a=(o-t)/u+4;break}a/=6}return[a,c,i]}function m([o,t,n]){let e=o/255,l=t/255,a=n/255;function c(r){let s=0;return r<=.04045?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),s}let i=.2126*c(e)+.7152*c(l)+.0722*c(a);function u(r){let s=0;return r<=216/24389?s=r*(24389/27):s=Math.pow(r,1/3)*116-16,s}return Math.round(u(i)*10)/1e3}function L(o,t){const n=m(o),e=m(t),l=.05;let i=(1-(e-n))/2*(.18-l)+l,u=1-Math.abs(e-n),r=Math.pow((1-i)*u,4),s=i+r;return Math.round(s*1e3)/1e3}function w(o,t){const n=k(o),e=S(n);let l=null,a=null;for(const g of t){const d=k(g),f=S(d);let C=!1;!l||!a?C=!0:Math.abs(f[2]-e[2])>.3?f[1]>a[1]&&(C=!0):Math.abs(e[2]-f[2])>Math.abs(e[2]-a[2])&&(C=!0),C&&(l=d,a=f)}let c=l,i=l,u=L(c,n),r=u*2;const s=.2;return e[2]>s&&e[2]<1-s&&(i=wo(i),r=L(i,n)),[v(F(n,c,u)),v(F(n,i,r))]}function ho(o,t,n,e){const[l,a]=w(o,[t]);let c,i;if(o===n)c=l,i=a;else{const b=w(n,[o,t,e]);c=b[0],i=b[1]}const u=k(o),r=k(n),s=20;let g,d,f,C;if(Math.abs(u[0]-r[0])<s&&Math.abs(u[1]-r[1])<s&&Math.abs(u[2]-r[2])<s){g=t,d=o;const b=w(g,[d]);f=b[0],C=b[1]}else g=o,d=t,f=l,C=a;return[l,a,c,i,g,d,f,C]}function vo(o){const[t,n,e,l,a,c,i,u]=ho(o.brandBackgroundColor,o.brandForegroundColor,o.mainBackgroundColor,o.mainForegroundColor),r={...o,widgetBackgroundColor:a,widgetForegroundColor:c,widgetHoverBackgroundColor:i,widgetActiveBackgroundColor:u,sameBackground:x(o.mainBackgroundColor)==x(o.brandBackgroundColor)};r.brandHoverBackgroundColor&&(r.widgetHoverBackgroundColor=r.brandHoverBackgroundColor),r.brandActiveBackgroundColor&&(r.widgetActiveBackgroundColor=r.brandActiveBackgroundColor),r.brandHoverBackgroundColor||(r.brandHoverBackgroundColor=t),r.brandActiveBackgroundColor||(r.brandActiveBackgroundColor=n),r.mainHoverBackgroundColor||(r.mainHoverBackgroundColor=e),r.mainActiveBackgroundColor||(r.mainActiveBackgroundColor=l),r.bannerBackgroundColor||(r.bannerBackgroundColor=r.brandBackgroundColor),r.bannerForegroundColor||(r.bannerForegroundColor=r.brandForegroundColor);const[s,g]=w(r.bannerBackgroundColor,[r.bannerForegroundColor]);r.bannerHoverBackgroundColor=s,r.bannerActiveBackgroundColor=g;const[d,f]=w(r.bannerForegroundColor,[r.bannerBackgroundColor]);if(r.bannerHoverForegroundColor=d,r.bannerActiveForegroundColor=f,r.bubbleBorderColor||(r.bubbleBorderColor=r.mainForegroundColor),r.checklistLauncherActiveBackgroundColor||(r.checklistLauncherActiveBackgroundColor=r.brandActiveBackgroundColor),r.checklistLauncherBackgroundColor||(r.checklistLauncherBackgroundColor=r.brandBackgroundColor),r.checklistLauncherCounterBackgroundColor||(r.checklistLauncherCounterBackgroundColor=r.brandForegroundColor),r.checklistLauncherCounterFontColor||(r.checklistLauncherCounterFontColor=r.brandBackgroundColor),r.checklistLauncherFontColor||(r.checklistLauncherFontColor=r.brandForegroundColor),r.checklistLauncherHoverBackgroundColor||(r.checklistLauncherHoverBackgroundColor=r.brandHoverBackgroundColor),r.focusColor||(r.focusColor=r.mainActiveBackgroundColor),r.launcherIconActiveColor||(r.launcherIconActiveColor=r.brandActiveBackgroundColor),r.launcherIconColor||(r.launcherIconColor=r.brandBackgroundColor),r.launcherIconHoverColor||(r.launcherIconHoverColor=r.brandHoverBackgroundColor),r.linkColor||(r.linkColor=r.widgetBackgroundColor),r.progressBarColor||(r.progressBarColor=r.widgetBackgroundColor),r.questionColor||(r.questionColor=r.widgetBackgroundColor),r.toolbarForegroundColor||(r.toolbarForegroundColor=r.mainForegroundColor),r.primaryButtonBackgroundColor||(r.primaryButtonBackgroundColor=r.widgetBackgroundColor),r.primaryButtonFontColor||(r.primaryButtonFontColor=r.widgetForegroundColor),r.primaryButtonHoverFontColor||(r.primaryButtonHoverFontColor=r.primaryButtonFontColor),r.primaryButtonActiveFontColor||(r.primaryButtonActiveFontColor=r.primaryButtonFontColor),!r.primaryButtonHoverBackgroundColor||!r.primaryButtonActiveBackgroundColor){const[C,b]=w(r.primaryButtonBackgroundColor,[r.primaryButtonFontColor]);r.primaryButtonHoverBackgroundColor||(r.primaryButtonHoverBackgroundColor=C),r.primaryButtonActiveBackgroundColor||(r.primaryButtonActiveBackgroundColor=b)}if(r.primaryButtonBorderColor||(r.primaryButtonBorderColor=r.widgetBackgroundColor),r.primaryButtonHoverBorderColor||(r.primaryButtonHoverBorderColor=r.primaryButtonHoverBackgroundColor),r.primaryButtonActiveBorderColor||(r.primaryButtonActiveBorderColor=r.primaryButtonActiveBackgroundColor),r.defaultButtonBackgroundColor||(r.defaultButtonBackgroundColor=r.mainBackgroundColor),r.defaultButtonFontColor||(r.defaultButtonFontColor=a),r.defaultButtonHoverFontColor||(r.defaultButtonHoverFontColor=r.defaultButtonFontColor),r.defaultButtonActiveFontColor||(r.defaultButtonActiveFontColor=r.defaultButtonFontColor),!r.defaultButtonHoverBackgroundColor||!r.defaultButtonActiveBackgroundColor){const[C,b]=w(r.defaultButtonBackgroundColor,[r.defaultButtonFontColor]);r.defaultButtonHoverBackgroundColor||(r.defaultButtonHoverBackgroundColor=C),r.defaultButtonActiveBackgroundColor||(r.defaultButtonActiveBackgroundColor=b)}return r.defaultButtonBorderColor||(r.defaultButtonBorderColor=r.defaultButtonFontColor),r.defaultButtonHoverBorderColor||(r.defaultButtonHoverBorderColor=r.defaultButtonBorderColor),r.defaultButtonActiveBorderColor||(r.defaultButtonActiveBorderColor=r.defaultButtonBorderColor),r.launcherButtonBackgroundColor||(r.launcherButtonBackgroundColor=r.brandBackgroundColor),r.launcherButtonBorderColor||(r.launcherButtonBorderColor=r.brandBackgroundColor),r.launcherButtonFontColor||(r.launcherButtonFontColor=r.brandForegroundColor),r.launcherButtonHoverBackgroundColor||(r.launcherButtonHoverBackgroundColor=r.brandHoverBackgroundColor),r.launcherButtonHoverBorderColor||(r.launcherButtonHoverBorderColor=r.launcherButtonHoverBackgroundColor),r.launcherButtonHoverFontColor||(r.launcherButtonHoverFontColor=r.launcherButtonFontColor),r.launcherButtonActiveBackgroundColor||(r.launcherButtonActiveBackgroundColor=r.brandActiveBackgroundColor),r.launcherButtonActiveBorderColor||(r.launcherButtonActiveBorderColor=r.launcherButtonActiveBackgroundColor),r.launcherButtonActiveFontColor||(r.launcherButtonActiveFontColor=r.launcherButtonFontColor),r}function yo(o){const{questionColor:t}=o;return{"--userflow-backdrop-highlight-color-rgb":B(o.backdropHighlightColor),"--userflow-backdrop-highlight-inset":o.backdropHighlightType===fo.INSIDE?"inset":"","--userflow-backdrop-highlight-opacity":o.backdropHighlightOpacity,"--userflow-backdrop-highlight-radius":o.backdropHighlightRadius+"px","--userflow-backdrop-highlight-spread":o.backdropHighlightSpread+"px","--userflow-backdrop-opacity":o.backdropOpacity,"--userflow-banner-background-color":o.bannerBackgroundColor,"--userflow-banner-hover-background-color":o.bannerHoverBackgroundColor,"--userflow-banner-active-background-color":o.bannerActiveBackgroundColor,"--userflow-banner-foreground-color":o.bannerForegroundColor,"--userflow-banner-hover-foreground-color":o.bannerHoverForegroundColor,"--userflow-banner-active-foreground-color":o.bannerActiveForegroundColor,"--userflow-beacon-color":o.beaconColor,"--userflow-beacon-size":o.beaconSize+"px","--userflow-brand-active-background-color":o.brandActiveBackgroundColor,"--userflow-brand-background-color":o.brandBackgroundColor,"--userflow-brand-foreground-color":o.brandForegroundColor,"--userflow-brand-foreground-color-rgb":B(o.brandForegroundColor),"--userflow-brand-hover-background-color":o.brandHoverBackgroundColor,"--userflow-bubble-border-color":o.bubbleBorderColor,"--userflow-bubble-border-radius":o.bubbleBorderRadius+"px","--userflow-bubble-border-width":o.bubbleBorderWidth+"px","--userflow-button-border-radius":o.buttonBorderRadius+"px","--userflow-button-height":o.buttonHeight+"px","--userflow-button-min-width":o.buttonMinWidth+"px","--userflow-button-text-align":o.buttonMinWidth===0?"start":"center","--userflow-buttons-justify-content":o.buttonHorizontalAlign==="left"?"start":o.buttonHorizontalAlign==="right"?"end":"center","--userflow-buttons-bubble-justify-content":o.buttonHorizontalAlign==="left"?"start":o.buttonHorizontalAlign==="center"?"center":"end","--userflow-checklist-launcher-active-background-color":o.checklistLauncherActiveBackgroundColor,"--userflow-checklist-launcher-background-color":o.checklistLauncherBackgroundColor,"--userflow-checklist-launcher-border-radius":o.checklistLauncherBorderRadius+"px","--userflow-checklist-launcher-counter-background-color":o.checklistLauncherCounterBackgroundColor,"--userflow-checklist-launcher-counter-font-color":o.checklistLauncherCounterFontColor,"--userflow-checklist-launcher-font-color-rgb":B(o.checklistLauncherFontColor),"--userflow-checklist-launcher-font-color":o.checklistLauncherFontColor,"--userflow-checklist-launcher-font-weight":String(o.checklistLauncherFontWeight),"--userflow-checklist-launcher-height":o.checklistLauncherHeight+"px","--userflow-checklist-launcher-hover-background-color":o.checklistLauncherHoverBackgroundColor,"--userflow-checkmark-background-color":o.checkmarkBackgroundColor,"--userflow-completed-task-text-decoration":o.completedTaskTextDecoration,"--userflow-default-button-active-background-color":o.defaultButtonActiveBackgroundColor,"--userflow-default-button-active-border-color":o.defaultButtonActiveBorderColor,"--userflow-default-button-active-font-color":o.defaultButtonActiveFontColor,"--userflow-default-button-background-color":o.defaultButtonBackgroundColor,"--userflow-default-button-border-color":o.defaultButtonBorderColor,"--userflow-default-button-border-width":o.defaultButtonBorderWidth+"px","--userflow-default-button-font-color":o.defaultButtonFontColor,"--userflow-default-button-font-weight":String(o.defaultButtonFontWeight),"--userflow-default-button-hover-background-color":o.defaultButtonHoverBackgroundColor,"--userflow-default-button-hover-border-color":o.defaultButtonHoverBorderColor,"--userflow-default-button-hover-font-color":o.defaultButtonHoverFontColor,"--userflow-focus-color":`rgba(${B(o.focusColor)}, ${o.focusOpacity})`,"--userflow-font-family":o.builtinFontFamily?Ho(o.builtinFontFamily.name)+(o.builtinFontFamily.fallback?", "+o.builtinFontFamily.fallback:""):o.fontFamily?o.fontFamily:"sans-serif","--userflow-font-size":o.fontSize+"px","--userflow-font-weight-bold":String(o.fontWeightBold),"--userflow-font-weight-normal":String(o.fontWeightNormal),"--userflow-h1-font-size":o.h1FontSize+"px","--userflow-h2-font-size":o.h2FontSize+"px","--userflow-launcher-button-active-background-color":o.launcherButtonActiveBackgroundColor,"--userflow-launcher-button-active-border-color":o.launcherButtonActiveBorderColor,"--userflow-launcher-button-active-font-color":o.launcherButtonActiveFontColor,"--userflow-launcher-button-background-color":o.launcherButtonBackgroundColor,"--userflow-launcher-button-border-color":o.launcherButtonBorderColor,"--userflow-launcher-button-border-radius":o.launcherButtonBorderRadius+"px","--userflow-launcher-button-border-width":o.launcherButtonBorderWidth+"px","--userflow-launcher-button-font-color":o.launcherButtonFontColor,"--userflow-launcher-button-font-weight":String(o.launcherButtonFontWeight),"--userflow-launcher-button-height":o.launcherButtonHeight+"px","--userflow-launcher-button-horizontal-padding":o.launcherButtonHorizontalPadding+"px","--userflow-launcher-button-hover-background-color":o.launcherButtonHoverBackgroundColor,"--userflow-launcher-button-hover-border-color":o.launcherButtonHoverBorderColor,"--userflow-launcher-button-hover-font-color":o.launcherButtonHoverFontColor,"--userflow-launcher-button-width":o.launcherButtonWidth?o.launcherButtonWidth+"px":"auto","--userflow-launcher-icon-active-color":o.launcherIconActiveColor,"--userflow-launcher-icon-color":o.launcherIconColor,"--userflow-launcher-icon-hover-color":o.launcherIconHoverColor,"--userflow-launcher-icon-opacity":o.launcherIconOpacity,"--userflow-launcher-icon-size":o.launcherIconSize+"px","--userflow-line-height":o.lineHeight+"px","--userflow-link-color":o.linkColor,"--userflow-main-active-background-color":o.mainActiveBackgroundColor,"--userflow-main-background-color":o.mainBackgroundColor,"--userflow-main-background-color-rgb":B(o.mainBackgroundColor),"--userflow-main-foreground-color":o.mainForegroundColor,"--userflow-main-foreground-color-rgb":B(o.mainForegroundColor),"--userflow-main-hover-background-color":o.mainHoverBackgroundColor,"--userflow-modal-padding":o.modalPadding+"px","--userflow-modal-padding-top":(o.avatarType===go.NONE?o.modalPadding:o.modalPadding+Math.max((o.avatarSize-o.modalPadding)/2,0))+"px","--userflow-backdrop-color-rgb":B(o.backdropColor),"--userflow-notch-color":o.bubbleBorderWidth>0&&o.bubbleBorderColor||o.mainBackgroundColor,"--userflow-primary-button-active-background-color":o.primaryButtonActiveBackgroundColor,"--userflow-primary-button-active-border-color":o.primaryButtonActiveBorderColor,"--userflow-primary-button-active-font-color":o.primaryButtonActiveFontColor,"--userflow-primary-button-background-color":o.primaryButtonBackgroundColor,"--userflow-primary-button-border-color":o.primaryButtonBorderColor,"--userflow-primary-button-border-width":o.primaryButtonBorderWidth+"px","--userflow-primary-button-font-color":o.primaryButtonFontColor,"--userflow-primary-button-font-weight":String(o.primaryButtonFontWeight),"--userflow-primary-button-hover-background-color":o.primaryButtonHoverBackgroundColor,"--userflow-primary-button-hover-border-color":o.primaryButtonHoverBorderColor,"--userflow-primary-button-hover-font-color":o.primaryButtonHoverFontColor,"--userflow-progress-bar-color":o.progressBarColor,"--userflow-progress-bar-height":o.progressBarHeight+"px","--userflow-narrow-progress-bar-height":o.narrowBarHeight+"px","--userflow-squared-progress-bar-height":o.squaredBarHeight+"px","--userflow-rounded-progress-bar-height":o.roundedBarHeight+"px","--userflow-dotted-progress-bar-height":o.dottedBarHeight+"px","--userflow-numbered-progress-bar-height":o.numberedBarFontSize+"px","--userflow-resource-center-collapsed-height":o.resourceCenterCollapsedHeight+"px","--userflow-resource-center-launcher-icon-img-size":o.rcIconSize+"px","--userflow-resource-center-full-width":o.resourceCenterFullWidth+"px","--userflow-resource-center-launcher-border-radius":(o.resourceCenterLauncherBorderRadius!=null?Math.min(o.resourceCenterLauncherBorderRadius,o.resourceCenterCollapsedHeight/2):o.resourceCenterCollapsedHeight/2)+"px","--userflow-resource-center-padding-x":o.resourceCenterPaddingX+"px","--userflow-resource-center-padding-y":o.resourceCenterPaddingY+"px","--userflow-resource-center-transition-duration":o.resourceCenterTransitionDuration+"ms","--userflow-resource-center-width":o.resourceCenterWidth+"px","--userflow-question-color-light":h(t,o.mainBackgroundColor,.5),"--userflow-question-color-lighter":h(t,o.mainBackgroundColor,.75),"--userflow-question-color-lightest":h(t,o.mainBackgroundColor,.9),"--userflow-question-color-medium-light":h(t,o.mainBackgroundColor,.15),"--userflow-question-color":t,"--userflow-toast-padding":o.toastPadding+"px","--userflow-toast-auto-dismiss":o.toastAutoDismiss+"ms","--userflow-toast-placement":o.toastPlacement+"px","--userflow-toast-width":o.toastWidth+"px","--userflow-toolbar-foreground-color":o.toolbarForegroundColor,"--userflow-toolbar-foreground-color-rgb":B(o.toolbarForegroundColor),"--userflow-tooltip-notch-size":o.tooltipNotchSize+"px","--userflow-unread-badge-background-color":o.unreadBadgeBackgroundColor,"--userflow-unread-badge-foreground-color":o.unreadBadgeForegroundColor,"--userflow-widget-active-background-color":o.widgetActiveBackgroundColor,"--userflow-widget-background-color":o.widgetBackgroundColor,"--userflow-widget-foreground-color":o.widgetForegroundColor,"--userflow-widget-hover-background-color":o.widgetHoverBackgroundColor}}const Fo=[];function Po(o){let[t,n]=p.useState(o);const e=po(o.sessionData||Fo);return p.useLayoutEffect(()=>{const{variations:l}=o;if(!l)return;const a=[],c=[],i=()=>{let u=o,r=!1;for(const[s,g]of l.entries())if(a[s]){r||(r=!0,u={...u});for(const d of g.overriddenKeys){const f=d,C=g[f];u[f]=C}}n(u)};for(const[u,r]of l.entries()){a[u]=!1;const{condition:s}=r;if(s&&r.overriddenKeys&&r.overriddenKeys.length>0){const d=bo[s.type].track({sessionData:e,condition:s,callback:f=>{a[u]=f,i()}});c[u]=d}else c[u]=()=>{}}return i(),()=>{for(const u of c)u()}},[o,e]),p.useMemo(()=>vo(t),[t])}function Do(o){const t=Co.serverEndpoint||"cdn.userflow.com";return o?.cssVersion?`https://${t}/themes/${o.id}/stylesheets/${o.cssVersion}/custom.css`:null}function Ho(o){return`"${o.trim()}"`}const M=new Map;function W(o){let t=M.get(o);return t||(t={stylesheets:new Map},M.set(o,t)),t}function zo(o,t,n,{uninstallOnUnmount:e}={}){const l=Bo(),[a,c]=p.useState(!t);return p.useLayoutEffect(()=>{if(!o||!t)return;let i=!1,u;const r=async d=>{await E(l,o,d),u&&T(o,u),u=d};(async()=>{let d=typeof t=="string"?t:t.get();if(Ao()&&n){let f=await xo(d);if(i)return;f=So(f,yo(n)),d="data:text/css;base64,"+btoa(f)}await r(d),!i&&c(!0)})();let g=null;return typeof t!="string"&&(g=t.onUpdate(async()=>{r(t.get())})),()=>{i=!0,g&&g(),e&&u&&T(o,u)}},[l,o,t,n,e]),{loaded:a}}function Ao(){return!!window.MSInputMethodContext&&!!document.documentMode}const I=new Map;function xo(o){return new Promise((t,n)=>{let e=I.get(o);if(e){t(e);return}const l=new XMLHttpRequest;l.addEventListener("load",()=>{if(l.status!==200){n(new Error("Userflow.js could not fetch stylesheet: "+o));return}const a=l.responseText;I.set(o,a),t(a)}),l.addEventListener("error",()=>{n(new Error("Userflow.js could not fetch stylesheet: "+o))}),l.open("GET",o),l.send()})}function So(o,t){for(const n in t)if(t.hasOwnProperty(n)){const e=t[n];e&&(o=o.replace(new RegExp(`var\\(${n}.*?\\)`,"g"),e))}return o=o.replace(/var\(--[a-z0-9-]+(,\s*(.*?))?\)/g,"$2"),o}function Uo(o,t){const n=t&&mo(t),e=n?.url,l=n?.fontFamily,[a,c]=p.useState(!e||!l);return p.useLayoutEffect(()=>{if(!o||!e||!l)return;let i=!1;return E(null,o,e),ko(o,l,()=>{i||c(!0)}),()=>{i=!0}},[o,e,l]),{loaded:a}}function E(o,t,n){const e=W(t),l=e.stylesheets.get(n);if(l)return l.loadPromise;const a=t.document.createElement("link"),c=new Promise((i,u)=>{a.dataset.userflowStylesheet="true",a.rel="stylesheet",a.href=n,a.onload=()=>{i()},a.onerror=r=>{console.log(`Userflow.js: Error installing Stylesheet ${n}:`,r),o&&o.reportCspIssue(),u()},t.document.head.appendChild(a)});return e.stylesheets.set(n,{link:a,loadPromise:c}),c}function T(o,t){const n=W(o),e=n.stylesheets.get(t);e&&(o.document.head.removeChild(e.link),n.stylesheets.delete(t))}function mo(o){if(o.builtinFontFamily)switch(o.builtinFontFamily.provider){case H.GOOGLE:{const t=Array.from(new Set(["0,400","1,400",`0,${o.fontWeightBold}`,`0,${o.fontWeightNormal}`,`0,${o.defaultButtonFontWeight}`,`0,${o.primaryButtonFontWeight}`,`0,${o.checklistLauncherFontWeight}`,`0,${o.launcherButtonFontWeight}`])).sort().join(";");return{url:`https://fonts.googleapis.com/css2?family=${encodeURIComponent(o.builtinFontFamily.name)}:ital,wght@${t}`,fontFamily:o.builtinFontFamily.name}}case H.STANDARD:return null}else return o.fontCssUrl?{url:o.fontCssUrl,fontFamily:o.fontFamily}:null}export{Ro as D,zo as a,Uo as b,po as c,Do as d,yo as g,Po as u};
|
|
1
|
+
import{r as p,R as y}from"./vendor.react.js";import{V as $,W as R,R as P,P as D,X as z,z as U,Y as O,Z as q,x as _,_ as j,$ as N,a0 as K,Q as V,i as G,a1 as Y,a2 as Q,a3 as X,b as Z,a4 as J}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{e as oo,g as ro,h as to,i as no,j as eo,k as lo,l as ao,m as uo,n as co,o as io}from"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.core-js.js";import{j as so,$ as fo,I as go,a4 as H}from"./userflow.js";import{c as bo}from"./flow-condition-types.js";import{a as Co}from"./client-context.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="1ac6b869-fa91-431a-8477-b8a59b1af335",o._sentryDebugIdIdentifier="sentry-dbid-1ac6b869-fa91-431a-8477-b8a59b1af335")}catch{}})();function Bo(o){const[t]=p.useState(()=>new so(o));return t.update(o),t}const $o=({icon:o,size:t,dataAttrs:n})=>{t=t||16;const e=typeof o=="string"&&A[o]?A[o]:o;if(typeof e=="string")return y.createElement("img",{...n,"aria-hidden":"true",src:e,width:t,height:t,style:{objectFit:"contain"}});{const l=e.icon[0],a=e.icon[1],c=e.icon[4];return y.createElement("svg",{"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:`0 0 ${l} ${a}`,...n},y.createElement("path",{fill:"currentColor",d:String(c)}))}},A={"regular/calendar-day":$,"regular/comment-alt":R,"regular/comments-alt":P,"regular/envelope":D,"regular/exclamation-triangle":z,"regular/external-link":U,"regular/file-alt":O,"regular/graduation-cap":q,"regular/info-circle":_,"regular/lightbulb":j,"regular/megaphone":N,"regular/pencil":K,"regular/phone":V,"regular/play-circle":G,"regular/question-circle":Y,"regular/shoe-prints":Q,"solid/shoe-prints":oo,"solid/file-invoice":ro,"solid/receipt":to,"solid/university":no,"solid/users":eo,"solid/stars":lo,"regular/tasks":X,"regular/user":Z,"regular/users":J,"solid/exclamation-triangle":ao,"solid/info-circle":uo,"solid/play-circle":co,"solid/question-circle":io};function po(o,t,n){if(!o.document.fonts)return n(),()=>{};let e=!1;const l=()=>{const i=o.document.fonts.load(`100px ${t}`,"BESbswy");if(!i){c(),n();return}i.then(u=>{e||(u.length>=1?(c(),n()):window.setTimeout(l,25))},u=>{console.log("Userflow.js: observeFont error:"),console.log(u),n()})};l();const a=window.setTimeout(()=>{console.warn(`Userflow.js: Timed out waiting for font family ${t} to load. Will continue anyway.`),n()},2e3),c=()=>{e=!0,window.clearTimeout(a)};return c}function k(o){return o?o.match(/^#[0-9a-f]{6}$/i)?[parseInt(o.substring(1,3),16),parseInt(o.substring(3,5),16),parseInt(o.substring(5,7),16)]:o.match(/^#[0-9a-f]{3}$/i)?[parseInt(o.substring(1,2).repeat(2),16),parseInt(o.substring(2,3).repeat(2),16),parseInt(o.substring(3,4).repeat(2),16)]:[0,0,0]:[0,0,0]}function v([o,t,n]){return"#"+o.toString(16).padStart(2,"0")+t.toString(16).padStart(2,"0")+n.toString(16).padStart(2,"0")}function B(o){const t=k(o);return t?t.join(", "):"0, 0, 0"}function x(o){return v(k(o))}function ko([o,t,n]){return[Math.round(255-o),Math.round(255-t),Math.round(255-n)]}function F(o,t,n){return[Math.max(0,Math.min(255,Math.round(o[0]+(t[0]-o[0])*n))),Math.max(0,Math.min(255,Math.round(o[1]+(t[1]-o[1])*n))),Math.max(0,Math.min(255,Math.round(o[2]+(t[2]-o[2])*n)))]}function h(o,t,n){const e=k(o),l=k(t);return!e||!l?o:v(F(e,l,n))}function S([o,t,n]){o/=255,t/=255,n/=255;const e=Math.max(o,t,n),l=Math.min(o,t,n);let a,c,i=(e+l)/2;if(e==l)a=c=0;else{const u=e-l;switch(c=i>.5?u/(2-e-l):u/(e+l),e){case o:a=(t-n)/u+(t<n?6:0);break;case t:a=(n-o)/u+2;break;default:a=(o-t)/u+4;break}a/=6}return[a,c,i]}function m([o,t,n]){let e=o/255,l=t/255,a=n/255;function c(r){let s=0;return r<=.04045?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),s}let i=.2126*c(e)+.7152*c(l)+.0722*c(a);function u(r){let s=0;return r<=216/24389?s=r*(24389/27):s=Math.pow(r,1/3)*116-16,s}return Math.round(u(i)*10)/1e3}function L(o,t){const n=m(o),e=m(t),l=.05;let i=(1-(e-n))/2*(.18-l)+l,u=1-Math.abs(e-n),r=Math.pow((1-i)*u,4),s=i+r;return Math.round(s*1e3)/1e3}function w(o,t){const n=k(o),e=S(n);let l=null,a=null;for(const g of t){const d=k(g),f=S(d);let b=!1;!l||!a?b=!0:Math.abs(f[2]-e[2])>.3?f[1]>a[1]&&(b=!0):Math.abs(e[2]-f[2])>Math.abs(e[2]-a[2])&&(b=!0),b&&(l=d,a=f)}let c=l,i=l,u=L(c,n),r=u*2;const s=.2;return e[2]>s&&e[2]<1-s&&(i=ko(i),r=L(i,n)),[v(F(n,c,u)),v(F(n,i,r))]}function wo(o,t,n,e){const[l,a]=w(o,[t]);let c,i;if(o===n)c=l,i=a;else{const C=w(n,[o,t,e]);c=C[0],i=C[1]}const u=k(o),r=k(n),s=20;let g,d,f,b;if(Math.abs(u[0]-r[0])<s&&Math.abs(u[1]-r[1])<s&&Math.abs(u[2]-r[2])<s){g=t,d=o;const C=w(g,[d]);f=C[0],b=C[1]}else g=o,d=t,f=l,b=a;return[l,a,c,i,g,d,f,b]}function ho(o){const[t,n,e,l,a,c,i,u]=wo(o.brandBackgroundColor,o.brandForegroundColor,o.mainBackgroundColor,o.mainForegroundColor),r={...o,widgetBackgroundColor:a,widgetForegroundColor:c,widgetHoverBackgroundColor:i,widgetActiveBackgroundColor:u,sameBackground:x(o.mainBackgroundColor)==x(o.brandBackgroundColor)};r.brandHoverBackgroundColor&&(r.widgetHoverBackgroundColor=r.brandHoverBackgroundColor),r.brandActiveBackgroundColor&&(r.widgetActiveBackgroundColor=r.brandActiveBackgroundColor),r.brandHoverBackgroundColor||(r.brandHoverBackgroundColor=t),r.brandActiveBackgroundColor||(r.brandActiveBackgroundColor=n),r.mainHoverBackgroundColor||(r.mainHoverBackgroundColor=e),r.mainActiveBackgroundColor||(r.mainActiveBackgroundColor=l),r.bannerBackgroundColor||(r.bannerBackgroundColor=r.brandBackgroundColor),r.bannerForegroundColor||(r.bannerForegroundColor=r.brandForegroundColor);const[s,g]=w(r.bannerBackgroundColor,[r.bannerForegroundColor]);r.bannerHoverBackgroundColor=s,r.bannerActiveBackgroundColor=g;const[d,f]=w(r.bannerForegroundColor,[r.bannerBackgroundColor]);if(r.bannerHoverForegroundColor=d,r.bannerActiveForegroundColor=f,r.bubbleBorderColor||(r.bubbleBorderColor=r.mainForegroundColor),r.checklistLauncherActiveBackgroundColor||(r.checklistLauncherActiveBackgroundColor=r.brandActiveBackgroundColor),r.checklistLauncherBackgroundColor||(r.checklistLauncherBackgroundColor=r.brandBackgroundColor),r.checklistLauncherCounterBackgroundColor||(r.checklistLauncherCounterBackgroundColor=r.brandForegroundColor),r.checklistLauncherCounterFontColor||(r.checklistLauncherCounterFontColor=r.brandBackgroundColor),r.checklistLauncherFontColor||(r.checklistLauncherFontColor=r.brandForegroundColor),r.checklistLauncherHoverBackgroundColor||(r.checklistLauncherHoverBackgroundColor=r.brandHoverBackgroundColor),r.focusColor||(r.focusColor=r.mainActiveBackgroundColor),r.launcherIconActiveColor||(r.launcherIconActiveColor=r.brandActiveBackgroundColor),r.launcherIconColor||(r.launcherIconColor=r.brandBackgroundColor),r.launcherIconHoverColor||(r.launcherIconHoverColor=r.brandHoverBackgroundColor),r.linkColor||(r.linkColor=r.widgetBackgroundColor),r.progressBarColor||(r.progressBarColor=r.widgetBackgroundColor),r.questionColor||(r.questionColor=r.widgetBackgroundColor),r.toolbarForegroundColor||(r.toolbarForegroundColor=r.mainForegroundColor),r.primaryButtonBackgroundColor||(r.primaryButtonBackgroundColor=r.widgetBackgroundColor),r.primaryButtonFontColor||(r.primaryButtonFontColor=r.widgetForegroundColor),r.primaryButtonHoverFontColor||(r.primaryButtonHoverFontColor=r.primaryButtonFontColor),r.primaryButtonActiveFontColor||(r.primaryButtonActiveFontColor=r.primaryButtonFontColor),!r.primaryButtonHoverBackgroundColor||!r.primaryButtonActiveBackgroundColor){const[b,C]=w(r.primaryButtonBackgroundColor,[r.primaryButtonFontColor]);r.primaryButtonHoverBackgroundColor||(r.primaryButtonHoverBackgroundColor=b),r.primaryButtonActiveBackgroundColor||(r.primaryButtonActiveBackgroundColor=C)}if(r.primaryButtonBorderColor||(r.primaryButtonBorderColor=r.widgetBackgroundColor),r.primaryButtonHoverBorderColor||(r.primaryButtonHoverBorderColor=r.primaryButtonHoverBackgroundColor),r.primaryButtonActiveBorderColor||(r.primaryButtonActiveBorderColor=r.primaryButtonActiveBackgroundColor),r.defaultButtonBackgroundColor||(r.defaultButtonBackgroundColor=r.mainBackgroundColor),r.defaultButtonFontColor||(r.defaultButtonFontColor=a),r.defaultButtonHoverFontColor||(r.defaultButtonHoverFontColor=r.defaultButtonFontColor),r.defaultButtonActiveFontColor||(r.defaultButtonActiveFontColor=r.defaultButtonFontColor),!r.defaultButtonHoverBackgroundColor||!r.defaultButtonActiveBackgroundColor){const[b,C]=w(r.defaultButtonBackgroundColor,[r.defaultButtonFontColor]);r.defaultButtonHoverBackgroundColor||(r.defaultButtonHoverBackgroundColor=b),r.defaultButtonActiveBackgroundColor||(r.defaultButtonActiveBackgroundColor=C)}return r.defaultButtonBorderColor||(r.defaultButtonBorderColor=r.defaultButtonFontColor),r.defaultButtonHoverBorderColor||(r.defaultButtonHoverBorderColor=r.defaultButtonBorderColor),r.defaultButtonActiveBorderColor||(r.defaultButtonActiveBorderColor=r.defaultButtonBorderColor),r.launcherButtonBackgroundColor||(r.launcherButtonBackgroundColor=r.brandBackgroundColor),r.launcherButtonBorderColor||(r.launcherButtonBorderColor=r.brandBackgroundColor),r.launcherButtonFontColor||(r.launcherButtonFontColor=r.brandForegroundColor),r.launcherButtonHoverBackgroundColor||(r.launcherButtonHoverBackgroundColor=r.brandHoverBackgroundColor),r.launcherButtonHoverBorderColor||(r.launcherButtonHoverBorderColor=r.launcherButtonHoverBackgroundColor),r.launcherButtonHoverFontColor||(r.launcherButtonHoverFontColor=r.launcherButtonFontColor),r.launcherButtonActiveBackgroundColor||(r.launcherButtonActiveBackgroundColor=r.brandActiveBackgroundColor),r.launcherButtonActiveBorderColor||(r.launcherButtonActiveBorderColor=r.launcherButtonActiveBackgroundColor),r.launcherButtonActiveFontColor||(r.launcherButtonActiveFontColor=r.launcherButtonFontColor),r}function vo(o){const{questionColor:t}=o;return{"--userflow-backdrop-highlight-color-rgb":B(o.backdropHighlightColor),"--userflow-backdrop-highlight-inset":o.backdropHighlightType===fo.INSIDE?"inset":"","--userflow-backdrop-highlight-opacity":o.backdropHighlightOpacity,"--userflow-backdrop-highlight-radius":o.backdropHighlightRadius+"px","--userflow-backdrop-highlight-spread":o.backdropHighlightSpread+"px","--userflow-backdrop-opacity":o.backdropOpacity,"--userflow-banner-background-color":o.bannerBackgroundColor,"--userflow-banner-hover-background-color":o.bannerHoverBackgroundColor,"--userflow-banner-active-background-color":o.bannerActiveBackgroundColor,"--userflow-banner-foreground-color":o.bannerForegroundColor,"--userflow-banner-hover-foreground-color":o.bannerHoverForegroundColor,"--userflow-banner-active-foreground-color":o.bannerActiveForegroundColor,"--userflow-beacon-color":o.beaconColor,"--userflow-beacon-size":o.beaconSize+"px","--userflow-brand-active-background-color":o.brandActiveBackgroundColor,"--userflow-brand-background-color":o.brandBackgroundColor,"--userflow-brand-foreground-color":o.brandForegroundColor,"--userflow-brand-foreground-color-rgb":B(o.brandForegroundColor),"--userflow-brand-hover-background-color":o.brandHoverBackgroundColor,"--userflow-bubble-border-color":o.bubbleBorderColor,"--userflow-bubble-border-radius":o.bubbleBorderRadius+"px","--userflow-bubble-border-width":o.bubbleBorderWidth+"px","--userflow-button-border-radius":o.buttonBorderRadius+"px","--userflow-button-height":o.buttonHeight+"px","--userflow-button-min-width":o.buttonMinWidth+"px","--userflow-button-text-align":o.buttonMinWidth===0?"start":"center","--userflow-buttons-justify-content":o.buttonHorizontalAlign==="left"?"start":o.buttonHorizontalAlign==="right"?"end":"center","--userflow-buttons-bubble-justify-content":o.buttonHorizontalAlign==="left"?"start":o.buttonHorizontalAlign==="center"?"center":"end","--userflow-checklist-launcher-active-background-color":o.checklistLauncherActiveBackgroundColor,"--userflow-checklist-launcher-background-color":o.checklistLauncherBackgroundColor,"--userflow-checklist-launcher-border-radius":o.checklistLauncherBorderRadius+"px","--userflow-checklist-launcher-counter-background-color":o.checklistLauncherCounterBackgroundColor,"--userflow-checklist-launcher-counter-font-color":o.checklistLauncherCounterFontColor,"--userflow-checklist-launcher-font-color-rgb":B(o.checklistLauncherFontColor),"--userflow-checklist-launcher-font-color":o.checklistLauncherFontColor,"--userflow-checklist-launcher-font-weight":String(o.checklistLauncherFontWeight),"--userflow-checklist-launcher-height":o.checklistLauncherHeight+"px","--userflow-checklist-launcher-hover-background-color":o.checklistLauncherHoverBackgroundColor,"--userflow-checkmark-background-color":o.checkmarkBackgroundColor,"--userflow-completed-task-text-decoration":o.completedTaskTextDecoration,"--userflow-default-button-active-background-color":o.defaultButtonActiveBackgroundColor,"--userflow-default-button-active-border-color":o.defaultButtonActiveBorderColor,"--userflow-default-button-active-font-color":o.defaultButtonActiveFontColor,"--userflow-default-button-background-color":o.defaultButtonBackgroundColor,"--userflow-default-button-border-color":o.defaultButtonBorderColor,"--userflow-default-button-border-width":o.defaultButtonBorderWidth+"px","--userflow-default-button-font-color":o.defaultButtonFontColor,"--userflow-default-button-font-weight":String(o.defaultButtonFontWeight),"--userflow-default-button-hover-background-color":o.defaultButtonHoverBackgroundColor,"--userflow-default-button-hover-border-color":o.defaultButtonHoverBorderColor,"--userflow-default-button-hover-font-color":o.defaultButtonHoverFontColor,"--userflow-focus-color":`rgba(${B(o.focusColor)}, ${o.focusOpacity})`,"--userflow-font-family":o.builtinFontFamily?Fo(o.builtinFontFamily.name)+(o.builtinFontFamily.fallback?", "+o.builtinFontFamily.fallback:""):o.fontFamily?o.fontFamily:"sans-serif","--userflow-font-size":o.fontSize+"px","--userflow-font-weight-bold":String(o.fontWeightBold),"--userflow-font-weight-normal":String(o.fontWeightNormal),"--userflow-h1-font-size":o.h1FontSize+"px","--userflow-h2-font-size":o.h2FontSize+"px","--userflow-launcher-button-active-background-color":o.launcherButtonActiveBackgroundColor,"--userflow-launcher-button-active-border-color":o.launcherButtonActiveBorderColor,"--userflow-launcher-button-active-font-color":o.launcherButtonActiveFontColor,"--userflow-launcher-button-background-color":o.launcherButtonBackgroundColor,"--userflow-launcher-button-border-color":o.launcherButtonBorderColor,"--userflow-launcher-button-border-radius":o.launcherButtonBorderRadius+"px","--userflow-launcher-button-border-width":o.launcherButtonBorderWidth+"px","--userflow-launcher-button-font-color":o.launcherButtonFontColor,"--userflow-launcher-button-font-weight":String(o.launcherButtonFontWeight),"--userflow-launcher-button-height":o.launcherButtonHeight+"px","--userflow-launcher-button-horizontal-padding":o.launcherButtonHorizontalPadding+"px","--userflow-launcher-button-hover-background-color":o.launcherButtonHoverBackgroundColor,"--userflow-launcher-button-hover-border-color":o.launcherButtonHoverBorderColor,"--userflow-launcher-button-hover-font-color":o.launcherButtonHoverFontColor,"--userflow-launcher-button-width":o.launcherButtonWidth?o.launcherButtonWidth+"px":"auto","--userflow-launcher-icon-active-color":o.launcherIconActiveColor,"--userflow-launcher-icon-color":o.launcherIconColor,"--userflow-launcher-icon-hover-color":o.launcherIconHoverColor,"--userflow-launcher-icon-opacity":o.launcherIconOpacity,"--userflow-launcher-icon-size":o.launcherIconSize+"px","--userflow-line-height":o.lineHeight+"px","--userflow-link-color":o.linkColor,"--userflow-main-active-background-color":o.mainActiveBackgroundColor,"--userflow-main-background-color":o.mainBackgroundColor,"--userflow-main-background-color-rgb":B(o.mainBackgroundColor),"--userflow-main-foreground-color":o.mainForegroundColor,"--userflow-main-foreground-color-rgb":B(o.mainForegroundColor),"--userflow-main-hover-background-color":o.mainHoverBackgroundColor,"--userflow-modal-padding":o.modalPadding+"px","--userflow-modal-padding-top":(o.avatarType===go.NONE?o.modalPadding:o.modalPadding+Math.max((o.avatarSize-o.modalPadding)/2,0))+"px","--userflow-backdrop-color-rgb":B(o.backdropColor),"--userflow-notch-color":o.bubbleBorderWidth>0&&o.bubbleBorderColor||o.mainBackgroundColor,"--userflow-primary-button-active-background-color":o.primaryButtonActiveBackgroundColor,"--userflow-primary-button-active-border-color":o.primaryButtonActiveBorderColor,"--userflow-primary-button-active-font-color":o.primaryButtonActiveFontColor,"--userflow-primary-button-background-color":o.primaryButtonBackgroundColor,"--userflow-primary-button-border-color":o.primaryButtonBorderColor,"--userflow-primary-button-border-width":o.primaryButtonBorderWidth+"px","--userflow-primary-button-font-color":o.primaryButtonFontColor,"--userflow-primary-button-font-weight":String(o.primaryButtonFontWeight),"--userflow-primary-button-hover-background-color":o.primaryButtonHoverBackgroundColor,"--userflow-primary-button-hover-border-color":o.primaryButtonHoverBorderColor,"--userflow-primary-button-hover-font-color":o.primaryButtonHoverFontColor,"--userflow-progress-bar-color":o.progressBarColor,"--userflow-progress-bar-height":o.progressBarHeight+"px","--userflow-narrow-progress-bar-height":o.narrowBarHeight+"px","--userflow-squared-progress-bar-height":o.squaredBarHeight+"px","--userflow-rounded-progress-bar-height":o.roundedBarHeight+"px","--userflow-dotted-progress-bar-height":o.dottedBarHeight+"px","--userflow-numbered-progress-bar-height":o.numberedBarFontSize+"px","--userflow-resource-center-collapsed-height":o.resourceCenterCollapsedHeight+"px","--userflow-resource-center-launcher-icon-img-size":o.rcIconSize+"px","--userflow-resource-center-full-width":o.resourceCenterFullWidth+"px","--userflow-resource-center-launcher-border-radius":(o.resourceCenterLauncherBorderRadius!=null?Math.min(o.resourceCenterLauncherBorderRadius,o.resourceCenterCollapsedHeight/2):o.resourceCenterCollapsedHeight/2)+"px","--userflow-resource-center-padding-x":o.resourceCenterPaddingX+"px","--userflow-resource-center-padding-y":o.resourceCenterPaddingY+"px","--userflow-resource-center-transition-duration":o.resourceCenterTransitionDuration+"ms","--userflow-resource-center-width":o.resourceCenterWidth+"px","--userflow-question-color-light":h(t,o.mainBackgroundColor,.5),"--userflow-question-color-lighter":h(t,o.mainBackgroundColor,.75),"--userflow-question-color-lightest":h(t,o.mainBackgroundColor,.9),"--userflow-question-color-medium-light":h(t,o.mainBackgroundColor,.15),"--userflow-question-color":t,"--userflow-toast-padding":o.toastPadding+"px","--userflow-toast-auto-dismiss":o.toastAutoDismiss+"ms","--userflow-toast-placement":o.toastPlacement+"px","--userflow-toast-width":o.toastWidth+"px","--userflow-toolbar-foreground-color":o.toolbarForegroundColor,"--userflow-toolbar-foreground-color-rgb":B(o.toolbarForegroundColor),"--userflow-tooltip-notch-size":o.tooltipNotchSize+"px","--userflow-unread-badge-background-color":o.unreadBadgeBackgroundColor,"--userflow-unread-badge-foreground-color":o.unreadBadgeForegroundColor,"--userflow-widget-active-background-color":o.widgetActiveBackgroundColor,"--userflow-widget-background-color":o.widgetBackgroundColor,"--userflow-widget-foreground-color":o.widgetForegroundColor,"--userflow-widget-hover-background-color":o.widgetHoverBackgroundColor}}const yo=[];function Ro(o){let[t,n]=p.useState(o);const e=Bo(o.sessionData||yo);return p.useLayoutEffect(()=>{const{variations:l}=o;if(!l)return;const a=[],c=[],i=()=>{let u=o,r=!1;for(const[s,g]of l.entries())if(a[s]){r||(r=!0,u={...u});for(const d of g.overriddenKeys){const f=d,b=g[f];u[f]=b}}n(u)};for(const[u,r]of l.entries()){a[u]=!1;const{condition:s}=r;if(s&&r.overriddenKeys&&r.overriddenKeys.length>0){const d=bo[s.type].track({sessionData:e,condition:s,callback:f=>{a[u]=f,i()}});c[u]=d}else c[u]=()=>{}}return i(),()=>{for(const u of c)u()}},[o,e]),p.useMemo(()=>ho(t),[t])}function Po(o){return o?.cssVersion?`https://cdn.userflow.com/themes/${o.id}/stylesheets/${o.cssVersion}/custom.css`:null}function Fo(o){return`"${o.trim()}"`}const M=new Map;function W(o){let t=M.get(o);return t||(t={stylesheets:new Map},M.set(o,t)),t}function Do(o,t,n,{uninstallOnUnmount:e}={}){const l=Co(),[a,c]=p.useState(!t);return p.useLayoutEffect(()=>{if(!o||!t)return;let i=!1,u;const r=async d=>{await E(l,o,d),u&&T(o,u),u=d};(async()=>{let d=typeof t=="string"?t:t.get();if(Ho()&&n){let f=await Ao(d);if(i)return;f=xo(f,vo(n)),d="data:text/css;base64,"+btoa(f)}await r(d),!i&&c(!0)})();let g=null;return typeof t!="string"&&(g=t.onUpdate(async()=>{r(t.get())})),()=>{i=!0,g&&g(),e&&u&&T(o,u)}},[l,o,t,n,e]),{loaded:a}}function Ho(){return!!window.MSInputMethodContext&&!!document.documentMode}const I=new Map;function Ao(o){return new Promise((t,n)=>{let e=I.get(o);if(e){t(e);return}const l=new XMLHttpRequest;l.addEventListener("load",()=>{if(l.status!==200){n(new Error("Userflow.js could not fetch stylesheet: "+o));return}const a=l.responseText;I.set(o,a),t(a)}),l.addEventListener("error",()=>{n(new Error("Userflow.js could not fetch stylesheet: "+o))}),l.open("GET",o),l.send()})}function xo(o,t){for(const n in t)if(t.hasOwnProperty(n)){const e=t[n];e&&(o=o.replace(new RegExp(`var\\(${n}.*?\\)`,"g"),e))}return o=o.replace(/var\(--[a-z0-9-]+(,\s*(.*?))?\)/g,"$2"),o}function zo(o,t){const n=t&&So(t),e=n?.url,l=n?.fontFamily,[a,c]=p.useState(!e||!l);return p.useLayoutEffect(()=>{if(!o||!e||!l)return;let i=!1;return E(null,o,e),po(o,l,()=>{i||c(!0)}),()=>{i=!0}},[o,e,l]),{loaded:a}}function E(o,t,n){const e=W(t),l=e.stylesheets.get(n);if(l)return l.loadPromise;const a=t.document.createElement("link"),c=new Promise((i,u)=>{a.dataset.userflowStylesheet="true",a.rel="stylesheet",a.href=n,a.onload=()=>{i()},a.onerror=r=>{console.log(`Userflow.js: Error installing Stylesheet ${n}:`,r),o&&o.reportCspIssue(),u()},t.document.head.appendChild(a)});return e.stylesheets.set(n,{link:a,loadPromise:c}),c}function T(o,t){const n=W(o),e=n.stylesheets.get(t);e&&(o.document.head.removeChild(e.link),n.stylesheets.delete(t))}function So(o){if(o.builtinFontFamily)switch(o.builtinFontFamily.provider){case H.GOOGLE:{const t=Array.from(new Set(["0,400","1,400",`0,${o.fontWeightBold}`,`0,${o.fontWeightNormal}`,`0,${o.defaultButtonFontWeight}`,`0,${o.primaryButtonFontWeight}`,`0,${o.checklistLauncherFontWeight}`,`0,${o.launcherButtonFontWeight}`])).sort().join(";");return{url:`https://fonts.googleapis.com/css2?family=${encodeURIComponent(o.builtinFontFamily.name)}:ital,wght@${t}`,fontFamily:o.builtinFontFamily.name}}case H.STANDARD:return null}else return o.fontCssUrl?{url:o.fontCssUrl,fontFamily:o.fontFamily}:null}export{$o as D,Do as a,zo as b,Bo as c,Po as d,vo as g,Ro as u};
|
|
2
2
|
//# sourceMappingURL=stylesheets.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{R as n,r as p}from"./vendor.react.js";import{c as
|
|
1
|
+
import{R as n,r as p}from"./vendor.react.js";import{c as We,g as Ve,a as Ne,b as Se,o as ze}from"./flow-condition-types.js";import{c as He,D as Z}from"./stylesheets.js";import"./vendor.core-js.js";import{o as O}from"./vendor.obj-str.js";import{l as de,a0 as Ke,a1 as Ge,r as A,a2 as Ce,t as ye,E as oe,a3 as I,U as Je,H as S,d as Qe}from"./userflow.js";import{c as Y}from"./vendor.fortawesome.pro-solid-svg-icons.js";import{u as Xe}from"./vendor.react-i18next.js";import{u as je}from"./client-context.js";import{l as Ze,u as Ye,t as et,r as Te,p as tt,j as ke,e as nt,d as rt}from"./roots.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1de37416-3b4b-49ed-a029-a9cd834212e1",e._sentryDebugIdIdentifier="sentry-dbid-1de37416-3b4b-49ed-a029-a9cd834212e1")}catch{}})();const st=n.createContext(null);function be(){const e=p.useContext(st);if(!e)throw new Error("useSession: Session was not set");return e}function at(){const e=be();if(e.kind!=="flow")throw new Error("useFlowSession: Wrong session kind");return e}function lt(e){const t=p.useRef(e),r=p.useRef(e);return e!==r.current&&JSON.stringify(e)!==JSON.stringify(r.current)&&(t.current=e),r.current=e,t.current}function _e(e){const t=be(),[r,i]=p.useState(!1),s=He(t.data),l=lt(e);return p.useLayoutEffect(()=>{if(l)return We[l.type].track({sessionData:s,condition:l,callback:h=>{i(h)}})},[s,l]),l==null?!1:r}const it=({appearance:e,hidden:t,disabled:r,onMouseDown:i,onClick:s,text:l,active:a,children:c})=>n.createElement("button",{className:O({[It(e)]:!0,"userflowjs-bubble-button--hidden":!!t,"userflowjs-bubble-button--active":!!a}),onMouseDown:i,onClick:s,disabled:r},c||n.createElement("div",{className:"userflowjs-bubble-button-text",role:"presentation"},l));function ot(e){const t=Ge(),r=new URL(e,t).toString();t!==r&&(de.customNavigate?de.customNavigate(e):window.setTimeout(()=>{Ke(e)},0))}async function ue(e,t,r){const{steps:i}=t.version;switch(r.type){case A.CLOSE_FLOW:switch(t.kind){case"launcher":await e.dismissLauncher(t,{endReason:oe.ACTION});break;case"banner":case"flow":case"checklist":await e.endFlow(t,{endReason:oe.ACTION});break}return;case A.EVAL_JS:if(de.evalJsDisabled){console.error('Userflow.js: Blocked "Evaluate JavaScript" action from running, since userflow.disableEvalJs() has been called.');return}try{const s=Ne(r.code||"",t.data);new Function(`"use strict";
|
|
2
2
|
`+s)()}catch(s){console.error(`Userflow.js: Evaluate JavaScript action failed.
|
|
3
3
|
|
|
4
4
|
Error:
|
|
5
5
|
${s.stack||s.message||s}
|
|
6
6
|
|
|
7
7
|
Code:
|
|
8
|
-
${r.code}`)}return;case
|
|
8
|
+
${r.code}`)}return;case A.GO_TO_STEP:{if(t.kind!=="flow")return;const s=i.find(({crossVersionId:l})=>l===r.stepCvid);if(!s)throw new Je("Action points to unknown step: "+r.stepCvid);await e.goToStep(t,s);return}case A.NAVIGATE:{if(!r.url){console.warn("Userflow.js: NAVIGATE action is missing url property");return}const s=z(r.url,{lookupAttribute:Ve(t.data)});r.navigateTarget===Ce.NEW_TAB?window.open(s):ot(s);return}case A.SET_ATTRIBUTE:{let s;const l=r.attributeValue||"";switch(r.attributeOperation){case I.SET:s={set:l};break;case I.SET_DATETIME:s={set:new Date().toISOString()};break;case I.SET_DATETIME_ONCE:s={set_once:new Date().toISOString()};break;case I.SET_ONCE:s={set_once:l};break;case I.ADD:s={add:l};break;case I.SUBTRACT:s={subtract:l};break;case I.APPEND:s={append:l};break;case I.PREPEND:s={prepend:l};break;case I.REMOVE:s={remove:l};break;case I.UNSET:s={set:null};break;default:return}const a=r.attributeFqn||"",c=a.split("/");c.length===1?e.updateUser({[a]:s}):c[0]==="group"?e.updateGroup({[c[1]]:s}):c[0]==="group_membership"&&e.updateGroup({},{membership:{[c[1]]:s}});return}case A.SNOOZE:t.kind==="flow"&&r.timeValue&&r.timeUnit&&(e.endFlow(t,{endReason:oe.SNOOZED,batch:!0}),t.draftMode?window.alert(`In preview mode, flows can't be snoozed.
|
|
9
9
|
|
|
10
|
-
But if this flow was running in published mode, the flow would now be snoozed for ${r.timeValue} ${r.timeUnit.toLowerCase()+(r.timeValue===1?"":"s")}.`):e.send({kind:"Snooze",flowId:t.flow.id,timeValue:r.timeValue,timeUnit:r.timeUnit},{batch:!0}));return;case R.START_FLOW:t.kind==="launcher"&&e.deactivateLauncher(t),r.otherFlow?await e.startFlow({flowId:r.otherFlow.id,stepCvid:r.otherFlowStepCvid,startReason:t.draftMode?ve.DRAFT:ve.ACTION,replaceCurrent:!0}):console.warn("Userflow.js: START_FLOW action is missing other flow");return;case R.TRACK_BUTTON_EVENT:{let s=null,l=t?t.id:null;if(t.kind==="flow"){const{currentStep:a}=t;s=a?a?.crossVersionId:null}if(r.buttonEvent){const{eventName:a,token:u}=r.buttonEvent;await e.trackButtonEvent(a,u,s,l)}return}}}async function je(e,t,r){const i=[],s=[],l=[];for(const a of r)a.type===R.NAVIGATE?a.navigateTarget===Ne.NEW_TAB?i.push(a):l.push(a):s.push(a);for(const a of i)ue(e,t,a);await Promise.all(s.map(a=>ue(e,t,a)));for(const a of l)ue(e,t,a)}const it=({button:e})=>{const t=Se(),r=fe(),i=ye(e.disabledCondition),s=ye(e.hiddenCondition);return n.createElement(at,{appearance:e.appearance,hidden:s,disabled:i,onClick:()=>je(t,r,e.actions),text:_e(e.text,r.data)})},ot=()=>n.createElement("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},n.createElement("polygon",{className:"userflowjs-star-shape",fill:"#fff",points:"16 22.7785728 7.18322122 29.1352549 10.5042507 18.7856772 1.73415226 12.3647451 12.6034401 12.3250364 16 2 19.3965599 12.3250364 30.2658477 12.3647451 21.4957493 18.7856772 24.8167788 29.1352549"})),ut=({type:e,required:t,placeholder:r,buttonText:i,options:s,otherOption:l,multipleSelection:a,shuffleOptions:u,labelLeft:b,labelCenter:f,labelRight:v,minValue:c,maxValue:g,onSubmit:y,inert:d})=>{const{t:m}=Je(),E=p.useRef(null),[h,j]=p.useState(""),[A,H]=p.useState(new Set),[S,M]=p.useState(),[K,Q]=p.useState(),[_,G]=p.useState(!1),[k,ne]=p.useState(!1),[D,q]=p.useState(null),P=p.useMemo(()=>s&&(u?[...s].sort(()=>Math.random()-.5):s),[s,u]),L=o=>{if(!(d||!y)){if(t&&h===""&&[N.MULTILINE_TEXT,N.TEXT].includes(e)){q(m("question.requiredError")),re();return}ne(!0),q(null),y({...o,onCancel:()=>{ne(!1)},onError:T=>{ne(!1),q(T||"Sorry, something went wrong saving your answer. Please try again.")}})}},re=p.useCallback(()=>{d||!E.current||E.current.focus()},[d]),[he,we]=p.useState(!1);p.useEffect(()=>{he&&(re(),we(!1))},[re,he]);const pe=n.createElement("div",{className:"userflowjs-bubble-buttons"},n.createElement("button",{className:"userflowjs-bubble-button userflowjs-bubble-button--primary",onClick:()=>L({answer:{kind:"text",value:h}}),tabIndex:d?-1:void 0,disabled:k},n.createElement("div",{className:"userflowjs-bubble-button-text",role:"presentation"},i||m("question.submit"))));let C=null,X=0;if(e===N.NPS)b=b||m("question.npsLabelLeft"),v=v||m("question.npsLabelRight"),C=[0,1,2,3,4,5,6,7,8,9,10],X=C.length;else if([N.SCALE,N.STARS].includes(e)){c=c??1,g=g??5,C=[];for(let o=c;o<=g;o++)C.push(o);X=C.length}else e===N.MULTIPLE_CHOICE&&(X=(P?P.length:0)+(l&&!_?1:0));const[ge,Pe]=p.useState(-1),F=ge===-1?-1:Math.min(ge,X-1),se=o=>{if(!o.target.closest('[role="radio"], [role="checkbox"], [role="radiogroup"], [role="group"]'))return;let x=null;if(o.key==="ArrowRight"||o.key==="ArrowDown"?x=1:(o.key==="ArrowLeft"||o.key==="ArrowUp")&&(x=-1),x!=null){o.preventDefault();const W=o.currentTarget.querySelectorAll('[role="radio"], [role="checkbox"]');let w=F+x;w<0?w=W.length-1:w>W.length-1&&(w=0),Pe(w),W[w].focus()}};let ae=null,le=null;if(C&&(b||f||v)){const o=[];b&&o.push(C[0],b),v&&o.push(C[C.length-1],v),ae=n.createElement("div",{id:"a11y-scale-labels",className:"userflowjs-a11y-only"},o.join(", ")),le=n.createElement("div",{id:"userflowjs-bubble-question-labels",className:"userflowjs-bubble-question__scale-labels","aria-hidden":"true"},n.createElement("div",{className:"userflowjs-bubble-question__scale-label"},b),f&&n.createElement("div",{className:"userflowjs-bubble-question__scale-label userflowjs-bubble-question__scale-label--center"},f),n.createElement("div",{className:"userflowjs-bubble-question__scale-label userflowjs-bubble-question__scale-label--right"},v))}let U;switch(e){case N.MULTILINE_TEXT:U=n.createElement(n.Fragment,null,n.createElement("textarea",{ref:E,className:"userflowjs-textarea userflowjs-bubble-question__textarea",value:h,onChange:o=>j(o.target.value),onKeyDown:o=>{(o.ctrlKey||o.metaKey)&&o.key==="Enter"&&L({answer:{kind:"text",value:h}})},placeholder:r||m("question.placeholder"),readOnly:d||k,tabIndex:d?-1:void 0,rows:3,"aria-required":t?"true":void 0,"aria-invalid":D!=null?"true":void 0}),pe);break;case N.MULTIPLE_CHOICE:{const o=()=>{h&&L({answer:{kind:"text",value:h},animationPromise:ee()})},T=(P?.length||0)+(l?1:0),x=Math.max(0,Math.min(T,c??1)),B=Math.max(0,Math.min(T,g??T)),W=()=>{const w=(P||[]).filter((J,$)=>A.has($)).map(J=>J.value);if(l&&_&&h!==""&&w.push(h),x===B&&w.length!==x){q(m("question.multiple_selection_wrong",{count:x}));return}else if(w.length<x){q(m("question.multiple_selection_too_few",{count:x}));return}else if(w.length>B){q(m("question.multiple_selection_too_many",{count:B}));return}L({answer:{kind:"list",values:w}})};U=n.createElement(n.Fragment,null,a&&n.createElement("div",{className:O({"userflowjs-bubble-question__multiple-choice-hint":!0,"userflowjs-bubble-question__multiple-choice-hint--error":!!D})},m("question.multiple_selection_hint",{replace:{selected:A.size+(l&&_&&h!==""?1:0),range:x===B?x:`${x}-${B}`}}),D&&n.createElement(n.Fragment,null,". ",n.createElement("span",{role:"alert"},D))),n.createElement("div",{className:O({"userflowjs-bubble-question__multiple-choice":!0,"userflowjs-bubble-question__multiple-choice--single-selection":!a,"userflowjs-bubble-question__multiple-choice--multiple-selection":!!a}),role:a?"group":"radiogroup",tabIndex:!d&&F===-1?0:-1,onKeyDown:se},P?.map(({value:w,label:J},$)=>n.createElement("button",{key:$,className:O({"userflowjs-bubble-question__multiple-choice-option":!0,"userflowjs-bubble-question__multiple-choice-option--selected":a?A.has($):k&&!_&&h==w}),onClick:k?void 0:()=>{if(a){q(null);const ie=new Set(A);A.has($)?ie.delete($):ie.add($),H(ie)}else G(!1),j(w),L({answer:{kind:"text",value:w},animationPromise:ee()})},disabled:k,tabIndex:!d&&$===F?0:-1,role:a?"checkbox":"radio","aria-label":J||w,"aria-checked":!_&&h==w},a?n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-checkbox"},n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-checkbox-inner"},n.createElement(Z,{icon:Y}))):n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-radio"},n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-radio-inner"})),n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-option-text","aria-hidden":"true"},J||w))),l&&(_?n.createElement("div",{className:O({"userflowjs-bubble-question__multiple-choice-option":!0,"userflowjs-bubble-question__multiple-choice-option--other":!0,"userflowjs-bubble-question__multiple-choice-option--selected":a?h!="":k})},a?n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-checkbox",onClick:()=>{j(""),G(!1)}},n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-checkbox-inner"},n.createElement(Z,{icon:Y}))):n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-radio"},n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-radio-inner"})),n.createElement("input",{ref:E,className:"userflowjs-bubble-question__multiple-choice-option-input",value:h,onChange:w=>j(w.target.value),onKeyDown:w=>{!w.shiftKey&&w.key==="Enter"?a?W():o():w.key==="Escape"&&(w.stopPropagation(),j(""),G(!1))},onBlur:()=>{h===""&&G(!1)},placeholder:r||m("question.placeholder"),readOnly:d||k,tabIndex:d?-1:void 0}),!a&&n.createElement("button",{"data-testid":"multiple-choice-other-submit",className:"userflowjs-bubble-question__multiple-choice-option-submit",onClick:()=>o(),disabled:k,"aria-label":m("question.submit")},n.createElement(Z,{icon:Y}))):n.createElement("button",{className:"userflowjs-bubble-question__multiple-choice-option",onClick:k?void 0:()=>{q(null),G(!0),we(!0)},disabled:k,tabIndex:!d&&P?.length===F?0:-1,role:"radio","aria-label":m("question.other"),"aria-checked":"false"},a?n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-checkbox"},n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-checkbox-inner"},n.createElement(Z,{icon:Y}))):n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-radio"},n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-radio-inner"})),n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-option-text","aria-hidden":"true"},m("question.other"))))),a&&n.createElement("div",{className:"userflowjs-bubble-buttons"},n.createElement("button",{className:"userflowjs-bubble-button userflowjs-bubble-button--primary",onClick:W,tabIndex:d?-1:void 0,disabled:k},n.createElement("div",{className:"userflowjs-bubble-button-text",role:"presentation"},i||m("question.submit")))));break}case N.NPS:case N.SCALE:{U=n.createElement(n.Fragment,null,ae,n.createElement("div",{className:"userflowjs-bubble-question__scale-options",role:"radiogroup",tabIndex:!d&&F===-1?0:-1,onKeyDown:se},C?.map((o,T)=>n.createElement("button",{className:O({"userflowjs-bubble-question__scale-option":!0,"userflowjs-bubble-question__scale-option--selected":k&&S==o}),key:o,tabIndex:!d&&T===F?0:-1,onClick:()=>{M(o),L({answer:{kind:"number",value:o},animationPromise:ee()})},disabled:k,role:"radio","aria-checked":S==o},o))),le);break}case N.STARS:{U=n.createElement("div",{className:"userflowjs-bubble-question__stars-wrapper"},ae,n.createElement("div",{className:"userflowjs-bubble-question__stars",role:"radiogroup",tabIndex:!d&&F===-1?0:-1,onKeyDown:se},C?.map((o,T)=>n.createElement("button",{className:O({"userflowjs-bubble-question__star":!0,"userflowjs-bubble-question__star--hovered":!k&&K!=null&&K>=o,"userflowjs-bubble-question__star--selected":k&&S!=null&&S>=o,"userflowjs-bubble-question__star--not-selected":k&&S!=null&&S<o}),key:o,tabIndex:!d&&T===F?0:-1,onClick:()=>{M(o),L({answer:{kind:"number",value:o},animationPromise:ee()})},onMouseOver:()=>Q(o),onMouseLeave:()=>Q(null),disabled:k,role:"radio","aria-checked":S==o,"aria-label":String(o)},n.createElement("div",{className:"userflowjs-bubble-question__star-icon","aria-hidden":"true"},n.createElement(ot,null)),n.createElement("div",{className:"userflowjs-bubble-question__star-value","aria-hidden":"true"},o)))),le);break}case N.TEXT:U=n.createElement(n.Fragment,null,n.createElement("input",{ref:E,className:"userflowjs-text-input userflowjs-bubble-question__text-input",value:h,onChange:o=>j(o.target.value),onKeyDown:o=>{!o.shiftKey&&o.key==="Enter"&&L({answer:{kind:"text",value:h}})},placeholder:r||m("question.placeholder"),readOnly:d||k,tabIndex:d?-1:void 0,"aria-required":t?"true":void 0,"aria-invalid":D!=null?"true":void 0}),pe);break}return n.createElement("div",{className:"userflowjs-bubble-question",style:{pointerEvents:d?"none":void 0}},D&&!(e===N.MULTIPLE_CHOICE&&a)&&n.createElement("div",{className:"userflowjs-bubble-question__error",role:"alert"},D),U)};function ee(){return new Promise(e=>window.setTimeout(e,250))}const ct=({question:e})=>{const t=Se(),r=rt();return n.createElement(ut,{type:e.type,required:!!e.required,placeholder:e.placeholder||"",buttonText:e.buttonText||"",options:e.options,otherOption:e.otherOption,multipleSelection:e.multipleSelection,shuffleOptions:e.shuffleOptions,labelLeft:e.labelLeft||"",labelCenter:e.labelCenter||"",labelRight:e.labelRight||"",minValue:e.minValue,maxValue:e.maxValue,onSubmit:async i=>{Ge("answerQuestion",r.id,e.cvid,i);const{answer:s}=i;try{await Promise.all([await t.send({kind:"AnswerQuestion",sessionId:r.id,questionName:e.name,questionCvid:e.cvid,textAnswer:s.kind=="text"?s.value:null,numberAnswer:s.kind=="number"?String(s.value):null,listAnswer:s.kind=="list"?s.values:null}),i.animationPromise])}catch(a){console.log("Userflow.js: Error when answering question:",a),i.onError();return}const{bindAttributeFqn:l}=e;if(l&&t.flowSession?.id===r.id){let a;switch(s.kind){case"text":a={name:l,value:s.value};break;case"number":a={name:l,value:String(s.value)};break;case"list":a={name:l,value:s.values};break}t.optimisticClockUIUpdate(()=>{t.setFlowSession({...r,data:[...r.data.filter(u=>u.name!==l),a]})})}je(t,r,e.actions)}})},mt=({text:e})=>{if(!e)return null;const t=e.split(/\n/);return t.length===1?n.createElement(n.Fragment,null,t[0]):n.createElement(n.Fragment,null,t.map((r,i)=>n.createElement(n.Fragment,{key:i},i>0&&n.createElement("br",null),r)))};function ft(e=""){return{type:"rich2",children:[dt(e)]}}function dt(e=""){return{type:"paragraph",children:[{text:e}]}}function Te(e){if(e){let t;try{t=JSON.parse(e)}catch{throw new Error("Could not JSON.parse rich content doc: "+e)}if(t.type==="rich2")return t;throw new Error("Could not recognize rich content doc: "+e)}else return ft()}function bt(e=""){return{type:"plaintext2",children:[{type:"plaintext",children:[{text:e}]}]}}function ht(e){if(e){let t;try{t=JSON.parse(e)}catch{throw new Error("Could not JSON.parse plaintext doc: "+e)}if(t.type==="plaintext2")return t;throw new Error("Could not recognize plaintext doc: "+e)}else return bt()}function z(e,{lookupAttribute:t}){if(!e)return"";typeof e=="string"&&(e=ht(e));const r=[];function i(l){if(de(l)){l.text&&r.push(l.text);return}switch(l.type){case"attribute":{const a=Le(l,t);a&&r.push(a);break}default:s(l.children);break}}function s(l){l&&l.forEach(a=>a&&i(a))}return s(e.children),r.join("")}function Vt(e){let t=!0;if(!e)return!0;typeof e=="string"&&(e=Te(e));const r=new Set(["attribute","button","image","question","video"]);return $e(e,i=>{if(de(i)){i.text!==""&&(t=!1);return}"type"in i&&r.has(i.type)&&(t=!1)}),t}const zt=n.memo(({doc:e,...t})=>e?(typeof e=="string"&&(e=Te(e)),n.createElement(Ie,{parent:e,...t})):null),Ie=({parent:e,...t})=>n.createElement(n.Fragment,null,e.children.map((r,i)=>de(r)?n.createElement(wt,{key:i,node:r}):n.createElement(pt,{key:i,node:r,parent:e,...t}))),wt=({node:e})=>e.text?n.createElement(Re,{node:e},n.createElement(mt,{text:e.text})):null,Re=({node:e,children:t})=>(e.color&&typeof e.color=="string"&&(t=n.createElement("span",{style:{color:e.color}},t)),e.bold&&(t=n.createElement("b",null,t)),e.italic&&(t=n.createElement("i",null,t)),e.underline&&(t=n.createElement("u",null,t)),e.strikeThrough&&(t=n.createElement("s",null,t)),e.code&&(t=n.createElement("code",null,t)),e.small&&(t=n.createElement("small",null,t)),e.sup&&(t=n.createElement("sup",null,t)),t),pt=({node:e,parent:t,...r})=>{const{lookupAttribute:i}=r,s=n.createElement(Ie,{parent:e,...r});switch(e.type){case"attribute":return n.createElement(gt,{node:e,...r});case"button":return n.createElement(vt,{node:e,...r});case"button-group":return n.createElement("div",{className:"userflowjs-bubble-buttons",style:{justifyContent:e.align}},s);case"column":return n.createElement("div",{style:St(e,t)},s);case"column-group":return n.createElement("div",{className:"p-like",style:Nt(e)},s);case"container":return n.createElement("div",{className:"p-like"+(e.className?` ${e.className}`:""),style:Ct(e)},s);case"image":return n.createElement(yt,{node:e,...r});case"link":return n.createElement("a",{href:z(e.href,{lookupAttribute:i}),target:e.target==="same"?"_top":"_blank",rel:"noopener noreferrer"},s);case"paragraph":return n.createElement("p",{className:ce(e)},s);case"heading1":return n.createElement("h1",{className:ce(e)},s);case"heading2":return n.createElement("h2",{className:ce(e)},s);case"question":return n.createElement(Et,{node:e,...r});case"quote":return n.createElement("blockquote",null,s);case"code-block":return n.createElement("pre",null,n.createElement("code",null,s));case"ordered-list":return n.createElement("ol",null,s);case"unordered-list":return n.createElement("ul",null,s);case"list-item":return n.createElement("li",null,s);case"video":return n.createElement(kt,{node:e,...r});default:return n.createElement("div",null,s)}},gt=({node:e,lookupAttribute:t})=>{let r=Le(e,t);return n.createElement(Re,{node:e},r)},vt=({node:e,buttons:t})=>{const r=t?.find(i=>i.cvid===e.cvid);return r?n.createElement(it,{key:r.id,button:r}):null},Et=({node:e,questions:t})=>{const r=t?.find(i=>i.cvid===e.cvid);return r?n.createElement(ct,{key:r.id,question:r}):null},yt=({node:e,lookupAttribute:t})=>{const{src:r,widthMode:i,displayWidth:s,width:l,height:a,marginTop:u,marginRight:b,marginBottom:f,marginLeft:v,align:c,hasLink:g,href:y}=e;if(!r)return null;const{wrapperStyle:d,blockStyle:m}=Ae({widthMode:i,displayWidth:s,width:l,height:a,marginTop:u,marginRight:b,marginBottom:f,marginLeft:v,align:c}),E=typeof r=="string"?r:z(r,{lookupAttribute:t});let h=n.createElement("img",{src:xe(E,j=>encodeURIComponent((t?t(j):"")||"")),style:{...m,objectFit:"contain"},alt:""});return g&&y&&(h=n.createElement("a",{href:z(y,{lookupAttribute:t}),target:e.target==="same"?"_top":"_blank",rel:"noopener noreferrer",style:m},h)),n.createElement("div",{className:"p-like"},n.createElement("div",{style:d},h))},kt=({node:e,lookupAttribute:t})=>{const{url:r,widthMode:i,displayWidth:s,width:l,height:a,marginTop:u,marginRight:b,marginBottom:f,marginLeft:v,align:c}=e;if(!r)return null;const{wrapperStyle:g,blockStyle:y}=Ae({widthMode:i,displayWidth:s,width:l,height:a,marginTop:u,marginRight:b,marginBottom:f,marginLeft:v,align:c});return n.createElement("div",{className:"p-like"},n.createElement("div",{style:g},n.createElement("div",{style:y},n.createElement(_t,{element:e,noFocus:!0,lookupAttribute:t}))))},_t=({element:{embedType:e,url:t,src:r,autoPlay:i,controls:s,loop:l,muted:a},noFocus:u,forceMuted:b,lookupAttribute:f})=>{if(!t)return null;const v=typeof t=="string"?t:z(t,{lookupAttribute:f}),c={width:"100%",height:"100%",allow:"accelerometer; autoplay; fullscreen; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,allowtransparency:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true",oallowfullscreen:"true",msallowfullscreen:"true",style:{display:"block",border:"none"},tabIndex:u?-1:void 0};if(e==="video")return n.createElement("video",{key:v+";"+String(i)+";"+String(s)+";"+String(l)+";"+String(a),src:v,style:{width:"100%",height:"100%",display:"block"},autoPlay:!!i,controls:s!==!1,loop:l,muted:b||a});if(r){let E;try{E=new URL(r)}catch{return null}return b&&(E.searchParams.has("autoplay")||E.searchParams.has("autoPlay"))&&(E.searchParams.set("mute","1"),E.searchParams.set("muted","1"),E.searchParams.set("volume","0")),n.createElement("iframe",{src:E.toString(),...c})}let g=xt(v,{iframeFallback:!0});if(g.kind==="invalid")return null;const{videoProvider:y,videoId:d,searchParams:m}=g;switch(i=i||m.has("autoplay")||m.has("autoPlay"),y){case"iframe":return n.createElement("iframe",{src:xe(d,E=>encodeURIComponent((f?f(E):"")||"")),scrolling:m.get("scrolling")||void 0,...c});case"loom":return n.createElement("iframe",{src:`https://www.loom.com/embed/${d}?${m.toString()}`,...c});case"raw":return n.createElement("video",{src:d,controls:!0,style:{width:"100%",height:"100%",display:"block"},autoPlay:m.has("autoplay"),muted:b||m.has("muted")});case"youtube":return b&&i&&m.set("mute","1"),n.createElement("iframe",{src:`https://www.youtube.com/embed/${d}?${m.toString()}`,...c});case"vimeo":return b&&i&&m.set("muted","1"),n.createElement("iframe",{src:`https://player.vimeo.com/video/${d}?${m.toString()}`,...c});case"wistia":return m.set("videoFoam","true"),b&&i&&m.set("volume","0"),n.createElement(n.Fragment,null,n.createElement("iframe",{src:`https://fast.wistia.net/embed/iframe/${d}?${m.toString()}`,...c}))}};function xt(e,{iframeFallback:t}={}){let r;try{r=new URL(e)}catch{return{kind:"invalid"}}const{hostname:i,pathname:s,searchParams:l}=r;if(i.match(/^(www\.)?(use)?loom\.com$/)){const a=s.match(/^\/share\/([a-z0-9]+)$/i);if(a){const[,u]=a;return{kind:"ok",videoProvider:"loom",videoId:u,searchParams:l}}}if(e.startsWith("raw:"))return{kind:"ok",videoProvider:"raw",videoId:e.replace(/^raw:/,""),searchParams:l};if(e.startsWith("iframe:"))return{kind:"ok",videoProvider:"iframe",videoId:e.replace(/^iframe:/,""),searchParams:l};if(["youtube.com","www.youtube.com"].includes(i)){const a=l.get("v");if(a)return l.delete("v"),{kind:"ok",videoProvider:"youtube",videoId:a,searchParams:l}}if(i==="youtu.be"){const a=s.match(/^\/([^/]+)$/);if(a){const[,u]=a;return{kind:"ok",videoProvider:"youtube",videoId:u,searchParams:l}}}if(i==="vimeo.com"){const a=s.match(/^\/(\d+)$/);if(a){const[,u]=a;return{kind:"ok",videoProvider:"vimeo",videoId:u,searchParams:l}}}if(i==="player.vimeo.com"){const a=s.match(/^\/video\/([^/]+)$/);if(a){const[,u]=a;return{kind:"ok",videoProvider:"vimeo",videoId:u,searchParams:l}}}if(i.match(/^[^.]+\.wistia.com$/)){const a=s.match(/^\/medias\/([^/]+)$/);if(a){const[,u]=a;return{kind:"ok",videoProvider:"wistia",videoId:u,searchParams:l}}}return t?{kind:"ok",videoProvider:"iframe",videoId:e,searchParams:l}:{kind:"invalid"}}function ce(e){return e.align==="right"?"userflowjs-text-align-end":e.align==="center"?"userflowjs-text-align-center":e.align==="justify"?"userflowjs-text-align-justify":""}function Ae({widthMode:e,displayWidth:t,width:r,height:i,marginTop:s,marginRight:l,marginBottom:a,marginLeft:u,align:b}){const f={position:"relative"},v={position:"absolute",top:"0",left:"0",display:"block",width:"100%",height:"100%"};typeof t!="number"&&(t=100,e="percent"),b==="center"?(f.marginLeft="auto",f.marginRight="auto"):b==="right"&&(f.marginLeft="auto");let c=0;if(s!=null&&typeof s=="number"&&(f.marginTop=`${s}px`),l!=null&&typeof l=="number"&&(f.marginRight=`${l}px`,c+=l),a!=null&&typeof a=="number"&&(f.marginBottom=`${a}px`),u!=null&&typeof u=="number"&&(f.marginLeft=`${u}px`,c+=u),typeof t!="number"||typeof r!="number"||typeof i!="number")f.width="100px",f.height="100px";else if(e==="px"){const y=Math.max(10,t);f.width=`${y}px`,f.height=`${y/(r/i)}px`}else{const g=Math.max(0,Math.min(100,t));f.width=`calc(${g}% - ${c}px)`,f.height="0",f.paddingBottom=`calc((${g}% - ${c}px) / (${r} / ${i})`}return{wrapperStyle:f,blockStyle:v}}const qe=16;function Nt(e){return{display:"flex",alignItems:"stretch",marginRight:`-${e.spacing==null?qe:e.spacing}px`}}function St(e,t){const r=e.widthMode==="fill"||e.displayWidth==null;return{display:"flex",flexDirection:"column",justifyContent:e.justifyContent,width:r?void 0:e.widthMode==="px"?`${e.displayWidth||50}px`:e.widthMode==="percent"?`${e.displayWidth||50}%`:void 0,flex:r?"1 0 0":void 0,marginRight:`${t.spacing==null?qe:t.spacing}px`,marginBottom:"0"}}function Ct(e){return{display:"flex",flexDirection:"column",justifyContent:e.justifyContent,width:e.widthMode==="px"&&e.displayWidth!=null?`${e.displayWidth}px`:e.widthMode==="percent"&&e.displayWidth!=null?`${e.displayWidth}%`:void 0,minHeight:e.heightMode==="px"?`${e.displayHeight||50}px`:void 0,flex:e.heightMode==="fill"?"1 0 0":void 0,marginTop:e.marginTop!=null?`${e.marginTop}px`:void 0,marginRight:e.marginRight!=null?`${e.marginRight}px`:e.widthMode!=="fill"&&e.align==="center"?"auto":void 0,marginBottom:e.marginBottom!=null?`${e.marginBottom}px`:void 0,marginLeft:e.marginLeft!=null?`${e.marginLeft}px`:e.widthMode!=="fill"&&(e.align==="center"||e.align==="right")?"auto":void 0}}function Le(e,t){if(!t)return null;const r=e.attributeName;if(typeof r=="string"){const i=t(r)||e.fallback;if(typeof i=="string")return i}return null}function Fe(e){return Array.isArray(e.children)&&typeof e.addMark>"u"}function ke(e,t,r="type"){return Fe(e)&&typeof e=="object"&&e[r]===t}function de(e){return typeof e.text=="string"}function $e(e,t){function r(s,l){t(s,l),Fe(s)&&i(s.children)}function i(s){s&&s.forEach((l,a)=>l&&r(l,a))}i(Array.isArray(e)?e:e.children)}const Ht=n.memo(({doc:e,lookupAttribute:t})=>e?n.createElement(n.Fragment,null,z(e,{lookupAttribute:t})):null);function Kt(e,{buttons:t,questions:r}){const i=new Set,s=new Set;if($e(e,l=>{ke(l,"button")&&i.add(l.cvid),ke(l,"question")&&s.add(l.cvid)}),r){const l=r.filter(a=>!s.has(a.cvid));l.length>0&&(e={...e,children:[...e.children,...l.map(a=>({type:"question",cvid:a.cvid,children:[{text:""}]}))]})}if(t){const l=t.filter(a=>!i.has(a.cvid));l.length>0&&(e={...e,children:[...e.children,{type:"button-group",children:l.map(a=>({type:"button",cvid:a.cvid,children:[{text:""}]}))}]})}return e}function jt(e){return e=e||"default","userflowjs-bubble-button "+(e==="primary"||e==="PRIMARY"||e==="default"||e==="DEFAULT"||e==="banner-primary"||e==="banner-secondary"?`userflowjs-bubble-button--${e.toLowerCase()}`:e)}const Gt=new URL("bubble-frame.css",import.meta.url).href;let be=!1;const V=[];let te=[],De;function Tt(e){V.push(e),V.length===1&&(be=!0,Oe(),window.addEventListener("scroll",Me))}function It(e){const t=V.indexOf(e);t>=0&&(V.splice(t,1),V.length===0&&(be=!1,window.cancelAnimationFrame(De),window.removeEventListener("scroll",Me)))}function Jt(e){te.push(e)}function Rt(){V.forEach(e=>e()),te.length>0&&(te.forEach(e=>e()),te=[]),Oe()}function Oe(){be&&(De=window.requestAnimationFrame(Rt))}function Me(){}function Qt({selector:e,targetMoved:t,targetLost:r,onTargetClick:i,onTargetMouseEnter:s,onTargetMouseLeave:l}){const a=p.useRef(t),u=p.useRef(r),b=p.useRef(i),f=p.useRef(s),v=p.useRef(l);p.useLayoutEffect(()=>{a.current=t,u.current=r,b.current=i,f.current=s,v.current=l}),p.useLayoutEffect(()=>{let c=null,g=null,y=null,d=!1;const m=()=>{c=null,g=null,y=null,u.current()};if(!e){m();return}const E=()=>{if(!y||!c)return;const _=Ce(c);(!g||!At(g,_))&&(g=_,_.width===0&&_.height===0?m():a.current({targetEl:c,targetRect:g,clipEl:y,viewportClipRect:qt(y)}))};let h=!1;const j=()=>{h||(h=!0,Tt(E))},A=()=>{h&&(h=!1,It(E))},H=()=>{b.current&&b.current()},S=()=>{f.current&&f.current()},M=()=>{v.current&&v.current()},K=()=>{const _=c;c=Qe(e)?e:Xe(e),(!d||c!==_)&&(_&&(_.removeEventListener("click",H),_.removeEventListener("mouseenter",S),_.removeEventListener("mouseleave",M)),c?(j(),c.addEventListener("click",H),c.addEventListener("mouseenter",S),c.addEventListener("mouseleave",M),y=Ze(c)):(A(),m())),d=!0};K();const Q=We(K);return()=>{Q.disconnect(),A(),c&&(c.removeEventListener("click",H),c.removeEventListener("mouseenter",S),c.removeEventListener("mouseleave",M))}},[e])}function At(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function qt(e){Ye();const t=Ee(et()),r=Ee(tt());if(!e||e===document.documentElement)return{top:0,right:r,bottom:t,left:0};{const i=Ce(e);return{top:Math.max(0,i.top),right:Math.min(r,i.right),bottom:Math.min(t,i.bottom),left:Math.max(0,i.left)}}}export{it as B,zt as R,nt as S,Ht as a,Gt as b,ye as c,Te as d,at as e,Vt as f,Le as g,je as h,de as i,fe as j,Kt as m,lt as n,Jt as r,z as s,Qt as u};
|
|
10
|
+
But if this flow was running in published mode, the flow would now be snoozed for ${r.timeValue} ${r.timeUnit.toLowerCase()+(r.timeValue===1?"":"s")}.`):e.send({kind:"Snooze",flowId:t.flow.id,timeValue:r.timeValue,timeUnit:r.timeUnit},{batch:!0}));return;case A.START_FLOW:t.kind==="launcher"&&e.deactivateLauncher(t),r.otherFlow?await e.startFlow({flowId:r.otherFlow.id,stepCvid:r.otherFlowStepCvid,startReason:t.draftMode?ye.DRAFT:ye.ACTION,replaceCurrent:!0}):console.warn("Userflow.js: START_FLOW action is missing other flow");return;case A.TRACK_BUTTON_EVENT:{let s=null,l=t?t.id:null;if(t.kind==="flow"){const{currentStep:a}=t;s=a?a?.crossVersionId:null}if(r.buttonEvent){const{eventName:a,token:c}=r.buttonEvent;await e.trackButtonEvent(a,c,s,l)}return}}}async function Ie(e,t,r){const i=[],s=[],l=[];for(const a of r)a.type===A.NAVIGATE?a.navigateTarget===Ce.NEW_TAB?i.push(a):l.push(a):s.push(a);for(const a of i)ue(e,t,a);await Promise.all(s.map(a=>ue(e,t,a)));for(const a of l)ue(e,t,a)}const ut=({button:e})=>{const t=je(),r=be(),i=_e(e.disabledCondition),s=_e(e.hiddenCondition);return n.createElement(it,{appearance:e.appearance,hidden:s,disabled:i,onClick:()=>Ie(t,r,e.actions),text:Ne(e.text,r.data)})},ct=()=>n.createElement("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},n.createElement("polygon",{className:"userflowjs-star-shape",fill:"#fff",points:"16 22.7785728 7.18322122 29.1352549 10.5042507 18.7856772 1.73415226 12.3647451 12.6034401 12.3250364 16 2 19.3965599 12.3250364 30.2658477 12.3647451 21.4957493 18.7856772 24.8167788 29.1352549"})),mt=({type:e,required:t,placeholder:r,buttonText:i,options:s,otherOption:l,multipleSelection:a,shuffleOptions:c,labelLeft:h,labelCenter:d,labelRight:g,minValue:m,maxValue:v,onSubmit:E,inert:b})=>{const{t:f}=Xe(),_=p.useRef(null),[u,x]=p.useState(""),[R,H]=p.useState(new Set),[C,U]=p.useState(),[K,Q]=p.useState(),[k,G]=p.useState(!1),[y,ne]=p.useState(!1),[D,q]=p.useState(null),M=p.useMemo(()=>s&&(c?[...s].sort(()=>Math.random()-.5):s),[s,c]),L=o=>{if(!(b||!E)){if(t&&u===""&&[S.MULTILINE_TEXT,S.TEXT].includes(e)){q(f("question.requiredError")),re();return}ne(!0),q(null),E({...o,onCancel:()=>{ne(!1)},onError:T=>{ne(!1),q(T||"Sorry, something went wrong saving your answer. Please try again.")}})}},re=p.useCallback(()=>{b||!_.current||_.current.focus()},[b]),[pe,ge]=p.useState(!1);p.useEffect(()=>{pe&&(re(),ge(!1))},[re,pe]);const ve=n.createElement("div",{className:"userflowjs-bubble-buttons"},n.createElement("button",{className:"userflowjs-bubble-button userflowjs-bubble-button--primary",onClick:()=>L({answer:{kind:"text",value:u}}),tabIndex:b?-1:void 0,disabled:y},n.createElement("div",{className:"userflowjs-bubble-button-text",role:"presentation"},i||f("question.submit"))));let j=null,X=0;if(e===S.NPS)h=h||f("question.npsLabelLeft"),g=g||f("question.npsLabelRight"),j=[0,1,2,3,4,5,6,7,8,9,10],X=j.length;else if([S.SCALE,S.STARS].includes(e)){m=m??1,v=v??5,j=[];for(let o=m;o<=v;o++)j.push(o);X=j.length}else e===S.MULTIPLE_CHOICE&&(X=(M?M.length:0)+(l&&!k?1:0));const[Ee,Be]=p.useState(-1),F=Ee===-1?-1:Math.min(Ee,X-1),se=o=>{if(!o.target.closest('[role="radio"], [role="checkbox"], [role="radiogroup"], [role="group"]'))return;let N=null;if(o.key==="ArrowRight"||o.key==="ArrowDown"?N=1:(o.key==="ArrowLeft"||o.key==="ArrowUp")&&(N=-1),N!=null){o.preventDefault();const W=o.currentTarget.querySelectorAll('[role="radio"], [role="checkbox"]');let w=F+N;w<0?w=W.length-1:w>W.length-1&&(w=0),Be(w),W[w].focus()}};let ae=null,le=null;if(j&&(h||d||g)){const o=[];h&&o.push(j[0],h),g&&o.push(j[j.length-1],g),ae=n.createElement("div",{id:"a11y-scale-labels",className:"userflowjs-a11y-only"},o.join(", ")),le=n.createElement("div",{id:"userflowjs-bubble-question-labels",className:"userflowjs-bubble-question__scale-labels","aria-hidden":"true"},n.createElement("div",{className:"userflowjs-bubble-question__scale-label"},h),d&&n.createElement("div",{className:"userflowjs-bubble-question__scale-label userflowjs-bubble-question__scale-label--center"},d),n.createElement("div",{className:"userflowjs-bubble-question__scale-label userflowjs-bubble-question__scale-label--right"},g))}let P;switch(e){case S.MULTILINE_TEXT:P=n.createElement(n.Fragment,null,n.createElement("textarea",{ref:_,className:"userflowjs-textarea userflowjs-bubble-question__textarea",value:u,onChange:o=>x(o.target.value),onKeyDown:o=>{(o.ctrlKey||o.metaKey)&&o.key==="Enter"&&L({answer:{kind:"text",value:u}})},placeholder:r||f("question.placeholder"),readOnly:b||y,tabIndex:b?-1:void 0,rows:3,"aria-required":t?"true":void 0,"aria-invalid":D!=null?"true":void 0}),ve);break;case S.MULTIPLE_CHOICE:{const o=()=>{u&&L({answer:{kind:"text",value:u},animationPromise:ee()})},T=(M?.length||0)+(l?1:0),N=Math.max(0,Math.min(T,m??1)),B=Math.max(0,Math.min(T,v??T)),W=()=>{const w=(M||[]).filter((J,$)=>R.has($)).map(J=>J.value);if(l&&k&&u!==""&&w.push(u),N===B&&w.length!==N){q(f("question.multiple_selection_wrong",{count:N}));return}else if(w.length<N){q(f("question.multiple_selection_too_few",{count:N}));return}else if(w.length>B){q(f("question.multiple_selection_too_many",{count:B}));return}L({answer:{kind:"list",values:w}})};P=n.createElement(n.Fragment,null,a&&n.createElement("div",{className:O({"userflowjs-bubble-question__multiple-choice-hint":!0,"userflowjs-bubble-question__multiple-choice-hint--error":!!D})},f("question.multiple_selection_hint",{replace:{selected:R.size+(l&&k&&u!==""?1:0),range:N===B?N:`${N}-${B}`}}),D&&n.createElement(n.Fragment,null,". ",n.createElement("span",{role:"alert"},D))),n.createElement("div",{className:O({"userflowjs-bubble-question__multiple-choice":!0,"userflowjs-bubble-question__multiple-choice--single-selection":!a,"userflowjs-bubble-question__multiple-choice--multiple-selection":!!a}),role:a?"group":"radiogroup",tabIndex:!b&&F===-1?0:-1,onKeyDown:se},M?.map(({value:w,label:J},$)=>n.createElement("button",{key:$,className:O({"userflowjs-bubble-question__multiple-choice-option":!0,"userflowjs-bubble-question__multiple-choice-option--selected":a?R.has($):y&&!k&&u==w}),onClick:y?void 0:()=>{if(a){q(null);const ie=new Set(R);R.has($)?ie.delete($):ie.add($),H(ie)}else G(!1),x(w),L({answer:{kind:"text",value:w},animationPromise:ee()})},disabled:y,tabIndex:!b&&$===F?0:-1,role:a?"checkbox":"radio","aria-label":J||w,"aria-checked":!k&&u==w},a?n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-checkbox"},n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-checkbox-inner"},n.createElement(Z,{icon:Y}))):n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-radio"},n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-radio-inner"})),n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-option-text","aria-hidden":"true"},J||w))),l&&(k?n.createElement("div",{className:O({"userflowjs-bubble-question__multiple-choice-option":!0,"userflowjs-bubble-question__multiple-choice-option--other":!0,"userflowjs-bubble-question__multiple-choice-option--selected":a?u!="":y})},a?n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-checkbox",onClick:()=>{x(""),G(!1)}},n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-checkbox-inner"},n.createElement(Z,{icon:Y}))):n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-radio"},n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-radio-inner"})),n.createElement("input",{ref:_,className:"userflowjs-bubble-question__multiple-choice-option-input",value:u,onChange:w=>x(w.target.value),onKeyDown:w=>{!w.shiftKey&&w.key==="Enter"?a?W():o():w.key==="Escape"&&(w.stopPropagation(),x(""),G(!1))},onBlur:()=>{u===""&&G(!1)},placeholder:r||f("question.placeholder"),readOnly:b||y,tabIndex:b?-1:void 0}),!a&&n.createElement("button",{"data-testid":"multiple-choice-other-submit",className:"userflowjs-bubble-question__multiple-choice-option-submit",onClick:()=>o(),disabled:y,"aria-label":f("question.submit")},n.createElement(Z,{icon:Y}))):n.createElement("button",{className:"userflowjs-bubble-question__multiple-choice-option",onClick:y?void 0:()=>{q(null),G(!0),ge(!0)},disabled:y,tabIndex:!b&&M?.length===F?0:-1,role:"radio","aria-label":f("question.other"),"aria-checked":"false"},a?n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-checkbox"},n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-checkbox-inner"},n.createElement(Z,{icon:Y}))):n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-radio"},n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-radio-inner"})),n.createElement("div",{className:"userflowjs-bubble-question__multiple-choice-option-text","aria-hidden":"true"},f("question.other"))))),a&&n.createElement("div",{className:"userflowjs-bubble-buttons"},n.createElement("button",{className:"userflowjs-bubble-button userflowjs-bubble-button--primary",onClick:W,tabIndex:b?-1:void 0,disabled:y},n.createElement("div",{className:"userflowjs-bubble-button-text",role:"presentation"},i||f("question.submit")))));break}case S.NPS:case S.SCALE:{P=n.createElement(n.Fragment,null,ae,n.createElement("div",{className:"userflowjs-bubble-question__scale-options",role:"radiogroup",tabIndex:!b&&F===-1?0:-1,onKeyDown:se},j?.map((o,T)=>n.createElement("button",{className:O({"userflowjs-bubble-question__scale-option":!0,"userflowjs-bubble-question__scale-option--selected":y&&C==o}),key:o,tabIndex:!b&&T===F?0:-1,onClick:()=>{U(o),L({answer:{kind:"number",value:o},animationPromise:ee()})},disabled:y,role:"radio","aria-checked":C==o},o))),le);break}case S.STARS:{P=n.createElement("div",{className:"userflowjs-bubble-question__stars-wrapper"},ae,n.createElement("div",{className:"userflowjs-bubble-question__stars",role:"radiogroup",tabIndex:!b&&F===-1?0:-1,onKeyDown:se},j?.map((o,T)=>n.createElement("button",{className:O({"userflowjs-bubble-question__star":!0,"userflowjs-bubble-question__star--hovered":!y&&K!=null&&K>=o,"userflowjs-bubble-question__star--selected":y&&C!=null&&C>=o,"userflowjs-bubble-question__star--not-selected":y&&C!=null&&C<o}),key:o,tabIndex:!b&&T===F?0:-1,onClick:()=>{U(o),L({answer:{kind:"number",value:o},animationPromise:ee()})},onMouseOver:()=>Q(o),onMouseLeave:()=>Q(null),disabled:y,role:"radio","aria-checked":C==o,"aria-label":String(o)},n.createElement("div",{className:"userflowjs-bubble-question__star-icon","aria-hidden":"true"},n.createElement(ct,null)),n.createElement("div",{className:"userflowjs-bubble-question__star-value","aria-hidden":"true"},o)))),le);break}case S.TEXT:P=n.createElement(n.Fragment,null,n.createElement("input",{ref:_,className:"userflowjs-text-input userflowjs-bubble-question__text-input",value:u,onChange:o=>x(o.target.value),onKeyDown:o=>{!o.shiftKey&&o.key==="Enter"&&L({answer:{kind:"text",value:u}})},placeholder:r||f("question.placeholder"),readOnly:b||y,tabIndex:b?-1:void 0,"aria-required":t?"true":void 0,"aria-invalid":D!=null?"true":void 0}),ve);break}return n.createElement("div",{className:"userflowjs-bubble-question",style:{pointerEvents:b?"none":void 0}},D&&!(e===S.MULTIPLE_CHOICE&&a)&&n.createElement("div",{className:"userflowjs-bubble-question__error",role:"alert"},D),P)};function ee(){return new Promise(e=>window.setTimeout(e,250))}const ft=({question:e})=>{const t=je(),r=at();return n.createElement(mt,{type:e.type,required:!!e.required,placeholder:e.placeholder||"",buttonText:e.buttonText||"",options:e.options,otherOption:e.otherOption,multipleSelection:e.multipleSelection,shuffleOptions:e.shuffleOptions,labelLeft:e.labelLeft||"",labelCenter:e.labelCenter||"",labelRight:e.labelRight||"",minValue:e.minValue,maxValue:e.maxValue,onSubmit:async i=>{Qe("answerQuestion",r.id,e.cvid,i);const{answer:s}=i;try{await Promise.all([await t.send({kind:"AnswerQuestion",sessionId:r.id,questionName:e.name,questionCvid:e.cvid,textAnswer:s.kind=="text"?s.value:null,numberAnswer:s.kind=="number"?String(s.value):null,listAnswer:s.kind=="list"?s.values:null}),i.animationPromise])}catch(a){console.log("Userflow.js: Error when answering question:",a),i.onError();return}const{bindAttributeFqn:l}=e;if(l&&t.flowSession?.id===r.id){let a;switch(s.kind){case"text":a={name:l,value:s.value};break;case"number":a={name:l,value:String(s.value)};break;case"list":a={name:l,value:s.values};break}t.optimisticClockUIUpdate(()=>{t.setFlowSession({...r,data:[...r.data.filter(c=>c.name!==l),a]})})}Ie(t,r,e.actions)}})},dt=({text:e})=>{if(!e)return null;const t=e.split(/\n/);return t.length===1?n.createElement(n.Fragment,null,t[0]):n.createElement(n.Fragment,null,t.map((r,i)=>n.createElement(n.Fragment,{key:i},i>0&&n.createElement("br",null),r)))};function bt(e=""){return{type:"rich2",children:[ht(e)]}}function ht(e=""){return{type:"paragraph",children:[{text:e}]}}function Re(e){if(e){let t;try{t=JSON.parse(e)}catch{throw new Error("Could not JSON.parse rich content doc: "+e)}if(t.type==="rich2")return t;throw new Error("Could not recognize rich content doc: "+e)}else return bt()}function wt(e=""){return{type:"plaintext2",children:[{type:"plaintext",children:[{text:e}]}]}}function pt(e){if(e){let t;try{t=JSON.parse(e)}catch{throw new Error("Could not JSON.parse plaintext doc: "+e)}if(t.type==="plaintext2")return t;throw new Error("Could not recognize plaintext doc: "+e)}else return wt()}function z(e,{lookupAttribute:t}){if(!e)return"";typeof e=="string"&&(e=pt(e));const r=[];function i(l){if(he(l)){l.text&&r.push(l.text);return}switch(l.type){case"attribute":{const a=$e(l,t);a&&r.push(a);break}default:s(l.children);break}}function s(l){l&&l.forEach(a=>a&&i(a))}return s(e.children),r.join("")}function Ht(e){let t=!0;if(!e)return!0;typeof e=="string"&&(e=Re(e));const r=new Set(["attribute","button","image","question","video"]);return Oe(e,i=>{if(he(i)){i.text!==""&&(t=!1);return}"type"in i&&r.has(i.type)&&(t=!1)}),t}const Kt=n.memo(({doc:e,...t})=>e?(typeof e=="string"&&(e=Re(e)),n.createElement(Ae,{parent:e,...t})):null),Ae=({parent:e,...t})=>n.createElement(n.Fragment,null,e.children.map((r,i)=>he(r)?n.createElement(gt,{key:i,node:r}):n.createElement(vt,{key:i,node:r,parent:e,...t}))),gt=({node:e})=>e.text?n.createElement(qe,{node:e},n.createElement(dt,{text:e.text})):null,qe=({node:e,children:t})=>(e.color&&typeof e.color=="string"&&(t=n.createElement("span",{style:{color:e.color}},t)),e.bold&&(t=n.createElement("b",null,t)),e.italic&&(t=n.createElement("i",null,t)),e.underline&&(t=n.createElement("u",null,t)),e.strikeThrough&&(t=n.createElement("s",null,t)),e.code&&(t=n.createElement("code",null,t)),e.small&&(t=n.createElement("small",null,t)),e.sup&&(t=n.createElement("sup",null,t)),t),vt=({node:e,parent:t,...r})=>{const{lookupAttribute:i}=r,s=n.createElement(Ae,{parent:e,...r});switch(e.type){case"attribute":return n.createElement(Et,{node:e,...r});case"button":return n.createElement(yt,{node:e,...r});case"button-group":return n.createElement("div",{className:"userflowjs-bubble-buttons",style:{justifyContent:e.align}},s);case"column":return n.createElement("div",{style:jt(e,t)},s);case"column-group":return n.createElement("div",{className:"p-like",style:Ct(e)},s);case"container":return n.createElement("div",{className:"p-like"+(e.className?` ${e.className}`:""),style:Tt(e)},s);case"image":return n.createElement(_t,{node:e,...r});case"link":return n.createElement("a",{href:z(e.href,{lookupAttribute:i}),target:e.target==="same"?"_top":"_blank",rel:"noopener noreferrer"},s);case"paragraph":return n.createElement("p",{className:fe(e)},s);case"heading1":return n.createElement("h1",{className:fe(e)},s);case"heading2":return n.createElement("h2",{className:fe(e)},s);case"question":return n.createElement(kt,{node:e,...r});case"quote":return n.createElement("blockquote",null,s);case"code-block":return n.createElement("pre",null,n.createElement("code",null,s));case"ordered-list":return n.createElement("ol",null,s);case"unordered-list":return n.createElement("ul",null,s);case"list-item":return n.createElement("li",null,s);case"video":return n.createElement(xt,{node:e,...r});default:return n.createElement("div",null,s)}},Et=({node:e,lookupAttribute:t})=>{let r=$e(e,t);return n.createElement(qe,{node:e},r)},yt=({node:e,buttons:t})=>{const r=t?.find(i=>i.cvid===e.cvid);return r?n.createElement(ut,{key:r.id,button:r}):null},kt=({node:e,questions:t})=>{const r=t?.find(i=>i.cvid===e.cvid);return r?n.createElement(ft,{key:r.id,question:r}):null},_t=({node:e,lookupAttribute:t})=>{const{src:r,widthMode:i,displayWidth:s,width:l,height:a,marginTop:c,marginRight:h,marginBottom:d,marginLeft:g,align:m,hasLink:v,href:E}=e;if(!r)return null;const{wrapperStyle:b,blockStyle:f}=Le({widthMode:i,displayWidth:s,width:l,height:a,marginTop:c,marginRight:h,marginBottom:d,marginLeft:g,align:m}),_=typeof r=="string"?r:z(r,{lookupAttribute:t});let u=n.createElement("img",{src:Se(_,x=>encodeURIComponent((t?t(x):"")||"")),style:{...f,objectFit:"contain"},alt:""});return v&&E&&(u=n.createElement("a",{href:z(E,{lookupAttribute:t}),target:e.target==="same"?"_top":"_blank",rel:"noopener noreferrer",style:f},u)),n.createElement("div",{className:"p-like"},n.createElement("div",{style:b},u))},xt=({node:e,lookupAttribute:t})=>{const{url:r,widthMode:i,displayWidth:s,width:l,height:a,marginTop:c,marginRight:h,marginBottom:d,marginLeft:g,align:m}=e;if(!r)return null;const{wrapperStyle:v,blockStyle:E}=Le({widthMode:i,displayWidth:s,width:l,height:a,marginTop:c,marginRight:h,marginBottom:d,marginLeft:g,align:m});return n.createElement("div",{className:"p-like"},n.createElement("div",{style:v},n.createElement("div",{style:E},n.createElement(Nt,{element:e,noFocus:!0,lookupAttribute:t}))))},Nt=({element:{embedType:e,url:t,src:r,autoPlay:i,controls:s,loop:l,muted:a},noFocus:c,forceMuted:h,lookupAttribute:d})=>{if(!t)return null;const g=typeof t=="string"?t:z(t,{lookupAttribute:d}),m={width:"100%",height:"100%",allow:"accelerometer; autoplay; fullscreen; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,allowtransparency:"true",mozallowfullscreen:"true",webkitallowfullscreen:"true",oallowfullscreen:"true",msallowfullscreen:"true",style:{display:"block",border:"none"},tabIndex:c?-1:void 0};if(e==="video")return n.createElement("video",{key:g+";"+String(i)+";"+String(s)+";"+String(l)+";"+String(a),src:g,style:{width:"100%",height:"100%",display:"block"},autoPlay:!!i,controls:s!==!1,loop:l,muted:h||a});let v=St(g,{iframeFallback:!0});if(v.kind==="invalid")return null;if(r){let u;try{u=new URL(r)}catch{return null}h&&(u.searchParams.has("autoplay")||u.searchParams.has("autoPlay"))&&(u.searchParams.set("mute","1"),u.searchParams.set("muted","1"),u.searchParams.set("volume","0"));let x=u.toString();return me(u)&&(x=ce(u.toString())),n.createElement("iframe",{src:x,...m})}const{videoProvider:E,videoId:b,searchParams:f}=v;i=i||f.has("autoplay")||f.has("autoPlay");let _;try{_=new URL(g)}catch{console.error("Invalid video URL:",g)}switch(E){case"iframe":return _&&me(_)?n.createElement("iframe",{src:ce(g),...m}):n.createElement("iframe",{src:Se(b,u=>encodeURIComponent((d?d(u):"")||"")),scrolling:f.get("scrolling")||void 0,...m});case"loom":return n.createElement("iframe",{src:`https://www.loom.com/embed/${b}?${f.toString()}`,...m});case"raw":return n.createElement("video",{src:b,controls:!0,style:{width:"100%",height:"100%",display:"block"},autoPlay:f.has("autoplay"),muted:h||f.has("muted")});case"youtube":{h&&i&&f.set("mute","1");let u=`https://www.youtube.com/embed/${b}?${f.toString()}`;return _&&me(_)&&(u=ce(u)),n.createElement("iframe",{src:u,...m})}case"vimeo":return h&&i&&f.set("muted","1"),n.createElement("iframe",{src:`https://player.vimeo.com/video/${b}?${f.toString()}`,...m});case"wistia":return f.set("videoFoam","true"),h&&i&&f.set("volume","0"),n.createElement(n.Fragment,null,n.createElement("iframe",{src:`https://fast.wistia.net/embed/iframe/${b}?${f.toString()}`,...m}))}};function ce(e){return`https://cdn.userflow.com/iframe/youtube?src=${encodeURIComponent(e)}`}function me(e){return["youtube.com","www.youtube.com","youtu.be"].includes(e.hostname)}function St(e,{iframeFallback:t}={}){let r;try{r=new URL(e)}catch{return{kind:"invalid"}}const{hostname:i,pathname:s,searchParams:l}=r;if(i.match(/^(www\.)?(use)?loom\.com$/)){const a=s.match(/^\/share\/([a-z0-9]+)$/i);if(a){const[,c]=a;return{kind:"ok",videoProvider:"loom",videoId:c,searchParams:l}}}if(e.startsWith("raw:"))return{kind:"ok",videoProvider:"raw",videoId:e.replace(/^raw:/,""),searchParams:l};if(e.startsWith("iframe:"))return{kind:"ok",videoProvider:"iframe",videoId:e.replace(/^iframe:/,""),searchParams:l};if(["youtube.com","www.youtube.com"].includes(i)){const a=l.get("v");if(a)return l.delete("v"),{kind:"ok",videoProvider:"youtube",videoId:a,searchParams:l}}if(i==="youtu.be"){const a=s.match(/^\/([^/]+)$/);if(a){const[,c]=a;return{kind:"ok",videoProvider:"youtube",videoId:c,searchParams:l}}}if(i==="vimeo.com"){const a=s.match(/^\/(\d+)$/);if(a){const[,c]=a;return{kind:"ok",videoProvider:"vimeo",videoId:c,searchParams:l}}}if(i==="player.vimeo.com"){const a=s.match(/^\/video\/([^/]+)$/);if(a){const[,c]=a;return{kind:"ok",videoProvider:"vimeo",videoId:c,searchParams:l}}}if(i.match(/^[^.]+\.wistia.com$/)){const a=s.match(/^\/medias\/([^/]+)$/);if(a){const[,c]=a;return{kind:"ok",videoProvider:"wistia",videoId:c,searchParams:l}}}return t?{kind:"ok",videoProvider:"iframe",videoId:e,searchParams:l}:{kind:"invalid"}}function fe(e){return e.align==="right"?"userflowjs-text-align-end":e.align==="center"?"userflowjs-text-align-center":e.align==="justify"?"userflowjs-text-align-justify":""}function Le({widthMode:e,displayWidth:t,width:r,height:i,marginTop:s,marginRight:l,marginBottom:a,marginLeft:c,align:h}){const d={position:"relative"},g={position:"absolute",top:"0",left:"0",display:"block",width:"100%",height:"100%"};typeof t!="number"&&(t=100,e="percent"),h==="center"?(d.marginLeft="auto",d.marginRight="auto"):h==="right"&&(d.marginLeft="auto");let m=0;if(s!=null&&typeof s=="number"&&(d.marginTop=`${s}px`),l!=null&&typeof l=="number"&&(d.marginRight=`${l}px`,m+=l),a!=null&&typeof a=="number"&&(d.marginBottom=`${a}px`),c!=null&&typeof c=="number"&&(d.marginLeft=`${c}px`,m+=c),typeof t!="number"||typeof r!="number"||typeof i!="number")d.width="100px",d.height="100px";else if(e==="px"){const E=Math.max(10,t);d.width=`${E}px`,d.height=`${E/(r/i)}px`}else{const v=Math.max(0,Math.min(100,t));d.width=`calc(${v}% - ${m}px)`,d.height="0",d.paddingBottom=`calc((${v}% - ${m}px) / (${r} / ${i})`}return{wrapperStyle:d,blockStyle:g}}const Fe=16;function Ct(e){return{display:"flex",alignItems:"stretch",marginRight:`-${e.spacing==null?Fe:e.spacing}px`}}function jt(e,t){const r=e.widthMode==="fill"||e.displayWidth==null;return{display:"flex",flexDirection:"column",justifyContent:e.justifyContent,width:r?void 0:e.widthMode==="px"?`${e.displayWidth||50}px`:e.widthMode==="percent"?`${e.displayWidth||50}%`:void 0,flex:r?"1 0 0":void 0,marginRight:`${t.spacing==null?Fe:t.spacing}px`,marginBottom:"0"}}function Tt(e){return{display:"flex",flexDirection:"column",justifyContent:e.justifyContent,width:e.widthMode==="px"&&e.displayWidth!=null?`${e.displayWidth}px`:e.widthMode==="percent"&&e.displayWidth!=null?`${e.displayWidth}%`:void 0,minHeight:e.heightMode==="px"?`${e.displayHeight||50}px`:void 0,flex:e.heightMode==="fill"?"1 0 0":void 0,marginTop:e.marginTop!=null?`${e.marginTop}px`:void 0,marginRight:e.marginRight!=null?`${e.marginRight}px`:e.widthMode!=="fill"&&e.align==="center"?"auto":void 0,marginBottom:e.marginBottom!=null?`${e.marginBottom}px`:void 0,marginLeft:e.marginLeft!=null?`${e.marginLeft}px`:e.widthMode!=="fill"&&(e.align==="center"||e.align==="right")?"auto":void 0}}function $e(e,t){if(!t)return null;const r=e.attributeName;if(typeof r=="string"){const i=t(r)||e.fallback;if(typeof i=="string")return i}return null}function De(e){return Array.isArray(e.children)&&typeof e.addMark>"u"}function xe(e,t,r="type"){return De(e)&&typeof e=="object"&&e[r]===t}function he(e){return typeof e.text=="string"}function Oe(e,t){function r(s,l){t(s,l),De(s)&&i(s.children)}function i(s){s&&s.forEach((l,a)=>l&&r(l,a))}i(Array.isArray(e)?e:e.children)}const Gt=n.memo(({doc:e,lookupAttribute:t})=>e?n.createElement(n.Fragment,null,z(e,{lookupAttribute:t})):null);function Jt(e,{buttons:t,questions:r}){const i=new Set,s=new Set;if(Oe(e,l=>{xe(l,"button")&&i.add(l.cvid),xe(l,"question")&&s.add(l.cvid)}),r){const l=r.filter(a=>!s.has(a.cvid));l.length>0&&(e={...e,children:[...e.children,...l.map(a=>({type:"question",cvid:a.cvid,children:[{text:""}]}))]})}if(t){const l=t.filter(a=>!i.has(a.cvid));l.length>0&&(e={...e,children:[...e.children,{type:"button-group",children:l.map(a=>({type:"button",cvid:a.cvid,children:[{text:""}]}))}]})}return e}function It(e){return e=e||"default","userflowjs-bubble-button "+(e==="primary"||e==="PRIMARY"||e==="default"||e==="DEFAULT"||e==="banner-primary"||e==="banner-secondary"?`userflowjs-bubble-button--${e.toLowerCase()}`:e)}const Qt=new URL("bubble-frame.css",import.meta.url).href;let we=!1;const V=[];let te=[],Ue;function Rt(e){V.push(e),V.length===1&&(we=!0,Me(),window.addEventListener("scroll",Pe))}function At(e){const t=V.indexOf(e);t>=0&&(V.splice(t,1),V.length===0&&(we=!1,window.cancelAnimationFrame(Ue),window.removeEventListener("scroll",Pe)))}function Xt(e){te.push(e)}function qt(){V.forEach(e=>e()),te.length>0&&(te.forEach(e=>e()),te=[]),Me()}function Me(){we&&(Ue=window.requestAnimationFrame(qt))}function Pe(){}function Zt({selector:e,targetMoved:t,targetLost:r,onTargetClick:i,onTargetMouseEnter:s,onTargetMouseLeave:l}){const a=p.useRef(t),c=p.useRef(r),h=p.useRef(i),d=p.useRef(s),g=p.useRef(l);p.useLayoutEffect(()=>{a.current=t,c.current=r,h.current=i,d.current=s,g.current=l}),p.useLayoutEffect(()=>{let m=null,v=null,E=null,b=!1;const f=()=>{m=null,v=null,E=null,c.current()};if(!e){f();return}const _=()=>{if(!E||!m)return;const k=Te(m);(!v||!Lt(v,k))&&(v=k,k.width===0&&k.height===0?f():a.current({targetEl:m,targetRect:v,clipEl:E,viewportClipRect:Ft(E)}))};let u=!1;const x=()=>{u||(u=!0,Rt(_))},R=()=>{u&&(u=!1,At(_))},H=()=>{h.current&&h.current()},C=()=>{d.current&&d.current()},U=()=>{g.current&&g.current()},K=()=>{const k=m;m=Ze(e)?e:Ye(e),(!b||m!==k)&&(k&&(k.removeEventListener("click",H),k.removeEventListener("mouseenter",C),k.removeEventListener("mouseleave",U)),m?(x(),m.addEventListener("click",H),m.addEventListener("mouseenter",C),m.addEventListener("mouseleave",U),E=et(m)):(R(),f())),b=!0};K();const Q=ze(K);return()=>{Q.disconnect(),R(),m&&(m.removeEventListener("click",H),m.removeEventListener("mouseenter",C),m.removeEventListener("mouseleave",U))}},[e])}function Lt(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Ft(e){tt();const t=ke(nt()),r=ke(rt());if(!e||e===document.documentElement)return{top:0,right:r,bottom:t,left:0};{const i=Te(e);return{top:Math.max(0,i.top),right:Math.min(r,i.right),bottom:Math.min(t,i.bottom),left:Math.max(0,i.left)}}}export{ut as B,Kt as R,st as S,Gt as a,Qt as b,_e as c,Re as d,it as e,Ht as f,$e as g,Ie as h,he as i,be as j,Jt as m,ot as n,Xt as r,z as s,Zt as u};
|
|
11
11
|
//# sourceMappingURL=use-selector-element-monitoring.js.map
|
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.core-js.js","vendor.object-assign.js","client-context.js","vendor.i18next.js","vendor.babel.runtime.js","vendor.react-i18next.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","vendor.canvas-confetti.js","vendor.memoize-one.js","vendor.bignumber.js.js","use-element-rect.js","BannerApp.js","vendor.phoenix.js","vendor.uuid.js","implicit-tracking.js","DebuggerUI.js","vendor.lodash.js","vendor.fortawesome.react-fontawesome.js","vendor.fortawesome.fontawesome-svg-core.js","Popover.js","vendor.react-day-picker.js","ui.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import"./vendor.core-js.js";import{S as Y}from"./vendor.phoenix.js";import{v as R}from"./vendor.uuid.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]="12b6aeb3-9016-49f6-939b-86922309224f",t._sentryDebugIdIdentifier="sentry-dbid-12b6aeb3-9016-49f6-939b-86922309224f")}catch{}})();const z="modulepreload",J=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]"),u=a?.nonce||a?.getAttribute("nonce");n=Promise.allSettled(s.map(c=>{if(c=J(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":z,l||(E.as="script"),E.crossOrigin="",E.href=c,u&&E.setAttribute("nonce",u),document.head.appendChild(E),l)return new Promise((F,j)=>{E.addEventListener("load",F),E.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return n.then(a=>{for(const u of a||[])u.status==="rejected"&&r(u.reason);return e().catch(r)})};class h extends Error{constructor(e,s,i){super(e),Object.setPrototypeOf(this,h.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 nt(t){window.location.href=t}function H(){return window.location.href}function L(t){window.postMessage(t,window.origin)}function x(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 Q(t){return new Promise(e=>{x(s=>{const i=t(s);return i?(e(i),!0):!1})})}const N=new Set;let O=!1;function X(t){return Z(),N.add(t),()=>{G(t)}}function G(t){N.delete(t)}function w(){N.forEach(t=>t())}function Z(){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 q{destroy(){this.unregisterOnMessage&&this.unregisterOnMessage()}postBuilderMessage(e){L({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:e})}onBuilderMessage(e){return this.unregisterOnMessage=x(e),!1}async captureScreenshot(e,s,i,n){return L({kind:"userflow:crxScreenshot",x:e,y:s,width:i,height:n,devicePixelRatio:window.devicePixelRatio}),(await Q(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||{}),ee=(t=>(t.SECOND="SECOND",t.MINUTE="MINUTE",t.HOUR="HOUR",t.DAY="DAY",t))(ee||{}),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||{}),te=(t=>(t.LIKE="LIKE",t.DISLIKE="DISLIKE",t))(te||{}),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||{}),se=(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))(se||{}),ie=(t=>(t.AUTO="AUTO",t.MANUAL="MANUAL",t))(ie||{}),ne=(t=>(t.INPUT="INPUT",t))(ne||{}),re=(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))(re||{}),oe=(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))(oe||{}),ae=(t=>(t.END_USER="END_USER",t.GROUP="GROUP",t))(ae||{}),ce=(t=>(t.BETWEEN="BETWEEN",t.EQ="EQ",t.GTE="GTE",t.LTE="LTE",t))(ce||{}),le=(t=>(t.ANY="ANY",t.RELATIVE_BETWEEN="RELATIVE_BETWEEN",t.RELATIVE_GT="RELATIVE_GT",t.RELATIVE_LT="RELATIVE_LT",t))(le||{}),ue=(t=>(t.CURRENT_USER="CURRENT_USER",t.CURRENT_USER_CURRENT_GROUP="CURRENT_USER_CURRENT_GROUP",t.CURRENT_GROUP="CURRENT_GROUP",t))(ue||{}),he=(t=>(t.ASSET="ASSET",t.CARTOON="CARTOON",t.NONE="NONE",t.URL="URL",t))(he||{}),de=(t=>(t.INSIDE="INSIDE",t.OUTSIDE="OUTSIDE",t))(de||{}),fe=(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))(fe||{}),Ee=(t=>(t.GOOGLE="GOOGLE",t.STANDARD="STANDARD",t))(Ee||{}),Se=(t=>(t.DISMISS_FIRST_MENU_AFTER="DISMISS_FIRST_MENU_AFTER",t.DISMISS="DISMISS",t))(Se||{}),Te=(t=>(t.DISMISS="DISMISS",t.NONE="NONE",t))(Te||{}),ge=(t=>(t.DEFAULT="DEFAULT",t.NARROW="NARROW",t.CHAINED_SQUARED="CHAINED_SQUARED",t.CHAINED_ROUNDED="CHAINED_ROUNDED",t.DOTTED="DOTTED",t.NUMBERED="NUMBERED",t))(ge||{}),Ie=(t=>(t.TOP="TOP",t.BOTTOM="BOTTOM",t))(Ie||{}),we=(t=>(t.DEFAULT="DEFAULT",t.PLAINTEXT="PLAINTEXT",t.CUSTOM="CUSTOM",t))(we||{}),Ce=(t=>(t.CHECKLIST_OVERRIDE="CHECKLIST_OVERRIDE",t.RESOURCE_CENTER_ONLY="RESOURCE_CENTER_ONLY",t.NONE="NONE",t))(Ce||{}),ke=(t=>(t.BUBBLE="BUBBLE",t.END="END",t.ERROR="ERROR",t.FLAG="FLAG",t))(ke||{}),me=(t=>(t.MANUAL="MANUAL",t.NONE="NONE",t.SYNTHETIC="SYNTHETIC",t))(me||{}),Ue=(t=>(t.BUBBLE="BUBBLE",t.HIDDEN="HIDDEN",t.MODAL="MODAL",t.TOOLTIP="TOOLTIP",t))(Ue||{}),pe=(t=>(t.ABOVE="ABOVE",t.BELOW="BELOW",t.LEFT="LEFT",t.RIGHT="RIGHT",t))(pe||{}),Le=(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.TRACK_BUTTON_EVENT="TRACK_BUTTON_EVENT",t))(Le||{}),_e=(t=>(t.NEW_TAB="NEW_TAB",t.SAME_TAB="SAME_TAB",t))(_e||{}),Ne=(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))(Ne||{}),Ae=(t=>(t.MULTILINE_TEXT="MULTILINE_TEXT",t.MULTIPLE_CHOICE="MULTIPLE_CHOICE",t.NPS="NPS",t.SCALE="SCALE",t.STARS="STARS",t.TEXT="TEXT",t))(Ae||{}),_=(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))(_||{}),Re=(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))(Re||{}),ve=(t=>(t.BUTTON="BUTTON",t.INPUT="INPUT",t))(ve||{}),Oe=(t=>(t.EMAIL="EMAIL",t.PHONE="PHONE",t.CHAT="CHAT",t))(Oe||{}),be=(t=>(t.SILENT="SILENT",t.BADGE="BADGE",t.POPOUT="POPOUT",t.MODAL="MODAL",t.TOAST="TOAST",t))(be||{}),De=(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))(De||{}),W=(t=>(t.ACTIVATE="ACTIVATE",t.DEACTIVATE="DEACTIVATE",t.NEVER="NEVER",t))(W||{}),ye=(t=>(t.AUTO="AUTO",t.TOP="TOP",t.RIGHT="RIGHT",t.BOTTOM="BOTTOM",t.LEFT="LEFT",t))(ye||{}),Me=(t=>(t.START="START",t.CENTER="CENTER",t.END="END",t))(Me||{}),Pe=(t=>(t.PERCENT="PERCENT",t.PX="PX",t))(Pe||{}),Be=(t=>(t.BEACON="BEACON",t.BUTTON="BUTTON",t.HIDDEN="HIDDEN",t.ICON="ICON",t))(Be||{}),He=(t=>(t.LAUNCHER="LAUNCHER",t.TARGET="TARGET",t))(He||{}),xe=(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))(xe||{}),Ge=(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))(Ge||{}),V=(t=>(t.CHECKLIST="CHECKLIST",t))(V||{}),We=(t=>(t.ALWAYS="ALWAYS",t.MULTIPLE="MULTIPLE",t.NEVER="NEVER",t.ONCE="ONCE",t.ONCE_PER_GROUP="ONCE_PER_GROUP",t))(We||{}),Ve=(t=>(t.NONE="NONE",t.PENDING_SCHEDULE="PENDING_SCHEDULE",t.SCHEDULED="SCHEDULED",t.FIRED="FIRED",t))(Ve||{}),Ke=(t=>(t.NONE="NONE",t.LIKE="LIKE",t.SCALE="SCALE",t))(Ke||{}),$e=(t=>(t.HIDE="HIDE",t.BLOCK="BLOCK",t.OTHERS="OTHERS",t))($e||{});function Fe(){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=Fe();function b(t){return Array.isArray(t)||(t=t?[t]:[]),t=t.map(e=>typeof e=="string"?new RegExp(e):e),t}function rt(t,e){return t.every(s=>typeof s=="function"?s(e):s instanceof RegExp?s.test(e):!0)}function je(){let t=H();if(d.urlFilter){if(t=d.urlFilter(t),typeof t!="string")throw new h("Userflow.js: URL filter returned non-string value. Please check your userflow.setUrlFilter() implementation.");try{new URL(t)}catch(e){throw new h(`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 K="";try{K=localStorage.getItem("debug")||""}catch{}const $=K.split(",").some(t=>t==="*"||t.startsWith("userflow:*")),o=A("log");o.group=A("group");o.groupCollapsed=A("groupCollapsed");o.groupEnd=function(){$&&console.groupEnd()};let U;function A(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 Ye=()=>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]));function ze(t){const s=t.version.checklist.tasks.length;return Math.max(0,s-t.taskCompletions.length)}class D{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 y=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit","livewire:navigated","livewire:navigating","livewire:update"],Je=()=>g(()=>import("./BannerApp.js"),__vite__mapDeps([28,1,2,3,4,5,6,7,16,13,14,15,10,11,12,9,8,18,19,17,27,20,29,30])),p="
|
|
4
|
+
Error message: `+e.message)}}return t}let K="";try{K=localStorage.getItem("debug")||""}catch{}const $=K.split(",").some(t=>t==="*"||t.startsWith("userflow:*")),o=A("log");o.group=A("group");o.groupCollapsed=A("groupCollapsed");o.groupEnd=function(){$&&console.groupEnd()};let U;function A(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 Ye=()=>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]));function ze(t){const s=t.version.checklist.tasks.length;return Math.max(0,s-t.taskCompletions.length)}class D{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 y=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit","livewire:navigated","livewire:navigating","livewire:update"],Je=()=>g(()=>import("./BannerApp.js"),__vite__mapDeps([28,1,2,3,4,5,6,7,16,13,14,15,10,11,12,9,8,18,19,17,27,20,29,30])),p="1016382",Qe=import.meta.url,M=50,Xe=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.debuggerMountInProgress=!1,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.implicitTracking=null,this.initialMessagesQueue=[],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="+p),X(this.onUrlChange),this.setTargetEnv(new q),this.checkTestUserAtBoot(),this.toggleUI(),this.checkDebuggerSession();for(const e of y)document.addEventListener(e,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){o("destroy"),this.reset(),G(this.onUrlChange),this.destroyTargetEnv();for(const e of y)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 h("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 h("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 h("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new h("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new h("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");const e=/^ct_eu\d+_.+$/.test(this.clientToken)?"e.eu.":"e.";let s=d.serverEndpoint||e+"userflow.com";new URL(Qe).hostname==="js.getuserflow.com"&&s==="e.userflow.com"&&(s="e.getuserflow.com");const i="wss://"+s+"/end-users/"+this.clientToken+"/socket";this.socket=new Y(i,{reconnectAfterMs:n=>[100,500,1e3,5e3][n-1]||1e4,timeout:20*1e3}),this.socket.connect(),this.socket.onOpen(()=>{o("socket opened")}),this.socket.onClose(()=>{this.emit("private:disconnect")}),this.socket.onError(n=>{console.log("Userflow.js socket error",n),this.reportCspIssue()}),this.channel=this.socket.channel(`end_users:${this.externalId}`,()=>this.makeChannelJoinPayload()),this.channel.join().receive("ok",n=>{typeof this.featureFlags>"u"&&this.clearInitialMessagesQueue(n.featureFlags),this.logrocketAppId=n.logrocketAppId,this.featureFlags=new Set(n.featureFlags),o("channel joined"),this._socketStatus!=="connected"&&(this._socketStatus="connected"),this.featureFlagEnabled("cff_implicit_events")===!0&&!this.implicitTracking&&this.startImplicitTracking(),!this.featureFlagEnabled("cff_implicit_events")&&this.implicitTracking&&(this.implicitTracking.stop(),this.implicitTracking=null)}).receive("error",n=>{["company_closed","invalid_client_token","invalid_user_external_id","incorrect_user_signature","rate_limit_exceeded","user_signature_required"].includes(n.code)?(console.error(`Userflow.js resetting due to: [${n.code}] ${n.message}`),this.reset(),this.clientToken=null):n.code==="invalid_protocol_version"?(console.error(`Userflow.js destroying due to: [${n.code}] ${n.message}`),this.destroy()):console.log("Userflow.js channel join error",n)}),this.channel.on("server_message",n=>this.handleServerMessage(n)),this.channel.on("server_error",n=>{console.log(`Userflow.js server error (${n.code}): ${n.message}`+(n.details&&n.details.length>0?`
|
|
5
5
|
Details:
|
|
6
6
|
`+n.details.map(r=>(r.path?`${r.path}: `:"")+r.message):""))})}async startImplicitTracking(){await g(()=>import("./implicit-tracking.js"),__vite__mapDeps([31,12,2,30,29])).then(e=>{this.implicitTracking=new e.ImplicitTracking(this),this.implicitTracking.start()}).catch(e=>o(`Implicit tracking failed to load ${e}`))}makeChannelJoinPayload(){const e=this.buildClientContext();this.clientContext=e;const s={protocolVersion:2,userflowClientBuild:p,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()},Xe)}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})}clearInitialMessagesQueue(e){if(this.initialMessagesQueue.length===0)return;const s=e.includes("cff_disable_page_views")===!0,i=e.includes("cff_implicit_events")===!1;for(const n of this.initialMessagesQueue){const{message:r,handlesRejection:a,resolve:u,reject:c}=n;if(i&&r.kind==="TrackRawEvent"){u("skipped due to disabled implicit events");continue}if(s&&(r.kind==="TrackEvent"&&r.name==="page_viewed"||r.kind==="TrackRawEvent"&&r.name==="page_viewed")){u("skipped due to disabled page views tracking");continue}this._sendToChannel(r,u,c,{handlesRejection:a})}this.initialMessagesQueue=[]}async sendRaw(e,{handlesRejection:s}={}){return typeof this.featureFlags>"u"?new Promise((i,n)=>{this.initialMessagesQueue.push({message:e,resolve:i,reject:n,handlesRejection:s})}):new Promise((i,n)=>{this._sendToChannel(e,i,n,{handlesRejection:s})})}_sendToChannel(e,s,i,{handlesRejection:n}={}){if(!this.channel){const c=`Userflow.js: send() should not be called if channel is not set. Message kind=${e.kind}`;if(n)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",u)},u=this.channel.on("phx_error",c=>{a();const l=`Userflow.js send ${e.kind} got phx_error`;this._socketStatus==="connected"&&console.log(l,`
|
package/vendor.core-js.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="5a67e1e2-1eac-4264-a054-e78813fef559",r._sentryDebugIdIdentifier="sentry-dbid-5a67e1e2-1eac-4264-a054-e78813fef559")}catch{}})();var Ze=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};Ze.SENTRY_RELEASE={id:"8669f4eebdbc658319ab82795c8037ab709824f1"};var F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yi(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var P=function(r){return r&&r.Math===Math&&r},f=P(typeof globalThis=="object"&&globalThis)||P(typeof window=="object"&&window)||P(typeof self=="object"&&self)||P(typeof F=="object"&&F)||P(typeof F=="object"&&F)||function(){return this}()||Function("return this")(),gr={},h=function(r){try{return!!r()}catch{return!0}},Qe=h,g=!Qe(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),rt=h,Or=!rt(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),et=Or,B=Function.prototype.call,O=et?B.bind(B):function(){return B.apply(B,arguments)},fe={},se={}.propertyIsEnumerable,ye=Object.getOwnPropertyDescriptor,tt=ye&&!se.call({1:2},1);fe.f=tt?function(e){var t=ye(this,e);return!!t&&t.enumerable}:se;var $e=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}},de=Or,pe=Function.prototype,sr=pe.call,nt=de&&pe.bind.bind(sr,sr),b=de?nt:function(r){return function(){return sr.apply(r,arguments)}},be=b,at=be({}.toString),ot=be("".slice),q=function(r){return ot(at(r),8,-1)},it=b,vt=h,ut=q,H=Object,ct=it("".split),lt=vt(function(){return!H("z").propertyIsEnumerable(0)})?function(r){return ut(r)==="String"?ct(r,""):H(r)}:H,Sr=function(r){return r==null},ft=Sr,st=TypeError,he=function(r){if(ft(r))throw new st("Can't call method on "+r);return r},yt=lt,$t=he,Er=function(r){return yt($t(r))},X=typeof document=="object"&&document.all,$=typeof X>"u"&&X!==void 0?function(r){return typeof r=="function"||r===X}:function(r){return typeof r=="function"},dt=$,_=function(r){return typeof r=="object"?r!==null:dt(r)},Z=f,pt=$,bt=function(r){return pt(r)?r:void 0},ge=function(r,e){return arguments.length<2?bt(Z[r]):Z[r]&&Z[r][e]},ht=b,Oe=ht({}.isPrototypeOf),gt=f,_r=gt.navigator,Dr=_r&&_r.userAgent,Se=Dr?String(Dr):"",Ee=f,Q=Se,Mr=Ee.process,Ar=Ee.Deno,Fr=Mr&&Mr.versions||Ar&&Ar.version,Br=Fr&&Fr.v8,d,W;Br&&(d=Br.split("."),W=d[0]>0&&d[0]<4?1:+(d[0]+d[1]));!W&&Q&&(d=Q.match(/Edge\/(\d+)/),(!d||d[1]>=74)&&(d=Q.match(/Chrome\/(\d+)/),d&&(W=+d[1])));var Te=W,Lr=Te,Ot=h,St=f,Et=St.String,we=!!Object.getOwnPropertySymbols&&!Ot(function(){var r=Symbol("symbol detection");return!Et(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Lr&&Lr<41}),Tt=we,Ie=Tt&&!Symbol.sham&&typeof Symbol.iterator=="symbol",wt=ge,It=$,mt=Oe,Rt=Ie,Pt=Object,me=Rt?function(r){return typeof r=="symbol"}:function(r){var e=wt("Symbol");return It(e)&&mt(e.prototype,Pt(r))},Ct=String,Tr=function(r){try{return Ct(r)}catch{return"Object"}},jt=$,Nt=Tr,_t=TypeError,D=function(r){if(jt(r))return r;throw new _t(Nt(r)+" is not a function")},Dt=D,Mt=Sr,wr=function(r,e){var t=r[e];return Mt(t)?void 0:Dt(t)},rr=O,er=$,tr=_,At=TypeError,Ft=function(r,e){var t,n;if(e==="string"&&er(t=r.toString)&&!tr(n=rr(t,r))||er(t=r.valueOf)&&!tr(n=rr(t,r))||e!=="string"&&er(t=r.toString)&&!tr(n=rr(t,r)))return n;throw new At("Can't convert object to primitive value")},Re={exports:{}},Ur=f,Bt=Object.defineProperty,Ir=function(r,e){try{Bt(Ur,r,{value:e,configurable:!0,writable:!0})}catch{Ur[r]=e}return e},Lt=f,Ut=Ir,Gr="__core-js_shared__",xr=Re.exports=Lt[Gr]||Ut(Gr,{});(xr.versions||(xr.versions=[])).push({version:"3.39.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"});var mr=Re.exports,Kr=mr,Pe=function(r,e){return Kr[r]||(Kr[r]=e||{})},Gt=he,xt=Object,Kt=function(r){return xt(Gt(r))},Vt=b,kt=Kt,Wt=Vt({}.hasOwnProperty),S=Object.hasOwn||function(e,t){return Wt(kt(e),t)},zt=b,Yt=0,qt=Math.random(),Jt=zt(1 .toString),Ce=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Jt(++Yt+qt,36)},Ht=f,Xt=Pe,Vr=S,Zt=Ce,Qt=we,rn=Ie,m=Ht.Symbol,nr=Xt("wks"),en=rn?m.for||m:m&&m.withoutSetter||Zt,E=function(r){return Vr(nr,r)||(nr[r]=Qt&&Vr(m,r)?m[r]:en("Symbol."+r)),nr[r]},tn=O,kr=_,Wr=me,nn=wr,an=Ft,on=E,vn=TypeError,un=on("toPrimitive"),cn=function(r,e){if(!kr(r)||Wr(r))return r;var t=nn(r,un),n;if(t){if(e===void 0&&(e="default"),n=tn(t,r,e),!kr(n)||Wr(n))return n;throw new vn("Can't convert object to primitive value")}return e===void 0&&(e="number"),an(r,e)},ln=cn,fn=me,je=function(r){var e=ln(r,"string");return fn(e)?e:e+""},sn=f,zr=_,yr=sn.document,yn=zr(yr)&&zr(yr.createElement),$n=function(r){return yn?yr.createElement(r):{}},dn=g,pn=h,bn=$n,Ne=!dn&&!pn(function(){return Object.defineProperty(bn("div"),"a",{get:function(){return 7}}).a!==7}),hn=g,gn=O,On=fe,Sn=$e,En=Er,Tn=je,wn=S,In=Ne,Yr=Object.getOwnPropertyDescriptor;gr.f=hn?Yr:function(e,t){if(e=En(e),t=Tn(t),In)try{return Yr(e,t)}catch{}if(wn(e,t))return Sn(!gn(On.f,e,t),e[t])};var J={},mn=g,Rn=h,Pn=mn&&Rn(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Cn=_,jn=String,Nn=TypeError,M=function(r){if(Cn(r))return r;throw new Nn(jn(r)+" is not an object")},_n=g,Dn=Ne,Mn=Pn,L=M,qr=je,An=TypeError,ar=Object.defineProperty,Fn=Object.getOwnPropertyDescriptor,or="enumerable",ir="configurable",vr="writable";J.f=_n?Mn?function(e,t,n){if(L(e),t=qr(t),L(n),typeof e=="function"&&t==="prototype"&&"value"in n&&vr in n&&!n[vr]){var a=Fn(e,t);a&&a[vr]&&(e[t]=n.value,n={configurable:ir in n?n[ir]:a[ir],enumerable:or in n?n[or]:a[or],writable:!1})}return ar(e,t,n)}:ar:function(e,t,n){if(L(e),t=qr(t),L(n),Dn)try{return ar(e,t,n)}catch{}if("get"in n||"set"in n)throw new An("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Bn=g,Ln=J,Un=$e,_e=Bn?function(r,e,t){return Ln.f(r,e,Un(1,t))}:function(r,e,t){return r[e]=t,r},De={exports:{}},$r=g,Gn=S,Me=Function.prototype,xn=$r&&Object.getOwnPropertyDescriptor,Rr=Gn(Me,"name"),Kn=Rr&&function(){}.name==="something",Vn=Rr&&(!$r||$r&&xn(Me,"name").configurable),kn={EXISTS:Rr,PROPER:Kn,CONFIGURABLE:Vn},Wn=b,zn=$,dr=mr,Yn=Wn(Function.toString);zn(dr.inspectSource)||(dr.inspectSource=function(r){return Yn(r)});var Ae=dr.inspectSource,qn=f,Jn=$,Jr=qn.WeakMap,Hn=Jn(Jr)&&/native code/.test(String(Jr)),Xn=Pe,Zn=Ce,Hr=Xn("keys"),Qn=function(r){return Hr[r]||(Hr[r]=Zn(r))},Fe={},ra=Hn,Be=f,ea=_,ta=_e,ur=S,cr=mr,na=Qn,aa=Fe,Xr="Object already initialized",pr=Be.TypeError,oa=Be.WeakMap,z,N,Y,ia=function(r){return Y(r)?N(r):z(r,{})},va=function(r){return function(e){var t;if(!ea(e)||(t=N(e)).type!==r)throw new pr("Incompatible receiver, "+r+" required");return t}};if(ra||cr.state){var p=cr.state||(cr.state=new oa);p.get=p.get,p.has=p.has,p.set=p.set,z=function(r,e){if(p.has(r))throw new pr(Xr);return e.facade=r,p.set(r,e),e},N=function(r){return p.get(r)||{}},Y=function(r){return p.has(r)}}else{var I=na("state");aa[I]=!0,z=function(r,e){if(ur(r,I))throw new pr(Xr);return e.facade=r,ta(r,I,e),e},N=function(r){return ur(r,I)?r[I]:{}},Y=function(r){return ur(r,I)}}var ua={set:z,get:N,has:Y,enforce:ia,getterFor:va},Pr=b,ca=h,la=$,U=S,br=g,fa=kn.CONFIGURABLE,sa=Ae,Le=ua,ya=Le.enforce,$a=Le.get,Zr=String,K=Object.defineProperty,da=Pr("".slice),pa=Pr("".replace),ba=Pr([].join),ha=br&&!ca(function(){return K(function(){},"length",{value:8}).length!==8}),ga=String(String).split("String"),Oa=De.exports=function(r,e,t){da(Zr(e),0,7)==="Symbol("&&(e="["+pa(Zr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!U(r,"name")||fa&&r.name!==e)&&(br?K(r,"name",{value:e,configurable:!0}):r.name=e),ha&&t&&U(t,"arity")&&r.length!==t.arity&&K(r,"length",{value:t.arity});try{t&&U(t,"constructor")&&t.constructor?br&&K(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var n=ya(r);return U(n,"source")||(n.source=ba(ga,typeof e=="string"?e:"")),r};Function.prototype.toString=Oa(function(){return la(this)&&$a(this).source||sa(this)},"toString");var Sa=De.exports,Ea=$,Ta=J,wa=Sa,Ia=Ir,ma=function(r,e,t,n){n||(n={});var a=n.enumerable,o=n.name!==void 0?n.name:e;if(Ea(t)&&wa(t,o,n),n.global)a?r[e]=t:Ia(e,t);else{try{n.unsafe?r[e]&&(a=!0):delete r[e]}catch{}a?r[e]=t:Ta.f(r,e,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return r},Ue={},Ra=Math.ceil,Pa=Math.floor,Ca=Math.trunc||function(e){var t=+e;return(t>0?Pa:Ra)(t)},ja=Ca,Ge=function(r){var e=+r;return e!==e||e===0?0:ja(e)},Na=Ge,_a=Math.max,Da=Math.min,Ma=function(r,e){var t=Na(r);return t<0?_a(t+e,0):Da(t,e)},Aa=Ge,Fa=Math.min,Ba=function(r){var e=Aa(r);return e>0?Fa(e,9007199254740991):0},La=Ba,xe=function(r){return La(r.length)},Ua=Er,Ga=Ma,xa=xe,Qr=function(r){return function(e,t,n){var a=Ua(e),o=xa(a);if(o===0)return!r&&-1;var i=Ga(n,o),v;if(r&&t!==t){for(;o>i;)if(v=a[i++],v!==v)return!0}else for(;o>i;i++)if((r||i in a)&&a[i]===t)return r||i||0;return!r&&-1}},Ka={includes:Qr(!0),indexOf:Qr(!1)},Va=b,lr=S,ka=Er,Wa=Ka.indexOf,za=Fe,re=Va([].push),Ya=function(r,e){var t=ka(r),n=0,a=[],o;for(o in t)!lr(za,o)&&lr(t,o)&&re(a,o);for(;e.length>n;)lr(t,o=e[n++])&&(~Wa(a,o)||re(a,o));return a},qa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ja=Ya,Ha=qa,Xa=Ha.concat("length","prototype");Ue.f=Object.getOwnPropertyNames||function(e){return Ja(e,Xa)};var Ke={};Ke.f=Object.getOwnPropertySymbols;var Za=ge,Qa=b,ro=Ue,eo=Ke,to=M,no=Qa([].concat),ao=Za("Reflect","ownKeys")||function(e){var t=ro.f(to(e)),n=eo.f;return n?no(t,n(e)):t},ee=S,oo=ao,io=gr,vo=J,uo=function(r,e,t){for(var n=oo(e),a=vo.f,o=io.f,i=0;i<n.length;i++){var v=n[i];!ee(r,v)&&!(t&&ee(t,v))&&a(r,v,o(e,v))}},co=h,lo=$,fo=/#|\.prototype\./,A=function(r,e){var t=yo[so(r)];return t===po?!0:t===$o?!1:lo(e)?co(e):!!e},so=A.normalize=function(r){return String(r).replace(fo,".").toLowerCase()},yo=A.data={},$o=A.NATIVE="N",po=A.POLYFILL="P",Ve=A,G=f,bo=gr.f,ho=_e,go=ma,Oo=Ir,So=uo,Eo=Ve,To=function(r,e){var t=r.target,n=r.global,a=r.stat,o,i,v,u,c,s;if(n?i=G:a?i=G[t]||Oo(t,{}):i=G[t]&&G[t].prototype,i)for(v in e){if(c=e[v],r.dontCallGetSet?(s=bo(i,v),u=s&&s.value):u=i[v],o=Eo(n?v:t+(a?".":"#")+v,r.forced),!o&&u!==void 0){if(typeof c==typeof u)continue;So(c,u)}(r.sham||u&&u.sham)&&ho(c,"sham",!0),go(i,v,c,r)}},ke={},te=D,wo=TypeError,Io=function(r){var e,t;this.promise=new r(function(n,a){if(e!==void 0||t!==void 0)throw new wo("Bad Promise constructor");e=n,t=a}),this.resolve=te(e),this.reject=te(t)};ke.f=function(r){return new Io(r)};var mo=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}},Ro=q,Po=b,Co=function(r){if(Ro(r)==="Function")return Po(r)},ne=Co,jo=D,No=Or,_o=ne(ne.bind),Do=function(r,e){return jo(r),e===void 0?r:No?_o(r,e):function(){return r.apply(e,arguments)}},We={},Mo=E,Ao=We,Fo=Mo("iterator"),Bo=Array.prototype,Lo=function(r){return r!==void 0&&(Ao.Array===r||Bo[Fo]===r)},Uo=E,Go=Uo("toStringTag"),ze={};ze[Go]="z";var xo=String(ze)==="[object z]",Ko=xo,Vo=$,V=q,ko=E,Wo=ko("toStringTag"),zo=Object,Yo=V(function(){return arguments}())==="Arguments",qo=function(r,e){try{return r[e]}catch{}},Jo=Ko?V:function(r){var e,t,n;return r===void 0?"Undefined":r===null?"Null":typeof(t=qo(e=zo(r),Wo))=="string"?t:Yo?V(e):(n=V(e))==="Object"&&Vo(e.callee)?"Arguments":n},Ho=Jo,ae=wr,Xo=Sr,Zo=We,Qo=E,ri=Qo("iterator"),Ye=function(r){if(!Xo(r))return ae(r,ri)||ae(r,"@@iterator")||Zo[Ho(r)]},ei=O,ti=D,ni=M,ai=Tr,oi=Ye,ii=TypeError,vi=function(r,e){var t=arguments.length<2?oi(r):e;if(ti(t))return ni(ei(t,r));throw new ii(ai(r)+" is not iterable")},ui=O,oe=M,ci=wr,li=function(r,e,t){var n,a;oe(r);try{if(n=ci(r,"return"),!n){if(e==="throw")throw t;return t}n=ui(n,r)}catch(o){a=!0,n=o}if(e==="throw")throw t;if(a)throw n;return oe(n),t},fi=Do,si=O,yi=M,$i=Tr,di=Lo,pi=xe,ie=Oe,bi=vi,hi=Ye,ve=li,gi=TypeError,k=function(r,e){this.stopped=r,this.result=e},ue=k.prototype,Oi=function(r,e,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),v=!!(t&&t.INTERRUPTED),u=fi(e,n),c,s,T,R,l,w,Cr,jr=function(y){return c&&ve(c,"normal",y),new k(!0,y)},Nr=function(y){return a?(yi(y),v?u(y[0],y[1],jr):u(y[0],y[1])):v?u(y,jr):u(y)};if(o)c=r.iterator;else if(i)c=r;else{if(s=hi(r),!s)throw new gi($i(r)+" is not iterable");if(di(s)){for(T=0,R=pi(r);R>T;T++)if(l=Nr(r[T]),l&&ie(ue,l))return l;return new k(!1)}c=bi(r,s)}for(w=o?r.next:c.next;!(Cr=si(w,c)).done;){try{l=Nr(Cr.value)}catch(y){ve(c,"throw",y)}if(typeof l=="object"&&l&&ie(ue,l))return l}return new k(!1)},Si=f,qe=Si.Promise,Ei=E,Je=Ei("iterator"),He=!1;try{var Ti=0,ce={next:function(){return{done:!!Ti++}},return:function(){He=!0}};ce[Je]=function(){return this},Array.from(ce,function(){throw 2})}catch{}var wi=function(r,e){try{if(!e&&!He)return!1}catch{return!1}var t=!1;try{var n={};n[Je]=function(){return{next:function(){return{done:t=!0}}}},r(n)}catch{}return t},C=f,Ii=Se,mi=q,x=function(r){return Ii.slice(0,r.length)===r},Ri=function(){return x("Bun/")?"BUN":x("Cloudflare-Workers")?"CLOUDFLARE":x("Deno/")?"DENO":x("Node.js/")?"NODE":C.Bun&&typeof Bun.version=="string"?"BUN":C.Deno&&typeof Deno.version=="object"?"DENO":mi(C.process)==="process"?"NODE":C.window&&C.document?"BROWSER":"REST"}(),Pi=f,j=qe,Ci=$,ji=Ve,Ni=Ae,_i=E,le=Ri,fr=Te;j&&j.prototype;var Di=_i("species"),hr=!1,Xe=Ci(Pi.PromiseRejectionEvent),Mi=ji("Promise",function(){var r=Ni(j),e=r!==String(j);if(!e&&fr===66)return!0;if(!fr||fr<51||!/native code/.test(r)){var t=new j(function(o){o(1)}),n=function(o){o(function(){},function(){})},a=t.constructor={};if(a[Di]=n,hr=t.then(function(){})instanceof n,!hr)return!0}return!e&&(le==="BROWSER"||le==="DENO")&&!Xe}),Ai={CONSTRUCTOR:Mi,REJECTION_EVENT:Xe,SUBCLASSING:hr},Fi=qe,Bi=wi,Li=Ai.CONSTRUCTOR,Ui=Li||!Bi(function(r){Fi.all(r).then(void 0,function(){})}),Gi=To,xi=O,Ki=D,Vi=ke,ki=mo,Wi=Oi,zi=Ui;Gi({target:"Promise",stat:!0,forced:zi},{allSettled:function(e){var t=this,n=Vi.f(t),a=n.resolve,o=n.reject,i=ki(function(){var v=Ki(t.resolve),u=[],c=0,s=1;Wi(e,function(T){var R=c++,l=!1;s++,xi(v,t,T).then(function(w){l||(l=!0,u[R]={status:"fulfilled",value:w},--s||a(u))},function(w){l||(l=!0,u[R]={status:"rejected",reason:w},--s||a(u))})}),--s||a(u)});return i.error&&o(i.value),n.promise}});export{F as c,Yi as g};
|
|
1
|
+
(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="6727eb11-1729-4308-aa29-ab2ee8957839",r._sentryDebugIdIdentifier="sentry-dbid-6727eb11-1729-4308-aa29-ab2ee8957839")}catch{}})();var Ze=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};Ze.SENTRY_RELEASE={id:"3e1e24ea99c93db16fbcc8da6c7d84e73111574d"};var F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yi(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var P=function(r){return r&&r.Math===Math&&r},f=P(typeof globalThis=="object"&&globalThis)||P(typeof window=="object"&&window)||P(typeof self=="object"&&self)||P(typeof F=="object"&&F)||P(typeof F=="object"&&F)||function(){return this}()||Function("return this")(),gr={},h=function(r){try{return!!r()}catch{return!0}},Qe=h,g=!Qe(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),rt=h,Or=!rt(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),et=Or,B=Function.prototype.call,O=et?B.bind(B):function(){return B.apply(B,arguments)},fe={},se={}.propertyIsEnumerable,ye=Object.getOwnPropertyDescriptor,tt=ye&&!se.call({1:2},1);fe.f=tt?function(e){var t=ye(this,e);return!!t&&t.enumerable}:se;var de=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}},$e=Or,pe=Function.prototype,sr=pe.call,nt=$e&&pe.bind.bind(sr,sr),b=$e?nt:function(r){return function(){return sr.apply(r,arguments)}},be=b,at=be({}.toString),ot=be("".slice),q=function(r){return ot(at(r),8,-1)},it=b,vt=h,ut=q,H=Object,ct=it("".split),lt=vt(function(){return!H("z").propertyIsEnumerable(0)})?function(r){return ut(r)==="String"?ct(r,""):H(r)}:H,Sr=function(r){return r==null},ft=Sr,st=TypeError,he=function(r){if(ft(r))throw new st("Can't call method on "+r);return r},yt=lt,dt=he,Er=function(r){return yt(dt(r))},X=typeof document=="object"&&document.all,d=typeof X>"u"&&X!==void 0?function(r){return typeof r=="function"||r===X}:function(r){return typeof r=="function"},$t=d,_=function(r){return typeof r=="object"?r!==null:$t(r)},Z=f,pt=d,bt=function(r){return pt(r)?r:void 0},ge=function(r,e){return arguments.length<2?bt(Z[r]):Z[r]&&Z[r][e]},ht=b,Oe=ht({}.isPrototypeOf),gt=f,_r=gt.navigator,Dr=_r&&_r.userAgent,Se=Dr?String(Dr):"",Ee=f,Q=Se,Mr=Ee.process,Ar=Ee.Deno,Fr=Mr&&Mr.versions||Ar&&Ar.version,Br=Fr&&Fr.v8,$,W;Br&&($=Br.split("."),W=$[0]>0&&$[0]<4?1:+($[0]+$[1]));!W&&Q&&($=Q.match(/Edge\/(\d+)/),(!$||$[1]>=74)&&($=Q.match(/Chrome\/(\d+)/),$&&(W=+$[1])));var Te=W,Lr=Te,Ot=h,St=f,Et=St.String,we=!!Object.getOwnPropertySymbols&&!Ot(function(){var r=Symbol("symbol detection");return!Et(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Lr&&Lr<41}),Tt=we,Ie=Tt&&!Symbol.sham&&typeof Symbol.iterator=="symbol",wt=ge,It=d,mt=Oe,Rt=Ie,Pt=Object,me=Rt?function(r){return typeof r=="symbol"}:function(r){var e=wt("Symbol");return It(e)&&mt(e.prototype,Pt(r))},Ct=String,Tr=function(r){try{return Ct(r)}catch{return"Object"}},jt=d,Nt=Tr,_t=TypeError,D=function(r){if(jt(r))return r;throw new _t(Nt(r)+" is not a function")},Dt=D,Mt=Sr,wr=function(r,e){var t=r[e];return Mt(t)?void 0:Dt(t)},rr=O,er=d,tr=_,At=TypeError,Ft=function(r,e){var t,n;if(e==="string"&&er(t=r.toString)&&!tr(n=rr(t,r))||er(t=r.valueOf)&&!tr(n=rr(t,r))||e!=="string"&&er(t=r.toString)&&!tr(n=rr(t,r)))return n;throw new At("Can't convert object to primitive value")},Re={exports:{}},Ur=f,Bt=Object.defineProperty,Ir=function(r,e){try{Bt(Ur,r,{value:e,configurable:!0,writable:!0})}catch{Ur[r]=e}return e},Lt=f,Ut=Ir,Gr="__core-js_shared__",xr=Re.exports=Lt[Gr]||Ut(Gr,{});(xr.versions||(xr.versions=[])).push({version:"3.39.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"});var mr=Re.exports,Kr=mr,Pe=function(r,e){return Kr[r]||(Kr[r]=e||{})},Gt=he,xt=Object,Kt=function(r){return xt(Gt(r))},Vt=b,kt=Kt,Wt=Vt({}.hasOwnProperty),S=Object.hasOwn||function(e,t){return Wt(kt(e),t)},zt=b,Yt=0,qt=Math.random(),Jt=zt(1 .toString),Ce=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Jt(++Yt+qt,36)},Ht=f,Xt=Pe,Vr=S,Zt=Ce,Qt=we,rn=Ie,m=Ht.Symbol,nr=Xt("wks"),en=rn?m.for||m:m&&m.withoutSetter||Zt,E=function(r){return Vr(nr,r)||(nr[r]=Qt&&Vr(m,r)?m[r]:en("Symbol."+r)),nr[r]},tn=O,kr=_,Wr=me,nn=wr,an=Ft,on=E,vn=TypeError,un=on("toPrimitive"),cn=function(r,e){if(!kr(r)||Wr(r))return r;var t=nn(r,un),n;if(t){if(e===void 0&&(e="default"),n=tn(t,r,e),!kr(n)||Wr(n))return n;throw new vn("Can't convert object to primitive value")}return e===void 0&&(e="number"),an(r,e)},ln=cn,fn=me,je=function(r){var e=ln(r,"string");return fn(e)?e:e+""},sn=f,zr=_,yr=sn.document,yn=zr(yr)&&zr(yr.createElement),dn=function(r){return yn?yr.createElement(r):{}},$n=g,pn=h,bn=dn,Ne=!$n&&!pn(function(){return Object.defineProperty(bn("div"),"a",{get:function(){return 7}}).a!==7}),hn=g,gn=O,On=fe,Sn=de,En=Er,Tn=je,wn=S,In=Ne,Yr=Object.getOwnPropertyDescriptor;gr.f=hn?Yr:function(e,t){if(e=En(e),t=Tn(t),In)try{return Yr(e,t)}catch{}if(wn(e,t))return Sn(!gn(On.f,e,t),e[t])};var J={},mn=g,Rn=h,Pn=mn&&Rn(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Cn=_,jn=String,Nn=TypeError,M=function(r){if(Cn(r))return r;throw new Nn(jn(r)+" is not an object")},_n=g,Dn=Ne,Mn=Pn,L=M,qr=je,An=TypeError,ar=Object.defineProperty,Fn=Object.getOwnPropertyDescriptor,or="enumerable",ir="configurable",vr="writable";J.f=_n?Mn?function(e,t,n){if(L(e),t=qr(t),L(n),typeof e=="function"&&t==="prototype"&&"value"in n&&vr in n&&!n[vr]){var a=Fn(e,t);a&&a[vr]&&(e[t]=n.value,n={configurable:ir in n?n[ir]:a[ir],enumerable:or in n?n[or]:a[or],writable:!1})}return ar(e,t,n)}:ar:function(e,t,n){if(L(e),t=qr(t),L(n),Dn)try{return ar(e,t,n)}catch{}if("get"in n||"set"in n)throw new An("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Bn=g,Ln=J,Un=de,_e=Bn?function(r,e,t){return Ln.f(r,e,Un(1,t))}:function(r,e,t){return r[e]=t,r},De={exports:{}},dr=g,Gn=S,Me=Function.prototype,xn=dr&&Object.getOwnPropertyDescriptor,Rr=Gn(Me,"name"),Kn=Rr&&function(){}.name==="something",Vn=Rr&&(!dr||dr&&xn(Me,"name").configurable),kn={EXISTS:Rr,PROPER:Kn,CONFIGURABLE:Vn},Wn=b,zn=d,$r=mr,Yn=Wn(Function.toString);zn($r.inspectSource)||($r.inspectSource=function(r){return Yn(r)});var Ae=$r.inspectSource,qn=f,Jn=d,Jr=qn.WeakMap,Hn=Jn(Jr)&&/native code/.test(String(Jr)),Xn=Pe,Zn=Ce,Hr=Xn("keys"),Qn=function(r){return Hr[r]||(Hr[r]=Zn(r))},Fe={},ra=Hn,Be=f,ea=_,ta=_e,ur=S,cr=mr,na=Qn,aa=Fe,Xr="Object already initialized",pr=Be.TypeError,oa=Be.WeakMap,z,N,Y,ia=function(r){return Y(r)?N(r):z(r,{})},va=function(r){return function(e){var t;if(!ea(e)||(t=N(e)).type!==r)throw new pr("Incompatible receiver, "+r+" required");return t}};if(ra||cr.state){var p=cr.state||(cr.state=new oa);p.get=p.get,p.has=p.has,p.set=p.set,z=function(r,e){if(p.has(r))throw new pr(Xr);return e.facade=r,p.set(r,e),e},N=function(r){return p.get(r)||{}},Y=function(r){return p.has(r)}}else{var I=na("state");aa[I]=!0,z=function(r,e){if(ur(r,I))throw new pr(Xr);return e.facade=r,ta(r,I,e),e},N=function(r){return ur(r,I)?r[I]:{}},Y=function(r){return ur(r,I)}}var ua={set:z,get:N,has:Y,enforce:ia,getterFor:va},Pr=b,ca=h,la=d,U=S,br=g,fa=kn.CONFIGURABLE,sa=Ae,Le=ua,ya=Le.enforce,da=Le.get,Zr=String,K=Object.defineProperty,$a=Pr("".slice),pa=Pr("".replace),ba=Pr([].join),ha=br&&!ca(function(){return K(function(){},"length",{value:8}).length!==8}),ga=String(String).split("String"),Oa=De.exports=function(r,e,t){$a(Zr(e),0,7)==="Symbol("&&(e="["+pa(Zr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!U(r,"name")||fa&&r.name!==e)&&(br?K(r,"name",{value:e,configurable:!0}):r.name=e),ha&&t&&U(t,"arity")&&r.length!==t.arity&&K(r,"length",{value:t.arity});try{t&&U(t,"constructor")&&t.constructor?br&&K(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var n=ya(r);return U(n,"source")||(n.source=ba(ga,typeof e=="string"?e:"")),r};Function.prototype.toString=Oa(function(){return la(this)&&da(this).source||sa(this)},"toString");var Sa=De.exports,Ea=d,Ta=J,wa=Sa,Ia=Ir,ma=function(r,e,t,n){n||(n={});var a=n.enumerable,o=n.name!==void 0?n.name:e;if(Ea(t)&&wa(t,o,n),n.global)a?r[e]=t:Ia(e,t);else{try{n.unsafe?r[e]&&(a=!0):delete r[e]}catch{}a?r[e]=t:Ta.f(r,e,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return r},Ue={},Ra=Math.ceil,Pa=Math.floor,Ca=Math.trunc||function(e){var t=+e;return(t>0?Pa:Ra)(t)},ja=Ca,Ge=function(r){var e=+r;return e!==e||e===0?0:ja(e)},Na=Ge,_a=Math.max,Da=Math.min,Ma=function(r,e){var t=Na(r);return t<0?_a(t+e,0):Da(t,e)},Aa=Ge,Fa=Math.min,Ba=function(r){var e=Aa(r);return e>0?Fa(e,9007199254740991):0},La=Ba,xe=function(r){return La(r.length)},Ua=Er,Ga=Ma,xa=xe,Qr=function(r){return function(e,t,n){var a=Ua(e),o=xa(a);if(o===0)return!r&&-1;var i=Ga(n,o),v;if(r&&t!==t){for(;o>i;)if(v=a[i++],v!==v)return!0}else for(;o>i;i++)if((r||i in a)&&a[i]===t)return r||i||0;return!r&&-1}},Ka={includes:Qr(!0),indexOf:Qr(!1)},Va=b,lr=S,ka=Er,Wa=Ka.indexOf,za=Fe,re=Va([].push),Ya=function(r,e){var t=ka(r),n=0,a=[],o;for(o in t)!lr(za,o)&&lr(t,o)&&re(a,o);for(;e.length>n;)lr(t,o=e[n++])&&(~Wa(a,o)||re(a,o));return a},qa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ja=Ya,Ha=qa,Xa=Ha.concat("length","prototype");Ue.f=Object.getOwnPropertyNames||function(e){return Ja(e,Xa)};var Ke={};Ke.f=Object.getOwnPropertySymbols;var Za=ge,Qa=b,ro=Ue,eo=Ke,to=M,no=Qa([].concat),ao=Za("Reflect","ownKeys")||function(e){var t=ro.f(to(e)),n=eo.f;return n?no(t,n(e)):t},ee=S,oo=ao,io=gr,vo=J,uo=function(r,e,t){for(var n=oo(e),a=vo.f,o=io.f,i=0;i<n.length;i++){var v=n[i];!ee(r,v)&&!(t&&ee(t,v))&&a(r,v,o(e,v))}},co=h,lo=d,fo=/#|\.prototype\./,A=function(r,e){var t=yo[so(r)];return t===po?!0:t===$o?!1:lo(e)?co(e):!!e},so=A.normalize=function(r){return String(r).replace(fo,".").toLowerCase()},yo=A.data={},$o=A.NATIVE="N",po=A.POLYFILL="P",Ve=A,G=f,bo=gr.f,ho=_e,go=ma,Oo=Ir,So=uo,Eo=Ve,To=function(r,e){var t=r.target,n=r.global,a=r.stat,o,i,v,u,c,s;if(n?i=G:a?i=G[t]||Oo(t,{}):i=G[t]&&G[t].prototype,i)for(v in e){if(c=e[v],r.dontCallGetSet?(s=bo(i,v),u=s&&s.value):u=i[v],o=Eo(n?v:t+(a?".":"#")+v,r.forced),!o&&u!==void 0){if(typeof c==typeof u)continue;So(c,u)}(r.sham||u&&u.sham)&&ho(c,"sham",!0),go(i,v,c,r)}},ke={},te=D,wo=TypeError,Io=function(r){var e,t;this.promise=new r(function(n,a){if(e!==void 0||t!==void 0)throw new wo("Bad Promise constructor");e=n,t=a}),this.resolve=te(e),this.reject=te(t)};ke.f=function(r){return new Io(r)};var mo=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}},Ro=q,Po=b,Co=function(r){if(Ro(r)==="Function")return Po(r)},ne=Co,jo=D,No=Or,_o=ne(ne.bind),Do=function(r,e){return jo(r),e===void 0?r:No?_o(r,e):function(){return r.apply(e,arguments)}},We={},Mo=E,Ao=We,Fo=Mo("iterator"),Bo=Array.prototype,Lo=function(r){return r!==void 0&&(Ao.Array===r||Bo[Fo]===r)},Uo=E,Go=Uo("toStringTag"),ze={};ze[Go]="z";var xo=String(ze)==="[object z]",Ko=xo,Vo=d,V=q,ko=E,Wo=ko("toStringTag"),zo=Object,Yo=V(function(){return arguments}())==="Arguments",qo=function(r,e){try{return r[e]}catch{}},Jo=Ko?V:function(r){var e,t,n;return r===void 0?"Undefined":r===null?"Null":typeof(t=qo(e=zo(r),Wo))=="string"?t:Yo?V(e):(n=V(e))==="Object"&&Vo(e.callee)?"Arguments":n},Ho=Jo,ae=wr,Xo=Sr,Zo=We,Qo=E,ri=Qo("iterator"),Ye=function(r){if(!Xo(r))return ae(r,ri)||ae(r,"@@iterator")||Zo[Ho(r)]},ei=O,ti=D,ni=M,ai=Tr,oi=Ye,ii=TypeError,vi=function(r,e){var t=arguments.length<2?oi(r):e;if(ti(t))return ni(ei(t,r));throw new ii(ai(r)+" is not iterable")},ui=O,oe=M,ci=wr,li=function(r,e,t){var n,a;oe(r);try{if(n=ci(r,"return"),!n){if(e==="throw")throw t;return t}n=ui(n,r)}catch(o){a=!0,n=o}if(e==="throw")throw t;if(a)throw n;return oe(n),t},fi=Do,si=O,yi=M,di=Tr,$i=Lo,pi=xe,ie=Oe,bi=vi,hi=Ye,ve=li,gi=TypeError,k=function(r,e){this.stopped=r,this.result=e},ue=k.prototype,Oi=function(r,e,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),v=!!(t&&t.INTERRUPTED),u=fi(e,n),c,s,T,R,l,w,Cr,jr=function(y){return c&&ve(c,"normal",y),new k(!0,y)},Nr=function(y){return a?(yi(y),v?u(y[0],y[1],jr):u(y[0],y[1])):v?u(y,jr):u(y)};if(o)c=r.iterator;else if(i)c=r;else{if(s=hi(r),!s)throw new gi(di(r)+" is not iterable");if($i(s)){for(T=0,R=pi(r);R>T;T++)if(l=Nr(r[T]),l&&ie(ue,l))return l;return new k(!1)}c=bi(r,s)}for(w=o?r.next:c.next;!(Cr=si(w,c)).done;){try{l=Nr(Cr.value)}catch(y){ve(c,"throw",y)}if(typeof l=="object"&&l&&ie(ue,l))return l}return new k(!1)},Si=f,qe=Si.Promise,Ei=E,Je=Ei("iterator"),He=!1;try{var Ti=0,ce={next:function(){return{done:!!Ti++}},return:function(){He=!0}};ce[Je]=function(){return this},Array.from(ce,function(){throw 2})}catch{}var wi=function(r,e){try{if(!e&&!He)return!1}catch{return!1}var t=!1;try{var n={};n[Je]=function(){return{next:function(){return{done:t=!0}}}},r(n)}catch{}return t},C=f,Ii=Se,mi=q,x=function(r){return Ii.slice(0,r.length)===r},Ri=function(){return x("Bun/")?"BUN":x("Cloudflare-Workers")?"CLOUDFLARE":x("Deno/")?"DENO":x("Node.js/")?"NODE":C.Bun&&typeof Bun.version=="string"?"BUN":C.Deno&&typeof Deno.version=="object"?"DENO":mi(C.process)==="process"?"NODE":C.window&&C.document?"BROWSER":"REST"}(),Pi=f,j=qe,Ci=d,ji=Ve,Ni=Ae,_i=E,le=Ri,fr=Te;j&&j.prototype;var Di=_i("species"),hr=!1,Xe=Ci(Pi.PromiseRejectionEvent),Mi=ji("Promise",function(){var r=Ni(j),e=r!==String(j);if(!e&&fr===66)return!0;if(!fr||fr<51||!/native code/.test(r)){var t=new j(function(o){o(1)}),n=function(o){o(function(){},function(){})},a=t.constructor={};if(a[Di]=n,hr=t.then(function(){})instanceof n,!hr)return!0}return!e&&(le==="BROWSER"||le==="DENO")&&!Xe}),Ai={CONSTRUCTOR:Mi,REJECTION_EVENT:Xe,SUBCLASSING:hr},Fi=qe,Bi=wi,Li=Ai.CONSTRUCTOR,Ui=Li||!Bi(function(r){Fi.all(r).then(void 0,function(){})}),Gi=To,xi=O,Ki=D,Vi=ke,ki=mo,Wi=Oi,zi=Ui;Gi({target:"Promise",stat:!0,forced:zi},{allSettled:function(e){var t=this,n=Vi.f(t),a=n.resolve,o=n.reject,i=ki(function(){var v=Ki(t.resolve),u=[],c=0,s=1;Wi(e,function(T){var R=c++,l=!1;s++,xi(v,t,T).then(function(w){l||(l=!0,u[R]={status:"fulfilled",value:w},--s||a(u))},function(w){l||(l=!0,u[R]={status:"rejected",reason:w},--s||a(u))})}),--s||a(u)});return i.error&&o(i.value),n.promise}});export{F as c,Yi as g};
|
|
2
2
|
//# sourceMappingURL=vendor.core-js.js.map
|