userflow.js-self-hosted 0.1.1024504 → 0.1.1024509
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/AnnouncementEngagement.js +2 -2
- package/BannerApp.js +1 -1
- package/BuilderBar.js +1 -1
- package/ChecklistApp.js +1 -1
- package/ChecklistUI.js +1 -1
- package/DebuggerUI.js +2 -2
- package/ElementSelectionApp.js +1 -1
- package/EmbedApp.js +1 -1
- package/FlowApp.js +3 -3
- package/FlowChrome.js +2 -2
- package/Frame.js +1 -1
- package/LauncherApp.js +1 -1
- package/NotificationsApp.js +1 -1
- package/Popover.js +1 -1
- package/ResourceCenterApp.js +4 -4
- package/ResourceCenterAssistantChat.js +2 -2
- package/ResourceCenterLauncherHandler.js +1 -1
- package/SitePage.js +1 -1
- package/SmartFlowRecordingApp.js +1 -1
- package/StartConditionTestingApp.js +1 -1
- package/TrackerTestingApp.js +1 -1
- package/TreeDoc.js +3 -3
- package/Trigger.js +1 -1
- package/WorkflowApp.js +2 -2
- package/client-context.js +1 -1
- package/flow-condition-types.js +1 -1
- package/flow-host.styl.js +1 -1
- package/happy.js +1 -1
- package/hash.txt +1 -1
- package/implicit-tracking.js +2 -2
- package/neutral.js +1 -1
- package/package.json +1 -1
- package/react-hooks.js +1 -1
- package/roots.js +1 -1
- package/sad.js +1 -1
- package/steps.js +1 -1
- package/stylesheets.js +1 -1
- package/ui.js +2 -2
- package/use-confetti.js +1 -1
- package/use-element-rect.js +1 -1
- package/use-selector-element-monitoring.js +1 -1
- package/use-window-resize.js +1 -1
- package/userflow.js +8 -8
- package/vendor.babel.runtime.js +3 -3
- package/vendor.bignumber.js.js +1 -1
- package/vendor.canvas-confetti.js +2 -2
- package/vendor.date-fns.js +1 -1
- package/vendor.dompurify.js +1 -1
- package/vendor.fortawesome.pro-light-svg-icons.js +1 -1
- package/vendor.fortawesome.pro-regular-svg-icons.js +1 -1
- package/vendor.fortawesome.pro-solid-svg-icons.js +1 -1
- package/vendor.history.js +1 -1
- package/vendor.html-parse-stringify2.js +1 -1
- package/vendor.i18next.js +1 -1
- package/vendor.is-hotkey.js +1 -1
- package/vendor.lodash.js +1 -27
- package/vendor.mini-create-react-context.js +1 -1
- package/vendor.object-assign.js +1 -5
- package/vendor.path-to-regexp.js +1 -1
- package/vendor.prop-types.js +1 -1
- package/vendor.react-dom.js +8 -15
- package/vendor.react-i18next.js +1 -1
- package/vendor.react-is.js +1 -8
- package/vendor.react-router-dom.js +1 -1
- package/vendor.react-router.js +1 -1
- package/vendor.react.js +1 -8
- package/vendor.scheduler.js +1 -8
- package/vendor.void-elements.js +1 -1
- package/vendor.core-js.js +0 -2
- package/vendor.fortawesome.fontawesome-svg-core.js +0 -762
- package/vendor.fortawesome.react-fontawesome.js +0 -3
- package/vendor.react-day-picker.js +0 -2
package/flow-condition-types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as c,h as w,ac as k,ad as z,ae as K,af as g}from"./userflow.js";import"./vendor.core-js.js";import{i as S,b as I,c as X,a as j,d as B,s as Y}from"./vendor.date-fns.js";import{M as Z,o as H,f as U,u as F,C as q}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]="1bac4c7d-cc90-443d-af2c-064cf74f8f8b",e._sentryDebugIdIdentifier="sentry-dbid-1bac4c7d-cc90-443d-af2c-064cf74f8f8b")}catch{}})();const Q=/(\\*)\{\{([a-zA-Z0-9_.\\/]+)\}\}/g;function J(e,t){return(e||"").replace(Q,(r,n,s)=>{const o=n.length;return o%2===0?"\\".repeat(o/2)+(t(s)||""):"\\".repeat((o-1)/2)+"{{"+s+"}}"})}function ee(e){let t=null;return r=>(t||(t=new Map,e.forEach(({name:n,value:s})=>t.set(n,Array.isArray(s)?s[0]:s))),t.get(r)||null)}function L(e,t){const r=ee(t);return J(e,n=>r(n))}function x(e,t){const r=M(e,t),n=e.nearSelector&&M(e.nearSelector,t);return e===r&&e.nearSelector===n?e:e.nearSelector===n?r:{...r,nearSelector:n}}function M(e,t){if(!e.text)return e;const r=L(e.text,t);return r===e.text?e:{...e,text:r}}function te(e,t){return e.includes.length===0&&e.excludes.length===0?!1:(e.includes.length===0||e.includes.some(r=>{const n=V(r);return n&&t.match(n)}))&&!e.excludes.some(r=>{const n=V(r);return n&&t.match(n)})}function re(e){const t=e.match(/^(([a-z\d]+):\/\/)?([^/?#]+)?(\/[^?#]*)?(\?([^#]*))?(#.*)?$/i);if(!t)return null;const[,,r,n,s,,o,u]=t;return{scheme:r||"",domain:n||"",path:s||"",query:o||"",fragment:u||""}}function V(e){const t=re(e);if(!t)return console.error("Userflow: Invalid URL pattern:",e),null;const{scheme:r,domain:n,path:s,query:o,fragment:u}=t;let a;r?a=O(r):a="[a-z\\d]+";let f;n?f=A(n,"[^/]","."):f="[^/]*";const p="(:\\d+)?";let i;s?i=A(s,"[^?#]","/"):i="/[^?#]*";let E;o?(E="",new URLSearchParams(o).forEach((d,T)=>{let h;d===""?h="=?":d==="*"?h="(=[^&#]*)?":(d=d.split(/\*/g).map($=>encodeURI($)).join("*"),h="="+A(d,"[^#]")),E+="(?=.*[?&]"+O(T)+h+"([&#]|$))"}),E+="\\?[^#]*"):E="(\\?[^#]*)?";let m;return u?m=A(u,".","/"):m="(#.*)?",new RegExp("^"+a+"://"+f+p+i+E+m+"$")}function A(e,t,r){return e=O(e),e=e.replace(/\\\*/g,t+"*"),r&&(e=e.replace(/:[a-zA-Z0-9_]+/g,"[^"+r+"]+")),e}function O(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}const y={[c.ABSOLUTE_EQ]:{compare:({condition:e,value:t})=>{const r=b(t),n=D(e.value,"00:00:00.000"),s=D(e.value,"23:59:59.999");return r!=null&&n!=null&&s!=null&&!S(r,n)&&!I(r,s)}},[c.ABSOLUTE_GT]:{compare:({condition:e,value:t})=>{const r=b(t),n=D(e.value,"23:59:59.999");return r!=null&&n!=null&&I(r,n)}},[c.ABSOLUTE_LT]:{compare:({condition:e,value:t})=>{const r=b(t),n=D(e.value,"00:00:00.000");return r!=null&&n!=null&&S(r,n)}},[c.AND]:{compare:()=>W("AND.compare")},[c.BETWEEN]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&!!e.value2&&parseFloat(v(t))>=parseFloat(e.value)&&parseFloat(v(t))<=parseFloat(e.value2)},[c.CONTAINS]:{compare:({sessionData:e,condition:t,value:r})=>!!r&&v(r).toLowerCase().includes(L(t.value||"",e).toLowerCase())},[c.EMPTY]:{compare:({value:e})=>e==null||e===""||Array.isArray(e)&&e.length===0},[c.ENDS_WITH]:{compare:({sessionData:e,condition:t,value:r})=>!!r&&v(r).toLowerCase().endsWith(L(t.value||"",e).toLowerCase())},[c.EQ]:{compare:({sessionData:e,condition:t,value:r})=>L(t.value||"",e)===v(r)},[c.EXCLUDES_ALL]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return!(e.values||[]).some(n=>r.has(n))}},[c.EXCLUDES_ANY]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return!(e.values||[]).every(n=>r.has(n))}},[c.FALSE]:{compare:({value:e})=>v(e).toLowerCase()==="false"},[c.GT]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))>parseFloat(e.value)},[c.GTE]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))>=parseFloat(e.value)},[c.INCLUDES_ALL]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return(e.values||[]).every(n=>r.has(n))}},[c.INCLUDES_ANY]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return(e.values||[]).some(n=>r.has(n))}},[c.LT]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))<parseFloat(e.value)},[c.LTE]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))<=parseFloat(e.value)},[c.NE]:{compare:({sessionData:e,condition:t,value:r})=>L(t.value||"",e)!==v(r)},[c.NOT_CONTAINS]:{compare:({sessionData:e,condition:t,value:r})=>!r||!v(r).toLowerCase().includes(L(t.value||"",e).toLowerCase())},[c.NOT_EMPTY]:{compare:({value:e})=>e!=null&&e!==""&&(!Array.isArray(e)||e.length>0)},[c.NOT_REGEX]:{compare:({condition:e,value:t})=>!P(e,t)},[c.OR]:{compare:()=>W("OR.compare")},[c.REGEX]:{compare:({condition:e,value:t})=>P(e,t)},[c.RELATIVE_EQ]:{compare:({condition:e,value:t})=>{const r=b(t),n=_(e.value);return r==null||n==null?!1:!S(r,n)&&S(r,X(n,1))}},[c.RELATIVE_GT]:{compare:({condition:e,value:t})=>{const r=b(t),n=_(e.value);return r==null||n==null?!1:I(r,n)}},[c.RELATIVE_LT]:{compare:({condition:e,value:t})=>{const r=b(t),n=_(e.value);return r==null||n==null?!1:S(r,n)}},[c.STARTS_WITH]:{compare:({sessionData:e,condition:t,value:r})=>!!r&&v(r).toLowerCase().startsWith(L(t.value||"",e).toLowerCase())},[c.TRUE]:{compare:({value:e})=>v(e).toLowerCase()==="true"},[c.URL]:{compare:({condition:e,value:t})=>e.urlPattern&&t!=null?te(e.urlPattern,v(t)):!1}};function W(e){throw new Error(`conditionOperators.${e} is not supported`)}function b(e){if(Array.isArray(e)&&(e=e[0]),!e)return null;e.match(/(Z|((\+|-)\d\d:\d\d))$/i)||(e+="Z");const t=j(e);return B(t)?t:null}function D(e,t){if(!e)return null;e+="T"+t+"Z";const r=j(e);return B(r)?r:null}function _(e){if(!e)return null;const t=parseInt(e,10);return isNaN(t)?null:Y(Date.now(),t)}function P(e,t){return e.value?new RegExp(e.value).test(v(t)):!1}function v(e){return Array.isArray(e)?e[0]:e??""}function N(e){return Array.isArray(e)?e:e===""||e==null?[]:[e]}const ne=50,se=1e3;function R(e,t={}){let r,n;const s=()=>{n=void 0,e()},o=()=>{if(window.clearTimeout(r),n==null)n=Date.now();else if(Date.now()-n>se){s();return}r=window.setTimeout(s,ne)},u=i=>{const E=i.target;if(!E||!G(E))return;const m=document.getElementById("userflow-ui");m&&m.contains(E)||o()},a=new Z(i=>{oe(i)||o()}),f=()=>{o()},p=H(i=>{a.observe(i,{attributes:!0,subtree:!0,childList:!0,characterData:!0}),i.addEventListener("animationend",u),i.addEventListener("transitionend",u),i.addEventListener("toggle",f,!0),t.observeInput&&(i.addEventListener("input",o),i.addEventListener("keypress",o),i.addEventListener("change",o))},i=>{i.removeEventListener("animationend",u),i.removeEventListener("transitionend",u),i.removeEventListener("toggle",f,!0),t.observeInput&&(i.removeEventListener("input",o),i.removeEventListener("keypress",o),i.removeEventListener("change",o))});return{disconnect:()=>{window.clearTimeout(r),a.disconnect(),p()}}}function oe(e){const t=document.getElementById("userflow-ui");for(const r of e){const{target:n}=r;if(G(n)&&t&&t.contains(n))return!0}return!1}function G(e){return e.nodeType===Node.ELEMENT_NODE}const C={[w.ALWAYS_TRUE]:{track:({callback:e})=>(e(!0),()=>{})},[w.ATTRIBUTE]:{track:({sessionData:e,condition:t,callback:r})=>{const n=()=>{let o=!1;if(e&&t.operator){const u=e.value.find(p=>p.name===t.attributeName),a=u?u.value:null;o=y[t.operator].compare({sessionData:e.value,condition:t,value:a})}r(o)};n();const s=e.observe(n);return()=>{s()}}},[w.CLAUSE]:{isExpensive:e=>{for(const t of e.conditions){const r=C[t.type];if(r.isExpensive&&r.isExpensive(t))return!0}return!1},track:({sessionData:e,condition:t,flipBackEvents:r,callback:n,description:s})=>{let o,u,a=null;const f=t.conditions.map(m=>{const l=C[m.type];return{condition:m,typeDef:l,expensive:!!l.isExpensive&&l.isExpensive(m),active:!1,isTrue:null}}),p=m=>{for(const l of f){const d=!r||!l.expensive||m;d&&!l.active?(l.active=!0,l.isTrue=!1,l.untrack=l.typeDef.track({sessionData:e,condition:l.condition,flipBackEvents:r,callback:(T,h={})=>{l.isTrue=T,window.clearTimeout(o),h.immediate?i({immediate:!0}):o=window.setTimeout(i,0)},description:s})):!d&&l.active&&(l.untrack&&l.untrack(),l.active=!1,l.isTrue=null,l.untrack=void 0)}},i=(m={})=>{if(f.length===0){E(!1,m);return}let l,d;if(t.operator===c.AND){l=!0,d=!0;for(const T of f)T.isTrue===!1?(l=!1,T.expensive||(d=!1)):l!==!1&&T.isTrue===null&&(l=null)}else{l=!1,d=!0;for(const T of f)T.isTrue===!0?(l=!0,T.expensive||(d=!1)):l!==!0&&T.isTrue===null&&(l=null)}l!==null&&l!==a&&(a=l,E(l,m)),p(d)},E=(m,l)=>{if(!m||t.waitTime==null||t.waitTime=="0")window.clearTimeout(u),u=void 0,n(m,l);else if(!u){const d=parseFloat(t.waitTime)*1e3;u=window.setTimeout(()=>{n(!0,{})},d)}};return p(!1),i(),()=>{window.clearTimeout(o),window.clearTimeout(u);for(const m of f)m.untrack&&m.untrack()}}},[w.ELEMENT]:{isExpensive:()=>!0,track:e=>{const{elementState:t}=e.condition;if(!t)return()=>{};const r=ae(t);switch(r.kind){case"observer":return le(e,r.checkElement);case"event":return ue(e,r.eventName,r.valueWhenOccurred)}}},[w.FILLED_IN_INPUT]:{isExpensive:()=>!0,track:({sessionData:e,condition:t,callback:r})=>{let n=null,s;const o=()=>{if(!t.selector){console.warn("Userflow.js: INPUT_VALUE condition missing selector",t);return}const f=U(x(t.selector,e.value));let p=null;for(const i of f){const E=F(i);if(E){p=E;break}}p?p!=n&&(window.clearTimeout(s),s=window.setTimeout(()=>{r(!0)},1e3)):(r(!1),window.clearTimeout(s)),n=p};o();const u=e.observe(o),{disconnect:a}=R(o,{observeInput:!0});return()=>{u(),a(),window.clearTimeout(s)}}},[w.FLOW]:{track:()=>(console.warn("Userflow.js: Flow conditions do not work client-side"),()=>{})},[w.INPUT_VALUE]:{isExpensive:()=>!0,track:({sessionData:e,condition:t,callback:r})=>{const n=()=>{if(!t.operator){console.warn("Userflow.js: INPUT_VALUE condition missing operator",t);return}if(!t.selector){console.warn("Userflow.js: INPUT_VALUE condition missing selector",t);return}let u=!1;const a=y[t.operator],f=U(x(t.selector,e.value));if(f.length>0)for(const p of f){const i=F(p);if(a.compare({sessionData:e.value,condition:t,value:i})){u=!0;break}}else a.compare({sessionData:e.value,condition:t,value:""})&&(u=!0);r(u)};n();const s=e.observe(n),{disconnect:o}=R(n,{observeInput:!0});return()=>{s(),o()}}},[w.PAGE]:{track:({sessionData:e,condition:t,callback:r})=>{const n=()=>{let a=!1;if(t.operator){const f=k();a=y[t.operator].compare({sessionData:e.value,condition:t,value:f})}r(a)};let s=k();const o=()=>{const a=k();a!==s&&(s=a,n())};z(o),n();const u=e.observe(n);return()=>{u(),K(o)}}},[w.SEGMENT]:{track:({description:e,callback:t})=>(console.error("Userflow.js: Segment conditions are not supported in "+(e||"unknown content item")+"."),t(!1),()=>{})},[w.CHECKLIST_TASK_CLICKED]:{track:({description:e,callback:t})=>(console.error("Userflow.js: Checklist conditions are not supported in "+(e||"unknown content item")+"."),t(!1),()=>{})},[w.EVENT]:{track:({description:e,callback:t})=>(console.error("Userflow.js: Event conditions are not supported in "+(e||"unknown content item")+"."),t(!1),()=>{})},[w.TIME]:{track:({condition:e,callback:t})=>{let r=null;const n=e.value?new Date(e.value):null,s=e.value2?new Date(e.value2):null,o=()=>{let a=!0;(n&&!isNaN(n.valueOf())&&Date.now()<n.valueOf()||s&&!isNaN(s.valueOf())&&Date.now()>=s.valueOf())&&(a=!1),a!==r&&(r=a,t(a))};o();const u=window.setInterval(o,10*1e3);return()=>{window.clearInterval(u)}}}};function ae(e){switch(e){case g.CLICK:return{kind:"event",eventName:"click",valueWhenOccurred:!0};case g.DISABLED:return{kind:"observer",checkElement:t=>!!t&&t.disabled};case g.MOUSEDOWN:return{kind:"event",eventName:"mousedown",valueWhenOccurred:!0};case g.NOT_CLICK:return{kind:"event",eventName:"click",valueWhenOccurred:!1};case g.NOT_DISABLED:return{kind:"observer",checkElement:t=>!!t&&!t.disabled};case g.NOT_PRESENT:return{kind:"observer",checkElement:t=>!t};case g.PRESENT:return{kind:"observer",checkElement:t=>!!t}}}function le({sessionData:e,condition:t,callback:r},n){const s=()=>{if(!t.elementState){console.warn("Userflow.js: ELEMENT_STATE condition missing elementState",t);return}if(!t.selector){console.warn("Userflow.js: ELEMENT_STATE condition missing selector",t);return}let a=!1;const f=U(x(t.selector,e.value));if(f.length>0){for(const p of f)if(n(p)){a=!0;break}}else n(null)&&(a=!0);r(a)};s();const o=e.observe(s),{disconnect:u}=R(s);return()=>{o(),u()}}function ue({condition:e,flipBackEvents:t,callback:r},n,s){const{selector:o}=e;if(!o)return()=>{};r(!s);const u=p=>{const i=p.target;i&&q(i,o)&&(t?(r(s,{immediate:!0}),r(!s,{immediate:!0})):r(s))},a={capture:!0},f=H(p=>p.addEventListener(n,u,a),p=>p.removeEventListener(n,u,a));return()=>{f()}}const me=Object.freeze(Object.defineProperty({__proto__:null,conditionTypes:C},Symbol.toStringTag,{value:"Module"}));export{L as a,J as b,C as c,me as f,ee as g,x as i,R as o};
|
|
1
|
+
import{k as c,l as w,m as k,o as z,u as K,n as g}from"./userflow.js";import"./vendor.object-assign.js";import{i as b,a as I,b as X,p as j,c as B,s as Y}from"./vendor.date-fns.js";import{M as Z,o as H,f as U,g as F,e as q}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]="26d43740-7383-4471-8f85-1f321a76aec6",e._sentryDebugIdIdentifier="sentry-dbid-26d43740-7383-4471-8f85-1f321a76aec6")}catch{}})();const Q=/(\\*)\{\{([a-zA-Z0-9_.\\/]+)\}\}/g;function J(e,t){return(e||"").replace(Q,(r,n,s)=>{const o=n.length;return o%2===0?"\\".repeat(o/2)+(t(s)||""):"\\".repeat((o-1)/2)+"{{"+s+"}}"})}function ee(e){let t=null;return r=>(t||(t=new Map,e.forEach(({name:n,value:s})=>t.set(n,Array.isArray(s)?s[0]:s))),t.get(r)||null)}function L(e,t){const r=ee(t);return J(e,n=>r(n))}function x(e,t){const r=M(e,t),n=e.nearSelector&&M(e.nearSelector,t);return e===r&&e.nearSelector===n?e:e.nearSelector===n?r:{...r,nearSelector:n}}function M(e,t){if(!e.text)return e;const r=L(e.text,t);return r===e.text?e:{...e,text:r}}function te(e,t){return e.includes.length===0&&e.excludes.length===0?!1:(e.includes.length===0||e.includes.some(r=>{const n=V(r);return n&&t.match(n)}))&&!e.excludes.some(r=>{const n=V(r);return n&&t.match(n)})}function re(e){const t=e.match(/^(([a-z\d]+):\/\/)?([^/?#]+)?(\/[^?#]*)?(\?([^#]*))?(#.*)?$/i);if(!t)return null;const[,,r,n,s,,o,u]=t;return{scheme:r||"",domain:n||"",path:s||"",query:o||"",fragment:u||""}}function V(e){const t=re(e);if(!t)return console.error("Userflow: Invalid URL pattern:",e),null;const{scheme:r,domain:n,path:s,query:o,fragment:u}=t;let a;r?a=O(r):a="[a-z\\d]+";let f;n?f=A(n,"[^/]","."):f="[^/]*";const p="(:\\d+)?";let i;s?i=A(s,"[^?#]","/"):i="/[^?#]*";let E;o?(E="",new URLSearchParams(o).forEach((d,T)=>{let h;d===""?h="=?":d==="*"?h="(=[^&#]*)?":(d=d.split(/\*/g).map($=>encodeURI($)).join("*"),h="="+A(d,"[^#]")),E+="(?=.*[?&]"+O(T)+h+"([&#]|$))"}),E+="\\?[^#]*"):E="(\\?[^#]*)?";let m;return u?m=A(u,".","/"):m="(#.*)?",new RegExp("^"+a+"://"+f+p+i+E+m+"$")}function A(e,t,r){return e=O(e),e=e.replace(/\\\*/g,t+"*"),r&&(e=e.replace(/:[a-zA-Z0-9_]+/g,"[^"+r+"]+")),e}function O(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}const y={[c.ABSOLUTE_EQ]:{compare:({condition:e,value:t})=>{const r=S(t),n=D(e.value,"00:00:00.000"),s=D(e.value,"23:59:59.999");return r!=null&&n!=null&&s!=null&&!b(r,n)&&!I(r,s)}},[c.ABSOLUTE_GT]:{compare:({condition:e,value:t})=>{const r=S(t),n=D(e.value,"23:59:59.999");return r!=null&&n!=null&&I(r,n)}},[c.ABSOLUTE_LT]:{compare:({condition:e,value:t})=>{const r=S(t),n=D(e.value,"00:00:00.000");return r!=null&&n!=null&&b(r,n)}},[c.AND]:{compare:()=>W("AND.compare")},[c.BETWEEN]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&!!e.value2&&parseFloat(v(t))>=parseFloat(e.value)&&parseFloat(v(t))<=parseFloat(e.value2)},[c.CONTAINS]:{compare:({sessionData:e,condition:t,value:r})=>!!r&&v(r).toLowerCase().includes(L(t.value||"",e).toLowerCase())},[c.EMPTY]:{compare:({value:e})=>e==null||e===""||Array.isArray(e)&&e.length===0},[c.ENDS_WITH]:{compare:({sessionData:e,condition:t,value:r})=>!!r&&v(r).toLowerCase().endsWith(L(t.value||"",e).toLowerCase())},[c.EQ]:{compare:({sessionData:e,condition:t,value:r})=>L(t.value||"",e)===v(r)},[c.EXCLUDES_ALL]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return!(e.values||[]).some(n=>r.has(n))}},[c.EXCLUDES_ANY]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return!(e.values||[]).every(n=>r.has(n))}},[c.FALSE]:{compare:({value:e})=>v(e).toLowerCase()==="false"},[c.GT]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))>parseFloat(e.value)},[c.GTE]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))>=parseFloat(e.value)},[c.INCLUDES_ALL]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return(e.values||[]).every(n=>r.has(n))}},[c.INCLUDES_ANY]:{compare:({condition:e,value:t})=>{const r=new Set(N(t));return(e.values||[]).some(n=>r.has(n))}},[c.LT]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))<parseFloat(e.value)},[c.LTE]:{compare:({condition:e,value:t})=>!!t&&!!e.value&&parseFloat(v(t))<=parseFloat(e.value)},[c.NE]:{compare:({sessionData:e,condition:t,value:r})=>L(t.value||"",e)!==v(r)},[c.NOT_CONTAINS]:{compare:({sessionData:e,condition:t,value:r})=>!r||!v(r).toLowerCase().includes(L(t.value||"",e).toLowerCase())},[c.NOT_EMPTY]:{compare:({value:e})=>e!=null&&e!==""&&(!Array.isArray(e)||e.length>0)},[c.NOT_REGEX]:{compare:({condition:e,value:t})=>!P(e,t)},[c.OR]:{compare:()=>W("OR.compare")},[c.REGEX]:{compare:({condition:e,value:t})=>P(e,t)},[c.RELATIVE_EQ]:{compare:({condition:e,value:t})=>{const r=S(t),n=_(e.value);return r==null||n==null?!1:!b(r,n)&&b(r,X(n,1))}},[c.RELATIVE_GT]:{compare:({condition:e,value:t})=>{const r=S(t),n=_(e.value);return r==null||n==null?!1:I(r,n)}},[c.RELATIVE_LT]:{compare:({condition:e,value:t})=>{const r=S(t),n=_(e.value);return r==null||n==null?!1:b(r,n)}},[c.STARTS_WITH]:{compare:({sessionData:e,condition:t,value:r})=>!!r&&v(r).toLowerCase().startsWith(L(t.value||"",e).toLowerCase())},[c.TRUE]:{compare:({value:e})=>v(e).toLowerCase()==="true"},[c.URL]:{compare:({condition:e,value:t})=>e.urlPattern&&t!=null?te(e.urlPattern,v(t)):!1}};function W(e){throw new Error(`conditionOperators.${e} is not supported`)}function S(e){if(Array.isArray(e)&&(e=e[0]),!e)return null;e.match(/(Z|((\+|-)\d\d:\d\d))$/i)||(e+="Z");const t=j(e);return B(t)?t:null}function D(e,t){if(!e)return null;e+="T"+t+"Z";const r=j(e);return B(r)?r:null}function _(e){if(!e)return null;const t=parseInt(e,10);return isNaN(t)?null:Y(Date.now(),t)}function P(e,t){return e.value?new RegExp(e.value).test(v(t)):!1}function v(e){return Array.isArray(e)?e[0]:e??""}function N(e){return Array.isArray(e)?e:e===""||e==null?[]:[e]}const ne=50,se=1e3;function R(e,t={}){let r,n;const s=()=>{n=void 0,e()},o=()=>{if(window.clearTimeout(r),n==null)n=Date.now();else if(Date.now()-n>se){s();return}r=window.setTimeout(s,ne)},u=i=>{const E=i.target;if(!E||!G(E))return;const m=document.getElementById("userflow-ui");m&&m.contains(E)||o()},a=new Z(i=>{oe(i)||o()}),f=()=>{o()},p=H(i=>{a.observe(i,{attributes:!0,subtree:!0,childList:!0,characterData:!0}),i.addEventListener("animationend",u),i.addEventListener("transitionend",u),i.addEventListener("toggle",f,!0),t.observeInput&&(i.addEventListener("input",o),i.addEventListener("keypress",o),i.addEventListener("change",o))},i=>{i.removeEventListener("animationend",u),i.removeEventListener("transitionend",u),i.removeEventListener("toggle",f,!0),t.observeInput&&(i.removeEventListener("input",o),i.removeEventListener("keypress",o),i.removeEventListener("change",o))});return{disconnect:()=>{window.clearTimeout(r),a.disconnect(),p()}}}function oe(e){const t=document.getElementById("userflow-ui");for(const r of e){const{target:n}=r;if(G(n)&&t&&t.contains(n))return!0}return!1}function G(e){return e.nodeType===Node.ELEMENT_NODE}const C={[w.ALWAYS_TRUE]:{track:({callback:e})=>(e(!0),()=>{})},[w.ATTRIBUTE]:{track:({sessionData:e,condition:t,callback:r})=>{const n=()=>{let o=!1;if(e&&t.operator){const u=e.value.find(p=>p.name===t.attributeName),a=u?u.value:null;o=y[t.operator].compare({sessionData:e.value,condition:t,value:a})}r(o)};n();const s=e.observe(n);return()=>{s()}}},[w.CLAUSE]:{isExpensive:e=>{for(const t of e.conditions){const r=C[t.type];if(r.isExpensive&&r.isExpensive(t))return!0}return!1},track:({sessionData:e,condition:t,flipBackEvents:r,callback:n,description:s})=>{let o,u,a=null;const f=t.conditions.map(m=>{const l=C[m.type];return{condition:m,typeDef:l,expensive:!!l.isExpensive&&l.isExpensive(m),active:!1,isTrue:null}}),p=m=>{for(const l of f){const d=!r||!l.expensive||m;d&&!l.active?(l.active=!0,l.isTrue=!1,l.untrack=l.typeDef.track({sessionData:e,condition:l.condition,flipBackEvents:r,callback:(T,h={})=>{l.isTrue=T,window.clearTimeout(o),h.immediate?i({immediate:!0}):o=window.setTimeout(i,0)},description:s})):!d&&l.active&&(l.untrack&&l.untrack(),l.active=!1,l.isTrue=null,l.untrack=void 0)}},i=(m={})=>{if(f.length===0){E(!1,m);return}let l,d;if(t.operator===c.AND){l=!0,d=!0;for(const T of f)T.isTrue===!1?(l=!1,T.expensive||(d=!1)):l!==!1&&T.isTrue===null&&(l=null)}else{l=!1,d=!0;for(const T of f)T.isTrue===!0?(l=!0,T.expensive||(d=!1)):l!==!0&&T.isTrue===null&&(l=null)}l!==null&&l!==a&&(a=l,E(l,m)),p(d)},E=(m,l)=>{if(!m||t.waitTime==null||t.waitTime=="0")window.clearTimeout(u),u=void 0,n(m,l);else if(!u){const d=parseFloat(t.waitTime)*1e3;u=window.setTimeout(()=>{n(!0,{})},d)}};return p(!1),i(),()=>{window.clearTimeout(o),window.clearTimeout(u);for(const m of f)m.untrack&&m.untrack()}}},[w.ELEMENT]:{isExpensive:()=>!0,track:e=>{const{elementState:t}=e.condition;if(!t)return()=>{};const r=ae(t);switch(r.kind){case"observer":return le(e,r.checkElement);case"event":return ue(e,r.eventName,r.valueWhenOccurred)}}},[w.FILLED_IN_INPUT]:{isExpensive:()=>!0,track:({sessionData:e,condition:t,callback:r})=>{let n=null,s;const o=()=>{if(!t.selector){console.warn("Userflow.js: INPUT_VALUE condition missing selector",t);return}const f=U(x(t.selector,e.value));let p=null;for(const i of f){const E=F(i);if(E){p=E;break}}p?p!=n&&(window.clearTimeout(s),s=window.setTimeout(()=>{r(!0)},1e3)):(r(!1),window.clearTimeout(s)),n=p};o();const u=e.observe(o),{disconnect:a}=R(o,{observeInput:!0});return()=>{u(),a(),window.clearTimeout(s)}}},[w.FLOW]:{track:()=>(console.warn("Userflow.js: Flow conditions do not work client-side"),()=>{})},[w.INPUT_VALUE]:{isExpensive:()=>!0,track:({sessionData:e,condition:t,callback:r})=>{const n=()=>{if(!t.operator){console.warn("Userflow.js: INPUT_VALUE condition missing operator",t);return}if(!t.selector){console.warn("Userflow.js: INPUT_VALUE condition missing selector",t);return}let u=!1;const a=y[t.operator],f=U(x(t.selector,e.value));if(f.length>0)for(const p of f){const i=F(p);if(a.compare({sessionData:e.value,condition:t,value:i})){u=!0;break}}else a.compare({sessionData:e.value,condition:t,value:""})&&(u=!0);r(u)};n();const s=e.observe(n),{disconnect:o}=R(n,{observeInput:!0});return()=>{s(),o()}}},[w.PAGE]:{track:({sessionData:e,condition:t,callback:r})=>{const n=()=>{let a=!1;if(t.operator){const f=k();a=y[t.operator].compare({sessionData:e.value,condition:t,value:f})}r(a)};let s=k();const o=()=>{const a=k();a!==s&&(s=a,n())};z(o),n();const u=e.observe(n);return()=>{u(),K(o)}}},[w.SEGMENT]:{track:({description:e,callback:t})=>(console.error("Userflow.js: Segment conditions are not supported in "+(e||"unknown content item")+"."),t(!1),()=>{})},[w.CHECKLIST_TASK_CLICKED]:{track:({description:e,callback:t})=>(console.error("Userflow.js: Checklist conditions are not supported in "+(e||"unknown content item")+"."),t(!1),()=>{})},[w.EVENT]:{track:({description:e,callback:t})=>(console.error("Userflow.js: Event conditions are not supported in "+(e||"unknown content item")+"."),t(!1),()=>{})},[w.TIME]:{track:({condition:e,callback:t})=>{let r=null;const n=e.value?new Date(e.value):null,s=e.value2?new Date(e.value2):null,o=()=>{let a=!0;(n&&!isNaN(n.valueOf())&&Date.now()<n.valueOf()||s&&!isNaN(s.valueOf())&&Date.now()>=s.valueOf())&&(a=!1),a!==r&&(r=a,t(a))};o();const u=window.setInterval(o,10*1e3);return()=>{window.clearInterval(u)}}}};function ae(e){switch(e){case g.CLICK:return{kind:"event",eventName:"click",valueWhenOccurred:!0};case g.DISABLED:return{kind:"observer",checkElement:t=>!!t&&t.disabled};case g.MOUSEDOWN:return{kind:"event",eventName:"mousedown",valueWhenOccurred:!0};case g.NOT_CLICK:return{kind:"event",eventName:"click",valueWhenOccurred:!1};case g.NOT_DISABLED:return{kind:"observer",checkElement:t=>!!t&&!t.disabled};case g.NOT_PRESENT:return{kind:"observer",checkElement:t=>!t};case g.PRESENT:return{kind:"observer",checkElement:t=>!!t}}}function le({sessionData:e,condition:t,callback:r},n){const s=()=>{if(!t.elementState){console.warn("Userflow.js: ELEMENT_STATE condition missing elementState",t);return}if(!t.selector){console.warn("Userflow.js: ELEMENT_STATE condition missing selector",t);return}let a=!1;const f=U(x(t.selector,e.value));if(f.length>0){for(const p of f)if(n(p)){a=!0;break}}else n(null)&&(a=!0);r(a)};s();const o=e.observe(s),{disconnect:u}=R(s);return()=>{o(),u()}}function ue({condition:e,flipBackEvents:t,callback:r},n,s){const{selector:o}=e;if(!o)return()=>{};r(!s);const u=p=>{const i=p.target;i&&q(i,o)&&(t?(r(s,{immediate:!0}),r(!s,{immediate:!0})):r(s))},a={capture:!0},f=H(p=>p.addEventListener(n,u,a),p=>p.removeEventListener(n,u,a));return()=>{f()}}const me=Object.freeze(Object.defineProperty({__proto__:null,conditionTypes:C},Symbol.toStringTag,{value:"Module"}));export{J as a,x as b,C as c,me as f,ee as g,L as i,R as o};
|
|
2
2
|
//# sourceMappingURL=flow-condition-types.js.map
|
package/flow-host.styl.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{r as s,R as c}from"./vendor.react.js";import{c as i}from"./userflow.js";import"./vendor.object-assign.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]="46864f96-7756-47a9-814c-81bb2b08e942",e._sentryDebugIdIdentifier="sentry-dbid-46864f96-7756-47a9-814c-81bb2b08e942")}catch{}})();const _=0,E=10,d=100,g=2e3;function u(e){return i.baseZIndex+e}const n=[],I=10;function o(){const e={zIndex:n.length===0?u(d):n[n.length-1].zIndex+I};return n.push(e),e}function a(e){const t=n.indexOf(e);t!==-1&&n.splice(t,1)}function l(){const[e,t]=s.useState(o);s.useEffect(()=>()=>a(e),[e]);const r=s.useCallback(()=>{a(e),t(o())},[e]);return{zIndex:e.zIndex,bringToFront:r}}const p=({children:e})=>{const{zIndex:t}=l();return c.createElement(f.Provider,{value:t},e)},f=c.createContext(void 0);function C(){return s.useContext(f)||u(d)}const w=new URL("flow-host.css",import.meta.url).href;export{E as C,_ as L,g as N,p as S,C as a,w as f,l as u,u as w};
|
|
2
2
|
//# sourceMappingURL=flow-host.styl.js.map
|
package/happy.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{r as l}from"./vendor.react.js";import"./vendor.object-assign.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},c=new Error().stack;c&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[c]="db3e648f-8efc-47fc-8db3-88da6e05ab6c",e._sentryDebugIdIdentifier="sentry-dbid-db3e648f-8efc-47fc-8db3-88da6e05ab6c")}catch{}})();const n=e=>l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 408 408"},e),l.createElement("path",{fill:"#fecb4c",d:"m192.09-.238 2.587-.03C213.467-.438 231.607-.325 250 4l2.46.567C257.718 5.82 262.865 7.315 268 9l2.285.745c26.81 8.918 50.75 23.087 71.508 42.235a147 147 0 0 0 5.894 5.083C351.55 60.358 354.748 64.114 358 68l2.418 2.828c28.185 33.26 47.402 77.233 47.82 121.262l.03 2.587c.17 18.79.057 36.93-4.268 55.323l-.567 2.46c-1.252 5.258-2.748 10.405-4.433 15.54l-.745 2.285c-8.918 26.81-23.087 50.75-42.235 71.508a147 147 0 0 0-5.082 5.894c-3.296 3.862-7.053 7.06-10.938 10.313l-2.828 2.418c-33.26 28.185-77.233 47.402-121.262 47.82l-2.587.03c-18.79.17-36.93.057-55.323-4.268l-2.46-.567c-5.258-1.252-10.405-2.748-15.54-4.433l-2.285-.745c-26.81-8.918-50.75-23.087-71.508-42.235a147 147 0 0 0-5.894-5.082C56.45 347.642 53.253 343.885 50 340l-2.418-2.828C19.397 303.912.18 259.939-.238 215.91l-.03-2.587C-.438 194.533-.325 176.393 4 158l.567-2.46C5.82 150.282 7.315 145.135 9 140l.745-2.285c8.918-26.81 23.087-50.75 42.235-71.508a147 147 0 0 0 5.083-5.894C60.358 56.45 64.114 53.253 68 50l2.828-2.418C104.088 19.397 148.061.18 192.09-.238"}),l.createElement("path",{fill:"#664500",d:"M129.688 239.813C167.74 248.22 207.334 248.945 246 245l2.16-.21c6.404-.646 12.65-1.734 18.95-3.028l3.34-.687a635 635 0 0 0 6.546-1.398c15.429-3.266 15.429-3.266 22.379-.177 4.796 4.568 7.107 10.035 7.385 16.638l-.01 2.175-.008 2.328C306.008 278.754 294.06 295.399 282 308l-1.672 1.863c-14.872 16.013-41.988 29.155-63.82 30.324-3.266.067-6.527.094-9.793.074-2.014-.01-4.027 0-6.041.012-15.61-.03-30.18-2.07-43.674-10.273l-3.25-1.312c-10.371-4.38-18.393-11.623-26.36-19.353a125 125 0 0 0-3.453-3.17C114.832 297.858 109.306 286.328 105 275c-.53-1.085-1.06-2.17-1.605-3.29-1.657-4.407-1.876-7.99-1.832-12.647l-.061-2.303c.005-5.697 1.37-9.983 4.498-14.76 6.716-6.309 15.571-4.103 23.688-2.187"}),l.createElement("path",{fill:"#674600",d:"M280.383 114.617c8.913 3.95 14.106 12.665 17.617 21.383 4.061 11.74 3.651 25.96-1.523 37.234L295 176l-1.352 2.578c-3.814 6.436-9.032 10.114-15.648 13.422-6.602.649-13.14.31-19-3-6.477-5.436-10.059-12.19-13-20l-1.11-2.73c-3.37-12.375-1.556-26.624 4.465-37.782 7.256-11.768 17.024-17.498 31.028-13.87m-136-.001c8.913 3.95 14.106 12.665 17.617 21.383 4.061 11.74 3.651 25.96-1.523 37.234L159 176l-1.352 2.578c-3.814 6.436-9.032 10.114-15.648 13.422-6.602.649-13.14.31-19-3-6.477-5.436-10.059-12.19-13-20l-1.11-2.73c-3.37-12.375-1.556-26.624 4.465-37.782 7.256-11.768 17.024-17.498 31.028-13.87"}));export{n as default};
|
|
2
2
|
//# sourceMappingURL=happy.js.map
|
package/hash.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
677de0671835435f8367a66a811fdffd07a40811
|
package/implicit-tracking.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{i as
|
|
2
|
-
${d}`);m(`Clicked on element ${i}`)}catch(y){console.error("Error parsing autoData",y)}const p={id:R(),page_title:x(document.title),element_tag:n.tagName.toLowerCase(),element_position_x:Math.floor(s),element_position_y:Math.floor(o),element_selector:d,element_selector_version:P,element_width:Math.floor(c),element_height:Math.floor(_)};A===!1&&(p.element_text=this.getElementText(n),
|
|
1
|
+
import{i as a,b as D,c as I,n as x,d as S,f as N}from"./roots.js";import"./vendor.object-assign.js";import{d as m,r as O}from"./userflow.js";import{v as R}from"./vendor.uuid.js";import"./vendor.phoenix.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]="566f60ed-7380-4639-8ac6-3a4994579812",e._sentryDebugIdIdentifier="sentry-dbid-566f60ed-7380-4639-8ac6-3a4994579812")}catch{}})();const P=1;function G(e){return e.target?.shadowRoot?e.composedPath()[0]||null:e.target||null}function C(e){const t={version:"v1",minorVersion:0,notextGroups:[],textGroups:[]};for(;e.length>0;){const r=b(e,[1,3,4]);e=r[2];const[n,i]=r;switch(n){case 1:t.version=i;break;case 2:t.minorVersion=i;break;case 3:t.notextGroups.push(E(i));break;case 4:t.textGroups.push(E(i));break}}return t}function j(e){const{textGroups:t,notextGroups:r,version:n,minorVersion:i}=e;return[u(1,n),u(2,i||0),g(3,r,v),g(4,t,v)].join("")}function M(e){const t={css:"",offset:0};for(;e.length>0;){const r=b(e,[1]);e=r[2];const[n,i]=r;switch(n){case 1:t.css=i;break;case 2:t.offset=i;break}}return t}function V(e){return[u(1,e.css),u(2,e.offset)].join("")}function E(e){const t={cardinality:0,cssSelectors:[]};for(;e.length>0;){const r=b(e,[2]);e=r[2];const[n,i]=r;switch(n){case 1:t.cardinality=i;break;case 2:t.cssSelectors.push(M(i));break}}return t}function v(e){return[u(1,e.cardinality),g(2,e.cssSelectors,V)].join("")}function g(e,t,r){return t.map(n=>u(e,r(n))).join("")}function u(e,t){return typeof t=="string"?[l(e),l(B(t)),t].join(""):[l(e),l(t)].join("")}function b(e,t){const[r,n]=h(e);if(t.indexOf(r)!==-1){const[i,s]=h(n),o=T(s,0,i);return[r,o,T(s,i)]}else{const[i,s]=h(n);return[r,i,s]}}const w="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/";function l(e){if(e===0)return w[0];let t="";for(;e>0;){let r=e&31;e>>=5,e>0&&(r|=32),t=t+w[r]}return t}function h(e){let t=0,r=0;for(;r<e.length;r++){let n=w.indexOf(e[r]);if(n===-1)throw new Error(`Invalid base64 character: ${e[r]}`);let i=(n&32)===0;if(n&=31,t+=n*Math.pow(32,r),i)break}return[t,e.slice(r+1)]}function B(e){return new Blob([e]).size}function k(e){if(e<128)return 1;if(e<2048)return 2;if(55296<=e&&e<=56319)return 4;if(56320<=e&&e<=57343)return 0;if(e<65536)return 3;throw new Error(`Invalid char code ${e}`)}function T(e,t,r){let n=0,i=0;for(;i<t;){const c=k(e.charCodeAt(n));i+=c,n++,c==4&&i==t&&n++}let s="",o=0;for(;r===void 0?n<e.length:o<r;){const c=k(e.charCodeAt(n));o+=c,s+=e[n],n++,c==4&&r!==void 0&&o==r&&(s+=e[n])}return s}const U=["a","button","input"],z=["submit","reset","button"];class X{constructor(t){this.clickListener=async r=>{let n=G(r);if(!n)return;a(n,"svg")===!0&&n.parentElement&&a(n.parentElement,"button")&&(n=n.parentElement);const i=n.tagName.toLowerCase();if(U.includes(i)===!1||a(n,"input")&&z.includes(n.type)===!1)return;const{xaxis:s,yaxis:o,width:c,height:_}=this.computeElementPosition(n),A=this.isSensitiveElement(n),f=D(n);if(!f||!f?.selector?.autoData)return;const d=j(JSON.parse(f.selector.autoData)),L=JSON.stringify(C(d));try{if(N({type:O.AUTO,autoData:L})?.length===0)throw new Error(`Failed in finding the element back from selector
|
|
2
|
+
${d}`);m(`Clicked on element ${i}`)}catch(y){console.error("Error parsing autoData",y)}const p={id:R(),page_title:x(document.title),element_tag:n.tagName.toLowerCase(),element_position_x:Math.floor(s),element_position_y:Math.floor(o),element_selector:d,element_selector_version:P,element_width:Math.floor(c),element_height:Math.floor(_)};A===!1&&(p.element_text=this.getElementText(n),a(n,"a")&&(p.element_href=n.href)),this.ufClient.trackRawEvent({name:"clicked",attributes:p})},this.ufClient=t}start(){m("implicit tracking started"),document.addEventListener("click",this.clickListener,{capture:!0})}stop(){m("implicit tracking stopped"),document.removeEventListener("click",this.clickListener,{capture:!0})}isSensitiveElement(t){if(t.getAttribute("contenteditable")==="true")return!0;const r=t.name||t.id||"";return!!/\b(?:cc|cardnum|ccnum|credit(card)?|csc|cvc|cvv|exp(iry|date)?|pass(word)?|pwd|pin|routing|sec(urity|code|num)?|social(sec(urity)?)?|ssn|socsec)\b/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}getElementText(t){if(I(t)){const n=t.getAttribute("placeholder");return n?x(n):void 0}return S(t)}computeElementPosition(t){const r=window.getComputedStyle(t)?.position,n=["fixed","sticky"].includes(r),i=t.getBoundingClientRect(),s=n?i.x:window.screenX+i.x,o=n?i.y:window.screenY+i.y;return{xaxis:s,yaxis:o,width:i.width,height:i.height}}}export{X as ImplicitTracking};
|
|
3
3
|
//# sourceMappingURL=implicit-tracking.js.map
|
package/neutral.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as c}from"./vendor.react.js";import"./vendor.
|
|
1
|
+
import{r as c}from"./vendor.react.js";import"./vendor.object-assign.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},l=new Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="b197e71a-ac07-4545-8699-10fd8163ebbc",e._sentryDebugIdIdentifier="sentry-dbid-b197e71a-ac07-4545-8699-10fd8163ebbc")}catch{}})();const r=e=>c.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 408 408"},e),c.createElement("path",{fill:"#fecb4c",d:"m192.09-.238 2.587-.03C213.467-.438 231.607-.325 250 4l2.46.567C257.718 5.82 262.865 7.315 268 9l2.285.745c26.81 8.918 50.75 23.087 71.508 42.235a147 147 0 0 0 5.894 5.083C351.55 60.358 354.748 64.114 358 68l2.418 2.828c28.185 33.26 47.402 77.233 47.82 121.262l.03 2.587c.17 18.79.057 36.93-4.268 55.323l-.567 2.46c-1.252 5.258-2.748 10.405-4.433 15.54l-.745 2.285c-8.918 26.81-23.087 50.75-42.235 71.508a147 147 0 0 0-5.082 5.894c-3.296 3.862-7.053 7.06-10.938 10.313l-2.828 2.418c-33.26 28.185-77.233 47.402-121.262 47.82l-2.587.03c-18.79.17-36.93.057-55.323-4.268l-2.46-.567c-5.258-1.252-10.405-2.748-15.54-4.433l-2.285-.745c-26.81-8.918-50.75-23.087-71.508-42.235a147 147 0 0 0-5.894-5.082C56.45 347.642 53.253 343.885 50 340l-2.418-2.828C19.397 303.912.18 259.939-.238 215.91l-.03-2.587C-.438 194.533-.325 176.393 4 158l.567-2.46C5.82 150.282 7.315 145.135 9 140l.745-2.285c8.918-26.81 23.087-50.75 42.235-71.508a147 147 0 0 0 5.083-5.894C60.358 56.45 64.114 53.253 68 50l2.828-2.418C104.088 19.397 148.061.18 192.09-.238"}),c.createElement("path",{fill:"#684701",d:"M136.862 271.271q2.428-.005 4.855-.017c4.383-.015 8.764.008 13.146.039 4.59.026 9.18.02 13.77.02 7.706.003 15.41.029 23.116.07 8.906.047 17.812.063 26.719.06 9.488-.002 18.976.02 28.464.047q4.098.008 8.196.01 6.439.004 12.878.05 2.363.014 4.725.012c2.15-.002 4.3.015 6.45.037l3.646.015c4.203.511 6.677 2.224 9.954 4.769 2.14 2.84 1.742 5.74 1.637 9.172-.646 3.777-2.36 5.27-5.418 7.445-3.994 1.96-7.245 2.253-11.673 2.26l-1.992.012c-2.196.01-4.391.007-6.587.003l-4.731.015c-4.28.014-8.558.014-12.837.012q-5.36 0-10.72.008-12.648.016-25.294.006c-8.695-.006-17.39.006-26.085.027q-11.203.026-22.406.02c-4.459-.001-8.918.001-13.377.015q-6.29.019-12.58-.002-2.306-.004-4.613.009c-2.102.01-4.203.002-6.305-.01h-3.561c-4.505-.521-7.897-2-11.075-5.258-1.36-2.474-1.692-4.176-1.789-6.992l-.164-2.492c1.044-3.482 2.493-5.052 5.286-7.341 5.56-2.87 12.245-2.091 18.365-2.02"}),c.createElement("path",{fill:"#674600",d:"M280.383 114.617c8.913 3.95 14.106 12.665 17.617 21.383 4.061 11.74 3.651 25.96-1.523 37.234L295 176l-1.352 2.578c-3.814 6.436-9.032 10.114-15.648 13.422-6.602.649-13.14.31-19-3-6.477-5.436-10.059-12.19-13-20l-1.11-2.73c-3.37-12.375-1.556-26.624 4.465-37.782 7.256-11.768 17.024-17.498 31.028-13.87m-136-.001c8.913 3.95 14.106 12.665 17.617 21.383 4.061 11.74 3.651 25.96-1.523 37.234L159 176l-1.352 2.578c-3.814 6.436-9.032 10.114-15.648 13.422-6.602.649-13.14.31-19-3-6.477-5.436-10.059-12.19-13-20l-1.11-2.73c-3.37-12.375-1.556-26.624 4.465-37.782 7.256-11.768 17.024-17.498 31.028-13.87"}));export{r as default};
|
|
2
2
|
//# sourceMappingURL=neutral.js.map
|
package/package.json
CHANGED
package/react-hooks.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./vendor.lodash.js";import{r as t}from"./vendor.react.js";import"./vendor.
|
|
1
|
+
import"./vendor.lodash.js";import{r as t}from"./vendor.react.js";import"./vendor.object-assign.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="dbee557a-d7ce-48a6-aac0-66b4afc065f1",n._sentryDebugIdIdentifier="sentry-dbid-dbee557a-d7ce-48a6-aac0-66b4afc065f1")}catch{}})();function v(){const[n,e]=t.useState(!1),r=t.useRef(null),s=t.useCallback(()=>e(!0),[]),a=t.useCallback(()=>e(!1),[]),c=t.useCallback(()=>e(!0),[]),o=t.useCallback(()=>e(!1),[]);return{ref:r,hovered:n,eventHandlers:{onPointerEnter:s,onPointerLeave:a,onFocus:c,onBlur:o}}}function w(n,{once:e,rootMargin:r,disabled:s}={}){const[a,c]=t.useState(!1);return t.useEffect(()=>{if(s)return;const o=n.current;if(!o)return;const u=new IntersectionObserver(i=>{i.forEach(d=>{const f=d.isIntersecting;c(f),e&&f&&l()})},{root:null,rootMargin:r,threshold:0});u.observe(o);const l=()=>{u.disconnect()};return l},[n,e,r,s]),a}export{v as a,w as u};
|
|
2
2
|
//# sourceMappingURL=react-hooks.js.map
|
package/roots.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as l,K as R,ag as ne,m as ue,F as z,ah as Le}from"./userflow.js";import"./vendor.core-js.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]="60b5b541-f27b-4d4f-856a-cdfc7760a414",e._sentryDebugIdIdentifier="sentry-dbid-60b5b541-f27b-4d4f-856a-cdfc7760a414")}catch{}})();class Ie extends Error{constructor(t,o){const n=`Unreachable case: ${t}`;o?o=`${o} (${n})`:o=n,super(o)}}function yt(e){return typeof e=="object"&&e!=null}let fe=window.MutationObserver;const N=window;if(N.Zone&&typeof N.Zone.__symbol__=="function"){const e=N.Zone.__symbol__("MutationObserver");e&&typeof e=="string"&&N.hasOwnProperty(e)&&typeof N[e]=="function"&&(fe=N[e])}function de(e,t){const o=e.left,n=e.top,r=o+e.width,i=n+e.height,c=t.left,s=t.top,f=c+t.width,u=s+t.height;return Ne(o,n,r,i,c,s,f,u)}function Ne(e,t,o,n,r,i,c,s){const f=c<e,u=o<r,d=s<t,a=n<i;return a&&f?$(e,n,c,i):f&&d?$(e,t,c,s):d&&u?$(o,t,r,s):u&&a?$(o,n,r,i):f?e-c:u?r-o:d?t-s:a?i-n:0}function $(e,t,o,n){return Math.sqrt(Math.pow(o-e,2)+Math.pow(n-t,2))}function D(e){window.performance.mark&&window.performance.mark(e)}function X(e,t,o){window.performance.measure&&window.performance.measure(e,t,o)}function Re(){const e=window.getComputedStyle(window.document.body);if(e.zoom&&e.zoom!=="1"){const t=parseFloat(e.zoom);if(!isNaN(t))return t}return 1}function Et(e){return De(),_e(e)}let B;function _e(e){return B==null&&(B=Re()),B==1?e:e/B}function De(){B=null}function bt(){return(document.compatMode=="BackCompat"?document.body:document.documentElement).clientWidth||window.innerWidth}function Fe(){return(document.compatMode=="BackCompat"?document.body:document.documentElement).clientHeight||window.innerHeight}function St(e){return e?parseFloat(e.replace(/px$/,"")):0}function Tt(e){return e==null?void 0:e+"px"}function At(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}const Ve=50,ke=100,oe=25,Be=new Set(["left","start","justify","justify-all"]);class Oe{constructor(t){this.ctx=t,this.rectCache=new Map,this.isLabelLikeCache=new Map,this.hasPlaceholderCache=new Map}calcScore(t,o){const n=this.getRect(t),r=this.getRect(o),i=this.distBetween(t,o),c=K(o)?ke:Ve;if(i>c)return 0;const s=this.isLabelLike(t),f=this.isCloserToOtherInput(t,o),u=window.getComputedStyle(t).textAlign||"",d=n.top+n.height<=r.top,a=Math.abs(n.left-r.left)<oe&&(!u||Be.has(u)),h=n.left+n.width<=r.left,T=Math.abs(n.top-r.top)<oe,b=d&&a||h&&T,y=n.height>=Fe()/2,E=be(o);if(E&&n.top>=r.top+r.height)return 0;let m=1;const S=t.htmlFor;return S&&S===o.id&&(m+=Math.pow(1e3,4)),E&&!y&&!f&&(s&&b?m+=Math.pow(1e3,3):o===t&&this.hasPlaceholder(o)?m+=Math.pow(1e3,2):!s&&b&&(m+=Math.pow(1e3,1))),m+=c-i,m}getRect(t){let o=this.rectCache.get(t);return o||(o=v(t),this.rectCache.set(t,o)),o}isLabelLike(t){let o=this.isLabelLikeCache.get(t);if(o===void 0){const n="a, button, h1, h2, h3, h4, h5, h6, input";o=!t.closest(n)&&!t.querySelector(n),this.isLabelLikeCache.set(t,o)}return o}hasPlaceholder(t){let o=this.hasPlaceholderCache.get(t);return o===void 0&&(o=!!O(t),this.hasPlaceholderCache.set(t,o)),o}getAllInputs(){return this.allInputs||(this.allInputs=Array.from(document.querySelectorAll(ge())).filter(t=>ee(t,this.ctx))),this.allInputs}distBetween(t,o){return Math.round(de(this.getRect(t),this.getRect(o)))}isCloserToOtherInput(t,o){let n=this.distBetween(t,o);for(let r of this.getAllInputs()){if(r===o)continue;if(this.distBetween(t,r)<n)return!0}return!1}}function Pe(e,t={}){const o=performance.now();D("userflow:inferSelector:start"),l.groupCollapsed("inferSelector for",e,t);let n;try{n=Ue(e,t)}catch(r){console.error("Userflow findElement error:",r),n=null}return l("time",performance.now()-o),l.groupEnd(),D("userflow:inferSelector:end"),X("userflow:inferSelector","userflow:inferSelector:start","userflow:inferSelector:end"),n}function he(e){const t=[],o=e.tagName.toLowerCase();return R.inferenceAttributeNames.forEach(n=>{const r=e.getAttribute(n);if(!r)return;const i=R.inferenceAttributeFilters[n];if(!(i&&!ne(i,r)))if(n==="id")t.push(`#${r}`);else{const c=n==="name"||n==="placeholder"?o:"";t.push(`${c}[${n}="${r}"]`)}}),e.classList.forEach(n=>{ne(R.inferenceClassNameFilters,n)&&(n=n.replace(/:/g,"\\:").trim(),t.push(`.${n}`))}),t}const $e=window.userflow||{};$e.__inferSelector=Pe;function Ue(e,{elementType:t}={}){const o={minorVersion:Ge};let n=be(e);const r=ot(e);if(t===ue.INPUT&&!n)if(r)e=r,n=!0,l("use custom input parent",r);else return l("not an input"),null;else r&&(e=r,n=!0);const i=qe(e);let c=null;n||(c=we(e),c&&c.length>250&&(c=null)),l("text is:"+c);let s=new Map,f=new Map;const u=new Map,d=new G(i,null,o),a=new G(i,c,o),h=(y,E,m,S,g)=>{if(S<0)return;let p=y.get(E);p||(p=[],y.set(E,p)),p.push({css:m,offset:S,complexity:g}),l(`use css=${m}, cardinality=${E}, offset=${S}`)},T=He(e),b=[e.tagName.toLowerCase(),...he(e)];l("shadowRootSelectors:",i),l("ancestorCssSelectors:",T),l("ownCssSelectors:",b);for(const y of b)for(const E of T){const m=E?`${E} ${y}`:y,S=E?2:1,g=d.query(m),p=Array.from(g),w=p.length;if(w>100){l(`cardinality too high css=${m}, cardinality=${w}`);continue}u.set(m,w);const A=p.indexOf(e);if(h(s,w,m,A,S),c){const k=a.query(m),I=Array.from(k),Ce=I.indexOf(e),Me=I.length;h(f,Me,m,Ce,S)}}if(s.size>0||f.size>0){const y=S=>Array.from(S.entries()).map(([g,p])=>({cardinality:g,cssSelectors:p.sort((w,A)=>{const k=u.get(w.css),I=u.get(A.css);return k!==I?k?I?k-I:-1:1:w.complexity!==A.complexity?A.complexity-w.complexity:w.css.localeCompare(A.css)}).map(({css:w,offset:A})=>({css:w,offset:A}))})).sort((g,p)=>g.cardinality-p.cardinality),E={version:"v1",minorVersion:o.minorVersion,shadowRootSelectors:i,notextGroups:y(s),textGroups:y(f)},m={el:e,selector:{type:z.AUTO,autoData:JSON.stringify(E),text:c,elementType:t}};return l("inference result",m),m}return l("no selector inferred "),null}function qe(e){let t=[],o=e;for(;o;){let n=o.getRootNode();if(F(n)){const{host:i}=n;t.unshift(i.tagName.toLowerCase()),o=i;continue}const r=q(o);if(r){let i=r.tagName.toLowerCase();const c=r.getAttribute("name");c?i+=`[name="${c}"]`:r.id&&!r.id.match(/\d$/)&&(i+="#"+r.id),t.unshift(i),o=r;continue}break}if(t.length!==0)return t}function He(e){const t=new Map;t.set(null,0);let o=e.parentNode;for(;o&&C(o)&&!(o.tagName==="BODY"||F(o));){for(const r of he(o)){if(t.has(r))continue;const i=U(document.documentElement,r);if(i){const c=i.length;t.set(r,c)}}o=o.parentNode}return Array.from(t.entries()).sort(([,r],[,i])=>r-i).slice(0,20).map(([r])=>r)}function je(e,t){const{text:o,excludeText:n,precision:r}=e,i={minorVersion:t.minorVersion||0},c=o!=null&&!n,s=c?t.textGroups:t.notextGroups,f=Math.max(1,Math.min(s.length,Math.ceil((1-parseFloat(r||"1"))*s.length))),u=new G(t.shadowRootSelectors,c&&o||null,i);l("findElementAutoV1",{text:o,excludeText:n,precision:r,groups:s,groupCount:f});for(let d=0;d<f;d++){const a=s[d];let h=new Map,T=0,b=null;l.group(`group cardinality=${a.cardinality}`,a);try{for(let y=0;y<a.cssSelectors.length;y++){const{css:E,offset:m}=a.cssSelectors[y];l(`css=${E}, offset=${m}`);let S=u.query(E),g=null;for(let w=0;w<=m;w++){const A=S.next();if(A.done)break;g=A.value}if(!g)continue;const p=(h.get(g)||0)+1;if(h.set(g,p),l(`el with frequency=${p}`+(p>T&&g!==b?" NEW BEST":""),g),p>T&&(T=p,b=g,p>=Math.ceil(a.cssSelectors.length/2)))return l("early winner",b),b}}finally{l.groupEnd()}if(b)return l("winner",b),b}return l("element not found"),null}class G{constructor(t,o,n){this.shadowRootSelectors=t,this.text=o,this.ctx=n,this.isVisibleCache=new Map,this.textCache=new Map}*query(t){const o=U(document.documentElement,t,this.shadowRootSelectors);if(l("found",o),!o)return;const{text:n}=this;for(let r=0;r<o.length;r++){const i=o[r];if(n){let s=this.textCache.get(i);if(s==null&&(s=j(i,n),this.textCache.set(i,s)),!s){l("skip, text mismatch",i);continue}}let c=this.isVisibleCache.get(i);if(c==null&&(c=ee(i,this.ctx),this.isVisibleCache.set(i,c)),!c){l("skip, not visible",i);continue}l("yield",i),yield i}}}const Ge=5,P=window.userflow||{};function Z(e){const t=performance.now();D("userflow:findAllElements:start"),l.groupCollapsed("findAllElements",e);let o;try{if(e.type===z.MANUAL)o=Ye(e);else if(e.autoData){const n=JSON.parse(e.autoData);let r;if(n.version==="v1")r=je(e,n);else throw new Ie(n.version,"Unknown autoData version: "+n.version);o=r?[r]:[]}else o=[]}catch(n){console.error("Userflow findElement error:",n),o=[]}return l("time",performance.now()-t),l.groupEnd(),D("userflow:findAllElements:end"),X("userflow:findAllElements","userflow:findAllElements:start","userflow:findAllElements:end"),o}function Ye(e){const t={minorVersion:e.minorVersion==null?1:e.minorVersion};let{css:o,text:n,elementType:r,offset:i}=e;n=n&&_(n);const c="nearSelector"in e?e.nearSelector:null;l("findAllElementsManual",e),i!=null&&c!=null&&console.warn("Userflow.js: Both selector.offset and selector.nearSelector was set; ignoring nearSelector.");let s;if(n&&!o){if(s=[],t.minorVersion>=2)for(const f of ie())Y(f,n,s);else Y(document.body,n,s);l("els after traverseElementForText",s)}else if(o){if(t.minorVersion>=2){s=[];for(const f of ie()){const u=U(f,o);u&&u.length>0&&s.push(...u)}}else s=Array.from(U(document.body,o)||[]);l("els after safeQueryAll",s),n&&(s=Xe(s,n),l("els after filterElementsByText",s))}else console.warn("Userflow.js: findAllElements() requires least one of `css` and `text` to be set."),s=[];if(s.length>0&&(s=s.filter(f=>ee(f,t)),l("els after isVisible",s)),s.length>0&&r===ue.INPUT&&(s=tt(s,t),l("els after mapElementsToInputs",s)),s.length>0&&(s.sort((f,u)=>{const d=v(f),a=v(u);return d.top<a.top?-1:d.top>a.top?1:d.left-a.left}),l("els after sort",s)),s.length>0){if(i!=null)s=s[i]?[s[i]]:[],l("els after offset",s);else if(c!=null){const f=Z(c);let u=null,d=0;for(const a of s)for(const h of f){const T=de(v(a),v(h));(!u||T<d)&&(u=a,d=T)}s=u?[u]:[],l("els after nearSelector",s)}}return s}function me(e){return Z(e)[0]||null}function We(e,t){const o=performance.now();D("userflow:elementMatchesSelector:start"),l.groupCollapsed("elementMatchesSelector",e,t);let n;try{if(t.type===z.MANUAL)n=ze(e,t);else{const r=me(t);n=r!=null&&r.contains(e)}}catch(r){console.error("Userflow findElement error:",r),n=!1}return l(n?"match":"not match"),l("time",performance.now()-o),l.groupEnd(),D("userflow:elementMatchesSelector:end"),X("userflow:elementMatchesSelector","userflow:elementMatchesSelector:start","userflow:elementMatchesSelector:end"),n}function ze(e,t){t.offset!=null&&console.warn("Userflow.js: selector.offset is not supported for elementMatchesSelector yet"),"nearSelector"in t&&t.nearSelector!=null&&console.warn("Userflow.js: selector.nearSelector is not supported for elementMatchesSelector yet");let{css:o,text:n}=t;n=n&&_(n);let r=!1,i=e;for(;i&&i.tagName!=="BODY";){if((!o||i.matches(o))&&(!n||j(i,n))){r=!0;break}i=i.parentElement}return r}function Y(e,t,o){if(C(e)){const{tagName:r}=e;if(r==="SCRIPT"||r==="STYLE")return!1}let n=!1;for(let r=0;r<e.children.length;r++)Y(e.children[r],t,o)&&(n=!0);return!n&&C(e)&&j(e,t)&&(o.push(e),n=!0),n}function U(e,t,o){try{return o==null?e.querySelectorAll(t):pe(t,o,0,e)}catch{return console.info("Userflow.js: Invalid CSS selector: ",t),null}}function pe(e,t,o,n){if(o>=t.length)return Array.from(n.querySelectorAll(e));const r=t[o],i=n.querySelectorAll(r),c=[];return i.forEach(s=>{let f;if(s.shadowRoot)f=s.shadowRoot;else{if(!Te(s))return;let u=null;try{u=s.contentDocument}catch{}if(!u)return;f=u.body}c.push(...pe(e,t,o+1,f))}),c}function Xe(e,t){const o=[];for(let n=e.length-1;n>=0;n--){const r=e[n];o.some(i=>i.contains(r))||j(r,t)&&o.push(r)}return o.reverse()}const Ze={email:!0,number:!0,password:!0,search:!0,tel:!0,text:!0,url:!0},Qe={date:!0,"datetime-local":!0,month:!0,time:!0,week:!0},Je={button:!0,email:!0,reset:!0,search:!0,submit:!0,tel:!0,text:!0,url:!0};function we(e){let t=e.innerText;return t===void 0&&e.tagName!=="SELECT"&&(t=e.textContent),t=_(t),t||null}function O(e){if(ye(e)||Q(e)){const t=_(e.getAttribute("placeholder")),o=e.value||"";if(t&&!o)return t;const n=_(o);if(n&&rt(e))return n}if(J(e)&&e.selectedIndex>=0){const t=_(e.options[e.selectedIndex].text);if(t)return t}return we(e)}function j(e,t){const o=O(e);return o?Ke(t,o):!1}function Ke(e,t){const o=e.toLowerCase();return t.toLowerCase()===o}function _(e){return!e||e.length>250?null:e.replace(/^[\s\uFEFF\xA0\u200B*]+|[\s\uFEFF\xA0\u200B*]+$/g,"").replace(/\s+/g," ")}function et(e){for(const{cssSelector:t,getValue:o}of R.customInputs)if(e.matches(t))if(o)try{return(o(e)||"").trim()}catch(n){return console.error(`Userflow.js: getValue function for custom input '${t}' failed:`,n),""}else return O(e)||"";return J(e)?e.selectedIndex==-1?"":e.options[e.selectedIndex].text:K(e)?O(e)||"":e.value}function ge(){return"input, select, textarea, [contenteditable]"+R.customInputs.map(({cssSelector:e})=>`, ${e}`).join("")}function tt(e,t){const o=new Set,n=new Oe(t),r=ge();for(const i of e){if(i.matches(r)){o.add(i);continue}let c=null,s=null;n.getAllInputs().forEach(f=>{const u=n.calcScore(i,f);l("input",u,f),u!==0&&(c&&s&&u<=s||(l("input is best so far"),c=f,s=u))}),c&&(l("best input was",c),o.add(c))}return Array.from(o)}function ye(e){if(e.tagName!=="INPUT")return!1;const t=e.getAttribute("type");return t==null?!0:Ze[(t||"").toLowerCase()]===!0}function Q(e){return e.tagName==="TEXTAREA"}function nt(e){if(e.tagName!=="INPUT")return!1;const t=(e.getAttribute("type")||"").toLowerCase();return Qe[t]===!0}function J(e){return e.tagName==="SELECT"}function K(e){return"hasAttribute"in e&&e.hasAttribute("contenteditable")}function Ee(e){return!!(K(e)||R.customInputs.some(({cssSelector:t})=>e.matches(t)))}function ot(e){let t=e.parentNode;for(;t&&C(t)&&!(t.tagName==="BODY"||F(t));){if(Ee(t))return t;t=t.parentNode}return null}function be(e){return ye(e)||nt(e)||Q(e)||J(e)||Ee(e)}function rt(e){if(Q(e))return!0;const t=(e.getAttribute("type")||"").toLowerCase();return Je[t]}function ee(e,t){const o=v(e);let n=e,r=!0,i=!1,c=!1,s=!1,f=!1;for(;n;){const u=n===document.body,d=n.tagName==="BODY",a=window.getComputedStyle(n);let h=null;if(r){if(a.visibility&&a.visibility!=="visible")return l("not visible because visibility is",a.visibility,e,{cur:n}),!1;r=!1}if(a.display==="none")return l("not visible because display is",a.display,e,{cur:n}),!1;if(a.opacity!=null&&parseFloat(a.opacity)<.01)return l("not visible because opacity is",a.opacity,e,{cur:n}),!1;if(a.position==="absolute"?s=!0:(a.position==="relative"||a.position==="fixed"||a.position==="sticky")&&(s=!1),t.minorVersion>=4&&!i&&!d&&!(f&&a.position==="static")&&(M(a.overflowX)||M(a.overflowY))&&(h=h||v(n),h.width===0||h.height===0))return l("not visible because width/height (v1.4 check) is",h.width,h.height,e,{cur:n}),!1;if(!c&&Se(a.display)&&(t.minorVersion<1||d||a.position!=="static")){const T=d||M(a.overflow),b=T||M(a.overflowX),y=T||M(a.overflowY),{scrollLeft:E,scrollTop:m}=d?n.ownerDocument.documentElement:n,S=!d&&!s;if(b){if(h=h||v(n),S&&h.width===0)return l("not visible because width is",h.width,e,{cur:n}),!1;const g=t.minorVersion>=5?o.width/2:0,p=Math.round(o.left+g),w=Math.round(h.left-E);if(p<w)return l("not visible because it's clipped left",e,{elX:p,curLeft:w,cur:n}),!1}if(y){if(h=h||v(n),S&&h.height===0)return l("not visible because height is",h.height,e,{cur:n}),!1;const g=t.minorVersion>=5?o.height/2:0,p=Math.round(o.top+g),w=Math.round(h.top-m);if(p<w)return l("not visible because it's clipped top",e,{elY:p,curTop:w,cur:n}),!1}(b||y)&&(c=!0)}if(a.position==="fixed"&&(i=!0,c=!0),t.minorVersion>=3&&(n.scrollTop>0||n.scrollLeft>0)&&(c=!0),u)break;d?(n=q(n),r=!0):n=n.parentElement,f=s}return!0}function M(e){return e==="hidden"||e==="clip"||e==="scroll"||e==="auto"}function Se(e){return!e||!e.includes("inline")&&e!=="contents"}function vt(e){let t=e.parentNode,o=!1;for(;t&&t.tagName!=="BODY";){F(t)&&(t=t.host);const n=window.getComputedStyle(t);if(n.position==="absolute"?o=!0:(n.position==="relative"||n.position==="fixed"||n.position==="sticky")&&(o=!1),!o&&Se(n.display)&&(M(n.overflow)||M(n.overflowY)))return t;if(n.position==="fixed")return e.ownerDocument.documentElement;t=t.parentNode}return e.ownerDocument.documentElement}function v(e){if(e.tagName==="HTML"){const n=q(e);if(n)return v(n)}let t=e.getBoundingClientRect(),o=e;for(;o&&(o=q(o),!!o);){const n=o.getBoundingClientRect();t={width:t.width,height:t.height,left:t.left+n.left,right:t.right+n.left,top:t.top+n.top,bottom:t.bottom+n.top}}return t}const re=new WeakSet;function q(e){const t=e.ownerDocument?.defaultView;if(!t||re.has(t))return null;{const o=t.frameElement;return o||re.add(t),o}}function F(e){return typeof e=="object"&&e!=null&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e&&"mode"in e}function C(e){return typeof e=="object"&&e!=null&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Te(e){return C(e)&&e.tagName==="IFRAME"}function xt(e){let t=e;for(;t;)if(C(t)){if(t.hasAttribute("popover")&&t.matches(":popover-open"))return t;t=t.parentNode}else if(F(t))t=t.host;else break;return null}const st=e=>{if(!e)return null;const t=e.className;if(t==null)return null;if(typeof t=="string")return t;if(typeof t=="object"&&"baseVal"in t)return t.baseVal||null;try{return String(t)}catch{return null}},Ct=e=>{const t=e.getBoundingClientRect();return`${e.tagName}-${e.id||""}-${st(e)||""}-${Math.round(t.left)}-${Math.round(t.top)}`},it=e=>{e instanceof HTMLElement&&e.hasAttribute("popover")===!1&&typeof e.showPopover=="function"&&(e.setAttribute("popover","manual"),e.showPopover(),e.style.border="none",e.style.padding="0",e.style.margin="0",e.style.overflow="visible")},se=e=>{e instanceof HTMLElement&&e.hasAttribute("popover")&&typeof e.hidePopover=="function"&&(e.hidePopover(),e.removeAttribute("popover"),e.style.border="",e.style.padding="",e.style.margin="",e.style.overflow="")},Mt=(e,t)=>!(e instanceof HTMLElement)||typeof e.showPopover!="function"?()=>{}:(e.hasAttribute("popover")||(e.setAttribute("popover","manual"),e.showPopover(),e.style.border="none",e.style.padding="0",e.style.margin="0",e.style.overflow="visible",e.style.width="100vw",e.style.height="100vh"),it(t),t instanceof HTMLElement&&(t.style.background="none"),()=>lt(e,t)),lt=(e,t)=>{se(e),e instanceof HTMLElement&&(e.style.width="",e.style.height=""),se(t),t instanceof HTMLElement&&(t.style.background="")};P.__findElement=me;P.__findAllElements=Z;P.__elementMatchesSelector=We;P.__getElementText=O;P.__getInputValue=et;const x=new Set,W=new Map,H=new Set;function ie(){return Ae(),x}function Lt(e,t){Ae();for(const n of x)e(n);const o={setup:e,teardown:t};return H.add(o),()=>{H.delete(o);for(const n of x)t(n)}}let le=!1,L=null;function Ae(){if(ce(),!le){l("roots started"),le=!0,L=document.body,V(L),at();for(const e of Le)document.addEventListener(e,ct);window.setInterval(ce,10*1e3)}}function ct(){L&&!document.contains(L)&&(l("roots detected new Turbo body"),te(L),L=document.body,V(L))}function at(){for(const e of document.documentElement.children)e!==document.body&&e.shadowRoot&&V(e.shadowRoot)}function ce(){for(const e of x)F(e)&&(ut(e)||(l("roots clean before removeRoot",e),te(e)));l("roots clean finished, remaining=",x.size)}function ut(e){return e.ownerDocument.defaultView?e.host.isConnected:!1}function V(e){if(!x.has(e)){l("roots addRoot",e),x.add(e),ft(e),ve(e),mt(e),pt(e);for(const{setup:t}of H)t(e)}}function te(e){if(x.has(e)){l("roots removeRoot",e),W.get(e)?.disconnect(),W.delete(e),x.delete(e);for(const{teardown:t}of H)t(e)}}function ft(e){let t;const o=()=>{ve(e)},n=new fe(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(o)});n.observe(e,{childList:!0,subtree:!0}),W.set(e,n)}function ve(e){const t=C(e)?e.ownerDocument.getElementsByTagName("iframe"):e.querySelectorAll("iframe");for(const o of t)xe(o)}const ae=new WeakSet;function xe(e){if(ae.has(e)||e.closest("#userflow-ui"))return;e.addEventListener("load",dt);const t=e.contentWindow,o=e.contentDocument;if(!t||!o){ae.add(e);return}const n=o.body;n&&(t.addEventListener("pagehide",ht),l("roots setupFrame before addRoot",e,o,n),V(n))}function dt(e){const t=e.target;t&&Te(t)&&xe(t)}function ht(e){const t=e.currentTarget.document.body;l("roots onFrameUnload before removeRoot",t),te(t)}function mt(e){const t=e.ownerDocument.defaultView;if(t.__userflowAttachShadowInstalled)return;t.__userflowAttachShadowInstalled=!0;const o=t.Element.prototype.attachShadow;o!=null&&(t.Element.prototype.attachShadow=function(n){const r=o.call(this,n);return this.shadowRoot&&(l("roots monitorShadowDom before addRoot",this,this.shadowRoot),V(this.shadowRoot)),r})}function pt(e){const t=o=>{o.childNodes.forEach(n=>{C(n)&&n.shadowRoot&&(l("roots queryShadowDom before addRoot",n,n.shadowRoot),V(n.shadowRoot)),t(n)})};t(e)}export{vt as A,se as B,We as C,fe as M,Ie as U,Pe as a,be as b,yt as c,Tt as d,bt as e,Z as f,we as g,Fe as h,At as i,_e as j,F as k,C as l,q as m,_ as n,Lt as o,it as p,De as q,v as r,St as s,Ct as t,et as u,me as v,Te as w,Mt as x,xt as y,Et as z};
|
|
1
|
+
import{d as l,c as R,t as ne,q as ue,r as z,v as Le}from"./userflow.js";import"./vendor.object-assign.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]="de6fefa0-7345-4dcf-a7c9-e2268020aa40",e._sentryDebugIdIdentifier="sentry-dbid-de6fefa0-7345-4dcf-a7c9-e2268020aa40")}catch{}})();class Ie extends Error{constructor(t,o){const n=`Unreachable case: ${t}`;o?o=`${o} (${n})`:o=n,super(o)}}function yt(e){return typeof e=="object"&&e!=null}let fe=window.MutationObserver;const N=window;if(N.Zone&&typeof N.Zone.__symbol__=="function"){const e=N.Zone.__symbol__("MutationObserver");e&&typeof e=="string"&&N.hasOwnProperty(e)&&typeof N[e]=="function"&&(fe=N[e])}function de(e,t){const o=e.left,n=e.top,r=o+e.width,i=n+e.height,c=t.left,s=t.top,f=c+t.width,u=s+t.height;return Ne(o,n,r,i,c,s,f,u)}function Ne(e,t,o,n,r,i,c,s){const f=c<e,u=o<r,d=s<t,a=n<i;return a&&f?$(e,n,c,i):f&&d?$(e,t,c,s):d&&u?$(o,t,r,s):u&&a?$(o,n,r,i):f?e-c:u?r-o:d?t-s:a?i-n:0}function $(e,t,o,n){return Math.sqrt(Math.pow(o-e,2)+Math.pow(n-t,2))}function D(e){window.performance.mark&&window.performance.mark(e)}function X(e,t,o){window.performance.measure&&window.performance.measure(e,t,o)}function Re(){const e=window.getComputedStyle(window.document.body);if(e.zoom&&e.zoom!=="1"){const t=parseFloat(e.zoom);if(!isNaN(t))return t}return 1}function Et(e){return De(),_e(e)}let B;function _e(e){return B==null&&(B=Re()),B==1?e:e/B}function De(){B=null}function bt(){return(document.compatMode=="BackCompat"?document.body:document.documentElement).clientWidth||window.innerWidth}function Fe(){return(document.compatMode=="BackCompat"?document.body:document.documentElement).clientHeight||window.innerHeight}function St(e){return e?parseFloat(e.replace(/px$/,"")):0}function Tt(e){return e==null?void 0:e+"px"}function At(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}const Ve=50,ke=100,oe=25,Be=new Set(["left","start","justify","justify-all"]);class Oe{constructor(t){this.ctx=t,this.rectCache=new Map,this.isLabelLikeCache=new Map,this.hasPlaceholderCache=new Map}calcScore(t,o){const n=this.getRect(t),r=this.getRect(o),i=this.distBetween(t,o),c=K(o)?ke:Ve;if(i>c)return 0;const s=this.isLabelLike(t),f=this.isCloserToOtherInput(t,o),u=window.getComputedStyle(t).textAlign||"",d=n.top+n.height<=r.top,a=Math.abs(n.left-r.left)<oe&&(!u||Be.has(u)),h=n.left+n.width<=r.left,T=Math.abs(n.top-r.top)<oe,b=d&&a||h&&T,y=n.height>=Fe()/2,E=be(o);if(E&&n.top>=r.top+r.height)return 0;let m=1;const S=t.htmlFor;return S&&S===o.id&&(m+=Math.pow(1e3,4)),E&&!y&&!f&&(s&&b?m+=Math.pow(1e3,3):o===t&&this.hasPlaceholder(o)?m+=Math.pow(1e3,2):!s&&b&&(m+=Math.pow(1e3,1))),m+=c-i,m}getRect(t){let o=this.rectCache.get(t);return o||(o=v(t),this.rectCache.set(t,o)),o}isLabelLike(t){let o=this.isLabelLikeCache.get(t);if(o===void 0){const n="a, button, h1, h2, h3, h4, h5, h6, input";o=!t.closest(n)&&!t.querySelector(n),this.isLabelLikeCache.set(t,o)}return o}hasPlaceholder(t){let o=this.hasPlaceholderCache.get(t);return o===void 0&&(o=!!O(t),this.hasPlaceholderCache.set(t,o)),o}getAllInputs(){return this.allInputs||(this.allInputs=Array.from(document.querySelectorAll(ge())).filter(t=>ee(t,this.ctx))),this.allInputs}distBetween(t,o){return Math.round(de(this.getRect(t),this.getRect(o)))}isCloserToOtherInput(t,o){let n=this.distBetween(t,o);for(let r of this.getAllInputs()){if(r===o)continue;if(this.distBetween(t,r)<n)return!0}return!1}}function Pe(e,t={}){const o=performance.now();D("userflow:inferSelector:start"),l.groupCollapsed("inferSelector for",e,t);let n;try{n=Ue(e,t)}catch(r){console.error("Userflow findElement error:",r),n=null}return l("time",performance.now()-o),l.groupEnd(),D("userflow:inferSelector:end"),X("userflow:inferSelector","userflow:inferSelector:start","userflow:inferSelector:end"),n}function he(e){const t=[],o=e.tagName.toLowerCase();return R.inferenceAttributeNames.forEach(n=>{const r=e.getAttribute(n);if(!r)return;const i=R.inferenceAttributeFilters[n];if(!(i&&!ne(i,r)))if(n==="id")t.push(`#${r}`);else{const c=n==="name"||n==="placeholder"?o:"";t.push(`${c}[${n}="${r}"]`)}}),e.classList.forEach(n=>{ne(R.inferenceClassNameFilters,n)&&(n=n.replace(/:/g,"\\:").trim(),t.push(`.${n}`))}),t}const $e=window.userflow||{};$e.__inferSelector=Pe;function Ue(e,{elementType:t}={}){const o={minorVersion:Ge};let n=be(e);const r=ot(e);if(t===ue.INPUT&&!n)if(r)e=r,n=!0,l("use custom input parent",r);else return l("not an input"),null;else r&&(e=r,n=!0);const i=qe(e);let c=null;n||(c=we(e),c&&c.length>250&&(c=null)),l("text is:"+c);let s=new Map,f=new Map;const u=new Map,d=new G(i,null,o),a=new G(i,c,o),h=(y,E,m,S,g)=>{if(S<0)return;let p=y.get(E);p||(p=[],y.set(E,p)),p.push({css:m,offset:S,complexity:g}),l(`use css=${m}, cardinality=${E}, offset=${S}`)},T=He(e),b=[e.tagName.toLowerCase(),...he(e)];l("shadowRootSelectors:",i),l("ancestorCssSelectors:",T),l("ownCssSelectors:",b);for(const y of b)for(const E of T){const m=E?`${E} ${y}`:y,S=E?2:1,g=d.query(m),p=Array.from(g),w=p.length;if(w>100){l(`cardinality too high css=${m}, cardinality=${w}`);continue}u.set(m,w);const A=p.indexOf(e);if(h(s,w,m,A,S),c){const k=a.query(m),I=Array.from(k),Ce=I.indexOf(e),Me=I.length;h(f,Me,m,Ce,S)}}if(s.size>0||f.size>0){const y=S=>Array.from(S.entries()).map(([g,p])=>({cardinality:g,cssSelectors:p.sort((w,A)=>{const k=u.get(w.css),I=u.get(A.css);return k!==I?k?I?k-I:-1:1:w.complexity!==A.complexity?A.complexity-w.complexity:w.css.localeCompare(A.css)}).map(({css:w,offset:A})=>({css:w,offset:A}))})).sort((g,p)=>g.cardinality-p.cardinality),E={version:"v1",minorVersion:o.minorVersion,shadowRootSelectors:i,notextGroups:y(s),textGroups:y(f)},m={el:e,selector:{type:z.AUTO,autoData:JSON.stringify(E),text:c,elementType:t}};return l("inference result",m),m}return l("no selector inferred "),null}function qe(e){let t=[],o=e;for(;o;){let n=o.getRootNode();if(F(n)){const{host:i}=n;t.unshift(i.tagName.toLowerCase()),o=i;continue}const r=q(o);if(r){let i=r.tagName.toLowerCase();const c=r.getAttribute("name");c?i+=`[name="${c}"]`:r.id&&!r.id.match(/\d$/)&&(i+="#"+r.id),t.unshift(i),o=r;continue}break}if(t.length!==0)return t}function He(e){const t=new Map;t.set(null,0);let o=e.parentNode;for(;o&&C(o)&&!(o.tagName==="BODY"||F(o));){for(const r of he(o)){if(t.has(r))continue;const i=U(document.documentElement,r);if(i){const c=i.length;t.set(r,c)}}o=o.parentNode}return Array.from(t.entries()).sort(([,r],[,i])=>r-i).slice(0,20).map(([r])=>r)}function je(e,t){const{text:o,excludeText:n,precision:r}=e,i={minorVersion:t.minorVersion||0},c=o!=null&&!n,s=c?t.textGroups:t.notextGroups,f=Math.max(1,Math.min(s.length,Math.ceil((1-parseFloat(r||"1"))*s.length))),u=new G(t.shadowRootSelectors,c&&o||null,i);l("findElementAutoV1",{text:o,excludeText:n,precision:r,groups:s,groupCount:f});for(let d=0;d<f;d++){const a=s[d];let h=new Map,T=0,b=null;l.group(`group cardinality=${a.cardinality}`,a);try{for(let y=0;y<a.cssSelectors.length;y++){const{css:E,offset:m}=a.cssSelectors[y];l(`css=${E}, offset=${m}`);let S=u.query(E),g=null;for(let w=0;w<=m;w++){const A=S.next();if(A.done)break;g=A.value}if(!g)continue;const p=(h.get(g)||0)+1;if(h.set(g,p),l(`el with frequency=${p}`+(p>T&&g!==b?" NEW BEST":""),g),p>T&&(T=p,b=g,p>=Math.ceil(a.cssSelectors.length/2)))return l("early winner",b),b}}finally{l.groupEnd()}if(b)return l("winner",b),b}return l("element not found"),null}class G{constructor(t,o,n){this.shadowRootSelectors=t,this.text=o,this.ctx=n,this.isVisibleCache=new Map,this.textCache=new Map}*query(t){const o=U(document.documentElement,t,this.shadowRootSelectors);if(l("found",o),!o)return;const{text:n}=this;for(let r=0;r<o.length;r++){const i=o[r];if(n){let s=this.textCache.get(i);if(s==null&&(s=j(i,n),this.textCache.set(i,s)),!s){l("skip, text mismatch",i);continue}}let c=this.isVisibleCache.get(i);if(c==null&&(c=ee(i,this.ctx),this.isVisibleCache.set(i,c)),!c){l("skip, not visible",i);continue}l("yield",i),yield i}}}const Ge=5,P=window.userflow||{};function Z(e){const t=performance.now();D("userflow:findAllElements:start"),l.groupCollapsed("findAllElements",e);let o;try{if(e.type===z.MANUAL)o=Ye(e);else if(e.autoData){const n=JSON.parse(e.autoData);let r;if(n.version==="v1")r=je(e,n);else throw new Ie(n.version,"Unknown autoData version: "+n.version);o=r?[r]:[]}else o=[]}catch(n){console.error("Userflow findElement error:",n),o=[]}return l("time",performance.now()-t),l.groupEnd(),D("userflow:findAllElements:end"),X("userflow:findAllElements","userflow:findAllElements:start","userflow:findAllElements:end"),o}function Ye(e){const t={minorVersion:e.minorVersion==null?1:e.minorVersion};let{css:o,text:n,elementType:r,offset:i}=e;n=n&&_(n);const c="nearSelector"in e?e.nearSelector:null;l("findAllElementsManual",e),i!=null&&c!=null&&console.warn("Userflow.js: Both selector.offset and selector.nearSelector was set; ignoring nearSelector.");let s;if(n&&!o){if(s=[],t.minorVersion>=2)for(const f of ie())Y(f,n,s);else Y(document.body,n,s);l("els after traverseElementForText",s)}else if(o){if(t.minorVersion>=2){s=[];for(const f of ie()){const u=U(f,o);u&&u.length>0&&s.push(...u)}}else s=Array.from(U(document.body,o)||[]);l("els after safeQueryAll",s),n&&(s=Xe(s,n),l("els after filterElementsByText",s))}else console.warn("Userflow.js: findAllElements() requires least one of `css` and `text` to be set."),s=[];if(s.length>0&&(s=s.filter(f=>ee(f,t)),l("els after isVisible",s)),s.length>0&&r===ue.INPUT&&(s=tt(s,t),l("els after mapElementsToInputs",s)),s.length>0&&(s.sort((f,u)=>{const d=v(f),a=v(u);return d.top<a.top?-1:d.top>a.top?1:d.left-a.left}),l("els after sort",s)),s.length>0){if(i!=null)s=s[i]?[s[i]]:[],l("els after offset",s);else if(c!=null){const f=Z(c);let u=null,d=0;for(const a of s)for(const h of f){const T=de(v(a),v(h));(!u||T<d)&&(u=a,d=T)}s=u?[u]:[],l("els after nearSelector",s)}}return s}function me(e){return Z(e)[0]||null}function We(e,t){const o=performance.now();D("userflow:elementMatchesSelector:start"),l.groupCollapsed("elementMatchesSelector",e,t);let n;try{if(t.type===z.MANUAL)n=ze(e,t);else{const r=me(t);n=r!=null&&r.contains(e)}}catch(r){console.error("Userflow findElement error:",r),n=!1}return l(n?"match":"not match"),l("time",performance.now()-o),l.groupEnd(),D("userflow:elementMatchesSelector:end"),X("userflow:elementMatchesSelector","userflow:elementMatchesSelector:start","userflow:elementMatchesSelector:end"),n}function ze(e,t){t.offset!=null&&console.warn("Userflow.js: selector.offset is not supported for elementMatchesSelector yet"),"nearSelector"in t&&t.nearSelector!=null&&console.warn("Userflow.js: selector.nearSelector is not supported for elementMatchesSelector yet");let{css:o,text:n}=t;n=n&&_(n);let r=!1,i=e;for(;i&&i.tagName!=="BODY";){if((!o||i.matches(o))&&(!n||j(i,n))){r=!0;break}i=i.parentElement}return r}function Y(e,t,o){if(C(e)){const{tagName:r}=e;if(r==="SCRIPT"||r==="STYLE")return!1}let n=!1;for(let r=0;r<e.children.length;r++)Y(e.children[r],t,o)&&(n=!0);return!n&&C(e)&&j(e,t)&&(o.push(e),n=!0),n}function U(e,t,o){try{return o==null?e.querySelectorAll(t):pe(t,o,0,e)}catch{return console.info("Userflow.js: Invalid CSS selector: ",t),null}}function pe(e,t,o,n){if(o>=t.length)return Array.from(n.querySelectorAll(e));const r=t[o],i=n.querySelectorAll(r),c=[];return i.forEach(s=>{let f;if(s.shadowRoot)f=s.shadowRoot;else{if(!Te(s))return;let u=null;try{u=s.contentDocument}catch{}if(!u)return;f=u.body}c.push(...pe(e,t,o+1,f))}),c}function Xe(e,t){const o=[];for(let n=e.length-1;n>=0;n--){const r=e[n];o.some(i=>i.contains(r))||j(r,t)&&o.push(r)}return o.reverse()}const Ze={email:!0,number:!0,password:!0,search:!0,tel:!0,text:!0,url:!0},Qe={date:!0,"datetime-local":!0,month:!0,time:!0,week:!0},Je={button:!0,email:!0,reset:!0,search:!0,submit:!0,tel:!0,text:!0,url:!0};function we(e){let t=e.innerText;return t===void 0&&e.tagName!=="SELECT"&&(t=e.textContent),t=_(t),t||null}function O(e){if(ye(e)||Q(e)){const t=_(e.getAttribute("placeholder")),o=e.value||"";if(t&&!o)return t;const n=_(o);if(n&&rt(e))return n}if(J(e)&&e.selectedIndex>=0){const t=_(e.options[e.selectedIndex].text);if(t)return t}return we(e)}function j(e,t){const o=O(e);return o?Ke(t,o):!1}function Ke(e,t){const o=e.toLowerCase();return t.toLowerCase()===o}function _(e){return!e||e.length>250?null:e.replace(/^[\s\uFEFF\xA0\u200B*]+|[\s\uFEFF\xA0\u200B*]+$/g,"").replace(/\s+/g," ")}function et(e){for(const{cssSelector:t,getValue:o}of R.customInputs)if(e.matches(t))if(o)try{return(o(e)||"").trim()}catch(n){return console.error(`Userflow.js: getValue function for custom input '${t}' failed:`,n),""}else return O(e)||"";return J(e)?e.selectedIndex==-1?"":e.options[e.selectedIndex].text:K(e)?O(e)||"":e.value}function ge(){return"input, select, textarea, [contenteditable]"+R.customInputs.map(({cssSelector:e})=>`, ${e}`).join("")}function tt(e,t){const o=new Set,n=new Oe(t),r=ge();for(const i of e){if(i.matches(r)){o.add(i);continue}let c=null,s=null;n.getAllInputs().forEach(f=>{const u=n.calcScore(i,f);l("input",u,f),u!==0&&(c&&s&&u<=s||(l("input is best so far"),c=f,s=u))}),c&&(l("best input was",c),o.add(c))}return Array.from(o)}function ye(e){if(e.tagName!=="INPUT")return!1;const t=e.getAttribute("type");return t==null?!0:Ze[(t||"").toLowerCase()]===!0}function Q(e){return e.tagName==="TEXTAREA"}function nt(e){if(e.tagName!=="INPUT")return!1;const t=(e.getAttribute("type")||"").toLowerCase();return Qe[t]===!0}function J(e){return e.tagName==="SELECT"}function K(e){return"hasAttribute"in e&&e.hasAttribute("contenteditable")}function Ee(e){return!!(K(e)||R.customInputs.some(({cssSelector:t})=>e.matches(t)))}function ot(e){let t=e.parentNode;for(;t&&C(t)&&!(t.tagName==="BODY"||F(t));){if(Ee(t))return t;t=t.parentNode}return null}function be(e){return ye(e)||nt(e)||Q(e)||J(e)||Ee(e)}function rt(e){if(Q(e))return!0;const t=(e.getAttribute("type")||"").toLowerCase();return Je[t]}function ee(e,t){const o=v(e);let n=e,r=!0,i=!1,c=!1,s=!1,f=!1;for(;n;){const u=n===document.body,d=n.tagName==="BODY",a=window.getComputedStyle(n);let h=null;if(r){if(a.visibility&&a.visibility!=="visible")return l("not visible because visibility is",a.visibility,e,{cur:n}),!1;r=!1}if(a.display==="none")return l("not visible because display is",a.display,e,{cur:n}),!1;if(a.opacity!=null&&parseFloat(a.opacity)<.01)return l("not visible because opacity is",a.opacity,e,{cur:n}),!1;if(a.position==="absolute"?s=!0:(a.position==="relative"||a.position==="fixed"||a.position==="sticky")&&(s=!1),t.minorVersion>=4&&!i&&!d&&!(f&&a.position==="static")&&(M(a.overflowX)||M(a.overflowY))&&(h=h||v(n),h.width===0||h.height===0))return l("not visible because width/height (v1.4 check) is",h.width,h.height,e,{cur:n}),!1;if(!c&&Se(a.display)&&(t.minorVersion<1||d||a.position!=="static")){const T=d||M(a.overflow),b=T||M(a.overflowX),y=T||M(a.overflowY),{scrollLeft:E,scrollTop:m}=d?n.ownerDocument.documentElement:n,S=!d&&!s;if(b){if(h=h||v(n),S&&h.width===0)return l("not visible because width is",h.width,e,{cur:n}),!1;const g=t.minorVersion>=5?o.width/2:0,p=Math.round(o.left+g),w=Math.round(h.left-E);if(p<w)return l("not visible because it's clipped left",e,{elX:p,curLeft:w,cur:n}),!1}if(y){if(h=h||v(n),S&&h.height===0)return l("not visible because height is",h.height,e,{cur:n}),!1;const g=t.minorVersion>=5?o.height/2:0,p=Math.round(o.top+g),w=Math.round(h.top-m);if(p<w)return l("not visible because it's clipped top",e,{elY:p,curTop:w,cur:n}),!1}(b||y)&&(c=!0)}if(a.position==="fixed"&&(i=!0,c=!0),t.minorVersion>=3&&(n.scrollTop>0||n.scrollLeft>0)&&(c=!0),u)break;d?(n=q(n),r=!0):n=n.parentElement,f=s}return!0}function M(e){return e==="hidden"||e==="clip"||e==="scroll"||e==="auto"}function Se(e){return!e||!e.includes("inline")&&e!=="contents"}function vt(e){let t=e.parentNode,o=!1;for(;t&&t.tagName!=="BODY";){F(t)&&(t=t.host);const n=window.getComputedStyle(t);if(n.position==="absolute"?o=!0:(n.position==="relative"||n.position==="fixed"||n.position==="sticky")&&(o=!1),!o&&Se(n.display)&&(M(n.overflow)||M(n.overflowY)))return t;if(n.position==="fixed")return e.ownerDocument.documentElement;t=t.parentNode}return e.ownerDocument.documentElement}function v(e){if(e.tagName==="HTML"){const n=q(e);if(n)return v(n)}let t=e.getBoundingClientRect(),o=e;for(;o&&(o=q(o),!!o);){const n=o.getBoundingClientRect();t={width:t.width,height:t.height,left:t.left+n.left,right:t.right+n.left,top:t.top+n.top,bottom:t.bottom+n.top}}return t}const re=new WeakSet;function q(e){const t=e.ownerDocument?.defaultView;if(!t||re.has(t))return null;{const o=t.frameElement;return o||re.add(t),o}}function F(e){return typeof e=="object"&&e!=null&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e&&"mode"in e}function C(e){return typeof e=="object"&&e!=null&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function Te(e){return C(e)&&e.tagName==="IFRAME"}function xt(e){let t=e;for(;t;)if(C(t)){if(t.hasAttribute("popover")&&t.matches(":popover-open"))return t;t=t.parentNode}else if(F(t))t=t.host;else break;return null}const st=e=>{if(!e)return null;const t=e.className;if(t==null)return null;if(typeof t=="string")return t;if(typeof t=="object"&&"baseVal"in t)return t.baseVal||null;try{return String(t)}catch{return null}},Ct=e=>{const t=e.getBoundingClientRect();return`${e.tagName}-${e.id||""}-${st(e)||""}-${Math.round(t.left)}-${Math.round(t.top)}`},it=e=>{e instanceof HTMLElement&&e.hasAttribute("popover")===!1&&typeof e.showPopover=="function"&&(e.setAttribute("popover","manual"),e.showPopover(),e.style.border="none",e.style.padding="0",e.style.margin="0",e.style.overflow="visible")},se=e=>{e instanceof HTMLElement&&e.hasAttribute("popover")&&typeof e.hidePopover=="function"&&(e.hidePopover(),e.removeAttribute("popover"),e.style.border="",e.style.padding="",e.style.margin="",e.style.overflow="")},Mt=(e,t)=>!(e instanceof HTMLElement)||typeof e.showPopover!="function"?()=>{}:(e.hasAttribute("popover")||(e.setAttribute("popover","manual"),e.showPopover(),e.style.border="none",e.style.padding="0",e.style.margin="0",e.style.overflow="visible",e.style.width="100vw",e.style.height="100vh"),it(t),t instanceof HTMLElement&&(t.style.background="none"),()=>lt(e,t)),lt=(e,t)=>{se(e),e instanceof HTMLElement&&(e.style.width="",e.style.height=""),se(t),t instanceof HTMLElement&&(t.style.background="")};P.__findElement=me;P.__findAllElements=Z;P.__elementMatchesSelector=We;P.__getElementText=O;P.__getInputValue=et;const x=new Set,W=new Map,H=new Set;function ie(){return Ae(),x}function Lt(e,t){Ae();for(const n of x)e(n);const o={setup:e,teardown:t};return H.add(o),()=>{H.delete(o);for(const n of x)t(n)}}let le=!1,L=null;function Ae(){if(ce(),!le){l("roots started"),le=!0,L=document.body,V(L),at();for(const e of Le)document.addEventListener(e,ct);window.setInterval(ce,10*1e3)}}function ct(){L&&!document.contains(L)&&(l("roots detected new Turbo body"),te(L),L=document.body,V(L))}function at(){for(const e of document.documentElement.children)e!==document.body&&e.shadowRoot&&V(e.shadowRoot)}function ce(){for(const e of x)F(e)&&(ut(e)||(l("roots clean before removeRoot",e),te(e)));l("roots clean finished, remaining=",x.size)}function ut(e){return e.ownerDocument.defaultView?e.host.isConnected:!1}function V(e){if(!x.has(e)){l("roots addRoot",e),x.add(e),ft(e),ve(e),mt(e),pt(e);for(const{setup:t}of H)t(e)}}function te(e){if(x.has(e)){l("roots removeRoot",e),W.get(e)?.disconnect(),W.delete(e),x.delete(e);for(const{teardown:t}of H)t(e)}}function ft(e){let t;const o=()=>{ve(e)},n=new fe(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(o)});n.observe(e,{childList:!0,subtree:!0}),W.set(e,n)}function ve(e){const t=C(e)?e.ownerDocument.getElementsByTagName("iframe"):e.querySelectorAll("iframe");for(const o of t)xe(o)}const ae=new WeakSet;function xe(e){if(ae.has(e)||e.closest("#userflow-ui"))return;e.addEventListener("load",dt);const t=e.contentWindow,o=e.contentDocument;if(!t||!o){ae.add(e);return}const n=o.body;n&&(t.addEventListener("pagehide",ht),l("roots setupFrame before addRoot",e,o,n),V(n))}function dt(e){const t=e.target;t&&Te(t)&&xe(t)}function ht(e){const t=e.currentTarget.document.body;l("roots onFrameUnload before removeRoot",t),te(t)}function mt(e){const t=e.ownerDocument.defaultView;if(t.__userflowAttachShadowInstalled)return;t.__userflowAttachShadowInstalled=!0;const o=t.Element.prototype.attachShadow;o!=null&&(t.Element.prototype.attachShadow=function(n){const r=o.call(this,n);return this.shadowRoot&&(l("roots monitorShadowDom before addRoot",this,this.shadowRoot),V(this.shadowRoot)),r})}function pt(e){const t=o=>{o.childNodes.forEach(n=>{C(n)&&n.shadowRoot&&(l("roots queryShadowDom before addRoot",n,n.shadowRoot),V(n.shadowRoot)),t(n)})};t(e)}export{F as A,Ct as B,Et as C,fe as M,Ie as U,q as a,Pe as b,be as c,we as d,We as e,Z as f,et as g,yt as h,At as i,bt as j,Fe as k,C as l,me as m,_ as n,Lt as o,vt as p,De as q,v as r,_e as s,Te as t,Mt as u,xt as v,St as w,se as x,it as y,Tt as z};
|
|
2
2
|
//# sourceMappingURL=roots.js.map
|
package/sad.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as l}from"./vendor.react.js";import"./vendor.
|
|
1
|
+
import{r as l}from"./vendor.react.js";import"./vendor.object-assign.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},c=new Error().stack;c&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[c]="4bfb4ca7-1502-4371-88df-6b0df596506f",e._sentryDebugIdIdentifier="sentry-dbid-4bfb4ca7-1502-4371-88df-6b0df596506f")}catch{}})();const d=e=>l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 408 408"},e),l.createElement("path",{fill:"#fecb4c",d:"m192.09-.238 2.587-.03C213.467-.438 231.607-.325 250 4l2.46.567C257.718 5.82 262.865 7.315 268 9l2.285.745c26.81 8.918 50.75 23.087 71.508 42.235a147 147 0 0 0 5.894 5.083C351.55 60.358 354.748 64.114 358 68l2.418 2.828c28.185 33.26 47.402 77.233 47.82 121.262l.03 2.587c.17 18.79.057 36.93-4.268 55.323l-.567 2.46c-1.252 5.258-2.748 10.405-4.433 15.54l-.745 2.285c-8.918 26.81-23.087 50.75-42.235 71.508a147 147 0 0 0-5.082 5.894c-3.296 3.862-7.053 7.06-10.938 10.313l-2.828 2.418c-33.26 28.185-77.233 47.402-121.262 47.82l-2.587.03c-18.79.17-36.93.057-55.323-4.268l-2.46-.567c-5.258-1.252-10.405-2.748-15.54-4.433l-2.285-.745c-26.81-8.918-50.75-23.087-71.508-42.235a147 147 0 0 0-5.894-5.082C56.45 347.642 53.253 343.885 50 340l-2.418-2.828C19.397 303.912.18 259.939-.238 215.91l-.03-2.587C-.438 194.533-.325 176.393 4 158l.567-2.46C5.82 150.282 7.315 145.135 9 140l.745-2.285c8.918-26.81 23.087-50.75 42.235-71.508a147 147 0 0 0 5.083-5.894C60.358 56.45 64.114 53.253 68 50l2.828-2.418C104.088 19.397 148.061.18 192.09-.238"}),l.createElement("path",{fill:"#674600",d:"M202.884 266.76c2.282-.01 4.563-.041 6.845-.072 15.564-.114 29.063 2.867 43.271 9.312l2.965 1.336C270.68 284.64 283.364 298.549 289 314c.226 2.817-.093 4.278-1 7-1.809 1.809-4.28 1.345-6.7 1.523-2.894-.658-4.434-2.232-6.615-4.169-2.954-2.374-6.316-3.851-9.747-5.416l-2.256-1.044C256.282 309 249.805 306.757 243 305l-2.484-.645c-8.195-1.963-16.397-2.511-24.801-2.523l-2.604-.01q-2.715-.007-5.428-.007c-2.714-.002-5.428-.02-8.142-.04-24.034-.08-48.444 3.17-68.264 17.944-3.81 2.653-5.728 2.995-10.277 2.281-2.13-3.195-2.27-4.251-1.598-7.918 4.616-16.08 18.463-29.107 32.598-37.082 16.6-8.03 32.649-10.194 50.884-10.24m77.499-152.143c8.913 3.95 14.106 12.665 17.617 21.383 4.061 11.74 3.651 25.96-1.523 37.234L295 176l-1.352 2.578c-3.814 6.436-9.032 10.114-15.648 13.422-6.602.649-13.14.31-19-3-6.477-5.436-10.059-12.19-13-20l-1.11-2.73c-3.37-12.375-1.556-26.624 4.465-37.782 7.256-11.768 17.024-17.498 31.028-13.87m-136-.001c8.913 3.95 14.106 12.665 17.617 21.383 4.061 11.74 3.651 25.96-1.523 37.234L159 176l-1.352 2.578c-3.814 6.436-9.032 10.114-15.648 13.422-6.602.649-13.14.31-19-3-6.477-5.436-10.059-12.19-13-20l-1.11-2.73c-3.37-12.375-1.556-26.624 4.465-37.782 7.256-11.768 17.024-17.498 31.028-13.87"}));export{d as default};
|
|
2
2
|
//# sourceMappingURL=sad.js.map
|
package/steps.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{U as
|
|
1
|
+
import{U as e}from"./userflow.js";import"./vendor.object-assign.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="f8b1477d-a03f-42c9-acb0-3fc94fe4ba89",t._sentryDebugIdIdentifier="sentry-dbid-f8b1477d-a03f-42c9-acb0-3fc94fe4ba89")}catch{}})();function p(t){const{currentStep:n}=t,r=t.kind==="workflow"?t.version.workflowSteps:t.version.steps;if(n){const o=r.find(({crossVersionId:s})=>s===n.crossVersionId);if(!o)throw new e("Session points to an unknown step: "+n.crossVersionId);return o}return t.kind==="workflow"?f(t):i(t)}function f(t){const n=t.version.workflowSteps[0];if(!n)throw new e("Session has no current step and its version has no start step");return n}function i(t){const n=t.version.steps[0];if(!n)throw new e("Session has no current step and its version has no start step");return n}export{i as a,p as f};
|
|
2
2
|
//# sourceMappingURL=steps.js.map
|
package/stylesheets.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as k,R as y}from"./vendor.react.js";import{V as R,W as $,R as P,P as D,X as z,B as U,Y as O,Z as q,z as _,_ as j,$ as N,a0 as K,Q as V,l as G,a1 as Y,a2 as Q,a3 as X,a4 as Z,e as J,a5 as oo,a6 as ro}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{i as no,j as to,k as eo,l as lo,m as ao,n as uo,o as co,p as io,q as so,r as fo}from"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.core-js.js";import{j as go,a8 as Co,v as bo,ab as H}from"./userflow.js";import{c as Bo}from"./flow-condition-types.js";import{a as ko}from"./client-context.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="c9c3cb72-2831-4b32-bced-fefef9e6c3df",o._sentryDebugIdIdentifier="sentry-dbid-c9c3cb72-2831-4b32-bced-fefef9e6c3df")}catch{}})();function po(o){const[n]=k.useState(()=>new go(o));return n.update(o),n}const Po=({icon:o,size:n,dataAttrs:t})=>{n=n||16;const e=typeof o=="string"&&A[o]?A[o]:o;if(typeof e=="string")return y.createElement("img",{...t,"aria-hidden":"true",src:e,width:n,height:n,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:n,height:n,viewBox:`0 0 ${l} ${a}`,...t},y.createElement("path",{fill:"currentColor",d:String(c)}))}},A={"regular/calendar-day":R,"regular/comment-alt":$,"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/route":Q,"regular/shoe-prints":X,"solid/shoe-prints":no,"solid/file-invoice":to,"solid/receipt":eo,"solid/university":lo,"solid/users":ao,"solid/stars":uo,"regular/tasks":Z,"regular/user":J,"regular/users":oo,"solid/exclamation-triangle":co,"solid/info-circle":io,"solid/play-circle":so,"solid/question-circle":fo,"regular/user-headset":ro};function wo(o,n,t){if(!o.document.fonts)return t(),()=>{};let e=!1;const l=()=>{const i=o.document.fonts.load(`100px ${n}`,"BESbswy");if(!i){c(),t();return}i.then(u=>{e||(u.length>=1?(c(),t()):window.setTimeout(l,25))},u=>{console.log("Userflow.js: observeFont error:"),console.log(u),t()})};l();const a=window.setTimeout(()=>{console.warn(`Userflow.js: Timed out waiting for font family ${n} to load. Will continue anyway.`),t()},2e3),c=()=>{e=!0,window.clearTimeout(a)};return c}function p(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,n,t]){return"#"+o.toString(16).padStart(2,"0")+n.toString(16).padStart(2,"0")+t.toString(16).padStart(2,"0")}function B(o){const n=p(o);return n?n.join(", "):"0, 0, 0"}function x(o){return v(p(o))}function ho([o,n,t]){return[Math.round(255-o),Math.round(255-n),Math.round(255-t)]}function F(o,n,t){return[Math.max(0,Math.min(255,Math.round(o[0]+(n[0]-o[0])*t))),Math.max(0,Math.min(255,Math.round(o[1]+(n[1]-o[1])*t))),Math.max(0,Math.min(255,Math.round(o[2]+(n[2]-o[2])*t)))]}function h(o,n,t){const e=p(o),l=p(n);return!e||!l?o:v(F(e,l,t))}function S([o,n,t]){o/=255,n/=255,t/=255;const e=Math.max(o,n,t),l=Math.min(o,n,t);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=(n-t)/u+(n<t?6:0);break;case n:a=(t-o)/u+2;break;default:a=(o-n)/u+4;break}a/=6}return[a,c,i]}function m([o,n,t]){let e=o/255,l=n/255,a=t/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,n){const t=m(o),e=m(n),l=.05;let i=(1-(e-t))/2*(.18-l)+l,u=1-Math.abs(e-t),r=Math.pow((1-i)*u,4),s=i+r;return Math.round(s*1e3)/1e3}function w(o,n){const t=p(o),e=S(t);let l=null,a=null;for(const g of n){const d=p(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,t),r=u*2;const s=.2;return e[2]>s&&e[2]<1-s&&(i=ho(i),r=L(i,t)),[v(F(t,c,u)),v(F(t,i,r))]}function vo(o,n,t,e){const[l,a]=w(o,[n]);let c,i;if(o===t)c=l,i=a;else{const b=w(t,[o,n,e]);c=b[0],i=b[1]}const u=p(o),r=p(t),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=n,d=o;const b=w(g,[d]);f=b[0],C=b[1]}else g=o,d=n,f=l,C=a;return[l,a,c,i,g,d,f,C]}function yo(o){const[n,t,e,l,a,c,i,u]=vo(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=n),r.brandActiveBackgroundColor||(r.brandActiveBackgroundColor=t),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.siteHeroForegroundColor||(r.siteHeroForegroundColor=r.brandForegroundColor),r.siteHeroBackgroundColor||(r.siteHeroBackgroundColor=r.brandBackgroundColor),r.siteBackgroundColor||(r.siteBackgroundColor=r.mainHoverBackgroundColor),r.siteContentForegroundColor||(r.siteContentForegroundColor=r.mainForegroundColor),r.siteContentBackgroundColor||(r.siteContentBackgroundColor=r.mainBackgroundColor),r}function Fo(o){const{questionColor:n}=o;return{"--userflow-backdrop-highlight-color-rgb":B(o.backdropHighlightColor),"--userflow-backdrop-highlight-inset":o.backdropHighlightType===Co.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-background-color-rgb":B(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?Ao(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===bo.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(n,o.mainBackgroundColor,.5),"--userflow-question-color-lighter":h(n,o.mainBackgroundColor,.75),"--userflow-question-color-lightest":h(n,o.mainBackgroundColor,.9),"--userflow-question-color-medium-light":h(n,o.mainBackgroundColor,.15),"--userflow-question-color":n,"--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,"--userflow-site-hero-foreground-color":o.siteHeroForegroundColor,"--userflow-site-hero-background-color":o.siteHeroBackgroundColor,"--userflow-site-background-color":o.siteBackgroundColor,"--userflow-site-content-foreground-color":o.siteContentForegroundColor,"--userflow-site-content-background-color":o.siteContentBackgroundColor}}const Ho=[];function Do(o){let[n,t]=k.useState(o);const e=po(o.sessionData||Ho);return k.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}}t(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]),k.useMemo(()=>yo(n),[n])}function zo(o){return o?.cssVersion?`https://cdn.userflow.com/themes/${o.id}/stylesheets/${o.cssVersion}/custom.css`:null}function Ao(o){return`"${o.trim()}"`}const M=new Map;function W(o){let n=M.get(o);return n||(n={stylesheets:new Map},M.set(o,n)),n}function Uo(o,n,t,{uninstallOnUnmount:e}={}){const l=ko(),[a,c]=k.useState(!n);return k.useLayoutEffect(()=>{if(!o||!n)return;let i=!1,u;const r=async d=>{await E(l,o,d),u&&T(o,u),u=d};(async()=>{let d=typeof n=="string"?n:n.get();if(xo()&&t){let f=await So(d);if(i)return;f=mo(f,Fo(t)),d="data:text/css;base64,"+btoa(f)}await r(d),!i&&c(!0)})();let g=null;return typeof n!="string"&&(g=n.onUpdate(async()=>{r(n.get())})),()=>{i=!0,g&&g(),e&&u&&T(o,u)}},[l,o,n,t,e]),{loaded:a}}function xo(){return!!window.MSInputMethodContext&&!!document.documentMode}const I=new Map;function So(o){return new Promise((n,t)=>{let e=I.get(o);if(e){n(e);return}const l=new XMLHttpRequest;l.addEventListener("load",()=>{if(l.status!==200){t(new Error("Userflow.js could not fetch stylesheet: "+o));return}const a=l.responseText;I.set(o,a),n(a)}),l.addEventListener("error",()=>{t(new Error("Userflow.js could not fetch stylesheet: "+o))}),l.open("GET",o),l.send()})}function mo(o,n){for(const t in n)if(n.hasOwnProperty(t)){const e=n[t];e&&(o=o.replace(new RegExp(`var\\(${t}.*?\\)`,"g"),e))}return o=o.replace(/var\(--[a-z0-9-]+(,\s*(.*?))?\)/g,"$2"),o}function Oo(o,n){const t=n&&Lo(n),e=t?.url,l=t?.fontFamily,[a,c]=k.useState(!e||!l);return k.useLayoutEffect(()=>{if(!o||!e||!l)return;let i=!1;E(null,o,e);const u=wo(o,l,()=>{i||c(!0)});return()=>{i=!0,u()}},[o,e,l]),{loaded:a}}function E(o,n,t){const e=W(n),l=e.stylesheets.get(t);if(l)return l.loadPromise;const a=n.document.createElement("link"),c=new Promise((i,u)=>{a.dataset.userflowStylesheet="true",a.rel="stylesheet",a.href=t,a.onload=()=>{i()},a.onerror=r=>{console.log(`Userflow.js: Error installing Stylesheet ${t}:`,r),o&&o.reportCspIssue(),u()},n.document.head.appendChild(a)});return e.stylesheets.set(t,{link:a,loadPromise:c}),c}function T(o,n){const t=W(o),e=t.stylesheets.get(n);e&&(o.document.head.removeChild(e.link),t.stylesheets.delete(n))}function Lo(o){if(o.builtinFontFamily)switch(o.builtinFontFamily.provider){case H.GOOGLE:{const n=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@${n}`,fontFamily:o.builtinFontFamily.name}}case H.STANDARD:return null}else return o.fontCssUrl?{url:o.fontCssUrl,fontFamily:o.fontFamily}:null}export{Po as D,Do as a,Oo as b,po as c,zo as d,Fo as g,Uo as u};
|
|
1
|
+
import{r as k,R as y}from"./vendor.react.js";import{c as R,d as $,e as P,g as D,h as z,i as U,j as O,k as q,l as _,m as j,n as N,o as K,p as V,q as G,r as Y,s as Q,t as X,u as J,v as Z,w as oo,x as ro}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{c as no,d as to,e as eo,g as lo,h as ao,i as uo,j as co,k as io,l as so,m as fo}from"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.object-assign.js";import{S as go,b as Co,B as Bo,F as H}from"./userflow.js";import{c as bo}from"./flow-condition-types.js";import{a as ko}from"./client-context.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="ddd6c277-f0f5-427d-8219-845b3332a204",o._sentryDebugIdIdentifier="sentry-dbid-ddd6c277-f0f5-427d-8219-845b3332a204")}catch{}})();function po(o){const[n]=k.useState(()=>new go(o));return n.update(o),n}const Po=({icon:o,size:n,dataAttrs:t})=>{n=n||16;const e=typeof o=="string"&&A[o]?A[o]:o;if(typeof e=="string")return y.createElement("img",{...t,"aria-hidden":"true",src:e,width:n,height:n,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:n,height:n,viewBox:`0 0 ${l} ${a}`,...t},y.createElement("path",{fill:"currentColor",d:String(c)}))}},A={"regular/calendar-day":ro,"regular/comment-alt":oo,"regular/comments-alt":Z,"regular/envelope":J,"regular/exclamation-triangle":X,"regular/external-link":Q,"regular/file-alt":Y,"regular/graduation-cap":G,"regular/info-circle":V,"regular/lightbulb":K,"regular/megaphone":N,"regular/pencil":j,"regular/phone":_,"regular/play-circle":q,"regular/question-circle":O,"regular/route":U,"regular/shoe-prints":z,"solid/shoe-prints":fo,"solid/file-invoice":so,"solid/receipt":io,"solid/university":co,"solid/users":uo,"solid/stars":ao,"regular/tasks":D,"regular/user":P,"regular/users":$,"solid/exclamation-triangle":lo,"solid/info-circle":eo,"solid/play-circle":to,"solid/question-circle":no,"regular/user-headset":R};function wo(o,n,t){if(!o.document.fonts)return t(),()=>{};let e=!1;const l=()=>{const i=o.document.fonts.load(`100px ${n}`,"BESbswy");if(!i){c(),t();return}i.then(u=>{e||(u.length>=1?(c(),t()):window.setTimeout(l,25))},u=>{console.log("Userflow.js: observeFont error:"),console.log(u),t()})};l();const a=window.setTimeout(()=>{console.warn(`Userflow.js: Timed out waiting for font family ${n} to load. Will continue anyway.`),t()},2e3),c=()=>{e=!0,window.clearTimeout(a)};return c}function p(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,n,t]){return"#"+o.toString(16).padStart(2,"0")+n.toString(16).padStart(2,"0")+t.toString(16).padStart(2,"0")}function b(o){const n=p(o);return n?n.join(", "):"0, 0, 0"}function x(o){return v(p(o))}function ho([o,n,t]){return[Math.round(255-o),Math.round(255-n),Math.round(255-t)]}function F(o,n,t){return[Math.max(0,Math.min(255,Math.round(o[0]+(n[0]-o[0])*t))),Math.max(0,Math.min(255,Math.round(o[1]+(n[1]-o[1])*t))),Math.max(0,Math.min(255,Math.round(o[2]+(n[2]-o[2])*t)))]}function h(o,n,t){const e=p(o),l=p(n);return!e||!l?o:v(F(e,l,t))}function S([o,n,t]){o/=255,n/=255,t/=255;const e=Math.max(o,n,t),l=Math.min(o,n,t);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=(n-t)/u+(n<t?6:0);break;case n:a=(t-o)/u+2;break;default:a=(o-n)/u+4;break}a/=6}return[a,c,i]}function m([o,n,t]){let e=o/255,l=n/255,a=t/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,n){const t=m(o),e=m(n),l=.05;let i=(1-(e-t))/2*(.18-l)+l,u=1-Math.abs(e-t),r=Math.pow((1-i)*u,4),s=i+r;return Math.round(s*1e3)/1e3}function w(o,n){const t=p(o),e=S(t);let l=null,a=null;for(const g of n){const d=p(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,t),r=u*2;const s=.2;return e[2]>s&&e[2]<1-s&&(i=ho(i),r=L(i,t)),[v(F(t,c,u)),v(F(t,i,r))]}function vo(o,n,t,e){const[l,a]=w(o,[n]);let c,i;if(o===t)c=l,i=a;else{const B=w(t,[o,n,e]);c=B[0],i=B[1]}const u=p(o),r=p(t),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=n,d=o;const B=w(g,[d]);f=B[0],C=B[1]}else g=o,d=n,f=l,C=a;return[l,a,c,i,g,d,f,C]}function yo(o){const[n,t,e,l,a,c,i,u]=vo(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=n),r.brandActiveBackgroundColor||(r.brandActiveBackgroundColor=t),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.siteHeroForegroundColor||(r.siteHeroForegroundColor=r.brandForegroundColor),r.siteHeroBackgroundColor||(r.siteHeroBackgroundColor=r.brandBackgroundColor),r.siteBackgroundColor||(r.siteBackgroundColor=r.mainHoverBackgroundColor),r.siteContentForegroundColor||(r.siteContentForegroundColor=r.mainForegroundColor),r.siteContentBackgroundColor||(r.siteContentBackgroundColor=r.mainBackgroundColor),r}function Fo(o){const{questionColor:n}=o;return{"--userflow-backdrop-highlight-color-rgb":b(o.backdropHighlightColor),"--userflow-backdrop-highlight-inset":o.backdropHighlightType===Bo.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-background-color-rgb":b(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?Ao(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===Co.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(n,o.mainBackgroundColor,.5),"--userflow-question-color-lighter":h(n,o.mainBackgroundColor,.75),"--userflow-question-color-lightest":h(n,o.mainBackgroundColor,.9),"--userflow-question-color-medium-light":h(n,o.mainBackgroundColor,.15),"--userflow-question-color":n,"--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,"--userflow-site-hero-foreground-color":o.siteHeroForegroundColor,"--userflow-site-hero-background-color":o.siteHeroBackgroundColor,"--userflow-site-background-color":o.siteBackgroundColor,"--userflow-site-content-foreground-color":o.siteContentForegroundColor,"--userflow-site-content-background-color":o.siteContentBackgroundColor}}const Ho=[];function Do(o){let[n,t]=k.useState(o);const e=po(o.sessionData||Ho);return k.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}}t(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]),k.useMemo(()=>yo(n),[n])}function zo(o){return o?.cssVersion?`https://cdn.userflow.com/themes/${o.id}/stylesheets/${o.cssVersion}/custom.css`:null}function Ao(o){return`"${o.trim()}"`}const M=new Map;function W(o){let n=M.get(o);return n||(n={stylesheets:new Map},M.set(o,n)),n}function Uo(o,n,t,{uninstallOnUnmount:e}={}){const l=ko(),[a,c]=k.useState(!n);return k.useLayoutEffect(()=>{if(!o||!n)return;let i=!1,u;const r=async d=>{await E(l,o,d),u&&T(o,u),u=d};(async()=>{let d=typeof n=="string"?n:n.get();if(xo()&&t){let f=await So(d);if(i)return;f=mo(f,Fo(t)),d="data:text/css;base64,"+btoa(f)}await r(d),!i&&c(!0)})();let g=null;return typeof n!="string"&&(g=n.onUpdate(async()=>{r(n.get())})),()=>{i=!0,g&&g(),e&&u&&T(o,u)}},[l,o,n,t,e]),{loaded:a}}function xo(){return!!window.MSInputMethodContext&&!!document.documentMode}const I=new Map;function So(o){return new Promise((n,t)=>{let e=I.get(o);if(e){n(e);return}const l=new XMLHttpRequest;l.addEventListener("load",()=>{if(l.status!==200){t(new Error("Userflow.js could not fetch stylesheet: "+o));return}const a=l.responseText;I.set(o,a),n(a)}),l.addEventListener("error",()=>{t(new Error("Userflow.js could not fetch stylesheet: "+o))}),l.open("GET",o),l.send()})}function mo(o,n){for(const t in n)if(n.hasOwnProperty(t)){const e=n[t];e&&(o=o.replace(new RegExp(`var\\(${t}.*?\\)`,"g"),e))}return o=o.replace(/var\(--[a-z0-9-]+(,\s*(.*?))?\)/g,"$2"),o}function Oo(o,n){const t=n&&Lo(n),e=t?.url,l=t?.fontFamily,[a,c]=k.useState(!e||!l);return k.useLayoutEffect(()=>{if(!o||!e||!l)return;let i=!1;E(null,o,e);const u=wo(o,l,()=>{i||c(!0)});return()=>{i=!0,u()}},[o,e,l]),{loaded:a}}function E(o,n,t){const e=W(n),l=e.stylesheets.get(t);if(l)return l.loadPromise;const a=n.document.createElement("link"),c=new Promise((i,u)=>{a.dataset.userflowStylesheet="true",a.rel="stylesheet",a.href=t,a.onload=()=>{i()},a.onerror=r=>{console.log(`Userflow.js: Error installing Stylesheet ${t}:`,r),o&&o.reportCspIssue(),u()},n.document.head.appendChild(a)});return e.stylesheets.set(t,{link:a,loadPromise:c}),c}function T(o,n){const t=W(o),e=t.stylesheets.get(n);e&&(o.document.head.removeChild(e.link),t.stylesheets.delete(n))}function Lo(o){if(o.builtinFontFamily)switch(o.builtinFontFamily.provider){case H.GOOGLE:{const n=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@${n}`,fontFamily:o.builtinFontFamily.name}}case H.STANDARD:return null}else return o.fontCssUrl?{url:o.fontCssUrl,fontFamily:o.fontFamily}:null}export{Po as D,Do as a,po as b,Oo as c,zo as d,Fo as g,Uo as u};
|
|
2
2
|
//# sourceMappingURL=stylesheets.js.map
|
package/ui.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["ElementSelectionApp.js","vendor.react.js","vendor.
|
|
2
|
-
import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["ElementSelectionApp.js","vendor.react.js","vendor.object-assign.js","vendor.is-hotkey.js","vendor.obj-str.js","roots.js","userflow.js","vendor.phoenix.js","vendor.uuid.js","client-context.js","vendor.i18next.js","vendor.babel.runtime.js","vendor.react-i18next.js","use-window-resize.js","BuilderBar.js","Frame.js","vendor.react-dom.js","vendor.scheduler.js","stylesheets.js","vendor.fortawesome.pro-regular-svg-icons.js","vendor.fortawesome.pro-solid-svg-icons.js","flow-condition-types.js","vendor.date-fns.js","iframe-reset.styl.js","logomark.js","vendor.fortawesome.pro-light-svg-icons.js","SmartFlowRecordingApp.js","FlowApp.js","vendor.lodash.js","FlowChrome.js","flow-host.styl.js","use-selector-element-monitoring.js","use-confetti.js","vendor.canvas-confetti.js","TreeDoc.js","Trigger.js","steps.js","WorkflowApp.js","ChecklistApp.js","ChecklistUI.js","EmbedApp.js","use-element-rect.js","ResourceCenterLauncherHandler.js","ResourceCenterApp.js","AnnouncementEngagement.js","vendor.memoize-one.js","vendor.bignumber.js.js","LauncherApp.js","NotificationsApp.js","TrackerTestingApp.js","StartConditionTestingApp.js","Popover.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as s,R as e}from"./vendor.react.js";import{r as C}from"./vendor.react-dom.js";import{u as N,i as $,U as W}from"./client-context.js";import{R as J,_ as o,I as j,J as q,U as G}from"./userflow.js";import"./vendor.object-assign.js";import{I as K}from"./vendor.react-i18next.js";import"./vendor.scheduler.js";import"./vendor.i18next.js";import"./vendor.babel.runtime.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="35de5746-3a44-48ae-a5a8-d7c68fabdc7a",t._sentryDebugIdIdentifier="sentry-dbid-35de5746-3a44-48ae-a5a8-d7c68fabdc7a")}catch{}})();const M=e.lazy(()=>o(()=>import("./ElementSelectionApp.js"),__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]))),Q=e.lazy(()=>o(()=>import("./SmartFlowRecordingApp.js"),__vite__mapDeps([26,1,2,4,9,10,11,12,14,15,16,17,18,19,20,6,7,8,21,22,5,23,24,25,13]))),X=e.lazy(()=>o(()=>import("./FlowApp.js"),__vite__mapDeps([27,1,2,6,7,8,28,12,11,29,19,18,20,21,22,5,9,10,15,16,17,23,30,31,13,24,4,32,33,34,35,36]))),Y=e.lazy(()=>o(()=>import("./WorkflowApp.js"),__vite__mapDeps([37,1,2,6,7,8,36,9,10,11,12,5,34,21,22,18,19,20,4,30,29,15,16,17,23,31,13,24,32,33]))),Z=e.lazy(()=>o(()=>import("./ChecklistApp.js"),__vite__mapDeps([38,1,2,6,7,8,29,19,18,20,21,22,11,5,9,10,12,15,16,17,23,30,31,13,24,4,32,33,39,34]))),ee=e.lazy(j),te=e.lazy(()=>o(()=>import("./EmbedApp.js"),__vite__mapDeps([40,1,2,6,7,8,9,10,11,12,4,18,19,20,21,22,5,34,30,31,16,17,15,23,41,13,39]))),ne=e.lazy(q),se=e.lazy(()=>o(()=>import("./ResourceCenterLauncherHandler.js"),__vite__mapDeps([42,1,2,6,7,8,9,10,11,12,31,21,22,5,18,19,20,43,30,34,4,15,16,17,23,13,24,39,29,32,33,44,45,46,41]))),oe=e.lazy(()=>o(()=>import("./LauncherApp.js"),__vite__mapDeps([47,1,2,6,7,8,31,21,22,11,5,34,18,19,20,9,10,12,4,30,29,15,16,17,23,13,24,32,33,35]))),re=e.lazy(()=>o(()=>import("./NotificationsApp.js"),__vite__mapDeps([48,1,2,9,10,11,12,30,6,7,8,18,19,20,21,22,5]))),ie=e.lazy(()=>o(()=>import("./TrackerTestingApp.js"),__vite__mapDeps([49,1,2,9,10,11,12,14,15,16,17,18,19,20,6,7,8,21,22,5,23,24,4,25,13]))),ae=e.lazy(()=>o(()=>import("./StartConditionTestingApp.js"),__vite__mapDeps([50,1,2,9,10,11,12,14,15,16,17,18,19,20,6,7,8,21,22,5,23,24,4,25,13,51]))),ce=()=>{const t=N(),[n,p]=s.useState(t.getSessionStorageState()),[a,S]=s.useState(()=>m()?null:t.flowSession),[l,w]=s.useState(t.workflowSession),[i,v]=s.useState(t.checklistSession),[E,A]=s.useState(t.checklistExpanded),[u,g]=s.useState(t.bannerSession),[c,L]=s.useState(t.resourceCenterSession),[f,R]=s.useState(t.resourceCenterOpen),[d,I]=s.useState(t.resourceCenterLauncherHidden),[h,T]=s.useState(t.resourceCenterEmbedsChecklist()),[D,O]=s.useState(t.embedChecklistSessions()),[P,z]=s.useState(t.launcherSessions),[F,V]=s.useState(t.activeLauncherFlowId),[_,x]=s.useState(t.notifications),[U,H]=s.useState(t.embedSessions);s.useEffect(()=>{const r=()=>{p(t.getSessionStorageState()),S(B=>m()&&t.flowSession?.id!==B?.id?null:t.flowSession),v(t.checklistSession),A(t.checklistExpanded),g(t.bannerSession),L(t.resourceCenterSession),R(t.resourceCenterOpen),I(t.resourceCenterLauncherHidden),T(t.resourceCenterEmbedsChecklist()),O(t.embedChecklistSessions()),z(t.launcherSessions),V(t.activeLauncherFlowId),x(t.notifications),H(t.embedSessions),w(t.workflowSession)};t.on("uistatechange",r);const y=()=>{m()||S(t.flowSession)};return document.addEventListener("visibilitychange",y),()=>{t.off("uistatechange",r),document.removeEventListener("visibilitychange",y)}},[t]);const b=!n.activeApp&&!!a,k=c?.version.resourceCenter?.launcherType;return s.useLayoutEffect(()=>{if(b)return t.emit("flowvisibilitychange",!0),()=>{t.emit("flowvisibilitychange",!1)}},[t,b]),n.activeApp==="elementSelection"&&n.elementSelection?e.createElement(e.Suspense,{fallback:null},e.createElement(M,{state:n.elementSelection})):n.activeApp==="trackerTesting"&&n.trackerTesting?e.createElement(e.Suspense,{fallback:null},e.createElement(ie,{state:n.trackerTesting})):n.activeApp==="smartFlowRecording"&&n.smartFlowRecording?e.createElement(e.Suspense,{fallback:null},e.createElement(Q,{state:n.smartFlowRecording})):e.createElement(e.Fragment,null,l&&e.createElement(e.Suspense,{fallback:null},e.createElement(Y,{key:l.id,session:l})),a&&e.createElement(e.Suspense,{fallback:null},e.createElement(X,{key:a.id,session:a,checklistSession:i,resourceCenterEmbedsChecklist:h})),i&&!h&&!D&&(E||i.version.checklist?.launcherEnabled)&&e.createElement(e.Suspense,{fallback:null},e.createElement(Z,{key:i.id,session:i,checklistExpanded:E})),u&&e.createElement(e.Suspense,{fallback:null},e.createElement(ee,{key:u.id,session:u})),c&&e.createElement(e.Fragment,null,e.createElement(e.Suspense,{fallback:null},e.createElement(ne,{key:`${c.id}-${d}-${k}`,session:c,isOpen:f,flowSession:a,checklistSession:i,resourceCenterLauncherHidden:d})),k!==J.DEFAULT&&e.createElement(e.Suspense,{fallback:null},e.createElement(se,{session:c,isOpen:f,flowSession:a,resourceCenterLauncherHidden:d}))),e.createElement(e.Suspense,{fallback:null},P.map(r=>e.createElement(oe,{key:r.flow.id,session:r,active:r.flow.id===F}))),_.length>0&&e.createElement(e.Suspense,{fallback:null},e.createElement(re,{notifications:_})),n.activeApp==="startConditionTesting"&&n.testStartConditionToken&&e.createElement(e.Suspense,{fallback:null},e.createElement(ae,{token:n.testStartConditionToken})),U.map(r=>e.createElement(e.Suspense,{key:r.id,fallback:null},e.createElement(te,{session:r,checklistSession:i,type:"embed"}))))};function m(){return document.visibilityState==="hidden"}const le=({client:t})=>e.createElement(K,{i18n:$},e.createElement(W.Provider,{value:t},e.createElement(ce,null)));class ye{constructor(n){this.client=n}mount(){if(this.container)throw new G("UI has already been mounted");this.container=document.createElement("div"),this.container.id="userflow-ui",document.body.appendChild(this.container),C.render(e.createElement(le,{client:this.client}),this.container)}unmount(){this.container&&(C.unmountComponentAtNode(this.container),document.body.contains(this.container)&&document.body.removeChild(this.container),delete this.container)}}export{ye as RealUI};
|
|
3
3
|
//# sourceMappingURL=ui.js.map
|
package/use-confetti.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as T}from"./vendor.react.js";import{
|
|
1
|
+
import{r as T}from"./vendor.react.js";import{p as g}from"./userflow.js";import{c as E}from"./vendor.canvas-confetti.js";import{a as C}from"./roots.js";import"./vendor.object-assign.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]="60c745b7-d7a0-40a6-900c-6f42864db9bd",o._sentryDebugIdIdentifier="sentry-dbid-60c745b7-d7a0-40a6-900c-6f42864db9bd")}catch{}})();const r={PARTICLE_COUNT:400,ANIMATION_DELAY:400,DEFAULT_SPREAD:360,DEFAULT_GRAVITY:1,DEFAULT_TICKS:100,DEFAULT_Z_INDEX:5,TOOLTIP_DECAY:.85,TOOLTIP_START_VELOCITY:30},l={particleCount:r.PARTICLE_COUNT,spread:r.DEFAULT_SPREAD,gravity:r.DEFAULT_GRAVITY,ticks:r.DEFAULT_TICKS,angle:90,zIndex:r.DEFAULT_Z_INDEX,disableForReducedMotion:!0},I=o=>{if(!o)return{x:.5,y:.5};const t=o.getBoundingClientRect();return{x:t.left>=0?(t.left+t.width/2)/window.innerWidth:.5,y:t.top>=0?(t.top+t.height/2)/window.innerHeight:.5}},A=o=>{const t=C(o);if(t){const e=o.getBoundingClientRect(),n=t.getBoundingClientRect(),i=t.ownerDocument.defaultView,c=i?.innerWidth||1,s=i?.innerHeight||1;return{x:(n.left+e.left+e.width/2)/c,y:(n.top+e.top+e.height/2)/s}}return I(o)},h=({bubbleFrame:o,isBubbleVisible:t,theme:e,stepType:n,onAnimationComplete:i,confettiDelay:c,zIndex:s})=>{const[a,d]=T.useState(!1);return T.useEffect(()=>{if(!t||!a||!e.confettiColors||e.confettiColors.length===0)return;const u=setTimeout(()=>{try{const f=I(o),_={...l,colors:e.confettiColors||void 0,origin:f,zIndex:s??r.DEFAULT_Z_INDEX,...n===g.TOOLTIP&&{decay:r.TOOLTIP_DECAY,startVelocity:r.TOOLTIP_START_VELOCITY}};E(_)}catch(f){console.warn("Error launching confetti:",f)}finally{i?.(),d(!1)}},c);return()=>clearTimeout(u)},[t,a,e.confettiColors,o,n,i,c,s]),{startConfetti:d}},y=(o,t,e)=>{try{const n=A(o);E({...l,...e,origin:n,colors:t||void 0})}catch(n){console.warn("Error launching confetti:",n)}};export{y as f,h as u};
|
|
2
2
|
//# sourceMappingURL=use-confetti.js.map
|
package/use-element-rect.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as n}from"./vendor.react.js";import{u as
|
|
1
|
+
import{r as n}from"./vendor.react.js";import{u as d}from"./use-window-resize.js";import"./vendor.object-assign.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="4a20c6de-e837-46ef-86db-b7c541fe1814",e._sentryDebugIdIdentifier="sentry-dbid-4a20c6de-e837-46ef-86db-b7c541fe1814")}catch{}})();function y(){const[e,s]=n.useState(null),[r,u]=n.useState(0),[i,c]=n.useState(0),o=n.useCallback(()=>{if(!e||!e.isConnected||!e.ownerDocument){u(0),c(0);return}try{const t=e.offsetWidth,f=e.offsetHeight;t>=0&&f>=0&&(t!==r||f!==i)&&(u(t),c(f))}catch{u(0),c(0)}},[e,r,i]);return n.useLayoutEffect(()=>{if(!e||typeof MutationObserver!="function")return;const t=new MutationObserver(o);return t.observe(e,{childList:!0,attributes:!0,subtree:!0}),()=>{t.disconnect()}},[e,o]),n.useLayoutEffect(()=>{o()}),d(o),{width:r,height:i,setEl:s}}export{y as u};
|
|
2
2
|
//# sourceMappingURL=use-element-rect.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as i}from"./vendor.react.js";import{o as _}from"./flow-condition-types.js";import{l as O,
|
|
1
|
+
import{r as i}from"./vendor.react.js";import{o as _}from"./flow-condition-types.js";import{l as O,m as S,p as B,r as M,q as H,s as x,k as Z,j}from"./roots.js";import"./vendor.object-assign.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]="37293af6-2e92-4f30-9e30-08020b09c899",e._sentryDebugIdIdentifier="sentry-dbid-37293af6-2e92-4f30-9e30-08020b09c899")}catch{}})();const X=new URL("bubble-frame.css",import.meta.url).href;let w=!1;const c=[];let u=[],D;function G(e){c.push(e),c.length===1&&(w=!0,I(),window.addEventListener("scroll",q))}function N(e){const t=c.indexOf(e);t>=0&&(c.splice(t,1),c.length===0&&(w=!1,window.cancelAnimationFrame(D),window.removeEventListener("scroll",q)))}function Y(e){u.push(e)}function P(){c.forEach(e=>e()),u.length>0&&(u.forEach(e=>e()),u=[]),I()}function I(){w&&(D=window.requestAnimationFrame(P))}function q(){}function $({selector:e,targetMoved:t,targetLost:s,onTargetClick:o,onTargetMouseEnter:b,onTargetMouseLeave:R}){const L=i.useRef(t),k=i.useRef(s),m=i.useRef(o),d=i.useRef(b),h=i.useRef(R);i.useLayoutEffect(()=>{L.current=t,k.current=s,m.current=o,d.current=b,h.current=R}),i.useLayoutEffect(()=>{let n=null,a=null,f=null,y=!1;const v=()=>{n=null,a=null,f=null,k.current()};if(!e){v();return}const A=()=>{if(!f||!n)return;const r=M(n);(!a||!U(a,r))&&(a=r,r.width===0&&r.height===0?v():L.current({targetEl:n,targetRect:a,clipEl:f,viewportClipRect:V(f)}))};let l=!1;const T=()=>{l||(l=!0,G(A))},C=()=>{l&&(l=!1,N(A))},g=()=>{m.current&&m.current()},p=()=>{d.current&&d.current()},E=()=>{h.current&&h.current()},F=()=>{const r=n;n=O(e)?e:S(e),(!y||n!==r)&&(r&&(r.removeEventListener("click",g),r.removeEventListener("mouseenter",p),r.removeEventListener("mouseleave",E)),n?(T(),n.addEventListener("click",g),n.addEventListener("mouseenter",p),n.addEventListener("mouseleave",E),f=B(n)):(C(),v())),y=!0};F();const W=_(F);return()=>{W.disconnect(),C(),n&&(n.removeEventListener("click",g),n.removeEventListener("mouseenter",p),n.removeEventListener("mouseleave",E))}},[e])}function U(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function V(e){H();const t=x(Z()),s=x(j());if(!e||e===document.documentElement)return{top:0,right:s,bottom:t,left:0};{const o=M(e);return{top:Math.max(0,o.top),right:Math.min(s,o.right),bottom:Math.min(t,o.bottom),left:Math.max(0,o.left)}}}export{X as b,Y as r,$ as u};
|
|
2
2
|
//# sourceMappingURL=use-selector-element-monitoring.js.map
|
package/use-window-resize.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r}from"./vendor.react.js";import"./vendor.
|
|
1
|
+
import{r}from"./vendor.react.js";import"./vendor.object-assign.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="93340621-a1ab-460b-a7f7-856c71c9dc62",e._sentryDebugIdIdentifier="sentry-dbid-93340621-a1ab-460b-a7f7-856c71c9dc62")}catch{}})();function o(e){r.useLayoutEffect(()=>{let n;const t=()=>{window.cancelAnimationFrame(n),n=window.requestAnimationFrame(e)};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),window.cancelAnimationFrame(n)}},[e])}export{o as u};
|
|
2
2
|
//# sourceMappingURL=use-window-resize.js.map
|