1const CONFIG_ID="ia-error-config",MAX_EVENTS_PER_PAGE=7,NETWORK_MESSAGE=/^(?:TypeError: )?(Load failed|Failed to fetch|NetworkError|The network connection was lost|The operation was aborted|cancelled|Unable to fetch)/i,STALE_MODULE=/does not provide an export named|Importing a module script failed|Failed to load module script|specifier|spécificateur/i,LEAVING_GRACE_MS=1500;let config,sentCount=0;const alreadySent=new Set;let leaving=!1;window.addEventListener("pagehide",()=>{leaving=!0}),window.addEventListener("beforeunload",()=>{leaving=!0}),window.addEventListener("pageshow",()=>{leaving=!1});const LEAVING_INTENT_MS=1e4;let intentTimer;function leavingIntent(){leaving=!0,clearTimeout(intentTimer),intentTimer=setTimeout(()=>{document.visibilityState==="visible"&&(leaving=!1)},LEAVING_INTENT_MS)}window.addEventListener("click",event=>{if(event.defaultPrevented||event.metaKey||event.ctrlKey||event.shiftKey||event.button!==0)return;const link=event.target?.closest?.("a[href]");if(!link||link.target&&link.target!=="_self"||link.hasAttribute("download"))return;const href=link.getAttribute("href")||"";!href||href.startsWith("#")||href.startsWith("javascript:")||leavingIntent()}),window.addEventListener("submit",event=>{event.defaultPrevented||leavingIntent()});function parseDsn(dsn){try{const url=new URL(dsn),projectId=url.pathname.replace(/^\//,"");return!url.username||!projectId?null:{endpoint:`${url.origin}/api/${projectId}/envelope/?sentry_key=${url.username}&sentry_version=7`,dsn}}catch{return null}}function readConfig(){if(config!==void 0)return config;config=null;const node=document.getElementById(CONFIG_ID);if(!node)return config;try{const parsed=JSON.parse(node.textContent);if(!parsed?.dsn)return config;const target=parseDsn(parsed.dsn);if(!target||Math.random()*100>=(Number(parsed.sampleRate)||100))return config;config={...target,environment:parsed.environment||"production",release:parsed.release||""}}catch{config=null}return config}function safeExtra(extra){const out={};return Object.entries(extra||{}).forEach(([key,value])=>{const type=typeof value;type==="string"?out[key]=value.slice(0,200):(type==="number"||type==="boolean")&&(out[key]=value)}),out}let restored=!1;window.addEventListener("pageshow",event=>{event.persisted&&(restored=!0)});function pageTags(){const ua=navigator.userAgent||"",theme=window.Shopify?.theme||{},connection=navigator.connection||{};return{importmap:window.HTMLScriptElement?.supports?.("importmap")?"yes":"no",surface:location.pathname.split("/")[1]||"home",theme_id:String(theme.id||""),theme_role:String(theme.role||""),viewport:window.innerWidth>=1024?"desktop":"mobile",touch:navigator.maxTouchPoints>0?"yes":"no",webview:/FBAN|FBAV|Instagram|Line\/|TikTok|Snapchat|wv\)/.test(ua)?"yes":"no",connection:String(connection.effectiveType||"unknown"),save_data:connection.saveData?"yes":"no",online:navigator.onLine?"yes":"no",visibility:document.visibilityState,restored:restored?"yes":"no",page_age_s:String(Math.round(performance.now()/1e3)),cart_count:String(window.iaCartAPI?.cart?.item_count??""),locale:String(window.Shopify?.locale||""),country:String(window.Shopify?.country||"")}}function eventId(){return(window.crypto?.randomUUID?.()||`${Date.now()}${Math.random()}`).replace(/-/g,"").slice(0,32)}const CAPTURED="iaCaptured";export function captureError(error,context={}){if(error instanceof Error&&!error[CAPTURED])try{Object.defineProperty(error,CAPTURED,{value:!0})}catch{}if(leaving||navigator.onLine===!1||navigator.webdriver)return;const target=readConfig();if(!target||sentCount>=7)return;const name=error?.name||"Error",message=String(error?.message||error||"Unknown error").slice(0,500),tags=pageTags(),network=NETWORK_MESSAGE.test(message)||STALE_MODULE.test(message),unsupported=tags.importmap==="no"||!window.customElements||!window.IntersectionObserver||!window.ResizeObserver,level=context.level||(network||unsupported?"warning":"error"),fingerprint=context.fingerprint?[].concat(context.fingerprint):null,key=`${context.where||""}|${fingerprint?fingerprint.join("/"):""}|${name}|${message}`;if(alreadySent.has(key))return;alreadySent.add(key);const{where,level:_level,fingerprint:_fingerprint,tags:ownTags,...rest}=context,extraTags=Object.fromEntries(Object.entries(safeExtra(ownTags)).map(([k,v])=>[k,String(v)])),event={event_id:eventId(),timestamp:Date.now()/1e3,platform:"javascript",level,logger:"ia-cart",environment:target.environment,...target.release?{release:target.release}:{},exception:{values:[{type:name,value:message,stacktrace:void 0}]},tags:{...tags,...extraTags,...where?{where}:{}},...fingerprint?{fingerprint}:{},request:{url:location.origin+location.pathname,headers:{"User-Agent":navigator.userAgent}},extra:{...safeExtra(rest),...error?.status?{status:error.status}:{},...error?.stack?{stack:String(error.stack).slice(0,800)}:{}}},body=`${JSON.stringify({dsn:target.dsn,sent_at:new Date().toISOString()})} 2${JSON.stringify({type:"event"})} 3${JSON.stringify(event)} 4`,deliver=()=>{leaving||(sentCount+=1,fetch(target.endpoint,{method:"POST",headers:{"Content-Type":"application/x-sentry-envelope"},body,keepalive:!0,mode:"cors"}).catch(()=>{}))};network?setTimeout(deliver,1500):deliver()}const OURS=/\/ia-[\w.-]+\.(js|css)/;window.addEventListener("error",event=>{const target=event.target,src=target&&(target.src||target.href);if(src&&target!==window){if(OURS.test(src)&&!/\.css(\?|$)/.test(src)){const name=src.split("/").pop().split("?")[0];console.error("[ia-error-report] asset failed to load:",name),setTimeout(()=>{leaving||captureError(new Error("asset failed to load"),{where:"js:asset-failed",level:"warning",fingerprint:["js:asset-failed",name==="ia-core.js"?"ia-core.js":"module"],tags:{asset:name}})},1500)}return}const trail=`${event.filename||""} ${event.error?.stack||""}`;OURS.test(trail)&&(console.error("[ia-error-report] uncaught in our
4code:",event.message),captureError(event.error||new Error(event.message),{where:"js:uncaught",file:(event.filename||"").split("/").pop().split("?")[0],line:event.lineno||0}))},!0),window.addEventListener("unhandledrejection",event=>{const reason=event.reason;if(reason?.[CAPTURED]){event.preventDefault();return}const trail=String(reason?.stack||"");OURS.test(trail)&&(console.error("[ia-error-report] unhandled rejection in our code:",String(reason?.message||reason)),captureError(reason instanceof Error?reason:new Error(String(reason)),{where:"js:unhandled"}))}); 5//# sourceMappingURL=/cdn/shop/t/562/assets/ia-error-report.js.map?v=64826018324983570431790194874
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.