userflow.js-self-hosted 0.1.1025759 → 0.1.1025842

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/hash.txt CHANGED
@@ -1 +1 @@
1
- 96e13217db273b473d5196c35e1932f6a42ff0cd
1
+ 9f63ea748ab488610d9872f02aff7281ef73bd1e
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "userflow.js-self-hosted",
3
- "version": "0.1.1025759",
3
+ "version": "0.1.1025842",
4
4
  "description": "Self-hosted version of Userflow.js",
5
5
  "main": "userflow.js"
6
6
  }
package/userflow.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["ResourceCenterApp.js","vendor.react.js","vendor.object-assign.js","client-context.js","vendor.i18next.js","vendor.babel.runtime.js","vendor.react-i18next.js","flow-host.styl.js","TreeDoc.js","flow-condition-types.js","vendor.date-fns.js","roots.js","stylesheets.js","vendor.fortawesome.pro-regular-svg-icons.js","vendor.fortawesome.pro-solid-svg-icons.js","vendor.obj-str.js","use-selector-element-monitoring.js","Frame.js","vendor.react-dom.js","vendor.scheduler.js","iframe-reset.styl.js","use-window-resize.js","logomark.js","ChecklistUI.js","FlowChrome.js","use-confetti.js","vendor.canvas-confetti.js","AnnouncementEngagement.js","vendor.memoize-one.js","vendor.bignumber.js.js","use-element-rect.js","resource-center-route.js","BannerApp.js","vendor.phoenix.js","vendor.uuid.js","SitePage.js","vendor.react-router-dom.js","vendor.react-router.js","vendor.prop-types.js","vendor.history.js","vendor.resolve-pathname.js","vendor.value-equal.js","vendor.tiny-invariant.js","vendor.mini-create-react-context.js","vendor.path-to-regexp.js","vendor.react-is.js","Popover.js","react-hooks.js","vendor.lodash.js","implicit-tracking.js","DebuggerUI.js","ui.js"])))=>i.map(i=>d[i]);
2
2
  import"./vendor.object-assign.js";import{S as J}from"./vendor.phoenix.js";import{v as b}from"./vendor.uuid.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]="36fa7c4f-8d7f-48bc-8bfa-a0f5d0770ceb",e._sentryDebugIdIdentifier="sentry-dbid-36fa7c4f-8d7f-48bc-8bfa-a0f5d0770ceb")}catch{}})();const Q="modulepreload",X=function(e){return new URL("./",import.meta.url).toString()+e},D={},I=function(t,s,n){let i=Promise.resolve();if(s&&s.length>0){let u=function(c){return Promise.all(c.map(E=>Promise.resolve(E).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");i=u(s.map(c=>{if(c=X(c),c in D)return;D[c]=!0;const E=c.endsWith(".css"),g=E?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${g}`))return;const T=document.createElement("link");if(T.rel=E?"stylesheet":Q,E||(T.as="script"),T.crossOrigin="",T.href=c,l&&T.setAttribute("nonce",l),document.head.appendChild(T),E)return new Promise((Y,z)=>{T.addEventListener("load",Y),T.addEventListener("error",()=>z(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return i.then(a=>{for(const l of a||[])l.status==="rejected"&&r(l.reason);return t().catch(r)})};class h extends Error{constructor(t,s,n){super(t),Object.setPrototypeOf(this,h.prototype),this.name="UserflowError",this.code=s,this.humanMessage=n}}class G{constructor(t){this.type=t,this.testState={}}formatKey(t){return`userflow:${t}`}isSupported(){if(typeof window>"u")return!1;try{return window[this.type]!=null}catch{return!1}}getItem(t){return t=this.formatKey(t),this.isSupported()?window[this.type].getItem(t):null}setItem(t,s){t=this.formatKey(t);{if(!this.isSupported())return;window[this.type].setItem(t,s)}}removeItem(t){return t=this.formatKey(t),this.isSupported()?window[this.type].removeItem(t):void 0}clear(){return this.isSupported()?window[this.type].clear():void 0}}const C=new G("localStorage"),d=new G("sessionStorage");function ft(e){window.location.href=e}function m(){return window.location.href}function A(e){window.postMessage(e,window.origin)}function x(e){const t=n=>{if(n.source!==window||n.origin!==window.origin)return;const i=n.data;!i||typeof i!="object"||typeof i.kind!="string"||!i.kind.startsWith("userflow:")||e(i)===!0&&s()};window.addEventListener("message",t);const s=()=>window.removeEventListener("message",t);return s}function Z(e){return new Promise(t=>{x(s=>{const n=e(s);return n?(t(n),!0):!1})})}const v=new Set;let y=!1;function q(e){return ee(),v.add(e),()=>{F(e)}}function F(e){v.delete(e)}function k(){v.forEach(e=>e())}function ee(){if(y)return;y=!0;const{history:e}=window,t=s=>{const n=e[s];e[s]=(...i)=>{const r=n.apply(e,i);return k(),r}};window.__userflowStatePatched?(window.addEventListener("userflow:pushstate",()=>{k()}),window.addEventListener("userflow:replacestate",()=>{k()})):(t("pushState"),t("replaceState")),window.addEventListener("popstate",()=>{k()})}class te{destroy(){this.unregisterOnMessage&&this.unregisterOnMessage()}postBuilderMessage(t){A({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:t})}onBuilderMessage(t){return this.unregisterOnMessage=x(t),!1}async captureScreenshot(t,s,n,i){return A({kind:"userflow:crxScreenshot",x:t,y:s,width:n,height:i,devicePixelRatio:window.devicePixelRatio}),(await Z(a=>a.kind==="userflow:crxScreenshotResult"?a:null)).imageDataUrl}}var U=(e=>(e.ACTION="ACTION",e.ELEMENT_MISSING="ELEMENT_MISSING",e.LAUNCHER_DEACTIVATED="LAUNCHER_DEACTIVATED",e.WORKFLOW_TIMED_OUT="WORKFLOW_TIMED_OUT",e.REPLACED="REPLACED",e.SNOOZED="SNOOZED",e.TOOLTIP_TARGET_MISSING="TOOLTIP_TARGET_MISSING",e.USERFLOWJS="USERFLOWJS",e.USER_CLOSED="USER_CLOSED",e))(U||{}),se=(e=>(e.POSITIVE="POSITIVE",e.NEUTRAL="NEUTRAL",e.NEGATIVE="NEGATIVE",e))(se||{}),ie=(e=>(e.USER_INPUT_TIMEOUT="USER_INPUT_TIMEOUT",e.STEP_TIMEOUT="STEP_TIMEOUT",e))(ie||{}),ne=(e=>(e.SECOND="SECOND",e.MINUTE="MINUTE",e.HOUR="HOUR",e.DAY="DAY",e))(ne||{}),p=(e=>(e.ACTION="ACTION",e.DRAFT="DRAFT",e.LINK="LINK",e.LAUNCHER_SEEN="LAUNCHER_SEEN",e.RESOURCE_CENTER="RESOURCE_CENTER",e.USERFLOWJS="USERFLOWJS",e.ASSISTANT="ASSISTANT",e))(p||{}),re=(e=>(e.LIKE="LIKE",e.DISLIKE="DISLIKE",e))(re||{}),S=(e=>(e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.DATETIME="DATETIME",e.LIST="LIST",e.RANDOM_AB="RANDOM_AB",e.RANDOM_NUMBER="RANDOM_NUMBER",e.CHECKLIST_TASK="CHECKLIST_TASK",e.FLOW="FLOW",e.FLOW_SESSION="FLOW_SESSION",e.FLOW_STEP="FLOW_STEP",e.FLOW_VERSION="FLOW_VERSION",e))(S||{}),L=(e=>(e.FLOW="FLOW",e.BANNER="BANNER",e.EMBED="EMBED",e.CHECKLIST="CHECKLIST",e.LAUNCHER="LAUNCHER",e.RESOURCE_CENTER="RESOURCE_CENTER",e.SITE="SITE",e.WORKFLOW="WORKFLOW",e))(L||{}),oe=(e=>(e.ALWAYS_TRUE="ALWAYS_TRUE",e.ATTRIBUTE="ATTRIBUTE",e.CHECKLIST_TASK_CLICKED="CHECKLIST_TASK_CLICKED",e.CLAUSE="CLAUSE",e.ELEMENT="ELEMENT",e.EVENT="EVENT",e.FILLED_IN_INPUT="FILLED_IN_INPUT",e.FLOW="FLOW",e.INPUT_VALUE="INPUT_VALUE",e.PAGE="PAGE",e.SEGMENT="SEGMENT",e.TIME="TIME",e))(oe||{}),ae=(e=>(e.AUTO="AUTO",e.MANUAL="MANUAL",e))(ae||{}),ce=(e=>(e.INPUT="INPUT",e))(ce||{}),le=(e=>(e.ABSOLUTE_EQ="ABSOLUTE_EQ",e.ABSOLUTE_GT="ABSOLUTE_GT",e.ABSOLUTE_LT="ABSOLUTE_LT",e.AND="AND",e.BETWEEN="BETWEEN",e.CONTAINS="CONTAINS",e.EMPTY="EMPTY",e.ENDS_WITH="ENDS_WITH",e.EQ="EQ",e.EXCLUDES_ALL="EXCLUDES_ALL",e.EXCLUDES_ANY="EXCLUDES_ANY",e.FALSE="FALSE",e.GT="GT",e.GTE="GTE",e.INCLUDES_ALL="INCLUDES_ALL",e.INCLUDES_ANY="INCLUDES_ANY",e.LT="LT",e.LTE="LTE",e.NE="NE",e.NOT_CONTAINS="NOT_CONTAINS",e.NOT_EMPTY="NOT_EMPTY",e.NOT_REGEX="NOT_REGEX",e.OR="OR",e.REGEX="REGEX",e.RELATIVE_EQ="RELATIVE_EQ",e.RELATIVE_GT="RELATIVE_GT",e.RELATIVE_LT="RELATIVE_LT",e.STARTS_WITH="STARTS_WITH",e.TRUE="TRUE",e.URL="URL",e))(le||{}),ue=(e=>(e.CLICK="CLICK",e.DISABLED="DISABLED",e.MOUSEDOWN="MOUSEDOWN",e.NOT_CLICK="NOT_CLICK",e.NOT_DISABLED="NOT_DISABLED",e.NOT_PRESENT="NOT_PRESENT",e.PRESENT="PRESENT",e))(ue||{}),he=(e=>(e.END_USER="END_USER",e.GROUP="GROUP",e))(he||{}),de=(e=>(e.BETWEEN="BETWEEN",e.EQ="EQ",e.GTE="GTE",e.LTE="LTE",e))(de||{}),fe=(e=>(e.ANY="ANY",e.RELATIVE_BETWEEN="RELATIVE_BETWEEN",e.RELATIVE_GT="RELATIVE_GT",e.RELATIVE_LT="RELATIVE_LT",e))(fe||{}),Ee=(e=>(e.CURRENT_USER="CURRENT_USER",e.CURRENT_USER_CURRENT_GROUP="CURRENT_USER_CURRENT_GROUP",e.CURRENT_GROUP="CURRENT_GROUP",e))(Ee||{}),Se=(e=>(e.ASSET="ASSET",e.CARTOON="CARTOON",e.NONE="NONE",e.URL="URL",e))(Se||{}),Te=(e=>(e.INSIDE="INSIDE",e.OUTSIDE="OUTSIDE",e))(Te||{}),Ie=(e=>(e.TOP_LEFT="TOP_LEFT",e.TOP_CENTER="TOP_CENTER",e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_RIGHT="BOTTOM_RIGHT",e.BOTTOM_CENTER="BOTTOM_CENTER",e.BOTTOM_LEFT="BOTTOM_LEFT",e.CENTER="CENTER",e))(Ie||{}),ge=(e=>(e.GOOGLE="GOOGLE",e.STANDARD="STANDARD",e))(ge||{}),we=(e=>(e.DISMISS_FIRST_MENU_AFTER="DISMISS_FIRST_MENU_AFTER",e.DISMISS="DISMISS",e))(we||{}),Ce=(e=>(e.DISMISS="DISMISS",e.NONE="NONE",e))(Ce||{}),ke=(e=>(e.DEFAULT="DEFAULT",e.NARROW="NARROW",e.CHAINED_SQUARED="CHAINED_SQUARED",e.CHAINED_ROUNDED="CHAINED_ROUNDED",e.DOTTED="DOTTED",e.NUMBERED="NUMBERED",e))(ke||{}),me=(e=>(e.TOP="TOP",e.BOTTOM="BOTTOM",e))(me||{}),Ue=(e=>(e.DEFAULT="DEFAULT",e.PLAINTEXT="PLAINTEXT",e.CUSTOM="CUSTOM",e))(Ue||{}),Le=(e=>(e.CHECKLIST_OVERRIDE="CHECKLIST_OVERRIDE",e.RESOURCE_CENTER_ONLY="RESOURCE_CENTER_ONLY",e.NONE="NONE",e))(Le||{}),pe=(e=>(e.BUBBLE="BUBBLE",e.END="END",e.ERROR="ERROR",e.FLAG="FLAG",e))(pe||{}),_e=(e=>(e.MANUAL="MANUAL",e.NONE="NONE",e.SYNTHETIC="SYNTHETIC",e))(_e||{}),Ne=(e=>(e.BUBBLE="BUBBLE",e.HIDDEN="HIDDEN",e.MODAL="MODAL",e.TOOLTIP="TOOLTIP",e))(Ne||{}),Ae=(e=>(e.ABOVE="ABOVE",e.BELOW="BELOW",e.LEFT="LEFT",e.RIGHT="RIGHT",e))(Ae||{}),Re=(e=>(e.CLOSE_FLOW="CLOSE_FLOW",e.EVAL_JS="EVAL_JS",e.GO_TO_STEP="GO_TO_STEP",e.NAVIGATE="NAVIGATE",e.SET_ATTRIBUTE="SET_ATTRIBUTE",e.SNOOZE="SNOOZE",e.START_FLOW="START_FLOW",e.TRACK_BUTTON_EVENT="TRACK_BUTTON_EVENT",e))(Re||{}),ve=(e=>(e.NEW_TAB="NEW_TAB",e.SAME_TAB="SAME_TAB",e))(ve||{}),Oe=(e=>(e.SET="SET",e.SET_DATETIME="SET_DATETIME",e.SET_DATETIME_ONCE="SET_DATETIME_ONCE",e.SET_ONCE="SET_ONCE",e.ADD="ADD",e.SUBTRACT="SUBTRACT",e.APPEND="APPEND",e.PREPEND="PREPEND",e.REMOVE="REMOVE",e.UNSET="UNSET",e))(Oe||{}),be=(e=>(e.MULTILINE_TEXT="MULTILINE_TEXT",e.MULTIPLE_CHOICE="MULTIPLE_CHOICE",e.NPS="NPS",e.SCALE="SCALE",e.STARS="STARS",e.TEXT="TEXT",e))(be||{}),De=(e=>(e.CLICK="CLICK",e.FILL="FILL",e.NAVIGATE="NAVIGATE",e))(De||{}),R=(e=>(e.ACTION="ACTION",e.ANNOUNCEMENTS="ANNOUNCEMENTS",e.ASSISTANT="ASSISTANT",e.CHECKLIST="CHECKLIST",e.CONTACT="CONTACT",e.DIVIDER="DIVIDER",e.FLOWS="FLOWS",e.KNOWLEDGE_BASE="KNOWLEDGE_BASE",e.MESSAGE="MESSAGE",e.SUBPAGE="SUBPAGE",e))(R||{}),ye=(e=>(e.CRISP="CRISP",e.CUSTOM="CUSTOM",e.FRESHCHAT="FRESHCHAT",e.HELPSCOUT="HELPSCOUT",e.HUBSPOT="HUBSPOT",e.INTERCOM="INTERCOM",e.ZENDESK="ZENDESK",e.ZENDESK_MESSENGER="ZENDESK_MESSENGER",e))(ye||{}),Me=(e=>(e.BUTTON="BUTTON",e.INPUT="INPUT",e))(Me||{}),Pe=(e=>(e.EMAIL="EMAIL",e.PHONE="PHONE",e.CHAT="CHAT",e))(Pe||{}),Be=(e=>(e.SILENT="SILENT",e.BADGE="BADGE",e.POPOUT="POPOUT",e.MODAL="MODAL",e.TOAST="TOAST",e))(Be||{}),He=(e=>(e.DEFAULT="DEFAULT",e.CUSTOM="CUSTOM",e.NONE="NONE",e))(He||{}),We=(e=>(e.LAUNCHER_CLICK="LAUNCHER_CLICK",e.LAUNCHER_HOVER="LAUNCHER_HOVER",e.TARGET_CLICK="TARGET_CLICK",e.TARGET_HOVER="TARGET_HOVER",e.LAUNCHER_TARGET_CLICK="LAUNCHER_TARGET_CLICK",e.LAUNCHER_TARGET_HOVER="LAUNCHER_TARGET_HOVER",e))(We||{}),V=(e=>(e.ACTIVATE="ACTIVATE",e.DEACTIVATE="DEACTIVATE",e.NEVER="NEVER",e))(V||{}),Ge=(e=>(e.AUTO="AUTO",e.TOP="TOP",e.RIGHT="RIGHT",e.BOTTOM="BOTTOM",e.LEFT="LEFT",e))(Ge||{}),xe=(e=>(e.START="START",e.CENTER="CENTER",e.END="END",e))(xe||{}),Fe=(e=>(e.PERCENT="PERCENT",e.PX="PX",e))(Fe||{}),Ve=(e=>(e.BEACON="BEACON",e.BUTTON="BUTTON",e.HIDDEN="HIDDEN",e.ICON="ICON",e))(Ve||{}),Ke=(e=>(e.LAUNCHER="LAUNCHER",e.TARGET="TARGET",e))(Ke||{}),$e=(e=>(e.BODY_FIRST="BODY_FIRST",e.BODY_LAST="BODY_LAST",e.ELEMENT_FIRST="ELEMENT_FIRST",e.ELEMENT_LAST="ELEMENT_LAST",e.ELEMENT_BEFORE="ELEMENT_BEFORE",e.ELEMENT_AFTER="ELEMENT_AFTER",e))($e||{}),je=(e=>(e.BODY_FIRST="BODY_FIRST",e.BODY_LAST="BODY_LAST",e.ELEMENT_FIRST="ELEMENT_FIRST",e.ELEMENT_LAST="ELEMENT_LAST",e.ELEMENT_BEFORE="ELEMENT_BEFORE",e.ELEMENT_AFTER="ELEMENT_AFTER",e))(je||{}),K=(e=>(e.CHECKLIST="CHECKLIST",e))(K||{}),Ye=(e=>(e.INITIAL="INITIAL",e.FOLLOWUP="FOLLOWUP",e))(Ye||{}),ze=(e=>(e.FLOW="FLOW",e.WORKFLOW="WORKFLOW",e))(ze||{}),Je=(e=>(e.HIDE="HIDE",e.OTHERS="OTHERS",e))(Je||{}),Qe=(e=>(e.ALWAYS="ALWAYS",e.MULTIPLE="MULTIPLE",e.NEVER="NEVER",e.ONCE="ONCE",e.ONCE_PER_GROUP="ONCE_PER_GROUP",e))(Qe||{}),Xe=(e=>(e.NONE="NONE",e.PENDING_SCHEDULE="PENDING_SCHEDULE",e.SCHEDULED="SCHEDULED",e.FIRED="FIRED",e))(Xe||{}),Ze=(e=>(e.NONE="NONE",e.LIKE="LIKE",e.SCALE="SCALE",e))(Ze||{}),qe=(e=>(e.HIDE="HIDE",e.BLOCK="BLOCK",e.OTHERS="OTHERS",e))(qe||{});function et(){return{customInputs:[],customNavigate:null,urlFilter:null,linkUrlDecorator:null,customScrollIntoView:null,scrollPadding:null,inferenceAttributeNames:["data-for","data-id","data-testid","data-test-id","for","id","name","placeholder","role"],inferenceAttributeFilters:{id:[e=>!e.match(/\d$/)],"data-id":[e=>!e.match(/\d$/)]},inferenceClassNameFilters:[e=>!e.startsWith("css-")],baseZIndex:1234500,evalJsDisabled:!1}}const f=et();function M(e){return Array.isArray(e)||(e=e?[e]:[]),e=e.map(t=>typeof t=="string"?new RegExp(t):t),e}function Et(e,t){return e.every(s=>typeof s=="function"?s(t):s instanceof RegExp?s.test(t):!0)}function tt(){let e=m();if(f.urlFilter){if(e=f.urlFilter(e),typeof e!="string")throw new h("Userflow.js: URL filter returned non-string value. Please check your userflow.setUrlFilter() implementation.");try{new URL(e)}catch(t){throw new h(`Userflow.js: URL filter returned an invalid URL. Please check your userflow.setUrlFilter() implementation.
3
3
  Returned URL: `+e+`
4
- Error message: `+t.message)}}return e}let $="";try{$=localStorage.getItem("debug")||""}catch{}const j=$.split(",").some(e=>e==="*"||e.startsWith("userflow:*")),o=O("log");o.group=O("group");o.groupCollapsed=O("groupCollapsed");o.groupEnd=function(){j&&console.groupEnd()};let _;function O(e){return function(t,...s){if(j){const n=performance.now(),i=_?Math.round(n-_):0;_=n,console[e](`%cuserflow %c${t} %c+${i}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}const st=()=>I(()=>import("./ResourceCenterApp.js").then(e=>e.R),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]));function it(e){const s=e.version.checklist.tasks.length;return Math.max(0,s-e.taskCompletions.length)}class P{constructor(t){this.observers=new Set,this._value=t}get value(){return this._value}update(t){if(t!==this._value){this._value=t;for(const s of this.observers)s()}}observe(t){return this.observers.add(t),()=>this.observers.delete(t)}}const B=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit","livewire:navigated","livewire:navigating","livewire:update"],nt=()=>I(()=>import("./BannerApp.js"),__vite__mapDeps([32,1,2,3,4,5,6,15,12,13,14,9,10,11,8,7,16,18,19,17,20,30,21,33,34])),N="1025759",rt=import.meta.url,H=50,ot=300*1e3,W="userflowClientState",w="userflowClientSiteId";class at{constructor(){this.clientToken=null,this.externalId=null,this.signature=null,this.groupId=null,this.groupSignature=null,this._socketStatus="disconnected",this.socket=null,this.channel=null,this.logrocketAppId=null,this.debounceInactiveDisconnectTimeout=void 0,this.inBatch=!1,this.endBatchTimeout=void 0,this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=0,this.clientClock=1,this.serverClock=1,this.flowSession=null,this.flowSessionClock=0,this.checklistSession=null,this.checklistExpanded=!1,this.checklistExpandPending=!1,this.checklistSessionClock=0,this.bannerSession=null,this.resourceCenterSession=null,this.resourceCenterOpen=!1,this.resourceCenterLauncherHidden=null,this.siteSession=null,this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.embedSessions=[],this.workflowSession=null,this.notificationIdCounter=0,this.sessionStorageState=null,this.clientContext=null,this.flushUrlChangeTimeout=void 0,this.onFirstIdentifyRun=!1,this.onFirstIdentifyTimeout=void 0,this.firstIdentifyCallback=null,this.ui=null,this.debuggerUI=null,this.debuggerMountInProgress=!1,this.unackedTasks=new Set,this.clientConditions=new Map,this.trackers=new Map,this.conditionWaitTimers=new Map,this.listeners=new Map,this.targetEnv=null,this.idempotencyKeysSeen=new Set,this.testUserIdentified=!1,this.cspIssueReported=!1,this.uiDisabled=!1,this.audio=null,this.audioReady=!1,this.pageTrackingDisabled=!1,this.refCounter=1,this.implicitTracking=null,this.initialMessagesQueue=[],this.onBuilderMessage=t=>(this.handleBuilderMessage(t),!1),this.handleBuilderMessage=async t=>{o(`builder ${t.kind} message received`,t);const s="idempotencyKey"in t&&typeof t.idempotencyKey=="string"?t.idempotencyKey:null;if(s&&this.idempotencyKeysSeen.has(s))return;const n=()=>{s&&this.idempotencyKeysSeen.add(s)};switch(t.kind){case"userflow:selectElement":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:t.elementType}}));return}case"userflow:selectElementCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,elementSelection:null}));return}case"userflow:startFlowWithToken":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:null,testStartConditionToken:void 0})),d.setItem("previewFlowId",t.flowId),t.testUser?this.identifyTestUser(t.testUser):this.resetTestUser(),t.testStartCondition?this.setSessionStorageState(i=>({...i,activeApp:"startConditionTesting",testStartConditionToken:t.token})):this.onceIdentified(()=>{if(this.startFlowWithToken(t.token),t.isResourceCenter){const i=()=>{const r=this.resourceCenterSession;r&&r.draftMode&&r.flow.id===t.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",i))};this.on("resourceCenterChanged",i),i()}});return}case"userflow:testTracker":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0})),t.testUser?this.identifyTestUser(t.testUser):this.resetTestUser(),this.setSessionStorageState(i=>({...i,activeApp:"trackerTesting",trackerTesting:{trackerName:t.trackerName,token:t.token,events:0}}));return}case"userflow:testTrackerCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,trackerTesting:null}));return}case"userflow:startSmartFlow":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startSmartFlowAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"smartFlowRecording",smartFlowRecording:{sessionId:t.sessionId,isRecording:!0,startUrl:t.startUrl||null}}));return}case"userflow:smartFlowCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}case"userflow:smartFlowStartOverAck":return;case"userflow:smartFlowComplete":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout(()=>this.flushUrlChange(),H))},this.onUserActivity=()=>this.ensureConnected(),this.mountSitePage=async(t,s)=>{d.setItem(w,s),o("mounting site page"),this.setResourceCenterLauncherHidden(!0);try{const{SitePage:n}=await I(async()=>{const{SitePage:r}=await import("./SitePage.js");return{SitePage:r}},__vite__mapDeps([35,1,2,3,4,5,6,18,19,36,37,38,39,40,41,42,43,44,45,27,15,12,13,14,9,10,11,25,26,20,8,46,28,47,48,33,34]));new n(this,t).mount(),o("site page mounted")}catch(n){console.error("Userflow: Failed to mount site page",n)}},this.remountIfNecessary=()=>{!this.ui?.container||document.contains(this.ui.container)||(o("remounting UI because container was missing"),this.remount())},o("constructor, build="+N),q(this.onUrlChange),this.setTargetEnv(new te),this.checkTestUserAtBoot(),this.toggleUI(),this.checkDebuggerSession();for(const t of B)document.addEventListener(t,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){o("destroy"),this.reset(),F(this.onUrlChange),this.destroyTargetEnv();for(const t of B)document.removeEventListener(t,this.remountIfNecessary)}setTargetEnv(t){this.destroyTargetEnv(),this.targetEnv=t,t.onBuilderMessage(this.onBuilderMessage)}destroyTargetEnv(){this.targetEnv&&(this.targetEnv.destroy(),this.targetEnv=null)}getTargetEnv(){if(!this.targetEnv)throw new h("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(t){const s=t(this.getSessionStorageState());d.setItem(W,JSON.stringify(s)),this.sessionStorageState=s,this.toggleUI()}getSessionStorageState(){let t=this.sessionStorageState;if(!t){const s=d.getItem(W);if(s)try{t=JSON.parse(s)}catch(n){console.error("Userflow.js: Parse ElementSelectionState error:",n)}t||(t={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null}),this.sessionStorageState=t}return t}checkTestUserAtBoot(){const t=this.getSessionStorageState().testUser;t&&(o("checkTestUserAtBoot identifying test user"),this.identifyTestUser(t))}async identifyTestUser(t){this.setSessionStorageState(i=>({...i,testUser:t})),this.reset(),this.init(t.clientToken),this.testUserIdentified=!0,this.externalId=t.id;const s=[this.identify(t.id,{name:t.name,email:t.email,signed_up_at:{set_once:new Date().toISOString(),data_type:"datetime"}},{signature:t.signature})],{group:n}=t;n&&(this.groupId=n.id,s.push(this.group(n.id,{name:n.name},{signature:n.signature}))),await Promise.all(s)}resetTestUser(){this.setSessionStorageState(t=>({...t,testUser:null}))}init(t){if(o("init",t),!t)throw new h("userflow.init() was called but missing Userflow.js Token");if(this.clientToken!==t){if(this.testUserIdentified){o("init() ignoring new token since a test user has been identified");return}this.clientToken&&(o("init() resetting due to new client token"),this.reset()),this.clientToken=t,this.emit("private:initialised")}}ensureInit(){if(!this.clientToken)throw new h("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new h("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new h("You must call userflow.group() first");return this.groupId}ensureConnected(){if(!this.clientToken||!this.externalId||(this.debounceInactiveDisconnect(),this.socket))return;this._socketStatus="connecting",o("connecting to socket");const t=/^ct_eu\d+_.+$/.test(this.clientToken)?"e.eu.":"e.";let s=f.serverEndpoint||t+"userflow.com";new URL(rt).hostname==="js.getuserflow.com"&&s==="e.userflow.com"&&(s="e.getuserflow.com");const n="wss://"+s+"/end-users/"+this.clientToken+"/socket";this.socket=new J(n,{reconnectAfterMs:i=>[100,500,1e3,5e3][i-1]||1e4,timeout:20*1e3}),this.socket.connect(),this.socket.onOpen(()=>{o("socket opened")}),this.socket.onClose(()=>{this.emit("private:disconnect")}),this.socket.onError(i=>{console.log("Userflow.js socket error",i),this.reportCspIssue()}),this.channel=this.socket.channel(`end_users:${this.externalId}`,()=>this.makeChannelJoinPayload()),this.channel.join().receive("ok",i=>{typeof this.featureFlags>"u"&&this.clearInitialMessagesQueue(i.featureFlags),this.logrocketAppId=i.logrocketAppId,this.featureFlags=new Set(i.featureFlags),o("channel joined"),this._socketStatus!=="connected"&&(this._socketStatus="connected"),this.featureFlagEnabled("cff_implicit_events")===!0&&!this.implicitTracking&&this.startImplicitTracking(),!this.featureFlagEnabled("cff_implicit_events")&&this.implicitTracking&&(this.implicitTracking.stop(),this.implicitTracking=null)}).receive("error",i=>{["company_closed","invalid_client_token","invalid_user_external_id","incorrect_user_signature","rate_limit_exceeded","user_signature_required"].includes(i.code)?(console.error(`Userflow.js resetting due to: [${i.code}] ${i.message}`),this.reset(),this.clientToken=null):i.code==="invalid_protocol_version"?(console.error(`Userflow.js destroying due to: [${i.code}] ${i.message}`),this.destroy()):console.log("Userflow.js channel join error",i)}),this.channel.on("server_message",i=>this.handleServerMessage(i)),this.channel.on("server_error",i=>{console.log(`Userflow.js server error (${i.code}): ${i.message}`+(i.details&&i.details.length>0?`
4
+ Error message: `+t.message)}}return e}let $="";try{$=localStorage.getItem("debug")||""}catch{}const j=$.split(",").some(e=>e==="*"||e.startsWith("userflow:*")),o=O("log");o.group=O("group");o.groupCollapsed=O("groupCollapsed");o.groupEnd=function(){j&&console.groupEnd()};let _;function O(e){return function(t,...s){if(j){const n=performance.now(),i=_?Math.round(n-_):0;_=n,console[e](`%cuserflow %c${t} %c+${i}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}const st=()=>I(()=>import("./ResourceCenterApp.js").then(e=>e.R),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]));function it(e){const s=e.version.checklist.tasks.length;return Math.max(0,s-e.taskCompletions.length)}class P{constructor(t){this.observers=new Set,this._value=t}get value(){return this._value}update(t){if(t!==this._value){this._value=t;for(const s of this.observers)s()}}observe(t){return this.observers.add(t),()=>this.observers.delete(t)}}const B=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit","livewire:navigated","livewire:navigating","livewire:update"],nt=()=>I(()=>import("./BannerApp.js"),__vite__mapDeps([32,1,2,3,4,5,6,15,12,13,14,9,10,11,8,7,16,18,19,17,20,30,21,33,34])),N="1025842",rt=import.meta.url,H=50,ot=300*1e3,W="userflowClientState",w="userflowClientSiteId";class at{constructor(){this.clientToken=null,this.externalId=null,this.signature=null,this.groupId=null,this.groupSignature=null,this._socketStatus="disconnected",this.socket=null,this.channel=null,this.logrocketAppId=null,this.debounceInactiveDisconnectTimeout=void 0,this.inBatch=!1,this.endBatchTimeout=void 0,this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=0,this.clientClock=1,this.serverClock=1,this.flowSession=null,this.flowSessionClock=0,this.checklistSession=null,this.checklistExpanded=!1,this.checklistExpandPending=!1,this.checklistSessionClock=0,this.bannerSession=null,this.resourceCenterSession=null,this.resourceCenterOpen=!1,this.resourceCenterLauncherHidden=null,this.siteSession=null,this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.embedSessions=[],this.workflowSession=null,this.notificationIdCounter=0,this.sessionStorageState=null,this.clientContext=null,this.flushUrlChangeTimeout=void 0,this.onFirstIdentifyRun=!1,this.onFirstIdentifyTimeout=void 0,this.firstIdentifyCallback=null,this.ui=null,this.debuggerUI=null,this.debuggerMountInProgress=!1,this.unackedTasks=new Set,this.clientConditions=new Map,this.trackers=new Map,this.conditionWaitTimers=new Map,this.listeners=new Map,this.targetEnv=null,this.idempotencyKeysSeen=new Set,this.testUserIdentified=!1,this.cspIssueReported=!1,this.uiDisabled=!1,this.audio=null,this.audioReady=!1,this.pageTrackingDisabled=!1,this.refCounter=1,this.implicitTracking=null,this.initialMessagesQueue=[],this.onBuilderMessage=t=>(this.handleBuilderMessage(t),!1),this.handleBuilderMessage=async t=>{o(`builder ${t.kind} message received`,t);const s="idempotencyKey"in t&&typeof t.idempotencyKey=="string"?t.idempotencyKey:null;if(s&&this.idempotencyKeysSeen.has(s))return;const n=()=>{s&&this.idempotencyKeysSeen.add(s)};switch(t.kind){case"userflow:selectElement":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:t.elementType}}));return}case"userflow:selectElementCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,elementSelection:null}));return}case"userflow:startFlowWithToken":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:null,testStartConditionToken:void 0})),d.setItem("previewFlowId",t.flowId),t.testUser?this.identifyTestUser(t.testUser):this.resetTestUser(),t.testStartCondition?this.setSessionStorageState(i=>({...i,activeApp:"startConditionTesting",testStartConditionToken:t.token})):this.onceIdentified(()=>{if(this.startFlowWithToken(t.token),t.isResourceCenter){const i=()=>{const r=this.resourceCenterSession;r&&r.draftMode&&r.flow.id===t.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",i))};this.on("resourceCenterChanged",i),i()}});return}case"userflow:testTracker":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0})),t.testUser?this.identifyTestUser(t.testUser):this.resetTestUser(),this.setSessionStorageState(i=>({...i,activeApp:"trackerTesting",trackerTesting:{trackerName:t.trackerName,token:t.token,events:0}}));return}case"userflow:testTrackerCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,trackerTesting:null}));return}case"userflow:startSmartFlow":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startSmartFlowAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"smartFlowRecording",smartFlowRecording:{sessionId:t.sessionId,isRecording:!0,startUrl:t.startUrl||null}}));return}case"userflow:smartFlowCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}case"userflow:smartFlowStartOverAck":return;case"userflow:smartFlowComplete":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout(()=>this.flushUrlChange(),H))},this.onUserActivity=()=>this.ensureConnected(),this.mountSitePage=async(t,s)=>{d.setItem(w,s),o("mounting site page"),this.setResourceCenterLauncherHidden(!0);try{const{SitePage:n}=await I(async()=>{const{SitePage:r}=await import("./SitePage.js");return{SitePage:r}},__vite__mapDeps([35,1,2,3,4,5,6,18,19,36,37,38,39,40,41,42,43,44,45,27,15,12,13,14,9,10,11,25,26,20,8,46,28,47,48,33,34]));new n(this,t).mount(),o("site page mounted")}catch(n){console.error("Userflow: Failed to mount site page",n)}},this.remountIfNecessary=()=>{!this.ui?.container||document.contains(this.ui.container)||(o("remounting UI because container was missing"),this.remount())},o("constructor, build="+N),q(this.onUrlChange),this.setTargetEnv(new te),this.checkTestUserAtBoot(),this.toggleUI(),this.checkDebuggerSession();for(const t of B)document.addEventListener(t,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){o("destroy"),this.reset(),F(this.onUrlChange),this.destroyTargetEnv();for(const t of B)document.removeEventListener(t,this.remountIfNecessary)}setTargetEnv(t){this.destroyTargetEnv(),this.targetEnv=t,t.onBuilderMessage(this.onBuilderMessage)}destroyTargetEnv(){this.targetEnv&&(this.targetEnv.destroy(),this.targetEnv=null)}getTargetEnv(){if(!this.targetEnv)throw new h("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(t){const s=t(this.getSessionStorageState());d.setItem(W,JSON.stringify(s)),this.sessionStorageState=s,this.toggleUI()}getSessionStorageState(){let t=this.sessionStorageState;if(!t){const s=d.getItem(W);if(s)try{t=JSON.parse(s)}catch(n){console.error("Userflow.js: Parse ElementSelectionState error:",n)}t||(t={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null}),this.sessionStorageState=t}return t}checkTestUserAtBoot(){const t=this.getSessionStorageState().testUser;t&&(o("checkTestUserAtBoot identifying test user"),this.identifyTestUser(t))}async identifyTestUser(t){this.setSessionStorageState(i=>({...i,testUser:t})),this.reset(),this.init(t.clientToken),this.testUserIdentified=!0,this.externalId=t.id;const s=[this.identify(t.id,{name:t.name,email:t.email,signed_up_at:{set_once:new Date().toISOString(),data_type:"datetime"}},{signature:t.signature})],{group:n}=t;n&&(this.groupId=n.id,s.push(this.group(n.id,{name:n.name},{signature:n.signature}))),await Promise.all(s)}resetTestUser(){this.setSessionStorageState(t=>({...t,testUser:null}))}init(t){if(o("init",t),!t)throw new h("userflow.init() was called but missing Userflow.js Token");if(this.clientToken!==t){if(this.testUserIdentified){o("init() ignoring new token since a test user has been identified");return}this.clientToken&&(o("init() resetting due to new client token"),this.reset()),this.clientToken=t,this.emit("private:initialised")}}ensureInit(){if(!this.clientToken)throw new h("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new h("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new h("You must call userflow.group() first");return this.groupId}ensureConnected(){if(!this.clientToken||!this.externalId||(this.debounceInactiveDisconnect(),this.socket))return;this._socketStatus="connecting",o("connecting to socket");const t=/^ct_eu\d+_.+$/.test(this.clientToken)?"e.eu.":"e.";let s=f.serverEndpoint||t+"userflow.com";new URL(rt).hostname==="js.getuserflow.com"&&s==="e.userflow.com"&&(s="e.getuserflow.com");const n="wss://"+s+"/end-users/"+this.clientToken+"/socket";this.socket=new J(n,{reconnectAfterMs:i=>[100,500,1e3,5e3][i-1]||1e4,timeout:20*1e3}),this.socket.connect(),this.socket.onOpen(()=>{o("socket opened")}),this.socket.onClose(()=>{this.emit("private:disconnect")}),this.socket.onError(i=>{console.log("Userflow.js socket error",i),this.reportCspIssue()}),this.channel=this.socket.channel(`end_users:${this.externalId}`,()=>this.makeChannelJoinPayload()),this.channel.join().receive("ok",i=>{typeof this.featureFlags>"u"&&this.clearInitialMessagesQueue(i.featureFlags),this.logrocketAppId=i.logrocketAppId,this.featureFlags=new Set(i.featureFlags),o("channel joined"),this._socketStatus!=="connected"&&(this._socketStatus="connected"),this.featureFlagEnabled("cff_implicit_events")===!0&&!this.implicitTracking&&this.startImplicitTracking(),!this.featureFlagEnabled("cff_implicit_events")&&this.implicitTracking&&(this.implicitTracking.stop(),this.implicitTracking=null)}).receive("error",i=>{["company_closed","invalid_client_token","invalid_user_external_id","incorrect_user_signature","rate_limit_exceeded","user_signature_required"].includes(i.code)?(console.error(`Userflow.js resetting due to: [${i.code}] ${i.message}`),this.reset(),this.clientToken=null):i.code==="invalid_protocol_version"?(console.error(`Userflow.js destroying due to: [${i.code}] ${i.message}`),this.destroy()):console.log("Userflow.js channel join error",i)}),this.channel.on("server_message",i=>this.handleServerMessage(i)),this.channel.on("server_error",i=>{console.log(`Userflow.js server error (${i.code}): ${i.message}`+(i.details&&i.details.length>0?`
5
5
  Details:
6
6
  `+i.details.map(r=>(r.path?`${r.path}: `:"")+r.message):""))})}async startImplicitTracking(){await I(()=>import("./implicit-tracking.js"),__vite__mapDeps([49,11,2,34,33])).then(t=>{this.implicitTracking=new t.ImplicitTracking(this),this.implicitTracking.start()}).catch(t=>o(`Implicit tracking failed to load ${t}`))}makeChannelJoinPayload(){let t;d.getItem(w)&&(t=new URL(m()).searchParams.get("announcement_id")||void 0);const n=this.buildClientContext();this.clientContext=n;const i={protocolVersion:2,userflowClientBuild:N,signature:this.signature,groupExternalId:this.groupId,groupSignature:this.groupSignature,flowSessionId:this.flowSession?.id||null,checklistSessionId:this.checklistSession?.id||null,bannerSessionId:this.bannerSession?.id||null,resourceCenterSessionId:this.resourceCenterSession?.id||null,siteSessionId:this.siteSession?.id||null,launchers:this.launcherSessions.map(r=>({flowId:r.flow.id})),trackers:Array.from(this.trackers.values()).map(r=>({flowId:r.tracker.flowId})),hasDraftSession:this.hasDraftSession(),clientConditions:Array.from(this.clientConditions.values()).map(r=>({conditionId:r.condition.id,isTrue:r.isTrue})),previewFlowId:d.getItem("previewFlowId"),announcementPreviewId:t,clientContext:n};return o("channel join payload",i),i}disconnect(){window.clearTimeout(this.debounceInactiveDisconnectTimeout),this.socket&&this.socket.disconnect(),this._socketStatus="disconnected",this.socket=null,this.channel=null}debounceInactiveDisconnect(){window.clearTimeout(this.debounceInactiveDisconnectTimeout),this.debounceInactiveDisconnectTimeout=window.setTimeout(()=>{if(this.hasDraftSession()||this.assistantMessageInProgress){this.debounceInactiveDisconnect();return}o("disconnecting from socket due to inactivity"),this.disconnect()},ot)}hasDraftSession(){return!!this.flowSession?.draftMode||!!this.checklistSession?.draftMode||!!this.bannerSession?.draftMode||!!this.resourceCenterSession?.draftMode||this.launcherSessions.some(t=>t.draftMode)}async send(t,{batch:s,endBatch:n,handlesRejection:i}={}){return(!this.inBatch||!["ToggleClientCondition","UpdateClientContext"].includes(t.kind))&&this.checkPushRateLimit(),this.ensureConnected(),s&&!this.inBatch&&(this.inBatch=!0,this.sendRaw({kind:"BeginBatch"})),this.inBatch&&(window.clearTimeout(this.endBatchTimeout),n?this.endBatch():this.endBatchTimeout=window.setTimeout(()=>{this.endBatch()},H)),this.sendRaw(t,{handlesRejection:i})}clearInitialMessagesQueue(t){if(this.initialMessagesQueue.length===0)return;const s=t.includes("cff_disable_page_views")===!0,n=t.includes("cff_implicit_events")===!1;for(const i of this.initialMessagesQueue){const{message:r,handlesRejection:a,resolve:l,reject:u}=i;if(n&&r.kind==="TrackRawEvent"){l("skipped due to disabled implicit events");continue}if(s&&(r.kind==="TrackEvent"&&r.name==="page_viewed"||r.kind==="TrackRawEvent"&&r.name==="page_viewed")){l("skipped due to disabled page views tracking");continue}this._sendToChannel(r,l,u,{handlesRejection:a})}this.initialMessagesQueue=[]}async sendRaw(t,{handlesRejection:s}={}){return typeof this.featureFlags>"u"?new Promise((n,i)=>{this.initialMessagesQueue.push({message:t,resolve:n,reject:i,handlesRejection:s})}):new Promise((n,i)=>{this._sendToChannel(t,n,i,{handlesRejection:s})})}_sendToChannel(t,s,n,{handlesRejection:i}={}){if(!this.channel){const u=`Userflow.js: send() should not be called if channel is not set. Message kind=${t.kind}`;if(i)throw Error(u);console.log(u,`
7
7
  Client message:`,t);return}o(`push ${t.kind} message`,t);const r=this.clientClock,a=()=>{this.serverClock=r,this.channel?.off("phx_error",l)},l=this.channel.on("phx_error",u=>{a();const c=`Userflow.js send ${t.kind} got phx_error`;this._socketStatus==="connected"&&console.log(c,`
@@ -1,2 +1,2 @@
1
- (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]="1bcd03f6-0d22-4524-98d9-76d629861238",e._sentryDebugIdIdentifier="sentry-dbid-1bcd03f6-0d22-4524-98d9-76d629861238")}catch{}})();var p=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};p.SENTRY_RELEASE={id:"fccbb5a018c33b0411c01f01c83109241151a9ec"};var y=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function w(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i,c;function j(){if(c)return i;c=1;var e=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;function b(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function g(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var d={},r=0;r<10;r++)d["_"+String.fromCharCode(r)]=r;var a=Object.getOwnPropertyNames(d).map(function(n){return d[n]});if(a.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(n){o[n]=n}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return i=g()?Object.assign:function(t,d){for(var r,a=b(t),o,n=1;n<arguments.length;n++){r=Object(arguments[n]);for(var l in r)s.call(r,l)&&(a[l]=r[l]);if(e){o=e(r);for(var f=0;f<o.length;f++)u.call(r,o[f])&&(a[o[f]]=r[o[f]])}}return a},i}export{y as c,w as g,j as r};
1
+ (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]="1a684fe7-9d3c-4f2f-9d8b-7112d7a5c9f8",e._sentryDebugIdIdentifier="sentry-dbid-1a684fe7-9d3c-4f2f-9d8b-7112d7a5c9f8")}catch{}})();var p=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};p.SENTRY_RELEASE={id:"4bacebef3711f5bec1238b899d4080c2ac584853"};var y=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function w(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i,c;function j(){if(c)return i;c=1;var e=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;function b(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function g(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var d={},r=0;r<10;r++)d["_"+String.fromCharCode(r)]=r;var a=Object.getOwnPropertyNames(d).map(function(n){return d[n]});if(a.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(n){o[n]=n}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return i=g()?Object.assign:function(t,d){for(var r,a=b(t),o,n=1;n<arguments.length;n++){r=Object(arguments[n]);for(var l in r)s.call(r,l)&&(a[l]=r[l]);if(e){o=e(r);for(var f=0;f<o.length;f++)u.call(r,o[f])&&(a[o[f]]=r[o[f]])}}return a},i}export{y as c,w as g,j as r};
2
2
  //# sourceMappingURL=vendor.object-assign.js.map