1 line
2.8 KiB
JavaScript
1 line
2.8 KiB
JavaScript
const _="modulepreload",A=function(e){return"https://pressekonto.test/build/"+e},h={},P=function(r,n,f){let c=Promise.resolve();if(n&&n.length>0){let o=function(s){return Promise.all(s.map(l=>Promise.resolve(l).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const t=document.querySelector("meta[property=csp-nonce]"),m=(t==null?void 0:t.nonce)||(t==null?void 0:t.getAttribute("nonce"));c=o(n.map(s=>{if(s=A(s),s in h)return;h[s]=!0;const l=s.endsWith(".css"),d=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${d}`))return;const a=document.createElement("link");if(a.rel=l?"stylesheet":_,l||(a.as="script"),a.crossOrigin="",a.href=s,m&&a.setAttribute("nonce",m),document.head.appendChild(a),l)return new Promise((b,S)=>{a.addEventListener("load",b),a.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${s}`)))})}))}function u(o){const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=o,window.dispatchEvent(t),!t.defaultPrevented)throw o}return c.then(o=>{for(const t of o||[])t.status==="rejected"&&u(t.reason);return r().catch(u)})},i=(()=>{const e=document.querySelector('meta[name="pk-error-reporting"]');try{return e?JSON.parse(e.content):null}catch{return null}})(),R=["src","pr","ref","page","q","tab","edition"],k=new RegExp("(?<=\\/)[A-Za-z0-9_-]{32,}(?=\\/|$)","g"),g=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi;function p(e){try{const r=new URL(e,window.location.origin);r.pathname=r.pathname.replace(k,"[Filtered]");for(const n of[...r.searchParams.keys()])!R.includes(n)&&!n.startsWith("utm_")&&r.searchParams.set(n,"[Filtered]");return r.hash="",r.toString().replace(g,"[email]")}catch{return"[Filtered]"}}let E=null;function q(){return E??(E=P(()=>import("./error-reporting-sdk-Ca8cRdCE.js"),[]).then(e=>(e.init({dsn:i.dsn,release:i.release||void 0,environment:i.environment,sampleRate:i.sampleRate??1,sendDefaultPii:!1,integrations:r=>r.filter(n=>!["GlobalHandlers","Breadcrumbs","BrowserSession","BrowserApiErrors"].includes(n.name)),ignoreErrors:["ResizeObserver loop","Script error.","AbortError"],denyUrls:[/^chrome-extension:\/\//,/^moz-extension:\/\//,/^safari-(web-)?extension:\/\//],beforeSend(r){var n,f,c,u;(n=r.request)!=null&&n.url&&(r.request.url=p(r.request.url)),(c=(f=r.request)==null?void 0:f.headers)!=null&&c.Referer&&(r.request.headers.Referer=p(r.request.headers.Referer));for(const o of((u=r.exception)==null?void 0:u.values)??[])o.value&&(o.value=o.value.replace(g,"[email]"));return r}}),i.userId&&e.setUser({id:String(i.userId)}),e.setTag("area",i.area),e))),E}function w(e){q().then(r=>r.captureException(e)).catch(()=>{})}i!=null&&i.dsn&&(window.addEventListener("error",e=>{e.error&&w(e.error)}),window.addEventListener("unhandledrejection",e=>{w(e.reason instanceof Error?e.reason:new Error(String(e.reason)))}));
|