PageSourceSearch

https://www.mobatrainer.com/_next/static/chunks/177.d62cf20a66ed28a3.js

js mobatrainer.com collected 2026-10-05 05:25:34 UTC 10,316 bytes, 3 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[177],{8177:(e,t,i)=>{i.r(t),i.d(t,{IdentifyComponent:()=>c,OpenPanel:()=>o,OpenPanelBase:()=>s,OpenPanelComponent:()=>u,SetGlobalPropertiesComponent:()=>h,getInitSnippet:()=>a,useOpenPanel:()=>f});var n=class{constructor(e){this.baseUrl=e.baseUrl,this.headers={"Content-Type":"application/json",...e.defaultHeaders},this.maxRetries=e.maxRetries??3,this.initialRetryDelay=e.initialRetryDelay??500}async resolveHeaders(){let e={};for(let[t,i]of Object.entries(this.headers)){let n=await i;null!==n&&(e[t]=n)}return e}addHeader(e,t){this.headers[e]=t}async post(e,t,i,n){try{let n=await fetch(e,{method:"POST",headers:await this.resolveHeaders(),body:t?JSON.stringify(t??{}):void 0,keepalive:!0,...i});if(401===n.status)return null;if(200!==n.status&&202!==n.status)throw Error(`HTTP error! status: ${n.status}`);let s=await n.text();return s?JSON.parse(s):null}catch(s){if(n<this.maxRetries){let s=this.initialRetryDelay*2**n;return await new Promise(e=>setTimeout(e,s)),this.post(e,t,i,n+1)}return console.error("Max retries reached:",s),null}}async fetch(e,t,i={}){let n=`${this.baseUrl}${e}`;return this.post(n,t,i,0)}},s=class{constructor(e){this.groups=[],this.queue=[],this.options=e;let t={"openpanel-client-id":e.clientId};e.clientSecret&&(t["openpanel-client-secret"]=e.clientSecret),t["openpanel-sdk-name"]=e.sdk||"node",t["openpanel-sdk-version"]=e.sdkVersion||"1.3.1",this.api=new n({baseUrl:e.apiUrl||"https://api.openpanel.dev",defaultHeaders:t})}init(){}ready(){this.options.disabled=!1,this.options.waitForProfile=!1,this.flush()}shouldQueue(e){return!!(this.options.disabled||this.options.waitForProfile&&!this.profileId||"replay"===e.type&&!this.sessionId)}addQueue(e){"track"===e.type&&(e.payload.properties={...e.payload.properties??{},__timestamp:new Date().toISOString()}),this.queue.push(e)}async send(e){if(this.options.filter&&!this.options.filter(e))return Promise.resolve();if(this.shouldQueue(e))return this.addQueue(e),Promise.resolve();let t=await this.api.fetch("/track",e,{keepalive:"replay"!==e.type});this.deviceId=t?.deviceId;let i=!!this.sessionId;return this.sessionId=t?.sessionId,!i&&this.sessionId&&this.flush(),t}setGlobalProperties(e){this.global={...this.global,...e}}track(e,t){this.log("track event",e,t);let{groups:i,profileId:n,...s}=t??{},r=[...new Set([...this.groups,...i??[]])];return this.send({type:"track",payload:{name:e,profileId:n??this.profileId,groups:r.length>0?r:void 0,properties:{...this.global??{},...s}}})}identify(e){if(this.log("identify user",e),e.profileId&&(this.profileId=e.profileId,this.flush()),e.profileId&&Object.keys(e).length>1)return this.send({type:"identify",payload:{...e,properties:{...this.global,...e.properties}}})}upsertGroup(e){return this.log("upsert group",e),this.send({type:"group",payload:e})}setGroup(e){return this.log("set group",e),this.groups.includes(e)||(this.groups=[...this.groups,e]),this.send({type:"assign_group",payload:{groupIds:[e],profileId:this.profileId}})}setGroups(e){return this.log("set groups",e),this.groups=[...new Set([...this.groups,...e])],this.send({type:"assign_group",payload:{groupIds:e,profileId:this.profileId}})}alias(e){}increment(e){return this.send({type:"increment",payload:e})}decrement(e){return this.send({type:"decrement",payload:e})}revenue(e,t){let i=t?.deviceId;return delete t?.deviceId,this.track("revenue",{...t??{},...i?{__deviceId:i}:{},__revenue:e})}getDeviceId(){return this.deviceId??""}getSessionId(){return this.sessionId??""}fetchDeviceId(){return Promise.resolve(this.deviceId??"")}clear(){this.profileId=void 0,this.groups=[],this.deviceId=void 0,this.sessionId=void 0}buildFlushPayload(e){if("replay"===e.type)return e.payload;if("track"===e.type){let t="groups"in e.payload?e.payload.groups??[]:[],i=[...new Set([...this.groups,...t])];return{...e.payload,profileId:e.payload.profileId??this.profileId,groups:i.length>0?i:void 0}}return"identify"===e.type||"increment"===e.type||"decrement"===e.type?{...e.payload,profileId:e.payload.profileId??this.profileId}:"assign_group"===e.type?{...e.payload,profileId:e.payload.profileId??this.profileId}:e.payload}flush(){let e=[];for(let t of this.queue){if(this.shouldQueue(t)){e.push(t);continue}let i=this.buildFlushPayload(t);this.send({...t,payload:i})}this.queue=e}log(...e){this.options.debug&&console.log("[OpenPanel.dev]",...e)}},r="u">typeof document?document.currentScript:null,o=class extends s{constructor(e){if(super({s
1dk:"web",sdkVersion:"1.4.1",...e}),this.options=e,this.lastPath="",this.pendingRevenues=[],!this.isServer()){try{let e=sessionStorage.getItem("openpanel-pending-revenues");if(e){let t=JSON.parse(e);Array.isArray(t)&&(this.pendingRevenues=t)}}catch{this.pendingRevenues=[]}this.setGlobalProperties({__referrer:document.referrer}),this.options.trackScreenViews&&(this.trackScreenViews(),setTimeout(()=>this.screenView(),0)),this.options.trackOutgoingLinks&&this.trackOutgoingLinks(),this.options.trackAttributes&&this.trackAttributes(),this.options.sessionReplay?.enabled&&Math.random()<(this.options.sessionReplay.sampleRate??1)&&this.loadReplayModule().then(e=>{e&&e.startReplayRecorder(this.options.sessionReplay,e=>{this.send({type:"replay",payload:{...e}})})})}}async loadReplayModule(){try{if("u">typeof __OPENPANEL_REPLAY_URL__){let e=this.options.sessionReplay?.scriptUrl||r?.src?.replace(".js","-replay.js")||"https://openpanel.dev/op1-replay.js";return window.__openpanel_replay?window.__openpanel_replay:new Promise(t=>{let i=document.createElement("script");i.src=e,i.onload=()=>{t(window.__openpanel_replay??null)},i.onerror=()=>{console.warn("[OpenPanel] Failed to load replay script from",e),t(null)},document.head.appendChild(i)})}return await Promise.all([i.e(390),i.e(513),i.e(930)]).then(i.bind(i,1930))}catch(e){return console.warn("[OpenPanel] Failed to load replay module",e),null}}debounce(e,t){clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(e,t)}isServer(){return typeof document>"u"}trackOutgoingLinks(){this.isServer()||document.addEventListener("click",e=>{let t=e.target,i=t.closest("a");if(i&&t){let e=i.getAttribute("href");if(e?.startsWith("http"))try{let n=new URL(e),s=window.location.hostname;n.hostname!==s&&super.track("link_out",{href:e,text:i.innerText||i.getAttribute("title")||t.getAttribute("alt")||t.getAttribute("title")})}catch{}}})}trackScreenViews(){if(this.isServer())return;let e=history.pushState;history.pushState=function(...t){let i=e.apply(this,t);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),i};let t=history.replaceState;history.replaceState=function(...e){let i=t.apply(this,e);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),i},window.addEventListener("popstate",()=>{window.dispatchEvent(new Event("locationchange"))});let i=()=>this.debounce(()=>this.screenView(),50);this.options.trackHashChanges?window.addEventListener("hashchange",i):window.addEventListener("locationchange",i)}trackAttributes(){this.isServer()||document.addEventListener("click",e=>{let t=e.target,i=t.closest("button"),n=t.closest("a"),s=i?.getAttribute("data-track")?i:n?.getAttribute("data-track")?n:null;if(s){let e={};for(let t of s.attributes)t.name.startsWith("data-")&&"data-track"!==t.name&&(e[t.name.replace(/^data-/,"").replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace("-","").replace("_",""))]=t.value);let t=s.getAttribute("data-track");t&&super.track(t,e)}})}track(e,t){return super.track(e,{...t,__path:this.lastPath})}screenView(e,t){let i,n;this.isServer()||("string"==typeof e?(i=e,n=t):(i=window.location.href,n=e),this.lastPath!==i&&(this.lastPath=i,super.track("screen_view",{...n??{},__path:i,__title:document.title})))}async flushRevenue(){let e=this.pendingRevenues.map(e=>super.revenue(e.amount,e.properties));await Promise.all(e),this.clearRevenue()}clearRevenue(){if(this.pendingRevenues=[],!this.isServer())try{sessionStorage.removeItem("openpanel-pending-revenues")}catch{}}pendingRevenue(e,t){if(this.pendingRevenues.push({amount:e,properties:t}),!this.isServer())try{sessionStorage.setItem("openpanel-pending-revenues",JSON.stringify(this.pendingRevenues))}catch{}}};function a(){return'window.op=window.op||function(){var n=[];return new Proxy(function(){arguments.length&&n.push([].slice.call(arguments))},{get:function(t,r){return"q"===r?n:function(){n.push([r].concat([].slice.call(arguments)))}} ,has:function(t,r){return"q"===r}}) }();'}var l=i(3352),p=i(758),d=e=>"object"==typeof e&&null!=e?`{${Object.entries(e).map(([e,t])=>"filter"===e?`"${e}":${t}`:`"${e}":${JSON.stringify(t)}`).join(",")}}`:JSON.stringify(e);function u({profileId:e,cdnUrl:t,scriptUrl:i,globalProperties:n,strategy:s="afterInteractive",...r}){let o,u=[{name:"init",value:{...r,sdk:"nextjs",sdkVersion:"1.5.1"}}];return e&&u.push({name:"identify",value:{profileId:e}}),n&&u.push({name:"setGlobalProperties",value:n}),p.createElement(p.Fragment,null,p.createElement(l,{async:!0,defer:!0,src:(o=i||t||"https://openpanel.dev/op1.js").endsWith(".js")?`${o}?v=1.5.1`:o}),p.createElement(l,{dangerouslySetInnerHTML:{__html:`${a()}
2          ${u.map(e=>`window.op('${e.name}', ${d(e.value)});`).join(`
3`)}`},id:"openpanel-init",strategy:s}))}function c(e){return p.createElement(l,{dangerouslySetInnerHTML:{__html:`window.op('identify', ${JSON.stringify(e)});`}})}function h(e){return p.createElement(l,{dangerouslySetInnerHTML:{__html:`window.op('setGlobalProperties', ${JSON.stringify(e)});`}})}function f(){return{track:g,screenView:w,identify:v,increment:m,decrement:I,clear:E,setGlobalProperties:y,revenue:P,flushRevenue:R,clearRevenue:_,pendingRevenue:S,fetchDeviceId:k,getDeviceId:b}}function y(e){window.op?.("setGlobalProperties",e)}function g(e,t){window.op?.("track",e,t)}function w(e,t){window.op?.("screenView",e,t)}function v(e){window.op?.("identify",e)}function m(e){window.op?.("increment",e)}function I(e){window.op("decrement",e)}function k(){return window.op.fetchDeviceId()}function b(){return window.op.getDeviceId()}function _(){window.op.clearRevenue()}function S(e,t){window.op.pendingRevenue(e,t)}function P(e,t){return window.op.revenue(e,t)}function R(){return window.op.flushRevenue()}function E(){window.op?.("clear")}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.